@kavachos/dashboard 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,290 @@
1
+ var G0=u=>{throw TypeError(u)};var lo=(u,c,r)=>c.has(u)||G0("Cannot "+r);var x=(u,c,r)=>(lo(u,c,"read from private field"),r?r.call(u):c.get(u)),I=(u,c,r)=>c.has(u)?G0("Cannot add the same private member more than once"):c instanceof WeakSet?c.add(u):c.set(u,r),V=(u,c,r,o)=>(lo(u,c,"write to private field"),o?o.call(u,r):c.set(u,r),r),oe=(u,c,r)=>(lo(u,c,"access private method"),r);var zc=(u,c,r,o)=>({set _(f){V(u,c,f,r)},get _(){return x(u,c,o)}});(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const y of f)if(y.type==="childList")for(const p of y.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&o(p)}).observe(document,{childList:!0,subtree:!0});function r(f){const y={};return f.integrity&&(y.integrity=f.integrity),f.referrerPolicy&&(y.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?y.credentials="include":f.crossOrigin==="anonymous"?y.credentials="omit":y.credentials="same-origin",y}function o(f){if(f.ep)return;f.ep=!0;const y=r(f);fetch(f.href,y)}})();var io={exports:{}},Zi={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var X0;function zv(){if(X0)return Zi;X0=1;var u=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function r(o,f,y){var p=null;if(y!==void 0&&(p=""+y),f.key!==void 0&&(p=""+f.key),"key"in f){y={};for(var z in f)z!=="key"&&(y[z]=f[z])}else y=f;return f=y.ref,{$$typeof:u,type:o,key:p,ref:f!==void 0?f:null,props:y}}return Zi.Fragment=c,Zi.jsx=r,Zi.jsxs=r,Zi}var K0;function Sv(){return K0||(K0=1,io.exports=zv()),io.exports}var i=Sv(),so={exports:{}},le={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Z0;function Nv(){if(Z0)return le;Z0=1;var u=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),p=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),_=Symbol.iterator;function q(g){return g===null||typeof g!="object"?null:(g=_&&g[_]||g["@@iterator"],typeof g=="function"?g:null)}var X={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,B={};function L(g,U,Z){this.props=g,this.context=U,this.refs=B,this.updater=Z||X}L.prototype.isReactComponent={},L.prototype.setState=function(g,U){if(typeof g!="object"&&typeof g!="function"&&g!=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,g,U,"setState")},L.prototype.forceUpdate=function(g){this.updater.enqueueForceUpdate(this,g,"forceUpdate")};function Q(){}Q.prototype=L.prototype;function J(g,U,Z){this.props=g,this.context=U,this.refs=B,this.updater=Z||X}var w=J.prototype=new Q;w.constructor=J,R(w,L.prototype),w.isPureReactComponent=!0;var ae=Array.isArray;function fe(){}var ne={H:null,A:null,T:null,S:null},ue=Object.prototype.hasOwnProperty;function Ae(g,U,Z){var $=Z.ref;return{$$typeof:u,type:g,key:U,ref:$!==void 0?$:null,props:Z}}function He(g,U){return Ae(g.type,U,g.props)}function $e(g){return typeof g=="object"&&g!==null&&g.$$typeof===u}function We(g){var U={"=":"=0",":":"=2"};return"$"+g.replace(/[=:]/g,function(Z){return U[Z]})}var ia=/\/+/g;function gt(g,U){return typeof g=="object"&&g!==null&&g.key!=null?We(""+g.key):U.toString(36)}function ot(g){switch(g.status){case"fulfilled":return g.value;case"rejected":throw g.reason;default:switch(typeof g.status=="string"?g.then(fe,fe):(g.status="pending",g.then(function(U){g.status==="pending"&&(g.status="fulfilled",g.value=U)},function(U){g.status==="pending"&&(g.status="rejected",g.reason=U)})),g.status){case"fulfilled":return g.value;case"rejected":throw g.reason}}throw g}function O(g,U,Z,$,se){var he=typeof g;(he==="undefined"||he==="boolean")&&(g=null);var Se=!1;if(g===null)Se=!0;else switch(he){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(g.$$typeof){case u:case c:Se=!0;break;case H:return Se=g._init,O(Se(g._payload),U,Z,$,se)}}if(Se)return se=se(g),Se=$===""?"."+gt(g,0):$,ae(se)?(Z="",Se!=null&&(Z=Se.replace(ia,"$&/")+"/"),O(se,U,Z,"",function(Pl){return Pl})):se!=null&&($e(se)&&(se=He(se,Z+(se.key==null||g&&g.key===se.key?"":(""+se.key).replace(ia,"$&/")+"/")+Se)),U.push(se)),1;Se=0;var mt=$===""?".":$+":";if(ae(g))for(var Ye=0;Ye<g.length;Ye++)$=g[Ye],he=mt+gt($,Ye),Se+=O($,U,Z,he,se);else if(Ye=q(g),typeof Ye=="function")for(g=Ye.call(g),Ye=0;!($=g.next()).done;)$=$.value,he=mt+gt($,Ye++),Se+=O($,U,Z,he,se);else if(he==="object"){if(typeof g.then=="function")return O(ot(g),U,Z,$,se);throw U=String(g),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(g).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return Se}function K(g,U,Z){if(g==null)return g;var $=[],se=0;return O(g,$,"","",function(he){return U.call(Z,he,se++)}),$}function te(g){if(g._status===-1){var U=g._result;U=U(),U.then(function(Z){(g._status===0||g._status===-1)&&(g._status=1,g._result=Z)},function(Z){(g._status===0||g._status===-1)&&(g._status=2,g._result=Z)}),g._status===-1&&(g._status=0,g._result=U)}if(g._status===1)return g._result.default;throw g._result}var Me=typeof reportError=="function"?reportError:function(g){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof g=="object"&&g!==null&&typeof g.message=="string"?String(g.message):String(g),error:g});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",g);return}console.error(g)},we={map:K,forEach:function(g,U,Z){K(g,function(){U.apply(this,arguments)},Z)},count:function(g){var U=0;return K(g,function(){U++}),U},toArray:function(g){return K(g,function(U){return U})||[]},only:function(g){if(!$e(g))throw Error("React.Children.only expected to receive a single React element child.");return g}};return le.Activity=M,le.Children=we,le.Component=L,le.Fragment=r,le.Profiler=f,le.PureComponent=J,le.StrictMode=o,le.Suspense=S,le.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ne,le.__COMPILER_RUNTIME={__proto__:null,c:function(g){return ne.H.useMemoCache(g)}},le.cache=function(g){return function(){return g.apply(null,arguments)}},le.cacheSignal=function(){return null},le.cloneElement=function(g,U,Z){if(g==null)throw Error("The argument must be a React element, but you passed "+g+".");var $=R({},g.props),se=g.key;if(U!=null)for(he in U.key!==void 0&&(se=""+U.key),U)!ue.call(U,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&U.ref===void 0||($[he]=U[he]);var he=arguments.length-2;if(he===1)$.children=Z;else if(1<he){for(var Se=Array(he),mt=0;mt<he;mt++)Se[mt]=arguments[mt+2];$.children=Se}return Ae(g.type,se,$)},le.createContext=function(g){return g={$$typeof:p,_currentValue:g,_currentValue2:g,_threadCount:0,Provider:null,Consumer:null},g.Provider=g,g.Consumer={$$typeof:y,_context:g},g},le.createElement=function(g,U,Z){var $,se={},he=null;if(U!=null)for($ in U.key!==void 0&&(he=""+U.key),U)ue.call(U,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(se[$]=U[$]);var Se=arguments.length-2;if(Se===1)se.children=Z;else if(1<Se){for(var mt=Array(Se),Ye=0;Ye<Se;Ye++)mt[Ye]=arguments[Ye+2];se.children=mt}if(g&&g.defaultProps)for($ in Se=g.defaultProps,Se)se[$]===void 0&&(se[$]=Se[$]);return Ae(g,he,se)},le.createRef=function(){return{current:null}},le.forwardRef=function(g){return{$$typeof:z,render:g}},le.isValidElement=$e,le.lazy=function(g){return{$$typeof:H,_payload:{_status:-1,_result:g},_init:te}},le.memo=function(g,U){return{$$typeof:b,type:g,compare:U===void 0?null:U}},le.startTransition=function(g){var U=ne.T,Z={};ne.T=Z;try{var $=g(),se=ne.S;se!==null&&se(Z,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(fe,Me)}catch(he){Me(he)}finally{U!==null&&Z.types!==null&&(U.types=Z.types),ne.T=U}},le.unstable_useCacheRefresh=function(){return ne.H.useCacheRefresh()},le.use=function(g){return ne.H.use(g)},le.useActionState=function(g,U,Z){return ne.H.useActionState(g,U,Z)},le.useCallback=function(g,U){return ne.H.useCallback(g,U)},le.useContext=function(g){return ne.H.useContext(g)},le.useDebugValue=function(){},le.useDeferredValue=function(g,U){return ne.H.useDeferredValue(g,U)},le.useEffect=function(g,U){return ne.H.useEffect(g,U)},le.useEffectEvent=function(g){return ne.H.useEffectEvent(g)},le.useId=function(){return ne.H.useId()},le.useImperativeHandle=function(g,U,Z){return ne.H.useImperativeHandle(g,U,Z)},le.useInsertionEffect=function(g,U){return ne.H.useInsertionEffect(g,U)},le.useLayoutEffect=function(g,U){return ne.H.useLayoutEffect(g,U)},le.useMemo=function(g,U){return ne.H.useMemo(g,U)},le.useOptimistic=function(g,U){return ne.H.useOptimistic(g,U)},le.useReducer=function(g,U,Z){return ne.H.useReducer(g,U,Z)},le.useRef=function(g){return ne.H.useRef(g)},le.useState=function(g){return ne.H.useState(g)},le.useSyncExternalStore=function(g,U,Z){return ne.H.useSyncExternalStore(g,U,Z)},le.useTransition=function(){return ne.H.useTransition()},le.version="19.2.4",le}var V0;function wo(){return V0||(V0=1,so.exports=Nv()),so.exports}var G=wo(),co={exports:{}},Vi={},uo={exports:{}},ro={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var J0;function Av(){return J0||(J0=1,(function(u){function c(O,K){var te=O.length;O.push(K);e:for(;0<te;){var Me=te-1>>>1,we=O[Me];if(0<f(we,K))O[Me]=K,O[te]=we,te=Me;else break e}}function r(O){return O.length===0?null:O[0]}function o(O){if(O.length===0)return null;var K=O[0],te=O.pop();if(te!==K){O[0]=te;e:for(var Me=0,we=O.length,g=we>>>1;Me<g;){var U=2*(Me+1)-1,Z=O[U],$=U+1,se=O[$];if(0>f(Z,te))$<we&&0>f(se,Z)?(O[Me]=se,O[$]=te,Me=$):(O[Me]=Z,O[U]=te,Me=U);else if($<we&&0>f(se,te))O[Me]=se,O[$]=te,Me=$;else break e}}return K}function f(O,K){var te=O.sortIndex-K.sortIndex;return te!==0?te:O.id-K.id}if(u.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var y=performance;u.unstable_now=function(){return y.now()}}else{var p=Date,z=p.now();u.unstable_now=function(){return p.now()-z}}var S=[],b=[],H=1,M=null,_=3,q=!1,X=!1,R=!1,B=!1,L=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null;function w(O){for(var K=r(b);K!==null;){if(K.callback===null)o(b);else if(K.startTime<=O)o(b),K.sortIndex=K.expirationTime,c(S,K);else break;K=r(b)}}function ae(O){if(R=!1,w(O),!X)if(r(S)!==null)X=!0,fe||(fe=!0,We());else{var K=r(b);K!==null&&ot(ae,K.startTime-O)}}var fe=!1,ne=-1,ue=5,Ae=-1;function He(){return B?!0:!(u.unstable_now()-Ae<ue)}function $e(){if(B=!1,fe){var O=u.unstable_now();Ae=O;var K=!0;try{e:{X=!1,R&&(R=!1,Q(ne),ne=-1),q=!0;var te=_;try{t:{for(w(O),M=r(S);M!==null&&!(M.expirationTime>O&&He());){var Me=M.callback;if(typeof Me=="function"){M.callback=null,_=M.priorityLevel;var we=Me(M.expirationTime<=O);if(O=u.unstable_now(),typeof we=="function"){M.callback=we,w(O),K=!0;break t}M===r(S)&&o(S),w(O)}else o(S);M=r(S)}if(M!==null)K=!0;else{var g=r(b);g!==null&&ot(ae,g.startTime-O),K=!1}}break e}finally{M=null,_=te,q=!1}K=void 0}}finally{K?We():fe=!1}}}var We;if(typeof J=="function")We=function(){J($e)};else if(typeof MessageChannel<"u"){var ia=new MessageChannel,gt=ia.port2;ia.port1.onmessage=$e,We=function(){gt.postMessage(null)}}else We=function(){L($e,0)};function ot(O,K){ne=L(function(){O(u.unstable_now())},K)}u.unstable_IdlePriority=5,u.unstable_ImmediatePriority=1,u.unstable_LowPriority=4,u.unstable_NormalPriority=3,u.unstable_Profiling=null,u.unstable_UserBlockingPriority=2,u.unstable_cancelCallback=function(O){O.callback=null},u.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ue=0<O?Math.floor(1e3/O):5},u.unstable_getCurrentPriorityLevel=function(){return _},u.unstable_next=function(O){switch(_){case 1:case 2:case 3:var K=3;break;default:K=_}var te=_;_=K;try{return O()}finally{_=te}},u.unstable_requestPaint=function(){B=!0},u.unstable_runWithPriority=function(O,K){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var te=_;_=O;try{return K()}finally{_=te}},u.unstable_scheduleCallback=function(O,K,te){var Me=u.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?Me+te:Me):te=Me,O){case 1:var we=-1;break;case 2:we=250;break;case 5:we=1073741823;break;case 4:we=1e4;break;default:we=5e3}return we=te+we,O={id:H++,callback:K,priorityLevel:O,startTime:te,expirationTime:we,sortIndex:-1},te>Me?(O.sortIndex=te,c(b,O),r(S)===null&&O===r(b)&&(R?(Q(ne),ne=-1):R=!0,ot(ae,te-Me))):(O.sortIndex=we,c(S,O),X||q||(X=!0,fe||(fe=!0,We()))),O},u.unstable_shouldYield=He,u.unstable_wrapCallback=function(O){var K=_;return function(){var te=_;_=K;try{return O.apply(this,arguments)}finally{_=te}}}})(ro)),ro}var F0;function Ev(){return F0||(F0=1,uo.exports=Av()),uo.exports}var oo={exports:{}},dt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var $0;function Tv(){if($0)return dt;$0=1;var u=wo();function c(S){var b="https://react.dev/errors/"+S;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var H=2;H<arguments.length;H++)b+="&args[]="+encodeURIComponent(arguments[H])}return"Minified React error #"+S+"; visit "+b+" 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(c(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},f=Symbol.for("react.portal");function y(S,b,H){var M=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:M==null?null:""+M,children:S,containerInfo:b,implementation:H}}var p=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function z(S,b){if(S==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return dt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,dt.createPortal=function(S,b){var H=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(c(299));return y(S,b,null,H)},dt.flushSync=function(S){var b=p.T,H=o.p;try{if(p.T=null,o.p=2,S)return S()}finally{p.T=b,o.p=H,o.d.f()}},dt.preconnect=function(S,b){typeof S=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,o.d.C(S,b))},dt.prefetchDNS=function(S){typeof S=="string"&&o.d.D(S)},dt.preinit=function(S,b){if(typeof S=="string"&&b&&typeof b.as=="string"){var H=b.as,M=z(H,b.crossOrigin),_=typeof b.integrity=="string"?b.integrity:void 0,q=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;H==="style"?o.d.S(S,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:M,integrity:_,fetchPriority:q}):H==="script"&&o.d.X(S,{crossOrigin:M,integrity:_,fetchPriority:q,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},dt.preinitModule=function(S,b){if(typeof S=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var H=z(b.as,b.crossOrigin);o.d.M(S,{crossOrigin:H,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0})}}else b==null&&o.d.M(S)},dt.preload=function(S,b){if(typeof S=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var H=b.as,M=z(H,b.crossOrigin);o.d.L(S,H,{crossOrigin:M,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},dt.preloadModule=function(S,b){if(typeof S=="string")if(b){var H=z(b.as,b.crossOrigin);o.d.m(S,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:H,integrity:typeof b.integrity=="string"?b.integrity:void 0})}else o.d.m(S)},dt.requestFormReset=function(S){o.d.r(S)},dt.unstable_batchedUpdates=function(S,b){return S(b)},dt.useFormState=function(S,b,H){return p.H.useFormState(S,b,H)},dt.useFormStatus=function(){return p.H.useHostTransitionStatus()},dt.version="19.2.4",dt}var W0;function Mv(){if(W0)return oo.exports;W0=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(c){console.error(c)}}return u(),oo.exports=Tv(),oo.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var I0;function Cv(){if(I0)return Vi;I0=1;var u=Ev(),c=wo(),r=Mv();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function y(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function p(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function z(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function S(e){if(y(e)!==e)throw Error(o(188))}function b(e){var t=e.alternate;if(!t){if(t=y(e),t===null)throw Error(o(188));return t!==e?null:e}for(var a=e,n=t;;){var l=a.return;if(l===null)break;var s=l.alternate;if(s===null){if(n=l.return,n!==null){a=n;continue}break}if(l.child===s.child){for(s=l.child;s;){if(s===a)return S(l),e;if(s===n)return S(l),t;s=s.sibling}throw Error(o(188))}if(a.return!==n.return)a=l,n=s;else{for(var d=!1,h=l.child;h;){if(h===a){d=!0,a=l,n=s;break}if(h===n){d=!0,n=l,a=s;break}h=h.sibling}if(!d){for(h=s.child;h;){if(h===a){d=!0,a=s,n=l;break}if(h===n){d=!0,n=s,a=l;break}h=h.sibling}if(!d)throw Error(o(189))}}if(a.alternate!==n)throw Error(o(190))}if(a.tag!==3)throw Error(o(188));return a.stateNode.current===a?e:t}function H(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=H(e),t!==null)return t;e=e.sibling}return null}var M=Object.assign,_=Symbol.for("react.element"),q=Symbol.for("react.transitional.element"),X=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),J=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),fe=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),ue=Symbol.for("react.lazy"),Ae=Symbol.for("react.activity"),He=Symbol.for("react.memo_cache_sentinel"),$e=Symbol.iterator;function We(e){return e===null||typeof e!="object"?null:(e=$e&&e[$e]||e["@@iterator"],typeof e=="function"?e:null)}var ia=Symbol.for("react.client.reference");function gt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ia?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case L:return"Profiler";case B:return"StrictMode";case ae:return"Suspense";case fe:return"SuspenseList";case Ae:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case X:return"Portal";case J:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case w:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ne:return t=e.displayName||null,t!==null?t:gt(e.type)||"Memo";case ue:t=e._payload,e=e._init;try{return gt(e(t))}catch{}}return null}var ot=Array.isArray,O=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},Me=[],we=-1;function g(e){return{current:e}}function U(e){0>we||(e.current=Me[we],Me[we]=null,we--)}function Z(e,t){we++,Me[we]=e.current,e.current=t}var $=g(null),se=g(null),he=g(null),Se=g(null);function mt(e,t){switch(Z(he,t),Z(se,e),Z($,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?f0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=f0(t),e=h0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U($),Z($,e)}function Ye(){U($),U(se),U(he)}function Pl(e){e.memoizedState!==null&&Z(Se,e);var t=$.current,a=h0(t,e.type);t!==a&&(Z(se,e),Z($,a))}function ls(e){se.current===e&&(U($),U(se)),Se.current===e&&(U(Se),Yi._currentValue=te)}var Lc,Bo;function zn(e){if(Lc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Lc=t&&t[1]||"",Bo=-1<a.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Lc+e+Bo}var Bc=!1;function Yc(e,t){if(!e||Bc)return"";Bc=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var k=function(){throw Error()};if(Object.defineProperty(k.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(k,[])}catch(T){var E=T}Reflect.construct(e,[],k)}else{try{k.call()}catch(T){E=T}e.call(k.prototype)}}else{try{throw Error()}catch(T){E=T}(k=e())&&typeof k.catch=="function"&&k.catch(function(){})}}catch(T){if(T&&E&&typeof T.stack=="string")return[T.stack,E.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=n.DetermineComponentFrameRoot(),d=s[0],h=s[1];if(d&&h){var m=d.split(`
44
+ `),A=h.split(`
45
+ `);for(l=n=0;n<m.length&&!m[n].includes("DetermineComponentFrameRoot");)n++;for(;l<A.length&&!A[l].includes("DetermineComponentFrameRoot");)l++;if(n===m.length||l===A.length)for(n=m.length-1,l=A.length-1;1<=n&&0<=l&&m[n]!==A[l];)l--;for(;1<=n&&0<=l;n--,l--)if(m[n]!==A[l]){if(n!==1||l!==1)do if(n--,l--,0>l||m[n]!==A[l]){var C=`
46
+ `+m[n].replace(" at new "," at ");return e.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",e.displayName)),C}while(1<=n&&0<=l);break}}}finally{Bc=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?zn(a):""}function Pm(e,t){switch(e.tag){case 26:case 27:case 5:return zn(e.type);case 16:return zn("Lazy");case 13:return e.child!==t&&t!==null?zn("Suspense Fallback"):zn("Suspense");case 19:return zn("SuspenseList");case 0:case 15:return Yc(e.type,!1);case 11:return Yc(e.type.render,!1);case 1:return Yc(e.type,!0);case 31:return zn("Activity");default:return""}}function Yo(e){try{var t="",a=null;do t+=Pm(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
47
+ Error generating stack: `+n.message+`
48
+ `+n.stack}}var Gc=Object.prototype.hasOwnProperty,Xc=u.unstable_scheduleCallback,Kc=u.unstable_cancelCallback,ex=u.unstable_shouldYield,tx=u.unstable_requestPaint,Mt=u.unstable_now,ax=u.unstable_getCurrentPriorityLevel,Go=u.unstable_ImmediatePriority,Xo=u.unstable_UserBlockingPriority,is=u.unstable_NormalPriority,nx=u.unstable_LowPriority,Ko=u.unstable_IdlePriority,lx=u.log,ix=u.unstable_setDisableYieldValue,ei=null,Ct=null;function Qa(e){if(typeof lx=="function"&&ix(e),Ct&&typeof Ct.setStrictMode=="function")try{Ct.setStrictMode(ei,e)}catch{}}var Ot=Math.clz32?Math.clz32:ux,sx=Math.log,cx=Math.LN2;function ux(e){return e>>>=0,e===0?32:31-(sx(e)/cx|0)|0}var ss=256,cs=262144,us=4194304;function Sn(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function rs(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var l=0,s=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var h=n&134217727;return h!==0?(n=h&~s,n!==0?l=Sn(n):(d&=h,d!==0?l=Sn(d):a||(a=h&~e,a!==0&&(l=Sn(a))))):(h=n&~s,h!==0?l=Sn(h):d!==0?l=Sn(d):a||(a=n&~e,a!==0&&(l=Sn(a)))),l===0?0:t!==0&&t!==l&&(t&s)===0&&(s=l&-l,a=t&-t,s>=a||s===32&&(a&4194048)!==0)?t:l}function ti(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function rx(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Zo(){var e=us;return us<<=1,(us&62914560)===0&&(us=4194304),e}function Zc(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function ai(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ox(e,t,a,n,l,s){var d=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var h=e.entanglements,m=e.expirationTimes,A=e.hiddenUpdates;for(a=d&~a;0<a;){var C=31-Ot(a),k=1<<C;h[C]=0,m[C]=-1;var E=A[C];if(E!==null)for(A[C]=null,C=0;C<E.length;C++){var T=E[C];T!==null&&(T.lane&=-536870913)}a&=~k}n!==0&&Vo(e,n,0),s!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=s&~(d&~t))}function Vo(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Ot(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function Jo(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-Ot(a),l=1<<n;l&t|e[n]&t&&(e[n]|=t),a&=~l}}function Fo(e,t){var a=t&-t;return a=(a&42)!==0?1:Vc(a),(a&(e.suspendedLanes|t))!==0?0:a}function Vc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Jc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function $o(){var e=K.p;return e!==0?e:(e=window.event,e===void 0?32:U0(e.type))}function Wo(e,t){var a=K.p;try{return K.p=e,t()}finally{K.p=a}}var La=Math.random().toString(36).slice(2),lt="__reactFiber$"+La,pt="__reactProps$"+La,tl="__reactContainer$"+La,Fc="__reactEvents$"+La,dx="__reactListeners$"+La,fx="__reactHandles$"+La,Io="__reactResources$"+La,ni="__reactMarker$"+La;function $c(e){delete e[lt],delete e[pt],delete e[Fc],delete e[dx],delete e[fx]}function al(e){var t=e[lt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[tl]||a[lt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=b0(e);e!==null;){if(a=e[lt])return a;e=b0(e)}return t}e=a,a=e.parentNode}return null}function nl(e){if(e=e[lt]||e[tl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function li(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function ll(e){var t=e[Io];return t||(t=e[Io]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function tt(e){e[ni]=!0}var Po=new Set,ed={};function Nn(e,t){il(e,t),il(e+"Capture",t)}function il(e,t){for(ed[e]=t,e=0;e<t.length;e++)Po.add(t[e])}var hx=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]*$"),td={},ad={};function mx(e){return Gc.call(ad,e)?!0:Gc.call(td,e)?!1:hx.test(e)?ad[e]=!0:(td[e]=!0,!1)}function os(e,t,a){if(mx(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function ds(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function ha(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function Yt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function nd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function xx(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(d){a=""+d,s.call(this,d)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(d){a=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wc(e){if(!e._valueTracker){var t=nd(e)?"checked":"value";e._valueTracker=xx(e,t,""+e[t])}}function ld(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=nd(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function fs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var yx=/[\n"\\]/g;function Gt(e){return e.replace(yx,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ic(e,t,a,n,l,s,d,h){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Yt(t)):e.value!==""+Yt(t)&&(e.value=""+Yt(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?Pc(e,d,Yt(t)):a!=null?Pc(e,d,Yt(a)):n!=null&&e.removeAttribute("value"),l==null&&s!=null&&(e.defaultChecked=!!s),l!=null&&(e.checked=l&&typeof l!="function"&&typeof l!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.name=""+Yt(h):e.removeAttribute("name")}function id(e,t,a,n,l,s,d,h){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||a!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){Wc(e);return}a=a!=null?""+Yt(a):"",t=t!=null?""+Yt(t):a,h||t===e.value||(e.value=t),e.defaultValue=t}n=n??l,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=h?e.checked:!!n,e.defaultChecked=!!n,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Wc(e)}function Pc(e,t,a){t==="number"&&fs(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function sl(e,t,a,n){if(e=e.options,t){t={};for(var l=0;l<a.length;l++)t["$"+a[l]]=!0;for(a=0;a<e.length;a++)l=t.hasOwnProperty("$"+e[a].value),e[a].selected!==l&&(e[a].selected=l),l&&n&&(e[a].defaultSelected=!0)}else{for(a=""+Yt(a),t=null,l=0;l<e.length;l++){if(e[l].value===a){e[l].selected=!0,n&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function sd(e,t,a){if(t!=null&&(t=""+Yt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Yt(a):""}function cd(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(o(92));if(ot(n)){if(1<n.length)throw Error(o(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Yt(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),Wc(e)}function cl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var vx=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 ud(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||vx.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function rd(e,t,a){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var l in t)n=t[l],t.hasOwnProperty(l)&&a[l]!==n&&ud(e,l,n)}else for(var s in t)t.hasOwnProperty(s)&&ud(e,s,t[s])}function eu(e){if(e.indexOf("-")===-1)return!1;switch(e){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 gx=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"]]),px=/^[\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 hs(e){return px.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ma(){}var tu=null;function au(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ul=null,rl=null;function od(e){var t=nl(e);if(t&&(e=t.stateNode)){var a=e[pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ic(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Gt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var l=n[pt]||null;if(!l)throw Error(o(90));Ic(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&ld(n)}break e;case"textarea":sd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&sl(e,!!a.multiple,t,!1)}}}var nu=!1;function dd(e,t,a){if(nu)return e(t,a);nu=!0;try{var n=e(t);return n}finally{if(nu=!1,(ul!==null||rl!==null)&&(ec(),ul&&(t=ul,e=rl,rl=ul=null,od(t),e)))for(t=0;t<e.length;t++)od(e[t])}}function ii(e,t){var a=e.stateNode;if(a===null)return null;var n=a[pt]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(o(231,t,typeof a));return a}var xa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lu=!1;if(xa)try{var si={};Object.defineProperty(si,"passive",{get:function(){lu=!0}}),window.addEventListener("test",si,si),window.removeEventListener("test",si,si)}catch{lu=!1}var Ba=null,iu=null,ms=null;function fd(){if(ms)return ms;var e,t=iu,a=t.length,n,l="value"in Ba?Ba.value:Ba.textContent,s=l.length;for(e=0;e<a&&t[e]===l[e];e++);var d=a-e;for(n=1;n<=d&&t[a-n]===l[s-n];n++);return ms=l.slice(e,1<n?1-n:void 0)}function xs(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ys(){return!0}function hd(){return!1}function bt(e){function t(a,n,l,s,d){this._reactName=a,this._targetInst=l,this.type=n,this.nativeEvent=s,this.target=d,this.currentTarget=null;for(var h in e)e.hasOwnProperty(h)&&(a=e[h],this[h]=a?a(s):s[h]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?ys:hd,this.isPropagationStopped=hd,this}return M(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ys)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ys)},persist:function(){},isPersistent:ys}),t}var An={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vs=bt(An),ci=M({},An,{view:0,detail:0}),bx=bt(ci),su,cu,ui,gs=M({},ci,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ru,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ui&&(ui&&e.type==="mousemove"?(su=e.screenX-ui.screenX,cu=e.screenY-ui.screenY):cu=su=0,ui=e),su)},movementY:function(e){return"movementY"in e?e.movementY:cu}}),md=bt(gs),jx=M({},gs,{dataTransfer:0}),zx=bt(jx),Sx=M({},ci,{relatedTarget:0}),uu=bt(Sx),Nx=M({},An,{animationName:0,elapsedTime:0,pseudoElement:0}),Ax=bt(Nx),Ex=M({},An,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Tx=bt(Ex),Mx=M({},An,{data:0}),xd=bt(Mx),Cx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ox={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"},_x={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=_x[e])?!!t[e]:!1}function ru(){return wx}var Dx=M({},ci,{key:function(e){if(e.key){var t=Cx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=xs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ox[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ru,charCode:function(e){return e.type==="keypress"?xs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?xs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),kx=bt(Dx),Rx=M({},gs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yd=bt(Rx),Ux=M({},ci,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ru}),qx=bt(Ux),Hx=M({},An,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qx=bt(Hx),Lx=M({},gs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Bx=bt(Lx),Yx=M({},An,{newState:0,oldState:0}),Gx=bt(Yx),Xx=[9,13,27,32],ou=xa&&"CompositionEvent"in window,ri=null;xa&&"documentMode"in document&&(ri=document.documentMode);var Kx=xa&&"TextEvent"in window&&!ri,vd=xa&&(!ou||ri&&8<ri&&11>=ri),gd=" ",pd=!1;function bd(e,t){switch(e){case"keyup":return Xx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ol=!1;function Zx(e,t){switch(e){case"compositionend":return jd(t);case"keypress":return t.which!==32?null:(pd=!0,gd);case"textInput":return e=t.data,e===gd&&pd?null:e;default:return null}}function Vx(e,t){if(ol)return e==="compositionend"||!ou&&bd(e,t)?(e=fd(),ms=iu=Ba=null,ol=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return vd&&t.locale!=="ko"?null:t.data;default:return null}}var Jx={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 zd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Jx[e.type]:t==="textarea"}function Sd(e,t,a,n){ul?rl?rl.push(n):rl=[n]:ul=n,t=cc(t,"onChange"),0<t.length&&(a=new vs("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var oi=null,di=null;function Fx(e){s0(e,0)}function ps(e){var t=li(e);if(ld(t))return e}function Nd(e,t){if(e==="change")return t}var Ad=!1;if(xa){var du;if(xa){var fu="oninput"in document;if(!fu){var Ed=document.createElement("div");Ed.setAttribute("oninput","return;"),fu=typeof Ed.oninput=="function"}du=fu}else du=!1;Ad=du&&(!document.documentMode||9<document.documentMode)}function Td(){oi&&(oi.detachEvent("onpropertychange",Md),di=oi=null)}function Md(e){if(e.propertyName==="value"&&ps(di)){var t=[];Sd(t,di,e,au(e)),dd(Fx,t)}}function $x(e,t,a){e==="focusin"?(Td(),oi=t,di=a,oi.attachEvent("onpropertychange",Md)):e==="focusout"&&Td()}function Wx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ps(di)}function Ix(e,t){if(e==="click")return ps(t)}function Px(e,t){if(e==="input"||e==="change")return ps(t)}function ey(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _t=typeof Object.is=="function"?Object.is:ey;function fi(e,t){if(_t(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var l=a[n];if(!Gc.call(t,l)||!_t(e[l],t[l]))return!1}return!0}function Cd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Od(e,t){var a=Cd(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Cd(a)}}function _d(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_d(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=fs(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=fs(e.document)}return t}function hu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var ty=xa&&"documentMode"in document&&11>=document.documentMode,dl=null,mu=null,hi=null,xu=!1;function Dd(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;xu||dl==null||dl!==fs(n)||(n=dl,"selectionStart"in n&&hu(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),hi&&fi(hi,n)||(hi=n,n=cc(mu,"onSelect"),0<n.length&&(t=new vs("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=dl)))}function En(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var fl={animationend:En("Animation","AnimationEnd"),animationiteration:En("Animation","AnimationIteration"),animationstart:En("Animation","AnimationStart"),transitionrun:En("Transition","TransitionRun"),transitionstart:En("Transition","TransitionStart"),transitioncancel:En("Transition","TransitionCancel"),transitionend:En("Transition","TransitionEnd")},yu={},kd={};xa&&(kd=document.createElement("div").style,"AnimationEvent"in window||(delete fl.animationend.animation,delete fl.animationiteration.animation,delete fl.animationstart.animation),"TransitionEvent"in window||delete fl.transitionend.transition);function Tn(e){if(yu[e])return yu[e];if(!fl[e])return e;var t=fl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in kd)return yu[e]=t[a];return e}var Rd=Tn("animationend"),Ud=Tn("animationiteration"),qd=Tn("animationstart"),ay=Tn("transitionrun"),ny=Tn("transitionstart"),ly=Tn("transitioncancel"),Hd=Tn("transitionend"),Qd=new Map,vu="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(" ");vu.push("scrollEnd");function ta(e,t){Qd.set(e,t),Nn(t,[e])}var bs=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Xt=[],hl=0,gu=0;function js(){for(var e=hl,t=gu=hl=0;t<e;){var a=Xt[t];Xt[t++]=null;var n=Xt[t];Xt[t++]=null;var l=Xt[t];Xt[t++]=null;var s=Xt[t];if(Xt[t++]=null,n!==null&&l!==null){var d=n.pending;d===null?l.next=l:(l.next=d.next,d.next=l),n.pending=l}s!==0&&Ld(a,l,s)}}function zs(e,t,a,n){Xt[hl++]=e,Xt[hl++]=t,Xt[hl++]=a,Xt[hl++]=n,gu|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function pu(e,t,a,n){return zs(e,t,a,n),Ss(e)}function Mn(e,t){return zs(e,null,null,t),Ss(e)}function Ld(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var l=!1,s=e.return;s!==null;)s.childLanes|=a,n=s.alternate,n!==null&&(n.childLanes|=a),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(l=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,l&&t!==null&&(l=31-Ot(a),e=s.hiddenUpdates,n=e[l],n===null?e[l]=[t]:n.push(t),t.lane=a|536870912),s):null}function Ss(e){if(50<Ri)throw Ri=0,Mr=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ml={};function iy(e,t,a,n){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wt(e,t,a,n){return new iy(e,t,a,n)}function bu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ya(e,t){var a=e.alternate;return a===null?(a=wt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Bd(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ns(e,t,a,n,l,s){var d=0;if(n=e,typeof e=="function")bu(e)&&(d=1);else if(typeof e=="string")d=ov(e,a,$.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Ae:return e=wt(31,a,t,l),e.elementType=Ae,e.lanes=s,e;case R:return Cn(a.children,l,s,t);case B:d=8,l|=24;break;case L:return e=wt(12,a,t,l|2),e.elementType=L,e.lanes=s,e;case ae:return e=wt(13,a,t,l),e.elementType=ae,e.lanes=s,e;case fe:return e=wt(19,a,t,l),e.elementType=fe,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case J:d=10;break e;case Q:d=9;break e;case w:d=11;break e;case ne:d=14;break e;case ue:d=16,n=null;break e}d=29,a=Error(o(130,e===null?"null":typeof e,"")),n=null}return t=wt(d,a,t,l),t.elementType=e,t.type=n,t.lanes=s,t}function Cn(e,t,a,n){return e=wt(7,e,n,t),e.lanes=a,e}function ju(e,t,a){return e=wt(6,e,null,t),e.lanes=a,e}function Yd(e){var t=wt(18,null,null,0);return t.stateNode=e,t}function zu(e,t,a){return t=wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Gd=new WeakMap;function Kt(e,t){if(typeof e=="object"&&e!==null){var a=Gd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Yo(t)},Gd.set(e,t),t)}return{value:e,source:t,stack:Yo(t)}}var xl=[],yl=0,As=null,mi=0,Zt=[],Vt=0,Ya=null,sa=1,ca="";function va(e,t){xl[yl++]=mi,xl[yl++]=As,As=e,mi=t}function Xd(e,t,a){Zt[Vt++]=sa,Zt[Vt++]=ca,Zt[Vt++]=Ya,Ya=e;var n=sa;e=ca;var l=32-Ot(n)-1;n&=~(1<<l),a+=1;var s=32-Ot(t)+l;if(30<s){var d=l-l%5;s=(n&(1<<d)-1).toString(32),n>>=d,l-=d,sa=1<<32-Ot(t)+l|a<<l|n,ca=s+e}else sa=1<<s|a<<l|n,ca=e}function Su(e){e.return!==null&&(va(e,1),Xd(e,1,0))}function Nu(e){for(;e===As;)As=xl[--yl],xl[yl]=null,mi=xl[--yl],xl[yl]=null;for(;e===Ya;)Ya=Zt[--Vt],Zt[Vt]=null,ca=Zt[--Vt],Zt[Vt]=null,sa=Zt[--Vt],Zt[Vt]=null}function Kd(e,t){Zt[Vt++]=sa,Zt[Vt++]=ca,Zt[Vt++]=Ya,sa=t.id,ca=t.overflow,Ya=e}var it=null,ke=null,ge=!1,Ga=null,Jt=!1,Au=Error(o(519));function Xa(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xi(Kt(t,e)),Au}function Zd(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[lt]=e,t[pt]=n,a){case"dialog":xe("cancel",t),xe("close",t);break;case"iframe":case"object":case"embed":xe("load",t);break;case"video":case"audio":for(a=0;a<qi.length;a++)xe(qi[a],t);break;case"source":xe("error",t);break;case"img":case"image":case"link":xe("error",t),xe("load",t);break;case"details":xe("toggle",t);break;case"input":xe("invalid",t),id(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":xe("invalid",t);break;case"textarea":xe("invalid",t),cd(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||o0(t.textContent,a)?(n.popover!=null&&(xe("beforetoggle",t),xe("toggle",t)),n.onScroll!=null&&xe("scroll",t),n.onScrollEnd!=null&&xe("scrollend",t),n.onClick!=null&&(t.onclick=ma),t=!0):t=!1,t||Xa(e,!0)}function Vd(e){for(it=e.return;it;)switch(it.tag){case 5:case 31:case 13:Jt=!1;return;case 27:case 3:Jt=!0;return;default:it=it.return}}function vl(e){if(e!==it)return!1;if(!ge)return Vd(e),ge=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Gr(e.type,e.memoizedProps)),a=!a),a&&ke&&Xa(e),Vd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ke=p0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ke=p0(e)}else t===27?(t=ke,ln(e.type)?(e=Jr,Jr=null,ke=e):ke=t):ke=it?$t(e.stateNode.nextSibling):null;return!0}function On(){ke=it=null,ge=!1}function Eu(){var e=Ga;return e!==null&&(Nt===null?Nt=e:Nt.push.apply(Nt,e),Ga=null),e}function xi(e){Ga===null?Ga=[e]:Ga.push(e)}var Tu=g(null),_n=null,ga=null;function Ka(e,t,a){Z(Tu,t._currentValue),t._currentValue=a}function pa(e){e._currentValue=Tu.current,U(Tu)}function Mu(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function Cu(e,t,a,n){var l=e.child;for(l!==null&&(l.return=e);l!==null;){var s=l.dependencies;if(s!==null){var d=l.child;s=s.firstContext;e:for(;s!==null;){var h=s;s=l;for(var m=0;m<t.length;m++)if(h.context===t[m]){s.lanes|=a,h=s.alternate,h!==null&&(h.lanes|=a),Mu(s.return,a,e),n||(d=null);break e}s=h.next}}else if(l.tag===18){if(d=l.return,d===null)throw Error(o(341));d.lanes|=a,s=d.alternate,s!==null&&(s.lanes|=a),Mu(d,a,e),d=null}else d=l.child;if(d!==null)d.return=l;else for(d=l;d!==null;){if(d===e){d=null;break}if(l=d.sibling,l!==null){l.return=d.return,d=l;break}d=d.return}l=d}}function gl(e,t,a,n){e=null;for(var l=t,s=!1;l!==null;){if(!s){if((l.flags&524288)!==0)s=!0;else if((l.flags&262144)!==0)break}if(l.tag===10){var d=l.alternate;if(d===null)throw Error(o(387));if(d=d.memoizedProps,d!==null){var h=l.type;_t(l.pendingProps.value,d.value)||(e!==null?e.push(h):e=[h])}}else if(l===Se.current){if(d=l.alternate,d===null)throw Error(o(387));d.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(Yi):e=[Yi])}l=l.return}e!==null&&Cu(t,e,a,n),t.flags|=262144}function Es(e){for(e=e.firstContext;e!==null;){if(!_t(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function wn(e){_n=e,ga=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function st(e){return Jd(_n,e)}function Ts(e,t){return _n===null&&wn(e),Jd(e,t)}function Jd(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},ga===null){if(e===null)throw Error(o(308));ga=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ga=ga.next=t;return a}var sy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},cy=u.unstable_scheduleCallback,uy=u.unstable_NormalPriority,Ke={$$typeof:J,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ou(){return{controller:new sy,data:new Map,refCount:0}}function yi(e){e.refCount--,e.refCount===0&&cy(uy,function(){e.controller.abort()})}var vi=null,_u=0,pl=0,bl=null;function ry(e,t){if(vi===null){var a=vi=[];_u=0,pl=kr(),bl={status:"pending",value:void 0,then:function(n){a.push(n)}}}return _u++,t.then(Fd,Fd),t}function Fd(){if(--_u===0&&vi!==null){bl!==null&&(bl.status="fulfilled");var e=vi;vi=null,pl=0,bl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function oy(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(l){a.push(l)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var l=0;l<a.length;l++)(0,a[l])(t)},function(l){for(n.status="rejected",n.reason=l,l=0;l<a.length;l++)(0,a[l])(void 0)}),n}var $d=O.S;O.S=function(e,t){kh=Mt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ry(e,t),$d!==null&&$d(e,t)};var Dn=g(null);function wu(){var e=Dn.current;return e!==null?e:De.pooledCache}function Ms(e,t){t===null?Z(Dn,Dn.current):Z(Dn,t.pool)}function Wd(){var e=wu();return e===null?null:{parent:Ke._currentValue,pool:e}}var jl=Error(o(460)),Du=Error(o(474)),Cs=Error(o(542)),Os={then:function(){}};function Id(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Pd(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(ma,ma),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,tf(e),e;default:if(typeof t.status=="string")t.then(ma,ma);else{if(e=De,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var l=t;l.status="fulfilled",l.value=n}},function(n){if(t.status==="pending"){var l=t;l.status="rejected",l.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,tf(e),e}throw Rn=t,jl}}function kn(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Rn=a,jl):a}}var Rn=null;function ef(){if(Rn===null)throw Error(o(459));var e=Rn;return Rn=null,e}function tf(e){if(e===jl||e===Cs)throw Error(o(483))}var zl=null,gi=0;function _s(e){var t=gi;return gi+=1,zl===null&&(zl=[]),Pd(zl,e,t)}function pi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ws(e,t){throw t.$$typeof===_?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function af(e){function t(j,v){if(e){var N=j.deletions;N===null?(j.deletions=[v],j.flags|=16):N.push(v)}}function a(j,v){if(!e)return null;for(;v!==null;)t(j,v),v=v.sibling;return null}function n(j){for(var v=new Map;j!==null;)j.key!==null?v.set(j.key,j):v.set(j.index,j),j=j.sibling;return v}function l(j,v){return j=ya(j,v),j.index=0,j.sibling=null,j}function s(j,v,N){return j.index=N,e?(N=j.alternate,N!==null?(N=N.index,N<v?(j.flags|=67108866,v):N):(j.flags|=67108866,v)):(j.flags|=1048576,v)}function d(j){return e&&j.alternate===null&&(j.flags|=67108866),j}function h(j,v,N,D){return v===null||v.tag!==6?(v=ju(N,j.mode,D),v.return=j,v):(v=l(v,N),v.return=j,v)}function m(j,v,N,D){var P=N.type;return P===R?C(j,v,N.props.children,D,N.key):v!==null&&(v.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===ue&&kn(P)===v.type)?(v=l(v,N.props),pi(v,N),v.return=j,v):(v=Ns(N.type,N.key,N.props,null,j.mode,D),pi(v,N),v.return=j,v)}function A(j,v,N,D){return v===null||v.tag!==4||v.stateNode.containerInfo!==N.containerInfo||v.stateNode.implementation!==N.implementation?(v=zu(N,j.mode,D),v.return=j,v):(v=l(v,N.children||[]),v.return=j,v)}function C(j,v,N,D,P){return v===null||v.tag!==7?(v=Cn(N,j.mode,D,P),v.return=j,v):(v=l(v,N),v.return=j,v)}function k(j,v,N){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return v=ju(""+v,j.mode,N),v.return=j,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case q:return N=Ns(v.type,v.key,v.props,null,j.mode,N),pi(N,v),N.return=j,N;case X:return v=zu(v,j.mode,N),v.return=j,v;case ue:return v=kn(v),k(j,v,N)}if(ot(v)||We(v))return v=Cn(v,j.mode,N,null),v.return=j,v;if(typeof v.then=="function")return k(j,_s(v),N);if(v.$$typeof===J)return k(j,Ts(j,v),N);ws(j,v)}return null}function E(j,v,N,D){var P=v!==null?v.key:null;if(typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint")return P!==null?null:h(j,v,""+N,D);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case q:return N.key===P?m(j,v,N,D):null;case X:return N.key===P?A(j,v,N,D):null;case ue:return N=kn(N),E(j,v,N,D)}if(ot(N)||We(N))return P!==null?null:C(j,v,N,D,null);if(typeof N.then=="function")return E(j,v,_s(N),D);if(N.$$typeof===J)return E(j,v,Ts(j,N),D);ws(j,N)}return null}function T(j,v,N,D,P){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return j=j.get(N)||null,h(v,j,""+D,P);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case q:return j=j.get(D.key===null?N:D.key)||null,m(v,j,D,P);case X:return j=j.get(D.key===null?N:D.key)||null,A(v,j,D,P);case ue:return D=kn(D),T(j,v,N,D,P)}if(ot(D)||We(D))return j=j.get(N)||null,C(v,j,D,P,null);if(typeof D.then=="function")return T(j,v,N,_s(D),P);if(D.$$typeof===J)return T(j,v,N,Ts(v,D),P);ws(v,D)}return null}function F(j,v,N,D){for(var P=null,be=null,W=v,re=v=0,ve=null;W!==null&&re<N.length;re++){W.index>re?(ve=W,W=null):ve=W.sibling;var je=E(j,W,N[re],D);if(je===null){W===null&&(W=ve);break}e&&W&&je.alternate===null&&t(j,W),v=s(je,v,re),be===null?P=je:be.sibling=je,be=je,W=ve}if(re===N.length)return a(j,W),ge&&va(j,re),P;if(W===null){for(;re<N.length;re++)W=k(j,N[re],D),W!==null&&(v=s(W,v,re),be===null?P=W:be.sibling=W,be=W);return ge&&va(j,re),P}for(W=n(W);re<N.length;re++)ve=T(W,j,re,N[re],D),ve!==null&&(e&&ve.alternate!==null&&W.delete(ve.key===null?re:ve.key),v=s(ve,v,re),be===null?P=ve:be.sibling=ve,be=ve);return e&&W.forEach(function(on){return t(j,on)}),ge&&va(j,re),P}function ee(j,v,N,D){if(N==null)throw Error(o(151));for(var P=null,be=null,W=v,re=v=0,ve=null,je=N.next();W!==null&&!je.done;re++,je=N.next()){W.index>re?(ve=W,W=null):ve=W.sibling;var on=E(j,W,je.value,D);if(on===null){W===null&&(W=ve);break}e&&W&&on.alternate===null&&t(j,W),v=s(on,v,re),be===null?P=on:be.sibling=on,be=on,W=ve}if(je.done)return a(j,W),ge&&va(j,re),P;if(W===null){for(;!je.done;re++,je=N.next())je=k(j,je.value,D),je!==null&&(v=s(je,v,re),be===null?P=je:be.sibling=je,be=je);return ge&&va(j,re),P}for(W=n(W);!je.done;re++,je=N.next())je=T(W,j,re,je.value,D),je!==null&&(e&&je.alternate!==null&&W.delete(je.key===null?re:je.key),v=s(je,v,re),be===null?P=je:be.sibling=je,be=je);return e&&W.forEach(function(jv){return t(j,jv)}),ge&&va(j,re),P}function _e(j,v,N,D){if(typeof N=="object"&&N!==null&&N.type===R&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case q:e:{for(var P=N.key;v!==null;){if(v.key===P){if(P=N.type,P===R){if(v.tag===7){a(j,v.sibling),D=l(v,N.props.children),D.return=j,j=D;break e}}else if(v.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===ue&&kn(P)===v.type){a(j,v.sibling),D=l(v,N.props),pi(D,N),D.return=j,j=D;break e}a(j,v);break}else t(j,v);v=v.sibling}N.type===R?(D=Cn(N.props.children,j.mode,D,N.key),D.return=j,j=D):(D=Ns(N.type,N.key,N.props,null,j.mode,D),pi(D,N),D.return=j,j=D)}return d(j);case X:e:{for(P=N.key;v!==null;){if(v.key===P)if(v.tag===4&&v.stateNode.containerInfo===N.containerInfo&&v.stateNode.implementation===N.implementation){a(j,v.sibling),D=l(v,N.children||[]),D.return=j,j=D;break e}else{a(j,v);break}else t(j,v);v=v.sibling}D=zu(N,j.mode,D),D.return=j,j=D}return d(j);case ue:return N=kn(N),_e(j,v,N,D)}if(ot(N))return F(j,v,N,D);if(We(N)){if(P=We(N),typeof P!="function")throw Error(o(150));return N=P.call(N),ee(j,v,N,D)}if(typeof N.then=="function")return _e(j,v,_s(N),D);if(N.$$typeof===J)return _e(j,v,Ts(j,N),D);ws(j,N)}return typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint"?(N=""+N,v!==null&&v.tag===6?(a(j,v.sibling),D=l(v,N),D.return=j,j=D):(a(j,v),D=ju(N,j.mode,D),D.return=j,j=D),d(j)):a(j,v)}return function(j,v,N,D){try{gi=0;var P=_e(j,v,N,D);return zl=null,P}catch(W){if(W===jl||W===Cs)throw W;var be=wt(29,W,null,j.mode);return be.lanes=D,be.return=j,be}finally{}}}var Un=af(!0),nf=af(!1),Za=!1;function ku(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ru(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ja(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(ze&2)!==0){var l=n.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),n.pending=t,t=Ss(e),Ld(e,null,a),t}return zs(e,n,t,a),Ss(e)}function bi(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Jo(e,a)}}function Uu(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var l=null,s=null;if(a=a.firstBaseUpdate,a!==null){do{var d={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};s===null?l=s=d:s=s.next=d,a=a.next}while(a!==null);s===null?l=s=t:s=s.next=t}else l=s=t;a={baseState:n.baseState,firstBaseUpdate:l,lastBaseUpdate:s,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var qu=!1;function ji(){if(qu){var e=bl;if(e!==null)throw e}}function zi(e,t,a,n){qu=!1;var l=e.updateQueue;Za=!1;var s=l.firstBaseUpdate,d=l.lastBaseUpdate,h=l.shared.pending;if(h!==null){l.shared.pending=null;var m=h,A=m.next;m.next=null,d===null?s=A:d.next=A,d=m;var C=e.alternate;C!==null&&(C=C.updateQueue,h=C.lastBaseUpdate,h!==d&&(h===null?C.firstBaseUpdate=A:h.next=A,C.lastBaseUpdate=m))}if(s!==null){var k=l.baseState;d=0,C=A=m=null,h=s;do{var E=h.lane&-536870913,T=E!==h.lane;if(T?(ye&E)===E:(n&E)===E){E!==0&&E===pl&&(qu=!0),C!==null&&(C=C.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});e:{var F=e,ee=h;E=t;var _e=a;switch(ee.tag){case 1:if(F=ee.payload,typeof F=="function"){k=F.call(_e,k,E);break e}k=F;break e;case 3:F.flags=F.flags&-65537|128;case 0:if(F=ee.payload,E=typeof F=="function"?F.call(_e,k,E):F,E==null)break e;k=M({},k,E);break e;case 2:Za=!0}}E=h.callback,E!==null&&(e.flags|=64,T&&(e.flags|=8192),T=l.callbacks,T===null?l.callbacks=[E]:T.push(E))}else T={lane:E,tag:h.tag,payload:h.payload,callback:h.callback,next:null},C===null?(A=C=T,m=k):C=C.next=T,d|=E;if(h=h.next,h===null){if(h=l.shared.pending,h===null)break;T=h,h=T.next,T.next=null,l.lastBaseUpdate=T,l.shared.pending=null}}while(!0);C===null&&(m=k),l.baseState=m,l.firstBaseUpdate=A,l.lastBaseUpdate=C,s===null&&(l.shared.lanes=0),Pa|=d,e.lanes=d,e.memoizedState=k}}function lf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function sf(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)lf(a[e],t)}var Sl=g(null),Ds=g(0);function cf(e,t){e=Ma,Z(Ds,e),Z(Sl,t),Ma=e|t.baseLanes}function Hu(){Z(Ds,Ma),Z(Sl,Sl.current)}function Qu(){Ma=Ds.current,U(Sl),U(Ds)}var Dt=g(null),Ft=null;function Fa(e){var t=e.alternate;Z(Ge,Ge.current&1),Z(Dt,e),Ft===null&&(t===null||Sl.current!==null||t.memoizedState!==null)&&(Ft=e)}function Lu(e){Z(Ge,Ge.current),Z(Dt,e),Ft===null&&(Ft=e)}function uf(e){e.tag===22?(Z(Ge,Ge.current),Z(Dt,e),Ft===null&&(Ft=e)):$a()}function $a(){Z(Ge,Ge.current),Z(Dt,Dt.current)}function kt(e){U(Dt),Ft===e&&(Ft=null),U(Ge)}var Ge=g(0);function ks(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Zr(a)||Vr(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ba=0,ce=null,Ce=null,Ze=null,Rs=!1,Nl=!1,qn=!1,Us=0,Si=0,Al=null,dy=0;function Qe(){throw Error(o(321))}function Bu(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!_t(e[a],t[a]))return!1;return!0}function Yu(e,t,a,n,l,s){return ba=s,ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Kf:nr,qn=!1,s=a(n,l),qn=!1,Nl&&(s=of(t,a,n,l)),rf(e),s}function rf(e){O.H=Ei;var t=Ce!==null&&Ce.next!==null;if(ba=0,Ze=Ce=ce=null,Rs=!1,Si=0,Al=null,t)throw Error(o(300));e===null||Ve||(e=e.dependencies,e!==null&&Es(e)&&(Ve=!0))}function of(e,t,a,n){ce=e;var l=0;do{if(Nl&&(Al=null),Si=0,Nl=!1,25<=l)throw Error(o(301));if(l+=1,Ze=Ce=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}O.H=Zf,s=t(a,n)}while(Nl);return s}function fy(){var e=O.H,t=e.useState()[0];return t=typeof t.then=="function"?Ni(t):t,e=e.useState()[0],(Ce!==null?Ce.memoizedState:null)!==e&&(ce.flags|=1024),t}function Gu(){var e=Us!==0;return Us=0,e}function Xu(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Ku(e){if(Rs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Rs=!1}ba=0,Ze=Ce=ce=null,Nl=!1,Si=Us=0,Al=null}function xt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ze===null?ce.memoizedState=Ze=e:Ze=Ze.next=e,Ze}function Xe(){if(Ce===null){var e=ce.alternate;e=e!==null?e.memoizedState:null}else e=Ce.next;var t=Ze===null?ce.memoizedState:Ze.next;if(t!==null)Ze=t,Ce=e;else{if(e===null)throw ce.alternate===null?Error(o(467)):Error(o(310));Ce=e,e={memoizedState:Ce.memoizedState,baseState:Ce.baseState,baseQueue:Ce.baseQueue,queue:Ce.queue,next:null},Ze===null?ce.memoizedState=Ze=e:Ze=Ze.next=e}return Ze}function qs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ni(e){var t=Si;return Si+=1,Al===null&&(Al=[]),e=Pd(Al,e,t),t=ce,(Ze===null?t.memoizedState:Ze.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Kf:nr),e}function Hs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ni(e);if(e.$$typeof===J)return st(e)}throw Error(o(438,String(e)))}function Zu(e){var t=null,a=ce.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=ce.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(l){return l.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=qs(),ce.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=He;return t.index++,a}function ja(e,t){return typeof t=="function"?t(e):t}function Qs(e){var t=Xe();return Vu(t,Ce,e)}function Vu(e,t,a){var n=e.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=a;var l=e.baseQueue,s=n.pending;if(s!==null){if(l!==null){var d=l.next;l.next=s.next,s.next=d}t.baseQueue=l=s,n.pending=null}if(s=e.baseState,l===null)e.memoizedState=s;else{t=l.next;var h=d=null,m=null,A=t,C=!1;do{var k=A.lane&-536870913;if(k!==A.lane?(ye&k)===k:(ba&k)===k){var E=A.revertLane;if(E===0)m!==null&&(m=m.next={lane:0,revertLane:0,gesture:null,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null}),k===pl&&(C=!0);else if((ba&E)===E){A=A.next,E===pl&&(C=!0);continue}else k={lane:0,revertLane:A.revertLane,gesture:null,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null},m===null?(h=m=k,d=s):m=m.next=k,ce.lanes|=E,Pa|=E;k=A.action,qn&&a(s,k),s=A.hasEagerState?A.eagerState:a(s,k)}else E={lane:k,revertLane:A.revertLane,gesture:A.gesture,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null},m===null?(h=m=E,d=s):m=m.next=E,ce.lanes|=k,Pa|=k;A=A.next}while(A!==null&&A!==t);if(m===null?d=s:m.next=h,!_t(s,e.memoizedState)&&(Ve=!0,C&&(a=bl,a!==null)))throw a;e.memoizedState=s,e.baseState=d,e.baseQueue=m,n.lastRenderedState=s}return l===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Ju(e){var t=Xe(),a=t.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=e;var n=a.dispatch,l=a.pending,s=t.memoizedState;if(l!==null){a.pending=null;var d=l=l.next;do s=e(s,d.action),d=d.next;while(d!==l);_t(s,t.memoizedState)||(Ve=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),a.lastRenderedState=s}return[s,n]}function df(e,t,a){var n=ce,l=Xe(),s=ge;if(s){if(a===void 0)throw Error(o(407));a=a()}else a=t();var d=!_t((Ce||l).memoizedState,a);if(d&&(l.memoizedState=a,Ve=!0),l=l.queue,Wu(mf.bind(null,n,l,e),[e]),l.getSnapshot!==t||d||Ze!==null&&Ze.memoizedState.tag&1){if(n.flags|=2048,El(9,{destroy:void 0},hf.bind(null,n,l,a,t),null),De===null)throw Error(o(349));s||(ba&127)!==0||ff(n,t,a)}return a}function ff(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ce.updateQueue,t===null?(t=qs(),ce.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function hf(e,t,a,n){t.value=a,t.getSnapshot=n,xf(t)&&yf(e)}function mf(e,t,a){return a(function(){xf(t)&&yf(e)})}function xf(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!_t(e,a)}catch{return!0}}function yf(e){var t=Mn(e,2);t!==null&&At(t,e,2)}function Fu(e){var t=xt();if(typeof e=="function"){var a=e;if(e=a(),qn){Qa(!0);try{a()}finally{Qa(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:e},t}function vf(e,t,a,n){return e.baseState=a,Vu(e,Ce,typeof n=="function"?n:ja)}function hy(e,t,a,n,l){if(Ys(e))throw Error(o(485));if(e=t.action,e!==null){var s={payload:l,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){s.listeners.push(d)}};O.T!==null?a(!0):s.isTransition=!1,n(s),a=t.pending,a===null?(s.next=t.pending=s,gf(t,s)):(s.next=a.next,t.pending=a.next=s)}}function gf(e,t){var a=t.action,n=t.payload,l=e.state;if(t.isTransition){var s=O.T,d={};O.T=d;try{var h=a(l,n),m=O.S;m!==null&&m(d,h),pf(e,t,h)}catch(A){$u(e,t,A)}finally{s!==null&&d.types!==null&&(s.types=d.types),O.T=s}}else try{s=a(l,n),pf(e,t,s)}catch(A){$u(e,t,A)}}function pf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){bf(e,t,n)},function(n){return $u(e,t,n)}):bf(e,t,a)}function bf(e,t,a){t.status="fulfilled",t.value=a,jf(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,gf(e,a)))}function $u(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,jf(t),t=t.next;while(t!==n)}e.action=null}function jf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function zf(e,t){return t}function Sf(e,t){if(ge){var a=De.formState;if(a!==null){e:{var n=ce;if(ge){if(ke){t:{for(var l=ke,s=Jt;l.nodeType!==8;){if(!s){l=null;break t}if(l=$t(l.nextSibling),l===null){l=null;break t}}s=l.data,l=s==="F!"||s==="F"?l:null}if(l){ke=$t(l.nextSibling),n=l.data==="F!";break e}}Xa(n)}n=!1}n&&(t=a[0])}}return a=xt(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zf,lastRenderedState:t},a.queue=n,a=Yf.bind(null,ce,n),n.dispatch=a,n=Fu(!1),s=ar.bind(null,ce,!1,n.queue),n=xt(),l={state:t,dispatch:null,action:e,pending:null},n.queue=l,a=hy.bind(null,ce,l,s,a),l.dispatch=a,n.memoizedState=e,[t,a,!1]}function Nf(e){var t=Xe();return Af(t,Ce,e)}function Af(e,t,a){if(t=Vu(e,t,zf)[0],e=Qs(ja)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Ni(t)}catch(d){throw d===jl?Cs:d}else n=t;t=Xe();var l=t.queue,s=l.dispatch;return a!==t.memoizedState&&(ce.flags|=2048,El(9,{destroy:void 0},my.bind(null,l,a),null)),[n,s,e]}function my(e,t){e.action=t}function Ef(e){var t=Xe(),a=Ce;if(a!==null)return Af(t,a,e);Xe(),t=t.memoizedState,a=Xe();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function El(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=ce.updateQueue,t===null&&(t=qs(),ce.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function Tf(){return Xe().memoizedState}function Ls(e,t,a,n){var l=xt();ce.flags|=e,l.memoizedState=El(1|t,{destroy:void 0},a,n===void 0?null:n)}function Bs(e,t,a,n){var l=Xe();n=n===void 0?null:n;var s=l.memoizedState.inst;Ce!==null&&n!==null&&Bu(n,Ce.memoizedState.deps)?l.memoizedState=El(t,s,a,n):(ce.flags|=e,l.memoizedState=El(1|t,s,a,n))}function Mf(e,t){Ls(8390656,8,e,t)}function Wu(e,t){Bs(2048,8,e,t)}function xy(e){ce.flags|=4;var t=ce.updateQueue;if(t===null)t=qs(),ce.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Cf(e){var t=Xe().memoizedState;return xy({ref:t,nextImpl:e}),function(){if((ze&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Of(e,t){return Bs(4,2,e,t)}function _f(e,t){return Bs(4,4,e,t)}function wf(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Df(e,t,a){a=a!=null?a.concat([e]):null,Bs(4,4,wf.bind(null,t,e),a)}function Iu(){}function kf(e,t){var a=Xe();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&Bu(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function Rf(e,t){var a=Xe();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&Bu(t,n[1]))return n[0];if(n=e(),qn){Qa(!0);try{e()}finally{Qa(!1)}}return a.memoizedState=[n,t],n}function Pu(e,t,a){return a===void 0||(ba&1073741824)!==0&&(ye&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Uh(),ce.lanes|=e,Pa|=e,a)}function Uf(e,t,a,n){return _t(a,t)?a:Sl.current!==null?(e=Pu(e,a,n),_t(e,t)||(Ve=!0),e):(ba&42)===0||(ba&1073741824)!==0&&(ye&261930)===0?(Ve=!0,e.memoizedState=a):(e=Uh(),ce.lanes|=e,Pa|=e,t)}function qf(e,t,a,n,l){var s=K.p;K.p=s!==0&&8>s?s:8;var d=O.T,h={};O.T=h,ar(e,!1,t,a);try{var m=l(),A=O.S;if(A!==null&&A(h,m),m!==null&&typeof m=="object"&&typeof m.then=="function"){var C=oy(m,n);Ai(e,t,C,qt(e))}else Ai(e,t,n,qt(e))}catch(k){Ai(e,t,{then:function(){},status:"rejected",reason:k},qt())}finally{K.p=s,d!==null&&h.types!==null&&(d.types=h.types),O.T=d}}function yy(){}function er(e,t,a,n){if(e.tag!==5)throw Error(o(476));var l=Hf(e).queue;qf(e,l,t,te,a===null?yy:function(){return Qf(e),a(n)})}function Hf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:te},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qf(e){var t=Hf(e);t.next===null&&(t=e.alternate.memoizedState),Ai(e,t.next.queue,{},qt())}function tr(){return st(Yi)}function Lf(){return Xe().memoizedState}function Bf(){return Xe().memoizedState}function vy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=qt();e=Va(a);var n=Ja(t,e,a);n!==null&&(At(n,t,a),bi(n,t,a)),t={cache:Ou()},e.payload=t;return}t=t.return}}function gy(e,t,a){var n=qt();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ys(e)?Gf(t,a):(a=pu(e,t,a,n),a!==null&&(At(a,e,n),Xf(a,t,n)))}function Yf(e,t,a){var n=qt();Ai(e,t,a,n)}function Ai(e,t,a,n){var l={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ys(e))Gf(t,l);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var d=t.lastRenderedState,h=s(d,a);if(l.hasEagerState=!0,l.eagerState=h,_t(h,d))return zs(e,t,l,0),De===null&&js(),!1}catch{}finally{}if(a=pu(e,t,l,n),a!==null)return At(a,e,n),Xf(a,t,n),!0}return!1}function ar(e,t,a,n){if(n={lane:2,revertLane:kr(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ys(e)){if(t)throw Error(o(479))}else t=pu(e,a,n,2),t!==null&&At(t,e,2)}function Ys(e){var t=e.alternate;return e===ce||t!==null&&t===ce}function Gf(e,t){Nl=Rs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Xf(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Jo(e,a)}}var Ei={readContext:st,use:Hs,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useLayoutEffect:Qe,useInsertionEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useSyncExternalStore:Qe,useId:Qe,useHostTransitionStatus:Qe,useFormState:Qe,useActionState:Qe,useOptimistic:Qe,useMemoCache:Qe,useCacheRefresh:Qe};Ei.useEffectEvent=Qe;var Kf={readContext:st,use:Hs,useCallback:function(e,t){return xt().memoizedState=[e,t===void 0?null:t],e},useContext:st,useEffect:Mf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Ls(4194308,4,wf.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Ls(4194308,4,e,t)},useInsertionEffect:function(e,t){Ls(4,2,e,t)},useMemo:function(e,t){var a=xt();t=t===void 0?null:t;var n=e();if(qn){Qa(!0);try{e()}finally{Qa(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=xt();if(a!==void 0){var l=a(t);if(qn){Qa(!0);try{a(t)}finally{Qa(!1)}}}else l=t;return n.memoizedState=n.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},n.queue=e,e=e.dispatch=gy.bind(null,ce,e),[n.memoizedState,e]},useRef:function(e){var t=xt();return e={current:e},t.memoizedState=e},useState:function(e){e=Fu(e);var t=e.queue,a=Yf.bind(null,ce,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Iu,useDeferredValue:function(e,t){var a=xt();return Pu(a,e,t)},useTransition:function(){var e=Fu(!1);return e=qf.bind(null,ce,e.queue,!0,!1),xt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=ce,l=xt();if(ge){if(a===void 0)throw Error(o(407));a=a()}else{if(a=t(),De===null)throw Error(o(349));(ye&127)!==0||ff(n,t,a)}l.memoizedState=a;var s={value:a,getSnapshot:t};return l.queue=s,Mf(mf.bind(null,n,s,e),[e]),n.flags|=2048,El(9,{destroy:void 0},hf.bind(null,n,s,a,t),null),a},useId:function(){var e=xt(),t=De.identifierPrefix;if(ge){var a=ca,n=sa;a=(n&~(1<<32-Ot(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Us++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=dy++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:tr,useFormState:Sf,useActionState:Sf,useOptimistic:function(e){var t=xt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=ar.bind(null,ce,!0,a),a.dispatch=t,[e,t]},useMemoCache:Zu,useCacheRefresh:function(){return xt().memoizedState=vy.bind(null,ce)},useEffectEvent:function(e){var t=xt(),a={impl:e};return t.memoizedState=a,function(){if((ze&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}},nr={readContext:st,use:Hs,useCallback:kf,useContext:st,useEffect:Wu,useImperativeHandle:Df,useInsertionEffect:Of,useLayoutEffect:_f,useMemo:Rf,useReducer:Qs,useRef:Tf,useState:function(){return Qs(ja)},useDebugValue:Iu,useDeferredValue:function(e,t){var a=Xe();return Uf(a,Ce.memoizedState,e,t)},useTransition:function(){var e=Qs(ja)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Ni(e),t]},useSyncExternalStore:df,useId:Lf,useHostTransitionStatus:tr,useFormState:Nf,useActionState:Nf,useOptimistic:function(e,t){var a=Xe();return vf(a,Ce,e,t)},useMemoCache:Zu,useCacheRefresh:Bf};nr.useEffectEvent=Cf;var Zf={readContext:st,use:Hs,useCallback:kf,useContext:st,useEffect:Wu,useImperativeHandle:Df,useInsertionEffect:Of,useLayoutEffect:_f,useMemo:Rf,useReducer:Ju,useRef:Tf,useState:function(){return Ju(ja)},useDebugValue:Iu,useDeferredValue:function(e,t){var a=Xe();return Ce===null?Pu(a,e,t):Uf(a,Ce.memoizedState,e,t)},useTransition:function(){var e=Ju(ja)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Ni(e),t]},useSyncExternalStore:df,useId:Lf,useHostTransitionStatus:tr,useFormState:Ef,useActionState:Ef,useOptimistic:function(e,t){var a=Xe();return Ce!==null?vf(a,Ce,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Zu,useCacheRefresh:Bf};Zf.useEffectEvent=Cf;function lr(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:M({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var ir={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=qt(),l=Va(n);l.payload=t,a!=null&&(l.callback=a),t=Ja(e,l,n),t!==null&&(At(t,e,n),bi(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=qt(),l=Va(n);l.tag=1,l.payload=t,a!=null&&(l.callback=a),t=Ja(e,l,n),t!==null&&(At(t,e,n),bi(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=qt(),n=Va(a);n.tag=2,t!=null&&(n.callback=t),t=Ja(e,n,a),t!==null&&(At(t,e,a),bi(t,e,a))}};function Vf(e,t,a,n,l,s,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,s,d):t.prototype&&t.prototype.isPureReactComponent?!fi(a,n)||!fi(l,s):!0}function Jf(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&ir.enqueueReplaceState(t,t.state,null)}function Hn(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=M({},a));for(var l in e)a[l]===void 0&&(a[l]=e[l])}return a}function Ff(e){bs(e)}function $f(e){console.error(e)}function Wf(e){bs(e)}function Gs(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function If(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function sr(e,t,a){return a=Va(a),a.tag=3,a.payload={element:null},a.callback=function(){Gs(e,t)},a}function Pf(e){return e=Va(e),e.tag=3,e}function eh(e,t,a,n){var l=a.type.getDerivedStateFromError;if(typeof l=="function"){var s=n.value;e.payload=function(){return l(s)},e.callback=function(){If(t,a,n)}}var d=a.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){If(t,a,n),typeof l!="function"&&(en===null?en=new Set([this]):en.add(this));var h=n.stack;this.componentDidCatch(n.value,{componentStack:h!==null?h:""})})}function py(e,t,a,n,l){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&gl(t,a,l,!0),a=Dt.current,a!==null){switch(a.tag){case 31:case 13:return Ft===null?tc():a.alternate===null&&Le===0&&(Le=3),a.flags&=-257,a.flags|=65536,a.lanes=l,n===Os?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),_r(e,n,l)),!1;case 22:return a.flags|=65536,n===Os?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),_r(e,n,l)),!1}throw Error(o(435,a.tag))}return _r(e,n,l),tc(),!1}if(ge)return t=Dt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=l,n!==Au&&(e=Error(o(422),{cause:n}),xi(Kt(e,a)))):(n!==Au&&(t=Error(o(423),{cause:n}),xi(Kt(t,a))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,n=Kt(n,a),l=sr(e.stateNode,n,l),Uu(e,l),Le!==4&&(Le=2)),!1;var s=Error(o(520),{cause:n});if(s=Kt(s,a),ki===null?ki=[s]:ki.push(s),Le!==4&&(Le=2),t===null)return!0;n=Kt(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=l&-l,a.lanes|=e,e=sr(a.stateNode,n,e),Uu(a,e),!1;case 1:if(t=a.type,s=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(en===null||!en.has(s))))return a.flags|=65536,l&=-l,a.lanes|=l,l=Pf(l),eh(l,e,a,n),Uu(a,l),!1}a=a.return}while(a!==null);return!1}var cr=Error(o(461)),Ve=!1;function ct(e,t,a,n){t.child=e===null?nf(t,null,a,n):Un(t,e.child,a,n)}function th(e,t,a,n,l){a=a.render;var s=t.ref;if("ref"in n){var d={};for(var h in n)h!=="ref"&&(d[h]=n[h])}else d=n;return wn(t),n=Yu(e,t,a,d,s,l),h=Gu(),e!==null&&!Ve?(Xu(e,t,l),za(e,t,l)):(ge&&h&&Su(t),t.flags|=1,ct(e,t,n,l),t.child)}function ah(e,t,a,n,l){if(e===null){var s=a.type;return typeof s=="function"&&!bu(s)&&s.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=s,nh(e,t,s,n,l)):(e=Ns(a.type,null,n,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!xr(e,l)){var d=s.memoizedProps;if(a=a.compare,a=a!==null?a:fi,a(d,n)&&e.ref===t.ref)return za(e,t,l)}return t.flags|=1,e=ya(s,n),e.ref=t.ref,e.return=t,t.child=e}function nh(e,t,a,n,l){if(e!==null){var s=e.memoizedProps;if(fi(s,n)&&e.ref===t.ref)if(Ve=!1,t.pendingProps=n=s,xr(e,l))(e.flags&131072)!==0&&(Ve=!0);else return t.lanes=e.lanes,za(e,t,l)}return ur(e,t,a,n,l)}function lh(e,t,a,n){var l=n.children,s=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(s=s!==null?s.baseLanes|a:a,e!==null){for(n=t.child=e.child,l=0;n!==null;)l=l|n.lanes|n.childLanes,n=n.sibling;n=l&~s}else n=0,t.child=null;return ih(e,t,s,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ms(t,s!==null?s.cachePool:null),s!==null?cf(t,s):Hu(),uf(t);else return n=t.lanes=536870912,ih(e,t,s!==null?s.baseLanes|a:a,a,n)}else s!==null?(Ms(t,s.cachePool),cf(t,s),$a(),t.memoizedState=null):(e!==null&&Ms(t,null),Hu(),$a());return ct(e,t,l,a),t.child}function Ti(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ih(e,t,a,n,l){var s=wu();return s=s===null?null:{parent:Ke._currentValue,pool:s},t.memoizedState={baseLanes:a,cachePool:s},e!==null&&Ms(t,null),Hu(),uf(t),e!==null&&gl(e,t,n,!0),t.childLanes=l,null}function Xs(e,t){return t=Zs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function sh(e,t,a){return Un(t,e.child,null,a),e=Xs(t,t.pendingProps),e.flags|=2,kt(t),t.memoizedState=null,e}function by(e,t,a){var n=t.pendingProps,l=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ge){if(n.mode==="hidden")return e=Xs(t,n),t.lanes=536870912,Ti(null,e);if(Lu(t),(e=ke)?(e=g0(e,Jt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ya!==null?{id:sa,overflow:ca}:null,retryLane:536870912,hydrationErrors:null},a=Yd(e),a.return=t,t.child=a,it=t,ke=null)):e=null,e===null)throw Xa(t);return t.lanes=536870912,null}return Xs(t,n)}var s=e.memoizedState;if(s!==null){var d=s.dehydrated;if(Lu(t),l)if(t.flags&256)t.flags&=-257,t=sh(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Ve||gl(e,t,a,!1),l=(a&e.childLanes)!==0,Ve||l){if(n=De,n!==null&&(d=Fo(n,a),d!==0&&d!==s.retryLane))throw s.retryLane=d,Mn(e,d),At(n,e,d),cr;tc(),t=sh(e,t,a)}else e=s.treeContext,ke=$t(d.nextSibling),it=t,ge=!0,Ga=null,Jt=!1,e!==null&&Kd(t,e),t=Xs(t,n),t.flags|=4096;return t}return e=ya(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ks(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(o(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function ur(e,t,a,n,l){return wn(t),a=Yu(e,t,a,n,void 0,l),n=Gu(),e!==null&&!Ve?(Xu(e,t,l),za(e,t,l)):(ge&&n&&Su(t),t.flags|=1,ct(e,t,a,l),t.child)}function ch(e,t,a,n,l,s){return wn(t),t.updateQueue=null,a=of(t,n,a,l),rf(e),n=Gu(),e!==null&&!Ve?(Xu(e,t,s),za(e,t,s)):(ge&&n&&Su(t),t.flags|=1,ct(e,t,a,s),t.child)}function uh(e,t,a,n,l){if(wn(t),t.stateNode===null){var s=ml,d=a.contextType;typeof d=="object"&&d!==null&&(s=st(d)),s=new a(n,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=ir,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=n,s.state=t.memoizedState,s.refs={},ku(t),d=a.contextType,s.context=typeof d=="object"&&d!==null?st(d):ml,s.state=t.memoizedState,d=a.getDerivedStateFromProps,typeof d=="function"&&(lr(t,a,d,n),s.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(d=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),d!==s.state&&ir.enqueueReplaceState(s,s.state,null),zi(t,n,s,l),ji(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){s=t.stateNode;var h=t.memoizedProps,m=Hn(a,h);s.props=m;var A=s.context,C=a.contextType;d=ml,typeof C=="object"&&C!==null&&(d=st(C));var k=a.getDerivedStateFromProps;C=typeof k=="function"||typeof s.getSnapshotBeforeUpdate=="function",h=t.pendingProps!==h,C||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(h||A!==d)&&Jf(t,s,n,d),Za=!1;var E=t.memoizedState;s.state=E,zi(t,n,s,l),ji(),A=t.memoizedState,h||E!==A||Za?(typeof k=="function"&&(lr(t,a,k,n),A=t.memoizedState),(m=Za||Vf(t,a,m,n,E,A,d))?(C||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=A),s.props=n,s.state=A,s.context=d,n=m):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{s=t.stateNode,Ru(e,t),d=t.memoizedProps,C=Hn(a,d),s.props=C,k=t.pendingProps,E=s.context,A=a.contextType,m=ml,typeof A=="object"&&A!==null&&(m=st(A)),h=a.getDerivedStateFromProps,(A=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(d!==k||E!==m)&&Jf(t,s,n,m),Za=!1,E=t.memoizedState,s.state=E,zi(t,n,s,l),ji();var T=t.memoizedState;d!==k||E!==T||Za||e!==null&&e.dependencies!==null&&Es(e.dependencies)?(typeof h=="function"&&(lr(t,a,h,n),T=t.memoizedState),(C=Za||Vf(t,a,C,n,E,T,m)||e!==null&&e.dependencies!==null&&Es(e.dependencies))?(A||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,T,m),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,T,m)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||d===e.memoizedProps&&E===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&E===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=T),s.props=n,s.state=T,s.context=m,n=C):(typeof s.componentDidUpdate!="function"||d===e.memoizedProps&&E===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&E===e.memoizedState||(t.flags|=1024),n=!1)}return s=n,Ks(e,t),n=(t.flags&128)!==0,s||n?(s=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&n?(t.child=Un(t,e.child,null,l),t.child=Un(t,null,a,l)):ct(e,t,a,l),t.memoizedState=s.state,e=t.child):e=za(e,t,l),e}function rh(e,t,a,n){return On(),t.flags|=256,ct(e,t,a,n),t.child}var rr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function or(e){return{baseLanes:e,cachePool:Wd()}}function dr(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ut),e}function oh(e,t,a){var n=t.pendingProps,l=!1,s=(t.flags&128)!==0,d;if((d=s)||(d=e!==null&&e.memoizedState===null?!1:(Ge.current&2)!==0),d&&(l=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(ge){if(l?Fa(t):$a(),(e=ke)?(e=g0(e,Jt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ya!==null?{id:sa,overflow:ca}:null,retryLane:536870912,hydrationErrors:null},a=Yd(e),a.return=t,t.child=a,it=t,ke=null)):e=null,e===null)throw Xa(t);return Vr(e)?t.lanes=32:t.lanes=536870912,null}var h=n.children;return n=n.fallback,l?($a(),l=t.mode,h=Zs({mode:"hidden",children:h},l),n=Cn(n,l,a,null),h.return=t,n.return=t,h.sibling=n,t.child=h,n=t.child,n.memoizedState=or(a),n.childLanes=dr(e,d,a),t.memoizedState=rr,Ti(null,n)):(Fa(t),fr(t,h))}var m=e.memoizedState;if(m!==null&&(h=m.dehydrated,h!==null)){if(s)t.flags&256?(Fa(t),t.flags&=-257,t=hr(e,t,a)):t.memoizedState!==null?($a(),t.child=e.child,t.flags|=128,t=null):($a(),h=n.fallback,l=t.mode,n=Zs({mode:"visible",children:n.children},l),h=Cn(h,l,a,null),h.flags|=2,n.return=t,h.return=t,n.sibling=h,t.child=n,Un(t,e.child,null,a),n=t.child,n.memoizedState=or(a),n.childLanes=dr(e,d,a),t.memoizedState=rr,t=Ti(null,n));else if(Fa(t),Vr(h)){if(d=h.nextSibling&&h.nextSibling.dataset,d)var A=d.dgst;d=A,n=Error(o(419)),n.stack="",n.digest=d,xi({value:n,source:null,stack:null}),t=hr(e,t,a)}else if(Ve||gl(e,t,a,!1),d=(a&e.childLanes)!==0,Ve||d){if(d=De,d!==null&&(n=Fo(d,a),n!==0&&n!==m.retryLane))throw m.retryLane=n,Mn(e,n),At(d,e,n),cr;Zr(h)||tc(),t=hr(e,t,a)}else Zr(h)?(t.flags|=192,t.child=e.child,t=null):(e=m.treeContext,ke=$t(h.nextSibling),it=t,ge=!0,Ga=null,Jt=!1,e!==null&&Kd(t,e),t=fr(t,n.children),t.flags|=4096);return t}return l?($a(),h=n.fallback,l=t.mode,m=e.child,A=m.sibling,n=ya(m,{mode:"hidden",children:n.children}),n.subtreeFlags=m.subtreeFlags&65011712,A!==null?h=ya(A,h):(h=Cn(h,l,a,null),h.flags|=2),h.return=t,n.return=t,n.sibling=h,t.child=n,Ti(null,n),n=t.child,h=e.child.memoizedState,h===null?h=or(a):(l=h.cachePool,l!==null?(m=Ke._currentValue,l=l.parent!==m?{parent:m,pool:m}:l):l=Wd(),h={baseLanes:h.baseLanes|a,cachePool:l}),n.memoizedState=h,n.childLanes=dr(e,d,a),t.memoizedState=rr,Ti(e.child,n)):(Fa(t),a=e.child,e=a.sibling,a=ya(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=a,t.memoizedState=null,a)}function fr(e,t){return t=Zs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Zs(e,t){return e=wt(22,e,null,t),e.lanes=0,e}function hr(e,t,a){return Un(t,e.child,null,a),e=fr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dh(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Mu(e.return,t,a)}function mr(e,t,a,n,l,s){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:l,treeForkCount:s}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=n,d.tail=a,d.tailMode=l,d.treeForkCount=s)}function fh(e,t,a){var n=t.pendingProps,l=n.revealOrder,s=n.tail;n=n.children;var d=Ge.current,h=(d&2)!==0;if(h?(d=d&1|2,t.flags|=128):d&=1,Z(Ge,d),ct(e,t,n,a),n=ge?mi:0,!h&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dh(e,a,t);else if(e.tag===19)dh(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(l){case"forwards":for(a=t.child,l=null;a!==null;)e=a.alternate,e!==null&&ks(e)===null&&(l=a),a=a.sibling;a=l,a===null?(l=t.child,t.child=null):(l=a.sibling,a.sibling=null),mr(t,!1,l,a,s,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&ks(e)===null){t.child=l;break}e=l.sibling,l.sibling=a,a=l,l=e}mr(t,!0,a,null,s,n);break;case"together":mr(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function za(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Pa|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(gl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,a=ya(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ya(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function xr(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Es(e)))}function jy(e,t,a){switch(t.tag){case 3:mt(t,t.stateNode.containerInfo),Ka(t,Ke,e.memoizedState.cache),On();break;case 27:case 5:Pl(t);break;case 4:mt(t,t.stateNode.containerInfo);break;case 10:Ka(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Lu(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Fa(t),t.flags|=128,null):(a&t.child.childLanes)!==0?oh(e,t,a):(Fa(t),e=za(e,t,a),e!==null?e.sibling:null);Fa(t);break;case 19:var l=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(gl(e,t,a,!1),n=(a&t.childLanes)!==0),l){if(n)return fh(e,t,a);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),Z(Ge,Ge.current),n)break;return null;case 22:return t.lanes=0,lh(e,t,a,t.pendingProps);case 24:Ka(t,Ke,e.memoizedState.cache)}return za(e,t,a)}function hh(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ve=!0;else{if(!xr(e,a)&&(t.flags&128)===0)return Ve=!1,jy(e,t,a);Ve=(e.flags&131072)!==0}else Ve=!1,ge&&(t.flags&1048576)!==0&&Xd(t,mi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=kn(t.elementType),t.type=e,typeof e=="function")bu(e)?(n=Hn(e,n),t.tag=1,t=uh(null,t,e,n,a)):(t.tag=0,t=ur(null,t,e,n,a));else{if(e!=null){var l=e.$$typeof;if(l===w){t.tag=11,t=th(null,t,e,n,a);break e}else if(l===ne){t.tag=14,t=ah(null,t,e,n,a);break e}}throw t=gt(e)||e,Error(o(306,t,""))}}return t;case 0:return ur(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,l=Hn(n,t.pendingProps),uh(e,t,n,l,a);case 3:e:{if(mt(t,t.stateNode.containerInfo),e===null)throw Error(o(387));n=t.pendingProps;var s=t.memoizedState;l=s.element,Ru(e,t),zi(t,n,null,a);var d=t.memoizedState;if(n=d.cache,Ka(t,Ke,n),n!==s.cache&&Cu(t,[Ke],a,!0),ji(),n=d.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=rh(e,t,n,a);break e}else if(n!==l){l=Kt(Error(o(424)),t),xi(l),t=rh(e,t,n,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ke=$t(e.firstChild),it=t,ge=!0,Ga=null,Jt=!0,a=nf(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(On(),n===l){t=za(e,t,a);break e}ct(e,t,n,a)}t=t.child}return t;case 26:return Ks(e,t),e===null?(a=N0(t.type,null,t.pendingProps,null))?t.memoizedState=a:ge||(a=t.type,e=t.pendingProps,n=uc(he.current).createElement(a),n[lt]=t,n[pt]=e,ut(n,a,e),tt(n),t.stateNode=n):t.memoizedState=N0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Pl(t),e===null&&ge&&(n=t.stateNode=j0(t.type,t.pendingProps,he.current),it=t,Jt=!0,l=ke,ln(t.type)?(Jr=l,ke=$t(n.firstChild)):ke=l),ct(e,t,t.pendingProps.children,a),Ks(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ge&&((l=n=ke)&&(n=Wy(n,t.type,t.pendingProps,Jt),n!==null?(t.stateNode=n,it=t,ke=$t(n.firstChild),Jt=!1,l=!0):l=!1),l||Xa(t)),Pl(t),l=t.type,s=t.pendingProps,d=e!==null?e.memoizedProps:null,n=s.children,Gr(l,s)?n=null:d!==null&&Gr(l,d)&&(t.flags|=32),t.memoizedState!==null&&(l=Yu(e,t,fy,null,null,a),Yi._currentValue=l),Ks(e,t),ct(e,t,n,a),t.child;case 6:return e===null&&ge&&((e=a=ke)&&(a=Iy(a,t.pendingProps,Jt),a!==null?(t.stateNode=a,it=t,ke=null,e=!0):e=!1),e||Xa(t)),null;case 13:return oh(e,t,a);case 4:return mt(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Un(t,null,n,a):ct(e,t,n,a),t.child;case 11:return th(e,t,t.type,t.pendingProps,a);case 7:return ct(e,t,t.pendingProps,a),t.child;case 8:return ct(e,t,t.pendingProps.children,a),t.child;case 12:return ct(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,Ka(t,t.type,n.value),ct(e,t,n.children,a),t.child;case 9:return l=t.type._context,n=t.pendingProps.children,wn(t),l=st(l),n=n(l),t.flags|=1,ct(e,t,n,a),t.child;case 14:return ah(e,t,t.type,t.pendingProps,a);case 15:return nh(e,t,t.type,t.pendingProps,a);case 19:return fh(e,t,a);case 31:return by(e,t,a);case 22:return lh(e,t,a,t.pendingProps);case 24:return wn(t),n=st(Ke),e===null?(l=wu(),l===null&&(l=De,s=Ou(),l.pooledCache=s,s.refCount++,s!==null&&(l.pooledCacheLanes|=a),l=s),t.memoizedState={parent:n,cache:l},ku(t),Ka(t,Ke,l)):((e.lanes&a)!==0&&(Ru(e,t),zi(t,null,null,a),ji()),l=e.memoizedState,s=t.memoizedState,l.parent!==n?(l={parent:n,cache:n},t.memoizedState=l,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=l),Ka(t,Ke,n)):(n=s.cache,Ka(t,Ke,n),n!==l.cache&&Cu(t,[Ke],a,!0))),ct(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Sa(e){e.flags|=4}function yr(e,t,a,n,l){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(l&335544128)===l)if(e.stateNode.complete)e.flags|=8192;else if(Lh())e.flags|=8192;else throw Rn=Os,Du}else e.flags&=-16777217}function mh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!C0(t))if(Lh())e.flags|=8192;else throw Rn=Os,Du}function Vs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Zo():536870912,e.lanes|=t,Ol|=t)}function Mi(e,t){if(!ge)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Re(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var l=e.child;l!==null;)a|=l.lanes|l.childLanes,n|=l.subtreeFlags&65011712,n|=l.flags&65011712,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)a|=l.lanes|l.childLanes,n|=l.subtreeFlags,n|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function zy(e,t,a){var n=t.pendingProps;switch(Nu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Re(t),null;case 1:return Re(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),pa(Ke),Ye(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(vl(t)?Sa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Eu())),Re(t),null;case 26:var l=t.type,s=t.memoizedState;return e===null?(Sa(t),s!==null?(Re(t),mh(t,s)):(Re(t),yr(t,l,null,n,a))):s?s!==e.memoizedState?(Sa(t),Re(t),mh(t,s)):(Re(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Sa(t),Re(t),yr(t,l,e,n,a)),null;case 27:if(ls(t),a=he.current,l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Sa(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return Re(t),null}e=$.current,vl(t)?Zd(t):(e=j0(l,n,a),t.stateNode=e,Sa(t))}return Re(t),null;case 5:if(ls(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Sa(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return Re(t),null}if(s=$.current,vl(t))Zd(t);else{var d=uc(he.current);switch(s){case 1:s=d.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:s=d.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":s=d.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":s=d.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":s=d.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof n.is=="string"?d.createElement("select",{is:n.is}):d.createElement("select"),n.multiple?s.multiple=!0:n.size&&(s.size=n.size);break;default:s=typeof n.is=="string"?d.createElement(l,{is:n.is}):d.createElement(l)}}s[lt]=t,s[pt]=n;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)s.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=s;e:switch(ut(s,l,n),l){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Sa(t)}}return Re(t),yr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Sa(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(o(166));if(e=he.current,vl(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,l=it,l!==null)switch(l.tag){case 27:case 5:n=l.memoizedProps}e[lt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||o0(e.nodeValue,a)),e||Xa(t,!0)}else e=uc(e).createTextNode(n),e[lt]=t,t.stateNode=e}return Re(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=vl(t),a!==null){if(e===null){if(!n)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[lt]=t}else On(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Re(t),e=!1}else a=Eu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(kt(t),t):(kt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Re(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=vl(t),n!==null&&n.dehydrated!==null){if(e===null){if(!l)throw Error(o(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(o(317));l[lt]=t}else On(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Re(t),l=!1}else l=Eu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(kt(t),t):(kt(t),null)}return kt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,l=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(l=n.alternate.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==l&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Vs(t,t.updateQueue),Re(t),null);case 4:return Ye(),e===null&&Hr(t.stateNode.containerInfo),Re(t),null;case 10:return pa(t.type),Re(t),null;case 19:if(U(Ge),n=t.memoizedState,n===null)return Re(t),null;if(l=(t.flags&128)!==0,s=n.rendering,s===null)if(l)Mi(n,!1);else{if(Le!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=ks(e),s!==null){for(t.flags|=128,Mi(n,!1),e=s.updateQueue,t.updateQueue=e,Vs(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Bd(a,e),a=a.sibling;return Z(Ge,Ge.current&1|2),ge&&va(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Mt()>Is&&(t.flags|=128,l=!0,Mi(n,!1),t.lanes=4194304)}else{if(!l)if(e=ks(s),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,Vs(t,e),Mi(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!ge)return Re(t),null}else 2*Mt()-n.renderingStartTime>Is&&a!==536870912&&(t.flags|=128,l=!0,Mi(n,!1),t.lanes=4194304);n.isBackwards?(s.sibling=t.child,t.child=s):(e=n.last,e!==null?e.sibling=s:t.child=s,n.last=s)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=Mt(),e.sibling=null,a=Ge.current,Z(Ge,l?a&1|2:a&1),ge&&va(t,n.treeForkCount),e):(Re(t),null);case 22:case 23:return kt(t),Qu(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(Re(t),t.subtreeFlags&6&&(t.flags|=8192)):Re(t),a=t.updateQueue,a!==null&&Vs(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&U(Dn),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),pa(Ke),Re(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Sy(e,t){switch(Nu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pa(Ke),Ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ls(t),null;case 31:if(t.memoizedState!==null){if(kt(t),t.alternate===null)throw Error(o(340));On()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(kt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));On()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(Ge),null;case 4:return Ye(),null;case 10:return pa(t.type),null;case 22:case 23:return kt(t),Qu(),e!==null&&U(Dn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return pa(Ke),null;case 25:return null;default:return null}}function xh(e,t){switch(Nu(t),t.tag){case 3:pa(Ke),Ye();break;case 26:case 27:case 5:ls(t);break;case 4:Ye();break;case 31:t.memoizedState!==null&&kt(t);break;case 13:kt(t);break;case 19:U(Ge);break;case 10:pa(t.type);break;case 22:case 23:kt(t),Qu(),e!==null&&U(Dn);break;case 24:pa(Ke)}}function Ci(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var l=n.next;a=l;do{if((a.tag&e)===e){n=void 0;var s=a.create,d=a.inst;n=s(),d.destroy=n}a=a.next}while(a!==l)}}catch(h){Te(t,t.return,h)}}function Wa(e,t,a){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var s=l.next;n=s;do{if((n.tag&e)===e){var d=n.inst,h=d.destroy;if(h!==void 0){d.destroy=void 0,l=t;var m=a,A=h;try{A()}catch(C){Te(l,m,C)}}}n=n.next}while(n!==s)}}catch(C){Te(t,t.return,C)}}function yh(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{sf(t,a)}catch(n){Te(e,e.return,n)}}}function vh(e,t,a){a.props=Hn(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){Te(e,t,n)}}function Oi(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(l){Te(e,t,l)}}function ua(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(l){Te(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(l){Te(e,t,l)}else a.current=null}function gh(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(l){Te(e,e.return,l)}}function vr(e,t,a){try{var n=e.stateNode;Ky(n,e.type,a,t),n[pt]=t}catch(l){Te(e,e.return,l)}}function ph(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ln(e.type)||e.tag===4}function gr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ph(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ln(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function pr(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=ma));else if(n!==4&&(n===27&&ln(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(pr(e,t,a),e=e.sibling;e!==null;)pr(e,t,a),e=e.sibling}function Js(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&ln(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Js(e,t,a),e=e.sibling;e!==null;)Js(e,t,a),e=e.sibling}function bh(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);ut(t,n,a),t[lt]=e,t[pt]=a}catch(s){Te(e,e.return,s)}}var Na=!1,Je=!1,br=!1,jh=typeof WeakSet=="function"?WeakSet:Set,at=null;function Ny(e,t){if(e=e.containerInfo,Br=xc,e=wd(e),hu(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var l=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{a.nodeType,s.nodeType}catch{a=null;break e}var d=0,h=-1,m=-1,A=0,C=0,k=e,E=null;t:for(;;){for(var T;k!==a||l!==0&&k.nodeType!==3||(h=d+l),k!==s||n!==0&&k.nodeType!==3||(m=d+n),k.nodeType===3&&(d+=k.nodeValue.length),(T=k.firstChild)!==null;)E=k,k=T;for(;;){if(k===e)break t;if(E===a&&++A===l&&(h=d),E===s&&++C===n&&(m=d),(T=k.nextSibling)!==null)break;k=E,E=k.parentNode}k=T}a=h===-1||m===-1?null:{start:h,end:m}}else a=null}a=a||{start:0,end:0}}else a=null;for(Yr={focusedElem:e,selectionRange:a},xc=!1,at=t;at!==null;)if(t=at,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,at=e;else for(;at!==null;){switch(t=at,s=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)l=e[a],l.ref.impl=l.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&s!==null){e=void 0,a=t,l=s.memoizedProps,s=s.memoizedState,n=a.stateNode;try{var F=Hn(a.type,l);e=n.getSnapshotBeforeUpdate(F,s),n.__reactInternalSnapshotBeforeUpdate=e}catch(ee){Te(a,a.return,ee)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Kr(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Kr(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,at=e;break}at=t.return}}function zh(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:Ea(e,a),n&4&&Ci(5,a);break;case 1:if(Ea(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(d){Te(a,a.return,d)}else{var l=Hn(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Te(a,a.return,d)}}n&64&&yh(a),n&512&&Oi(a,a.return);break;case 3:if(Ea(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{sf(e,t)}catch(d){Te(a,a.return,d)}}break;case 27:t===null&&n&4&&bh(a);case 26:case 5:Ea(e,a),t===null&&n&4&&gh(a),n&512&&Oi(a,a.return);break;case 12:Ea(e,a);break;case 31:Ea(e,a),n&4&&Ah(e,a);break;case 13:Ea(e,a),n&4&&Eh(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Dy.bind(null,a),Py(e,a))));break;case 22:if(n=a.memoizedState!==null||Na,!n){t=t!==null&&t.memoizedState!==null||Je,l=Na;var s=Je;Na=n,(Je=t)&&!s?Ta(e,a,(a.subtreeFlags&8772)!==0):Ea(e,a),Na=l,Je=s}break;case 30:break;default:Ea(e,a)}}function Sh(e){var t=e.alternate;t!==null&&(e.alternate=null,Sh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&$c(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var qe=null,jt=!1;function Aa(e,t,a){for(a=a.child;a!==null;)Nh(e,t,a),a=a.sibling}function Nh(e,t,a){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(ei,a)}catch{}switch(a.tag){case 26:Je||ua(a,t),Aa(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Je||ua(a,t);var n=qe,l=jt;ln(a.type)&&(qe=a.stateNode,jt=!1),Aa(e,t,a),Qi(a.stateNode),qe=n,jt=l;break;case 5:Je||ua(a,t);case 6:if(n=qe,l=jt,qe=null,Aa(e,t,a),qe=n,jt=l,qe!==null)if(jt)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(a.stateNode)}catch(s){Te(a,t,s)}else try{qe.removeChild(a.stateNode)}catch(s){Te(a,t,s)}break;case 18:qe!==null&&(jt?(e=qe,y0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Hl(e)):y0(qe,a.stateNode));break;case 4:n=qe,l=jt,qe=a.stateNode.containerInfo,jt=!0,Aa(e,t,a),qe=n,jt=l;break;case 0:case 11:case 14:case 15:Wa(2,a,t),Je||Wa(4,a,t),Aa(e,t,a);break;case 1:Je||(ua(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&vh(a,t,n)),Aa(e,t,a);break;case 21:Aa(e,t,a);break;case 22:Je=(n=Je)||a.memoizedState!==null,Aa(e,t,a),Je=n;break;default:Aa(e,t,a)}}function Ah(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hl(e)}catch(a){Te(t,t.return,a)}}}function Eh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hl(e)}catch(a){Te(t,t.return,a)}}function Ay(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new jh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new jh),t;default:throw Error(o(435,e.tag))}}function Fs(e,t){var a=Ay(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var l=ky.bind(null,e,n);n.then(l,l)}})}function zt(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var l=a[n],s=e,d=t,h=d;e:for(;h!==null;){switch(h.tag){case 27:if(ln(h.type)){qe=h.stateNode,jt=!1;break e}break;case 5:qe=h.stateNode,jt=!1;break e;case 3:case 4:qe=h.stateNode.containerInfo,jt=!0;break e}h=h.return}if(qe===null)throw Error(o(160));Nh(s,d,l),qe=null,jt=!1,s=l.alternate,s!==null&&(s.return=null),l.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Th(t,e),t=t.sibling}var aa=null;function Th(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:zt(t,e),St(e),n&4&&(Wa(3,e,e.return),Ci(3,e),Wa(5,e,e.return));break;case 1:zt(t,e),St(e),n&512&&(Je||a===null||ua(a,a.return)),n&64&&Na&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var l=aa;if(zt(t,e),St(e),n&512&&(Je||a===null||ua(a,a.return)),n&4){var s=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,l=l.ownerDocument||l;t:switch(n){case"title":s=l.getElementsByTagName("title")[0],(!s||s[ni]||s[lt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=l.createElement(n),l.head.insertBefore(s,l.querySelector("head > title"))),ut(s,n,a),s[lt]=e,tt(s),n=s;break e;case"link":var d=T0("link","href",l).get(n+(a.href||""));if(d){for(var h=0;h<d.length;h++)if(s=d[h],s.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&s.getAttribute("rel")===(a.rel==null?null:a.rel)&&s.getAttribute("title")===(a.title==null?null:a.title)&&s.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){d.splice(h,1);break t}}s=l.createElement(n),ut(s,n,a),l.head.appendChild(s);break;case"meta":if(d=T0("meta","content",l).get(n+(a.content||""))){for(h=0;h<d.length;h++)if(s=d[h],s.getAttribute("content")===(a.content==null?null:""+a.content)&&s.getAttribute("name")===(a.name==null?null:a.name)&&s.getAttribute("property")===(a.property==null?null:a.property)&&s.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&s.getAttribute("charset")===(a.charSet==null?null:a.charSet)){d.splice(h,1);break t}}s=l.createElement(n),ut(s,n,a),l.head.appendChild(s);break;default:throw Error(o(468,n))}s[lt]=e,tt(s),n=s}e.stateNode=n}else M0(l,e.type,e.stateNode);else e.stateNode=E0(l,n,e.memoizedProps);else s!==n?(s===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):s.count--,n===null?M0(l,e.type,e.stateNode):E0(l,n,e.memoizedProps)):n===null&&e.stateNode!==null&&vr(e,e.memoizedProps,a.memoizedProps)}break;case 27:zt(t,e),St(e),n&512&&(Je||a===null||ua(a,a.return)),a!==null&&n&4&&vr(e,e.memoizedProps,a.memoizedProps);break;case 5:if(zt(t,e),St(e),n&512&&(Je||a===null||ua(a,a.return)),e.flags&32){l=e.stateNode;try{cl(l,"")}catch(F){Te(e,e.return,F)}}n&4&&e.stateNode!=null&&(l=e.memoizedProps,vr(e,l,a!==null?a.memoizedProps:l)),n&1024&&(br=!0);break;case 6:if(zt(t,e),St(e),n&4){if(e.stateNode===null)throw Error(o(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(F){Te(e,e.return,F)}}break;case 3:if(dc=null,l=aa,aa=rc(t.containerInfo),zt(t,e),aa=l,St(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Hl(t.containerInfo)}catch(F){Te(e,e.return,F)}br&&(br=!1,Mh(e));break;case 4:n=aa,aa=rc(e.stateNode.containerInfo),zt(t,e),St(e),aa=n;break;case 12:zt(t,e),St(e);break;case 31:zt(t,e),St(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Fs(e,n)));break;case 13:zt(t,e),St(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ws=Mt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Fs(e,n)));break;case 22:l=e.memoizedState!==null;var m=a!==null&&a.memoizedState!==null,A=Na,C=Je;if(Na=A||l,Je=C||m,zt(t,e),Je=C,Na=A,St(e),n&8192)e:for(t=e.stateNode,t._visibility=l?t._visibility&-2:t._visibility|1,l&&(a===null||m||Na||Je||Qn(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){m=a=t;try{if(s=m.stateNode,l)d=s.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{h=m.stateNode;var k=m.memoizedProps.style,E=k!=null&&k.hasOwnProperty("display")?k.display:null;h.style.display=E==null||typeof E=="boolean"?"":(""+E).trim()}}catch(F){Te(m,m.return,F)}}}else if(t.tag===6){if(a===null){m=t;try{m.stateNode.nodeValue=l?"":m.memoizedProps}catch(F){Te(m,m.return,F)}}}else if(t.tag===18){if(a===null){m=t;try{var T=m.stateNode;l?v0(T,!0):v0(m.stateNode,!1)}catch(F){Te(m,m.return,F)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,Fs(e,a))));break;case 19:zt(t,e),St(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Fs(e,n)));break;case 30:break;case 21:break;default:zt(t,e),St(e)}}function St(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(ph(n)){a=n;break}n=n.return}if(a==null)throw Error(o(160));switch(a.tag){case 27:var l=a.stateNode,s=gr(e);Js(e,s,l);break;case 5:var d=a.stateNode;a.flags&32&&(cl(d,""),a.flags&=-33);var h=gr(e);Js(e,h,d);break;case 3:case 4:var m=a.stateNode.containerInfo,A=gr(e);pr(e,A,m);break;default:throw Error(o(161))}}catch(C){Te(e,e.return,C)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ea(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)zh(e,t.alternate,t),t=t.sibling}function Qn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Wa(4,t,t.return),Qn(t);break;case 1:ua(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&vh(t,t.return,a),Qn(t);break;case 27:Qi(t.stateNode);case 26:case 5:ua(t,t.return),Qn(t);break;case 22:t.memoizedState===null&&Qn(t);break;case 30:Qn(t);break;default:Qn(t)}e=e.sibling}}function Ta(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,l=e,s=t,d=s.flags;switch(s.tag){case 0:case 11:case 15:Ta(l,s,a),Ci(4,s);break;case 1:if(Ta(l,s,a),n=s,l=n.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(A){Te(n,n.return,A)}if(n=s,l=n.updateQueue,l!==null){var h=n.stateNode;try{var m=l.shared.hiddenCallbacks;if(m!==null)for(l.shared.hiddenCallbacks=null,l=0;l<m.length;l++)lf(m[l],h)}catch(A){Te(n,n.return,A)}}a&&d&64&&yh(s),Oi(s,s.return);break;case 27:bh(s);case 26:case 5:Ta(l,s,a),a&&n===null&&d&4&&gh(s),Oi(s,s.return);break;case 12:Ta(l,s,a);break;case 31:Ta(l,s,a),a&&d&4&&Ah(l,s);break;case 13:Ta(l,s,a),a&&d&4&&Eh(l,s);break;case 22:s.memoizedState===null&&Ta(l,s,a),Oi(s,s.return);break;case 30:break;default:Ta(l,s,a)}t=t.sibling}}function jr(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&yi(a))}function zr(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&yi(e))}function na(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ch(e,t,a,n),t=t.sibling}function Ch(e,t,a,n){var l=t.flags;switch(t.tag){case 0:case 11:case 15:na(e,t,a,n),l&2048&&Ci(9,t);break;case 1:na(e,t,a,n);break;case 3:na(e,t,a,n),l&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&yi(e)));break;case 12:if(l&2048){na(e,t,a,n),e=t.stateNode;try{var s=t.memoizedProps,d=s.id,h=s.onPostCommit;typeof h=="function"&&h(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(m){Te(t,t.return,m)}}else na(e,t,a,n);break;case 31:na(e,t,a,n);break;case 13:na(e,t,a,n);break;case 23:break;case 22:s=t.stateNode,d=t.alternate,t.memoizedState!==null?s._visibility&2?na(e,t,a,n):_i(e,t):s._visibility&2?na(e,t,a,n):(s._visibility|=2,Tl(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),l&2048&&jr(d,t);break;case 24:na(e,t,a,n),l&2048&&zr(t.alternate,t);break;default:na(e,t,a,n)}}function Tl(e,t,a,n,l){for(l=l&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,d=t,h=a,m=n,A=d.flags;switch(d.tag){case 0:case 11:case 15:Tl(s,d,h,m,l),Ci(8,d);break;case 23:break;case 22:var C=d.stateNode;d.memoizedState!==null?C._visibility&2?Tl(s,d,h,m,l):_i(s,d):(C._visibility|=2,Tl(s,d,h,m,l)),l&&A&2048&&jr(d.alternate,d);break;case 24:Tl(s,d,h,m,l),l&&A&2048&&zr(d.alternate,d);break;default:Tl(s,d,h,m,l)}t=t.sibling}}function _i(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,l=n.flags;switch(n.tag){case 22:_i(a,n),l&2048&&jr(n.alternate,n);break;case 24:_i(a,n),l&2048&&zr(n.alternate,n);break;default:_i(a,n)}t=t.sibling}}var wi=8192;function Ml(e,t,a){if(e.subtreeFlags&wi)for(e=e.child;e!==null;)Oh(e,t,a),e=e.sibling}function Oh(e,t,a){switch(e.tag){case 26:Ml(e,t,a),e.flags&wi&&e.memoizedState!==null&&dv(a,aa,e.memoizedState,e.memoizedProps);break;case 5:Ml(e,t,a);break;case 3:case 4:var n=aa;aa=rc(e.stateNode.containerInfo),Ml(e,t,a),aa=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=wi,wi=16777216,Ml(e,t,a),wi=n):Ml(e,t,a));break;default:Ml(e,t,a)}}function _h(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Di(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];at=n,Dh(n,e)}_h(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)wh(e),e=e.sibling}function wh(e){switch(e.tag){case 0:case 11:case 15:Di(e),e.flags&2048&&Wa(9,e,e.return);break;case 3:Di(e);break;case 12:Di(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$s(e)):Di(e);break;default:Di(e)}}function $s(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];at=n,Dh(n,e)}_h(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Wa(8,t,t.return),$s(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,$s(t));break;default:$s(t)}e=e.sibling}}function Dh(e,t){for(;at!==null;){var a=at;switch(a.tag){case 0:case 11:case 15:Wa(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:yi(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,at=n;else e:for(a=e;at!==null;){n=at;var l=n.sibling,s=n.return;if(Sh(n),n===a){at=null;break e}if(l!==null){l.return=s,at=l;break e}at=s}}}var Ey={getCacheForType:function(e){var t=st(Ke),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return st(Ke).controller.signal}},Ty=typeof WeakMap=="function"?WeakMap:Map,ze=0,De=null,me=null,ye=0,Ee=0,Rt=null,Ia=!1,Cl=!1,Sr=!1,Ma=0,Le=0,Pa=0,Ln=0,Nr=0,Ut=0,Ol=0,ki=null,Nt=null,Ar=!1,Ws=0,kh=0,Is=1/0,Ps=null,en=null,Ie=0,tn=null,_l=null,Ca=0,Er=0,Tr=null,Rh=null,Ri=0,Mr=null;function qt(){return(ze&2)!==0&&ye!==0?ye&-ye:O.T!==null?kr():$o()}function Uh(){if(Ut===0)if((ye&536870912)===0||ge){var e=cs;cs<<=1,(cs&3932160)===0&&(cs=262144),Ut=e}else Ut=536870912;return e=Dt.current,e!==null&&(e.flags|=32),Ut}function At(e,t,a){(e===De&&(Ee===2||Ee===9)||e.cancelPendingCommit!==null)&&(wl(e,0),an(e,ye,Ut,!1)),ai(e,a),((ze&2)===0||e!==De)&&(e===De&&((ze&2)===0&&(Ln|=a),Le===4&&an(e,ye,Ut,!1)),ra(e))}function qh(e,t,a){if((ze&6)!==0)throw Error(o(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||ti(e,t),l=n?Oy(e,t):Or(e,t,!0),s=n;do{if(l===0){Cl&&!n&&an(e,t,0,!1);break}else{if(a=e.current.alternate,s&&!My(a)){l=Or(e,t,!1),s=!1;continue}if(l===2){if(s=t,e.errorRecoveryDisabledLanes&s)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var h=e;l=ki;var m=h.current.memoizedState.isDehydrated;if(m&&(wl(h,d).flags|=256),d=Or(h,d,!1),d!==2){if(Sr&&!m){h.errorRecoveryDisabledLanes|=s,Ln|=s,l=4;break e}s=Nt,Nt=l,s!==null&&(Nt===null?Nt=s:Nt.push.apply(Nt,s))}l=d}if(s=!1,l!==2)continue}}if(l===1){wl(e,0),an(e,t,0,!0);break}e:{switch(n=e,s=l,s){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:an(n,t,Ut,!Ia);break e;case 2:Nt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(l=Ws+300-Mt(),10<l)){if(an(n,t,Ut,!Ia),rs(n,0,!0)!==0)break e;Ca=t,n.timeoutHandle=m0(Hh.bind(null,n,a,Nt,Ps,Ar,t,Ut,Ln,Ol,Ia,s,"Throttled",-0,0),l);break e}Hh(n,a,Nt,Ps,Ar,t,Ut,Ln,Ol,Ia,s,null,-0,0)}}break}while(!0);ra(e)}function Hh(e,t,a,n,l,s,d,h,m,A,C,k,E,T){if(e.timeoutHandle=-1,k=t.subtreeFlags,k&8192||(k&16785408)===16785408){k={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ma},Oh(t,s,k);var F=(s&62914560)===s?Ws-Mt():(s&4194048)===s?kh-Mt():0;if(F=fv(k,F),F!==null){Ca=s,e.cancelPendingCommit=F(Zh.bind(null,e,t,s,a,n,l,d,h,m,C,k,null,E,T)),an(e,s,d,!A);return}}Zh(e,t,s,a,n,l,d,h,m)}function My(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var l=a[n],s=l.getSnapshot;l=l.value;try{if(!_t(s(),l))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function an(e,t,a,n){t&=~Nr,t&=~Ln,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var l=t;0<l;){var s=31-Ot(l),d=1<<s;n[s]=-1,l&=~d}a!==0&&Vo(e,a,t)}function ec(){return(ze&6)===0?(Ui(0),!1):!0}function Cr(){if(me!==null){if(Ee===0)var e=me.return;else e=me,ga=_n=null,Ku(e),zl=null,gi=0,e=me;for(;e!==null;)xh(e.alternate,e),e=e.return;me=null}}function wl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Jy(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Ca=0,Cr(),De=e,me=a=ya(e.current,null),ye=t,Ee=0,Rt=null,Ia=!1,Cl=ti(e,t),Sr=!1,Ol=Ut=Nr=Ln=Pa=Le=0,Nt=ki=null,Ar=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var l=31-Ot(n),s=1<<l;t|=e[l],n&=~s}return Ma=t,js(),a}function Qh(e,t){ce=null,O.H=Ei,t===jl||t===Cs?(t=ef(),Ee=3):t===Du?(t=ef(),Ee=4):Ee=t===cr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Rt=t,me===null&&(Le=1,Gs(e,Kt(t,e.current)))}function Lh(){var e=Dt.current;return e===null?!0:(ye&4194048)===ye?Ft===null:(ye&62914560)===ye||(ye&536870912)!==0?e===Ft:!1}function Bh(){var e=O.H;return O.H=Ei,e===null?Ei:e}function Yh(){var e=O.A;return O.A=Ey,e}function tc(){Le=4,Ia||(ye&4194048)!==ye&&Dt.current!==null||(Cl=!0),(Pa&134217727)===0&&(Ln&134217727)===0||De===null||an(De,ye,Ut,!1)}function Or(e,t,a){var n=ze;ze|=2;var l=Bh(),s=Yh();(De!==e||ye!==t)&&(Ps=null,wl(e,t)),t=!1;var d=Le;e:do try{if(Ee!==0&&me!==null){var h=me,m=Rt;switch(Ee){case 8:Cr(),d=6;break e;case 3:case 2:case 9:case 6:Dt.current===null&&(t=!0);var A=Ee;if(Ee=0,Rt=null,Dl(e,h,m,A),a&&Cl){d=0;break e}break;default:A=Ee,Ee=0,Rt=null,Dl(e,h,m,A)}}Cy(),d=Le;break}catch(C){Qh(e,C)}while(!0);return t&&e.shellSuspendCounter++,ga=_n=null,ze=n,O.H=l,O.A=s,me===null&&(De=null,ye=0,js()),d}function Cy(){for(;me!==null;)Gh(me)}function Oy(e,t){var a=ze;ze|=2;var n=Bh(),l=Yh();De!==e||ye!==t?(Ps=null,Is=Mt()+500,wl(e,t)):Cl=ti(e,t);e:do try{if(Ee!==0&&me!==null){t=me;var s=Rt;t:switch(Ee){case 1:Ee=0,Rt=null,Dl(e,t,s,1);break;case 2:case 9:if(Id(s)){Ee=0,Rt=null,Xh(t);break}t=function(){Ee!==2&&Ee!==9||De!==e||(Ee=7),ra(e)},s.then(t,t);break e;case 3:Ee=7;break e;case 4:Ee=5;break e;case 7:Id(s)?(Ee=0,Rt=null,Xh(t)):(Ee=0,Rt=null,Dl(e,t,s,7));break;case 5:var d=null;switch(me.tag){case 26:d=me.memoizedState;case 5:case 27:var h=me;if(d?C0(d):h.stateNode.complete){Ee=0,Rt=null;var m=h.sibling;if(m!==null)me=m;else{var A=h.return;A!==null?(me=A,ac(A)):me=null}break t}}Ee=0,Rt=null,Dl(e,t,s,5);break;case 6:Ee=0,Rt=null,Dl(e,t,s,6);break;case 8:Cr(),Le=6;break e;default:throw Error(o(462))}}_y();break}catch(C){Qh(e,C)}while(!0);return ga=_n=null,O.H=n,O.A=l,ze=a,me!==null?0:(De=null,ye=0,js(),Le)}function _y(){for(;me!==null&&!ex();)Gh(me)}function Gh(e){var t=hh(e.alternate,e,Ma);e.memoizedProps=e.pendingProps,t===null?ac(e):me=t}function Xh(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=ch(a,t,t.pendingProps,t.type,void 0,ye);break;case 11:t=ch(a,t,t.pendingProps,t.type.render,t.ref,ye);break;case 5:Ku(t);default:xh(a,t),t=me=Bd(t,Ma),t=hh(a,t,Ma)}e.memoizedProps=e.pendingProps,t===null?ac(e):me=t}function Dl(e,t,a,n){ga=_n=null,Ku(t),zl=null,gi=0;var l=t.return;try{if(py(e,l,t,a,ye)){Le=1,Gs(e,Kt(a,e.current)),me=null;return}}catch(s){if(l!==null)throw me=l,s;Le=1,Gs(e,Kt(a,e.current)),me=null;return}t.flags&32768?(ge||n===1?e=!0:Cl||(ye&536870912)!==0?e=!1:(Ia=e=!0,(n===2||n===9||n===3||n===6)&&(n=Dt.current,n!==null&&n.tag===13&&(n.flags|=16384))),Kh(t,e)):ac(t)}function ac(e){var t=e;do{if((t.flags&32768)!==0){Kh(t,Ia);return}e=t.return;var a=zy(t.alternate,t,Ma);if(a!==null){me=a;return}if(t=t.sibling,t!==null){me=t;return}me=t=e}while(t!==null);Le===0&&(Le=5)}function Kh(e,t){do{var a=Sy(e.alternate,e);if(a!==null){a.flags&=32767,me=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){me=e;return}me=e=a}while(e!==null);Le=6,me=null}function Zh(e,t,a,n,l,s,d,h,m){e.cancelPendingCommit=null;do nc();while(Ie!==0);if((ze&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(s=t.lanes|t.childLanes,s|=gu,ox(e,a,s,d,h,m),e===De&&(me=De=null,ye=0),_l=t,tn=e,Ca=a,Er=s,Tr=l,Rh=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Ry(is,function(){return Wh(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=O.T,O.T=null,l=K.p,K.p=2,d=ze,ze|=4;try{Ny(e,t,a)}finally{ze=d,K.p=l,O.T=n}}Ie=1,Vh(),Jh(),Fh()}}function Vh(){if(Ie===1){Ie=0;var e=tn,t=_l,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=O.T,O.T=null;var n=K.p;K.p=2;var l=ze;ze|=4;try{Th(t,e);var s=Yr,d=wd(e.containerInfo),h=s.focusedElem,m=s.selectionRange;if(d!==h&&h&&h.ownerDocument&&_d(h.ownerDocument.documentElement,h)){if(m!==null&&hu(h)){var A=m.start,C=m.end;if(C===void 0&&(C=A),"selectionStart"in h)h.selectionStart=A,h.selectionEnd=Math.min(C,h.value.length);else{var k=h.ownerDocument||document,E=k&&k.defaultView||window;if(E.getSelection){var T=E.getSelection(),F=h.textContent.length,ee=Math.min(m.start,F),_e=m.end===void 0?ee:Math.min(m.end,F);!T.extend&&ee>_e&&(d=_e,_e=ee,ee=d);var j=Od(h,ee),v=Od(h,_e);if(j&&v&&(T.rangeCount!==1||T.anchorNode!==j.node||T.anchorOffset!==j.offset||T.focusNode!==v.node||T.focusOffset!==v.offset)){var N=k.createRange();N.setStart(j.node,j.offset),T.removeAllRanges(),ee>_e?(T.addRange(N),T.extend(v.node,v.offset)):(N.setEnd(v.node,v.offset),T.addRange(N))}}}}for(k=[],T=h;T=T.parentNode;)T.nodeType===1&&k.push({element:T,left:T.scrollLeft,top:T.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<k.length;h++){var D=k[h];D.element.scrollLeft=D.left,D.element.scrollTop=D.top}}xc=!!Br,Yr=Br=null}finally{ze=l,K.p=n,O.T=a}}e.current=t,Ie=2}}function Jh(){if(Ie===2){Ie=0;var e=tn,t=_l,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=O.T,O.T=null;var n=K.p;K.p=2;var l=ze;ze|=4;try{zh(e,t.alternate,t)}finally{ze=l,K.p=n,O.T=a}}Ie=3}}function Fh(){if(Ie===4||Ie===3){Ie=0,tx();var e=tn,t=_l,a=Ca,n=Rh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ie=5:(Ie=0,_l=tn=null,$h(e,e.pendingLanes));var l=e.pendingLanes;if(l===0&&(en=null),Jc(a),t=t.stateNode,Ct&&typeof Ct.onCommitFiberRoot=="function")try{Ct.onCommitFiberRoot(ei,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=O.T,l=K.p,K.p=2,O.T=null;try{for(var s=e.onRecoverableError,d=0;d<n.length;d++){var h=n[d];s(h.value,{componentStack:h.stack})}}finally{O.T=t,K.p=l}}(Ca&3)!==0&&nc(),ra(e),l=e.pendingLanes,(a&261930)!==0&&(l&42)!==0?e===Mr?Ri++:(Ri=0,Mr=e):Ri=0,Ui(0)}}function $h(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,yi(t)))}function nc(){return Vh(),Jh(),Fh(),Wh()}function Wh(){if(Ie!==5)return!1;var e=tn,t=Er;Er=0;var a=Jc(Ca),n=O.T,l=K.p;try{K.p=32>a?32:a,O.T=null,a=Tr,Tr=null;var s=tn,d=Ca;if(Ie=0,_l=tn=null,Ca=0,(ze&6)!==0)throw Error(o(331));var h=ze;if(ze|=4,wh(s.current),Ch(s,s.current,d,a),ze=h,Ui(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(ei,s)}catch{}return!0}finally{K.p=l,O.T=n,$h(e,t)}}function Ih(e,t,a){t=Kt(a,t),t=sr(e.stateNode,t,2),e=Ja(e,t,2),e!==null&&(ai(e,2),ra(e))}function Te(e,t,a){if(e.tag===3)Ih(e,e,a);else for(;t!==null;){if(t.tag===3){Ih(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(en===null||!en.has(n))){e=Kt(a,e),a=Pf(2),n=Ja(t,a,2),n!==null&&(eh(a,n,t,e),ai(n,2),ra(n));break}}t=t.return}}function _r(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new Ty;var l=new Set;n.set(t,l)}else l=n.get(t),l===void 0&&(l=new Set,n.set(t,l));l.has(a)||(Sr=!0,l.add(a),e=wy.bind(null,e,t,a),t.then(e,e))}function wy(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,De===e&&(ye&a)===a&&(Le===4||Le===3&&(ye&62914560)===ye&&300>Mt()-Ws?(ze&2)===0&&wl(e,0):Nr|=a,Ol===ye&&(Ol=0)),ra(e)}function Ph(e,t){t===0&&(t=Zo()),e=Mn(e,t),e!==null&&(ai(e,t),ra(e))}function Dy(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Ph(e,a)}function ky(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,l=e.memoizedState;l!==null&&(a=l.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(o(314))}n!==null&&n.delete(t),Ph(e,a)}function Ry(e,t){return Xc(e,t)}var lc=null,kl=null,wr=!1,ic=!1,Dr=!1,nn=0;function ra(e){e!==kl&&e.next===null&&(kl===null?lc=kl=e:kl=kl.next=e),ic=!0,wr||(wr=!0,qy())}function Ui(e,t){if(!Dr&&ic){Dr=!0;do for(var a=!1,n=lc;n!==null;){if(e!==0){var l=n.pendingLanes;if(l===0)var s=0;else{var d=n.suspendedLanes,h=n.pingedLanes;s=(1<<31-Ot(42|e)+1)-1,s&=l&~(d&~h),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(a=!0,n0(n,s))}else s=ye,s=rs(n,n===De?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(s&3)===0||ti(n,s)||(a=!0,n0(n,s));n=n.next}while(a);Dr=!1}}function Uy(){e0()}function e0(){ic=wr=!1;var e=0;nn!==0&&Vy()&&(e=nn);for(var t=Mt(),a=null,n=lc;n!==null;){var l=n.next,s=t0(n,t);s===0?(n.next=null,a===null?lc=l:a.next=l,l===null&&(kl=a)):(a=n,(e!==0||(s&3)!==0)&&(ic=!0)),n=l}Ie!==0&&Ie!==5||Ui(e),nn!==0&&(nn=0)}function t0(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,l=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var d=31-Ot(s),h=1<<d,m=l[d];m===-1?((h&a)===0||(h&n)!==0)&&(l[d]=rx(h,t)):m<=t&&(e.expiredLanes|=h),s&=~h}if(t=De,a=ye,a=rs(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(Ee===2||Ee===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Kc(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||ti(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&Kc(n),Jc(a)){case 2:case 8:a=Xo;break;case 32:a=is;break;case 268435456:a=Ko;break;default:a=is}return n=a0.bind(null,e),a=Xc(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&Kc(n),e.callbackPriority=2,e.callbackNode=null,2}function a0(e,t){if(Ie!==0&&Ie!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(nc()&&e.callbackNode!==a)return null;var n=ye;return n=rs(e,e===De?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(qh(e,n,t),t0(e,Mt()),e.callbackNode!=null&&e.callbackNode===a?a0.bind(null,e):null)}function n0(e,t){if(nc())return null;qh(e,t,!0)}function qy(){Fy(function(){(ze&6)!==0?Xc(Go,Uy):e0()})}function kr(){if(nn===0){var e=pl;e===0&&(e=ss,ss<<=1,(ss&261888)===0&&(ss=256)),nn=e}return nn}function l0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:hs(""+e)}function i0(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Hy(e,t,a,n,l){if(t==="submit"&&a&&a.stateNode===l){var s=l0((l[pt]||null).action),d=n.submitter;d&&(t=(t=d[pt]||null)?l0(t.formAction):d.getAttribute("formAction"),t!==null&&(s=t,d=null));var h=new vs("action","action",null,n,l);e.push({event:h,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(nn!==0){var m=d?i0(l,d):new FormData(l);er(a,{pending:!0,data:m,method:l.method,action:s},null,m)}}else typeof s=="function"&&(h.preventDefault(),m=d?i0(l,d):new FormData(l),er(a,{pending:!0,data:m,method:l.method,action:s},s,m))},currentTarget:l}]})}}for(var Rr=0;Rr<vu.length;Rr++){var Ur=vu[Rr],Qy=Ur.toLowerCase(),Ly=Ur[0].toUpperCase()+Ur.slice(1);ta(Qy,"on"+Ly)}ta(Rd,"onAnimationEnd"),ta(Ud,"onAnimationIteration"),ta(qd,"onAnimationStart"),ta("dblclick","onDoubleClick"),ta("focusin","onFocus"),ta("focusout","onBlur"),ta(ay,"onTransitionRun"),ta(ny,"onTransitionStart"),ta(ly,"onTransitionCancel"),ta(Hd,"onTransitionEnd"),il("onMouseEnter",["mouseout","mouseover"]),il("onMouseLeave",["mouseout","mouseover"]),il("onPointerEnter",["pointerout","pointerover"]),il("onPointerLeave",["pointerout","pointerover"]),Nn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Nn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Nn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Nn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Nn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Nn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qi="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(" "),By=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qi));function s0(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],l=n.event;n=n.listeners;e:{var s=void 0;if(t)for(var d=n.length-1;0<=d;d--){var h=n[d],m=h.instance,A=h.currentTarget;if(h=h.listener,m!==s&&l.isPropagationStopped())break e;s=h,l.currentTarget=A;try{s(l)}catch(C){bs(C)}l.currentTarget=null,s=m}else for(d=0;d<n.length;d++){if(h=n[d],m=h.instance,A=h.currentTarget,h=h.listener,m!==s&&l.isPropagationStopped())break e;s=h,l.currentTarget=A;try{s(l)}catch(C){bs(C)}l.currentTarget=null,s=m}}}}function xe(e,t){var a=t[Fc];a===void 0&&(a=t[Fc]=new Set);var n=e+"__bubble";a.has(n)||(c0(t,e,2,!1),a.add(n))}function qr(e,t,a){var n=0;t&&(n|=4),c0(a,e,n,t)}var sc="_reactListening"+Math.random().toString(36).slice(2);function Hr(e){if(!e[sc]){e[sc]=!0,Po.forEach(function(a){a!=="selectionchange"&&(By.has(a)||qr(a,!1,e),qr(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[sc]||(t[sc]=!0,qr("selectionchange",!1,t))}}function c0(e,t,a,n){switch(U0(t)){case 2:var l=xv;break;case 8:l=yv;break;default:l=Pr}a=l.bind(null,t,a,e),l=void 0,!lu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),n?l!==void 0?e.addEventListener(t,a,{capture:!0,passive:l}):e.addEventListener(t,a,!0):l!==void 0?e.addEventListener(t,a,{passive:l}):e.addEventListener(t,a,!1)}function Qr(e,t,a,n,l){var s=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var d=n.tag;if(d===3||d===4){var h=n.stateNode.containerInfo;if(h===l)break;if(d===4)for(d=n.return;d!==null;){var m=d.tag;if((m===3||m===4)&&d.stateNode.containerInfo===l)return;d=d.return}for(;h!==null;){if(d=al(h),d===null)return;if(m=d.tag,m===5||m===6||m===26||m===27){n=s=d;continue e}h=h.parentNode}}n=n.return}dd(function(){var A=s,C=au(a),k=[];e:{var E=Qd.get(e);if(E!==void 0){var T=vs,F=e;switch(e){case"keypress":if(xs(a)===0)break e;case"keydown":case"keyup":T=kx;break;case"focusin":F="focus",T=uu;break;case"focusout":F="blur",T=uu;break;case"beforeblur":case"afterblur":T=uu;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":T=md;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":T=zx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":T=qx;break;case Rd:case Ud:case qd:T=Ax;break;case Hd:T=Qx;break;case"scroll":case"scrollend":T=bx;break;case"wheel":T=Bx;break;case"copy":case"cut":case"paste":T=Tx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":T=yd;break;case"toggle":case"beforetoggle":T=Gx}var ee=(t&4)!==0,_e=!ee&&(e==="scroll"||e==="scrollend"),j=ee?E!==null?E+"Capture":null:E;ee=[];for(var v=A,N;v!==null;){var D=v;if(N=D.stateNode,D=D.tag,D!==5&&D!==26&&D!==27||N===null||j===null||(D=ii(v,j),D!=null&&ee.push(Hi(v,D,N))),_e)break;v=v.return}0<ee.length&&(E=new T(E,F,null,a,C),k.push({event:E,listeners:ee}))}}if((t&7)===0){e:{if(E=e==="mouseover"||e==="pointerover",T=e==="mouseout"||e==="pointerout",E&&a!==tu&&(F=a.relatedTarget||a.fromElement)&&(al(F)||F[tl]))break e;if((T||E)&&(E=C.window===C?C:(E=C.ownerDocument)?E.defaultView||E.parentWindow:window,T?(F=a.relatedTarget||a.toElement,T=A,F=F?al(F):null,F!==null&&(_e=y(F),ee=F.tag,F!==_e||ee!==5&&ee!==27&&ee!==6)&&(F=null)):(T=null,F=A),T!==F)){if(ee=md,D="onMouseLeave",j="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(ee=yd,D="onPointerLeave",j="onPointerEnter",v="pointer"),_e=T==null?E:li(T),N=F==null?E:li(F),E=new ee(D,v+"leave",T,a,C),E.target=_e,E.relatedTarget=N,D=null,al(C)===A&&(ee=new ee(j,v+"enter",F,a,C),ee.target=N,ee.relatedTarget=_e,D=ee),_e=D,T&&F)t:{for(ee=Yy,j=T,v=F,N=0,D=j;D;D=ee(D))N++;D=0;for(var P=v;P;P=ee(P))D++;for(;0<N-D;)j=ee(j),N--;for(;0<D-N;)v=ee(v),D--;for(;N--;){if(j===v||v!==null&&j===v.alternate){ee=j;break t}j=ee(j),v=ee(v)}ee=null}else ee=null;T!==null&&u0(k,E,T,ee,!1),F!==null&&_e!==null&&u0(k,_e,F,ee,!0)}}e:{if(E=A?li(A):window,T=E.nodeName&&E.nodeName.toLowerCase(),T==="select"||T==="input"&&E.type==="file")var be=Nd;else if(zd(E))if(Ad)be=Px;else{be=Wx;var W=$x}else T=E.nodeName,!T||T.toLowerCase()!=="input"||E.type!=="checkbox"&&E.type!=="radio"?A&&eu(A.elementType)&&(be=Nd):be=Ix;if(be&&(be=be(e,A))){Sd(k,be,a,C);break e}W&&W(e,E,A),e==="focusout"&&A&&E.type==="number"&&A.memoizedProps.value!=null&&Pc(E,"number",E.value)}switch(W=A?li(A):window,e){case"focusin":(zd(W)||W.contentEditable==="true")&&(dl=W,mu=A,hi=null);break;case"focusout":hi=mu=dl=null;break;case"mousedown":xu=!0;break;case"contextmenu":case"mouseup":case"dragend":xu=!1,Dd(k,a,C);break;case"selectionchange":if(ty)break;case"keydown":case"keyup":Dd(k,a,C)}var re;if(ou)e:{switch(e){case"compositionstart":var ve="onCompositionStart";break e;case"compositionend":ve="onCompositionEnd";break e;case"compositionupdate":ve="onCompositionUpdate";break e}ve=void 0}else ol?bd(e,a)&&(ve="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ve="onCompositionStart");ve&&(vd&&a.locale!=="ko"&&(ol||ve!=="onCompositionStart"?ve==="onCompositionEnd"&&ol&&(re=fd()):(Ba=C,iu="value"in Ba?Ba.value:Ba.textContent,ol=!0)),W=cc(A,ve),0<W.length&&(ve=new xd(ve,e,null,a,C),k.push({event:ve,listeners:W}),re?ve.data=re:(re=jd(a),re!==null&&(ve.data=re)))),(re=Kx?Zx(e,a):Vx(e,a))&&(ve=cc(A,"onBeforeInput"),0<ve.length&&(W=new xd("onBeforeInput","beforeinput",null,a,C),k.push({event:W,listeners:ve}),W.data=re)),Hy(k,e,A,a,C)}s0(k,t)})}function Hi(e,t,a){return{instance:e,listener:t,currentTarget:a}}function cc(e,t){for(var a=t+"Capture",n=[];e!==null;){var l=e,s=l.stateNode;if(l=l.tag,l!==5&&l!==26&&l!==27||s===null||(l=ii(e,a),l!=null&&n.unshift(Hi(e,l,s)),l=ii(e,t),l!=null&&n.push(Hi(e,l,s))),e.tag===3)return n;e=e.return}return[]}function Yy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function u0(e,t,a,n,l){for(var s=t._reactName,d=[];a!==null&&a!==n;){var h=a,m=h.alternate,A=h.stateNode;if(h=h.tag,m!==null&&m===n)break;h!==5&&h!==26&&h!==27||A===null||(m=A,l?(A=ii(a,s),A!=null&&d.unshift(Hi(a,A,m))):l||(A=ii(a,s),A!=null&&d.push(Hi(a,A,m)))),a=a.return}d.length!==0&&e.push({event:t,listeners:d})}var Gy=/\r\n?/g,Xy=/\u0000|\uFFFD/g;function r0(e){return(typeof e=="string"?e:""+e).replace(Gy,`
49
+ `).replace(Xy,"")}function o0(e,t){return t=r0(t),r0(e)===t}function Oe(e,t,a,n,l,s){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||cl(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&cl(e,""+n);break;case"className":ds(e,"class",n);break;case"tabIndex":ds(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":ds(e,a,n);break;case"style":rd(e,n,s);break;case"data":if(t!=="object"){ds(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=hs(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(a==="formAction"?(t!=="input"&&Oe(e,t,"name",l.name,l,null),Oe(e,t,"formEncType",l.formEncType,l,null),Oe(e,t,"formMethod",l.formMethod,l,null),Oe(e,t,"formTarget",l.formTarget,l,null)):(Oe(e,t,"encType",l.encType,l,null),Oe(e,t,"method",l.method,l,null),Oe(e,t,"target",l.target,l,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=hs(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=ma);break;case"onScroll":n!=null&&xe("scroll",e);break;case"onScrollEnd":n!=null&&xe("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(a=n.__html,a!=null){if(l.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=hs(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);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":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":xe("beforetoggle",e),xe("toggle",e),os(e,"popover",n);break;case"xlinkActuate":ha(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":ha(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":ha(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":ha(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":ha(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":ha(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":ha(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":ha(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":ha(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":os(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=gx.get(a)||a,os(e,a,n))}}function Lr(e,t,a,n,l,s){switch(a){case"style":rd(e,n,s);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(a=n.__html,a!=null){if(l.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"children":typeof n=="string"?cl(e,n):(typeof n=="number"||typeof n=="bigint")&&cl(e,""+n);break;case"onScroll":n!=null&&xe("scroll",e);break;case"onScrollEnd":n!=null&&xe("scrollend",e);break;case"onClick":n!=null&&(e.onclick=ma);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ed.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(l=a.endsWith("Capture"),t=a.slice(2,l?a.length-7:void 0),s=e[pt]||null,s=s!=null?s[a]:null,typeof s=="function"&&e.removeEventListener(t,s,l),typeof n=="function")){typeof s!="function"&&s!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,l);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):os(e,a,n)}}}function ut(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xe("error",e),xe("load",e);var n=!1,l=!1,s;for(s in a)if(a.hasOwnProperty(s)){var d=a[s];if(d!=null)switch(s){case"src":n=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Oe(e,t,s,d,a,null)}}l&&Oe(e,t,"srcSet",a.srcSet,a,null),n&&Oe(e,t,"src",a.src,a,null);return;case"input":xe("invalid",e);var h=s=d=l=null,m=null,A=null;for(n in a)if(a.hasOwnProperty(n)){var C=a[n];if(C!=null)switch(n){case"name":l=C;break;case"type":d=C;break;case"checked":m=C;break;case"defaultChecked":A=C;break;case"value":s=C;break;case"defaultValue":h=C;break;case"children":case"dangerouslySetInnerHTML":if(C!=null)throw Error(o(137,t));break;default:Oe(e,t,n,C,a,null)}}id(e,s,h,m,A,d,l,!1);return;case"select":xe("invalid",e),n=d=s=null;for(l in a)if(a.hasOwnProperty(l)&&(h=a[l],h!=null))switch(l){case"value":s=h;break;case"defaultValue":d=h;break;case"multiple":n=h;default:Oe(e,t,l,h,a,null)}t=s,a=d,e.multiple=!!n,t!=null?sl(e,!!n,t,!1):a!=null&&sl(e,!!n,a,!0);return;case"textarea":xe("invalid",e),s=l=n=null;for(d in a)if(a.hasOwnProperty(d)&&(h=a[d],h!=null))switch(d){case"value":n=h;break;case"defaultValue":l=h;break;case"children":s=h;break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(o(91));break;default:Oe(e,t,d,h,a,null)}cd(e,n,l,s);return;case"option":for(m in a)if(a.hasOwnProperty(m)&&(n=a[m],n!=null))switch(m){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Oe(e,t,m,n,a,null)}return;case"dialog":xe("beforetoggle",e),xe("toggle",e),xe("cancel",e),xe("close",e);break;case"iframe":case"object":xe("load",e);break;case"video":case"audio":for(n=0;n<qi.length;n++)xe(qi[n],e);break;case"image":xe("error",e),xe("load",e);break;case"details":xe("toggle",e);break;case"embed":case"source":case"link":xe("error",e),xe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(A in a)if(a.hasOwnProperty(A)&&(n=a[A],n!=null))switch(A){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Oe(e,t,A,n,a,null)}return;default:if(eu(t)){for(C in a)a.hasOwnProperty(C)&&(n=a[C],n!==void 0&&Lr(e,t,C,n,a,void 0));return}}for(h in a)a.hasOwnProperty(h)&&(n=a[h],n!=null&&Oe(e,t,h,n,a,null))}function Ky(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var l=null,s=null,d=null,h=null,m=null,A=null,C=null;for(T in a){var k=a[T];if(a.hasOwnProperty(T)&&k!=null)switch(T){case"checked":break;case"value":break;case"defaultValue":m=k;default:n.hasOwnProperty(T)||Oe(e,t,T,null,n,k)}}for(var E in n){var T=n[E];if(k=a[E],n.hasOwnProperty(E)&&(T!=null||k!=null))switch(E){case"type":s=T;break;case"name":l=T;break;case"checked":A=T;break;case"defaultChecked":C=T;break;case"value":d=T;break;case"defaultValue":h=T;break;case"children":case"dangerouslySetInnerHTML":if(T!=null)throw Error(o(137,t));break;default:T!==k&&Oe(e,t,E,T,n,k)}}Ic(e,d,h,m,A,C,s,l);return;case"select":T=d=h=E=null;for(s in a)if(m=a[s],a.hasOwnProperty(s)&&m!=null)switch(s){case"value":break;case"multiple":T=m;default:n.hasOwnProperty(s)||Oe(e,t,s,null,n,m)}for(l in n)if(s=n[l],m=a[l],n.hasOwnProperty(l)&&(s!=null||m!=null))switch(l){case"value":E=s;break;case"defaultValue":h=s;break;case"multiple":d=s;default:s!==m&&Oe(e,t,l,s,n,m)}t=h,a=d,n=T,E!=null?sl(e,!!a,E,!1):!!n!=!!a&&(t!=null?sl(e,!!a,t,!0):sl(e,!!a,a?[]:"",!1));return;case"textarea":T=E=null;for(h in a)if(l=a[h],a.hasOwnProperty(h)&&l!=null&&!n.hasOwnProperty(h))switch(h){case"value":break;case"children":break;default:Oe(e,t,h,null,n,l)}for(d in n)if(l=n[d],s=a[d],n.hasOwnProperty(d)&&(l!=null||s!=null))switch(d){case"value":E=l;break;case"defaultValue":T=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(o(91));break;default:l!==s&&Oe(e,t,d,l,n,s)}sd(e,E,T);return;case"option":for(var F in a)if(E=a[F],a.hasOwnProperty(F)&&E!=null&&!n.hasOwnProperty(F))switch(F){case"selected":e.selected=!1;break;default:Oe(e,t,F,null,n,E)}for(m in n)if(E=n[m],T=a[m],n.hasOwnProperty(m)&&E!==T&&(E!=null||T!=null))switch(m){case"selected":e.selected=E&&typeof E!="function"&&typeof E!="symbol";break;default:Oe(e,t,m,E,n,T)}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 ee in a)E=a[ee],a.hasOwnProperty(ee)&&E!=null&&!n.hasOwnProperty(ee)&&Oe(e,t,ee,null,n,E);for(A in n)if(E=n[A],T=a[A],n.hasOwnProperty(A)&&E!==T&&(E!=null||T!=null))switch(A){case"children":case"dangerouslySetInnerHTML":if(E!=null)throw Error(o(137,t));break;default:Oe(e,t,A,E,n,T)}return;default:if(eu(t)){for(var _e in a)E=a[_e],a.hasOwnProperty(_e)&&E!==void 0&&!n.hasOwnProperty(_e)&&Lr(e,t,_e,void 0,n,E);for(C in n)E=n[C],T=a[C],!n.hasOwnProperty(C)||E===T||E===void 0&&T===void 0||Lr(e,t,C,E,n,T);return}}for(var j in a)E=a[j],a.hasOwnProperty(j)&&E!=null&&!n.hasOwnProperty(j)&&Oe(e,t,j,null,n,E);for(k in n)E=n[k],T=a[k],!n.hasOwnProperty(k)||E===T||E==null&&T==null||Oe(e,t,k,E,n,T)}function d0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Zy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var l=a[n],s=l.transferSize,d=l.initiatorType,h=l.duration;if(s&&h&&d0(d)){for(d=0,h=l.responseEnd,n+=1;n<a.length;n++){var m=a[n],A=m.startTime;if(A>h)break;var C=m.transferSize,k=m.initiatorType;C&&d0(k)&&(m=m.responseEnd,d+=C*(m<h?1:(h-A)/(m-A)))}if(--n,t+=8*(s+d)/(l.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Br=null,Yr=null;function uc(e){return e.nodeType===9?e:e.ownerDocument}function f0(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function h0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Gr(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xr=null;function Vy(){var e=window.event;return e&&e.type==="popstate"?e===Xr?!1:(Xr=e,!0):(Xr=null,!1)}var m0=typeof setTimeout=="function"?setTimeout:void 0,Jy=typeof clearTimeout=="function"?clearTimeout:void 0,x0=typeof Promise=="function"?Promise:void 0,Fy=typeof queueMicrotask=="function"?queueMicrotask:typeof x0<"u"?function(e){return x0.resolve(null).then(e).catch($y)}:m0;function $y(e){setTimeout(function(){throw e})}function ln(e){return e==="head"}function y0(e,t){var a=t,n=0;do{var l=a.nextSibling;if(e.removeChild(a),l&&l.nodeType===8)if(a=l.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(l),Hl(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")Qi(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Qi(a);for(var s=a.firstChild;s;){var d=s.nextSibling,h=s.nodeName;s[ni]||h==="SCRIPT"||h==="STYLE"||h==="LINK"&&s.rel.toLowerCase()==="stylesheet"||a.removeChild(s),s=d}}else a==="body"&&Qi(e.ownerDocument.body);a=l}while(a);Hl(t)}function v0(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function Kr(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Kr(a),$c(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Wy(e,t,a,n){for(;e.nodeType===1;){var l=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[ni])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==l.rel||e.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||e.getAttribute("title")!==(l.title==null?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(l.src==null?null:l.src)||e.getAttribute("type")!==(l.type==null?null:l.type)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=l.name==null?null:""+l.name;if(l.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=$t(e.nextSibling),e===null)break}return null}function Iy(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=$t(e.nextSibling),e===null))return null;return e}function g0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=$t(e.nextSibling),e===null))return null;return e}function Zr(e){return e.data==="$?"||e.data==="$~"}function Vr(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Py(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function $t(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Jr=null;function p0(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return $t(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function b0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function j0(e,t,a){switch(t=uc(a),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Qi(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);$c(e)}var Wt=new Map,z0=new Set;function rc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Oa=K.d;K.d={f:ev,r:tv,D:av,C:nv,L:lv,m:iv,X:cv,S:sv,M:uv};function ev(){var e=Oa.f(),t=ec();return e||t}function tv(e){var t=nl(e);t!==null&&t.tag===5&&t.type==="form"?Qf(t):Oa.r(e)}var Rl=typeof document>"u"?null:document;function S0(e,t,a){var n=Rl;if(n&&typeof t=="string"&&t){var l=Gt(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof a=="string"&&(l+='[crossorigin="'+a+'"]'),z0.has(l)||(z0.add(l),e={rel:e,crossOrigin:a,href:t},n.querySelector(l)===null&&(t=n.createElement("link"),ut(t,"link",e),tt(t),n.head.appendChild(t)))}}function av(e){Oa.D(e),S0("dns-prefetch",e,null)}function nv(e,t){Oa.C(e,t),S0("preconnect",e,t)}function lv(e,t,a){Oa.L(e,t,a);var n=Rl;if(n&&e&&t){var l='link[rel="preload"][as="'+Gt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(l+='[imagesrcset="'+Gt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(l+='[imagesizes="'+Gt(a.imageSizes)+'"]')):l+='[href="'+Gt(e)+'"]';var s=l;switch(t){case"style":s=Ul(e);break;case"script":s=ql(e)}Wt.has(s)||(e=M({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Wt.set(s,e),n.querySelector(l)!==null||t==="style"&&n.querySelector(Li(s))||t==="script"&&n.querySelector(Bi(s))||(t=n.createElement("link"),ut(t,"link",e),tt(t),n.head.appendChild(t)))}}function iv(e,t){Oa.m(e,t);var a=Rl;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+Gt(n)+'"][href="'+Gt(e)+'"]',s=l;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=ql(e)}if(!Wt.has(s)&&(e=M({rel:"modulepreload",href:e},t),Wt.set(s,e),a.querySelector(l)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Bi(s)))return}n=a.createElement("link"),ut(n,"link",e),tt(n),a.head.appendChild(n)}}}function sv(e,t,a){Oa.S(e,t,a);var n=Rl;if(n&&e){var l=ll(n).hoistableStyles,s=Ul(e);t=t||"default";var d=l.get(s);if(!d){var h={loading:0,preload:null};if(d=n.querySelector(Li(s)))h.loading=5;else{e=M({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Wt.get(s))&&Fr(e,a);var m=d=n.createElement("link");tt(m),ut(m,"link",e),m._p=new Promise(function(A,C){m.onload=A,m.onerror=C}),m.addEventListener("load",function(){h.loading|=1}),m.addEventListener("error",function(){h.loading|=2}),h.loading|=4,oc(d,t,n)}d={type:"stylesheet",instance:d,count:1,state:h},l.set(s,d)}}}function cv(e,t){Oa.X(e,t);var a=Rl;if(a&&e){var n=ll(a).hoistableScripts,l=ql(e),s=n.get(l);s||(s=a.querySelector(Bi(l)),s||(e=M({src:e,async:!0},t),(t=Wt.get(l))&&$r(e,t),s=a.createElement("script"),tt(s),ut(s,"link",e),a.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(l,s))}}function uv(e,t){Oa.M(e,t);var a=Rl;if(a&&e){var n=ll(a).hoistableScripts,l=ql(e),s=n.get(l);s||(s=a.querySelector(Bi(l)),s||(e=M({src:e,async:!0,type:"module"},t),(t=Wt.get(l))&&$r(e,t),s=a.createElement("script"),tt(s),ut(s,"link",e),a.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(l,s))}}function N0(e,t,a,n){var l=(l=he.current)?rc(l):null;if(!l)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Ul(a.href),a=ll(l).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Ul(a.href);var s=ll(l).hoistableStyles,d=s.get(e);if(d||(l=l.ownerDocument||l,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,d),(s=l.querySelector(Li(e)))&&!s._p&&(d.instance=s,d.state.loading=5),Wt.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Wt.set(e,a),s||rv(l,e,a,d.state))),t&&n===null)throw Error(o(528,""));return d}if(t&&n!==null)throw Error(o(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ql(a),a=ll(l).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Ul(e){return'href="'+Gt(e)+'"'}function Li(e){return'link[rel="stylesheet"]['+e+"]"}function A0(e){return M({},e,{"data-precedence":e.precedence,precedence:null})}function rv(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),ut(t,"link",a),tt(t),e.head.appendChild(t))}function ql(e){return'[src="'+Gt(e)+'"]'}function Bi(e){return"script[async]"+e}function E0(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Gt(a.href)+'"]');if(n)return t.instance=n,tt(n),n;var l=M({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),tt(n),ut(n,"style",l),oc(n,a.precedence,e),t.instance=n;case"stylesheet":l=Ul(a.href);var s=e.querySelector(Li(l));if(s)return t.state.loading|=4,t.instance=s,tt(s),s;n=A0(a),(l=Wt.get(l))&&Fr(n,l),s=(e.ownerDocument||e).createElement("link"),tt(s);var d=s;return d._p=new Promise(function(h,m){d.onload=h,d.onerror=m}),ut(s,"link",n),t.state.loading|=4,oc(s,a.precedence,e),t.instance=s;case"script":return s=ql(a.src),(l=e.querySelector(Bi(s)))?(t.instance=l,tt(l),l):(n=a,(l=Wt.get(s))&&(n=M({},a),$r(n,l)),e=e.ownerDocument||e,l=e.createElement("script"),tt(l),ut(l,"link",n),e.head.appendChild(l),t.instance=l);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,oc(n,a.precedence,e));return t.instance}function oc(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=n.length?n[n.length-1]:null,s=l,d=0;d<n.length;d++){var h=n[d];if(h.dataset.precedence===t)s=h;else if(s!==l)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Fr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function $r(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var dc=null;function T0(e,t,a){if(dc===null){var n=new Map,l=dc=new Map;l.set(a,n)}else l=dc,n=l.get(a),n||(n=new Map,l.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),l=0;l<a.length;l++){var s=a[l];if(!(s[ni]||s[lt]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var d=s.getAttribute(t)||"";d=e+d;var h=n.get(d);h?h.push(s):n.set(d,[s])}}return n}function M0(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function ov(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function C0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function dv(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var l=Ul(n.href),s=t.querySelector(Li(l));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=fc.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=s,tt(s);return}s=t.ownerDocument||t,n=A0(n),(l=Wt.get(l))&&Fr(n,l),s=s.createElement("link"),tt(s);var d=s;d._p=new Promise(function(h,m){d.onload=h,d.onerror=m}),ut(s,"link",n),a.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=fc.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Wr=0;function fv(e,t){return e.stylesheets&&e.count===0&&mc(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&mc(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&Wr===0&&(Wr=62500*Zy());var l=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&mc(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>Wr?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(l)}}:null}function fc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)mc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var hc=null;function mc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,hc=new Map,t.forEach(hv,e),hc=null,fc.call(e))}function hv(e,t){if(!(t.state.loading&4)){var a=hc.get(e);if(a)var n=a.get(null);else{a=new Map,hc.set(e,a);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<l.length;s++){var d=l[s];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(a.set(d.dataset.precedence,d),n=d)}n&&a.set(null,n)}l=t.instance,d=l.getAttribute("data-precedence"),s=a.get(d)||n,s===n&&a.set(null,l),a.set(d,l),this.count++,n=fc.bind(this),l.addEventListener("load",n),l.addEventListener("error",n),s?s.parentNode.insertBefore(l,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(l,e.firstChild)),t.state.loading|=4}}var Yi={$$typeof:J,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function mv(e,t,a,n,l,s,d,h,m){this.tag=1,this.containerInfo=e,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=Zc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zc(0),this.hiddenUpdates=Zc(null),this.identifierPrefix=n,this.onUncaughtError=l,this.onCaughtError=s,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=m,this.incompleteTransitions=new Map}function O0(e,t,a,n,l,s,d,h,m,A,C,k){return e=new mv(e,t,a,d,m,A,C,k,h),t=1,s===!0&&(t|=24),s=wt(3,null,null,t),e.current=s,s.stateNode=e,t=Ou(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:n,isDehydrated:a,cache:t},ku(s),e}function _0(e){return e?(e=ml,e):ml}function w0(e,t,a,n,l,s){l=_0(l),n.context===null?n.context=l:n.pendingContext=l,n=Va(t),n.payload={element:a},s=s===void 0?null:s,s!==null&&(n.callback=s),a=Ja(e,n,t),a!==null&&(At(a,e,t),bi(a,e,t))}function D0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Ir(e,t){D0(e,t),(e=e.alternate)&&D0(e,t)}function k0(e){if(e.tag===13||e.tag===31){var t=Mn(e,67108864);t!==null&&At(t,e,67108864),Ir(e,67108864)}}function R0(e){if(e.tag===13||e.tag===31){var t=qt();t=Vc(t);var a=Mn(e,t);a!==null&&At(a,e,t),Ir(e,t)}}var xc=!0;function xv(e,t,a,n){var l=O.T;O.T=null;var s=K.p;try{K.p=2,Pr(e,t,a,n)}finally{K.p=s,O.T=l}}function yv(e,t,a,n){var l=O.T;O.T=null;var s=K.p;try{K.p=8,Pr(e,t,a,n)}finally{K.p=s,O.T=l}}function Pr(e,t,a,n){if(xc){var l=eo(n);if(l===null)Qr(e,t,n,yc,a),q0(e,n);else if(gv(l,e,t,a,n))n.stopPropagation();else if(q0(e,n),t&4&&-1<vv.indexOf(e)){for(;l!==null;){var s=nl(l);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var d=Sn(s.pendingLanes);if(d!==0){var h=s;for(h.pendingLanes|=2,h.entangledLanes|=2;d;){var m=1<<31-Ot(d);h.entanglements[1]|=m,d&=~m}ra(s),(ze&6)===0&&(Is=Mt()+500,Ui(0))}}break;case 31:case 13:h=Mn(s,2),h!==null&&At(h,s,2),ec(),Ir(s,2)}if(s=eo(n),s===null&&Qr(e,t,n,yc,a),s===l)break;l=s}l!==null&&n.stopPropagation()}else Qr(e,t,n,null,a)}}function eo(e){return e=au(e),to(e)}var yc=null;function to(e){if(yc=null,e=al(e),e!==null){var t=y(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=p(t),e!==null)return e;e=null}else if(a===31){if(e=z(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return yc=e,null}function U0(e){switch(e){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(ax()){case Go:return 2;case Xo:return 8;case is:case nx:return 32;case Ko:return 268435456;default:return 32}default:return 32}}var ao=!1,sn=null,cn=null,un=null,Gi=new Map,Xi=new Map,rn=[],vv="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 q0(e,t){switch(e){case"focusin":case"focusout":sn=null;break;case"dragenter":case"dragleave":cn=null;break;case"mouseover":case"mouseout":un=null;break;case"pointerover":case"pointerout":Gi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xi.delete(t.pointerId)}}function Ki(e,t,a,n,l,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:s,targetContainers:[l]},t!==null&&(t=nl(t),t!==null&&k0(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function gv(e,t,a,n,l){switch(t){case"focusin":return sn=Ki(sn,e,t,a,n,l),!0;case"dragenter":return cn=Ki(cn,e,t,a,n,l),!0;case"mouseover":return un=Ki(un,e,t,a,n,l),!0;case"pointerover":var s=l.pointerId;return Gi.set(s,Ki(Gi.get(s)||null,e,t,a,n,l)),!0;case"gotpointercapture":return s=l.pointerId,Xi.set(s,Ki(Xi.get(s)||null,e,t,a,n,l)),!0}return!1}function H0(e){var t=al(e.target);if(t!==null){var a=y(t);if(a!==null){if(t=a.tag,t===13){if(t=p(a),t!==null){e.blockedOn=t,Wo(e.priority,function(){R0(a)});return}}else if(t===31){if(t=z(a),t!==null){e.blockedOn=t,Wo(e.priority,function(){R0(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function vc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=eo(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);tu=n,a.target.dispatchEvent(n),tu=null}else return t=nl(a),t!==null&&k0(t),e.blockedOn=a,!1;t.shift()}return!0}function Q0(e,t,a){vc(e)&&a.delete(t)}function pv(){ao=!1,sn!==null&&vc(sn)&&(sn=null),cn!==null&&vc(cn)&&(cn=null),un!==null&&vc(un)&&(un=null),Gi.forEach(Q0),Xi.forEach(Q0)}function gc(e,t){e.blockedOn===t&&(e.blockedOn=null,ao||(ao=!0,u.unstable_scheduleCallback(u.unstable_NormalPriority,pv)))}var pc=null;function L0(e){pc!==e&&(pc=e,u.unstable_scheduleCallback(u.unstable_NormalPriority,function(){pc===e&&(pc=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],l=e[t+2];if(typeof n!="function"){if(to(n||a)===null)continue;break}var s=nl(a);s!==null&&(e.splice(t,3),t-=3,er(s,{pending:!0,data:l,method:a.method,action:n},n,l))}}))}function Hl(e){function t(m){return gc(m,e)}sn!==null&&gc(sn,e),cn!==null&&gc(cn,e),un!==null&&gc(un,e),Gi.forEach(t),Xi.forEach(t);for(var a=0;a<rn.length;a++){var n=rn[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<rn.length&&(a=rn[0],a.blockedOn===null);)H0(a),a.blockedOn===null&&rn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var l=a[n],s=a[n+1],d=l[pt]||null;if(typeof s=="function")d||L0(a);else if(d){var h=null;if(s&&s.hasAttribute("formAction")){if(l=s,d=s[pt]||null)h=d.formAction;else if(to(l)!==null)continue}else h=d.action;typeof h=="function"?a[n+1]=h:(a.splice(n,3),n-=3),L0(a)}}}function B0(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(d){return l=d})},focusReset:"manual",scroll:"manual"})}function t(){l!==null&&(l(),l=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,l=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),l!==null&&(l(),l=null)}}}function no(e){this._internalRoot=e}bc.prototype.render=no.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var a=t.current,n=qt();w0(a,n,e,t,null,null)},bc.prototype.unmount=no.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;w0(e.current,2,null,e,null,null),ec(),t[tl]=null}};function bc(e){this._internalRoot=e}bc.prototype.unstable_scheduleHydration=function(e){if(e){var t=$o();e={blockedOn:null,target:e,priority:t};for(var a=0;a<rn.length&&t!==0&&t<rn[a].priority;a++);rn.splice(a,0,e),a===0&&H0(e)}};var Y0=c.version;if(Y0!=="19.2.4")throw Error(o(527,Y0,"19.2.4"));K.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=b(t),e=e!==null?H(e):null,e=e===null?null:e.stateNode,e};var bv={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var jc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jc.isDisabled&&jc.supportsFiber)try{ei=jc.inject(bv),Ct=jc}catch{}}return Vi.createRoot=function(e,t){if(!f(e))throw Error(o(299));var a=!1,n="",l=Ff,s=$f,d=Wf;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(l=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=O0(e,1,!1,null,null,a,n,null,l,s,d,B0),e[tl]=t.current,Hr(e),new no(t)},Vi.hydrateRoot=function(e,t,a){if(!f(e))throw Error(o(299));var n=!1,l="",s=Ff,d=$f,h=Wf,m=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(l=a.identifierPrefix),a.onUncaughtError!==void 0&&(s=a.onUncaughtError),a.onCaughtError!==void 0&&(d=a.onCaughtError),a.onRecoverableError!==void 0&&(h=a.onRecoverableError),a.formState!==void 0&&(m=a.formState)),t=O0(e,1,!0,t,a??null,n,l,m,s,d,h,B0),t.context=_0(null),a=t.current,n=qt(),n=Vc(n),l=Va(n),l.callback=null,Ja(a,l,n),a=n,t.current.lanes=a,ai(t,a),ra(t),e[tl]=t.current,Hr(e),new bc(t)},Vi.version="19.2.4",Vi}var P0;function Ov(){if(P0)return co.exports;P0=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(c){console.error(c)}}return u(),co.exports=Cv(),co.exports}var _v=Ov(),Il=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(u){return this.listeners.add(u),this.onSubscribe(),()=>{this.listeners.delete(u),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Yn,fn,Ql,jm,wv=(jm=class extends Il{constructor(){super();I(this,Yn);I(this,fn);I(this,Ql);V(this,Ql,c=>{if(typeof window<"u"&&window.addEventListener){const r=()=>c();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){x(this,fn)||this.setEventListener(x(this,Ql))}onUnsubscribe(){var c;this.hasListeners()||((c=x(this,fn))==null||c.call(this),V(this,fn,void 0))}setEventListener(c){var r;V(this,Ql,c),(r=x(this,fn))==null||r.call(this),V(this,fn,c(o=>{typeof o=="boolean"?this.setFocused(o):this.onFocus()}))}setFocused(c){x(this,Yn)!==c&&(V(this,Yn,c),this.onFocus())}onFocus(){const c=this.isFocused();this.listeners.forEach(r=>{r(c)})}isFocused(){var c;return typeof x(this,Yn)=="boolean"?x(this,Yn):((c=globalThis.document)==null?void 0:c.visibilityState)!=="hidden"}},Yn=new WeakMap,fn=new WeakMap,Ql=new WeakMap,jm),Do=new wv,Dv={setTimeout:(u,c)=>setTimeout(u,c),clearTimeout:u=>clearTimeout(u),setInterval:(u,c)=>setInterval(u,c),clearInterval:u=>clearInterval(u)},hn,_o,zm,kv=(zm=class{constructor(){I(this,hn,Dv);I(this,_o,!1)}setTimeoutProvider(u){V(this,hn,u)}setTimeout(u,c){return x(this,hn).setTimeout(u,c)}clearTimeout(u){x(this,hn).clearTimeout(u)}setInterval(u,c){return x(this,hn).setInterval(u,c)}clearInterval(u){x(this,hn).clearInterval(u)}},hn=new WeakMap,_o=new WeakMap,zm),Bn=new kv;function Rv(u){setTimeout(u,0)}var Uv=typeof window>"u"||"Deno"in globalThis;function vt(){}function qv(u,c){return typeof u=="function"?u(c):u}function mo(u){return typeof u=="number"&&u>=0&&u!==1/0}function wm(u,c){return Math.max(u+(c||0)-Date.now(),0)}function jn(u,c){return typeof u=="function"?u(c):u}function Pt(u,c){return typeof u=="function"?u(c):u}function em(u,c){const{type:r="all",exact:o,fetchStatus:f,predicate:y,queryKey:p,stale:z}=u;if(p){if(o){if(c.queryHash!==ko(p,c.options))return!1}else if(!Fi(c.queryKey,p))return!1}if(r!=="all"){const S=c.isActive();if(r==="active"&&!S||r==="inactive"&&S)return!1}return!(typeof z=="boolean"&&c.isStale()!==z||f&&f!==c.state.fetchStatus||y&&!y(c))}function tm(u,c){const{exact:r,status:o,predicate:f,mutationKey:y}=u;if(y){if(!c.options.mutationKey)return!1;if(r){if(Wn(c.options.mutationKey)!==Wn(y))return!1}else if(!Fi(c.options.mutationKey,y))return!1}return!(o&&c.state.status!==o||f&&!f(c))}function ko(u,c){return((c==null?void 0:c.queryKeyHashFn)||Wn)(u)}function Wn(u){return JSON.stringify(u,(c,r)=>xo(r)?Object.keys(r).sort().reduce((o,f)=>(o[f]=r[f],o),{}):r)}function Fi(u,c){return u===c?!0:typeof u!=typeof c?!1:u&&c&&typeof u=="object"&&typeof c=="object"?Object.keys(c).every(r=>Fi(u[r],c[r])):!1}var Hv=Object.prototype.hasOwnProperty;function Dm(u,c,r=0){if(u===c)return u;if(r>500)return c;const o=am(u)&&am(c);if(!o&&!(xo(u)&&xo(c)))return c;const y=(o?u:Object.keys(u)).length,p=o?c:Object.keys(c),z=p.length,S=o?new Array(z):{};let b=0;for(let H=0;H<z;H++){const M=o?H:p[H],_=u[M],q=c[M];if(_===q){S[M]=_,(o?H<y:Hv.call(u,M))&&b++;continue}if(_===null||q===null||typeof _!="object"||typeof q!="object"){S[M]=q;continue}const X=Dm(_,q,r+1);S[M]=X,X===_&&b++}return y===z&&b===y?u:S}function wc(u,c){if(!c||Object.keys(u).length!==Object.keys(c).length)return!1;for(const r in u)if(u[r]!==c[r])return!1;return!0}function am(u){return Array.isArray(u)&&u.length===Object.keys(u).length}function xo(u){if(!nm(u))return!1;const c=u.constructor;if(c===void 0)return!0;const r=c.prototype;return!(!nm(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(u)!==Object.prototype)}function nm(u){return Object.prototype.toString.call(u)==="[object Object]"}function Qv(u){return new Promise(c=>{Bn.setTimeout(c,u)})}function yo(u,c,r){return typeof r.structuralSharing=="function"?r.structuralSharing(u,c):r.structuralSharing!==!1?Dm(u,c):c}function Lv(u,c,r=0){const o=[...u,c];return r&&o.length>r?o.slice(1):o}function Bv(u,c,r=0){const o=[c,...u];return r&&o.length>r?o.slice(0,-1):o}var Ro=Symbol();function km(u,c){return!u.queryFn&&(c!=null&&c.initialPromise)?()=>c.initialPromise:!u.queryFn||u.queryFn===Ro?()=>Promise.reject(new Error(`Missing queryFn: '${u.queryHash}'`)):u.queryFn}function Uo(u,c){return typeof u=="function"?u(...c):!!u}function Yv(u,c,r){let o=!1,f;return Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(f??(f=c()),o||(o=!0,f.aborted?r():f.addEventListener("abort",r,{once:!0})),f)}),u}var $i=(()=>{let u=()=>Uv;return{isServer(){return u()},setIsServer(c){u=c}}})();function vo(){let u,c;const r=new Promise((f,y)=>{u=f,c=y});r.status="pending",r.catch(()=>{});function o(f){Object.assign(r,f),delete r.resolve,delete r.reject}return r.resolve=f=>{o({status:"fulfilled",value:f}),u(f)},r.reject=f=>{o({status:"rejected",reason:f}),c(f)},r}var Gv=Rv;function Xv(){let u=[],c=0,r=z=>{z()},o=z=>{z()},f=Gv;const y=z=>{c?u.push(z):f(()=>{r(z)})},p=()=>{const z=u;u=[],z.length&&f(()=>{o(()=>{z.forEach(S=>{r(S)})})})};return{batch:z=>{let S;c++;try{S=z()}finally{c--,c||p()}return S},batchCalls:z=>(...S)=>{y(()=>{z(...S)})},schedule:y,setNotifyFunction:z=>{r=z},setBatchNotifyFunction:z=>{o=z},setScheduler:z=>{f=z}}}var Pe=Xv(),Ll,mn,Bl,Sm,Kv=(Sm=class extends Il{constructor(){super();I(this,Ll,!0);I(this,mn);I(this,Bl);V(this,Bl,c=>{if(typeof window<"u"&&window.addEventListener){const r=()=>c(!0),o=()=>c(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",o)}}})}onSubscribe(){x(this,mn)||this.setEventListener(x(this,Bl))}onUnsubscribe(){var c;this.hasListeners()||((c=x(this,mn))==null||c.call(this),V(this,mn,void 0))}setEventListener(c){var r;V(this,Bl,c),(r=x(this,mn))==null||r.call(this),V(this,mn,c(this.setOnline.bind(this)))}setOnline(c){x(this,Ll)!==c&&(V(this,Ll,c),this.listeners.forEach(o=>{o(c)}))}isOnline(){return x(this,Ll)}},Ll=new WeakMap,mn=new WeakMap,Bl=new WeakMap,Sm),Dc=new Kv;function Zv(u){return Math.min(1e3*2**u,3e4)}function Rm(u){return(u??"online")==="online"?Dc.isOnline():!0}var go=class extends Error{constructor(u){super("CancelledError"),this.revert=u==null?void 0:u.revert,this.silent=u==null?void 0:u.silent}};function Um(u){let c=!1,r=0,o;const f=vo(),y=()=>f.status!=="pending",p=R=>{var B;if(!y()){const L=new go(R);_(L),(B=u.onCancel)==null||B.call(u,L)}},z=()=>{c=!0},S=()=>{c=!1},b=()=>Do.isFocused()&&(u.networkMode==="always"||Dc.isOnline())&&u.canRun(),H=()=>Rm(u.networkMode)&&u.canRun(),M=R=>{y()||(o==null||o(),f.resolve(R))},_=R=>{y()||(o==null||o(),f.reject(R))},q=()=>new Promise(R=>{var B;o=L=>{(y()||b())&&R(L)},(B=u.onPause)==null||B.call(u)}).then(()=>{var R;o=void 0,y()||(R=u.onContinue)==null||R.call(u)}),X=()=>{if(y())return;let R;const B=r===0?u.initialPromise:void 0;try{R=B??u.fn()}catch(L){R=Promise.reject(L)}Promise.resolve(R).then(M).catch(L=>{var fe;if(y())return;const Q=u.retry??($i.isServer()?0:3),J=u.retryDelay??Zv,w=typeof J=="function"?J(r,L):J,ae=Q===!0||typeof Q=="number"&&r<Q||typeof Q=="function"&&Q(r,L);if(c||!ae){_(L);return}r++,(fe=u.onFail)==null||fe.call(u,r,L),Qv(w).then(()=>b()?void 0:q()).then(()=>{c?_(L):X()})})};return{promise:f,status:()=>f.status,cancel:p,continue:()=>(o==null||o(),f),cancelRetry:z,continueRetry:S,canStart:H,start:()=>(H()?X():q().then(X),f)}}var Gn,Nm,qm=(Nm=class{constructor(){I(this,Gn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mo(this.gcTime)&&V(this,Gn,Bn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(u){this.gcTime=Math.max(this.gcTime||0,u??($i.isServer()?1/0:300*1e3))}clearGcTimeout(){x(this,Gn)&&(Bn.clearTimeout(x(this,Gn)),V(this,Gn,void 0))}},Gn=new WeakMap,Nm),Xn,Yl,It,Kn,nt,Wi,Zn,Ht,Hm,_a,Am,Vv=(Am=class extends qm{constructor(c){super();I(this,Ht);I(this,Xn);I(this,Yl);I(this,It);I(this,Kn);I(this,nt);I(this,Wi);I(this,Zn);V(this,Zn,!1),V(this,Wi,c.defaultOptions),this.setOptions(c.options),this.observers=[],V(this,Kn,c.client),V(this,It,x(this,Kn).getQueryCache()),this.queryKey=c.queryKey,this.queryHash=c.queryHash,V(this,Xn,im(this.options)),this.state=c.state??x(this,Xn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var c;return(c=x(this,nt))==null?void 0:c.promise}setOptions(c){if(this.options={...x(this,Wi),...c},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=im(this.options);r.data!==void 0&&(this.setState(lm(r.data,r.dataUpdatedAt)),V(this,Xn,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&x(this,It).remove(this)}setData(c,r){const o=yo(this.state.data,c,this.options);return oe(this,Ht,_a).call(this,{data:o,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),o}setState(c,r){oe(this,Ht,_a).call(this,{type:"setState",state:c,setStateOptions:r})}cancel(c){var o,f;const r=(o=x(this,nt))==null?void 0:o.promise;return(f=x(this,nt))==null||f.cancel(c),r?r.then(vt).catch(vt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return x(this,Xn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(c=>Pt(c.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ro||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(c=>jn(c.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(c=>c.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(c=0){return this.state.data===void 0?!0:c==="static"?!1:this.state.isInvalidated?!0:!wm(this.state.dataUpdatedAt,c)}onFocus(){var r;const c=this.observers.find(o=>o.shouldFetchOnWindowFocus());c==null||c.refetch({cancelRefetch:!1}),(r=x(this,nt))==null||r.continue()}onOnline(){var r;const c=this.observers.find(o=>o.shouldFetchOnReconnect());c==null||c.refetch({cancelRefetch:!1}),(r=x(this,nt))==null||r.continue()}addObserver(c){this.observers.includes(c)||(this.observers.push(c),this.clearGcTimeout(),x(this,It).notify({type:"observerAdded",query:this,observer:c}))}removeObserver(c){this.observers.includes(c)&&(this.observers=this.observers.filter(r=>r!==c),this.observers.length||(x(this,nt)&&(x(this,Zn)||oe(this,Ht,Hm).call(this)?x(this,nt).cancel({revert:!0}):x(this,nt).cancelRetry()),this.scheduleGc()),x(this,It).notify({type:"observerRemoved",query:this,observer:c}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||oe(this,Ht,_a).call(this,{type:"invalidate"})}async fetch(c,r){var S,b,H,M,_,q,X,R,B,L,Q,J;if(this.state.fetchStatus!=="idle"&&((S=x(this,nt))==null?void 0:S.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(x(this,nt))return x(this,nt).continueRetry(),x(this,nt).promise}if(c&&this.setOptions(c),!this.options.queryFn){const w=this.observers.find(ae=>ae.options.queryFn);w&&this.setOptions(w.options)}const o=new AbortController,f=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(V(this,Zn,!0),o.signal)})},y=()=>{const w=km(this.options,r),fe=(()=>{const ne={client:x(this,Kn),queryKey:this.queryKey,meta:this.meta};return f(ne),ne})();return V(this,Zn,!1),this.options.persister?this.options.persister(w,fe,this):w(fe)},z=(()=>{const w={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:x(this,Kn),state:this.state,fetchFn:y};return f(w),w})();(b=this.options.behavior)==null||b.onFetch(z,this),V(this,Yl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((H=z.fetchOptions)==null?void 0:H.meta))&&oe(this,Ht,_a).call(this,{type:"fetch",meta:(M=z.fetchOptions)==null?void 0:M.meta}),V(this,nt,Um({initialPromise:r==null?void 0:r.initialPromise,fn:z.fetchFn,onCancel:w=>{w instanceof go&&w.revert&&this.setState({...x(this,Yl),fetchStatus:"idle"}),o.abort()},onFail:(w,ae)=>{oe(this,Ht,_a).call(this,{type:"failed",failureCount:w,error:ae})},onPause:()=>{oe(this,Ht,_a).call(this,{type:"pause"})},onContinue:()=>{oe(this,Ht,_a).call(this,{type:"continue"})},retry:z.options.retry,retryDelay:z.options.retryDelay,networkMode:z.options.networkMode,canRun:()=>!0}));try{const w=await x(this,nt).start();if(w===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(w),(q=(_=x(this,It).config).onSuccess)==null||q.call(_,w,this),(R=(X=x(this,It).config).onSettled)==null||R.call(X,w,this.state.error,this),w}catch(w){if(w instanceof go){if(w.silent)return x(this,nt).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw oe(this,Ht,_a).call(this,{type:"error",error:w}),(L=(B=x(this,It).config).onError)==null||L.call(B,w,this),(J=(Q=x(this,It).config).onSettled)==null||J.call(Q,this.state.data,w,this),w}finally{this.scheduleGc()}}},Xn=new WeakMap,Yl=new WeakMap,It=new WeakMap,Kn=new WeakMap,nt=new WeakMap,Wi=new WeakMap,Zn=new WeakMap,Ht=new WeakSet,Hm=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},_a=function(c){const r=o=>{switch(c.type){case"failed":return{...o,fetchFailureCount:c.failureCount,fetchFailureReason:c.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...Qm(o.data,this.options),fetchMeta:c.meta??null};case"success":const f={...o,...lm(c.data,c.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!c.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return V(this,Yl,c.manual?f:void 0),f;case"error":const y=c.error;return{...o,error:y,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:y,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...c.state}}};this.state=r(this.state),Pe.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate()}),x(this,It).notify({query:this,type:"updated",action:c})})},Am);function Qm(u,c){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Rm(c.networkMode)?"fetching":"paused",...u===void 0&&{error:null,status:"pending"}}}function lm(u,c){return{data:u,dataUpdatedAt:c??Date.now(),error:null,isInvalidated:!1,status:"success"}}function im(u){const c=typeof u.initialData=="function"?u.initialData():u.initialData,r=c!==void 0,o=r?typeof u.initialDataUpdatedAt=="function"?u.initialDataUpdatedAt():u.initialDataUpdatedAt:0;return{data:c,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 Et,pe,Ii,yt,Vn,Gl,wa,xn,Pi,Xl,Kl,Jn,Fn,yn,Zl,Ne,Ji,po,bo,jo,zo,So,No,Ao,Lm,Em,Jv=(Em=class extends Il{constructor(c,r){super();I(this,Ne);I(this,Et);I(this,pe);I(this,Ii);I(this,yt);I(this,Vn);I(this,Gl);I(this,wa);I(this,xn);I(this,Pi);I(this,Xl);I(this,Kl);I(this,Jn);I(this,Fn);I(this,yn);I(this,Zl,new Set);this.options=r,V(this,Et,c),V(this,xn,null),V(this,wa,vo()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(x(this,pe).addObserver(this),sm(x(this,pe),this.options)?oe(this,Ne,Ji).call(this):this.updateResult(),oe(this,Ne,zo).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Eo(x(this,pe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Eo(x(this,pe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,oe(this,Ne,So).call(this),oe(this,Ne,No).call(this),x(this,pe).removeObserver(this)}setOptions(c){const r=this.options,o=x(this,pe);if(this.options=x(this,Et).defaultQueryOptions(c),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Pt(this.options.enabled,x(this,pe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");oe(this,Ne,Ao).call(this),x(this,pe).setOptions(this.options),r._defaulted&&!wc(this.options,r)&&x(this,Et).getQueryCache().notify({type:"observerOptionsUpdated",query:x(this,pe),observer:this});const f=this.hasListeners();f&&cm(x(this,pe),o,this.options,r)&&oe(this,Ne,Ji).call(this),this.updateResult(),f&&(x(this,pe)!==o||Pt(this.options.enabled,x(this,pe))!==Pt(r.enabled,x(this,pe))||jn(this.options.staleTime,x(this,pe))!==jn(r.staleTime,x(this,pe)))&&oe(this,Ne,po).call(this);const y=oe(this,Ne,bo).call(this);f&&(x(this,pe)!==o||Pt(this.options.enabled,x(this,pe))!==Pt(r.enabled,x(this,pe))||y!==x(this,yn))&&oe(this,Ne,jo).call(this,y)}getOptimisticResult(c){const r=x(this,Et).getQueryCache().build(x(this,Et),c),o=this.createResult(r,c);return $v(this,o)&&(V(this,yt,o),V(this,Gl,this.options),V(this,Vn,x(this,pe).state)),o}getCurrentResult(){return x(this,yt)}trackResult(c,r){return new Proxy(c,{get:(o,f)=>(this.trackProp(f),r==null||r(f),f==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&x(this,wa).status==="pending"&&x(this,wa).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(o,f))})}trackProp(c){x(this,Zl).add(c)}getCurrentQuery(){return x(this,pe)}refetch({...c}={}){return this.fetch({...c})}fetchOptimistic(c){const r=x(this,Et).defaultQueryOptions(c),o=x(this,Et).getQueryCache().build(x(this,Et),r);return o.fetch().then(()=>this.createResult(o,r))}fetch(c){return oe(this,Ne,Ji).call(this,{...c,cancelRefetch:c.cancelRefetch??!0}).then(()=>(this.updateResult(),x(this,yt)))}createResult(c,r){var Ae;const o=x(this,pe),f=this.options,y=x(this,yt),p=x(this,Vn),z=x(this,Gl),b=c!==o?c.state:x(this,Ii),{state:H}=c;let M={...H},_=!1,q;if(r._optimisticResults){const He=this.hasListeners(),$e=!He&&sm(c,r),We=He&&cm(c,o,r,f);($e||We)&&(M={...M,...Qm(H.data,c.options)}),r._optimisticResults==="isRestoring"&&(M.fetchStatus="idle")}let{error:X,errorUpdatedAt:R,status:B}=M;q=M.data;let L=!1;if(r.placeholderData!==void 0&&q===void 0&&B==="pending"){let He;y!=null&&y.isPlaceholderData&&r.placeholderData===(z==null?void 0:z.placeholderData)?(He=y.data,L=!0):He=typeof r.placeholderData=="function"?r.placeholderData((Ae=x(this,Kl))==null?void 0:Ae.state.data,x(this,Kl)):r.placeholderData,He!==void 0&&(B="success",q=yo(y==null?void 0:y.data,He,r),_=!0)}if(r.select&&q!==void 0&&!L)if(y&&q===(p==null?void 0:p.data)&&r.select===x(this,Pi))q=x(this,Xl);else try{V(this,Pi,r.select),q=r.select(q),q=yo(y==null?void 0:y.data,q,r),V(this,Xl,q),V(this,xn,null)}catch(He){V(this,xn,He)}x(this,xn)&&(X=x(this,xn),q=x(this,Xl),R=Date.now(),B="error");const Q=M.fetchStatus==="fetching",J=B==="pending",w=B==="error",ae=J&&Q,fe=q!==void 0,ue={status:B,fetchStatus:M.fetchStatus,isPending:J,isSuccess:B==="success",isError:w,isInitialLoading:ae,isLoading:ae,data:q,dataUpdatedAt:M.dataUpdatedAt,error:X,errorUpdatedAt:R,failureCount:M.fetchFailureCount,failureReason:M.fetchFailureReason,errorUpdateCount:M.errorUpdateCount,isFetched:c.isFetched(),isFetchedAfterMount:M.dataUpdateCount>b.dataUpdateCount||M.errorUpdateCount>b.errorUpdateCount,isFetching:Q,isRefetching:Q&&!J,isLoadingError:w&&!fe,isPaused:M.fetchStatus==="paused",isPlaceholderData:_,isRefetchError:w&&fe,isStale:qo(c,r),refetch:this.refetch,promise:x(this,wa),isEnabled:Pt(r.enabled,c)!==!1};if(this.options.experimental_prefetchInRender){const He=ue.data!==void 0,$e=ue.status==="error"&&!He,We=ot=>{$e?ot.reject(ue.error):He&&ot.resolve(ue.data)},ia=()=>{const ot=V(this,wa,ue.promise=vo());We(ot)},gt=x(this,wa);switch(gt.status){case"pending":c.queryHash===o.queryHash&&We(gt);break;case"fulfilled":($e||ue.data!==gt.value)&&ia();break;case"rejected":(!$e||ue.error!==gt.reason)&&ia();break}}return ue}updateResult(){const c=x(this,yt),r=this.createResult(x(this,pe),this.options);if(V(this,Vn,x(this,pe).state),V(this,Gl,this.options),x(this,Vn).data!==void 0&&V(this,Kl,x(this,pe)),wc(r,c))return;V(this,yt,r);const o=()=>{if(!c)return!0;const{notifyOnChangeProps:f}=this.options,y=typeof f=="function"?f():f;if(y==="all"||!y&&!x(this,Zl).size)return!0;const p=new Set(y??x(this,Zl));return this.options.throwOnError&&p.add("error"),Object.keys(x(this,yt)).some(z=>{const S=z;return x(this,yt)[S]!==c[S]&&p.has(S)})};oe(this,Ne,Lm).call(this,{listeners:o()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&oe(this,Ne,zo).call(this)}},Et=new WeakMap,pe=new WeakMap,Ii=new WeakMap,yt=new WeakMap,Vn=new WeakMap,Gl=new WeakMap,wa=new WeakMap,xn=new WeakMap,Pi=new WeakMap,Xl=new WeakMap,Kl=new WeakMap,Jn=new WeakMap,Fn=new WeakMap,yn=new WeakMap,Zl=new WeakMap,Ne=new WeakSet,Ji=function(c){oe(this,Ne,Ao).call(this);let r=x(this,pe).fetch(this.options,c);return c!=null&&c.throwOnError||(r=r.catch(vt)),r},po=function(){oe(this,Ne,So).call(this);const c=jn(this.options.staleTime,x(this,pe));if($i.isServer()||x(this,yt).isStale||!mo(c))return;const o=wm(x(this,yt).dataUpdatedAt,c)+1;V(this,Jn,Bn.setTimeout(()=>{x(this,yt).isStale||this.updateResult()},o))},bo=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(x(this,pe)):this.options.refetchInterval)??!1},jo=function(c){oe(this,Ne,No).call(this),V(this,yn,c),!($i.isServer()||Pt(this.options.enabled,x(this,pe))===!1||!mo(x(this,yn))||x(this,yn)===0)&&V(this,Fn,Bn.setInterval(()=>{(this.options.refetchIntervalInBackground||Do.isFocused())&&oe(this,Ne,Ji).call(this)},x(this,yn)))},zo=function(){oe(this,Ne,po).call(this),oe(this,Ne,jo).call(this,oe(this,Ne,bo).call(this))},So=function(){x(this,Jn)&&(Bn.clearTimeout(x(this,Jn)),V(this,Jn,void 0))},No=function(){x(this,Fn)&&(Bn.clearInterval(x(this,Fn)),V(this,Fn,void 0))},Ao=function(){const c=x(this,Et).getQueryCache().build(x(this,Et),this.options);if(c===x(this,pe))return;const r=x(this,pe);V(this,pe,c),V(this,Ii,c.state),this.hasListeners()&&(r==null||r.removeObserver(this),c.addObserver(this))},Lm=function(c){Pe.batch(()=>{c.listeners&&this.listeners.forEach(r=>{r(x(this,yt))}),x(this,Et).getQueryCache().notify({query:x(this,pe),type:"observerResultsUpdated"})})},Em);function Fv(u,c){return Pt(c.enabled,u)!==!1&&u.state.data===void 0&&!(u.state.status==="error"&&c.retryOnMount===!1)}function sm(u,c){return Fv(u,c)||u.state.data!==void 0&&Eo(u,c,c.refetchOnMount)}function Eo(u,c,r){if(Pt(c.enabled,u)!==!1&&jn(c.staleTime,u)!=="static"){const o=typeof r=="function"?r(u):r;return o==="always"||o!==!1&&qo(u,c)}return!1}function cm(u,c,r,o){return(u!==c||Pt(o.enabled,u)===!1)&&(!r.suspense||u.state.status!=="error")&&qo(u,r)}function qo(u,c){return Pt(c.enabled,u)!==!1&&u.isStaleByTime(jn(c.staleTime,u))}function $v(u,c){return!wc(u.getCurrentResult(),c)}function um(u){return{onFetch:(c,r)=>{var H,M,_,q,X;const o=c.options,f=(_=(M=(H=c.fetchOptions)==null?void 0:H.meta)==null?void 0:M.fetchMore)==null?void 0:_.direction,y=((q=c.state.data)==null?void 0:q.pages)||[],p=((X=c.state.data)==null?void 0:X.pageParams)||[];let z={pages:[],pageParams:[]},S=0;const b=async()=>{let R=!1;const B=J=>{Yv(J,()=>c.signal,()=>R=!0)},L=km(c.options,c.fetchOptions),Q=async(J,w,ae)=>{if(R)return Promise.reject();if(w==null&&J.pages.length)return Promise.resolve(J);const ne=(()=>{const $e={client:c.client,queryKey:c.queryKey,pageParam:w,direction:ae?"backward":"forward",meta:c.options.meta};return B($e),$e})(),ue=await L(ne),{maxPages:Ae}=c.options,He=ae?Bv:Lv;return{pages:He(J.pages,ue,Ae),pageParams:He(J.pageParams,w,Ae)}};if(f&&y.length){const J=f==="backward",w=J?Wv:rm,ae={pages:y,pageParams:p},fe=w(o,ae);z=await Q(ae,fe,J)}else{const J=u??y.length;do{const w=S===0?p[0]??o.initialPageParam:rm(o,z);if(S>0&&w==null)break;z=await Q(z,w),S++}while(S<J)}return z};c.options.persister?c.fetchFn=()=>{var R,B;return(B=(R=c.options).persister)==null?void 0:B.call(R,b,{client:c.client,queryKey:c.queryKey,meta:c.options.meta,signal:c.signal},r)}:c.fetchFn=b}}}function rm(u,{pages:c,pageParams:r}){const o=c.length-1;return c.length>0?u.getNextPageParam(c[o],c,r[o],r):void 0}function Wv(u,{pages:c,pageParams:r}){var o;return c.length>0?(o=u.getPreviousPageParam)==null?void 0:o.call(u,c[0],c,r[0],r):void 0}var es,oa,ft,$n,da,dn,Tm,Iv=(Tm=class extends qm{constructor(c){super();I(this,da);I(this,es);I(this,oa);I(this,ft);I(this,$n);V(this,es,c.client),this.mutationId=c.mutationId,V(this,ft,c.mutationCache),V(this,oa,[]),this.state=c.state||Bm(),this.setOptions(c.options),this.scheduleGc()}setOptions(c){this.options=c,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(c){x(this,oa).includes(c)||(x(this,oa).push(c),this.clearGcTimeout(),x(this,ft).notify({type:"observerAdded",mutation:this,observer:c}))}removeObserver(c){V(this,oa,x(this,oa).filter(r=>r!==c)),this.scheduleGc(),x(this,ft).notify({type:"observerRemoved",mutation:this,observer:c})}optionalRemove(){x(this,oa).length||(this.state.status==="pending"?this.scheduleGc():x(this,ft).remove(this))}continue(){var c;return((c=x(this,$n))==null?void 0:c.continue())??this.execute(this.state.variables)}async execute(c){var p,z,S,b,H,M,_,q,X,R,B,L,Q,J,w,ae,fe,ne;const r=()=>{oe(this,da,dn).call(this,{type:"continue"})},o={client:x(this,es),meta:this.options.meta,mutationKey:this.options.mutationKey};V(this,$n,Um({fn:()=>this.options.mutationFn?this.options.mutationFn(c,o):Promise.reject(new Error("No mutationFn found")),onFail:(ue,Ae)=>{oe(this,da,dn).call(this,{type:"failed",failureCount:ue,error:Ae})},onPause:()=>{oe(this,da,dn).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>x(this,ft).canRun(this)}));const f=this.state.status==="pending",y=!x(this,$n).canStart();try{if(f)r();else{oe(this,da,dn).call(this,{type:"pending",variables:c,isPaused:y}),x(this,ft).config.onMutate&&await x(this,ft).config.onMutate(c,this,o);const Ae=await((z=(p=this.options).onMutate)==null?void 0:z.call(p,c,o));Ae!==this.state.context&&oe(this,da,dn).call(this,{type:"pending",context:Ae,variables:c,isPaused:y})}const ue=await x(this,$n).start();return await((b=(S=x(this,ft).config).onSuccess)==null?void 0:b.call(S,ue,c,this.state.context,this,o)),await((M=(H=this.options).onSuccess)==null?void 0:M.call(H,ue,c,this.state.context,o)),await((q=(_=x(this,ft).config).onSettled)==null?void 0:q.call(_,ue,null,this.state.variables,this.state.context,this,o)),await((R=(X=this.options).onSettled)==null?void 0:R.call(X,ue,null,c,this.state.context,o)),oe(this,da,dn).call(this,{type:"success",data:ue}),ue}catch(ue){try{await((L=(B=x(this,ft).config).onError)==null?void 0:L.call(B,ue,c,this.state.context,this,o))}catch(Ae){Promise.reject(Ae)}try{await((J=(Q=this.options).onError)==null?void 0:J.call(Q,ue,c,this.state.context,o))}catch(Ae){Promise.reject(Ae)}try{await((ae=(w=x(this,ft).config).onSettled)==null?void 0:ae.call(w,void 0,ue,this.state.variables,this.state.context,this,o))}catch(Ae){Promise.reject(Ae)}try{await((ne=(fe=this.options).onSettled)==null?void 0:ne.call(fe,void 0,ue,c,this.state.context,o))}catch(Ae){Promise.reject(Ae)}throw oe(this,da,dn).call(this,{type:"error",error:ue}),ue}finally{x(this,ft).runNext(this)}}},es=new WeakMap,oa=new WeakMap,ft=new WeakMap,$n=new WeakMap,da=new WeakSet,dn=function(c){const r=o=>{switch(c.type){case"failed":return{...o,failureCount:c.failureCount,failureReason:c.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:c.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:c.isPaused,status:"pending",variables:c.variables,submittedAt:Date.now()};case"success":return{...o,data:c.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:c.error,failureCount:o.failureCount+1,failureReason:c.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Pe.batch(()=>{x(this,oa).forEach(o=>{o.onMutationUpdate(c)}),x(this,ft).notify({mutation:this,type:"updated",action:c})})},Tm);function Bm(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Da,la,ts,Mm,Pv=(Mm=class extends Il{constructor(c={}){super();I(this,Da);I(this,la);I(this,ts);this.config=c,V(this,Da,new Set),V(this,la,new Map),V(this,ts,0)}build(c,r,o){const f=new Iv({client:c,mutationCache:this,mutationId:++zc(this,ts)._,options:c.defaultMutationOptions(r),state:o});return this.add(f),f}add(c){x(this,Da).add(c);const r=Sc(c);if(typeof r=="string"){const o=x(this,la).get(r);o?o.push(c):x(this,la).set(r,[c])}this.notify({type:"added",mutation:c})}remove(c){if(x(this,Da).delete(c)){const r=Sc(c);if(typeof r=="string"){const o=x(this,la).get(r);if(o)if(o.length>1){const f=o.indexOf(c);f!==-1&&o.splice(f,1)}else o[0]===c&&x(this,la).delete(r)}}this.notify({type:"removed",mutation:c})}canRun(c){const r=Sc(c);if(typeof r=="string"){const o=x(this,la).get(r),f=o==null?void 0:o.find(y=>y.state.status==="pending");return!f||f===c}else return!0}runNext(c){var o;const r=Sc(c);if(typeof r=="string"){const f=(o=x(this,la).get(r))==null?void 0:o.find(y=>y!==c&&y.state.isPaused);return(f==null?void 0:f.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Pe.batch(()=>{x(this,Da).forEach(c=>{this.notify({type:"removed",mutation:c})}),x(this,Da).clear(),x(this,la).clear()})}getAll(){return Array.from(x(this,Da))}find(c){const r={exact:!0,...c};return this.getAll().find(o=>tm(r,o))}findAll(c={}){return this.getAll().filter(r=>tm(c,r))}notify(c){Pe.batch(()=>{this.listeners.forEach(r=>{r(c)})})}resumePausedMutations(){const c=this.getAll().filter(r=>r.state.isPaused);return Pe.batch(()=>Promise.all(c.map(r=>r.continue().catch(vt))))}},Da=new WeakMap,la=new WeakMap,ts=new WeakMap,Mm);function Sc(u){var c;return(c=u.options.scope)==null?void 0:c.id}var ka,vn,Tt,Ra,qa,Oc,To,Cm,e1=(Cm=class extends Il{constructor(r,o){super();I(this,qa);I(this,ka);I(this,vn);I(this,Tt);I(this,Ra);V(this,ka,r),this.setOptions(o),this.bindMethods(),oe(this,qa,Oc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var f;const o=this.options;this.options=x(this,ka).defaultMutationOptions(r),wc(this.options,o)||x(this,ka).getMutationCache().notify({type:"observerOptionsUpdated",mutation:x(this,Tt),observer:this}),o!=null&&o.mutationKey&&this.options.mutationKey&&Wn(o.mutationKey)!==Wn(this.options.mutationKey)?this.reset():((f=x(this,Tt))==null?void 0:f.state.status)==="pending"&&x(this,Tt).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=x(this,Tt))==null||r.removeObserver(this)}onMutationUpdate(r){oe(this,qa,Oc).call(this),oe(this,qa,To).call(this,r)}getCurrentResult(){return x(this,vn)}reset(){var r;(r=x(this,Tt))==null||r.removeObserver(this),V(this,Tt,void 0),oe(this,qa,Oc).call(this),oe(this,qa,To).call(this)}mutate(r,o){var f;return V(this,Ra,o),(f=x(this,Tt))==null||f.removeObserver(this),V(this,Tt,x(this,ka).getMutationCache().build(x(this,ka),this.options)),x(this,Tt).addObserver(this),x(this,Tt).execute(r)}},ka=new WeakMap,vn=new WeakMap,Tt=new WeakMap,Ra=new WeakMap,qa=new WeakSet,Oc=function(){var o;const r=((o=x(this,Tt))==null?void 0:o.state)??Bm();V(this,vn,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},To=function(r){Pe.batch(()=>{var o,f,y,p,z,S,b,H;if(x(this,Ra)&&this.hasListeners()){const M=x(this,vn).variables,_=x(this,vn).context,q={client:x(this,ka),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(f=(o=x(this,Ra)).onSuccess)==null||f.call(o,r.data,M,_,q)}catch(X){Promise.reject(X)}try{(p=(y=x(this,Ra)).onSettled)==null||p.call(y,r.data,null,M,_,q)}catch(X){Promise.reject(X)}}else if((r==null?void 0:r.type)==="error"){try{(S=(z=x(this,Ra)).onError)==null||S.call(z,r.error,M,_,q)}catch(X){Promise.reject(X)}try{(H=(b=x(this,Ra)).onSettled)==null||H.call(b,void 0,r.error,M,_,q)}catch(X){Promise.reject(X)}}}this.listeners.forEach(M=>{M(x(this,vn))})})},Cm),fa,Om,t1=(Om=class extends Il{constructor(c={}){super();I(this,fa);this.config=c,V(this,fa,new Map)}build(c,r,o){const f=r.queryKey,y=r.queryHash??ko(f,r);let p=this.get(y);return p||(p=new Vv({client:c,queryKey:f,queryHash:y,options:c.defaultQueryOptions(r),state:o,defaultOptions:c.getQueryDefaults(f)}),this.add(p)),p}add(c){x(this,fa).has(c.queryHash)||(x(this,fa).set(c.queryHash,c),this.notify({type:"added",query:c}))}remove(c){const r=x(this,fa).get(c.queryHash);r&&(c.destroy(),r===c&&x(this,fa).delete(c.queryHash),this.notify({type:"removed",query:c}))}clear(){Pe.batch(()=>{this.getAll().forEach(c=>{this.remove(c)})})}get(c){return x(this,fa).get(c)}getAll(){return[...x(this,fa).values()]}find(c){const r={exact:!0,...c};return this.getAll().find(o=>em(r,o))}findAll(c={}){const r=this.getAll();return Object.keys(c).length>0?r.filter(o=>em(c,o)):r}notify(c){Pe.batch(()=>{this.listeners.forEach(r=>{r(c)})})}onFocus(){Pe.batch(()=>{this.getAll().forEach(c=>{c.onFocus()})})}onOnline(){Pe.batch(()=>{this.getAll().forEach(c=>{c.onOnline()})})}},fa=new WeakMap,Om),Be,gn,pn,Vl,Jl,bn,Fl,$l,_m,a1=(_m=class{constructor(u={}){I(this,Be);I(this,gn);I(this,pn);I(this,Vl);I(this,Jl);I(this,bn);I(this,Fl);I(this,$l);V(this,Be,u.queryCache||new t1),V(this,gn,u.mutationCache||new Pv),V(this,pn,u.defaultOptions||{}),V(this,Vl,new Map),V(this,Jl,new Map),V(this,bn,0)}mount(){zc(this,bn)._++,x(this,bn)===1&&(V(this,Fl,Do.subscribe(async u=>{u&&(await this.resumePausedMutations(),x(this,Be).onFocus())})),V(this,$l,Dc.subscribe(async u=>{u&&(await this.resumePausedMutations(),x(this,Be).onOnline())})))}unmount(){var u,c;zc(this,bn)._--,x(this,bn)===0&&((u=x(this,Fl))==null||u.call(this),V(this,Fl,void 0),(c=x(this,$l))==null||c.call(this),V(this,$l,void 0))}isFetching(u){return x(this,Be).findAll({...u,fetchStatus:"fetching"}).length}isMutating(u){return x(this,gn).findAll({...u,status:"pending"}).length}getQueryData(u){var r;const c=this.defaultQueryOptions({queryKey:u});return(r=x(this,Be).get(c.queryHash))==null?void 0:r.state.data}ensureQueryData(u){const c=this.defaultQueryOptions(u),r=x(this,Be).build(this,c),o=r.state.data;return o===void 0?this.fetchQuery(u):(u.revalidateIfStale&&r.isStaleByTime(jn(c.staleTime,r))&&this.prefetchQuery(c),Promise.resolve(o))}getQueriesData(u){return x(this,Be).findAll(u).map(({queryKey:c,state:r})=>{const o=r.data;return[c,o]})}setQueryData(u,c,r){const o=this.defaultQueryOptions({queryKey:u}),f=x(this,Be).get(o.queryHash),y=f==null?void 0:f.state.data,p=qv(c,y);if(p!==void 0)return x(this,Be).build(this,o).setData(p,{...r,manual:!0})}setQueriesData(u,c,r){return Pe.batch(()=>x(this,Be).findAll(u).map(({queryKey:o})=>[o,this.setQueryData(o,c,r)]))}getQueryState(u){var r;const c=this.defaultQueryOptions({queryKey:u});return(r=x(this,Be).get(c.queryHash))==null?void 0:r.state}removeQueries(u){const c=x(this,Be);Pe.batch(()=>{c.findAll(u).forEach(r=>{c.remove(r)})})}resetQueries(u,c){const r=x(this,Be);return Pe.batch(()=>(r.findAll(u).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...u},c)))}cancelQueries(u,c={}){const r={revert:!0,...c},o=Pe.batch(()=>x(this,Be).findAll(u).map(f=>f.cancel(r)));return Promise.all(o).then(vt).catch(vt)}invalidateQueries(u,c={}){return Pe.batch(()=>(x(this,Be).findAll(u).forEach(r=>{r.invalidate()}),(u==null?void 0:u.refetchType)==="none"?Promise.resolve():this.refetchQueries({...u,type:(u==null?void 0:u.refetchType)??(u==null?void 0:u.type)??"active"},c)))}refetchQueries(u,c={}){const r={...c,cancelRefetch:c.cancelRefetch??!0},o=Pe.batch(()=>x(this,Be).findAll(u).filter(f=>!f.isDisabled()&&!f.isStatic()).map(f=>{let y=f.fetch(void 0,r);return r.throwOnError||(y=y.catch(vt)),f.state.fetchStatus==="paused"?Promise.resolve():y}));return Promise.all(o).then(vt)}fetchQuery(u){const c=this.defaultQueryOptions(u);c.retry===void 0&&(c.retry=!1);const r=x(this,Be).build(this,c);return r.isStaleByTime(jn(c.staleTime,r))?r.fetch(c):Promise.resolve(r.state.data)}prefetchQuery(u){return this.fetchQuery(u).then(vt).catch(vt)}fetchInfiniteQuery(u){return u.behavior=um(u.pages),this.fetchQuery(u)}prefetchInfiniteQuery(u){return this.fetchInfiniteQuery(u).then(vt).catch(vt)}ensureInfiniteQueryData(u){return u.behavior=um(u.pages),this.ensureQueryData(u)}resumePausedMutations(){return Dc.isOnline()?x(this,gn).resumePausedMutations():Promise.resolve()}getQueryCache(){return x(this,Be)}getMutationCache(){return x(this,gn)}getDefaultOptions(){return x(this,pn)}setDefaultOptions(u){V(this,pn,u)}setQueryDefaults(u,c){x(this,Vl).set(Wn(u),{queryKey:u,defaultOptions:c})}getQueryDefaults(u){const c=[...x(this,Vl).values()],r={};return c.forEach(o=>{Fi(u,o.queryKey)&&Object.assign(r,o.defaultOptions)}),r}setMutationDefaults(u,c){x(this,Jl).set(Wn(u),{mutationKey:u,defaultOptions:c})}getMutationDefaults(u){const c=[...x(this,Jl).values()],r={};return c.forEach(o=>{Fi(u,o.mutationKey)&&Object.assign(r,o.defaultOptions)}),r}defaultQueryOptions(u){if(u._defaulted)return u;const c={...x(this,pn).queries,...this.getQueryDefaults(u.queryKey),...u,_defaulted:!0};return c.queryHash||(c.queryHash=ko(c.queryKey,c)),c.refetchOnReconnect===void 0&&(c.refetchOnReconnect=c.networkMode!=="always"),c.throwOnError===void 0&&(c.throwOnError=!!c.suspense),!c.networkMode&&c.persister&&(c.networkMode="offlineFirst"),c.queryFn===Ro&&(c.enabled=!1),c}defaultMutationOptions(u){return u!=null&&u._defaulted?u:{...x(this,pn).mutations,...(u==null?void 0:u.mutationKey)&&this.getMutationDefaults(u.mutationKey),...u,_defaulted:!0}}clear(){x(this,Be).clear(),x(this,gn).clear()}},Be=new WeakMap,gn=new WeakMap,pn=new WeakMap,Vl=new WeakMap,Jl=new WeakMap,bn=new WeakMap,Fl=new WeakMap,$l=new WeakMap,_m),Ym=G.createContext(void 0),In=u=>{const c=G.useContext(Ym);if(!c)throw new Error("No QueryClient set, use QueryClientProvider to set one");return c},n1=({client:u,children:c})=>(G.useEffect(()=>(u.mount(),()=>{u.unmount()}),[u]),i.jsx(Ym.Provider,{value:u,children:c})),Gm=G.createContext(!1),l1=()=>G.useContext(Gm);Gm.Provider;function i1(){let u=!1;return{clearReset:()=>{u=!1},reset:()=>{u=!0},isReset:()=>u}}var s1=G.createContext(i1()),c1=()=>G.useContext(s1),u1=(u,c,r)=>{const o=r!=null&&r.state.error&&typeof u.throwOnError=="function"?Uo(u.throwOnError,[r.state.error,r]):u.throwOnError;(u.suspense||u.experimental_prefetchInRender||o)&&(c.isReset()||(u.retryOnMount=!1))},r1=u=>{G.useEffect(()=>{u.clearReset()},[u])},o1=({result:u,errorResetBoundary:c,throwOnError:r,query:o,suspense:f})=>u.isError&&!c.isReset()&&!u.isFetching&&o&&(f&&u.data===void 0||Uo(r,[u.error,o])),d1=u=>{if(u.suspense){const r=f=>f==="static"?f:Math.max(f??1e3,1e3),o=u.staleTime;u.staleTime=typeof o=="function"?(...f)=>r(o(...f)):r(o),typeof u.gcTime=="number"&&(u.gcTime=Math.max(u.gcTime,1e3))}},f1=(u,c)=>u.isLoading&&u.isFetching&&!c,h1=(u,c)=>(u==null?void 0:u.suspense)&&c.isPending,om=(u,c,r)=>c.fetchOptimistic(u).catch(()=>{r.clearReset()});function m1(u,c,r){var _,q,X,R;const o=l1(),f=c1(),y=In(),p=y.defaultQueryOptions(u);(q=(_=y.getDefaultOptions().queries)==null?void 0:_._experimental_beforeQuery)==null||q.call(_,p);const z=y.getQueryCache().get(p.queryHash);p._optimisticResults=o?"isRestoring":"optimistic",d1(p),u1(p,f,z),r1(f);const S=!y.getQueryCache().get(p.queryHash),[b]=G.useState(()=>new c(y,p)),H=b.getOptimisticResult(p),M=!o&&u.subscribed!==!1;if(G.useSyncExternalStore(G.useCallback(B=>{const L=M?b.subscribe(Pe.batchCalls(B)):vt;return b.updateResult(),L},[b,M]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),G.useEffect(()=>{b.setOptions(p)},[p,b]),h1(p,H))throw om(p,b,f);if(o1({result:H,errorResetBoundary:f,throwOnError:p.throwOnError,query:z,suspense:p.suspense}))throw H.error;if((R=(X=y.getDefaultOptions().queries)==null?void 0:X._experimental_afterQuery)==null||R.call(X,p,H),p.experimental_prefetchInRender&&!$i.isServer()&&f1(H,o)){const B=S?om(p,b,f):z==null?void 0:z.promise;B==null||B.catch(vt).finally(()=>{b.updateResult()})}return p.notifyOnChangeProps?H:b.trackResult(H)}function rt(u,c){return m1(u,Jv)}function Ua(u,c){const r=In(),[o]=G.useState(()=>new e1(r,u));G.useEffect(()=>{o.setOptions(u)},[o,u]);const f=G.useSyncExternalStore(G.useCallback(p=>o.subscribe(Pe.batchCalls(p)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),y=G.useCallback((p,z)=>{o.mutate(p,z).catch(vt)},[o]);if(f.error&&Uo(o.options.throwOnError,[f.error]))throw f.error;return{...f,mutate:y,mutateAsync:f.mutate}}async function x1(u,c,r){try{const o=`${u.replace(/\/$/,"")}${c}`,f=await fetch(o,{...r,headers:{"Content-Type":"application/json",...r==null?void 0:r.headers}});if(!f.ok){let p={};try{p=await f.json()}catch{}return{success:!1,error:{code:p.code??`HTTP_${f.status}`,message:p.message??f.statusText}}}return{success:!0,data:await f.json()}}catch(o){return{success:!1,error:{code:"NETWORK_ERROR",message:o instanceof Error?o.message:"Network request failed"}}}}function y1(u){const c=(r,o)=>x1(u,r,o);return{getStats:()=>c("/api/dashboard/stats"),getAgents:()=>c("/api/agents"),createAgent:r=>c("/api/agents",{method:"POST",body:JSON.stringify(r)}),revokeAgent:r=>c(`/api/agents/${r}/revoke`,{method:"POST"}),rotateAgentToken:r=>c(`/api/agents/${r}/rotate`,{method:"POST"}),getAgentPermissions:r=>c(`/api/agents/${r}/permissions`),getAuditLogs:r=>{const o=new URLSearchParams;r&&(r.agentId&&o.set("agentId",r.agentId),r.action&&o.set("action",r.action),r.result&&o.set("result",r.result),r.from&&o.set("from",r.from),r.to&&o.set("to",r.to),r.limit!==void 0&&o.set("limit",String(r.limit)),r.offset!==void 0&&o.set("offset",String(r.offset)));const f=o.toString();return c(`/api/audit${f?`?${f}`:""}`)},exportAuditLogs:(r,o)=>{const f=new URLSearchParams;return f.set("format",r),o&&(o.agentId&&f.set("agentId",o.agentId),o.action&&f.set("action",o.action),o.result&&f.set("result",o.result),o.from&&f.set("from",o.from),o.to&&f.set("to",o.to)),c(`/api/audit/export?${f.toString()}`)},getUsers:()=>c("/api/users"),getPermissionTemplates:()=>c("/api/permissions/templates"),createPermissionTemplate:r=>c("/api/permissions/templates",{method:"POST",body:JSON.stringify(r)}),updatePermissionTemplate:(r,o)=>c(`/api/permissions/templates/${r}`,{method:"PATCH",body:JSON.stringify(o)}),deletePermissionTemplate:r=>c(`/api/permissions/templates/${r}`,{method:"DELETE"}),getDelegations:()=>c("/api/delegations"),revokeDelegation:r=>c(`/api/delegations/${r}`,{method:"DELETE"}),getMcpServers:()=>c("/api/mcp/servers"),registerMcpServer:r=>c("/api/mcp/servers",{method:"POST",body:JSON.stringify(r)}),getSettings:()=>c("/api/settings"),updateSettings:r=>c("/api/settings",{method:"PATCH",body:JSON.stringify(r)})}}/**
50
+ * @license lucide-react v0.474.0 - ISC
51
+ *
52
+ * This source code is licensed under the ISC license.
53
+ * See the LICENSE file in the root directory of this source tree.
54
+ */const v1=u=>u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Xm=(...u)=>u.filter((c,r,o)=>!!c&&c.trim()!==""&&o.indexOf(c)===r).join(" ").trim();/**
55
+ * @license lucide-react v0.474.0 - ISC
56
+ *
57
+ * This source code is licensed under the ISC license.
58
+ * See the LICENSE file in the root directory of this source tree.
59
+ */var g1={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"};/**
60
+ * @license lucide-react v0.474.0 - ISC
61
+ *
62
+ * This source code is licensed under the ISC license.
63
+ * See the LICENSE file in the root directory of this source tree.
64
+ */const p1=G.forwardRef(({color:u="currentColor",size:c=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:f="",children:y,iconNode:p,...z},S)=>G.createElement("svg",{ref:S,...g1,width:c,height:c,stroke:u,strokeWidth:o?Number(r)*24/Number(c):r,className:Xm("lucide",f),...z},[...p.map(([b,H])=>G.createElement(b,H)),...Array.isArray(y)?y:[y]]));/**
65
+ * @license lucide-react v0.474.0 - ISC
66
+ *
67
+ * This source code is licensed under the ISC license.
68
+ * See the LICENSE file in the root directory of this source tree.
69
+ */const ie=(u,c)=>{const r=G.forwardRef(({className:o,...f},y)=>G.createElement(p1,{ref:y,iconNode:c,className:Xm(`lucide-${v1(u)}`,o),...f}));return r.displayName=`${u}`,r};/**
70
+ * @license lucide-react v0.474.0 - ISC
71
+ *
72
+ * This source code is licensed under the ISC license.
73
+ * See the LICENSE file in the root directory of this source tree.
74
+ */const b1=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],j1=ie("Activity",b1);/**
75
+ * @license lucide-react v0.474.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */const z1=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],S1=ie("Archive",z1);/**
80
+ * @license lucide-react v0.474.0 - ISC
81
+ *
82
+ * This source code is licensed under the ISC license.
83
+ * See the LICENSE file in the root directory of this source tree.
84
+ */const N1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],kc=ie("ArrowRight",N1);/**
85
+ * @license lucide-react v0.474.0 - ISC
86
+ *
87
+ * This source code is licensed under the ISC license.
88
+ * See the LICENSE file in the root directory of this source tree.
89
+ */const A1=[["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"}]],Rc=ie("Bot",A1);/**
90
+ * @license lucide-react v0.474.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */const E1=[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],Mo=ie("CalendarClock",E1);/**
95
+ * @license lucide-react v0.474.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */const T1=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],M1=ie("Check",T1);/**
100
+ * @license lucide-react v0.474.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const C1=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Km=ie("ChevronRight",C1);/**
105
+ * @license lucide-react v0.474.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */const O1=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],_1=ie("CircleCheckBig",O1);/**
110
+ * @license lucide-react v0.474.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const w1=[["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"}]],Uc=ie("CircleX",w1);/**
115
+ * @license lucide-react v0.474.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */const D1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Hc=ie("Clock",D1);/**
120
+ * @license lucide-react v0.474.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const k1=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],R1=ie("CodeXml",k1);/**
125
+ * @license lucide-react v0.474.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const U1=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],q1=ie("Copy",U1);/**
130
+ * @license lucide-react v0.474.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const H1=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Q1=ie("Database",H1);/**
135
+ * @license lucide-react v0.474.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const L1=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],B1=ie("Download",L1);/**
140
+ * @license lucide-react v0.474.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const Y1=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],G1=ie("Ellipsis",Y1);/**
145
+ * @license lucide-react v0.474.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const X1=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],K1=ie("ExternalLink",X1);/**
150
+ * @license lucide-react v0.474.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const Z1=[["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"}]],V1=ie("EyeOff",Z1);/**
155
+ * @license lucide-react v0.474.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const J1=[["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"}]],F1=ie("Eye",J1);/**
160
+ * @license lucide-react v0.474.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const $1=[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]],W1=ie("Filter",$1);/**
165
+ * @license lucide-react v0.474.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const I1=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],P1=ie("GitBranch",I1);/**
170
+ * @license lucide-react v0.474.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const eg=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],tg=ie("Info",eg);/**
175
+ * @license lucide-react v0.474.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const ag=[["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"}]],ng=ie("LayoutDashboard",ag);/**
180
+ * @license lucide-react v0.474.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const lg=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],ig=ie("LogOut",lg);/**
185
+ * @license lucide-react v0.474.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const sg=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],cg=ie("Moon",sg);/**
190
+ * @license lucide-react v0.474.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const ug=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],rg=ie("Network",ug);/**
195
+ * @license lucide-react v0.474.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const og=[["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"}]],dg=ie("Pencil",og);/**
200
+ * @license lucide-react v0.474.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const fg=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Wl=ie("Plus",fg);/**
205
+ * @license lucide-react v0.474.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const hg=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],mg=ie("RefreshCw",hg);/**
210
+ * @license lucide-react v0.474.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const xg=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],yg=ie("RotateCw",xg);/**
215
+ * @license lucide-react v0.474.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const vg=[["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"}]],gg=ie("Save",vg);/**
220
+ * @license lucide-react v0.474.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const pg=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Zm=ie("ScrollText",pg);/**
225
+ * @license lucide-react v0.474.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const bg=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Co=ie("Server",bg);/**
230
+ * @license lucide-react v0.474.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const jg=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],zg=ie("Settings",jg);/**
235
+ * @license lucide-react v0.474.0 - ISC
236
+ *
237
+ * This source code is licensed under the ISC license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */const Sg=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],Vm=ie("ShieldAlert",Sg);/**
240
+ * @license lucide-react v0.474.0 - ISC
241
+ *
242
+ * This source code is licensed under the ISC license.
243
+ * See the LICENSE file in the root directory of this source tree.
244
+ */const Ng=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],as=ie("ShieldCheck",Ng);/**
245
+ * @license lucide-react v0.474.0 - ISC
246
+ *
247
+ * This source code is licensed under the ISC license.
248
+ * See the LICENSE file in the root directory of this source tree.
249
+ */const Ag=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]],Jm=ie("ShieldOff",Ag);/**
250
+ * @license lucide-react v0.474.0 - ISC
251
+ *
252
+ * This source code is licensed under the ISC license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */const Eg=[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]],Tg=ie("SlidersHorizontal",Eg);/**
255
+ * @license lucide-react v0.474.0 - ISC
256
+ *
257
+ * This source code is licensed under the ISC license.
258
+ * See the LICENSE file in the root directory of this source tree.
259
+ */const Mg=[["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"}]],Cg=ie("Sun",Mg);/**
260
+ * @license lucide-react v0.474.0 - ISC
261
+ *
262
+ * This source code is licensed under the ISC license.
263
+ * See the LICENSE file in the root directory of this source tree.
264
+ */const Og=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],dm=ie("Timer",Og);/**
265
+ * @license lucide-react v0.474.0 - ISC
266
+ *
267
+ * This source code is licensed under the ISC license.
268
+ * See the LICENSE file in the root directory of this source tree.
269
+ */const _g=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],wg=ie("Trash2",_g);/**
270
+ * @license lucide-react v0.474.0 - ISC
271
+ *
272
+ * This source code is licensed under the ISC license.
273
+ * See the LICENSE file in the root directory of this source tree.
274
+ */const Dg=[["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"}]],kg=ie("TriangleAlert",Dg);/**
275
+ * @license lucide-react v0.474.0 - ISC
276
+ *
277
+ * This source code is licensed under the ISC license.
278
+ * See the LICENSE file in the root directory of this source tree.
279
+ */const Rg=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],Ho=ie("Users",Rg);/**
280
+ * @license lucide-react v0.474.0 - ISC
281
+ *
282
+ * This source code is licensed under the ISC license.
283
+ * See the LICENSE file in the root directory of this source tree.
284
+ */const Ug=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qc=ie("X",Ug);/**
285
+ * @license lucide-react v0.474.0 - ISC
286
+ *
287
+ * This source code is licensed under the ISC license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */const qg=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Hg=ie("Zap",qg);function Qg({apiUrl:u,onAuthenticated:c}){const[r,o]=G.useState(""),[f,y]=G.useState(!1),[p,z]=G.useState(null),[S,b]=G.useState(!1);async function H(M){if(M.preventDefault(),!!r.trim()){b(!0),z(null);try{const _=`${u.replace(/\/$/,"")}/api/dashboard/auth`;(await fetch(_,{headers:{Authorization:`Bearer ${r}`}})).ok?(sessionStorage.setItem("kavachos_dashboard_secret",r),c(r)):z("Invalid secret. Check your KAVACHOS_DASHBOARD_SECRET.")}catch{z("Could not reach the API. Make sure the server is running.")}finally{b(!1)}}}return i.jsx("div",{className:"min-h-screen bg-white dark:bg-zinc-950 flex items-center justify-center px-4",children:i.jsxs("div",{className:"w-full max-w-sm",children:[i.jsxs("div",{className:"flex flex-col items-center mb-8",children:[i.jsx("div",{className:"w-12 h-12 rounded-2xl flex items-center justify-center mb-4 bg-gradient-to-br from-yellow-500/20 to-yellow-700/10 border border-yellow-600/30",children:i.jsx(as,{className:"w-6 h-6 text-yellow-500",strokeWidth:2})}),i.jsx("h1",{className:"text-lg font-semibold text-zinc-900 dark:text-white tracking-tight",children:"KavachOS"}),i.jsx("p",{className:"text-xs text-zinc-500 uppercase tracking-widest mt-0.5 font-medium",children:"Admin Dashboard"})]}),i.jsxs("div",{className:"bg-zinc-50 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-2xl p-6 shadow-xl shadow-black/40",children:[i.jsx("h2",{className:"text-sm font-medium text-zinc-700 dark:text-zinc-300 mb-1",children:"Dashboard access"}),i.jsx("p",{className:"text-xs text-zinc-500 mb-5",children:"Enter the dashboard secret to continue."}),i.jsxs("form",{onSubmit:H,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"kavachos-secret",className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"Secret"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{id:"kavachos-secret",type:f?"text":"password",value:r,onChange:M=>o(M.target.value),placeholder:"Enter your dashboard secret",autoComplete:"current-password",className:"w-full bg-white dark:bg-zinc-950 border border-zinc-300 dark:border-zinc-700 rounded-lg px-3 py-2.5 text-sm text-zinc-900 dark:text-white placeholder-zinc-600 pr-10 focus:outline-none focus:border-yellow-600/60 focus:ring-1 focus:ring-yellow-600/20 transition-colors"}),i.jsx("button",{type:"button",onClick:()=>y(M=>!M),className:"absolute right-3 top-1/2 -translate-y-1/2 text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300 transition-colors","aria-label":f?"Hide secret":"Show secret",children:f?i.jsx(V1,{className:"w-4 h-4"}):i.jsx(F1,{className:"w-4 h-4"})})]})]}),p&&i.jsx("p",{className:"text-xs text-red-400 bg-red-500/10 border border-red-500/20 rounded-lg px-3 py-2",children:p}),i.jsx("button",{type:"submit",disabled:S||!r.trim(),className:"w-full py-2.5 px-4 rounded-lg text-sm font-medium transition-all duration-100 bg-gradient-to-r from-yellow-600 to-yellow-700 text-zinc-950 hover:from-yellow-500 hover:to-yellow-600 disabled:opacity-40 disabled:cursor-not-allowed shadow-sm",children:S?"Verifying...":"Access dashboard"})]})]}),i.jsxs("p",{className:"text-center text-xs text-zinc-600 mt-5",children:["Set ",i.jsx("code",{className:"text-zinc-500 font-mono",children:"KAVACHOS_DASHBOARD_SECRET"})," to protect this dashboard."]})]})})}const fo="kavachos_dashboard_secret";async function Lg(u,c){try{const r=`${u.replace(/\/$/,"")}/api/dashboard/auth`;return(await fetch(r,{headers:{Authorization:`Bearer ${c}`}})).ok}catch{return!1}}function Bg({onLogout:u}){return i.jsxs("button",{type:"button",onClick:u,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs font-medium text-zinc-400 hover:text-zinc-200 hover:bg-zinc-800 transition-all duration-100",title:"Sign out",children:[i.jsx(ig,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Sign out"})]})}function Yg({apiUrl:u,children:c}){const[r,o]=G.useState("checking"),f=G.useCallback(()=>{sessionStorage.removeItem(fo),o("unauthenticated")},[]);return G.useEffect(()=>{const y=sessionStorage.getItem(fo);if(!y){o("unauthenticated");return}Lg(u,y).then(p=>{o(p?"authenticated":"unauthenticated"),p||sessionStorage.removeItem(fo)})},[u]),r==="checking"?i.jsx("div",{className:"min-h-screen bg-white dark:bg-zinc-950 flex items-center justify-center",children:i.jsx("div",{className:"w-5 h-5 rounded-full border-2 border-zinc-300 dark:border-zinc-700 border-t-yellow-500 animate-spin"})}):r==="unauthenticated"?i.jsx(Qg,{apiUrl:u,onAuthenticated:()=>o("authenticated")}):i.jsx(i.Fragment,{children:c(f)})}const Fm="kavachos-demo-banner-dismissed";function Gg(){return typeof window>"u"?!1:sessionStorage.getItem(Fm)==="true"}function Xg(){const[u,c]=G.useState(Gg);if(u)return null;function r(){sessionStorage.setItem(Fm,"true"),c(!0)}return i.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 bg-amber-950/60 border-b border-amber-700/40 text-amber-300",children:[i.jsxs("div",{className:"flex-1 flex items-center gap-2 text-xs font-medium",children:[i.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-amber-400 flex-shrink-0"}),"Running in demo mode with sample data."," ",i.jsx("a",{href:"https://kavachos.com/docs",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 hover:text-amber-200 transition-colors",children:"Read the docs"})," ","to set up your own instance."]}),i.jsx("button",{type:"button",onClick:r,className:"flex-shrink-0 text-amber-500 hover:text-amber-300 transition-colors","aria-label":"Dismiss demo banner",children:i.jsx(Qc,{className:"w-3.5 h-3.5"})})]})}const Kg=[{id:"overview",label:"Overview",icon:ng,description:"System overview"},{id:"agents",label:"Agents",icon:Rc,description:"Manage agent identities"},{id:"users",label:"Users",icon:Ho,description:"Users who own agents"},{id:"permissions",label:"Permissions",icon:as,description:"Permission templates"},{id:"delegations",label:"Delegations",icon:P1,description:"Agent delegation chains"},{id:"mcp-servers",label:"MCP Servers",icon:Co,description:"Registered MCP servers"},{id:"audit",label:"Audit Log",icon:Zm,description:"Immutable audit trail"},{id:"security",label:"Security",icon:Vm,description:"Security overview"},{id:"settings",label:"Settings",icon:zg,description:"System configuration"}];function Zg(){return i.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-5 border-b border-zinc-200 dark:border-zinc-800 dark:border-zinc-800",children:[i.jsx("div",{className:"w-7 h-7 rounded-lg bg-amber-600 flex items-center justify-center flex-shrink-0",children:i.jsx(as,{className:"w-4 h-4 text-white",strokeWidth:2.5})}),i.jsxs("div",{children:[i.jsx("div",{className:"text-sm font-semibold text-zinc-900 dark:text-white tracking-tight",children:"KavachOS"}),i.jsx("div",{className:"text-[10px] text-zinc-500 uppercase tracking-widest font-medium",children:"Admin"})]})]})}function Vg({currentPage:u,onNavigate:c}){return i.jsxs("aside",{className:"w-56 flex-shrink-0 bg-white dark:bg-zinc-950 border-r border-zinc-200 dark:border-zinc-800 flex flex-col h-screen sticky top-0",children:[i.jsx(Zg,{}),i.jsx("nav",{className:"flex-1 px-3 py-4 space-y-0.5",children:Kg.map(r=>{const o=r.icon,f=u===r.id;return i.jsxs("button",{type:"button",onClick:()=>c(r.id),className:["w-full flex items-center gap-3 px-3 py-2 rounded-lg text-left transition-all duration-100",f?"bg-zinc-100 dark:bg-zinc-800 text-zinc-900 dark:text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-900"].join(" "),children:[i.jsx(o,{className:["w-4 h-4 flex-shrink-0",f?"text-amber-500 dark:text-amber-400":"text-current"].join(" "),strokeWidth:f?2.5:2}),i.jsx("span",{className:"text-sm font-medium",children:r.label}),f&&i.jsx(Km,{className:"w-3 h-3 ml-auto text-zinc-400 dark:text-zinc-600"})]},r.id)})}),i.jsx("div",{className:"px-4 py-4 border-t border-zinc-200 dark:border-zinc-800",children:i.jsxs("div",{className:"flex items-center gap-2 text-xs text-zinc-500",children:[i.jsx(j1,{className:"w-3.5 h-3.5 text-emerald-500"}),i.jsx("span",{children:"System Online"})]})})]})}const fm="kavachos-theme";function Jg(){const[u,c]=G.useState(()=>{if(typeof window>"u")return!0;const r=localStorage.getItem(fm);return r!==null?r==="dark":window.matchMedia("(prefers-color-scheme: dark)").matches});return G.useEffect(()=>{const r=document.documentElement;u?r.classList.add("dark"):r.classList.remove("dark"),localStorage.setItem(fm,u?"dark":"light")},[u]),i.jsx("button",{type:"button",onClick:()=>c(r=>!r),className:"w-8 h-8 flex items-center justify-center rounded-lg text-zinc-500 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors","aria-label":u?"Switch to light mode":"Switch to dark mode",children:u?i.jsx(Cg,{className:"w-4 h-4"}):i.jsx(cg,{className:"w-4 h-4"})})}function Ha({title:u,description:c,actions:r}){return i.jsxs("div",{className:"flex items-start justify-between mb-6",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-xl font-semibold text-zinc-900 dark:text-white tracking-tight",children:u}),c&&i.jsx("p",{className:"text-sm text-zinc-500 dark:text-zinc-400 mt-0.5",children:c})]}),r&&i.jsx("div",{className:"flex items-center gap-2",children:r})]})}function Fg({currentPage:u,onNavigate:c,children:r,headerActions:o,demo:f}){return i.jsxs("div",{className:"flex min-h-screen bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-white",children:[i.jsx(Vg,{currentPage:u,onNavigate:c}),i.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[f&&i.jsx(Xg,{}),i.jsx("header",{className:"flex items-center justify-end px-6 py-3 border-b border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Jg,{}),o]})}),i.jsx("main",{className:"flex-1 overflow-auto",children:i.jsx("div",{className:"max-w-6xl mx-auto px-6 py-8",children:r})})]})]})}const $m=G.createContext(null),$g=3e3,Wg={success:"bg-zinc-50 dark:bg-zinc-900 border-emerald-700/60 text-emerald-400",error:"bg-zinc-50 dark:bg-zinc-900 border-red-700/60 text-red-400",info:"bg-zinc-50 dark:bg-zinc-900 border-amber-700/60 text-amber-400"},Ig={success:_1,error:Uc,info:tg};function Pg({toast:u,onDismiss:c}){const r=Ig[u.variant],o=G.useRef(null);return G.useEffect(()=>(o.current=setTimeout(()=>c(u.id),$g),()=>{o.current!==null&&clearTimeout(o.current)}),[u.id,c]),i.jsxs("div",{role:"alert",className:["flex items-start gap-3 px-4 py-3 rounded-xl border shadow-lg min-w-64 max-w-sm","animate-in slide-in-from-bottom-2 fade-in duration-200",Wg[u.variant]].join(" "),children:[i.jsx(r,{className:"w-4 h-4 flex-shrink-0 mt-0.5",strokeWidth:2}),i.jsx("p",{className:"flex-1 text-sm font-medium text-zinc-800 dark:text-zinc-200",children:u.message}),i.jsx("button",{type:"button",onClick:()=>c(u.id),className:"flex-shrink-0 text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300 transition-colors","aria-label":"Dismiss notification",children:i.jsx(Qc,{className:"w-3.5 h-3.5"})})]})}function ep({children:u}){const[c,r]=G.useState([]),o=G.useCallback(y=>{r(p=>p.filter(z=>z.id!==y))},[]),f=G.useCallback((y,p)=>{const z=`${Date.now()}-${Math.random().toString(36).slice(2,7)}`;r(S=>[...S,{id:z,variant:y,message:p}])},[]);return i.jsxs($m.Provider,{value:{toast:f},children:[u,c.length>0&&i.jsx("div",{role:"status","aria-label":"Notifications",className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 items-end",children:c.map(y=>i.jsx(Pg,{toast:y,onDismiss:o},y.id))})]})}function tp(){const u=G.useContext($m);if(u===null)throw new Error("useToast must be used inside <ToastProvider>");return u}const ap={green:"bg-emerald-950 text-emerald-400 border-emerald-800",red:"bg-red-950 text-red-400 border-red-800",yellow:"bg-amber-950 text-amber-400 border-amber-800",gray:"bg-zinc-100 dark:bg-zinc-800 text-zinc-400 border-zinc-700",blue:"bg-blue-950 text-blue-400 border-blue-800",indigo:"bg-indigo-950 text-indigo-400 border-indigo-800",gold:"bg-amber-950 text-amber-400 border-amber-700"};function ea({variant:u,children:c}){return i.jsx("span",{className:["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",ap[u]].join(" "),children:c})}const np={green:"bg-emerald-400",red:"bg-red-400",yellow:"bg-amber-400",gray:"bg-zinc-500",blue:"bg-blue-400",indigo:"bg-indigo-400",gold:"bg-amber-400"};function Qo({variant:u}){return i.jsx("span",{className:["w-1.5 h-1.5 rounded-full flex-shrink-0",np[u]].join(" ")})}const lp={primary:"kavach-btn-gold text-[#1a1000] border-0 shadow-[0_2px_8px_-2px_rgba(154,114,40,0.3),inset_0_1px_1px_rgba(255,255,255,0.4)] hover:shadow-[0_2px_12px_-2px_rgba(154,114,40,0.4)] relative overflow-hidden",secondary:"bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-700 text-zinc-200 border border-zinc-300 dark:border-zinc-700 hover:border-zinc-600",ghost:"bg-transparent hover:bg-zinc-800 text-zinc-400 hover:text-zinc-200 border border-transparent",danger:"bg-red-950 hover:bg-red-900 text-red-400 hover:text-red-300 border border-red-900 hover:border-red-800"},ip={sm:"px-2.5 py-1 text-xs",md:"px-3.5 py-1.5 text-sm",lg:"px-5 py-2.5 text-sm"};function Fe({variant:u="secondary",size:c="md",children:r,loading:o=!1,className:f="",disabled:y,...p}){return i.jsxs("button",{type:"button",disabled:y??o,className:["inline-flex items-center gap-1.5 rounded-lg font-medium transition-all duration-100","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500/30 focus-visible:ring-offset-1 focus-visible:ring-offset-zinc-900","disabled:opacity-50 disabled:cursor-not-allowed",lp[u],ip[c],f].join(" "),...p,children:[o&&i.jsxs("svg",{className:"w-3.5 h-3.5 animate-spin",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),r]})}function Ue({htmlFor:u,children:c,required:r}){return i.jsxs("label",{htmlFor:u,className:"block text-xs font-medium text-zinc-600 dark:text-zinc-400 mb-1.5",children:[c,r&&i.jsx("span",{className:"text-red-400 ml-1",children:"*"})]})}const Lo="w-full bg-white dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-700 rounded-lg px-3 py-2 text-sm text-zinc-900 dark:text-white placeholder-zinc-400 dark:placeholder-zinc-500 transition-colors focus:outline-none focus:ring-2 focus:ring-amber-500/30 focus:border-transparent disabled:opacity-50 disabled:cursor-not-allowed";function et({error:u,className:c="",...r}){return i.jsxs("div",{children:[i.jsx("input",{className:[Lo,u?"border-red-700":"",c].join(" "),...r}),u&&i.jsx("p",{className:"mt-1 text-xs text-red-400",children:u})]})}function _c({error:u,className:c="",children:r,...o}){return i.jsxs("div",{children:[i.jsx("select",{className:[Lo,"appearance-none cursor-pointer",u?"border-red-700":"",c].join(" "),...o,children:r}),u&&i.jsx("p",{className:"mt-1 text-xs text-red-400",children:u})]})}function sp({error:u,className:c="",...r}){return i.jsxs("div",{children:[i.jsx("textarea",{className:[Lo,"resize-none",u?"border-red-700":"",c].join(" "),...r}),u&&i.jsx("p",{className:"mt-1 text-xs text-red-400",children:u})]})}function ht({children:u,className:c=""}){return i.jsx("div",{className:["space-y-1",c].join(" "),children:u})}function ns({open:u,onClose:c,title:r,children:o,footer:f}){return u?i.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",children:[i.jsx("div",{className:"absolute inset-0 bg-black/70 backdrop-blur-sm",onClick:c,"aria-hidden":"true"}),i.jsxs("div",{className:"relative bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded-2xl shadow-2xl w-full max-w-lg max-h-[90vh] flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-zinc-200 dark:border-zinc-800",children:[i.jsx("h2",{id:"modal-title",className:"text-base font-semibold text-zinc-900 dark:text-white",children:r}),i.jsx("button",{type:"button",onClick:c,className:"w-7 h-7 flex items-center justify-center rounded-lg text-zinc-400 dark:text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-700 dark:hover:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors","aria-label":"Close modal",children:i.jsx(Qc,{className:"w-4 h-4"})})]}),i.jsx("div",{className:"flex-1 overflow-auto px-6 py-5",children:o}),f&&i.jsx("div",{className:"px-6 py-4 border-t border-zinc-200 dark:border-zinc-800 flex items-center justify-end gap-2",children:f})]})]}):null}function Qt({children:u}){return i.jsx("div",{className:"rounded-xl border border-zinc-200 dark:border-zinc-800 overflow-hidden",children:i.jsx("table",{className:"w-full text-sm",children:u})})}function Lt({children:u}){return i.jsx("thead",{className:"bg-zinc-100 dark:bg-zinc-900 border-b border-zinc-200 dark:border-zinc-800",children:i.jsx("tr",{children:u})})}function Bt({children:u}){return i.jsx("tbody",{className:"divide-y divide-zinc-100 dark:divide-zinc-800/60",children:u})}function Y({children:u,className:c=""}){return i.jsx("th",{className:["px-4 py-3 text-left text-xs font-medium text-zinc-500 uppercase tracking-wider",c].join(" "),children:u})}function de({children:u,className:c=""}){return i.jsx("td",{className:["px-4 py-3 text-zinc-600 dark:text-zinc-300",c].join(" "),children:u})}function Pn({children:u,onClick:c}){return i.jsx("tr",{onClick:c,className:["bg-white dark:bg-zinc-950 transition-colors",c?"cursor-pointer hover:bg-zinc-50 dark:hover:bg-zinc-900":""].join(" "),children:u})}function el({icon:u,title:c,description:r,action:o,steps:f,docsLink:y}){return i.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[i.jsx("div",{className:"w-12 h-12 rounded-xl bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center mb-4 text-zinc-400 dark:text-zinc-500",children:u}),i.jsx("p",{className:"text-sm font-medium text-zinc-700 dark:text-zinc-300 mb-1",children:c}),r&&i.jsx("p",{className:"text-xs text-zinc-500 max-w-xs mb-4",children:r}),f&&f.length>0&&i.jsx("ol",{className:"text-left mt-2 mb-5 space-y-1.5 max-w-xs",children:f.map((p,z)=>i.jsxs("li",{className:"flex items-start gap-2.5 text-xs text-zinc-500",children:[i.jsx("span",{className:"flex-shrink-0 w-4 h-4 rounded-full bg-zinc-100 dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 flex items-center justify-center text-[10px] font-medium text-zinc-500 dark:text-zinc-400 mt-px",children:z+1}),i.jsx("span",{children:p})]},p))}),o,y&&i.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 mt-4 text-xs text-zinc-400 dark:text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-700 dark:hover:text-zinc-300 transition-colors",children:["Learn more",i.jsx(K1,{className:"w-3 h-3"})]})]})}function qc(u){switch(u){case"active":return"green";case"revoked":return"red";case"expired":return"gray"}}function Oo(u){return u?new Date(u).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"—"}function Wm(u){if(!u)return"Never";const c=Date.now()-new Date(u).getTime(),r=Math.floor(c/6e4);if(r<1)return"Just now";if(r<60)return`${r}m ago`;const o=Math.floor(r/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}const cp=["llm","workflow","tool","human-in-loop","system"];function up({open:u,onClose:c,onSubmit:r,loading:o}){const[f,y]=G.useState(""),[p,z]=G.useState("llm"),[S,b]=G.useState(""),[H,M]=G.useState([]),[_,q]=G.useState(""),X=["read","write","delete","execute","list"];function R(Q){M(J=>J.includes(Q)?J.filter(w=>w!==Q):[...J,Q])}function B(){if(!f.trim()){q("Name is required");return}q("");const Q=S.trim()&&H.length>0?[{resource:S.trim(),actions:H}]:[];r({name:f.trim(),type:p,permissions:Q})}function L(){y(""),z("llm"),b(""),M([]),q(""),c()}return i.jsx(ns,{open:u,onClose:L,title:"Create Agent",footer:i.jsxs(i.Fragment,{children:[i.jsx(Fe,{variant:"ghost",onClick:L,children:"Cancel"}),i.jsx(Fe,{variant:"primary",onClick:B,loading:o,children:"Create Agent"})]}),children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs(ht,{children:[i.jsx(Ue,{htmlFor:"agent-name",required:!0,children:"Name"}),i.jsx(et,{id:"agent-name",placeholder:"e.g. data-pipeline-agent",value:f,onChange:Q=>y(Q.target.value),error:_,autoFocus:!0})]}),i.jsxs(ht,{children:[i.jsx(Ue,{htmlFor:"agent-type",required:!0,children:"Type"}),i.jsx(_c,{id:"agent-type",value:p,onChange:Q=>z(Q.target.value),children:cp.map(Q=>i.jsx("option",{value:Q,children:Q},Q))})]}),i.jsxs("div",{className:"border-t border-zinc-200 dark:border-zinc-800 pt-4",children:[i.jsx("p",{className:"text-xs font-medium text-zinc-400 mb-3",children:"Initial Permission (optional)"}),i.jsxs(ht,{children:[i.jsx(Ue,{htmlFor:"resource",children:"Resource Pattern"}),i.jsx(et,{id:"resource",placeholder:"e.g. documents:* or api/v1/users",value:S,onChange:Q=>b(Q.target.value)})]}),i.jsxs("div",{className:"mt-3",children:[i.jsx(Ue,{children:"Actions"}),i.jsx("div",{className:"flex flex-wrap gap-2 mt-1.5",children:X.map(Q=>i.jsx("button",{type:"button",onClick:()=>R(Q),className:["px-2.5 py-1 rounded-md text-xs font-medium border transition-colors",H.includes(Q)?"bg-amber-600 border-amber-500 text-white":"bg-zinc-100 dark:bg-zinc-800 border-zinc-300 dark:border-zinc-700 text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200"].join(" "),children:Q},Q))})]})]})]})})}function rp({open:u,onClose:c,token:r,agentName:o}){const[f,y]=G.useState(!1);function p(){navigator.clipboard.writeText(r).then(()=>{y(!0),setTimeout(()=>y(!1),2e3)})}return i.jsx(ns,{open:u,onClose:c,title:"Agent Token",footer:i.jsx(Fe,{variant:"primary",onClick:c,children:"Done"}),children:i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"bg-amber-950/50 border border-amber-800/50 rounded-lg px-4 py-3",children:i.jsx("p",{className:"text-xs text-amber-400 font-medium",children:"Save this token now. It will not be shown again."})}),i.jsxs("div",{children:[i.jsx(Ue,{children:"Agent"}),i.jsx("p",{className:"text-sm text-zinc-300",children:o})]}),i.jsxs("div",{children:[i.jsx(Ue,{children:"Token"}),i.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[i.jsx("code",{className:"flex-1 bg-white dark:bg-zinc-950 border border-zinc-300 dark:border-zinc-700 rounded-lg px-3 py-2 text-xs text-zinc-700 dark:text-zinc-300 font-mono break-all",children:r}),i.jsx("button",{type:"button",onClick:p,className:"flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-lg bg-zinc-100 dark:bg-zinc-800 border border-zinc-300 dark:border-zinc-700 text-zinc-400 hover:text-zinc-200 transition-colors","aria-label":"Copy token",children:f?i.jsx(M1,{className:"w-3.5 h-3.5 text-emerald-400"}):i.jsx(q1,{className:"w-3.5 h-3.5"})})]})]})]})})}function op({agent:u,onRevoke:c,onRotate:r,revoking:o,rotating:f}){const[y,p]=G.useState(!1);return u.status!=="active"?null:i.jsxs("div",{className:"relative",children:[i.jsx("button",{type:"button",onClick:()=>p(z=>!z),className:"w-7 h-7 flex items-center justify-center rounded-md text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300 hover:bg-zinc-800 transition-colors","aria-label":"Agent actions",children:i.jsx(G1,{className:"w-4 h-4"})}),y&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>p(!1),"aria-hidden":"true"}),i.jsxs("div",{className:"absolute right-0 top-8 z-20 bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-700 rounded-xl shadow-xl py-1 min-w-[140px]",children:[i.jsxs("button",{type:"button",onClick:()=>{r(u.id),p(!1)},disabled:f,className:"w-full flex items-center gap-2.5 px-3 py-2 text-xs text-zinc-700 dark:text-zinc-300 hover:bg-zinc-800 hover:text-white transition-colors disabled:opacity-50",children:[i.jsx(yg,{className:"w-3.5 h-3.5"}),"Rotate Token"]}),i.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-800 my-1"}),i.jsxs("button",{type:"button",onClick:()=>{c(u.id),p(!1)},disabled:o,className:"w-full flex items-center gap-2.5 px-3 py-2 text-xs text-red-400 hover:bg-red-950/50 hover:text-red-300 transition-colors disabled:opacity-50",children:[i.jsx(Jm,{className:"w-3.5 h-3.5"}),"Revoke Agent"]})]})]})]})}function dp(u){switch(u){case"allowed":return"green";case"denied":return"red";case"rate_limited":return"yellow"}}function fp(u){return new Date(u).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function hp({open:u,onClose:c,agent:r,client:o}){const{data:f,isLoading:y}=rt({queryKey:["agent-permissions",r.id],queryFn:()=>o.getAgentPermissions(r.id),enabled:u}),{data:p,isLoading:z}=rt({queryKey:["agent-audit",r.id],queryFn:()=>o.getAuditLogs({agentId:r.id,limit:20}),enabled:u}),{data:S}=rt({queryKey:["delegations"],queryFn:()=>o.getDelegations(),enabled:u}),b=f!=null&&f.success?f.data:[],H=p!=null&&p.success?p.data.entries:[],_=(S!=null&&S.success?S.data:[]).filter(q=>q.fromAgentId===r.id||q.toAgentId===r.id);return i.jsx(ns,{open:u,onClose:c,title:r.name,footer:i.jsx(Fe,{variant:"primary",onClick:c,children:"Close"}),children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-3",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-[11px] font-medium text-zinc-500 uppercase tracking-wider mb-1",children:"ID"}),i.jsx("code",{className:"text-xs font-mono text-zinc-700 dark:text-zinc-300 break-all",children:r.id})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-[11px] font-medium text-zinc-500 uppercase tracking-wider mb-1",children:"Type"}),i.jsx("span",{className:"text-xs font-mono text-zinc-300",children:r.type})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-[11px] font-medium text-zinc-500 uppercase tracking-wider mb-1",children:"Status"}),i.jsxs(ea,{variant:qc(r.status),children:[i.jsx(Qo,{variant:qc(r.status)}),r.status]})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-[11px] font-medium text-zinc-500 uppercase tracking-wider mb-1",children:"Last active"}),i.jsx("span",{className:"text-xs text-zinc-300",children:Wm(r.lastActiveAt)})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-[11px] font-medium text-zinc-500 uppercase tracking-wider mb-1",children:"Created"}),i.jsx("span",{className:"text-xs text-zinc-300",children:Oo(r.createdAt)})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-[11px] font-medium text-zinc-500 uppercase tracking-wider mb-1",children:"Expires"}),i.jsx("span",{className:"text-xs text-zinc-300",children:Oo(r.expiresAt)})]})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs font-medium text-zinc-400 uppercase tracking-wider mb-2",children:"Permissions"}),y?i.jsx("div",{className:"flex items-center justify-center py-4",children:i.jsx("div",{className:"w-4 h-4 border-2 border-zinc-300 dark:border-zinc-700 border-t-amber-500 rounded-full animate-spin"})}):b.length===0?i.jsx("p",{className:"text-xs text-zinc-600 py-2",children:"No permissions assigned."}):i.jsx("div",{className:"rounded-lg border border-zinc-200 dark:border-zinc-800 overflow-hidden",children:i.jsxs("table",{className:"w-full text-xs",children:[i.jsx("thead",{className:"bg-zinc-50 dark:bg-zinc-900 border-b border-zinc-200 dark:border-zinc-800",children:i.jsxs("tr",{children:[i.jsx("th",{className:"px-3 py-2 text-left text-[11px] font-medium text-zinc-500 uppercase tracking-wider",children:"Resource"}),i.jsx("th",{className:"px-3 py-2 text-left text-[11px] font-medium text-zinc-500 uppercase tracking-wider",children:"Actions"})]})}),i.jsx("tbody",{className:"divide-y divide-zinc-800/60",children:b.map(q=>i.jsxs("tr",{className:"bg-zinc-950",children:[i.jsx("td",{className:"px-3 py-2",children:i.jsx("code",{className:"text-zinc-300 font-mono",children:q.resource})}),i.jsx("td",{className:"px-3 py-2",children:i.jsx("div",{className:"flex flex-wrap gap-1",children:q.actions.map(X=>i.jsx("span",{className:"px-1.5 py-0.5 bg-zinc-100 dark:bg-zinc-800 border border-zinc-300 dark:border-zinc-700 rounded text-[10px] text-zinc-400 font-mono",children:X},X))})})]},q.id))})]})})]}),_.length>0&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs font-medium text-zinc-400 uppercase tracking-wider mb-2",children:"Delegation chains"}),i.jsx("div",{className:"space-y-2",children:_.map(q=>i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-white dark:bg-zinc-950 border border-zinc-200 dark:border-zinc-800 rounded-lg text-xs",children:[i.jsx("span",{className:"text-zinc-300 font-medium truncate max-w-[100px]",children:q.fromAgentName}),i.jsx(kc,{className:"w-3 h-3 text-zinc-600 flex-shrink-0"}),i.jsx("span",{className:"text-zinc-300 font-medium truncate max-w-[100px]",children:q.toAgentName}),i.jsx(ea,{variant:q.status==="active"?"green":q.status==="expired"?"yellow":"red",children:q.status})]},q.id))})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs font-medium text-zinc-400 uppercase tracking-wider mb-2",children:"Recent activity"}),z?i.jsx("div",{className:"flex items-center justify-center py-4",children:i.jsx("div",{className:"w-4 h-4 border-2 border-zinc-300 dark:border-zinc-700 border-t-amber-500 rounded-full animate-spin"})}):H.length===0?i.jsx("p",{className:"text-xs text-zinc-600 py-2",children:"No audit events yet."}):i.jsx("div",{className:"rounded-lg border border-zinc-200 dark:border-zinc-800 overflow-hidden",children:i.jsx("div",{className:"divide-y divide-zinc-800/60",children:H.map(q=>i.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 bg-white dark:bg-zinc-950 text-xs",children:[i.jsx(Hc,{className:"w-3 h-3 text-zinc-600 flex-shrink-0"}),i.jsx("span",{className:"text-zinc-500 tabular-nums flex-shrink-0 w-28",children:fp(q.timestamp)}),i.jsx("code",{className:"text-zinc-400 font-mono w-20 flex-shrink-0 truncate",children:q.action}),i.jsx("code",{className:"text-zinc-500 font-mono flex-1 truncate",children:q.resource}),i.jsx(ea,{variant:dp(q.result),children:q.result.replace("_"," ")})]},q.id))})})]})]})})}function mp({client:u}){const c=In(),{toast:r}=tp(),[o,f]=G.useState(!1),[y,p]=G.useState(null),[z,S]=G.useState({open:!1,token:"",agentName:""}),{data:b,isLoading:H}=rt({queryKey:["agents"],queryFn:()=>u.getAgents()}),M=Ua({mutationFn:R=>u.createAgent(R),onSuccess:R=>{R.success?(c.invalidateQueries({queryKey:["agents"]}),f(!1),r("success",`Agent "${R.data.agent.name}" created`),S({open:!0,token:R.data.token,agentName:R.data.agent.name})):r("error","Failed to create agent")},onError:()=>{r("error","Failed to create agent")}}),_=Ua({mutationFn:R=>u.revokeAgent(R),onSuccess:(R,B)=>{if(c.invalidateQueries({queryKey:["agents"]}),R.success){const Q=(b!=null&&b.success?b.data:[]).find(J=>J.id===B);r("success",`Agent "${(Q==null?void 0:Q.name)??"Agent"}" revoked`)}else r("error","Failed to revoke agent")},onError:()=>{r("error","Failed to revoke agent")}}),q=Ua({mutationFn:R=>u.rotateAgentToken(R),onSuccess:(R,B)=>{if(R.success){const Q=(b!=null&&b.success?b.data:[]).find(J=>J.id===B);r("success",`Token rotated for "${(Q==null?void 0:Q.name)??"Agent"}"`),S({open:!0,token:R.data.token,agentName:(Q==null?void 0:Q.name)??"Agent"})}else r("error","Failed to rotate token")},onError:()=>{r("error","Failed to rotate token")}}),X=b!=null&&b.success?b.data:[];return i.jsxs("div",{children:[i.jsx(Ha,{title:"Agents",description:"Manage AI agent identities, tokens, and permissions.",actions:i.jsxs(Fe,{variant:"primary",onClick:()=>f(!0),children:[i.jsx(Wl,{className:"w-3.5 h-3.5"}),"New Agent"]})}),H?i.jsx("div",{className:"flex items-center justify-center py-16",children:i.jsx("div",{className:"w-5 h-5 border-2 border-zinc-300 dark:border-zinc-700 border-t-amber-500 rounded-full animate-spin"})}):X.length===0?i.jsxs(Qt,{children:[i.jsxs(Lt,{children:[i.jsx(Y,{children:"Agent"}),i.jsx(Y,{children:"Type"}),i.jsx(Y,{children:"Status"}),i.jsx(Y,{children:"Permissions"}),i.jsx(Y,{children:"Last Active"}),i.jsx(Y,{children:"Created"}),i.jsx(Y,{})]}),i.jsx(Bt,{children:i.jsx("tr",{children:i.jsx("td",{colSpan:7,children:i.jsx(el,{icon:i.jsx(Rc,{className:"w-6 h-6"}),title:"Create your first agent",description:"Agents are the primary identity in KavachOS. Each agent gets a token you use to authorize actions.",steps:['Click "New Agent" above',"Set permissions for the resources the agent needs","Copy the token and use it in your app"],action:i.jsxs(Fe,{variant:"primary",onClick:()=>f(!0),children:[i.jsx(Wl,{className:"w-3.5 h-3.5"}),"Create Agent"]}),docsLink:"https://kavachos.com/docs/quickstart"})})})})]}):i.jsxs(Qt,{children:[i.jsxs(Lt,{children:[i.jsx(Y,{children:"Agent"}),i.jsx(Y,{children:"Type"}),i.jsx(Y,{children:"Status"}),i.jsx(Y,{children:"Permissions"}),i.jsx(Y,{children:"Last Active"}),i.jsx(Y,{children:"Created"}),i.jsx(Y,{})]}),i.jsx(Bt,{children:X.map(R=>i.jsxs(Pn,{onClick:()=>p(R),children:[i.jsx(de,{children:i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-white",children:R.name}),i.jsxs("p",{className:"text-xs text-zinc-500 font-mono mt-0.5",children:[R.id.slice(0,12),"…"]})]})}),i.jsx(de,{children:i.jsx("span",{className:"text-xs font-mono text-zinc-400",children:R.type})}),i.jsx(de,{children:i.jsxs(ea,{variant:qc(R.status),children:[i.jsx(Qo,{variant:qc(R.status)}),R.status]})}),i.jsx(de,{children:i.jsx("span",{className:"text-zinc-300",children:R.permissionsCount})}),i.jsx(de,{children:i.jsx("span",{className:"text-zinc-400 text-xs",children:Wm(R.lastActiveAt)})}),i.jsx(de,{children:i.jsx("span",{className:"text-zinc-400 text-xs",children:Oo(R.createdAt)})}),i.jsx(de,{className:"text-right",children:i.jsx(op,{agent:R,onRevoke:B=>_.mutate(B),onRotate:B=>q.mutate(B),revoking:_.isPending,rotating:q.isPending})})]},R.id))})]}),i.jsx(up,{open:o,onClose:()=>f(!1),onSubmit:R=>M.mutate(R),loading:M.isPending}),i.jsx(rp,{open:z.open,onClose:()=>S({open:!1,token:"",agentName:""}),token:z.token,agentName:z.agentName}),y&&i.jsx(hp,{open:y!==null,onClose:()=>p(null),agent:y,client:u})]})}function xp(u){switch(u){case"allowed":return"green";case"denied":return"red";case"rate_limited":return"yellow"}}function yp(u){const c=new Date(u);return{date:c.toLocaleDateString("en-US",{month:"short",day:"numeric"}),time:c.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}}function vp(u){return u<1?"<1ms":u<1e3?`${u}ms`:`${(u/1e3).toFixed(1)}s`}const gp=["","read","write","delete","execute","list","authenticate","authorize"],pp=[{value:"",label:"All results"},{value:"allowed",label:"Allowed"},{value:"denied",label:"Denied"},{value:"rate_limited",label:"Rate limited"}];function bp({filters:u,agentOptions:c,onChange:r}){return i.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-5 p-3 bg-zinc-50 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl",children:[i.jsx(W1,{className:"w-3.5 h-3.5 text-zinc-500 flex-shrink-0 ml-0.5"}),i.jsxs(_c,{value:u.agentId??"",onChange:o=>r({...u,agentId:o.target.value||void 0,offset:0}),className:"flex-1 min-w-[140px] max-w-[200px] py-1.5 text-xs",children:[i.jsx("option",{value:"",children:"All agents"}),c.map(o=>i.jsx("option",{value:o.id,children:o.name},o.id))]}),i.jsxs(_c,{value:u.action??"",onChange:o=>r({...u,action:o.target.value||void 0,offset:0}),className:"flex-1 min-w-[120px] max-w-[160px] py-1.5 text-xs",children:[i.jsx("option",{value:"",children:"All actions"}),gp.filter(Boolean).map(o=>i.jsx("option",{value:o,children:o},o))]}),i.jsx(_c,{value:u.result??"",onChange:o=>r({...u,result:o.target.value||void 0,offset:0}),className:"flex-1 min-w-[130px] max-w-[180px] py-1.5 text-xs",children:pp.map(o=>i.jsx("option",{value:o.value,children:o.label},o.value))}),i.jsx("input",{type:"date",value:u.from?u.from.slice(0,10):"",onChange:o=>r({...u,from:o.target.value?`${o.target.value}T00:00:00Z`:void 0,offset:0}),className:"bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-700 rounded-lg px-2.5 py-1.5 text-xs text-zinc-700 dark:text-zinc-300 focus:outline-none focus:ring-2 focus:ring-amber-500/30","aria-label":"From date"}),i.jsx("span",{className:"text-zinc-600 text-xs",children:"to"}),i.jsx("input",{type:"date",value:u.to?u.to.slice(0,10):"",onChange:o=>r({...u,to:o.target.value?`${o.target.value}T23:59:59Z`:void 0,offset:0}),className:"bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-700 rounded-lg px-2.5 py-1.5 text-xs text-zinc-700 dark:text-zinc-300 focus:outline-none focus:ring-2 focus:ring-amber-500/30","aria-label":"To date"}),(u.agentId??u.action??u.result??u.from??u.to)&&i.jsx("button",{type:"button",onClick:()=>r({limit:u.limit,offset:0}),className:"text-xs text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300 transition-colors ml-auto",children:"Clear filters"})]})}function jp({client:u,filters:c}){const[r,o]=G.useState(!1),[f,y]=G.useState(!1),p=G.useRef(null);async function z(S){o(!1),y(!0);try{const b=await u.exportAuditLogs(S,c);if(!b.success)return;const H=new Blob([b.data],{type:S==="csv"?"text/csv":"application/json"}),M=URL.createObjectURL(H),_=document.createElement("a");_.href=M,_.download=`audit-export.${S}`,_.click(),URL.revokeObjectURL(M)}finally{y(!1)}}return i.jsxs("div",{className:"relative",ref:p,children:[i.jsxs(Fe,{variant:"secondary",size:"sm",loading:f,onClick:()=>o(S=>!S),"aria-haspopup":"true","aria-expanded":r,children:[i.jsx(B1,{className:"w-3.5 h-3.5"}),"Export"]}),r&&i.jsxs("div",{className:"absolute right-0 mt-1 w-36 bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-700 rounded-lg shadow-lg z-10 overflow-hidden",children:[i.jsx("button",{type:"button",className:"w-full text-left px-3 py-2 text-xs text-zinc-700 dark:text-zinc-300 hover:bg-zinc-800 transition-colors",onClick:()=>void z("json"),children:"Export as JSON"}),i.jsx("button",{type:"button",className:"w-full text-left px-3 py-2 text-xs text-zinc-700 dark:text-zinc-300 hover:bg-zinc-800 transition-colors",onClick:()=>void z("csv"),children:"Export as CSV"})]})]})}const hm=50;function zp({client:u}){const[c,r]=G.useState({limit:hm,offset:0}),{data:o,isLoading:f,refetch:y,isFetching:p}=rt({queryKey:["audit-logs",c],queryFn:()=>u.getAuditLogs(c),refetchInterval:3e4}),{data:z}=rt({queryKey:["agents"],queryFn:()=>u.getAgents()}),S=o!=null&&o.success?o.data.entries:[],b=o!=null&&o.success?o.data.total:0,H=z!=null&&z.success?z.data.map(R=>({id:R.id,name:R.name})):[],M=c.offset??0,_=c.limit??hm,q=M+_<b,X=M>0;return i.jsxs("div",{children:[i.jsx(Ha,{title:"Audit Log",description:"Immutable record of all agent actions. Compliance-ready.",actions:i.jsxs(i.Fragment,{children:[i.jsx(jp,{client:u,filters:c}),i.jsxs(Fe,{variant:"secondary",size:"sm",onClick:()=>void y(),loading:p,children:[i.jsx(mg,{className:"w-3.5 h-3.5"}),"Refresh"]})]})}),i.jsx(bp,{filters:c,agentOptions:H,onChange:r}),f?i.jsx("div",{className:"flex items-center justify-center py-16",children:i.jsx("div",{className:"w-5 h-5 border-2 border-zinc-300 dark:border-zinc-700 border-t-amber-500 rounded-full animate-spin"})}):S.length===0?i.jsxs(Qt,{children:[i.jsxs(Lt,{children:[i.jsx(Y,{children:"Timestamp"}),i.jsx(Y,{children:"Agent"}),i.jsx(Y,{children:"Action"}),i.jsx(Y,{children:"Resource"}),i.jsx(Y,{children:"Result"}),i.jsx(Y,{children:"Duration"})]}),i.jsx(Bt,{children:i.jsx("tr",{children:i.jsx("td",{colSpan:6,children:i.jsx(el,{icon:i.jsx(Zm,{className:"w-6 h-6"}),title:"No audit events yet",description:"Events are created automatically when agents call kavach.authorize(). Every allow and deny decision is recorded here.",docsLink:"https://kavachos.com/docs/audit"})})})})]}):i.jsxs(i.Fragment,{children:[i.jsxs(Qt,{children:[i.jsxs(Lt,{children:[i.jsx(Y,{children:"Timestamp"}),i.jsx(Y,{children:"Agent"}),i.jsx(Y,{children:"Action"}),i.jsx(Y,{children:"Resource"}),i.jsx(Y,{children:"Result"}),i.jsx(Y,{children:"Duration"})]}),i.jsx(Bt,{children:S.map(R=>{const B=yp(R.timestamp);return i.jsxs(Pn,{children:[i.jsx(de,{children:i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(Hc,{className:"w-3 h-3 text-zinc-600 flex-shrink-0"}),i.jsxs("div",{children:[i.jsx("span",{className:"text-xs text-zinc-700 dark:text-zinc-300 font-mono",children:B.time}),i.jsx("span",{className:"block text-[10px] text-zinc-600",children:B.date})]})]})}),i.jsx(de,{children:i.jsx("span",{className:"text-xs font-medium text-zinc-800 dark:text-zinc-200",children:R.agentName})}),i.jsx(de,{children:i.jsx("code",{className:"text-xs font-mono text-zinc-400",children:R.action})}),i.jsx(de,{children:i.jsx("code",{className:"text-xs font-mono text-zinc-400 max-w-[200px] truncate block",children:R.resource})}),i.jsx(de,{children:i.jsx(ea,{variant:xp(R.result),children:R.result.replace("_"," ")})}),i.jsx(de,{children:i.jsx("span",{className:"text-xs text-zinc-500 font-mono",children:vp(R.durationMs)})})]},R.id)})})]}),i.jsxs("div",{className:"flex items-center justify-between mt-4 text-xs text-zinc-500",children:[i.jsxs("span",{children:[M+1,"–",Math.min(M+_,b)," of ",b," entries"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Fe,{variant:"secondary",size:"sm",disabled:!X,onClick:()=>r(R=>({...R,offset:Math.max(0,(R.offset??0)-_)})),children:"Previous"}),i.jsx(Fe,{variant:"secondary",size:"sm",disabled:!q,onClick:()=>r(R=>({...R,offset:(R.offset??0)+_})),children:"Next"})]})]})]})]})}function Sp(u){const c=Date.now(),o=new Date(u).getTime()-c,f=Math.round(o/1e3),y=Math.abs(f),p=[[86400,"d"],[3600,"h"],[60,"m"]];for(const[z,S]of p)if(y>=z){const b=Math.floor(y/z);return f>=0?`in ${b}${S}`:`${b}${S} ago`}return f>=0?"in <1m":"just now"}function Np(u){switch(u){case"active":return"green";case"expired":return"yellow";case"revoked":return"red"}}function Ap({permissions:u}){const c=u.length;if(c===0)return i.jsx("span",{className:"text-xs text-zinc-600",children:"None"});const r=u.slice(0,2).map(o=>o.resource).join(", ");return i.jsxs("div",{title:u.map(o=>`${o.resource}: ${o.actions.join(", ")}`).join(`
290
+ `),children:[i.jsxs("span",{className:"text-xs text-zinc-300",children:[c," ",c===1?"permission":"permissions"]}),i.jsxs("p",{className:"text-[11px] text-zinc-600 mt-0.5 max-w-[160px] truncate",children:[r,c>2?` +${c-2} more`:""]})]})}function Ep({client:u}){const c=In(),{data:r,isLoading:o}=rt({queryKey:["delegations"],queryFn:()=>u.getDelegations()}),f=Ua({mutationFn:p=>u.revokeDelegation(p),onSuccess:()=>{c.invalidateQueries({queryKey:["delegations"]})}}),y=r!=null&&r.success?r.data:[];return i.jsxs("div",{children:[i.jsx(Ha,{title:"Delegations",description:"Active delegation chains between agents. Each chain grants a subset of the delegating agent's permissions."}),o?i.jsx("div",{className:"flex items-center justify-center py-16",children:i.jsx("div",{className:"w-5 h-5 border-2 border-zinc-300 dark:border-zinc-700 border-t-amber-500 rounded-full animate-spin"})}):y.length===0?i.jsxs(Qt,{children:[i.jsxs(Lt,{children:[i.jsx(Y,{children:"ID"}),i.jsx(Y,{children:"Chain"}),i.jsx(Y,{children:"Permissions"}),i.jsx(Y,{children:"Depth"}),i.jsx(Y,{children:"Expires"}),i.jsx(Y,{children:"Status"}),i.jsx(Y,{})]}),i.jsx(Bt,{children:i.jsx("tr",{children:i.jsx("td",{colSpan:7,children:i.jsx(el,{icon:i.jsx(rg,{className:"w-6 h-6"}),title:"No delegation chains",description:"Delegations let one agent grant a subset of its permissions to another. Use the SDK to create delegation chains between agents.",docsLink:"https://kavachos.com/docs/delegation"})})})})]}):i.jsxs(Qt,{children:[i.jsxs(Lt,{children:[i.jsx(Y,{children:"ID"}),i.jsx(Y,{children:"Chain"}),i.jsx(Y,{children:"Permissions"}),i.jsx(Y,{children:"Depth"}),i.jsx(Y,{children:"Expires"}),i.jsx(Y,{children:"Status"}),i.jsx(Y,{})]}),i.jsx(Bt,{children:y.map(p=>i.jsxs(Pn,{children:[i.jsx(de,{children:i.jsx("code",{className:"text-xs font-mono text-zinc-500",children:p.id})}),i.jsxs(de,{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm text-zinc-200 font-medium max-w-[120px] truncate",children:p.fromAgentName}),i.jsx(kc,{className:"w-3.5 h-3.5 text-zinc-600 flex-shrink-0"}),i.jsx("span",{className:"text-sm text-zinc-200 font-medium max-w-[120px] truncate",children:p.toAgentName})]}),i.jsxs("div",{className:"flex gap-1 mt-0.5",children:[i.jsx("code",{className:"text-[10px] font-mono text-zinc-600",children:p.fromAgentId}),i.jsx("span",{className:"text-[10px] text-zinc-700",children:"→"}),i.jsx("code",{className:"text-[10px] font-mono text-zinc-600",children:p.toAgentId})]})]}),i.jsx(de,{children:i.jsx(Ap,{permissions:p.permissions})}),i.jsx(de,{children:i.jsxs("span",{className:"text-xs font-mono text-zinc-400",children:[p.depth,"/",p.maxDepth]})}),i.jsx(de,{children:i.jsx("span",{className:["text-xs",p.status==="expired"||new Date(p.expiresAt)<new Date?"text-amber-400":"text-zinc-400"].join(" "),children:Sp(p.expiresAt)})}),i.jsx(de,{children:i.jsx(ea,{variant:Np(p.status),children:p.status})}),i.jsx(de,{className:"text-right",children:p.status==="active"&&i.jsxs(Fe,{variant:"ghost",onClick:()=>f.mutate(p.id),disabled:f.isPending&&f.variables===p.id,children:[i.jsx(Uc,{className:"w-3.5 h-3.5 text-red-400"}),i.jsx("span",{className:"text-red-400",children:"Revoke"})]})})]},p.id))})]})]})}function mm(u){switch(u){case"online":return"green";case"offline":return"red";case"unknown":return"gray"}}function Tp({open:u,onClose:c,onSubmit:r,loading:o}){const[f,y]=G.useState(""),[p,z]=G.useState(""),[S,b]=G.useState(""),[H,M]=G.useState(!1),[_,q]=G.useState(""),[X,R]=G.useState(""),[B,L]=G.useState("");function Q(){let w=!0;if(f.trim()?R(""):(R("Name is required"),w=!1),p.trim()?L(""):(L("Endpoint URL is required"),w=!1),!w)return;const ae=S.split(",").map(ne=>ne.trim()).filter(Boolean),fe=_.trim()?Number(_.trim()):void 0;r({name:f.trim(),endpoint:p.trim(),tools:ae,authRequired:H,rateLimit:fe&&fe>0?{rpm:fe}:void 0})}function J(){y(""),z(""),b(""),M(!1),q(""),R(""),L(""),c()}return i.jsx(ns,{open:u,onClose:J,title:"Register MCP Server",footer:i.jsxs(i.Fragment,{children:[i.jsx(Fe,{variant:"ghost",onClick:J,children:"Cancel"}),i.jsx(Fe,{variant:"primary",onClick:Q,loading:o,children:"Register Server"})]}),children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs(ht,{children:[i.jsx(Ue,{htmlFor:"mcp-name",required:!0,children:"Name"}),i.jsx(et,{id:"mcp-name",placeholder:"e.g. filesystem-tools",value:f,onChange:w=>y(w.target.value),error:X,autoFocus:!0})]}),i.jsxs(ht,{children:[i.jsx(Ue,{htmlFor:"mcp-endpoint",required:!0,children:"Endpoint URL"}),i.jsx(et,{id:"mcp-endpoint",placeholder:"https://mcp.example.com/sse",value:p,onChange:w=>z(w.target.value),error:B})]}),i.jsxs(ht,{children:[i.jsx(Ue,{htmlFor:"mcp-tools",children:"Tools (comma-separated)"}),i.jsx(et,{id:"mcp-tools",placeholder:"read_file, write_file, list_dir",value:S,onChange:w=>b(w.target.value)})]}),i.jsxs(ht,{children:[i.jsx(Ue,{htmlFor:"mcp-rate-limit",children:"Rate limit (requests per minute)"}),i.jsx(et,{id:"mcp-rate-limit",type:"number",placeholder:"e.g. 60",min:"1",value:_,onChange:w=>q(w.target.value)})]}),i.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[i.jsx("button",{id:"mcp-auth",type:"button",role:"switch","aria-checked":H,onClick:()=>M(w=>!w),className:["relative inline-flex h-5 w-9 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-amber-500/30 focus:ring-offset-2 focus:ring-offset-zinc-900",H?"bg-amber-600":"bg-zinc-700"].join(" "),children:i.jsx("span",{className:["pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow ring-0 transition duration-200",H?"translate-x-4":"translate-x-0"].join(" ")})}),i.jsx("label",{htmlFor:"mcp-auth",className:"text-sm text-zinc-700 dark:text-zinc-300 cursor-pointer select-none",children:"Auth required"})]})]})})}function Mp({client:u}){const c=In(),[r,o]=G.useState(!1),{data:f,isLoading:y}=rt({queryKey:["mcp-servers"],queryFn:()=>u.getMcpServers()}),p=Ua({mutationFn:S=>u.registerMcpServer(S),onSuccess:S=>{S.success&&(c.invalidateQueries({queryKey:["mcp-servers"]}),o(!1))}}),z=f!=null&&f.success?f.data:[];return i.jsxs("div",{children:[i.jsx(Ha,{title:"MCP Servers",description:"Registered Model Context Protocol servers available to agents.",actions:i.jsxs(Fe,{variant:"primary",onClick:()=>o(!0),children:[i.jsx(Wl,{className:"w-3.5 h-3.5"}),"Register Server"]})}),y?i.jsx("div",{className:"flex items-center justify-center py-16",children:i.jsx("div",{className:"w-5 h-5 border-2 border-zinc-300 dark:border-zinc-700 border-t-amber-500 rounded-full animate-spin"})}):z.length===0?i.jsxs(Qt,{children:[i.jsxs(Lt,{children:[i.jsx(Y,{children:"Name"}),i.jsx(Y,{children:"Endpoint"}),i.jsx(Y,{children:"Tools"}),i.jsx(Y,{children:"Auth"}),i.jsx(Y,{children:"Rate limit"}),i.jsx(Y,{children:"Status"})]}),i.jsx(Bt,{children:i.jsx("tr",{children:i.jsx("td",{colSpan:6,children:i.jsx(el,{icon:i.jsx(Co,{className:"w-6 h-6"}),title:"No servers registered",description:"Register an MCP server to make its tools available to agents.",action:i.jsxs(Fe,{variant:"primary",onClick:()=>o(!0),children:[i.jsx(Wl,{className:"w-3.5 h-3.5"}),"Register Server"]})})})})})]}):i.jsxs(Qt,{children:[i.jsxs(Lt,{children:[i.jsx(Y,{children:"Name"}),i.jsx(Y,{children:"Endpoint"}),i.jsx(Y,{children:"Tools"}),i.jsx(Y,{children:"Auth"}),i.jsx(Y,{children:"Rate limit"}),i.jsx(Y,{children:"Status"})]}),i.jsx(Bt,{children:z.map(S=>i.jsxs(Pn,{children:[i.jsx(de,{children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-6 h-6 rounded-md bg-zinc-100 dark:bg-zinc-800 border border-zinc-300 dark:border-zinc-700 flex items-center justify-center flex-shrink-0",children:i.jsx(Co,{className:"w-3.5 h-3.5 text-zinc-400"})}),i.jsx("span",{className:"text-sm font-medium text-zinc-900 dark:text-white",children:S.name})]})}),i.jsx(de,{children:i.jsx("code",{className:"text-xs font-mono text-zinc-400 max-w-[200px] truncate block",children:S.endpoint})}),i.jsx(de,{children:S.tools.length===0?i.jsx("span",{className:"text-xs text-zinc-600",children:"—"}):i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"text-sm text-zinc-700 dark:text-zinc-300 font-medium",children:S.tools.length}),i.jsx("span",{className:"text-xs text-zinc-500",children:S.tools.length===1?"tool":"tools"})]})}),i.jsx(de,{children:S.authRequired?i.jsx(ea,{variant:"gold",children:"Required"}):i.jsx(ea,{variant:"gray",children:"None"})}),i.jsx(de,{children:S.rateLimit?i.jsxs("span",{className:"text-xs font-mono text-zinc-300",children:[S.rateLimit.rpm," rpm"]}):i.jsx("span",{className:"text-xs text-zinc-600",children:"—"})}),i.jsx(de,{children:i.jsxs(ea,{variant:mm(S.status),children:[i.jsx(Qo,{variant:mm(S.status)}),S.status]})})]},S.id))})]}),i.jsx(Tp,{open:r,onClose:()=>o(!1),onSubmit:S=>p.mutate(S),loading:p.isPending})]})}function Cp(u){return new Date(u).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Op(u){switch(u){case"allowed":return"green";case"denied":return"red";case"rate_limited":return"yellow"}}function _p(u){switch(u){case"allowed":return"allowed";case"denied":return"denied";case"rate_limited":return"rate limited"}}function Nc({title:u,value:c,subtitle:r,icon:o,iconColor:f}){return i.jsxs("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl p-5 flex flex-col gap-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-xs font-medium text-zinc-500 dark:text-zinc-400 uppercase tracking-wider",children:u}),i.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center ${f}`,children:i.jsx(o,{className:"w-4 h-4 text-zinc-900 dark:text-white",strokeWidth:2})})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-3xl font-semibold text-zinc-900 dark:text-white tracking-tight",children:c}),i.jsx("p",{className:"text-xs text-zinc-500 dark:text-zinc-500 mt-1",children:r})]})]})}function Ac(){return i.jsxs("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl p-5 flex flex-col gap-4 animate-pulse",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"h-3 w-24 bg-zinc-200 dark:bg-zinc-800 rounded"}),i.jsx("div",{className:"w-8 h-8 bg-zinc-200 dark:bg-zinc-200 dark:bg-zinc-800 rounded-lg"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"h-8 w-16 bg-zinc-200 dark:bg-zinc-800 rounded"}),i.jsx("div",{className:"h-3 w-28 bg-zinc-200 dark:bg-zinc-800 rounded mt-2"})]})]})}function wp({client:u}){const{data:c,isLoading:r,dataUpdatedAt:o}=rt({queryKey:["audit","recent"],queryFn:()=>u.getAuditLogs({limit:10}),refetchInterval:15e3}),f=c!=null&&c.success?c.data.entries:[],y=o>0?new Date(o):null;return i.jsxs("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl overflow-hidden",children:[i.jsxs("div",{className:"px-5 py-4 border-b border-zinc-200 dark:border-zinc-800 flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-white",children:"Recent Activity"}),i.jsx("p",{className:"text-xs text-zinc-500 dark:text-zinc-500 mt-0.5",children:"Last 10 audit entries, auto-refreshes every 15s"})]}),y&&i.jsxs("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-600 tabular-nums",children:["Updated"," ",y.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"})]})]}),r?i.jsx("div",{className:"divide-y divide-zinc-800",children:Array.from({length:5}).map((p,z)=>i.jsxs("div",{className:"px-5 py-3.5 flex items-center gap-4 animate-pulse",children:[i.jsx("div",{className:"h-3 w-28 bg-zinc-200 dark:bg-zinc-800 rounded flex-shrink-0"}),i.jsx("div",{className:"h-3 w-20 bg-zinc-200 dark:bg-zinc-800 rounded flex-shrink-0"}),i.jsx("div",{className:"h-3 w-24 bg-zinc-200 dark:bg-zinc-800 rounded flex-shrink-0"}),i.jsx("div",{className:"h-3 flex-1 bg-zinc-200 dark:bg-zinc-800 rounded"}),i.jsx("div",{className:"h-5 w-16 bg-zinc-200 dark:bg-zinc-200 dark:bg-zinc-800 rounded-full flex-shrink-0"})]},z))}):f.length===0?i.jsxs("div",{className:"px-5 py-10 text-center",children:[i.jsx(Mo,{className:"w-8 h-8 text-zinc-700 dark:text-zinc-300 dark:text-zinc-700 mx-auto mb-3"}),i.jsx("p",{className:"text-sm text-zinc-400 dark:text-zinc-500",children:"No audit events yet"})]}):i.jsx("div",{className:"divide-y divide-zinc-800",children:f.map(p=>i.jsxs("div",{className:"px-5 py-3 flex items-center gap-4 text-xs hover:bg-zinc-50 dark:hover:bg-zinc-100/60 dark:bg-zinc-800/40 transition-colors",children:[i.jsx("span",{className:"text-zinc-500 dark:text-zinc-500 tabular-nums flex-shrink-0 w-36",children:Cp(p.timestamp)}),i.jsx("span",{className:"text-zinc-800 dark:text-zinc-300 font-medium truncate w-32 flex-shrink-0",children:p.agentName}),i.jsx("span",{className:"text-zinc-600 dark:text-zinc-400 font-mono truncate w-24 flex-shrink-0",children:p.action}),i.jsx("span",{className:"text-zinc-600 dark:text-zinc-500 truncate flex-1 font-mono",children:p.resource}),i.jsx(ea,{variant:Op(p.result),children:_p(p.result)})]},p.id))})]})}function Dp({client:u,onNavigate:c}){const{data:r,isLoading:o}=rt({queryKey:["dashboard","stats"],queryFn:()=>u.getStats(),refetchInterval:3e4}),f=r!=null&&r.success?r.data:null;return G.useEffect(()=>{u.getAuditLogs({limit:10})},[u]),i.jsxs("div",{children:[i.jsx(Ha,{title:"Overview",description:"System-wide health and recent activity at a glance."}),i.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:o||!f?i.jsxs(i.Fragment,{children:[i.jsx(Ac,{}),i.jsx(Ac,{}),i.jsx(Ac,{}),i.jsx(Ac,{})]}):i.jsxs(i.Fragment,{children:[i.jsx(Nc,{title:"Total Agents",value:f.totalAgents,subtitle:`${f.activeAgents} active`,icon:Rc,iconColor:"bg-amber-600"}),i.jsx(Nc,{title:"Auth Rate",value:`${Math.round(f.authAllowedRate)}%`,subtitle:"allowed vs denied, last 24h",icon:as,iconColor:"bg-emerald-600"}),i.jsx(Nc,{title:"Audit Events",value:f.totalAuditEvents.toLocaleString(),subtitle:`${f.recentAuditEvents} in last 24h`,icon:Mo,iconColor:"bg-violet-600"}),i.jsx(Nc,{title:"Delegations",value:f.activeDelegations,subtitle:"active delegations",icon:Ho,iconColor:"bg-sky-600"})]})}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[i.jsx("div",{className:"lg:col-span-2",children:i.jsx(wp,{client:u})}),i.jsxs("div",{className:"flex flex-col gap-4",children:[i.jsxs("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl overflow-hidden",children:[i.jsx("div",{className:"px-5 py-4 border-b border-zinc-200 dark:border-zinc-800",children:i.jsx("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-white",children:"Quick Actions"})}),i.jsxs("div",{className:"p-4 flex flex-col gap-3",children:[i.jsxs("button",{type:"button",onClick:()=>c("agents"),className:"group flex items-center justify-between w-full px-4 py-3.5 bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-700/80 border border-zinc-300 dark:border-zinc-700 hover:border-zinc-600 rounded-lg transition-all duration-100 text-left",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-lg bg-amber-600/20 border border-amber-500/30 flex items-center justify-center flex-shrink-0",children:i.jsx(Rc,{className:"w-4 h-4 text-amber-400"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-zinc-900 dark:text-white",children:"Create Agent"}),i.jsx("p",{className:"text-xs text-zinc-500",children:"Register a new AI agent"})]})]}),i.jsx(kc,{className:"w-4 h-4 text-zinc-600 group-hover:text-zinc-400 transition-colors"})]}),i.jsxs("button",{type:"button",onClick:()=>c("audit"),className:"group flex items-center justify-between w-full px-4 py-3.5 bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-700/80 border border-zinc-300 dark:border-zinc-700 hover:border-zinc-600 rounded-lg transition-all duration-100 text-left",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-lg bg-violet-600/20 border border-violet-500/30 flex items-center justify-center flex-shrink-0",children:i.jsx(Mo,{className:"w-4 h-4 text-violet-400"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-zinc-900 dark:text-white",children:"View Audit Log"}),i.jsx("p",{className:"text-xs text-zinc-500",children:"Full immutable event trail"})]})]}),i.jsx(kc,{className:"w-4 h-4 text-zinc-600 group-hover:text-zinc-400 transition-colors"})]})]})]}),f&&i.jsxs("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl p-5",children:[i.jsx("h3",{className:"text-xs font-medium text-zinc-500 dark:text-zinc-400 uppercase tracking-wider mb-4",children:"Authorization Breakdown"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[i.jsx("span",{className:"text-xs text-zinc-400",children:"Allowed"}),i.jsxs("span",{className:"text-xs font-mono text-emerald-400",children:[Math.round(f.authAllowedRate),"%"]})]}),i.jsx("div",{className:"h-1.5 bg-zinc-200 dark:bg-zinc-200 dark:bg-zinc-800 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-emerald-500 rounded-full transition-all duration-500",style:{width:`${Math.min(100,f.authAllowedRate)}%`}})})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[i.jsx("span",{className:"text-xs text-zinc-400",children:"Denied"}),i.jsxs("span",{className:"text-xs font-mono text-red-400",children:[Math.round(100-f.authAllowedRate),"%"]})]}),i.jsx("div",{className:"h-1.5 bg-zinc-200 dark:bg-zinc-200 dark:bg-zinc-800 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-red-500 rounded-full transition-all duration-500",style:{width:`${Math.min(100,100-f.authAllowedRate)}%`}})})]})]})]})]})]})]})}function xm(u,c){if(u===c||u==="*"||c==="*")return!0;function r(o,f){if(o===f)return!0;if(o.endsWith(":*")||o.endsWith("/*")||o.endsWith("*")){const y=o.endsWith(":*")||o.endsWith("/*")?o.slice(0,-2):o.slice(0,-1);return f.startsWith(y)||y.startsWith(f)}return!1}return r(u,c)||r(c,u)}function ym(u){return u.some(c=>["write","delete","update","create","execute"].includes(c))}function vm(u){return u.filter(r=>!["read","list"].includes(r)).length===0}function gm(u){return u.requireApproval===!0}function kp(u,c,r){const o=[];for(const f of c){if(r!==void 0&&f.id===r||!xm(u.resource,f.resource))continue;const y=ym(u.actions),p=ym(f.actions),z=vm(u.actions),S=vm(f.actions),b=gm(u.constraints),H=gm(f.constraints);if(b!==H&&o.push({kind:"contradiction",otherName:f.name,message:`Contradicts "${f.name}": one requires human approval on overlapping resource "${f.resource}", the other does not.`}),xm(u.resource,f.resource)&&(f.resource==="*"||f.resource.endsWith("*")&&u.resource.startsWith(f.resource.slice(0,-1)))&&f.actions.length>=u.actions.length&&u.actions.every(M=>f.actions.includes(M))){o.push({kind:"redundancy",otherName:f.name,message:`Redundant with "${f.name}": that template already covers "${f.resource}" with the same or broader actions.`});continue}z&&p?o.push({kind:"overlap",otherName:f.name,message:`Overlaps with "${f.name}": this template is read-only but "${f.name}" grants write access on matching resource "${f.resource}".`}):y&&S&&o.push({kind:"overlap",otherName:f.name,message:`Overlaps with "${f.name}": this template grants write access while "${f.name}" is read-only on matching resource "${f.resource}".`})}return o}function Rp({resource:u,actions:c,constraints:r,allTemplates:o,editingId:f}){if(!u.trim()||c.length===0)return null;const y=kp({resource:u,actions:c,constraints:r},o,f);return y.length===0?null:i.jsx("div",{className:"rounded-lg border border-yellow-700/60 bg-yellow-950/30 px-3.5 py-3",role:"alert","aria-live":"polite",children:i.jsxs("div",{className:"flex items-start gap-2.5",children:[i.jsx(kg,{className:"w-4 h-4 text-yellow-500 mt-0.5 flex-shrink-0"}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"text-xs font-semibold text-yellow-400 mb-1.5",children:y.length===1?"Potential conflict detected":`${y.length} potential conflicts detected`}),i.jsx("ul",{className:"space-y-1",children:y.map(p=>i.jsxs("li",{className:"text-[11px] text-yellow-300/80 leading-relaxed",children:[i.jsx("span",{className:"inline-block w-16 font-mono text-yellow-600 uppercase tracking-wide text-[9px]",children:p.kind}),p.message]},`${p.kind}-${p.otherName}-${p.message}`))})]})]})})}function Up(u){const c=u.rateLimit!==void 0&&u.rateLimit!==null?u.rateLimit:null,r=u.timeWindow!==void 0&&u.timeWindow!==null?u.timeWindow:null,o=u.requireApproval===!0,f=Array.isArray(u.ipAllowlist)&&u.ipAllowlist.length>0?u.ipAllowlist:null,y=Array.isArray(u.argumentPatterns)&&u.argumentPatterns.length>0?u.argumentPatterns:null;return{rateLimit:c,timeWindow:r,requireApproval:o,ipAllowlist:f,argumentPatterns:y}}function qp(u){const c={};return u.rateLimit!==null&&(c.rateLimit=u.rateLimit),u.timeWindow!==null&&(c.timeWindow=u.timeWindow),u.requireApproval&&(c.requireApproval=!0),u.ipAllowlist!==null&&(c.ipAllowlist=u.ipAllowlist),u.argumentPatterns!==null&&(c.argumentPatterns=u.argumentPatterns),c}function Ec({id:u,label:c,enabled:r,onToggle:o,children:f}){return i.jsxs("div",{className:"rounded-lg border border-zinc-200 dark:border-zinc-800 overflow-hidden",children:[i.jsxs("button",{type:"button",id:u,onClick:o,className:"w-full flex items-center justify-between px-3 py-2.5 bg-zinc-100/60 dark:bg-zinc-800/40 hover:bg-zinc-200/70 dark:bg-zinc-800/70 transition-colors","aria-expanded":r,children:[i.jsx("span",{className:"text-xs font-medium text-zinc-300",children:c}),i.jsx("span",{className:["w-8 h-4 rounded-full transition-colors relative flex-shrink-0",r?"bg-amber-600":"bg-zinc-700"].join(" "),"aria-hidden":"true",children:i.jsx("span",{className:["absolute top-0.5 w-3 h-3 rounded-full bg-white transition-transform",r?"translate-x-4":"translate-x-0.5"].join(" ")})})]}),r&&i.jsx("div",{className:"px-3 py-3 space-y-2.5 border-t border-zinc-800",children:f})]})}function pm({tags:u,onRemove:c}){return u.length===0?null:i.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:u.map(r=>i.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-zinc-100 dark:bg-zinc-800 border border-zinc-300 dark:border-zinc-700 text-xs text-zinc-700 dark:text-zinc-300 font-mono",children:[r,i.jsx("button",{type:"button",onClick:()=>c(r),className:"text-zinc-500 hover:text-zinc-200 transition-colors","aria-label":`Remove ${r}`,children:i.jsx(Qc,{className:"w-2.5 h-2.5"})})]},r))})}function Hp({constraints:u,onChange:c}){var X,R,B;const r=Up(u),[o,f]=G.useState(""),[y,p]=G.useState("");function z(L){c(qp({...r,...L}))}function S(){z({rateLimit:r.rateLimit===null?{maxCallsPerHour:100}:null})}function b(){z({timeWindow:r.timeWindow===null?{start:"09:00",end:"17:00"}:null})}function H(){const L=o.split(",").map(w=>w.trim()).filter(Boolean);if(L.length===0)return;const Q=r.ipAllowlist??[],J=[...Q,...L.filter(w=>!Q.includes(w))];z({ipAllowlist:J.length>0?J:null}),f("")}function M(L){const Q=(r.ipAllowlist??[]).filter(J=>J!==L);z({ipAllowlist:Q.length>0?Q:null})}function _(){const L=y.split(",").map(w=>w.trim()).filter(Boolean);if(L.length===0)return;const Q=r.argumentPatterns??[],J=[...Q,...L.filter(w=>!Q.includes(w))];z({argumentPatterns:J.length>0?J:null}),p("")}function q(L){const Q=(r.argumentPatterns??[]).filter(J=>J!==L);z({argumentPatterns:Q.length>0?Q:null})}return i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ec,{id:"constraint-rate-limit",label:"Rate limit",enabled:r.rateLimit!==null,onToggle:S,children:i.jsxs("div",{children:[i.jsx(Ue,{htmlFor:"constraint-max-calls",children:"Max calls per hour"}),i.jsx(et,{id:"constraint-max-calls",type:"number",min:1,value:((X=r.rateLimit)==null?void 0:X.maxCallsPerHour)??100,onChange:L=>z({rateLimit:{maxCallsPerHour:Number(L.target.value)}}),className:"w-32"})]})}),i.jsx(Ec,{id:"constraint-time-window",label:"Time window",enabled:r.timeWindow!==null,onToggle:b,children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{children:[i.jsx(Ue,{htmlFor:"constraint-tw-start",children:"Start"}),i.jsx(et,{id:"constraint-tw-start",type:"time",value:((R=r.timeWindow)==null?void 0:R.start)??"09:00",onChange:L=>{var Q;return z({timeWindow:{start:L.target.value,end:((Q=r.timeWindow)==null?void 0:Q.end)??"17:00"}})},className:"w-32"})]}),i.jsxs("div",{children:[i.jsx(Ue,{htmlFor:"constraint-tw-end",children:"End"}),i.jsx(et,{id:"constraint-tw-end",type:"time",value:((B=r.timeWindow)==null?void 0:B.end)??"17:00",onChange:L=>{var Q;return z({timeWindow:{start:((Q=r.timeWindow)==null?void 0:Q.start)??"09:00",end:L.target.value}})},className:"w-32"})]})]})}),i.jsxs("label",{className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-zinc-200 dark:border-zinc-800 bg-zinc-100/60 dark:bg-zinc-800/40 cursor-pointer hover:bg-zinc-200/70 dark:bg-zinc-800/70 transition-colors",children:[i.jsx("input",{type:"checkbox",checked:r.requireApproval,onChange:()=>z({requireApproval:!r.requireApproval}),className:"w-3.5 h-3.5 rounded border-zinc-600 bg-zinc-100 dark:bg-zinc-800 accent-amber-500"}),i.jsx("span",{className:"text-xs font-medium text-zinc-300",children:"Human-in-the-loop (require approval)"})]}),i.jsx(Ec,{id:"constraint-ip-allowlist",label:"IP allowlist",enabled:r.ipAllowlist!==null,onToggle:()=>z({ipAllowlist:r.ipAllowlist===null?[]:null}),children:i.jsxs("div",{children:[i.jsx(Ue,{htmlFor:"constraint-ip-input",children:"Add IPs or CIDRs (comma-separated, press Enter)"}),i.jsx(et,{id:"constraint-ip-input",placeholder:"10.0.0.0/8, 192.168.1.5",value:o,onChange:L=>f(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),H())},onBlur:H}),i.jsx(pm,{tags:r.ipAllowlist??[],onRemove:M})]})}),i.jsx(Ec,{id:"constraint-arg-patterns",label:"Argument patterns",enabled:r.argumentPatterns!==null,onToggle:()=>z({argumentPatterns:r.argumentPatterns===null?[]:null}),children:i.jsxs("div",{children:[i.jsx(Ue,{htmlFor:"constraint-pattern-input",children:"Glob patterns (comma-separated, press Enter)"}),i.jsx(et,{id:"constraint-pattern-input",placeholder:"docs/*, reports/**",value:y,onChange:L=>p(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),_())},onBlur:_}),i.jsx(pm,{tags:r.argumentPatterns??[],onRemove:q})]})})]})}const Qp=["read","write","delete","execute","list","create","update"];function Lp(u){return new Date(u).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function bm({open:u,onClose:c,onSubmit:r,loading:o,initial:f,allTemplates:y}){const p=(f==null?void 0:f.constraints)??{},[z,S]=G.useState({name:(f==null?void 0:f.name)??"",description:(f==null?void 0:f.description)??"",resource:(f==null?void 0:f.resource)??"",actions:(f==null?void 0:f.actions)??[],constraints:p,constraintsJson:f!=null&&f.constraints?JSON.stringify(f.constraints,null,2):""}),[b,H]=G.useState({}),[M,_]=G.useState("visual");function q(w){S(ae=>({...ae,actions:ae.actions.includes(w)?ae.actions.filter(fe=>fe!==w):[...ae.actions,w]}))}function X(w){S(ae=>({...ae,constraints:w,constraintsJson:JSON.stringify(w,null,2)}))}function R(w){S(ae=>{let fe={};try{fe=JSON.parse(w)}catch{fe=ae.constraints}return{...ae,constraintsJson:w,constraints:fe}})}function B(){const w={};if(z.name.trim()||(w.name="Name is required"),z.resource.trim()||(w.resource="Resource pattern is required"),z.actions.length===0&&(w.actions="At least one action required"),M==="raw"&&z.constraintsJson.trim())try{JSON.parse(z.constraintsJson)}catch{w.constraintsJson="Invalid JSON"}return H(w),Object.keys(w).length===0}function L(){if(!B())return;let w={};if(M==="raw"&&z.constraintsJson.trim())try{w=JSON.parse(z.constraintsJson)}catch{}else w=z.constraints;r({name:z.name.trim(),description:z.description.trim()||void 0,resource:z.resource.trim(),actions:z.actions,constraints:w})}function Q(){S({name:(f==null?void 0:f.name)??"",description:(f==null?void 0:f.description)??"",resource:(f==null?void 0:f.resource)??"",actions:(f==null?void 0:f.actions)??[],constraints:(f==null?void 0:f.constraints)??{},constraintsJson:f!=null&&f.constraints?JSON.stringify(f.constraints,null,2):""}),H({}),_("visual"),c()}const J=M==="raw"?(()=>{try{return JSON.parse(z.constraintsJson)}catch{return z.constraints}})():z.constraints;return i.jsx(ns,{open:u,onClose:Q,title:f?"Edit Template":"New Permission Template",footer:i.jsxs(i.Fragment,{children:[i.jsx(Fe,{variant:"ghost",onClick:Q,children:"Cancel"}),i.jsx(Fe,{variant:"primary",onClick:L,loading:o,children:f?"Save Changes":"Create Template"})]}),children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs(ht,{children:[i.jsx(Ue,{htmlFor:"tpl-name",required:!0,children:"Name"}),i.jsx(et,{id:"tpl-name",placeholder:"e.g. read-only-documents",value:z.name,onChange:w=>S(ae=>({...ae,name:w.target.value})),error:b.name,autoFocus:!0})]}),i.jsxs(ht,{children:[i.jsx(Ue,{htmlFor:"tpl-description",children:"Description"}),i.jsx(et,{id:"tpl-description",placeholder:"Brief description of what this template grants",value:z.description,onChange:w=>S(ae=>({...ae,description:w.target.value}))})]}),i.jsxs(ht,{children:[i.jsx(Ue,{htmlFor:"tpl-resource",required:!0,children:"Resource Pattern"}),i.jsx(et,{id:"tpl-resource",placeholder:"e.g. documents:*, api/v1/users/:id",value:z.resource,onChange:w=>S(ae=>({...ae,resource:w.target.value})),error:b.resource}),i.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Use ",i.jsx("code",{className:"text-zinc-400",children:"*"})," for wildcard matching"]})]}),i.jsxs("div",{children:[i.jsx(Ue,{required:!0,children:"Actions"}),b.actions&&i.jsx("p",{className:"text-xs text-red-400 mb-1.5",children:b.actions}),i.jsx("div",{className:"flex flex-wrap gap-2 mt-1.5",children:Qp.map(w=>i.jsx("button",{type:"button",onClick:()=>q(w),className:["px-2.5 py-1 rounded-md text-xs font-medium border transition-colors",z.actions.includes(w)?"bg-amber-600 border-amber-500 text-white":"bg-zinc-100 dark:bg-zinc-800 border-zinc-300 dark:border-zinc-700 text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200"].join(" "),children:w},w))})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx(Ue,{children:"Constraints"}),i.jsxs("div",{className:"flex items-center gap-0.5 p-0.5 rounded-md bg-zinc-100 dark:bg-zinc-800 border border-zinc-300 dark:border-zinc-700",children:[i.jsxs("button",{type:"button",onClick:()=>_("visual"),className:["flex items-center gap-1.5 px-2 py-1 rounded text-[11px] font-medium transition-colors",M==="visual"?"bg-zinc-700 text-zinc-800 dark:text-zinc-200":"text-zinc-500 hover:text-zinc-300"].join(" "),children:[i.jsx(Tg,{className:"w-3 h-3"}),"Visual"]}),i.jsxs("button",{type:"button",onClick:()=>_("raw"),className:["flex items-center gap-1.5 px-2 py-1 rounded text-[11px] font-medium transition-colors",M==="raw"?"bg-zinc-700 text-zinc-800 dark:text-zinc-200":"text-zinc-500 hover:text-zinc-300"].join(" "),children:[i.jsx(R1,{className:"w-3 h-3"}),"Raw JSON"]})]})]}),M==="visual"?i.jsx(Hp,{constraints:z.constraints,onChange:X}):i.jsxs(ht,{children:[i.jsx(sp,{id:"tpl-constraints",placeholder:'{"maxRequests": 100, "allowedIPs": ["10.0.0.0/8"]}',value:z.constraintsJson,onChange:w=>R(w.target.value),rows:5,error:b.constraintsJson,className:"font-mono text-xs"}),i.jsx("p",{className:"text-[11px] text-zinc-500 mt-1",children:"Optional. JSON object with additional constraints applied at check time."})]})]}),i.jsx(Rp,{resource:z.resource,actions:z.actions,constraints:J,allTemplates:y,editingId:f==null?void 0:f.id})]})})}function Bp({client:u}){const c=In(),[r,o]=G.useState(!1),[f,y]=G.useState(null),{data:p,isLoading:z}=rt({queryKey:["permission-templates"],queryFn:()=>u.getPermissionTemplates()}),S=Ua({mutationFn:_=>u.createPermissionTemplate(_),onSuccess:_=>{_.success&&(c.invalidateQueries({queryKey:["permission-templates"]}),o(!1))}}),b=Ua({mutationFn:({id:_,input:q})=>u.updatePermissionTemplate(_,q),onSuccess:_=>{_.success&&(c.invalidateQueries({queryKey:["permission-templates"]}),y(null))}}),H=Ua({mutationFn:_=>u.deletePermissionTemplate(_),onSuccess:()=>{c.invalidateQueries({queryKey:["permission-templates"]})}}),M=p!=null&&p.success?p.data:[];return i.jsxs("div",{children:[i.jsx(Ha,{title:"Permissions",description:"Reusable permission templates for agents. Define once, apply many times.",actions:i.jsxs(Fe,{variant:"primary",onClick:()=>o(!0),children:[i.jsx(Wl,{className:"w-3.5 h-3.5"}),"New Template"]})}),z?i.jsx("div",{className:"flex items-center justify-center py-16",children:i.jsx("div",{className:"w-5 h-5 border-2 border-zinc-300 dark:border-zinc-700 border-t-amber-500 rounded-full animate-spin"})}):M.length===0?i.jsxs(Qt,{children:[i.jsxs(Lt,{children:[i.jsx(Y,{children:"Name"}),i.jsx(Y,{children:"Resource"}),i.jsx(Y,{children:"Actions"}),i.jsx(Y,{children:"Constraints"}),i.jsx(Y,{children:"Updated"}),i.jsx(Y,{})]}),i.jsx(Bt,{children:i.jsx("tr",{children:i.jsx("td",{colSpan:6,children:i.jsx(el,{icon:i.jsx(as,{className:"w-6 h-6"}),title:"No permission templates",description:"Templates let you define reusable permission sets once, then apply them to any agent. Good for shared roles like read-only or admin.",action:i.jsxs(Fe,{variant:"primary",onClick:()=>o(!0),children:[i.jsx(Wl,{className:"w-3.5 h-3.5"}),"Create Template"]}),docsLink:"https://kavachos.com/docs/permissions"})})})})]}):i.jsxs(Qt,{children:[i.jsxs(Lt,{children:[i.jsx(Y,{children:"Name"}),i.jsx(Y,{children:"Resource"}),i.jsx(Y,{children:"Actions"}),i.jsx(Y,{children:"Constraints"}),i.jsx(Y,{children:"Updated"}),i.jsx(Y,{})]}),i.jsx(Bt,{children:M.map(_=>i.jsxs(Pn,{onClick:()=>y(_),children:[i.jsx(de,{children:i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-white",children:_.name}),_.description&&i.jsx("p",{className:"text-xs text-zinc-500 mt-0.5 max-w-[200px] truncate",children:_.description})]})}),i.jsx(de,{children:i.jsx("code",{className:"text-xs font-mono text-amber-400",children:_.resource})}),i.jsx(de,{children:i.jsx("div",{className:"flex flex-wrap gap-1",children:_.actions.map(q=>i.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono bg-zinc-100 dark:bg-zinc-800 text-zinc-400",children:q},q))})}),i.jsx(de,{children:Object.keys(_.constraints).length>0?i.jsxs("span",{className:"text-xs text-zinc-400",children:[Object.keys(_.constraints).length," rule",Object.keys(_.constraints).length!==1?"s":""]}):i.jsx("span",{className:"text-xs text-zinc-600",children:"None"})}),i.jsx(de,{children:i.jsx("span",{className:"text-xs text-zinc-500",children:Lp(_.updatedAt)})}),i.jsx(de,{className:"text-right",children:i.jsxs("div",{className:"flex items-center justify-end gap-1",children:[i.jsx("button",{type:"button",onClick:q=>{q.stopPropagation(),y(_)},className:"w-7 h-7 flex items-center justify-center rounded-md text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300 hover:bg-zinc-800 transition-colors","aria-label":"Edit template",children:i.jsx(dg,{className:"w-3.5 h-3.5"})}),i.jsx("button",{type:"button",onClick:q=>{q.stopPropagation(),H.mutate(_.id)},disabled:H.isPending,className:"w-7 h-7 flex items-center justify-center rounded-md text-zinc-500 hover:text-red-400 hover:bg-red-950/50 transition-colors disabled:opacity-50","aria-label":"Delete template",children:i.jsx(wg,{className:"w-3.5 h-3.5"})}),i.jsx(Km,{className:"w-3.5 h-3.5 text-zinc-700"})]})})]},_.id))})]}),i.jsx(bm,{open:r,onClose:()=>o(!1),onSubmit:_=>S.mutate(_),loading:S.isPending,allTemplates:M}),i.jsx(bm,{open:f!==null,onClose:()=>y(null),onSubmit:_=>{f&&b.mutate({id:f.id,input:_})},loading:b.isPending,initial:f??void 0,allTemplates:M})]})}function Yp(u){return new Date(u).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Tc({title:u,value:c,subtitle:r,icon:o,iconColor:f}){return i.jsxs("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl p-5 flex flex-col gap-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-xs font-medium text-zinc-400 uppercase tracking-wider",children:u}),i.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center ${f}`,children:i.jsx(o,{className:"w-4 h-4 text-zinc-900 dark:text-white",strokeWidth:2})})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-3xl font-semibold text-zinc-900 dark:text-white tracking-tight",children:c}),i.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:r})]})]})}function Mc(){return i.jsxs("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl p-5 flex flex-col gap-4 animate-pulse",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"h-3 w-24 bg-zinc-200 dark:bg-zinc-800 rounded"}),i.jsx("div",{className:"w-8 h-8 bg-zinc-200 dark:bg-zinc-800 rounded-lg"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"h-8 w-16 bg-zinc-200 dark:bg-zinc-800 rounded"}),i.jsx("div",{className:"h-3 w-28 bg-zinc-200 dark:bg-zinc-800 rounded mt-2"})]})]})}function Gp({client:u}){const{data:c,isLoading:r}=rt({queryKey:["dashboard","stats"],queryFn:()=>u.getStats(),refetchInterval:3e4}),{data:o}=rt({queryKey:["agents"],queryFn:()=>u.getAgents()}),{data:f,isLoading:y}=rt({queryKey:["audit-denials"],queryFn:()=>u.getAuditLogs({result:"denied",limit:20}),refetchInterval:3e4}),{data:p,isLoading:z}=rt({queryKey:["audit-rate-limited"],queryFn:()=>u.getAuditLogs({result:"rate_limited",limit:20}),refetchInterval:3e4}),S=c!=null&&c.success?c.data:null,b=o!=null&&o.success?o.data:[],H=f!=null&&f.success?f.data.entries:[],M=p!=null&&p.success?p.data.entries:[],_=b.filter(B=>B.status==="revoked").length,q=b.filter(B=>B.status==="expired").length,R=[...new Set(M.map(B=>B.agentId))].map(B=>{const L=M.find(Q=>Q.agentId===B);return{id:B,name:(L==null?void 0:L.agentName)??B}});return i.jsxs("div",{children:[i.jsx(Ha,{title:"Security",description:"Security health, denied access attempts, and rate limiting overview."}),i.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:r||!S?i.jsxs(i.Fragment,{children:[i.jsx(Mc,{}),i.jsx(Mc,{}),i.jsx(Mc,{}),i.jsx(Mc,{})]}):i.jsxs(i.Fragment,{children:[i.jsx(Tc,{title:"Rate limited (24h)",value:p!=null&&p.success?p.data.total:"—",subtitle:"requests throttled in last 24h",icon:dm,iconColor:"bg-amber-600"}),i.jsx(Tc,{title:"Denied (24h)",value:f!=null&&f.success?f.data.total:"—",subtitle:"access denied events in last 24h",icon:Uc,iconColor:"bg-red-600"}),i.jsx(Tc,{title:"Revoked agents",value:_,subtitle:"agents manually revoked",icon:Jm,iconColor:"bg-rose-700"}),i.jsx(Tc,{title:"Expired tokens",value:q,subtitle:"agents with expired credentials",icon:Vm,iconColor:"bg-zinc-600"})]})}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[i.jsx("div",{className:"lg:col-span-2",children:i.jsxs("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl overflow-hidden",children:[i.jsxs("div",{className:"px-5 py-4 border-b border-zinc-200 dark:border-zinc-800",children:[i.jsx("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-white",children:"Recent denials"}),i.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"Last 20 denied access events"})]}),y?i.jsx("div",{className:"flex items-center justify-center py-12",children:i.jsx("div",{className:"w-5 h-5 border-2 border-zinc-300 dark:border-zinc-700 border-t-amber-500 rounded-full animate-spin"})}):H.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center mb-3 text-zinc-500",children:i.jsx(Uc,{className:"w-5 h-5"})}),i.jsx("p",{className:"text-sm font-medium text-zinc-700 dark:text-zinc-300 mb-1",children:"No denied events"}),i.jsx("p",{className:"text-xs text-zinc-500",children:"All recent access requests were allowed."})]}):i.jsxs(Qt,{children:[i.jsxs(Lt,{children:[i.jsx(Y,{children:"Timestamp"}),i.jsx(Y,{children:"Agent"}),i.jsx(Y,{children:"Action"}),i.jsx(Y,{children:"Resource"})]}),i.jsx(Bt,{children:H.map(B=>i.jsxs(Pn,{children:[i.jsx(de,{children:i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(Hc,{className:"w-3 h-3 text-zinc-600 flex-shrink-0"}),i.jsx("span",{className:"text-xs text-zinc-700 dark:text-zinc-300 font-mono",children:Yp(B.timestamp)})]})}),i.jsx(de,{children:i.jsx("span",{className:"text-xs font-medium text-zinc-800 dark:text-zinc-200",children:B.agentName})}),i.jsx(de,{children:i.jsx("code",{className:"text-xs font-mono text-zinc-400",children:B.action})}),i.jsx(de,{children:i.jsx("code",{className:"text-xs font-mono text-zinc-400 max-w-[180px] truncate block",children:B.resource})})]},B.id))})]})]})}),i.jsx("div",{children:i.jsxs("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl overflow-hidden",children:[i.jsxs("div",{className:"px-5 py-4 border-b border-zinc-200 dark:border-zinc-800",children:[i.jsx("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-white",children:"Rate limited agents"}),i.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"Agents hitting limits recently"})]}),z?i.jsx("div",{className:"flex items-center justify-center py-10",children:i.jsx("div",{className:"w-4 h-4 border-2 border-zinc-300 dark:border-zinc-700 border-t-amber-500 rounded-full animate-spin"})}):R.length===0?i.jsx("div",{className:"flex flex-col items-center justify-center py-10 text-center px-4",children:i.jsx(el,{icon:i.jsx(dm,{className:"w-5 h-5"}),title:"No throttled agents",description:"No agents have hit rate limits recently."})}):i.jsx("div",{className:"divide-y divide-zinc-800/60",children:R.map(B=>{const L=M.filter(Q=>Q.agentId===B.id).length;return i.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-zinc-800 dark:text-zinc-200",children:B.name}),i.jsxs("p",{className:"text-[11px] font-mono text-zinc-600 mt-0.5",children:[B.id.slice(0,12),"…"]})]}),i.jsxs(ea,{variant:"yellow",children:[L," hits"]})]},B.id)})})]})})]})]})}function Cc({icon:u,title:c,description:r,children:o}){return i.jsxs("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl p-5",children:[i.jsxs("div",{className:"flex items-start gap-3 mb-5",children:[i.jsx("div",{className:"w-8 h-8 rounded-lg bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center flex-shrink-0 text-zinc-400",children:u}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-white",children:c}),i.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:r})]})]}),o]})}function ho({label:u,value:c}){return i.jsxs("div",{children:[i.jsx("p",{className:"text-xs font-medium text-zinc-500 mb-1",children:u}),i.jsx("p",{className:"text-sm font-mono text-zinc-700 dark:text-zinc-300 bg-zinc-100 dark:bg-zinc-950 border border-zinc-200 dark:border-zinc-800 rounded-lg px-3 py-2",children:c})]})}function Xp({settings:u,onSave:c,loading:r}){const[o,f]=G.useState(String(u.tokenExpirySeconds)),[y,p]=G.useState(String(u.rateLimitRequestsPerMinute)),[z,S]=G.useState(String(u.rateLimitWindowSeconds)),[b,H]=G.useState(String(u.auditRetentionDays)),[M,_]=G.useState(String(u.maxAgentsPerTenant));function q(){c({tokenExpirySeconds:Number(o),rateLimitRequestsPerMinute:Number(y),rateLimitWindowSeconds:Number(z),auditRetentionDays:Number(b),maxAgentsPerTenant:Number(M)})}return i.jsxs("div",{className:"space-y-5",children:[i.jsx(Cc,{icon:i.jsx(Q1,{className:"w-4 h-4"}),title:"Database",description:"Connection information. Managed via environment variables.",children:i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[i.jsx(ho,{label:"Adapter",value:u.database.adapter}),i.jsx(ho,{label:"Version",value:u.database.version}),i.jsx(ho,{label:"Connection",value:u.database.url.replace(/:[^:@]+@/,":***@")})]})}),i.jsx(Cc,{icon:i.jsx(Hc,{className:"w-4 h-4"}),title:"Token Expiry",description:"Default lifetime for agent tokens before they must be rotated.",children:i.jsxs("div",{className:"max-w-xs",children:[i.jsxs(ht,{children:[i.jsx(Ue,{htmlFor:"token-expiry",children:"Expiry (seconds)"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(et,{id:"token-expiry",type:"number",min:60,max:31536e3,value:o,onChange:X=>f(X.target.value)}),i.jsxs("span",{className:"text-xs text-zinc-500 whitespace-nowrap flex-shrink-0",children:[Math.round(Number(o)/3600),"h"]})]})]}),i.jsx("p",{className:"text-[11px] text-zinc-500 mt-2",children:"Recommended: 3600 (1h) for automated agents, 86400 (24h) for service accounts."})]})}),i.jsxs(Cc,{icon:i.jsx(Hg,{className:"w-4 h-4"}),title:"Rate Limits",description:"Default rate limiting applied to all agents unless overridden by permission constraints.",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-md",children:[i.jsxs(ht,{children:[i.jsx(Ue,{htmlFor:"rate-limit-requests",children:"Requests per window"}),i.jsx(et,{id:"rate-limit-requests",type:"number",min:1,value:y,onChange:X=>p(X.target.value)})]}),i.jsxs(ht,{children:[i.jsx(Ue,{htmlFor:"rate-limit-window",children:"Window (seconds)"}),i.jsx(et,{id:"rate-limit-window",type:"number",min:1,value:z,onChange:X=>S(X.target.value)})]})]}),i.jsxs("p",{className:"text-[11px] text-zinc-500 mt-2",children:["Current: ",y," requests per ",z,"s window."]})]}),i.jsxs(Cc,{icon:i.jsx(S1,{className:"w-4 h-4"}),title:"Audit Retention",description:"How long audit log entries are retained before automatic deletion.",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-md",children:[i.jsxs(ht,{children:[i.jsx(Ue,{htmlFor:"audit-retention",children:"Retention (days)"}),i.jsx(et,{id:"audit-retention",type:"number",min:1,max:3650,value:b,onChange:X=>H(X.target.value)})]}),i.jsxs(ht,{children:[i.jsx(Ue,{htmlFor:"max-agents",children:"Max agents per tenant"}),i.jsx(et,{id:"max-agents",type:"number",min:1,value:M,onChange:X=>_(X.target.value)})]})]}),i.jsx("p",{className:"text-[11px] text-zinc-500 mt-2",children:"EU AI Act Article 12 requires minimum 90 days. SOC 2 recommends 365+ days."})]}),i.jsx("div",{className:"flex justify-end pt-2",children:i.jsxs(Fe,{variant:"primary",onClick:q,loading:r,children:[i.jsx(gg,{className:"w-3.5 h-3.5"}),"Save Settings"]})})]})}function Kp({client:u}){const c=In(),{data:r,isLoading:o}=rt({queryKey:["settings"],queryFn:()=>u.getSettings()}),f=Ua({mutationFn:y=>u.updateSettings(y),onSuccess:y=>{y.success&&c.invalidateQueries({queryKey:["settings"]})}});return i.jsxs("div",{children:[i.jsx(Ha,{title:"Settings",description:"System configuration and operational parameters."}),o?i.jsx("div",{className:"flex items-center justify-center py-16",children:i.jsx("div",{className:"w-5 h-5 border-2 border-zinc-300 dark:border-zinc-700 border-t-amber-500 rounded-full animate-spin"})}):r!=null&&r.success?i.jsx(Xp,{settings:r.data,onSave:y=>f.mutate(y),loading:f.isPending}):i.jsxs("div",{className:"bg-red-950/30 border border-red-800/50 rounded-xl p-5",children:[i.jsx("p",{className:"text-sm text-red-400",children:"Failed to load settings. Check that your KavachOS API is reachable."}),r&&!r.success&&i.jsxs("p",{className:"text-xs text-red-500 mt-1 font-mono",children:[r.error.code,": ",r.error.message]})]})]})}function Zp({client:u,onNavigate:c}){const{data:r,isLoading:o}=rt({queryKey:["users"],queryFn:()=>u.getUsers()}),f=r!=null&&r.success?r.data:[];return i.jsxs("div",{children:[i.jsx(Ha,{title:"Users",description:"Users who own agent identities in this system."}),o?i.jsx("div",{className:"flex items-center justify-center py-16",children:i.jsx("div",{className:"w-5 h-5 border-2 border-zinc-300 dark:border-zinc-700 border-t-amber-500 rounded-full animate-spin"})}):f.length===0?i.jsxs(Qt,{children:[i.jsxs(Lt,{children:[i.jsx(Y,{children:"ID"}),i.jsx(Y,{children:"Email"}),i.jsx(Y,{children:"Name"}),i.jsx(Y,{children:"Agents"}),i.jsx(Y,{children:"Created"})]}),i.jsx(Bt,{children:i.jsx("tr",{children:i.jsx("td",{colSpan:5,children:i.jsx(el,{icon:i.jsx(Ho,{className:"w-6 h-6"}),title:"No users found",description:"Users will appear here once agents are created."})})})})]}):i.jsxs(Qt,{children:[i.jsxs(Lt,{children:[i.jsx(Y,{children:"ID"}),i.jsx(Y,{children:"Email"}),i.jsx(Y,{children:"Name"}),i.jsx(Y,{children:"Agents"}),i.jsx(Y,{children:"Created"})]}),i.jsx(Bt,{children:f.map(y=>i.jsxs(Pn,{children:[i.jsx(de,{children:i.jsx("code",{className:"text-xs font-mono text-zinc-500",children:y.id})}),i.jsx(de,{children:i.jsx("span",{className:"text-xs text-zinc-800 dark:text-zinc-200",children:y.email})}),i.jsx(de,{children:i.jsx("span",{className:"text-xs text-zinc-400",children:y.name??"—"})}),i.jsx(de,{children:i.jsx("button",{type:"button",onClick:()=>c("agents"),className:"inline-flex","aria-label":`View agents for ${y.email}`,children:i.jsx(ea,{variant:y.agentCount>0?"gold":"gray",children:y.agentCount})})}),i.jsx(de,{children:i.jsx("span",{className:"text-xs text-zinc-500",children:new Date(y.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})})})]},y.id))})]})]})}const Vp=new a1({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}}});function Jp({apiUrl:u,onLogout:c,demo:r}){const[o,f]=G.useState("overview"),y=G.useMemo(()=>y1(u),[u]);function p(){switch(o){case"overview":return i.jsx(Dp,{client:y,onNavigate:f});case"agents":return i.jsx(mp,{client:y});case"users":return i.jsx(Zp,{client:y,onNavigate:f});case"audit":return i.jsx(zp,{client:y});case"permissions":return i.jsx(Bp,{client:y});case"delegations":return i.jsx(Ep,{client:y});case"mcp-servers":return i.jsx(Mp,{client:y});case"security":return i.jsx(Gp,{client:y});case"settings":return i.jsx(Kp,{client:y})}}return i.jsx(Fg,{currentPage:o,onNavigate:f,headerActions:i.jsx(Bg,{onLogout:c}),demo:r,children:p()})}const Fp="kavachos-theme";function $p({apiUrl:u,theme:c="dark",demo:r}){return G.useEffect(()=>{const o=localStorage.getItem(Fp);(o!==null?o==="dark":c==="dark"||window.matchMedia("(prefers-color-scheme: dark)").matches)?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[c]),i.jsx("div",{"data-kavachos-dashboard":!0,children:i.jsx(Yg,{apiUrl:u,children:o=>i.jsx(n1,{client:Vp,children:i.jsx(ep,{children:i.jsx(Jp,{apiUrl:u,onLogout:o,demo:r})})})})})}const Im=document.getElementById("root");if(!Im)throw new Error("Root element #root not found");_v.createRoot(Im).render(i.jsx(G.StrictMode,{children:i.jsx($p,{apiUrl:"http://localhost:3000",theme:"dark"})}));