@opentrust/dashboard 7.3.28 → 7.3.30

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,403 @@
1
+ function Z1(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function Gc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xp={exports:{}},Xa={},yp={exports:{}},oe={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its 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 Vo=Symbol.for("react.element"),J1=Symbol.for("react.portal"),ew=Symbol.for("react.fragment"),tw=Symbol.for("react.strict_mode"),nw=Symbol.for("react.profiler"),rw=Symbol.for("react.provider"),sw=Symbol.for("react.context"),ow=Symbol.for("react.forward_ref"),iw=Symbol.for("react.suspense"),aw=Symbol.for("react.memo"),lw=Symbol.for("react.lazy"),$f=Symbol.iterator;function uw(e){return e===null||typeof e!="object"?null:(e=$f&&e[$f]||e["@@iterator"],typeof e=="function"?e:null)}var vp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wp=Object.assign,Np={};function js(e,t,n){this.props=e,this.context=t,this.refs=Np,this.updater=n||vp}js.prototype.isReactComponent={};js.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};js.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Sp(){}Sp.prototype=js.prototype;function Yc(e,t,n){this.props=e,this.context=t,this.refs=Np,this.updater=n||vp}var Xc=Yc.prototype=new Sp;Xc.constructor=Yc;wp(Xc,js.prototype);Xc.isPureReactComponent=!0;var Of=Array.isArray,bp=Object.prototype.hasOwnProperty,Qc={current:null},jp={key:!0,ref:!0,__self:!0,__source:!0};function kp(e,t,n){var r,s={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)bp.call(t,r)&&!jp.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];s.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:Vo,type:e,key:o,ref:i,props:s,_owner:Qc.current}}function cw(e,t){return{$$typeof:Vo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function qc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Vo}function dw(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ff=/\/+/g;function $l(e,t){return typeof e=="object"&&e!==null&&e.key!=null?dw(""+e.key):t.toString(36)}function Fi(e,t,n,r,s){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(o){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Vo:case J1:i=!0}}if(i)return i=e,s=s(i),e=r===""?"."+$l(i,0):r,Of(s)?(n="",e!=null&&(n=e.replace(Ff,"$&/")+"/"),Fi(s,t,n,"",function(c){return c})):s!=null&&(qc(s)&&(s=cw(s,n+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(Ff,"$&/")+"/")+e)),t.push(s)),1;if(i=0,r=r===""?".":r+":",Of(e))for(var l=0;l<e.length;l++){o=e[l];var u=r+$l(o,l);i+=Fi(o,t,n,u,s)}else if(u=uw(e),typeof u=="function")for(e=u.call(e),l=0;!(o=e.next()).done;)o=o.value,u=r+$l(o,l++),i+=Fi(o,t,n,u,s);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function ii(e,t,n){if(e==null)return e;var r=[],s=0;return Fi(e,r,"","",function(o){return t.call(n,o,s++)}),r}function fw(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Je={current:null},Hi={transition:null},hw={ReactCurrentDispatcher:Je,ReactCurrentBatchConfig:Hi,ReactCurrentOwner:Qc};oe.Children={map:ii,forEach:function(e,t,n){ii(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ii(e,function(){t++}),t},toArray:function(e){return ii(e,function(t){return t})||[]},only:function(e){if(!qc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};oe.Component=js;oe.Fragment=ew;oe.Profiler=nw;oe.PureComponent=Yc;oe.StrictMode=tw;oe.Suspense=iw;oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hw;oe.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=wp({},e.props),s=e.key,o=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,i=Qc.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)bp.call(t,u)&&!jp.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){l=Array(u);for(var c=0;c<u;c++)l[c]=arguments[c+2];r.children=l}return{$$typeof:Vo,type:e.type,key:s,ref:o,props:r,_owner:i}};oe.createContext=function(e){return e={$$typeof:sw,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:rw,_context:e},e.Consumer=e};oe.createElement=kp;oe.createFactory=function(e){var t=kp.bind(null,e);return t.type=e,t};oe.createRef=function(){return{current:null}};oe.forwardRef=function(e){return{$$typeof:ow,render:e}};oe.isValidElement=qc;oe.lazy=function(e){return{$$typeof:lw,_payload:{_status:-1,_result:e},_init:fw}};oe.memo=function(e,t){return{$$typeof:aw,type:e,compare:t===void 0?null:t}};oe.startTransition=function(e){var t=Hi.transition;Hi.transition={};try{e()}finally{Hi.transition=t}};oe.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};oe.useCallback=function(e,t){return Je.current.useCallback(e,t)};oe.useContext=function(e){return Je.current.useContext(e)};oe.useDebugValue=function(){};oe.useDeferredValue=function(e){return Je.current.useDeferredValue(e)};oe.useEffect=function(e,t){return Je.current.useEffect(e,t)};oe.useId=function(){return Je.current.useId()};oe.useImperativeHandle=function(e,t,n){return Je.current.useImperativeHandle(e,t,n)};oe.useInsertionEffect=function(e,t){return Je.current.useInsertionEffect(e,t)};oe.useLayoutEffect=function(e,t){return Je.current.useLayoutEffect(e,t)};oe.useMemo=function(e,t){return Je.current.useMemo(e,t)};oe.useReducer=function(e,t,n){return Je.current.useReducer(e,t,n)};oe.useRef=function(e){return Je.current.useRef(e)};oe.useState=function(e){return Je.current.useState(e)};oe.useSyncExternalStore=function(e,t,n){return Je.current.useSyncExternalStore(e,t,n)};oe.useTransition=function(){return Je.current.useTransition()};oe.version="18.3.0";yp.exports=oe;var m=yp.exports;const Ut=Gc(m),mw=Z1({__proto__:null,default:Ut},[m]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its 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 pw=m,gw=Symbol.for("react.element"),xw=Symbol.for("react.fragment"),yw=Object.prototype.hasOwnProperty,vw=pw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ww={key:!0,ref:!0,__self:!0,__source:!0};function Cp(e,t,n){var r,s={},o=null,i=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)yw.call(t,r)&&!ww.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:gw,type:e,key:o,ref:i,props:s,_owner:vw.current}}Xa.Fragment=xw;Xa.jsx=Cp;Xa.jsxs=Cp;xp.exports=Xa;var a=xp.exports,Iu={},Ep={exports:{}},xt={},_p={exports:{}},Pp={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its 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
+ */(function(e){function t(_,M){var A=_.length;_.push(M);e:for(;0<A;){var F=A-1>>>1,O=_[F];if(0<s(O,M))_[F]=M,_[A]=O,A=F;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var M=_[0],A=_.pop();if(A!==M){_[0]=A;e:for(var F=0,O=_.length,U=O>>>1;F<U;){var V=2*(F+1)-1,G=_[V],Y=V+1,X=_[Y];if(0>s(G,A))Y<O&&0>s(X,G)?(_[F]=X,_[Y]=A,F=Y):(_[F]=G,_[V]=A,F=V);else if(Y<O&&0>s(X,A))_[F]=X,_[Y]=A,F=Y;else break e}}return M}function s(_,M){var A=_.sortIndex-M.sortIndex;return A!==0?A:_.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var u=[],c=[],h=1,d=null,f=3,g=!1,x=!1,w=!1,N=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(_){for(var M=n(c);M!==null;){if(M.callback===null)r(c);else if(M.startTime<=_)r(c),M.sortIndex=M.expirationTime,t(u,M);else break;M=n(c)}}function S(_){if(w=!1,y(_),!x)if(n(u)!==null)x=!0,k(b);else{var M=n(c);M!==null&&z(S,M.startTime-_)}}function b(_,M){x=!1,w&&(w=!1,p(P),P=-1),g=!0;var A=f;try{for(y(M),d=n(u);d!==null&&(!(d.expirationTime>M)||_&&!R());){var F=d.callback;if(typeof F=="function"){d.callback=null,f=d.priorityLevel;var O=F(d.expirationTime<=M);M=e.unstable_now(),typeof O=="function"?d.callback=O:d===n(u)&&r(u),y(M)}else r(u);d=n(u)}if(d!==null)var U=!0;else{var V=n(c);V!==null&&z(S,V.startTime-M),U=!1}return U}finally{d=null,f=A,g=!1}}var C=!1,j=null,P=-1,I=5,$=-1;function R(){return!(e.unstable_now()-$<I)}function T(){if(j!==null){var _=e.unstable_now();$=_;var M=!0;try{M=j(!0,_)}finally{M?D():(C=!1,j=null)}}else C=!1}var D;if(typeof v=="function")D=function(){v(T)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,L=E.port2;E.port1.onmessage=T,D=function(){L.postMessage(null)}}else D=function(){N(T,0)};function k(_){j=_,C||(C=!0,D())}function z(_,M){P=N(function(){_(e.unstable_now())},M)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(_){_.callback=null},e.unstable_continueExecution=function(){x||g||(x=!0,k(b))},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(_){switch(f){case 1:case 2:case 3:var M=3;break;default:M=f}var A=f;f=M;try{return _()}finally{f=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,M){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var A=f;f=_;try{return M()}finally{f=A}},e.unstable_scheduleCallback=function(_,M,A){var F=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?F+A:F):A=F,_){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=A+O,_={id:h++,callback:M,priorityLevel:_,startTime:A,expirationTime:O,sortIndex:-1},A>F?(_.sortIndex=A,t(c,_),n(u)===null&&_===n(c)&&(w?(p(P),P=-1):w=!0,z(S,A-F))):(_.sortIndex=O,t(u,_),x||g||(x=!0,k(b))),_},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(_){var M=f;return function(){var A=f;f=M;try{return _.apply(this,arguments)}finally{f=A}}}})(Pp);_p.exports=Pp;var Nw=_p.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its 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 Sw=m,mt=Nw;function H(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);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."}var Mp=new Set,po={};function Er(e,t){as(e,t),as(e+"Capture",t)}function as(e,t){for(po[e]=t,e=0;e<t.length;e++)Mp.add(t[e])}var mn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ru=Object.prototype.hasOwnProperty,bw=/^[: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]*$/,Hf={},Bf={};function jw(e){return Ru.call(Bf,e)?!0:Ru.call(Hf,e)?!1:bw.test(e)?Bf[e]=!0:(Hf[e]=!0,!1)}function kw(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Cw(e,t,n,r){if(t===null||typeof t>"u"||kw(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function et(e,t,n,r,s,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var Ve={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ve[e]=new et(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ve[t]=new et(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ve[e]=new et(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ve[e]=new et(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ve[e]=new et(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ve[e]=new et(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ve[e]=new et(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ve[e]=new et(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ve[e]=new et(e,5,!1,e.toLowerCase(),null,!1,!1)});var Zc=/[\-:]([a-z])/g;function Jc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Zc,Jc);Ve[t]=new et(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Zc,Jc);Ve[t]=new et(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Zc,Jc);Ve[t]=new et(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ve[e]=new et(e,1,!1,e.toLowerCase(),null,!1,!1)});Ve.xlinkHref=new et("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ve[e]=new et(e,1,!1,e.toLowerCase(),null,!0,!0)});function ed(e,t,n,r){var s=Ve.hasOwnProperty(t)?Ve[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Cw(t,n,s,r)&&(n=null),r||s===null?jw(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var vn=Sw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ai=Symbol.for("react.element"),$r=Symbol.for("react.portal"),Or=Symbol.for("react.fragment"),td=Symbol.for("react.strict_mode"),Tu=Symbol.for("react.profiler"),Ip=Symbol.for("react.provider"),Rp=Symbol.for("react.context"),nd=Symbol.for("react.forward_ref"),Lu=Symbol.for("react.suspense"),Au=Symbol.for("react.suspense_list"),rd=Symbol.for("react.memo"),_n=Symbol.for("react.lazy"),Tp=Symbol.for("react.offscreen"),Vf=Symbol.iterator;function zs(e){return e===null||typeof e!="object"?null:(e=Vf&&e[Vf]||e["@@iterator"],typeof e=="function"?e:null)}var Ce=Object.assign,Ol;function Qs(e){if(Ol===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ol=t&&t[1]||""}return`
34
+ `+Ol+e}var Fl=!1;function Hl(e,t){if(!e||Fl)return"";Fl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.stack.split(`
35
+ `),o=r.stack.split(`
36
+ `),i=s.length-1,l=o.length-1;1<=i&&0<=l&&s[i]!==o[l];)l--;for(;1<=i&&0<=l;i--,l--)if(s[i]!==o[l]){if(i!==1||l!==1)do if(i--,l--,0>l||s[i]!==o[l]){var u=`
37
+ `+s[i].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=i&&0<=l);break}}}finally{Fl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Qs(e):""}function Ew(e){switch(e.tag){case 5:return Qs(e.type);case 16:return Qs("Lazy");case 13:return Qs("Suspense");case 19:return Qs("SuspenseList");case 0:case 2:case 15:return e=Hl(e.type,!1),e;case 11:return e=Hl(e.type.render,!1),e;case 1:return e=Hl(e.type,!0),e;default:return""}}function zu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Or:return"Fragment";case $r:return"Portal";case Tu:return"Profiler";case td:return"StrictMode";case Lu:return"Suspense";case Au:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Rp:return(e.displayName||"Context")+".Consumer";case Ip:return(e._context.displayName||"Context")+".Provider";case nd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case rd:return t=e.displayName||null,t!==null?t:zu(e.type)||"Memo";case _n:t=e._payload,e=e._init;try{return zu(e(t))}catch{}}return null}function _w(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return zu(t);case 8:return t===td?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Un(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Lp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Pw(e){var t=Lp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function li(e){e._valueTracker||(e._valueTracker=Pw(e))}function Ap(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Lp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function la(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}}function Du(e,t){var n=t.checked;return Ce({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Uf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Un(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function zp(e,t){t=t.checked,t!=null&&ed(e,"checked",t,!1)}function $u(e,t){zp(e,t);var n=Un(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ou(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ou(e,t.type,Un(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ou(e,t,n){(t!=="number"||la(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var qs=Array.isArray;function Zr(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Un(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Fu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return Ce({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Kf(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(H(92));if(qs(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Un(n)}}function Dp(e,t){var n=Un(t.value),r=Un(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Gf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function $p(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Hu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?$p(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ui,Op=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ui=ui||document.createElement("div"),ui.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ui.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function go(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var no={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Mw=["Webkit","ms","Moz","O"];Object.keys(no).forEach(function(e){Mw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),no[t]=no[e]})});function Fp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||no.hasOwnProperty(e)&&no[e]?(""+t).trim():t+"px"}function Hp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Fp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var Iw=Ce({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Bu(e,t){if(t){if(Iw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function Vu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Uu=null;function sd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wu=null,Jr=null,es=null;function Yf(e){if(e=Ko(e)){if(typeof Wu!="function")throw Error(H(280));var t=e.stateNode;t&&(t=el(t),Wu(e.stateNode,e.type,t))}}function Bp(e){Jr?es?es.push(e):es=[e]:Jr=e}function Vp(){if(Jr){var e=Jr,t=es;if(es=Jr=null,Yf(e),t)for(e=0;e<t.length;e++)Yf(t[e])}}function Up(e,t){return e(t)}function Wp(){}var Bl=!1;function Kp(e,t,n){if(Bl)return e(t,n);Bl=!0;try{return Up(e,t,n)}finally{Bl=!1,(Jr!==null||es!==null)&&(Wp(),Vp())}}function xo(e,t){var n=e.stateNode;if(n===null)return null;var r=el(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(H(231,t,typeof n));return n}var Ku=!1;if(mn)try{var Ds={};Object.defineProperty(Ds,"passive",{get:function(){Ku=!0}}),window.addEventListener("test",Ds,Ds),window.removeEventListener("test",Ds,Ds)}catch{Ku=!1}function Rw(e,t,n,r,s,o,i,l,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(h){this.onError(h)}}var ro=!1,ua=null,ca=!1,Gu=null,Tw={onError:function(e){ro=!0,ua=e}};function Lw(e,t,n,r,s,o,i,l,u){ro=!1,ua=null,Rw.apply(Tw,arguments)}function Aw(e,t,n,r,s,o,i,l,u){if(Lw.apply(this,arguments),ro){if(ro){var c=ua;ro=!1,ua=null}else throw Error(H(198));ca||(ca=!0,Gu=c)}}function _r(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Gp(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 Xf(e){if(_r(e)!==e)throw Error(H(188))}function zw(e){var t=e.alternate;if(!t){if(t=_r(e),t===null)throw Error(H(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var o=s.alternate;if(o===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===n)return Xf(s),e;if(o===r)return Xf(s),t;o=o.sibling}throw Error(H(188))}if(n.return!==r.return)n=s,r=o;else{for(var i=!1,l=s.child;l;){if(l===n){i=!0,n=s,r=o;break}if(l===r){i=!0,r=s,n=o;break}l=l.sibling}if(!i){for(l=o.child;l;){if(l===n){i=!0,n=o,r=s;break}if(l===r){i=!0,r=o,n=s;break}l=l.sibling}if(!i)throw Error(H(189))}}if(n.alternate!==r)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?e:t}function Yp(e){return e=zw(e),e!==null?Xp(e):null}function Xp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Xp(e);if(t!==null)return t;e=e.sibling}return null}var Qp=mt.unstable_scheduleCallback,Qf=mt.unstable_cancelCallback,Dw=mt.unstable_shouldYield,$w=mt.unstable_requestPaint,_e=mt.unstable_now,Ow=mt.unstable_getCurrentPriorityLevel,od=mt.unstable_ImmediatePriority,qp=mt.unstable_UserBlockingPriority,da=mt.unstable_NormalPriority,Fw=mt.unstable_LowPriority,Zp=mt.unstable_IdlePriority,Qa=null,Yt=null;function Hw(e){if(Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(Qa,e,void 0,(e.current.flags&128)===128)}catch{}}var At=Math.clz32?Math.clz32:Uw,Bw=Math.log,Vw=Math.LN2;function Uw(e){return e>>>=0,e===0?32:31-(Bw(e)/Vw|0)|0}var ci=64,di=4194304;function Zs(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function fa(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var l=i&~s;l!==0?r=Zs(l):(o&=i,o!==0&&(r=Zs(o)))}else i=n&~s,i!==0?r=Zs(i):o!==0&&(r=Zs(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-At(t),s=1<<n,r|=e[n],t&=~s;return r}function Ww(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Kw(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-At(o),l=1<<i,u=s[i];u===-1?(!(l&n)||l&r)&&(s[i]=Ww(l,t)):u<=t&&(e.expiredLanes|=l),o&=~l}}function Yu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Jp(){var e=ci;return ci<<=1,!(ci&4194240)&&(ci=64),e}function Vl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Uo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-At(t),e[t]=n}function Gw(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-At(n),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function id(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-At(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var de=0;function eg(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var tg,ad,ng,rg,sg,Xu=!1,fi=[],An=null,zn=null,Dn=null,yo=new Map,vo=new Map,Mn=[],Yw="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 submit".split(" ");function qf(e,t){switch(e){case"focusin":case"focusout":An=null;break;case"dragenter":case"dragleave":zn=null;break;case"mouseover":case"mouseout":Dn=null;break;case"pointerover":case"pointerout":yo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vo.delete(t.pointerId)}}function $s(e,t,n,r,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[s]},t!==null&&(t=Ko(t),t!==null&&ad(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Xw(e,t,n,r,s){switch(t){case"focusin":return An=$s(An,e,t,n,r,s),!0;case"dragenter":return zn=$s(zn,e,t,n,r,s),!0;case"mouseover":return Dn=$s(Dn,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return yo.set(o,$s(yo.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,vo.set(o,$s(vo.get(o)||null,e,t,n,r,s)),!0}return!1}function og(e){var t=ar(e.target);if(t!==null){var n=_r(t);if(n!==null){if(t=n.tag,t===13){if(t=Gp(n),t!==null){e.blockedOn=t,sg(e.priority,function(){ng(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Bi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Qu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Uu=r,n.target.dispatchEvent(r),Uu=null}else return t=Ko(n),t!==null&&ad(t),e.blockedOn=n,!1;t.shift()}return!0}function Zf(e,t,n){Bi(e)&&n.delete(t)}function Qw(){Xu=!1,An!==null&&Bi(An)&&(An=null),zn!==null&&Bi(zn)&&(zn=null),Dn!==null&&Bi(Dn)&&(Dn=null),yo.forEach(Zf),vo.forEach(Zf)}function Os(e,t){e.blockedOn===t&&(e.blockedOn=null,Xu||(Xu=!0,mt.unstable_scheduleCallback(mt.unstable_NormalPriority,Qw)))}function wo(e){function t(s){return Os(s,e)}if(0<fi.length){Os(fi[0],e);for(var n=1;n<fi.length;n++){var r=fi[n];r.blockedOn===e&&(r.blockedOn=null)}}for(An!==null&&Os(An,e),zn!==null&&Os(zn,e),Dn!==null&&Os(Dn,e),yo.forEach(t),vo.forEach(t),n=0;n<Mn.length;n++)r=Mn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Mn.length&&(n=Mn[0],n.blockedOn===null);)og(n),n.blockedOn===null&&Mn.shift()}var ts=vn.ReactCurrentBatchConfig,ha=!0;function qw(e,t,n,r){var s=de,o=ts.transition;ts.transition=null;try{de=1,ld(e,t,n,r)}finally{de=s,ts.transition=o}}function Zw(e,t,n,r){var s=de,o=ts.transition;ts.transition=null;try{de=4,ld(e,t,n,r)}finally{de=s,ts.transition=o}}function ld(e,t,n,r){if(ha){var s=Qu(e,t,n,r);if(s===null)Jl(e,t,r,ma,n),qf(e,r);else if(Xw(s,e,t,n,r))r.stopPropagation();else if(qf(e,r),t&4&&-1<Yw.indexOf(e)){for(;s!==null;){var o=Ko(s);if(o!==null&&tg(o),o=Qu(e,t,n,r),o===null&&Jl(e,t,r,ma,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else Jl(e,t,r,null,n)}}var ma=null;function Qu(e,t,n,r){if(ma=null,e=sd(r),e=ar(e),e!==null)if(t=_r(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Gp(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ma=e,null}function ig(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ow()){case od:return 1;case qp:return 4;case da:case Fw:return 16;case Zp:return 536870912;default:return 16}default:return 16}}var Tn=null,ud=null,Vi=null;function ag(){if(Vi)return Vi;var e,t=ud,n=t.length,r,s="value"in Tn?Tn.value:Tn.textContent,o=s.length;for(e=0;e<n&&t[e]===s[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===s[o-r];r++);return Vi=s.slice(e,1<r?1-r:void 0)}function Ui(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 hi(){return!0}function Jf(){return!1}function yt(e){function t(n,r,s,o,i){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?hi:Jf,this.isPropagationStopped=Jf,this}return Ce(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=hi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=hi)},persist:function(){},isPersistent:hi}),t}var ks={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cd=yt(ks),Wo=Ce({},ks,{view:0,detail:0}),Jw=yt(Wo),Ul,Wl,Fs,qa=Ce({},Wo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dd,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!==Fs&&(Fs&&e.type==="mousemove"?(Ul=e.screenX-Fs.screenX,Wl=e.screenY-Fs.screenY):Wl=Ul=0,Fs=e),Ul)},movementY:function(e){return"movementY"in e?e.movementY:Wl}}),eh=yt(qa),eN=Ce({},qa,{dataTransfer:0}),tN=yt(eN),nN=Ce({},Wo,{relatedTarget:0}),Kl=yt(nN),rN=Ce({},ks,{animationName:0,elapsedTime:0,pseudoElement:0}),sN=yt(rN),oN=Ce({},ks,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),iN=yt(oN),aN=Ce({},ks,{data:0}),th=yt(aN),lN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},uN={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"},cN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dN(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=cN[e])?!!t[e]:!1}function dd(){return dN}var fN=Ce({},Wo,{key:function(e){if(e.key){var t=lN[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ui(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?uN[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dd,charCode:function(e){return e.type==="keypress"?Ui(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ui(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hN=yt(fN),mN=Ce({},qa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nh=yt(mN),pN=Ce({},Wo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dd}),gN=yt(pN),xN=Ce({},ks,{propertyName:0,elapsedTime:0,pseudoElement:0}),yN=yt(xN),vN=Ce({},qa,{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}),wN=yt(vN),NN=[9,13,27,32],fd=mn&&"CompositionEvent"in window,so=null;mn&&"documentMode"in document&&(so=document.documentMode);var SN=mn&&"TextEvent"in window&&!so,lg=mn&&(!fd||so&&8<so&&11>=so),rh=" ",sh=!1;function ug(e,t){switch(e){case"keyup":return NN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fr=!1;function bN(e,t){switch(e){case"compositionend":return cg(t);case"keypress":return t.which!==32?null:(sh=!0,rh);case"textInput":return e=t.data,e===rh&&sh?null:e;default:return null}}function jN(e,t){if(Fr)return e==="compositionend"||!fd&&ug(e,t)?(e=ag(),Vi=ud=Tn=null,Fr=!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 lg&&t.locale!=="ko"?null:t.data;default:return null}}var kN={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 oh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!kN[e.type]:t==="textarea"}function dg(e,t,n,r){Bp(r),t=pa(t,"onChange"),0<t.length&&(n=new cd("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var oo=null,No=null;function CN(e){Sg(e,0)}function Za(e){var t=Vr(e);if(Ap(t))return e}function EN(e,t){if(e==="change")return t}var fg=!1;if(mn){var Gl;if(mn){var Yl="oninput"in document;if(!Yl){var ih=document.createElement("div");ih.setAttribute("oninput","return;"),Yl=typeof ih.oninput=="function"}Gl=Yl}else Gl=!1;fg=Gl&&(!document.documentMode||9<document.documentMode)}function ah(){oo&&(oo.detachEvent("onpropertychange",hg),No=oo=null)}function hg(e){if(e.propertyName==="value"&&Za(No)){var t=[];dg(t,No,e,sd(e)),Kp(CN,t)}}function _N(e,t,n){e==="focusin"?(ah(),oo=t,No=n,oo.attachEvent("onpropertychange",hg)):e==="focusout"&&ah()}function PN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Za(No)}function MN(e,t){if(e==="click")return Za(t)}function IN(e,t){if(e==="input"||e==="change")return Za(t)}function RN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dt=typeof Object.is=="function"?Object.is:RN;function So(e,t){if(Dt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!Ru.call(t,s)||!Dt(e[s],t[s]))return!1}return!0}function lh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function uh(e,t){var n=lh(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=lh(n)}}function mg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pg(){for(var e=window,t=la();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=la(e.document)}return t}function hd(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")}function TN(e){var t=pg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&mg(n.ownerDocument.documentElement,n)){if(r!==null&&hd(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=uh(n,o);var i=uh(n,r);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var LN=mn&&"documentMode"in document&&11>=document.documentMode,Hr=null,qu=null,io=null,Zu=!1;function ch(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Zu||Hr==null||Hr!==la(r)||(r=Hr,"selectionStart"in r&&hd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),io&&So(io,r)||(io=r,r=pa(qu,"onSelect"),0<r.length&&(t=new cd("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Hr)))}function mi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Br={animationend:mi("Animation","AnimationEnd"),animationiteration:mi("Animation","AnimationIteration"),animationstart:mi("Animation","AnimationStart"),transitionend:mi("Transition","TransitionEnd")},Xl={},gg={};mn&&(gg=document.createElement("div").style,"AnimationEvent"in window||(delete Br.animationend.animation,delete Br.animationiteration.animation,delete Br.animationstart.animation),"TransitionEvent"in window||delete Br.transitionend.transition);function Ja(e){if(Xl[e])return Xl[e];if(!Br[e])return e;var t=Br[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in gg)return Xl[e]=t[n];return e}var xg=Ja("animationend"),yg=Ja("animationiteration"),vg=Ja("animationstart"),wg=Ja("transitionend"),Ng=new Map,dh="abort auxClick 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(" ");function qn(e,t){Ng.set(e,t),Er(t,[e])}for(var Ql=0;Ql<dh.length;Ql++){var ql=dh[Ql],AN=ql.toLowerCase(),zN=ql[0].toUpperCase()+ql.slice(1);qn(AN,"on"+zN)}qn(xg,"onAnimationEnd");qn(yg,"onAnimationIteration");qn(vg,"onAnimationStart");qn("dblclick","onDoubleClick");qn("focusin","onFocus");qn("focusout","onBlur");qn(wg,"onTransitionEnd");as("onMouseEnter",["mouseout","mouseover"]);as("onMouseLeave",["mouseout","mouseover"]);as("onPointerEnter",["pointerout","pointerover"]);as("onPointerLeave",["pointerout","pointerover"]);Er("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Er("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Er("onBeforeInput",["compositionend","keypress","textInput","paste"]);Er("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Er("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Er("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Js="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(" "),DN=new Set("cancel close invalid load scroll toggle".split(" ").concat(Js));function fh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Aw(r,t,void 0,e),e.currentTarget=null}function Sg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],u=l.instance,c=l.currentTarget;if(l=l.listener,u!==o&&s.isPropagationStopped())break e;fh(s,l,c),o=u}else for(i=0;i<r.length;i++){if(l=r[i],u=l.instance,c=l.currentTarget,l=l.listener,u!==o&&s.isPropagationStopped())break e;fh(s,l,c),o=u}}}if(ca)throw e=Gu,ca=!1,Gu=null,e}function ge(e,t){var n=t[rc];n===void 0&&(n=t[rc]=new Set);var r=e+"__bubble";n.has(r)||(bg(t,e,2,!1),n.add(r))}function Zl(e,t,n){var r=0;t&&(r|=4),bg(n,e,r,t)}var pi="_reactListening"+Math.random().toString(36).slice(2);function bo(e){if(!e[pi]){e[pi]=!0,Mp.forEach(function(n){n!=="selectionchange"&&(DN.has(n)||Zl(n,!1,e),Zl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[pi]||(t[pi]=!0,Zl("selectionchange",!1,t))}}function bg(e,t,n,r){switch(ig(t)){case 1:var s=qw;break;case 4:s=Zw;break;default:s=ld}n=s.bind(null,t,n,e),s=void 0,!Ku||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Jl(e,t,n,r,s){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(i===4)for(i=r.return;i!==null;){var u=i.tag;if((u===3||u===4)&&(u=i.stateNode.containerInfo,u===s||u.nodeType===8&&u.parentNode===s))return;i=i.return}for(;l!==null;){if(i=ar(l),i===null)return;if(u=i.tag,u===5||u===6){r=o=i;continue e}l=l.parentNode}}r=r.return}Kp(function(){var c=o,h=sd(n),d=[];e:{var f=Ng.get(e);if(f!==void 0){var g=cd,x=e;switch(e){case"keypress":if(Ui(n)===0)break e;case"keydown":case"keyup":g=hN;break;case"focusin":x="focus",g=Kl;break;case"focusout":x="blur",g=Kl;break;case"beforeblur":case"afterblur":g=Kl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=eh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=tN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=gN;break;case xg:case yg:case vg:g=sN;break;case wg:g=yN;break;case"scroll":g=Jw;break;case"wheel":g=wN;break;case"copy":case"cut":case"paste":g=iN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=nh}var w=(t&4)!==0,N=!w&&e==="scroll",p=w?f!==null?f+"Capture":null:f;w=[];for(var v=c,y;v!==null;){y=v;var S=y.stateNode;if(y.tag===5&&S!==null&&(y=S,p!==null&&(S=xo(v,p),S!=null&&w.push(jo(v,S,y)))),N)break;v=v.return}0<w.length&&(f=new g(f,x,null,n,h),d.push({event:f,listeners:w}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",f&&n!==Uu&&(x=n.relatedTarget||n.fromElement)&&(ar(x)||x[pn]))break e;if((g||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,g?(x=n.relatedTarget||n.toElement,g=c,x=x?ar(x):null,x!==null&&(N=_r(x),x!==N||x.tag!==5&&x.tag!==6)&&(x=null)):(g=null,x=c),g!==x)){if(w=eh,S="onMouseLeave",p="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(w=nh,S="onPointerLeave",p="onPointerEnter",v="pointer"),N=g==null?f:Vr(g),y=x==null?f:Vr(x),f=new w(S,v+"leave",g,n,h),f.target=N,f.relatedTarget=y,S=null,ar(h)===c&&(w=new w(p,v+"enter",x,n,h),w.target=y,w.relatedTarget=N,S=w),N=S,g&&x)t:{for(w=g,p=x,v=0,y=w;y;y=Tr(y))v++;for(y=0,S=p;S;S=Tr(S))y++;for(;0<v-y;)w=Tr(w),v--;for(;0<y-v;)p=Tr(p),y--;for(;v--;){if(w===p||p!==null&&w===p.alternate)break t;w=Tr(w),p=Tr(p)}w=null}else w=null;g!==null&&hh(d,f,g,w,!1),x!==null&&N!==null&&hh(d,N,x,w,!0)}}e:{if(f=c?Vr(c):window,g=f.nodeName&&f.nodeName.toLowerCase(),g==="select"||g==="input"&&f.type==="file")var b=EN;else if(oh(f))if(fg)b=IN;else{b=PN;var C=_N}else(g=f.nodeName)&&g.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(b=MN);if(b&&(b=b(e,c))){dg(d,b,n,h);break e}C&&C(e,f,c),e==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&Ou(f,"number",f.value)}switch(C=c?Vr(c):window,e){case"focusin":(oh(C)||C.contentEditable==="true")&&(Hr=C,qu=c,io=null);break;case"focusout":io=qu=Hr=null;break;case"mousedown":Zu=!0;break;case"contextmenu":case"mouseup":case"dragend":Zu=!1,ch(d,n,h);break;case"selectionchange":if(LN)break;case"keydown":case"keyup":ch(d,n,h)}var j;if(fd)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Fr?ug(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(lg&&n.locale!=="ko"&&(Fr||P!=="onCompositionStart"?P==="onCompositionEnd"&&Fr&&(j=ag()):(Tn=h,ud="value"in Tn?Tn.value:Tn.textContent,Fr=!0)),C=pa(c,P),0<C.length&&(P=new th(P,e,null,n,h),d.push({event:P,listeners:C}),j?P.data=j:(j=cg(n),j!==null&&(P.data=j)))),(j=SN?bN(e,n):jN(e,n))&&(c=pa(c,"onBeforeInput"),0<c.length&&(h=new th("onBeforeInput","beforeinput",null,n,h),d.push({event:h,listeners:c}),h.data=j))}Sg(d,t)})}function jo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function pa(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=xo(e,n),o!=null&&r.unshift(jo(e,o,s)),o=xo(e,t),o!=null&&r.push(jo(e,o,s))),e=e.return}return r}function Tr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function hh(e,t,n,r,s){for(var o=t._reactName,i=[];n!==null&&n!==r;){var l=n,u=l.alternate,c=l.stateNode;if(u!==null&&u===r)break;l.tag===5&&c!==null&&(l=c,s?(u=xo(n,o),u!=null&&i.unshift(jo(n,u,l))):s||(u=xo(n,o),u!=null&&i.push(jo(n,u,l)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var $N=/\r\n?/g,ON=/\u0000|\uFFFD/g;function mh(e){return(typeof e=="string"?e:""+e).replace($N,`
38
+ `).replace(ON,"")}function gi(e,t,n){if(t=mh(t),mh(e)!==t&&n)throw Error(H(425))}function ga(){}var Ju=null,ec=null;function tc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var nc=typeof setTimeout=="function"?setTimeout:void 0,FN=typeof clearTimeout=="function"?clearTimeout:void 0,ph=typeof Promise=="function"?Promise:void 0,HN=typeof queueMicrotask=="function"?queueMicrotask:typeof ph<"u"?function(e){return ph.resolve(null).then(e).catch(BN)}:nc;function BN(e){setTimeout(function(){throw e})}function eu(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),wo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);wo(t)}function $n(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==="$?")break;if(t==="/$")return null}}return e}function gh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Cs=Math.random().toString(36).slice(2),Kt="__reactFiber$"+Cs,ko="__reactProps$"+Cs,pn="__reactContainer$"+Cs,rc="__reactEvents$"+Cs,VN="__reactListeners$"+Cs,UN="__reactHandles$"+Cs;function ar(e){var t=e[Kt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pn]||n[Kt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gh(e);e!==null;){if(n=e[Kt])return n;e=gh(e)}return t}e=n,n=e.parentNode}return null}function Ko(e){return e=e[Kt]||e[pn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Vr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function el(e){return e[ko]||null}var sc=[],Ur=-1;function Zn(e){return{current:e}}function xe(e){0>Ur||(e.current=sc[Ur],sc[Ur]=null,Ur--)}function fe(e,t){Ur++,sc[Ur]=e.current,e.current=t}var Wn={},Qe=Zn(Wn),at=Zn(!1),gr=Wn;function ls(e,t){var n=e.type.contextTypes;if(!n)return Wn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function lt(e){return e=e.childContextTypes,e!=null}function xa(){xe(at),xe(Qe)}function xh(e,t,n){if(Qe.current!==Wn)throw Error(H(168));fe(Qe,t),fe(at,n)}function jg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(H(108,_w(e)||"Unknown",s));return Ce({},n,r)}function ya(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wn,gr=Qe.current,fe(Qe,e),fe(at,at.current),!0}function yh(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=jg(e,t,gr),r.__reactInternalMemoizedMergedChildContext=e,xe(at),xe(Qe),fe(Qe,e)):xe(at),fe(at,n)}var ln=null,tl=!1,tu=!1;function kg(e){ln===null?ln=[e]:ln.push(e)}function WN(e){tl=!0,kg(e)}function Jn(){if(!tu&&ln!==null){tu=!0;var e=0,t=de;try{var n=ln;for(de=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ln=null,tl=!1}catch(s){throw ln!==null&&(ln=ln.slice(e+1)),Qp(od,Jn),s}finally{de=t,tu=!1}}return null}var Wr=[],Kr=0,va=null,wa=0,vt=[],wt=0,xr=null,un=1,cn="";function sr(e,t){Wr[Kr++]=wa,Wr[Kr++]=va,va=e,wa=t}function Cg(e,t,n){vt[wt++]=un,vt[wt++]=cn,vt[wt++]=xr,xr=e;var r=un;e=cn;var s=32-At(r)-1;r&=~(1<<s),n+=1;var o=32-At(t)+s;if(30<o){var i=s-s%5;o=(r&(1<<i)-1).toString(32),r>>=i,s-=i,un=1<<32-At(t)+s|n<<s|r,cn=o+e}else un=1<<o|n<<s|r,cn=e}function md(e){e.return!==null&&(sr(e,1),Cg(e,1,0))}function pd(e){for(;e===va;)va=Wr[--Kr],Wr[Kr]=null,wa=Wr[--Kr],Wr[Kr]=null;for(;e===xr;)xr=vt[--wt],vt[wt]=null,cn=vt[--wt],vt[wt]=null,un=vt[--wt],vt[wt]=null}var ht=null,ft=null,ve=!1,It=null;function Eg(e,t){var n=Nt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function vh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ht=e,ft=$n(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ht=e,ft=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=xr!==null?{id:un,overflow:cn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Nt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ht=e,ft=null,!0):!1;default:return!1}}function oc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ic(e){if(ve){var t=ft;if(t){var n=t;if(!vh(e,t)){if(oc(e))throw Error(H(418));t=$n(n.nextSibling);var r=ht;t&&vh(e,t)?Eg(r,n):(e.flags=e.flags&-4097|2,ve=!1,ht=e)}}else{if(oc(e))throw Error(H(418));e.flags=e.flags&-4097|2,ve=!1,ht=e}}}function wh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ht=e}function xi(e){if(e!==ht)return!1;if(!ve)return wh(e),ve=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!tc(e.type,e.memoizedProps)),t&&(t=ft)){if(oc(e))throw _g(),Error(H(418));for(;t;)Eg(e,t),t=$n(t.nextSibling)}if(wh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ft=$n(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ft=null}}else ft=ht?$n(e.stateNode.nextSibling):null;return!0}function _g(){for(var e=ft;e;)e=$n(e.nextSibling)}function us(){ft=ht=null,ve=!1}function gd(e){It===null?It=[e]:It.push(e)}var KN=vn.ReactCurrentBatchConfig;function Hs(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(H(309));var r=n.stateNode}if(!r)throw Error(H(147,e));var s=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(i){var l=s.refs;i===null?delete l[o]:l[o]=i},t._stringRef=o,t)}if(typeof e!="string")throw Error(H(284));if(!n._owner)throw Error(H(290,e))}return e}function yi(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Nh(e){var t=e._init;return t(e._payload)}function Pg(e){function t(p,v){if(e){var y=p.deletions;y===null?(p.deletions=[v],p.flags|=16):y.push(v)}}function n(p,v){if(!e)return null;for(;v!==null;)t(p,v),v=v.sibling;return null}function r(p,v){for(p=new Map;v!==null;)v.key!==null?p.set(v.key,v):p.set(v.index,v),v=v.sibling;return p}function s(p,v){return p=Bn(p,v),p.index=0,p.sibling=null,p}function o(p,v,y){return p.index=y,e?(y=p.alternate,y!==null?(y=y.index,y<v?(p.flags|=2,v):y):(p.flags|=2,v)):(p.flags|=1048576,v)}function i(p){return e&&p.alternate===null&&(p.flags|=2),p}function l(p,v,y,S){return v===null||v.tag!==6?(v=lu(y,p.mode,S),v.return=p,v):(v=s(v,y),v.return=p,v)}function u(p,v,y,S){var b=y.type;return b===Or?h(p,v,y.props.children,S,y.key):v!==null&&(v.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===_n&&Nh(b)===v.type)?(S=s(v,y.props),S.ref=Hs(p,v,y),S.return=p,S):(S=qi(y.type,y.key,y.props,null,p.mode,S),S.ref=Hs(p,v,y),S.return=p,S)}function c(p,v,y,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==y.containerInfo||v.stateNode.implementation!==y.implementation?(v=uu(y,p.mode,S),v.return=p,v):(v=s(v,y.children||[]),v.return=p,v)}function h(p,v,y,S,b){return v===null||v.tag!==7?(v=hr(y,p.mode,S,b),v.return=p,v):(v=s(v,y),v.return=p,v)}function d(p,v,y){if(typeof v=="string"&&v!==""||typeof v=="number")return v=lu(""+v,p.mode,y),v.return=p,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case ai:return y=qi(v.type,v.key,v.props,null,p.mode,y),y.ref=Hs(p,null,v),y.return=p,y;case $r:return v=uu(v,p.mode,y),v.return=p,v;case _n:var S=v._init;return d(p,S(v._payload),y)}if(qs(v)||zs(v))return v=hr(v,p.mode,y,null),v.return=p,v;yi(p,v)}return null}function f(p,v,y,S){var b=v!==null?v.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return b!==null?null:l(p,v,""+y,S);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ai:return y.key===b?u(p,v,y,S):null;case $r:return y.key===b?c(p,v,y,S):null;case _n:return b=y._init,f(p,v,b(y._payload),S)}if(qs(y)||zs(y))return b!==null?null:h(p,v,y,S,null);yi(p,y)}return null}function g(p,v,y,S,b){if(typeof S=="string"&&S!==""||typeof S=="number")return p=p.get(y)||null,l(v,p,""+S,b);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ai:return p=p.get(S.key===null?y:S.key)||null,u(v,p,S,b);case $r:return p=p.get(S.key===null?y:S.key)||null,c(v,p,S,b);case _n:var C=S._init;return g(p,v,y,C(S._payload),b)}if(qs(S)||zs(S))return p=p.get(y)||null,h(v,p,S,b,null);yi(v,S)}return null}function x(p,v,y,S){for(var b=null,C=null,j=v,P=v=0,I=null;j!==null&&P<y.length;P++){j.index>P?(I=j,j=null):I=j.sibling;var $=f(p,j,y[P],S);if($===null){j===null&&(j=I);break}e&&j&&$.alternate===null&&t(p,j),v=o($,v,P),C===null?b=$:C.sibling=$,C=$,j=I}if(P===y.length)return n(p,j),ve&&sr(p,P),b;if(j===null){for(;P<y.length;P++)j=d(p,y[P],S),j!==null&&(v=o(j,v,P),C===null?b=j:C.sibling=j,C=j);return ve&&sr(p,P),b}for(j=r(p,j);P<y.length;P++)I=g(j,p,P,y[P],S),I!==null&&(e&&I.alternate!==null&&j.delete(I.key===null?P:I.key),v=o(I,v,P),C===null?b=I:C.sibling=I,C=I);return e&&j.forEach(function(R){return t(p,R)}),ve&&sr(p,P),b}function w(p,v,y,S){var b=zs(y);if(typeof b!="function")throw Error(H(150));if(y=b.call(y),y==null)throw Error(H(151));for(var C=b=null,j=v,P=v=0,I=null,$=y.next();j!==null&&!$.done;P++,$=y.next()){j.index>P?(I=j,j=null):I=j.sibling;var R=f(p,j,$.value,S);if(R===null){j===null&&(j=I);break}e&&j&&R.alternate===null&&t(p,j),v=o(R,v,P),C===null?b=R:C.sibling=R,C=R,j=I}if($.done)return n(p,j),ve&&sr(p,P),b;if(j===null){for(;!$.done;P++,$=y.next())$=d(p,$.value,S),$!==null&&(v=o($,v,P),C===null?b=$:C.sibling=$,C=$);return ve&&sr(p,P),b}for(j=r(p,j);!$.done;P++,$=y.next())$=g(j,p,P,$.value,S),$!==null&&(e&&$.alternate!==null&&j.delete($.key===null?P:$.key),v=o($,v,P),C===null?b=$:C.sibling=$,C=$);return e&&j.forEach(function(T){return t(p,T)}),ve&&sr(p,P),b}function N(p,v,y,S){if(typeof y=="object"&&y!==null&&y.type===Or&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case ai:e:{for(var b=y.key,C=v;C!==null;){if(C.key===b){if(b=y.type,b===Or){if(C.tag===7){n(p,C.sibling),v=s(C,y.props.children),v.return=p,p=v;break e}}else if(C.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===_n&&Nh(b)===C.type){n(p,C.sibling),v=s(C,y.props),v.ref=Hs(p,C,y),v.return=p,p=v;break e}n(p,C);break}else t(p,C);C=C.sibling}y.type===Or?(v=hr(y.props.children,p.mode,S,y.key),v.return=p,p=v):(S=qi(y.type,y.key,y.props,null,p.mode,S),S.ref=Hs(p,v,y),S.return=p,p=S)}return i(p);case $r:e:{for(C=y.key;v!==null;){if(v.key===C)if(v.tag===4&&v.stateNode.containerInfo===y.containerInfo&&v.stateNode.implementation===y.implementation){n(p,v.sibling),v=s(v,y.children||[]),v.return=p,p=v;break e}else{n(p,v);break}else t(p,v);v=v.sibling}v=uu(y,p.mode,S),v.return=p,p=v}return i(p);case _n:return C=y._init,N(p,v,C(y._payload),S)}if(qs(y))return x(p,v,y,S);if(zs(y))return w(p,v,y,S);yi(p,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,v!==null&&v.tag===6?(n(p,v.sibling),v=s(v,y),v.return=p,p=v):(n(p,v),v=lu(y,p.mode,S),v.return=p,p=v),i(p)):n(p,v)}return N}var cs=Pg(!0),Mg=Pg(!1),Na=Zn(null),Sa=null,Gr=null,xd=null;function yd(){xd=Gr=Sa=null}function vd(e){var t=Na.current;xe(Na),e._currentValue=t}function ac(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ns(e,t){Sa=e,xd=Gr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ot=!0),e.firstContext=null)}function bt(e){var t=e._currentValue;if(xd!==e)if(e={context:e,memoizedValue:t,next:null},Gr===null){if(Sa===null)throw Error(H(308));Gr=e,Sa.dependencies={lanes:0,firstContext:e}}else Gr=Gr.next=e;return t}var lr=null;function wd(e){lr===null?lr=[e]:lr.push(e)}function Ig(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,wd(t)):(n.next=s.next,s.next=n),t.interleaved=n,gn(e,r)}function gn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Pn=!1;function Nd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Rg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function fn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function On(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ae&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,gn(e,n)}return s=r.interleaved,s===null?(t.next=t,wd(r)):(t.next=s.next,s.next=t),r.interleaved=t,gn(e,n)}function Wi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,id(e,n)}}function Sh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?s=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ba(e,t,n,r){var s=e.updateQueue;Pn=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var u=l,c=u.next;u.next=null,i===null?o=c:i.next=c,i=u;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==i&&(l===null?h.firstBaseUpdate=c:l.next=c,h.lastBaseUpdate=u))}if(o!==null){var d=s.baseState;i=0,h=c=u=null,l=o;do{var f=l.lane,g=l.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:g,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,w=l;switch(f=t,g=n,w.tag){case 1:if(x=w.payload,typeof x=="function"){d=x.call(g,d,f);break e}d=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=w.payload,f=typeof x=="function"?x.call(g,d,f):x,f==null)break e;d=Ce({},d,f);break e;case 2:Pn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[l]:f.push(l))}else g={eventTime:g,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(c=h=g,u=d):h=h.next=g,i|=f;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;f=l,l=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(h===null&&(u=d),s.baseState=u,s.firstBaseUpdate=c,s.lastBaseUpdate=h,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);vr|=i,e.lanes=i,e.memoizedState=d}}function bh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(H(191,s));s.call(r)}}}var Go={},Xt=Zn(Go),Co=Zn(Go),Eo=Zn(Go);function ur(e){if(e===Go)throw Error(H(174));return e}function Sd(e,t){switch(fe(Eo,t),fe(Co,e),fe(Xt,Go),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Hu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Hu(t,e)}xe(Xt),fe(Xt,t)}function ds(){xe(Xt),xe(Co),xe(Eo)}function Tg(e){ur(Eo.current);var t=ur(Xt.current),n=Hu(t,e.type);t!==n&&(fe(Co,e),fe(Xt,n))}function bd(e){Co.current===e&&(xe(Xt),xe(Co))}var je=Zn(0);function ja(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 nu=[];function jd(){for(var e=0;e<nu.length;e++)nu[e]._workInProgressVersionPrimary=null;nu.length=0}var Ki=vn.ReactCurrentDispatcher,ru=vn.ReactCurrentBatchConfig,yr=0,ke=null,Ae=null,De=null,ka=!1,ao=!1,_o=0,GN=0;function We(){throw Error(H(321))}function kd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Dt(e[n],t[n]))return!1;return!0}function Cd(e,t,n,r,s,o){if(yr=o,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ki.current=e===null||e.memoizedState===null?qN:ZN,e=n(r,s),ao){o=0;do{if(ao=!1,_o=0,25<=o)throw Error(H(301));o+=1,De=Ae=null,t.updateQueue=null,Ki.current=JN,e=n(r,s)}while(ao)}if(Ki.current=Ca,t=Ae!==null&&Ae.next!==null,yr=0,De=Ae=ke=null,ka=!1,t)throw Error(H(300));return e}function Ed(){var e=_o!==0;return _o=0,e}function Vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return De===null?ke.memoizedState=De=e:De=De.next=e,De}function jt(){if(Ae===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=Ae.next;var t=De===null?ke.memoizedState:De.next;if(t!==null)De=t,Ae=e;else{if(e===null)throw Error(H(310));Ae=e,e={memoizedState:Ae.memoizedState,baseState:Ae.baseState,baseQueue:Ae.baseQueue,queue:Ae.queue,next:null},De===null?ke.memoizedState=De=e:De=De.next=e}return De}function Po(e,t){return typeof t=="function"?t(e):t}function su(e){var t=jt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=Ae,s=r.baseQueue,o=n.pending;if(o!==null){if(s!==null){var i=s.next;s.next=o.next,o.next=i}r.baseQueue=s=o,n.pending=null}if(s!==null){o=s.next,r=r.baseState;var l=i=null,u=null,c=o;do{var h=c.lane;if((yr&h)===h)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:h,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(l=u=d,i=r):u=u.next=d,ke.lanes|=h,vr|=h}c=c.next}while(c!==null&&c!==o);u===null?i=r:u.next=l,Dt(r,t.memoizedState)||(ot=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do o=s.lane,ke.lanes|=o,vr|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ou(e){var t=jt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,o=t.memoizedState;if(s!==null){n.pending=null;var i=s=s.next;do o=e(o,i.action),i=i.next;while(i!==s);Dt(o,t.memoizedState)||(ot=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lg(){}function Ag(e,t){var n=ke,r=jt(),s=t(),o=!Dt(r.memoizedState,s);if(o&&(r.memoizedState=s,ot=!0),r=r.queue,_d($g.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||De!==null&&De.memoizedState.tag&1){if(n.flags|=2048,Mo(9,Dg.bind(null,n,r,s,t),void 0,null),$e===null)throw Error(H(349));yr&30||zg(n,t,s)}return s}function zg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ke.updateQueue,t===null?(t={lastEffect:null,stores:null},ke.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Dg(e,t,n,r){t.value=n,t.getSnapshot=r,Og(t)&&Fg(e)}function $g(e,t,n){return n(function(){Og(t)&&Fg(e)})}function Og(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dt(e,n)}catch{return!0}}function Fg(e){var t=gn(e,1);t!==null&&zt(t,e,1,-1)}function jh(e){var t=Vt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:e},t.queue=e,e=e.dispatch=QN.bind(null,ke,e),[t.memoizedState,e]}function Mo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ke.updateQueue,t===null?(t={lastEffect:null,stores:null},ke.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Hg(){return jt().memoizedState}function Gi(e,t,n,r){var s=Vt();ke.flags|=e,s.memoizedState=Mo(1|t,n,void 0,r===void 0?null:r)}function nl(e,t,n,r){var s=jt();r=r===void 0?null:r;var o=void 0;if(Ae!==null){var i=Ae.memoizedState;if(o=i.destroy,r!==null&&kd(r,i.deps)){s.memoizedState=Mo(t,n,o,r);return}}ke.flags|=e,s.memoizedState=Mo(1|t,n,o,r)}function kh(e,t){return Gi(8390656,8,e,t)}function _d(e,t){return nl(2048,8,e,t)}function Bg(e,t){return nl(4,2,e,t)}function Vg(e,t){return nl(4,4,e,t)}function Ug(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Wg(e,t,n){return n=n!=null?n.concat([e]):null,nl(4,4,Ug.bind(null,t,e),n)}function Pd(){}function Kg(e,t){var n=jt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&kd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Gg(e,t){var n=jt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&kd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Yg(e,t,n){return yr&21?(Dt(n,t)||(n=Jp(),ke.lanes|=n,vr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ot=!0),e.memoizedState=n)}function YN(e,t){var n=de;de=n!==0&&4>n?n:4,e(!0);var r=ru.transition;ru.transition={};try{e(!1),t()}finally{de=n,ru.transition=r}}function Xg(){return jt().memoizedState}function XN(e,t,n){var r=Hn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Qg(e))qg(t,n);else if(n=Ig(e,t,n,r),n!==null){var s=Ze();zt(n,e,r,s),Zg(n,t,r)}}function QN(e,t,n){var r=Hn(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qg(e))qg(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,l=o(i,n);if(s.hasEagerState=!0,s.eagerState=l,Dt(l,i)){var u=t.interleaved;u===null?(s.next=s,wd(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}n=Ig(e,t,s,r),n!==null&&(s=Ze(),zt(n,e,r,s),Zg(n,t,r))}}function Qg(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function qg(e,t){ao=ka=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Zg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,id(e,n)}}var Ca={readContext:bt,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useInsertionEffect:We,useLayoutEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useMutableSource:We,useSyncExternalStore:We,useId:We,unstable_isNewReconciler:!1},qN={readContext:bt,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:bt,useEffect:kh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Gi(4194308,4,Ug.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gi(4194308,4,e,t)},useInsertionEffect:function(e,t){return Gi(4,2,e,t)},useMemo:function(e,t){var n=Vt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Vt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=XN.bind(null,ke,e),[r.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:jh,useDebugValue:Pd,useDeferredValue:function(e){return Vt().memoizedState=e},useTransition:function(){var e=jh(!1),t=e[0];return e=YN.bind(null,e[1]),Vt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ke,s=Vt();if(ve){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),$e===null)throw Error(H(349));yr&30||zg(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,kh($g.bind(null,r,o,e),[e]),r.flags|=2048,Mo(9,Dg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Vt(),t=$e.identifierPrefix;if(ve){var n=cn,r=un;n=(r&~(1<<32-At(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=_o++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=GN++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ZN={readContext:bt,useCallback:Kg,useContext:bt,useEffect:_d,useImperativeHandle:Wg,useInsertionEffect:Bg,useLayoutEffect:Vg,useMemo:Gg,useReducer:su,useRef:Hg,useState:function(){return su(Po)},useDebugValue:Pd,useDeferredValue:function(e){var t=jt();return Yg(t,Ae.memoizedState,e)},useTransition:function(){var e=su(Po)[0],t=jt().memoizedState;return[e,t]},useMutableSource:Lg,useSyncExternalStore:Ag,useId:Xg,unstable_isNewReconciler:!1},JN={readContext:bt,useCallback:Kg,useContext:bt,useEffect:_d,useImperativeHandle:Wg,useInsertionEffect:Bg,useLayoutEffect:Vg,useMemo:Gg,useReducer:ou,useRef:Hg,useState:function(){return ou(Po)},useDebugValue:Pd,useDeferredValue:function(e){var t=jt();return Ae===null?t.memoizedState=e:Yg(t,Ae.memoizedState,e)},useTransition:function(){var e=ou(Po)[0],t=jt().memoizedState;return[e,t]},useMutableSource:Lg,useSyncExternalStore:Ag,useId:Xg,unstable_isNewReconciler:!1};function _t(e,t){if(e&&e.defaultProps){t=Ce({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function lc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ce({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var rl={isMounted:function(e){return(e=e._reactInternals)?_r(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ze(),s=Hn(e),o=fn(r,s);o.payload=t,n!=null&&(o.callback=n),t=On(e,o,s),t!==null&&(zt(t,e,s,r),Wi(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ze(),s=Hn(e),o=fn(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=On(e,o,s),t!==null&&(zt(t,e,s,r),Wi(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ze(),r=Hn(e),s=fn(n,r);s.tag=2,t!=null&&(s.callback=t),t=On(e,s,r),t!==null&&(zt(t,e,r,n),Wi(t,e,r))}};function Ch(e,t,n,r,s,o,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,i):t.prototype&&t.prototype.isPureReactComponent?!So(n,r)||!So(s,o):!0}function Jg(e,t,n){var r=!1,s=Wn,o=t.contextType;return typeof o=="object"&&o!==null?o=bt(o):(s=lt(t)?gr:Qe.current,r=t.contextTypes,o=(r=r!=null)?ls(e,s):Wn),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=rl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function Eh(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&rl.enqueueReplaceState(t,t.state,null)}function uc(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Nd(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=bt(o):(o=lt(t)?gr:Qe.current,s.context=ls(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(lc(e,t,o,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&rl.enqueueReplaceState(s,s.state,null),ba(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function fs(e,t){try{var n="",r=t;do n+=Ew(r),r=r.return;while(r);var s=n}catch(o){s=`
39
+ Error generating stack: `+o.message+`
40
+ `+o.stack}return{value:e,source:t,stack:s,digest:null}}function iu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function cc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var e2=typeof WeakMap=="function"?WeakMap:Map;function ex(e,t,n){n=fn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){_a||(_a=!0,wc=r),cc(e,t)},n}function tx(e,t,n){n=fn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){cc(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){cc(e,t),typeof r!="function"&&(Fn===null?Fn=new Set([this]):Fn.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function _h(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new e2;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=m2.bind(null,e,t,n),t.then(e,e))}function Ph(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Mh(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=fn(-1,1),t.tag=2,On(n,t,1))),n.lanes|=1),e)}var t2=vn.ReactCurrentOwner,ot=!1;function qe(e,t,n,r){t.child=e===null?Mg(t,null,n,r):cs(t,e.child,n,r)}function Ih(e,t,n,r,s){n=n.render;var o=t.ref;return ns(t,s),r=Cd(e,t,n,r,o,s),n=Ed(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,xn(e,t,s)):(ve&&n&&md(t),t.flags|=1,qe(e,t,r,s),t.child)}function Rh(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!Dd(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,nx(e,t,o,r,s)):(e=qi(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var i=o.memoizedProps;if(n=n.compare,n=n!==null?n:So,n(i,r)&&e.ref===t.ref)return xn(e,t,s)}return t.flags|=1,e=Bn(o,r),e.ref=t.ref,e.return=t,t.child=e}function nx(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if(So(o,r)&&e.ref===t.ref)if(ot=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(ot=!0);else return t.lanes=e.lanes,xn(e,t,s)}return dc(e,t,n,r,s)}function rx(e,t,n){var r=t.pendingProps,s=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},fe(Xr,ct),ct|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,fe(Xr,ct),ct|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,fe(Xr,ct),ct|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,fe(Xr,ct),ct|=r;return qe(e,t,s,n),t.child}function sx(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function dc(e,t,n,r,s){var o=lt(n)?gr:Qe.current;return o=ls(t,o),ns(t,s),n=Cd(e,t,n,r,o,s),r=Ed(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,xn(e,t,s)):(ve&&r&&md(t),t.flags|=1,qe(e,t,n,s),t.child)}function Th(e,t,n,r,s){if(lt(n)){var o=!0;ya(t)}else o=!1;if(ns(t,s),t.stateNode===null)Yi(e,t),Jg(t,n,r),uc(t,n,r,s),r=!0;else if(e===null){var i=t.stateNode,l=t.memoizedProps;i.props=l;var u=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=bt(c):(c=lt(n)?gr:Qe.current,c=ls(t,c));var h=n.getDerivedStateFromProps,d=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function";d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==r||u!==c)&&Eh(t,i,r,c),Pn=!1;var f=t.memoizedState;i.state=f,ba(t,r,i,s),u=t.memoizedState,l!==r||f!==u||at.current||Pn?(typeof h=="function"&&(lc(t,n,h,r),u=t.memoizedState),(l=Pn||Ch(t,n,l,r,f,u,c))?(d||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),i.props=r,i.state=u,i.context=c,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Rg(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:_t(t.type,l),i.props=c,d=t.pendingProps,f=i.context,u=n.contextType,typeof u=="object"&&u!==null?u=bt(u):(u=lt(n)?gr:Qe.current,u=ls(t,u));var g=n.getDerivedStateFromProps;(h=typeof g=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==d||f!==u)&&Eh(t,i,r,u),Pn=!1,f=t.memoizedState,i.state=f,ba(t,r,i,s);var x=t.memoizedState;l!==d||f!==x||at.current||Pn?(typeof g=="function"&&(lc(t,n,g,r),x=t.memoizedState),(c=Pn||Ch(t,n,c,r,f,x,u)||!1)?(h||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,x,u),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,x,u)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),i.props=r,i.state=x,i.context=u,r=c):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return fc(e,t,n,r,o,s)}function fc(e,t,n,r,s,o){sx(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return s&&yh(t,n,!1),xn(e,t,o);r=t.stateNode,t2.current=t;var l=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=cs(t,e.child,null,o),t.child=cs(t,null,l,o)):qe(e,t,l,o),t.memoizedState=r.state,s&&yh(t,n,!0),t.child}function ox(e){var t=e.stateNode;t.pendingContext?xh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&xh(e,t.context,!1),Sd(e,t.containerInfo)}function Lh(e,t,n,r,s){return us(),gd(s),t.flags|=256,qe(e,t,n,r),t.child}var hc={dehydrated:null,treeContext:null,retryLane:0};function mc(e){return{baseLanes:e,cachePool:null,transitions:null}}function ix(e,t,n){var r=t.pendingProps,s=je.current,o=!1,i=(t.flags&128)!==0,l;if((l=i)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),fe(je,s&1),e===null)return ic(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,o?(r=t.mode,o=t.child,i={mode:"hidden",children:i},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=il(i,r,0,null),e=hr(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=mc(n),t.memoizedState=hc,e):Md(t,i));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return n2(e,t,i,r,l,s,n);if(o){o=r.fallback,i=t.mode,s=e.child,l=s.sibling;var u={mode:"hidden",children:r.children};return!(i&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Bn(s,u),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?o=Bn(l,o):(o=hr(o,i,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,i=e.child.memoizedState,i=i===null?mc(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=hc,r}return o=e.child,e=o.sibling,r=Bn(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Md(e,t){return t=il({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function vi(e,t,n,r){return r!==null&&gd(r),cs(t,e.child,null,n),e=Md(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function n2(e,t,n,r,s,o,i){if(n)return t.flags&256?(t.flags&=-257,r=iu(Error(H(422))),vi(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=il({mode:"visible",children:r.children},s,0,null),o=hr(o,s,i,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&cs(t,e.child,null,i),t.child.memoizedState=mc(i),t.memoizedState=hc,o);if(!(t.mode&1))return vi(e,t,i,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(H(419)),r=iu(o,r,void 0),vi(e,t,i,r)}if(l=(i&e.childLanes)!==0,ot||l){if(r=$e,r!==null){switch(i&-i){case 4:s=2;break;case 16:s=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|i)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,gn(e,s),zt(r,e,s,-1))}return zd(),r=iu(Error(H(421))),vi(e,t,i,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=p2.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,ft=$n(s.nextSibling),ht=t,ve=!0,It=null,e!==null&&(vt[wt++]=un,vt[wt++]=cn,vt[wt++]=xr,un=e.id,cn=e.overflow,xr=t),t=Md(t,r.children),t.flags|=4096,t)}function Ah(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ac(e.return,t,n)}function au(e,t,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=s)}function ax(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(qe(e,t,r.children,n),r=je.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ah(e,n,t);else if(e.tag===19)Ah(e,n,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}r&=1}if(fe(je,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&ja(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),au(t,!1,s,n,o);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&ja(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}au(t,!0,n,null,o);break;case"together":au(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Yi(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function xn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),vr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=Bn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Bn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function r2(e,t,n){switch(t.tag){case 3:ox(t),us();break;case 5:Tg(t);break;case 1:lt(t.type)&&ya(t);break;case 4:Sd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;fe(Na,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(fe(je,je.current&1),t.flags|=128,null):n&t.child.childLanes?ix(e,t,n):(fe(je,je.current&1),e=xn(e,t,n),e!==null?e.sibling:null);fe(je,je.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ax(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),fe(je,je.current),r)break;return null;case 22:case 23:return t.lanes=0,rx(e,t,n)}return xn(e,t,n)}var lx,pc,ux,cx;lx=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};pc=function(){};ux=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,ur(Xt.current);var o=null;switch(n){case"input":s=Du(e,s),r=Du(e,r),o=[];break;case"select":s=Ce({},s,{value:void 0}),r=Ce({},r,{value:void 0}),o=[];break;case"textarea":s=Fu(e,s),r=Fu(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ga)}Bu(n,r);var i;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var l=s[c];for(i in l)l.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(po.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var u=r[c];if(l=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&u!==l&&(u!=null||l!=null))if(c==="style")if(l){for(i in l)!l.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&l[i]!==u[i]&&(n||(n={}),n[i]=u[i])}else n||(o||(o=[]),o.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(o=o||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(o=o||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(po.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&ge("scroll",e),o||l===u||(o=[])):(o=o||[]).push(c,u))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};cx=function(e,t,n,r){n!==r&&(t.flags|=4)};function Bs(e,t){if(!ve)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ke(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function s2(e,t,n){var r=t.pendingProps;switch(pd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ke(t),null;case 1:return lt(t.type)&&xa(),Ke(t),null;case 3:return r=t.stateNode,ds(),xe(at),xe(Qe),jd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(xi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,It!==null&&(bc(It),It=null))),pc(e,t),Ke(t),null;case 5:bd(t);var s=ur(Eo.current);if(n=t.type,e!==null&&t.stateNode!=null)ux(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(H(166));return Ke(t),null}if(e=ur(Xt.current),xi(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Kt]=t,r[ko]=o,e=(t.mode&1)!==0,n){case"dialog":ge("cancel",r),ge("close",r);break;case"iframe":case"object":case"embed":ge("load",r);break;case"video":case"audio":for(s=0;s<Js.length;s++)ge(Js[s],r);break;case"source":ge("error",r);break;case"img":case"image":case"link":ge("error",r),ge("load",r);break;case"details":ge("toggle",r);break;case"input":Uf(r,o),ge("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},ge("invalid",r);break;case"textarea":Kf(r,o),ge("invalid",r)}Bu(n,o),s=null;for(var i in o)if(o.hasOwnProperty(i)){var l=o[i];i==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&gi(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&gi(r.textContent,l,e),s=["children",""+l]):po.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&ge("scroll",r)}switch(n){case"input":li(r),Wf(r,o,!0);break;case"textarea":li(r),Gf(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=ga)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=$p(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Kt]=t,e[ko]=r,lx(e,t,!1,!1),t.stateNode=e;e:{switch(i=Vu(n,r),n){case"dialog":ge("cancel",e),ge("close",e),s=r;break;case"iframe":case"object":case"embed":ge("load",e),s=r;break;case"video":case"audio":for(s=0;s<Js.length;s++)ge(Js[s],e);s=r;break;case"source":ge("error",e),s=r;break;case"img":case"image":case"link":ge("error",e),ge("load",e),s=r;break;case"details":ge("toggle",e),s=r;break;case"input":Uf(e,r),s=Du(e,r),ge("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Ce({},r,{value:void 0}),ge("invalid",e);break;case"textarea":Kf(e,r),s=Fu(e,r),ge("invalid",e);break;default:s=r}Bu(n,s),l=s;for(o in l)if(l.hasOwnProperty(o)){var u=l[o];o==="style"?Hp(e,u):o==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Op(e,u)):o==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&go(e,u):typeof u=="number"&&go(e,""+u):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(po.hasOwnProperty(o)?u!=null&&o==="onScroll"&&ge("scroll",e):u!=null&&ed(e,o,u,i))}switch(n){case"input":li(e),Wf(e,r,!1);break;case"textarea":li(e),Gf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Un(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Zr(e,!!r.multiple,o,!1):r.defaultValue!=null&&Zr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=ga)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ke(t),null;case 6:if(e&&t.stateNode!=null)cx(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=ur(Eo.current),ur(Xt.current),xi(t)){if(r=t.stateNode,n=t.memoizedProps,r[Kt]=t,(o=r.nodeValue!==n)&&(e=ht,e!==null))switch(e.tag){case 3:gi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&gi(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Kt]=t,t.stateNode=r}return Ke(t),null;case 13:if(xe(je),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ve&&ft!==null&&t.mode&1&&!(t.flags&128))_g(),us(),t.flags|=98560,o=!1;else if(o=xi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(H(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(H(317));o[Kt]=t}else us(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ke(t),o=!1}else It!==null&&(bc(It),It=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||je.current&1?ze===0&&(ze=3):zd())),t.updateQueue!==null&&(t.flags|=4),Ke(t),null);case 4:return ds(),pc(e,t),e===null&&bo(t.stateNode.containerInfo),Ke(t),null;case 10:return vd(t.type._context),Ke(t),null;case 17:return lt(t.type)&&xa(),Ke(t),null;case 19:if(xe(je),o=t.memoizedState,o===null)return Ke(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Bs(o,!1);else{if(ze!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=ja(e),i!==null){for(t.flags|=128,Bs(o,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return fe(je,je.current&1|2),t.child}e=e.sibling}o.tail!==null&&_e()>hs&&(t.flags|=128,r=!0,Bs(o,!1),t.lanes=4194304)}else{if(!r)if(e=ja(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Bs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!ve)return Ke(t),null}else 2*_e()-o.renderingStartTime>hs&&n!==1073741824&&(t.flags|=128,r=!0,Bs(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=_e(),t.sibling=null,n=je.current,fe(je,r?n&1|2:n&1),t):(Ke(t),null);case 22:case 23:return Ad(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ct&1073741824&&(Ke(t),t.subtreeFlags&6&&(t.flags|=8192)):Ke(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function o2(e,t){switch(pd(t),t.tag){case 1:return lt(t.type)&&xa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ds(),xe(at),xe(Qe),jd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return bd(t),null;case 13:if(xe(je),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));us()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xe(je),null;case 4:return ds(),null;case 10:return vd(t.type._context),null;case 22:case 23:return Ad(),null;case 24:return null;default:return null}}var wi=!1,Ye=!1,i2=typeof WeakSet=="function"?WeakSet:Set,W=null;function Yr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ee(e,t,r)}else n.current=null}function gc(e,t,n){try{n()}catch(r){Ee(e,t,r)}}var zh=!1;function a2(e,t){if(Ju=ha,e=pg(),hd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,l=-1,u=-1,c=0,h=0,d=e,f=null;t:for(;;){for(var g;d!==n||s!==0&&d.nodeType!==3||(l=i+s),d!==o||r!==0&&d.nodeType!==3||(u=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(g=d.firstChild)!==null;)f=d,d=g;for(;;){if(d===e)break t;if(f===n&&++c===s&&(l=i),f===o&&++h===r&&(u=i),(g=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=g}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ec={focusedElem:e,selectionRange:n},ha=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var w=x.memoizedProps,N=x.memoizedState,p=t.stateNode,v=p.getSnapshotBeforeUpdate(t.elementType===t.type?w:_t(t.type,w),N);p.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(S){Ee(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return x=zh,zh=!1,x}function lo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&gc(t,n,o)}s=s.next}while(s!==r)}}function sl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function xc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function dx(e){var t=e.alternate;t!==null&&(e.alternate=null,dx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Kt],delete t[ko],delete t[rc],delete t[VN],delete t[UN])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function fx(e){return e.tag===5||e.tag===3||e.tag===4}function Dh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fx(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.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 yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ga));else if(r!==4&&(e=e.child,e!==null))for(yc(e,t,n),e=e.sibling;e!==null;)yc(e,t,n),e=e.sibling}function vc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(vc(e,t,n),e=e.sibling;e!==null;)vc(e,t,n),e=e.sibling}var Oe=null,Pt=!1;function Sn(e,t,n){for(n=n.child;n!==null;)hx(e,t,n),n=n.sibling}function hx(e,t,n){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(Qa,n)}catch{}switch(n.tag){case 5:Ye||Yr(n,t);case 6:var r=Oe,s=Pt;Oe=null,Sn(e,t,n),Oe=r,Pt=s,Oe!==null&&(Pt?(e=Oe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Oe.removeChild(n.stateNode));break;case 18:Oe!==null&&(Pt?(e=Oe,n=n.stateNode,e.nodeType===8?eu(e.parentNode,n):e.nodeType===1&&eu(e,n),wo(e)):eu(Oe,n.stateNode));break;case 4:r=Oe,s=Pt,Oe=n.stateNode.containerInfo,Pt=!0,Sn(e,t,n),Oe=r,Pt=s;break;case 0:case 11:case 14:case 15:if(!Ye&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&gc(n,t,i),s=s.next}while(s!==r)}Sn(e,t,n);break;case 1:if(!Ye&&(Yr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ee(n,t,l)}Sn(e,t,n);break;case 21:Sn(e,t,n);break;case 22:n.mode&1?(Ye=(r=Ye)||n.memoizedState!==null,Sn(e,t,n),Ye=r):Sn(e,t,n);break;default:Sn(e,t,n)}}function $h(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new i2),t.forEach(function(r){var s=g2.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Et(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var o=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 5:Oe=l.stateNode,Pt=!1;break e;case 3:Oe=l.stateNode.containerInfo,Pt=!0;break e;case 4:Oe=l.stateNode.containerInfo,Pt=!0;break e}l=l.return}if(Oe===null)throw Error(H(160));hx(o,i,s),Oe=null,Pt=!1;var u=s.alternate;u!==null&&(u.return=null),s.return=null}catch(c){Ee(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)mx(t,e),t=t.sibling}function mx(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Et(t,e),Bt(e),r&4){try{lo(3,e,e.return),sl(3,e)}catch(w){Ee(e,e.return,w)}try{lo(5,e,e.return)}catch(w){Ee(e,e.return,w)}}break;case 1:Et(t,e),Bt(e),r&512&&n!==null&&Yr(n,n.return);break;case 5:if(Et(t,e),Bt(e),r&512&&n!==null&&Yr(n,n.return),e.flags&32){var s=e.stateNode;try{go(s,"")}catch(w){Ee(e,e.return,w)}}if(r&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,i=n!==null?n.memoizedProps:o,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&zp(s,o),Vu(l,i);var c=Vu(l,o);for(i=0;i<u.length;i+=2){var h=u[i],d=u[i+1];h==="style"?Hp(s,d):h==="dangerouslySetInnerHTML"?Op(s,d):h==="children"?go(s,d):ed(s,h,d,c)}switch(l){case"input":$u(s,o);break;case"textarea":Dp(s,o);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var g=o.value;g!=null?Zr(s,!!o.multiple,g,!1):f!==!!o.multiple&&(o.defaultValue!=null?Zr(s,!!o.multiple,o.defaultValue,!0):Zr(s,!!o.multiple,o.multiple?[]:"",!1))}s[ko]=o}catch(w){Ee(e,e.return,w)}}break;case 6:if(Et(t,e),Bt(e),r&4){if(e.stateNode===null)throw Error(H(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(w){Ee(e,e.return,w)}}break;case 3:if(Et(t,e),Bt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{wo(t.containerInfo)}catch(w){Ee(e,e.return,w)}break;case 4:Et(t,e),Bt(e);break;case 13:Et(t,e),Bt(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Td=_e())),r&4&&$h(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(Ye=(c=Ye)||h,Et(t,e),Ye=c):Et(t,e),Bt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!h&&e.mode&1)for(W=e,h=e.child;h!==null;){for(d=W=h;W!==null;){switch(f=W,g=f.child,f.tag){case 0:case 11:case 14:case 15:lo(4,f,f.return);break;case 1:Yr(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(w){Ee(r,n,w)}}break;case 5:Yr(f,f.return);break;case 22:if(f.memoizedState!==null){Fh(d);continue}}g!==null?(g.return=f,W=g):Fh(d)}h=h.sibling}e:for(h=null,d=e;;){if(d.tag===5){if(h===null){h=d;try{s=d.stateNode,c?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=d.stateNode,u=d.memoizedProps.style,i=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=Fp("display",i))}catch(w){Ee(e,e.return,w)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(w){Ee(e,e.return,w)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Et(t,e),Bt(e),r&4&&$h(e);break;case 21:break;default:Et(t,e),Bt(e)}}function Bt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(fx(n)){var r=n;break e}n=n.return}throw Error(H(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(go(s,""),r.flags&=-33);var o=Dh(e);vc(e,o,s);break;case 3:case 4:var i=r.stateNode.containerInfo,l=Dh(e);yc(e,l,i);break;default:throw Error(H(161))}}catch(u){Ee(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function l2(e,t,n){W=e,px(e)}function px(e,t,n){for(var r=(e.mode&1)!==0;W!==null;){var s=W,o=s.child;if(s.tag===22&&r){var i=s.memoizedState!==null||wi;if(!i){var l=s.alternate,u=l!==null&&l.memoizedState!==null||Ye;l=wi;var c=Ye;if(wi=i,(Ye=u)&&!c)for(W=s;W!==null;)i=W,u=i.child,i.tag===22&&i.memoizedState!==null?Hh(s):u!==null?(u.return=i,W=u):Hh(s);for(;o!==null;)W=o,px(o),o=o.sibling;W=s,wi=l,Ye=c}Oh(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,W=o):Oh(e)}}function Oh(e){for(;W!==null;){var t=W;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ye||sl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ye)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:_t(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&bh(t,o,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}bh(t,i,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var h=c.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&wo(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}Ye||t.flags&512&&xc(t)}catch(f){Ee(t,t.return,f)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function Fh(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var n=t.sibling;if(n!==null){n.return=t.return,W=n;break}W=t.return}}function Hh(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{sl(4,t)}catch(u){Ee(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(u){Ee(t,s,u)}}var o=t.return;try{xc(t)}catch(u){Ee(t,o,u)}break;case 5:var i=t.return;try{xc(t)}catch(u){Ee(t,i,u)}}}catch(u){Ee(t,t.return,u)}if(t===e){W=null;break}var l=t.sibling;if(l!==null){l.return=t.return,W=l;break}W=t.return}}var u2=Math.ceil,Ea=vn.ReactCurrentDispatcher,Id=vn.ReactCurrentOwner,St=vn.ReactCurrentBatchConfig,ae=0,$e=null,Me=null,Fe=0,ct=0,Xr=Zn(0),ze=0,Io=null,vr=0,ol=0,Rd=0,uo=null,st=null,Td=0,hs=1/0,an=null,_a=!1,wc=null,Fn=null,Ni=!1,Ln=null,Pa=0,co=0,Nc=null,Xi=-1,Qi=0;function Ze(){return ae&6?_e():Xi!==-1?Xi:Xi=_e()}function Hn(e){return e.mode&1?ae&2&&Fe!==0?Fe&-Fe:KN.transition!==null?(Qi===0&&(Qi=Jp()),Qi):(e=de,e!==0||(e=window.event,e=e===void 0?16:ig(e.type)),e):1}function zt(e,t,n,r){if(50<co)throw co=0,Nc=null,Error(H(185));Uo(e,n,r),(!(ae&2)||e!==$e)&&(e===$e&&(!(ae&2)&&(ol|=n),ze===4&&In(e,Fe)),ut(e,r),n===1&&ae===0&&!(t.mode&1)&&(hs=_e()+500,tl&&Jn()))}function ut(e,t){var n=e.callbackNode;Kw(e,t);var r=fa(e,e===$e?Fe:0);if(r===0)n!==null&&Qf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Qf(n),t===1)e.tag===0?WN(Bh.bind(null,e)):kg(Bh.bind(null,e)),HN(function(){!(ae&6)&&Jn()}),n=null;else{switch(eg(r)){case 1:n=od;break;case 4:n=qp;break;case 16:n=da;break;case 536870912:n=Zp;break;default:n=da}n=bx(n,gx.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function gx(e,t){if(Xi=-1,Qi=0,ae&6)throw Error(H(327));var n=e.callbackNode;if(rs()&&e.callbackNode!==n)return null;var r=fa(e,e===$e?Fe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ma(e,r);else{t=r;var s=ae;ae|=2;var o=yx();($e!==e||Fe!==t)&&(an=null,hs=_e()+500,fr(e,t));do try{f2();break}catch(l){xx(e,l)}while(!0);yd(),Ea.current=o,ae=s,Me!==null?t=0:($e=null,Fe=0,t=ze)}if(t!==0){if(t===2&&(s=Yu(e),s!==0&&(r=s,t=Sc(e,s))),t===1)throw n=Io,fr(e,0),In(e,r),ut(e,_e()),n;if(t===6)In(e,r);else{if(s=e.current.alternate,!(r&30)&&!c2(s)&&(t=Ma(e,r),t===2&&(o=Yu(e),o!==0&&(r=o,t=Sc(e,o))),t===1))throw n=Io,fr(e,0),In(e,r),ut(e,_e()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:or(e,st,an);break;case 3:if(In(e,r),(r&130023424)===r&&(t=Td+500-_e(),10<t)){if(fa(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Ze(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=nc(or.bind(null,e,st,an),t);break}or(e,st,an);break;case 4:if(In(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var i=31-At(r);o=1<<i,i=t[i],i>s&&(s=i),r&=~o}if(r=s,r=_e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*u2(r/1960))-r,10<r){e.timeoutHandle=nc(or.bind(null,e,st,an),r);break}or(e,st,an);break;case 5:or(e,st,an);break;default:throw Error(H(329))}}}return ut(e,_e()),e.callbackNode===n?gx.bind(null,e):null}function Sc(e,t){var n=uo;return e.current.memoizedState.isDehydrated&&(fr(e,t).flags|=256),e=Ma(e,t),e!==2&&(t=st,st=n,t!==null&&bc(t)),e}function bc(e){st===null?st=e:st.push.apply(st,e)}function c2(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],o=s.getSnapshot;s=s.value;try{if(!Dt(o(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 In(e,t){for(t&=~Rd,t&=~ol,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-At(t),r=1<<n;e[n]=-1,t&=~r}}function Bh(e){if(ae&6)throw Error(H(327));rs();var t=fa(e,0);if(!(t&1))return ut(e,_e()),null;var n=Ma(e,t);if(e.tag!==0&&n===2){var r=Yu(e);r!==0&&(t=r,n=Sc(e,r))}if(n===1)throw n=Io,fr(e,0),In(e,t),ut(e,_e()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,or(e,st,an),ut(e,_e()),null}function Ld(e,t){var n=ae;ae|=1;try{return e(t)}finally{ae=n,ae===0&&(hs=_e()+500,tl&&Jn())}}function wr(e){Ln!==null&&Ln.tag===0&&!(ae&6)&&rs();var t=ae;ae|=1;var n=St.transition,r=de;try{if(St.transition=null,de=1,e)return e()}finally{de=r,St.transition=n,ae=t,!(ae&6)&&Jn()}}function Ad(){ct=Xr.current,xe(Xr)}function fr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,FN(n)),Me!==null)for(n=Me.return;n!==null;){var r=n;switch(pd(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&xa();break;case 3:ds(),xe(at),xe(Qe),jd();break;case 5:bd(r);break;case 4:ds();break;case 13:xe(je);break;case 19:xe(je);break;case 10:vd(r.type._context);break;case 22:case 23:Ad()}n=n.return}if($e=e,Me=e=Bn(e.current,null),Fe=ct=t,ze=0,Io=null,Rd=ol=vr=0,st=uo=null,lr!==null){for(t=0;t<lr.length;t++)if(n=lr[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,o=n.pending;if(o!==null){var i=o.next;o.next=s,r.next=i}n.pending=r}lr=null}return e}function xx(e,t){do{var n=Me;try{if(yd(),Ki.current=Ca,ka){for(var r=ke.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}ka=!1}if(yr=0,De=Ae=ke=null,ao=!1,_o=0,Id.current=null,n===null||n.return===null){ze=1,Io=t,Me=null;break}e:{var o=e,i=n.return,l=n,u=t;if(t=Fe,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,h=l,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var g=Ph(i);if(g!==null){g.flags&=-257,Mh(g,i,l,o,t),g.mode&1&&_h(o,c,t),t=g,u=c;var x=t.updateQueue;if(x===null){var w=new Set;w.add(u),t.updateQueue=w}else x.add(u);break e}else{if(!(t&1)){_h(o,c,t),zd();break e}u=Error(H(426))}}else if(ve&&l.mode&1){var N=Ph(i);if(N!==null){!(N.flags&65536)&&(N.flags|=256),Mh(N,i,l,o,t),gd(fs(u,l));break e}}o=u=fs(u,l),ze!==4&&(ze=2),uo===null?uo=[o]:uo.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var p=ex(o,u,t);Sh(o,p);break e;case 1:l=u;var v=o.type,y=o.stateNode;if(!(o.flags&128)&&(typeof v.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Fn===null||!Fn.has(y)))){o.flags|=65536,t&=-t,o.lanes|=t;var S=tx(o,l,t);Sh(o,S);break e}}o=o.return}while(o!==null)}wx(n)}catch(b){t=b,Me===n&&n!==null&&(Me=n=n.return);continue}break}while(!0)}function yx(){var e=Ea.current;return Ea.current=Ca,e===null?Ca:e}function zd(){(ze===0||ze===3||ze===2)&&(ze=4),$e===null||!(vr&268435455)&&!(ol&268435455)||In($e,Fe)}function Ma(e,t){var n=ae;ae|=2;var r=yx();($e!==e||Fe!==t)&&(an=null,fr(e,t));do try{d2();break}catch(s){xx(e,s)}while(!0);if(yd(),ae=n,Ea.current=r,Me!==null)throw Error(H(261));return $e=null,Fe=0,ze}function d2(){for(;Me!==null;)vx(Me)}function f2(){for(;Me!==null&&!Dw();)vx(Me)}function vx(e){var t=Sx(e.alternate,e,ct);e.memoizedProps=e.pendingProps,t===null?wx(e):Me=t,Id.current=null}function wx(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=o2(n,t),n!==null){n.flags&=32767,Me=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ze=6,Me=null;return}}else if(n=s2(n,t,ct),n!==null){Me=n;return}if(t=t.sibling,t!==null){Me=t;return}Me=t=e}while(t!==null);ze===0&&(ze=5)}function or(e,t,n){var r=de,s=St.transition;try{St.transition=null,de=1,h2(e,t,n,r)}finally{St.transition=s,de=r}return null}function h2(e,t,n,r){do rs();while(Ln!==null);if(ae&6)throw Error(H(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Gw(e,o),e===$e&&(Me=$e=null,Fe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ni||(Ni=!0,bx(da,function(){return rs(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=St.transition,St.transition=null;var i=de;de=1;var l=ae;ae|=4,Id.current=null,a2(e,n),mx(n,e),TN(ec),ha=!!Ju,ec=Ju=null,e.current=n,l2(n),$w(),ae=l,de=i,St.transition=o}else e.current=n;if(Ni&&(Ni=!1,Ln=e,Pa=s),o=e.pendingLanes,o===0&&(Fn=null),Hw(n.stateNode),ut(e,_e()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(_a)throw _a=!1,e=wc,wc=null,e;return Pa&1&&e.tag!==0&&rs(),o=e.pendingLanes,o&1?e===Nc?co++:(co=0,Nc=e):co=0,Jn(),null}function rs(){if(Ln!==null){var e=eg(Pa),t=St.transition,n=de;try{if(St.transition=null,de=16>e?16:e,Ln===null)var r=!1;else{if(e=Ln,Ln=null,Pa=0,ae&6)throw Error(H(331));var s=ae;for(ae|=4,W=e.current;W!==null;){var o=W,i=o.child;if(W.flags&16){var l=o.deletions;if(l!==null){for(var u=0;u<l.length;u++){var c=l[u];for(W=c;W!==null;){var h=W;switch(h.tag){case 0:case 11:case 15:lo(8,h,o)}var d=h.child;if(d!==null)d.return=h,W=d;else for(;W!==null;){h=W;var f=h.sibling,g=h.return;if(dx(h),h===c){W=null;break}if(f!==null){f.return=g,W=f;break}W=g}}}var x=o.alternate;if(x!==null){var w=x.child;if(w!==null){x.child=null;do{var N=w.sibling;w.sibling=null,w=N}while(w!==null)}}W=o}}if(o.subtreeFlags&2064&&i!==null)i.return=o,W=i;else e:for(;W!==null;){if(o=W,o.flags&2048)switch(o.tag){case 0:case 11:case 15:lo(9,o,o.return)}var p=o.sibling;if(p!==null){p.return=o.return,W=p;break e}W=o.return}}var v=e.current;for(W=v;W!==null;){i=W;var y=i.child;if(i.subtreeFlags&2064&&y!==null)y.return=i,W=y;else e:for(i=v;W!==null;){if(l=W,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:sl(9,l)}}catch(b){Ee(l,l.return,b)}if(l===i){W=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,W=S;break e}W=l.return}}if(ae=s,Jn(),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(Qa,e)}catch{}r=!0}return r}finally{de=n,St.transition=t}}return!1}function Vh(e,t,n){t=fs(n,t),t=ex(e,t,1),e=On(e,t,1),t=Ze(),e!==null&&(Uo(e,1,t),ut(e,t))}function Ee(e,t,n){if(e.tag===3)Vh(e,e,n);else for(;t!==null;){if(t.tag===3){Vh(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Fn===null||!Fn.has(r))){e=fs(n,e),e=tx(t,e,1),t=On(t,e,1),e=Ze(),t!==null&&(Uo(t,1,e),ut(t,e));break}}t=t.return}}function m2(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ze(),e.pingedLanes|=e.suspendedLanes&n,$e===e&&(Fe&n)===n&&(ze===4||ze===3&&(Fe&130023424)===Fe&&500>_e()-Td?fr(e,0):Rd|=n),ut(e,t)}function Nx(e,t){t===0&&(e.mode&1?(t=di,di<<=1,!(di&130023424)&&(di=4194304)):t=1);var n=Ze();e=gn(e,t),e!==null&&(Uo(e,t,n),ut(e,n))}function p2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Nx(e,n)}function g2(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(H(314))}r!==null&&r.delete(t),Nx(e,n)}var Sx;Sx=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||at.current)ot=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ot=!1,r2(e,t,n);ot=!!(e.flags&131072)}else ot=!1,ve&&t.flags&1048576&&Cg(t,wa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Yi(e,t),e=t.pendingProps;var s=ls(t,Qe.current);ns(t,n),s=Cd(null,t,r,e,s,n);var o=Ed();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lt(r)?(o=!0,ya(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Nd(t),s.updater=rl,t.stateNode=s,s._reactInternals=t,uc(t,r,e,n),t=fc(null,t,r,!0,o,n)):(t.tag=0,ve&&o&&md(t),qe(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Yi(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=y2(r),e=_t(r,e),s){case 0:t=dc(null,t,r,e,n);break e;case 1:t=Th(null,t,r,e,n);break e;case 11:t=Ih(null,t,r,e,n);break e;case 14:t=Rh(null,t,r,_t(r.type,e),n);break e}throw Error(H(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:_t(r,s),dc(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:_t(r,s),Th(e,t,r,s,n);case 3:e:{if(ox(t),e===null)throw Error(H(387));r=t.pendingProps,o=t.memoizedState,s=o.element,Rg(e,t),ba(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=fs(Error(H(423)),t),t=Lh(e,t,r,n,s);break e}else if(r!==s){s=fs(Error(H(424)),t),t=Lh(e,t,r,n,s);break e}else for(ft=$n(t.stateNode.containerInfo.firstChild),ht=t,ve=!0,It=null,n=Mg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(us(),r===s){t=xn(e,t,n);break e}qe(e,t,r,n)}t=t.child}return t;case 5:return Tg(t),e===null&&ic(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,tc(r,s)?i=null:o!==null&&tc(r,o)&&(t.flags|=32),sx(e,t),qe(e,t,i,n),t.child;case 6:return e===null&&ic(t),null;case 13:return ix(e,t,n);case 4:return Sd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=cs(t,null,r,n):qe(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:_t(r,s),Ih(e,t,r,s,n);case 7:return qe(e,t,t.pendingProps,n),t.child;case 8:return qe(e,t,t.pendingProps.children,n),t.child;case 12:return qe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,o=t.memoizedProps,i=s.value,fe(Na,r._currentValue),r._currentValue=i,o!==null)if(Dt(o.value,i)){if(o.children===s.children&&!at.current){t=xn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){i=o.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=fn(-1,n&-n),u.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?u.next=u:(u.next=h.next,h.next=u),c.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),ac(o.return,n,t),l.lanes|=n;break}u=u.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(H(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),ac(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}qe(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,ns(t,n),s=bt(s),r=r(s),t.flags|=1,qe(e,t,r,n),t.child;case 14:return r=t.type,s=_t(r,t.pendingProps),s=_t(r.type,s),Rh(e,t,r,s,n);case 15:return nx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:_t(r,s),Yi(e,t),t.tag=1,lt(r)?(e=!0,ya(t)):e=!1,ns(t,n),Jg(t,r,s),uc(t,r,s,n),fc(null,t,r,!0,e,n);case 19:return ax(e,t,n);case 22:return rx(e,t,n)}throw Error(H(156,t.tag))};function bx(e,t){return Qp(e,t)}function x2(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nt(e,t,n,r){return new x2(e,t,n,r)}function Dd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function y2(e){if(typeof e=="function")return Dd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===nd)return 11;if(e===rd)return 14}return 2}function Bn(e,t){var n=e.alternate;return n===null?(n=Nt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function qi(e,t,n,r,s,o){var i=2;if(r=e,typeof e=="function")Dd(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Or:return hr(n.children,s,o,t);case td:i=8,s|=8;break;case Tu:return e=Nt(12,n,t,s|2),e.elementType=Tu,e.lanes=o,e;case Lu:return e=Nt(13,n,t,s),e.elementType=Lu,e.lanes=o,e;case Au:return e=Nt(19,n,t,s),e.elementType=Au,e.lanes=o,e;case Tp:return il(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ip:i=10;break e;case Rp:i=9;break e;case nd:i=11;break e;case rd:i=14;break e;case _n:i=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=Nt(i,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function hr(e,t,n,r){return e=Nt(7,e,r,t),e.lanes=n,e}function il(e,t,n,r){return e=Nt(22,e,r,t),e.elementType=Tp,e.lanes=n,e.stateNode={isHidden:!1},e}function lu(e,t,n){return e=Nt(6,e,null,t),e.lanes=n,e}function uu(e,t,n){return t=Nt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function v2(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vl(0),this.expirationTimes=Vl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vl(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function $d(e,t,n,r,s,o,i,l,u){return e=new v2(e,t,n,l,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Nt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Nd(o),e}function w2(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$r,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function jx(e){if(!e)return Wn;e=e._reactInternals;e:{if(_r(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(lt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var n=e.type;if(lt(n))return jg(e,n,t)}return t}function kx(e,t,n,r,s,o,i,l,u){return e=$d(n,r,!0,e,s,o,i,l,u),e.context=jx(null),n=e.current,r=Ze(),s=Hn(n),o=fn(r,s),o.callback=t??null,On(n,o,s),e.current.lanes=s,Uo(e,s,r),ut(e,r),e}function al(e,t,n,r){var s=t.current,o=Ze(),i=Hn(s);return n=jx(n),t.context===null?t.context=n:t.pendingContext=n,t=fn(o,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=On(s,t,i),e!==null&&(zt(e,s,i,o),Wi(e,s,i)),i}function Ia(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Uh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Od(e,t){Uh(e,t),(e=e.alternate)&&Uh(e,t)}function N2(){return null}var Cx=typeof reportError=="function"?reportError:function(e){console.error(e)};function Fd(e){this._internalRoot=e}ll.prototype.render=Fd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));al(e,t,null,null)};ll.prototype.unmount=Fd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;wr(function(){al(null,e,null,null)}),t[pn]=null}};function ll(e){this._internalRoot=e}ll.prototype.unstable_scheduleHydration=function(e){if(e){var t=rg();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mn.length&&t!==0&&t<Mn[n].priority;n++);Mn.splice(n,0,e),n===0&&og(e)}};function Hd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ul(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Wh(){}function S2(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var c=Ia(i);o.call(c)}}var i=kx(t,r,e,0,null,!1,!1,"",Wh);return e._reactRootContainer=i,e[pn]=i.current,bo(e.nodeType===8?e.parentNode:e),wr(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var c=Ia(u);l.call(c)}}var u=$d(e,0,!1,null,null,!1,!1,"",Wh);return e._reactRootContainer=u,e[pn]=u.current,bo(e.nodeType===8?e.parentNode:e),wr(function(){al(t,u,n,r)}),u}function cl(e,t,n,r,s){var o=n._reactRootContainer;if(o){var i=o;if(typeof s=="function"){var l=s;s=function(){var u=Ia(i);l.call(u)}}al(t,i,e,s)}else i=S2(n,t,e,s,r);return Ia(i)}tg=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Zs(t.pendingLanes);n!==0&&(id(t,n|1),ut(t,_e()),!(ae&6)&&(hs=_e()+500,Jn()))}break;case 13:wr(function(){var r=gn(e,1);if(r!==null){var s=Ze();zt(r,e,1,s)}}),Od(e,1)}};ad=function(e){if(e.tag===13){var t=gn(e,134217728);if(t!==null){var n=Ze();zt(t,e,134217728,n)}Od(e,134217728)}};ng=function(e){if(e.tag===13){var t=Hn(e),n=gn(e,t);if(n!==null){var r=Ze();zt(n,e,t,r)}Od(e,t)}};rg=function(){return de};sg=function(e,t){var n=de;try{return de=e,t()}finally{de=n}};Wu=function(e,t,n){switch(t){case"input":if($u(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=el(r);if(!s)throw Error(H(90));Ap(r),$u(r,s)}}}break;case"textarea":Dp(e,n);break;case"select":t=n.value,t!=null&&Zr(e,!!n.multiple,t,!1)}};Up=Ld;Wp=wr;var b2={usingClientEntryPoint:!1,Events:[Ko,Vr,el,Bp,Vp,Ld]},Vs={findFiberByHostInstance:ar,bundleType:0,version:"18.3.0",rendererPackageName:"react-dom"},j2={bundleType:Vs.bundleType,version:Vs.version,rendererPackageName:Vs.rendererPackageName,rendererConfig:Vs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:vn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Yp(e),e===null?null:e.stateNode},findFiberByHostInstance:Vs.findFiberByHostInstance||N2,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.0-next-8a015b68cc-20240425"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Si=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Si.isDisabled&&Si.supportsFiber)try{Qa=Si.inject(j2),Yt=Si}catch{}}xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=b2;xt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Hd(t))throw Error(H(200));return w2(e,t,null,n)};xt.createRoot=function(e,t){if(!Hd(e))throw Error(H(299));var n=!1,r="",s=Cx;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=$d(e,1,!1,null,null,n,!1,r,s),e[pn]=t.current,bo(e.nodeType===8?e.parentNode:e),new Fd(t)};xt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=Yp(t),e=e===null?null:e.stateNode,e};xt.flushSync=function(e){return wr(e)};xt.hydrate=function(e,t,n){if(!ul(t))throw Error(H(200));return cl(null,e,t,!0,n)};xt.hydrateRoot=function(e,t,n){if(!Hd(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",i=Cx;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=kx(t,null,e,1,n??null,s,!1,o,i),e[pn]=t.current,bo(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new ll(t)};xt.render=function(e,t,n){if(!ul(t))throw Error(H(200));return cl(null,e,t,!1,n)};xt.unmountComponentAtNode=function(e){if(!ul(e))throw Error(H(40));return e._reactRootContainer?(wr(function(){cl(null,null,e,!1,function(){e._reactRootContainer=null,e[pn]=null})}),!0):!1};xt.unstable_batchedUpdates=Ld;xt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ul(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return cl(e,t,n,!1,r)};xt.version="18.3.0-next-8a015b68cc-20240425";function Ex(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ex)}catch(e){console.error(e)}}Ex(),Ep.exports=xt;var dl=Ep.exports;const k2=Gc(dl);var Kh=dl;Iu.createRoot=Kh.createRoot,Iu.hydrateRoot=Kh.hydrateRoot;/**
41
+ * react-router v7.1.0
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */var Gh="popstate";function C2(e={}){function t(r,s){let{pathname:o,search:i,hash:l}=r.location;return jc("",{pathname:o,search:i,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Ro(s)}return _2(t,n,null,e)}function Ne(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function kt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function E2(){return Math.random().toString(36).substring(2,10)}function Yh(e,t){return{usr:e.state,key:e.key,idx:t}}function jc(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Es(t):t,state:n,key:t&&t.key||r||E2()}}function Ro({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Es(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function _2(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:o=!1}=r,i=s.history,l="POP",u=null,c=h();c==null&&(c=0,i.replaceState({...i.state,idx:c},""));function h(){return(i.state||{idx:null}).idx}function d(){l="POP";let N=h(),p=N==null?null:N-c;c=N,u&&u({action:l,location:w.location,delta:p})}function f(N,p){l="PUSH";let v=jc(w.location,N,p);c=h()+1;let y=Yh(v,c),S=w.createHref(v);try{i.pushState(y,"",S)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;s.location.assign(S)}o&&u&&u({action:l,location:w.location,delta:1})}function g(N,p){l="REPLACE";let v=jc(w.location,N,p);c=h();let y=Yh(v,c),S=w.createHref(v);i.replaceState(y,"",S),o&&u&&u({action:l,location:w.location,delta:0})}function x(N){let p=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof N=="string"?N:Ro(N);return v=v.replace(/ $/,"%20"),Ne(p,`No window.location.(origin|href) available to create URL for href: ${v}`),new URL(v,p)}let w={get action(){return l},get location(){return e(s,i)},listen(N){if(u)throw new Error("A history only accepts one active listener");return s.addEventListener(Gh,d),u=N,()=>{s.removeEventListener(Gh,d),u=null}},createHref(N){return t(s,N)},createURL:x,encodeLocation(N){let p=x(N);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:f,replace:g,go(N){return i.go(N)}};return w}function _x(e,t,n="/"){return P2(e,t,n,!1)}function P2(e,t,n,r){let s=typeof t=="string"?Es(t):t,o=Kn(s.pathname||"/",n);if(o==null)return null;let i=Px(e);M2(i);let l=null;for(let u=0;l==null&&u<i.length;++u){let c=H2(o);l=O2(i[u],c,r)}return l}function Px(e,t=[],n=[],r=""){let s=(o,i,l)=>{let u={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};u.relativePath.startsWith("/")&&(Ne(u.relativePath.startsWith(r),`Absolute route path "${u.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(r.length));let c=hn([r,u.relativePath]),h=n.concat(u);o.children&&o.children.length>0&&(Ne(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),Px(o.children,t,h,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:D2(c,o.index),routesMeta:h})};return e.forEach((o,i)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))s(o,i);else for(let u of Mx(o.path))s(o,i,u)}),t}function Mx(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let i=Mx(r.join("/")),l=[];return l.push(...i.map(u=>u===""?o:[o,u].join("/"))),s&&l.push(...i),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function M2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$2(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var I2=/^:[\w-]+$/,R2=3,T2=2,L2=1,A2=10,z2=-2,Xh=e=>e==="*";function D2(e,t){let n=e.split("/"),r=n.length;return n.some(Xh)&&(r+=z2),t&&(r+=T2),n.filter(s=>!Xh(s)).reduce((s,o)=>s+(I2.test(o)?R2:o===""?L2:A2),r)}function $2(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function O2(e,t,n=!1){let{routesMeta:r}=e,s={},o="/",i=[];for(let l=0;l<r.length;++l){let u=r[l],c=l===r.length-1,h=o==="/"?t:t.slice(o.length)||"/",d=Ra({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},h),f=u.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Ra({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!d)return null;Object.assign(s,d.params),i.push({params:s,pathname:hn([o,d.pathname]),pathnameBase:W2(hn([o,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(o=hn([o,d.pathnameBase]))}return i}function Ra(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=F2(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],i=o.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((c,{paramName:h,isOptional:d},f)=>{if(h==="*"){let x=l[f]||"";i=o.slice(0,o.length-x.length).replace(/(.)\/+$/,"$1")}const g=l[f];return d&&!g?c[h]=void 0:c[h]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:i,pattern:e}}function F2(e,t=!1,n=!0){kt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,u)=>(r.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function H2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return kt(!1,`The URL path "${e}" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Kn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function B2(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Es(e):e;return{pathname:n?n.startsWith("/")?n:V2(n,t):t,search:K2(r),hash:G2(s)}}function V2(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function cu(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function U2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Bd(e){let t=U2(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Vd(e,t,n,r=!1){let s;typeof e=="string"?s=Es(e):(s={...e},Ne(!s.pathname||!s.pathname.includes("?"),cu("?","pathname","search",s)),Ne(!s.pathname||!s.pathname.includes("#"),cu("#","pathname","hash",s)),Ne(!s.search||!s.search.includes("#"),cu("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,l;if(i==null)l=n;else{let d=t.length-1;if(!r&&i.startsWith("..")){let f=i.split("/");for(;f[0]==="..";)f.shift(),d-=1;s.pathname=f.join("/")}l=d>=0?t[d]:"/"}let u=B2(s,l),c=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||h)&&(u.pathname+="/"),u}var hn=e=>e.join("/").replace(/\/\/+/g,"/"),W2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),K2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,G2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Y2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Ix=["POST","PUT","PATCH","DELETE"];new Set(Ix);var X2=["GET",...Ix];new Set(X2);var _s=m.createContext(null);_s.displayName="DataRouter";var fl=m.createContext(null);fl.displayName="DataRouterState";var Rx=m.createContext({isTransitioning:!1});Rx.displayName="ViewTransition";var Q2=m.createContext(new Map);Q2.displayName="Fetchers";var q2=m.createContext(null);q2.displayName="Await";var Ot=m.createContext(null);Ot.displayName="Navigation";var Yo=m.createContext(null);Yo.displayName="Location";var Ct=m.createContext({outlet:null,matches:[],isDataRoute:!1});Ct.displayName="Route";var Ud=m.createContext(null);Ud.displayName="RouteError";function Z2(e,{relative:t}={}){Ne(Ps(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=m.useContext(Ot),{hash:s,pathname:o,search:i}=Xo(e,{relative:t}),l=o;return n!=="/"&&(l=o==="/"?n:hn([n,o])),r.createHref({pathname:l,search:i,hash:s})}function Ps(){return m.useContext(Yo)!=null}function tn(){return Ne(Ps(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(Yo).location}var Tx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Lx(e){m.useContext(Ot).static||m.useLayoutEffect(e)}function hl(){let{isDataRoute:e}=m.useContext(Ct);return e?mS():J2()}function J2(){Ne(Ps(),"useNavigate() may be used only in the context of a <Router> component.");let e=m.useContext(_s),{basename:t,navigator:n}=m.useContext(Ot),{matches:r}=m.useContext(Ct),{pathname:s}=tn(),o=JSON.stringify(Bd(r)),i=m.useRef(!1);return Lx(()=>{i.current=!0}),m.useCallback((u,c={})=>{if(kt(i.current,Tx),!i.current)return;if(typeof u=="number"){n.go(u);return}let h=Vd(u,JSON.parse(o),s,c.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:hn([t,h.pathname])),(c.replace?n.replace:n.push)(h,c.state,c)},[t,n,o,s,e])}var eS=m.createContext(null);function tS(e){let t=m.useContext(Ct).outlet;return t&&m.createElement(eS.Provider,{value:e},t)}function nS(){let{matches:e}=m.useContext(Ct),t=e[e.length-1];return t?t.params:{}}function Xo(e,{relative:t}={}){let{matches:n}=m.useContext(Ct),{pathname:r}=tn(),s=JSON.stringify(Bd(n));return m.useMemo(()=>Vd(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function rS(e,t){return Ax(e,t)}function Ax(e,t,n,r){var p;Ne(Ps(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=m.useContext(Ot),{matches:o}=m.useContext(Ct),i=o[o.length-1],l=i?i.params:{},u=i?i.pathname:"/",c=i?i.pathnameBase:"/",h=i&&i.route;{let v=h&&h.path||"";zx(u,!h||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${v}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
50
+
51
+ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let d=tn(),f;if(t){let v=typeof t=="string"?Es(t):t;Ne(c==="/"||((p=v.pathname)==null?void 0:p.startsWith(c)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${v.pathname}" was given in the \`location\` prop.`),f=v}else f=d;let g=f.pathname||"/",x=g;if(c!=="/"){let v=c.replace(/^\//,"").split("/");x="/"+g.replace(/^\//,"").split("/").slice(v.length).join("/")}let w=_x(e,{pathname:x});kt(h||w!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),kt(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let N=lS(w&&w.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:hn([c,s.encodeLocation?s.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:hn([c,s.encodeLocation?s.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),o,n,r);return t&&N?m.createElement(Yo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},N):N}function sS(){let e=hS(),t=Y2(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:o},"ErrorBoundary")," or"," ",m.createElement("code",{style:o},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:s},n):null,i)}var oS=m.createElement(sS,null),iS=class extends m.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?m.createElement(Ct.Provider,{value:this.props.routeContext},m.createElement(Ud.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function aS({routeContext:e,match:t,children:n}){let r=m.useContext(_s);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(Ct.Provider,{value:e},n)}function lS(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,o=n==null?void 0:n.errors;if(o!=null){let u=s.findIndex(c=>c.route.id&&(o==null?void 0:o[c.route.id])!==void 0);Ne(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,u+1))}let i=!1,l=-1;if(n)for(let u=0;u<s.length;u++){let c=s[u];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(l=u),c.route.id){let{loaderData:h,errors:d}=n,f=c.route.loader&&!h.hasOwnProperty(c.route.id)&&(!d||d[c.route.id]===void 0);if(c.route.lazy||f){i=!0,l>=0?s=s.slice(0,l+1):s=[s[0]];break}}}return s.reduceRight((u,c,h)=>{let d,f=!1,g=null,x=null;n&&(d=o&&c.route.id?o[c.route.id]:void 0,g=c.route.errorElement||oS,i&&(l<0&&h===0?(zx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,x=null):l===h&&(f=!0,x=c.route.hydrateFallbackElement||null)));let w=t.concat(s.slice(0,h+1)),N=()=>{let p;return d?p=g:f?p=x:c.route.Component?p=m.createElement(c.route.Component,null):c.route.element?p=c.route.element:p=u,m.createElement(aS,{match:c,routeContext:{outlet:u,matches:w,isDataRoute:n!=null},children:p})};return n&&(c.route.ErrorBoundary||c.route.errorElement||h===0)?m.createElement(iS,{location:n.location,revalidation:n.revalidation,component:g,error:d,children:N(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):N()},null)}function Wd(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function uS(e){let t=m.useContext(_s);return Ne(t,Wd(e)),t}function cS(e){let t=m.useContext(fl);return Ne(t,Wd(e)),t}function dS(e){let t=m.useContext(Ct);return Ne(t,Wd(e)),t}function Kd(e){let t=dS(e),n=t.matches[t.matches.length-1];return Ne(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function fS(){return Kd("useRouteId")}function hS(){var r;let e=m.useContext(Ud),t=cS("useRouteError"),n=Kd("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function mS(){let{router:e}=uS("useNavigate"),t=Kd("useNavigate"),n=m.useRef(!1);return Lx(()=>{n.current=!0}),m.useCallback(async(s,o={})=>{kt(n.current,Tx),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var Qh={};function zx(e,t,n){!t&&!Qh[e]&&(Qh[e]=!0,kt(!1,n))}m.memo(pS);function pS({routes:e,future:t,state:n}){return Ax(e,void 0,n,t)}function kc({to:e,replace:t,state:n,relative:r}){Ne(Ps(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=m.useContext(Ot);kt(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=m.useContext(Ct),{pathname:i}=tn(),l=hl(),u=Vd(e,Bd(o),i,r==="path"),c=JSON.stringify(u);return m.useEffect(()=>{l(JSON.parse(c),{replace:t,state:n,relative:r})},[l,c,r,t,n]),null}function gS(e){return tS(e.context)}function Ge(e){Ne(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function xS({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:o=!1}){Ne(!Ps(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),l=m.useMemo(()=>({basename:i,navigator:s,static:o,future:{}}),[i,s,o]);typeof n=="string"&&(n=Es(n));let{pathname:u="/",search:c="",hash:h="",state:d=null,key:f="default"}=n,g=m.useMemo(()=>{let x=Kn(u,i);return x==null?null:{location:{pathname:x,search:c,hash:h,state:d,key:f},navigationType:r}},[i,u,c,h,d,f,r]);return kt(g!=null,`<Router basename="${i}"> is not able to match the URL "${u}${c}${h}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:m.createElement(Ot.Provider,{value:l},m.createElement(Yo.Provider,{children:t,value:g}))}function yS({children:e,location:t}){return rS(Cc(e),t)}function Cc(e,t=[]){let n=[];return m.Children.forEach(e,(r,s)=>{if(!m.isValidElement(r))return;let o=[...t,s];if(r.type===m.Fragment){n.push.apply(n,Cc(r.props.children,o));return}Ne(r.type===Ge,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ne(!r.props.index||!r.props.children,"An index route cannot have child routes.");let i={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Cc(r.props.children,o)),n.push(i)}),n}var Zi="get",Ji="application/x-www-form-urlencoded";function ml(e){return e!=null&&typeof e.tagName=="string"}function vS(e){return ml(e)&&e.tagName.toLowerCase()==="button"}function wS(e){return ml(e)&&e.tagName.toLowerCase()==="form"}function NS(e){return ml(e)&&e.tagName.toLowerCase()==="input"}function SS(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function bS(e,t){return e.button===0&&(!t||t==="_self")&&!SS(e)}function Ec(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function jS(e,t){let n=Ec(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}var bi=null;function kS(){if(bi===null)try{new FormData(document.createElement("form"),0),bi=!1}catch{bi=!0}return bi}var CS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function du(e){return e!=null&&!CS.has(e)?(kt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ji}"`),null):e}function ES(e,t){let n,r,s,o,i;if(wS(e)){let l=e.getAttribute("action");r=l?Kn(l,t):null,n=e.getAttribute("method")||Zi,s=du(e.getAttribute("enctype"))||Ji,o=new FormData(e)}else if(vS(e)||NS(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||l.getAttribute("action");if(r=u?Kn(u,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||Zi,s=du(e.getAttribute("formenctype"))||du(l.getAttribute("enctype"))||Ji,o=new FormData(l,e),!kS()){let{name:c,type:h,value:d}=e;if(h==="image"){let f=c?`${c}.`:"";o.append(`${f}x`,"0"),o.append(`${f}y`,"0")}else c&&o.append(c,d)}}else{if(ml(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Zi,r=null,s=Ji,i=e}return o&&s==="text/plain"&&(i=o,o=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:o,body:i}}function Gd(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function _S(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function PS(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function MS(e,t,n){let r=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let i=await _S(o,n);return i.links?i.links():[]}return[]}));return LS(r.flat(1).filter(PS).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function qh(e,t,n,r,s,o){let i=(u,c)=>n[c]?u.route.id!==n[c].route.id:!0,l=(u,c)=>{var h;return n[c].pathname!==u.pathname||((h=n[c].route.path)==null?void 0:h.endsWith("*"))&&n[c].params["*"]!==u.params["*"]};return o==="assets"?t.filter((u,c)=>i(u,c)||l(u,c)):o==="data"?t.filter((u,c)=>{var d;let h=r.routes[u.route.id];if(!h||!h.hasLoader)return!1;if(i(u,c)||l(u,c))return!0;if(u.route.shouldRevalidate){let f=u.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((d=n[0])==null?void 0:d.params)||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function IS(e,t){return RS(e.map(n=>{let r=t.routes[n.route.id];if(!r)return[];let s=[r.module];return r.imports&&(s=s.concat(r.imports)),s}).flat(1))}function RS(e){return[...new Set(e)]}function TS(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function LS(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let o=JSON.stringify(TS(s));return n.has(o)||(n.add(o),r.push({key:o,link:s})),r},[])}function AS(e){let t=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return t.pathname==="/"?t.pathname="_root.data":t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}function zS(){let e=m.useContext(_s);return Gd(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function DS(){let e=m.useContext(fl);return Gd(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Yd=m.createContext(void 0);Yd.displayName="FrameworkContext";function Dx(){let e=m.useContext(Yd);return Gd(e,"You must render this element inside a <HydratedRouter> element"),e}function $S(e,t){let n=m.useContext(Yd),[r,s]=m.useState(!1),[o,i]=m.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:c,onMouseLeave:h,onTouchStart:d}=t,f=m.useRef(null);m.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let w=p=>{p.forEach(v=>{i(v.isIntersecting)})},N=new IntersectionObserver(w,{threshold:.5});return f.current&&N.observe(f.current),()=>{N.disconnect()}}},[e]),m.useEffect(()=>{if(r){let w=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(w)}}},[r]);let g=()=>{s(!0)},x=()=>{s(!1),i(!1)};return n?e!=="intent"?[o,f,{}]:[o,f,{onFocus:Us(l,g),onBlur:Us(u,x),onMouseEnter:Us(c,g),onMouseLeave:Us(h,x),onTouchStart:Us(d,g)}]:[!1,f,{}]}function Us(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function OS({page:e,...t}){let{router:n}=zS(),r=m.useMemo(()=>_x(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?m.createElement(HS,{page:e,matches:r,...t}):null}function FS(e){let{manifest:t,routeModules:n}=Dx(),[r,s]=m.useState([]);return m.useEffect(()=>{let o=!1;return MS(e,t,n).then(i=>{o||s(i)}),()=>{o=!0}},[e,t,n]),r}function HS({page:e,matches:t,...n}){let r=tn(),{manifest:s,routeModules:o}=Dx(),{loaderData:i,matches:l}=DS(),u=m.useMemo(()=>qh(e,t,l,s,r,"data"),[e,t,l,s,r]),c=m.useMemo(()=>qh(e,t,l,s,r,"assets"),[e,t,l,s,r]),h=m.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let g=new Set,x=!1;if(t.forEach(N=>{var v;let p=s.routes[N.route.id];!p||!p.hasLoader||(!u.some(y=>y.route.id===N.route.id)&&N.route.id in i&&((v=o[N.route.id])!=null&&v.shouldRevalidate)||p.hasClientLoader?x=!0:g.add(N.route.id))}),g.size===0)return[];let w=AS(e);return x&&g.size>0&&w.searchParams.set("_routes",t.filter(N=>g.has(N.route.id)).map(N=>N.route.id).join(",")),[w.pathname+w.search]},[i,r,s,u,t,e,o]),d=m.useMemo(()=>IS(c,s),[c,s]),f=FS(c);return m.createElement(m.Fragment,null,h.map(g=>m.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...n})),d.map(g=>m.createElement("link",{key:g,rel:"modulepreload",href:g,...n})),f.map(({key:g,link:x})=>m.createElement("link",{key:g,...x})))}function BS(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var $x=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{$x&&(window.__reactRouterVersion="7.1.0")}catch{}function VS({basename:e,children:t,window:n}){let r=m.useRef();r.current==null&&(r.current=C2({window:n,v5Compat:!0}));let s=r.current,[o,i]=m.useState({action:s.action,location:s.location}),l=m.useCallback(u=>{m.startTransition(()=>i(u))},[i]);return m.useLayoutEffect(()=>s.listen(l),[s,l]),m.createElement(xS,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}var Ox=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gn=m.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:o,replace:i,state:l,target:u,to:c,preventScrollReset:h,viewTransition:d,...f},g){let{basename:x}=m.useContext(Ot),w=typeof c=="string"&&Ox.test(c),N,p=!1;if(typeof c=="string"&&w&&(N=c,$x))try{let I=new URL(window.location.href),$=c.startsWith("//")?new URL(I.protocol+c):new URL(c),R=Kn($.pathname,x);$.origin===I.origin&&R!=null?c=R+$.search+$.hash:p=!0}catch{kt(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let v=Z2(c,{relative:s}),[y,S,b]=$S(r,f),C=KS(c,{replace:i,state:l,target:u,preventScrollReset:h,relative:s,viewTransition:d});function j(I){t&&t(I),I.defaultPrevented||C(I)}let P=m.createElement("a",{...f,...b,href:N||v,onClick:p||o?t:j,ref:BS(g,S),target:u,"data-discover":!w&&n==="render"?"true":void 0});return y&&!w?m.createElement(m.Fragment,null,P,m.createElement(OS,{page:v})):P});Gn.displayName="Link";var Fx=m.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:o,to:i,viewTransition:l,children:u,...c},h){let d=Xo(i,{relative:c.relative}),f=tn(),g=m.useContext(fl),{navigator:x,basename:w}=m.useContext(Ot),N=g!=null&&ZS(d)&&l===!0,p=x.encodeLocation?x.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(v=v.toLowerCase(),y=y?y.toLowerCase():null,p=p.toLowerCase()),y&&w&&(y=Kn(y,w)||y);const S=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let b=v===p||!s&&v.startsWith(p)&&v.charAt(S)==="/",C=y!=null&&(y===p||!s&&y.startsWith(p)&&y.charAt(p.length)==="/"),j={isActive:b,isPending:C,isTransitioning:N},P=b?t:void 0,I;typeof r=="function"?I=r(j):I=[r,b?"active":null,C?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let $=typeof o=="function"?o(j):o;return m.createElement(Gn,{...c,"aria-current":P,className:I,ref:h,style:$,to:i,viewTransition:l},typeof u=="function"?u(j):u)});Fx.displayName="NavLink";var US=m.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:o,method:i=Zi,action:l,onSubmit:u,relative:c,preventScrollReset:h,viewTransition:d,...f},g)=>{let x=QS(),w=qS(l,{relative:c}),N=i.toLowerCase()==="get"?"get":"post",p=typeof l=="string"&&Ox.test(l),v=y=>{if(u&&u(y),y.defaultPrevented)return;y.preventDefault();let S=y.nativeEvent.submitter,b=(S==null?void 0:S.getAttribute("formmethod"))||i;x(S||y.currentTarget,{fetcherKey:t,method:b,navigate:n,replace:s,state:o,relative:c,preventScrollReset:h,viewTransition:d})};return m.createElement("form",{ref:g,method:N,action:w,onSubmit:r?u:v,...f,"data-discover":!p&&e==="render"?"true":void 0})});US.displayName="Form";function WS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Hx(e){let t=m.useContext(_s);return Ne(t,WS(e)),t}function KS(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:o,viewTransition:i}={}){let l=hl(),u=tn(),c=Xo(e,{relative:o});return m.useCallback(h=>{if(bS(h,t)){h.preventDefault();let d=n!==void 0?n:Ro(u)===Ro(c);l(e,{replace:d,state:r,preventScrollReset:s,relative:o,viewTransition:i})}},[u,l,c,n,r,t,e,s,o,i])}function GS(e){kt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=m.useRef(Ec(e)),n=m.useRef(!1),r=tn(),s=m.useMemo(()=>jS(r.search,n.current?null:t.current),[r.search]),o=hl(),i=m.useCallback((l,u)=>{const c=Ec(typeof l=="function"?l(s):l);n.current=!0,o("?"+c,u)},[o,s]);return[s,i]}var YS=0,XS=()=>`__${String(++YS)}__`;function QS(){let{router:e}=Hx("useSubmit"),{basename:t}=m.useContext(Ot),n=fS();return m.useCallback(async(r,s={})=>{let{action:o,method:i,encType:l,formData:u,body:c}=ES(r,t);if(s.navigate===!1){let h=s.fetcherKey||XS();await e.fetch(h,n,s.action||o,{preventScrollReset:s.preventScrollReset,formData:u,body:c,formMethod:s.method||i,formEncType:s.encType||l,flushSync:s.flushSync})}else await e.navigate(s.action||o,{preventScrollReset:s.preventScrollReset,formData:u,body:c,formMethod:s.method||i,formEncType:s.encType||l,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function qS(e,{relative:t}={}){let{basename:n}=m.useContext(Ot),r=m.useContext(Ct);Ne(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),o={...Xo(e||".",{relative:t})},i=tn();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),u=l.getAll("index");if(u.some(h=>h==="")){l.delete("index"),u.filter(d=>d).forEach(d=>l.append("index",d));let h=l.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:hn([n,o.pathname])),Ro(o)}function ZS(e,t={}){let n=m.useContext(Rx);Ne(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Hx("useViewTransitionState"),s=Xo(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Kn(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Kn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ra(s.pathname,i)!=null||Ra(s.pathname,o)!=null}new TextEncoder;const Bx=m.createContext(null);function JS({children:e}){const[t,n]=m.useState(()=>localStorage.getItem("opentrust_theme")||"dark"),r=s=>{n(s),localStorage.setItem("opentrust_theme",s)};return m.useEffect(()=>{const s=document.documentElement;if(s.classList.remove("light","dark"),t==="system"){const o=window.matchMedia("(prefers-color-scheme: dark)").matches;s.classList.add(o?"dark":"light")}else s.classList.add(t)},[t]),a.jsx(Bx.Provider,{value:{theme:t,setTheme:r},children:e})}function eb(){const e=m.useContext(Bx);if(!e)throw new Error("useTheme must be within ThemeProvider");return e}const Vx=m.createContext(null);function tb({children:e}){const[t,n]=m.useState(()=>{const l=localStorage.getItem("opentrust_user");return l?JSON.parse(l):null}),[r,s]=m.useState(!!localStorage.getItem("opentrust_user"));m.useEffect(()=>{if(!t){s(!1);return}let l=!1;return(async()=>{try{(await fetch("/api/auth/me",{headers:{Authorization:`Bearer ${t.apiKey}`}})).ok||l||(n(null),localStorage.removeItem("opentrust_user"))}catch{}finally{l||s(!1)}})(),()=>{l=!0}},[]);const o=m.useCallback(async(l,u)=>{const c=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:l,password:u})}),h=await c.json();if(!c.ok||!h.success)throw new Error(h.error??"Login failed");const d={email:h.email,apiKey:h.apiKey,name:h.name};n(d),localStorage.setItem("opentrust_user",JSON.stringify(d))},[]),i=m.useCallback(()=>{n(null),localStorage.removeItem("opentrust_user")},[]);return a.jsx(Vx.Provider,{value:{user:t,isAuthenticated:!!t,isLoading:r,login:o,logout:i},children:e})}function Xd(){const e=m.useContext(Vx);if(!e)throw new Error("useAuth must be within AuthProvider");return e}function Ux(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Ux(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function nb(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Ux(e))&&(r&&(r+=" "),r+=t);return r}const Qd="-";function rb(e){const t=ob(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function s(i){const l=i.split(Qd);return l[0]===""&&l.length!==1&&l.shift(),Wx(l,t)||sb(i)}function o(i,l){const u=n[i]||[];return l&&r[i]?[...u,...r[i]]:u}return{getClassGroupId:s,getConflictingClassGroupIds:o}}function Wx(e,t){var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Wx(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Qd);return(i=t.validators.find(({validator:l})=>l(o)))==null?void 0:i.classGroupId}const Zh=/^\[(.+)\]$/;function sb(e){if(Zh.test(e)){const t=Zh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function ob(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ab(Object.entries(e.classGroups),n).forEach(([o,i])=>{_c(i,r,o,t)}),r}function _c(e,t,n,r){e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Jh(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(ib(s)){_c(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,i])=>{_c(i,Jh(t,o),n,r)})})}function Jh(e,t){let n=e;return t.split(Qd).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function ib(e){return e.isThemeGetter}function ab(e,t){return t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,l])=>[t+i,l])):o);return[n,s]}):e}function lb(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function s(o,i){n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)}return{get(o){let i=n.get(o);if(i!==void 0)return i;if((i=r.get(o))!==void 0)return s(o,i),i},set(o,i){n.has(o)?n.set(o,i):s(o,i)}}}const Kx="!";function ub(e){const t=e.separator,n=t.length===1,r=t[0],s=t.length;return function(i){const l=[];let u=0,c=0,h;for(let w=0;w<i.length;w++){let N=i[w];if(u===0){if(N===r&&(n||i.slice(w,w+s)===t)){l.push(i.slice(c,w)),c=w+s;continue}if(N==="/"){h=w;continue}}N==="["?u++:N==="]"&&u--}const d=l.length===0?i:i.substring(c),f=d.startsWith(Kx),g=f?d.substring(1):d,x=h&&h>c?h-c:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:g,maybePostfixModifierPosition:x}}}function cb(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function db(e){return{cache:lb(e.cacheSize),splitModifiers:ub(e),...rb(e)}}const fb=/\s+/;function hb(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=new Set;return e.trim().split(fb).map(i=>{const{modifiers:l,hasImportantModifier:u,baseClassName:c,maybePostfixModifierPosition:h}=n(i);let d=r(h?c.substring(0,h):c),f=!!h;if(!d){if(!h)return{isTailwindClass:!1,originalClassName:i};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:i};f=!1}const g=cb(l).join(":");return{isTailwindClass:!0,modifierId:u?g+Kx:g,classGroupId:d,originalClassName:i,hasPostfixModifier:f}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:l,classGroupId:u,hasPostfixModifier:c}=i,h=l+u;return o.has(h)?!1:(o.add(h),s(u,c).forEach(d=>o.add(l+d)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function mb(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Gx(t))&&(r&&(r+=" "),r+=n);return r}function Gx(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Gx(e[r]))&&(n&&(n+=" "),n+=t);return n}function pb(e,...t){let n,r,s,o=i;function i(u){const c=t.reduce((h,d)=>d(h),e());return n=db(c),r=n.cache.get,s=n.cache.set,o=l,l(u)}function l(u){const c=r(u);if(c)return c;const h=hb(u,n);return s(u,h),h}return function(){return o(mb.apply(null,arguments))}}function pe(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const Yx=/^\[(?:([a-z-]+):)?(.+)\]$/i,gb=/^\d+\/\d+$/,xb=new Set(["px","full","screen"]),yb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,wb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Nb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Sb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function sn(e){return cr(e)||xb.has(e)||gb.test(e)}function bn(e){return Ms(e,"length",Mb)}function cr(e){return!!e&&!Number.isNaN(Number(e))}function ji(e){return Ms(e,"number",cr)}function Ws(e){return!!e&&Number.isInteger(Number(e))}function bb(e){return e.endsWith("%")&&cr(e.slice(0,-1))}function ne(e){return Yx.test(e)}function jn(e){return yb.test(e)}const jb=new Set(["length","size","percentage"]);function kb(e){return Ms(e,jb,Xx)}function Cb(e){return Ms(e,"position",Xx)}const Eb=new Set(["image","url"]);function _b(e){return Ms(e,Eb,Rb)}function Pb(e){return Ms(e,"",Ib)}function Ks(){return!0}function Ms(e,t,n){const r=Yx.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function Mb(e){return vb.test(e)&&!wb.test(e)}function Xx(){return!1}function Ib(e){return Nb.test(e)}function Rb(e){return Sb.test(e)}function Tb(){const e=pe("colors"),t=pe("spacing"),n=pe("blur"),r=pe("brightness"),s=pe("borderColor"),o=pe("borderRadius"),i=pe("borderSpacing"),l=pe("borderWidth"),u=pe("contrast"),c=pe("grayscale"),h=pe("hueRotate"),d=pe("invert"),f=pe("gap"),g=pe("gradientColorStops"),x=pe("gradientColorStopPositions"),w=pe("inset"),N=pe("margin"),p=pe("opacity"),v=pe("padding"),y=pe("saturate"),S=pe("scale"),b=pe("sepia"),C=pe("skew"),j=pe("space"),P=pe("translate"),I=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",ne,t],T=()=>[ne,t],D=()=>["",sn,bn],E=()=>["auto",cr,ne],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],k=()=>["solid","dashed","dotted","double","none"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_=()=>["start","end","center","between","around","evenly","stretch"],M=()=>["","0",ne],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[cr,ji],O=()=>[cr,ne];return{cacheSize:500,separator:":",theme:{colors:[Ks],spacing:[sn,bn],blur:["none","",jn,ne],brightness:F(),borderColor:[e],borderRadius:["none","","full",jn,ne],borderSpacing:T(),borderWidth:D(),contrast:F(),grayscale:M(),hueRotate:O(),invert:M(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[bb,bn],inset:R(),margin:R(),opacity:F(),padding:T(),saturate:F(),scale:F(),sepia:M(),skew:O(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[jn]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...L(),ne]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ws,ne]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ne]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",Ws,ne]}],"grid-cols":[{"grid-cols":[Ks]}],"col-start-end":[{col:["auto",{span:["full",Ws,ne]},ne]}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":[Ks]}],"row-start-end":[{row:["auto",{span:[Ws,ne]},ne]}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ne]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[N]}],mx:[{mx:[N]}],my:[{my:[N]}],ms:[{ms:[N]}],me:[{me:[N]}],mt:[{mt:[N]}],mr:[{mr:[N]}],mb:[{mb:[N]}],ml:[{ml:[N]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ne,t]}],"min-w":[{"min-w":[ne,t,"min","max","fit"]}],"max-w":[{"max-w":[ne,t,"none","full","min","max","fit","prose",{screen:[jn]},jn]}],h:[{h:[ne,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ne,t,"auto","min","max","fit"]}],"font-size":[{text:["base",jn,bn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ji]}],"font-family":[{font:[Ks]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ne]}],"line-clamp":[{"line-clamp":["none",cr,ji]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",sn,ne]}],"list-image":[{"list-image":["none",ne]}],"list-style-type":[{list:["none","disc","decimal",ne]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[p]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...k(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",sn,bn]}],"underline-offset":[{"underline-offset":["auto",sn,ne]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[p]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...L(),Cb]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kb]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_b]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[p]}],"border-style":[{border:[...k(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[p]}],"divide-style":[{divide:k()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...k()]}],"outline-offset":[{"outline-offset":[sn,ne]}],"outline-w":[{outline:[sn,bn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[sn,bn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",jn,Pb]}],"shadow-color":[{shadow:[Ks]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",jn,ne]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[b]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[b]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ne]}],duration:[{duration:O()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Ws,ne]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ne]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ne]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ne]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[sn,bn,ji]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const Lb=pb(Tb);function Pe(...e){return Lb(nb(e))}/**
52
+ * @license lucide-react v0.400.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const Ab=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Qx=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
57
+ * @license lucide-react v0.400.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */var zb={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"};/**
62
+ * @license lucide-react v0.400.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */const Db=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...l},u)=>m.createElement("svg",{ref:u,...zb,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Qx("lucide",s),...l},[...i.map(([c,h])=>m.createElement(c,h)),...Array.isArray(o)?o:[o]]));/**
67
+ * @license lucide-react v0.400.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const Z=(e,t)=>{const n=m.forwardRef(({className:r,...s},o)=>m.createElement(Db,{ref:o,iconNode:t,className:Qx(`lucide-${Ab(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
72
+ * @license lucide-react v0.400.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const $b=Z("Activity",[["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"}]]);/**
77
+ * @license lucide-react v0.400.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const Ob=Z("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
82
+ * @license lucide-react v0.400.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const Fb=Z("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
87
+ * @license lucide-react v0.400.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const Hb=Z("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
92
+ * @license lucide-react v0.400.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const Qo=Z("Bot",[["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"}]]);/**
97
+ * @license lucide-react v0.400.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const pl=Z("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
102
+ * @license lucide-react v0.400.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const qd=Z("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
107
+ * @license lucide-react v0.400.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const Bb=Z("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
112
+ * @license lucide-react v0.400.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const Zd=Z("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
117
+ * @license lucide-react v0.400.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const gl=Z("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
122
+ * @license lucide-react v0.400.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const Yn=Z("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
127
+ * @license lucide-react v0.400.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const pt=Z("CircleX",[["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"}]]);/**
132
+ * @license lucide-react v0.400.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const Vb=Z("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
137
+ * @license lucide-react v0.400.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const Ub=Z("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
142
+ * @license lucide-react v0.400.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const Wb=Z("Copy",[["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"}]]);/**
147
+ * @license lucide-react v0.400.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const Kb=Z("Database",[["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"}]]);/**
152
+ * @license lucide-react v0.400.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const $t=Z("Download",[["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"}]]);/**
157
+ * @license lucide-react v0.400.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const Gb=Z("ExternalLink",[["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"}]]);/**
162
+ * @license lucide-react v0.400.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const Yb=Z("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
167
+ * @license lucide-react v0.400.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const Xb=Z("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
172
+ * @license lucide-react v0.400.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const Is=Z("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
177
+ * @license lucide-react v0.400.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const qx=Z("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]);/**
182
+ * @license lucide-react v0.400.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const Zx=Z("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
187
+ * @license lucide-react v0.400.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const Qb=Z("KeyRound",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
192
+ * @license lucide-react v0.400.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const qb=Z("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
197
+ * @license lucide-react v0.400.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const He=Z("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
202
+ * @license lucide-react v0.400.0 - ISC
203
+ *
204
+ * This source code is licensed under the ISC license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const Zb=Z("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
207
+ * @license lucide-react v0.400.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const Jb=Z("LogOut",[["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"}]]);/**
212
+ * @license lucide-react v0.400.0 - ISC
213
+ *
214
+ * This source code is licensed under the ISC license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const xl=Z("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
217
+ * @license lucide-react v0.400.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const ej=Z("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
222
+ * @license lucide-react v0.400.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const tj=Z("Network",[["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"}]]);/**
227
+ * @license lucide-react v0.400.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const Nr=Z("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
232
+ * @license lucide-react v0.400.0 - ISC
233
+ *
234
+ * This source code is licensed under the ISC license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const nj=Z("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
237
+ * @license lucide-react v0.400.0 - ISC
238
+ *
239
+ * This source code is licensed under the ISC license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const Ta=Z("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
242
+ * @license lucide-react v0.400.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const ea=Z("Puzzle",[["path",{d:"M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.077.877.528 1.073 1.01a2.5 2.5 0 1 0 3.259-3.259c-.482-.196-.933-.558-1.01-1.073-.05-.336.062-.676.303-.917l1.525-1.525A2.402 2.402 0 0 1 12 1.998c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.237 3.237c-.464.18-.894.527-.967 1.02Z",key:"i0oyt7"}]]);/**
247
+ * @license lucide-react v0.400.0 - ISC
248
+ *
249
+ * This source code is licensed under the ISC license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const Xn=Z("RefreshCw",[["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"}]]);/**
252
+ * @license lucide-react v0.400.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const La=Z("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
257
+ * @license lucide-react v0.400.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const Jx=Z("Save",[["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"}]]);/**
262
+ * @license lucide-react v0.400.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const rj=Z("ScrollText",[["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"}]]);/**
267
+ * @license lucide-react v0.400.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const ey=Z("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
272
+ * @license lucide-react v0.400.0 - ISC
273
+ *
274
+ * This source code is licensed under the ISC license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */const Jd=Z("Server",[["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"}]]);/**
277
+ * @license lucide-react v0.400.0 - ISC
278
+ *
279
+ * This source code is licensed under the ISC license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */const qt=Z("Settings",[["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"}]]);/**
282
+ * @license lucide-react v0.400.0 - ISC
283
+ *
284
+ * This source code is licensed under the ISC license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */const ty=Z("Shield",[["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"}]]);/**
287
+ * @license lucide-react v0.400.0 - ISC
288
+ *
289
+ * This source code is licensed under the ISC license.
290
+ * See the LICENSE file in the root directory of this source tree.
291
+ */const em=Z("SquareCheckBig",[["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}],["path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11",key:"1jnkn4"}]]);/**
292
+ * @license lucide-react v0.400.0 - ISC
293
+ *
294
+ * This source code is licensed under the ISC license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */const To=Z("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
297
+ * @license lucide-react v0.400.0 - ISC
298
+ *
299
+ * This source code is licensed under the ISC license.
300
+ * See the LICENSE file in the root directory of this source tree.
301
+ */const sj=Z("Sun",[["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"}]]);/**
302
+ * @license lucide-react v0.400.0 - ISC
303
+ *
304
+ * This source code is licensed under the ISC license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ */const ms=Z("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
307
+ * @license lucide-react v0.400.0 - ISC
308
+ *
309
+ * This source code is licensed under the ISC license.
310
+ * See the LICENSE file in the root directory of this source tree.
311
+ */const Zt=Z("Trash2",[["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"}]]);/**
312
+ * @license lucide-react v0.400.0 - ISC
313
+ *
314
+ * This source code is licensed under the ISC license.
315
+ * See the LICENSE file in the root directory of this source tree.
316
+ */const ef=Z("TriangleAlert",[["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"}]]);/**
317
+ * @license lucide-react v0.400.0 - ISC
318
+ *
319
+ * This source code is licensed under the ISC license.
320
+ * See the LICENSE file in the root directory of this source tree.
321
+ */const ny=Z("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
322
+ * @license lucide-react v0.400.0 - ISC
323
+ *
324
+ * This source code is licensed under the ISC license.
325
+ * See the LICENSE file in the root directory of this source tree.
326
+ */const ry=Z("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),oj=[{label:"Discovery",items:[{to:"/inventory/hosts",label:"Hosts",icon:xl},{to:"/inventory/agents",label:"Agents",icon:Qo},{to:"/inventory/identities",label:"Identities",icon:qx},{to:"/inventory/permissions",label:"Permissions",icon:Qb}]},{label:"Secure",items:[{to:"/secure/risk",label:"Risk",icon:ef},{to:"/secure/graph",label:"Graph",icon:tj}]},{label:"Operations",items:[{to:"/ops/skills",label:"Skills",icon:ny},{to:"/ops/plugins",label:"Plugins",icon:ea}]},{label:"System",items:[{to:"/system/logs",label:"Logs",icon:rj},{to:"/system/settings",label:"Settings",icon:qt}]}];function ij(){const e=tn(),[t,n]=m.useState("");return m.useEffect(()=>{fetch("/health").then(r=>r.json()).then(r=>n(r.version??"")).catch(()=>{})},[]),a.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[a.jsxs("div",{className:"flex h-14 items-center gap-2 border-b border-border px-4",children:[a.jsx("img",{src:"/dashboard/logo-512.png",alt:"OpenTrust",className:"h-6 w-6 dark:brightness-[1.8] dark:contrast-125"}),a.jsx("span",{className:"text-sm font-semibold tracking-tight text-foreground",children:"OpenTrust"})]}),a.jsx("nav",{className:"flex-1 space-y-6 px-3 py-4",children:oj.map(r=>a.jsxs("div",{children:[a.jsx("p",{className:"mb-2 px-2 text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:r.label}),a.jsx("div",{className:"space-y-0.5",children:r.items.map(s=>a.jsxs(Fx,{to:s.to,className:Pe("flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm transition-colors",e.pathname.startsWith(s.to)?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[a.jsx(s.icon,{className:"h-4 w-4 shrink-0"}),s.label]},s.to))})]},r.label))}),a.jsx("div",{className:"border-t border-border px-4 py-3",children:a.jsx("p",{className:"text-[11px] text-muted-foreground",children:t?`v${t}`:""})})]})}function aj(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function sy(...e){return t=>e.forEach(n=>aj(n,t))}function Jt(...e){return m.useCallback(sy(...e),e)}var ps=m.forwardRef((e,t)=>{const{children:n,...r}=e,s=m.Children.toArray(n),o=s.find(uj);if(o){const i=o.props.children,l=s.map(u=>u===o?m.Children.count(i)>1?m.Children.only(null):m.isValidElement(i)?i.props.children:null:u);return a.jsx(Pc,{...r,ref:t,children:m.isValidElement(i)?m.cloneElement(i,void 0,l):null})}return a.jsx(Pc,{...r,ref:t,children:n})});ps.displayName="Slot";var Pc=m.forwardRef((e,t)=>{const{children:n,...r}=e;if(m.isValidElement(n)){const s=dj(n);return m.cloneElement(n,{...cj(r,n.props),ref:t?sy(t,s):s})}return m.Children.count(n)>1?m.Children.only(null):null});Pc.displayName="SlotClone";var lj=({children:e})=>a.jsx(a.Fragment,{children:e});function uj(e){return m.isValidElement(e)&&e.type===lj}function cj(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...l)=>{o(...l),s(...l)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function dj(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function oy(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=oy(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function fj(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=oy(e))&&(r&&(r+=" "),r+=t);return r}const tm=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,nm=fj,hj=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return nm(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(c=>{const h=n==null?void 0:n[c],d=o==null?void 0:o[c];if(h===null)return null;const f=tm(h)||tm(d);return s[c][f]}),l=n&&Object.entries(n).reduce((c,h)=>{let[d,f]=h;return f===void 0||(c[d]=f),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,h)=>{let{class:d,className:f,...g}=h;return Object.entries(g).every(x=>{let[w,N]=x;return Array.isArray(N)?N.includes({...o,...l}[w]):{...o,...l}[w]===N})?[...c,d,f]:c},[]);return nm(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},mj=hj("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-border bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),K=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},o)=>{const i=r?ps:"button";return a.jsx(i,{className:Pe(mj({variant:t,size:n,className:e})),ref:o,...s})});K.displayName="Button";function pj(){const{user:e,logout:t}=Xd(),{theme:n,setTheme:r}=eb();return a.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border bg-card px-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"h-2 w-2 rounded-full bg-success"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[(e==null?void 0:e.email)&&a.jsx("span",{className:"text-xs text-muted-foreground",children:e.email}),a.jsx(K,{variant:"ghost",size:"icon",onClick:()=>r(n==="dark"?"light":"dark"),className:"h-8 w-8",children:n==="dark"?a.jsx(sj,{className:"h-4 w-4"}):a.jsx(ej,{className:"h-4 w-4"})}),a.jsx(K,{variant:"ghost",size:"icon",onClick:t,className:"h-8 w-8",children:a.jsx(Jb,{className:"h-4 w-4"})})]})]})}function gj(){return a.jsxs("div",{className:"flex h-screen overflow-hidden bg-background",children:[a.jsx(ij,{}),a.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[a.jsx(pj,{}),a.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:a.jsx(gS,{})})]})]})}const Te=m.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:Pe("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors","file:border-0 file:bg-transparent file:text-sm file:font-medium","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Te.displayName="Input";function xj(){const[e,t]=m.useState(""),[n,r]=m.useState(""),[s,o]=m.useState(""),[i,l]=m.useState(!1),[u,c]=m.useState(!1),{login:h,isAuthenticated:d,isLoading:f}=Xd(),g=hl();if(m.useEffect(()=>{d&&g("/inventory/agents",{replace:!0})},[d,g]),m.useEffect(()=>{fetch("/api/auth/config").then(w=>w.json()).then(w=>c(w.defaultPassword===!0)).catch(()=>{})},[]),f)return a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:a.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading..."})});const x=async w=>{w.preventDefault(),o(""),l(!0);try{await h(e,n),g("/inventory/agents",{replace:!0})}catch(N){o(N instanceof Error?N.message:"Login failed")}finally{l(!1)}};return a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:a.jsxs("div",{className:"w-full max-w-sm space-y-8 px-4",children:[a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsx("img",{src:"/dashboard/logo-512.png",alt:"OpenTrust",className:"h-12 w-12 dark:brightness-[1.8] dark:contrast-125"}),a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-lg font-semibold tracking-tight text-foreground",children:"OpenTrust"}),a.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Sign in to your dashboard"})]})]}),u&&a.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-50 px-3 py-2.5 text-sm text-amber-800 dark:bg-amber-950 dark:text-amber-200",children:[a.jsx(ef,{className:"mt-0.5 h-4 w-4 shrink-0"}),a.jsxs("span",{children:["Default credentials: ",a.jsx("code",{className:"rounded bg-amber-100 px-1 py-0.5 text-xs dark:bg-amber-900",children:"admin"})," / ",a.jsx("code",{className:"rounded bg-amber-100 px-1 py-0.5 text-xs dark:bg-amber-900",children:"admin"}),". Please change after login."]})]}),a.jsxs("form",{onSubmit:x,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-sm font-medium text-foreground",children:"Username"}),a.jsx(Te,{type:"text",placeholder:"admin",value:e,onChange:w=>t(w.target.value),autoComplete:"username",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-sm font-medium text-foreground",children:"Password"}),a.jsx(Te,{type:"password",placeholder:"Password",value:n,onChange:w=>r(w.target.value),autoComplete:"current-password",required:!0})]}),s&&a.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:s}),a.jsx(K,{type:"submit",className:"w-full",disabled:i,children:i?"Signing in...":"Sign in"})]}),a.jsx("p",{className:"text-center text-xs text-muted-foreground",children:"Change the password in Settings after first login."})]})})}const yj="/api";async function ce(e,t){const n=localStorage.getItem("opentrust_user"),r=n?JSON.parse(n).apiKey:null,s=await fetch(`${yj}${e}`,{...t,headers:{"Content-Type":"application/json",...r&&{Authorization:`Bearer ${r}`},...t==null?void 0:t.headers}});if(!s.ok)throw new Error(`API ${s.status}: ${await s.text()}`);return s.json()}const re={agents:{list:()=>ce("/agents"),get:e=>ce(`/agents/${e}`),create:e=>ce("/agents",{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>ce(`/agents/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>ce(`/agents/${e}`,{method:"DELETE"})},discovery:{agents:()=>ce("/discovery/agents"),profile:e=>ce(`/discovery/agents/${e}/profile`)},observations:{recent:(e=50)=>ce(`/observations?limit=${e}`),permissions:()=>ce("/observations/permissions"),anomalies:()=>ce("/observations/anomalies"),summary:()=>ce("/observations/summary"),agentPermissions:e=>ce(`/observations/agents/${e}/permissions`)},commands:{list:e=>ce(`/commands?agentId=${e}`),create:e=>ce("/commands",{method:"POST",body:JSON.stringify(e)})},system:{services:()=>ce("/system/services"),logs:(e,t=200)=>ce(`/system/logs/${e}?lines=${t}`),clearLog:e=>ce(`/system/logs/${e}`,{method:"DELETE"})},hosts:{list:()=>ce("/hosts"),get:e=>ce(`/hosts/${e}`),remove:e=>ce(`/hosts/${e}`,{method:"DELETE"}),agents:e=>ce(`/hosts/${e}/agents`),sendCommand:(e,t,n)=>ce("/hosts/commands",{method:"POST",body:JSON.stringify({hostId:e,type:t,payload:n})}),commands:(e,t=50)=>ce(`/hosts/commands?hostId=${e}&limit=${t}`)},detect:e=>ce("/detect",{method:"POST",body:JSON.stringify(e)}),usage:{summary:(e=30)=>ce(`/usage/summary?days=${e}`),daily:(e=30)=>ce(`/usage/daily?days=${e}`)},settings:{get:()=>ce("/settings"),update:e=>ce("/settings",{method:"PUT",body:JSON.stringify(e)}),getApiKey:(e=!1)=>ce(`/settings/api-key${e?"?reveal=true":""}`),generateKey:()=>ce("/settings/generate-key",{method:"POST"})}};function ye({className:e,variant:t="default",...n}){return a.jsx("div",{className:Pe("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{"border-transparent bg-primary text-primary-foreground shadow":t==="default","border-transparent bg-secondary text-secondary-foreground":t==="secondary","border-transparent bg-destructive text-destructive-foreground shadow":t==="destructive","text-foreground":t==="outline","border-transparent bg-success/15 text-success":t==="success","border-transparent bg-warning/15 text-warning":t==="warning"},e),...n})}const Xe=m.forwardRef(({className:e,...t},n)=>a.jsx("label",{ref:n,className:Pe("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));Xe.displayName="Label";function Be(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function vj(e,t){const n=m.createContext(t);function r(o){const{children:i,...l}=o,u=m.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:u,children:i})}function s(o){const i=m.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,s]}function yl(e,t=[]){let n=[];function r(o,i){const l=m.createContext(i),u=n.length;n=[...n,i];function c(d){const{scope:f,children:g,...x}=d,w=(f==null?void 0:f[e][u])||l,N=m.useMemo(()=>x,Object.values(x));return a.jsx(w.Provider,{value:N,children:g})}function h(d,f){const g=(f==null?void 0:f[e][u])||l,x=m.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,h]}const s=()=>{const o=n.map(i=>m.createContext(i));return function(l){const u=(l==null?void 0:l[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return s.scopeName=e,[r,wj(s,...t)]}function wj(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((l,{useScope:u,scopeName:c})=>{const d=u(o)[`__scope${c}`];return{...l,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var Aa=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},Nj=mw.useId||(()=>{}),Sj=0;function fo(e){const[t,n]=m.useState(Nj());return Aa(()=>{n(r=>r??String(Sj++))},[e]),t?`radix-${t}`:""}function Qn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function tf({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=bj({defaultProp:t,onChange:n}),o=e!==void 0,i=o?e:r,l=Qn(n),u=m.useCallback(c=>{if(o){const d=typeof c=="function"?c(e):c;d!==e&&l(d)}else s(c)},[o,e,s,l]);return[i,u]}function bj({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,s=m.useRef(r),o=Qn(t);return m.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}var jj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],tt=jj.reduce((e,t)=>{const n=m.forwardRef((r,s)=>{const{asChild:o,...i}=r,l=o?ps:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(l,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function kj(e,t){e&&dl.flushSync(()=>e.dispatchEvent(t))}function Cj(e,t=globalThis==null?void 0:globalThis.document){const n=Qn(e);m.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Ej="DismissableLayer",Mc="dismissableLayer.update",_j="dismissableLayer.pointerDownOutside",Pj="dismissableLayer.focusOutside",rm,iy=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ay=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:l,...u}=e,c=m.useContext(iy),[h,d]=m.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=m.useState({}),x=Jt(t,j=>d(j)),w=Array.from(c.layers),[N]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),p=w.indexOf(N),v=h?w.indexOf(h):-1,y=c.layersWithOutsidePointerEventsDisabled.size>0,S=v>=p,b=Rj(j=>{const P=j.target,I=[...c.branches].some($=>$.contains(P));!S||I||(s==null||s(j),i==null||i(j),j.defaultPrevented||l==null||l())},f),C=Tj(j=>{const P=j.target;[...c.branches].some($=>$.contains(P))||(o==null||o(j),i==null||i(j),j.defaultPrevented||l==null||l())},f);return Cj(j=>{v===c.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&l&&(j.preventDefault(),l()))},f),m.useEffect(()=>{if(h)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(rm=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),sm(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=rm)}},[h,f,n,c]),m.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),sm())},[h,c]),m.useEffect(()=>{const j=()=>g({});return document.addEventListener(Mc,j),()=>document.removeEventListener(Mc,j)},[]),a.jsx(tt.div,{...u,ref:x,style:{pointerEvents:y?S?"auto":"none":void 0,...e.style},onFocusCapture:Be(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Be(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Be(e.onPointerDownCapture,b.onPointerDownCapture)})});ay.displayName=Ej;var Mj="DismissableLayerBranch",Ij=m.forwardRef((e,t)=>{const n=m.useContext(iy),r=m.useRef(null),s=Jt(t,r);return m.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),a.jsx(tt.div,{...e,ref:s})});Ij.displayName=Mj;function Rj(e,t=globalThis==null?void 0:globalThis.document){const n=Qn(e),r=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let u=function(){ly(_j,n,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=u,t.addEventListener("click",s.current,{once:!0})):u()}else t.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Tj(e,t=globalThis==null?void 0:globalThis.document){const n=Qn(e),r=m.useRef(!1);return m.useEffect(()=>{const s=o=>{o.target&&!r.current&&ly(Pj,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function sm(){const e=new CustomEvent(Mc);document.dispatchEvent(e)}function ly(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?kj(s,o):s.dispatchEvent(o)}var fu="focusScope.autoFocusOnMount",hu="focusScope.autoFocusOnUnmount",om={bubbles:!1,cancelable:!0},Lj="FocusScope",uy=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[l,u]=m.useState(null),c=Qn(s),h=Qn(o),d=m.useRef(null),f=Jt(t,w=>u(w)),g=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let w=function(y){if(g.paused||!l)return;const S=y.target;l.contains(S)?d.current=S:En(d.current,{select:!0})},N=function(y){if(g.paused||!l)return;const S=y.relatedTarget;S!==null&&(l.contains(S)||En(d.current,{select:!0}))},p=function(y){if(document.activeElement===document.body)for(const b of y)b.removedNodes.length>0&&En(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",N);const v=new MutationObserver(p);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",N),v.disconnect()}}},[r,l,g.paused]),m.useEffect(()=>{if(l){am.add(g);const w=document.activeElement;if(!l.contains(w)){const p=new CustomEvent(fu,om);l.addEventListener(fu,c),l.dispatchEvent(p),p.defaultPrevented||(Aj(Fj(cy(l)),{select:!0}),document.activeElement===w&&En(l))}return()=>{l.removeEventListener(fu,c),setTimeout(()=>{const p=new CustomEvent(hu,om);l.addEventListener(hu,h),l.dispatchEvent(p),p.defaultPrevented||En(w??document.body,{select:!0}),l.removeEventListener(hu,h),am.remove(g)},0)}}},[l,c,h,g]);const x=m.useCallback(w=>{if(!n&&!r||g.paused)return;const N=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,p=document.activeElement;if(N&&p){const v=w.currentTarget,[y,S]=zj(v);y&&S?!w.shiftKey&&p===S?(w.preventDefault(),n&&En(y,{select:!0})):w.shiftKey&&p===y&&(w.preventDefault(),n&&En(S,{select:!0})):p===v&&w.preventDefault()}},[n,r,g.paused]);return a.jsx(tt.div,{tabIndex:-1,...i,ref:f,onKeyDown:x})});uy.displayName=Lj;function Aj(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(En(r,{select:t}),document.activeElement!==n)return}function zj(e){const t=cy(e),n=im(t,e),r=im(t.reverse(),e);return[n,r]}function cy(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function im(e,t){for(const n of e)if(!Dj(n,{upTo:t}))return n}function Dj(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function $j(e){return e instanceof HTMLInputElement&&"select"in e}function En(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&$j(e)&&t&&e.select()}}var am=Oj();function Oj(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=lm(e,t),e.unshift(t)},remove(t){var n;e=lm(e,t),(n=e[0])==null||n.resume()}}}function lm(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Fj(e){return e.filter(t=>t.tagName!=="A")}var Hj="Portal",dy=m.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,o]=m.useState(!1);Aa(()=>o(!0),[]);const i=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return i?k2.createPortal(a.jsx(tt.div,{...r,ref:t}),i):null});dy.displayName=Hj;function Bj(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var qo=e=>{const{present:t,children:n}=e,r=Vj(t),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),o=Jt(r.ref,Uj(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:o}):null};qo.displayName="Presence";function Vj(e){const[t,n]=m.useState(),r=m.useRef({}),s=m.useRef(e),o=m.useRef("none"),i=e?"mounted":"unmounted",[l,u]=Bj(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=ki(r.current);o.current=l==="mounted"?c:"none"},[l]),Aa(()=>{const c=r.current,h=s.current;if(h!==e){const f=o.current,g=ki(c);e?u("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(h&&f!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,u]),Aa(()=>{if(t){const c=d=>{const g=ki(r.current).includes(d.animationName);d.target===t&&g&&dl.flushSync(()=>u("ANIMATION_END"))},h=d=>{d.target===t&&(o.current=ki(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function ki(e){return(e==null?void 0:e.animationName)||"none"}function Uj(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mu=0;function Wj(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??um()),document.body.insertAdjacentElement("beforeend",e[1]??um()),mu++,()=>{mu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),mu--}},[])}function um(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Gt=function(){return Gt=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Gt.apply(this,arguments)};function fy(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function Kj(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var ta="right-scroll-bar-position",na="width-before-scroll-bar",Gj="with-scroll-bars-hidden",Yj="--removed-body-scroll-bar-size";function pu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Xj(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var Qj=typeof window<"u"?m.useLayoutEffect:m.useEffect,cm=new WeakMap;function qj(e,t){var n=Xj(null,function(r){return e.forEach(function(s){return pu(s,r)})});return Qj(function(){var r=cm.get(n);if(r){var s=new Set(r),o=new Set(e),i=n.current;s.forEach(function(l){o.has(l)||pu(l,null)}),o.forEach(function(l){s.has(l)||pu(l,i)})}cm.set(n,e)},[e]),n}function Zj(e){return e}function Jj(e,t){t===void 0&&(t=Zj);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var i=t(o,r);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(o){for(r=!0;n.length;){var i=n;n=[],i.forEach(o)}n={push:function(l){return o(l)},filter:function(){return n}}},assignMedium:function(o){r=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(o),i=n}var u=function(){var h=i;i=[],h.forEach(o)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(h){i.push(h),c()},filter:function(h){return i=i.filter(h),n}}}};return s}function ek(e){e===void 0&&(e={});var t=Jj(null);return t.options=Gt({async:!0,ssr:!1},e),t}var hy=function(e){var t=e.sideCar,n=fy(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,Gt({},n))};hy.isSideCarExport=!0;function tk(e,t){return e.useMedium(t),hy}var my=ek(),gu=function(){},vl=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:gu,onWheelCapture:gu,onTouchMoveCapture:gu}),s=r[0],o=r[1],i=e.forwardProps,l=e.children,u=e.className,c=e.removeScrollBar,h=e.enabled,d=e.shards,f=e.sideCar,g=e.noIsolation,x=e.inert,w=e.allowPinchZoom,N=e.as,p=N===void 0?"div":N,v=e.gapMode,y=fy(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,b=qj([n,t]),C=Gt(Gt({},y),s);return m.createElement(m.Fragment,null,h&&m.createElement(S,{sideCar:my,removeScrollBar:c,shards:d,noIsolation:g,inert:x,setCallbacks:o,allowPinchZoom:!!w,lockRef:n,gapMode:v}),i?m.cloneElement(m.Children.only(l),Gt(Gt({},C),{ref:b})):m.createElement(p,Gt({},C,{className:u,ref:b}),l))});vl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};vl.classNames={fullWidth:na,zeroRight:ta};var nk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function rk(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=nk();return t&&e.setAttribute("nonce",t),e}function sk(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ok(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ik=function(){var e=0,t=null;return{add:function(n){e==0&&(t=rk())&&(sk(t,n),ok(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ak=function(){var e=ik();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},py=function(){var e=ak(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},lk={left:0,top:0,right:0,gap:0},xu=function(e){return parseInt(e||"",10)||0},uk=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[xu(n),xu(r),xu(s)]},ck=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return lk;var t=uk(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},dk=py(),ss="data-scroll-locked",fk=function(e,t,n,r){var s=e.left,o=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),`
327
+ .`.concat(Gj,` {
328
+ overflow: hidden `).concat(r,`;
329
+ padding-right: `).concat(l,"px ").concat(r,`;
330
+ }
331
+ body[`).concat(ss,`] {
332
+ overflow: hidden `).concat(r,`;
333
+ overscroll-behavior: contain;
334
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
335
+ padding-left: `.concat(s,`px;
336
+ padding-top: `).concat(o,`px;
337
+ padding-right: `).concat(i,`px;
338
+ margin-left:0;
339
+ margin-top:0;
340
+ margin-right: `).concat(l,"px ").concat(r,`;
341
+ `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
342
+ }
343
+
344
+ .`).concat(ta,` {
345
+ right: `).concat(l,"px ").concat(r,`;
346
+ }
347
+
348
+ .`).concat(na,` {
349
+ margin-right: `).concat(l,"px ").concat(r,`;
350
+ }
351
+
352
+ .`).concat(ta," .").concat(ta,` {
353
+ right: 0 `).concat(r,`;
354
+ }
355
+
356
+ .`).concat(na," .").concat(na,` {
357
+ margin-right: 0 `).concat(r,`;
358
+ }
359
+
360
+ body[`).concat(ss,`] {
361
+ `).concat(Yj,": ").concat(l,`px;
362
+ }
363
+ `)},dm=function(){var e=parseInt(document.body.getAttribute(ss)||"0",10);return isFinite(e)?e:0},hk=function(){m.useEffect(function(){return document.body.setAttribute(ss,(dm()+1).toString()),function(){var e=dm()-1;e<=0?document.body.removeAttribute(ss):document.body.setAttribute(ss,e.toString())}},[])},mk=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;hk();var o=m.useMemo(function(){return ck(s)},[s]);return m.createElement(dk,{styles:fk(o,!t,s,n?"":"!important")})},Ic=!1;if(typeof window<"u")try{var Ci=Object.defineProperty({},"passive",{get:function(){return Ic=!0,!0}});window.addEventListener("test",Ci,Ci),window.removeEventListener("test",Ci,Ci)}catch{Ic=!1}var Lr=Ic?{passive:!1}:!1,pk=function(e){return e.tagName==="TEXTAREA"},gy=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!pk(e)&&n[t]==="visible")},gk=function(e){return gy(e,"overflowY")},xk=function(e){return gy(e,"overflowX")},fm=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=xy(e,r);if(s){var o=yy(e,r),i=o[1],l=o[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},yk=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},vk=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},xy=function(e,t){return e==="v"?gk(t):xk(t)},yy=function(e,t){return e==="v"?yk(t):vk(t)},wk=function(e,t){return e==="h"&&t==="rtl"?-1:1},Nk=function(e,t,n,r,s){var o=wk(e,window.getComputedStyle(t).direction),i=o*r,l=n.target,u=t.contains(l),c=!1,h=i>0,d=0,f=0;do{var g=yy(e,l),x=g[0],w=g[1],N=g[2],p=w-N-o*x;(x||p)&&xy(e,l)&&(d+=p,f+=x),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(h&&Math.abs(d)<1||!h&&Math.abs(f)<1)&&(c=!0),c},Ei=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},hm=function(e){return[e.deltaX,e.deltaY]},mm=function(e){return e&&"current"in e?e.current:e},Sk=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bk=function(e){return`
364
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
365
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
366
+ `)},jk=0,Ar=[];function kk(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(jk++)[0],o=m.useState(py)[0],i=m.useRef(e);m.useEffect(function(){i.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=Kj([e.lockRef.current],(e.shards||[]).map(mm),!0).filter(Boolean);return w.forEach(function(N){return N.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(w,N){if("touches"in w&&w.touches.length===2)return!i.current.allowPinchZoom;var p=Ei(w),v=n.current,y="deltaX"in w?w.deltaX:v[0]-p[0],S="deltaY"in w?w.deltaY:v[1]-p[1],b,C=w.target,j=Math.abs(y)>Math.abs(S)?"h":"v";if("touches"in w&&j==="h"&&C.type==="range")return!1;var P=fm(j,C);if(!P)return!0;if(P?b=j:(b=j==="v"?"h":"v",P=fm(j,C)),!P)return!1;if(!r.current&&"changedTouches"in w&&(y||S)&&(r.current=b),!b)return!0;var I=r.current||b;return Nk(I,N,w,I==="h"?y:S)},[]),u=m.useCallback(function(w){var N=w;if(!(!Ar.length||Ar[Ar.length-1]!==o)){var p="deltaY"in N?hm(N):Ei(N),v=t.current.filter(function(b){return b.name===N.type&&(b.target===N.target||N.target===b.shadowParent)&&Sk(b.delta,p)})[0];if(v&&v.should){N.cancelable&&N.preventDefault();return}if(!v){var y=(i.current.shards||[]).map(mm).filter(Boolean).filter(function(b){return b.contains(N.target)}),S=y.length>0?l(N,y[0]):!i.current.noIsolation;S&&N.cancelable&&N.preventDefault()}}},[]),c=m.useCallback(function(w,N,p,v){var y={name:w,delta:N,target:p,should:v,shadowParent:Ck(p)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(S){return S!==y})},1)},[]),h=m.useCallback(function(w){n.current=Ei(w),r.current=void 0},[]),d=m.useCallback(function(w){c(w.type,hm(w),w.target,l(w,e.lockRef.current))},[]),f=m.useCallback(function(w){c(w.type,Ei(w),w.target,l(w,e.lockRef.current))},[]);m.useEffect(function(){return Ar.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",u,Lr),document.addEventListener("touchmove",u,Lr),document.addEventListener("touchstart",h,Lr),function(){Ar=Ar.filter(function(w){return w!==o}),document.removeEventListener("wheel",u,Lr),document.removeEventListener("touchmove",u,Lr),document.removeEventListener("touchstart",h,Lr)}},[]);var g=e.removeScrollBar,x=e.inert;return m.createElement(m.Fragment,null,x?m.createElement(o,{styles:bk(s)}):null,g?m.createElement(mk,{gapMode:e.gapMode}):null)}function Ck(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ek=tk(my,kk);var vy=m.forwardRef(function(e,t){return m.createElement(vl,Gt({},e,{ref:t,sideCar:Ek}))});vy.classNames=vl.classNames;var _k=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},zr=new WeakMap,_i=new WeakMap,Pi={},yu=0,wy=function(e){return e&&(e.host||wy(e.parentNode))},Pk=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=wy(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Mk=function(e,t,n,r){var s=Pk(t,Array.isArray(e)?e:[e]);Pi[n]||(Pi[n]=new WeakMap);var o=Pi[n],i=[],l=new Set,u=new Set(s),c=function(d){!d||l.has(d)||(l.add(d),c(d.parentNode))};s.forEach(c);var h=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(f){if(l.has(f))h(f);else try{var g=f.getAttribute(r),x=g!==null&&g!=="false",w=(zr.get(f)||0)+1,N=(o.get(f)||0)+1;zr.set(f,w),o.set(f,N),i.push(f),w===1&&x&&_i.set(f,!0),N===1&&f.setAttribute(n,"true"),x||f.setAttribute(r,"true")}catch(p){console.error("aria-hidden: cannot operate on ",f,p)}})};return h(t),l.clear(),yu++,function(){i.forEach(function(d){var f=zr.get(d)-1,g=o.get(d)-1;zr.set(d,f),o.set(d,g),f||(_i.has(d)||d.removeAttribute(r),_i.delete(d)),g||d.removeAttribute(n)}),yu--,yu||(zr=new WeakMap,zr=new WeakMap,_i=new WeakMap,Pi={})}},Ik=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=_k(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),Mk(r,s,n,"aria-hidden")):function(){return null}},nf="Dialog",[Ny]=yl(nf),[Rk,Ft]=Ny(nf),Sy=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,l=m.useRef(null),u=m.useRef(null),[c=!1,h]=tf({prop:r,defaultProp:s,onChange:o});return a.jsx(Rk,{scope:t,triggerRef:l,contentRef:u,contentId:fo(),titleId:fo(),descriptionId:fo(),open:c,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(d=>!d),[h]),modal:i,children:n})};Sy.displayName=nf;var by="DialogTrigger",Tk=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(by,n),o=Jt(t,s.triggerRef);return a.jsx(tt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":of(s.open),...r,ref:o,onClick:Be(e.onClick,s.onOpenToggle)})});Tk.displayName=by;var rf="DialogPortal",[Lk,jy]=Ny(rf,{forceMount:void 0}),ky=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Ft(rf,t);return a.jsx(Lk,{scope:t,forceMount:n,children:m.Children.map(r,i=>a.jsx(qo,{present:n||o.open,children:a.jsx(dy,{asChild:!0,container:s,children:i})}))})};ky.displayName=rf;var za="DialogOverlay",Cy=m.forwardRef((e,t)=>{const n=jy(za,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ft(za,e.__scopeDialog);return o.modal?a.jsx(qo,{present:r||o.open,children:a.jsx(Ak,{...s,ref:t})}):null});Cy.displayName=za;var Ak=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(za,n);return a.jsx(vy,{as:ps,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(tt.div,{"data-state":of(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Sr="DialogContent",Ey=m.forwardRef((e,t)=>{const n=jy(Sr,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ft(Sr,e.__scopeDialog);return a.jsx(qo,{present:r||o.open,children:o.modal?a.jsx(zk,{...s,ref:t}):a.jsx(Dk,{...s,ref:t})})});Ey.displayName=Sr;var zk=m.forwardRef((e,t)=>{const n=Ft(Sr,e.__scopeDialog),r=m.useRef(null),s=Jt(t,n.contentRef,r);return m.useEffect(()=>{const o=r.current;if(o)return Ik(o)},[]),a.jsx(_y,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Be(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Be(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&o.preventDefault()}),onFocusOutside:Be(e.onFocusOutside,o=>o.preventDefault())})}),Dk=m.forwardRef((e,t)=>{const n=Ft(Sr,e.__scopeDialog),r=m.useRef(!1),s=m.useRef(!1);return a.jsx(_y,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),_y=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,l=Ft(Sr,n),u=m.useRef(null),c=Jt(t,u);return Wj(),a.jsxs(a.Fragment,{children:[a.jsx(uy,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(ay,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":of(l.open),...i,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx($k,{titleId:l.titleId}),a.jsx(Fk,{contentRef:u,descriptionId:l.descriptionId})]})]})}),sf="DialogTitle",Py=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(sf,n);return a.jsx(tt.h2,{id:s.titleId,...r,ref:t})});Py.displayName=sf;var My="DialogDescription",Iy=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(My,n);return a.jsx(tt.p,{id:s.descriptionId,...r,ref:t})});Iy.displayName=My;var Ry="DialogClose",Ty=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(Ry,n);return a.jsx(tt.button,{type:"button",...r,ref:t,onClick:Be(e.onClick,()=>s.onOpenChange(!1))})});Ty.displayName=Ry;function of(e){return e?"open":"closed"}var Ly="DialogTitleWarning",[kI,Ay]=vj(Ly,{contentName:Sr,titleName:sf,docsSlug:"dialog"}),$k=({titleId:e})=>{const t=Ay(Ly),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
367
+
368
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
369
+
370
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ok="DialogDescriptionWarning",Fk=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ay(Ok).contentName}}.`;return m.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Hk=Sy,Bk=ky,zy=Cy,Dy=Ey,$y=Py,Oy=Iy,Vk=Ty;const Pr=Hk,Uk=Bk,Fy=m.forwardRef(({className:e,...t},n)=>a.jsx(zy,{ref:n,className:Pe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Fy.displayName=zy.displayName;const er=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(Uk,{children:[a.jsx(Fy,{}),a.jsxs(Dy,{ref:r,className:Pe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,a.jsxs(Vk,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(ry,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));er.displayName=Dy.displayName;const Mr=({className:e,...t})=>a.jsx("div",{className:Pe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t}),Ir=({className:e,...t})=>a.jsx("div",{className:Pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t}),tr=m.forwardRef(({className:e,...t},n)=>a.jsx($y,{ref:n,className:Pe("text-lg font-semibold leading-none tracking-tight",e),...t}));tr.displayName=$y.displayName;const nr=m.forwardRef(({className:e,...t},n)=>a.jsx(Oy,{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));nr.displayName=Oy.displayName;function Wk(){const[e,t]=m.useState([]),[n,r]=m.useState([]),[s,o]=m.useState(""),[i,l]=m.useState(""),[u,c]=m.useState(""),[h,d]=m.useState(""),[f,g]=m.useState(!0),[x,w]=m.useState(new Set),[N,p]=m.useState(!1),[v,y]=m.useState(null),S=async()=>{g(!0);try{const[k,z]=await Promise.all([re.discovery.agents(),re.hosts.list()]);t(k.data??[]),r(z.data??[])}catch{}g(!1)};m.useEffect(()=>{S()},[]),m.useEffect(()=>{if(!v)return;const k=setTimeout(()=>y(null),4e3);return()=>clearTimeout(k)},[v]);const b=new Map(n.map(k=>[k.id,k])),C=[...new Set(e.map(k=>k.provider).filter(Boolean))].sort(),j=[...new Set(e.map(k=>k.status??"inactive").filter(Boolean))].sort(),P=e.filter(k=>{var z;if(s&&!((z=k.name)!=null&&z.toLowerCase().includes(s.toLowerCase())))return!1;if(i){if(i==="__none__"){if(k.hostId)return!1}else if(k.hostId!==i)return!1}return!(u&&k.provider!==u||h&&(k.status??"inactive")!==h)}),I=!!(i||u||h),$=k=>k==="active"?"success":k==="inactive"?"secondary":"warning",R=(k,z)=>{z.preventDefault(),z.stopPropagation(),w(_=>{const M=new Set(_);return M.has(k)?M.delete(k):M.add(k),M})},T=()=>{x.size===P.length?w(new Set):w(new Set(P.map(k=>k.registeredAgentId||k.id)))},D=()=>{l(""),c(""),d("")},E=e.filter(k=>x.has(k.registeredAgentId||k.id)),L=[...new Set(E.map(k=>k.hostId).filter(Boolean))];return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Agents"}),a.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," agent",e.length!==1?"s":""," discovered",I&&` · ${P.length} shown`]})]}),a.jsxs(K,{variant:"outline",size:"sm",onClick:S,children:[a.jsx(Xn,{className:"h-3.5 w-3.5"}),"Scan"]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs("div",{className:"relative max-w-xs flex-1 min-w-[180px]",children:[a.jsx(ey,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),a.jsx(Te,{placeholder:"Search agents...",className:"pl-9 h-8 text-sm",value:s,onChange:k=>o(k.target.value)})]}),a.jsxs("select",{className:"h-8 rounded-md border border-input bg-background px-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring",value:i,onChange:k=>l(k.target.value),children:[a.jsx("option",{value:"",children:"All Hosts"}),n.map(k=>a.jsx("option",{value:k.id,children:k.hostname},k.id)),a.jsx("option",{value:"__none__",children:"No Host"})]}),a.jsxs("select",{className:"h-8 rounded-md border border-input bg-background px-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring",value:u,onChange:k=>c(k.target.value),children:[a.jsx("option",{value:"",children:"All Providers"}),C.map(k=>a.jsx("option",{value:k,children:k},k))]}),a.jsxs("select",{className:"h-8 rounded-md border border-input bg-background px-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring",value:h,onChange:k=>d(k.target.value),children:[a.jsx("option",{value:"",children:"All Status"}),j.map(k=>a.jsx("option",{value:k,children:k},k))]}),I&&a.jsxs(K,{variant:"ghost",size:"sm",onClick:D,className:"h-8 text-xs px-2",children:[a.jsx(ry,{className:"h-3 w-3 mr-1"})," Clear"]}),P.length>0&&a.jsx(K,{variant:"ghost",size:"sm",onClick:T,className:"h-8 text-xs ml-auto",children:x.size===P.length?a.jsxs(a.Fragment,{children:[a.jsx(em,{className:"h-3.5 w-3.5 mr-1"})," Deselect All"]}):a.jsxs(a.Fragment,{children:[a.jsx(To,{className:"h-3.5 w-3.5 mr-1"})," Select All"]})})]}),x.size>0&&a.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-primary/20 bg-primary/5 px-4 py-3",children:[a.jsxs("span",{className:"text-sm font-medium",children:[x.size," agent",x.size>1?"s":""," selected"]}),a.jsx("div",{className:"flex-1"}),a.jsxs(K,{size:"sm",onClick:()=>p(!0),children:[a.jsx($t,{className:"h-3.5 w-3.5 mr-1"})," Install Skill"]}),a.jsx(K,{size:"sm",variant:"ghost",onClick:()=>w(new Set),children:"Clear"})]}),f?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):P.length===0?a.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border",children:[a.jsx(Qo,{className:"h-8 w-8 text-muted-foreground/50"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents found"})]}):a.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:P.map(k=>{var M;const z=k.registeredAgentId||k.id,_=x.has(z);return a.jsxs("div",{className:"relative",children:[a.jsx("button",{onClick:A=>R(z,A),className:`absolute left-2 top-2 z-10 rounded p-0.5 transition-colors ${_?"text-primary":"text-muted-foreground/30 hover:text-muted-foreground/60"}`,children:_?a.jsx(em,{className:"h-4 w-4"}):a.jsx(To,{className:"h-4 w-4"})}),a.jsxs(Gn,{to:`/inventory/agents/${k.id}`,className:`group flex flex-col gap-3 rounded-lg border bg-card p-4 pl-8 transition-colors hover:border-muted-foreground/30 ${_?"border-primary/40 bg-primary/5":"border-border"}`,children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("span",{className:"text-xl",children:k.emoji||"🤖"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-foreground group-hover:text-foreground",children:k.name}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[k.provider||"unknown",k.model?` · ${k.model}`:"",k.hostId&&b.has(k.hostId)&&a.jsxs("span",{className:"ml-1 text-muted-foreground/60",children:["@ ",b.get(k.hostId).hostname]})]})]})]}),a.jsx(ye,{variant:$(k.status??"inactive"),className:"text-[10px]",children:k.status??"inactive"})]}),((M=k.skills)==null?void 0:M.length)>0&&a.jsxs("div",{className:"flex flex-wrap gap-1",children:[k.skills.slice(0,4).map(A=>a.jsx("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:typeof A=="string"?A:A.name},A.name??A)),k.skills.length>4&&a.jsxs("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:["+",k.skills.length-4]})]})]})]},k.id)})}),a.jsx(Kk,{open:N,onOpenChange:p,hostIds:L,agentCount:x.size,hostlessCount:E.filter(k=>!k.hostId).length,onDone:(k,z)=>{y({msg:k,type:z}),w(new Set)}}),v&&a.jsxs("div",{className:`fixed bottom-6 right-6 z-[100] flex items-center gap-2 rounded-lg border px-4 py-3 shadow-lg ${v.type==="success"?"border-emerald-500/30 bg-emerald-50 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200":"border-destructive/30 bg-red-50 text-red-800 dark:bg-red-950 dark:text-red-200"}`,children:[v.type==="success"?a.jsx(Yn,{className:"h-4 w-4"}):a.jsx(pt,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:v.msg})]})]})}function Kk({open:e,onOpenChange:t,hostIds:n,agentCount:r,hostlessCount:s,onDone:o}){const[i,l]=m.useState(""),[u,c]=m.useState(!1),[h,d]=m.useState(""),f=()=>{l(""),d("")},g=async()=>{const x=i.trim();if(!x)return;if(n.length===0){d("None of the selected agents are associated with a host. Run 'opentrust connect' on their machines first.");return}c(!0),d("");let w=0,N=0;for(const p of n)try{await re.hosts.sendCommand(p,"install_skill",{skillName:x}),w++}catch{N++}c(!1),N===0?(f(),t(!1),o(`Skill "${x}" install sent to ${w} host${w>1?"s":""} (${r} agents)`,"success")):d(`${w} sent, ${N} failed`)};return a.jsx(Pr,{open:e,onOpenChange:x=>{x||f(),t(x)},children:a.jsxs(er,{className:"sm:max-w-[460px]",children:[a.jsxs(Mr,{children:[a.jsxs(tr,{className:"flex items-center gap-2",children:[a.jsx(Nr,{className:"h-4 w-4"})," Batch Install Skill"]}),a.jsxs(nr,{children:["Install a skill on ",r," selected agent",r>1?"s":""," across ",n.length," host",n.length>1?"s":"",".",s>0&&a.jsxs("span",{className:"text-amber-600 dark:text-amber-400",children:[" ","(",s," agent",s>1?"s":""," without host will be skipped)"]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Xe,{htmlFor:"batch-skill-name",children:"Skill Name"}),a.jsx(Te,{id:"batch-skill-name",placeholder:"e.g. self-improving-agent, web-search",value:i,onChange:x=>{l(x.target.value),d("")},onKeyDown:x=>x.key==="Enter"&&g()}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Runs ",a.jsx("code",{className:"rounded bg-muted px-1",children:"clawhub install <name> --force"})," on each host via CLI daemon. Same host won't receive duplicate commands."]})]}),h&&a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[a.jsx(pt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:h})]}),a.jsxs(Ir,{children:[a.jsx(K,{variant:"outline",onClick:()=>{f(),t(!1)},children:"Cancel"}),a.jsxs(K,{onClick:g,disabled:u||!i.trim(),children:[u?a.jsx(He,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx($t,{className:"mr-1.5 h-3.5 w-3.5"}),"Install on ",n.length," host",n.length>1?"s":""]})]})]})})}const he=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Pe("rounded-lg border border-border bg-card text-card-foreground shadow-sm",e),...t}));he.displayName="Card";const Ie=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Pe("flex flex-col space-y-1.5 p-6",e),...t}));Ie.displayName="CardHeader";const Re=m.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:Pe("font-semibold leading-none tracking-tight",e),...t}));Re.displayName="CardTitle";const af=m.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));af.displayName="CardDescription";const we=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Pe("p-6 pt-0",e),...t}));we.displayName="CardContent";const Gk=["Profile","Tasks","Identities","Permissions"];function Yk(){const{id:e}=nS(),[t,n]=m.useState(null),[r,s]=m.useState([]),[o,i]=m.useState("Profile"),[l,u]=m.useState(!0),[c,h]=m.useState(null);return m.useEffect(()=>{e&&(u(!0),(async()=>{const d=await re.discovery.profile(e).catch(()=>null),f=(d==null?void 0:d.data)??null;n(f),f!=null&&f.hostId&&re.hosts.get(f.hostId).then(w=>h(w.data??null)).catch(()=>{});const g=(f==null?void 0:f.registeredAgentId)??e,x=await re.observations.agentPermissions(g).catch(()=>({data:[]}));s((x==null?void 0:x.data)??[]),u(!1)})())},[e]),l?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):t?a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Gn,{to:"/inventory/agents",className:"rounded-md p-1.5 hover:bg-accent",children:a.jsx(Fb,{className:"h-4 w-4"})}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-2xl",children:t.emoji||"🤖"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-lg font-semibold",children:t.name||e}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.provider||"unknown",t.model?` / ${t.model}`:"",c&&t.hostId&&a.jsxs(Gn,{to:`/inventory/hosts?expand=${t.hostId}`,className:"ml-2 inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[a.jsx(xl,{className:"h-3 w-3"})," ",c.hostname]})]})]})]})]}),a.jsx("div",{className:"flex gap-1 border-b border-border",children:Gk.map(d=>a.jsx("button",{onClick:()=>i(d),className:Pe("border-b-2 px-4 py-2 text-sm font-medium transition-colors",o===d?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:d},d))}),o==="Profile"&&a.jsx(Xk,{profile:t}),o==="Tasks"&&a.jsx(Qk,{profile:t}),o==="Identities"&&a.jsx(qk,{profile:t}),o==="Permissions"&&a.jsx(Zk,{permissions:r})]}):a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Agent not found"})}function Xk({profile:e}){const t=e.skills??[];return a.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[a.jsxs(he,{children:[a.jsx(Ie,{children:a.jsx(Re,{className:"text-sm",children:"Info"})}),a.jsxs(we,{className:"space-y-2 text-sm",children:[a.jsx(Gs,{label:"Owner",value:e.ownerName||"—"}),a.jsx(Gs,{label:"Creature",value:e.creature||"—"}),a.jsx(Gs,{label:"Vibe",value:e.vibe||"—"}),a.jsx(Gs,{label:"Sessions",value:String(e.sessionCount??0)}),a.jsx(Gs,{label:"Last Active",value:e.lastActive??"never"})]})]}),a.jsxs(he,{children:[a.jsx(Ie,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(ny,{className:"h-4 w-4"})," Skills (",t.length,")"]}),a.jsx(Gn,{to:"/ops/skills",children:a.jsxs(K,{size:"sm",variant:"ghost",className:"h-7 text-xs text-muted-foreground",children:["Manage ",a.jsx(Gb,{className:"ml-1 h-3 w-3"})]})})]})}),a.jsx(we,{children:t.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-2 py-4",children:[a.jsx(Nr,{className:"h-8 w-8 text-muted-foreground/30"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No skills installed"}),a.jsx(Gn,{to:"/ops/skills",children:a.jsx(K,{size:"sm",variant:"ghost",className:"h-7 text-xs",children:"Go to Operations to install skills"})})]}):a.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(n=>a.jsxs(ye,{variant:"secondary",className:"text-xs font-normal",children:[a.jsx(Nr,{className:"mr-1 h-3 w-3"})," ",n.name]},n.name))})})]}),a.jsxs(he,{children:[a.jsx(Ie,{children:a.jsx(Re,{className:"text-sm",children:"Plugins"})}),a.jsx(we,{children:(e.plugins??[]).length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins"}):a.jsx("div",{className:"space-y-1.5",children:(e.plugins??[]).map(n=>a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsx("span",{children:n.name}),a.jsx(ye,{variant:n.enabled?"success":"secondary",className:"text-[10px]",children:n.enabled?"on":"off"})]},n.name))})})]}),a.jsxs(he,{children:[a.jsx(Ie,{children:a.jsx(Re,{className:"text-sm",children:"Connected Systems"})}),a.jsx(we,{children:(e.connectedSystems??[]).length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"None"}):a.jsx("div",{className:"flex flex-wrap gap-1.5",children:(e.connectedSystems??[]).map(n=>a.jsx(ye,{variant:"outline",className:"text-xs",children:n},n))})})]})]})}function Qk({profile:e}){const t=e.cronJobs??[];return a.jsxs(he,{children:[a.jsx(Ie,{children:a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Ub,{className:"h-4 w-4"})," Scheduled Tasks (",t.length,")"]})}),a.jsx(we,{children:t.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No scheduled tasks"}):a.jsx("div",{className:"space-y-2",children:t.map((n,r)=>a.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:n.schedule}),a.jsx("span",{className:"ml-2",children:n.task??n.id})]}),a.jsx(ye,{variant:n.enabled!==!1?"success":"secondary",className:"text-[10px]",children:n.enabled!==!1?"active":"paused"})]},r))})})]})}function qk({profile:e}){const t=e.workspaceFiles??{},n=[{label:"SOUL.md",content:t.soul},{label:"IDENTITY.md",content:t.identity},{label:"USER.md",content:t.user}].filter(r=>r.content);return a.jsx("div",{className:"space-y-4",children:n.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No identity files found"}):n.map(r=>a.jsxs(he,{children:[a.jsx(Ie,{children:a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Is,{className:"h-4 w-4"})," ",r.label]})}),a.jsx(we,{children:a.jsx("pre",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded-md bg-muted p-3 font-mono text-xs text-muted-foreground",children:r.content})})]},r.label))})}function Zk({permissions:e}){return e.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No observed permissions"}):a.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Tool"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Access"}),a.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"Calls"}),a.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"Errors"})]})}),a.jsx("tbody",{children:e.map(t=>a.jsxs("tr",{className:"border-b border-border last:border-0",children:[a.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:t.toolName}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(ye,{variant:"outline",className:"text-[10px]",children:t.category??"—"})}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(ye,{variant:t.accessPattern==="write"?"warning":t.accessPattern==="admin"?"destructive":"secondary",className:"text-[10px]",children:t.accessPattern??"read"})}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs",children:t.callCount}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs text-destructive",children:t.errorCount||"—"})]},t.id))})]})})}function Gs({label:e,value:t}){return a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:e}),a.jsx("span",{className:"font-medium",children:t})]})}function Jk(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,o]=m.useState(new Set);m.useEffect(()=>{re.discovery.agents().then(u=>{t(u.data??[]),r(!1)}).catch(()=>r(!1))},[]);const i=[{category:"Agents",items:e.map(u=>({id:u.id,name:u.name,emoji:u.emoji,provider:u.provider,status:u.status}))},{category:"Owners",items:[...new Set(e.map(u=>u.ownerName).filter(Boolean))].map(u=>({id:u,name:u,type:"owner"}))},{category:"Connected Systems",items:[...new Set(e.flatMap(u=>u.connectedSystems??[]))].map(u=>({id:u,name:u,type:"system"}))}],l=u=>{o(c=>{const h=new Set(c);return h.has(u)?h.delete(u):h.add(u),h})};return n?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Identities"}),a.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Agents, owners, and connected systems"})]}),a.jsx("div",{className:"space-y-3",children:i.map(u=>a.jsxs(he,{children:[a.jsxs("button",{onClick:()=>l(u.category),className:"flex w-full items-center justify-between p-4 text-left",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(qx,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"text-sm font-medium",children:u.category}),a.jsx(ye,{variant:"secondary",className:"text-[10px]",children:u.items.length})]}),s.has(u.category)?a.jsx(pl,{className:"h-4 w-4 text-muted-foreground"}):a.jsx(qd,{className:"h-4 w-4 text-muted-foreground"})]}),s.has(u.category)&&a.jsx(we,{className:"border-t border-border pt-3",children:u.items.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"None"}):a.jsx("div",{className:"space-y-1.5",children:u.items.map(c=>a.jsxs("div",{className:"flex items-center justify-between rounded-md px-3 py-2 text-sm hover:bg-muted/50",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[c.emoji&&a.jsx("span",{className:"text-base",children:c.emoji}),a.jsx("span",{children:c.name})]}),c.status&&a.jsx(ye,{variant:c.status==="active"?"success":"secondary",className:"text-[10px]",children:c.status}),c.type&&a.jsx(ye,{variant:"outline",className:"text-[10px]",children:c.type})]},c.id))})})]},u.category))})]})}function eC(){const[e,t]=m.useState([]),[n,r]=m.useState(""),[s,o]=m.useState("callCount"),[i,l]=m.useState(!1),[u,c]=m.useState(!0);m.useEffect(()=>{re.observations.permissions().then(f=>{t(f.data??[]),c(!1)}).catch(()=>c(!1))},[]);const h=m.useMemo(()=>{let f=e;if(n){const g=n.toLowerCase();f=f.filter(x=>{var w,N;return((w=x.toolName)==null?void 0:w.toLowerCase().includes(g))||((N=x.category)==null?void 0:N.toLowerCase().includes(g))})}return[...f].sort((g,x)=>{const w=g[s]??0,N=x[s]??0;return typeof w=="string"?i?w.localeCompare(N):N.localeCompare(w):i?w-N:N-w})},[e,n,s,i]),d=f=>{s===f?l(!i):(o(f),l(!1))};return u?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Permissions"}),a.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," observed tool permission",e.length!==1?"s":""]})]}),a.jsxs("div",{className:"relative max-w-sm",children:[a.jsx(ey,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),a.jsx(Te,{placeholder:"Filter by tool or category...",className:"pl-9",value:n,onChange:f=>r(f.target.value)})]}),a.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[a.jsx(vu,{label:"Tool",sortKey:"toolName",current:s,asc:i,onSort:d}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Access"}),a.jsx(vu,{label:"Calls",sortKey:"callCount",current:s,asc:i,onSort:d,align:"right"}),a.jsx(vu,{label:"Errors",sortKey:"errorCount",current:s,asc:i,onSort:d,align:"right"})]})}),a.jsx("tbody",{children:h.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-muted-foreground",children:"No permissions"})}):h.map(f=>a.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-muted/30",children:[a.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:f.toolName}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(ye,{variant:"outline",className:"text-[10px]",children:f.category??"—"})}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(ye,{variant:f.accessPattern==="write"?"warning":f.accessPattern==="admin"?"destructive":"secondary",className:"text-[10px]",children:f.accessPattern??"read"})}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs",children:f.callCount}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs text-destructive",children:f.errorCount||"—"})]},f.id))})]})})]})}function vu({label:e,sortKey:t,current:n,asc:r,onSort:s,align:o="left"}){return a.jsx("th",{className:`cursor-pointer px-4 py-2.5 font-medium text-muted-foreground hover:text-foreground ${o==="right"?"text-right":"text-left"}`,onClick:()=>s(t),children:a.jsxs("span",{className:"inline-flex items-center gap-1",children:[e,n===t&&a.jsx(Hb,{className:"h-3 w-3"})]})})}function tC(){const[e,t]=m.useState([]),[n,r]=m.useState(!0);m.useEffect(()=>{re.observations.anomalies().then(i=>{t(i.data??[]),r(!1)}).catch(()=>r(!1))},[]);const s=i=>i.blocked||i.errorCount>3?"high":i.callCount===1||i.errorCount>0?"medium":"low",o=i=>i==="high"?"destructive":i==="medium"?"warning":"secondary";return n?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Risk Overview"}),a.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," anomal",e.length!==1?"ies":"y"," detected"]})]}),e.length===0?a.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border",children:[a.jsx(ef,{className:"h-8 w-8 text-muted-foreground/50"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No anomalies detected"})]}):a.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Tool"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Agent"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Risk"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),a.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"First Seen"})]})}),a.jsx("tbody",{children:e.map(i=>{var u;const l=s(i);return a.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-muted/30",children:[a.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:i.toolName}),a.jsx("td",{className:"px-4 py-2.5 text-xs text-muted-foreground",children:((u=i.agentId)==null?void 0:u.slice(0,8))??"—"}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(ye,{variant:o(l),className:"text-[10px]",children:l})}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(ye,{variant:"outline",className:"text-[10px]",children:i.category??"—"})}),a.jsx("td",{className:"px-4 py-2.5 text-right text-xs text-muted-foreground",children:i.firstSeen?new Date(i.firstSeen).toLocaleDateString():"—"})]},i.id)})})]})})]})}function Le(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Le(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var nC={value:()=>{}};function wl(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ra(n)}function ra(e){this._=e}function rC(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ra.prototype=wl.prototype={constructor:ra,on:function(e,t){var n=this._,r=rC(e+"",n),s,o=-1,i=r.length;if(arguments.length<2){for(;++o<i;)if((s=(e=r[o]).type)&&(s=sC(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<i;)if(s=(e=r[o]).type)n[s]=pm(n[s],e.name,t);else if(t==null)for(s in n)n[s]=pm(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ra(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,o;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,s=o.length;r<s;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)}};function sC(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function pm(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=nC,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Rc="http://www.w3.org/1999/xhtml";const gm={svg:"http://www.w3.org/2000/svg",xhtml:Rc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Nl(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),gm.hasOwnProperty(t)?{space:gm[t],local:e}:e}function oC(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Rc&&t.documentElement.namespaceURI===Rc?t.createElement(e):t.createElementNS(n,e)}}function iC(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Hy(e){var t=Nl(e);return(t.local?iC:oC)(t)}function aC(){}function lf(e){return e==null?aC:function(){return this.querySelector(e)}}function lC(e){typeof e!="function"&&(e=lf(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=new Array(i),u,c,h=0;h<i;++h)(u=o[h])&&(c=e.call(u,u.__data__,h,o))&&("__data__"in u&&(c.__data__=u.__data__),l[h]=c);return new gt(r,this._parents)}function uC(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function cC(){return[]}function By(e){return e==null?cC:function(){return this.querySelectorAll(e)}}function dC(e){return function(){return uC(e.apply(this,arguments))}}function fC(e){typeof e=="function"?e=dC(e):e=By(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var i=t[o],l=i.length,u,c=0;c<l;++c)(u=i[c])&&(r.push(e.call(u,u.__data__,c,i)),s.push(u));return new gt(r,s)}function Vy(e){return function(){return this.matches(e)}}function Uy(e){return function(t){return t.matches(e)}}var hC=Array.prototype.find;function mC(e){return function(){return hC.call(this.children,e)}}function pC(){return this.firstElementChild}function gC(e){return this.select(e==null?pC:mC(typeof e=="function"?e:Uy(e)))}var xC=Array.prototype.filter;function yC(){return Array.from(this.children)}function vC(e){return function(){return xC.call(this.children,e)}}function wC(e){return this.selectAll(e==null?yC:vC(typeof e=="function"?e:Uy(e)))}function NC(e){typeof e!="function"&&(e=Vy(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=[],u,c=0;c<i;++c)(u=o[c])&&e.call(u,u.__data__,c,o)&&l.push(u);return new gt(r,this._parents)}function Wy(e){return new Array(e.length)}function SC(){return new gt(this._enter||this._groups.map(Wy),this._parents)}function Da(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Da.prototype={constructor:Da,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function bC(e){return function(){return e}}function jC(e,t,n,r,s,o){for(var i=0,l,u=t.length,c=o.length;i<c;++i)(l=t[i])?(l.__data__=o[i],r[i]=l):n[i]=new Da(e,o[i]);for(;i<u;++i)(l=t[i])&&(s[i]=l)}function kC(e,t,n,r,s,o,i){var l,u,c=new Map,h=t.length,d=o.length,f=new Array(h),g;for(l=0;l<h;++l)(u=t[l])&&(f[l]=g=i.call(u,u.__data__,l,t)+"",c.has(g)?s[l]=u:c.set(g,u));for(l=0;l<d;++l)g=i.call(e,o[l],l,o)+"",(u=c.get(g))?(r[l]=u,u.__data__=o[l],c.delete(g)):n[l]=new Da(e,o[l]);for(l=0;l<h;++l)(u=t[l])&&c.get(f[l])===u&&(s[l]=u)}function CC(e){return e.__data__}function EC(e,t){if(!arguments.length)return Array.from(this,CC);var n=t?kC:jC,r=this._parents,s=this._groups;typeof e!="function"&&(e=bC(e));for(var o=s.length,i=new Array(o),l=new Array(o),u=new Array(o),c=0;c<o;++c){var h=r[c],d=s[c],f=d.length,g=_C(e.call(h,h&&h.__data__,c,r)),x=g.length,w=l[c]=new Array(x),N=i[c]=new Array(x),p=u[c]=new Array(f);n(h,d,w,N,p,g,t);for(var v=0,y=0,S,b;v<x;++v)if(S=w[v]){for(v>=y&&(y=v+1);!(b=N[y])&&++y<x;);S._next=b||null}}return i=new gt(i,r),i._enter=l,i._exit=u,i}function _C(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function PC(){return new gt(this._exit||this._groups.map(Wy),this._parents)}function MC(e,t,n){var r=this.enter(),s=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?o.remove():n(o),r&&s?r.merge(s).order():s}function IC(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,o=r.length,i=Math.min(s,o),l=new Array(s),u=0;u<i;++u)for(var c=n[u],h=r[u],d=c.length,f=l[u]=new Array(d),g,x=0;x<d;++x)(g=c[x]||h[x])&&(f[x]=g);for(;u<s;++u)l[u]=n[u];return new gt(l,this._parents)}function RC(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,o=r[s],i;--s>=0;)(i=r[s])&&(o&&i.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(i,o),o=i);return this}function TC(e){e||(e=LC);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o){for(var i=n[o],l=i.length,u=s[o]=new Array(l),c,h=0;h<l;++h)(c=i[h])&&(u[h]=c);u.sort(t)}return new gt(s,this._parents).order()}function LC(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function AC(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function zC(){return Array.from(this)}function DC(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length;s<o;++s){var i=r[s];if(i)return i}return null}function $C(){let e=0;for(const t of this)++e;return e}function OC(){return!this.node()}function FC(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],o=0,i=s.length,l;o<i;++o)(l=s[o])&&e.call(l,l.__data__,o,s);return this}function HC(e){return function(){this.removeAttribute(e)}}function BC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function VC(e,t){return function(){this.setAttribute(e,t)}}function UC(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function WC(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function KC(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function GC(e,t){var n=Nl(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?BC:HC:typeof t=="function"?n.local?KC:WC:n.local?UC:VC)(n,t))}function Ky(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function YC(e){return function(){this.style.removeProperty(e)}}function XC(e,t,n){return function(){this.style.setProperty(e,t,n)}}function QC(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function qC(e,t,n){return arguments.length>1?this.each((t==null?YC:typeof t=="function"?QC:XC)(e,t,n??"")):gs(this.node(),e)}function gs(e,t){return e.style.getPropertyValue(t)||Ky(e).getComputedStyle(e,null).getPropertyValue(t)}function ZC(e){return function(){delete this[e]}}function JC(e,t){return function(){this[e]=t}}function eE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function tE(e,t){return arguments.length>1?this.each((t==null?ZC:typeof t=="function"?eE:JC)(e,t)):this.node()[e]}function Gy(e){return e.trim().split(/^|\s+/)}function uf(e){return e.classList||new Yy(e)}function Yy(e){this._node=e,this._names=Gy(e.getAttribute("class")||"")}Yy.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Xy(e,t){for(var n=uf(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function Qy(e,t){for(var n=uf(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function nE(e){return function(){Xy(this,e)}}function rE(e){return function(){Qy(this,e)}}function sE(e,t){return function(){(t.apply(this,arguments)?Xy:Qy)(this,e)}}function oE(e,t){var n=Gy(e+"");if(arguments.length<2){for(var r=uf(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?sE:t?nE:rE)(n,t))}function iE(){this.textContent=""}function aE(e){return function(){this.textContent=e}}function lE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function uE(e){return arguments.length?this.each(e==null?iE:(typeof e=="function"?lE:aE)(e)):this.node().textContent}function cE(){this.innerHTML=""}function dE(e){return function(){this.innerHTML=e}}function fE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function hE(e){return arguments.length?this.each(e==null?cE:(typeof e=="function"?fE:dE)(e)):this.node().innerHTML}function mE(){this.nextSibling&&this.parentNode.appendChild(this)}function pE(){return this.each(mE)}function gE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function xE(){return this.each(gE)}function yE(e){var t=typeof e=="function"?e:Hy(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function vE(){return null}function wE(e,t){var n=typeof e=="function"?e:Hy(e),r=t==null?vE:typeof t=="function"?t:lf(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function NE(){var e=this.parentNode;e&&e.removeChild(this)}function SE(){return this.each(NE)}function bE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function jE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function kE(e){return this.select(e?jE:bE)}function CE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function EE(e){return function(t){e.call(this,t,this.__data__)}}function _E(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function PE(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,o;n<s;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function ME(e,t,n){return function(){var r=this.__on,s,o=EE(t);if(r){for(var i=0,l=r.length;i<l;++i)if((s=r[i]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=n),s.value=t;return}}this.addEventListener(e.type,o,n),s={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(s):this.__on=[s]}}function IE(e,t,n){var r=_E(e+""),s,o=r.length,i;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,c=l.length,h;u<c;++u)for(s=0,h=l[u];s<o;++s)if((i=r[s]).type===h.type&&i.name===h.name)return h.value}return}for(l=t?ME:PE,s=0;s<o;++s)this.each(l(r[s],t,n));return this}function qy(e,t,n){var r=Ky(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function RE(e,t){return function(){return qy(this,e,t)}}function TE(e,t){return function(){return qy(this,e,t.apply(this,arguments))}}function LE(e,t){return this.each((typeof t=="function"?TE:RE)(e,t))}function*AE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length,i;s<o;++s)(i=r[s])&&(yield i)}var Zy=[null];function gt(e,t){this._groups=e,this._parents=t}function Zo(){return new gt([[document.documentElement]],Zy)}function zE(){return this}gt.prototype=Zo.prototype={constructor:gt,select:lC,selectAll:fC,selectChild:gC,selectChildren:wC,filter:NC,data:EC,enter:SC,exit:PC,join:MC,merge:IC,selection:zE,order:RC,sort:TC,call:AC,nodes:zC,node:DC,size:$C,empty:OC,each:FC,attr:GC,style:qC,property:tE,classed:oE,text:uE,html:hE,raise:pE,lower:xE,append:yE,insert:wE,remove:SE,clone:kE,datum:CE,on:IE,dispatch:LE,[Symbol.iterator]:AE};function dt(e){return typeof e=="string"?new gt([[document.querySelector(e)]],[document.documentElement]):new gt([[e]],Zy)}function DE(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Mt(e,t){if(e=DE(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const $E={passive:!1},Lo={capture:!0,passive:!1};function wu(e){e.stopImmediatePropagation()}function os(e){e.preventDefault(),e.stopImmediatePropagation()}function Jy(e){var t=e.document.documentElement,n=dt(e).on("dragstart.drag",os,Lo);"onselectstart"in t?n.on("selectstart.drag",os,Lo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function e0(e,t){var n=e.document.documentElement,r=dt(e).on("dragstart.drag",null);t&&(r.on("click.drag",os,Lo),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Mi=e=>()=>e;function Tc(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:i,y:l,dx:u,dy:c,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}Tc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function OE(e){return!e.ctrlKey&&!e.button}function FE(){return this.parentNode}function HE(e,t){return t??{x:e.x,y:e.y}}function BE(){return navigator.maxTouchPoints||"ontouchstart"in this}function t0(){var e=OE,t=FE,n=HE,r=BE,s={},o=wl("start","drag","end"),i=0,l,u,c,h,d=0;function f(S){S.on("mousedown.drag",g).filter(r).on("touchstart.drag",N).on("touchmove.drag",p,$E).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(S,b){if(!(h||!e.call(this,S,b))){var C=y(this,t.call(this,S,b),S,b,"mouse");C&&(dt(S.view).on("mousemove.drag",x,Lo).on("mouseup.drag",w,Lo),Jy(S.view),wu(S),c=!1,l=S.clientX,u=S.clientY,C("start",S))}}function x(S){if(os(S),!c){var b=S.clientX-l,C=S.clientY-u;c=b*b+C*C>d}s.mouse("drag",S)}function w(S){dt(S.view).on("mousemove.drag mouseup.drag",null),e0(S.view,c),os(S),s.mouse("end",S)}function N(S,b){if(e.call(this,S,b)){var C=S.changedTouches,j=t.call(this,S,b),P=C.length,I,$;for(I=0;I<P;++I)($=y(this,j,S,b,C[I].identifier,C[I]))&&(wu(S),$("start",S,C[I]))}}function p(S){var b=S.changedTouches,C=b.length,j,P;for(j=0;j<C;++j)(P=s[b[j].identifier])&&(os(S),P("drag",S,b[j]))}function v(S){var b=S.changedTouches,C=b.length,j,P;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),j=0;j<C;++j)(P=s[b[j].identifier])&&(wu(S),P("end",S,b[j]))}function y(S,b,C,j,P,I){var $=o.copy(),R=Mt(I||C,b),T,D,E;if((E=n.call(S,new Tc("beforestart",{sourceEvent:C,target:f,identifier:P,active:i,x:R[0],y:R[1],dx:0,dy:0,dispatch:$}),j))!=null)return T=E.x-R[0]||0,D=E.y-R[1]||0,function L(k,z,_){var M=R,A;switch(k){case"start":s[P]=L,A=i++;break;case"end":delete s[P],--i;case"drag":R=Mt(_||z,b),A=i;break}$.call(k,S,new Tc(k,{sourceEvent:z,subject:E,target:f,identifier:P,active:A,x:R[0]+T,y:R[1]+D,dx:R[0]-M[0],dy:R[1]-M[1],dispatch:$}),j)}}return f.filter=function(S){return arguments.length?(e=typeof S=="function"?S:Mi(!!S),f):e},f.container=function(S){return arguments.length?(t=typeof S=="function"?S:Mi(S),f):t},f.subject=function(S){return arguments.length?(n=typeof S=="function"?S:Mi(S),f):n},f.touchable=function(S){return arguments.length?(r=typeof S=="function"?S:Mi(!!S),f):r},f.on=function(){var S=o.on.apply(o,arguments);return S===o?f:S},f.clickDistance=function(S){return arguments.length?(d=(S=+S)*S,f):Math.sqrt(d)},f}function cf(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function n0(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Jo(){}var Ao=.7,$a=1/Ao,is="\\s*([+-]?\\d+)\\s*",zo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",VE=/^#([0-9a-f]{3,8})$/,UE=new RegExp(`^rgb\\(${is},${is},${is}\\)$`),WE=new RegExp(`^rgb\\(${Qt},${Qt},${Qt}\\)$`),KE=new RegExp(`^rgba\\(${is},${is},${is},${zo}\\)$`),GE=new RegExp(`^rgba\\(${Qt},${Qt},${Qt},${zo}\\)$`),YE=new RegExp(`^hsl\\(${zo},${Qt},${Qt}\\)$`),XE=new RegExp(`^hsla\\(${zo},${Qt},${Qt},${zo}\\)$`),xm={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};cf(Jo,br,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ym,formatHex:ym,formatHex8:QE,formatHsl:qE,formatRgb:vm,toString:vm});function ym(){return this.rgb().formatHex()}function QE(){return this.rgb().formatHex8()}function qE(){return r0(this).formatHsl()}function vm(){return this.rgb().formatRgb()}function br(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=VE.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?wm(t):n===3?new it(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ii(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ii(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=UE.exec(e))?new it(t[1],t[2],t[3],1):(t=WE.exec(e))?new it(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=KE.exec(e))?Ii(t[1],t[2],t[3],t[4]):(t=GE.exec(e))?Ii(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=YE.exec(e))?bm(t[1],t[2]/100,t[3]/100,1):(t=XE.exec(e))?bm(t[1],t[2]/100,t[3]/100,t[4]):xm.hasOwnProperty(e)?wm(xm[e]):e==="transparent"?new it(NaN,NaN,NaN,0):null}function wm(e){return new it(e>>16&255,e>>8&255,e&255,1)}function Ii(e,t,n,r){return r<=0&&(e=t=n=NaN),new it(e,t,n,r)}function ZE(e){return e instanceof Jo||(e=br(e)),e?(e=e.rgb(),new it(e.r,e.g,e.b,e.opacity)):new it}function Lc(e,t,n,r){return arguments.length===1?ZE(e):new it(e,t,n,r??1)}function it(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}cf(it,Lc,n0(Jo,{brighter(e){return e=e==null?$a:Math.pow($a,e),new it(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ao:Math.pow(Ao,e),new it(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new it(mr(this.r),mr(this.g),mr(this.b),Oa(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Nm,formatHex:Nm,formatHex8:JE,formatRgb:Sm,toString:Sm}));function Nm(){return`#${dr(this.r)}${dr(this.g)}${dr(this.b)}`}function JE(){return`#${dr(this.r)}${dr(this.g)}${dr(this.b)}${dr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Sm(){const e=Oa(this.opacity);return`${e===1?"rgb(":"rgba("}${mr(this.r)}, ${mr(this.g)}, ${mr(this.b)}${e===1?")":`, ${e})`}`}function Oa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function mr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function dr(e){return e=mr(e),(e<16?"0":"")+e.toString(16)}function bm(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Rt(e,t,n,r)}function r0(e){if(e instanceof Rt)return new Rt(e.h,e.s,e.l,e.opacity);if(e instanceof Jo||(e=br(e)),!e)return new Rt;if(e instanceof Rt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),o=Math.max(t,n,r),i=NaN,l=o-s,u=(o+s)/2;return l?(t===o?i=(n-r)/l+(n<r)*6:n===o?i=(r-t)/l+2:i=(t-n)/l+4,l/=u<.5?o+s:2-o-s,i*=60):l=u>0&&u<1?0:i,new Rt(i,l,u,e.opacity)}function e_(e,t,n,r){return arguments.length===1?r0(e):new Rt(e,t,n,r??1)}function Rt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}cf(Rt,e_,n0(Jo,{brighter(e){return e=e==null?$a:Math.pow($a,e),new Rt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ao:Math.pow(Ao,e),new Rt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new it(Nu(e>=240?e-240:e+120,s,r),Nu(e,s,r),Nu(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Rt(jm(this.h),Ri(this.s),Ri(this.l),Oa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Oa(this.opacity);return`${e===1?"hsl(":"hsla("}${jm(this.h)}, ${Ri(this.s)*100}%, ${Ri(this.l)*100}%${e===1?")":`, ${e})`}`}}));function jm(e){return e=(e||0)%360,e<0?e+360:e}function Ri(e){return Math.max(0,Math.min(1,e||0))}function Nu(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const df=e=>()=>e;function t_(e,t){return function(n){return e+n*t}}function n_(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function r_(e){return(e=+e)==1?s0:function(t,n){return n-t?n_(t,n,e):df(isNaN(t)?n:t)}}function s0(e,t){var n=t-e;return n?t_(e,n):df(isNaN(e)?t:e)}const Fa=function e(t){var n=r_(t);function r(s,o){var i=n((s=Lc(s)).r,(o=Lc(o)).r),l=n(s.g,o.g),u=n(s.b,o.b),c=s0(s.opacity,o.opacity);return function(h){return s.r=i(h),s.g=l(h),s.b=u(h),s.opacity=c(h),s+""}}return r.gamma=e,r}(1);function s_(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(o){for(s=0;s<n;++s)r[s]=e[s]*(1-o)+t[s]*o;return r}}function o_(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function i_(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),o=new Array(n),i;for(i=0;i<r;++i)s[i]=ho(e[i],t[i]);for(;i<n;++i)o[i]=t[i];return function(l){for(i=0;i<r;++i)o[i]=s[i](l);return o}}function a_(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Wt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function l_(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=ho(e[s],t[s]):r[s]=t[s];return function(o){for(s in n)r[s]=n[s](o);return r}}var Ac=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Su=new RegExp(Ac.source,"g");function u_(e){return function(){return e}}function c_(e){return function(t){return e(t)+""}}function o0(e,t){var n=Ac.lastIndex=Su.lastIndex=0,r,s,o,i=-1,l=[],u=[];for(e=e+"",t=t+"";(r=Ac.exec(e))&&(s=Su.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),l[i]?l[i]+=o:l[++i]=o),(r=r[0])===(s=s[0])?l[i]?l[i]+=s:l[++i]=s:(l[++i]=null,u.push({i,x:Wt(r,s)})),n=Su.lastIndex;return n<t.length&&(o=t.slice(n),l[i]?l[i]+=o:l[++i]=o),l.length<2?u[0]?c_(u[0].x):u_(t):(t=u.length,function(c){for(var h=0,d;h<t;++h)l[(d=u[h]).i]=d.x(c);return l.join("")})}function ho(e,t){var n=typeof t,r;return t==null||n==="boolean"?df(t):(n==="number"?Wt:n==="string"?(r=br(t))?(t=r,Fa):o0:t instanceof br?Fa:t instanceof Date?a_:o_(t)?s_:Array.isArray(t)?i_:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?l_:Wt)(e,t)}var km=180/Math.PI,zc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function i0(e,t,n,r,s,o){var i,l,u;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,u/=l),e*r<t*n&&(e=-e,t=-t,u=-u,i=-i),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*km,skewX:Math.atan(u)*km,scaleX:i,scaleY:l}}var Ti;function d_(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?zc:i0(t.a,t.b,t.c,t.d,t.e,t.f)}function f_(e){return e==null||(Ti||(Ti=document.createElementNS("http://www.w3.org/2000/svg","g")),Ti.setAttribute("transform",e),!(e=Ti.transform.baseVal.consolidate()))?zc:(e=e.matrix,i0(e.a,e.b,e.c,e.d,e.e,e.f))}function a0(e,t,n,r){function s(c){return c.length?c.pop()+" ":""}function o(c,h,d,f,g,x){if(c!==d||h!==f){var w=g.push("translate(",null,t,null,n);x.push({i:w-4,x:Wt(c,d)},{i:w-2,x:Wt(h,f)})}else(d||f)&&g.push("translate("+d+t+f+n)}function i(c,h,d,f){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),f.push({i:d.push(s(d)+"rotate(",null,r)-2,x:Wt(c,h)})):h&&d.push(s(d)+"rotate("+h+r)}function l(c,h,d,f){c!==h?f.push({i:d.push(s(d)+"skewX(",null,r)-2,x:Wt(c,h)}):h&&d.push(s(d)+"skewX("+h+r)}function u(c,h,d,f,g,x){if(c!==d||h!==f){var w=g.push(s(g)+"scale(",null,",",null,")");x.push({i:w-4,x:Wt(c,d)},{i:w-2,x:Wt(h,f)})}else(d!==1||f!==1)&&g.push(s(g)+"scale("+d+","+f+")")}return function(c,h){var d=[],f=[];return c=e(c),h=e(h),o(c.translateX,c.translateY,h.translateX,h.translateY,d,f),i(c.rotate,h.rotate,d,f),l(c.skewX,h.skewX,d,f),u(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,f),c=h=null,function(g){for(var x=-1,w=f.length,N;++x<w;)d[(N=f[x]).i]=N.x(g);return d.join("")}}}var h_=a0(d_,"px, ","px)","deg)"),m_=a0(f_,", ",")",")"),p_=1e-12;function Cm(e){return((e=Math.exp(e))+1/e)/2}function g_(e){return((e=Math.exp(e))-1/e)/2}function x_(e){return((e=Math.exp(2*e))-1)/(e+1)}const sa=function e(t,n,r){function s(o,i){var l=o[0],u=o[1],c=o[2],h=i[0],d=i[1],f=i[2],g=h-l,x=d-u,w=g*g+x*x,N,p;if(w<p_)p=Math.log(f/c)/t,N=function(j){return[l+j*g,u+j*x,c*Math.exp(t*j*p)]};else{var v=Math.sqrt(w),y=(f*f-c*c+r*w)/(2*c*n*v),S=(f*f-c*c-r*w)/(2*f*n*v),b=Math.log(Math.sqrt(y*y+1)-y),C=Math.log(Math.sqrt(S*S+1)-S);p=(C-b)/t,N=function(j){var P=j*p,I=Cm(b),$=c/(n*v)*(I*x_(t*P+b)-g_(b));return[l+$*g,u+$*x,c*I/Cm(t*P+b)]}}return N.duration=p*1e3*t/Math.SQRT2,N}return s.rho=function(o){var i=Math.max(.001,+o),l=i*i,u=l*l;return e(i,l,u)},s}(Math.SQRT2,2,4);var xs=0,eo=0,Ys=0,l0=1e3,Ha,to,Ba=0,jr=0,Sl=0,Do=typeof performance=="object"&&performance.now?performance:Date,u0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ff(){return jr||(u0(y_),jr=Do.now()+Sl)}function y_(){jr=0}function Va(){this._call=this._time=this._next=null}Va.prototype=c0.prototype={constructor:Va,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ff():+n)+(t==null?0:+t),!this._next&&to!==this&&(to?to._next=this:Ha=this,to=this),this._call=e,this._time=n,Dc()},stop:function(){this._call&&(this._call=null,this._time=1/0,Dc())}};function c0(e,t,n){var r=new Va;return r.restart(e,t,n),r}function v_(){ff(),++xs;for(var e=Ha,t;e;)(t=jr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--xs}function Em(){jr=(Ba=Do.now())+Sl,xs=eo=0;try{v_()}finally{xs=0,N_(),jr=0}}function w_(){var e=Do.now(),t=e-Ba;t>l0&&(Sl-=t,Ba=e)}function N_(){for(var e,t=Ha,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ha=n);to=e,Dc(r)}function Dc(e){if(!xs){eo&&(eo=clearTimeout(eo));var t=e-jr;t>24?(e<1/0&&(eo=setTimeout(Em,e-Do.now()-Sl)),Ys&&(Ys=clearInterval(Ys))):(Ys||(Ba=Do.now(),Ys=setInterval(w_,l0)),xs=1,u0(Em))}}function _m(e,t,n){var r=new Va;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var S_=wl("start","end","cancel","interrupt"),b_=[],d0=0,Pm=1,$c=2,oa=3,Mm=4,Oc=5,ia=6;function bl(e,t,n,r,s,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;j_(e,n,{name:t,index:r,group:s,on:S_,tween:b_,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:d0})}function hf(e,t){var n=Ht(e,t);if(n.state>d0)throw new Error("too late; already scheduled");return n}function nn(e,t){var n=Ht(e,t);if(n.state>oa)throw new Error("too late; already running");return n}function Ht(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function j_(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=c0(o,0,n.time);function o(c){n.state=Pm,n.timer.restart(i,n.delay,n.time),n.delay<=c&&i(c-n.delay)}function i(c){var h,d,f,g;if(n.state!==Pm)return u();for(h in r)if(g=r[h],g.name===n.name){if(g.state===oa)return _m(i);g.state===Mm?(g.state=ia,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[h]):+h<t&&(g.state=ia,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[h])}if(_m(function(){n.state===oa&&(n.state=Mm,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=$c,n.on.call("start",e,e.__data__,n.index,n.group),n.state===$c){for(n.state=oa,s=new Array(f=n.tween.length),h=0,d=-1;h<f;++h)(g=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(s[++d]=g);s.length=d+1}}function l(c){for(var h=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(u),n.state=Oc,1),d=-1,f=s.length;++d<f;)s[d].call(e,h);n.state===Oc&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=ia,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function aa(e,t){var n=e.__transition,r,s,o=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((r=n[i]).name!==t){o=!1;continue}s=r.state>$c&&r.state<Oc,r.state=ia,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}o&&delete e.__transition}}function k_(e){return this.each(function(){aa(this,e)})}function C_(e,t){var n,r;return function(){var s=nn(this,e),o=s.tween;if(o!==n){r=n=o;for(var i=0,l=r.length;i<l;++i)if(r[i].name===t){r=r.slice(),r.splice(i,1);break}}s.tween=r}}function E_(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=nn(this,e),i=o.tween;if(i!==r){s=(r=i).slice();for(var l={name:t,value:n},u=0,c=s.length;u<c;++u)if(s[u].name===t){s[u]=l;break}u===c&&s.push(l)}o.tween=s}}function __(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ht(this.node(),n).tween,s=0,o=r.length,i;s<o;++s)if((i=r[s]).name===e)return i.value;return null}return this.each((t==null?C_:E_)(n,e,t))}function mf(e,t,n){var r=e._id;return e.each(function(){var s=nn(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Ht(s,r).value[t]}}function f0(e,t){var n;return(typeof t=="number"?Wt:t instanceof br?Fa:(n=br(t))?(t=n,Fa):o0)(e,t)}function P_(e){return function(){this.removeAttribute(e)}}function M_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function I_(e,t,n){var r,s=n+"",o;return function(){var i=this.getAttribute(e);return i===s?null:i===r?o:o=t(r=i,n)}}function R_(e,t,n){var r,s=n+"",o;return function(){var i=this.getAttributeNS(e.space,e.local);return i===s?null:i===r?o:o=t(r=i,n)}}function T_(e,t,n){var r,s,o;return function(){var i,l=n(this),u;return l==null?void this.removeAttribute(e):(i=this.getAttribute(e),u=l+"",i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,l)))}}function L_(e,t,n){var r,s,o;return function(){var i,l=n(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),u=l+"",i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,l)))}}function A_(e,t){var n=Nl(e),r=n==="transform"?m_:f0;return this.attrTween(e,typeof t=="function"?(n.local?L_:T_)(n,r,mf(this,"attr."+e,t)):t==null?(n.local?M_:P_)(n):(n.local?R_:I_)(n,r,t))}function z_(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function D_(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function $_(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&D_(e,o)),n}return s._value=t,s}function O_(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&z_(e,o)),n}return s._value=t,s}function F_(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Nl(e);return this.tween(n,(r.local?$_:O_)(r,t))}function H_(e,t){return function(){hf(this,e).delay=+t.apply(this,arguments)}}function B_(e,t){return t=+t,function(){hf(this,e).delay=t}}function V_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?H_:B_)(t,e)):Ht(this.node(),t).delay}function U_(e,t){return function(){nn(this,e).duration=+t.apply(this,arguments)}}function W_(e,t){return t=+t,function(){nn(this,e).duration=t}}function K_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?U_:W_)(t,e)):Ht(this.node(),t).duration}function G_(e,t){if(typeof t!="function")throw new Error;return function(){nn(this,e).ease=t}}function Y_(e){var t=this._id;return arguments.length?this.each(G_(t,e)):Ht(this.node(),t).ease}function X_(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;nn(this,e).ease=n}}function Q_(e){if(typeof e!="function")throw new Error;return this.each(X_(this._id,e))}function q_(e){typeof e!="function"&&(e=Vy(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=[],u,c=0;c<i;++c)(u=o[c])&&e.call(u,u.__data__,c,o)&&l.push(u);return new yn(r,this._parents,this._name,this._id)}function Z_(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,o=Math.min(r,s),i=new Array(r),l=0;l<o;++l)for(var u=t[l],c=n[l],h=u.length,d=i[l]=new Array(h),f,g=0;g<h;++g)(f=u[g]||c[g])&&(d[g]=f);for(;l<r;++l)i[l]=t[l];return new yn(i,this._parents,this._name,this._id)}function J_(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function e3(e,t,n){var r,s,o=J_(t)?hf:nn;return function(){var i=o(this,e),l=i.on;l!==r&&(s=(r=l).copy()).on(t,n),i.on=s}}function t3(e,t){var n=this._id;return arguments.length<2?Ht(this.node(),n).on.on(e):this.each(e3(n,e,t))}function n3(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function r3(){return this.on("end.remove",n3(this._id))}function s3(e){var t=this._name,n=this._id;typeof e!="function"&&(e=lf(e));for(var r=this._groups,s=r.length,o=new Array(s),i=0;i<s;++i)for(var l=r[i],u=l.length,c=o[i]=new Array(u),h,d,f=0;f<u;++f)(h=l[f])&&(d=e.call(h,h.__data__,f,l))&&("__data__"in h&&(d.__data__=h.__data__),c[f]=d,bl(c[f],t,n,f,c,Ht(h,n)));return new yn(o,this._parents,t,n)}function o3(e){var t=this._name,n=this._id;typeof e!="function"&&(e=By(e));for(var r=this._groups,s=r.length,o=[],i=[],l=0;l<s;++l)for(var u=r[l],c=u.length,h,d=0;d<c;++d)if(h=u[d]){for(var f=e.call(h,h.__data__,d,u),g,x=Ht(h,n),w=0,N=f.length;w<N;++w)(g=f[w])&&bl(g,t,n,w,f,x);o.push(f),i.push(h)}return new yn(o,i,t,n)}var i3=Zo.prototype.constructor;function a3(){return new i3(this._groups,this._parents)}function l3(e,t){var n,r,s;return function(){var o=gs(this,e),i=(this.style.removeProperty(e),gs(this,e));return o===i?null:o===n&&i===r?s:s=t(n=o,r=i)}}function h0(e){return function(){this.style.removeProperty(e)}}function u3(e,t,n){var r,s=n+"",o;return function(){var i=gs(this,e);return i===s?null:i===r?o:o=t(r=i,n)}}function c3(e,t,n){var r,s,o;return function(){var i=gs(this,e),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),gs(this,e))),i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,l))}}function d3(e,t){var n,r,s,o="style."+t,i="end."+o,l;return function(){var u=nn(this,e),c=u.on,h=u.value[o]==null?l||(l=h0(t)):void 0;(c!==n||s!==h)&&(r=(n=c).copy()).on(i,s=h),u.on=r}}function f3(e,t,n){var r=(e+="")=="transform"?h_:f0;return t==null?this.styleTween(e,l3(e,r)).on("end.style."+e,h0(e)):typeof t=="function"?this.styleTween(e,c3(e,r,mf(this,"style."+e,t))).each(d3(this._id,e)):this.styleTween(e,u3(e,r,t),n).on("end.style."+e,null)}function h3(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function m3(e,t,n){var r,s;function o(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&h3(e,i,n)),r}return o._value=t,o}function p3(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,m3(e,t,n??""))}function g3(e){return function(){this.textContent=e}}function x3(e){return function(){var t=e(this);this.textContent=t??""}}function y3(e){return this.tween("text",typeof e=="function"?x3(mf(this,"text",e)):g3(e==null?"":e+""))}function v3(e){return function(t){this.textContent=e.call(this,t)}}function w3(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&v3(s)),t}return r._value=e,r}function N3(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,w3(e))}function S3(){for(var e=this._name,t=this._id,n=m0(),r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],l=i.length,u,c=0;c<l;++c)if(u=i[c]){var h=Ht(u,t);bl(u,e,n,c,i,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new yn(r,this._parents,e,n)}function b3(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,i){var l={value:i},u={value:function(){--s===0&&o()}};n.each(function(){var c=nn(this,r),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(u)),c.on=t}),s===0&&o()})}var j3=0;function yn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function m0(){return++j3}var on=Zo.prototype;yn.prototype={constructor:yn,select:s3,selectAll:o3,selectChild:on.selectChild,selectChildren:on.selectChildren,filter:q_,merge:Z_,selection:a3,transition:S3,call:on.call,nodes:on.nodes,node:on.node,size:on.size,empty:on.empty,each:on.each,on:t3,attr:A_,attrTween:F_,style:f3,styleTween:p3,text:y3,textTween:N3,remove:r3,tween:__,delay:V_,duration:K_,ease:Y_,easeVarying:Q_,end:b3,[Symbol.iterator]:on[Symbol.iterator]};function k3(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var C3={time:null,delay:0,duration:250,ease:k3};function E3(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function _3(e){var t,n;e instanceof yn?(t=e._id,e=e._name):(t=m0(),(n=C3).time=ff(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],l=i.length,u,c=0;c<l;++c)(u=i[c])&&bl(u,e,t,c,i,n||E3(u,t));return new yn(r,this._parents,e,t)}Zo.prototype.interrupt=k_;Zo.prototype.transition=_3;const Li=e=>()=>e;function P3(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function dn(e,t,n){this.k=e,this.x=t,this.y=n}dn.prototype={constructor:dn,scale:function(e){return e===1?this:new dn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new dn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var jl=new dn(1,0,0);p0.prototype=dn.prototype;function p0(e){for(;!e.__zoom;)if(!(e=e.parentNode))return jl;return e.__zoom}function bu(e){e.stopImmediatePropagation()}function Xs(e){e.preventDefault(),e.stopImmediatePropagation()}function M3(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function I3(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Im(){return this.__zoom||jl}function R3(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function T3(){return navigator.maxTouchPoints||"ontouchstart"in this}function L3(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i))}function g0(){var e=M3,t=I3,n=L3,r=R3,s=T3,o=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,u=sa,c=wl("start","zoom","end"),h,d,f,g=500,x=150,w=0,N=10;function p(E){E.property("__zoom",Im).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",$).filter(s).on("touchstart.zoom",R).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",D).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(E,L,k,z){var _=E.selection?E.selection():E;_.property("__zoom",Im),E!==_?b(E,L,k,z):_.interrupt().each(function(){C(this,arguments).event(z).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},p.scaleBy=function(E,L,k,z){p.scaleTo(E,function(){var _=this.__zoom.k,M=typeof L=="function"?L.apply(this,arguments):L;return _*M},k,z)},p.scaleTo=function(E,L,k,z){p.transform(E,function(){var _=t.apply(this,arguments),M=this.__zoom,A=k==null?S(_):typeof k=="function"?k.apply(this,arguments):k,F=M.invert(A),O=typeof L=="function"?L.apply(this,arguments):L;return n(y(v(M,O),A,F),_,i)},k,z)},p.translateBy=function(E,L,k,z){p.transform(E,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),i)},null,z)},p.translateTo=function(E,L,k,z,_){p.transform(E,function(){var M=t.apply(this,arguments),A=this.__zoom,F=z==null?S(M):typeof z=="function"?z.apply(this,arguments):z;return n(jl.translate(F[0],F[1]).scale(A.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof k=="function"?-k.apply(this,arguments):-k),M,i)},z,_)};function v(E,L){return L=Math.max(o[0],Math.min(o[1],L)),L===E.k?E:new dn(L,E.x,E.y)}function y(E,L,k){var z=L[0]-k[0]*E.k,_=L[1]-k[1]*E.k;return z===E.x&&_===E.y?E:new dn(E.k,z,_)}function S(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function b(E,L,k,z){E.on("start.zoom",function(){C(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(z).end()}).tween("zoom",function(){var _=this,M=arguments,A=C(_,M).event(z),F=t.apply(_,M),O=k==null?S(F):typeof k=="function"?k.apply(_,M):k,U=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),V=_.__zoom,G=typeof L=="function"?L.apply(_,M):L,Y=u(V.invert(O).concat(U/V.k),G.invert(O).concat(U/G.k));return function(X){if(X===1)X=G;else{var B=Y(X),q=U/B[2];X=new dn(q,O[0]-B[0]*q,O[1]-B[1]*q)}A.zoom(null,X)}})}function C(E,L,k){return!k&&E.__zooming||new j(E,L)}function j(E,L){this.that=E,this.args=L,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,L),this.taps=0}j.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,L){return this.mouse&&E!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=L.invert(this.touch1[0])),this.that.__zoom=L,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var L=dt(this.that).datum();c.call(E,this.that,new P3(E,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:c}),L)}};function P(E,...L){if(!e.apply(this,arguments))return;var k=C(this,L).event(E),z=this.__zoom,_=Math.max(o[0],Math.min(o[1],z.k*Math.pow(2,r.apply(this,arguments)))),M=Mt(E);if(k.wheel)(k.mouse[0][0]!==M[0]||k.mouse[0][1]!==M[1])&&(k.mouse[1]=z.invert(k.mouse[0]=M)),clearTimeout(k.wheel);else{if(z.k===_)return;k.mouse=[M,z.invert(M)],aa(this),k.start()}Xs(E),k.wheel=setTimeout(A,x),k.zoom("mouse",n(y(v(z,_),k.mouse[0],k.mouse[1]),k.extent,i));function A(){k.wheel=null,k.end()}}function I(E,...L){if(f||!e.apply(this,arguments))return;var k=E.currentTarget,z=C(this,L,!0).event(E),_=dt(E.view).on("mousemove.zoom",O,!0).on("mouseup.zoom",U,!0),M=Mt(E,k),A=E.clientX,F=E.clientY;Jy(E.view),bu(E),z.mouse=[M,this.__zoom.invert(M)],aa(this),z.start();function O(V){if(Xs(V),!z.moved){var G=V.clientX-A,Y=V.clientY-F;z.moved=G*G+Y*Y>w}z.event(V).zoom("mouse",n(y(z.that.__zoom,z.mouse[0]=Mt(V,k),z.mouse[1]),z.extent,i))}function U(V){_.on("mousemove.zoom mouseup.zoom",null),e0(V.view,z.moved),Xs(V),z.event(V).end()}}function $(E,...L){if(e.apply(this,arguments)){var k=this.__zoom,z=Mt(E.changedTouches?E.changedTouches[0]:E,this),_=k.invert(z),M=k.k*(E.shiftKey?.5:2),A=n(y(v(k,M),z,_),t.apply(this,L),i);Xs(E),l>0?dt(this).transition().duration(l).call(b,A,z,E):dt(this).call(p.transform,A,z,E)}}function R(E,...L){if(e.apply(this,arguments)){var k=E.touches,z=k.length,_=C(this,L,E.changedTouches.length===z).event(E),M,A,F,O;for(bu(E),A=0;A<z;++A)F=k[A],O=Mt(F,this),O=[O,this.__zoom.invert(O),F.identifier],_.touch0?!_.touch1&&_.touch0[2]!==O[2]&&(_.touch1=O,_.taps=0):(_.touch0=O,M=!0,_.taps=1+!!h);h&&(h=clearTimeout(h)),M&&(_.taps<2&&(d=O[0],h=setTimeout(function(){h=null},g)),aa(this),_.start())}}function T(E,...L){if(this.__zooming){var k=C(this,L).event(E),z=E.changedTouches,_=z.length,M,A,F,O;for(Xs(E),M=0;M<_;++M)A=z[M],F=Mt(A,this),k.touch0&&k.touch0[2]===A.identifier?k.touch0[0]=F:k.touch1&&k.touch1[2]===A.identifier&&(k.touch1[0]=F);if(A=k.that.__zoom,k.touch1){var U=k.touch0[0],V=k.touch0[1],G=k.touch1[0],Y=k.touch1[1],X=(X=G[0]-U[0])*X+(X=G[1]-U[1])*X,B=(B=Y[0]-V[0])*B+(B=Y[1]-V[1])*B;A=v(A,Math.sqrt(X/B)),F=[(U[0]+G[0])/2,(U[1]+G[1])/2],O=[(V[0]+Y[0])/2,(V[1]+Y[1])/2]}else if(k.touch0)F=k.touch0[0],O=k.touch0[1];else return;k.zoom("touch",n(y(A,F,O),k.extent,i))}}function D(E,...L){if(this.__zooming){var k=C(this,L).event(E),z=E.changedTouches,_=z.length,M,A;for(bu(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),M=0;M<_;++M)A=z[M],k.touch0&&k.touch0[2]===A.identifier?delete k.touch0:k.touch1&&k.touch1[2]===A.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(A=Mt(A,this),Math.hypot(d[0]-A[0],d[1]-A[1])<N)){var F=dt(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return p.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:Li(+E),p):r},p.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Li(!!E),p):e},p.touchable=function(E){return arguments.length?(s=typeof E=="function"?E:Li(!!E),p):s},p.extent=function(E){return arguments.length?(t=typeof E=="function"?E:Li([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),p):t},p.scaleExtent=function(E){return arguments.length?(o[0]=+E[0],o[1]=+E[1],p):[o[0],o[1]]},p.translateExtent=function(E){return arguments.length?(i[0][0]=+E[0][0],i[1][0]=+E[1][0],i[0][1]=+E[0][1],i[1][1]=+E[1][1],p):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},p.constrain=function(E){return arguments.length?(n=E,p):n},p.duration=function(E){return arguments.length?(l=+E,p):l},p.interpolate=function(E){return arguments.length?(u=E,p):u},p.on=function(){var E=c.on.apply(c,arguments);return E===c?p:E},p.clickDistance=function(E){return arguments.length?(w=(E=+E)*E,p):Math.sqrt(w)},p.tapDistance=function(E){return arguments.length?(N=+E,p):N},p}const en={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},$o=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],x0=["Enter"," ","Escape"],y0={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ys;(function(e){e.Strict="strict",e.Loose="loose"})(ys||(ys={}));var pr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(pr||(pr={}));var Oo;(function(e){e.Partial="partial",e.Full="full"})(Oo||(Oo={}));const v0={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Rn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Rn||(Rn={}));var Ua;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ua||(Ua={}));var Q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Q||(Q={}));const Rm={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top};function w0(e){return e===null?null:e?"valid":"invalid"}const N0=e=>"id"in e&&"source"in e&&"target"in e,A3=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),pf=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ei=(e,t=[0,0])=>{const{width:n,height:r}=wn(e),s=e.origin??t,o=n*s[0],i=r*s[1];return{x:e.position.x-o,y:e.position.y-i}},z3=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const o=typeof s=="string";let i=!t.nodeLookup&&!o?s:void 0;t.nodeLookup&&(i=o?t.nodeLookup.get(s):pf(s)?s:t.nodeLookup.get(s.id));const l=i?Wa(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return kl(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Cl(n)},ti=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=kl(n,Wa(s)),r=!0)}),r?Cl(n):{x:0,y:0,width:0,height:0}},gf=(e,t,[n,r,s]=[0,0,1],o=!1,i=!1)=>{const l={...ri(t,[n,r,s]),width:t.width/s,height:t.height/s},u=[];for(const c of e.values()){const{measured:h,selectable:d=!0,hidden:f=!1}=c;if(i&&!d||f)continue;const g=h.width??c.width??c.initialWidth??null,x=h.height??c.height??c.initialHeight??null,w=Fo(l,ws(c)),N=(g??0)*(x??0),p=o&&w>0;(!c.internals.handleBounds||p||w>=N||c.dragging)&&u.push(c)}return u},D3=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function $3(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function O3({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},i){if(e.size===0)return Promise.resolve(!0);const l=$3(e,i),u=ti(l),c=xf(u,t,n,(i==null?void 0:i.minZoom)??s,(i==null?void 0:i.maxZoom)??o,(i==null?void 0:i.padding)??.1);return await r.setViewport(c,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)}function S0({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:o}){const i=n.get(e),l=i.parentId?n.get(i.parentId):void 0,{x:u,y:c}=l?l.internals.positionAbsolute:{x:0,y:0},h=i.origin??r;let d=i.extent||s;if(i.extent==="parent"&&!i.expandParent)if(!l)o==null||o("005",en.error005());else{const g=l.measured.width,x=l.measured.height;g&&x&&(d=[[u,c],[u+g,c+x]])}else l&&Ns(i.extent)&&(d=[[i.extent[0][0]+u,i.extent[0][1]+c],[i.extent[1][0]+u,i.extent[1][1]+c]]);const f=Ns(d)?kr(t,d,i.measured):t;return(i.measured.width===void 0||i.measured.height===void 0)&&(o==null||o("015",en.error015())),{position:{x:f.x-u+(i.measured.width??0)*h[0],y:f.y-c+(i.measured.height??0)*h[1]},positionAbsolute:f}}async function F3({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const o=new Set(e.map(f=>f.id)),i=[];for(const f of n){if(f.deletable===!1)continue;const g=o.has(f.id),x=!g&&f.parentId&&i.find(w=>w.id===f.parentId);(g||x)&&i.push(f)}const l=new Set(t.map(f=>f.id)),u=r.filter(f=>f.deletable!==!1),h=D3(i,u);for(const f of u)l.has(f.id)&&!h.find(x=>x.id===f.id)&&h.push(f);if(!s)return{edges:h,nodes:i};const d=await s({nodes:i,edges:h});return typeof d=="boolean"?d?{edges:h,nodes:i}:{edges:[],nodes:[]}:d}const vs=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),kr=(e={x:0,y:0},t,n)=>({x:vs(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:vs(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function b0(e,t,n){const{width:r,height:s}=wn(n),{x:o,y:i}=n.internals.positionAbsolute;return kr(e,[[o,i],[o+r,i+s]],t)}const Tm=(e,t,n)=>e<t?vs(Math.abs(e-t),1,t)/t:e>n?-vs(Math.abs(e-n),1,t)/t:0,j0=(e,t,n=15,r=40)=>{const s=Tm(e.x,r,t.width-r)*n,o=Tm(e.y,r,t.height-r)*n;return[s,o]},kl=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Fc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Cl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),ws=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=pf(e)?e.internals.positionAbsolute:ei(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Wa=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=pf(e)?e.internals.positionAbsolute:ei(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},k0=(e,t)=>Cl(kl(Fc(e),Fc(t))),Fo=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Lm=e=>Tt(e.width)&&Tt(e.height)&&Tt(e.x)&&Tt(e.y),Tt=e=>!isNaN(e)&&isFinite(e),H3=(e,t)=>{},ni=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ri=({x:e,y:t},[n,r,s],o=!1,i=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return o?ni(l,i):l},Ka=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function Dr(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function B3(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Dr(e,n),s=Dr(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Dr(e.top??e.y??0,n),s=Dr(e.bottom??e.y??0,n),o=Dr(e.left??e.x??0,t),i=Dr(e.right??e.x??0,t);return{top:r,right:i,bottom:s,left:o,x:o+i,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function V3(e,t,n,r,s,o){const{x:i,y:l}=Ka(e,[t,n,r]),{x:u,y:c}=Ka({x:e.x+e.width,y:e.y+e.height},[t,n,r]),h=s-u,d=o-c;return{left:Math.floor(i),top:Math.floor(l),right:Math.floor(h),bottom:Math.floor(d)}}const xf=(e,t,n,r,s,o)=>{const i=B3(o,t,n),l=(t-i.x)/e.width,u=(n-i.y)/e.height,c=Math.min(l,u),h=vs(c,r,s),d=e.x+e.width/2,f=e.y+e.height/2,g=t/2-d*h,x=n/2-f*h,w=V3(e,g,x,h,t,n),N={left:Math.min(w.left-i.left,0),top:Math.min(w.top-i.top,0),right:Math.min(w.right-i.right,0),bottom:Math.min(w.bottom-i.bottom,0)};return{x:g-N.left+N.right,y:x-N.top+N.bottom,zoom:h}},Ho=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ns(e){return e!=null&&e!=="parent"}function wn(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function C0(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function E0(e,t={width:0,height:0},n,r,s){const o={...e},i=r.get(n);if(i){const l=i.origin||s;o.x+=i.internals.positionAbsolute.x-(t.width??0)*l[0],o.y+=i.internals.positionAbsolute.y-(t.height??0)*l[1]}return o}function Am(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function U3(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function W3(e){return{...y0,...e||{}}}function mo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:i}=Lt(e),l=ri({x:o-((s==null?void 0:s.left)??0),y:i-((s==null?void 0:s.top)??0)},r),{x:u,y:c}=n?ni(l,t):l;return{xSnapped:u,ySnapped:c,...l}}const yf=e=>({width:e.offsetWidth,height:e.offsetHeight}),_0=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},K3=["INPUT","SELECT","TEXTAREA"];function P0(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:K3.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const M0=e=>"clientX"in e,Lt=(e,t)=>{var o,i;const n=M0(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,s=n?e.clientY:(i=e.touches)==null?void 0:i[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},zm=(e,t,n,r,s)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(i=>{const l=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:e,nodeId:s,position:i.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...yf(i)}})};function I0({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:i,targetControlY:l}){const u=e*.125+s*.375+i*.375+n*.125,c=t*.125+o*.375+l*.375+r*.125,h=Math.abs(u-e),d=Math.abs(c-t);return[u,c,h,d]}function Ai(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Dm({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case Q.Left:return[t-Ai(t-r,o),n];case Q.Right:return[t+Ai(r-t,o),n];case Q.Top:return[t,n-Ai(n-s,o)];case Q.Bottom:return[t,n+Ai(s-n,o)]}}function R0({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:s,targetPosition:o=Q.Top,curvature:i=.25}){const[l,u]=Dm({pos:n,x1:e,y1:t,x2:r,y2:s,c:i}),[c,h]=Dm({pos:o,x1:r,y1:s,x2:e,y2:t,c:i}),[d,f,g,x]=I0({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:h});return[`M${e},${t} C${l},${u} ${c},${h} ${r},${s}`,d,f,g,x]}function T0({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,o=n<e?n+s:n-s,i=Math.abs(r-t)/2,l=r<t?r+i:r-i;return[o,l,s,i]}function G3({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:s=!1,zIndexMode:o="basic"}){if(o==="manual")return r;const i=s&&n?r+1e3:r,l=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return i+l}function Y3({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=kl(Wa(e),Wa(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const i={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:r/s[2]};return Fo(i,Cl(o))>0}const X3=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Q3=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),q3=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||X3;let s;return N0(e)?s={...e}:s={...e,id:r(e)},Q3(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function L0({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,i,l]=T0({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,i,l]}const $m={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}},Z3=({source:e,sourcePosition:t=Q.Bottom,target:n})=>t===Q.Left||t===Q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Om=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function J3({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:r=Q.Top,center:s,offset:o,stepPosition:i}){const l=$m[t],u=$m[r],c={x:e.x+l.x*o,y:e.y+l.y*o},h={x:n.x+u.x*o,y:n.y+u.y*o},d=Z3({source:c,sourcePosition:t,target:h}),f=d.x!==0?"x":"y",g=d[f];let x=[],w,N;const p={x:0,y:0},v={x:0,y:0},[,,y,S]=T0({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*u[f]===-1){f==="x"?(w=s.x??c.x+(h.x-c.x)*i,N=s.y??(c.y+h.y)/2):(w=s.x??(c.x+h.x)/2,N=s.y??c.y+(h.y-c.y)*i);const C=[{x:w,y:c.y},{x:w,y:h.y}],j=[{x:c.x,y:N},{x:h.x,y:N}];l[f]===g?x=f==="x"?C:j:x=f==="x"?j:C}else{const C=[{x:c.x,y:h.y}],j=[{x:h.x,y:c.y}];if(f==="x"?x=l.x===g?j:C:x=l.y===g?C:j,t===r){const T=Math.abs(e[f]-n[f]);if(T<=o){const D=Math.min(o-1,o-T);l[f]===g?p[f]=(c[f]>e[f]?-1:1)*D:v[f]=(h[f]>n[f]?-1:1)*D}}if(t!==r){const T=f==="x"?"y":"x",D=l[f]===u[T],E=c[T]>h[T],L=c[T]<h[T];(l[f]===1&&(!D&&E||D&&L)||l[f]!==1&&(!D&&L||D&&E))&&(x=f==="x"?C:j)}const P={x:c.x+p.x,y:c.y+p.y},I={x:h.x+v.x,y:h.y+v.y},$=Math.max(Math.abs(P.x-x[0].x),Math.abs(I.x-x[0].x)),R=Math.max(Math.abs(P.y-x[0].y),Math.abs(I.y-x[0].y));$>=R?(w=(P.x+I.x)/2,N=x[0].y):(w=x[0].x,N=(P.y+I.y)/2)}return[[e,{x:c.x+p.x,y:c.y+p.y},...x,{x:h.x+v.x,y:h.y+v.y},n],w,N,y,S]}function e4(e,t,n,r){const s=Math.min(Om(e,t)/2,Om(t,n)/2,r),{x:o,y:i}=t;if(e.x===o&&o===n.x||e.y===i&&i===n.y)return`L${o} ${i}`;if(e.y===i){const c=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${o+s*c},${i}Q ${o},${i} ${o},${i+s*h}`}const l=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${o},${i+s*u}Q ${o},${i} ${o+s*l},${i}`}function Hc({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:s,targetPosition:o=Q.Top,borderRadius:i=5,centerX:l,centerY:u,offset:c=20,stepPosition:h=.5}){const[d,f,g,x,w]=J3({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:l,y:u},offset:c,stepPosition:h});return[d.reduce((p,v,y)=>{let S="";return y>0&&y<d.length-1?S=e4(d[y-1],v,d[y+1],i):S=`${y===0?"M":"L"}${v.x} ${v.y}`,p+=S,p},""),f,g,x,w]}function Fm(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function t4(e){var d;const{sourceNode:t,targetNode:n}=e;if(!Fm(t)||!Fm(n))return null;const r=t.internals.handleBounds||Hm(t.handles),s=n.internals.handleBounds||Hm(n.handles),o=Bm((r==null?void 0:r.source)??[],e.sourceHandle),i=Bm(e.connectionMode===ys.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!o||!i)return(d=e.onError)==null||d.call(e,"008",en.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(o==null?void 0:o.position)||Q.Bottom,u=(i==null?void 0:i.position)||Q.Top,c=Cr(t,o,l),h=Cr(n,i,u);return{sourceX:c.x,sourceY:c.y,targetX:h.x,targetY:h.y,sourcePosition:l,targetPosition:u}}function Hm(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Cr(e,t,n=Q.Left,r=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:i,height:l}=t??wn(e);if(r)return{x:s+i/2,y:o+l/2};switch((t==null?void 0:t.position)??n){case Q.Top:return{x:s+i/2,y:o};case Q.Right:return{x:s+i,y:o+l/2};case Q.Bottom:return{x:s+i/2,y:o+l};case Q.Left:return{x:s,y:o+l/2}}}function Bm(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Bc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function n4(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const o=new Set;return e.reduce((i,l)=>([l.markerStart||r,l.markerEnd||s].forEach(u=>{if(u&&typeof u=="object"){const c=Bc(u,t);o.has(c)||(i.push({id:c,color:u.color||n,...u}),o.add(c))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))}const A0=1e3,r4=10,vf={nodeOrigin:[0,0],nodeExtent:$o,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},s4={...vf,checkEquality:!0};function wf(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function o4(e,t,n){const r=wf(vf,n);for(const s of e.values())if(s.parentId)Sf(s,e,t,r);else{const o=ei(s,r.nodeOrigin),i=Ns(s.extent)?s.extent:r.nodeExtent,l=kr(o,i,wn(s));s.internals.positionAbsolute=l}}function i4(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const s of e.handles){const o={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(o):s.type==="target"&&r.push(o)}return{source:n,target:r}}function Nf(e){return e==="manual"}function Vc(e,t,n,r={}){var c,h;const s=wf(s4,r),o={i:0},i=new Map(t),l=s!=null&&s.elevateNodesOnSelect&&!Nf(s.zIndexMode)?A0:0;let u=e.length>0;t.clear(),n.clear();for(const d of e){let f=i.get(d.id);if(s.checkEquality&&d===(f==null?void 0:f.internals.userNode))t.set(d.id,f);else{const g=ei(d,s.nodeOrigin),x=Ns(d.extent)?d.extent:s.nodeExtent,w=kr(g,x,wn(d));f={...s.defaults,...d,measured:{width:(c=d.measured)==null?void 0:c.width,height:(h=d.measured)==null?void 0:h.height},internals:{positionAbsolute:w,handleBounds:i4(d,f),z:z0(d,l,s.zIndexMode),userNode:d}},t.set(d.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(u=!1),d.parentId&&Sf(f,t,n,r,o)}return u}function a4(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Sf(e,t,n,r,s){const{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:l,zIndexMode:u}=wf(vf,r),c=e.parentId,h=t.get(c);if(!h){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}a4(e,n),s&&!h.parentId&&h.internals.rootParentIndex===void 0&&u==="auto"&&(h.internals.rootParentIndex=++s.i,h.internals.z=h.internals.z+s.i*r4),s&&h.internals.rootParentIndex!==void 0&&(s.i=h.internals.rootParentIndex);const d=o&&!Nf(u)?A0:0,{x:f,y:g,z:x}=l4(e,h,i,l,d,u),{positionAbsolute:w}=e.internals,N=f!==w.x||g!==w.y;(N||x!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x:f,y:g}:w,z:x}})}function z0(e,t,n){const r=Tt(e.zIndex)?e.zIndex:0;return Nf(n)?r:r+(e.selected?t:0)}function l4(e,t,n,r,s,o){const{x:i,y:l}=t.internals.positionAbsolute,u=wn(e),c=ei(e,n),h=Ns(e.extent)?kr(c,e.extent,u):c;let d=kr({x:i+h.x,y:l+h.y},r,u);e.extent==="parent"&&(d=b0(d,u,t));const f=z0(e,s,o),g=t.internals.z??0;return{x:d.x,y:d.y,z:g>=f?g+1:f}}function bf(e,t,n,r=[0,0]){var i;const s=[],o=new Map;for(const l of e){const u=t.get(l.parentId);if(!u)continue;const c=((i=o.get(l.parentId))==null?void 0:i.expandedRect)??ws(u),h=k0(c,l.rect);o.set(l.parentId,{expandedRect:h,parent:u})}return o.size>0&&o.forEach(({expandedRect:l,parent:u},c)=>{var y;const h=u.internals.positionAbsolute,d=wn(u),f=u.origin??r,g=l.x<h.x?Math.round(Math.abs(h.x-l.x)):0,x=l.y<h.y?Math.round(Math.abs(h.y-l.y)):0,w=Math.max(d.width,Math.round(l.width)),N=Math.max(d.height,Math.round(l.height)),p=(w-d.width)*f[0],v=(N-d.height)*f[1];(g>0||x>0||p||v)&&(s.push({id:c,type:"position",position:{x:u.position.x-g+p,y:u.position.y-x+v}}),(y=n.get(c))==null||y.forEach(S=>{e.some(b=>b.id===S.id)||s.push({id:S.id,type:"position",position:{x:S.position.x+g,y:S.position.y+x}})})),(d.width<l.width||d.height<l.height||g||x)&&s.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:w+(g?f[0]*g-p:0),height:N+(x?f[1]*x-v:0)}})}),s}function u4(e,t,n,r,s,o,i){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!l)return{changes:[],updatedInternals:u};const c=[],h=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(h.transform),f=[];for(const g of e.values()){const x=t.get(g.id);if(!x)continue;if(x.hidden){t.set(x.id,{...x,internals:{...x.internals,handleBounds:void 0}}),u=!0;continue}const w=yf(g.nodeElement),N=x.measured.width!==w.width||x.measured.height!==w.height;if(!!(w.width&&w.height&&(N||!x.internals.handleBounds||g.force))){const v=g.nodeElement.getBoundingClientRect(),y=Ns(x.extent)?x.extent:o;let{positionAbsolute:S}=x.internals;x.parentId&&x.extent==="parent"?S=b0(S,w,t.get(x.parentId)):y&&(S=kr(S,y,w));const b={...x,measured:w,internals:{...x.internals,positionAbsolute:S,handleBounds:{source:zm("source",g.nodeElement,v,d,x.id),target:zm("target",g.nodeElement,v,d,x.id)}}};t.set(x.id,b),x.parentId&&Sf(b,t,n,{nodeOrigin:s,zIndexMode:i}),u=!0,N&&(c.push({id:x.id,type:"dimensions",dimensions:w}),x.expandParent&&x.parentId&&f.push({id:x.id,parentId:x.parentId,rect:ws(b,s)}))}}if(f.length>0){const g=bf(f,t,n,s);c.push(...g)}return{changes:c,updatedInternals:u}}async function c4({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const i=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,o]],r),l=!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2]);return Promise.resolve(l)}function Vm(e,t,n,r,s,o){let i=s;const l=r.get(i)||new Map;r.set(i,l.set(n,t)),i=`${s}-${e}`;const u=r.get(i)||new Map;if(r.set(i,u.set(n,t)),o){i=`${s}-${e}-${o}`;const c=r.get(i)||new Map;r.set(i,c.set(n,t))}}function D0(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:o,sourceHandle:i=null,targetHandle:l=null}=r,u={edgeId:r.id,source:s,target:o,sourceHandle:i,targetHandle:l},c=`${s}-${i}--${o}-${l}`,h=`${o}-${l}--${s}-${i}`;Vm("source",u,h,e,s,i),Vm("target",u,c,e,o,l),t.set(r.id,r)}}function $0(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:$0(n,t):!1}function Um(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function d4(e,t,n,r){const s=new Map;for(const[o,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!$0(i,e))&&(i.draggable||t&&typeof i.draggable>"u")){const l=e.get(o);l&&s.set(o,{id:o,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return s}function ju({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var i,l,u;const s=[];for(const[c,h]of t){const d=(i=n.get(c))==null?void 0:i.internals.userNode;d&&s.push({...d,position:h.position,dragging:r})}if(!e)return[s[0],s];const o=(l=n.get(e))==null?void 0:l.internals.userNode;return[o?{...o,position:((u=t.get(e))==null?void 0:u.position)||o.position,dragging:r}:s[0],s]}function f4({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const o={x:n-s.distance.x,y:r-s.distance.y},i=ni(o,t);return{x:i.x-o.x,y:i.y-o.y}}function h4({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let o={x:null,y:null},i=0,l=new Map,u=!1,c={x:0,y:0},h=null,d=!1,f=null,g=!1,x=!1,w=null;function N({noDragClassName:v,handleSelector:y,domNode:S,isSelectable:b,nodeId:C,nodeClickDistance:j=0}){f=dt(S);function P({x:T,y:D}){const{nodeLookup:E,nodeExtent:L,snapGrid:k,snapToGrid:z,nodeOrigin:_,onNodeDrag:M,onSelectionDrag:A,onError:F,updateNodePositions:O}=t();o={x:T,y:D};let U=!1;const V=l.size>1,G=V&&L?Fc(ti(l)):null,Y=V&&z?f4({dragItems:l,snapGrid:k,x:T,y:D}):null;for(const[X,B]of l){if(!E.has(X))continue;let q={x:T-B.distance.x,y:D-B.distance.y};z&&(q=Y?{x:Math.round(q.x+Y.x),y:Math.round(q.y+Y.y)}:ni(q,k));let se=null;if(V&&L&&!B.extent&&G){const{positionAbsolute:J}=B.internals,ue=J.x-G.x+L[0][0],me=J.x+B.measured.width-G.x2+L[1][0],le=J.y-G.y+L[0][1],Ue=J.y+B.measured.height-G.y2+L[1][1];se=[[ue,le],[me,Ue]]}const{position:te,positionAbsolute:ee}=S0({nodeId:X,nextPosition:q,nodeLookup:E,nodeExtent:se||L,nodeOrigin:_,onError:F});U=U||B.position.x!==te.x||B.position.y!==te.y,B.position=te,B.internals.positionAbsolute=ee}if(x=x||U,!!U&&(O(l,!0),w&&(r||M||!C&&A))){const[X,B]=ju({nodeId:C,dragItems:l,nodeLookup:E});r==null||r(w,l,X,B),M==null||M(w,X,B),C||A==null||A(w,B)}}async function I(){if(!h)return;const{transform:T,panBy:D,autoPanSpeed:E,autoPanOnNodeDrag:L}=t();if(!L){u=!1,cancelAnimationFrame(i);return}const[k,z]=j0(c,h,E);(k!==0||z!==0)&&(o.x=(o.x??0)-k/T[2],o.y=(o.y??0)-z/T[2],await D({x:k,y:z})&&P(o)),i=requestAnimationFrame(I)}function $(T){var V;const{nodeLookup:D,multiSelectionActive:E,nodesDraggable:L,transform:k,snapGrid:z,snapToGrid:_,selectNodesOnDrag:M,onNodeDragStart:A,onSelectionDragStart:F,unselectNodesAndEdges:O}=t();d=!0,(!M||!b)&&!E&&C&&((V=D.get(C))!=null&&V.selected||O()),b&&M&&C&&(e==null||e(C));const U=mo(T.sourceEvent,{transform:k,snapGrid:z,snapToGrid:_,containerBounds:h});if(o=U,l=d4(D,L,U,C),l.size>0&&(n||A||!C&&F)){const[G,Y]=ju({nodeId:C,dragItems:l,nodeLookup:D});n==null||n(T.sourceEvent,l,G,Y),A==null||A(T.sourceEvent,G,Y),C||F==null||F(T.sourceEvent,Y)}}const R=t0().clickDistance(j).on("start",T=>{const{domNode:D,nodeDragThreshold:E,transform:L,snapGrid:k,snapToGrid:z}=t();h=(D==null?void 0:D.getBoundingClientRect())||null,g=!1,x=!1,w=T.sourceEvent,E===0&&$(T),o=mo(T.sourceEvent,{transform:L,snapGrid:k,snapToGrid:z,containerBounds:h}),c=Lt(T.sourceEvent,h)}).on("drag",T=>{const{autoPanOnNodeDrag:D,transform:E,snapGrid:L,snapToGrid:k,nodeDragThreshold:z,nodeLookup:_}=t(),M=mo(T.sourceEvent,{transform:E,snapGrid:L,snapToGrid:k,containerBounds:h});if(w=T.sourceEvent,(T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1||C&&!_.has(C))&&(g=!0),!g){if(!u&&D&&d&&(u=!0,I()),!d){const A=Lt(T.sourceEvent,h),F=A.x-c.x,O=A.y-c.y;Math.sqrt(F*F+O*O)>z&&$(T)}(o.x!==M.xSnapped||o.y!==M.ySnapped)&&l&&d&&(c=Lt(T.sourceEvent,h),P(M))}}).on("end",T=>{if(!(!d||g)&&(u=!1,d=!1,cancelAnimationFrame(i),l.size>0)){const{nodeLookup:D,updateNodePositions:E,onNodeDragStop:L,onSelectionDragStop:k}=t();if(x&&(E(l,!1),x=!1),s||L||!C&&k){const[z,_]=ju({nodeId:C,dragItems:l,nodeLookup:D,dragging:!1});s==null||s(T.sourceEvent,l,z,_),L==null||L(T.sourceEvent,z,_),C||k==null||k(T.sourceEvent,_)}}}).filter(T=>{const D=T.target;return!T.button&&(!v||!Um(D,`.${v}`,S))&&(!y||Um(D,y,S))});f.call(R)}function p(){f==null||f.on(".drag",null)}return{update:N,destroy:p}}function m4(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())Fo(s,ws(o))>0&&r.push(o);return r}const p4=250;function g4(e,t,n,r){var l,u;let s=[],o=1/0;const i=m4(e,n,t+p4);for(const c of i){const h=[...((l=c.internals.handleBounds)==null?void 0:l.source)??[],...((u=c.internals.handleBounds)==null?void 0:u.target)??[]];for(const d of h){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:g}=Cr(c,d,d.position,!0),x=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(g-e.y,2));x>t||(x<o?(s=[{...d,x:f,y:g}],o=x):x===o&&s.push({...d,x:f,y:g}))}}if(!s.length)return null;if(s.length>1){const c=r.type==="source"?"target":"source";return s.find(h=>h.type===c)??s[0]}return s[0]}function O0(e,t,n,r,s,o=!1){var c,h,d;const i=r.get(e);if(!i)return null;const l=s==="strict"?(c=i.internals.handleBounds)==null?void 0:c[t]:[...((h=i.internals.handleBounds)==null?void 0:h.source)??[],...((d=i.internals.handleBounds)==null?void 0:d.target)??[]],u=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return u&&o?{...u,...Cr(i,u,u.position,!0)}:u}function F0(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function x4(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const H0=()=>!0;function y4(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:i,domNode:l,nodeLookup:u,lib:c,autoPanOnConnect:h,flowId:d,panBy:f,cancelConnection:g,onConnectStart:x,onConnect:w,onConnectEnd:N,isValidConnection:p=H0,onReconnectEnd:v,updateConnection:y,getTransform:S,getFromHandle:b,autoPanSpeed:C,dragThreshold:j=1,handleDomNode:P}){const I=_0(e.target);let $=0,R;const{x:T,y:D}=Lt(e),E=F0(o,P),L=l==null?void 0:l.getBoundingClientRect();let k=!1;if(!L||!E)return;const z=O0(s,E,r,u,t);if(!z)return;let _=Lt(e,L),M=!1,A=null,F=!1,O=null;function U(){if(!h||!L)return;const[te,ee]=j0(_,L,C);f({x:te,y:ee}),$=requestAnimationFrame(U)}const V={...z,nodeId:s,type:E,position:z.position},G=u.get(s);let X={inProgress:!0,isValid:null,from:Cr(G,V,Q.Left,!0),fromHandle:V,fromPosition:V.position,fromNode:G,to:_,toHandle:null,toPosition:Rm[V.position],toNode:null,pointer:_};function B(){k=!0,y(X),x==null||x(e,{nodeId:s,handleId:r,handleType:E})}j===0&&B();function q(te){if(!k){const{x:Ue,y:Nn}=Lt(te),rn=Ue-T,rr=Nn-D;if(!(rn*rn+rr*rr>j*j))return;B()}if(!b()||!V){se(te);return}const ee=S();_=Lt(te,L),R=g4(ri(_,ee,!1,[1,1]),n,u,V),M||(U(),M=!0);const J=B0(te,{handle:R,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:i?"target":"source",isValidConnection:p,doc:I,lib:c,flowId:d,nodeLookup:u});O=J.handleDomNode,A=J.connection,F=x4(!!R,J.isValid);const ue=u.get(s),me=ue?Cr(ue,V,Q.Left,!0):X.from,le={...X,from:me,isValid:F,to:J.toHandle&&F?Ka({x:J.toHandle.x,y:J.toHandle.y},ee):_,toHandle:J.toHandle,toPosition:F&&J.toHandle?J.toHandle.position:Rm[V.position],toNode:J.toHandle?u.get(J.toHandle.nodeId):null,pointer:_};y(le),X=le}function se(te){if(!("touches"in te&&te.touches.length>0)){if(k){(R||O)&&A&&F&&(w==null||w(A));const{inProgress:ee,...J}=X,ue={...J,toPosition:X.toHandle?X.toPosition:null};N==null||N(te,ue),o&&(v==null||v(te,ue))}g(),cancelAnimationFrame($),M=!1,F=!1,A=null,O=null,I.removeEventListener("mousemove",q),I.removeEventListener("mouseup",se),I.removeEventListener("touchmove",q),I.removeEventListener("touchend",se)}}I.addEventListener("mousemove",q),I.addEventListener("mouseup",se),I.addEventListener("touchmove",q),I.addEventListener("touchend",se)}function B0(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:i,lib:l,flowId:u,isValidConnection:c=H0,nodeLookup:h}){const d=o==="target",f=t?i.querySelector(`.${l}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:g,y:x}=Lt(e),w=i.elementFromPoint(g,x),N=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:f,p={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const v=F0(void 0,N),y=N.getAttribute("data-nodeid"),S=N.getAttribute("data-handleid"),b=N.classList.contains("connectable"),C=N.classList.contains("connectableend");if(!y||!v)return p;const j={source:d?y:r,sourceHandle:d?S:s,target:d?r:y,targetHandle:d?s:S};p.connection=j;const I=b&&C&&(n===ys.Strict?d&&v==="source"||!d&&v==="target":y!==r||S!==s);p.isValid=I&&c(j),p.toHandle=O0(y,v,S,h,n,!0)}return p}const Uc={onPointerDown:y4,isValid:B0};function v4({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=dt(e);function o({translateExtent:l,width:u,height:c,zoomStep:h=1,pannable:d=!0,zoomable:f=!0,inversePan:g=!1}){const x=y=>{if(y.sourceEvent.type!=="wheel"||!t)return;const S=n(),b=y.sourceEvent.ctrlKey&&Ho()?10:1,C=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*h,j=S[2]*Math.pow(2,C*b);t.scaleTo(j)};let w=[0,0];const N=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(w=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},p=y=>{const S=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const b=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],C=[b[0]-w[0],b[1]-w[1]];w=b;const j=r()*Math.max(S[2],Math.log(S[2]))*(g?-1:1),P={x:S[0]-C[0]*j,y:S[1]-C[1]*j},I=[[0,0],[u,c]];t.setViewportConstrained({x:P.x,y:P.y,zoom:S[2]},I,l)},v=g0().on("start",N).on("zoom",d?p:null).on("zoom.wheel",f?x:null);s.call(v,{})}function i(){s.on("zoom",null)}return{update:o,destroy:i,pointer:Mt}}const El=e=>({x:e.x,y:e.y,zoom:e.k}),ku=({x:e,y:t,zoom:n})=>jl.translate(e,t).scale(n),Qr=(e,t)=>e.target.closest(`.${t}`),V0=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),w4=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Cu=(e,t=0,n=w4,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},U0=e=>{const t=e.ctrlKey&&Ho()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function N4({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:c}){return h=>{if(Qr(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(h.ctrlKey&&i){const N=Mt(h),p=U0(h),v=d*Math.pow(2,p);r.scaleTo(n,v,N,h);return}const f=h.deltaMode===1?20:1;let g=s===pr.Vertical?0:h.deltaX*f,x=s===pr.Horizontal?0:h.deltaY*f;!Ho()&&h.shiftKey&&s!==pr.Vertical&&(g=h.deltaY*f,x=0),r.translateBy(n,-(g/d)*o,-(x/d)*o,{internal:!0});const w=El(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(h,w),e.panScrollTimeout=setTimeout(()=>{c==null||c(h,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(h,w))}}function S4({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const o=r.type==="wheel",i=!t&&o&&!r.ctrlKey,l=Qr(r,e);if(r.ctrlKey&&o&&l&&r.preventDefault(),i||l)return null;r.preventDefault(),n.call(this,r,s)}}function b4({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,i,l;if((o=r.sourceEvent)!=null&&o.internal)return;const s=El(r.transform);e.mouseButton=((i=r.sourceEvent)==null?void 0:i.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function j4({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var i,l;e.usedRightMouseButton=!!(n&&V0(t,e.mouseButton??0)),(i=o.sourceEvent)!=null&&i.sync||r([o.transform.x,o.transform.y,o.transform.k]),s&&!((l=o.sourceEvent)!=null&&l.internal)&&(s==null||s(o.sourceEvent,El(o.transform)))}}function k4({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:o}){return i=>{var l;if(!((l=i.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,o&&V0(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&o(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const u=El(i.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(i.sourceEvent,u)},n?150:0)}}}function C4({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:i,noWheelClassName:l,noPanClassName:u,lib:c,connectionInProgress:h}){return d=>{var N;const f=e||t,g=n&&d.ctrlKey,x=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Qr(d,`${c}-flow__node`)||Qr(d,`${c}-flow__edge`)))return!0;if(!r&&!f&&!s&&!o&&!n||i||h&&!x||Qr(d,l)&&x||Qr(d,u)&&(!x||s&&x&&!e)||!n&&d.ctrlKey&&x)return!1;if(!n&&d.type==="touchstart"&&((N=d.touches)==null?void 0:N.length)>1)return d.preventDefault(),!1;if(!f&&!s&&!g&&x||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||x)&&w}}function E4({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:o,onPanZoomStart:i,onPanZoomEnd:l,onDraggingChange:u}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),d=g0().scaleExtent([t,n]).translateExtent(r),f=dt(e).call(d);v({x:s.x,y:s.y,zoom:vs(s.zoom,t,n)},[[0,0],[h.width,h.height]],r);const g=f.on("wheel.zoom"),x=f.on("dblclick.zoom");d.wheelDelta(U0);function w(R,T){return f?new Promise(D=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?ho:sa).transform(Cu(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>D(!0)),R)}):Promise.resolve(!1)}function N({noWheelClassName:R,noPanClassName:T,onPaneContextMenu:D,userSelectionActive:E,panOnScroll:L,panOnDrag:k,panOnScrollMode:z,panOnScrollSpeed:_,preventScrolling:M,zoomOnPinch:A,zoomOnScroll:F,zoomOnDoubleClick:O,zoomActivationKeyPressed:U,lib:V,onTransformChange:G,connectionInProgress:Y,paneClickDistance:X,selectionOnDrag:B}){E&&!c.isZoomingOrPanning&&p();const q=L&&!U&&!E;d.clickDistance(B?1/0:!Tt(X)||X<0?0:X);const se=q?N4({zoomPanValues:c,noWheelClassName:R,d3Selection:f,d3Zoom:d,panOnScrollMode:z,panOnScrollSpeed:_,zoomOnPinch:A,onPanZoomStart:i,onPanZoom:o,onPanZoomEnd:l}):S4({noWheelClassName:R,preventScrolling:M,d3ZoomHandler:g});if(f.on("wheel.zoom",se,{passive:!1}),!E){const ee=b4({zoomPanValues:c,onDraggingChange:u,onPanZoomStart:i});d.on("start",ee);const J=j4({zoomPanValues:c,panOnDrag:k,onPaneContextMenu:!!D,onPanZoom:o,onTransformChange:G});d.on("zoom",J);const ue=k4({zoomPanValues:c,panOnDrag:k,panOnScroll:L,onPaneContextMenu:D,onPanZoomEnd:l,onDraggingChange:u});d.on("end",ue)}const te=C4({zoomActivationKeyPressed:U,panOnDrag:k,zoomOnScroll:F,panOnScroll:L,zoomOnDoubleClick:O,zoomOnPinch:A,userSelectionActive:E,noPanClassName:T,noWheelClassName:R,lib:V,connectionInProgress:Y});d.filter(te),O?f.on("dblclick.zoom",x):f.on("dblclick.zoom",null)}function p(){d.on("zoom",null)}async function v(R,T,D){const E=ku(R),L=d==null?void 0:d.constrain()(E,T,D);return L&&await w(L),new Promise(k=>k(L))}async function y(R,T){const D=ku(R);return await w(D,T),new Promise(E=>E(D))}function S(R){if(f){const T=ku(R),D=f.property("__zoom");(D.k!==R.zoom||D.x!==R.x||D.y!==R.y)&&(d==null||d.transform(f,T,null,{sync:!0}))}}function b(){const R=f?p0(f.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}function C(R,T){return f?new Promise(D=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?ho:sa).scaleTo(Cu(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>D(!0)),R)}):Promise.resolve(!1)}function j(R,T){return f?new Promise(D=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?ho:sa).scaleBy(Cu(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>D(!0)),R)}):Promise.resolve(!1)}function P(R){d==null||d.scaleExtent(R)}function I(R){d==null||d.translateExtent(R)}function $(R){const T=!Tt(R)||R<0?0:R;d==null||d.clickDistance(T)}return{update:N,destroy:p,setViewport:y,setViewportConstrained:v,getViewport:b,scaleTo:C,scaleBy:j,setScaleExtent:P,setTranslateExtent:I,syncViewport:S,setClickDistance:$}}var Ss;(function(e){e.Line="line",e.Handle="handle"})(Ss||(Ss={}));function _4({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:o}){const i=e-t,l=n-r,u=[i>0?1:i<0?-1:0,l>0?1:l<0?-1:0];return i&&s&&(u[0]=u[0]*-1),l&&o&&(u[1]=u[1]*-1),u}function Wm(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function kn(e,t){return Math.max(0,t-e)}function Cn(e,t){return Math.max(0,e-t)}function zi(e,t,n){return Math.max(0,t-e,e-n)}function Km(e,t){return e?!t:t}function P4(e,t,n,r,s,o,i,l){let{affectsX:u,affectsY:c}=t;const{isHorizontal:h,isVertical:d}=t,f=h&&d,{xSnapped:g,ySnapped:x}=n,{minWidth:w,maxWidth:N,minHeight:p,maxHeight:v}=r,{x:y,y:S,width:b,height:C,aspectRatio:j}=e;let P=Math.floor(h?g-e.pointerX:0),I=Math.floor(d?x-e.pointerY:0);const $=b+(u?-P:P),R=C+(c?-I:I),T=-o[0]*b,D=-o[1]*C;let E=zi($,w,N),L=zi(R,p,v);if(i){let _=0,M=0;u&&P<0?_=kn(y+P+T,i[0][0]):!u&&P>0&&(_=Cn(y+$+T,i[1][0])),c&&I<0?M=kn(S+I+D,i[0][1]):!c&&I>0&&(M=Cn(S+R+D,i[1][1])),E=Math.max(E,_),L=Math.max(L,M)}if(l){let _=0,M=0;u&&P>0?_=Cn(y+P,l[0][0]):!u&&P<0&&(_=kn(y+$,l[1][0])),c&&I>0?M=Cn(S+I,l[0][1]):!c&&I<0&&(M=kn(S+R,l[1][1])),E=Math.max(E,_),L=Math.max(L,M)}if(s){if(h){const _=zi($/j,p,v)*j;if(E=Math.max(E,_),i){let M=0;!u&&!c||u&&!c&&f?M=Cn(S+D+$/j,i[1][1])*j:M=kn(S+D+(u?P:-P)/j,i[0][1])*j,E=Math.max(E,M)}if(l){let M=0;!u&&!c||u&&!c&&f?M=kn(S+$/j,l[1][1])*j:M=Cn(S+(u?P:-P)/j,l[0][1])*j,E=Math.max(E,M)}}if(d){const _=zi(R*j,w,N)/j;if(L=Math.max(L,_),i){let M=0;!u&&!c||c&&!u&&f?M=Cn(y+R*j+T,i[1][0])/j:M=kn(y+(c?I:-I)*j+T,i[0][0])/j,L=Math.max(L,M)}if(l){let M=0;!u&&!c||c&&!u&&f?M=kn(y+R*j,l[1][0])/j:M=Cn(y+(c?I:-I)*j,l[0][0])/j,L=Math.max(L,M)}}}I=I+(I<0?L:-L),P=P+(P<0?E:-E),s&&(f?$>R*j?I=(Km(u,c)?-P:P)/j:P=(Km(u,c)?-I:I)*j:h?(I=P/j,c=u):(P=I*j,u=c));const k=u?y+P:y,z=c?S+I:S;return{width:b+(u?-P:P),height:C+(c?-I:I),x:o[0]*P*(u?-1:1)+k,y:o[1]*I*(c?-1:1)+z}}const W0={width:0,height:0,x:0,y:0},M4={...W0,pointerX:0,pointerY:0,aspectRatio:1};function I4(e){return[[0,0],[e.measured.width,e.measured.height]]}function R4(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,o=e.measured.width??0,i=e.measured.height??0,l=n[0]*o,u=n[1]*i;return[[r-l,s-u],[r+o-l,s+i-u]]}function T4({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=dt(e);let i={controlDirection:Wm("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:c,boundaries:h,keepAspectRatio:d,resizeDirection:f,onResizeStart:g,onResize:x,onResizeEnd:w,shouldResize:N}){let p={...W0},v={...M4};i={boundaries:h,resizeDirection:f,keepAspectRatio:d,controlDirection:Wm(c)};let y,S=null,b=[],C,j,P,I=!1;const $=t0().on("start",R=>{const{nodeLookup:T,transform:D,snapGrid:E,snapToGrid:L,nodeOrigin:k,paneDomNode:z}=n();if(y=T.get(t),!y)return;S=(z==null?void 0:z.getBoundingClientRect())??null;const{xSnapped:_,ySnapped:M}=mo(R.sourceEvent,{transform:D,snapGrid:E,snapToGrid:L,containerBounds:S});p={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},v={...p,pointerX:_,pointerY:M,aspectRatio:p.width/p.height},C=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(C=T.get(y.parentId),j=C&&y.extent==="parent"?I4(C):void 0),b=[],P=void 0;for(const[A,F]of T)if(F.parentId===t&&(b.push({id:A,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const O=R4(F,y,F.origin??k);P?P=[[Math.min(O[0][0],P[0][0]),Math.min(O[0][1],P[0][1])],[Math.max(O[1][0],P[1][0]),Math.max(O[1][1],P[1][1])]]:P=O}g==null||g(R,{...p})}).on("drag",R=>{const{transform:T,snapGrid:D,snapToGrid:E,nodeOrigin:L}=n(),k=mo(R.sourceEvent,{transform:T,snapGrid:D,snapToGrid:E,containerBounds:S}),z=[];if(!y)return;const{x:_,y:M,width:A,height:F}=p,O={},U=y.origin??L,{width:V,height:G,x:Y,y:X}=P4(v,i.controlDirection,k,i.boundaries,i.keepAspectRatio,U,j,P),B=V!==A,q=G!==F,se=Y!==_&&B,te=X!==M&&q;if(!se&&!te&&!B&&!q)return;if((se||te||U[0]===1||U[1]===1)&&(O.x=se?Y:p.x,O.y=te?X:p.y,p.x=O.x,p.y=O.y,b.length>0)){const me=Y-_,le=X-M;for(const Ue of b)Ue.position={x:Ue.position.x-me+U[0]*(V-A),y:Ue.position.y-le+U[1]*(G-F)},z.push(Ue)}if((B||q)&&(O.width=B&&(!i.resizeDirection||i.resizeDirection==="horizontal")?V:p.width,O.height=q&&(!i.resizeDirection||i.resizeDirection==="vertical")?G:p.height,p.width=O.width,p.height=O.height),C&&y.expandParent){const me=U[0]*(O.width??0);O.x&&O.x<me&&(p.x=me,v.x=v.x-(O.x-me));const le=U[1]*(O.height??0);O.y&&O.y<le&&(p.y=le,v.y=v.y-(O.y-le))}const ee=_4({width:p.width,prevWidth:A,height:p.height,prevHeight:F,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),J={...p,direction:ee};(N==null?void 0:N(R,J))!==!1&&(I=!0,x==null||x(R,J),r(O,z))}).on("end",R=>{I&&(w==null||w(R,{...p}),s==null||s({...p}),I=!1)});o.call($)}function u(){o.on(".drag",null)}return{update:l,destroy:u}}var K0={exports:{}},G0={},Y0={exports:{}},X0={};/**
371
+ * @license React
372
+ * use-sync-external-store-shim.production.js
373
+ *
374
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
375
+ *
376
+ * This source code is licensed under the MIT license found in the
377
+ * LICENSE file in the root directory of this source tree.
378
+ */var bs=m;function L4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var A4=typeof Object.is=="function"?Object.is:L4,z4=bs.useState,D4=bs.useEffect,$4=bs.useLayoutEffect,O4=bs.useDebugValue;function F4(e,t){var n=t(),r=z4({inst:{value:n,getSnapshot:t}}),s=r[0].inst,o=r[1];return $4(function(){s.value=n,s.getSnapshot=t,Eu(s)&&o({inst:s})},[e,n,t]),D4(function(){return Eu(s)&&o({inst:s}),e(function(){Eu(s)&&o({inst:s})})},[e]),O4(n),n}function Eu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!A4(e,n)}catch{return!0}}function H4(e,t){return t()}var B4=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?H4:F4;X0.useSyncExternalStore=bs.useSyncExternalStore!==void 0?bs.useSyncExternalStore:B4;Y0.exports=X0;var V4=Y0.exports;/**
379
+ * @license React
380
+ * use-sync-external-store-shim/with-selector.production.js
381
+ *
382
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
383
+ *
384
+ * This source code is licensed under the MIT license found in the
385
+ * LICENSE file in the root directory of this source tree.
386
+ */var _l=m,U4=V4;function W4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var K4=typeof Object.is=="function"?Object.is:W4,G4=U4.useSyncExternalStore,Y4=_l.useRef,X4=_l.useEffect,Q4=_l.useMemo,q4=_l.useDebugValue;G0.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var o=Y4(null);if(o.current===null){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=Q4(function(){function u(g){if(!c){if(c=!0,h=g,g=r(g),s!==void 0&&i.hasValue){var x=i.value;if(s(x,g))return d=x}return d=g}if(x=d,K4(h,g))return x;var w=r(g);return s!==void 0&&s(x,w)?(h=g,x):(h=g,d=w)}var c=!1,h,d,f=n===void 0?null:n;return[function(){return u(t())},f===null?void 0:function(){return u(f())}]},[t,n,r,s]);var l=G4(e,o[0],o[1]);return X4(function(){i.hasValue=!0,i.value=l},[l]),q4(l),l};K0.exports=G0;var Z4=K0.exports;const J4=Gc(Z4),e5={},Gm=e=>{let t;const n=new Set,r=(h,d)=>{const f=typeof h=="function"?h(t):h;if(!Object.is(f,t)){const g=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(x=>x(t,g))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>c,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(e5?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,s,u);return u},t5=e=>e?Gm(e):Gm,{useDebugValue:n5}=Ut,{useSyncExternalStoreWithSelector:r5}=J4,s5=e=>e;function Q0(e,t=s5,n){const r=r5(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return n5(r),r}const Ym=(e,t)=>{const n=t5(e),r=(s,o=t)=>Q0(n,s,o);return Object.assign(r,n),r},o5=(e,t)=>e?Ym(e,t):Ym;function Se(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Pl=m.createContext(null),i5=Pl.Provider,q0=en.error001();function ie(e,t){const n=m.useContext(Pl);if(n===null)throw new Error(q0);return Q0(n,e,t)}function be(){const e=m.useContext(Pl);if(e===null)throw new Error(q0);return m.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Xm={display:"none"},a5={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Z0="react-flow__node-desc",J0="react-flow__edge-desc",l5="react-flow__aria-live",u5=e=>e.ariaLiveMessage,c5=e=>e.ariaLabelConfig;function d5({rfId:e}){const t=ie(u5);return a.jsx("div",{id:`${l5}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:a5,children:t})}function f5({rfId:e,disableKeyboardA11y:t}){const n=ie(c5);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${Z0}-${e}`,style:Xm,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${J0}-${e}`,style:Xm,children:n["edge.a11yDescription.default"]}),!t&&a.jsx(d5,{rfId:e})]})}const Ml=m.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const i=`${e}`.split("-");return a.jsx("div",{className:Le(["react-flow__panel",n,...i]),style:r,ref:o,...s,children:t})});Ml.displayName="Panel";function h5({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:a.jsx(Ml,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:a.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const m5=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Di=e=>e.id;function p5(e,t){return Se(e.selectedNodes.map(Di),t.selectedNodes.map(Di))&&Se(e.selectedEdges.map(Di),t.selectedEdges.map(Di))}function g5({onSelectionChange:e}){const t=be(),{selectedNodes:n,selectedEdges:r}=ie(m5,p5);return m.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[n,r,e]),null}const x5=e=>!!e.onSelectionChangeHandlers;function y5({onSelectionChange:e}){const t=ie(x5);return e||t?a.jsx(g5,{onSelectionChange:e}):null}const ev=[0,0],v5={x:0,y:0,zoom:1},w5=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Qm=[...w5,"rfId"],N5=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),qm={translateExtent:$o,nodeOrigin:ev,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function S5(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:u}=ie(N5,Se),c=be();m.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{h.current=qm,l()}),[]);const h=m.useRef(qm);return m.useEffect(()=>{for(const d of Qm){const f=e[d],g=h.current[d];f!==g&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?r(f):d==="maxZoom"?s(f):d==="translateExtent"?o(f):d==="nodeExtent"?i(f):d==="ariaLabelConfig"?c.setState({ariaLabelConfig:W3(f)}):d==="fitView"?c.setState({fitViewQueued:f}):d==="fitViewOptions"?c.setState({fitViewOptions:f}):c.setState({[d]:f})))}h.current=e},Qm.map(d=>e[d])),null}function Zm(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function b5(e){var r;const[t,n]=m.useState(e==="system"?null:e);return m.useEffect(()=>{if(e!=="system"){n(e);return}const s=Zm(),o=()=>n(s!=null&&s.matches?"dark":"light");return o(),s==null||s.addEventListener("change",o),()=>{s==null||s.removeEventListener("change",o)}},[e]),t!==null?t:(r=Zm())!=null&&r.matches?"dark":"light"}const Jm=typeof document<"u"?document:null;function Bo(e=null,t={target:Jm,actInsideInputWithModifier:!0}){const[n,r]=m.useState(!1),s=m.useRef(!1),o=m.useRef(new Set([])),[i,l]=m.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
387
+ `).replace(`
388
+
389
+ `,`
390
+ +`).split(`
391
+ `)),h=c.reduce((d,f)=>d.concat(...f),[]);return[c,h]}return[[],[]]},[e]);return m.useEffect(()=>{const u=(t==null?void 0:t.target)??Jm,c=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=g=>{var N,p;if(s.current=g.ctrlKey||g.metaKey||g.shiftKey||g.altKey,(!s.current||s.current&&!c)&&P0(g))return!1;const w=tp(g.code,l);if(o.current.add(g[w]),ep(i,o.current,!1)){const v=((p=(N=g.composedPath)==null?void 0:N.call(g))==null?void 0:p[0])||g.target,y=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";t.preventDefault!==!1&&(s.current||!y)&&g.preventDefault(),r(!0)}},d=g=>{const x=tp(g.code,l);ep(i,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(g[x]),g.key==="Meta"&&o.current.clear(),s.current=!1},f=()=>{o.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",h),u==null||u.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{u==null||u.removeEventListener("keydown",h),u==null||u.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function ep(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function tp(e,t){return t.includes(e)?"code":"key"}const j5=()=>{const e=be();return m.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,o],panZoom:i}=e.getState();return i?(await i.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??o},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:o,maxZoom:i,panZoom:l}=e.getState(),u=xf(t,r,s,o,i,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:s,snapToGrid:o,domNode:i}=e.getState();if(!i)return t;const{x:l,y:u}=i.getBoundingClientRect(),c={x:t.x-l,y:t.y-u},h=n.snapGrid??s,d=n.snapToGrid??o;return ri(c,r,d,h)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:o}=r.getBoundingClientRect(),i=Ka(t,n);return{x:i.x+s,y:i.y+o}}}),[])};function tv(e,t){const n=[],r=new Map,s=[];for(const o of e)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const i=r.get(o.id);i?i.push(o):r.set(o.id,[o])}for(const o of t){const i=r.get(o.id);if(!i){n.push(o);continue}if(i[0].type==="remove")continue;if(i[0].type==="replace"){n.push({...i[0].item});continue}const l={...o};for(const u of i)k5(u,l);n.push(l)}return s.length&&s.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function k5(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function C5(e,t){return tv(e,t)}function E5(e,t){return tv(e,t)}function ir(e,t){return{id:e,type:"select",selected:t}}function qr(e,t=new Set,n=!1){const r=[];for(const[s,o]of e){const i=t.has(s);!(o.selected===void 0&&!i)&&o.selected!==i&&(n&&(o.selected=i),r.push(ir(o.id,i)))}return r}function np({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,i]of e.entries()){const l=t.get(i.id),u=((s=l==null?void 0:l.internals)==null?void 0:s.userNode)??l;u!==void 0&&u!==i&&n.push({id:i.id,item:i,type:"replace"}),u===void 0&&n.push({item:i,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function rp(e){return{id:e.id,type:"remove"}}const sp=e=>A3(e),_5=e=>N0(e);function nv(e){return m.forwardRef(e)}const P5=typeof window<"u"?m.useLayoutEffect:m.useEffect;function op(e){const[t,n]=m.useState(BigInt(0)),[r]=m.useState(()=>M5(()=>n(s=>s+BigInt(1))));return P5(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function M5(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const rv=m.createContext(null);function I5({children:e}){const t=be(),n=m.useCallback(l=>{const{nodes:u=[],setNodes:c,hasDefaultNodes:h,onNodesChange:d,nodeLookup:f,fitViewQueued:g,onNodesChangeMiddlewareMap:x}=t.getState();let w=u;for(const p of l)w=typeof p=="function"?p(w):p;let N=np({items:w,lookup:f});for(const p of x.values())N=p(N);h&&c(w),N.length>0?d==null||d(N):g&&window.requestAnimationFrame(()=>{const{fitViewQueued:p,nodes:v,setNodes:y}=t.getState();p&&y(v)})},[]),r=op(n),s=m.useCallback(l=>{const{edges:u=[],setEdges:c,hasDefaultEdges:h,onEdgesChange:d,edgeLookup:f}=t.getState();let g=u;for(const x of l)g=typeof x=="function"?x(g):x;h?c(g):d&&d(np({items:g,lookup:f}))},[]),o=op(s),i=m.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return a.jsx(rv.Provider,{value:i,children:e})}function R5(){const e=m.useContext(rv);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const T5=e=>!!e.panZoom;function jf(){const e=j5(),t=be(),n=R5(),r=ie(T5),s=m.useMemo(()=>{const o=d=>t.getState().nodeLookup.get(d),i=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},u=d=>{var p,v;const{nodeLookup:f,nodeOrigin:g}=t.getState(),x=sp(d)?d:f.get(d.id),w=x.parentId?E0(x.position,x.measured,x.parentId,f,g):x.position,N={...x,position:w,width:((p=x.measured)==null?void 0:p.width)??x.width,height:((v=x.measured)==null?void 0:v.height)??x.height};return ws(N)},c=(d,f,g={replace:!1})=>{i(x=>x.map(w=>{if(w.id===d){const N=typeof f=="function"?f(w):f;return g.replace&&sp(N)?N:{...w,...N}}return w}))},h=(d,f,g={replace:!1})=>{l(x=>x.map(w=>{if(w.id===d){const N=typeof f=="function"?f(w):f;return g.replace&&_5(N)?N:{...w,...N}}return w}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=o(d))==null?void 0:f.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:i,setEdges:l,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(g=>[...g,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(g=>[...g,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:g}=t.getState(),[x,w,N]=g;return{nodes:d.map(p=>({...p})),edges:f.map(p=>({...p})),viewport:{x,y:w,zoom:N}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:g,edges:x,onNodesDelete:w,onEdgesDelete:N,triggerNodeChanges:p,triggerEdgeChanges:v,onDelete:y,onBeforeDelete:S}=t.getState(),{nodes:b,edges:C}=await F3({nodesToRemove:d,edgesToRemove:f,nodes:g,edges:x,onBeforeDelete:S}),j=C.length>0,P=b.length>0;if(j){const I=C.map(rp);N==null||N(C),v(I)}if(P){const I=b.map(rp);w==null||w(b),p(I)}return(P||j)&&(y==null||y({nodes:b,edges:C})),{deletedNodes:b,deletedEdges:C}},getIntersectingNodes:(d,f=!0,g)=>{const x=Lm(d),w=x?d:u(d),N=g!==void 0;return w?(g||t.getState().nodes).filter(p=>{const v=t.getState().nodeLookup.get(p.id);if(v&&!x&&(p.id===d.id||!v.internals.positionAbsolute))return!1;const y=ws(N?p:v),S=Fo(y,w);return f&&S>0||S>=y.width*y.height||S>=w.width*w.height}):[]},isNodeIntersecting:(d,f,g=!0)=>{const w=Lm(d)?d:u(d);if(!w)return!1;const N=Fo(w,f);return g&&N>0||N>=f.width*f.height||N>=w.width*w.height},updateNode:c,updateNodeData:(d,f,g={replace:!1})=>{c(d,x=>{const w=typeof f=="function"?f(x):f;return g.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},g)},updateEdge:h,updateEdgeData:(d,f,g={replace:!1})=>{h(d,x=>{const w=typeof f=="function"?f(x):f;return g.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},g)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:g}=t.getState();return z3(d,{nodeLookup:f,nodeOrigin:g})},getHandleConnections:({type:d,id:f,nodeId:g})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${g}-${d}${f?`-${f}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:d,handleId:f,nodeId:g})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${g}${d?f?`-${d}-${f}`:`-${d}`:""}`))==null?void 0:x.values())??[])},fitView:async d=>{const f=t.getState().fitViewResolver??U3();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(g=>[...g]),f.promise}}},[]);return m.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const ip=e=>e.selected,L5=typeof window<"u"?window:void 0;function A5({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=be(),{deleteElements:r}=jf(),s=Bo(e,{actInsideInputWithModifier:!1}),o=Bo(t,{target:L5});m.useEffect(()=>{if(s){const{edges:i,nodes:l}=n.getState();r({nodes:l.filter(ip),edges:i.filter(ip)}),n.setState({nodesSelectionActive:!1})}},[s]),m.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function z5(e){const t=be();m.useEffect(()=>{const n=()=>{var s,o,i,l;if(!e.current||!(((o=(s=e.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const r=yf(e.current);(r.height===0||r.width===0)&&((l=(i=t.getState()).onError)==null||l.call(i,"004",en.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Il={position:"absolute",width:"100%",height:"100%",top:0,left:0},D5=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function $5({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=pr.Free,zoomOnDoubleClick:i=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:c,minZoom:h,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:g=!0,children:x,noWheelClassName:w,noPanClassName:N,onViewportChange:p,isControlledViewport:v,paneClickDistance:y,selectionOnDrag:S}){const b=be(),C=m.useRef(null),{userSelectionActive:j,lib:P,connectionInProgress:I}=ie(D5,Se),$=Bo(f),R=m.useRef();z5(C);const T=m.useCallback(D=>{p==null||p({x:D[0],y:D[1],zoom:D[2]}),v||b.setState({transform:D})},[p,v]);return m.useEffect(()=>{if(C.current){R.current=E4({domNode:C.current,minZoom:h,maxZoom:d,translateExtent:c,viewport:u,onDraggingChange:k=>b.setState({paneDragging:k}),onPanZoomStart:(k,z)=>{const{onViewportChangeStart:_,onMoveStart:M}=b.getState();M==null||M(k,z),_==null||_(z)},onPanZoom:(k,z)=>{const{onViewportChange:_,onMove:M}=b.getState();M==null||M(k,z),_==null||_(z)},onPanZoomEnd:(k,z)=>{const{onViewportChangeEnd:_,onMoveEnd:M}=b.getState();M==null||M(k,z),_==null||_(z)}});const{x:D,y:E,zoom:L}=R.current.getViewport();return b.setState({panZoom:R.current,transform:[D,E,L],domNode:C.current.closest(".react-flow")}),()=>{var k;(k=R.current)==null||k.destroy()}}},[]),m.useEffect(()=>{var D;(D=R.current)==null||D.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:i,panOnDrag:l,zoomActivationKeyPressed:$,preventScrolling:g,noPanClassName:N,userSelectionActive:j,noWheelClassName:w,lib:P,onTransformChange:T,connectionInProgress:I,selectionOnDrag:S,paneClickDistance:y})},[e,t,n,r,s,o,i,l,$,g,N,j,w,P,T,I,S,y]),a.jsx("div",{className:"react-flow__renderer",ref:C,style:Il,children:x})}const O5=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function F5(){const{userSelectionActive:e,userSelectionRect:t}=ie(O5,Se);return e&&t?a.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const _u=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},H5=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function B5({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Oo.Full,panOnDrag:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:i,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:h,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:g,children:x}){const w=be(),{userSelectionActive:N,elementsSelectable:p,dragging:v,connectionInProgress:y}=ie(H5,Se),S=p&&(e||N),b=m.useRef(null),C=m.useRef(),j=m.useRef(new Set),P=m.useRef(new Set),I=m.useRef(!1),$=_=>{if(I.current||y){I.current=!1;return}u==null||u(_),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},R=_=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){_.preventDefault();return}c==null||c(_)},T=h?_=>h(_):void 0,D=_=>{I.current&&(_.stopPropagation(),I.current=!1)},E=_=>{var G,Y;const{domNode:M}=w.getState();if(C.current=M==null?void 0:M.getBoundingClientRect(),!C.current)return;const A=_.target===b.current;if(!A&&!!_.target.closest(".nokey")||!e||!(o&&A||t)||_.button!==0||!_.isPrimary)return;(Y=(G=_.target)==null?void 0:G.setPointerCapture)==null||Y.call(G,_.pointerId),I.current=!1;const{x:U,y:V}=Lt(_.nativeEvent,C.current);w.setState({userSelectionRect:{width:0,height:0,startX:U,startY:V,x:U,y:V}}),A||(_.stopPropagation(),_.preventDefault())},L=_=>{const{userSelectionRect:M,transform:A,nodeLookup:F,edgeLookup:O,connectionLookup:U,triggerNodeChanges:V,triggerEdgeChanges:G,defaultEdgeOptions:Y,resetSelectedElements:X}=w.getState();if(!C.current||!M)return;const{x:B,y:q}=Lt(_.nativeEvent,C.current),{startX:se,startY:te}=M;if(!I.current){const le=t?0:s;if(Math.hypot(B-se,q-te)<=le)return;X(),i==null||i(_)}I.current=!0;const ee={startX:se,startY:te,x:B<se?B:se,y:q<te?q:te,width:Math.abs(B-se),height:Math.abs(q-te)},J=j.current,ue=P.current;j.current=new Set(gf(F,ee,A,n===Oo.Partial,!0).map(le=>le.id)),P.current=new Set;const me=(Y==null?void 0:Y.selectable)??!0;for(const le of j.current){const Ue=U.get(le);if(Ue)for(const{edgeId:Nn}of Ue.values()){const rn=O.get(Nn);rn&&(rn.selectable??me)&&P.current.add(Nn)}}if(!Am(J,j.current)){const le=qr(F,j.current,!0);V(le)}if(!Am(ue,P.current)){const le=qr(O,P.current);G(le)}w.setState({userSelectionRect:ee,userSelectionActive:!0,nodesSelectionActive:!1})},k=_=>{var M,A;_.button===0&&((A=(M=_.target)==null?void 0:M.releasePointerCapture)==null||A.call(M,_.pointerId),!N&&_.target===b.current&&w.getState().userSelectionRect&&($==null||$(_)),w.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(l==null||l(_),w.setState({nodesSelectionActive:j.current.size>0})))},z=r===!0||Array.isArray(r)&&r.includes(0);return a.jsxs("div",{className:Le(["react-flow__pane",{draggable:z,dragging:v,selection:e}]),onClick:S?void 0:_u($,b),onContextMenu:_u(R,b),onWheel:_u(T,b),onPointerEnter:S?void 0:d,onPointerMove:S?L:f,onPointerUp:S?k:void 0,onPointerDownCapture:S?E:void 0,onClickCapture:S?D:void 0,onPointerLeave:g,ref:b,style:Il,children:[x,a.jsx(F5,{})]})}function Wc({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:i,nodeLookup:l,onError:u}=t.getState(),c=l.get(e);if(!c){u==null||u("012",en.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):s([e])}function sv({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:i}){const l=be(),[u,c]=m.useState(!1),h=m.useRef();return m.useEffect(()=>{h.current=h4({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{Wc({id:d,store:l,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),m.useEffect(()=>{var d,f;if(t)(d=h.current)==null||d.destroy();else if(e.current)return(f=h.current)==null||f.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:i}),()=>{var g;(g=h.current)==null||g.destroy()}},[n,r,t,o,e,s]),u}const V5=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function ov(){const e=be();return m.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:i,onError:l,updateNodePositions:u,nodeLookup:c,nodeOrigin:h}=e.getState(),d=new Map,f=V5(i),g=s?o[0]:5,x=s?o[1]:5,w=n.direction.x*g*n.factor,N=n.direction.y*x*n.factor;for(const[,p]of c){if(!f(p))continue;let v={x:p.internals.positionAbsolute.x+w,y:p.internals.positionAbsolute.y+N};s&&(v=ni(v,o));const{position:y,positionAbsolute:S}=S0({nodeId:p.id,nextPosition:v,nodeLookup:c,nodeExtent:r,nodeOrigin:h,onError:l});p.position=y,p.internals.positionAbsolute=S,d.set(p.id,p)}u(d)},[])}const kf=m.createContext(null),U5=kf.Provider;kf.Consumer;const iv=()=>m.useContext(kf),W5=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),K5=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:i}=r,{fromHandle:l,toHandle:u,isValid:c}=i,h=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:h,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:o===ys.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!s,valid:h&&c}};function G5({type:e="source",position:t=Q.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:i,onConnect:l,children:u,className:c,onMouseDown:h,onTouchStart:d,...f},g){var L,k;const x=i||null,w=e==="target",N=be(),p=iv(),{connectOnClick:v,noPanClassName:y,rfId:S}=ie(W5,Se),{connectingFrom:b,connectingTo:C,clickConnecting:j,isPossibleEndHandle:P,connectionInProcess:I,clickConnectionInProcess:$,valid:R}=ie(K5(p,x,e),Se);p||(k=(L=N.getState()).onError)==null||k.call(L,"010",en.error010());const T=z=>{const{defaultEdgeOptions:_,onConnect:M,hasDefaultEdges:A}=N.getState(),F={..._,...z};if(A){const{edges:O,setEdges:U}=N.getState();U(q3(F,O))}M==null||M(F),l==null||l(F)},D=z=>{if(!p)return;const _=M0(z.nativeEvent);if(s&&(_&&z.button===0||!_)){const M=N.getState();Uc.onPointerDown(z.nativeEvent,{handleDomNode:z.currentTarget,autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:w,handleId:x,nodeId:p,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:M.onConnectEnd,updateConnection:M.updateConnection,onConnect:T,isValidConnection:n||M.isValidConnection,getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}_?h==null||h(z):d==null||d(z)},E=z=>{const{onClickConnectStart:_,onClickConnectEnd:M,connectionClickStartHandle:A,connectionMode:F,isValidConnection:O,lib:U,rfId:V,nodeLookup:G,connection:Y}=N.getState();if(!p||!A&&!s)return;if(!A){_==null||_(z.nativeEvent,{nodeId:p,handleId:x,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:p,type:e,id:x}});return}const X=_0(z.target),B=n||O,{connection:q,isValid:se}=Uc.isValid(z.nativeEvent,{handle:{nodeId:p,id:x,type:e},connectionMode:F,fromNodeId:A.nodeId,fromHandleId:A.id||null,fromType:A.type,isValidConnection:B,flowId:V,doc:X,lib:U,nodeLookup:G});se&&q&&T(q);const te=structuredClone(Y);delete te.inProgress,te.toPosition=te.toHandle?te.toHandle.position:null,M==null||M(z,te),N.setState({connectionClickStartHandle:null})};return a.jsx("div",{"data-handleid":x,"data-nodeid":p,"data-handlepos":t,"data-id":`${S}-${p}-${x}-${e}`,className:Le(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,c,{source:!w,target:w,connectable:r,connectablestart:s,connectableend:o,clickconnecting:j,connectingfrom:b,connectingto:C,valid:R,connectionindicator:r&&(!I||P)&&(I||$?o:s)}]),onMouseDown:D,onTouchStart:D,onClick:v?E:void 0,ref:g,...f,children:u})}const Ga=m.memo(nv(G5));function Y5({data:e,isConnectable:t,sourcePosition:n=Q.Bottom}){return a.jsxs(a.Fragment,{children:[e==null?void 0:e.label,a.jsx(Ga,{type:"source",position:n,isConnectable:t})]})}function X5({data:e,isConnectable:t,targetPosition:n=Q.Top,sourcePosition:r=Q.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx(Ga,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,a.jsx(Ga,{type:"source",position:r,isConnectable:t})]})}function Q5(){return null}function q5({data:e,isConnectable:t,targetPosition:n=Q.Top}){return a.jsxs(a.Fragment,{children:[a.jsx(Ga,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Ya={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},ap={input:Y5,default:X5,output:q5,group:Q5};function Z5(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const J5=e=>{const{width:t,height:n,x:r,y:s}=ti(e.nodeLookup,{filter:o=>!!o.selected});return{width:Tt(t)?t:null,height:Tt(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function eP({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=be(),{width:s,height:o,transformString:i,userSelectionActive:l}=ie(J5,Se),u=ov(),c=m.useRef(null);if(m.useEffect(()=>{var f;n||(f=c.current)==null||f.focus({preventScroll:!0})},[n]),sv({nodeRef:c}),l||!s||!o)return null;const h=e?f=>{const g=r.getState().nodes.filter(x=>x.selected);e(f,g)}:void 0,d=f=>{Object.prototype.hasOwnProperty.call(Ya,f.key)&&(f.preventDefault(),u({direction:Ya[f.key],factor:f.shiftKey?4:1}))};return a.jsx("div",{className:Le(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:a.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:s,height:o}})})}const lp=typeof window<"u"?window:void 0,tP=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function av({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:c,selectionOnDrag:h,selectionMode:d,onSelectionStart:f,onSelectionEnd:g,multiSelectionKeyCode:x,panActivationKeyCode:w,zoomActivationKeyCode:N,elementsSelectable:p,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:S,panOnScrollSpeed:b,panOnScrollMode:C,zoomOnDoubleClick:j,panOnDrag:P,defaultViewport:I,translateExtent:$,minZoom:R,maxZoom:T,preventScrolling:D,onSelectionContextMenu:E,noWheelClassName:L,noPanClassName:k,disableKeyboardA11y:z,onViewportChange:_,isControlledViewport:M}){const{nodesSelectionActive:A,userSelectionActive:F}=ie(tP,Se),O=Bo(c,{target:lp}),U=Bo(w,{target:lp}),V=U||P,G=U||S,Y=h&&V!==!0,X=O||F||Y;return A5({deleteKeyCode:u,multiSelectionKeyCode:x}),a.jsx($5,{onPaneContextMenu:o,elementsSelectable:p,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:G,panOnScrollSpeed:b,panOnScrollMode:C,zoomOnDoubleClick:j,panOnDrag:!O&&V,defaultViewport:I,translateExtent:$,minZoom:R,maxZoom:T,zoomActivationKeyCode:N,preventScrolling:D,noWheelClassName:L,noPanClassName:k,onViewportChange:_,isControlledViewport:M,paneClickDistance:l,selectionOnDrag:Y,children:a.jsxs(B5,{onSelectionStart:f,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,panOnDrag:V,isSelecting:!!X,selectionMode:d,selectionKeyPressed:O,paneClickDistance:l,selectionOnDrag:Y,children:[e,A&&a.jsx(eP,{onSelectionContextMenu:E,noPanClassName:k,disableKeyboardA11y:z})]})})}av.displayName="FlowRenderer";const nP=m.memo(av),rP=e=>t=>e?gf(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function sP(e){return ie(m.useCallback(rP(e),[e]),Se)}const oP=e=>e.updateNodeInternals;function iP(){const e=ie(oP),[t]=m.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const o=s.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:s.target,force:!0})}),e(r)}));return m.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function aP({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=be(),o=m.useRef(null),i=m.useRef(null),l=m.useRef(e.sourcePosition),u=m.useRef(e.targetPosition),c=m.useRef(t),h=n&&!!e.internals.handleBounds;return m.useEffect(()=>{o.current&&!e.hidden&&(!h||i.current!==o.current)&&(i.current&&(r==null||r.unobserve(i.current)),r==null||r.observe(o.current),i.current=o.current)},[h,e.hidden]),m.useEffect(()=>()=>{i.current&&(r==null||r.unobserve(i.current),i.current=null)},[]),m.useEffect(()=>{if(o.current){const d=c.current!==t,f=l.current!==e.sourcePosition,g=u.current!==e.targetPosition;(d||f||g)&&(c.current=t,l.current=e.sourcePosition,u.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function lP({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:i,nodesDraggable:l,elementsSelectable:u,nodesConnectable:c,nodesFocusable:h,resizeObserver:d,noDragClassName:f,noPanClassName:g,disableKeyboardA11y:x,rfId:w,nodeTypes:N,nodeClickDistance:p,onError:v}){const{node:y,internals:S,isParent:b}=ie(B=>{const q=B.nodeLookup.get(e),se=B.parentLookup.has(e);return{node:q,internals:q.internals,isParent:se}},Se);let C=y.type||"default",j=(N==null?void 0:N[C])||ap[C];j===void 0&&(v==null||v("003",en.error003(C)),C="default",j=(N==null?void 0:N.default)||ap.default);const P=!!(y.draggable||l&&typeof y.draggable>"u"),I=!!(y.selectable||u&&typeof y.selectable>"u"),$=!!(y.connectable||c&&typeof y.connectable>"u"),R=!!(y.focusable||h&&typeof y.focusable>"u"),T=be(),D=C0(y),E=aP({node:y,nodeType:C,hasDimensions:D,resizeObserver:d}),L=sv({nodeRef:E,disabled:y.hidden||!P,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:p}),k=ov();if(y.hidden)return null;const z=wn(y),_=Z5(y),M=I||P||t||n||r||s,A=n?B=>n(B,{...S.userNode}):void 0,F=r?B=>r(B,{...S.userNode}):void 0,O=s?B=>s(B,{...S.userNode}):void 0,U=o?B=>o(B,{...S.userNode}):void 0,V=i?B=>i(B,{...S.userNode}):void 0,G=B=>{const{selectNodesOnDrag:q,nodeDragThreshold:se}=T.getState();I&&(!q||!P||se>0)&&Wc({id:e,store:T,nodeRef:E}),t&&t(B,{...S.userNode})},Y=B=>{if(!(P0(B.nativeEvent)||x)){if(x0.includes(B.key)&&I){const q=B.key==="Escape";Wc({id:e,store:T,unselect:q,nodeRef:E})}else if(P&&y.selected&&Object.prototype.hasOwnProperty.call(Ya,B.key)){B.preventDefault();const{ariaLabelConfig:q}=T.getState();T.setState({ariaLiveMessage:q["node.a11yDescription.ariaLiveMessage"]({direction:B.key.replace("Arrow","").toLowerCase(),x:~~S.positionAbsolute.x,y:~~S.positionAbsolute.y})}),k({direction:Ya[B.key],factor:B.shiftKey?4:1})}}},X=()=>{var ue;if(x||!((ue=E.current)!=null&&ue.matches(":focus-visible")))return;const{transform:B,width:q,height:se,autoPanOnNodeFocus:te,setCenter:ee}=T.getState();if(!te)return;gf(new Map([[e,y]]),{x:0,y:0,width:q,height:se},B,!0).length>0||ee(y.position.x+z.width/2,y.position.y+z.height/2,{zoom:B[2]})};return a.jsx("div",{className:Le(["react-flow__node",`react-flow__node-${C}`,{[g]:P},y.className,{selected:y.selected,selectable:I,parent:b,draggable:P,dragging:L}]),ref:E,style:{zIndex:S.z,transform:`translate(${S.positionAbsolute.x}px,${S.positionAbsolute.y}px)`,pointerEvents:M?"all":"none",visibility:D?"visible":"hidden",...y.style,..._},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:A,onMouseMove:F,onMouseLeave:O,onContextMenu:U,onClick:G,onDoubleClick:V,onKeyDown:R?Y:void 0,tabIndex:R?0:void 0,onFocus:R?X:void 0,role:y.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${Z0}-${w}`,"aria-label":y.ariaLabel,...y.domAttributes,children:a.jsx(U5,{value:e,children:a.jsx(j,{id:e,data:y.data,type:C,positionAbsoluteX:S.positionAbsolute.x,positionAbsoluteY:S.positionAbsolute.y,selected:y.selected??!1,selectable:I,draggable:P,deletable:y.deletable??!0,isConnectable:$,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:L,dragHandle:y.dragHandle,zIndex:S.z,parentId:y.parentId,...z})})})}var uP=m.memo(lP);const cP=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function lv(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:o}=ie(cP,Se),i=sP(e.onlyRenderVisibleElements),l=iP();return a.jsx("div",{className:"react-flow__nodes",style:Il,children:i.map(u=>a.jsx(uP,{id:u,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:o},u))})}lv.displayName="NodeRenderer";const dP=m.memo(lv);function fP(e){return ie(m.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const o=n.nodeLookup.get(s.source),i=n.nodeLookup.get(s.target);o&&i&&Y3({sourceNode:o,targetNode:i,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),Se)}const hP=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return a.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},mP=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return a.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},up={[Ua.Arrow]:hP,[Ua.ArrowClosed]:mP};function pP(e){const t=be();return m.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(up,e)?up[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",en.error009(e)),null)},[e])}const gP=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:i,orient:l="auto-start-reverse"})=>{const u=pP(t);return u?a.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:l,refX:"0",refY:"0",children:a.jsx(u,{color:n,strokeWidth:i})}):null},uv=({defaultColor:e,rfId:t})=>{const n=ie(o=>o.edges),r=ie(o=>o.defaultEdgeOptions),s=m.useMemo(()=>n4(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?a.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:a.jsx("defs",{children:s.map(o=>a.jsx(gP,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};uv.displayName="MarkerDefinitions";var xP=m.memo(uv);function cv({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:i=[2,4],labelBgBorderRadius:l=2,children:u,className:c,...h}){const[d,f]=m.useState({x:1,y:0,width:0,height:0}),g=Le(["react-flow__edge-textwrapper",c]),x=m.useRef(null);return m.useEffect(()=>{if(x.current){const w=x.current.getBBox();f({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?a.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:g,visibility:d.width?"visible":"hidden",...h,children:[s&&a.jsx("rect",{width:d.width+2*i[0],x:-i[0],y:-i[1],height:d.height+2*i[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),a.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:x,style:r,children:n}),u]}):null}cv.displayName="EdgeText";const yP=m.memo(cv);function Rl({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:u,interactionWidth:c=20,...h}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...h,d:e,fill:"none",className:Le(["react-flow__edge-path",h.className])}),c?a.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&Tt(t)&&Tt(n)?a.jsx(yP,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:u}):null]})}function cp({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===Q.Left||e===Q.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function dv({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:s,targetPosition:o=Q.Top}){const[i,l]=cp({pos:n,x1:e,y1:t,x2:r,y2:s}),[u,c]=cp({pos:o,x1:r,y1:s,x2:e,y2:t}),[h,d,f,g]=I0({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:i,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${t} C${i},${l} ${u},${c} ${r},${s}`,h,d,f,g]}function fv(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i,targetPosition:l,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:x,markerEnd:w,markerStart:N,interactionWidth:p})=>{const[v,y,S]=dv({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l}),b=e.isInternal?void 0:t;return a.jsx(Rl,{id:b,path:v,labelX:y,labelY:S,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:x,markerEnd:w,markerStart:N,interactionWidth:p})})}const vP=fv({isInternal:!1}),hv=fv({isInternal:!0});vP.displayName="SimpleBezierEdge";hv.displayName="SimpleBezierEdgeInternal";function mv(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,sourcePosition:g=Q.Bottom,targetPosition:x=Q.Top,markerEnd:w,markerStart:N,pathOptions:p,interactionWidth:v})=>{const[y,S,b]=Hc({sourceX:n,sourceY:r,sourcePosition:g,targetX:s,targetY:o,targetPosition:x,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset,stepPosition:p==null?void 0:p.stepPosition}),C=e.isInternal?void 0:t;return a.jsx(Rl,{id:C,path:y,labelX:S,labelY:b,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:w,markerStart:N,interactionWidth:v})})}const pv=mv({isInternal:!1}),gv=mv({isInternal:!0});pv.displayName="SmoothStepEdge";gv.displayName="SmoothStepEdgeInternal";function xv(e){return m.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return a.jsx(pv,{...n,id:r,pathOptions:m.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const wP=xv({isInternal:!1}),yv=xv({isInternal:!0});wP.displayName="StepEdge";yv.displayName="StepEdgeInternal";function vv(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:g,markerStart:x,interactionWidth:w})=>{const[N,p,v]=L0({sourceX:n,sourceY:r,targetX:s,targetY:o}),y=e.isInternal?void 0:t;return a.jsx(Rl,{id:y,path:N,labelX:p,labelY:v,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:g,markerStart:x,interactionWidth:w})})}const NP=vv({isInternal:!1}),wv=vv({isInternal:!0});NP.displayName="StraightEdge";wv.displayName="StraightEdgeInternal";function Nv(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i=Q.Bottom,targetPosition:l=Q.Top,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:x,markerEnd:w,markerStart:N,pathOptions:p,interactionWidth:v})=>{const[y,S,b]=R0({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l,curvature:p==null?void 0:p.curvature}),C=e.isInternal?void 0:t;return a.jsx(Rl,{id:C,path:y,labelX:S,labelY:b,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:x,markerEnd:w,markerStart:N,interactionWidth:v})})}const SP=Nv({isInternal:!1}),Sv=Nv({isInternal:!0});SP.displayName="BezierEdge";Sv.displayName="BezierEdgeInternal";const dp={default:Sv,straight:wv,step:yv,smoothstep:gv,simplebezier:hv},fp={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},bP=(e,t,n)=>n===Q.Left?e-t:n===Q.Right?e+t:e,jP=(e,t,n)=>n===Q.Top?e-t:n===Q.Bottom?e+t:e,hp="react-flow__edgeupdater";function mp({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:i,type:l}){return a.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:i,className:Le([hp,`${hp}-${l}`]),cx:bP(t,r,e),cy:jP(n,r,e),r,stroke:"transparent",fill:"transparent"})}function kP({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:i,sourcePosition:l,targetPosition:u,onReconnect:c,onReconnectStart:h,onReconnectEnd:d,setReconnecting:f,setUpdateHover:g}){const x=be(),w=(S,b)=>{if(S.button!==0)return;const{autoPanOnConnect:C,domNode:j,isValidConnection:P,connectionMode:I,connectionRadius:$,lib:R,onConnectStart:T,onConnectEnd:D,cancelConnection:E,nodeLookup:L,rfId:k,panBy:z,updateConnection:_}=x.getState(),M=b.type==="target",A=(U,V)=>{f(!1),d==null||d(U,n,b.type,V)},F=U=>c==null?void 0:c(n,U),O=(U,V)=>{f(!0),h==null||h(S,n,b.type),T==null||T(U,V)};Uc.onPointerDown(S.nativeEvent,{autoPanOnConnect:C,connectionMode:I,connectionRadius:$,domNode:j,handleId:b.id,nodeId:b.nodeId,nodeLookup:L,isTarget:M,edgeUpdaterType:b.type,lib:R,flowId:k,cancelConnection:E,panBy:z,isValidConnection:P,onConnect:F,onConnectStart:O,onConnectEnd:D,onReconnectEnd:A,updateConnection:_,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:S.currentTarget})},N=S=>w(S,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),p=S=>w(S,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>g(!0),y=()=>g(!1);return a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(mp,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:N,onMouseEnter:v,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&a.jsx(mp,{position:u,centerX:o,centerY:i,radius:t,onMouseDown:p,onMouseEnter:v,onMouseOut:y,type:"target"})]})}function CP({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:i,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:g,rfId:x,edgeTypes:w,noPanClassName:N,onError:p,disableKeyboardA11y:v}){let y=ie(ee=>ee.edgeLookup.get(e));const S=ie(ee=>ee.defaultEdgeOptions);y=S?{...S,...y}:y;let b=y.type||"default",C=(w==null?void 0:w[b])||dp[b];C===void 0&&(p==null||p("011",en.error011(b)),b="default",C=(w==null?void 0:w.default)||dp.default);const j=!!(y.focusable||t&&typeof y.focusable>"u"),P=typeof d<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),I=!!(y.selectable||r&&typeof y.selectable>"u"),$=m.useRef(null),[R,T]=m.useState(!1),[D,E]=m.useState(!1),L=be(),{zIndex:k,sourceX:z,sourceY:_,targetX:M,targetY:A,sourcePosition:F,targetPosition:O}=ie(m.useCallback(ee=>{const J=ee.nodeLookup.get(y.source),ue=ee.nodeLookup.get(y.target);if(!J||!ue)return{zIndex:y.zIndex,...fp};const me=t4({id:e,sourceNode:J,targetNode:ue,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:ee.connectionMode,onError:p});return{zIndex:G3({selected:y.selected,zIndex:y.zIndex,sourceNode:J,targetNode:ue,elevateOnSelect:ee.elevateEdgesOnSelect,zIndexMode:ee.zIndexMode}),...me||fp}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),Se),U=m.useMemo(()=>y.markerStart?`url('#${Bc(y.markerStart,x)}')`:void 0,[y.markerStart,x]),V=m.useMemo(()=>y.markerEnd?`url('#${Bc(y.markerEnd,x)}')`:void 0,[y.markerEnd,x]);if(y.hidden||z===null||_===null||M===null||A===null)return null;const G=ee=>{var le;const{addSelectedEdges:J,unselectNodesAndEdges:ue,multiSelectionActive:me}=L.getState();I&&(L.setState({nodesSelectionActive:!1}),y.selected&&me?(ue({nodes:[],edges:[y]}),(le=$.current)==null||le.blur()):J([e])),s&&s(ee,y)},Y=o?ee=>{o(ee,{...y})}:void 0,X=i?ee=>{i(ee,{...y})}:void 0,B=l?ee=>{l(ee,{...y})}:void 0,q=u?ee=>{u(ee,{...y})}:void 0,se=c?ee=>{c(ee,{...y})}:void 0,te=ee=>{var J;if(!v&&x0.includes(ee.key)&&I){const{unselectNodesAndEdges:ue,addSelectedEdges:me}=L.getState();ee.key==="Escape"?((J=$.current)==null||J.blur(),ue({edges:[y]})):me([e])}};return a.jsx("svg",{style:{zIndex:k},children:a.jsxs("g",{className:Le(["react-flow__edge",`react-flow__edge-${b}`,y.className,N,{selected:y.selected,animated:y.animated,inactive:!I&&!s,updating:R,selectable:I}]),onClick:G,onDoubleClick:Y,onContextMenu:X,onMouseEnter:B,onMouseMove:q,onMouseLeave:se,onKeyDown:j?te:void 0,tabIndex:j?0:void 0,role:y.ariaRole??(j?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":j?`${J0}-${x}`:void 0,ref:$,...y.domAttributes,children:[!D&&a.jsx(C,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:I,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:z,sourceY:_,targetX:M,targetY:A,sourcePosition:F,targetPosition:O,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:U,markerEnd:V,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),P&&a.jsx(kP,{edge:y,isReconnectable:P,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:g,sourceX:z,sourceY:_,targetX:M,targetY:A,sourcePosition:F,targetPosition:O,setUpdateHover:T,setReconnecting:E})]})})}var EP=m.memo(CP);const _P=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function bv({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:h,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:g,onReconnectEnd:x,disableKeyboardA11y:w}){const{edgesFocusable:N,edgesReconnectable:p,elementsSelectable:v,onError:y}=ie(_P,Se),S=fP(t);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(xP,{defaultColor:e,rfId:n}),S.map(b=>a.jsx(EP,{id:b,edgesFocusable:N,edgesReconnectable:p,elementsSelectable:v,noPanClassName:s,onReconnect:o,onContextMenu:i,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,onClick:h,reconnectRadius:d,onDoubleClick:f,onReconnectStart:g,onReconnectEnd:x,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:w},b))]})}bv.displayName="EdgeRenderer";const PP=m.memo(bv),MP=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function IP({children:e}){const t=ie(MP);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function RP(e){const t=jf(),n=m.useRef(!1);m.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const TP=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function LP(e){const t=ie(TP),n=be();return m.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function AP(e){return e.connection.inProgress?{...e.connection,to:ri(e.connection.to,e.transform)}:{...e.connection}}function zP(e){return AP}function DP(e){const t=zP();return ie(t,Se)}const $P=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function OP({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:i,isValid:l,inProgress:u}=ie($P,Se);return!(o&&s&&u)?null:a.jsx("svg",{style:e,width:o,height:i,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:Le(["react-flow__connection",w0(l)]),children:a.jsx(jv,{style:t,type:n,CustomComponent:r,isValid:l})})})}const jv=({style:e,type:t=Rn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:i,fromHandle:l,fromPosition:u,to:c,toNode:h,toHandle:d,toPosition:f,pointer:g}=DP();if(!s)return;if(n)return a.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:l,fromX:o.x,fromY:o.y,toX:c.x,toY:c.y,fromPosition:u,toPosition:f,connectionStatus:w0(r),toNode:h,toHandle:d,pointer:g});let x="";const w={sourceX:o.x,sourceY:o.y,sourcePosition:u,targetX:c.x,targetY:c.y,targetPosition:f};switch(t){case Rn.Bezier:[x]=R0(w);break;case Rn.SimpleBezier:[x]=dv(w);break;case Rn.Step:[x]=Hc({...w,borderRadius:0});break;case Rn.SmoothStep:[x]=Hc(w);break;default:[x]=L0(w)}return a.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};jv.displayName="ConnectionLine";const FP={};function pp(e=FP){m.useRef(e),be(),m.useEffect(()=>{},[e])}function HP(){be(),m.useRef(!1),m.useEffect(()=>{},[])}function kv({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:h,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:g,connectionLineType:x,connectionLineStyle:w,connectionLineComponent:N,connectionLineContainerStyle:p,selectionKeyCode:v,selectionOnDrag:y,selectionMode:S,multiSelectionKeyCode:b,panActivationKeyCode:C,zoomActivationKeyCode:j,deleteKeyCode:P,onlyRenderVisibleElements:I,elementsSelectable:$,defaultViewport:R,translateExtent:T,minZoom:D,maxZoom:E,preventScrolling:L,defaultMarkerColor:k,zoomOnScroll:z,zoomOnPinch:_,panOnScroll:M,panOnScrollSpeed:A,panOnScrollMode:F,zoomOnDoubleClick:O,panOnDrag:U,onPaneClick:V,onPaneMouseEnter:G,onPaneMouseMove:Y,onPaneMouseLeave:X,onPaneScroll:B,onPaneContextMenu:q,paneClickDistance:se,nodeClickDistance:te,onEdgeContextMenu:ee,onEdgeMouseEnter:J,onEdgeMouseMove:ue,onEdgeMouseLeave:me,reconnectRadius:le,onReconnect:Ue,onReconnectStart:Nn,onReconnectEnd:rn,noDragClassName:rr,noWheelClassName:Rs,noPanClassName:Ts,disableKeyboardA11y:Ls,nodeExtent:Al,rfId:si,viewport:Rr,onViewportChange:As}){return pp(e),pp(t),HP(),RP(n),LP(Rr),a.jsx(nP,{onPaneClick:V,onPaneMouseEnter:G,onPaneMouseMove:Y,onPaneMouseLeave:X,onPaneContextMenu:q,onPaneScroll:B,paneClickDistance:se,deleteKeyCode:P,selectionKeyCode:v,selectionOnDrag:y,selectionMode:S,onSelectionStart:f,onSelectionEnd:g,multiSelectionKeyCode:b,panActivationKeyCode:C,zoomActivationKeyCode:j,elementsSelectable:$,zoomOnScroll:z,zoomOnPinch:_,zoomOnDoubleClick:O,panOnScroll:M,panOnScrollSpeed:A,panOnScrollMode:F,panOnDrag:U,defaultViewport:R,translateExtent:T,minZoom:D,maxZoom:E,onSelectionContextMenu:d,preventScrolling:L,noDragClassName:rr,noWheelClassName:Rs,noPanClassName:Ts,disableKeyboardA11y:Ls,onViewportChange:As,isControlledViewport:!!Rr,children:a.jsxs(IP,{children:[a.jsx(PP,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:i,onReconnect:Ue,onReconnectStart:Nn,onReconnectEnd:rn,onlyRenderVisibleElements:I,onEdgeContextMenu:ee,onEdgeMouseEnter:J,onEdgeMouseMove:ue,onEdgeMouseLeave:me,reconnectRadius:le,defaultMarkerColor:k,noPanClassName:Ts,disableKeyboardA11y:Ls,rfId:si}),a.jsx(OP,{style:w,type:x,component:N,containerStyle:p}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(dP,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:h,nodeClickDistance:te,onlyRenderVisibleElements:I,noPanClassName:Ts,noDragClassName:rr,disableKeyboardA11y:Ls,nodeExtent:Al,rfId:si}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}kv.displayName="GraphView";const BP=m.memo(kv),gp=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:u=.5,maxZoom:c=2,nodeOrigin:h,nodeExtent:d,zIndexMode:f="basic"}={})=>{const g=new Map,x=new Map,w=new Map,N=new Map,p=r??t??[],v=n??e??[],y=h??[0,0],S=d??$o;D0(w,N,p);const b=Vc(v,g,x,{nodeOrigin:y,nodeExtent:S,zIndexMode:f});let C=[0,0,1];if(i&&s&&o){const j=ti(g,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:P,y:I,zoom:$}=xf(j,s,o,u,c,(l==null?void 0:l.padding)??.1);C=[P,I,$]}return{rfId:"1",width:s??0,height:o??0,transform:C,nodes:v,nodesInitialized:b,nodeLookup:g,parentLookup:x,edges:p,edgeLookup:N,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:c,translateExtent:$o,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ys.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:i??!1,fitViewOptions:l,fitViewResolver:null,connection:{...v0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:H3,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:y0,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},VP=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:u,maxZoom:c,nodeOrigin:h,nodeExtent:d,zIndexMode:f})=>o5((g,x)=>{async function w(){const{nodeLookup:N,panZoom:p,fitViewOptions:v,fitViewResolver:y,width:S,height:b,minZoom:C,maxZoom:j}=x();p&&(await O3({nodes:N,width:S,height:b,panZoom:p,minZoom:C,maxZoom:j},v),y==null||y.resolve(!0),g({fitViewResolver:null}))}return{...gp({nodes:e,edges:t,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:u,maxZoom:c,nodeOrigin:h,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:N=>{const{nodeLookup:p,parentLookup:v,nodeOrigin:y,elevateNodesOnSelect:S,fitViewQueued:b,zIndexMode:C}=x(),j=Vc(N,p,v,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:S,checkEquality:!0,zIndexMode:C});b&&j?(w(),g({nodes:N,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0})):g({nodes:N,nodesInitialized:j})},setEdges:N=>{const{connectionLookup:p,edgeLookup:v}=x();D0(p,v,N),g({edges:N})},setDefaultNodesAndEdges:(N,p)=>{if(N){const{setNodes:v}=x();v(N),g({hasDefaultNodes:!0})}if(p){const{setEdges:v}=x();v(p),g({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:p,nodeLookup:v,parentLookup:y,domNode:S,nodeOrigin:b,nodeExtent:C,debug:j,fitViewQueued:P,zIndexMode:I}=x(),{changes:$,updatedInternals:R}=u4(N,v,y,S,b,C,I);R&&(o4(v,y,{nodeOrigin:b,nodeExtent:C,zIndexMode:I}),P?(w(),g({fitViewQueued:!1,fitViewOptions:void 0})):g({}),($==null?void 0:$.length)>0&&(j&&console.log("React Flow: trigger node changes",$),p==null||p($)))},updateNodePositions:(N,p=!1)=>{const v=[];let y=[];const{nodeLookup:S,triggerNodeChanges:b,connection:C,updateConnection:j,onNodesChangeMiddlewareMap:P}=x();for(const[I,$]of N){const R=S.get(I),T=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&($!=null&&$.position)),D={id:I,type:"position",position:T?{x:Math.max(0,$.position.x),y:Math.max(0,$.position.y)}:$.position,dragging:p};if(R&&C.inProgress&&C.fromNode.id===R.id){const E=Cr(R,C.fromHandle,Q.Left,!0);j({...C,from:E})}T&&R.parentId&&v.push({id:I,parentId:R.parentId,rect:{...$.internals.positionAbsolute,width:$.measured.width??0,height:$.measured.height??0}}),y.push(D)}if(v.length>0){const{parentLookup:I,nodeOrigin:$}=x(),R=bf(v,S,I,$);y.push(...R)}for(const I of P.values())y=I(y);b(y)},triggerNodeChanges:N=>{const{onNodesChange:p,setNodes:v,nodes:y,hasDefaultNodes:S,debug:b}=x();if(N!=null&&N.length){if(S){const C=C5(N,y);v(C)}b&&console.log("React Flow: trigger node changes",N),p==null||p(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:p,setEdges:v,edges:y,hasDefaultEdges:S,debug:b}=x();if(N!=null&&N.length){if(S){const C=E5(N,y);v(C)}b&&console.log("React Flow: trigger edge changes",N),p==null||p(N)}},addSelectedNodes:N=>{const{multiSelectionActive:p,edgeLookup:v,nodeLookup:y,triggerNodeChanges:S,triggerEdgeChanges:b}=x();if(p){const C=N.map(j=>ir(j,!0));S(C);return}S(qr(y,new Set([...N]),!0)),b(qr(v))},addSelectedEdges:N=>{const{multiSelectionActive:p,edgeLookup:v,nodeLookup:y,triggerNodeChanges:S,triggerEdgeChanges:b}=x();if(p){const C=N.map(j=>ir(j,!0));b(C);return}b(qr(v,new Set([...N]))),S(qr(y,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:p}={})=>{const{edges:v,nodes:y,nodeLookup:S,triggerNodeChanges:b,triggerEdgeChanges:C}=x(),j=N||y,P=p||v,I=j.map(R=>{const T=S.get(R.id);return T&&(T.selected=!1),ir(R.id,!1)}),$=P.map(R=>ir(R.id,!1));b(I),C($)},setMinZoom:N=>{const{panZoom:p,maxZoom:v}=x();p==null||p.setScaleExtent([N,v]),g({minZoom:N})},setMaxZoom:N=>{const{panZoom:p,minZoom:v}=x();p==null||p.setScaleExtent([v,N]),g({maxZoom:N})},setTranslateExtent:N=>{var p;(p=x().panZoom)==null||p.setTranslateExtent(N),g({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:p,triggerNodeChanges:v,triggerEdgeChanges:y,elementsSelectable:S}=x();if(!S)return;const b=p.reduce((j,P)=>P.selected?[...j,ir(P.id,!1)]:j,[]),C=N.reduce((j,P)=>P.selected?[...j,ir(P.id,!1)]:j,[]);v(b),y(C)},setNodeExtent:N=>{const{nodes:p,nodeLookup:v,parentLookup:y,nodeOrigin:S,elevateNodesOnSelect:b,nodeExtent:C,zIndexMode:j}=x();N[0][0]===C[0][0]&&N[0][1]===C[0][1]&&N[1][0]===C[1][0]&&N[1][1]===C[1][1]||(Vc(p,v,y,{nodeOrigin:S,nodeExtent:N,elevateNodesOnSelect:b,checkEquality:!1,zIndexMode:j}),g({nodeExtent:N}))},panBy:N=>{const{transform:p,width:v,height:y,panZoom:S,translateExtent:b}=x();return c4({delta:N,panZoom:S,transform:p,translateExtent:b,width:v,height:y})},setCenter:async(N,p,v)=>{const{width:y,height:S,maxZoom:b,panZoom:C}=x();if(!C)return Promise.resolve(!1);const j=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:b;return await C.setViewport({x:y/2-N*j,y:S/2-p*j,zoom:j},{duration:v==null?void 0:v.duration,ease:v==null?void 0:v.ease,interpolate:v==null?void 0:v.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{g({connection:{...v0}})},updateConnection:N=>{g({connection:N})},reset:()=>g({...gp()})}},Object.is);function UP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,initialMinZoom:i,initialMaxZoom:l,initialFitViewOptions:u,fitView:c,nodeOrigin:h,nodeExtent:d,zIndexMode:f,children:g}){const[x]=m.useState(()=>VP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:c,minZoom:i,maxZoom:l,fitViewOptions:u,nodeOrigin:h,nodeExtent:d,zIndexMode:f}));return a.jsx(i5,{value:x,children:a.jsx(I5,{children:g})})}function WP({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:i,fitView:l,fitViewOptions:u,minZoom:c,maxZoom:h,nodeOrigin:d,nodeExtent:f,zIndexMode:g}){return m.useContext(Pl)?a.jsx(a.Fragment,{children:e}):a.jsx(UP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:i,fitView:l,initialFitViewOptions:u,initialMinZoom:c,initialMaxZoom:h,nodeOrigin:d,nodeExtent:f,zIndexMode:g,children:e})}const KP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function GP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:i,onNodeClick:l,onEdgeClick:u,onInit:c,onMove:h,onMoveStart:d,onMoveEnd:f,onConnect:g,onConnectStart:x,onConnectEnd:w,onClickConnectStart:N,onClickConnectEnd:p,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:S,onNodeContextMenu:b,onNodeDoubleClick:C,onNodeDragStart:j,onNodeDrag:P,onNodeDragStop:I,onNodesDelete:$,onEdgesDelete:R,onDelete:T,onSelectionChange:D,onSelectionDragStart:E,onSelectionDrag:L,onSelectionDragStop:k,onSelectionContextMenu:z,onSelectionStart:_,onSelectionEnd:M,onBeforeDelete:A,connectionMode:F,connectionLineType:O=Rn.Bezier,connectionLineStyle:U,connectionLineComponent:V,connectionLineContainerStyle:G,deleteKeyCode:Y="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:B=!1,selectionMode:q=Oo.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:te=Ho()?"Meta":"Control",zoomActivationKeyCode:ee=Ho()?"Meta":"Control",snapToGrid:J,snapGrid:ue,onlyRenderVisibleElements:me=!1,selectNodesOnDrag:le,nodesDraggable:Ue,autoPanOnNodeFocus:Nn,nodesConnectable:rn,nodesFocusable:rr,nodeOrigin:Rs=ev,edgesFocusable:Ts,edgesReconnectable:Ls,elementsSelectable:Al=!0,defaultViewport:si=v5,minZoom:Rr=.5,maxZoom:As=2,translateExtent:Mf=$o,preventScrolling:Xv=!0,nodeExtent:zl,defaultMarkerColor:Qv="#b1b1b7",zoomOnScroll:qv=!0,zoomOnPinch:Zv=!0,panOnScroll:Jv=!1,panOnScrollSpeed:e1=.5,panOnScrollMode:t1=pr.Free,zoomOnDoubleClick:n1=!0,panOnDrag:r1=!0,onPaneClick:s1,onPaneMouseEnter:o1,onPaneMouseMove:i1,onPaneMouseLeave:a1,onPaneScroll:l1,onPaneContextMenu:u1,paneClickDistance:c1=1,nodeClickDistance:d1=0,children:f1,onReconnect:h1,onReconnectStart:m1,onReconnectEnd:p1,onEdgeContextMenu:g1,onEdgeDoubleClick:x1,onEdgeMouseEnter:y1,onEdgeMouseMove:v1,onEdgeMouseLeave:w1,reconnectRadius:N1=10,onNodesChange:S1,onEdgesChange:b1,noDragClassName:j1="nodrag",noWheelClassName:k1="nowheel",noPanClassName:If="nopan",fitView:Rf,fitViewOptions:Tf,connectOnClick:C1,attributionPosition:E1,proOptions:_1,defaultEdgeOptions:P1,elevateNodesOnSelect:M1=!0,elevateEdgesOnSelect:I1=!1,disableKeyboardA11y:Lf=!1,autoPanOnConnect:R1,autoPanOnNodeDrag:T1,autoPanSpeed:L1,connectionRadius:A1,isValidConnection:z1,onError:D1,style:$1,id:Af,nodeDragThreshold:O1,connectionDragThreshold:F1,viewport:H1,onViewportChange:B1,width:V1,height:U1,colorMode:W1="light",debug:K1,onScroll:oi,ariaLabelConfig:G1,zIndexMode:zf="basic",...Y1},X1){const Dl=Af||"1",Q1=b5(W1),q1=m.useCallback(Df=>{Df.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),oi==null||oi(Df)},[oi]);return a.jsx("div",{"data-testid":"rf__wrapper",...Y1,onScroll:q1,style:{...$1,...KP},ref:X1,className:Le(["react-flow",s,Q1]),id:Af,role:"application",children:a.jsxs(WP,{nodes:e,edges:t,width:V1,height:U1,fitView:Rf,fitViewOptions:Tf,minZoom:Rr,maxZoom:As,nodeOrigin:Rs,nodeExtent:zl,zIndexMode:zf,children:[a.jsx(BP,{onInit:c,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:S,onNodeContextMenu:b,onNodeDoubleClick:C,nodeTypes:o,edgeTypes:i,connectionLineType:O,connectionLineStyle:U,connectionLineComponent:V,connectionLineContainerStyle:G,selectionKeyCode:X,selectionOnDrag:B,selectionMode:q,deleteKeyCode:Y,multiSelectionKeyCode:te,panActivationKeyCode:se,zoomActivationKeyCode:ee,onlyRenderVisibleElements:me,defaultViewport:si,translateExtent:Mf,minZoom:Rr,maxZoom:As,preventScrolling:Xv,zoomOnScroll:qv,zoomOnPinch:Zv,zoomOnDoubleClick:n1,panOnScroll:Jv,panOnScrollSpeed:e1,panOnScrollMode:t1,panOnDrag:r1,onPaneClick:s1,onPaneMouseEnter:o1,onPaneMouseMove:i1,onPaneMouseLeave:a1,onPaneScroll:l1,onPaneContextMenu:u1,paneClickDistance:c1,nodeClickDistance:d1,onSelectionContextMenu:z,onSelectionStart:_,onSelectionEnd:M,onReconnect:h1,onReconnectStart:m1,onReconnectEnd:p1,onEdgeContextMenu:g1,onEdgeDoubleClick:x1,onEdgeMouseEnter:y1,onEdgeMouseMove:v1,onEdgeMouseLeave:w1,reconnectRadius:N1,defaultMarkerColor:Qv,noDragClassName:j1,noWheelClassName:k1,noPanClassName:If,rfId:Dl,disableKeyboardA11y:Lf,nodeExtent:zl,viewport:H1,onViewportChange:B1}),a.jsx(S5,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:x,onConnectEnd:w,onClickConnectStart:N,onClickConnectEnd:p,nodesDraggable:Ue,autoPanOnNodeFocus:Nn,nodesConnectable:rn,nodesFocusable:rr,edgesFocusable:Ts,edgesReconnectable:Ls,elementsSelectable:Al,elevateNodesOnSelect:M1,elevateEdgesOnSelect:I1,minZoom:Rr,maxZoom:As,nodeExtent:zl,onNodesChange:S1,onEdgesChange:b1,snapToGrid:J,snapGrid:ue,connectionMode:F,translateExtent:Mf,connectOnClick:C1,defaultEdgeOptions:P1,fitView:Rf,fitViewOptions:Tf,onNodesDelete:$,onEdgesDelete:R,onDelete:T,onNodeDragStart:j,onNodeDrag:P,onNodeDragStop:I,onSelectionDrag:L,onSelectionDragStart:E,onSelectionDragStop:k,onMove:h,onMoveStart:d,onMoveEnd:f,noPanClassName:If,nodeOrigin:Rs,rfId:Dl,autoPanOnConnect:R1,autoPanOnNodeDrag:T1,autoPanSpeed:L1,onError:D1,connectionRadius:A1,isValidConnection:z1,selectNodesOnDrag:le,nodeDragThreshold:O1,connectionDragThreshold:F1,onBeforeDelete:A,debug:K1,ariaLabelConfig:G1,zIndexMode:zf}),a.jsx(y5,{onSelectionChange:D}),f1,a.jsx(h5,{proOptions:_1,position:E1}),a.jsx(f5,{rfId:Dl,disableKeyboardA11y:Lf})]})})}var YP=nv(GP);function XP({dimensions:e,lineWidth:t,variant:n,className:r}){return a.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Le(["react-flow__background-pattern",n,r])})}function QP({radius:e,className:t}){return a.jsx("circle",{cx:e,cy:e,r:e,className:Le(["react-flow__background-pattern","dots",t])})}var Vn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Vn||(Vn={}));const qP={[Vn.Dots]:1,[Vn.Lines]:1,[Vn.Cross]:6},ZP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Cv({id:e,variant:t=Vn.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:i,bgColor:l,style:u,className:c,patternClassName:h}){const d=m.useRef(null),{transform:f,patternId:g}=ie(ZP,Se),x=r||qP[t],w=t===Vn.Dots,N=t===Vn.Cross,p=Array.isArray(n)?n:[n,n],v=[p[0]*f[2]||1,p[1]*f[2]||1],y=x*f[2],S=Array.isArray(o)?o:[o,o],b=N?[y,y]:v,C=[S[0]*f[2]||1+b[0]/2,S[1]*f[2]||1+b[1]/2],j=`${g}${e||""}`;return a.jsxs("svg",{className:Le(["react-flow__background",c]),style:{...u,...Il,"--xy-background-color-props":l,"--xy-background-pattern-color-props":i},ref:d,"data-testid":"rf__background",children:[a.jsx("pattern",{id:j,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`,children:w?a.jsx(QP,{radius:y/2,className:h}):a.jsx(XP,{dimensions:b,lineWidth:s,variant:t,className:h})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${j})`})]})}Cv.displayName="Background";const JP=m.memo(Cv);function eM(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:a.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function tM(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:a.jsx("path",{d:"M0 0h32v4.2H0z"})})}function nM(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:a.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function rM(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function sM(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function $i({children:e,className:t,...n}){return a.jsx("button",{type:"button",className:Le(["react-flow__controls-button",t]),...n,children:e})}const oM=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Ev({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:i,onFitView:l,onInteractiveChange:u,className:c,children:h,position:d="bottom-left",orientation:f="vertical","aria-label":g}){const x=be(),{isInteractive:w,minZoomReached:N,maxZoomReached:p,ariaLabelConfig:v}=ie(oM,Se),{zoomIn:y,zoomOut:S,fitView:b}=jf(),C=()=>{y(),o==null||o()},j=()=>{S(),i==null||i()},P=()=>{b(s),l==null||l()},I=()=>{x.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),u==null||u(!w)},$=f==="horizontal"?"horizontal":"vertical";return a.jsxs(Ml,{className:Le(["react-flow__controls",$,c]),position:d,style:e,"data-testid":"rf__controls","aria-label":g??v["controls.ariaLabel"],children:[t&&a.jsxs(a.Fragment,{children:[a.jsx($i,{onClick:C,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:p,children:a.jsx(eM,{})}),a.jsx($i,{onClick:j,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:N,children:a.jsx(tM,{})})]}),n&&a.jsx($i,{className:"react-flow__controls-fitview",onClick:P,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:a.jsx(nM,{})}),r&&a.jsx($i,{className:"react-flow__controls-interactive",onClick:I,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:w?a.jsx(sM,{}):a.jsx(rM,{})}),h]})}Ev.displayName="Controls";const iM=m.memo(Ev);function aM({id:e,x:t,y:n,width:r,height:s,style:o,color:i,strokeColor:l,strokeWidth:u,className:c,borderRadius:h,shapeRendering:d,selected:f,onClick:g}){const{background:x,backgroundColor:w}=o||{},N=i||x||w;return a.jsx("rect",{className:Le(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:h,ry:h,width:r,height:s,style:{fill:N,stroke:l,strokeWidth:u},shapeRendering:d,onClick:g?p=>g(p,e):void 0})}const lM=m.memo(aM),uM=e=>e.nodes.map(t=>t.id),Pu=e=>e instanceof Function?e:()=>e;function cM({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=lM,onClick:i}){const l=ie(uM,Se),u=Pu(t),c=Pu(e),h=Pu(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(f=>a.jsx(fM,{id:f,nodeColorFunc:u,nodeStrokeColorFunc:c,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:i,shapeRendering:d},f))})}function dM({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:i,NodeComponent:l,onClick:u}){const{node:c,x:h,y:d,width:f,height:g}=ie(x=>{const{internals:w}=x.nodeLookup.get(e),N=w.userNode,{x:p,y:v}=w.positionAbsolute,{width:y,height:S}=wn(N);return{node:N,x:p,y:v,width:y,height:S}},Se);return!c||c.hidden||!C0(c)?null:a.jsx(l,{x:h,y:d,width:f,height:g,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:s,strokeColor:n(c),strokeWidth:o,shapeRendering:i,onClick:u,id:c.id})}const fM=m.memo(dM);var hM=m.memo(cM);const mM=200,pM=150,gM=e=>!e.hidden,xM=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?k0(ti(e.nodeLookup,{filter:gM}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},yM="react-flow__minimap-desc";function _v({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:i,nodeComponent:l,bgColor:u,maskColor:c,maskStrokeColor:h,maskStrokeWidth:d,position:f="bottom-right",onClick:g,onNodeClick:x,pannable:w=!1,zoomable:N=!1,ariaLabel:p,inversePan:v,zoomStep:y=1,offsetScale:S=5}){const b=be(),C=m.useRef(null),{boundingRect:j,viewBB:P,rfId:I,panZoom:$,translateExtent:R,flowWidth:T,flowHeight:D,ariaLabelConfig:E}=ie(xM,Se),L=(e==null?void 0:e.width)??mM,k=(e==null?void 0:e.height)??pM,z=j.width/L,_=j.height/k,M=Math.max(z,_),A=M*L,F=M*k,O=S*M,U=j.x-(A-j.width)/2-O,V=j.y-(F-j.height)/2-O,G=A+O*2,Y=F+O*2,X=`${yM}-${I}`,B=m.useRef(0),q=m.useRef();B.current=M,m.useEffect(()=>{if(C.current&&$)return q.current=v4({domNode:C.current,panZoom:$,getTransform:()=>b.getState().transform,getViewScale:()=>B.current}),()=>{var J;(J=q.current)==null||J.destroy()}},[$]),m.useEffect(()=>{var J;(J=q.current)==null||J.update({translateExtent:R,width:T,height:D,inversePan:v,pannable:w,zoomStep:y,zoomable:N})},[w,N,v,y,R,T,D]);const se=g?J=>{var le;const[ue,me]=((le=q.current)==null?void 0:le.pointer(J))||[0,0];g(J,{x:ue,y:me})}:void 0,te=x?m.useCallback((J,ue)=>{const me=b.getState().nodeLookup.get(ue).internals.userNode;x(J,me)},[]):void 0,ee=p??E["minimap.ariaLabel"];return a.jsx(Ml,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*M:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof i=="number"?i:void 0},className:Le(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:L,height:k,viewBox:`${U} ${V} ${G} ${Y}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:C,onClick:se,children:[ee&&a.jsx("title",{id:X,children:ee}),a.jsx(hM,{onClick:te,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:i,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-O},${V-O}h${G+O*2}v${Y+O*2}h${-G-O*2}z
392
+ M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}_v.displayName="MiniMap";m.memo(_v);const vM=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,wM={[Ss.Line]:"right",[Ss.Handle]:"bottom-right"};function NM({nodeId:e,position:t,variant:n=Ss.Handle,className:r,style:s=void 0,children:o,color:i,minWidth:l=10,minHeight:u=10,maxWidth:c=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:g=!0,shouldResize:x,onResizeStart:w,onResize:N,onResizeEnd:p}){const v=iv(),y=typeof e=="string"?e:v,S=be(),b=m.useRef(null),C=n===Ss.Handle,j=ie(m.useCallback(vM(C&&g),[C,g]),Se),P=m.useRef(null),I=t??wM[n];m.useEffect(()=>{if(!(!b.current||!y))return P.current||(P.current=T4({domNode:b.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:R,transform:T,snapGrid:D,snapToGrid:E,nodeOrigin:L,domNode:k}=S.getState();return{nodeLookup:R,transform:T,snapGrid:D,snapToGrid:E,nodeOrigin:L,paneDomNode:k}},onChange:(R,T)=>{const{triggerNodeChanges:D,nodeLookup:E,parentLookup:L,nodeOrigin:k}=S.getState(),z=[],_={x:R.x,y:R.y},M=E.get(y);if(M&&M.expandParent&&M.parentId){const A=M.origin??k,F=R.width??M.measured.width??0,O=R.height??M.measured.height??0,U={id:M.id,parentId:M.parentId,rect:{width:F,height:O,...E0({x:R.x??M.position.x,y:R.y??M.position.y},{width:F,height:O},M.parentId,E,A)}},V=bf([U],E,L,k);z.push(...V),_.x=R.x?Math.max(A[0]*F,R.x):void 0,_.y=R.y?Math.max(A[1]*O,R.y):void 0}if(_.x!==void 0&&_.y!==void 0){const A={id:y,type:"position",position:{..._}};z.push(A)}if(R.width!==void 0&&R.height!==void 0){const F={id:y,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};z.push(F)}for(const A of T){const F={...A,type:"position"};z.push(F)}D(z)},onEnd:({width:R,height:T})=>{const D={id:y,type:"dimensions",resizing:!1,dimensions:{width:R,height:T}};S.getState().triggerNodeChanges([D])}})),P.current.update({controlPosition:I,boundaries:{minWidth:l,minHeight:u,maxWidth:c,maxHeight:h},keepAspectRatio:d,resizeDirection:f,onResizeStart:w,onResize:N,onResizeEnd:p,shouldResize:x}),()=>{var R;(R=P.current)==null||R.destroy()}},[I,l,u,c,h,d,w,N,p,x]);const $=I.split("-");return a.jsx("div",{className:Le(["react-flow__resize-control","nodrag",...$,n,r]),ref:b,style:{...s,scale:j,...i&&{[C?"backgroundColor":"borderColor"]:i}},children:o})}m.memo(NM);function SM(){const[e,t]=m.useState(()=>document.documentElement.classList.contains("dark"));return m.useEffect(()=>{const n=new MutationObserver(()=>t(document.documentElement.classList.contains("dark")));return n.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>n.disconnect()},[]),e}function bM(){const[e,t]=m.useState([]),[n,r]=m.useState([]),[s,o]=m.useState(!0),i=SM();m.useEffect(()=>{Promise.all([re.discovery.agents(),re.observations.permissions()]).then(([c,h])=>{t(c.data??[]),r(h.data??[]),o(!1)}).catch(()=>o(!1))},[]);const{nodes:l,edges:u}=m.useMemo(()=>{const c=[],h=[],d=new Set,f=new Map,g=i?{background:"#18181b",color:"#fafafa",border:"1px solid #3f3f46"}:{background:"#ffffff",color:"#09090b",border:"1px solid #e4e4e7"},x=i?{background:"#09090b",color:"#a1a1aa",border:"1px solid #3f3f46"}:{background:"#f4f4f5",color:"#52525b",border:"1px solid #d4d4d8"},w=i?"#52525b":"#a1a1aa",N=i?"#27272a":"#e4e4e7";return e.forEach((p,v)=>{const y=`agent-${p.id}`;p.registeredAgentId&&f.set(p.registeredAgentId,y),f.set(p.id,y),c.push({id:y,position:{x:100,y:v*120},data:{label:`${p.emoji||"🤖"} ${p.name}`},style:{...g,borderRadius:"8px",padding:"8px 16px",fontSize:"13px"}})}),n.forEach(p=>{const v=`tool-${p.toolName}`;d.has(p.toolName)||(d.add(p.toolName),c.push({id:v,position:{x:400,y:d.size*80},data:{label:`🔧 ${p.toolName}`},style:{...x,borderRadius:"8px",padding:"6px 12px",fontSize:"12px"}}));const y=f.get(p.agentId)??`agent-${p.agentId}`;h.push({id:`e-${p.agentId}-${p.toolName}`,source:y,target:v,animated:p.accessPattern==="write",style:{stroke:p.accessPattern==="write"?"#eab308":w}})}),{nodes:c,edges:h,bgColor:N}},[e,n,i]);return s?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Identity Graph"}),a.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Agent-to-tool relationship visualization"})]}),a.jsx("div",{className:"h-[600px] rounded-lg border border-border bg-card",children:a.jsxs(YP,{nodes:l,edges:u,fitView:!0,proOptions:{hideAttribution:!0},children:[a.jsx(JP,{color:i?"#27272a":"#e4e4e7",gap:20}),a.jsx(iM,{})]})})]})}const Cf=m.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:Pe("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Cf.displayName="Textarea";function jM(e){const t=e+"CollectionProvider",[n,r]=yl(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:x,children:w}=g,N=Ut.useRef(null),p=Ut.useRef(new Map).current;return a.jsx(s,{scope:x,itemMap:p,collectionRef:N,children:w})};i.displayName=t;const l=e+"CollectionSlot",u=Ut.forwardRef((g,x)=>{const{scope:w,children:N}=g,p=o(l,w),v=Jt(x,p.collectionRef);return a.jsx(ps,{ref:v,children:N})});u.displayName=l;const c=e+"CollectionItemSlot",h="data-radix-collection-item",d=Ut.forwardRef((g,x)=>{const{scope:w,children:N,...p}=g,v=Ut.useRef(null),y=Jt(x,v),S=o(c,w);return Ut.useEffect(()=>(S.itemMap.set(v,{ref:v,...p}),()=>void S.itemMap.delete(v))),a.jsx(ps,{[h]:"",ref:y,children:N})});d.displayName=c;function f(g){const x=o(e+"CollectionConsumer",g);return Ut.useCallback(()=>{const N=x.collectionRef.current;if(!N)return[];const p=Array.from(N.querySelectorAll(`[${h}]`));return Array.from(x.itemMap.values()).sort((S,b)=>p.indexOf(S.ref.current)-p.indexOf(b.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:i,Slot:u,ItemSlot:d},f,r]}var kM=m.createContext(void 0);function Pv(e){const t=m.useContext(kM);return e||t||"ltr"}var Mu="rovingFocusGroup.onEntryFocus",CM={bubbles:!1,cancelable:!0},Tl="RovingFocusGroup",[Kc,Mv,EM]=jM(Tl),[_M,Iv]=yl(Tl,[EM]),[PM,MM]=_M(Tl),Rv=m.forwardRef((e,t)=>a.jsx(Kc.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Kc.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(IM,{...e,ref:t})})}));Rv.displayName=Tl;var IM=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:h=!1,...d}=e,f=m.useRef(null),g=Jt(t,f),x=Pv(o),[w=null,N]=tf({prop:i,defaultProp:l,onChange:u}),[p,v]=m.useState(!1),y=Qn(c),S=Mv(n),b=m.useRef(!1),[C,j]=m.useState(0);return m.useEffect(()=>{const P=f.current;if(P)return P.addEventListener(Mu,y),()=>P.removeEventListener(Mu,y)},[y]),a.jsx(PM,{scope:n,orientation:r,dir:x,loop:s,currentTabStopId:w,onItemFocus:m.useCallback(P=>N(P),[N]),onItemShiftTab:m.useCallback(()=>v(!0),[]),onFocusableItemAdd:m.useCallback(()=>j(P=>P+1),[]),onFocusableItemRemove:m.useCallback(()=>j(P=>P-1),[]),children:a.jsx(tt.div,{tabIndex:p||C===0?-1:0,"data-orientation":r,...d,ref:g,style:{outline:"none",...e.style},onMouseDown:Be(e.onMouseDown,()=>{b.current=!0}),onFocus:Be(e.onFocus,P=>{const I=!b.current;if(P.target===P.currentTarget&&I&&!p){const $=new CustomEvent(Mu,CM);if(P.currentTarget.dispatchEvent($),!$.defaultPrevented){const R=S().filter(k=>k.focusable),T=R.find(k=>k.active),D=R.find(k=>k.id===w),L=[T,D,...R].filter(Boolean).map(k=>k.ref.current);Av(L,h)}}b.current=!1}),onBlur:Be(e.onBlur,()=>v(!1))})})}),Tv="RovingFocusGroupItem",Lv=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,...i}=e,l=fo(),u=o||l,c=MM(Tv,n),h=c.currentTabStopId===u,d=Mv(n),{onFocusableItemAdd:f,onFocusableItemRemove:g}=c;return m.useEffect(()=>{if(r)return f(),()=>g()},[r,f,g]),a.jsx(Kc.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:a.jsx(tt.span,{tabIndex:h?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:Be(e.onMouseDown,x=>{r?c.onItemFocus(u):x.preventDefault()}),onFocus:Be(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:Be(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){c.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const w=LM(x,c.orientation,c.dir);if(w!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let p=d().filter(v=>v.focusable).map(v=>v.ref.current);if(w==="last")p.reverse();else if(w==="prev"||w==="next"){w==="prev"&&p.reverse();const v=p.indexOf(x.currentTarget);p=c.loop?AM(p,v+1):p.slice(v+1)}setTimeout(()=>Av(p))}})})})});Lv.displayName=Tv;var RM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function TM(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function LM(e,t,n){const r=TM(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return RM[r]}function Av(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function AM(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var zM=Rv,DM=Lv,Ef="Tabs",[$M]=yl(Ef,[Iv]),zv=Iv(),[OM,_f]=$M(Ef),Dv=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:l,activationMode:u="automatic",...c}=e,h=Pv(l),[d,f]=tf({prop:r,onChange:s,defaultProp:o});return a.jsx(OM,{scope:n,baseId:fo(),value:d,onValueChange:f,orientation:i,dir:h,activationMode:u,children:a.jsx(tt.div,{dir:h,"data-orientation":i,...c,ref:t})})});Dv.displayName=Ef;var $v="TabsList",Ov=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=_f($v,n),i=zv(n);return a.jsx(zM,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:r,children:a.jsx(tt.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});Ov.displayName=$v;var Fv="TabsTrigger",Hv=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,i=_f(Fv,n),l=zv(n),u=Uv(i.baseId,r),c=Wv(i.baseId,r),h=r===i.value;return a.jsx(DM,{asChild:!0,...l,focusable:!s,active:h,children:a.jsx(tt.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":c,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...o,ref:t,onMouseDown:Be(e.onMouseDown,d=>{!s&&d.button===0&&d.ctrlKey===!1?i.onValueChange(r):d.preventDefault()}),onKeyDown:Be(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(r)}),onFocus:Be(e.onFocus,()=>{const d=i.activationMode!=="manual";!h&&!s&&d&&i.onValueChange(r)})})})});Hv.displayName=Fv;var Bv="TabsContent",Vv=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...i}=e,l=_f(Bv,n),u=Uv(l.baseId,r),c=Wv(l.baseId,r),h=r===l.value,d=m.useRef(h);return m.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),a.jsx(qo,{present:s||h,children:({present:f})=>a.jsx(tt.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!f,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&o})})});Vv.displayName=Bv;function Uv(e,t){return`${e}-trigger-${t}`}function Wv(e,t){return`${e}-content-${t}`}var FM=Dv,Kv=Ov,Gv=Hv,Yv=Vv;const Pf=FM,Ll=m.forwardRef(({className:e,...t},n)=>a.jsx(Kv,{ref:n,className:Pe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Ll.displayName=Kv.displayName;const nt=m.forwardRef(({className:e,...t},n)=>a.jsx(Gv,{ref:n,className:Pe("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));nt.displayName=Gv.displayName;const rt=m.forwardRef(({className:e,...t},n)=>a.jsx(Yv,{ref:n,className:Pe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));rt.displayName=Yv.displayName;function HM({message:e,type:t,onClose:n}){return m.useEffect(()=>{const r=setTimeout(n,4e3);return()=>clearTimeout(r)},[n]),a.jsxs("div",{className:`fixed bottom-6 right-6 z-[100] flex items-center gap-2 rounded-lg border px-4 py-3 shadow-lg transition-all animate-in slide-in-from-bottom-4 ${t==="success"?"border-emerald-500/30 bg-emerald-50 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200":"border-destructive/30 bg-red-50 text-red-800 dark:bg-red-950 dark:text-red-200"}`,children:[t==="success"?a.jsx(Yn,{className:"h-4 w-4"}):a.jsx(pt,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:e}),a.jsx("button",{onClick:n,className:"ml-2 text-current/50 hover:text-current",children:"×"})]})}function BM(){const[e,t]=m.useState([]),[n,r]=m.useState(""),[s,o]=m.useState(!0),[i,l]=m.useState("skills"),[u,c]=m.useState(null),h=m.useRef(null),d=m.useCallback((x,w="success")=>{c({message:x,type:w})},[]),f=m.useCallback(()=>{d("Command sent to host"),l("commands"),setTimeout(()=>{var x;return(x=h.current)==null?void 0:x.call(h)},300)},[d]),g=m.useCallback(x=>{const w=x instanceof Error?x.message:"Failed to send command";d(w,"error")},[d]);return m.useEffect(()=>{re.hosts.list().then(x=>{const w=(x.data??[]).filter(N=>N.status==="online");t(w),w.length>0&&!n&&r(w[0].id)}).catch(()=>{}).finally(()=>o(!1))},[]),s?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading hosts..."}):e.length===0?a.jsxs("div",{className:"space-y-6",children:[a.jsx("h1",{className:"text-lg font-semibold",children:"Operations"}),a.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[a.jsx(Qo,{className:"h-10 w-10 text-muted-foreground/30"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No hosts connected"}),a.jsxs("p",{className:"text-xs text-muted-foreground/70",children:["Run ",a.jsx("code",{className:"rounded bg-muted px-1",children:"opentrust connect --dashboard-url ... --api-key ..."})," on a host"]})]})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-lg font-semibold",children:"Operations"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-muted-foreground",children:"Host:"}),a.jsx("select",{className:"h-8 rounded-md border border-input bg-background px-2 text-sm focus:outline-none focus:ring-1 focus:ring-ring",value:n,onChange:x=>r(x.target.value),children:e.map(x=>a.jsxs("option",{value:x.id,children:[x.hostname," (",x.ip||"local",")"]},x.id))})]})]}),n&&a.jsxs(Pf,{value:i,onValueChange:l,className:"w-full",children:[a.jsxs(Ll,{children:[a.jsxs(nt,{value:"skills",children:[a.jsx(Nr,{className:"mr-1.5 h-3.5 w-3.5"})," Skills"]}),a.jsxs(nt,{value:"commands",children:[a.jsx(ms,{className:"mr-1.5 h-3.5 w-3.5"})," Commands"]}),a.jsxs(nt,{value:"config",children:[a.jsx(qt,{className:"mr-1.5 h-3.5 w-3.5"})," Config"]})]}),a.jsx(rt,{value:"skills",children:a.jsx(VM,{hostId:n,onCommandSent:f,onCommandError:g})}),a.jsx(rt,{value:"commands",children:a.jsx(UM,{hostId:n,refreshRef:h})}),a.jsx(rt,{value:"config",children:a.jsx(WM,{hostId:n,onCommandSent:f,onCommandError:g})})]}),u&&a.jsx(HM,{message:u.message,type:u.type,onClose:()=>c(null)})]})}function VM({hostId:e,onCommandSent:t,onCommandError:n}){const[r,s]=m.useState(!1),[o,i]=m.useState(null),[l,u]=m.useState([]);m.useEffect(()=>{re.hosts.agents(e).then(h=>u(h.data??[])).catch(()=>u([]))},[e]);const c=l.flatMap(h=>((h.metadata??{}).skills??[]).map(f=>({...f,agentName:h.name})));return a.jsxs("div",{className:"space-y-4 pt-4",children:[a.jsx("div",{className:"flex gap-2",children:a.jsxs(K,{size:"sm",onClick:()=>s(!0),children:[a.jsx($t,{className:"mr-1.5 h-3.5 w-3.5"})," Install Skill"]})}),c.length>0&&a.jsxs(he,{children:[a.jsx(Ie,{children:a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Nr,{className:"h-4 w-4"})," Installed Skills (",c.length,")"]})}),a.jsx(we,{children:a.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:c.map((h,d)=>a.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border p-3 transition-colors hover:bg-muted/30",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-muted",children:a.jsx(Nr,{className:"h-4 w-4 text-muted-foreground"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:h.name}),h.description&&a.jsx("p",{className:"text-[11px] text-muted-foreground line-clamp-1",children:h.description}),l.length>1&&a.jsx("p",{className:"text-[10px] text-muted-foreground/60",children:h.agentName})]})]}),a.jsx(K,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>i(h.name),children:a.jsx(Zt,{className:"h-3.5 w-3.5"})})]},`${h.name}-${d}`))})})]}),l.length>0&&a.jsxs(he,{children:[a.jsx(Ie,{children:a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Qo,{className:"h-4 w-4"})," Agents on this Host (",l.length,")"]})}),a.jsx(we,{children:a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:l.map(h=>{const d=h.metadata??{};return a.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg border border-border p-3",children:[a.jsx("span",{className:"text-lg",children:d.emoji||"🤖"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:h.name}),a.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[(d.skills??[]).length," skills · ",h.status]})]})]},h.id)})})})]}),a.jsxs(he,{children:[a.jsx(Ie,{children:a.jsx(Re,{className:"text-sm",children:"How Skills Work"})}),a.jsxs(we,{className:"text-xs text-muted-foreground space-y-2",children:[a.jsxs("p",{children:["Skills are ",a.jsx("a",{href:"https://agentskills.io",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"AgentSkills"}),"-compatible folders containing a ",a.jsx("code",{className:"rounded bg-muted px-1",children:"SKILL.md"})," with YAML frontmatter and instructions."]}),a.jsxs("p",{children:["Browse and discover skills at ",a.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"clawhub.com"}),". Commands are executed by the CLI on the selected host via ",a.jsx("code",{className:"rounded bg-muted px-1",children:"clawhub install <slug>"}),"."]})]})]}),a.jsx(KM,{open:r,onOpenChange:s,hostId:e,onSuccess:t,onError:n}),a.jsx(GM,{open:o!==null,onOpenChange:h=>{h||i(null)},hostId:e,initialName:o??"",onSuccess:t,onError:n})]})}function UM({hostId:e,refreshRef:t}){const[n,r]=m.useState([]),[s,o]=m.useState(!0),[i,l]=m.useState(null),u=m.useCallback(()=>{re.hosts.commands(e).then(f=>r(f.data??[])).catch(()=>{}).finally(()=>o(!1))},[e]);m.useEffect(()=>(t&&(t.current=u),()=>{t&&(t.current=null)}),[u,t]),m.useEffect(()=>{u()},[u]),m.useEffect(()=>{if(!n.some(x=>x.status==="pending"||x.status==="running"))return;const g=setInterval(u,5e3);return()=>clearInterval(g)},[n,u]);const c=f=>f==="completed"?a.jsx(Yn,{className:"h-3.5 w-3.5 text-emerald-500"}):f==="failed"?a.jsx(pt,{className:"h-3.5 w-3.5 text-destructive"}):f==="running"?a.jsx(He,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):a.jsx(Zd,{className:"h-3.5 w-3.5 text-muted-foreground"}),h=f=>f==="completed"?"success":f==="failed"?"destructive":f==="running"?"warning":"secondary",d=f=>({install_skill:{icon:a.jsx($t,{className:"h-3 w-3"}),label:"Install Skill"},install_custom_skill:{icon:a.jsx(Is,{className:"h-3 w-3"}),label:"Custom Skill"},uninstall_skill:{icon:a.jsx(Zt,{className:"h-3 w-3"}),label:"Uninstall Skill"},install_plugin:{icon:a.jsx($t,{className:"h-3 w-3"}),label:"Install Plugin"},uninstall_plugin:{icon:a.jsx(Zt,{className:"h-3 w-3"}),label:"Uninstall Plugin"},update_config:{icon:a.jsx(qt,{className:"h-3 w-3"}),label:"Update Config"}})[f]??{icon:a.jsx(ms,{className:"h-3 w-3"}),label:f};return s?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-4 pt-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Command history for this host"}),a.jsxs(K,{size:"sm",variant:"ghost",onClick:u,children:[a.jsx(Xn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]}),n.length===0?a.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[a.jsx(ms,{className:"h-8 w-8 text-muted-foreground/30"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No commands sent yet"})]}):a.jsx("div",{className:"space-y-2",children:n.map(f=>{var N,p,v;const g=d(f.type),x=i===f.id,w=f.result||f.type==="install_custom_skill"&&((N=f.payload)==null?void 0:N.content);return a.jsxs("div",{className:"rounded-lg border border-border transition-colors hover:bg-muted/20",children:[a.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-4 py-3",onClick:()=>w&&l(x?null:f.id),children:[c(f.status),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[g.icon," ",a.jsx("span",{children:g.label})]}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[((p=f.payload)==null?void 0:p.skillName)&&`"${f.payload.skillName}"`,f.type==="update_config"&&f.payload&&!f.payload.skillName&&Object.keys(f.payload).join(", ")]}),a.jsx("div",{className:"flex-1"}),a.jsx(ye,{variant:h(f.status),className:"text-[10px]",children:f.status}),a.jsx("span",{className:"text-[11px] text-muted-foreground",children:XM(f.createdAt)}),w&&(x?a.jsx(pl,{className:"h-3.5 w-3.5 text-muted-foreground"}):a.jsx(qd,{className:"h-3.5 w-3.5 text-muted-foreground"}))]}),x&&w&&a.jsxs("div",{className:"border-t border-border bg-muted/30 px-4 py-3 text-xs",children:[f.result&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"font-medium text-muted-foreground",children:"Result"}),a.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded-md bg-background p-2.5 font-mono text-[11px] text-muted-foreground",children:typeof f.result=="string"?f.result:JSON.stringify(f.result,null,2)})]}),f.type==="install_custom_skill"&&((v=f.payload)==null?void 0:v.content)&&a.jsxs("div",{className:"mt-2 space-y-1",children:[a.jsx("p",{className:"font-medium text-muted-foreground",children:"Skill Content"}),a.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded-md bg-background p-2.5 font-mono text-[11px] text-muted-foreground",children:f.payload.content})]})]})]},f.id)})})]})}function WM({hostId:e,onCommandSent:t,onCommandError:n}){const[r,s]=m.useState(!1);return a.jsxs("div",{className:"space-y-4 pt-4",children:[a.jsxs(he,{children:[a.jsx(Ie,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(qt,{className:"h-4 w-4"})," Guards Configuration"]}),a.jsxs(K,{size:"sm",variant:"outline",onClick:()=>s(!0),children:[a.jsx(qt,{className:"mr-1.5 h-3.5 w-3.5"})," Update Config"]})]})}),a.jsxs(we,{className:"text-xs text-muted-foreground space-y-3",children:[a.jsxs("p",{children:["Send configuration updates to the Guards plugin on the host. The CLI updates ",a.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/openclaw.json"})," on the target machine."]}),a.jsxs("div",{className:"rounded-md bg-muted p-3 space-y-1.5",children:[a.jsx("p",{className:"font-medium text-foreground text-xs",children:"Available settings:"}),a.jsxs("div",{className:"grid gap-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"blockOnRisk"}),a.jsx("span",{children:"Block tool calls when risk is detected"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"logLevel"}),a.jsx("span",{children:"Logging verbosity (debug, info, warn, error)"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"timeoutMs"}),a.jsx("span",{children:"Request timeout in milliseconds"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"enabled"}),a.jsx("span",{children:"Enable/disable the Guards plugin"})]})]})]})]})]}),a.jsx(YM,{open:r,onOpenChange:s,hostId:e,onSuccess:t,onError:n})]})}function KM({open:e,onOpenChange:t,hostId:n,onSuccess:r,onError:s}){const[o,i]=m.useState("registry"),[l,u]=m.useState(""),[c,h]=m.useState(""),[d,f]=m.useState(!1),[g,x]=m.useState(""),w=()=>{u(""),h(""),i("registry"),x("")},N=async()=>{if(!(o==="registry"&&!l.trim())&&!(o==="custom"&&(!l.trim()||!c.trim()))){f(!0),x("");try{o==="registry"?await re.hosts.sendCommand(n,"install_skill",{skillName:l.trim()}):await re.hosts.sendCommand(n,"install_custom_skill",{skillName:l.trim(),content:c}),w(),t(!1),r==null||r()}catch(p){const v=p instanceof Error?p.message:"Failed to send command";x(v),s==null||s(p)}finally{f(!1)}}};return a.jsx(Pr,{open:e,onOpenChange:p=>{p||w(),t(p)},children:a.jsxs(er,{className:"sm:max-w-[560px]",children:[a.jsxs(Mr,{children:[a.jsxs(tr,{className:"flex items-center gap-2",children:[a.jsx($t,{className:"h-4 w-4"})," Install Skill"]}),a.jsxs(nr,{children:["Install from ",a.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"ClawHub"})," registry or provide custom SKILL.md content."]})]}),a.jsxs(Pf,{value:o,onValueChange:p=>{i(p),x("")},children:[a.jsxs(Ll,{className:"w-full",children:[a.jsxs(nt,{value:"registry",className:"flex-1",children:[a.jsx(Nr,{className:"mr-1.5 h-3.5 w-3.5"})," ClawHub Registry"]}),a.jsxs(nt,{value:"custom",className:"flex-1",children:[a.jsx(Is,{className:"mr-1.5 h-3.5 w-3.5"})," Custom SKILL.md"]})]}),a.jsx(rt,{value:"registry",className:"space-y-4 pt-2",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx(Xe,{htmlFor:"reg-skill-name",children:"Skill Slug"}),a.jsx(Te,{id:"reg-skill-name",placeholder:"e.g. web-search, code-review, self-improving-agent...",value:l,onChange:p=>{u(p.target.value),x("")},onKeyDown:p=>p.key==="Enter"&&N()}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",a.jsx("code",{className:"rounded bg-muted px-1",children:"clawhub install <slug>"})," on the host via CLI. Browse available skills at ",a.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"clawhub.com"}),"."]})]})}),a.jsxs(rt,{value:"custom",className:"space-y-4 pt-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Xe,{htmlFor:"custom-skill-name",children:"Skill Name"}),a.jsx(Te,{id:"custom-skill-name",placeholder:"my-custom-skill",value:l,onChange:p=>{u(p.target.value),x("")}})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Xe,{htmlFor:"custom-skill-content",children:"SKILL.md Content"}),a.jsx(Cf,{id:"custom-skill-content",placeholder:`---
393
+ name: my-custom-skill
394
+ description: My custom skill
395
+ ---
396
+
397
+ Instructions for the agent...
398
+
399
+ Use {baseDir} to reference the skill folder path.`,value:c,onChange:p=>{h(p.target.value),x("")},className:"min-h-[200px] font-mono text-xs"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["The content will be saved as ",a.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/workspace/skills/<name>/SKILL.md"}),". Use YAML frontmatter with ",a.jsx("code",{className:"rounded bg-muted px-1",children:"name"})," and ",a.jsx("code",{className:"rounded bg-muted px-1",children:"description"})," fields."]})]})]})]}),g&&a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[a.jsx(pt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:g})]}),a.jsxs(Ir,{children:[a.jsx(K,{variant:"outline",onClick:()=>{w(),t(!1)},children:"Cancel"}),a.jsxs(K,{onClick:N,disabled:d||!l.trim()||o==="custom"&&!c.trim(),children:[d?a.jsx(He,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx($t,{className:"mr-1.5 h-3.5 w-3.5"}),"Install"]})]})]})})}function GM({open:e,onOpenChange:t,hostId:n,initialName:r,onSuccess:s,onError:o}){const[i,l]=m.useState(r??""),[u,c]=m.useState(!1),[h,d]=m.useState("");m.useEffect(()=>{r&&l(r)},[r]);const f=async()=>{if(i.trim()){c(!0),d("");try{await re.hosts.sendCommand(n,"uninstall_skill",{skillName:i.trim()}),l(""),t(!1),s==null||s()}catch(g){const x=g instanceof Error?g.message:"Failed to send command";d(x),o==null||o(g)}finally{c(!1)}}};return a.jsx(Pr,{open:e,onOpenChange:t,children:a.jsxs(er,{className:"sm:max-w-[400px]",children:[a.jsxs(Mr,{children:[a.jsxs(tr,{className:"flex items-center gap-2",children:[a.jsx(Zt,{className:"h-4 w-4"})," Uninstall Skill"]}),a.jsx(nr,{children:"This will send a command to the host CLI to remove the skill."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Xe,{htmlFor:"uninstall-name",children:"Skill Name"}),a.jsx(Te,{id:"uninstall-name",placeholder:"Skill name to uninstall...",value:i,onChange:g=>{l(g.target.value),d("")},onKeyDown:g=>g.key==="Enter"&&f()})]}),h&&a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[a.jsx(pt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:h})]}),a.jsxs(Ir,{children:[a.jsx(K,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),a.jsxs(K,{variant:"destructive",onClick:f,disabled:u||!i.trim(),children:[u?a.jsx(He,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Zt,{className:"mr-1.5 h-3.5 w-3.5"}),"Uninstall"]})]})]})})}function YM({open:e,onOpenChange:t,hostId:n,onSuccess:r,onError:s}){const[o,i]=m.useState(`{
400
+ "blockOnRisk": false
401
+ }`),[l,u]=m.useState(""),[c,h]=m.useState(!1),d=async()=>{u("");let f;try{f=JSON.parse(o)}catch{u("Invalid JSON");return}if(typeof f!="object"||f===null||Array.isArray(f)){u("Must be a JSON object");return}h(!0);try{await re.hosts.sendCommand(n,"update_config",f),t(!1),r==null||r()}catch(g){const x=g instanceof Error?g.message:"Failed to send command";u(x),s==null||s(g)}finally{h(!1)}};return a.jsx(Pr,{open:e,onOpenChange:t,children:a.jsxs(er,{className:"sm:max-w-[460px]",children:[a.jsxs(Mr,{children:[a.jsxs(tr,{className:"flex items-center gap-2",children:[a.jsx(qt,{className:"h-4 w-4"})," Update Guards Config"]}),a.jsx(nr,{children:"Values will be merged into the existing Guards plugin configuration."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Xe,{htmlFor:"config-json",children:"Config JSON"}),a.jsx(Cf,{id:"config-json",value:o,onChange:f=>{i(f.target.value),u("")},className:"min-h-[120px] font-mono text-xs"}),l&&a.jsx("p",{className:"text-xs text-destructive",children:l})]}),a.jsxs(Ir,{children:[a.jsx(K,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),a.jsxs(K,{onClick:d,disabled:c,children:[c?a.jsx(He,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(qt,{className:"mr-1.5 h-3.5 w-3.5"}),"Update"]})]})]})})}function XM(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function QM(){const[e,t]=m.useState([]),[n,r]=m.useState(""),[s,o]=m.useState(null),[i,l]=m.useState(!0),[u,c]=m.useState(null),h=m.useCallback((g,x="success")=>{c({msg:g,type:x}),setTimeout(()=>c(null),4e3)},[]);if(m.useEffect(()=>{re.discovery.agents().then(g=>{const x=g.data??[];t(x),x.length>0&&!n&&r(x[0].registeredAgentId||x[0].id)}).catch(()=>{}).finally(()=>l(!1))},[]),m.useEffect(()=>{if(!n){o(null);return}const g=e.find(x=>(x.registeredAgentId||x.id)===n);o(g??null)},[n,e]),i)return a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading agents..."});if(e.length===0)return a.jsxs("div",{className:"space-y-6",children:[a.jsx("h1",{className:"text-lg font-semibold",children:"Plugins"}),a.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[a.jsx(Qo,{className:"h-10 w-10 text-muted-foreground/30"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents discovered"}),a.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Start an OpenClaw agent with the Guards plugin to see it here"})]})]});const d=s==null?void 0:s.hostId,f=(s==null?void 0:s.plugins)??[];return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-lg font-semibold",children:"Plugins"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage OpenClaw plugins per agent"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-muted-foreground",children:"Agent:"}),a.jsx("select",{className:"h-8 rounded-md border border-input bg-background px-2 text-sm focus:outline-none focus:ring-1 focus:ring-ring",value:n,onChange:g=>r(g.target.value),children:e.map(g=>a.jsx("option",{value:g.registeredAgentId||g.id,children:g.name},g.registeredAgentId||g.id))})]})]}),s&&a.jsxs(a.Fragment,{children:[a.jsx(qM,{plugins:f}),d?a.jsxs(a.Fragment,{children:[a.jsx(ZM,{hostId:d,showToast:h}),a.jsx(JM,{hostId:d})]}):a.jsx(he,{className:"border-dashed",children:a.jsxs(we,{className:"flex flex-col items-center gap-2 py-6",children:[a.jsx(Zd,{className:"h-6 w-6 text-muted-foreground/40"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"This agent is not associated with a host. Plugin install/uninstall commands require a connected host."}),a.jsxs("p",{className:"text-xs text-muted-foreground/70",children:["Run ",a.jsx("code",{className:"rounded bg-muted px-1",children:"opentrust connect"})," on the agent's machine to link it."]})]})}),a.jsx(eI,{})]}),u&&a.jsxs("div",{className:`fixed bottom-6 right-6 z-[100] flex items-center gap-2 rounded-lg border px-4 py-3 shadow-lg animate-in slide-in-from-bottom-4 ${u.type==="success"?"border-emerald-500/30 bg-emerald-50 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200":"border-destructive/30 bg-red-50 text-red-800 dark:bg-red-950 dark:text-red-200"}`,children:[u.type==="success"?a.jsx(Yn,{className:"h-4 w-4"}):a.jsx(pt,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:u.msg}),a.jsx("button",{onClick:()=>c(null),className:"ml-2 text-current/50 hover:text-current",children:"×"})]})]})}function qM({plugins:e}){return e.length===0?a.jsx(he,{className:"border-dashed",children:a.jsxs(we,{className:"flex flex-col items-center gap-2 py-6",children:[a.jsx(ea,{className:"h-8 w-8 text-muted-foreground/30"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins reported by this agent"})]})}):a.jsxs(he,{children:[a.jsx(Ie,{children:a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(ea,{className:"h-4 w-4"})," Installed Plugins (",e.length,")"]})}),a.jsx(we,{className:"space-y-2",children:e.map(t=>a.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-2.5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ea,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-sm font-medium",children:t.name||t.id}),t.version&&a.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",t.version]})]}),a.jsx(ye,{variant:t.enabled!==!1?"default":"secondary",className:"text-[10px]",children:t.enabled!==!1?"enabled":"disabled"})]},t.name||t.id))})]})}function ZM({hostId:e,showToast:t}){const[n,r]=m.useState(!1),[s,o]=m.useState(!1);return a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(K,{size:"sm",onClick:()=>r(!0),children:[a.jsx($t,{className:"mr-1.5 h-3.5 w-3.5"})," Install Plugin"]}),a.jsxs(K,{size:"sm",variant:"outline",onClick:()=>o(!0),children:[a.jsx(Zt,{className:"mr-1.5 h-3.5 w-3.5"})," Uninstall Plugin"]}),a.jsx(tI,{open:n,onOpenChange:r,hostId:e,showToast:t}),a.jsx(nI,{open:s,onOpenChange:o,hostId:e,showToast:t})]})}function JM({hostId:e}){const[t,n]=m.useState([]),[r,s]=m.useState(!0),[o,i]=m.useState(null),l=m.useCallback(()=>{re.hosts.commands(e).then(c=>{const h=(c.data??[]).filter(d=>d.type==="install_plugin"||d.type==="uninstall_plugin");n(h)}).catch(()=>{}).finally(()=>s(!1))},[e]);m.useEffect(()=>{l()},[l]),m.useEffect(()=>{if(!t.some(d=>d.status==="pending"||d.status==="running"))return;const h=setInterval(l,5e3);return()=>clearInterval(h)},[t,l]);const u=c=>c==="completed"?a.jsx(Yn,{className:"h-3.5 w-3.5 text-emerald-500"}):c==="failed"?a.jsx(pt,{className:"h-3.5 w-3.5 text-destructive"}):c==="running"?a.jsx(He,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):a.jsx(Zd,{className:"h-3.5 w-3.5 text-muted-foreground"});return r||t.length===0?null:a.jsxs(he,{children:[a.jsx(Ie,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(ms,{className:"h-4 w-4"})," Plugin Command History"]}),a.jsxs(K,{size:"sm",variant:"ghost",onClick:l,children:[a.jsx(Xn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]})}),a.jsx(we,{className:"space-y-2",children:t.map(c=>{var g,x;const h=o===c.id,d=c.type==="install_plugin"?"Install Plugin":"Uninstall Plugin",f=((g=c.payload)==null?void 0:g.spec)||((x=c.payload)==null?void 0:x.pluginId)||"";return a.jsxs("div",{className:"rounded-lg border border-border transition-colors hover:bg-muted/20",children:[a.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-4 py-3",onClick:()=>c.result&&i(h?null:c.id),children:[u(c.status),a.jsx("span",{className:"text-xs font-medium",children:d}),f&&a.jsxs("span",{className:"text-xs text-muted-foreground",children:['"',f,'"']}),a.jsx("div",{className:"flex-1"}),a.jsx(ye,{variant:c.status==="completed"?"default":c.status==="failed"?"destructive":"secondary",className:"text-[10px]",children:c.status}),a.jsx("span",{className:"text-[11px] text-muted-foreground",children:rI(c.createdAt)}),c.result&&(h?a.jsx(pl,{className:"h-3.5 w-3.5 text-muted-foreground"}):a.jsx(qd,{className:"h-3.5 w-3.5 text-muted-foreground"}))]}),h&&c.result&&a.jsx("div",{className:"border-t border-border bg-muted/30 px-4 py-3",children:a.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded-md bg-background p-2.5 font-mono text-[11px] text-muted-foreground",children:typeof c.result=="string"?c.result:JSON.stringify(c.result,null,2)})})]},c.id)})})]})}function eI(){return a.jsxs(he,{children:[a.jsx(Ie,{children:a.jsx(Re,{className:"text-sm",children:"How Plugins Work"})}),a.jsxs(we,{className:"text-xs text-muted-foreground space-y-2",children:[a.jsx("p",{children:"OpenClaw plugins extend agent capabilities. They can be installed from npm or local paths."}),a.jsx("p",{children:"Common plugin specs:"}),a.jsxs("ul",{className:"list-inside list-disc space-y-0.5 pl-2",children:[a.jsxs("li",{children:[a.jsx("code",{className:"rounded bg-muted px-1",children:"@openclaw/voice-call"})," — Voice calling plugin"]}),a.jsxs("li",{children:[a.jsx("code",{className:"rounded bg-muted px-1",children:"@opentrust/guards"})," — Security guard plugin"]}),a.jsxs("li",{children:[a.jsx("code",{className:"rounded bg-muted px-1",children:"/path/to/plugin"})," — Local plugin path"]})]}),a.jsxs("p",{children:["Commands are sent to the agent's host CLI which executes ",a.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins install/uninstall"}),"."]})]})]})}function tI({open:e,onOpenChange:t,hostId:n,showToast:r}){const[s,o]=m.useState(""),[i,l]=m.useState(!1),[u,c]=m.useState(""),h=()=>{o(""),c("")},d=async()=>{if(s.trim()){l(!0),c("");try{await re.hosts.sendCommand(n,"install_plugin",{spec:s.trim()}),h(),t(!1),r("Plugin install command sent","success")}catch(f){const g=f instanceof Error?f.message:"Failed to send command";c(g)}finally{l(!1)}}};return a.jsx(Pr,{open:e,onOpenChange:f=>{f||h(),t(f)},children:a.jsxs(er,{className:"sm:max-w-[480px]",children:[a.jsxs(Mr,{children:[a.jsxs(tr,{className:"flex items-center gap-2",children:[a.jsx($t,{className:"h-4 w-4"})," Install Plugin"]}),a.jsx(nr,{children:"Install an OpenClaw plugin via npm package name or local path."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Xe,{htmlFor:"plugin-spec",children:"Plugin Spec"}),a.jsx(Te,{id:"plugin-spec",placeholder:"e.g. @openclaw/voice-call, @opentrust/guards, /path/to/plugin",value:s,onChange:f=>{o(f.target.value),c("")},onKeyDown:f=>f.key==="Enter"&&d()}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",a.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins install <spec>"})," on the agent's host via CLI."]})]}),u&&a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[a.jsx(pt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:u})]}),a.jsxs(Ir,{children:[a.jsx(K,{variant:"outline",onClick:()=>{h(),t(!1)},children:"Cancel"}),a.jsxs(K,{onClick:d,disabled:i||!s.trim(),children:[i?a.jsx(He,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx($t,{className:"mr-1.5 h-3.5 w-3.5"}),"Install"]})]})]})})}function nI({open:e,onOpenChange:t,hostId:n,showToast:r,initialId:s}){const[o,i]=m.useState(s??""),[l,u]=m.useState(!1),[c,h]=m.useState("");m.useEffect(()=>{s&&i(s)},[s]);const d=async()=>{if(o.trim()){u(!0),h("");try{await re.hosts.sendCommand(n,"uninstall_plugin",{pluginId:o.trim()}),i(""),t(!1),r("Plugin uninstall command sent","success")}catch(f){const g=f instanceof Error?f.message:"Failed to send command";h(g)}finally{u(!1)}}};return a.jsx(Pr,{open:e,onOpenChange:t,children:a.jsxs(er,{className:"sm:max-w-[400px]",children:[a.jsxs(Mr,{children:[a.jsxs(tr,{className:"flex items-center gap-2",children:[a.jsx(Zt,{className:"h-4 w-4"})," Uninstall Plugin"]}),a.jsx(nr,{children:"Remove an OpenClaw plugin from the agent's host."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Xe,{htmlFor:"plugin-id",children:"Plugin ID"}),a.jsx(Te,{id:"plugin-id",placeholder:"e.g. voice-call, opentrust-guard",value:o,onChange:f=>{i(f.target.value),h("")},onKeyDown:f=>f.key==="Enter"&&d()}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",a.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins uninstall <id> --force"})," on the host via CLI."]})]}),c&&a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[a.jsx(pt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:c})]}),a.jsxs(Ir,{children:[a.jsx(K,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),a.jsxs(K,{variant:"destructive",onClick:d,disabled:l||!o.trim(),children:[l?a.jsx(He,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Zt,{className:"mr-1.5 h-3.5 w-3.5"}),"Uninstall"]})]})]})})}function rI(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function sI(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${(e/Math.pow(t,r)).toFixed(1)} ${n[r]}`}function oI(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,o]=m.useState("dashboard"),i=m.useCallback(()=>{re.system.services().then(l=>t(l.data??[])).catch(()=>{}).finally(()=>r(!1))},[]);return m.useEffect(()=>{i()},[i]),m.useEffect(()=>{const l=setInterval(i,1e4);return()=>clearInterval(l)},[i]),n?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-lg font-semibold",children:"System"}),a.jsxs(K,{size:"sm",variant:"ghost",onClick:i,children:[a.jsx(Xn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]}),a.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:e.map(l=>a.jsx(he,{className:`cursor-pointer transition-all ${s===l.key?"ring-2 ring-primary shadow-sm":"hover:bg-muted/30"}`,onClick:()=>o(l.key),children:a.jsxs(we,{className:"flex items-center gap-3 p-4",children:[a.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-lg ${l.healthy?"bg-emerald-100 dark:bg-emerald-950":l.running?"bg-amber-100 dark:bg-amber-950":"bg-muted"}`,children:a.jsx(Jd,{className:`h-5 w-5 ${l.healthy?"text-emerald-600 dark:text-emerald-400":l.running?"text-amber-600 dark:text-amber-400":"text-muted-foreground"}`})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"text-sm font-medium",children:l.name}),a.jsx(Vb,{className:`h-2 w-2 fill-current ${l.healthy?"text-emerald-500":l.running?"text-amber-500":"text-muted-foreground/40"}`})]}),a.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[a.jsxs("span",{children:[":",l.port]}),l.pid&&a.jsxs("span",{children:["PID ",l.pid]}),l.logSize>0&&a.jsx("span",{children:sI(l.logSize)})]})]}),a.jsx(ye,{variant:l.healthy?"default":l.running?"secondary":"outline",className:`text-[10px] ${l.healthy?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20":""}`,children:l.healthy?"Healthy":l.running?"Running":"Stopped"})]})},l.key))}),s&&a.jsx(iI,{service:s})]})}function iI({service:e}){const[t,n]=m.useState([]),[r,s]=m.useState(0),[o,i]=m.useState(""),[l,u]=m.useState(!0),[c,h]=m.useState(!0),[d,f]=m.useState(!0),[g,x]=m.useState(200),w=m.useRef(null),N=m.useRef(null),p=m.useCallback(b=>{const C=b??g;re.system.logs(e,C).then(j=>{n(j.data.lines),s(j.data.total),i(j.data.lastModified)}).catch(()=>{}).finally(()=>u(!1))},[e,g]);m.useEffect(()=>{u(!0),n([]),p()},[e]),m.useEffect(()=>{p()},[g]),m.useEffect(()=>{c&&w.current&&(w.current.scrollTop=w.current.scrollHeight)},[t,c]),m.useEffect(()=>(d?N.current=setInterval(()=>p(),3e3):N.current&&(clearInterval(N.current),N.current=null),()=>{N.current&&clearInterval(N.current)}),[d,p]);const v=async()=>{try{await re.system.clearLog(e),n([]),s(0)}catch{}},y=()=>{x(b=>Math.min(b+500,2e3))},S=e.charAt(0).toUpperCase()+e.slice(1);return a.jsxs(he,{children:[a.jsx(Ie,{className:"pb-3",children:a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Is,{className:"h-4 w-4"})," ",S," Logs",a.jsxs(ye,{variant:"outline",className:"text-[10px] font-normal",children:[r.toLocaleString()," lines"]}),o&&a.jsxs("span",{className:"text-[11px] font-normal text-muted-foreground",children:["Updated ",new Date(o).toLocaleTimeString()]})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[r>g&&a.jsx(K,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:y,children:"Load more"}),a.jsxs(K,{size:"sm",variant:d?"default":"outline",className:"h-7 text-xs",onClick:()=>{f(!d),h(!d)},children:[d?a.jsx(nj,{className:"mr-1 h-3 w-3"}):a.jsx(Ta,{className:"mr-1 h-3 w-3"}),d?"Pause":"Tail"]}),a.jsxs(K,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>{var b;h(!0),(b=w.current)==null||b.scrollTo({top:w.current.scrollHeight,behavior:"smooth"})},children:[a.jsx(Ob,{className:"mr-1 h-3 w-3"})," Bottom"]}),a.jsxs(K,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>p(),children:[a.jsx(Xn,{className:"mr-1 h-3 w-3"})," Refresh"]}),a.jsxs(K,{size:"sm",variant:"ghost",className:"h-7 text-xs text-destructive hover:text-destructive",onClick:v,children:[a.jsx(Zt,{className:"mr-1 h-3 w-3"})," Clear"]})]})]})}),a.jsx(we,{className:"p-0",children:l?a.jsx("div",{className:"flex h-60 items-center justify-center",children:a.jsx(He,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):t.length===0?a.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-2",children:[a.jsx($b,{className:"h-8 w-8 text-muted-foreground/20"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No log output"})]}):a.jsx("div",{ref:w,className:"h-[calc(100vh-420px)] min-h-[300px] overflow-auto border-t border-border bg-zinc-950 dark:bg-zinc-950",onScroll:()=>{if(!w.current)return;const{scrollTop:b,scrollHeight:C,clientHeight:j}=w.current,P=C-b-j<40;h(P)},children:a.jsx("pre",{className:"p-4 text-xs leading-5 font-mono text-zinc-300",children:t.map((b,C)=>a.jsx(aI,{line:b,lineNum:r-t.length+C+1},C))})})})]})}function aI({line:e,lineNum:t}){const n=lI(e);return a.jsxs("div",{className:"group flex hover:bg-white/5",children:[a.jsx("span",{className:"mr-3 inline-block w-10 select-none text-right text-zinc-600 group-hover:text-zinc-500",children:t}),a.jsx("span",{className:n,children:e}),`
402
+ `]})}function lI(e){const t=e.toLowerCase();return t.includes("error")||t.includes("err ")||t.includes("fatal")?"text-red-400":t.includes("warn")||t.includes("warning")?"text-amber-400":t.includes("debug")||t.includes("dbg ")?"text-zinc-500":/\b(get|post|put|delete|patch)\b/i.test(e)?"text-sky-400":t.includes("info")||t.includes("listening")||t.includes("started")||t.includes("running")?"text-emerald-400":"text-zinc-300"}const uI=[{key:"og_core_url",label:"Core API URL",icon:Jd,placeholder:"http://localhost:53666",description:"OpenTrust Core service endpoint"},{key:"gateway_url",label:"Gateway URL",icon:Zx,placeholder:"http://localhost:8900",description:"AI Gateway proxy endpoint"},{key:"dashboard_mode",label:"Dashboard Mode",icon:ty,placeholder:"selfhosted",description:"Deployment mode: selfhosted or embedded"},{key:"database_url",label:"Database URL",icon:Kb,placeholder:"file:./data/dashboard.db",description:"Database connection string",sensitive:!0}];function cI(){const[e,t]=m.useState({}),[n,r]=m.useState({}),[s,o]=m.useState(!0),[i,l]=m.useState(!1),[u,c]=m.useState(null),[h,d]=m.useState(null),[f,g]=m.useState(!1),[x,w]=m.useState(""),[N,p]=m.useState(""),[v,y]=m.useState(!1),[S,b]=m.useState(!1),C=m.useCallback(()=>{re.settings.getApiKey(!1).then(D=>{w(D.data.key),p(""),y(!1)}).catch(()=>{})},[]),j=()=>{o(!0),re.settings.get().then(D=>{const E=D.data??{};t(E),r(E)}).catch(()=>{}).finally(()=>o(!1))};m.useEffect(()=>{j(),C()},[C]);const P=()=>Object.keys(e).some(D=>e[D]!==n[D]),I=async()=>{l(!0);try{const D={};for(const[E,L]of Object.entries(e))L!==n[E]&&(D[E]=L);Object.keys(D).length>0&&(await re.settings.update(D),r({...e}),R("Settings saved","success"))}catch(D){R(D instanceof Error?D.message:"Failed to save","error")}finally{l(!1)}},$=async()=>{g(!0),d(null);try{const E=await(await fetch("/api/settings/test-connection",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${JSON.parse(localStorage.getItem("opentrust_user")||"{}").apiKey||""}`}})).json();E.success&&d(E.data)}catch{d({connected:!1,message:"Request failed"})}finally{g(!1)}},R=(D,E)=>{c({msg:D,type:E}),setTimeout(()=>c(null),3e3)},T=(D,E)=>{t(L=>({...L,[D]:E}))};return s?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading settings..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-lg font-semibold",children:"Settings"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure OpenTrust system settings"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(K,{size:"sm",variant:"ghost",onClick:j,children:[a.jsx(Xn,{className:"mr-1.5 h-3.5 w-3.5"})," Reload"]}),a.jsxs(K,{size:"sm",onClick:I,disabled:i||!P(),children:[i?a.jsx(He,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Jx,{className:"mr-1.5 h-3.5 w-3.5"}),"Save Changes"]})]})]}),a.jsxs(he,{children:[a.jsxs(Ie,{children:[a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(qb,{className:"h-4 w-4"})," System API Key"]}),a.jsx(af,{className:"text-xs",children:"Unified key for CLI, Guards, Gateway, and Dashboard inter-component authentication"})]}),a.jsxs(we,{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Te,{readOnly:!0,value:v?N:x,className:"font-mono text-sm",placeholder:"Loading..."}),a.jsx(K,{size:"icon",variant:"outline",title:v?"Hide":"Reveal",onClick:async()=>{if(v)y(!1);else try{const D=await re.settings.getApiKey(!0);p(D.data.key),y(!0)}catch{R("Failed to reveal key","error")}},children:v?a.jsx(Yb,{className:"h-4 w-4"}):a.jsx(Xb,{className:"h-4 w-4"})}),a.jsx(K,{size:"icon",variant:"outline",title:"Copy to clipboard",onClick:async()=>{try{const D=await re.settings.getApiKey(!0);await navigator.clipboard.writeText(D.data.key),R("API key copied","success")}catch{R("Failed to copy","error")}},children:a.jsx(Wb,{className:"h-4 w-4"})}),a.jsx(K,{size:"icon",variant:"outline",title:"Regenerate key",disabled:S,onClick:async()=>{if(window.confirm("Regenerating will invalidate the current key. All connected components must update their configuration. Continue?")){b(!0);try{const D=await re.settings.generateKey();p(D.data.key),w(D.data.key.slice(0,12)+"..."+D.data.key.slice(-4)),y(!0),R("New API key generated","success")}catch{R("Failed to generate key","error")}finally{b(!1)}}},children:S?a.jsx(He,{className:"h-4 w-4 animate-spin"}):a.jsx(La,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"rounded-md border border-border bg-muted/50 p-3",children:[a.jsxs("p",{className:"mb-2 flex items-center gap-1.5 text-xs font-medium",children:[a.jsx(ms,{className:"h-3.5 w-3.5"})," Connection Guide"]}),a.jsxs("div",{className:"space-y-1.5 text-[11px] font-mono text-muted-foreground",children:[a.jsxs("p",{children:[a.jsx("span",{className:"text-foreground font-semibold",children:"CLI:"})," opentrust connect --dashboard-url http://<host>:53667 --api-key <key>"]}),a.jsxs("p",{children:[a.jsx("span",{className:"text-foreground font-semibold",children:"Guards:"})," Set ",a.jsx("code",{className:"rounded bg-muted px-1",children:"apiKey"})," in openclaw.json plugin config"]}),a.jsxs("p",{children:[a.jsx("span",{className:"text-foreground font-semibold",children:"Gateway:"})," Set env ",a.jsx("code",{className:"rounded bg-muted px-1",children:"OT_API_KEY=<key>"})]})]})]})]})]}),a.jsx(dI,{showToast:R}),a.jsxs(he,{children:[a.jsx(Ie,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Jd,{className:"h-4 w-4"})," Service Connection"]}),a.jsxs(K,{size:"sm",variant:"outline",onClick:$,disabled:f,children:[f?a.jsx(He,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Xn,{className:"mr-1.5 h-3.5 w-3.5"}),"Test Connection"]})]})}),a.jsx(we,{children:h?a.jsxs("div",{className:`flex items-center gap-2 rounded-md border px-3 py-2 text-sm ${h.connected?"border-emerald-500/30 bg-emerald-50 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200":"border-destructive/30 bg-red-50 text-red-800 dark:bg-red-950 dark:text-red-200"}`,children:[h.connected?a.jsx(Yn,{className:"h-4 w-4"}):a.jsx(pt,{className:"h-4 w-4"}),a.jsx("span",{children:h.message}),h.url&&a.jsx(ye,{variant:"outline",className:"ml-auto text-[10px]",children:h.url})]}):a.jsx("p",{className:"text-xs text-muted-foreground",children:'Click "Test Connection" to verify Core service connectivity'})})]}),a.jsxs(he,{children:[a.jsx(Ie,{children:a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(qt,{className:"h-4 w-4"})," Configuration"]})}),a.jsx(we,{className:"space-y-5",children:uI.map(D=>{const E=D.icon,L=e[D.key]!==n[D.key];return a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(E,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx(Xe,{htmlFor:D.key,className:"text-sm font-medium",children:D.label}),L&&a.jsx(ye,{variant:"secondary",className:"text-[10px]",children:"Modified"})]}),a.jsx(Te,{id:D.key,value:e[D.key]??"",onChange:k=>T(D.key,k.target.value),placeholder:D.placeholder,className:"font-mono text-sm"}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:D.description})]},D.key)})})]}),a.jsxs(he,{children:[a.jsx(Ie,{children:a.jsx(Re,{className:"text-sm",children:"Environment"})}),a.jsx(we,{children:a.jsxs("div",{className:"grid gap-3 text-xs sm:grid-cols-2",children:[a.jsx(Oi,{label:"Dashboard Mode",value:e.dashboard_mode||"selfhosted"}),a.jsx(Oi,{label:"Core URL",value:e.og_core_url||"http://localhost:53666"}),a.jsx(Oi,{label:"Gateway URL",value:e.gateway_url||"http://localhost:8900"}),a.jsx(Oi,{label:"Database",value:e.database_url?"Custom":"SQLite (default)"})]})})]}),u&&a.jsxs("div",{className:`fixed bottom-6 right-6 z-[100] flex items-center gap-2 rounded-lg border px-4 py-3 shadow-lg animate-in slide-in-from-bottom-4 ${u.type==="success"?"border-emerald-500/30 bg-emerald-50 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200":"border-destructive/30 bg-red-50 text-red-800 dark:bg-red-950 dark:text-red-200"}`,children:[u.type==="success"?a.jsx(Yn,{className:"h-4 w-4"}):a.jsx(pt,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:u.msg})]})]})}function dI({showToast:e}){const[t,n]=m.useState(""),[r,s]=m.useState(""),[o,i]=m.useState(""),[l,u]=m.useState(!1),c=async h=>{if(h.preventDefault(),r!==o){e("Passwords do not match","error");return}if(r.length<4){e("Password must be at least 4 characters","error");return}u(!0);try{const d=localStorage.getItem("opentrust_user"),f=d?JSON.parse(d).apiKey:null,g=await fetch("/api/auth/change-password",{method:"POST",headers:{"Content-Type":"application/json",...f&&{Authorization:`Bearer ${f}`}},body:JSON.stringify({currentPassword:t,newPassword:r})}),x=await g.json();if(!g.ok||!x.success)throw new Error(x.error||"Failed");e("Password changed successfully","success"),n(""),s(""),i("")}catch(d){e(d instanceof Error?d.message:"Failed to change password","error")}finally{u(!1)}};return a.jsxs(he,{children:[a.jsxs(Ie,{children:[a.jsxs(Re,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Zb,{className:"h-4 w-4"})," Change Password"]}),a.jsx(af,{className:"text-xs",children:"Update the admin login password"})]}),a.jsx(we,{children:a.jsxs("form",{onSubmit:c,className:"space-y-3",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(Xe,{className:"text-xs",children:"Current Password"}),a.jsx(Te,{type:"password",value:t,onChange:h=>n(h.target.value),required:!0,className:"text-sm"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Xe,{className:"text-xs",children:"New Password"}),a.jsx(Te,{type:"password",value:r,onChange:h=>s(h.target.value),required:!0,className:"text-sm"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Xe,{className:"text-xs",children:"Confirm New Password"}),a.jsx(Te,{type:"password",value:o,onChange:h=>i(h.target.value),required:!0,className:"text-sm"})]}),a.jsxs(K,{type:"submit",size:"sm",disabled:l,children:[l?a.jsx(He,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Jx,{className:"mr-1.5 h-3.5 w-3.5"}),"Update Password"]})]})})]})}function Oi({label:e,value:t}){return a.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2",children:[a.jsx("span",{className:"text-muted-foreground",children:e}),a.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-[11px]",children:t})]})}function fI(){const[e,t]=GS(),[n,r]=m.useState([]),[s,o]=m.useState(!0),[i,l]=m.useState(e.get("expand")),[u,c]=m.useState(null),h=m.useCallback(async()=>{try{const g=await re.hosts.list();r(g.data)}catch{}finally{o(!1)}},[]);m.useEffect(()=>{h();const g=setInterval(h,15e3);return()=>clearInterval(g)},[h]),m.useEffect(()=>{if(!u)return;const g=setTimeout(()=>c(null),4e3);return()=>clearTimeout(g)},[u]);const d=(g,x)=>c({msg:g,type:x}),f=async g=>{try{await re.hosts.remove(g),r(x=>x.filter(w=>w.id!==g)),d("Host removed","success")}catch{d("Failed to remove host","error")}};return s?a.jsx("div",{className:"flex items-center justify-center py-24",children:a.jsx(He,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Hosts"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage machines running OpenTrust CLI"})]}),a.jsxs(K,{variant:"outline",size:"sm",onClick:h,children:[a.jsx(Xn,{className:"h-4 w-4 mr-1"})," Refresh"]})]}),n.length===0?a.jsxs(he,{className:"p-8 text-center",children:[a.jsx(xl,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),a.jsx("h3",{className:"text-lg font-medium mb-2",children:"No hosts connected"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4 max-w-md mx-auto",children:"Use the CLI to connect a host to this Dashboard:"}),a.jsx("code",{className:"block bg-muted rounded px-3 py-2 text-xs font-mono max-w-lg mx-auto",children:"opentrust connect --dashboard-url http://this-host:53667 --api-key sk-og-xxx"})]}):a.jsx("div",{className:"space-y-3",children:n.map(g=>a.jsx("div",{children:a.jsx(hI,{host:g,expanded:i===g.id,onToggle:()=>{const x=i===g.id?null:g.id;l(x),x?t({expand:x},{replace:!0}):t({},{replace:!0})},onRemove:()=>f(g.id),showToast:d})},g.id))}),u&&a.jsxs("div",{className:`fixed bottom-6 right-6 z-50 flex items-center gap-2 rounded-lg px-4 py-3 text-sm shadow-lg ${u.type==="success"?"bg-green-600 text-white":"bg-red-600 text-white"}`,children:[u.type==="success"?a.jsx(Yn,{className:"h-4 w-4"}):a.jsx(pt,{className:"h-4 w-4"}),u.msg]})]})}function hI({host:e,expanded:t,onToggle:n,onRemove:r,showToast:s}){const o=e.status==="online",i=e.services??{},l=Object.values(i).filter(d=>d.running).length,u=Object.keys(i).length;e.metadata;const[c,h]=m.useState(0);return m.useEffect(()=>{re.hosts.agents(e.id).then(d=>h((d.data??[]).length)).catch(()=>{})},[e.id]),a.jsxs(he,{className:"overflow-hidden",children:[a.jsxs("button",{onClick:n,className:"w-full flex items-center gap-4 p-4 hover:bg-accent/30 transition-colors text-left",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[a.jsx("div",{className:`h-2.5 w-2.5 rounded-full shrink-0 ${o?"bg-green-500":"bg-gray-400"}`}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-medium truncate",children:e.hostname}),a.jsx(ye,{variant:o?"default":"secondary",className:"text-[10px] px-1.5",children:o?"online":"offline"})]}),a.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground mt-0.5",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Zx,{className:"h-3 w-3"})," ",e.ip]}),a.jsxs("span",{children:[e.os," / ",e.arch]}),a.jsxs("span",{children:["CLI v",e.cliVersion]}),a.jsxs("span",{children:[l,"/",u," services"]}),c>0&&a.jsxs("span",{children:[c," agent",c>1?"s":""]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex gap-1",children:Object.entries(i).map(([d,f])=>a.jsx("span",{title:`${f.name}: ${f.running?f.healthy?"healthy":"running":"stopped"}`,className:`inline-block h-4 w-4 rounded text-[8px] font-bold flex items-center justify-center ${f.running?f.healthy?"bg-green-500/20 text-green-700 dark:text-green-400":"bg-yellow-500/20 text-yellow-700 dark:text-yellow-400":"bg-gray-500/20 text-gray-500"}`,children:d[0].toUpperCase()},d))}),t?a.jsx(Bb,{className:"h-4 w-4 text-muted-foreground"}):a.jsx(pl,{className:"h-4 w-4 text-muted-foreground"})]})]}),t&&a.jsx("div",{className:"border-t border-border",children:a.jsx(mI,{host:e,onRemove:r,showToast:s})})]})}function mI({host:e,onRemove:t,showToast:n}){const[r,s]=m.useState("agents");return a.jsxs(Pf,{value:r,onValueChange:s,className:"w-full",children:[a.jsxs(Ll,{className:"w-full justify-start rounded-none border-b bg-transparent px-4 pt-2",children:[a.jsx(nt,{value:"agents",children:"Agents"}),a.jsx(nt,{value:"services",children:"Services"}),a.jsx(nt,{value:"guards",children:"Guards"}),a.jsx(nt,{value:"logs",children:"Logs"}),a.jsx(nt,{value:"upgrade",children:"Upgrade"}),a.jsx(nt,{value:"config",children:"Config"}),a.jsx(nt,{value:"commands",children:"Commands"}),a.jsx(nt,{value:"info",children:"Info"})]}),a.jsxs("div",{className:"p-4",children:[a.jsx(rt,{value:"agents",className:"mt-0",children:a.jsx(pI,{hostId:e.id})}),a.jsx(rt,{value:"services",className:"mt-0",children:a.jsx(gI,{host:e,showToast:n})}),a.jsx(rt,{value:"guards",className:"mt-0",children:a.jsx(xI,{host:e,showToast:n})}),a.jsx(rt,{value:"logs",className:"mt-0",children:a.jsx(yI,{host:e,showToast:n})}),a.jsx(rt,{value:"upgrade",className:"mt-0",children:a.jsx(vI,{host:e,showToast:n})}),a.jsx(rt,{value:"config",className:"mt-0",children:a.jsx(wI,{host:e,showToast:n})}),a.jsx(rt,{value:"commands",className:"mt-0",children:a.jsx(NI,{hostId:e.id})}),a.jsx(rt,{value:"info",className:"mt-0",children:a.jsx(SI,{host:e,onRemove:t})})]})]})}function pI({hostId:e}){const[t,n]=m.useState([]),[r,s]=m.useState(!0);return m.useEffect(()=>{re.hosts.agents(e).then(o=>n(o.data??[])).catch(()=>{}).finally(()=>s(!1))},[e]),r?a.jsx("div",{className:"flex items-center justify-center py-8",children:a.jsx(He,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):t.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-3 py-8 text-center",children:[a.jsx(xl,{className:"h-8 w-8 text-muted-foreground/30"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents associated with this host"}),a.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Agents are auto-linked when the Guards plugin reports the same hostname"})]}):a.jsxs("div",{className:"space-y-2",children:[a.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:[t.length," agent",t.length>1?"s":""," running on this host"]}),t.map(o=>{const i=o.metadata??{},l=i.emoji||"🤖",u=i.openclawId||o.id;return a.jsxs(Gn,{to:`/inventory/agents/${u}`,className:"flex items-center gap-3 rounded-lg border border-border p-3 transition-colors hover:bg-muted/30",children:[a.jsx("span",{className:"text-lg",children:l}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:o.name}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[o.provider!=="custom"?o.provider:""," ",a.jsx(ye,{variant:o.status==="active"?"default":"secondary",className:"text-[10px] ml-1",children:o.status})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[o.lastSeenAt&&a.jsx("span",{className:"text-[11px] text-muted-foreground",children:new Date(o.lastSeenAt).toLocaleString()}),a.jsx(gl,{className:"h-3.5 w-3.5 text-muted-foreground/50 rotate-90"})]})]},o.id)})]})}function gI({host:e,showToast:t}){const n=e.services??{},[r,s]=m.useState(null),o=async(i,l)=>{s(`${i}-${l}`);try{await re.hosts.sendCommand(e.id,i,{service:l}),t(`${i.replace("_"," ")} "${l}" sent`,"success")}catch{t(`Failed to send ${i}`,"error")}finally{s(null)}};return a.jsxs("div",{className:"space-y-2",children:[Object.entries(n).map(([i,l])=>a.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`h-2 w-2 rounded-full ${l.running?l.healthy?"bg-green-500":"bg-yellow-500":"bg-gray-400"}`}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-sm",children:l.name}),a.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:[":",l.port]}),l.pid&&a.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["PID ",l.pid]})]})]}),a.jsx("div",{className:"flex items-center gap-1",children:l.running?a.jsxs(a.Fragment,{children:[a.jsxs(K,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("restart_service",i),children:[a.jsx(La,{className:"h-3 w-3 mr-1"})," Restart"]}),a.jsxs(K,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("stop_service",i),children:[a.jsx(To,{className:"h-3 w-3 mr-1"})," Stop"]})]}):a.jsxs(K,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("start_service",i),children:[a.jsx(Ta,{className:"h-3 w-3 mr-1"})," Start"]})})]},i)),a.jsxs("div",{className:"flex gap-2 pt-2",children:[a.jsxs(K,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("start_service","all"),children:[a.jsx(Ta,{className:"h-3 w-3 mr-1"})," Start All"]}),a.jsxs(K,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("stop_service","all"),children:[a.jsx(To,{className:"h-3 w-3 mr-1"})," Stop All"]}),a.jsxs(K,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("restart_service","all"),children:[a.jsx(La,{className:"h-3 w-3 mr-1"})," Restart All"]})]})]})}function xI({host:e,showToast:t}){const[n,r]=m.useState(""),[s,o]=m.useState(null),l=(e.metadata??{}).guards,u=async c=>{o(c);try{await re.hosts.sendCommand(e.id,c,n?{version:n}:{}),t(c==="install_guards"?"Guards install command sent":"Guards upgrade command sent","success")}catch{t(`Failed to send ${c.replace("_"," ")} command`,"error")}finally{o(null)}};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ty,{className:"h-5 w-5 text-primary"}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium",children:"OpenTrust Guards Plugin"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Install or upgrade the ",a.jsx("code",{children:"@opentrust/guards"})," security plugin for OpenClaw on this host"]})]})]}),(l==null?void 0:l.installed)&&a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(ye,{variant:"default",className:"text-xs",children:"Installed"}),l.version&&a.jsxs("span",{className:"text-muted-foreground",children:["v",l.version]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Te,{placeholder:"Version (empty = latest)",value:n,onChange:c=>r(c.target.value),className:"max-w-xs"}),a.jsxs(K,{onClick:()=>u("install_guards"),disabled:s!==null,variant:"default",children:[s==="install_guards"?a.jsx(He,{className:"h-4 w-4 mr-1 animate-spin"}):a.jsx($t,{className:"h-4 w-4 mr-1"}),"Install"]}),a.jsxs(K,{onClick:()=>u("upgrade_guards"),disabled:s!==null,variant:"outline",children:[s==="upgrade_guards"?a.jsx(He,{className:"h-4 w-4 mr-1 animate-spin"}):a.jsx(gl,{className:"h-4 w-4 mr-1"}),"Upgrade"]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.jsx("strong",{children:"Install"}),": runs ",a.jsx("code",{children:"openclaw plugins install @opentrust/guards"})," on the remote host.",a.jsx("br",{}),a.jsx("strong",{children:"Upgrade"}),": uninstalls the current version then installs the specified (or latest) version.",a.jsx("br",{}),"Check the ",a.jsx("strong",{children:"Commands"})," tab to see execution results."]})]})}function yI({host:e,showToast:t}){const n=Object.keys(e.services??{}),[r,s]=m.useState(n[0]??"core"),[o,i]=m.useState(null),[l,u]=m.useState(!1),c=async()=>{u(!0);try{await re.hosts.sendCommand(e.id,"fetch_logs",{service:r,lines:200}),t("Log fetch command sent. Check Commands tab for result.","success")}catch{t("Failed to send fetch_logs command","error")}finally{u(!1)}};return a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Xe,{children:"Service:"}),a.jsx("select",{className:"rounded border border-border bg-background px-2 py-1 text-sm",value:r,onChange:h=>s(h.target.value),children:n.map(h=>a.jsx("option",{value:h,children:h},h))}),a.jsxs(K,{variant:"outline",size:"sm",onClick:c,disabled:l,children:[a.jsx(Is,{className:"h-3 w-3 mr-1"})," Fetch Logs"]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:'The fetch_logs command is sent to the host CLI daemon. View the result in the "Commands" tab once completed.'})]})}function vI({host:e,showToast:t}){const[n,r]=m.useState(""),[s,o]=m.useState(!1),i=async()=>{o(!0);try{await re.hosts.sendCommand(e.id,"upgrade",n?{version:n}:{}),t("Upgrade command sent","success")}catch{t("Failed to send upgrade command","error")}finally{o(!1)}};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[a.jsxs("span",{children:["Current CLI version: ",a.jsxs("strong",{children:["v",e.cliVersion]})]}),a.jsxs("span",{children:["Project mode: ",a.jsx(ye,{variant:"secondary",children:e.projectMode})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Te,{placeholder:"Target version (empty = latest)",value:n,onChange:l=>r(l.target.value),className:"max-w-xs"}),a.jsxs(K,{onClick:i,disabled:s,children:[a.jsx(gl,{className:"h-4 w-4 mr-1"})," Upgrade"]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Runs ",a.jsx("code",{children:"npm install -g @opentrust/cli@version"})," and upgrades project packages on the remote host."]})]})}function wI({host:e,showToast:t}){const[n,r]=m.useState(""),[s,o]=m.useState(""),[i,l]=m.useState(!1),u=async()=>{if(n){l(!0);try{await re.hosts.sendCommand(e.id,"update_env",{key:n,value:s}),t(`ENV update sent: ${n}`,"success"),r(""),o("")}catch{t("Failed to send config update","error")}finally{l(!1)}}};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Update environment variables in the remote host's ",a.jsx("code",{children:".env"})," file."]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 max-w-lg",children:[a.jsxs("div",{children:[a.jsx(Xe,{className:"text-xs",children:"Key"}),a.jsx(Te,{placeholder:"e.g. CORE_API_KEY",value:n,onChange:c=>r(c.target.value)})]}),a.jsxs("div",{children:[a.jsx(Xe,{className:"text-xs",children:"Value"}),a.jsx(Te,{placeholder:"Value",value:s,onChange:c=>o(c.target.value)})]})]}),a.jsxs(K,{size:"sm",onClick:u,disabled:i||!n,children:[a.jsx(qt,{className:"h-3 w-3 mr-1"})," Update .env"]})]})}function NI({hostId:e}){const[t,n]=m.useState([]),[r,s]=m.useState(!0),o=m.useCallback(async()=>{try{const u=await re.hosts.commands(e);n(u.data)}catch{}s(!1)},[e]);m.useEffect(()=>{o();const u=setInterval(o,8e3);return()=>clearInterval(u)},[o]);const i=u=>{const c={pending:"bg-yellow-500/20 text-yellow-700 dark:text-yellow-400",running:"bg-blue-500/20 text-blue-700 dark:text-blue-400",completed:"bg-green-500/20 text-green-700 dark:text-green-400",failed:"bg-red-500/20 text-red-700 dark:text-red-400"};return a.jsx("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium ${c[u]??"bg-gray-500/20 text-gray-500"}`,children:u})},l=u=>({start_service:a.jsx(Ta,{className:"h-3 w-3"}),stop_service:a.jsx(To,{className:"h-3 w-3"}),restart_service:a.jsx(La,{className:"h-3 w-3"}),upgrade:a.jsx(gl,{className:"h-3 w-3"}),fetch_logs:a.jsx(Is,{className:"h-3 w-3"}),update_env:a.jsx(qt,{className:"h-3 w-3"})})[u]??a.jsx(ms,{className:"h-3 w-3"});return r?a.jsx("div",{className:"text-sm text-muted-foreground py-4",children:"Loading..."}):t.length===0?a.jsx("div",{className:"text-sm text-muted-foreground py-4",children:"No commands yet."}):a.jsx("div",{className:"space-y-2 max-h-[400px] overflow-y-auto",children:t.map(u=>a.jsxs("div",{className:"rounded border border-border p-3 text-sm",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[l(u.type),a.jsx("span",{className:"font-medium",children:u.type.replace(/_/g," ")}),i(u.status)]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(u.createdAt).toLocaleString()})]}),u.payload&&a.jsx("pre",{className:"text-xs bg-muted rounded px-2 py-1 mt-1 overflow-x-auto",children:JSON.stringify(u.payload,null,2)}),u.result&&a.jsx("pre",{className:`text-xs rounded px-2 py-1 mt-1 overflow-x-auto ${u.status==="failed"?"bg-red-500/10":"bg-green-500/10"}`,children:JSON.stringify(u.result,null,2)})]},u.id))})}function SI({host:e,onRemove:t}){const n=e.metadata??{},[r,s]=m.useState(!1),o=[{label:"Host ID",value:e.id},{label:"Hostname",value:e.hostname},{label:"OS",value:`${e.os} (${e.arch})`},{label:"IP",value:e.ip},{label:"CLI Version",value:e.cliVersion},{label:"Project Mode",value:e.projectMode},{label:"Project Root",value:e.projectRoot},{label:"CPU",value:`${n.cpuModel} (${n.cpuCount} cores)`},{label:"Memory",value:`${n.freeMemMB} MB free / ${n.totalMemMB} MB total`},{label:"Node.js",value:String(n.nodeVersion??"")},{label:"Uptime",value:n.uptime?`${Math.round(Number(n.uptime)/3600)} hours`:""},{label:"Last Seen",value:new Date(e.lastSeenAt).toLocaleString()},{label:"Connected Since",value:new Date(e.createdAt).toLocaleString()}];return a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2",children:o.filter(i=>i.value).map(i=>a.jsxs("div",{className:"flex gap-2 text-sm py-1",children:[a.jsxs("span",{className:"text-muted-foreground min-w-[120px]",children:[i.label,":"]}),a.jsx("span",{className:"font-mono text-xs break-all",children:i.value})]},i.label))}),a.jsx("div",{className:"border-t border-border pt-4",children:a.jsxs(K,{variant:"destructive",size:"sm",onClick:()=>s(!0),children:[a.jsx(Zt,{className:"h-3 w-3 mr-1"})," Remove Host"]})}),a.jsx(Pr,{open:r,onOpenChange:s,children:a.jsxs(er,{children:[a.jsxs(Mr,{children:[a.jsx(tr,{children:"Remove Host"}),a.jsxs(nr,{children:["Remove ",a.jsx("strong",{children:e.hostname})," from the Dashboard? The host will need to run"," ",a.jsx("code",{children:"opentrust connect"})," again to re-register."]})]}),a.jsxs(Ir,{children:[a.jsx(K,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),a.jsx(K,{variant:"destructive",onClick:()=>{s(!1),t()},children:"Remove"})]})]})})]})}function bI({children:e}){const{isAuthenticated:t,isLoading:n}=Xd();return n?a.jsx("div",{className:"flex min-h-screen items-center justify-center",children:a.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading..."})}):t?a.jsx(a.Fragment,{children:e}):a.jsx(kc,{to:"/login",replace:!0})}function jI(){return a.jsxs(yS,{children:[a.jsx(Ge,{path:"/login",element:a.jsx(xj,{})}),a.jsxs(Ge,{element:a.jsx(bI,{children:a.jsx(gj,{})}),children:[a.jsx(Ge,{index:!0,element:a.jsx(kc,{to:"/inventory/agents",replace:!0})}),a.jsx(Ge,{path:"/inventory/agents",element:a.jsx(Wk,{})}),a.jsx(Ge,{path:"/inventory/agents/:id",element:a.jsx(Yk,{})}),a.jsx(Ge,{path:"/inventory/identities",element:a.jsx(Jk,{})}),a.jsx(Ge,{path:"/inventory/permissions",element:a.jsx(eC,{})}),a.jsx(Ge,{path:"/secure/risk",element:a.jsx(tC,{})}),a.jsx(Ge,{path:"/secure/graph",element:a.jsx(bM,{})}),a.jsx(Ge,{path:"/ops/skills",element:a.jsx(BM,{})}),a.jsx(Ge,{path:"/ops/plugins",element:a.jsx(QM,{})}),a.jsx(Ge,{path:"/inventory/hosts",element:a.jsx(fI,{})}),a.jsx(Ge,{path:"/system/logs",element:a.jsx(oI,{})}),a.jsx(Ge,{path:"/system/settings",element:a.jsx(cI,{})})]}),a.jsx(Ge,{path:"*",element:a.jsx(kc,{to:"/inventory/agents",replace:!0})})]})}Iu.createRoot(document.getElementById("root")).render(a.jsx(Ut.StrictMode,{children:a.jsx(VS,{basename:"/dashboard",children:a.jsx(JS,{children:a.jsx(tb,{children:a.jsx(jI,{})})})})}));
403
+ //# sourceMappingURL=index-Cbxrxznf.js.map