@opentrust/dashboard 7.3.22 → 7.3.23

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,398 @@
1
+ function Y1(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 Hc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fp={exports:{}},Ka={},hp={exports:{}},se={};/**
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 Ho=Symbol.for("react.element"),G1=Symbol.for("react.portal"),X1=Symbol.for("react.fragment"),Q1=Symbol.for("react.strict_mode"),q1=Symbol.for("react.profiler"),Z1=Symbol.for("react.provider"),J1=Symbol.for("react.context"),ew=Symbol.for("react.forward_ref"),tw=Symbol.for("react.suspense"),nw=Symbol.for("react.memo"),rw=Symbol.for("react.lazy"),Lf=Symbol.iterator;function sw(e){return e===null||typeof e!="object"?null:(e=Lf&&e[Lf]||e["@@iterator"],typeof e=="function"?e:null)}var mp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},pp=Object.assign,gp={};function ws(e,t,n){this.props=e,this.context=t,this.refs=gp,this.updater=n||mp}ws.prototype.isReactComponent={};ws.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")};ws.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function xp(){}xp.prototype=ws.prototype;function Vc(e,t,n){this.props=e,this.context=t,this.refs=gp,this.updater=n||mp}var Bc=Vc.prototype=new xp;Bc.constructor=Vc;pp(Bc,ws.prototype);Bc.isPureReactComponent=!0;var Af=Array.isArray,yp=Object.prototype.hasOwnProperty,Uc={current:null},vp={key:!0,ref:!0,__self:!0,__source:!0};function wp(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)yp.call(t,r)&&!vp.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];s.children=u}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:Ho,type:e,key:o,ref:i,props:s,_owner:Uc.current}}function ow(e,t){return{$$typeof:Ho,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Wc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ho}function iw(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var zf=/\/+/g;function Rl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?iw(""+e.key):t.toString(36)}function Di(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 Ho:case G1:i=!0}}if(i)return i=e,s=s(i),e=r===""?"."+Rl(i,0):r,Af(s)?(n="",e!=null&&(n=e.replace(zf,"$&/")+"/"),Di(s,t,n,"",function(c){return c})):s!=null&&(Wc(s)&&(s=ow(s,n+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(zf,"$&/")+"/")+e)),t.push(s)),1;if(i=0,r=r===""?".":r+":",Af(e))for(var a=0;a<e.length;a++){o=e[a];var u=r+Rl(o,a);i+=Di(o,t,n,u,s)}else if(u=sw(e),typeof u=="function")for(e=u.call(e),a=0;!(o=e.next()).done;)o=o.value,u=r+Rl(o,a++),i+=Di(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 ri(e,t,n){if(e==null)return e;var r=[],s=0;return Di(e,r,"","",function(o){return t.call(n,o,s++)}),r}function aw(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 Ze={current:null},$i={transition:null},lw={ReactCurrentDispatcher:Ze,ReactCurrentBatchConfig:$i,ReactCurrentOwner:Uc};se.Children={map:ri,forEach:function(e,t,n){ri(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ri(e,function(){t++}),t},toArray:function(e){return ri(e,function(t){return t})||[]},only:function(e){if(!Wc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};se.Component=ws;se.Fragment=X1;se.Profiler=q1;se.PureComponent=Vc;se.StrictMode=Q1;se.Suspense=tw;se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lw;se.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=pp({},e.props),s=e.key,o=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,i=Uc.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(u in t)yp.call(t,u)&&!vp.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&a!==void 0?a[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){a=Array(u);for(var c=0;c<u;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Ho,type:e.type,key:s,ref:o,props:r,_owner:i}};se.createContext=function(e){return e={$$typeof:J1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Z1,_context:e},e.Consumer=e};se.createElement=wp;se.createFactory=function(e){var t=wp.bind(null,e);return t.type=e,t};se.createRef=function(){return{current:null}};se.forwardRef=function(e){return{$$typeof:ew,render:e}};se.isValidElement=Wc;se.lazy=function(e){return{$$typeof:rw,_payload:{_status:-1,_result:e},_init:aw}};se.memo=function(e,t){return{$$typeof:nw,type:e,compare:t===void 0?null:t}};se.startTransition=function(e){var t=$i.transition;$i.transition={};try{e()}finally{$i.transition=t}};se.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};se.useCallback=function(e,t){return Ze.current.useCallback(e,t)};se.useContext=function(e){return Ze.current.useContext(e)};se.useDebugValue=function(){};se.useDeferredValue=function(e){return Ze.current.useDeferredValue(e)};se.useEffect=function(e,t){return Ze.current.useEffect(e,t)};se.useId=function(){return Ze.current.useId()};se.useImperativeHandle=function(e,t,n){return Ze.current.useImperativeHandle(e,t,n)};se.useInsertionEffect=function(e,t){return Ze.current.useInsertionEffect(e,t)};se.useLayoutEffect=function(e,t){return Ze.current.useLayoutEffect(e,t)};se.useMemo=function(e,t){return Ze.current.useMemo(e,t)};se.useReducer=function(e,t,n){return Ze.current.useReducer(e,t,n)};se.useRef=function(e){return Ze.current.useRef(e)};se.useState=function(e){return Ze.current.useState(e)};se.useSyncExternalStore=function(e,t,n){return Ze.current.useSyncExternalStore(e,t,n)};se.useTransition=function(){return Ze.current.useTransition()};se.version="18.3.0";hp.exports=se;var p=hp.exports;const Bt=Hc(p),uw=Y1({__proto__:null,default:Bt},[p]);/**
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 cw=p,dw=Symbol.for("react.element"),fw=Symbol.for("react.fragment"),hw=Object.prototype.hasOwnProperty,mw=cw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,pw={key:!0,ref:!0,__self:!0,__source:!0};function Np(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)hw.call(t,r)&&!pw.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:dw,type:e,key:o,ref:i,props:s,_owner:mw.current}}Ka.Fragment=fw;Ka.jsx=Np;Ka.jsxs=Np;fp.exports=Ka;var l=fp.exports,ju={},Sp={exports:{}},mt={},bp={exports:{}},kp={};/**
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(E,P){var z=E.length;E.push(P);e:for(;0<z;){var F=z-1>>>1,O=E[F];if(0<s(O,P))E[F]=P,E[z]=O,z=F;else break e}}function n(E){return E.length===0?null:E[0]}function r(E){if(E.length===0)return null;var P=E[0],z=E.pop();if(z!==P){E[0]=z;e:for(var F=0,O=E.length,U=O>>>1;F<U;){var B=2*(F+1)-1,K=E[B],Y=B+1,G=E[Y];if(0>s(K,z))Y<O&&0>s(G,K)?(E[F]=G,E[Y]=z,F=Y):(E[F]=K,E[B]=z,F=B);else if(Y<O&&0>s(G,z))E[F]=G,E[Y]=z,F=Y;else break e}}return P}function s(E,P){var z=E.sortIndex-P.sortIndex;return z!==0?z:E.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var u=[],c=[],h=1,d=null,f=3,x=!1,y=!1,w=!1,N=typeof setTimeout=="function"?setTimeout:null,m=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 g(E){for(var P=n(c);P!==null;){if(P.callback===null)r(c);else if(P.startTime<=E)r(c),P.sortIndex=P.expirationTime,t(u,P);else break;P=n(c)}}function S(E){if(w=!1,g(E),!y)if(n(u)!==null)y=!0,M(b);else{var P=n(c);P!==null&&D(S,P.startTime-E)}}function b(E,P){y=!1,w&&(w=!1,m(_),_=-1),x=!0;var z=f;try{for(g(P),d=n(u);d!==null&&(!(d.expirationTime>P)||E&&!R());){var F=d.callback;if(typeof F=="function"){d.callback=null,f=d.priorityLevel;var O=F(d.expirationTime<=P);P=e.unstable_now(),typeof O=="function"?d.callback=O:d===n(u)&&r(u),g(P)}else r(u);d=n(u)}if(d!==null)var U=!0;else{var B=n(c);B!==null&&D(S,B.startTime-P),U=!1}return U}finally{d=null,f=z,x=!1}}var j=!1,k=null,_=-1,I=5,$=-1;function R(){return!(e.unstable_now()-$<I)}function T(){if(k!==null){var E=e.unstable_now();$=E;var P=!0;try{P=k(!0,E)}finally{P?A():(j=!1,k=null)}}else j=!1}var A;if(typeof v=="function")A=function(){v(T)};else if(typeof MessageChannel<"u"){var C=new MessageChannel,L=C.port2;C.port1.onmessage=T,A=function(){L.postMessage(null)}}else A=function(){N(T,0)};function M(E){k=E,j||(j=!0,A())}function D(E,P){_=N(function(){E(e.unstable_now())},P)}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(E){E.callback=null},e.unstable_continueExecution=function(){y||x||(y=!0,M(b))},e.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<E?Math.floor(1e3/E):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(E){switch(f){case 1:case 2:case 3:var P=3;break;default:P=f}var z=f;f=P;try{return E()}finally{f=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(E,P){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var z=f;f=E;try{return P()}finally{f=z}},e.unstable_scheduleCallback=function(E,P,z){var F=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?F+z:F):z=F,E){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=z+O,E={id:h++,callback:P,priorityLevel:E,startTime:z,expirationTime:O,sortIndex:-1},z>F?(E.sortIndex=z,t(c,E),n(u)===null&&E===n(c)&&(w?(m(_),_=-1):w=!0,D(S,z-F))):(E.sortIndex=O,t(u,E),y||x||(y=!0,M(b))),E},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(E){var P=f;return function(){var z=f;f=P;try{return E.apply(this,arguments)}finally{f=z}}}})(kp);bp.exports=kp;var gw=bp.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 xw=p,ft=gw;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 jp=new Set,mo={};function Sr(e,t){ns(e,t),ns(e+"Capture",t)}function ns(e,t){for(mo[e]=t,e=0;e<t.length;e++)jp.add(t[e])}var dn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cu=Object.prototype.hasOwnProperty,yw=/^[: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]*$/,Df={},$f={};function vw(e){return Cu.call($f,e)?!0:Cu.call(Df,e)?!1:yw.test(e)?$f[e]=!0:(Df[e]=!0,!1)}function ww(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 Nw(e,t,n,r){if(t===null||typeof t>"u"||ww(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 Je(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 Je(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 Je(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ve[e]=new Je(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ve[e]=new Je(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 Je(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ve[e]=new Je(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ve[e]=new Je(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ve[e]=new Je(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ve[e]=new Je(e,5,!1,e.toLowerCase(),null,!1,!1)});var Kc=/[\-:]([a-z])/g;function Yc(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(Kc,Yc);Ve[t]=new Je(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(Kc,Yc);Ve[t]=new Je(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(Kc,Yc);Ve[t]=new Je(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ve[e]=new Je(e,1,!1,e.toLowerCase(),null,!1,!1)});Ve.xlinkHref=new Je("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ve[e]=new Je(e,1,!1,e.toLowerCase(),null,!0,!0)});function Gc(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")&&(Nw(t,n,s,r)&&(n=null),r||s===null?vw(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 xn=xw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,si=Symbol.for("react.element"),Tr=Symbol.for("react.portal"),Lr=Symbol.for("react.fragment"),Xc=Symbol.for("react.strict_mode"),Eu=Symbol.for("react.profiler"),Cp=Symbol.for("react.provider"),Ep=Symbol.for("react.context"),Qc=Symbol.for("react.forward_ref"),_u=Symbol.for("react.suspense"),Pu=Symbol.for("react.suspense_list"),qc=Symbol.for("react.memo"),En=Symbol.for("react.lazy"),_p=Symbol.for("react.offscreen"),Of=Symbol.iterator;function As(e){return e===null||typeof e!="object"?null:(e=Of&&e[Of]||e["@@iterator"],typeof e=="function"?e:null)}var be=Object.assign,Tl;function Xs(e){if(Tl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Tl=t&&t[1]||""}return`
34
+ `+Tl+e}var Ll=!1;function Al(e,t){if(!e||Ll)return"";Ll=!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,a=o.length-1;1<=i&&0<=a&&s[i]!==o[a];)a--;for(;1<=i&&0<=a;i--,a--)if(s[i]!==o[a]){if(i!==1||a!==1)do if(i--,a--,0>a||s[i]!==o[a]){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<=a);break}}}finally{Ll=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Xs(e):""}function Sw(e){switch(e.tag){case 5:return Xs(e.type);case 16:return Xs("Lazy");case 13:return Xs("Suspense");case 19:return Xs("SuspenseList");case 0:case 2:case 15:return e=Al(e.type,!1),e;case 11:return e=Al(e.type.render,!1),e;case 1:return e=Al(e.type,!0),e;default:return""}}function Mu(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 Lr:return"Fragment";case Tr:return"Portal";case Eu:return"Profiler";case Xc:return"StrictMode";case _u:return"Suspense";case Pu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ep:return(e.displayName||"Context")+".Consumer";case Cp:return(e._context.displayName||"Context")+".Provider";case Qc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qc:return t=e.displayName||null,t!==null?t:Mu(e.type)||"Memo";case En:t=e._payload,e=e._init;try{return Mu(e(t))}catch{}}return null}function bw(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 Mu(t);case 8:return t===Xc?"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 Bn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Pp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kw(e){var t=Pp(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 oi(e){e._valueTracker||(e._valueTracker=kw(e))}function Mp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Pp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function sa(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 Iu(e,t){var n=t.checked;return be({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ff(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Bn(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 Ip(e,t){t=t.checked,t!=null&&Gc(e,"checked",t,!1)}function Ru(e,t){Ip(e,t);var n=Bn(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")?Tu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Tu(e,t.type,Bn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Hf(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 Tu(e,t,n){(t!=="number"||sa(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Qs=Array.isArray;function Yr(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=""+Bn(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 Lu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return be({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Vf(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:Bn(n)}}function Rp(e,t){var n=Bn(t.value),r=Bn(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 Bf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Tp(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 Au(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Tp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ii,Lp=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(ii=ii||document.createElement("div"),ii.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ii.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function po(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var to={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},jw=["Webkit","ms","Moz","O"];Object.keys(to).forEach(function(e){jw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),to[t]=to[e]})});function Ap(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||to.hasOwnProperty(e)&&to[e]?(""+t).trim():t+"px"}function zp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Ap(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var Cw=be({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 zu(e,t){if(t){if(Cw[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 Du(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 $u=null;function Zc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ou=null,Gr=null,Xr=null;function Uf(e){if(e=Uo(e)){if(typeof Ou!="function")throw Error(H(280));var t=e.stateNode;t&&(t=qa(t),Ou(e.stateNode,e.type,t))}}function Dp(e){Gr?Xr?Xr.push(e):Xr=[e]:Gr=e}function $p(){if(Gr){var e=Gr,t=Xr;if(Xr=Gr=null,Uf(e),t)for(e=0;e<t.length;e++)Uf(t[e])}}function Op(e,t){return e(t)}function Fp(){}var zl=!1;function Hp(e,t,n){if(zl)return e(t,n);zl=!0;try{return Op(e,t,n)}finally{zl=!1,(Gr!==null||Xr!==null)&&(Fp(),$p())}}function go(e,t){var n=e.stateNode;if(n===null)return null;var r=qa(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 Fu=!1;if(dn)try{var zs={};Object.defineProperty(zs,"passive",{get:function(){Fu=!0}}),window.addEventListener("test",zs,zs),window.removeEventListener("test",zs,zs)}catch{Fu=!1}function Ew(e,t,n,r,s,o,i,a,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(h){this.onError(h)}}var no=!1,oa=null,ia=!1,Hu=null,_w={onError:function(e){no=!0,oa=e}};function Pw(e,t,n,r,s,o,i,a,u){no=!1,oa=null,Ew.apply(_w,arguments)}function Mw(e,t,n,r,s,o,i,a,u){if(Pw.apply(this,arguments),no){if(no){var c=oa;no=!1,oa=null}else throw Error(H(198));ia||(ia=!0,Hu=c)}}function br(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 Vp(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 Wf(e){if(br(e)!==e)throw Error(H(188))}function Iw(e){var t=e.alternate;if(!t){if(t=br(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 Wf(s),e;if(o===r)return Wf(s),t;o=o.sibling}throw Error(H(188))}if(n.return!==r.return)n=s,r=o;else{for(var i=!1,a=s.child;a;){if(a===n){i=!0,n=s,r=o;break}if(a===r){i=!0,r=s,n=o;break}a=a.sibling}if(!i){for(a=o.child;a;){if(a===n){i=!0,n=o,r=s;break}if(a===r){i=!0,r=o,n=s;break}a=a.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 Bp(e){return e=Iw(e),e!==null?Up(e):null}function Up(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Up(e);if(t!==null)return t;e=e.sibling}return null}var Wp=ft.unstable_scheduleCallback,Kf=ft.unstable_cancelCallback,Rw=ft.unstable_shouldYield,Tw=ft.unstable_requestPaint,Ce=ft.unstable_now,Lw=ft.unstable_getCurrentPriorityLevel,Jc=ft.unstable_ImmediatePriority,Kp=ft.unstable_UserBlockingPriority,aa=ft.unstable_NormalPriority,Aw=ft.unstable_LowPriority,Yp=ft.unstable_IdlePriority,Ya=null,Yt=null;function zw(e){if(Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(Ya,e,void 0,(e.current.flags&128)===128)}catch{}}var Tt=Math.clz32?Math.clz32:Ow,Dw=Math.log,$w=Math.LN2;function Ow(e){return e>>>=0,e===0?32:31-(Dw(e)/$w|0)|0}var ai=64,li=4194304;function qs(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 la(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 a=i&~s;a!==0?r=qs(a):(o&=i,o!==0&&(r=qs(o)))}else i=n&~s,i!==0?r=qs(i):o!==0&&(r=qs(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-Tt(t),s=1<<n,r|=e[n],t&=~s;return r}function Fw(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 Hw(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-Tt(o),a=1<<i,u=s[i];u===-1?(!(a&n)||a&r)&&(s[i]=Fw(a,t)):u<=t&&(e.expiredLanes|=a),o&=~a}}function Vu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Gp(){var e=ai;return ai<<=1,!(ai&4194240)&&(ai=64),e}function Dl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Vo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Tt(t),e[t]=n}function Vw(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-Tt(n),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function ed(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Tt(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var de=0;function Xp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Qp,td,qp,Zp,Jp,Bu=!1,ui=[],Ln=null,An=null,zn=null,xo=new Map,yo=new Map,Pn=[],Bw="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 Yf(e,t){switch(e){case"focusin":case"focusout":Ln=null;break;case"dragenter":case"dragleave":An=null;break;case"mouseover":case"mouseout":zn=null;break;case"pointerover":case"pointerout":xo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":yo.delete(t.pointerId)}}function Ds(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=Uo(t),t!==null&&td(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Uw(e,t,n,r,s){switch(t){case"focusin":return Ln=Ds(Ln,e,t,n,r,s),!0;case"dragenter":return An=Ds(An,e,t,n,r,s),!0;case"mouseover":return zn=Ds(zn,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return xo.set(o,Ds(xo.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,yo.set(o,Ds(yo.get(o)||null,e,t,n,r,s)),!0}return!1}function eg(e){var t=nr(e.target);if(t!==null){var n=br(t);if(n!==null){if(t=n.tag,t===13){if(t=Vp(n),t!==null){e.blockedOn=t,Jp(e.priority,function(){qp(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 Oi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Uu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);$u=r,n.target.dispatchEvent(r),$u=null}else return t=Uo(n),t!==null&&td(t),e.blockedOn=n,!1;t.shift()}return!0}function Gf(e,t,n){Oi(e)&&n.delete(t)}function Ww(){Bu=!1,Ln!==null&&Oi(Ln)&&(Ln=null),An!==null&&Oi(An)&&(An=null),zn!==null&&Oi(zn)&&(zn=null),xo.forEach(Gf),yo.forEach(Gf)}function $s(e,t){e.blockedOn===t&&(e.blockedOn=null,Bu||(Bu=!0,ft.unstable_scheduleCallback(ft.unstable_NormalPriority,Ww)))}function vo(e){function t(s){return $s(s,e)}if(0<ui.length){$s(ui[0],e);for(var n=1;n<ui.length;n++){var r=ui[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ln!==null&&$s(Ln,e),An!==null&&$s(An,e),zn!==null&&$s(zn,e),xo.forEach(t),yo.forEach(t),n=0;n<Pn.length;n++)r=Pn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Pn.length&&(n=Pn[0],n.blockedOn===null);)eg(n),n.blockedOn===null&&Pn.shift()}var Qr=xn.ReactCurrentBatchConfig,ua=!0;function Kw(e,t,n,r){var s=de,o=Qr.transition;Qr.transition=null;try{de=1,nd(e,t,n,r)}finally{de=s,Qr.transition=o}}function Yw(e,t,n,r){var s=de,o=Qr.transition;Qr.transition=null;try{de=4,nd(e,t,n,r)}finally{de=s,Qr.transition=o}}function nd(e,t,n,r){if(ua){var s=Uu(e,t,n,r);if(s===null)Yl(e,t,r,ca,n),Yf(e,r);else if(Uw(s,e,t,n,r))r.stopPropagation();else if(Yf(e,r),t&4&&-1<Bw.indexOf(e)){for(;s!==null;){var o=Uo(s);if(o!==null&&Qp(o),o=Uu(e,t,n,r),o===null&&Yl(e,t,r,ca,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else Yl(e,t,r,null,n)}}var ca=null;function Uu(e,t,n,r){if(ca=null,e=Zc(r),e=nr(e),e!==null)if(t=br(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Vp(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 ca=e,null}function tg(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(Lw()){case Jc:return 1;case Kp:return 4;case aa:case Aw:return 16;case Yp:return 536870912;default:return 16}default:return 16}}var Rn=null,rd=null,Fi=null;function ng(){if(Fi)return Fi;var e,t=rd,n=t.length,r,s="value"in Rn?Rn.value:Rn.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 Fi=s.slice(e,1<r?1-r:void 0)}function Hi(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 ci(){return!0}function Xf(){return!1}function pt(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 a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?ci:Xf,this.isPropagationStopped=Xf,this}return be(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=ci)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ci)},persist:function(){},isPersistent:ci}),t}var Ns={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sd=pt(Ns),Bo=be({},Ns,{view:0,detail:0}),Gw=pt(Bo),$l,Ol,Os,Ga=be({},Bo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:od,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!==Os&&(Os&&e.type==="mousemove"?($l=e.screenX-Os.screenX,Ol=e.screenY-Os.screenY):Ol=$l=0,Os=e),$l)},movementY:function(e){return"movementY"in e?e.movementY:Ol}}),Qf=pt(Ga),Xw=be({},Ga,{dataTransfer:0}),Qw=pt(Xw),qw=be({},Bo,{relatedTarget:0}),Fl=pt(qw),Zw=be({},Ns,{animationName:0,elapsedTime:0,pseudoElement:0}),Jw=pt(Zw),e2=be({},Ns,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),t2=pt(e2),n2=be({},Ns,{data:0}),qf=pt(n2),r2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},s2={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"},o2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function i2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=o2[e])?!!t[e]:!1}function od(){return i2}var a2=be({},Bo,{key:function(e){if(e.key){var t=r2[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Hi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?s2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:od,charCode:function(e){return e.type==="keypress"?Hi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Hi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),l2=pt(a2),u2=be({},Ga,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zf=pt(u2),c2=be({},Bo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:od}),d2=pt(c2),f2=be({},Ns,{propertyName:0,elapsedTime:0,pseudoElement:0}),h2=pt(f2),m2=be({},Ga,{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}),p2=pt(m2),g2=[9,13,27,32],id=dn&&"CompositionEvent"in window,ro=null;dn&&"documentMode"in document&&(ro=document.documentMode);var x2=dn&&"TextEvent"in window&&!ro,rg=dn&&(!id||ro&&8<ro&&11>=ro),Jf=" ",eh=!1;function sg(e,t){switch(e){case"keyup":return g2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function og(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ar=!1;function y2(e,t){switch(e){case"compositionend":return og(t);case"keypress":return t.which!==32?null:(eh=!0,Jf);case"textInput":return e=t.data,e===Jf&&eh?null:e;default:return null}}function v2(e,t){if(Ar)return e==="compositionend"||!id&&sg(e,t)?(e=ng(),Fi=rd=Rn=null,Ar=!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 rg&&t.locale!=="ko"?null:t.data;default:return null}}var w2={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 th(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!w2[e.type]:t==="textarea"}function ig(e,t,n,r){Dp(r),t=da(t,"onChange"),0<t.length&&(n=new sd("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var so=null,wo=null;function N2(e){xg(e,0)}function Xa(e){var t=$r(e);if(Mp(t))return e}function S2(e,t){if(e==="change")return t}var ag=!1;if(dn){var Hl;if(dn){var Vl="oninput"in document;if(!Vl){var nh=document.createElement("div");nh.setAttribute("oninput","return;"),Vl=typeof nh.oninput=="function"}Hl=Vl}else Hl=!1;ag=Hl&&(!document.documentMode||9<document.documentMode)}function rh(){so&&(so.detachEvent("onpropertychange",lg),wo=so=null)}function lg(e){if(e.propertyName==="value"&&Xa(wo)){var t=[];ig(t,wo,e,Zc(e)),Hp(N2,t)}}function b2(e,t,n){e==="focusin"?(rh(),so=t,wo=n,so.attachEvent("onpropertychange",lg)):e==="focusout"&&rh()}function k2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xa(wo)}function j2(e,t){if(e==="click")return Xa(t)}function C2(e,t){if(e==="input"||e==="change")return Xa(t)}function E2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var At=typeof Object.is=="function"?Object.is:E2;function No(e,t){if(At(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(!Cu.call(t,s)||!At(e[s],t[s]))return!1}return!0}function sh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function oh(e,t){var n=sh(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=sh(n)}}function ug(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ug(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cg(){for(var e=window,t=sa();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=sa(e.document)}return t}function ad(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 _2(e){var t=cg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ug(n.ownerDocument.documentElement,n)){if(r!==null&&ad(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=oh(n,o);var i=oh(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 P2=dn&&"documentMode"in document&&11>=document.documentMode,zr=null,Wu=null,oo=null,Ku=!1;function ih(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ku||zr==null||zr!==sa(r)||(r=zr,"selectionStart"in r&&ad(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}),oo&&No(oo,r)||(oo=r,r=da(Wu,"onSelect"),0<r.length&&(t=new sd("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=zr)))}function di(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Dr={animationend:di("Animation","AnimationEnd"),animationiteration:di("Animation","AnimationIteration"),animationstart:di("Animation","AnimationStart"),transitionend:di("Transition","TransitionEnd")},Bl={},dg={};dn&&(dg=document.createElement("div").style,"AnimationEvent"in window||(delete Dr.animationend.animation,delete Dr.animationiteration.animation,delete Dr.animationstart.animation),"TransitionEvent"in window||delete Dr.transitionend.transition);function Qa(e){if(Bl[e])return Bl[e];if(!Dr[e])return e;var t=Dr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in dg)return Bl[e]=t[n];return e}var fg=Qa("animationend"),hg=Qa("animationiteration"),mg=Qa("animationstart"),pg=Qa("transitionend"),gg=new Map,ah="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 Xn(e,t){gg.set(e,t),Sr(t,[e])}for(var Ul=0;Ul<ah.length;Ul++){var Wl=ah[Ul],M2=Wl.toLowerCase(),I2=Wl[0].toUpperCase()+Wl.slice(1);Xn(M2,"on"+I2)}Xn(fg,"onAnimationEnd");Xn(hg,"onAnimationIteration");Xn(mg,"onAnimationStart");Xn("dblclick","onDoubleClick");Xn("focusin","onFocus");Xn("focusout","onBlur");Xn(pg,"onTransitionEnd");ns("onMouseEnter",["mouseout","mouseover"]);ns("onMouseLeave",["mouseout","mouseover"]);ns("onPointerEnter",["pointerout","pointerover"]);ns("onPointerLeave",["pointerout","pointerover"]);Sr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Sr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Sr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Sr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Sr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Sr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zs="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(" "),R2=new Set("cancel close invalid load scroll toggle".split(" ").concat(Zs));function lh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Mw(r,t,void 0,e),e.currentTarget=null}function xg(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 a=r[i],u=a.instance,c=a.currentTarget;if(a=a.listener,u!==o&&s.isPropagationStopped())break e;lh(s,a,c),o=u}else for(i=0;i<r.length;i++){if(a=r[i],u=a.instance,c=a.currentTarget,a=a.listener,u!==o&&s.isPropagationStopped())break e;lh(s,a,c),o=u}}}if(ia)throw e=Hu,ia=!1,Hu=null,e}function pe(e,t){var n=t[qu];n===void 0&&(n=t[qu]=new Set);var r=e+"__bubble";n.has(r)||(yg(t,e,2,!1),n.add(r))}function Kl(e,t,n){var r=0;t&&(r|=4),yg(n,e,r,t)}var fi="_reactListening"+Math.random().toString(36).slice(2);function So(e){if(!e[fi]){e[fi]=!0,jp.forEach(function(n){n!=="selectionchange"&&(R2.has(n)||Kl(n,!1,e),Kl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fi]||(t[fi]=!0,Kl("selectionchange",!1,t))}}function yg(e,t,n,r){switch(tg(t)){case 1:var s=Kw;break;case 4:s=Yw;break;default:s=nd}n=s.bind(null,t,n,e),s=void 0,!Fu||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 Yl(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 a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.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(;a!==null;){if(i=nr(a),i===null)return;if(u=i.tag,u===5||u===6){r=o=i;continue e}a=a.parentNode}}r=r.return}Hp(function(){var c=o,h=Zc(n),d=[];e:{var f=gg.get(e);if(f!==void 0){var x=sd,y=e;switch(e){case"keypress":if(Hi(n)===0)break e;case"keydown":case"keyup":x=l2;break;case"focusin":y="focus",x=Fl;break;case"focusout":y="blur",x=Fl;break;case"beforeblur":case"afterblur":x=Fl;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":x=Qf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=Qw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=d2;break;case fg:case hg:case mg:x=Jw;break;case pg:x=h2;break;case"scroll":x=Gw;break;case"wheel":x=p2;break;case"copy":case"cut":case"paste":x=t2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Zf}var w=(t&4)!==0,N=!w&&e==="scroll",m=w?f!==null?f+"Capture":null:f;w=[];for(var v=c,g;v!==null;){g=v;var S=g.stateNode;if(g.tag===5&&S!==null&&(g=S,m!==null&&(S=go(v,m),S!=null&&w.push(bo(v,S,g)))),N)break;v=v.return}0<w.length&&(f=new x(f,y,null,n,h),d.push({event:f,listeners:w}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",f&&n!==$u&&(y=n.relatedTarget||n.fromElement)&&(nr(y)||y[fn]))break e;if((x||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,x?(y=n.relatedTarget||n.toElement,x=c,y=y?nr(y):null,y!==null&&(N=br(y),y!==N||y.tag!==5&&y.tag!==6)&&(y=null)):(x=null,y=c),x!==y)){if(w=Qf,S="onMouseLeave",m="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(w=Zf,S="onPointerLeave",m="onPointerEnter",v="pointer"),N=x==null?f:$r(x),g=y==null?f:$r(y),f=new w(S,v+"leave",x,n,h),f.target=N,f.relatedTarget=g,S=null,nr(h)===c&&(w=new w(m,v+"enter",y,n,h),w.target=g,w.relatedTarget=N,S=w),N=S,x&&y)t:{for(w=x,m=y,v=0,g=w;g;g=_r(g))v++;for(g=0,S=m;S;S=_r(S))g++;for(;0<v-g;)w=_r(w),v--;for(;0<g-v;)m=_r(m),g--;for(;v--;){if(w===m||m!==null&&w===m.alternate)break t;w=_r(w),m=_r(m)}w=null}else w=null;x!==null&&uh(d,f,x,w,!1),y!==null&&N!==null&&uh(d,N,y,w,!0)}}e:{if(f=c?$r(c):window,x=f.nodeName&&f.nodeName.toLowerCase(),x==="select"||x==="input"&&f.type==="file")var b=S2;else if(th(f))if(ag)b=C2;else{b=k2;var j=b2}else(x=f.nodeName)&&x.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(b=j2);if(b&&(b=b(e,c))){ig(d,b,n,h);break e}j&&j(e,f,c),e==="focusout"&&(j=f._wrapperState)&&j.controlled&&f.type==="number"&&Tu(f,"number",f.value)}switch(j=c?$r(c):window,e){case"focusin":(th(j)||j.contentEditable==="true")&&(zr=j,Wu=c,oo=null);break;case"focusout":oo=Wu=zr=null;break;case"mousedown":Ku=!0;break;case"contextmenu":case"mouseup":case"dragend":Ku=!1,ih(d,n,h);break;case"selectionchange":if(P2)break;case"keydown":case"keyup":ih(d,n,h)}var k;if(id)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else Ar?sg(e,n)&&(_="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(rg&&n.locale!=="ko"&&(Ar||_!=="onCompositionStart"?_==="onCompositionEnd"&&Ar&&(k=ng()):(Rn=h,rd="value"in Rn?Rn.value:Rn.textContent,Ar=!0)),j=da(c,_),0<j.length&&(_=new qf(_,e,null,n,h),d.push({event:_,listeners:j}),k?_.data=k:(k=og(n),k!==null&&(_.data=k)))),(k=x2?y2(e,n):v2(e,n))&&(c=da(c,"onBeforeInput"),0<c.length&&(h=new qf("onBeforeInput","beforeinput",null,n,h),d.push({event:h,listeners:c}),h.data=k))}xg(d,t)})}function bo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function da(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=go(e,n),o!=null&&r.unshift(bo(e,o,s)),o=go(e,t),o!=null&&r.push(bo(e,o,s))),e=e.return}return r}function _r(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function uh(e,t,n,r,s){for(var o=t._reactName,i=[];n!==null&&n!==r;){var a=n,u=a.alternate,c=a.stateNode;if(u!==null&&u===r)break;a.tag===5&&c!==null&&(a=c,s?(u=go(n,o),u!=null&&i.unshift(bo(n,u,a))):s||(u=go(n,o),u!=null&&i.push(bo(n,u,a)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var T2=/\r\n?/g,L2=/\u0000|\uFFFD/g;function ch(e){return(typeof e=="string"?e:""+e).replace(T2,`
38
+ `).replace(L2,"")}function hi(e,t,n){if(t=ch(t),ch(e)!==t&&n)throw Error(H(425))}function fa(){}var Yu=null,Gu=null;function Xu(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 Qu=typeof setTimeout=="function"?setTimeout:void 0,A2=typeof clearTimeout=="function"?clearTimeout:void 0,dh=typeof Promise=="function"?Promise:void 0,z2=typeof queueMicrotask=="function"?queueMicrotask:typeof dh<"u"?function(e){return dh.resolve(null).then(e).catch(D2)}:Qu;function D2(e){setTimeout(function(){throw e})}function Gl(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),vo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);vo(t)}function Dn(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 fh(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 Ss=Math.random().toString(36).slice(2),Wt="__reactFiber$"+Ss,ko="__reactProps$"+Ss,fn="__reactContainer$"+Ss,qu="__reactEvents$"+Ss,$2="__reactListeners$"+Ss,O2="__reactHandles$"+Ss;function nr(e){var t=e[Wt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[fn]||n[Wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fh(e);e!==null;){if(n=e[Wt])return n;e=fh(e)}return t}e=n,n=e.parentNode}return null}function Uo(e){return e=e[Wt]||e[fn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function $r(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function qa(e){return e[ko]||null}var Zu=[],Or=-1;function Qn(e){return{current:e}}function ge(e){0>Or||(e.current=Zu[Or],Zu[Or]=null,Or--)}function fe(e,t){Or++,Zu[Or]=e.current,e.current=t}var Un={},Ge=Qn(Un),st=Qn(!1),dr=Un;function rs(e,t){var n=e.type.contextTypes;if(!n)return Un;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 ot(e){return e=e.childContextTypes,e!=null}function ha(){ge(st),ge(Ge)}function hh(e,t,n){if(Ge.current!==Un)throw Error(H(168));fe(Ge,t),fe(st,n)}function vg(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,bw(e)||"Unknown",s));return be({},n,r)}function ma(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Un,dr=Ge.current,fe(Ge,e),fe(st,st.current),!0}function mh(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=vg(e,t,dr),r.__reactInternalMemoizedMergedChildContext=e,ge(st),ge(Ge),fe(Ge,e)):ge(st),fe(st,n)}var sn=null,Za=!1,Xl=!1;function wg(e){sn===null?sn=[e]:sn.push(e)}function F2(e){Za=!0,wg(e)}function qn(){if(!Xl&&sn!==null){Xl=!0;var e=0,t=de;try{var n=sn;for(de=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}sn=null,Za=!1}catch(s){throw sn!==null&&(sn=sn.slice(e+1)),Wp(Jc,qn),s}finally{de=t,Xl=!1}}return null}var Fr=[],Hr=0,pa=null,ga=0,gt=[],xt=0,fr=null,on=1,an="";function Jn(e,t){Fr[Hr++]=ga,Fr[Hr++]=pa,pa=e,ga=t}function Ng(e,t,n){gt[xt++]=on,gt[xt++]=an,gt[xt++]=fr,fr=e;var r=on;e=an;var s=32-Tt(r)-1;r&=~(1<<s),n+=1;var o=32-Tt(t)+s;if(30<o){var i=s-s%5;o=(r&(1<<i)-1).toString(32),r>>=i,s-=i,on=1<<32-Tt(t)+s|n<<s|r,an=o+e}else on=1<<o|n<<s|r,an=e}function ld(e){e.return!==null&&(Jn(e,1),Ng(e,1,0))}function ud(e){for(;e===pa;)pa=Fr[--Hr],Fr[Hr]=null,ga=Fr[--Hr],Fr[Hr]=null;for(;e===fr;)fr=gt[--xt],gt[xt]=null,an=gt[--xt],gt[xt]=null,on=gt[--xt],gt[xt]=null}var ct=null,ut=null,xe=!1,Pt=null;function Sg(e,t){var n=wt(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 ph(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,ct=e,ut=Dn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ct=e,ut=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=fr!==null?{id:on,overflow:an}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=wt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ct=e,ut=null,!0):!1;default:return!1}}function Ju(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ec(e){if(xe){var t=ut;if(t){var n=t;if(!ph(e,t)){if(Ju(e))throw Error(H(418));t=Dn(n.nextSibling);var r=ct;t&&ph(e,t)?Sg(r,n):(e.flags=e.flags&-4097|2,xe=!1,ct=e)}}else{if(Ju(e))throw Error(H(418));e.flags=e.flags&-4097|2,xe=!1,ct=e}}}function gh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ct=e}function mi(e){if(e!==ct)return!1;if(!xe)return gh(e),xe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Xu(e.type,e.memoizedProps)),t&&(t=ut)){if(Ju(e))throw bg(),Error(H(418));for(;t;)Sg(e,t),t=Dn(t.nextSibling)}if(gh(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){ut=Dn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ut=null}}else ut=ct?Dn(e.stateNode.nextSibling):null;return!0}function bg(){for(var e=ut;e;)e=Dn(e.nextSibling)}function ss(){ut=ct=null,xe=!1}function cd(e){Pt===null?Pt=[e]:Pt.push(e)}var H2=xn.ReactCurrentBatchConfig;function Fs(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 a=s.refs;i===null?delete a[o]:a[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 pi(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function xh(e){var t=e._init;return t(e._payload)}function kg(e){function t(m,v){if(e){var g=m.deletions;g===null?(m.deletions=[v],m.flags|=16):g.push(v)}}function n(m,v){if(!e)return null;for(;v!==null;)t(m,v),v=v.sibling;return null}function r(m,v){for(m=new Map;v!==null;)v.key!==null?m.set(v.key,v):m.set(v.index,v),v=v.sibling;return m}function s(m,v){return m=Hn(m,v),m.index=0,m.sibling=null,m}function o(m,v,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<v?(m.flags|=2,v):g):(m.flags|=2,v)):(m.flags|=1048576,v)}function i(m){return e&&m.alternate===null&&(m.flags|=2),m}function a(m,v,g,S){return v===null||v.tag!==6?(v=nu(g,m.mode,S),v.return=m,v):(v=s(v,g),v.return=m,v)}function u(m,v,g,S){var b=g.type;return b===Lr?h(m,v,g.props.children,S,g.key):v!==null&&(v.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===En&&xh(b)===v.type)?(S=s(v,g.props),S.ref=Fs(m,v,g),S.return=m,S):(S=Gi(g.type,g.key,g.props,null,m.mode,S),S.ref=Fs(m,v,g),S.return=m,S)}function c(m,v,g,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==g.containerInfo||v.stateNode.implementation!==g.implementation?(v=ru(g,m.mode,S),v.return=m,v):(v=s(v,g.children||[]),v.return=m,v)}function h(m,v,g,S,b){return v===null||v.tag!==7?(v=lr(g,m.mode,S,b),v.return=m,v):(v=s(v,g),v.return=m,v)}function d(m,v,g){if(typeof v=="string"&&v!==""||typeof v=="number")return v=nu(""+v,m.mode,g),v.return=m,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case si:return g=Gi(v.type,v.key,v.props,null,m.mode,g),g.ref=Fs(m,null,v),g.return=m,g;case Tr:return v=ru(v,m.mode,g),v.return=m,v;case En:var S=v._init;return d(m,S(v._payload),g)}if(Qs(v)||As(v))return v=lr(v,m.mode,g,null),v.return=m,v;pi(m,v)}return null}function f(m,v,g,S){var b=v!==null?v.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return b!==null?null:a(m,v,""+g,S);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case si:return g.key===b?u(m,v,g,S):null;case Tr:return g.key===b?c(m,v,g,S):null;case En:return b=g._init,f(m,v,b(g._payload),S)}if(Qs(g)||As(g))return b!==null?null:h(m,v,g,S,null);pi(m,g)}return null}function x(m,v,g,S,b){if(typeof S=="string"&&S!==""||typeof S=="number")return m=m.get(g)||null,a(v,m,""+S,b);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case si:return m=m.get(S.key===null?g:S.key)||null,u(v,m,S,b);case Tr:return m=m.get(S.key===null?g:S.key)||null,c(v,m,S,b);case En:var j=S._init;return x(m,v,g,j(S._payload),b)}if(Qs(S)||As(S))return m=m.get(g)||null,h(v,m,S,b,null);pi(v,S)}return null}function y(m,v,g,S){for(var b=null,j=null,k=v,_=v=0,I=null;k!==null&&_<g.length;_++){k.index>_?(I=k,k=null):I=k.sibling;var $=f(m,k,g[_],S);if($===null){k===null&&(k=I);break}e&&k&&$.alternate===null&&t(m,k),v=o($,v,_),j===null?b=$:j.sibling=$,j=$,k=I}if(_===g.length)return n(m,k),xe&&Jn(m,_),b;if(k===null){for(;_<g.length;_++)k=d(m,g[_],S),k!==null&&(v=o(k,v,_),j===null?b=k:j.sibling=k,j=k);return xe&&Jn(m,_),b}for(k=r(m,k);_<g.length;_++)I=x(k,m,_,g[_],S),I!==null&&(e&&I.alternate!==null&&k.delete(I.key===null?_:I.key),v=o(I,v,_),j===null?b=I:j.sibling=I,j=I);return e&&k.forEach(function(R){return t(m,R)}),xe&&Jn(m,_),b}function w(m,v,g,S){var b=As(g);if(typeof b!="function")throw Error(H(150));if(g=b.call(g),g==null)throw Error(H(151));for(var j=b=null,k=v,_=v=0,I=null,$=g.next();k!==null&&!$.done;_++,$=g.next()){k.index>_?(I=k,k=null):I=k.sibling;var R=f(m,k,$.value,S);if(R===null){k===null&&(k=I);break}e&&k&&R.alternate===null&&t(m,k),v=o(R,v,_),j===null?b=R:j.sibling=R,j=R,k=I}if($.done)return n(m,k),xe&&Jn(m,_),b;if(k===null){for(;!$.done;_++,$=g.next())$=d(m,$.value,S),$!==null&&(v=o($,v,_),j===null?b=$:j.sibling=$,j=$);return xe&&Jn(m,_),b}for(k=r(m,k);!$.done;_++,$=g.next())$=x(k,m,_,$.value,S),$!==null&&(e&&$.alternate!==null&&k.delete($.key===null?_:$.key),v=o($,v,_),j===null?b=$:j.sibling=$,j=$);return e&&k.forEach(function(T){return t(m,T)}),xe&&Jn(m,_),b}function N(m,v,g,S){if(typeof g=="object"&&g!==null&&g.type===Lr&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case si:e:{for(var b=g.key,j=v;j!==null;){if(j.key===b){if(b=g.type,b===Lr){if(j.tag===7){n(m,j.sibling),v=s(j,g.props.children),v.return=m,m=v;break e}}else if(j.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===En&&xh(b)===j.type){n(m,j.sibling),v=s(j,g.props),v.ref=Fs(m,j,g),v.return=m,m=v;break e}n(m,j);break}else t(m,j);j=j.sibling}g.type===Lr?(v=lr(g.props.children,m.mode,S,g.key),v.return=m,m=v):(S=Gi(g.type,g.key,g.props,null,m.mode,S),S.ref=Fs(m,v,g),S.return=m,m=S)}return i(m);case Tr:e:{for(j=g.key;v!==null;){if(v.key===j)if(v.tag===4&&v.stateNode.containerInfo===g.containerInfo&&v.stateNode.implementation===g.implementation){n(m,v.sibling),v=s(v,g.children||[]),v.return=m,m=v;break e}else{n(m,v);break}else t(m,v);v=v.sibling}v=ru(g,m.mode,S),v.return=m,m=v}return i(m);case En:return j=g._init,N(m,v,j(g._payload),S)}if(Qs(g))return y(m,v,g,S);if(As(g))return w(m,v,g,S);pi(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,v!==null&&v.tag===6?(n(m,v.sibling),v=s(v,g),v.return=m,m=v):(n(m,v),v=nu(g,m.mode,S),v.return=m,m=v),i(m)):n(m,v)}return N}var os=kg(!0),jg=kg(!1),xa=Qn(null),ya=null,Vr=null,dd=null;function fd(){dd=Vr=ya=null}function hd(e){var t=xa.current;ge(xa),e._currentValue=t}function tc(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 qr(e,t){ya=e,dd=Vr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(nt=!0),e.firstContext=null)}function St(e){var t=e._currentValue;if(dd!==e)if(e={context:e,memoizedValue:t,next:null},Vr===null){if(ya===null)throw Error(H(308));Vr=e,ya.dependencies={lanes:0,firstContext:e}}else Vr=Vr.next=e;return t}var rr=null;function md(e){rr===null?rr=[e]:rr.push(e)}function Cg(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,md(t)):(n.next=s.next,s.next=n),t.interleaved=n,hn(e,r)}function hn(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 _n=!1;function pd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Eg(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 un(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function $n(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,hn(e,n)}return s=r.interleaved,s===null?(t.next=t,md(r)):(t.next=s.next,s.next=t),r.interleaved=t,hn(e,n)}function Vi(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,ed(e,n)}}function yh(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 va(e,t,n,r){var s=e.updateQueue;_n=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var u=a,c=u.next;u.next=null,i===null?o=c:i.next=c,i=u;var h=e.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==i&&(a===null?h.firstBaseUpdate=c:a.next=c,h.lastBaseUpdate=u))}if(o!==null){var d=s.baseState;i=0,h=c=u=null,a=o;do{var f=a.lane,x=a.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:x,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,w=a;switch(f=t,x=n,w.tag){case 1:if(y=w.payload,typeof y=="function"){d=y.call(x,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=w.payload,f=typeof y=="function"?y.call(x,d,f):y,f==null)break e;d=be({},d,f);break e;case 2:_n=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[a]:f.push(a))}else x={eventTime:x,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(c=h=x,u=d):h=h.next=x,i|=f;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;f=a,a=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);mr|=i,e.lanes=i,e.memoizedState=d}}function vh(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 Wo={},Gt=Qn(Wo),jo=Qn(Wo),Co=Qn(Wo);function sr(e){if(e===Wo)throw Error(H(174));return e}function gd(e,t){switch(fe(Co,t),fe(jo,e),fe(Gt,Wo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Au(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Au(t,e)}ge(Gt),fe(Gt,t)}function is(){ge(Gt),ge(jo),ge(Co)}function _g(e){sr(Co.current);var t=sr(Gt.current),n=Au(t,e.type);t!==n&&(fe(jo,e),fe(Gt,n))}function xd(e){jo.current===e&&(ge(Gt),ge(jo))}var Ne=Qn(0);function wa(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 Ql=[];function yd(){for(var e=0;e<Ql.length;e++)Ql[e]._workInProgressVersionPrimary=null;Ql.length=0}var Bi=xn.ReactCurrentDispatcher,ql=xn.ReactCurrentBatchConfig,hr=0,Se=null,Ie=null,Le=null,Na=!1,io=!1,Eo=0,V2=0;function Ue(){throw Error(H(321))}function vd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!At(e[n],t[n]))return!1;return!0}function wd(e,t,n,r,s,o){if(hr=o,Se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Bi.current=e===null||e.memoizedState===null?K2:Y2,e=n(r,s),io){o=0;do{if(io=!1,Eo=0,25<=o)throw Error(H(301));o+=1,Le=Ie=null,t.updateQueue=null,Bi.current=G2,e=n(r,s)}while(io)}if(Bi.current=Sa,t=Ie!==null&&Ie.next!==null,hr=0,Le=Ie=Se=null,Na=!1,t)throw Error(H(300));return e}function Nd(){var e=Eo!==0;return Eo=0,e}function Vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Le===null?Se.memoizedState=Le=e:Le=Le.next=e,Le}function bt(){if(Ie===null){var e=Se.alternate;e=e!==null?e.memoizedState:null}else e=Ie.next;var t=Le===null?Se.memoizedState:Le.next;if(t!==null)Le=t,Ie=e;else{if(e===null)throw Error(H(310));Ie=e,e={memoizedState:Ie.memoizedState,baseState:Ie.baseState,baseQueue:Ie.baseQueue,queue:Ie.queue,next:null},Le===null?Se.memoizedState=Le=e:Le=Le.next=e}return Le}function _o(e,t){return typeof t=="function"?t(e):t}function Zl(e){var t=bt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=Ie,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 a=i=null,u=null,c=o;do{var h=c.lane;if((hr&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?(a=u=d,i=r):u=u.next=d,Se.lanes|=h,mr|=h}c=c.next}while(c!==null&&c!==o);u===null?i=r:u.next=a,At(r,t.memoizedState)||(nt=!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,Se.lanes|=o,mr|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Jl(e){var t=bt(),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);At(o,t.memoizedState)||(nt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Pg(){}function Mg(e,t){var n=Se,r=bt(),s=t(),o=!At(r.memoizedState,s);if(o&&(r.memoizedState=s,nt=!0),r=r.queue,Sd(Tg.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Le!==null&&Le.memoizedState.tag&1){if(n.flags|=2048,Po(9,Rg.bind(null,n,r,s,t),void 0,null),Ae===null)throw Error(H(349));hr&30||Ig(n,t,s)}return s}function Ig(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Se.updateQueue,t===null?(t={lastEffect:null,stores:null},Se.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Rg(e,t,n,r){t.value=n,t.getSnapshot=r,Lg(t)&&Ag(e)}function Tg(e,t,n){return n(function(){Lg(t)&&Ag(e)})}function Lg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!At(e,n)}catch{return!0}}function Ag(e){var t=hn(e,1);t!==null&&Lt(t,e,1,-1)}function wh(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:_o,lastRenderedState:e},t.queue=e,e=e.dispatch=W2.bind(null,Se,e),[t.memoizedState,e]}function Po(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Se.updateQueue,t===null?(t={lastEffect:null,stores:null},Se.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 zg(){return bt().memoizedState}function Ui(e,t,n,r){var s=Vt();Se.flags|=e,s.memoizedState=Po(1|t,n,void 0,r===void 0?null:r)}function Ja(e,t,n,r){var s=bt();r=r===void 0?null:r;var o=void 0;if(Ie!==null){var i=Ie.memoizedState;if(o=i.destroy,r!==null&&vd(r,i.deps)){s.memoizedState=Po(t,n,o,r);return}}Se.flags|=e,s.memoizedState=Po(1|t,n,o,r)}function Nh(e,t){return Ui(8390656,8,e,t)}function Sd(e,t){return Ja(2048,8,e,t)}function Dg(e,t){return Ja(4,2,e,t)}function $g(e,t){return Ja(4,4,e,t)}function Og(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 Fg(e,t,n){return n=n!=null?n.concat([e]):null,Ja(4,4,Og.bind(null,t,e),n)}function bd(){}function Hg(e,t){var n=bt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&vd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Vg(e,t){var n=bt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&vd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Bg(e,t,n){return hr&21?(At(n,t)||(n=Gp(),Se.lanes|=n,mr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,nt=!0),e.memoizedState=n)}function B2(e,t){var n=de;de=n!==0&&4>n?n:4,e(!0);var r=ql.transition;ql.transition={};try{e(!1),t()}finally{de=n,ql.transition=r}}function Ug(){return bt().memoizedState}function U2(e,t,n){var r=Fn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Wg(e))Kg(t,n);else if(n=Cg(e,t,n,r),n!==null){var s=Qe();Lt(n,e,r,s),Yg(n,t,r)}}function W2(e,t,n){var r=Fn(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Wg(e))Kg(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,a=o(i,n);if(s.hasEagerState=!0,s.eagerState=a,At(a,i)){var u=t.interleaved;u===null?(s.next=s,md(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}n=Cg(e,t,s,r),n!==null&&(s=Qe(),Lt(n,e,r,s),Yg(n,t,r))}}function Wg(e){var t=e.alternate;return e===Se||t!==null&&t===Se}function Kg(e,t){io=Na=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Yg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ed(e,n)}}var Sa={readContext:St,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},K2={readContext:St,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:Nh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ui(4194308,4,Og.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ui(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ui(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=U2.bind(null,Se,e),[r.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:wh,useDebugValue:bd,useDeferredValue:function(e){return Vt().memoizedState=e},useTransition:function(){var e=wh(!1),t=e[0];return e=B2.bind(null,e[1]),Vt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Se,s=Vt();if(xe){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),Ae===null)throw Error(H(349));hr&30||Ig(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,Nh(Tg.bind(null,r,o,e),[e]),r.flags|=2048,Po(9,Rg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Vt(),t=Ae.identifierPrefix;if(xe){var n=an,r=on;n=(r&~(1<<32-Tt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Eo++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=V2++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Y2={readContext:St,useCallback:Hg,useContext:St,useEffect:Sd,useImperativeHandle:Fg,useInsertionEffect:Dg,useLayoutEffect:$g,useMemo:Vg,useReducer:Zl,useRef:zg,useState:function(){return Zl(_o)},useDebugValue:bd,useDeferredValue:function(e){var t=bt();return Bg(t,Ie.memoizedState,e)},useTransition:function(){var e=Zl(_o)[0],t=bt().memoizedState;return[e,t]},useMutableSource:Pg,useSyncExternalStore:Mg,useId:Ug,unstable_isNewReconciler:!1},G2={readContext:St,useCallback:Hg,useContext:St,useEffect:Sd,useImperativeHandle:Fg,useInsertionEffect:Dg,useLayoutEffect:$g,useMemo:Vg,useReducer:Jl,useRef:zg,useState:function(){return Jl(_o)},useDebugValue:bd,useDeferredValue:function(e){var t=bt();return Ie===null?t.memoizedState=e:Bg(t,Ie.memoizedState,e)},useTransition:function(){var e=Jl(_o)[0],t=bt().memoizedState;return[e,t]},useMutableSource:Pg,useSyncExternalStore:Mg,useId:Ug,unstable_isNewReconciler:!1};function Ct(e,t){if(e&&e.defaultProps){t=be({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function nc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:be({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var el={isMounted:function(e){return(e=e._reactInternals)?br(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Qe(),s=Fn(e),o=un(r,s);o.payload=t,n!=null&&(o.callback=n),t=$n(e,o,s),t!==null&&(Lt(t,e,s,r),Vi(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Qe(),s=Fn(e),o=un(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=$n(e,o,s),t!==null&&(Lt(t,e,s,r),Vi(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Qe(),r=Fn(e),s=un(n,r);s.tag=2,t!=null&&(s.callback=t),t=$n(e,s,r),t!==null&&(Lt(t,e,r,n),Vi(t,e,r))}};function Sh(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?!No(n,r)||!No(s,o):!0}function Gg(e,t,n){var r=!1,s=Un,o=t.contextType;return typeof o=="object"&&o!==null?o=St(o):(s=ot(t)?dr:Ge.current,r=t.contextTypes,o=(r=r!=null)?rs(e,s):Un),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=el,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function bh(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&&el.enqueueReplaceState(t,t.state,null)}function rc(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},pd(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=St(o):(o=ot(t)?dr:Ge.current,s.context=rs(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(nc(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&&el.enqueueReplaceState(s,s.state,null),va(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function as(e,t){try{var n="",r=t;do n+=Sw(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 eu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function sc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var X2=typeof WeakMap=="function"?WeakMap:Map;function Xg(e,t,n){n=un(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ka||(ka=!0,mc=r),sc(e,t)},n}function Qg(e,t,n){n=un(-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(){sc(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){sc(e,t),typeof r!="function"&&(On===null?On=new Set([this]):On.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function kh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new X2;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=uN.bind(null,e,t,n),t.then(e,e))}function jh(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 Ch(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=un(-1,1),t.tag=2,$n(n,t,1))),n.lanes|=1),e)}var Q2=xn.ReactCurrentOwner,nt=!1;function Xe(e,t,n,r){t.child=e===null?jg(t,null,n,r):os(t,e.child,n,r)}function Eh(e,t,n,r,s){n=n.render;var o=t.ref;return qr(t,s),r=wd(e,t,n,r,o,s),n=Nd(),e!==null&&!nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,mn(e,t,s)):(xe&&n&&ld(t),t.flags|=1,Xe(e,t,r,s),t.child)}function _h(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!Id(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,qg(e,t,o,r,s)):(e=Gi(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:No,n(i,r)&&e.ref===t.ref)return mn(e,t,s)}return t.flags|=1,e=Hn(o,r),e.ref=t.ref,e.return=t,t.child=e}function qg(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if(No(o,r)&&e.ref===t.ref)if(nt=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(nt=!0);else return t.lanes=e.lanes,mn(e,t,s)}return oc(e,t,n,r,s)}function Zg(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(Ur,at),at|=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(Ur,at),at|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,fe(Ur,at),at|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,fe(Ur,at),at|=r;return Xe(e,t,s,n),t.child}function Jg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function oc(e,t,n,r,s){var o=ot(n)?dr:Ge.current;return o=rs(t,o),qr(t,s),n=wd(e,t,n,r,o,s),r=Nd(),e!==null&&!nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,mn(e,t,s)):(xe&&r&&ld(t),t.flags|=1,Xe(e,t,n,s),t.child)}function Ph(e,t,n,r,s){if(ot(n)){var o=!0;ma(t)}else o=!1;if(qr(t,s),t.stateNode===null)Wi(e,t),Gg(t,n,r),rc(t,n,r,s),r=!0;else if(e===null){var i=t.stateNode,a=t.memoizedProps;i.props=a;var u=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=St(c):(c=ot(n)?dr:Ge.current,c=rs(t,c));var h=n.getDerivedStateFromProps,d=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function";d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==r||u!==c)&&bh(t,i,r,c),_n=!1;var f=t.memoizedState;i.state=f,va(t,r,i,s),u=t.memoizedState,a!==r||f!==u||st.current||_n?(typeof h=="function"&&(nc(t,n,h,r),u=t.memoizedState),(a=_n||Sh(t,n,a,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=a):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Eg(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Ct(t.type,a),i.props=c,d=t.pendingProps,f=i.context,u=n.contextType,typeof u=="object"&&u!==null?u=St(u):(u=ot(n)?dr:Ge.current,u=rs(t,u));var x=n.getDerivedStateFromProps;(h=typeof x=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==d||f!==u)&&bh(t,i,r,u),_n=!1,f=t.memoizedState,i.state=f,va(t,r,i,s);var y=t.memoizedState;a!==d||f!==y||st.current||_n?(typeof x=="function"&&(nc(t,n,x,r),y=t.memoizedState),(c=_n||Sh(t,n,c,r,f,y,u)||!1)?(h||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,y,u),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,y,u)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),i.props=r,i.state=y,i.context=u,r=c):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return ic(e,t,n,r,o,s)}function ic(e,t,n,r,s,o){Jg(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return s&&mh(t,n,!1),mn(e,t,o);r=t.stateNode,Q2.current=t;var a=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=os(t,e.child,null,o),t.child=os(t,null,a,o)):Xe(e,t,a,o),t.memoizedState=r.state,s&&mh(t,n,!0),t.child}function ex(e){var t=e.stateNode;t.pendingContext?hh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&hh(e,t.context,!1),gd(e,t.containerInfo)}function Mh(e,t,n,r,s){return ss(),cd(s),t.flags|=256,Xe(e,t,n,r),t.child}var ac={dehydrated:null,treeContext:null,retryLane:0};function lc(e){return{baseLanes:e,cachePool:null,transitions:null}}function tx(e,t,n){var r=t.pendingProps,s=Ne.current,o=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),fe(Ne,s&1),e===null)return ec(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=rl(i,r,0,null),e=lr(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=lc(n),t.memoizedState=ac,e):kd(t,i));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return q2(e,t,i,r,a,s,n);if(o){o=r.fallback,i=t.mode,s=e.child,a=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=Hn(s,u),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?o=Hn(a,o):(o=lr(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?lc(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=ac,r}return o=e.child,e=o.sibling,r=Hn(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 kd(e,t){return t=rl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function gi(e,t,n,r){return r!==null&&cd(r),os(t,e.child,null,n),e=kd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function q2(e,t,n,r,s,o,i){if(n)return t.flags&256?(t.flags&=-257,r=eu(Error(H(422))),gi(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=rl({mode:"visible",children:r.children},s,0,null),o=lr(o,s,i,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&os(t,e.child,null,i),t.child.memoizedState=lc(i),t.memoizedState=ac,o);if(!(t.mode&1))return gi(e,t,i,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(H(419)),r=eu(o,r,void 0),gi(e,t,i,r)}if(a=(i&e.childLanes)!==0,nt||a){if(r=Ae,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,hn(e,s),Lt(r,e,s,-1))}return Md(),r=eu(Error(H(421))),gi(e,t,i,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=cN.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,ut=Dn(s.nextSibling),ct=t,xe=!0,Pt=null,e!==null&&(gt[xt++]=on,gt[xt++]=an,gt[xt++]=fr,on=e.id,an=e.overflow,fr=t),t=kd(t,r.children),t.flags|=4096,t)}function Ih(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),tc(e.return,t,n)}function tu(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 nx(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(Xe(e,t,r.children,n),r=Ne.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&&Ih(e,n,t);else if(e.tag===19)Ih(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(Ne,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&&wa(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),tu(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&&wa(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}tu(t,!0,n,null,o);break;case"together":tu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Wi(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function mn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),mr|=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=Hn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Hn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Z2(e,t,n){switch(t.tag){case 3:ex(t),ss();break;case 5:_g(t);break;case 1:ot(t.type)&&ma(t);break;case 4:gd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;fe(xa,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(fe(Ne,Ne.current&1),t.flags|=128,null):n&t.child.childLanes?tx(e,t,n):(fe(Ne,Ne.current&1),e=mn(e,t,n),e!==null?e.sibling:null);fe(Ne,Ne.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return nx(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),fe(Ne,Ne.current),r)break;return null;case 22:case 23:return t.lanes=0,Zg(e,t,n)}return mn(e,t,n)}var rx,uc,sx,ox;rx=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}};uc=function(){};sx=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,sr(Gt.current);var o=null;switch(n){case"input":s=Iu(e,s),r=Iu(e,r),o=[];break;case"select":s=be({},s,{value:void 0}),r=be({},r,{value:void 0}),o=[];break;case"textarea":s=Lu(e,s),r=Lu(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=fa)}zu(n,r);var i;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(i in a)a.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(mo.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var u=r[c];if(a=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&u!==a&&(u!=null||a!=null))if(c==="style")if(a){for(i in a)!a.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&a[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,a=a?a.__html:void 0,u!=null&&a!==u&&(o=o||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(o=o||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(mo.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&pe("scroll",e),o||a===u||(o=[])):(o=o||[]).push(c,u))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};ox=function(e,t,n,r){n!==r&&(t.flags|=4)};function Hs(e,t){if(!xe)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 We(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 J2(e,t,n){var r=t.pendingProps;switch(ud(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(t),null;case 1:return ot(t.type)&&ha(),We(t),null;case 3:return r=t.stateNode,is(),ge(st),ge(Ge),yd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(mi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pt!==null&&(xc(Pt),Pt=null))),uc(e,t),We(t),null;case 5:xd(t);var s=sr(Co.current);if(n=t.type,e!==null&&t.stateNode!=null)sx(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 We(t),null}if(e=sr(Gt.current),mi(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Wt]=t,r[ko]=o,e=(t.mode&1)!==0,n){case"dialog":pe("cancel",r),pe("close",r);break;case"iframe":case"object":case"embed":pe("load",r);break;case"video":case"audio":for(s=0;s<Zs.length;s++)pe(Zs[s],r);break;case"source":pe("error",r);break;case"img":case"image":case"link":pe("error",r),pe("load",r);break;case"details":pe("toggle",r);break;case"input":Ff(r,o),pe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},pe("invalid",r);break;case"textarea":Vf(r,o),pe("invalid",r)}zu(n,o),s=null;for(var i in o)if(o.hasOwnProperty(i)){var a=o[i];i==="children"?typeof a=="string"?r.textContent!==a&&(o.suppressHydrationWarning!==!0&&hi(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&hi(r.textContent,a,e),s=["children",""+a]):mo.hasOwnProperty(i)&&a!=null&&i==="onScroll"&&pe("scroll",r)}switch(n){case"input":oi(r),Hf(r,o,!0);break;case"textarea":oi(r),Bf(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=fa)}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=Tp(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[Wt]=t,e[ko]=r,rx(e,t,!1,!1),t.stateNode=e;e:{switch(i=Du(n,r),n){case"dialog":pe("cancel",e),pe("close",e),s=r;break;case"iframe":case"object":case"embed":pe("load",e),s=r;break;case"video":case"audio":for(s=0;s<Zs.length;s++)pe(Zs[s],e);s=r;break;case"source":pe("error",e),s=r;break;case"img":case"image":case"link":pe("error",e),pe("load",e),s=r;break;case"details":pe("toggle",e),s=r;break;case"input":Ff(e,r),s=Iu(e,r),pe("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=be({},r,{value:void 0}),pe("invalid",e);break;case"textarea":Vf(e,r),s=Lu(e,r),pe("invalid",e);break;default:s=r}zu(n,s),a=s;for(o in a)if(a.hasOwnProperty(o)){var u=a[o];o==="style"?zp(e,u):o==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Lp(e,u)):o==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&po(e,u):typeof u=="number"&&po(e,""+u):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(mo.hasOwnProperty(o)?u!=null&&o==="onScroll"&&pe("scroll",e):u!=null&&Gc(e,o,u,i))}switch(n){case"input":oi(e),Hf(e,r,!1);break;case"textarea":oi(e),Bf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Bn(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Yr(e,!!r.multiple,o,!1):r.defaultValue!=null&&Yr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=fa)}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 We(t),null;case 6:if(e&&t.stateNode!=null)ox(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=sr(Co.current),sr(Gt.current),mi(t)){if(r=t.stateNode,n=t.memoizedProps,r[Wt]=t,(o=r.nodeValue!==n)&&(e=ct,e!==null))switch(e.tag){case 3:hi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&hi(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Wt]=t,t.stateNode=r}return We(t),null;case 13:if(ge(Ne),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(xe&&ut!==null&&t.mode&1&&!(t.flags&128))bg(),ss(),t.flags|=98560,o=!1;else if(o=mi(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[Wt]=t}else ss(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;We(t),o=!1}else Pt!==null&&(xc(Pt),Pt=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||Ne.current&1?Re===0&&(Re=3):Md())),t.updateQueue!==null&&(t.flags|=4),We(t),null);case 4:return is(),uc(e,t),e===null&&So(t.stateNode.containerInfo),We(t),null;case 10:return hd(t.type._context),We(t),null;case 17:return ot(t.type)&&ha(),We(t),null;case 19:if(ge(Ne),o=t.memoizedState,o===null)return We(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Hs(o,!1);else{if(Re!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=wa(e),i!==null){for(t.flags|=128,Hs(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(Ne,Ne.current&1|2),t.child}e=e.sibling}o.tail!==null&&Ce()>ls&&(t.flags|=128,r=!0,Hs(o,!1),t.lanes=4194304)}else{if(!r)if(e=wa(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Hs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!xe)return We(t),null}else 2*Ce()-o.renderingStartTime>ls&&n!==1073741824&&(t.flags|=128,r=!0,Hs(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=Ce(),t.sibling=null,n=Ne.current,fe(Ne,r?n&1|2:n&1),t):(We(t),null);case 22:case 23:return Pd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?at&1073741824&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function eN(e,t){switch(ud(t),t.tag){case 1:return ot(t.type)&&ha(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return is(),ge(st),ge(Ge),yd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return xd(t),null;case 13:if(ge(Ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));ss()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ge(Ne),null;case 4:return is(),null;case 10:return hd(t.type._context),null;case 22:case 23:return Pd(),null;case 24:return null;default:return null}}var xi=!1,Ye=!1,tN=typeof WeakSet=="function"?WeakSet:Set,W=null;function Br(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ke(e,t,r)}else n.current=null}function cc(e,t,n){try{n()}catch(r){ke(e,t,r)}}var Rh=!1;function nN(e,t){if(Yu=ua,e=cg(),ad(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,a=-1,u=-1,c=0,h=0,d=e,f=null;t:for(;;){for(var x;d!==n||s!==0&&d.nodeType!==3||(a=i+s),d!==o||r!==0&&d.nodeType!==3||(u=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(x=d.firstChild)!==null;)f=d,d=x;for(;;){if(d===e)break t;if(f===n&&++c===s&&(a=i),f===o&&++h===r&&(u=i),(x=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=x}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Gu={focusedElem:e,selectionRange:n},ua=!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 y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,N=y.memoizedState,m=t.stateNode,v=m.getSnapshotBeforeUpdate(t.elementType===t.type?w:Ct(t.type,w),N);m.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(S){ke(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return y=Rh,Rh=!1,y}function ao(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&&cc(t,n,o)}s=s.next}while(s!==r)}}function tl(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 dc(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 ix(e){var t=e.alternate;t!==null&&(e.alternate=null,ix(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wt],delete t[ko],delete t[qu],delete t[$2],delete t[O2])),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 ax(e){return e.tag===5||e.tag===3||e.tag===4}function Th(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ax(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 fc(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=fa));else if(r!==4&&(e=e.child,e!==null))for(fc(e,t,n),e=e.sibling;e!==null;)fc(e,t,n),e=e.sibling}function hc(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(hc(e,t,n),e=e.sibling;e!==null;)hc(e,t,n),e=e.sibling}var De=null,Et=!1;function Nn(e,t,n){for(n=n.child;n!==null;)lx(e,t,n),n=n.sibling}function lx(e,t,n){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(Ya,n)}catch{}switch(n.tag){case 5:Ye||Br(n,t);case 6:var r=De,s=Et;De=null,Nn(e,t,n),De=r,Et=s,De!==null&&(Et?(e=De,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):De.removeChild(n.stateNode));break;case 18:De!==null&&(Et?(e=De,n=n.stateNode,e.nodeType===8?Gl(e.parentNode,n):e.nodeType===1&&Gl(e,n),vo(e)):Gl(De,n.stateNode));break;case 4:r=De,s=Et,De=n.stateNode.containerInfo,Et=!0,Nn(e,t,n),De=r,Et=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)&&cc(n,t,i),s=s.next}while(s!==r)}Nn(e,t,n);break;case 1:if(!Ye&&(Br(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ke(n,t,a)}Nn(e,t,n);break;case 21:Nn(e,t,n);break;case 22:n.mode&1?(Ye=(r=Ye)||n.memoizedState!==null,Nn(e,t,n),Ye=r):Nn(e,t,n);break;default:Nn(e,t,n)}}function Lh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new tN),t.forEach(function(r){var s=dN.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function jt(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,a=i;e:for(;a!==null;){switch(a.tag){case 5:De=a.stateNode,Et=!1;break e;case 3:De=a.stateNode.containerInfo,Et=!0;break e;case 4:De=a.stateNode.containerInfo,Et=!0;break e}a=a.return}if(De===null)throw Error(H(160));lx(o,i,s),De=null,Et=!1;var u=s.alternate;u!==null&&(u.return=null),s.return=null}catch(c){ke(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ux(t,e),t=t.sibling}function ux(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jt(t,e),Ht(e),r&4){try{ao(3,e,e.return),tl(3,e)}catch(w){ke(e,e.return,w)}try{ao(5,e,e.return)}catch(w){ke(e,e.return,w)}}break;case 1:jt(t,e),Ht(e),r&512&&n!==null&&Br(n,n.return);break;case 5:if(jt(t,e),Ht(e),r&512&&n!==null&&Br(n,n.return),e.flags&32){var s=e.stateNode;try{po(s,"")}catch(w){ke(e,e.return,w)}}if(r&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,i=n!==null?n.memoizedProps:o,a=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&Ip(s,o),Du(a,i);var c=Du(a,o);for(i=0;i<u.length;i+=2){var h=u[i],d=u[i+1];h==="style"?zp(s,d):h==="dangerouslySetInnerHTML"?Lp(s,d):h==="children"?po(s,d):Gc(s,h,d,c)}switch(a){case"input":Ru(s,o);break;case"textarea":Rp(s,o);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var x=o.value;x!=null?Yr(s,!!o.multiple,x,!1):f!==!!o.multiple&&(o.defaultValue!=null?Yr(s,!!o.multiple,o.defaultValue,!0):Yr(s,!!o.multiple,o.multiple?[]:"",!1))}s[ko]=o}catch(w){ke(e,e.return,w)}}break;case 6:if(jt(t,e),Ht(e),r&4){if(e.stateNode===null)throw Error(H(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(w){ke(e,e.return,w)}}break;case 3:if(jt(t,e),Ht(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{vo(t.containerInfo)}catch(w){ke(e,e.return,w)}break;case 4:jt(t,e),Ht(e);break;case 13:jt(t,e),Ht(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Ed=Ce())),r&4&&Lh(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(Ye=(c=Ye)||h,jt(t,e),Ye=c):jt(t,e),Ht(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,x=f.child,f.tag){case 0:case 11:case 14:case 15:ao(4,f,f.return);break;case 1:Br(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(w){ke(r,n,w)}}break;case 5:Br(f,f.return);break;case 22:if(f.memoizedState!==null){zh(d);continue}}x!==null?(x.return=f,W=x):zh(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"):(a=d.stateNode,u=d.memoizedProps.style,i=u!=null&&u.hasOwnProperty("display")?u.display:null,a.style.display=Ap("display",i))}catch(w){ke(e,e.return,w)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(w){ke(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:jt(t,e),Ht(e),r&4&&Lh(e);break;case 21:break;default:jt(t,e),Ht(e)}}function Ht(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ax(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&&(po(s,""),r.flags&=-33);var o=Th(e);hc(e,o,s);break;case 3:case 4:var i=r.stateNode.containerInfo,a=Th(e);fc(e,a,i);break;default:throw Error(H(161))}}catch(u){ke(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function rN(e,t,n){W=e,cx(e)}function cx(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||xi;if(!i){var a=s.alternate,u=a!==null&&a.memoizedState!==null||Ye;a=xi;var c=Ye;if(xi=i,(Ye=u)&&!c)for(W=s;W!==null;)i=W,u=i.child,i.tag===22&&i.memoizedState!==null?Dh(s):u!==null?(u.return=i,W=u):Dh(s);for(;o!==null;)W=o,cx(o),o=o.sibling;W=s,xi=a,Ye=c}Ah(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,W=o):Ah(e)}}function Ah(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||tl(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:Ct(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&vh(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}vh(t,i,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;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&&vo(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}Ye||t.flags&512&&dc(t)}catch(f){ke(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 zh(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 Dh(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{tl(4,t)}catch(u){ke(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(u){ke(t,s,u)}}var o=t.return;try{dc(t)}catch(u){ke(t,o,u)}break;case 5:var i=t.return;try{dc(t)}catch(u){ke(t,i,u)}}}catch(u){ke(t,t.return,u)}if(t===e){W=null;break}var a=t.sibling;if(a!==null){a.return=t.return,W=a;break}W=t.return}}var sN=Math.ceil,ba=xn.ReactCurrentDispatcher,jd=xn.ReactCurrentOwner,Nt=xn.ReactCurrentBatchConfig,ae=0,Ae=null,Pe=null,Fe=0,at=0,Ur=Qn(0),Re=0,Mo=null,mr=0,nl=0,Cd=0,lo=null,tt=null,Ed=0,ls=1/0,rn=null,ka=!1,mc=null,On=null,yi=!1,Tn=null,ja=0,uo=0,pc=null,Ki=-1,Yi=0;function Qe(){return ae&6?Ce():Ki!==-1?Ki:Ki=Ce()}function Fn(e){return e.mode&1?ae&2&&Fe!==0?Fe&-Fe:H2.transition!==null?(Yi===0&&(Yi=Gp()),Yi):(e=de,e!==0||(e=window.event,e=e===void 0?16:tg(e.type)),e):1}function Lt(e,t,n,r){if(50<uo)throw uo=0,pc=null,Error(H(185));Vo(e,n,r),(!(ae&2)||e!==Ae)&&(e===Ae&&(!(ae&2)&&(nl|=n),Re===4&&Mn(e,Fe)),it(e,r),n===1&&ae===0&&!(t.mode&1)&&(ls=Ce()+500,Za&&qn()))}function it(e,t){var n=e.callbackNode;Hw(e,t);var r=la(e,e===Ae?Fe:0);if(r===0)n!==null&&Kf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Kf(n),t===1)e.tag===0?F2($h.bind(null,e)):wg($h.bind(null,e)),z2(function(){!(ae&6)&&qn()}),n=null;else{switch(Xp(r)){case 1:n=Jc;break;case 4:n=Kp;break;case 16:n=aa;break;case 536870912:n=Yp;break;default:n=aa}n=yx(n,dx.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function dx(e,t){if(Ki=-1,Yi=0,ae&6)throw Error(H(327));var n=e.callbackNode;if(Zr()&&e.callbackNode!==n)return null;var r=la(e,e===Ae?Fe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ca(e,r);else{t=r;var s=ae;ae|=2;var o=hx();(Ae!==e||Fe!==t)&&(rn=null,ls=Ce()+500,ar(e,t));do try{aN();break}catch(a){fx(e,a)}while(!0);fd(),ba.current=o,ae=s,Pe!==null?t=0:(Ae=null,Fe=0,t=Re)}if(t!==0){if(t===2&&(s=Vu(e),s!==0&&(r=s,t=gc(e,s))),t===1)throw n=Mo,ar(e,0),Mn(e,r),it(e,Ce()),n;if(t===6)Mn(e,r);else{if(s=e.current.alternate,!(r&30)&&!oN(s)&&(t=Ca(e,r),t===2&&(o=Vu(e),o!==0&&(r=o,t=gc(e,o))),t===1))throw n=Mo,ar(e,0),Mn(e,r),it(e,Ce()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:er(e,tt,rn);break;case 3:if(Mn(e,r),(r&130023424)===r&&(t=Ed+500-Ce(),10<t)){if(la(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Qe(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Qu(er.bind(null,e,tt,rn),t);break}er(e,tt,rn);break;case 4:if(Mn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var i=31-Tt(r);o=1<<i,i=t[i],i>s&&(s=i),r&=~o}if(r=s,r=Ce()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*sN(r/1960))-r,10<r){e.timeoutHandle=Qu(er.bind(null,e,tt,rn),r);break}er(e,tt,rn);break;case 5:er(e,tt,rn);break;default:throw Error(H(329))}}}return it(e,Ce()),e.callbackNode===n?dx.bind(null,e):null}function gc(e,t){var n=lo;return e.current.memoizedState.isDehydrated&&(ar(e,t).flags|=256),e=Ca(e,t),e!==2&&(t=tt,tt=n,t!==null&&xc(t)),e}function xc(e){tt===null?tt=e:tt.push.apply(tt,e)}function oN(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(!At(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 Mn(e,t){for(t&=~Cd,t&=~nl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Tt(t),r=1<<n;e[n]=-1,t&=~r}}function $h(e){if(ae&6)throw Error(H(327));Zr();var t=la(e,0);if(!(t&1))return it(e,Ce()),null;var n=Ca(e,t);if(e.tag!==0&&n===2){var r=Vu(e);r!==0&&(t=r,n=gc(e,r))}if(n===1)throw n=Mo,ar(e,0),Mn(e,t),it(e,Ce()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,er(e,tt,rn),it(e,Ce()),null}function _d(e,t){var n=ae;ae|=1;try{return e(t)}finally{ae=n,ae===0&&(ls=Ce()+500,Za&&qn())}}function pr(e){Tn!==null&&Tn.tag===0&&!(ae&6)&&Zr();var t=ae;ae|=1;var n=Nt.transition,r=de;try{if(Nt.transition=null,de=1,e)return e()}finally{de=r,Nt.transition=n,ae=t,!(ae&6)&&qn()}}function Pd(){at=Ur.current,ge(Ur)}function ar(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,A2(n)),Pe!==null)for(n=Pe.return;n!==null;){var r=n;switch(ud(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ha();break;case 3:is(),ge(st),ge(Ge),yd();break;case 5:xd(r);break;case 4:is();break;case 13:ge(Ne);break;case 19:ge(Ne);break;case 10:hd(r.type._context);break;case 22:case 23:Pd()}n=n.return}if(Ae=e,Pe=e=Hn(e.current,null),Fe=at=t,Re=0,Mo=null,Cd=nl=mr=0,tt=lo=null,rr!==null){for(t=0;t<rr.length;t++)if(n=rr[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}rr=null}return e}function fx(e,t){do{var n=Pe;try{if(fd(),Bi.current=Sa,Na){for(var r=Se.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Na=!1}if(hr=0,Le=Ie=Se=null,io=!1,Eo=0,jd.current=null,n===null||n.return===null){Re=1,Mo=t,Pe=null;break}e:{var o=e,i=n.return,a=n,u=t;if(t=Fe,a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,h=a,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 x=jh(i);if(x!==null){x.flags&=-257,Ch(x,i,a,o,t),x.mode&1&&kh(o,c,t),t=x,u=c;var y=t.updateQueue;if(y===null){var w=new Set;w.add(u),t.updateQueue=w}else y.add(u);break e}else{if(!(t&1)){kh(o,c,t),Md();break e}u=Error(H(426))}}else if(xe&&a.mode&1){var N=jh(i);if(N!==null){!(N.flags&65536)&&(N.flags|=256),Ch(N,i,a,o,t),cd(as(u,a));break e}}o=u=as(u,a),Re!==4&&(Re=2),lo===null?lo=[o]:lo.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var m=Xg(o,u,t);yh(o,m);break e;case 1:a=u;var v=o.type,g=o.stateNode;if(!(o.flags&128)&&(typeof v.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(On===null||!On.has(g)))){o.flags|=65536,t&=-t,o.lanes|=t;var S=Qg(o,a,t);yh(o,S);break e}}o=o.return}while(o!==null)}px(n)}catch(b){t=b,Pe===n&&n!==null&&(Pe=n=n.return);continue}break}while(!0)}function hx(){var e=ba.current;return ba.current=Sa,e===null?Sa:e}function Md(){(Re===0||Re===3||Re===2)&&(Re=4),Ae===null||!(mr&268435455)&&!(nl&268435455)||Mn(Ae,Fe)}function Ca(e,t){var n=ae;ae|=2;var r=hx();(Ae!==e||Fe!==t)&&(rn=null,ar(e,t));do try{iN();break}catch(s){fx(e,s)}while(!0);if(fd(),ae=n,ba.current=r,Pe!==null)throw Error(H(261));return Ae=null,Fe=0,Re}function iN(){for(;Pe!==null;)mx(Pe)}function aN(){for(;Pe!==null&&!Rw();)mx(Pe)}function mx(e){var t=xx(e.alternate,e,at);e.memoizedProps=e.pendingProps,t===null?px(e):Pe=t,jd.current=null}function px(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=eN(n,t),n!==null){n.flags&=32767,Pe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Re=6,Pe=null;return}}else if(n=J2(n,t,at),n!==null){Pe=n;return}if(t=t.sibling,t!==null){Pe=t;return}Pe=t=e}while(t!==null);Re===0&&(Re=5)}function er(e,t,n){var r=de,s=Nt.transition;try{Nt.transition=null,de=1,lN(e,t,n,r)}finally{Nt.transition=s,de=r}return null}function lN(e,t,n,r){do Zr();while(Tn!==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(Vw(e,o),e===Ae&&(Pe=Ae=null,Fe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||yi||(yi=!0,yx(aa,function(){return Zr(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Nt.transition,Nt.transition=null;var i=de;de=1;var a=ae;ae|=4,jd.current=null,nN(e,n),ux(n,e),_2(Gu),ua=!!Yu,Gu=Yu=null,e.current=n,rN(n),Tw(),ae=a,de=i,Nt.transition=o}else e.current=n;if(yi&&(yi=!1,Tn=e,ja=s),o=e.pendingLanes,o===0&&(On=null),zw(n.stateNode),it(e,Ce()),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(ka)throw ka=!1,e=mc,mc=null,e;return ja&1&&e.tag!==0&&Zr(),o=e.pendingLanes,o&1?e===pc?uo++:(uo=0,pc=e):uo=0,qn(),null}function Zr(){if(Tn!==null){var e=Xp(ja),t=Nt.transition,n=de;try{if(Nt.transition=null,de=16>e?16:e,Tn===null)var r=!1;else{if(e=Tn,Tn=null,ja=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 a=o.deletions;if(a!==null){for(var u=0;u<a.length;u++){var c=a[u];for(W=c;W!==null;){var h=W;switch(h.tag){case 0:case 11:case 15:ao(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,x=h.return;if(ix(h),h===c){W=null;break}if(f!==null){f.return=x,W=f;break}W=x}}}var y=o.alternate;if(y!==null){var w=y.child;if(w!==null){y.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:ao(9,o,o.return)}var m=o.sibling;if(m!==null){m.return=o.return,W=m;break e}W=o.return}}var v=e.current;for(W=v;W!==null;){i=W;var g=i.child;if(i.subtreeFlags&2064&&g!==null)g.return=i,W=g;else e:for(i=v;W!==null;){if(a=W,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:tl(9,a)}}catch(b){ke(a,a.return,b)}if(a===i){W=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,W=S;break e}W=a.return}}if(ae=s,qn(),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(Ya,e)}catch{}r=!0}return r}finally{de=n,Nt.transition=t}}return!1}function Oh(e,t,n){t=as(n,t),t=Xg(e,t,1),e=$n(e,t,1),t=Qe(),e!==null&&(Vo(e,1,t),it(e,t))}function ke(e,t,n){if(e.tag===3)Oh(e,e,n);else for(;t!==null;){if(t.tag===3){Oh(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(On===null||!On.has(r))){e=as(n,e),e=Qg(t,e,1),t=$n(t,e,1),e=Qe(),t!==null&&(Vo(t,1,e),it(t,e));break}}t=t.return}}function uN(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Qe(),e.pingedLanes|=e.suspendedLanes&n,Ae===e&&(Fe&n)===n&&(Re===4||Re===3&&(Fe&130023424)===Fe&&500>Ce()-Ed?ar(e,0):Cd|=n),it(e,t)}function gx(e,t){t===0&&(e.mode&1?(t=li,li<<=1,!(li&130023424)&&(li=4194304)):t=1);var n=Qe();e=hn(e,t),e!==null&&(Vo(e,t,n),it(e,n))}function cN(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gx(e,n)}function dN(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),gx(e,n)}var xx;xx=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||st.current)nt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return nt=!1,Z2(e,t,n);nt=!!(e.flags&131072)}else nt=!1,xe&&t.flags&1048576&&Ng(t,ga,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Wi(e,t),e=t.pendingProps;var s=rs(t,Ge.current);qr(t,n),s=wd(null,t,r,e,s,n);var o=Nd();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,ot(r)?(o=!0,ma(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,pd(t),s.updater=el,t.stateNode=s,s._reactInternals=t,rc(t,r,e,n),t=ic(null,t,r,!0,o,n)):(t.tag=0,xe&&o&&ld(t),Xe(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Wi(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=hN(r),e=Ct(r,e),s){case 0:t=oc(null,t,r,e,n);break e;case 1:t=Ph(null,t,r,e,n);break e;case 11:t=Eh(null,t,r,e,n);break e;case 14:t=_h(null,t,r,Ct(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:Ct(r,s),oc(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),Ph(e,t,r,s,n);case 3:e:{if(ex(t),e===null)throw Error(H(387));r=t.pendingProps,o=t.memoizedState,s=o.element,Eg(e,t),va(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=as(Error(H(423)),t),t=Mh(e,t,r,n,s);break e}else if(r!==s){s=as(Error(H(424)),t),t=Mh(e,t,r,n,s);break e}else for(ut=Dn(t.stateNode.containerInfo.firstChild),ct=t,xe=!0,Pt=null,n=jg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ss(),r===s){t=mn(e,t,n);break e}Xe(e,t,r,n)}t=t.child}return t;case 5:return _g(t),e===null&&ec(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,Xu(r,s)?i=null:o!==null&&Xu(r,o)&&(t.flags|=32),Jg(e,t),Xe(e,t,i,n),t.child;case 6:return e===null&&ec(t),null;case 13:return tx(e,t,n);case 4:return gd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=os(t,null,r,n):Xe(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),Eh(e,t,r,s,n);case 7:return Xe(e,t,t.pendingProps,n),t.child;case 8:return Xe(e,t,t.pendingProps.children,n),t.child;case 12:return Xe(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(xa,r._currentValue),r._currentValue=i,o!==null)if(At(o.value,i)){if(o.children===s.children&&!st.current){t=mn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=un(-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),tc(o.return,n,t),a.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,a=i.alternate,a!==null&&(a.lanes|=n),tc(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}Xe(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,qr(t,n),s=St(s),r=r(s),t.flags|=1,Xe(e,t,r,n),t.child;case 14:return r=t.type,s=Ct(r,t.pendingProps),s=Ct(r.type,s),_h(e,t,r,s,n);case 15:return qg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),Wi(e,t),t.tag=1,ot(r)?(e=!0,ma(t)):e=!1,qr(t,n),Gg(t,r,s),rc(t,r,s,n),ic(null,t,r,!0,e,n);case 19:return nx(e,t,n);case 22:return Zg(e,t,n)}throw Error(H(156,t.tag))};function yx(e,t){return Wp(e,t)}function fN(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 wt(e,t,n,r){return new fN(e,t,n,r)}function Id(e){return e=e.prototype,!(!e||!e.isReactComponent)}function hN(e){if(typeof e=="function")return Id(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Qc)return 11;if(e===qc)return 14}return 2}function Hn(e,t){var n=e.alternate;return n===null?(n=wt(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 Gi(e,t,n,r,s,o){var i=2;if(r=e,typeof e=="function")Id(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Lr:return lr(n.children,s,o,t);case Xc:i=8,s|=8;break;case Eu:return e=wt(12,n,t,s|2),e.elementType=Eu,e.lanes=o,e;case _u:return e=wt(13,n,t,s),e.elementType=_u,e.lanes=o,e;case Pu:return e=wt(19,n,t,s),e.elementType=Pu,e.lanes=o,e;case _p:return rl(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Cp:i=10;break e;case Ep:i=9;break e;case Qc:i=11;break e;case qc:i=14;break e;case En:i=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=wt(i,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function lr(e,t,n,r){return e=wt(7,e,r,t),e.lanes=n,e}function rl(e,t,n,r){return e=wt(22,e,r,t),e.elementType=_p,e.lanes=n,e.stateNode={isHidden:!1},e}function nu(e,t,n){return e=wt(6,e,null,t),e.lanes=n,e}function ru(e,t,n){return t=wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function mN(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=Dl(0),this.expirationTimes=Dl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dl(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Rd(e,t,n,r,s,o,i,a,u){return e=new mN(e,t,n,a,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=wt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},pd(o),e}function pN(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Tr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function vx(e){if(!e)return Un;e=e._reactInternals;e:{if(br(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(ot(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(ot(n))return vg(e,n,t)}return t}function wx(e,t,n,r,s,o,i,a,u){return e=Rd(n,r,!0,e,s,o,i,a,u),e.context=vx(null),n=e.current,r=Qe(),s=Fn(n),o=un(r,s),o.callback=t??null,$n(n,o,s),e.current.lanes=s,Vo(e,s,r),it(e,r),e}function sl(e,t,n,r){var s=t.current,o=Qe(),i=Fn(s);return n=vx(n),t.context===null?t.context=n:t.pendingContext=n,t=un(o,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=$n(s,t,i),e!==null&&(Lt(e,s,i,o),Vi(e,s,i)),i}function Ea(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 Fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Td(e,t){Fh(e,t),(e=e.alternate)&&Fh(e,t)}function gN(){return null}var Nx=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ld(e){this._internalRoot=e}ol.prototype.render=Ld.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));sl(e,t,null,null)};ol.prototype.unmount=Ld.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pr(function(){sl(null,e,null,null)}),t[fn]=null}};function ol(e){this._internalRoot=e}ol.prototype.unstable_scheduleHydration=function(e){if(e){var t=Zp();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Pn.length&&t!==0&&t<Pn[n].priority;n++);Pn.splice(n,0,e),n===0&&eg(e)}};function Ad(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function il(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Hh(){}function xN(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var c=Ea(i);o.call(c)}}var i=wx(t,r,e,0,null,!1,!1,"",Hh);return e._reactRootContainer=i,e[fn]=i.current,So(e.nodeType===8?e.parentNode:e),pr(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=Ea(u);a.call(c)}}var u=Rd(e,0,!1,null,null,!1,!1,"",Hh);return e._reactRootContainer=u,e[fn]=u.current,So(e.nodeType===8?e.parentNode:e),pr(function(){sl(t,u,n,r)}),u}function al(e,t,n,r,s){var o=n._reactRootContainer;if(o){var i=o;if(typeof s=="function"){var a=s;s=function(){var u=Ea(i);a.call(u)}}sl(t,i,e,s)}else i=xN(n,t,e,s,r);return Ea(i)}Qp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=qs(t.pendingLanes);n!==0&&(ed(t,n|1),it(t,Ce()),!(ae&6)&&(ls=Ce()+500,qn()))}break;case 13:pr(function(){var r=hn(e,1);if(r!==null){var s=Qe();Lt(r,e,1,s)}}),Td(e,1)}};td=function(e){if(e.tag===13){var t=hn(e,134217728);if(t!==null){var n=Qe();Lt(t,e,134217728,n)}Td(e,134217728)}};qp=function(e){if(e.tag===13){var t=Fn(e),n=hn(e,t);if(n!==null){var r=Qe();Lt(n,e,t,r)}Td(e,t)}};Zp=function(){return de};Jp=function(e,t){var n=de;try{return de=e,t()}finally{de=n}};Ou=function(e,t,n){switch(t){case"input":if(Ru(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=qa(r);if(!s)throw Error(H(90));Mp(r),Ru(r,s)}}}break;case"textarea":Rp(e,n);break;case"select":t=n.value,t!=null&&Yr(e,!!n.multiple,t,!1)}};Op=_d;Fp=pr;var yN={usingClientEntryPoint:!1,Events:[Uo,$r,qa,Dp,$p,_d]},Vs={findFiberByHostInstance:nr,bundleType:0,version:"18.3.0",rendererPackageName:"react-dom"},vN={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:xn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Bp(e),e===null?null:e.stateNode},findFiberByHostInstance:Vs.findFiberByHostInstance||gN,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 vi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vi.isDisabled&&vi.supportsFiber)try{Ya=vi.inject(vN),Yt=vi}catch{}}mt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yN;mt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ad(t))throw Error(H(200));return pN(e,t,null,n)};mt.createRoot=function(e,t){if(!Ad(e))throw Error(H(299));var n=!1,r="",s=Nx;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Rd(e,1,!1,null,null,n,!1,r,s),e[fn]=t.current,So(e.nodeType===8?e.parentNode:e),new Ld(t)};mt.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=Bp(t),e=e===null?null:e.stateNode,e};mt.flushSync=function(e){return pr(e)};mt.hydrate=function(e,t,n){if(!il(t))throw Error(H(200));return al(null,e,t,!0,n)};mt.hydrateRoot=function(e,t,n){if(!Ad(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",i=Nx;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=wx(t,null,e,1,n??null,s,!1,o,i),e[fn]=t.current,So(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 ol(t)};mt.render=function(e,t,n){if(!il(t))throw Error(H(200));return al(null,e,t,!1,n)};mt.unmountComponentAtNode=function(e){if(!il(e))throw Error(H(40));return e._reactRootContainer?(pr(function(){al(null,null,e,!1,function(){e._reactRootContainer=null,e[fn]=null})}),!0):!1};mt.unstable_batchedUpdates=_d;mt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!il(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return al(e,t,n,!1,r)};mt.version="18.3.0-next-8a015b68cc-20240425";function Sx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Sx)}catch(e){console.error(e)}}Sx(),Sp.exports=mt;var ll=Sp.exports;const wN=Hc(ll);var Vh=ll;ju.createRoot=Vh.createRoot,ju.hydrateRoot=Vh.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 Bh="popstate";function NN(e={}){function t(r,s){let{pathname:o,search:i,hash:a}=r.location;return yc("",{pathname:o,search:i,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Io(s)}return bN(t,n,null,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function zt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function SN(){return Math.random().toString(36).substring(2,10)}function Uh(e,t){return{usr:e.state,key:e.key,idx:t}}function yc(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?bs(t):t,state:n,key:t&&t.key||r||SN()}}function Io({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 bs(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 bN(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:o=!1}=r,i=s.history,a="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(){a="POP";let N=h(),m=N==null?null:N-c;c=N,u&&u({action:a,location:w.location,delta:m})}function f(N,m){a="PUSH";let v=yc(w.location,N,m);c=h()+1;let g=Uh(v,c),S=w.createHref(v);try{i.pushState(g,"",S)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;s.location.assign(S)}o&&u&&u({action:a,location:w.location,delta:1})}function x(N,m){a="REPLACE";let v=yc(w.location,N,m);c=h();let g=Uh(v,c),S=w.createHref(v);i.replaceState(g,"",S),o&&u&&u({action:a,location:w.location,delta:0})}function y(N){let m=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof N=="string"?N:Io(N);return v=v.replace(/ $/,"%20"),ye(m,`No window.location.(origin|href) available to create URL for href: ${v}`),new URL(v,m)}let w={get action(){return a},get location(){return e(s,i)},listen(N){if(u)throw new Error("A history only accepts one active listener");return s.addEventListener(Bh,d),u=N,()=>{s.removeEventListener(Bh,d),u=null}},createHref(N){return t(s,N)},createURL:y,encodeLocation(N){let m=y(N);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:x,go(N){return i.go(N)}};return w}function bx(e,t,n="/"){return kN(e,t,n,!1)}function kN(e,t,n,r){let s=typeof t=="string"?bs(t):t,o=Wn(s.pathname||"/",n);if(o==null)return null;let i=kx(e);jN(i);let a=null;for(let u=0;a==null&&u<i.length;++u){let c=zN(o);a=LN(i[u],c,r)}return a}function kx(e,t=[],n=[],r=""){let s=(o,i,a)=>{let u={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};u.relativePath.startsWith("/")&&(ye(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=cn([r,u.relativePath]),h=n.concat(u);o.children&&o.children.length>0&&(ye(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),kx(o.children,t,h,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:RN(c,o.index),routesMeta:h})};return e.forEach((o,i)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))s(o,i);else for(let u of jx(o.path))s(o,i,u)}),t}function jx(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=jx(r.join("/")),a=[];return a.push(...i.map(u=>u===""?o:[o,u].join("/"))),s&&a.push(...i),a.map(u=>e.startsWith("/")&&u===""?"/":u)}function jN(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:TN(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var CN=/^:[\w-]+$/,EN=3,_N=2,PN=1,MN=10,IN=-2,Wh=e=>e==="*";function RN(e,t){let n=e.split("/"),r=n.length;return n.some(Wh)&&(r+=IN),t&&(r+=_N),n.filter(s=>!Wh(s)).reduce((s,o)=>s+(CN.test(o)?EN:o===""?PN:MN),r)}function TN(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 LN(e,t,n=!1){let{routesMeta:r}=e,s={},o="/",i=[];for(let a=0;a<r.length;++a){let u=r[a],c=a===r.length-1,h=o==="/"?t:t.slice(o.length)||"/",d=_a({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},h),f=u.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=_a({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!d)return null;Object.assign(s,d.params),i.push({params:s,pathname:cn([o,d.pathname]),pathnameBase:FN(cn([o,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(o=cn([o,d.pathnameBase]))}return i}function _a(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=AN(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],i=o.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((c,{paramName:h,isOptional:d},f)=>{if(h==="*"){let y=a[f]||"";i=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const x=a[f];return d&&!x?c[h]=void 0:c[h]=(x||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:i,pattern:e}}function AN(e,t=!1,n=!0){zt(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,a,u)=>(r.push({paramName:a,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 zN(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return zt(!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 Wn(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 DN(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?bs(e):e;return{pathname:n?n.startsWith("/")?n:$N(n,t):t,search:HN(r),hash:VN(s)}}function $N(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 su(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 ON(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function zd(e){let t=ON(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Dd(e,t,n,r=!1){let s;typeof e=="string"?s=bs(e):(s={...e},ye(!s.pathname||!s.pathname.includes("?"),su("?","pathname","search",s)),ye(!s.pathname||!s.pathname.includes("#"),su("#","pathname","hash",s)),ye(!s.search||!s.search.includes("#"),su("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,a;if(i==null)a=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("/")}a=d>=0?t[d]:"/"}let u=DN(s,a),c=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||h)&&(u.pathname+="/"),u}var cn=e=>e.join("/").replace(/\/\/+/g,"/"),FN=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),HN=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,VN=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function BN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Cx=["POST","PUT","PATCH","DELETE"];new Set(Cx);var UN=["GET",...Cx];new Set(UN);var ks=p.createContext(null);ks.displayName="DataRouter";var ul=p.createContext(null);ul.displayName="DataRouterState";var Ex=p.createContext({isTransitioning:!1});Ex.displayName="ViewTransition";var WN=p.createContext(new Map);WN.displayName="Fetchers";var KN=p.createContext(null);KN.displayName="Await";var $t=p.createContext(null);$t.displayName="Navigation";var Ko=p.createContext(null);Ko.displayName="Location";var kt=p.createContext({outlet:null,matches:[],isDataRoute:!1});kt.displayName="Route";var $d=p.createContext(null);$d.displayName="RouteError";function YN(e,{relative:t}={}){ye(js(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=p.useContext($t),{hash:s,pathname:o,search:i}=Yo(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:cn([n,o])),r.createHref({pathname:a,search:i,hash:s})}function js(){return p.useContext(Ko)!=null}function yn(){return ye(js(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(Ko).location}var _x="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Px(e){p.useContext($t).static||p.useLayoutEffect(e)}function Od(){let{isDataRoute:e}=p.useContext(kt);return e?uS():GN()}function GN(){ye(js(),"useNavigate() may be used only in the context of a <Router> component.");let e=p.useContext(ks),{basename:t,navigator:n}=p.useContext($t),{matches:r}=p.useContext(kt),{pathname:s}=yn(),o=JSON.stringify(zd(r)),i=p.useRef(!1);return Px(()=>{i.current=!0}),p.useCallback((u,c={})=>{if(zt(i.current,_x),!i.current)return;if(typeof u=="number"){n.go(u);return}let h=Dd(u,JSON.parse(o),s,c.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:cn([t,h.pathname])),(c.replace?n.replace:n.push)(h,c.state,c)},[t,n,o,s,e])}var XN=p.createContext(null);function QN(e){let t=p.useContext(kt).outlet;return t&&p.createElement(XN.Provider,{value:e},t)}function qN(){let{matches:e}=p.useContext(kt),t=e[e.length-1];return t?t.params:{}}function Yo(e,{relative:t}={}){let{matches:n}=p.useContext(kt),{pathname:r}=yn(),s=JSON.stringify(zd(n));return p.useMemo(()=>Dd(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function ZN(e,t){return Mx(e,t)}function Mx(e,t,n,r){var m;ye(js(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=p.useContext($t),{matches:o}=p.useContext(kt),i=o[o.length-1],a=i?i.params:{},u=i?i.pathname:"/",c=i?i.pathnameBase:"/",h=i&&i.route;{let v=h&&h.path||"";Ix(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=yn(),f;if(t){let v=typeof t=="string"?bs(t):t;ye(c==="/"||((m=v.pathname)==null?void 0:m.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 x=f.pathname||"/",y=x;if(c!=="/"){let v=c.replace(/^\//,"").split("/");y="/"+x.replace(/^\//,"").split("/").slice(v.length).join("/")}let w=bx(e,{pathname:y});zt(h||w!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),zt(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=rS(w&&w.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:cn([c,s.encodeLocation?s.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:cn([c,s.encodeLocation?s.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),o,n,r);return t&&N?p.createElement(Ko.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},N):N}function JN(){let e=lS(),t=BN(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=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:o},"ErrorBoundary")," or"," ",p.createElement("code",{style:o},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:s},n):null,i)}var eS=p.createElement(JN,null),tS=class extends p.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?p.createElement(kt.Provider,{value:this.props.routeContext},p.createElement($d.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function nS({routeContext:e,match:t,children:n}){let r=p.useContext(ks);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),p.createElement(kt.Provider,{value:e},n)}function rS(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);ye(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,a=-1;if(n)for(let u=0;u<s.length;u++){let c=s[u];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(a=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,a>=0?s=s.slice(0,a+1):s=[s[0]];break}}}return s.reduceRight((u,c,h)=>{let d,f=!1,x=null,y=null;n&&(d=o&&c.route.id?o[c.route.id]:void 0,x=c.route.errorElement||eS,i&&(a<0&&h===0?(Ix("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,y=null):a===h&&(f=!0,y=c.route.hydrateFallbackElement||null)));let w=t.concat(s.slice(0,h+1)),N=()=>{let m;return d?m=x:f?m=y:c.route.Component?m=p.createElement(c.route.Component,null):c.route.element?m=c.route.element:m=u,p.createElement(nS,{match:c,routeContext:{outlet:u,matches:w,isDataRoute:n!=null},children:m})};return n&&(c.route.ErrorBoundary||c.route.errorElement||h===0)?p.createElement(tS,{location:n.location,revalidation:n.revalidation,component:x,error:d,children:N(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):N()},null)}function Fd(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function sS(e){let t=p.useContext(ks);return ye(t,Fd(e)),t}function oS(e){let t=p.useContext(ul);return ye(t,Fd(e)),t}function iS(e){let t=p.useContext(kt);return ye(t,Fd(e)),t}function Hd(e){let t=iS(e),n=t.matches[t.matches.length-1];return ye(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function aS(){return Hd("useRouteId")}function lS(){var r;let e=p.useContext($d),t=oS("useRouteError"),n=Hd("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function uS(){let{router:e}=sS("useNavigate"),t=Hd("useNavigate"),n=p.useRef(!1);return Px(()=>{n.current=!0}),p.useCallback(async(s,o={})=>{zt(n.current,_x),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var Kh={};function Ix(e,t,n){!t&&!Kh[e]&&(Kh[e]=!0,zt(!1,n))}p.memo(cS);function cS({routes:e,future:t,state:n}){return Mx(e,void 0,n,t)}function vc({to:e,replace:t,state:n,relative:r}){ye(js(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=p.useContext($t);zt(!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}=p.useContext(kt),{pathname:i}=yn(),a=Od(),u=Dd(e,zd(o),i,r==="path"),c=JSON.stringify(u);return p.useEffect(()=>{a(JSON.parse(c),{replace:t,state:n,relative:r})},[a,c,r,t,n]),null}function dS(e){return QN(e.context)}function Ke(e){ye(!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 fS({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:o=!1}){ye(!js(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),a=p.useMemo(()=>({basename:i,navigator:s,static:o,future:{}}),[i,s,o]);typeof n=="string"&&(n=bs(n));let{pathname:u="/",search:c="",hash:h="",state:d=null,key:f="default"}=n,x=p.useMemo(()=>{let y=Wn(u,i);return y==null?null:{location:{pathname:y,search:c,hash:h,state:d,key:f},navigationType:r}},[i,u,c,h,d,f,r]);return zt(x!=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.`),x==null?null:p.createElement($t.Provider,{value:a},p.createElement(Ko.Provider,{children:t,value:x}))}function hS({children:e,location:t}){return ZN(wc(e),t)}function wc(e,t=[]){let n=[];return p.Children.forEach(e,(r,s)=>{if(!p.isValidElement(r))return;let o=[...t,s];if(r.type===p.Fragment){n.push.apply(n,wc(r.props.children,o));return}ye(r.type===Ke,`[${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>`),ye(!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=wc(r.props.children,o)),n.push(i)}),n}var Xi="get",Qi="application/x-www-form-urlencoded";function cl(e){return e!=null&&typeof e.tagName=="string"}function mS(e){return cl(e)&&e.tagName.toLowerCase()==="button"}function pS(e){return cl(e)&&e.tagName.toLowerCase()==="form"}function gS(e){return cl(e)&&e.tagName.toLowerCase()==="input"}function xS(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function yS(e,t){return e.button===0&&(!t||t==="_self")&&!xS(e)}var wi=null;function vS(){if(wi===null)try{new FormData(document.createElement("form"),0),wi=!1}catch{wi=!0}return wi}var wS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ou(e){return e!=null&&!wS.has(e)?(zt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Qi}"`),null):e}function NS(e,t){let n,r,s,o,i;if(pS(e)){let a=e.getAttribute("action");r=a?Wn(a,t):null,n=e.getAttribute("method")||Xi,s=ou(e.getAttribute("enctype"))||Qi,o=new FormData(e)}else if(mS(e)||gS(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||a.getAttribute("action");if(r=u?Wn(u,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||Xi,s=ou(e.getAttribute("formenctype"))||ou(a.getAttribute("enctype"))||Qi,o=new FormData(a,e),!vS()){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(cl(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Xi,r=null,s=Qi,i=e}return o&&s==="text/plain"&&(i=o,o=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:o,body:i}}function Vd(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function SS(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 bS(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 kS(e,t,n){let r=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let i=await SS(o,n);return i.links?i.links():[]}return[]}));return _S(r.flat(1).filter(bS).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Yh(e,t,n,r,s,o){let i=(u,c)=>n[c]?u.route.id!==n[c].route.id:!0,a=(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)||a(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)||a(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 jS(e,t){return CS(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 CS(e){return[...new Set(e)]}function ES(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function _S(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let o=JSON.stringify(ES(s));return n.has(o)||(n.add(o),r.push({key:o,link:s})),r},[])}function PS(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 MS(){let e=p.useContext(ks);return Vd(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function IS(){let e=p.useContext(ul);return Vd(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Bd=p.createContext(void 0);Bd.displayName="FrameworkContext";function Rx(){let e=p.useContext(Bd);return Vd(e,"You must render this element inside a <HydratedRouter> element"),e}function RS(e,t){let n=p.useContext(Bd),[r,s]=p.useState(!1),[o,i]=p.useState(!1),{onFocus:a,onBlur:u,onMouseEnter:c,onMouseLeave:h,onTouchStart:d}=t,f=p.useRef(null);p.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let w=m=>{m.forEach(v=>{i(v.isIntersecting)})},N=new IntersectionObserver(w,{threshold:.5});return f.current&&N.observe(f.current),()=>{N.disconnect()}}},[e]),p.useEffect(()=>{if(r){let w=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(w)}}},[r]);let x=()=>{s(!0)},y=()=>{s(!1),i(!1)};return n?e!=="intent"?[o,f,{}]:[o,f,{onFocus:Bs(a,x),onBlur:Bs(u,y),onMouseEnter:Bs(c,x),onMouseLeave:Bs(h,y),onTouchStart:Bs(d,x)}]:[!1,f,{}]}function Bs(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function TS({page:e,...t}){let{router:n}=MS(),r=p.useMemo(()=>bx(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?p.createElement(AS,{page:e,matches:r,...t}):null}function LS(e){let{manifest:t,routeModules:n}=Rx(),[r,s]=p.useState([]);return p.useEffect(()=>{let o=!1;return kS(e,t,n).then(i=>{o||s(i)}),()=>{o=!0}},[e,t,n]),r}function AS({page:e,matches:t,...n}){let r=yn(),{manifest:s,routeModules:o}=Rx(),{loaderData:i,matches:a}=IS(),u=p.useMemo(()=>Yh(e,t,a,s,r,"data"),[e,t,a,s,r]),c=p.useMemo(()=>Yh(e,t,a,s,r,"assets"),[e,t,a,s,r]),h=p.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let x=new Set,y=!1;if(t.forEach(N=>{var v;let m=s.routes[N.route.id];!m||!m.hasLoader||(!u.some(g=>g.route.id===N.route.id)&&N.route.id in i&&((v=o[N.route.id])!=null&&v.shouldRevalidate)||m.hasClientLoader?y=!0:x.add(N.route.id))}),x.size===0)return[];let w=PS(e);return y&&x.size>0&&w.searchParams.set("_routes",t.filter(N=>x.has(N.route.id)).map(N=>N.route.id).join(",")),[w.pathname+w.search]},[i,r,s,u,t,e,o]),d=p.useMemo(()=>jS(c,s),[c,s]),f=LS(c);return p.createElement(p.Fragment,null,h.map(x=>p.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...n})),d.map(x=>p.createElement("link",{key:x,rel:"modulepreload",href:x,...n})),f.map(({key:x,link:y})=>p.createElement("link",{key:x,...y})))}function zS(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Tx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Tx&&(window.__reactRouterVersion="7.1.0")}catch{}function DS({basename:e,children:t,window:n}){let r=p.useRef();r.current==null&&(r.current=NN({window:n,v5Compat:!0}));let s=r.current,[o,i]=p.useState({action:s.action,location:s.location}),a=p.useCallback(u=>{p.startTransition(()=>i(u))},[i]);return p.useLayoutEffect(()=>s.listen(a),[s,a]),p.createElement(fS,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}var Lx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,us=p.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:o,replace:i,state:a,target:u,to:c,preventScrollReset:h,viewTransition:d,...f},x){let{basename:y}=p.useContext($t),w=typeof c=="string"&&Lx.test(c),N,m=!1;if(typeof c=="string"&&w&&(N=c,Tx))try{let I=new URL(window.location.href),$=c.startsWith("//")?new URL(I.protocol+c):new URL(c),R=Wn($.pathname,y);$.origin===I.origin&&R!=null?c=R+$.search+$.hash:m=!0}catch{zt(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let v=YN(c,{relative:s}),[g,S,b]=RS(r,f),j=FS(c,{replace:i,state:a,target:u,preventScrollReset:h,relative:s,viewTransition:d});function k(I){t&&t(I),I.defaultPrevented||j(I)}let _=p.createElement("a",{...f,...b,href:N||v,onClick:m||o?t:k,ref:zS(x,S),target:u,"data-discover":!w&&n==="render"?"true":void 0});return g&&!w?p.createElement(p.Fragment,null,_,p.createElement(TS,{page:v})):_});us.displayName="Link";var Ax=p.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:o,to:i,viewTransition:a,children:u,...c},h){let d=Yo(i,{relative:c.relative}),f=yn(),x=p.useContext(ul),{navigator:y,basename:w}=p.useContext($t),N=x!=null&&WS(d)&&a===!0,m=y.encodeLocation?y.encodeLocation(d).pathname:d.pathname,v=f.pathname,g=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(v=v.toLowerCase(),g=g?g.toLowerCase():null,m=m.toLowerCase()),g&&w&&(g=Wn(g,w)||g);const S=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let b=v===m||!s&&v.startsWith(m)&&v.charAt(S)==="/",j=g!=null&&(g===m||!s&&g.startsWith(m)&&g.charAt(m.length)==="/"),k={isActive:b,isPending:j,isTransitioning:N},_=b?t:void 0,I;typeof r=="function"?I=r(k):I=[r,b?"active":null,j?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let $=typeof o=="function"?o(k):o;return p.createElement(us,{...c,"aria-current":_,className:I,ref:h,style:$,to:i,viewTransition:a},typeof u=="function"?u(k):u)});Ax.displayName="NavLink";var $S=p.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:o,method:i=Xi,action:a,onSubmit:u,relative:c,preventScrollReset:h,viewTransition:d,...f},x)=>{let y=BS(),w=US(a,{relative:c}),N=i.toLowerCase()==="get"?"get":"post",m=typeof a=="string"&&Lx.test(a),v=g=>{if(u&&u(g),g.defaultPrevented)return;g.preventDefault();let S=g.nativeEvent.submitter,b=(S==null?void 0:S.getAttribute("formmethod"))||i;y(S||g.currentTarget,{fetcherKey:t,method:b,navigate:n,replace:s,state:o,relative:c,preventScrollReset:h,viewTransition:d})};return p.createElement("form",{ref:x,method:N,action:w,onSubmit:r?u:v,...f,"data-discover":!m&&e==="render"?"true":void 0})});$S.displayName="Form";function OS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zx(e){let t=p.useContext(ks);return ye(t,OS(e)),t}function FS(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:o,viewTransition:i}={}){let a=Od(),u=yn(),c=Yo(e,{relative:o});return p.useCallback(h=>{if(yS(h,t)){h.preventDefault();let d=n!==void 0?n:Io(u)===Io(c);a(e,{replace:d,state:r,preventScrollReset:s,relative:o,viewTransition:i})}},[u,a,c,n,r,t,e,s,o,i])}var HS=0,VS=()=>`__${String(++HS)}__`;function BS(){let{router:e}=zx("useSubmit"),{basename:t}=p.useContext($t),n=aS();return p.useCallback(async(r,s={})=>{let{action:o,method:i,encType:a,formData:u,body:c}=NS(r,t);if(s.navigate===!1){let h=s.fetcherKey||VS();await e.fetch(h,n,s.action||o,{preventScrollReset:s.preventScrollReset,formData:u,body:c,formMethod:s.method||i,formEncType:s.encType||a,flushSync:s.flushSync})}else await e.navigate(s.action||o,{preventScrollReset:s.preventScrollReset,formData:u,body:c,formMethod:s.method||i,formEncType:s.encType||a,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function US(e,{relative:t}={}){let{basename:n}=p.useContext($t),r=p.useContext(kt);ye(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),o={...Yo(e||".",{relative:t})},i=yn();if(e==null){o.search=i.search;let a=new URLSearchParams(o.search),u=a.getAll("index");if(u.some(h=>h==="")){a.delete("index"),u.filter(d=>d).forEach(d=>a.append("index",d));let h=a.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:cn([n,o.pathname])),Io(o)}function WS(e,t={}){let n=p.useContext(Ex);ye(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=zx("useViewTransitionState"),s=Yo(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Wn(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Wn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return _a(s.pathname,i)!=null||_a(s.pathname,o)!=null}new TextEncoder;const Dx=p.createContext(null);function KS({children:e}){const[t,n]=p.useState(()=>localStorage.getItem("opentrust_theme")||"dark"),r=s=>{n(s),localStorage.setItem("opentrust_theme",s)};return p.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]),l.jsx(Dx.Provider,{value:{theme:t,setTheme:r},children:e})}function YS(){const e=p.useContext(Dx);if(!e)throw new Error("useTheme must be within ThemeProvider");return e}const $x=p.createContext(null);function GS({children:e}){const[t,n]=p.useState(()=>{const a=localStorage.getItem("opentrust_user");return a?JSON.parse(a):null}),[r,s]=p.useState(!!localStorage.getItem("opentrust_user"));p.useEffect(()=>{if(!t){s(!1);return}let a=!1;return(async()=>{try{(await fetch("/api/auth/me",{headers:{Authorization:`Bearer ${t.apiKey}`}})).ok||a||(n(null),localStorage.removeItem("opentrust_user"))}catch{}finally{a||s(!1)}})(),()=>{a=!0}},[]);const o=p.useCallback(async(a,u)=>{const c=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a,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=p.useCallback(()=>{n(null),localStorage.removeItem("opentrust_user")},[]);return l.jsx($x.Provider,{value:{user:t,isAuthenticated:!!t,isLoading:r,login:o,logout:i},children:e})}function Ud(){const e=p.useContext($x);if(!e)throw new Error("useAuth must be within AuthProvider");return e}function Ox(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=Ox(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function XS(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Ox(e))&&(r&&(r+=" "),r+=t);return r}const Wd="-";function QS(e){const t=ZS(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function s(i){const a=i.split(Wd);return a[0]===""&&a.length!==1&&a.shift(),Fx(a,t)||qS(i)}function o(i,a){const u=n[i]||[];return a&&r[i]?[...u,...r[i]]:u}return{getClassGroupId:s,getConflictingClassGroupIds:o}}function Fx(e,t){var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Fx(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Wd);return(i=t.validators.find(({validator:a})=>a(o)))==null?void 0:i.classGroupId}const Gh=/^\[(.+)\]$/;function qS(e){if(Gh.test(e)){const t=Gh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function ZS(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return eb(Object.entries(e.classGroups),n).forEach(([o,i])=>{Nc(i,r,o,t)}),r}function Nc(e,t,n,r){e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Xh(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(JS(s)){Nc(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,i])=>{Nc(i,Xh(t,o),n,r)})})}function Xh(e,t){let n=e;return t.split(Wd).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function JS(e){return e.isThemeGetter}function eb(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,a])=>[t+i,a])):o);return[n,s]}):e}function tb(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 Hx="!";function nb(e){const t=e.separator,n=t.length===1,r=t[0],s=t.length;return function(i){const a=[];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)){a.push(i.slice(c,w)),c=w+s;continue}if(N==="/"){h=w;continue}}N==="["?u++:N==="]"&&u--}const d=a.length===0?i:i.substring(c),f=d.startsWith(Hx),x=f?d.substring(1):d,y=h&&h>c?h-c:void 0;return{modifiers:a,hasImportantModifier:f,baseClassName:x,maybePostfixModifierPosition:y}}}function rb(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 sb(e){return{cache:tb(e.cacheSize),splitModifiers:nb(e),...QS(e)}}const ob=/\s+/;function ib(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=new Set;return e.trim().split(ob).map(i=>{const{modifiers:a,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 x=rb(a).join(":");return{isTailwindClass:!0,modifierId:u?x+Hx:x,classGroupId:d,originalClassName:i,hasPostfixModifier:f}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:a,classGroupId:u,hasPostfixModifier:c}=i,h=a+u;return o.has(h)?!1:(o.add(h),s(u,c).forEach(d=>o.add(a+d)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function ab(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Vx(t))&&(r&&(r+=" "),r+=n);return r}function Vx(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Vx(e[r]))&&(n&&(n+=" "),n+=t);return n}function lb(e,...t){let n,r,s,o=i;function i(u){const c=t.reduce((h,d)=>d(h),e());return n=sb(c),r=n.cache.get,s=n.cache.set,o=a,a(u)}function a(u){const c=r(u);if(c)return c;const h=ib(u,n);return s(u,h),h}return function(){return o(ab.apply(null,arguments))}}function me(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const Bx=/^\[(?:([a-z-]+):)?(.+)\]$/i,ub=/^\d+\/\d+$/,cb=new Set(["px","full","screen"]),db=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fb=/\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$/,hb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,mb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function tn(e){return or(e)||cb.has(e)||ub.test(e)}function Sn(e){return Cs(e,"length",bb)}function or(e){return!!e&&!Number.isNaN(Number(e))}function Ni(e){return Cs(e,"number",or)}function Us(e){return!!e&&Number.isInteger(Number(e))}function gb(e){return e.endsWith("%")&&or(e.slice(0,-1))}function ne(e){return Bx.test(e)}function bn(e){return db.test(e)}const xb=new Set(["length","size","percentage"]);function yb(e){return Cs(e,xb,Ux)}function vb(e){return Cs(e,"position",Ux)}const wb=new Set(["image","url"]);function Nb(e){return Cs(e,wb,jb)}function Sb(e){return Cs(e,"",kb)}function Ws(){return!0}function Cs(e,t,n){const r=Bx.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function bb(e){return fb.test(e)&&!hb.test(e)}function Ux(){return!1}function kb(e){return mb.test(e)}function jb(e){return pb.test(e)}function Cb(){const e=me("colors"),t=me("spacing"),n=me("blur"),r=me("brightness"),s=me("borderColor"),o=me("borderRadius"),i=me("borderSpacing"),a=me("borderWidth"),u=me("contrast"),c=me("grayscale"),h=me("hueRotate"),d=me("invert"),f=me("gap"),x=me("gradientColorStops"),y=me("gradientColorStopPositions"),w=me("inset"),N=me("margin"),m=me("opacity"),v=me("padding"),g=me("saturate"),S=me("scale"),b=me("sepia"),j=me("skew"),k=me("space"),_=me("translate"),I=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",ne,t],T=()=>[ne,t],A=()=>["",tn,Sn],C=()=>["auto",or,ne],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],E=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",ne],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[or,Ni],O=()=>[or,ne];return{cacheSize:500,separator:":",theme:{colors:[Ws],spacing:[tn,Sn],blur:["none","",bn,ne],brightness:F(),borderColor:[e],borderRadius:["none","","full",bn,ne],borderSpacing:T(),borderWidth:A(),contrast:F(),grayscale:P(),hueRotate:O(),invert:P(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[gb,Sn],inset:R(),margin:R(),opacity:F(),padding:T(),saturate:F(),scale:F(),sepia:P(),skew:O(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[bn]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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",Us,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:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",Us,ne]}],"grid-cols":[{"grid-cols":[Ws]}],"col-start-end":[{col:["auto",{span:["full",Us,ne]},ne]}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":[Ws]}],"row-start-end":[{row:["auto",{span:[Us,ne]},ne]}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"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",...E()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...E(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...E(),"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":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"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:[bn]},bn]}],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",bn,Sn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ni]}],"font-family":[{font:[Ws]}],"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",or,Ni]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",tn,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":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",tn,Sn]}],"underline-offset":[{"underline-offset":["auto",tn,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":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...L(),vb]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",yb]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Nb]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],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:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:M()}],"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:["",...M()]}],"outline-offset":[{"outline-offset":[tn,ne]}],"outline-w":[{outline:[tn,Sn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[tn,Sn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",bn,Sb]}],"shadow-color":[{shadow:[Ws]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",bn,ne]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[g]}],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":[m]}],"backdrop-saturate":[{"backdrop-saturate":[g]}],"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:[Us,ne]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"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:[tn,Sn,Ni]}],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 Eb=lb(Cb);function _e(...e){return Eb(XS(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 _b=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wx=(...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 Pb={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 Mb=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},u)=>p.createElement("svg",{ref:u,...Pb,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Wx("lucide",s),...a},[...i.map(([c,h])=>p.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=p.forwardRef(({className:r,...s},o)=>p.createElement(Mb,{ref:o,iconNode:t,className:Wx(`lucide-${_b(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 Ib=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 Rb=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 Tb=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 Lb=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 Kd=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 dl=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 Yd=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 Ab=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 Kx=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 Yx=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 gr=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 Dt=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 zb=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 Db=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 $b=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 Ob=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 Kn=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 Fb=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 Hb=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 Vb=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 Es=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 Gx=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 Xx=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 Bb=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 Ub=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 dt=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 Wb=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 Kb=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 Gd=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 Yb=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 Gb=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 Pa=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 Xb=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 Ma=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 Qb=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 Yn=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 Ia=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 Qx=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 qb=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 qx=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 Xd=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 Zb=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 Sc=Z("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
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 Jb=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"}]]);/**
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 cs=Z("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
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 pn=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"}]]);/**
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 Qd=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"}]]);/**
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 Zx=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"}]]);/**
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 ek=Z("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),tk=[{label:"Discovery",items:[{to:"/inventory/agents",label:"Agents",icon:Kd},{to:"/inventory/identities",label:"Identities",icon:Gx},{to:"/inventory/permissions",label:"Permissions",icon:Bb},{to:"/inventory/hosts",label:"Hosts",icon:Gd}]},{label:"Secure",items:[{to:"/secure/risk",label:"Risk",icon:Qd},{to:"/secure/graph",label:"Graph",icon:Gb}]},{label:"Operations",items:[{to:"/ops/skills",label:"Skills",icon:Zx},{to:"/ops/plugins",label:"Plugins",icon:Qb}]},{label:"System",items:[{to:"/system/logs",label:"Logs",icon:qb},{to:"/system/settings",label:"Settings",icon:Qt}]}];function nk(){const e=yn(),[t,n]=p.useState("");return p.useEffect(()=>{fetch("/health").then(r=>r.json()).then(r=>n(r.version??"")).catch(()=>{})},[]),l.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[l.jsxs("div",{className:"flex h-14 items-center gap-2 border-b border-border px-4",children:[l.jsx("img",{src:"/dashboard/logo-512.png",alt:"OpenTrust",className:"h-6 w-6 dark:brightness-[1.8] dark:contrast-125"}),l.jsx("span",{className:"text-sm font-semibold tracking-tight text-foreground",children:"OpenTrust"})]}),l.jsx("nav",{className:"flex-1 space-y-6 px-3 py-4",children:tk.map(r=>l.jsxs("div",{children:[l.jsx("p",{className:"mb-2 px-2 text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:r.label}),l.jsx("div",{className:"space-y-0.5",children:r.items.map(s=>l.jsxs(Ax,{to:s.to,className:_e("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:[l.jsx(s.icon,{className:"h-4 w-4 shrink-0"}),s.label]},s.to))})]},r.label))}),l.jsx("div",{className:"border-t border-border px-4 py-3",children:l.jsx("p",{className:"text-[11px] text-muted-foreground",children:t?`v${t}`:""})})]})}function rk(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Jx(...e){return t=>e.forEach(n=>rk(n,t))}function qt(...e){return p.useCallback(Jx(...e),e)}var ds=p.forwardRef((e,t)=>{const{children:n,...r}=e,s=p.Children.toArray(n),o=s.find(ok);if(o){const i=o.props.children,a=s.map(u=>u===o?p.Children.count(i)>1?p.Children.only(null):p.isValidElement(i)?i.props.children:null:u);return l.jsx(bc,{...r,ref:t,children:p.isValidElement(i)?p.cloneElement(i,void 0,a):null})}return l.jsx(bc,{...r,ref:t,children:n})});ds.displayName="Slot";var bc=p.forwardRef((e,t)=>{const{children:n,...r}=e;if(p.isValidElement(n)){const s=ak(n);return p.cloneElement(n,{...ik(r,n.props),ref:t?Jx(t,s):s})}return p.Children.count(n)>1?p.Children.only(null):null});bc.displayName="SlotClone";var sk=({children:e})=>l.jsx(l.Fragment,{children:e});function ok(e){return p.isValidElement(e)&&e.type===sk}function ik(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]=(...a)=>{o(...a),s(...a)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function ak(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 ey(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=ey(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function lk(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=ey(e))&&(r&&(r+=" "),r+=t);return r}const Qh=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,qh=lk,uk=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return qh(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=Qh(h)||Qh(d);return s[c][f]}),a=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,...x}=h;return Object.entries(x).every(y=>{let[w,N]=y;return Array.isArray(N)?N.includes({...o,...a}[w]):{...o,...a}[w]===N})?[...c,d,f]:c},[]);return qh(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},ck=uk("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"}}),J=p.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},o)=>{const i=r?ds:"button";return l.jsx(i,{className:_e(ck({variant:t,size:n,className:e})),ref:o,...s})});J.displayName="Button";function dk(){const{user:e,logout:t}=Ud(),{theme:n,setTheme:r}=YS();return l.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border bg-card px-6",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"h-2 w-2 rounded-full bg-success"}),l.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[(e==null?void 0:e.email)&&l.jsx("span",{className:"text-xs text-muted-foreground",children:e.email}),l.jsx(J,{variant:"ghost",size:"icon",onClick:()=>r(n==="dark"?"light":"dark"),className:"h-8 w-8",children:n==="dark"?l.jsx(Jb,{className:"h-4 w-4"}):l.jsx(Yb,{className:"h-4 w-4"})}),l.jsx(J,{variant:"ghost",size:"icon",onClick:t,className:"h-8 w-8",children:l.jsx(Kb,{className:"h-4 w-4"})})]})]})}function fk(){return l.jsxs("div",{className:"flex h-screen overflow-hidden bg-background",children:[l.jsx(nk,{}),l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.jsx(dk,{}),l.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:l.jsx(dS,{})})]})]})}const ze=p.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:_e("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}));ze.displayName="Input";function hk(){const[e,t]=p.useState(""),[n,r]=p.useState(""),[s,o]=p.useState(""),[i,a]=p.useState(!1),[u,c]=p.useState(!1),{login:h,isAuthenticated:d,isLoading:f}=Ud(),x=Od();if(p.useEffect(()=>{d&&x("/inventory/agents",{replace:!0})},[d,x]),p.useEffect(()=>{fetch("/api/auth/config").then(w=>w.json()).then(w=>c(w.defaultPassword===!0)).catch(()=>{})},[]),f)return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:l.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading..."})});const y=async w=>{w.preventDefault(),o(""),a(!0);try{await h(e,n),x("/inventory/agents",{replace:!0})}catch(N){o(N instanceof Error?N.message:"Login failed")}finally{a(!1)}};return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:l.jsxs("div",{className:"w-full max-w-sm space-y-8 px-4",children:[l.jsxs("div",{className:"flex flex-col items-center gap-3",children:[l.jsx("img",{src:"/dashboard/logo-512.png",alt:"OpenTrust",className:"h-12 w-12 dark:brightness-[1.8] dark:contrast-125"}),l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-lg font-semibold tracking-tight text-foreground",children:"OpenTrust"}),l.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Sign in to your dashboard"})]})]}),u&&l.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:[l.jsx(Qd,{className:"mt-0.5 h-4 w-4 shrink-0"}),l.jsxs("span",{children:["Default credentials: ",l.jsx("code",{className:"rounded bg-amber-100 px-1 py-0.5 text-xs dark:bg-amber-900",children:"admin"})," / ",l.jsx("code",{className:"rounded bg-amber-100 px-1 py-0.5 text-xs dark:bg-amber-900",children:"admin"}),". Please change after login."]})]}),l.jsxs("form",{onSubmit:y,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"text-sm font-medium text-foreground",children:"Username"}),l.jsx(ze,{type:"text",placeholder:"admin",value:e,onChange:w=>t(w.target.value),autoComplete:"username",required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"text-sm font-medium text-foreground",children:"Password"}),l.jsx(ze,{type:"password",placeholder:"Password",value:n,onChange:w=>r(w.target.value),autoComplete:"current-password",required:!0})]}),s&&l.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:s}),l.jsx(J,{type:"submit",className:"w-full",disabled:i,children:i?"Signing in...":"Sign in"})]}),l.jsx("p",{className:"text-center text-xs text-muted-foreground",children:"Change the password in Settings after first login."})]})})}const mk="/api";async function ce(e,t){const n=localStorage.getItem("opentrust_user"),r=n?JSON.parse(n).apiKey:null,s=await fetch(`${mk}${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 oe={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"}),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 je({className:e,variant:t="default",...n}){return l.jsx("div",{className:_e("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})}function pk(){const[e,t]=p.useState([]),[n,r]=p.useState(""),[s,o]=p.useState(!0),i=async()=>{o(!0);try{const c=await oe.discovery.agents();t(c.data??[])}catch{}o(!1)};p.useEffect(()=>{i()},[]);const a=e.filter(c=>{var h;return!n||((h=c.name)==null?void 0:h.toLowerCase().includes(n.toLowerCase()))}),u=c=>c==="active"?"success":c==="inactive"?"secondary":"warning";return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Agents"}),l.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," agent",e.length!==1?"s":""," discovered"]})]}),l.jsxs(J,{variant:"outline",size:"sm",onClick:i,children:[l.jsx(Yn,{className:"h-3.5 w-3.5"}),"Scan"]})]}),l.jsxs("div",{className:"relative max-w-sm",children:[l.jsx(qx,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),l.jsx(ze,{placeholder:"Search agents...",className:"pl-9",value:n,onChange:c=>r(c.target.value)})]}),s?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.length===0?l.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border",children:[l.jsx(Kd,{className:"h-8 w-8 text-muted-foreground/50"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents found"})]}):l.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:a.map(c=>{var h;return l.jsxs(us,{to:`/inventory/agents/${c.id}`,className:"group flex flex-col gap-3 rounded-lg border border-border bg-card p-4 transition-colors hover:border-muted-foreground/30",children:[l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx("span",{className:"text-xl",children:c.emoji||"🤖"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-foreground group-hover:text-foreground",children:c.name}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[c.provider||"unknown",c.model?` · ${c.model}`:""]})]})]}),l.jsx(je,{variant:u(c.status??"inactive"),className:"text-[10px]",children:c.status??"inactive"})]}),((h=c.skills)==null?void 0:h.length)>0&&l.jsxs("div",{className:"flex flex-wrap gap-1",children:[c.skills.slice(0,4).map(d=>l.jsx("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:typeof d=="string"?d:d.name},d.name??d)),c.skills.length>4&&l.jsxs("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:["+",c.skills.length-4]})]})]},c.id)})})]})}const Ee=p.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:_e("rounded-lg border border-border bg-card text-card-foreground shadow-sm",e),...t}));Ee.displayName="Card";const $e=p.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-6",e),...t}));$e.displayName="CardHeader";const Oe=p.forwardRef(({className:e,...t},n)=>l.jsx("h3",{ref:n,className:_e("font-semibold leading-none tracking-tight",e),...t}));Oe.displayName="CardTitle";const qd=p.forwardRef(({className:e,...t},n)=>l.jsx("p",{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));qd.displayName="CardDescription";const Te=p.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:_e("p-6 pt-0",e),...t}));Te.displayName="CardContent";const gk=["Profile","Tasks","Identities","Permissions"];function xk(){const{id:e}=qN(),[t,n]=p.useState(null),[r,s]=p.useState([]),[o,i]=p.useState("Profile"),[a,u]=p.useState(!0);return p.useEffect(()=>{e&&(u(!0),(async()=>{const c=await oe.discovery.profile(e).catch(()=>null),h=(c==null?void 0:c.data)??null;n(h);const d=(h==null?void 0:h.registeredAgentId)??e,f=await oe.observations.agentPermissions(d).catch(()=>({data:[]}));s((f==null?void 0:f.data)??[]),u(!1)})())},[e]),a?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):t?l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(us,{to:"/inventory/agents",className:"rounded-md p-1.5 hover:bg-accent",children:l.jsx(Tb,{className:"h-4 w-4"})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"text-2xl",children:t.emoji||"🤖"}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-semibold",children:t.name||e}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.provider||"unknown",t.model?` / ${t.model}`:""]})]})]})]}),l.jsx("div",{className:"flex gap-1 border-b border-border",children:gk.map(c=>l.jsx("button",{onClick:()=>i(c),className:_e("border-b-2 px-4 py-2 text-sm font-medium transition-colors",o===c?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:c},c))}),o==="Profile"&&l.jsx(yk,{profile:t}),o==="Tasks"&&l.jsx(vk,{profile:t}),o==="Identities"&&l.jsx(wk,{profile:t}),o==="Permissions"&&l.jsx(Nk,{permissions:r})]}):l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Agent not found"})}function yk({profile:e}){const t=e.skills??[];return l.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[l.jsxs(Ee,{children:[l.jsx($e,{children:l.jsx(Oe,{className:"text-sm",children:"Info"})}),l.jsxs(Te,{className:"space-y-2 text-sm",children:[l.jsx(Ks,{label:"Owner",value:e.ownerName||"—"}),l.jsx(Ks,{label:"Creature",value:e.creature||"—"}),l.jsx(Ks,{label:"Vibe",value:e.vibe||"—"}),l.jsx(Ks,{label:"Sessions",value:String(e.sessionCount??0)}),l.jsx(Ks,{label:"Last Active",value:e.lastActive??"never"})]})]}),l.jsxs(Ee,{children:[l.jsx($e,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(Oe,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Zx,{className:"h-4 w-4"})," Skills (",t.length,")"]}),l.jsx(us,{to:"/ops/skills",children:l.jsxs(J,{size:"sm",variant:"ghost",className:"h-7 text-xs text-muted-foreground",children:["Manage ",l.jsx(Fb,{className:"ml-1 h-3 w-3"})]})})]})}),l.jsx(Te,{children:t.length===0?l.jsxs("div",{className:"flex flex-col items-center gap-2 py-4",children:[l.jsx(Pa,{className:"h-8 w-8 text-muted-foreground/30"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No skills installed"}),l.jsx(us,{to:"/ops/skills",children:l.jsx(J,{size:"sm",variant:"ghost",className:"h-7 text-xs",children:"Go to Operations to install skills"})})]}):l.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(n=>l.jsxs(je,{variant:"secondary",className:"text-xs font-normal",children:[l.jsx(Pa,{className:"mr-1 h-3 w-3"})," ",n.name]},n.name))})})]}),l.jsxs(Ee,{children:[l.jsx($e,{children:l.jsx(Oe,{className:"text-sm",children:"Plugins"})}),l.jsx(Te,{children:(e.plugins??[]).length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins"}):l.jsx("div",{className:"space-y-1.5",children:(e.plugins??[]).map(n=>l.jsxs("div",{className:"flex items-center justify-between text-sm",children:[l.jsx("span",{children:n.name}),l.jsx(je,{variant:n.enabled?"success":"secondary",className:"text-[10px]",children:n.enabled?"on":"off"})]},n.name))})})]}),l.jsxs(Ee,{children:[l.jsx($e,{children:l.jsx(Oe,{className:"text-sm",children:"Connected Systems"})}),l.jsx(Te,{children:(e.connectedSystems??[]).length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"None"}):l.jsx("div",{className:"flex flex-wrap gap-1.5",children:(e.connectedSystems??[]).map(n=>l.jsx(je,{variant:"outline",className:"text-xs",children:n},n))})})]})]})}function vk({profile:e}){const t=e.cronJobs??[];return l.jsxs(Ee,{children:[l.jsx($e,{children:l.jsxs(Oe,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Db,{className:"h-4 w-4"})," Scheduled Tasks (",t.length,")"]})}),l.jsx(Te,{children:t.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No scheduled tasks"}):l.jsx("div",{className:"space-y-2",children:t.map((n,r)=>l.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2 text-sm",children:[l.jsxs("div",{children:[l.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:n.schedule}),l.jsx("span",{className:"ml-2",children:n.task??n.id})]}),l.jsx(je,{variant:n.enabled!==!1?"success":"secondary",className:"text-[10px]",children:n.enabled!==!1?"active":"paused"})]},r))})})]})}function wk({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 l.jsx("div",{className:"space-y-4",children:n.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No identity files found"}):n.map(r=>l.jsxs(Ee,{children:[l.jsx($e,{children:l.jsxs(Oe,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Es,{className:"h-4 w-4"})," ",r.label]})}),l.jsx(Te,{children:l.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 Nk({permissions:e}){return e.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No observed permissions"}):l.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Tool"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Access"}),l.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"Calls"}),l.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"Errors"})]})}),l.jsx("tbody",{children:e.map(t=>l.jsxs("tr",{className:"border-b border-border last:border-0",children:[l.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:t.toolName}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(je,{variant:"outline",className:"text-[10px]",children:t.category??"—"})}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(je,{variant:t.accessPattern==="write"?"warning":t.accessPattern==="admin"?"destructive":"secondary",className:"text-[10px]",children:t.accessPattern??"read"})}),l.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs",children:t.callCount}),l.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs text-destructive",children:t.errorCount||"—"})]},t.id))})]})})}function Ks({label:e,value:t}){return l.jsxs("div",{className:"flex justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:e}),l.jsx("span",{className:"font-medium",children:t})]})}function Sk(){const[e,t]=p.useState([]),[n,r]=p.useState(!0),[s,o]=p.useState(new Set);p.useEffect(()=>{oe.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"}))}],a=u=>{o(c=>{const h=new Set(c);return h.has(u)?h.delete(u):h.add(u),h})};return n?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Identities"}),l.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Agents, owners, and connected systems"})]}),l.jsx("div",{className:"space-y-3",children:i.map(u=>l.jsxs(Ee,{children:[l.jsxs("button",{onClick:()=>a(u.category),className:"flex w-full items-center justify-between p-4 text-left",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Gx,{className:"h-4 w-4 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:u.category}),l.jsx(je,{variant:"secondary",className:"text-[10px]",children:u.items.length})]}),s.has(u.category)?l.jsx(dl,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(Yd,{className:"h-4 w-4 text-muted-foreground"})]}),s.has(u.category)&&l.jsx(Te,{className:"border-t border-border pt-3",children:u.items.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"None"}):l.jsx("div",{className:"space-y-1.5",children:u.items.map(c=>l.jsxs("div",{className:"flex items-center justify-between rounded-md px-3 py-2 text-sm hover:bg-muted/50",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[c.emoji&&l.jsx("span",{className:"text-base",children:c.emoji}),l.jsx("span",{children:c.name})]}),c.status&&l.jsx(je,{variant:c.status==="active"?"success":"secondary",className:"text-[10px]",children:c.status}),c.type&&l.jsx(je,{variant:"outline",className:"text-[10px]",children:c.type})]},c.id))})})]},u.category))})]})}function bk(){const[e,t]=p.useState([]),[n,r]=p.useState(""),[s,o]=p.useState("callCount"),[i,a]=p.useState(!1),[u,c]=p.useState(!0);p.useEffect(()=>{oe.observations.permissions().then(f=>{t(f.data??[]),c(!1)}).catch(()=>c(!1))},[]);const h=p.useMemo(()=>{let f=e;if(n){const x=n.toLowerCase();f=f.filter(y=>{var w,N;return((w=y.toolName)==null?void 0:w.toLowerCase().includes(x))||((N=y.category)==null?void 0:N.toLowerCase().includes(x))})}return[...f].sort((x,y)=>{const w=x[s]??0,N=y[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?a(!i):(o(f),a(!1))};return u?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Permissions"}),l.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," observed tool permission",e.length!==1?"s":""]})]}),l.jsxs("div",{className:"relative max-w-sm",children:[l.jsx(qx,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),l.jsx(ze,{placeholder:"Filter by tool or category...",className:"pl-9",value:n,onChange:f=>r(f.target.value)})]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[l.jsx(iu,{label:"Tool",sortKey:"toolName",current:s,asc:i,onSort:d}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Access"}),l.jsx(iu,{label:"Calls",sortKey:"callCount",current:s,asc:i,onSort:d,align:"right"}),l.jsx(iu,{label:"Errors",sortKey:"errorCount",current:s,asc:i,onSort:d,align:"right"})]})}),l.jsx("tbody",{children:h.length===0?l.jsx("tr",{children:l.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-muted-foreground",children:"No permissions"})}):h.map(f=>l.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-muted/30",children:[l.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:f.toolName}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(je,{variant:"outline",className:"text-[10px]",children:f.category??"—"})}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(je,{variant:f.accessPattern==="write"?"warning":f.accessPattern==="admin"?"destructive":"secondary",className:"text-[10px]",children:f.accessPattern??"read"})}),l.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs",children:f.callCount}),l.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs text-destructive",children:f.errorCount||"—"})]},f.id))})]})})]})}function iu({label:e,sortKey:t,current:n,asc:r,onSort:s,align:o="left"}){return l.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:l.jsxs("span",{className:"inline-flex items-center gap-1",children:[e,n===t&&l.jsx(Lb,{className:"h-3 w-3"})]})})}function kk(){const[e,t]=p.useState([]),[n,r]=p.useState(!0);p.useEffect(()=>{oe.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?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Risk Overview"}),l.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," anomal",e.length!==1?"ies":"y"," detected"]})]}),e.length===0?l.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border",children:[l.jsx(Qd,{className:"h-8 w-8 text-muted-foreground/50"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No anomalies detected"})]}):l.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Tool"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Agent"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Risk"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),l.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"First Seen"})]})}),l.jsx("tbody",{children:e.map(i=>{var u;const a=s(i);return l.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-muted/30",children:[l.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:i.toolName}),l.jsx("td",{className:"px-4 py-2.5 text-xs text-muted-foreground",children:((u=i.agentId)==null?void 0:u.slice(0,8))??"—"}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(je,{variant:o(a),className:"text-[10px]",children:a})}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(je,{variant:"outline",className:"text-[10px]",children:i.category??"—"})}),l.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 Me(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=Me(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var jk={value:()=>{}};function fl(){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 qi(n)}function qi(e){this._=e}function Ck(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}})}qi.prototype=fl.prototype={constructor:qi,on:function(e,t){var n=this._,r=Ck(e+"",n),s,o=-1,i=r.length;if(arguments.length<2){for(;++o<i;)if((s=(e=r[o]).type)&&(s=Ek(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]=Zh(n[s],e.name,t);else if(t==null)for(s in n)n[s]=Zh(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 qi(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 Ek(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function Zh(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=jk,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var kc="http://www.w3.org/1999/xhtml";const Jh={svg:"http://www.w3.org/2000/svg",xhtml:kc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function hl(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Jh.hasOwnProperty(t)?{space:Jh[t],local:e}:e}function _k(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===kc&&t.documentElement.namespaceURI===kc?t.createElement(e):t.createElementNS(n,e)}}function Pk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ty(e){var t=hl(e);return(t.local?Pk:_k)(t)}function Mk(){}function Zd(e){return e==null?Mk:function(){return this.querySelector(e)}}function Ik(e){typeof e!="function"&&(e=Zd(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,a=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__),a[h]=c);return new ht(r,this._parents)}function Rk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Tk(){return[]}function ny(e){return e==null?Tk:function(){return this.querySelectorAll(e)}}function Lk(e){return function(){return Rk(e.apply(this,arguments))}}function Ak(e){typeof e=="function"?e=Lk(e):e=ny(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var i=t[o],a=i.length,u,c=0;c<a;++c)(u=i[c])&&(r.push(e.call(u,u.__data__,c,i)),s.push(u));return new ht(r,s)}function ry(e){return function(){return this.matches(e)}}function sy(e){return function(t){return t.matches(e)}}var zk=Array.prototype.find;function Dk(e){return function(){return zk.call(this.children,e)}}function $k(){return this.firstElementChild}function Ok(e){return this.select(e==null?$k:Dk(typeof e=="function"?e:sy(e)))}var Fk=Array.prototype.filter;function Hk(){return Array.from(this.children)}function Vk(e){return function(){return Fk.call(this.children,e)}}function Bk(e){return this.selectAll(e==null?Hk:Vk(typeof e=="function"?e:sy(e)))}function Uk(e){typeof e!="function"&&(e=ry(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,a=r[s]=[],u,c=0;c<i;++c)(u=o[c])&&e.call(u,u.__data__,c,o)&&a.push(u);return new ht(r,this._parents)}function oy(e){return new Array(e.length)}function Wk(){return new ht(this._enter||this._groups.map(oy),this._parents)}function Ra(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ra.prototype={constructor:Ra,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 Kk(e){return function(){return e}}function Yk(e,t,n,r,s,o){for(var i=0,a,u=t.length,c=o.length;i<c;++i)(a=t[i])?(a.__data__=o[i],r[i]=a):n[i]=new Ra(e,o[i]);for(;i<u;++i)(a=t[i])&&(s[i]=a)}function Gk(e,t,n,r,s,o,i){var a,u,c=new Map,h=t.length,d=o.length,f=new Array(h),x;for(a=0;a<h;++a)(u=t[a])&&(f[a]=x=i.call(u,u.__data__,a,t)+"",c.has(x)?s[a]=u:c.set(x,u));for(a=0;a<d;++a)x=i.call(e,o[a],a,o)+"",(u=c.get(x))?(r[a]=u,u.__data__=o[a],c.delete(x)):n[a]=new Ra(e,o[a]);for(a=0;a<h;++a)(u=t[a])&&c.get(f[a])===u&&(s[a]=u)}function Xk(e){return e.__data__}function Qk(e,t){if(!arguments.length)return Array.from(this,Xk);var n=t?Gk:Yk,r=this._parents,s=this._groups;typeof e!="function"&&(e=Kk(e));for(var o=s.length,i=new Array(o),a=new Array(o),u=new Array(o),c=0;c<o;++c){var h=r[c],d=s[c],f=d.length,x=qk(e.call(h,h&&h.__data__,c,r)),y=x.length,w=a[c]=new Array(y),N=i[c]=new Array(y),m=u[c]=new Array(f);n(h,d,w,N,m,x,t);for(var v=0,g=0,S,b;v<y;++v)if(S=w[v]){for(v>=g&&(g=v+1);!(b=N[g])&&++g<y;);S._next=b||null}}return i=new ht(i,r),i._enter=a,i._exit=u,i}function qk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Zk(){return new ht(this._exit||this._groups.map(oy),this._parents)}function Jk(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 ej(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),a=new Array(s),u=0;u<i;++u)for(var c=n[u],h=r[u],d=c.length,f=a[u]=new Array(d),x,y=0;y<d;++y)(x=c[y]||h[y])&&(f[y]=x);for(;u<s;++u)a[u]=n[u];return new ht(a,this._parents)}function tj(){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 nj(e){e||(e=rj);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],a=i.length,u=s[o]=new Array(a),c,h=0;h<a;++h)(c=i[h])&&(u[h]=c);u.sort(t)}return new ht(s,this._parents).order()}function rj(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function sj(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function oj(){return Array.from(this)}function ij(){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 aj(){let e=0;for(const t of this)++e;return e}function lj(){return!this.node()}function uj(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],o=0,i=s.length,a;o<i;++o)(a=s[o])&&e.call(a,a.__data__,o,s);return this}function cj(e){return function(){this.removeAttribute(e)}}function dj(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fj(e,t){return function(){this.setAttribute(e,t)}}function hj(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function mj(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function pj(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 gj(e,t){var n=hl(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?dj:cj:typeof t=="function"?n.local?pj:mj:n.local?hj:fj)(n,t))}function iy(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function xj(e){return function(){this.style.removeProperty(e)}}function yj(e,t,n){return function(){this.style.setProperty(e,t,n)}}function vj(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function wj(e,t,n){return arguments.length>1?this.each((t==null?xj:typeof t=="function"?vj:yj)(e,t,n??"")):fs(this.node(),e)}function fs(e,t){return e.style.getPropertyValue(t)||iy(e).getComputedStyle(e,null).getPropertyValue(t)}function Nj(e){return function(){delete this[e]}}function Sj(e,t){return function(){this[e]=t}}function bj(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function kj(e,t){return arguments.length>1?this.each((t==null?Nj:typeof t=="function"?bj:Sj)(e,t)):this.node()[e]}function ay(e){return e.trim().split(/^|\s+/)}function Jd(e){return e.classList||new ly(e)}function ly(e){this._node=e,this._names=ay(e.getAttribute("class")||"")}ly.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 uy(e,t){for(var n=Jd(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function cy(e,t){for(var n=Jd(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function jj(e){return function(){uy(this,e)}}function Cj(e){return function(){cy(this,e)}}function Ej(e,t){return function(){(t.apply(this,arguments)?uy:cy)(this,e)}}function _j(e,t){var n=ay(e+"");if(arguments.length<2){for(var r=Jd(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?Ej:t?jj:Cj)(n,t))}function Pj(){this.textContent=""}function Mj(e){return function(){this.textContent=e}}function Ij(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Rj(e){return arguments.length?this.each(e==null?Pj:(typeof e=="function"?Ij:Mj)(e)):this.node().textContent}function Tj(){this.innerHTML=""}function Lj(e){return function(){this.innerHTML=e}}function Aj(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function zj(e){return arguments.length?this.each(e==null?Tj:(typeof e=="function"?Aj:Lj)(e)):this.node().innerHTML}function Dj(){this.nextSibling&&this.parentNode.appendChild(this)}function $j(){return this.each(Dj)}function Oj(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Fj(){return this.each(Oj)}function Hj(e){var t=typeof e=="function"?e:ty(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Vj(){return null}function Bj(e,t){var n=typeof e=="function"?e:ty(e),r=t==null?Vj:typeof t=="function"?t:Zd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Uj(){var e=this.parentNode;e&&e.removeChild(this)}function Wj(){return this.each(Uj)}function Kj(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Yj(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Gj(e){return this.select(e?Yj:Kj)}function Xj(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Qj(e){return function(t){e.call(this,t,this.__data__)}}function qj(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 Zj(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 Jj(e,t,n){return function(){var r=this.__on,s,o=Qj(t);if(r){for(var i=0,a=r.length;i<a;++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 eC(e,t,n){var r=qj(e+""),s,o=r.length,i;if(arguments.length<2){var a=this.node().__on;if(a){for(var u=0,c=a.length,h;u<c;++u)for(s=0,h=a[u];s<o;++s)if((i=r[s]).type===h.type&&i.name===h.name)return h.value}return}for(a=t?Jj:Zj,s=0;s<o;++s)this.each(a(r[s],t,n));return this}function dy(e,t,n){var r=iy(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 tC(e,t){return function(){return dy(this,e,t)}}function nC(e,t){return function(){return dy(this,e,t.apply(this,arguments))}}function rC(e,t){return this.each((typeof t=="function"?nC:tC)(e,t))}function*sC(){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 fy=[null];function ht(e,t){this._groups=e,this._parents=t}function Go(){return new ht([[document.documentElement]],fy)}function oC(){return this}ht.prototype=Go.prototype={constructor:ht,select:Ik,selectAll:Ak,selectChild:Ok,selectChildren:Bk,filter:Uk,data:Qk,enter:Wk,exit:Zk,join:Jk,merge:ej,selection:oC,order:tj,sort:nj,call:sj,nodes:oj,node:ij,size:aj,empty:lj,each:uj,attr:gj,style:wj,property:kj,classed:_j,text:Rj,html:zj,raise:$j,lower:Fj,append:Hj,insert:Bj,remove:Wj,clone:Gj,datum:Xj,on:eC,dispatch:rC,[Symbol.iterator]:sC};function lt(e){return typeof e=="string"?new ht([[document.querySelector(e)]],[document.documentElement]):new ht([[e]],fy)}function iC(e){let t;for(;t=e.sourceEvent;)e=t;return e}function _t(e,t){if(e=iC(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 aC={passive:!1},Ro={capture:!0,passive:!1};function au(e){e.stopImmediatePropagation()}function Jr(e){e.preventDefault(),e.stopImmediatePropagation()}function hy(e){var t=e.document.documentElement,n=lt(e).on("dragstart.drag",Jr,Ro);"onselectstart"in t?n.on("selectstart.drag",Jr,Ro):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function my(e,t){var n=e.document.documentElement,r=lt(e).on("dragstart.drag",null);t&&(r.on("click.drag",Jr,Ro),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 Si=e=>()=>e;function jc(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:i,y:a,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:a,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}jc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function lC(e){return!e.ctrlKey&&!e.button}function uC(){return this.parentNode}function cC(e,t){return t??{x:e.x,y:e.y}}function dC(){return navigator.maxTouchPoints||"ontouchstart"in this}function py(){var e=lC,t=uC,n=cC,r=dC,s={},o=fl("start","drag","end"),i=0,a,u,c,h,d=0;function f(S){S.on("mousedown.drag",x).filter(r).on("touchstart.drag",N).on("touchmove.drag",m,aC).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(S,b){if(!(h||!e.call(this,S,b))){var j=g(this,t.call(this,S,b),S,b,"mouse");j&&(lt(S.view).on("mousemove.drag",y,Ro).on("mouseup.drag",w,Ro),hy(S.view),au(S),c=!1,a=S.clientX,u=S.clientY,j("start",S))}}function y(S){if(Jr(S),!c){var b=S.clientX-a,j=S.clientY-u;c=b*b+j*j>d}s.mouse("drag",S)}function w(S){lt(S.view).on("mousemove.drag mouseup.drag",null),my(S.view,c),Jr(S),s.mouse("end",S)}function N(S,b){if(e.call(this,S,b)){var j=S.changedTouches,k=t.call(this,S,b),_=j.length,I,$;for(I=0;I<_;++I)($=g(this,k,S,b,j[I].identifier,j[I]))&&(au(S),$("start",S,j[I]))}}function m(S){var b=S.changedTouches,j=b.length,k,_;for(k=0;k<j;++k)(_=s[b[k].identifier])&&(Jr(S),_("drag",S,b[k]))}function v(S){var b=S.changedTouches,j=b.length,k,_;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),k=0;k<j;++k)(_=s[b[k].identifier])&&(au(S),_("end",S,b[k]))}function g(S,b,j,k,_,I){var $=o.copy(),R=_t(I||j,b),T,A,C;if((C=n.call(S,new jc("beforestart",{sourceEvent:j,target:f,identifier:_,active:i,x:R[0],y:R[1],dx:0,dy:0,dispatch:$}),k))!=null)return T=C.x-R[0]||0,A=C.y-R[1]||0,function L(M,D,E){var P=R,z;switch(M){case"start":s[_]=L,z=i++;break;case"end":delete s[_],--i;case"drag":R=_t(E||D,b),z=i;break}$.call(M,S,new jc(M,{sourceEvent:D,subject:C,target:f,identifier:_,active:z,x:R[0]+T,y:R[1]+A,dx:R[0]-P[0],dy:R[1]-P[1],dispatch:$}),k)}}return f.filter=function(S){return arguments.length?(e=typeof S=="function"?S:Si(!!S),f):e},f.container=function(S){return arguments.length?(t=typeof S=="function"?S:Si(S),f):t},f.subject=function(S){return arguments.length?(n=typeof S=="function"?S:Si(S),f):n},f.touchable=function(S){return arguments.length?(r=typeof S=="function"?S:Si(!!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 ef(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function gy(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Xo(){}var To=.7,Ta=1/To,es="\\s*([+-]?\\d+)\\s*",Lo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fC=/^#([0-9a-f]{3,8})$/,hC=new RegExp(`^rgb\\(${es},${es},${es}\\)$`),mC=new RegExp(`^rgb\\(${Xt},${Xt},${Xt}\\)$`),pC=new RegExp(`^rgba\\(${es},${es},${es},${Lo}\\)$`),gC=new RegExp(`^rgba\\(${Xt},${Xt},${Xt},${Lo}\\)$`),xC=new RegExp(`^hsl\\(${Lo},${Xt},${Xt}\\)$`),yC=new RegExp(`^hsla\\(${Lo},${Xt},${Xt},${Lo}\\)$`),em={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};ef(Xo,xr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:tm,formatHex:tm,formatHex8:vC,formatHsl:wC,formatRgb:nm,toString:nm});function tm(){return this.rgb().formatHex()}function vC(){return this.rgb().formatHex8()}function wC(){return xy(this).formatHsl()}function nm(){return this.rgb().formatRgb()}function xr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=fC.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?rm(t):n===3?new rt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?bi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?bi(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=hC.exec(e))?new rt(t[1],t[2],t[3],1):(t=mC.exec(e))?new rt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=pC.exec(e))?bi(t[1],t[2],t[3],t[4]):(t=gC.exec(e))?bi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=xC.exec(e))?im(t[1],t[2]/100,t[3]/100,1):(t=yC.exec(e))?im(t[1],t[2]/100,t[3]/100,t[4]):em.hasOwnProperty(e)?rm(em[e]):e==="transparent"?new rt(NaN,NaN,NaN,0):null}function rm(e){return new rt(e>>16&255,e>>8&255,e&255,1)}function bi(e,t,n,r){return r<=0&&(e=t=n=NaN),new rt(e,t,n,r)}function NC(e){return e instanceof Xo||(e=xr(e)),e?(e=e.rgb(),new rt(e.r,e.g,e.b,e.opacity)):new rt}function Cc(e,t,n,r){return arguments.length===1?NC(e):new rt(e,t,n,r??1)}function rt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ef(rt,Cc,gy(Xo,{brighter(e){return e=e==null?Ta:Math.pow(Ta,e),new rt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?To:Math.pow(To,e),new rt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new rt(ur(this.r),ur(this.g),ur(this.b),La(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:sm,formatHex:sm,formatHex8:SC,formatRgb:om,toString:om}));function sm(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}`}function SC(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}${ir((isNaN(this.opacity)?1:this.opacity)*255)}`}function om(){const e=La(this.opacity);return`${e===1?"rgb(":"rgba("}${ur(this.r)}, ${ur(this.g)}, ${ur(this.b)}${e===1?")":`, ${e})`}`}function La(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ur(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ir(e){return e=ur(e),(e<16?"0":"")+e.toString(16)}function im(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Mt(e,t,n,r)}function xy(e){if(e instanceof Mt)return new Mt(e.h,e.s,e.l,e.opacity);if(e instanceof Xo||(e=xr(e)),!e)return new Mt;if(e instanceof Mt)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,a=o-s,u=(o+s)/2;return a?(t===o?i=(n-r)/a+(n<r)*6:n===o?i=(r-t)/a+2:i=(t-n)/a+4,a/=u<.5?o+s:2-o-s,i*=60):a=u>0&&u<1?0:i,new Mt(i,a,u,e.opacity)}function bC(e,t,n,r){return arguments.length===1?xy(e):new Mt(e,t,n,r??1)}function Mt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ef(Mt,bC,gy(Xo,{brighter(e){return e=e==null?Ta:Math.pow(Ta,e),new Mt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?To:Math.pow(To,e),new Mt(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 rt(lu(e>=240?e-240:e+120,s,r),lu(e,s,r),lu(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Mt(am(this.h),ki(this.s),ki(this.l),La(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=La(this.opacity);return`${e===1?"hsl(":"hsla("}${am(this.h)}, ${ki(this.s)*100}%, ${ki(this.l)*100}%${e===1?")":`, ${e})`}`}}));function am(e){return e=(e||0)%360,e<0?e+360:e}function ki(e){return Math.max(0,Math.min(1,e||0))}function lu(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 tf=e=>()=>e;function kC(e,t){return function(n){return e+n*t}}function jC(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 CC(e){return(e=+e)==1?yy:function(t,n){return n-t?jC(t,n,e):tf(isNaN(t)?n:t)}}function yy(e,t){var n=t-e;return n?kC(e,n):tf(isNaN(e)?t:e)}const Aa=function e(t){var n=CC(t);function r(s,o){var i=n((s=Cc(s)).r,(o=Cc(o)).r),a=n(s.g,o.g),u=n(s.b,o.b),c=yy(s.opacity,o.opacity);return function(h){return s.r=i(h),s.g=a(h),s.b=u(h),s.opacity=c(h),s+""}}return r.gamma=e,r}(1);function EC(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 _C(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function PC(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]=co(e[i],t[i]);for(;i<n;++i)o[i]=t[i];return function(a){for(i=0;i<r;++i)o[i]=s[i](a);return o}}function MC(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ut(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function IC(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]=co(e[s],t[s]):r[s]=t[s];return function(o){for(s in n)r[s]=n[s](o);return r}}var Ec=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,uu=new RegExp(Ec.source,"g");function RC(e){return function(){return e}}function TC(e){return function(t){return e(t)+""}}function vy(e,t){var n=Ec.lastIndex=uu.lastIndex=0,r,s,o,i=-1,a=[],u=[];for(e=e+"",t=t+"";(r=Ec.exec(e))&&(s=uu.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),a[i]?a[i]+=o:a[++i]=o),(r=r[0])===(s=s[0])?a[i]?a[i]+=s:a[++i]=s:(a[++i]=null,u.push({i,x:Ut(r,s)})),n=uu.lastIndex;return n<t.length&&(o=t.slice(n),a[i]?a[i]+=o:a[++i]=o),a.length<2?u[0]?TC(u[0].x):RC(t):(t=u.length,function(c){for(var h=0,d;h<t;++h)a[(d=u[h]).i]=d.x(c);return a.join("")})}function co(e,t){var n=typeof t,r;return t==null||n==="boolean"?tf(t):(n==="number"?Ut:n==="string"?(r=xr(t))?(t=r,Aa):vy:t instanceof xr?Aa:t instanceof Date?MC:_C(t)?EC:Array.isArray(t)?PC:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?IC:Ut)(e,t)}var lm=180/Math.PI,_c={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function wy(e,t,n,r,s,o){var i,a,u;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,u/=a),e*r<t*n&&(e=-e,t=-t,u=-u,i=-i),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*lm,skewX:Math.atan(u)*lm,scaleX:i,scaleY:a}}var ji;function LC(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?_c:wy(t.a,t.b,t.c,t.d,t.e,t.f)}function AC(e){return e==null||(ji||(ji=document.createElementNS("http://www.w3.org/2000/svg","g")),ji.setAttribute("transform",e),!(e=ji.transform.baseVal.consolidate()))?_c:(e=e.matrix,wy(e.a,e.b,e.c,e.d,e.e,e.f))}function Ny(e,t,n,r){function s(c){return c.length?c.pop()+" ":""}function o(c,h,d,f,x,y){if(c!==d||h!==f){var w=x.push("translate(",null,t,null,n);y.push({i:w-4,x:Ut(c,d)},{i:w-2,x:Ut(h,f)})}else(d||f)&&x.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:Ut(c,h)})):h&&d.push(s(d)+"rotate("+h+r)}function a(c,h,d,f){c!==h?f.push({i:d.push(s(d)+"skewX(",null,r)-2,x:Ut(c,h)}):h&&d.push(s(d)+"skewX("+h+r)}function u(c,h,d,f,x,y){if(c!==d||h!==f){var w=x.push(s(x)+"scale(",null,",",null,")");y.push({i:w-4,x:Ut(c,d)},{i:w-2,x:Ut(h,f)})}else(d!==1||f!==1)&&x.push(s(x)+"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),a(c.skewX,h.skewX,d,f),u(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,f),c=h=null,function(x){for(var y=-1,w=f.length,N;++y<w;)d[(N=f[y]).i]=N.x(x);return d.join("")}}}var zC=Ny(LC,"px, ","px)","deg)"),DC=Ny(AC,", ",")",")"),$C=1e-12;function um(e){return((e=Math.exp(e))+1/e)/2}function OC(e){return((e=Math.exp(e))-1/e)/2}function FC(e){return((e=Math.exp(2*e))-1)/(e+1)}const Zi=function e(t,n,r){function s(o,i){var a=o[0],u=o[1],c=o[2],h=i[0],d=i[1],f=i[2],x=h-a,y=d-u,w=x*x+y*y,N,m;if(w<$C)m=Math.log(f/c)/t,N=function(k){return[a+k*x,u+k*y,c*Math.exp(t*k*m)]};else{var v=Math.sqrt(w),g=(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(g*g+1)-g),j=Math.log(Math.sqrt(S*S+1)-S);m=(j-b)/t,N=function(k){var _=k*m,I=um(b),$=c/(n*v)*(I*FC(t*_+b)-OC(b));return[a+$*x,u+$*y,c*I/um(t*_+b)]}}return N.duration=m*1e3*t/Math.SQRT2,N}return s.rho=function(o){var i=Math.max(.001,+o),a=i*i,u=a*a;return e(i,a,u)},s}(Math.SQRT2,2,4);var hs=0,Js=0,Ys=0,Sy=1e3,za,eo,Da=0,yr=0,ml=0,Ao=typeof performance=="object"&&performance.now?performance:Date,by=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function nf(){return yr||(by(HC),yr=Ao.now()+ml)}function HC(){yr=0}function $a(){this._call=this._time=this._next=null}$a.prototype=ky.prototype={constructor:$a,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?nf():+n)+(t==null?0:+t),!this._next&&eo!==this&&(eo?eo._next=this:za=this,eo=this),this._call=e,this._time=n,Pc()},stop:function(){this._call&&(this._call=null,this._time=1/0,Pc())}};function ky(e,t,n){var r=new $a;return r.restart(e,t,n),r}function VC(){nf(),++hs;for(var e=za,t;e;)(t=yr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--hs}function cm(){yr=(Da=Ao.now())+ml,hs=Js=0;try{VC()}finally{hs=0,UC(),yr=0}}function BC(){var e=Ao.now(),t=e-Da;t>Sy&&(ml-=t,Da=e)}function UC(){for(var e,t=za,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:za=n);eo=e,Pc(r)}function Pc(e){if(!hs){Js&&(Js=clearTimeout(Js));var t=e-yr;t>24?(e<1/0&&(Js=setTimeout(cm,e-Ao.now()-ml)),Ys&&(Ys=clearInterval(Ys))):(Ys||(Da=Ao.now(),Ys=setInterval(BC,Sy)),hs=1,by(cm))}}function dm(e,t,n){var r=new $a;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var WC=fl("start","end","cancel","interrupt"),KC=[],jy=0,fm=1,Mc=2,Ji=3,hm=4,Ic=5,ea=6;function pl(e,t,n,r,s,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;YC(e,n,{name:t,index:r,group:s,on:WC,tween:KC,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:jy})}function rf(e,t){var n=Ot(e,t);if(n.state>jy)throw new Error("too late; already scheduled");return n}function Jt(e,t){var n=Ot(e,t);if(n.state>Ji)throw new Error("too late; already running");return n}function Ot(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function YC(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=ky(o,0,n.time);function o(c){n.state=fm,n.timer.restart(i,n.delay,n.time),n.delay<=c&&i(c-n.delay)}function i(c){var h,d,f,x;if(n.state!==fm)return u();for(h in r)if(x=r[h],x.name===n.name){if(x.state===Ji)return dm(i);x.state===hm?(x.state=ea,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete r[h]):+h<t&&(x.state=ea,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete r[h])}if(dm(function(){n.state===Ji&&(n.state=hm,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Mc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Mc){for(n.state=Ji,s=new Array(f=n.tween.length),h=0,d=-1;h<f;++h)(x=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(s[++d]=x);s.length=d+1}}function a(c){for(var h=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(u),n.state=Ic,1),d=-1,f=s.length;++d<f;)s[d].call(e,h);n.state===Ic&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=ea,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function ta(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>Mc&&r.state<Ic,r.state=ea,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}o&&delete e.__transition}}function GC(e){return this.each(function(){ta(this,e)})}function XC(e,t){var n,r;return function(){var s=Jt(this,e),o=s.tween;if(o!==n){r=n=o;for(var i=0,a=r.length;i<a;++i)if(r[i].name===t){r=r.slice(),r.splice(i,1);break}}s.tween=r}}function QC(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=Jt(this,e),i=o.tween;if(i!==r){s=(r=i).slice();for(var a={name:t,value:n},u=0,c=s.length;u<c;++u)if(s[u].name===t){s[u]=a;break}u===c&&s.push(a)}o.tween=s}}function qC(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ot(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?XC:QC)(n,e,t))}function sf(e,t,n){var r=e._id;return e.each(function(){var s=Jt(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Ot(s,r).value[t]}}function Cy(e,t){var n;return(typeof t=="number"?Ut:t instanceof xr?Aa:(n=xr(t))?(t=n,Aa):vy)(e,t)}function ZC(e){return function(){this.removeAttribute(e)}}function JC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function eE(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 tE(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 nE(e,t,n){var r,s,o;return function(){var i,a=n(this),u;return a==null?void this.removeAttribute(e):(i=this.getAttribute(e),u=a+"",i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,a)))}}function rE(e,t,n){var r,s,o;return function(){var i,a=n(this),u;return a==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),u=a+"",i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,a)))}}function sE(e,t){var n=hl(e),r=n==="transform"?DC:Cy;return this.attrTween(e,typeof t=="function"?(n.local?rE:nE)(n,r,sf(this,"attr."+e,t)):t==null?(n.local?JC:ZC)(n):(n.local?tE:eE)(n,r,t))}function oE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function iE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function aE(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&iE(e,o)),n}return s._value=t,s}function lE(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&oE(e,o)),n}return s._value=t,s}function uE(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=hl(e);return this.tween(n,(r.local?aE:lE)(r,t))}function cE(e,t){return function(){rf(this,e).delay=+t.apply(this,arguments)}}function dE(e,t){return t=+t,function(){rf(this,e).delay=t}}function fE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?cE:dE)(t,e)):Ot(this.node(),t).delay}function hE(e,t){return function(){Jt(this,e).duration=+t.apply(this,arguments)}}function mE(e,t){return t=+t,function(){Jt(this,e).duration=t}}function pE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?hE:mE)(t,e)):Ot(this.node(),t).duration}function gE(e,t){if(typeof t!="function")throw new Error;return function(){Jt(this,e).ease=t}}function xE(e){var t=this._id;return arguments.length?this.each(gE(t,e)):Ot(this.node(),t).ease}function yE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Jt(this,e).ease=n}}function vE(e){if(typeof e!="function")throw new Error;return this.each(yE(this._id,e))}function wE(e){typeof e!="function"&&(e=ry(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,a=r[s]=[],u,c=0;c<i;++c)(u=o[c])&&e.call(u,u.__data__,c,o)&&a.push(u);return new gn(r,this._parents,this._name,this._id)}function NE(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),a=0;a<o;++a)for(var u=t[a],c=n[a],h=u.length,d=i[a]=new Array(h),f,x=0;x<h;++x)(f=u[x]||c[x])&&(d[x]=f);for(;a<r;++a)i[a]=t[a];return new gn(i,this._parents,this._name,this._id)}function SE(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 bE(e,t,n){var r,s,o=SE(t)?rf:Jt;return function(){var i=o(this,e),a=i.on;a!==r&&(s=(r=a).copy()).on(t,n),i.on=s}}function kE(e,t){var n=this._id;return arguments.length<2?Ot(this.node(),n).on.on(e):this.each(bE(n,e,t))}function jE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function CE(){return this.on("end.remove",jE(this._id))}function EE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Zd(e));for(var r=this._groups,s=r.length,o=new Array(s),i=0;i<s;++i)for(var a=r[i],u=a.length,c=o[i]=new Array(u),h,d,f=0;f<u;++f)(h=a[f])&&(d=e.call(h,h.__data__,f,a))&&("__data__"in h&&(d.__data__=h.__data__),c[f]=d,pl(c[f],t,n,f,c,Ot(h,n)));return new gn(o,this._parents,t,n)}function _E(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ny(e));for(var r=this._groups,s=r.length,o=[],i=[],a=0;a<s;++a)for(var u=r[a],c=u.length,h,d=0;d<c;++d)if(h=u[d]){for(var f=e.call(h,h.__data__,d,u),x,y=Ot(h,n),w=0,N=f.length;w<N;++w)(x=f[w])&&pl(x,t,n,w,f,y);o.push(f),i.push(h)}return new gn(o,i,t,n)}var PE=Go.prototype.constructor;function ME(){return new PE(this._groups,this._parents)}function IE(e,t){var n,r,s;return function(){var o=fs(this,e),i=(this.style.removeProperty(e),fs(this,e));return o===i?null:o===n&&i===r?s:s=t(n=o,r=i)}}function Ey(e){return function(){this.style.removeProperty(e)}}function RE(e,t,n){var r,s=n+"",o;return function(){var i=fs(this,e);return i===s?null:i===r?o:o=t(r=i,n)}}function TE(e,t,n){var r,s,o;return function(){var i=fs(this,e),a=n(this),u=a+"";return a==null&&(u=a=(this.style.removeProperty(e),fs(this,e))),i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,a))}}function LE(e,t){var n,r,s,o="style."+t,i="end."+o,a;return function(){var u=Jt(this,e),c=u.on,h=u.value[o]==null?a||(a=Ey(t)):void 0;(c!==n||s!==h)&&(r=(n=c).copy()).on(i,s=h),u.on=r}}function AE(e,t,n){var r=(e+="")=="transform"?zC:Cy;return t==null?this.styleTween(e,IE(e,r)).on("end.style."+e,Ey(e)):typeof t=="function"?this.styleTween(e,TE(e,r,sf(this,"style."+e,t))).each(LE(this._id,e)):this.styleTween(e,RE(e,r,t),n).on("end.style."+e,null)}function zE(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function DE(e,t,n){var r,s;function o(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&zE(e,i,n)),r}return o._value=t,o}function $E(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,DE(e,t,n??""))}function OE(e){return function(){this.textContent=e}}function FE(e){return function(){var t=e(this);this.textContent=t??""}}function HE(e){return this.tween("text",typeof e=="function"?FE(sf(this,"text",e)):OE(e==null?"":e+""))}function VE(e){return function(t){this.textContent=e.call(this,t)}}function BE(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&VE(s)),t}return r._value=e,r}function UE(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,BE(e))}function WE(){for(var e=this._name,t=this._id,n=_y(),r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],a=i.length,u,c=0;c<a;++c)if(u=i[c]){var h=Ot(u,t);pl(u,e,n,c,i,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new gn(r,this._parents,e,n)}function KE(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,i){var a={value:i},u={value:function(){--s===0&&o()}};n.each(function(){var c=Jt(this,r),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(u)),c.on=t}),s===0&&o()})}var YE=0;function gn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function _y(){return++YE}var nn=Go.prototype;gn.prototype={constructor:gn,select:EE,selectAll:_E,selectChild:nn.selectChild,selectChildren:nn.selectChildren,filter:wE,merge:NE,selection:ME,transition:WE,call:nn.call,nodes:nn.nodes,node:nn.node,size:nn.size,empty:nn.empty,each:nn.each,on:kE,attr:sE,attrTween:uE,style:AE,styleTween:$E,text:HE,textTween:UE,remove:CE,tween:qC,delay:fE,duration:pE,ease:xE,easeVarying:vE,end:KE,[Symbol.iterator]:nn[Symbol.iterator]};function GE(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var XE={time:null,delay:0,duration:250,ease:GE};function QE(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 qE(e){var t,n;e instanceof gn?(t=e._id,e=e._name):(t=_y(),(n=XE).time=nf(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],a=i.length,u,c=0;c<a;++c)(u=i[c])&&pl(u,e,t,c,i,n||QE(u,t));return new gn(r,this._parents,e,t)}Go.prototype.interrupt=GC;Go.prototype.transition=qE;const Ci=e=>()=>e;function ZE(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 ln(e,t,n){this.k=e,this.x=t,this.y=n}ln.prototype={constructor:ln,scale:function(e){return e===1?this:new ln(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ln(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 gl=new ln(1,0,0);Py.prototype=ln.prototype;function Py(e){for(;!e.__zoom;)if(!(e=e.parentNode))return gl;return e.__zoom}function cu(e){e.stopImmediatePropagation()}function Gs(e){e.preventDefault(),e.stopImmediatePropagation()}function JE(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function e_(){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 mm(){return this.__zoom||gl}function t_(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function n_(){return navigator.maxTouchPoints||"ontouchstart"in this}function r_(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 My(){var e=JE,t=e_,n=r_,r=t_,s=n_,o=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],a=250,u=Zi,c=fl("start","zoom","end"),h,d,f,x=500,y=150,w=0,N=10;function m(C){C.property("__zoom",mm).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",$).filter(s).on("touchstart.zoom",R).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(C,L,M,D){var E=C.selection?C.selection():C;E.property("__zoom",mm),C!==E?b(C,L,M,D):E.interrupt().each(function(){j(this,arguments).event(D).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},m.scaleBy=function(C,L,M,D){m.scaleTo(C,function(){var E=this.__zoom.k,P=typeof L=="function"?L.apply(this,arguments):L;return E*P},M,D)},m.scaleTo=function(C,L,M,D){m.transform(C,function(){var E=t.apply(this,arguments),P=this.__zoom,z=M==null?S(E):typeof M=="function"?M.apply(this,arguments):M,F=P.invert(z),O=typeof L=="function"?L.apply(this,arguments):L;return n(g(v(P,O),z,F),E,i)},M,D)},m.translateBy=function(C,L,M,D){m.transform(C,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),i)},null,D)},m.translateTo=function(C,L,M,D,E){m.transform(C,function(){var P=t.apply(this,arguments),z=this.__zoom,F=D==null?S(P):typeof D=="function"?D.apply(this,arguments):D;return n(gl.translate(F[0],F[1]).scale(z.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof M=="function"?-M.apply(this,arguments):-M),P,i)},D,E)};function v(C,L){return L=Math.max(o[0],Math.min(o[1],L)),L===C.k?C:new ln(L,C.x,C.y)}function g(C,L,M){var D=L[0]-M[0]*C.k,E=L[1]-M[1]*C.k;return D===C.x&&E===C.y?C:new ln(C.k,D,E)}function S(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function b(C,L,M,D){C.on("start.zoom",function(){j(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){j(this,arguments).event(D).end()}).tween("zoom",function(){var E=this,P=arguments,z=j(E,P).event(D),F=t.apply(E,P),O=M==null?S(F):typeof M=="function"?M.apply(E,P):M,U=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),B=E.__zoom,K=typeof L=="function"?L.apply(E,P):L,Y=u(B.invert(O).concat(U/B.k),K.invert(O).concat(U/K.k));return function(G){if(G===1)G=K;else{var V=Y(G),Q=U/V[2];G=new ln(Q,O[0]-V[0]*Q,O[1]-V[1]*Q)}z.zoom(null,G)}})}function j(C,L,M){return!M&&C.__zooming||new k(C,L)}function k(C,L){this.that=C,this.args=L,this.active=0,this.sourceEvent=null,this.extent=t.apply(C,L),this.taps=0}k.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,L){return this.mouse&&C!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&C!=="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(C){var L=lt(this.that).datum();c.call(C,this.that,new ZE(C,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:c}),L)}};function _(C,...L){if(!e.apply(this,arguments))return;var M=j(this,L).event(C),D=this.__zoom,E=Math.max(o[0],Math.min(o[1],D.k*Math.pow(2,r.apply(this,arguments)))),P=_t(C);if(M.wheel)(M.mouse[0][0]!==P[0]||M.mouse[0][1]!==P[1])&&(M.mouse[1]=D.invert(M.mouse[0]=P)),clearTimeout(M.wheel);else{if(D.k===E)return;M.mouse=[P,D.invert(P)],ta(this),M.start()}Gs(C),M.wheel=setTimeout(z,y),M.zoom("mouse",n(g(v(D,E),M.mouse[0],M.mouse[1]),M.extent,i));function z(){M.wheel=null,M.end()}}function I(C,...L){if(f||!e.apply(this,arguments))return;var M=C.currentTarget,D=j(this,L,!0).event(C),E=lt(C.view).on("mousemove.zoom",O,!0).on("mouseup.zoom",U,!0),P=_t(C,M),z=C.clientX,F=C.clientY;hy(C.view),cu(C),D.mouse=[P,this.__zoom.invert(P)],ta(this),D.start();function O(B){if(Gs(B),!D.moved){var K=B.clientX-z,Y=B.clientY-F;D.moved=K*K+Y*Y>w}D.event(B).zoom("mouse",n(g(D.that.__zoom,D.mouse[0]=_t(B,M),D.mouse[1]),D.extent,i))}function U(B){E.on("mousemove.zoom mouseup.zoom",null),my(B.view,D.moved),Gs(B),D.event(B).end()}}function $(C,...L){if(e.apply(this,arguments)){var M=this.__zoom,D=_t(C.changedTouches?C.changedTouches[0]:C,this),E=M.invert(D),P=M.k*(C.shiftKey?.5:2),z=n(g(v(M,P),D,E),t.apply(this,L),i);Gs(C),a>0?lt(this).transition().duration(a).call(b,z,D,C):lt(this).call(m.transform,z,D,C)}}function R(C,...L){if(e.apply(this,arguments)){var M=C.touches,D=M.length,E=j(this,L,C.changedTouches.length===D).event(C),P,z,F,O;for(cu(C),z=0;z<D;++z)F=M[z],O=_t(F,this),O=[O,this.__zoom.invert(O),F.identifier],E.touch0?!E.touch1&&E.touch0[2]!==O[2]&&(E.touch1=O,E.taps=0):(E.touch0=O,P=!0,E.taps=1+!!h);h&&(h=clearTimeout(h)),P&&(E.taps<2&&(d=O[0],h=setTimeout(function(){h=null},x)),ta(this),E.start())}}function T(C,...L){if(this.__zooming){var M=j(this,L).event(C),D=C.changedTouches,E=D.length,P,z,F,O;for(Gs(C),P=0;P<E;++P)z=D[P],F=_t(z,this),M.touch0&&M.touch0[2]===z.identifier?M.touch0[0]=F:M.touch1&&M.touch1[2]===z.identifier&&(M.touch1[0]=F);if(z=M.that.__zoom,M.touch1){var U=M.touch0[0],B=M.touch0[1],K=M.touch1[0],Y=M.touch1[1],G=(G=K[0]-U[0])*G+(G=K[1]-U[1])*G,V=(V=Y[0]-B[0])*V+(V=Y[1]-B[1])*V;z=v(z,Math.sqrt(G/V)),F=[(U[0]+K[0])/2,(U[1]+K[1])/2],O=[(B[0]+Y[0])/2,(B[1]+Y[1])/2]}else if(M.touch0)F=M.touch0[0],O=M.touch0[1];else return;M.zoom("touch",n(g(z,F,O),M.extent,i))}}function A(C,...L){if(this.__zooming){var M=j(this,L).event(C),D=C.changedTouches,E=D.length,P,z;for(cu(C),f&&clearTimeout(f),f=setTimeout(function(){f=null},x),P=0;P<E;++P)z=D[P],M.touch0&&M.touch0[2]===z.identifier?delete M.touch0:M.touch1&&M.touch1[2]===z.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(z=_t(z,this),Math.hypot(d[0]-z[0],d[1]-z[1])<N)){var F=lt(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return m.wheelDelta=function(C){return arguments.length?(r=typeof C=="function"?C:Ci(+C),m):r},m.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Ci(!!C),m):e},m.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:Ci(!!C),m):s},m.extent=function(C){return arguments.length?(t=typeof C=="function"?C:Ci([[+C[0][0],+C[0][1]],[+C[1][0],+C[1][1]]]),m):t},m.scaleExtent=function(C){return arguments.length?(o[0]=+C[0],o[1]=+C[1],m):[o[0],o[1]]},m.translateExtent=function(C){return arguments.length?(i[0][0]=+C[0][0],i[1][0]=+C[1][0],i[0][1]=+C[0][1],i[1][1]=+C[1][1],m):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},m.constrain=function(C){return arguments.length?(n=C,m):n},m.duration=function(C){return arguments.length?(a=+C,m):a},m.interpolate=function(C){return arguments.length?(u=C,m):u},m.on=function(){var C=c.on.apply(c,arguments);return C===c?m:C},m.clickDistance=function(C){return arguments.length?(w=(C=+C)*C,m):Math.sqrt(w)},m.tapDistance=function(C){return arguments.length?(N=+C,m):N},m}const Zt={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."},zo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Iy=["Enter"," ","Escape"],Ry={"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 ms;(function(e){e.Strict="strict",e.Loose="loose"})(ms||(ms={}));var cr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(cr||(cr={}));var Do;(function(e){e.Partial="partial",e.Full="full"})(Do||(Do={}));const Ty={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var In;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(In||(In={}));var Oa;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Oa||(Oa={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const pm={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top};function Ly(e){return e===null?null:e?"valid":"invalid"}const Ay=e=>"id"in e&&"source"in e&&"target"in e,s_=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),of=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Qo=(e,t=[0,0])=>{const{width:n,height:r}=vn(e),s=e.origin??t,o=n*s[0],i=r*s[1];return{x:e.position.x-o,y:e.position.y-i}},o_=(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):of(s)?s:t.nodeLookup.get(s.id));const a=i?Fa(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return xl(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return yl(n)},qo=(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=xl(n,Fa(s)),r=!0)}),r?yl(n):{x:0,y:0,width:0,height:0}},af=(e,t,[n,r,s]=[0,0,1],o=!1,i=!1)=>{const a={...Jo(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 x=h.width??c.width??c.initialWidth??null,y=h.height??c.height??c.initialHeight??null,w=$o(a,gs(c)),N=(x??0)*(y??0),m=o&&w>0;(!c.internals.handleBounds||m||w>=N||c.dragging)&&u.push(c)}return u},i_=(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 a_(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 l_({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},i){if(e.size===0)return Promise.resolve(!0);const a=a_(e,i),u=qo(a),c=lf(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 zy({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:o}){const i=n.get(e),a=i.parentId?n.get(i.parentId):void 0,{x:u,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},h=i.origin??r;let d=i.extent||s;if(i.extent==="parent"&&!i.expandParent)if(!a)o==null||o("005",Zt.error005());else{const x=a.measured.width,y=a.measured.height;x&&y&&(d=[[u,c],[u+x,c+y]])}else a&&xs(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=xs(d)?vr(t,d,i.measured):t;return(i.measured.width===void 0||i.measured.height===void 0)&&(o==null||o("015",Zt.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 u_({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 x=o.has(f.id),y=!x&&f.parentId&&i.find(w=>w.id===f.parentId);(x||y)&&i.push(f)}const a=new Set(t.map(f=>f.id)),u=r.filter(f=>f.deletable!==!1),h=i_(i,u);for(const f of u)a.has(f.id)&&!h.find(y=>y.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 ps=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),vr=(e={x:0,y:0},t,n)=>({x:ps(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ps(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Dy(e,t,n){const{width:r,height:s}=vn(n),{x:o,y:i}=n.internals.positionAbsolute;return vr(e,[[o,i],[o+r,i+s]],t)}const gm=(e,t,n)=>e<t?ps(Math.abs(e-t),1,t)/t:e>n?-ps(Math.abs(e-n),1,t)/t:0,$y=(e,t,n=15,r=40)=>{const s=gm(e.x,r,t.width-r)*n,o=gm(e.y,r,t.height-r)*n;return[s,o]},xl=(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)}),Rc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),yl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),gs=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=of(e)?e.internals.positionAbsolute:Qo(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}},Fa=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=of(e)?e.internals.positionAbsolute:Qo(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)}},Oy=(e,t)=>yl(xl(Rc(e),Rc(t))),$o=(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)},xm=e=>It(e.width)&&It(e.height)&&It(e.x)&&It(e.y),It=e=>!isNaN(e)&&isFinite(e),c_=(e,t)=>{},Zo=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Jo=({x:e,y:t},[n,r,s],o=!1,i=[1,1])=>{const a={x:(e-n)/s,y:(t-r)/s};return o?Zo(a,i):a},Ha=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function Pr(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 d_(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Pr(e,n),s=Pr(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Pr(e.top??e.y??0,n),s=Pr(e.bottom??e.y??0,n),o=Pr(e.left??e.x??0,t),i=Pr(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 f_(e,t,n,r,s,o){const{x:i,y:a}=Ha(e,[t,n,r]),{x:u,y:c}=Ha({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(a),right:Math.floor(h),bottom:Math.floor(d)}}const lf=(e,t,n,r,s,o)=>{const i=d_(o,t,n),a=(t-i.x)/e.width,u=(n-i.y)/e.height,c=Math.min(a,u),h=ps(c,r,s),d=e.x+e.width/2,f=e.y+e.height/2,x=t/2-d*h,y=n/2-f*h,w=f_(e,x,y,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:x-N.left+N.right,y:y-N.top+N.bottom,zoom:h}},Oo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function xs(e){return e!=null&&e!=="parent"}function vn(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 Fy(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 Hy(e,t={width:0,height:0},n,r,s){const o={...e},i=r.get(n);if(i){const a=i.origin||s;o.x+=i.internals.positionAbsolute.x-(t.width??0)*a[0],o.y+=i.internals.positionAbsolute.y-(t.height??0)*a[1]}return o}function ym(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function h_(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function m_(e){return{...Ry,...e||{}}}function fo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:i}=Rt(e),a=Jo({x:o-((s==null?void 0:s.left)??0),y:i-((s==null?void 0:s.top)??0)},r),{x:u,y:c}=n?Zo(a,t):a;return{xSnapped:u,ySnapped:c,...a}}const uf=e=>({width:e.offsetWidth,height:e.offsetHeight}),Vy=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},p_=["INPUT","SELECT","TEXTAREA"];function By(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:p_.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Uy=e=>"clientX"in e,Rt=(e,t)=>{var o,i;const n=Uy(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)}},vm=(e,t,n,r,s)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(i=>{const a=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:e,nodeId:s,position:i.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...uf(i)}})};function Wy({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:i,targetControlY:a}){const u=e*.125+s*.375+i*.375+n*.125,c=t*.125+o*.375+a*.375+r*.125,h=Math.abs(u-e),d=Math.abs(c-t);return[u,c,h,d]}function Ei(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function wm({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case X.Left:return[t-Ei(t-r,o),n];case X.Right:return[t+Ei(r-t,o),n];case X.Top:return[t,n-Ei(n-s,o)];case X.Bottom:return[t,n+Ei(s-n,o)]}}function Ky({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:s,targetPosition:o=X.Top,curvature:i=.25}){const[a,u]=wm({pos:n,x1:e,y1:t,x2:r,y2:s,c:i}),[c,h]=wm({pos:o,x1:r,y1:s,x2:e,y2:t,c:i}),[d,f,x,y]=Wy({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:u,targetControlX:c,targetControlY:h});return[`M${e},${t} C${a},${u} ${c},${h} ${r},${s}`,d,f,x,y]}function Yy({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,a=r<t?r+i:r-i;return[o,a,s,i]}function g_({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,a=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return i+a}function x_({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=xl(Fa(e),Fa(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 $o(i,yl(o))>0}const y_=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,v_=(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)),w_=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||y_;let s;return Ay(e)?s={...e}:s={...e,id:r(e)},v_(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function Gy({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,i,a]=Yy({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,i,a]}const Nm={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},N_=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.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},Sm=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function S_({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:r=X.Top,center:s,offset:o,stepPosition:i}){const a=Nm[t],u=Nm[r],c={x:e.x+a.x*o,y:e.y+a.y*o},h={x:n.x+u.x*o,y:n.y+u.y*o},d=N_({source:c,sourcePosition:t,target:h}),f=d.x!==0?"x":"y",x=d[f];let y=[],w,N;const m={x:0,y:0},v={x:0,y:0},[,,g,S]=Yy({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[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 j=[{x:w,y:c.y},{x:w,y:h.y}],k=[{x:c.x,y:N},{x:h.x,y:N}];a[f]===x?y=f==="x"?j:k:y=f==="x"?k:j}else{const j=[{x:c.x,y:h.y}],k=[{x:h.x,y:c.y}];if(f==="x"?y=a.x===x?k:j:y=a.y===x?j:k,t===r){const T=Math.abs(e[f]-n[f]);if(T<=o){const A=Math.min(o-1,o-T);a[f]===x?m[f]=(c[f]>e[f]?-1:1)*A:v[f]=(h[f]>n[f]?-1:1)*A}}if(t!==r){const T=f==="x"?"y":"x",A=a[f]===u[T],C=c[T]>h[T],L=c[T]<h[T];(a[f]===1&&(!A&&C||A&&L)||a[f]!==1&&(!A&&L||A&&C))&&(y=f==="x"?j:k)}const _={x:c.x+m.x,y:c.y+m.y},I={x:h.x+v.x,y:h.y+v.y},$=Math.max(Math.abs(_.x-y[0].x),Math.abs(I.x-y[0].x)),R=Math.max(Math.abs(_.y-y[0].y),Math.abs(I.y-y[0].y));$>=R?(w=(_.x+I.x)/2,N=y[0].y):(w=y[0].x,N=(_.y+I.y)/2)}return[[e,{x:c.x+m.x,y:c.y+m.y},...y,{x:h.x+v.x,y:h.y+v.y},n],w,N,g,S]}function b_(e,t,n,r){const s=Math.min(Sm(e,t)/2,Sm(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 a=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${o},${i+s*u}Q ${o},${i} ${o+s*a},${i}`}function Tc({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:s,targetPosition:o=X.Top,borderRadius:i=5,centerX:a,centerY:u,offset:c=20,stepPosition:h=.5}){const[d,f,x,y,w]=S_({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:a,y:u},offset:c,stepPosition:h});return[d.reduce((m,v,g)=>{let S="";return g>0&&g<d.length-1?S=b_(d[g-1],v,d[g+1],i):S=`${g===0?"M":"L"}${v.x} ${v.y}`,m+=S,m},""),f,x,y,w]}function bm(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function k_(e){var d;const{sourceNode:t,targetNode:n}=e;if(!bm(t)||!bm(n))return null;const r=t.internals.handleBounds||km(t.handles),s=n.internals.handleBounds||km(n.handles),o=jm((r==null?void 0:r.source)??[],e.sourceHandle),i=jm(e.connectionMode===ms.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",Zt.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(o==null?void 0:o.position)||X.Bottom,u=(i==null?void 0:i.position)||X.Top,c=wr(t,o,a),h=wr(n,i,u);return{sourceX:c.x,sourceY:c.y,targetX:h.x,targetY:h.y,sourcePosition:a,targetPosition:u}}function km(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 wr(e,t,n=X.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:a}=t??vn(e);if(r)return{x:s+i/2,y:o+a/2};switch((t==null?void 0:t.position)??n){case X.Top:return{x:s+i/2,y:o};case X.Right:return{x:s+i,y:o+a/2};case X.Bottom:return{x:s+i/2,y:o+a};case X.Left:return{x:s,y:o+a/2}}}function jm(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Lc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function j_(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const o=new Set;return e.reduce((i,a)=>([a.markerStart||r,a.markerEnd||s].forEach(u=>{if(u&&typeof u=="object"){const c=Lc(u,t);o.has(c)||(i.push({id:c,color:u.color||n,...u}),o.add(c))}}),i),[]).sort((i,a)=>i.id.localeCompare(a.id))}const Xy=1e3,C_=10,cf={nodeOrigin:[0,0],nodeExtent:zo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},E_={...cf,checkEquality:!0};function df(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function __(e,t,n){const r=df(cf,n);for(const s of e.values())if(s.parentId)hf(s,e,t,r);else{const o=Qo(s,r.nodeOrigin),i=xs(s.extent)?s.extent:r.nodeExtent,a=vr(o,i,vn(s));s.internals.positionAbsolute=a}}function P_(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 ff(e){return e==="manual"}function Ac(e,t,n,r={}){var c,h;const s=df(E_,r),o={i:0},i=new Map(t),a=s!=null&&s.elevateNodesOnSelect&&!ff(s.zIndexMode)?Xy: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 x=Qo(d,s.nodeOrigin),y=xs(d.extent)?d.extent:s.nodeExtent,w=vr(x,y,vn(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:P_(d,f),z:Qy(d,a,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&&hf(f,t,n,r,o)}return u}function M_(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 hf(e,t,n,r,s){const{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:a,zIndexMode:u}=df(cf,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}M_(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*C_),s&&h.internals.rootParentIndex!==void 0&&(s.i=h.internals.rootParentIndex);const d=o&&!ff(u)?Xy:0,{x:f,y:x,z:y}=I_(e,h,i,a,d,u),{positionAbsolute:w}=e.internals,N=f!==w.x||x!==w.y;(N||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x:f,y:x}:w,z:y}})}function Qy(e,t,n){const r=It(e.zIndex)?e.zIndex:0;return ff(n)?r:r+(e.selected?t:0)}function I_(e,t,n,r,s,o){const{x:i,y:a}=t.internals.positionAbsolute,u=vn(e),c=Qo(e,n),h=xs(e.extent)?vr(c,e.extent,u):c;let d=vr({x:i+h.x,y:a+h.y},r,u);e.extent==="parent"&&(d=Dy(d,u,t));const f=Qy(e,s,o),x=t.internals.z??0;return{x:d.x,y:d.y,z:x>=f?x+1:f}}function mf(e,t,n,r=[0,0]){var i;const s=[],o=new Map;for(const a of e){const u=t.get(a.parentId);if(!u)continue;const c=((i=o.get(a.parentId))==null?void 0:i.expandedRect)??gs(u),h=Oy(c,a.rect);o.set(a.parentId,{expandedRect:h,parent:u})}return o.size>0&&o.forEach(({expandedRect:a,parent:u},c)=>{var g;const h=u.internals.positionAbsolute,d=vn(u),f=u.origin??r,x=a.x<h.x?Math.round(Math.abs(h.x-a.x)):0,y=a.y<h.y?Math.round(Math.abs(h.y-a.y)):0,w=Math.max(d.width,Math.round(a.width)),N=Math.max(d.height,Math.round(a.height)),m=(w-d.width)*f[0],v=(N-d.height)*f[1];(x>0||y>0||m||v)&&(s.push({id:c,type:"position",position:{x:u.position.x-x+m,y:u.position.y-y+v}}),(g=n.get(c))==null||g.forEach(S=>{e.some(b=>b.id===S.id)||s.push({id:S.id,type:"position",position:{x:S.position.x+x,y:S.position.y+y}})})),(d.width<a.width||d.height<a.height||x||y)&&s.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:w+(x?f[0]*x-m:0),height:N+(y?f[1]*y-v:0)}})}),s}function R_(e,t,n,r,s,o,i){const a=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!a)return{changes:[],updatedInternals:u};const c=[],h=window.getComputedStyle(a),{m22:d}=new window.DOMMatrixReadOnly(h.transform),f=[];for(const x of e.values()){const y=t.get(x.id);if(!y)continue;if(y.hidden){t.set(y.id,{...y,internals:{...y.internals,handleBounds:void 0}}),u=!0;continue}const w=uf(x.nodeElement),N=y.measured.width!==w.width||y.measured.height!==w.height;if(!!(w.width&&w.height&&(N||!y.internals.handleBounds||x.force))){const v=x.nodeElement.getBoundingClientRect(),g=xs(y.extent)?y.extent:o;let{positionAbsolute:S}=y.internals;y.parentId&&y.extent==="parent"?S=Dy(S,w,t.get(y.parentId)):g&&(S=vr(S,g,w));const b={...y,measured:w,internals:{...y.internals,positionAbsolute:S,handleBounds:{source:vm("source",x.nodeElement,v,d,y.id),target:vm("target",x.nodeElement,v,d,y.id)}}};t.set(y.id,b),y.parentId&&hf(b,t,n,{nodeOrigin:s,zIndexMode:i}),u=!0,N&&(c.push({id:y.id,type:"dimensions",dimensions:w}),y.expandParent&&y.parentId&&f.push({id:y.id,parentId:y.parentId,rect:gs(b,s)}))}}if(f.length>0){const x=mf(f,t,n,s);c.push(...x)}return{changes:c,updatedInternals:u}}async function T_({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),a=!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2]);return Promise.resolve(a)}function Cm(e,t,n,r,s,o){let i=s;const a=r.get(i)||new Map;r.set(i,a.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 qy(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:o,sourceHandle:i=null,targetHandle:a=null}=r,u={edgeId:r.id,source:s,target:o,sourceHandle:i,targetHandle:a},c=`${s}-${i}--${o}-${a}`,h=`${o}-${a}--${s}-${i}`;Cm("source",u,h,e,s,i),Cm("target",u,c,e,o,a),t.set(r.id,r)}}function Zy(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Zy(n,t):!1}function Em(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 L_(e,t,n,r){const s=new Map;for(const[o,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!Zy(i,e))&&(i.draggable||t&&typeof i.draggable>"u")){const a=e.get(o);a&&s.set(o,{id:o,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return s}function du({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var i,a,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=(a=n.get(e))==null?void 0:a.internals.userNode;return[o?{...o,position:((u=t.get(e))==null?void 0:u.position)||o.position,dragging:r}:s[0],s]}function A_({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=Zo(o,t);return{x:i.x-o.x,y:i.y-o.y}}function z_({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let o={x:null,y:null},i=0,a=new Map,u=!1,c={x:0,y:0},h=null,d=!1,f=null,x=!1,y=!1,w=null;function N({noDragClassName:v,handleSelector:g,domNode:S,isSelectable:b,nodeId:j,nodeClickDistance:k=0}){f=lt(S);function _({x:T,y:A}){const{nodeLookup:C,nodeExtent:L,snapGrid:M,snapToGrid:D,nodeOrigin:E,onNodeDrag:P,onSelectionDrag:z,onError:F,updateNodePositions:O}=t();o={x:T,y:A};let U=!1;const B=a.size>1,K=B&&L?Rc(qo(a)):null,Y=B&&D?A_({dragItems:a,snapGrid:M,x:T,y:A}):null;for(const[G,V]of a){if(!C.has(G))continue;let Q={x:T-V.distance.x,y:A-V.distance.y};D&&(Q=Y?{x:Math.round(Q.x+Y.x),y:Math.round(Q.y+Y.y)}:Zo(Q,M));let re=null;if(B&&L&&!V.extent&&K){const{positionAbsolute:q}=V.internals,ue=q.x-K.x+L[0][0],he=q.x+V.measured.width-K.x2+L[1][0],le=q.y-K.y+L[0][1],Be=q.y+V.measured.height-K.y2+L[1][1];re=[[ue,le],[he,Be]]}const{position:te,positionAbsolute:ee}=zy({nodeId:G,nextPosition:Q,nodeLookup:C,nodeExtent:re||L,nodeOrigin:E,onError:F});U=U||V.position.x!==te.x||V.position.y!==te.y,V.position=te,V.internals.positionAbsolute=ee}if(y=y||U,!!U&&(O(a,!0),w&&(r||P||!j&&z))){const[G,V]=du({nodeId:j,dragItems:a,nodeLookup:C});r==null||r(w,a,G,V),P==null||P(w,G,V),j||z==null||z(w,V)}}async function I(){if(!h)return;const{transform:T,panBy:A,autoPanSpeed:C,autoPanOnNodeDrag:L}=t();if(!L){u=!1,cancelAnimationFrame(i);return}const[M,D]=$y(c,h,C);(M!==0||D!==0)&&(o.x=(o.x??0)-M/T[2],o.y=(o.y??0)-D/T[2],await A({x:M,y:D})&&_(o)),i=requestAnimationFrame(I)}function $(T){var B;const{nodeLookup:A,multiSelectionActive:C,nodesDraggable:L,transform:M,snapGrid:D,snapToGrid:E,selectNodesOnDrag:P,onNodeDragStart:z,onSelectionDragStart:F,unselectNodesAndEdges:O}=t();d=!0,(!P||!b)&&!C&&j&&((B=A.get(j))!=null&&B.selected||O()),b&&P&&j&&(e==null||e(j));const U=fo(T.sourceEvent,{transform:M,snapGrid:D,snapToGrid:E,containerBounds:h});if(o=U,a=L_(A,L,U,j),a.size>0&&(n||z||!j&&F)){const[K,Y]=du({nodeId:j,dragItems:a,nodeLookup:A});n==null||n(T.sourceEvent,a,K,Y),z==null||z(T.sourceEvent,K,Y),j||F==null||F(T.sourceEvent,Y)}}const R=py().clickDistance(k).on("start",T=>{const{domNode:A,nodeDragThreshold:C,transform:L,snapGrid:M,snapToGrid:D}=t();h=(A==null?void 0:A.getBoundingClientRect())||null,x=!1,y=!1,w=T.sourceEvent,C===0&&$(T),o=fo(T.sourceEvent,{transform:L,snapGrid:M,snapToGrid:D,containerBounds:h}),c=Rt(T.sourceEvent,h)}).on("drag",T=>{const{autoPanOnNodeDrag:A,transform:C,snapGrid:L,snapToGrid:M,nodeDragThreshold:D,nodeLookup:E}=t(),P=fo(T.sourceEvent,{transform:C,snapGrid:L,snapToGrid:M,containerBounds:h});if(w=T.sourceEvent,(T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1||j&&!E.has(j))&&(x=!0),!x){if(!u&&A&&d&&(u=!0,I()),!d){const z=Rt(T.sourceEvent,h),F=z.x-c.x,O=z.y-c.y;Math.sqrt(F*F+O*O)>D&&$(T)}(o.x!==P.xSnapped||o.y!==P.ySnapped)&&a&&d&&(c=Rt(T.sourceEvent,h),_(P))}}).on("end",T=>{if(!(!d||x)&&(u=!1,d=!1,cancelAnimationFrame(i),a.size>0)){const{nodeLookup:A,updateNodePositions:C,onNodeDragStop:L,onSelectionDragStop:M}=t();if(y&&(C(a,!1),y=!1),s||L||!j&&M){const[D,E]=du({nodeId:j,dragItems:a,nodeLookup:A,dragging:!1});s==null||s(T.sourceEvent,a,D,E),L==null||L(T.sourceEvent,D,E),j||M==null||M(T.sourceEvent,E)}}}).filter(T=>{const A=T.target;return!T.button&&(!v||!Em(A,`.${v}`,S))&&(!g||Em(A,g,S))});f.call(R)}function m(){f==null||f.on(".drag",null)}return{update:N,destroy:m}}function D_(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())$o(s,gs(o))>0&&r.push(o);return r}const $_=250;function O_(e,t,n,r){var a,u;let s=[],o=1/0;const i=D_(e,n,t+$_);for(const c of i){const h=[...((a=c.internals.handleBounds)==null?void 0:a.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:x}=wr(c,d,d.position,!0),y=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(x-e.y,2));y>t||(y<o?(s=[{...d,x:f,y:x}],o=y):y===o&&s.push({...d,x:f,y:x}))}}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 Jy(e,t,n,r,s,o=!1){var c,h,d;const i=r.get(e);if(!i)return null;const a=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?a==null?void 0:a.find(f=>f.id===n):a==null?void 0:a[0])??null;return u&&o?{...u,...wr(i,u,u.position,!0)}:u}function e0(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function F_(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const t0=()=>!0;function H_(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:i,domNode:a,nodeLookup:u,lib:c,autoPanOnConnect:h,flowId:d,panBy:f,cancelConnection:x,onConnectStart:y,onConnect:w,onConnectEnd:N,isValidConnection:m=t0,onReconnectEnd:v,updateConnection:g,getTransform:S,getFromHandle:b,autoPanSpeed:j,dragThreshold:k=1,handleDomNode:_}){const I=Vy(e.target);let $=0,R;const{x:T,y:A}=Rt(e),C=e0(o,_),L=a==null?void 0:a.getBoundingClientRect();let M=!1;if(!L||!C)return;const D=Jy(s,C,r,u,t);if(!D)return;let E=Rt(e,L),P=!1,z=null,F=!1,O=null;function U(){if(!h||!L)return;const[te,ee]=$y(E,L,j);f({x:te,y:ee}),$=requestAnimationFrame(U)}const B={...D,nodeId:s,type:C,position:D.position},K=u.get(s);let G={inProgress:!0,isValid:null,from:wr(K,B,X.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:K,to:E,toHandle:null,toPosition:pm[B.position],toNode:null,pointer:E};function V(){M=!0,g(G),y==null||y(e,{nodeId:s,handleId:r,handleType:C})}k===0&&V();function Q(te){if(!M){const{x:Be,y:wn}=Rt(te),en=Be-T,Zn=wn-A;if(!(en*en+Zn*Zn>k*k))return;V()}if(!b()||!B){re(te);return}const ee=S();E=Rt(te,L),R=O_(Jo(E,ee,!1,[1,1]),n,u,B),P||(U(),P=!0);const q=n0(te,{handle:R,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:i?"target":"source",isValidConnection:m,doc:I,lib:c,flowId:d,nodeLookup:u});O=q.handleDomNode,z=q.connection,F=F_(!!R,q.isValid);const ue=u.get(s),he=ue?wr(ue,B,X.Left,!0):G.from,le={...G,from:he,isValid:F,to:q.toHandle&&F?Ha({x:q.toHandle.x,y:q.toHandle.y},ee):E,toHandle:q.toHandle,toPosition:F&&q.toHandle?q.toHandle.position:pm[B.position],toNode:q.toHandle?u.get(q.toHandle.nodeId):null,pointer:E};g(le),G=le}function re(te){if(!("touches"in te&&te.touches.length>0)){if(M){(R||O)&&z&&F&&(w==null||w(z));const{inProgress:ee,...q}=G,ue={...q,toPosition:G.toHandle?G.toPosition:null};N==null||N(te,ue),o&&(v==null||v(te,ue))}x(),cancelAnimationFrame($),P=!1,F=!1,z=null,O=null,I.removeEventListener("mousemove",Q),I.removeEventListener("mouseup",re),I.removeEventListener("touchmove",Q),I.removeEventListener("touchend",re)}}I.addEventListener("mousemove",Q),I.addEventListener("mouseup",re),I.addEventListener("touchmove",Q),I.addEventListener("touchend",re)}function n0(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:i,lib:a,flowId:u,isValidConnection:c=t0,nodeLookup:h}){const d=o==="target",f=t?i.querySelector(`.${a}-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,y}=Rt(e),w=i.elementFromPoint(x,y),N=w!=null&&w.classList.contains(`${a}-flow__handle`)?w:f,m={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const v=e0(void 0,N),g=N.getAttribute("data-nodeid"),S=N.getAttribute("data-handleid"),b=N.classList.contains("connectable"),j=N.classList.contains("connectableend");if(!g||!v)return m;const k={source:d?g:r,sourceHandle:d?S:s,target:d?r:g,targetHandle:d?s:S};m.connection=k;const I=b&&j&&(n===ms.Strict?d&&v==="source"||!d&&v==="target":g!==r||S!==s);m.isValid=I&&c(k),m.toHandle=Jy(g,v,S,h,n,!0)}return m}const zc={onPointerDown:H_,isValid:n0};function V_({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=lt(e);function o({translateExtent:a,width:u,height:c,zoomStep:h=1,pannable:d=!0,zoomable:f=!0,inversePan:x=!1}){const y=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const S=n(),b=g.sourceEvent.ctrlKey&&Oo()?10:1,j=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*h,k=S[2]*Math.pow(2,j*b);t.scaleTo(k)};let w=[0,0];const N=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(w=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},m=g=>{const S=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const b=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],j=[b[0]-w[0],b[1]-w[1]];w=b;const k=r()*Math.max(S[2],Math.log(S[2]))*(x?-1:1),_={x:S[0]-j[0]*k,y:S[1]-j[1]*k},I=[[0,0],[u,c]];t.setViewportConstrained({x:_.x,y:_.y,zoom:S[2]},I,a)},v=My().on("start",N).on("zoom",d?m:null).on("zoom.wheel",f?y:null);s.call(v,{})}function i(){s.on("zoom",null)}return{update:o,destroy:i,pointer:_t}}const vl=e=>({x:e.x,y:e.y,zoom:e.k}),fu=({x:e,y:t,zoom:n})=>gl.translate(e,t).scale(n),Wr=(e,t)=>e.target.closest(`.${t}`),r0=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),B_=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,hu=(e,t=0,n=B_,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},s0=e=>{const t=e.ctrlKey&&Oo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function U_({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:i,onPanZoomStart:a,onPanZoom:u,onPanZoomEnd:c}){return h=>{if(Wr(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=_t(h),m=s0(h),v=d*Math.pow(2,m);r.scaleTo(n,v,N,h);return}const f=h.deltaMode===1?20:1;let x=s===cr.Vertical?0:h.deltaX*f,y=s===cr.Horizontal?0:h.deltaY*f;!Oo()&&h.shiftKey&&s!==cr.Vertical&&(x=h.deltaY*f,y=0),r.translateBy(n,-(x/d)*o,-(y/d)*o,{internal:!0});const w=vl(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,a==null||a(h,w))}}function W_({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const o=r.type==="wheel",i=!t&&o&&!r.ctrlKey,a=Wr(r,e);if(r.ctrlKey&&o&&a&&r.preventDefault(),i||a)return null;r.preventDefault(),n.call(this,r,s)}}function K_({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,i,a;if((o=r.sourceEvent)!=null&&o.internal)return;const s=vl(r.transform);e.mouseButton=((i=r.sourceEvent)==null?void 0:i.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((a=r.sourceEvent)==null?void 0:a.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function Y_({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var i,a;e.usedRightMouseButton=!!(n&&r0(t,e.mouseButton??0)),(i=o.sourceEvent)!=null&&i.sync||r([o.transform.x,o.transform.y,o.transform.k]),s&&!((a=o.sourceEvent)!=null&&a.internal)&&(s==null||s(o.sourceEvent,vl(o.transform)))}}function G_({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:o}){return i=>{var a;if(!((a=i.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,o&&r0(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&o(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const u=vl(i.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(i.sourceEvent,u)},n?150:0)}}}function X_({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:i,noWheelClassName:a,noPanClassName:u,lib:c,connectionInProgress:h}){return d=>{var N;const f=e||t,x=n&&d.ctrlKey,y=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Wr(d,`${c}-flow__node`)||Wr(d,`${c}-flow__edge`)))return!0;if(!r&&!f&&!s&&!o&&!n||i||h&&!y||Wr(d,a)&&y||Wr(d,u)&&(!y||s&&y&&!e)||!n&&d.ctrlKey&&y)return!1;if(!n&&d.type==="touchstart"&&((N=d.touches)==null?void 0:N.length)>1)return d.preventDefault(),!1;if(!f&&!s&&!x&&y||!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||y)&&w}}function Q_({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:o,onPanZoomStart:i,onPanZoomEnd:a,onDraggingChange:u}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),d=My().scaleExtent([t,n]).translateExtent(r),f=lt(e).call(d);v({x:s.x,y:s.y,zoom:ps(s.zoom,t,n)},[[0,0],[h.width,h.height]],r);const x=f.on("wheel.zoom"),y=f.on("dblclick.zoom");d.wheelDelta(s0);function w(R,T){return f?new Promise(A=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?co:Zi).transform(hu(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>A(!0)),R)}):Promise.resolve(!1)}function N({noWheelClassName:R,noPanClassName:T,onPaneContextMenu:A,userSelectionActive:C,panOnScroll:L,panOnDrag:M,panOnScrollMode:D,panOnScrollSpeed:E,preventScrolling:P,zoomOnPinch:z,zoomOnScroll:F,zoomOnDoubleClick:O,zoomActivationKeyPressed:U,lib:B,onTransformChange:K,connectionInProgress:Y,paneClickDistance:G,selectionOnDrag:V}){C&&!c.isZoomingOrPanning&&m();const Q=L&&!U&&!C;d.clickDistance(V?1/0:!It(G)||G<0?0:G);const re=Q?U_({zoomPanValues:c,noWheelClassName:R,d3Selection:f,d3Zoom:d,panOnScrollMode:D,panOnScrollSpeed:E,zoomOnPinch:z,onPanZoomStart:i,onPanZoom:o,onPanZoomEnd:a}):W_({noWheelClassName:R,preventScrolling:P,d3ZoomHandler:x});if(f.on("wheel.zoom",re,{passive:!1}),!C){const ee=K_({zoomPanValues:c,onDraggingChange:u,onPanZoomStart:i});d.on("start",ee);const q=Y_({zoomPanValues:c,panOnDrag:M,onPaneContextMenu:!!A,onPanZoom:o,onTransformChange:K});d.on("zoom",q);const ue=G_({zoomPanValues:c,panOnDrag:M,panOnScroll:L,onPaneContextMenu:A,onPanZoomEnd:a,onDraggingChange:u});d.on("end",ue)}const te=X_({zoomActivationKeyPressed:U,panOnDrag:M,zoomOnScroll:F,panOnScroll:L,zoomOnDoubleClick:O,zoomOnPinch:z,userSelectionActive:C,noPanClassName:T,noWheelClassName:R,lib:B,connectionInProgress:Y});d.filter(te),O?f.on("dblclick.zoom",y):f.on("dblclick.zoom",null)}function m(){d.on("zoom",null)}async function v(R,T,A){const C=fu(R),L=d==null?void 0:d.constrain()(C,T,A);return L&&await w(L),new Promise(M=>M(L))}async function g(R,T){const A=fu(R);return await w(A,T),new Promise(C=>C(A))}function S(R){if(f){const T=fu(R),A=f.property("__zoom");(A.k!==R.zoom||A.x!==R.x||A.y!==R.y)&&(d==null||d.transform(f,T,null,{sync:!0}))}}function b(){const R=f?Py(f.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}function j(R,T){return f?new Promise(A=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?co:Zi).scaleTo(hu(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>A(!0)),R)}):Promise.resolve(!1)}function k(R,T){return f?new Promise(A=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?co:Zi).scaleBy(hu(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>A(!0)),R)}):Promise.resolve(!1)}function _(R){d==null||d.scaleExtent(R)}function I(R){d==null||d.translateExtent(R)}function $(R){const T=!It(R)||R<0?0:R;d==null||d.clickDistance(T)}return{update:N,destroy:m,setViewport:g,setViewportConstrained:v,getViewport:b,scaleTo:j,scaleBy:k,setScaleExtent:_,setTranslateExtent:I,syncViewport:S,setClickDistance:$}}var ys;(function(e){e.Line="line",e.Handle="handle"})(ys||(ys={}));function q_({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:o}){const i=e-t,a=n-r,u=[i>0?1:i<0?-1:0,a>0?1:a<0?-1:0];return i&&s&&(u[0]=u[0]*-1),a&&o&&(u[1]=u[1]*-1),u}function _m(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 jn(e,t){return Math.max(0,e-t)}function _i(e,t,n){return Math.max(0,t-e,e-n)}function Pm(e,t){return e?!t:t}function Z_(e,t,n,r,s,o,i,a){let{affectsX:u,affectsY:c}=t;const{isHorizontal:h,isVertical:d}=t,f=h&&d,{xSnapped:x,ySnapped:y}=n,{minWidth:w,maxWidth:N,minHeight:m,maxHeight:v}=r,{x:g,y:S,width:b,height:j,aspectRatio:k}=e;let _=Math.floor(h?x-e.pointerX:0),I=Math.floor(d?y-e.pointerY:0);const $=b+(u?-_:_),R=j+(c?-I:I),T=-o[0]*b,A=-o[1]*j;let C=_i($,w,N),L=_i(R,m,v);if(i){let E=0,P=0;u&&_<0?E=kn(g+_+T,i[0][0]):!u&&_>0&&(E=jn(g+$+T,i[1][0])),c&&I<0?P=kn(S+I+A,i[0][1]):!c&&I>0&&(P=jn(S+R+A,i[1][1])),C=Math.max(C,E),L=Math.max(L,P)}if(a){let E=0,P=0;u&&_>0?E=jn(g+_,a[0][0]):!u&&_<0&&(E=kn(g+$,a[1][0])),c&&I>0?P=jn(S+I,a[0][1]):!c&&I<0&&(P=kn(S+R,a[1][1])),C=Math.max(C,E),L=Math.max(L,P)}if(s){if(h){const E=_i($/k,m,v)*k;if(C=Math.max(C,E),i){let P=0;!u&&!c||u&&!c&&f?P=jn(S+A+$/k,i[1][1])*k:P=kn(S+A+(u?_:-_)/k,i[0][1])*k,C=Math.max(C,P)}if(a){let P=0;!u&&!c||u&&!c&&f?P=kn(S+$/k,a[1][1])*k:P=jn(S+(u?_:-_)/k,a[0][1])*k,C=Math.max(C,P)}}if(d){const E=_i(R*k,w,N)/k;if(L=Math.max(L,E),i){let P=0;!u&&!c||c&&!u&&f?P=jn(g+R*k+T,i[1][0])/k:P=kn(g+(c?I:-I)*k+T,i[0][0])/k,L=Math.max(L,P)}if(a){let P=0;!u&&!c||c&&!u&&f?P=kn(g+R*k,a[1][0])/k:P=jn(g+(c?I:-I)*k,a[0][0])/k,L=Math.max(L,P)}}}I=I+(I<0?L:-L),_=_+(_<0?C:-C),s&&(f?$>R*k?I=(Pm(u,c)?-_:_)/k:_=(Pm(u,c)?-I:I)*k:h?(I=_/k,c=u):(_=I*k,u=c));const M=u?g+_:g,D=c?S+I:S;return{width:b+(u?-_:_),height:j+(c?-I:I),x:o[0]*_*(u?-1:1)+M,y:o[1]*I*(c?-1:1)+D}}const o0={width:0,height:0,x:0,y:0},J_={...o0,pointerX:0,pointerY:0,aspectRatio:1};function e3(e){return[[0,0],[e.measured.width,e.measured.height]]}function t3(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,a=n[0]*o,u=n[1]*i;return[[r-a,s-u],[r+o-a,s+i-u]]}function n3({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=lt(e);let i={controlDirection:_m("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:c,boundaries:h,keepAspectRatio:d,resizeDirection:f,onResizeStart:x,onResize:y,onResizeEnd:w,shouldResize:N}){let m={...o0},v={...J_};i={boundaries:h,resizeDirection:f,keepAspectRatio:d,controlDirection:_m(c)};let g,S=null,b=[],j,k,_,I=!1;const $=py().on("start",R=>{const{nodeLookup:T,transform:A,snapGrid:C,snapToGrid:L,nodeOrigin:M,paneDomNode:D}=n();if(g=T.get(t),!g)return;S=(D==null?void 0:D.getBoundingClientRect())??null;const{xSnapped:E,ySnapped:P}=fo(R.sourceEvent,{transform:A,snapGrid:C,snapToGrid:L,containerBounds:S});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},v={...m,pointerX:E,pointerY:P,aspectRatio:m.width/m.height},j=void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(j=T.get(g.parentId),k=j&&g.extent==="parent"?e3(j):void 0),b=[],_=void 0;for(const[z,F]of T)if(F.parentId===t&&(b.push({id:z,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const O=t3(F,g,F.origin??M);_?_=[[Math.min(O[0][0],_[0][0]),Math.min(O[0][1],_[0][1])],[Math.max(O[1][0],_[1][0]),Math.max(O[1][1],_[1][1])]]:_=O}x==null||x(R,{...m})}).on("drag",R=>{const{transform:T,snapGrid:A,snapToGrid:C,nodeOrigin:L}=n(),M=fo(R.sourceEvent,{transform:T,snapGrid:A,snapToGrid:C,containerBounds:S}),D=[];if(!g)return;const{x:E,y:P,width:z,height:F}=m,O={},U=g.origin??L,{width:B,height:K,x:Y,y:G}=Z_(v,i.controlDirection,M,i.boundaries,i.keepAspectRatio,U,k,_),V=B!==z,Q=K!==F,re=Y!==E&&V,te=G!==P&&Q;if(!re&&!te&&!V&&!Q)return;if((re||te||U[0]===1||U[1]===1)&&(O.x=re?Y:m.x,O.y=te?G:m.y,m.x=O.x,m.y=O.y,b.length>0)){const he=Y-E,le=G-P;for(const Be of b)Be.position={x:Be.position.x-he+U[0]*(B-z),y:Be.position.y-le+U[1]*(K-F)},D.push(Be)}if((V||Q)&&(O.width=V&&(!i.resizeDirection||i.resizeDirection==="horizontal")?B:m.width,O.height=Q&&(!i.resizeDirection||i.resizeDirection==="vertical")?K:m.height,m.width=O.width,m.height=O.height),j&&g.expandParent){const he=U[0]*(O.width??0);O.x&&O.x<he&&(m.x=he,v.x=v.x-(O.x-he));const le=U[1]*(O.height??0);O.y&&O.y<le&&(m.y=le,v.y=v.y-(O.y-le))}const ee=q_({width:m.width,prevWidth:z,height:m.height,prevHeight:F,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),q={...m,direction:ee};(N==null?void 0:N(R,q))!==!1&&(I=!0,y==null||y(R,q),r(O,D))}).on("end",R=>{I&&(w==null||w(R,{...m}),s==null||s({...m}),I=!1)});o.call($)}function u(){o.on(".drag",null)}return{update:a,destroy:u}}var i0={exports:{}},a0={},l0={exports:{}},u0={};/**
322
+ * @license React
323
+ * use-sync-external-store-shim.production.js
324
+ *
325
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
326
+ *
327
+ * This source code is licensed under the MIT license found in the
328
+ * LICENSE file in the root directory of this source tree.
329
+ */var vs=p;function r3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var s3=typeof Object.is=="function"?Object.is:r3,o3=vs.useState,i3=vs.useEffect,a3=vs.useLayoutEffect,l3=vs.useDebugValue;function u3(e,t){var n=t(),r=o3({inst:{value:n,getSnapshot:t}}),s=r[0].inst,o=r[1];return a3(function(){s.value=n,s.getSnapshot=t,mu(s)&&o({inst:s})},[e,n,t]),i3(function(){return mu(s)&&o({inst:s}),e(function(){mu(s)&&o({inst:s})})},[e]),l3(n),n}function mu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!s3(e,n)}catch{return!0}}function c3(e,t){return t()}var d3=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c3:u3;u0.useSyncExternalStore=vs.useSyncExternalStore!==void 0?vs.useSyncExternalStore:d3;l0.exports=u0;var f3=l0.exports;/**
330
+ * @license React
331
+ * use-sync-external-store-shim/with-selector.production.js
332
+ *
333
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
334
+ *
335
+ * This source code is licensed under the MIT license found in the
336
+ * LICENSE file in the root directory of this source tree.
337
+ */var wl=p,h3=f3;function m3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var p3=typeof Object.is=="function"?Object.is:m3,g3=h3.useSyncExternalStore,x3=wl.useRef,y3=wl.useEffect,v3=wl.useMemo,w3=wl.useDebugValue;a0.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var o=x3(null);if(o.current===null){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=v3(function(){function u(x){if(!c){if(c=!0,h=x,x=r(x),s!==void 0&&i.hasValue){var y=i.value;if(s(y,x))return d=y}return d=x}if(y=d,p3(h,x))return y;var w=r(x);return s!==void 0&&s(y,w)?(h=x,y):(h=x,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 a=g3(e,o[0],o[1]);return y3(function(){i.hasValue=!0,i.value=a},[a]),w3(a),a};i0.exports=a0;var N3=i0.exports;const S3=Hc(N3),b3={},Mm=e=>{let t;const n=new Set,r=(h,d)=>{const f=typeof h=="function"?h(t):h;if(!Object.is(f,t)){const x=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(y=>y(t,x))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>c,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(b3?"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},k3=e=>e?Mm(e):Mm,{useDebugValue:j3}=Bt,{useSyncExternalStoreWithSelector:C3}=S3,E3=e=>e;function c0(e,t=E3,n){const r=C3(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return j3(r),r}const Im=(e,t)=>{const n=k3(e),r=(s,o=t)=>c0(n,s,o);return Object.assign(r,n),r},_3=(e,t)=>e?Im(e,t):Im;function ve(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 Nl=p.createContext(null),P3=Nl.Provider,d0=Zt.error001();function ie(e,t){const n=p.useContext(Nl);if(n===null)throw new Error(d0);return c0(n,e,t)}function we(){const e=p.useContext(Nl);if(e===null)throw new Error(d0);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Rm={display:"none"},M3={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},f0="react-flow__node-desc",h0="react-flow__edge-desc",I3="react-flow__aria-live",R3=e=>e.ariaLiveMessage,T3=e=>e.ariaLabelConfig;function L3({rfId:e}){const t=ie(R3);return l.jsx("div",{id:`${I3}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:M3,children:t})}function A3({rfId:e,disableKeyboardA11y:t}){const n=ie(T3);return l.jsxs(l.Fragment,{children:[l.jsx("div",{id:`${f0}-${e}`,style:Rm,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),l.jsx("div",{id:`${h0}-${e}`,style:Rm,children:n["edge.a11yDescription.default"]}),!t&&l.jsx(L3,{rfId:e})]})}const Sl=p.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const i=`${e}`.split("-");return l.jsx("div",{className:Me(["react-flow__panel",n,...i]),style:r,ref:o,...s,children:t})});Sl.displayName="Panel";function z3({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:l.jsx(Sl,{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:l.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const D3=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}},Pi=e=>e.id;function $3(e,t){return ve(e.selectedNodes.map(Pi),t.selectedNodes.map(Pi))&&ve(e.selectedEdges.map(Pi),t.selectedEdges.map(Pi))}function O3({onSelectionChange:e}){const t=we(),{selectedNodes:n,selectedEdges:r}=ie(D3,$3);return p.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[n,r,e]),null}const F3=e=>!!e.onSelectionChangeHandlers;function H3({onSelectionChange:e}){const t=ie(F3);return e||t?l.jsx(O3,{onSelectionChange:e}):null}const m0=[0,0],V3={x:0,y:0,zoom:1},B3=["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"],Tm=[...B3,"rfId"],U3=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}),Lm={translateExtent:zo,nodeOrigin:m0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function W3(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:i,reset:a,setDefaultNodesAndEdges:u}=ie(U3,ve),c=we();p.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{h.current=Lm,a()}),[]);const h=p.useRef(Lm);return p.useEffect(()=>{for(const d of Tm){const f=e[d],x=h.current[d];f!==x&&(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:m_(f)}):d==="fitView"?c.setState({fitViewQueued:f}):d==="fitViewOptions"?c.setState({fitViewOptions:f}):c.setState({[d]:f})))}h.current=e},Tm.map(d=>e[d])),null}function Am(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function K3(e){var r;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const s=Am(),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=Am())!=null&&r.matches?"dark":"light"}const zm=typeof document<"u"?document:null;function Fo(e=null,t={target:zm,actInsideInputWithModifier:!0}){const[n,r]=p.useState(!1),s=p.useRef(!1),o=p.useRef(new Set([])),[i,a]=p.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
338
+ `).replace(`
339
+
340
+ `,`
341
+ +`).split(`
342
+ `)),h=c.reduce((d,f)=>d.concat(...f),[]);return[c,h]}return[[],[]]},[e]);return p.useEffect(()=>{const u=(t==null?void 0:t.target)??zm,c=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=x=>{var N,m;if(s.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!s.current||s.current&&!c)&&By(x))return!1;const w=$m(x.code,a);if(o.current.add(x[w]),Dm(i,o.current,!1)){const v=((m=(N=x.composedPath)==null?void 0:N.call(x))==null?void 0:m[0])||x.target,g=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";t.preventDefault!==!1&&(s.current||!g)&&x.preventDefault(),r(!0)}},d=x=>{const y=$m(x.code,a);Dm(i,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(x[y]),x.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 Dm(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function $m(e,t){return t.includes(e)?"code":"key"}const Y3=()=>{const e=we();return p.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:a}=e.getState(),u=lf(t,r,s,o,i,(n==null?void 0:n.padding)??.1);return a?(await a.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:a,y:u}=i.getBoundingClientRect(),c={x:t.x-a,y:t.y-u},h=n.snapGrid??s,d=n.snapToGrid??o;return Jo(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=Ha(t,n);return{x:i.x+s,y:i.y+o}}}),[])};function p0(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 a={...o};for(const u of i)G3(u,a);n.push(a)}return s.length&&s.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function G3(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 X3(e,t){return p0(e,t)}function Q3(e,t){return p0(e,t)}function tr(e,t){return{id:e,type:"select",selected:t}}function Kr(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(tr(o.id,i)))}return r}function Om({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 a=t.get(i.id),u=((s=a==null?void 0:a.internals)==null?void 0:s.userNode)??a;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 Fm(e){return{id:e.id,type:"remove"}}const Hm=e=>s_(e),q3=e=>Ay(e);function g0(e){return p.forwardRef(e)}const Z3=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Vm(e){const[t,n]=p.useState(BigInt(0)),[r]=p.useState(()=>J3(()=>n(s=>s+BigInt(1))));return Z3(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function J3(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const x0=p.createContext(null);function e4({children:e}){const t=we(),n=p.useCallback(a=>{const{nodes:u=[],setNodes:c,hasDefaultNodes:h,onNodesChange:d,nodeLookup:f,fitViewQueued:x,onNodesChangeMiddlewareMap:y}=t.getState();let w=u;for(const m of a)w=typeof m=="function"?m(w):m;let N=Om({items:w,lookup:f});for(const m of y.values())N=m(N);h&&c(w),N.length>0?d==null||d(N):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:v,setNodes:g}=t.getState();m&&g(v)})},[]),r=Vm(n),s=p.useCallback(a=>{const{edges:u=[],setEdges:c,hasDefaultEdges:h,onEdgesChange:d,edgeLookup:f}=t.getState();let x=u;for(const y of a)x=typeof y=="function"?y(x):y;h?c(x):d&&d(Om({items:x,lookup:f}))},[]),o=Vm(s),i=p.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return l.jsx(x0.Provider,{value:i,children:e})}function t4(){const e=p.useContext(x0);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const n4=e=>!!e.panZoom;function pf(){const e=Y3(),t=we(),n=t4(),r=ie(n4),s=p.useMemo(()=>{const o=d=>t.getState().nodeLookup.get(d),i=d=>{n.nodeQueue.push(d)},a=d=>{n.edgeQueue.push(d)},u=d=>{var m,v;const{nodeLookup:f,nodeOrigin:x}=t.getState(),y=Hm(d)?d:f.get(d.id),w=y.parentId?Hy(y.position,y.measured,y.parentId,f,x):y.position,N={...y,position:w,width:((m=y.measured)==null?void 0:m.width)??y.width,height:((v=y.measured)==null?void 0:v.height)??y.height};return gs(N)},c=(d,f,x={replace:!1})=>{i(y=>y.map(w=>{if(w.id===d){const N=typeof f=="function"?f(w):f;return x.replace&&Hm(N)?N:{...w,...N}}return w}))},h=(d,f,x={replace:!1})=>{a(y=>y.map(w=>{if(w.id===d){const N=typeof f=="function"?f(w):f;return x.replace&&q3(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:a,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(x=>[...x,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(x=>[...x,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:x}=t.getState(),[y,w,N]=x;return{nodes:d.map(m=>({...m})),edges:f.map(m=>({...m})),viewport:{x:y,y:w,zoom:N}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:x,edges:y,onNodesDelete:w,onEdgesDelete:N,triggerNodeChanges:m,triggerEdgeChanges:v,onDelete:g,onBeforeDelete:S}=t.getState(),{nodes:b,edges:j}=await u_({nodesToRemove:d,edgesToRemove:f,nodes:x,edges:y,onBeforeDelete:S}),k=j.length>0,_=b.length>0;if(k){const I=j.map(Fm);N==null||N(j),v(I)}if(_){const I=b.map(Fm);w==null||w(b),m(I)}return(_||k)&&(g==null||g({nodes:b,edges:j})),{deletedNodes:b,deletedEdges:j}},getIntersectingNodes:(d,f=!0,x)=>{const y=xm(d),w=y?d:u(d),N=x!==void 0;return w?(x||t.getState().nodes).filter(m=>{const v=t.getState().nodeLookup.get(m.id);if(v&&!y&&(m.id===d.id||!v.internals.positionAbsolute))return!1;const g=gs(N?m:v),S=$o(g,w);return f&&S>0||S>=g.width*g.height||S>=w.width*w.height}):[]},isNodeIntersecting:(d,f,x=!0)=>{const w=xm(d)?d:u(d);if(!w)return!1;const N=$o(w,f);return x&&N>0||N>=f.width*f.height||N>=w.width*w.height},updateNode:c,updateNodeData:(d,f,x={replace:!1})=>{c(d,y=>{const w=typeof f=="function"?f(y):f;return x.replace?{...y,data:w}:{...y,data:{...y.data,...w}}},x)},updateEdge:h,updateEdgeData:(d,f,x={replace:!1})=>{h(d,y=>{const w=typeof f=="function"?f(y):f;return x.replace?{...y,data:w}:{...y,data:{...y.data,...w}}},x)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:x}=t.getState();return o_(d,{nodeLookup:f,nodeOrigin:x})},getHandleConnections:({type:d,id:f,nodeId:x})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${x}-${d}${f?`-${f}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:d,handleId:f,nodeId:x})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${x}${d?f?`-${d}-${f}`:`-${d}`:""}`))==null?void 0:y.values())??[])},fitView:async d=>{const f=t.getState().fitViewResolver??h_();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(x=>[...x]),f.promise}}},[]);return p.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const Bm=e=>e.selected,r4=typeof window<"u"?window:void 0;function s4({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=we(),{deleteElements:r}=pf(),s=Fo(e,{actInsideInputWithModifier:!1}),o=Fo(t,{target:r4});p.useEffect(()=>{if(s){const{edges:i,nodes:a}=n.getState();r({nodes:a.filter(Bm),edges:i.filter(Bm)}),n.setState({nodesSelectionActive:!1})}},[s]),p.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function o4(e){const t=we();p.useEffect(()=>{const n=()=>{var s,o,i,a;if(!e.current||!(((o=(s=e.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const r=uf(e.current);(r.height===0||r.width===0)&&((a=(i=t.getState()).onError)==null||a.call(i,"004",Zt.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 bl={position:"absolute",width:"100%",height:"100%",top:0,left:0},i4=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function a4({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=cr.Free,zoomOnDoubleClick:i=!0,panOnDrag:a=!0,defaultViewport:u,translateExtent:c,minZoom:h,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:x=!0,children:y,noWheelClassName:w,noPanClassName:N,onViewportChange:m,isControlledViewport:v,paneClickDistance:g,selectionOnDrag:S}){const b=we(),j=p.useRef(null),{userSelectionActive:k,lib:_,connectionInProgress:I}=ie(i4,ve),$=Fo(f),R=p.useRef();o4(j);const T=p.useCallback(A=>{m==null||m({x:A[0],y:A[1],zoom:A[2]}),v||b.setState({transform:A})},[m,v]);return p.useEffect(()=>{if(j.current){R.current=Q_({domNode:j.current,minZoom:h,maxZoom:d,translateExtent:c,viewport:u,onDraggingChange:M=>b.setState({paneDragging:M}),onPanZoomStart:(M,D)=>{const{onViewportChangeStart:E,onMoveStart:P}=b.getState();P==null||P(M,D),E==null||E(D)},onPanZoom:(M,D)=>{const{onViewportChange:E,onMove:P}=b.getState();P==null||P(M,D),E==null||E(D)},onPanZoomEnd:(M,D)=>{const{onViewportChangeEnd:E,onMoveEnd:P}=b.getState();P==null||P(M,D),E==null||E(D)}});const{x:A,y:C,zoom:L}=R.current.getViewport();return b.setState({panZoom:R.current,transform:[A,C,L],domNode:j.current.closest(".react-flow")}),()=>{var M;(M=R.current)==null||M.destroy()}}},[]),p.useEffect(()=>{var A;(A=R.current)==null||A.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:i,panOnDrag:a,zoomActivationKeyPressed:$,preventScrolling:x,noPanClassName:N,userSelectionActive:k,noWheelClassName:w,lib:_,onTransformChange:T,connectionInProgress:I,selectionOnDrag:S,paneClickDistance:g})},[e,t,n,r,s,o,i,a,$,x,N,k,w,_,T,I,S,g]),l.jsx("div",{className:"react-flow__renderer",ref:j,style:bl,children:y})}const l4=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function u4(){const{userSelectionActive:e,userSelectionRect:t}=ie(l4,ve);return e&&t?l.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 pu=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},c4=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function d4({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Do.Full,panOnDrag:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:i,onSelectionEnd:a,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:h,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:x,children:y}){const w=we(),{userSelectionActive:N,elementsSelectable:m,dragging:v,connectionInProgress:g}=ie(c4,ve),S=m&&(e||N),b=p.useRef(null),j=p.useRef(),k=p.useRef(new Set),_=p.useRef(new Set),I=p.useRef(!1),$=E=>{if(I.current||g){I.current=!1;return}u==null||u(E),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},R=E=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){E.preventDefault();return}c==null||c(E)},T=h?E=>h(E):void 0,A=E=>{I.current&&(E.stopPropagation(),I.current=!1)},C=E=>{var K,Y;const{domNode:P}=w.getState();if(j.current=P==null?void 0:P.getBoundingClientRect(),!j.current)return;const z=E.target===b.current;if(!z&&!!E.target.closest(".nokey")||!e||!(o&&z||t)||E.button!==0||!E.isPrimary)return;(Y=(K=E.target)==null?void 0:K.setPointerCapture)==null||Y.call(K,E.pointerId),I.current=!1;const{x:U,y:B}=Rt(E.nativeEvent,j.current);w.setState({userSelectionRect:{width:0,height:0,startX:U,startY:B,x:U,y:B}}),z||(E.stopPropagation(),E.preventDefault())},L=E=>{const{userSelectionRect:P,transform:z,nodeLookup:F,edgeLookup:O,connectionLookup:U,triggerNodeChanges:B,triggerEdgeChanges:K,defaultEdgeOptions:Y,resetSelectedElements:G}=w.getState();if(!j.current||!P)return;const{x:V,y:Q}=Rt(E.nativeEvent,j.current),{startX:re,startY:te}=P;if(!I.current){const le=t?0:s;if(Math.hypot(V-re,Q-te)<=le)return;G(),i==null||i(E)}I.current=!0;const ee={startX:re,startY:te,x:V<re?V:re,y:Q<te?Q:te,width:Math.abs(V-re),height:Math.abs(Q-te)},q=k.current,ue=_.current;k.current=new Set(af(F,ee,z,n===Do.Partial,!0).map(le=>le.id)),_.current=new Set;const he=(Y==null?void 0:Y.selectable)??!0;for(const le of k.current){const Be=U.get(le);if(Be)for(const{edgeId:wn}of Be.values()){const en=O.get(wn);en&&(en.selectable??he)&&_.current.add(wn)}}if(!ym(q,k.current)){const le=Kr(F,k.current,!0);B(le)}if(!ym(ue,_.current)){const le=Kr(O,_.current);K(le)}w.setState({userSelectionRect:ee,userSelectionActive:!0,nodesSelectionActive:!1})},M=E=>{var P,z;E.button===0&&((z=(P=E.target)==null?void 0:P.releasePointerCapture)==null||z.call(P,E.pointerId),!N&&E.target===b.current&&w.getState().userSelectionRect&&($==null||$(E)),w.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(a==null||a(E),w.setState({nodesSelectionActive:k.current.size>0})))},D=r===!0||Array.isArray(r)&&r.includes(0);return l.jsxs("div",{className:Me(["react-flow__pane",{draggable:D,dragging:v,selection:e}]),onClick:S?void 0:pu($,b),onContextMenu:pu(R,b),onWheel:pu(T,b),onPointerEnter:S?void 0:d,onPointerMove:S?L:f,onPointerUp:S?M:void 0,onPointerDownCapture:S?C:void 0,onClickCapture:S?A:void 0,onPointerLeave:x,ref:b,style:bl,children:[y,l.jsx(u4,{})]})}function Dc({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:i,nodeLookup:a,onError:u}=t.getState(),c=a.get(e);if(!c){u==null||u("012",Zt.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 y0({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:i}){const a=we(),[u,c]=p.useState(!1),h=p.useRef();return p.useEffect(()=>{h.current=z_({getStoreItems:()=>a.getState(),onNodeMouseDown:d=>{Dc({id:d,store:a,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),p.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 x;(x=h.current)==null||x.destroy()}},[n,r,t,o,e,s]),u}const f4=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function v0(){const e=we();return p.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:i,onError:a,updateNodePositions:u,nodeLookup:c,nodeOrigin:h}=e.getState(),d=new Map,f=f4(i),x=s?o[0]:5,y=s?o[1]:5,w=n.direction.x*x*n.factor,N=n.direction.y*y*n.factor;for(const[,m]of c){if(!f(m))continue;let v={x:m.internals.positionAbsolute.x+w,y:m.internals.positionAbsolute.y+N};s&&(v=Zo(v,o));const{position:g,positionAbsolute:S}=zy({nodeId:m.id,nextPosition:v,nodeLookup:c,nodeExtent:r,nodeOrigin:h,onError:a});m.position=g,m.internals.positionAbsolute=S,d.set(m.id,m)}u(d)},[])}const gf=p.createContext(null),h4=gf.Provider;gf.Consumer;const w0=()=>p.useContext(gf),m4=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),p4=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:i}=r,{fromHandle:a,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:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.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===ms.Strict?(a==null?void 0:a.type)!==n:e!==(a==null?void 0:a.nodeId)||t!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!s,valid:h&&c}};function g4({type:e="source",position:t=X.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:i,onConnect:a,children:u,className:c,onMouseDown:h,onTouchStart:d,...f},x){var L,M;const y=i||null,w=e==="target",N=we(),m=w0(),{connectOnClick:v,noPanClassName:g,rfId:S}=ie(m4,ve),{connectingFrom:b,connectingTo:j,clickConnecting:k,isPossibleEndHandle:_,connectionInProcess:I,clickConnectionInProcess:$,valid:R}=ie(p4(m,y,e),ve);m||(M=(L=N.getState()).onError)==null||M.call(L,"010",Zt.error010());const T=D=>{const{defaultEdgeOptions:E,onConnect:P,hasDefaultEdges:z}=N.getState(),F={...E,...D};if(z){const{edges:O,setEdges:U}=N.getState();U(w_(F,O))}P==null||P(F),a==null||a(F)},A=D=>{if(!m)return;const E=Uy(D.nativeEvent);if(s&&(E&&D.button===0||!E)){const P=N.getState();zc.onPointerDown(D.nativeEvent,{handleDomNode:D.currentTarget,autoPanOnConnect:P.autoPanOnConnect,connectionMode:P.connectionMode,connectionRadius:P.connectionRadius,domNode:P.domNode,nodeLookup:P.nodeLookup,lib:P.lib,isTarget:w,handleId:y,nodeId:m,flowId:P.rfId,panBy:P.panBy,cancelConnection:P.cancelConnection,onConnectStart:P.onConnectStart,onConnectEnd:P.onConnectEnd,updateConnection:P.updateConnection,onConnect:T,isValidConnection:n||P.isValidConnection,getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:P.autoPanSpeed,dragThreshold:P.connectionDragThreshold})}E?h==null||h(D):d==null||d(D)},C=D=>{const{onClickConnectStart:E,onClickConnectEnd:P,connectionClickStartHandle:z,connectionMode:F,isValidConnection:O,lib:U,rfId:B,nodeLookup:K,connection:Y}=N.getState();if(!m||!z&&!s)return;if(!z){E==null||E(D.nativeEvent,{nodeId:m,handleId:y,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:m,type:e,id:y}});return}const G=Vy(D.target),V=n||O,{connection:Q,isValid:re}=zc.isValid(D.nativeEvent,{handle:{nodeId:m,id:y,type:e},connectionMode:F,fromNodeId:z.nodeId,fromHandleId:z.id||null,fromType:z.type,isValidConnection:V,flowId:B,doc:G,lib:U,nodeLookup:K});re&&Q&&T(Q);const te=structuredClone(Y);delete te.inProgress,te.toPosition=te.toHandle?te.toHandle.position:null,P==null||P(D,te),N.setState({connectionClickStartHandle:null})};return l.jsx("div",{"data-handleid":y,"data-nodeid":m,"data-handlepos":t,"data-id":`${S}-${m}-${y}-${e}`,className:Me(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,c,{source:!w,target:w,connectable:r,connectablestart:s,connectableend:o,clickconnecting:k,connectingfrom:b,connectingto:j,valid:R,connectionindicator:r&&(!I||_)&&(I||$?o:s)}]),onMouseDown:A,onTouchStart:A,onClick:v?C:void 0,ref:x,...f,children:u})}const Va=p.memo(g0(g4));function x4({data:e,isConnectable:t,sourcePosition:n=X.Bottom}){return l.jsxs(l.Fragment,{children:[e==null?void 0:e.label,l.jsx(Va,{type:"source",position:n,isConnectable:t})]})}function y4({data:e,isConnectable:t,targetPosition:n=X.Top,sourcePosition:r=X.Bottom}){return l.jsxs(l.Fragment,{children:[l.jsx(Va,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,l.jsx(Va,{type:"source",position:r,isConnectable:t})]})}function v4(){return null}function w4({data:e,isConnectable:t,targetPosition:n=X.Top}){return l.jsxs(l.Fragment,{children:[l.jsx(Va,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Ba={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Um={input:x4,default:y4,output:w4,group:v4};function N4(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 S4=e=>{const{width:t,height:n,x:r,y:s}=qo(e.nodeLookup,{filter:o=>!!o.selected});return{width:It(t)?t:null,height:It(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 b4({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=we(),{width:s,height:o,transformString:i,userSelectionActive:a}=ie(S4,ve),u=v0(),c=p.useRef(null);if(p.useEffect(()=>{var f;n||(f=c.current)==null||f.focus({preventScroll:!0})},[n]),y0({nodeRef:c}),a||!s||!o)return null;const h=e?f=>{const x=r.getState().nodes.filter(y=>y.selected);e(f,x)}:void 0,d=f=>{Object.prototype.hasOwnProperty.call(Ba,f.key)&&(f.preventDefault(),u({direction:Ba[f.key],factor:f.shiftKey?4:1}))};return l.jsx("div",{className:Me(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:l.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 Wm=typeof window<"u"?window:void 0,k4=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function N0({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,paneClickDistance:a,deleteKeyCode:u,selectionKeyCode:c,selectionOnDrag:h,selectionMode:d,onSelectionStart:f,onSelectionEnd:x,multiSelectionKeyCode:y,panActivationKeyCode:w,zoomActivationKeyCode:N,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:S,panOnScrollSpeed:b,panOnScrollMode:j,zoomOnDoubleClick:k,panOnDrag:_,defaultViewport:I,translateExtent:$,minZoom:R,maxZoom:T,preventScrolling:A,onSelectionContextMenu:C,noWheelClassName:L,noPanClassName:M,disableKeyboardA11y:D,onViewportChange:E,isControlledViewport:P}){const{nodesSelectionActive:z,userSelectionActive:F}=ie(k4,ve),O=Fo(c,{target:Wm}),U=Fo(w,{target:Wm}),B=U||_,K=U||S,Y=h&&B!==!0,G=O||F||Y;return s4({deleteKeyCode:u,multiSelectionKeyCode:y}),l.jsx(a4,{onPaneContextMenu:o,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:K,panOnScrollSpeed:b,panOnScrollMode:j,zoomOnDoubleClick:k,panOnDrag:!O&&B,defaultViewport:I,translateExtent:$,minZoom:R,maxZoom:T,zoomActivationKeyCode:N,preventScrolling:A,noWheelClassName:L,noPanClassName:M,onViewportChange:E,isControlledViewport:P,paneClickDistance:a,selectionOnDrag:Y,children:l.jsxs(d4,{onSelectionStart:f,onSelectionEnd:x,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,panOnDrag:B,isSelecting:!!G,selectionMode:d,selectionKeyPressed:O,paneClickDistance:a,selectionOnDrag:Y,children:[e,z&&l.jsx(b4,{onSelectionContextMenu:C,noPanClassName:M,disableKeyboardA11y:D})]})})}N0.displayName="FlowRenderer";const j4=p.memo(N0),C4=e=>t=>e?af(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 E4(e){return ie(p.useCallback(C4(e),[e]),ve)}const _4=e=>e.updateNodeInternals;function P4(){const e=ie(_4),[t]=p.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 p.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function M4({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=we(),o=p.useRef(null),i=p.useRef(null),a=p.useRef(e.sourcePosition),u=p.useRef(e.targetPosition),c=p.useRef(t),h=n&&!!e.internals.handleBounds;return p.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]),p.useEffect(()=>()=>{i.current&&(r==null||r.unobserve(i.current),i.current=null)},[]),p.useEffect(()=>{if(o.current){const d=c.current!==t,f=a.current!==e.sourcePosition,x=u.current!==e.targetPosition;(d||f||x)&&(c.current=t,a.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 I4({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:i,nodesDraggable:a,elementsSelectable:u,nodesConnectable:c,nodesFocusable:h,resizeObserver:d,noDragClassName:f,noPanClassName:x,disableKeyboardA11y:y,rfId:w,nodeTypes:N,nodeClickDistance:m,onError:v}){const{node:g,internals:S,isParent:b}=ie(V=>{const Q=V.nodeLookup.get(e),re=V.parentLookup.has(e);return{node:Q,internals:Q.internals,isParent:re}},ve);let j=g.type||"default",k=(N==null?void 0:N[j])||Um[j];k===void 0&&(v==null||v("003",Zt.error003(j)),j="default",k=(N==null?void 0:N.default)||Um.default);const _=!!(g.draggable||a&&typeof g.draggable>"u"),I=!!(g.selectable||u&&typeof g.selectable>"u"),$=!!(g.connectable||c&&typeof g.connectable>"u"),R=!!(g.focusable||h&&typeof g.focusable>"u"),T=we(),A=Fy(g),C=M4({node:g,nodeType:j,hasDimensions:A,resizeObserver:d}),L=y0({nodeRef:C,disabled:g.hidden||!_,noDragClassName:f,handleSelector:g.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:m}),M=v0();if(g.hidden)return null;const D=vn(g),E=N4(g),P=I||_||t||n||r||s,z=n?V=>n(V,{...S.userNode}):void 0,F=r?V=>r(V,{...S.userNode}):void 0,O=s?V=>s(V,{...S.userNode}):void 0,U=o?V=>o(V,{...S.userNode}):void 0,B=i?V=>i(V,{...S.userNode}):void 0,K=V=>{const{selectNodesOnDrag:Q,nodeDragThreshold:re}=T.getState();I&&(!Q||!_||re>0)&&Dc({id:e,store:T,nodeRef:C}),t&&t(V,{...S.userNode})},Y=V=>{if(!(By(V.nativeEvent)||y)){if(Iy.includes(V.key)&&I){const Q=V.key==="Escape";Dc({id:e,store:T,unselect:Q,nodeRef:C})}else if(_&&g.selected&&Object.prototype.hasOwnProperty.call(Ba,V.key)){V.preventDefault();const{ariaLabelConfig:Q}=T.getState();T.setState({ariaLiveMessage:Q["node.a11yDescription.ariaLiveMessage"]({direction:V.key.replace("Arrow","").toLowerCase(),x:~~S.positionAbsolute.x,y:~~S.positionAbsolute.y})}),M({direction:Ba[V.key],factor:V.shiftKey?4:1})}}},G=()=>{var ue;if(y||!((ue=C.current)!=null&&ue.matches(":focus-visible")))return;const{transform:V,width:Q,height:re,autoPanOnNodeFocus:te,setCenter:ee}=T.getState();if(!te)return;af(new Map([[e,g]]),{x:0,y:0,width:Q,height:re},V,!0).length>0||ee(g.position.x+D.width/2,g.position.y+D.height/2,{zoom:V[2]})};return l.jsx("div",{className:Me(["react-flow__node",`react-flow__node-${j}`,{[x]:_},g.className,{selected:g.selected,selectable:I,parent:b,draggable:_,dragging:L}]),ref:C,style:{zIndex:S.z,transform:`translate(${S.positionAbsolute.x}px,${S.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:A?"visible":"hidden",...g.style,...E},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:F,onMouseLeave:O,onContextMenu:U,onClick:K,onDoubleClick:B,onKeyDown:R?Y:void 0,tabIndex:R?0:void 0,onFocus:R?G:void 0,role:g.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${f0}-${w}`,"aria-label":g.ariaLabel,...g.domAttributes,children:l.jsx(h4,{value:e,children:l.jsx(k,{id:e,data:g.data,type:j,positionAbsoluteX:S.positionAbsolute.x,positionAbsoluteY:S.positionAbsolute.y,selected:g.selected??!1,selectable:I,draggable:_,deletable:g.deletable??!0,isConnectable:$,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:L,dragHandle:g.dragHandle,zIndex:S.z,parentId:g.parentId,...D})})})}var R4=p.memo(I4);const T4=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function S0(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:o}=ie(T4,ve),i=E4(e.onlyRenderVisibleElements),a=P4();return l.jsx("div",{className:"react-flow__nodes",style:bl,children:i.map(u=>l.jsx(R4,{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:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:o},u))})}S0.displayName="NodeRenderer";const L4=p.memo(S0);function A4(e){return ie(p.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&&x_({sourceNode:o,targetNode:i,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),ve)}const z4=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return l.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},D4=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return l.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Km={[Oa.Arrow]:z4,[Oa.ArrowClosed]:D4};function $4(e){const t=we();return p.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(Km,e)?Km[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",Zt.error009(e)),null)},[e])}const O4=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:i,orient:a="auto-start-reverse"})=>{const u=$4(t);return u?l.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0",children:l.jsx(u,{color:n,strokeWidth:i})}):null},b0=({defaultColor:e,rfId:t})=>{const n=ie(o=>o.edges),r=ie(o=>o.defaultEdgeOptions),s=p.useMemo(()=>j_(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?l.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:l.jsx("defs",{children:s.map(o=>l.jsx(O4,{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};b0.displayName="MarkerDefinitions";var F4=p.memo(b0);function k0({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:i=[2,4],labelBgBorderRadius:a=2,children:u,className:c,...h}){const[d,f]=p.useState({x:1,y:0,width:0,height:0}),x=Me(["react-flow__edge-textwrapper",c]),y=p.useRef(null);return p.useEffect(()=>{if(y.current){const w=y.current.getBBox();f({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?l.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:x,visibility:d.width?"visible":"hidden",...h,children:[s&&l.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:a,ry:a}),l.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:y,style:r,children:n}),u]}):null}k0.displayName="EdgeText";const H4=p.memo(k0);function kl({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:a,labelBgBorderRadius:u,interactionWidth:c=20,...h}){return l.jsxs(l.Fragment,{children:[l.jsx("path",{...h,d:e,fill:"none",className:Me(["react-flow__edge-path",h.className])}),c?l.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&It(t)&&It(n)?l.jsx(H4,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:a,labelBgBorderRadius:u}):null]})}function Ym({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===X.Left||e===X.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function j0({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:s,targetPosition:o=X.Top}){const[i,a]=Ym({pos:n,x1:e,y1:t,x2:r,y2:s}),[u,c]=Ym({pos:o,x1:r,y1:s,x2:e,y2:t}),[h,d,f,x]=Wy({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:i,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${i},${a} ${u},${c} ${r},${s}`,h,d,f,x]}function C0(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i,targetPosition:a,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:N,interactionWidth:m})=>{const[v,g,S]=j0({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:a}),b=e.isInternal?void 0:t;return l.jsx(kl,{id:b,path:v,labelX:g,labelY:S,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:N,interactionWidth:m})})}const V4=C0({isInternal:!1}),E0=C0({isInternal:!0});V4.displayName="SimpleBezierEdge";E0.displayName="SimpleBezierEdgeInternal";function _0(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,sourcePosition:x=X.Bottom,targetPosition:y=X.Top,markerEnd:w,markerStart:N,pathOptions:m,interactionWidth:v})=>{const[g,S,b]=Tc({sourceX:n,sourceY:r,sourcePosition:x,targetX:s,targetY:o,targetPosition:y,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset,stepPosition:m==null?void 0:m.stepPosition}),j=e.isInternal?void 0:t;return l.jsx(kl,{id:j,path:g,labelX:S,labelY:b,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:w,markerStart:N,interactionWidth:v})})}const P0=_0({isInternal:!1}),M0=_0({isInternal:!0});P0.displayName="SmoothStepEdge";M0.displayName="SmoothStepEdgeInternal";function I0(e){return p.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return l.jsx(P0,{...n,id:r,pathOptions:p.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const B4=I0({isInternal:!1}),R0=I0({isInternal:!0});B4.displayName="StepEdge";R0.displayName="StepEdgeInternal";function T0(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:y,interactionWidth:w})=>{const[N,m,v]=Gy({sourceX:n,sourceY:r,targetX:s,targetY:o}),g=e.isInternal?void 0:t;return l.jsx(kl,{id:g,path:N,labelX:m,labelY:v,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:y,interactionWidth:w})})}const U4=T0({isInternal:!1}),L0=T0({isInternal:!0});U4.displayName="StraightEdge";L0.displayName="StraightEdgeInternal";function A0(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i=X.Bottom,targetPosition:a=X.Top,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:N,pathOptions:m,interactionWidth:v})=>{const[g,S,b]=Ky({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:a,curvature:m==null?void 0:m.curvature}),j=e.isInternal?void 0:t;return l.jsx(kl,{id:j,path:g,labelX:S,labelY:b,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:N,interactionWidth:v})})}const W4=A0({isInternal:!1}),z0=A0({isInternal:!0});W4.displayName="BezierEdge";z0.displayName="BezierEdgeInternal";const Gm={default:z0,straight:L0,step:R0,smoothstep:M0,simplebezier:E0},Xm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},K4=(e,t,n)=>n===X.Left?e-t:n===X.Right?e+t:e,Y4=(e,t,n)=>n===X.Top?e-t:n===X.Bottom?e+t:e,Qm="react-flow__edgeupdater";function qm({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:i,type:a}){return l.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:i,className:Me([Qm,`${Qm}-${a}`]),cx:K4(t,r,e),cy:Y4(n,r,e),r,stroke:"transparent",fill:"transparent"})}function G4({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:i,sourcePosition:a,targetPosition:u,onReconnect:c,onReconnectStart:h,onReconnectEnd:d,setReconnecting:f,setUpdateHover:x}){const y=we(),w=(S,b)=>{if(S.button!==0)return;const{autoPanOnConnect:j,domNode:k,isValidConnection:_,connectionMode:I,connectionRadius:$,lib:R,onConnectStart:T,onConnectEnd:A,cancelConnection:C,nodeLookup:L,rfId:M,panBy:D,updateConnection:E}=y.getState(),P=b.type==="target",z=(U,B)=>{f(!1),d==null||d(U,n,b.type,B)},F=U=>c==null?void 0:c(n,U),O=(U,B)=>{f(!0),h==null||h(S,n,b.type),T==null||T(U,B)};zc.onPointerDown(S.nativeEvent,{autoPanOnConnect:j,connectionMode:I,connectionRadius:$,domNode:k,handleId:b.id,nodeId:b.nodeId,nodeLookup:L,isTarget:P,edgeUpdaterType:b.type,lib:R,flowId:M,cancelConnection:C,panBy:D,isValidConnection:_,onConnect:F,onConnectStart:O,onConnectEnd:A,onReconnectEnd:z,updateConnection:E,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:S.currentTarget})},N=S=>w(S,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=S=>w(S,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>x(!0),g=()=>x(!1);return l.jsxs(l.Fragment,{children:[(e===!0||e==="source")&&l.jsx(qm,{position:a,centerX:r,centerY:s,radius:t,onMouseDown:N,onMouseEnter:v,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&l.jsx(qm,{position:u,centerX:o,centerY:i,radius:t,onMouseDown:m,onMouseEnter:v,onMouseOut:g,type:"target"})]})}function X4({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:i,onMouseEnter:a,onMouseMove:u,onMouseLeave:c,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:x,rfId:y,edgeTypes:w,noPanClassName:N,onError:m,disableKeyboardA11y:v}){let g=ie(ee=>ee.edgeLookup.get(e));const S=ie(ee=>ee.defaultEdgeOptions);g=S?{...S,...g}:g;let b=g.type||"default",j=(w==null?void 0:w[b])||Gm[b];j===void 0&&(m==null||m("011",Zt.error011(b)),b="default",j=(w==null?void 0:w.default)||Gm.default);const k=!!(g.focusable||t&&typeof g.focusable>"u"),_=typeof d<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),I=!!(g.selectable||r&&typeof g.selectable>"u"),$=p.useRef(null),[R,T]=p.useState(!1),[A,C]=p.useState(!1),L=we(),{zIndex:M,sourceX:D,sourceY:E,targetX:P,targetY:z,sourcePosition:F,targetPosition:O}=ie(p.useCallback(ee=>{const q=ee.nodeLookup.get(g.source),ue=ee.nodeLookup.get(g.target);if(!q||!ue)return{zIndex:g.zIndex,...Xm};const he=k_({id:e,sourceNode:q,targetNode:ue,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:ee.connectionMode,onError:m});return{zIndex:g_({selected:g.selected,zIndex:g.zIndex,sourceNode:q,targetNode:ue,elevateOnSelect:ee.elevateEdgesOnSelect,zIndexMode:ee.zIndexMode}),...he||Xm}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex]),ve),U=p.useMemo(()=>g.markerStart?`url('#${Lc(g.markerStart,y)}')`:void 0,[g.markerStart,y]),B=p.useMemo(()=>g.markerEnd?`url('#${Lc(g.markerEnd,y)}')`:void 0,[g.markerEnd,y]);if(g.hidden||D===null||E===null||P===null||z===null)return null;const K=ee=>{var le;const{addSelectedEdges:q,unselectNodesAndEdges:ue,multiSelectionActive:he}=L.getState();I&&(L.setState({nodesSelectionActive:!1}),g.selected&&he?(ue({nodes:[],edges:[g]}),(le=$.current)==null||le.blur()):q([e])),s&&s(ee,g)},Y=o?ee=>{o(ee,{...g})}:void 0,G=i?ee=>{i(ee,{...g})}:void 0,V=a?ee=>{a(ee,{...g})}:void 0,Q=u?ee=>{u(ee,{...g})}:void 0,re=c?ee=>{c(ee,{...g})}:void 0,te=ee=>{var q;if(!v&&Iy.includes(ee.key)&&I){const{unselectNodesAndEdges:ue,addSelectedEdges:he}=L.getState();ee.key==="Escape"?((q=$.current)==null||q.blur(),ue({edges:[g]})):he([e])}};return l.jsx("svg",{style:{zIndex:M},children:l.jsxs("g",{className:Me(["react-flow__edge",`react-flow__edge-${b}`,g.className,N,{selected:g.selected,animated:g.animated,inactive:!I&&!s,updating:R,selectable:I}]),onClick:K,onDoubleClick:Y,onContextMenu:G,onMouseEnter:V,onMouseMove:Q,onMouseLeave:re,onKeyDown:k?te:void 0,tabIndex:k?0:void 0,role:g.ariaRole??(k?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":g.ariaLabel===null?void 0:g.ariaLabel||`Edge from ${g.source} to ${g.target}`,"aria-describedby":k?`${h0}-${y}`:void 0,ref:$,...g.domAttributes,children:[!A&&l.jsx(j,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:I,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:D,sourceY:E,targetX:P,targetY:z,sourcePosition:F,targetPosition:O,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:U,markerEnd:B,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),_&&l.jsx(G4,{edge:g,isReconnectable:_,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:x,sourceX:D,sourceY:E,targetX:P,targetY:z,sourcePosition:F,targetPosition:O,setUpdateHover:T,setReconnecting:C})]})})}var Q4=p.memo(X4);const q4=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function D0({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:i,onEdgeMouseEnter:a,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:h,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:x,onReconnectEnd:y,disableKeyboardA11y:w}){const{edgesFocusable:N,edgesReconnectable:m,elementsSelectable:v,onError:g}=ie(q4,ve),S=A4(t);return l.jsxs("div",{className:"react-flow__edges",children:[l.jsx(F4,{defaultColor:e,rfId:n}),S.map(b=>l.jsx(Q4,{id:b,edgesFocusable:N,edgesReconnectable:m,elementsSelectable:v,noPanClassName:s,onReconnect:o,onContextMenu:i,onMouseEnter:a,onMouseMove:u,onMouseLeave:c,onClick:h,reconnectRadius:d,onDoubleClick:f,onReconnectStart:x,onReconnectEnd:y,rfId:n,onError:g,edgeTypes:r,disableKeyboardA11y:w},b))]})}D0.displayName="EdgeRenderer";const Z4=p.memo(D0),J4=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function eP({children:e}){const t=ie(J4);return l.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function tP(e){const t=pf(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const nP=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function rP(e){const t=ie(nP),n=we();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function sP(e){return e.connection.inProgress?{...e.connection,to:Jo(e.connection.to,e.transform)}:{...e.connection}}function oP(e){return sP}function iP(e){const t=oP();return ie(t,ve)}const aP=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function lP({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:i,isValid:a,inProgress:u}=ie(aP,ve);return!(o&&s&&u)?null:l.jsx("svg",{style:e,width:o,height:i,className:"react-flow__connectionline react-flow__container",children:l.jsx("g",{className:Me(["react-flow__connection",Ly(a)]),children:l.jsx($0,{style:t,type:n,CustomComponent:r,isValid:a})})})}const $0=({style:e,type:t=In.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:i,fromHandle:a,fromPosition:u,to:c,toNode:h,toHandle:d,toPosition:f,pointer:x}=iP();if(!s)return;if(n)return l.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:a,fromX:o.x,fromY:o.y,toX:c.x,toY:c.y,fromPosition:u,toPosition:f,connectionStatus:Ly(r),toNode:h,toHandle:d,pointer:x});let y="";const w={sourceX:o.x,sourceY:o.y,sourcePosition:u,targetX:c.x,targetY:c.y,targetPosition:f};switch(t){case In.Bezier:[y]=Ky(w);break;case In.SimpleBezier:[y]=j0(w);break;case In.Step:[y]=Tc({...w,borderRadius:0});break;case In.SmoothStep:[y]=Tc(w);break;default:[y]=Gy(w)}return l.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};$0.displayName="ConnectionLine";const uP={};function Zm(e=uP){p.useRef(e),we(),p.useEffect(()=>{},[e])}function cP(){we(),p.useRef(!1),p.useEffect(()=>{},[])}function O0({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:h,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:x,connectionLineType:y,connectionLineStyle:w,connectionLineComponent:N,connectionLineContainerStyle:m,selectionKeyCode:v,selectionOnDrag:g,selectionMode:S,multiSelectionKeyCode:b,panActivationKeyCode:j,zoomActivationKeyCode:k,deleteKeyCode:_,onlyRenderVisibleElements:I,elementsSelectable:$,defaultViewport:R,translateExtent:T,minZoom:A,maxZoom:C,preventScrolling:L,defaultMarkerColor:M,zoomOnScroll:D,zoomOnPinch:E,panOnScroll:P,panOnScrollSpeed:z,panOnScrollMode:F,zoomOnDoubleClick:O,panOnDrag:U,onPaneClick:B,onPaneMouseEnter:K,onPaneMouseMove:Y,onPaneMouseLeave:G,onPaneScroll:V,onPaneContextMenu:Q,paneClickDistance:re,nodeClickDistance:te,onEdgeContextMenu:ee,onEdgeMouseEnter:q,onEdgeMouseMove:ue,onEdgeMouseLeave:he,reconnectRadius:le,onReconnect:Be,onReconnectStart:wn,onReconnectEnd:en,noDragClassName:Zn,noWheelClassName:Is,noPanClassName:Rs,disableKeyboardA11y:Ts,nodeExtent:Pl,rfId:ti,viewport:Er,onViewportChange:Ls}){return Zm(e),Zm(t),cP(),tP(n),rP(Er),l.jsx(j4,{onPaneClick:B,onPaneMouseEnter:K,onPaneMouseMove:Y,onPaneMouseLeave:G,onPaneContextMenu:Q,onPaneScroll:V,paneClickDistance:re,deleteKeyCode:_,selectionKeyCode:v,selectionOnDrag:g,selectionMode:S,onSelectionStart:f,onSelectionEnd:x,multiSelectionKeyCode:b,panActivationKeyCode:j,zoomActivationKeyCode:k,elementsSelectable:$,zoomOnScroll:D,zoomOnPinch:E,zoomOnDoubleClick:O,panOnScroll:P,panOnScrollSpeed:z,panOnScrollMode:F,panOnDrag:U,defaultViewport:R,translateExtent:T,minZoom:A,maxZoom:C,onSelectionContextMenu:d,preventScrolling:L,noDragClassName:Zn,noWheelClassName:Is,noPanClassName:Rs,disableKeyboardA11y:Ts,onViewportChange:Ls,isControlledViewport:!!Er,children:l.jsxs(eP,{children:[l.jsx(Z4,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:i,onReconnect:Be,onReconnectStart:wn,onReconnectEnd:en,onlyRenderVisibleElements:I,onEdgeContextMenu:ee,onEdgeMouseEnter:q,onEdgeMouseMove:ue,onEdgeMouseLeave:he,reconnectRadius:le,defaultMarkerColor:M,noPanClassName:Rs,disableKeyboardA11y:Ts,rfId:ti}),l.jsx(lP,{style:w,type:y,component:N,containerStyle:m}),l.jsx("div",{className:"react-flow__edgelabel-renderer"}),l.jsx(L4,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:a,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:h,nodeClickDistance:te,onlyRenderVisibleElements:I,noPanClassName:Rs,noDragClassName:Zn,disableKeyboardA11y:Ts,nodeExtent:Pl,rfId:ti}),l.jsx("div",{className:"react-flow__viewport-portal"})]})})}O0.displayName="GraphView";const dP=p.memo(O0),Jm=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:a,minZoom:u=.5,maxZoom:c=2,nodeOrigin:h,nodeExtent:d,zIndexMode:f="basic"}={})=>{const x=new Map,y=new Map,w=new Map,N=new Map,m=r??t??[],v=n??e??[],g=h??[0,0],S=d??zo;qy(w,N,m);const b=Ac(v,x,y,{nodeOrigin:g,nodeExtent:S,zIndexMode:f});let j=[0,0,1];if(i&&s&&o){const k=qo(x,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:_,y:I,zoom:$}=lf(k,s,o,u,c,(a==null?void 0:a.padding)??.1);j=[_,I,$]}return{rfId:"1",width:s??0,height:o??0,transform:j,nodes:v,nodesInitialized:b,nodeLookup:x,parentLookup:y,edges:m,edgeLookup:N,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:c,translateExtent:zo,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ms.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:g,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:a,fitViewResolver:null,connection:{...Ty},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:c_,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Ry,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},fP=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:a,minZoom:u,maxZoom:c,nodeOrigin:h,nodeExtent:d,zIndexMode:f})=>_3((x,y)=>{async function w(){const{nodeLookup:N,panZoom:m,fitViewOptions:v,fitViewResolver:g,width:S,height:b,minZoom:j,maxZoom:k}=y();m&&(await l_({nodes:N,width:S,height:b,panZoom:m,minZoom:j,maxZoom:k},v),g==null||g.resolve(!0),x({fitViewResolver:null}))}return{...Jm({nodes:e,edges:t,width:s,height:o,fitView:i,fitViewOptions:a,minZoom:u,maxZoom:c,nodeOrigin:h,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:N=>{const{nodeLookup:m,parentLookup:v,nodeOrigin:g,elevateNodesOnSelect:S,fitViewQueued:b,zIndexMode:j}=y(),k=Ac(N,m,v,{nodeOrigin:g,nodeExtent:d,elevateNodesOnSelect:S,checkEquality:!0,zIndexMode:j});b&&k?(w(),x({nodes:N,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0})):x({nodes:N,nodesInitialized:k})},setEdges:N=>{const{connectionLookup:m,edgeLookup:v}=y();qy(m,v,N),x({edges:N})},setDefaultNodesAndEdges:(N,m)=>{if(N){const{setNodes:v}=y();v(N),x({hasDefaultNodes:!0})}if(m){const{setEdges:v}=y();v(m),x({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:m,nodeLookup:v,parentLookup:g,domNode:S,nodeOrigin:b,nodeExtent:j,debug:k,fitViewQueued:_,zIndexMode:I}=y(),{changes:$,updatedInternals:R}=R_(N,v,g,S,b,j,I);R&&(__(v,g,{nodeOrigin:b,nodeExtent:j,zIndexMode:I}),_?(w(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),($==null?void 0:$.length)>0&&(k&&console.log("React Flow: trigger node changes",$),m==null||m($)))},updateNodePositions:(N,m=!1)=>{const v=[];let g=[];const{nodeLookup:S,triggerNodeChanges:b,connection:j,updateConnection:k,onNodesChangeMiddlewareMap:_}=y();for(const[I,$]of N){const R=S.get(I),T=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&($!=null&&$.position)),A={id:I,type:"position",position:T?{x:Math.max(0,$.position.x),y:Math.max(0,$.position.y)}:$.position,dragging:m};if(R&&j.inProgress&&j.fromNode.id===R.id){const C=wr(R,j.fromHandle,X.Left,!0);k({...j,from:C})}T&&R.parentId&&v.push({id:I,parentId:R.parentId,rect:{...$.internals.positionAbsolute,width:$.measured.width??0,height:$.measured.height??0}}),g.push(A)}if(v.length>0){const{parentLookup:I,nodeOrigin:$}=y(),R=mf(v,S,I,$);g.push(...R)}for(const I of _.values())g=I(g);b(g)},triggerNodeChanges:N=>{const{onNodesChange:m,setNodes:v,nodes:g,hasDefaultNodes:S,debug:b}=y();if(N!=null&&N.length){if(S){const j=X3(N,g);v(j)}b&&console.log("React Flow: trigger node changes",N),m==null||m(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:m,setEdges:v,edges:g,hasDefaultEdges:S,debug:b}=y();if(N!=null&&N.length){if(S){const j=Q3(N,g);v(j)}b&&console.log("React Flow: trigger edge changes",N),m==null||m(N)}},addSelectedNodes:N=>{const{multiSelectionActive:m,edgeLookup:v,nodeLookup:g,triggerNodeChanges:S,triggerEdgeChanges:b}=y();if(m){const j=N.map(k=>tr(k,!0));S(j);return}S(Kr(g,new Set([...N]),!0)),b(Kr(v))},addSelectedEdges:N=>{const{multiSelectionActive:m,edgeLookup:v,nodeLookup:g,triggerNodeChanges:S,triggerEdgeChanges:b}=y();if(m){const j=N.map(k=>tr(k,!0));b(j);return}b(Kr(v,new Set([...N]))),S(Kr(g,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:m}={})=>{const{edges:v,nodes:g,nodeLookup:S,triggerNodeChanges:b,triggerEdgeChanges:j}=y(),k=N||g,_=m||v,I=k.map(R=>{const T=S.get(R.id);return T&&(T.selected=!1),tr(R.id,!1)}),$=_.map(R=>tr(R.id,!1));b(I),j($)},setMinZoom:N=>{const{panZoom:m,maxZoom:v}=y();m==null||m.setScaleExtent([N,v]),x({minZoom:N})},setMaxZoom:N=>{const{panZoom:m,minZoom:v}=y();m==null||m.setScaleExtent([v,N]),x({maxZoom:N})},setTranslateExtent:N=>{var m;(m=y().panZoom)==null||m.setTranslateExtent(N),x({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:m,triggerNodeChanges:v,triggerEdgeChanges:g,elementsSelectable:S}=y();if(!S)return;const b=m.reduce((k,_)=>_.selected?[...k,tr(_.id,!1)]:k,[]),j=N.reduce((k,_)=>_.selected?[...k,tr(_.id,!1)]:k,[]);v(b),g(j)},setNodeExtent:N=>{const{nodes:m,nodeLookup:v,parentLookup:g,nodeOrigin:S,elevateNodesOnSelect:b,nodeExtent:j,zIndexMode:k}=y();N[0][0]===j[0][0]&&N[0][1]===j[0][1]&&N[1][0]===j[1][0]&&N[1][1]===j[1][1]||(Ac(m,v,g,{nodeOrigin:S,nodeExtent:N,elevateNodesOnSelect:b,checkEquality:!1,zIndexMode:k}),x({nodeExtent:N}))},panBy:N=>{const{transform:m,width:v,height:g,panZoom:S,translateExtent:b}=y();return T_({delta:N,panZoom:S,transform:m,translateExtent:b,width:v,height:g})},setCenter:async(N,m,v)=>{const{width:g,height:S,maxZoom:b,panZoom:j}=y();if(!j)return Promise.resolve(!1);const k=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:b;return await j.setViewport({x:g/2-N*k,y:S/2-m*k,zoom:k},{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:()=>{x({connection:{...Ty}})},updateConnection:N=>{x({connection:N})},reset:()=>x({...Jm()})}},Object.is);function hP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,initialMinZoom:i,initialMaxZoom:a,initialFitViewOptions:u,fitView:c,nodeOrigin:h,nodeExtent:d,zIndexMode:f,children:x}){const[y]=p.useState(()=>fP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:c,minZoom:i,maxZoom:a,fitViewOptions:u,nodeOrigin:h,nodeExtent:d,zIndexMode:f}));return l.jsx(P3,{value:y,children:l.jsx(e4,{children:x})})}function mP({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:i,fitView:a,fitViewOptions:u,minZoom:c,maxZoom:h,nodeOrigin:d,nodeExtent:f,zIndexMode:x}){return p.useContext(Nl)?l.jsx(l.Fragment,{children:e}):l.jsx(hP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:i,fitView:a,initialFitViewOptions:u,initialMinZoom:c,initialMaxZoom:h,nodeOrigin:d,nodeExtent:f,zIndexMode:x,children:e})}const pP={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:a,onEdgeClick:u,onInit:c,onMove:h,onMoveStart:d,onMoveEnd:f,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:N,onClickConnectEnd:m,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:S,onNodeContextMenu:b,onNodeDoubleClick:j,onNodeDragStart:k,onNodeDrag:_,onNodeDragStop:I,onNodesDelete:$,onEdgesDelete:R,onDelete:T,onSelectionChange:A,onSelectionDragStart:C,onSelectionDrag:L,onSelectionDragStop:M,onSelectionContextMenu:D,onSelectionStart:E,onSelectionEnd:P,onBeforeDelete:z,connectionMode:F,connectionLineType:O=In.Bezier,connectionLineStyle:U,connectionLineComponent:B,connectionLineContainerStyle:K,deleteKeyCode:Y="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:V=!1,selectionMode:Q=Do.Full,panActivationKeyCode:re="Space",multiSelectionKeyCode:te=Oo()?"Meta":"Control",zoomActivationKeyCode:ee=Oo()?"Meta":"Control",snapToGrid:q,snapGrid:ue,onlyRenderVisibleElements:he=!1,selectNodesOnDrag:le,nodesDraggable:Be,autoPanOnNodeFocus:wn,nodesConnectable:en,nodesFocusable:Zn,nodeOrigin:Is=m0,edgesFocusable:Rs,edgesReconnectable:Ts,elementsSelectable:Pl=!0,defaultViewport:ti=V3,minZoom:Er=.5,maxZoom:Ls=2,translateExtent:Cf=zo,preventScrolling:Uv=!0,nodeExtent:Ml,defaultMarkerColor:Wv="#b1b1b7",zoomOnScroll:Kv=!0,zoomOnPinch:Yv=!0,panOnScroll:Gv=!1,panOnScrollSpeed:Xv=.5,panOnScrollMode:Qv=cr.Free,zoomOnDoubleClick:qv=!0,panOnDrag:Zv=!0,onPaneClick:Jv,onPaneMouseEnter:e1,onPaneMouseMove:t1,onPaneMouseLeave:n1,onPaneScroll:r1,onPaneContextMenu:s1,paneClickDistance:o1=1,nodeClickDistance:i1=0,children:a1,onReconnect:l1,onReconnectStart:u1,onReconnectEnd:c1,onEdgeContextMenu:d1,onEdgeDoubleClick:f1,onEdgeMouseEnter:h1,onEdgeMouseMove:m1,onEdgeMouseLeave:p1,reconnectRadius:g1=10,onNodesChange:x1,onEdgesChange:y1,noDragClassName:v1="nodrag",noWheelClassName:w1="nowheel",noPanClassName:Ef="nopan",fitView:_f,fitViewOptions:Pf,connectOnClick:N1,attributionPosition:S1,proOptions:b1,defaultEdgeOptions:k1,elevateNodesOnSelect:j1=!0,elevateEdgesOnSelect:C1=!1,disableKeyboardA11y:Mf=!1,autoPanOnConnect:E1,autoPanOnNodeDrag:_1,autoPanSpeed:P1,connectionRadius:M1,isValidConnection:I1,onError:R1,style:T1,id:If,nodeDragThreshold:L1,connectionDragThreshold:A1,viewport:z1,onViewportChange:D1,width:$1,height:O1,colorMode:F1="light",debug:H1,onScroll:ni,ariaLabelConfig:V1,zIndexMode:Rf="basic",...B1},U1){const Il=If||"1",W1=K3(F1),K1=p.useCallback(Tf=>{Tf.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ni==null||ni(Tf)},[ni]);return l.jsx("div",{"data-testid":"rf__wrapper",...B1,onScroll:K1,style:{...T1,...pP},ref:U1,className:Me(["react-flow",s,W1]),id:If,role:"application",children:l.jsxs(mP,{nodes:e,edges:t,width:$1,height:O1,fitView:_f,fitViewOptions:Pf,minZoom:Er,maxZoom:Ls,nodeOrigin:Is,nodeExtent:Ml,zIndexMode:Rf,children:[l.jsx(dP,{onInit:c,onNodeClick:a,onEdgeClick:u,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:S,onNodeContextMenu:b,onNodeDoubleClick:j,nodeTypes:o,edgeTypes:i,connectionLineType:O,connectionLineStyle:U,connectionLineComponent:B,connectionLineContainerStyle:K,selectionKeyCode:G,selectionOnDrag:V,selectionMode:Q,deleteKeyCode:Y,multiSelectionKeyCode:te,panActivationKeyCode:re,zoomActivationKeyCode:ee,onlyRenderVisibleElements:he,defaultViewport:ti,translateExtent:Cf,minZoom:Er,maxZoom:Ls,preventScrolling:Uv,zoomOnScroll:Kv,zoomOnPinch:Yv,zoomOnDoubleClick:qv,panOnScroll:Gv,panOnScrollSpeed:Xv,panOnScrollMode:Qv,panOnDrag:Zv,onPaneClick:Jv,onPaneMouseEnter:e1,onPaneMouseMove:t1,onPaneMouseLeave:n1,onPaneScroll:r1,onPaneContextMenu:s1,paneClickDistance:o1,nodeClickDistance:i1,onSelectionContextMenu:D,onSelectionStart:E,onSelectionEnd:P,onReconnect:l1,onReconnectStart:u1,onReconnectEnd:c1,onEdgeContextMenu:d1,onEdgeDoubleClick:f1,onEdgeMouseEnter:h1,onEdgeMouseMove:m1,onEdgeMouseLeave:p1,reconnectRadius:g1,defaultMarkerColor:Wv,noDragClassName:v1,noWheelClassName:w1,noPanClassName:Ef,rfId:Il,disableKeyboardA11y:Mf,nodeExtent:Ml,viewport:z1,onViewportChange:D1}),l.jsx(W3,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:N,onClickConnectEnd:m,nodesDraggable:Be,autoPanOnNodeFocus:wn,nodesConnectable:en,nodesFocusable:Zn,edgesFocusable:Rs,edgesReconnectable:Ts,elementsSelectable:Pl,elevateNodesOnSelect:j1,elevateEdgesOnSelect:C1,minZoom:Er,maxZoom:Ls,nodeExtent:Ml,onNodesChange:x1,onEdgesChange:y1,snapToGrid:q,snapGrid:ue,connectionMode:F,translateExtent:Cf,connectOnClick:N1,defaultEdgeOptions:k1,fitView:_f,fitViewOptions:Pf,onNodesDelete:$,onEdgesDelete:R,onDelete:T,onNodeDragStart:k,onNodeDrag:_,onNodeDragStop:I,onSelectionDrag:L,onSelectionDragStart:C,onSelectionDragStop:M,onMove:h,onMoveStart:d,onMoveEnd:f,noPanClassName:Ef,nodeOrigin:Is,rfId:Il,autoPanOnConnect:E1,autoPanOnNodeDrag:_1,autoPanSpeed:P1,onError:R1,connectionRadius:M1,isValidConnection:I1,selectNodesOnDrag:le,nodeDragThreshold:L1,connectionDragThreshold:A1,onBeforeDelete:z,debug:H1,ariaLabelConfig:V1,zIndexMode:Rf}),l.jsx(H3,{onSelectionChange:A}),a1,l.jsx(z3,{proOptions:b1,position:S1}),l.jsx(A3,{rfId:Il,disableKeyboardA11y:Mf})]})})}var xP=g0(gP);function yP({dimensions:e,lineWidth:t,variant:n,className:r}){return l.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Me(["react-flow__background-pattern",n,r])})}function vP({radius:e,className:t}){return l.jsx("circle",{cx:e,cy:e,r:e,className:Me(["react-flow__background-pattern","dots",t])})}var Vn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Vn||(Vn={}));const wP={[Vn.Dots]:1,[Vn.Lines]:1,[Vn.Cross]:6},NP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function F0({id:e,variant:t=Vn.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:i,bgColor:a,style:u,className:c,patternClassName:h}){const d=p.useRef(null),{transform:f,patternId:x}=ie(NP,ve),y=r||wP[t],w=t===Vn.Dots,N=t===Vn.Cross,m=Array.isArray(n)?n:[n,n],v=[m[0]*f[2]||1,m[1]*f[2]||1],g=y*f[2],S=Array.isArray(o)?o:[o,o],b=N?[g,g]:v,j=[S[0]*f[2]||1+b[0]/2,S[1]*f[2]||1+b[1]/2],k=`${x}${e||""}`;return l.jsxs("svg",{className:Me(["react-flow__background",c]),style:{...u,...bl,"--xy-background-color-props":a,"--xy-background-pattern-color-props":i},ref:d,"data-testid":"rf__background",children:[l.jsx("pattern",{id:k,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${j[0]},-${j[1]})`,children:w?l.jsx(vP,{radius:g/2,className:h}):l.jsx(yP,{dimensions:b,lineWidth:s,variant:t,className:h})}),l.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}F0.displayName="Background";const SP=p.memo(F0);function bP(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:l.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function kP(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:l.jsx("path",{d:"M0 0h32v4.2H0z"})})}function jP(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:l.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 CP(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.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 EP(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.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 Mi({children:e,className:t,...n}){return l.jsx("button",{type:"button",className:Me(["react-flow__controls-button",t]),...n,children:e})}const _P=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function H0({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:i,onFitView:a,onInteractiveChange:u,className:c,children:h,position:d="bottom-left",orientation:f="vertical","aria-label":x}){const y=we(),{isInteractive:w,minZoomReached:N,maxZoomReached:m,ariaLabelConfig:v}=ie(_P,ve),{zoomIn:g,zoomOut:S,fitView:b}=pf(),j=()=>{g(),o==null||o()},k=()=>{S(),i==null||i()},_=()=>{b(s),a==null||a()},I=()=>{y.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),u==null||u(!w)},$=f==="horizontal"?"horizontal":"vertical";return l.jsxs(Sl,{className:Me(["react-flow__controls",$,c]),position:d,style:e,"data-testid":"rf__controls","aria-label":x??v["controls.ariaLabel"],children:[t&&l.jsxs(l.Fragment,{children:[l.jsx(Mi,{onClick:j,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:m,children:l.jsx(bP,{})}),l.jsx(Mi,{onClick:k,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:N,children:l.jsx(kP,{})})]}),n&&l.jsx(Mi,{className:"react-flow__controls-fitview",onClick:_,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:l.jsx(jP,{})}),r&&l.jsx(Mi,{className:"react-flow__controls-interactive",onClick:I,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:w?l.jsx(EP,{}):l.jsx(CP,{})}),h]})}H0.displayName="Controls";const PP=p.memo(H0);function MP({id:e,x:t,y:n,width:r,height:s,style:o,color:i,strokeColor:a,strokeWidth:u,className:c,borderRadius:h,shapeRendering:d,selected:f,onClick:x}){const{background:y,backgroundColor:w}=o||{},N=i||y||w;return l.jsx("rect",{className:Me(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:h,ry:h,width:r,height:s,style:{fill:N,stroke:a,strokeWidth:u},shapeRendering:d,onClick:x?m=>x(m,e):void 0})}const IP=p.memo(MP),RP=e=>e.nodes.map(t=>t.id),gu=e=>e instanceof Function?e:()=>e;function TP({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=IP,onClick:i}){const a=ie(RP,ve),u=gu(t),c=gu(e),h=gu(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return l.jsx(l.Fragment,{children:a.map(f=>l.jsx(AP,{id:f,nodeColorFunc:u,nodeStrokeColorFunc:c,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:i,shapeRendering:d},f))})}function LP({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:i,NodeComponent:a,onClick:u}){const{node:c,x:h,y:d,width:f,height:x}=ie(y=>{const{internals:w}=y.nodeLookup.get(e),N=w.userNode,{x:m,y:v}=w.positionAbsolute,{width:g,height:S}=vn(N);return{node:N,x:m,y:v,width:g,height:S}},ve);return!c||c.hidden||!Fy(c)?null:l.jsx(a,{x:h,y:d,width:f,height:x,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 AP=p.memo(LP);var zP=p.memo(TP);const DP=200,$P=150,OP=e=>!e.hidden,FP=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?Oy(qo(e.nodeLookup,{filter:OP}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},HP="react-flow__minimap-desc";function V0({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:i,nodeComponent:a,bgColor:u,maskColor:c,maskStrokeColor:h,maskStrokeWidth:d,position:f="bottom-right",onClick:x,onNodeClick:y,pannable:w=!1,zoomable:N=!1,ariaLabel:m,inversePan:v,zoomStep:g=1,offsetScale:S=5}){const b=we(),j=p.useRef(null),{boundingRect:k,viewBB:_,rfId:I,panZoom:$,translateExtent:R,flowWidth:T,flowHeight:A,ariaLabelConfig:C}=ie(FP,ve),L=(e==null?void 0:e.width)??DP,M=(e==null?void 0:e.height)??$P,D=k.width/L,E=k.height/M,P=Math.max(D,E),z=P*L,F=P*M,O=S*P,U=k.x-(z-k.width)/2-O,B=k.y-(F-k.height)/2-O,K=z+O*2,Y=F+O*2,G=`${HP}-${I}`,V=p.useRef(0),Q=p.useRef();V.current=P,p.useEffect(()=>{if(j.current&&$)return Q.current=V_({domNode:j.current,panZoom:$,getTransform:()=>b.getState().transform,getViewScale:()=>V.current}),()=>{var q;(q=Q.current)==null||q.destroy()}},[$]),p.useEffect(()=>{var q;(q=Q.current)==null||q.update({translateExtent:R,width:T,height:A,inversePan:v,pannable:w,zoomStep:g,zoomable:N})},[w,N,v,g,R,T,A]);const re=x?q=>{var le;const[ue,he]=((le=Q.current)==null?void 0:le.pointer(q))||[0,0];x(q,{x:ue,y:he})}:void 0,te=y?p.useCallback((q,ue)=>{const he=b.getState().nodeLookup.get(ue).internals.userNode;y(q,he)},[]):void 0,ee=m??C["minimap.ariaLabel"];return l.jsx(Sl,{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*P: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:Me(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:l.jsxs("svg",{width:L,height:M,viewBox:`${U} ${B} ${K} ${Y}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":G,ref:j,onClick:re,children:[ee&&l.jsx("title",{id:G,children:ee}),l.jsx(zP,{onClick:te,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:i,nodeComponent:a}),l.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-O},${B-O}h${K+O*2}v${Y+O*2}h${-K-O*2}z
343
+ M${_.x},${_.y}h${_.width}v${_.height}h${-_.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}V0.displayName="MiniMap";p.memo(V0);const VP=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,BP={[ys.Line]:"right",[ys.Handle]:"bottom-right"};function UP({nodeId:e,position:t,variant:n=ys.Handle,className:r,style:s=void 0,children:o,color:i,minWidth:a=10,minHeight:u=10,maxWidth:c=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:x=!0,shouldResize:y,onResizeStart:w,onResize:N,onResizeEnd:m}){const v=w0(),g=typeof e=="string"?e:v,S=we(),b=p.useRef(null),j=n===ys.Handle,k=ie(p.useCallback(VP(j&&x),[j,x]),ve),_=p.useRef(null),I=t??BP[n];p.useEffect(()=>{if(!(!b.current||!g))return _.current||(_.current=n3({domNode:b.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:R,transform:T,snapGrid:A,snapToGrid:C,nodeOrigin:L,domNode:M}=S.getState();return{nodeLookup:R,transform:T,snapGrid:A,snapToGrid:C,nodeOrigin:L,paneDomNode:M}},onChange:(R,T)=>{const{triggerNodeChanges:A,nodeLookup:C,parentLookup:L,nodeOrigin:M}=S.getState(),D=[],E={x:R.x,y:R.y},P=C.get(g);if(P&&P.expandParent&&P.parentId){const z=P.origin??M,F=R.width??P.measured.width??0,O=R.height??P.measured.height??0,U={id:P.id,parentId:P.parentId,rect:{width:F,height:O,...Hy({x:R.x??P.position.x,y:R.y??P.position.y},{width:F,height:O},P.parentId,C,z)}},B=mf([U],C,L,M);D.push(...B),E.x=R.x?Math.max(z[0]*F,R.x):void 0,E.y=R.y?Math.max(z[1]*O,R.y):void 0}if(E.x!==void 0&&E.y!==void 0){const z={id:g,type:"position",position:{...E}};D.push(z)}if(R.width!==void 0&&R.height!==void 0){const F={id:g,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};D.push(F)}for(const z of T){const F={...z,type:"position"};D.push(F)}A(D)},onEnd:({width:R,height:T})=>{const A={id:g,type:"dimensions",resizing:!1,dimensions:{width:R,height:T}};S.getState().triggerNodeChanges([A])}})),_.current.update({controlPosition:I,boundaries:{minWidth:a,minHeight:u,maxWidth:c,maxHeight:h},keepAspectRatio:d,resizeDirection:f,onResizeStart:w,onResize:N,onResizeEnd:m,shouldResize:y}),()=>{var R;(R=_.current)==null||R.destroy()}},[I,a,u,c,h,d,w,N,m,y]);const $=I.split("-");return l.jsx("div",{className:Me(["react-flow__resize-control","nodrag",...$,n,r]),ref:b,style:{...s,scale:k,...i&&{[j?"backgroundColor":"borderColor"]:i}},children:o})}p.memo(UP);function WP(){const[e,t]=p.useState(()=>document.documentElement.classList.contains("dark"));return p.useEffect(()=>{const n=new MutationObserver(()=>t(document.documentElement.classList.contains("dark")));return n.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>n.disconnect()},[]),e}function KP(){const[e,t]=p.useState([]),[n,r]=p.useState([]),[s,o]=p.useState(!0),i=WP();p.useEffect(()=>{Promise.all([oe.discovery.agents(),oe.observations.permissions()]).then(([c,h])=>{t(c.data??[]),r(h.data??[]),o(!1)}).catch(()=>o(!1))},[]);const{nodes:a,edges:u}=p.useMemo(()=>{const c=[],h=[],d=new Set,f=new Map,x=i?{background:"#18181b",color:"#fafafa",border:"1px solid #3f3f46"}:{background:"#ffffff",color:"#09090b",border:"1px solid #e4e4e7"},y=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((m,v)=>{const g=`agent-${m.id}`;m.registeredAgentId&&f.set(m.registeredAgentId,g),f.set(m.id,g),c.push({id:g,position:{x:100,y:v*120},data:{label:`${m.emoji||"🤖"} ${m.name}`},style:{...x,borderRadius:"8px",padding:"8px 16px",fontSize:"13px"}})}),n.forEach(m=>{const v=`tool-${m.toolName}`;d.has(m.toolName)||(d.add(m.toolName),c.push({id:v,position:{x:400,y:d.size*80},data:{label:`🔧 ${m.toolName}`},style:{...y,borderRadius:"8px",padding:"6px 12px",fontSize:"12px"}}));const g=f.get(m.agentId)??`agent-${m.agentId}`;h.push({id:`e-${m.agentId}-${m.toolName}`,source:g,target:v,animated:m.accessPattern==="write",style:{stroke:m.accessPattern==="write"?"#eab308":w}})}),{nodes:c,edges:h,bgColor:N}},[e,n,i]);return s?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Identity Graph"}),l.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Agent-to-tool relationship visualization"})]}),l.jsx("div",{className:"h-[600px] rounded-lg border border-border bg-card",children:l.jsxs(xP,{nodes:a,edges:u,fitView:!0,proOptions:{hideAttribution:!0},children:[l.jsx(SP,{color:i?"#27272a":"#e4e4e7",gap:20}),l.jsx(PP,{})]})})]})}const xf=p.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:_e("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}));xf.displayName="Textarea";const qe=p.forwardRef(({className:e,...t},n)=>l.jsx("label",{ref:n,className:_e("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));qe.displayName="Label";function He(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 YP(e,t){const n=p.createContext(t);function r(o){const{children:i,...a}=o,u=p.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:u,children:i})}function s(o){const i=p.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 jl(e,t=[]){let n=[];function r(o,i){const a=p.createContext(i),u=n.length;n=[...n,i];function c(d){const{scope:f,children:x,...y}=d,w=(f==null?void 0:f[e][u])||a,N=p.useMemo(()=>y,Object.values(y));return l.jsx(w.Provider,{value:N,children:x})}function h(d,f){const x=(f==null?void 0:f[e][u])||a,y=p.useContext(x);if(y)return y;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=>p.createContext(i));return function(a){const u=(a==null?void 0:a[e])||o;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return s.scopeName=e,[r,GP(s,...t)]}function GP(...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((a,{useScope:u,scopeName:c})=>{const d=u(o)[`__scope${c}`];return{...a,...d}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function XP(e){const t=e+"CollectionProvider",[n,r]=jl(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=x=>{const{scope:y,children:w}=x,N=Bt.useRef(null),m=Bt.useRef(new Map).current;return l.jsx(s,{scope:y,itemMap:m,collectionRef:N,children:w})};i.displayName=t;const a=e+"CollectionSlot",u=Bt.forwardRef((x,y)=>{const{scope:w,children:N}=x,m=o(a,w),v=qt(y,m.collectionRef);return l.jsx(ds,{ref:v,children:N})});u.displayName=a;const c=e+"CollectionItemSlot",h="data-radix-collection-item",d=Bt.forwardRef((x,y)=>{const{scope:w,children:N,...m}=x,v=Bt.useRef(null),g=qt(y,v),S=o(c,w);return Bt.useEffect(()=>(S.itemMap.set(v,{ref:v,...m}),()=>void S.itemMap.delete(v))),l.jsx(ds,{[h]:"",ref:g,children:N})});d.displayName=c;function f(x){const y=o(e+"CollectionConsumer",x);return Bt.useCallback(()=>{const N=y.collectionRef.current;if(!N)return[];const m=Array.from(N.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((S,b)=>m.indexOf(S.ref.current)-m.indexOf(b.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:u,ItemSlot:d},f,r]}var Ua=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},QP=uw.useId||(()=>{}),qP=0;function ho(e){const[t,n]=p.useState(QP());return Ua(()=>{n(r=>r??String(qP++))},[e]),t?`radix-${t}`:""}var ZP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],et=ZP.reduce((e,t)=>{const n=p.forwardRef((r,s)=>{const{asChild:o,...i}=r,a=o?ds:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function JP(e,t){e&&ll.flushSync(()=>e.dispatchEvent(t))}function Gn(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function yf({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=e5({defaultProp:t,onChange:n}),o=e!==void 0,i=o?e:r,a=Gn(n),u=p.useCallback(c=>{if(o){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else s(c)},[o,e,s,a]);return[i,u]}function e5({defaultProp:e,onChange:t}){const n=p.useState(e),[r]=n,s=p.useRef(r),o=Gn(t);return p.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}var t5=p.createContext(void 0);function B0(e){const t=p.useContext(t5);return e||t||"ltr"}var xu="rovingFocusGroup.onEntryFocus",n5={bubbles:!1,cancelable:!0},Cl="RovingFocusGroup",[$c,U0,r5]=XP(Cl),[s5,W0]=jl(Cl,[r5]),[o5,i5]=s5(Cl),K0=p.forwardRef((e,t)=>l.jsx($c.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx($c.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(a5,{...e,ref:t})})}));K0.displayName=Cl;var a5=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:h=!1,...d}=e,f=p.useRef(null),x=qt(t,f),y=B0(o),[w=null,N]=yf({prop:i,defaultProp:a,onChange:u}),[m,v]=p.useState(!1),g=Gn(c),S=U0(n),b=p.useRef(!1),[j,k]=p.useState(0);return p.useEffect(()=>{const _=f.current;if(_)return _.addEventListener(xu,g),()=>_.removeEventListener(xu,g)},[g]),l.jsx(o5,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:w,onItemFocus:p.useCallback(_=>N(_),[N]),onItemShiftTab:p.useCallback(()=>v(!0),[]),onFocusableItemAdd:p.useCallback(()=>k(_=>_+1),[]),onFocusableItemRemove:p.useCallback(()=>k(_=>_-1),[]),children:l.jsx(et.div,{tabIndex:m||j===0?-1:0,"data-orientation":r,...d,ref:x,style:{outline:"none",...e.style},onMouseDown:He(e.onMouseDown,()=>{b.current=!0}),onFocus:He(e.onFocus,_=>{const I=!b.current;if(_.target===_.currentTarget&&I&&!m){const $=new CustomEvent(xu,n5);if(_.currentTarget.dispatchEvent($),!$.defaultPrevented){const R=S().filter(M=>M.focusable),T=R.find(M=>M.active),A=R.find(M=>M.id===w),L=[T,A,...R].filter(Boolean).map(M=>M.ref.current);X0(L,h)}}b.current=!1}),onBlur:He(e.onBlur,()=>v(!1))})})}),Y0="RovingFocusGroupItem",G0=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,...i}=e,a=ho(),u=o||a,c=i5(Y0,n),h=c.currentTabStopId===u,d=U0(n),{onFocusableItemAdd:f,onFocusableItemRemove:x}=c;return p.useEffect(()=>{if(r)return f(),()=>x()},[r,f,x]),l.jsx($c.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:l.jsx(et.span,{tabIndex:h?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:He(e.onMouseDown,y=>{r?c.onItemFocus(u):y.preventDefault()}),onFocus:He(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:He(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const w=c5(y,c.orientation,c.dir);if(w!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let m=d().filter(v=>v.focusable).map(v=>v.ref.current);if(w==="last")m.reverse();else if(w==="prev"||w==="next"){w==="prev"&&m.reverse();const v=m.indexOf(y.currentTarget);m=c.loop?d5(m,v+1):m.slice(v+1)}setTimeout(()=>X0(m))}})})})});G0.displayName=Y0;var l5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function u5(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function c5(e,t,n){const r=u5(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return l5[r]}function X0(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function d5(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var f5=K0,h5=G0;function m5(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var ei=e=>{const{present:t,children:n}=e,r=p5(t),s=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),o=qt(r.ref,g5(s));return typeof n=="function"||r.isPresent?p.cloneElement(s,{ref:o}):null};ei.displayName="Presence";function p5(e){const[t,n]=p.useState(),r=p.useRef({}),s=p.useRef(e),o=p.useRef("none"),i=e?"mounted":"unmounted",[a,u]=m5(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const c=Ii(r.current);o.current=a==="mounted"?c:"none"},[a]),Ua(()=>{const c=r.current,h=s.current;if(h!==e){const f=o.current,x=Ii(c);e?u("MOUNT"):x==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(h&&f!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,u]),Ua(()=>{if(t){const c=d=>{const x=Ii(r.current).includes(d.animationName);d.target===t&&x&&ll.flushSync(()=>u("ANIMATION_END"))},h=d=>{d.target===t&&(o.current=Ii(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(a),ref:p.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Ii(e){return(e==null?void 0:e.animationName)||"none"}function g5(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 vf="Tabs",[x5]=jl(vf,[W0]),Q0=W0(),[y5,wf]=x5(vf),q0=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:a,activationMode:u="automatic",...c}=e,h=B0(a),[d,f]=yf({prop:r,onChange:s,defaultProp:o});return l.jsx(y5,{scope:n,baseId:ho(),value:d,onValueChange:f,orientation:i,dir:h,activationMode:u,children:l.jsx(et.div,{dir:h,"data-orientation":i,...c,ref:t})})});q0.displayName=vf;var Z0="TabsList",J0=p.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=wf(Z0,n),i=Q0(n);return l.jsx(f5,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:r,children:l.jsx(et.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});J0.displayName=Z0;var ev="TabsTrigger",tv=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,i=wf(ev,n),a=Q0(n),u=sv(i.baseId,r),c=ov(i.baseId,r),h=r===i.value;return l.jsx(h5,{asChild:!0,...a,focusable:!s,active:h,children:l.jsx(et.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:He(e.onMouseDown,d=>{!s&&d.button===0&&d.ctrlKey===!1?i.onValueChange(r):d.preventDefault()}),onKeyDown:He(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(r)}),onFocus:He(e.onFocus,()=>{const d=i.activationMode!=="manual";!h&&!s&&d&&i.onValueChange(r)})})})});tv.displayName=ev;var nv="TabsContent",rv=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...i}=e,a=wf(nv,n),u=sv(a.baseId,r),c=ov(a.baseId,r),h=r===a.value,d=p.useRef(h);return p.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),l.jsx(ei,{present:s||h,children:({present:f})=>l.jsx(et.div,{"data-state":h?"active":"inactive","data-orientation":a.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})})});rv.displayName=nv;function sv(e,t){return`${e}-trigger-${t}`}function ov(e,t){return`${e}-content-${t}`}var v5=q0,iv=J0,av=tv,lv=rv;const Nf=v5,El=p.forwardRef(({className:e,...t},n)=>l.jsx(iv,{ref:n,className:_e("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));El.displayName=iv.displayName;const yt=p.forwardRef(({className:e,...t},n)=>l.jsx(av,{ref:n,className:_e("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}));yt.displayName=av.displayName;const vt=p.forwardRef(({className:e,...t},n)=>l.jsx(lv,{ref:n,className:_e("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));vt.displayName=lv.displayName;function w5(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e);p.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 N5="DismissableLayer",Oc="dismissableLayer.update",S5="dismissableLayer.pointerDownOutside",b5="dismissableLayer.focusOutside",ep,uv=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cv=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...u}=e,c=p.useContext(uv),[h,d]=p.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=p.useState({}),y=qt(t,k=>d(k)),w=Array.from(c.layers),[N]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),m=w.indexOf(N),v=h?w.indexOf(h):-1,g=c.layersWithOutsidePointerEventsDisabled.size>0,S=v>=m,b=C5(k=>{const _=k.target,I=[...c.branches].some($=>$.contains(_));!S||I||(s==null||s(k),i==null||i(k),k.defaultPrevented||a==null||a())},f),j=E5(k=>{const _=k.target;[...c.branches].some($=>$.contains(_))||(o==null||o(k),i==null||i(k),k.defaultPrevented||a==null||a())},f);return w5(k=>{v===c.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&a&&(k.preventDefault(),a()))},f),p.useEffect(()=>{if(h)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(ep=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),tp(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=ep)}},[h,f,n,c]),p.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),tp())},[h,c]),p.useEffect(()=>{const k=()=>x({});return document.addEventListener(Oc,k),()=>document.removeEventListener(Oc,k)},[]),l.jsx(et.div,{...u,ref:y,style:{pointerEvents:g?S?"auto":"none":void 0,...e.style},onFocusCapture:He(e.onFocusCapture,j.onFocusCapture),onBlurCapture:He(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:He(e.onPointerDownCapture,b.onPointerDownCapture)})});cv.displayName=N5;var k5="DismissableLayerBranch",j5=p.forwardRef((e,t)=>{const n=p.useContext(uv),r=p.useRef(null),s=qt(t,r);return p.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),l.jsx(et.div,{...e,ref:s})});j5.displayName=k5;function C5(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e),r=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let u=function(){dv(S5,n,c,{discrete:!0})};const c={originalEvent:a};a.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 E5(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e),r=p.useRef(!1);return p.useEffect(()=>{const s=o=>{o.target&&!r.current&&dv(b5,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 tp(){const e=new CustomEvent(Oc);document.dispatchEvent(e)}function dv(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?JP(s,o):s.dispatchEvent(o)}var yu="focusScope.autoFocusOnMount",vu="focusScope.autoFocusOnUnmount",np={bubbles:!1,cancelable:!0},_5="FocusScope",fv=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,u]=p.useState(null),c=Gn(s),h=Gn(o),d=p.useRef(null),f=qt(t,w=>u(w)),x=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let w=function(g){if(x.paused||!a)return;const S=g.target;a.contains(S)?d.current=S:Cn(d.current,{select:!0})},N=function(g){if(x.paused||!a)return;const S=g.relatedTarget;S!==null&&(a.contains(S)||Cn(d.current,{select:!0}))},m=function(g){if(document.activeElement===document.body)for(const b of g)b.removedNodes.length>0&&Cn(a)};document.addEventListener("focusin",w),document.addEventListener("focusout",N);const v=new MutationObserver(m);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",N),v.disconnect()}}},[r,a,x.paused]),p.useEffect(()=>{if(a){sp.add(x);const w=document.activeElement;if(!a.contains(w)){const m=new CustomEvent(yu,np);a.addEventListener(yu,c),a.dispatchEvent(m),m.defaultPrevented||(P5(L5(hv(a)),{select:!0}),document.activeElement===w&&Cn(a))}return()=>{a.removeEventListener(yu,c),setTimeout(()=>{const m=new CustomEvent(vu,np);a.addEventListener(vu,h),a.dispatchEvent(m),m.defaultPrevented||Cn(w??document.body,{select:!0}),a.removeEventListener(vu,h),sp.remove(x)},0)}}},[a,c,h,x]);const y=p.useCallback(w=>{if(!n&&!r||x.paused)return;const N=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,m=document.activeElement;if(N&&m){const v=w.currentTarget,[g,S]=M5(v);g&&S?!w.shiftKey&&m===S?(w.preventDefault(),n&&Cn(g,{select:!0})):w.shiftKey&&m===g&&(w.preventDefault(),n&&Cn(S,{select:!0})):m===v&&w.preventDefault()}},[n,r,x.paused]);return l.jsx(et.div,{tabIndex:-1,...i,ref:f,onKeyDown:y})});fv.displayName=_5;function P5(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Cn(r,{select:t}),document.activeElement!==n)return}function M5(e){const t=hv(e),n=rp(t,e),r=rp(t.reverse(),e);return[n,r]}function hv(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 rp(e,t){for(const n of e)if(!I5(n,{upTo:t}))return n}function I5(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 R5(e){return e instanceof HTMLInputElement&&"select"in e}function Cn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&R5(e)&&t&&e.select()}}var sp=T5();function T5(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=op(e,t),e.unshift(t)},remove(t){var n;e=op(e,t),(n=e[0])==null||n.resume()}}}function op(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function L5(e){return e.filter(t=>t.tagName!=="A")}var A5="Portal",mv=p.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,o]=p.useState(!1);Ua(()=>o(!0),[]);const i=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?wN.createPortal(l.jsx(et.div,{...r,ref:t}),i):null});mv.displayName=A5;var wu=0;function z5(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ip()),document.body.insertAdjacentElement("beforeend",e[1]??ip()),wu++,()=>{wu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),wu--}},[])}function ip(){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 Kt=function(){return Kt=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},Kt.apply(this,arguments)};function pv(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 D5(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 na="right-scroll-bar-position",ra="width-before-scroll-bar",$5="with-scroll-bars-hidden",O5="--removed-body-scroll-bar-size";function Nu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function F5(e,t){var n=p.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 H5=typeof window<"u"?p.useLayoutEffect:p.useEffect,ap=new WeakMap;function V5(e,t){var n=F5(null,function(r){return e.forEach(function(s){return Nu(s,r)})});return H5(function(){var r=ap.get(n);if(r){var s=new Set(r),o=new Set(e),i=n.current;s.forEach(function(a){o.has(a)||Nu(a,null)}),o.forEach(function(a){s.has(a)||Nu(a,i)})}ap.set(n,e)},[e]),n}function B5(e){return e}function U5(e,t){t===void 0&&(t=B5);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(a){return a!==i})}},assignSyncMedium:function(o){for(r=!0;n.length;){var i=n;n=[],i.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var i=[];if(n.length){var a=n;n=[],a.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 W5(e){e===void 0&&(e={});var t=U5(null);return t.options=Kt({async:!0,ssr:!1},e),t}var gv=function(e){var t=e.sideCar,n=pv(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 p.createElement(r,Kt({},n))};gv.isSideCarExport=!0;function K5(e,t){return e.useMedium(t),gv}var xv=W5(),Su=function(){},_l=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:Su,onWheelCapture:Su,onTouchMoveCapture:Su}),s=r[0],o=r[1],i=e.forwardProps,a=e.children,u=e.className,c=e.removeScrollBar,h=e.enabled,d=e.shards,f=e.sideCar,x=e.noIsolation,y=e.inert,w=e.allowPinchZoom,N=e.as,m=N===void 0?"div":N,v=e.gapMode,g=pv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,b=V5([n,t]),j=Kt(Kt({},g),s);return p.createElement(p.Fragment,null,h&&p.createElement(S,{sideCar:xv,removeScrollBar:c,shards:d,noIsolation:x,inert:y,setCallbacks:o,allowPinchZoom:!!w,lockRef:n,gapMode:v}),i?p.cloneElement(p.Children.only(a),Kt(Kt({},j),{ref:b})):p.createElement(m,Kt({},j,{className:u,ref:b}),a))});_l.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_l.classNames={fullWidth:ra,zeroRight:na};var Y5=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function G5(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Y5();return t&&e.setAttribute("nonce",t),e}function X5(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Q5(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var q5=function(){var e=0,t=null;return{add:function(n){e==0&&(t=G5())&&(X5(t,n),Q5(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Z5=function(){var e=q5();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},yv=function(){var e=Z5(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},J5={left:0,top:0,right:0,gap:0},bu=function(e){return parseInt(e||"",10)||0},eM=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[bu(n),bu(r),bu(s)]},tM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return J5;var t=eM(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])}},nM=yv(),ts="data-scroll-locked",rM=function(e,t,n,r){var s=e.left,o=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
344
+ .`.concat($5,` {
345
+ overflow: hidden `).concat(r,`;
346
+ padding-right: `).concat(a,"px ").concat(r,`;
347
+ }
348
+ body[`).concat(ts,`] {
349
+ overflow: hidden `).concat(r,`;
350
+ overscroll-behavior: contain;
351
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
352
+ padding-left: `.concat(s,`px;
353
+ padding-top: `).concat(o,`px;
354
+ padding-right: `).concat(i,`px;
355
+ margin-left:0;
356
+ margin-top:0;
357
+ margin-right: `).concat(a,"px ").concat(r,`;
358
+ `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
359
+ }
360
+
361
+ .`).concat(na,` {
362
+ right: `).concat(a,"px ").concat(r,`;
363
+ }
364
+
365
+ .`).concat(ra,` {
366
+ margin-right: `).concat(a,"px ").concat(r,`;
367
+ }
368
+
369
+ .`).concat(na," .").concat(na,` {
370
+ right: 0 `).concat(r,`;
371
+ }
372
+
373
+ .`).concat(ra," .").concat(ra,` {
374
+ margin-right: 0 `).concat(r,`;
375
+ }
376
+
377
+ body[`).concat(ts,`] {
378
+ `).concat(O5,": ").concat(a,`px;
379
+ }
380
+ `)},lp=function(){var e=parseInt(document.body.getAttribute(ts)||"0",10);return isFinite(e)?e:0},sM=function(){p.useEffect(function(){return document.body.setAttribute(ts,(lp()+1).toString()),function(){var e=lp()-1;e<=0?document.body.removeAttribute(ts):document.body.setAttribute(ts,e.toString())}},[])},oM=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;sM();var o=p.useMemo(function(){return tM(s)},[s]);return p.createElement(nM,{styles:rM(o,!t,s,n?"":"!important")})},Fc=!1;if(typeof window<"u")try{var Ri=Object.defineProperty({},"passive",{get:function(){return Fc=!0,!0}});window.addEventListener("test",Ri,Ri),window.removeEventListener("test",Ri,Ri)}catch{Fc=!1}var Mr=Fc?{passive:!1}:!1,iM=function(e){return e.tagName==="TEXTAREA"},vv=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!iM(e)&&n[t]==="visible")},aM=function(e){return vv(e,"overflowY")},lM=function(e){return vv(e,"overflowX")},up=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=wv(e,r);if(s){var o=Nv(e,r),i=o[1],a=o[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},uM=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},cM=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},wv=function(e,t){return e==="v"?aM(t):lM(t)},Nv=function(e,t){return e==="v"?uM(t):cM(t)},dM=function(e,t){return e==="h"&&t==="rtl"?-1:1},fM=function(e,t,n,r,s){var o=dM(e,window.getComputedStyle(t).direction),i=o*r,a=n.target,u=t.contains(a),c=!1,h=i>0,d=0,f=0;do{var x=Nv(e,a),y=x[0],w=x[1],N=x[2],m=w-N-o*y;(y||m)&&wv(e,a)&&(d+=m,f+=y),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return(h&&Math.abs(d)<1||!h&&Math.abs(f)<1)&&(c=!0),c},Ti=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cp=function(e){return[e.deltaX,e.deltaY]},dp=function(e){return e&&"current"in e?e.current:e},hM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mM=function(e){return`
381
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
382
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
383
+ `)},pM=0,Ir=[];function gM(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),s=p.useState(pM++)[0],o=p.useState(yv)[0],i=p.useRef(e);p.useEffect(function(){i.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=D5([e.lockRef.current],(e.shards||[]).map(dp),!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 a=p.useCallback(function(w,N){if("touches"in w&&w.touches.length===2)return!i.current.allowPinchZoom;var m=Ti(w),v=n.current,g="deltaX"in w?w.deltaX:v[0]-m[0],S="deltaY"in w?w.deltaY:v[1]-m[1],b,j=w.target,k=Math.abs(g)>Math.abs(S)?"h":"v";if("touches"in w&&k==="h"&&j.type==="range")return!1;var _=up(k,j);if(!_)return!0;if(_?b=k:(b=k==="v"?"h":"v",_=up(k,j)),!_)return!1;if(!r.current&&"changedTouches"in w&&(g||S)&&(r.current=b),!b)return!0;var I=r.current||b;return fM(I,N,w,I==="h"?g:S)},[]),u=p.useCallback(function(w){var N=w;if(!(!Ir.length||Ir[Ir.length-1]!==o)){var m="deltaY"in N?cp(N):Ti(N),v=t.current.filter(function(b){return b.name===N.type&&(b.target===N.target||N.target===b.shadowParent)&&hM(b.delta,m)})[0];if(v&&v.should){N.cancelable&&N.preventDefault();return}if(!v){var g=(i.current.shards||[]).map(dp).filter(Boolean).filter(function(b){return b.contains(N.target)}),S=g.length>0?a(N,g[0]):!i.current.noIsolation;S&&N.cancelable&&N.preventDefault()}}},[]),c=p.useCallback(function(w,N,m,v){var g={name:w,delta:N,target:m,should:v,shadowParent:xM(m)};t.current.push(g),setTimeout(function(){t.current=t.current.filter(function(S){return S!==g})},1)},[]),h=p.useCallback(function(w){n.current=Ti(w),r.current=void 0},[]),d=p.useCallback(function(w){c(w.type,cp(w),w.target,a(w,e.lockRef.current))},[]),f=p.useCallback(function(w){c(w.type,Ti(w),w.target,a(w,e.lockRef.current))},[]);p.useEffect(function(){return Ir.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",u,Mr),document.addEventListener("touchmove",u,Mr),document.addEventListener("touchstart",h,Mr),function(){Ir=Ir.filter(function(w){return w!==o}),document.removeEventListener("wheel",u,Mr),document.removeEventListener("touchmove",u,Mr),document.removeEventListener("touchstart",h,Mr)}},[]);var x=e.removeScrollBar,y=e.inert;return p.createElement(p.Fragment,null,y?p.createElement(o,{styles:mM(s)}):null,x?p.createElement(oM,{gapMode:e.gapMode}):null)}function xM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const yM=K5(xv,gM);var Sv=p.forwardRef(function(e,t){return p.createElement(_l,Kt({},e,{ref:t,sideCar:yM}))});Sv.classNames=_l.classNames;var vM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rr=new WeakMap,Li=new WeakMap,Ai={},ku=0,bv=function(e){return e&&(e.host||bv(e.parentNode))},wM=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=bv(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})},NM=function(e,t,n,r){var s=wM(t,Array.isArray(e)?e:[e]);Ai[n]||(Ai[n]=new WeakMap);var o=Ai[n],i=[],a=new Set,u=new Set(s),c=function(d){!d||a.has(d)||(a.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(a.has(f))h(f);else try{var x=f.getAttribute(r),y=x!==null&&x!=="false",w=(Rr.get(f)||0)+1,N=(o.get(f)||0)+1;Rr.set(f,w),o.set(f,N),i.push(f),w===1&&y&&Li.set(f,!0),N===1&&f.setAttribute(n,"true"),y||f.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",f,m)}})};return h(t),a.clear(),ku++,function(){i.forEach(function(d){var f=Rr.get(d)-1,x=o.get(d)-1;Rr.set(d,f),o.set(d,x),f||(Li.has(d)||d.removeAttribute(r),Li.delete(d)),x||d.removeAttribute(n)}),ku--,ku||(Rr=new WeakMap,Rr=new WeakMap,Li=new WeakMap,Ai={})}},SM=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=vM(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),NM(r,s,n,"aria-hidden")):function(){return null}},Sf="Dialog",[kv]=jl(Sf),[bM,Ft]=kv(Sf),jv=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,a=p.useRef(null),u=p.useRef(null),[c=!1,h]=yf({prop:r,defaultProp:s,onChange:o});return l.jsx(bM,{scope:t,triggerRef:a,contentRef:u,contentId:ho(),titleId:ho(),descriptionId:ho(),open:c,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(d=>!d),[h]),modal:i,children:n})};jv.displayName=Sf;var Cv="DialogTrigger",kM=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(Cv,n),o=qt(t,s.triggerRef);return l.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":jf(s.open),...r,ref:o,onClick:He(e.onClick,s.onOpenToggle)})});kM.displayName=Cv;var bf="DialogPortal",[jM,Ev]=kv(bf,{forceMount:void 0}),_v=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Ft(bf,t);return l.jsx(jM,{scope:t,forceMount:n,children:p.Children.map(r,i=>l.jsx(ei,{present:n||o.open,children:l.jsx(mv,{asChild:!0,container:s,children:i})}))})};_v.displayName=bf;var Wa="DialogOverlay",Pv=p.forwardRef((e,t)=>{const n=Ev(Wa,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ft(Wa,e.__scopeDialog);return o.modal?l.jsx(ei,{present:r||o.open,children:l.jsx(CM,{...s,ref:t})}):null});Pv.displayName=Wa;var CM=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(Wa,n);return l.jsx(Sv,{as:ds,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(et.div,{"data-state":jf(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Nr="DialogContent",Mv=p.forwardRef((e,t)=>{const n=Ev(Nr,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ft(Nr,e.__scopeDialog);return l.jsx(ei,{present:r||o.open,children:o.modal?l.jsx(EM,{...s,ref:t}):l.jsx(_M,{...s,ref:t})})});Mv.displayName=Nr;var EM=p.forwardRef((e,t)=>{const n=Ft(Nr,e.__scopeDialog),r=p.useRef(null),s=qt(t,n.contentRef,r);return p.useEffect(()=>{const o=r.current;if(o)return SM(o)},[]),l.jsx(Iv,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:He(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:He(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:He(e.onFocusOutside,o=>o.preventDefault())})}),_M=p.forwardRef((e,t)=>{const n=Ft(Nr,e.__scopeDialog),r=p.useRef(!1),s=p.useRef(!1);return l.jsx(Iv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.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()}})}),Iv=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,a=Ft(Nr,n),u=p.useRef(null),c=qt(t,u);return z5(),l.jsxs(l.Fragment,{children:[l.jsx(fv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(cv,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":jf(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(PM,{titleId:a.titleId}),l.jsx(IM,{contentRef:u,descriptionId:a.descriptionId})]})]})}),kf="DialogTitle",Rv=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(kf,n);return l.jsx(et.h2,{id:s.titleId,...r,ref:t})});Rv.displayName=kf;var Tv="DialogDescription",Lv=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(Tv,n);return l.jsx(et.p,{id:s.descriptionId,...r,ref:t})});Lv.displayName=Tv;var Av="DialogClose",zv=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(Av,n);return l.jsx(et.button,{type:"button",...r,ref:t,onClick:He(e.onClick,()=>s.onOpenChange(!1))})});zv.displayName=Av;function jf(e){return e?"open":"closed"}var Dv="DialogTitleWarning",[xI,$v]=YP(Dv,{contentName:Nr,titleName:kf,docsSlug:"dialog"}),PM=({titleId:e})=>{const t=$v(Dv),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
384
+
385
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
386
+
387
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},MM="DialogDescriptionWarning",IM=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$v(MM).contentName}}.`;return p.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},RM=jv,TM=_v,Ov=Pv,Fv=Mv,Hv=Rv,Vv=Lv,LM=zv;const _s=RM,AM=TM,Bv=p.forwardRef(({className:e,...t},n)=>l.jsx(Ov,{ref:n,className:_e("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}));Bv.displayName=Ov.displayName;const kr=p.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(AM,{children:[l.jsx(Bv,{}),l.jsxs(Fv,{ref:r,className:_e("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,l.jsxs(LM,{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:[l.jsx(ek,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));kr.displayName=Fv.displayName;const Ps=({className:e,...t})=>l.jsx("div",{className:_e("flex flex-col space-y-1.5 text-center sm:text-left",e),...t}),Ms=({className:e,...t})=>l.jsx("div",{className:_e("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t}),jr=p.forwardRef(({className:e,...t},n)=>l.jsx(Hv,{ref:n,className:_e("text-lg font-semibold leading-none tracking-tight",e),...t}));jr.displayName=Hv.displayName;const Cr=p.forwardRef(({className:e,...t},n)=>l.jsx(Vv,{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));Cr.displayName=Vv.displayName;function zM({message:e,type:t,onClose:n}){return p.useEffect(()=>{const r=setTimeout(n,4e3);return()=>clearTimeout(r)},[n]),l.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"?l.jsx(gr,{className:"h-4 w-4"}):l.jsx(Dt,{className:"h-4 w-4"}),l.jsx("span",{className:"text-sm",children:e}),l.jsx("button",{onClick:n,className:"ml-2 text-current/50 hover:text-current",children:"×"})]})}function DM(){const[e,t]=p.useState([]),[n,r]=p.useState(""),[s,o]=p.useState(!0),[i,a]=p.useState("skills"),[u,c]=p.useState(null),h=p.useRef(null),d=p.useCallback((y,w="success")=>{c({message:y,type:w})},[]),f=p.useCallback(()=>{d("Command sent to host"),a("commands"),setTimeout(()=>{var y;return(y=h.current)==null?void 0:y.call(h)},300)},[d]),x=p.useCallback(y=>{const w=y instanceof Error?y.message:"Failed to send command";d(w,"error")},[d]);return p.useEffect(()=>{oe.hosts.list().then(y=>{const w=(y.data??[]).filter(N=>N.status==="online");t(w),w.length>0&&!n&&r(w[0].id)}).catch(()=>{}).finally(()=>o(!1))},[]),s?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading hosts..."}):e.length===0?l.jsxs("div",{className:"space-y-6",children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Operations"}),l.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[l.jsx(Kd,{className:"h-10 w-10 text-muted-foreground/30"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No hosts connected"}),l.jsxs("p",{className:"text-xs text-muted-foreground/70",children:["Run ",l.jsx("code",{className:"rounded bg-muted px-1",children:"opentrust connect --dashboard-url ... --api-key ..."})," on a host"]})]})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Operations"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-muted-foreground",children:"Host:"}),l.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:y=>r(y.target.value),children:e.map(y=>l.jsxs("option",{value:y.id,children:[y.hostname," (",y.ip||"local",")"]},y.id))})]})]}),n&&l.jsxs(Nf,{value:i,onValueChange:a,className:"w-full",children:[l.jsxs(El,{children:[l.jsxs(yt,{value:"skills",children:[l.jsx(Pa,{className:"mr-1.5 h-3.5 w-3.5"})," Skills"]}),l.jsxs(yt,{value:"commands",children:[l.jsx(cs,{className:"mr-1.5 h-3.5 w-3.5"})," Commands"]}),l.jsxs(yt,{value:"config",children:[l.jsx(Qt,{className:"mr-1.5 h-3.5 w-3.5"})," Config"]})]}),l.jsx(vt,{value:"skills",children:l.jsx($M,{hostId:n,onCommandSent:f,onCommandError:x})}),l.jsx(vt,{value:"commands",children:l.jsx(OM,{hostId:n,refreshRef:h})}),l.jsx(vt,{value:"config",children:l.jsx(FM,{hostId:n,onCommandSent:f,onCommandError:x})})]}),u&&l.jsx(zM,{message:u.message,type:u.type,onClose:()=>c(null)})]})}function $M({hostId:e,onCommandSent:t,onCommandError:n}){const[r,s]=p.useState(!1),[o,i]=p.useState(null);return l.jsxs("div",{className:"space-y-4 pt-4",children:[l.jsx("div",{className:"flex gap-2",children:l.jsxs(J,{size:"sm",onClick:()=>s(!0),children:[l.jsx(Kn,{className:"mr-1.5 h-3.5 w-3.5"})," Install Skill"]})}),l.jsxs(Ee,{children:[l.jsx($e,{children:l.jsx(Oe,{className:"text-sm",children:"How Skills Work"})}),l.jsxs(Te,{className:"text-xs text-muted-foreground space-y-2",children:[l.jsxs("p",{children:["Skills are ",l.jsx("a",{href:"https://agentskills.io",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"AgentSkills"}),"-compatible folders containing a ",l.jsx("code",{className:"rounded bg-muted px-1",children:"SKILL.md"})," with YAML frontmatter and instructions."]}),l.jsx("p",{children:"Skills are loaded from three locations (highest to lowest precedence):"}),l.jsxs("ol",{className:"list-inside list-decimal space-y-0.5 pl-2",children:[l.jsxs("li",{children:[l.jsx("code",{className:"rounded bg-muted px-1",children:"<workspace>/skills"})," — per-agent workspace skills"]}),l.jsxs("li",{children:[l.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/workspace/skills"})," — shared managed skills"]}),l.jsx("li",{children:"Bundled skills — shipped with the OpenClaw install"})]}),l.jsxs("p",{children:["Browse and discover skills at ",l.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 ",l.jsx("code",{className:"rounded bg-muted px-1",children:"clawhub install <slug>"}),"."]})]})]}),l.jsx(HM,{open:r,onOpenChange:s,hostId:e,onSuccess:t,onError:n}),l.jsx(VM,{open:o!==null,onOpenChange:a=>{a||i(null)},hostId:e,initialName:o??"",onSuccess:t,onError:n})]})}function OM({hostId:e,refreshRef:t}){const[n,r]=p.useState([]),[s,o]=p.useState(!0),[i,a]=p.useState(null),u=p.useCallback(()=>{oe.hosts.commands(e).then(f=>r(f.data??[])).catch(()=>{}).finally(()=>o(!1))},[e]);p.useEffect(()=>(t&&(t.current=u),()=>{t&&(t.current=null)}),[u,t]),p.useEffect(()=>{u()},[u]),p.useEffect(()=>{if(!n.some(y=>y.status==="pending"||y.status==="running"))return;const x=setInterval(u,5e3);return()=>clearInterval(x)},[n,u]);const c=f=>f==="completed"?l.jsx(gr,{className:"h-3.5 w-3.5 text-emerald-500"}):f==="failed"?l.jsx(Dt,{className:"h-3.5 w-3.5 text-destructive"}):f==="running"?l.jsx(dt,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):l.jsx(Kx,{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:l.jsx(Kn,{className:"h-3 w-3"}),label:"Install Skill"},install_custom_skill:{icon:l.jsx(Es,{className:"h-3 w-3"}),label:"Custom Skill"},uninstall_skill:{icon:l.jsx(pn,{className:"h-3 w-3"}),label:"Uninstall Skill"},install_plugin:{icon:l.jsx(Kn,{className:"h-3 w-3"}),label:"Install Plugin"},uninstall_plugin:{icon:l.jsx(pn,{className:"h-3 w-3"}),label:"Uninstall Plugin"},update_config:{icon:l.jsx(Qt,{className:"h-3 w-3"}),label:"Update Config"}})[f]??{icon:l.jsx(cs,{className:"h-3 w-3"}),label:f};return s?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-4 pt-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Command history for this host"}),l.jsxs(J,{size:"sm",variant:"ghost",onClick:u,children:[l.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]}),n.length===0?l.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[l.jsx(cs,{className:"h-8 w-8 text-muted-foreground/30"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No commands sent yet"})]}):l.jsx("div",{className:"space-y-2",children:n.map(f=>{var N,m,v;const x=d(f.type),y=i===f.id,w=f.result||f.type==="install_custom_skill"&&((N=f.payload)==null?void 0:N.content);return l.jsxs("div",{className:"rounded-lg border border-border transition-colors hover:bg-muted/20",children:[l.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-4 py-3",onClick:()=>w&&a(y?null:f.id),children:[c(f.status),l.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[x.icon," ",l.jsx("span",{children:x.label})]}),l.jsxs("span",{className:"text-xs text-muted-foreground",children:[((m=f.payload)==null?void 0:m.skillName)&&`"${f.payload.skillName}"`,f.type==="update_config"&&f.payload&&!f.payload.skillName&&Object.keys(f.payload).join(", ")]}),l.jsx("div",{className:"flex-1"}),l.jsx(je,{variant:h(f.status),className:"text-[10px]",children:f.status}),l.jsx("span",{className:"text-[11px] text-muted-foreground",children:UM(f.createdAt)}),w&&(y?l.jsx(dl,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx(Yd,{className:"h-3.5 w-3.5 text-muted-foreground"}))]}),y&&w&&l.jsxs("div",{className:"border-t border-border bg-muted/30 px-4 py-3 text-xs",children:[f.result&&l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"font-medium text-muted-foreground",children:"Result"}),l.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)&&l.jsxs("div",{className:"mt-2 space-y-1",children:[l.jsx("p",{className:"font-medium text-muted-foreground",children:"Skill Content"}),l.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 FM({hostId:e,onCommandSent:t,onCommandError:n}){const[r,s]=p.useState(!1);return l.jsxs("div",{className:"space-y-4 pt-4",children:[l.jsxs(Ee,{children:[l.jsx($e,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(Oe,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Qt,{className:"h-4 w-4"})," Guards Configuration"]}),l.jsxs(J,{size:"sm",variant:"outline",onClick:()=>s(!0),children:[l.jsx(Qt,{className:"mr-1.5 h-3.5 w-3.5"})," Update Config"]})]})}),l.jsxs(Te,{className:"text-xs text-muted-foreground space-y-3",children:[l.jsxs("p",{children:["Send configuration updates to the Guards plugin on the host. The CLI updates ",l.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/openclaw.json"})," on the target machine."]}),l.jsxs("div",{className:"rounded-md bg-muted p-3 space-y-1.5",children:[l.jsx("p",{className:"font-medium text-foreground text-xs",children:"Available settings:"}),l.jsxs("div",{className:"grid gap-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"blockOnRisk"}),l.jsx("span",{children:"Block tool calls when risk is detected"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"logLevel"}),l.jsx("span",{children:"Logging verbosity (debug, info, warn, error)"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"timeoutMs"}),l.jsx("span",{children:"Request timeout in milliseconds"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"enabled"}),l.jsx("span",{children:"Enable/disable the Guards plugin"})]})]})]})]})]}),l.jsx(BM,{open:r,onOpenChange:s,hostId:e,onSuccess:t,onError:n})]})}function HM({open:e,onOpenChange:t,hostId:n,onSuccess:r,onError:s}){const[o,i]=p.useState("registry"),[a,u]=p.useState(""),[c,h]=p.useState(""),[d,f]=p.useState(!1),[x,y]=p.useState(""),w=()=>{u(""),h(""),i("registry"),y("")},N=async()=>{if(!(o==="registry"&&!a.trim())&&!(o==="custom"&&(!a.trim()||!c.trim()))){f(!0),y("");try{o==="registry"?await oe.hosts.sendCommand(n,"install_skill",{skillName:a.trim()}):await oe.hosts.sendCommand(n,"install_custom_skill",{skillName:a.trim(),content:c}),w(),t(!1),r==null||r()}catch(m){const v=m instanceof Error?m.message:"Failed to send command";y(v),s==null||s(m)}finally{f(!1)}}};return l.jsx(_s,{open:e,onOpenChange:m=>{m||w(),t(m)},children:l.jsxs(kr,{className:"sm:max-w-[560px]",children:[l.jsxs(Ps,{children:[l.jsxs(jr,{className:"flex items-center gap-2",children:[l.jsx(Kn,{className:"h-4 w-4"})," Install Skill"]}),l.jsxs(Cr,{children:["Install from ",l.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."]})]}),l.jsxs(Nf,{value:o,onValueChange:m=>{i(m),y("")},children:[l.jsxs(El,{className:"w-full",children:[l.jsxs(yt,{value:"registry",className:"flex-1",children:[l.jsx(Pa,{className:"mr-1.5 h-3.5 w-3.5"})," ClawHub Registry"]}),l.jsxs(yt,{value:"custom",className:"flex-1",children:[l.jsx(Es,{className:"mr-1.5 h-3.5 w-3.5"})," Custom SKILL.md"]})]}),l.jsx(vt,{value:"registry",className:"space-y-4 pt-2",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"reg-skill-name",children:"Skill Slug"}),l.jsx(ze,{id:"reg-skill-name",placeholder:"e.g. web-search, code-review, self-improving-agent...",value:a,onChange:m=>{u(m.target.value),y("")},onKeyDown:m=>m.key==="Enter"&&N()}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",l.jsx("code",{className:"rounded bg-muted px-1",children:"clawhub install <slug>"})," on the host via CLI. Browse available skills at ",l.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"clawhub.com"}),"."]})]})}),l.jsxs(vt,{value:"custom",className:"space-y-4 pt-2",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"custom-skill-name",children:"Skill Name"}),l.jsx(ze,{id:"custom-skill-name",placeholder:"my-custom-skill",value:a,onChange:m=>{u(m.target.value),y("")}})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"custom-skill-content",children:"SKILL.md Content"}),l.jsx(xf,{id:"custom-skill-content",placeholder:`---
388
+ name: my-custom-skill
389
+ description: My custom skill
390
+ ---
391
+
392
+ Instructions for the agent...
393
+
394
+ Use {baseDir} to reference the skill folder path.`,value:c,onChange:m=>{h(m.target.value),y("")},className:"min-h-[200px] font-mono text-xs"}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["The content will be saved as ",l.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/workspace/skills/<name>/SKILL.md"}),". Use YAML frontmatter with ",l.jsx("code",{className:"rounded bg-muted px-1",children:"name"})," and ",l.jsx("code",{className:"rounded bg-muted px-1",children:"description"})," fields."]})]})]})]}),x&&l.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:[l.jsx(Dt,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{children:x})]}),l.jsxs(Ms,{children:[l.jsx(J,{variant:"outline",onClick:()=>{w(),t(!1)},children:"Cancel"}),l.jsxs(J,{onClick:N,disabled:d||!a.trim()||o==="custom"&&!c.trim(),children:[d?l.jsx(dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(Kn,{className:"mr-1.5 h-3.5 w-3.5"}),"Install"]})]})]})})}function VM({open:e,onOpenChange:t,hostId:n,initialName:r,onSuccess:s,onError:o}){const[i,a]=p.useState(r??""),[u,c]=p.useState(!1),[h,d]=p.useState("");p.useEffect(()=>{r&&a(r)},[r]);const f=async()=>{if(i.trim()){c(!0),d("");try{await oe.hosts.sendCommand(n,"uninstall_skill",{skillName:i.trim()}),a(""),t(!1),s==null||s()}catch(x){const y=x instanceof Error?x.message:"Failed to send command";d(y),o==null||o(x)}finally{c(!1)}}};return l.jsx(_s,{open:e,onOpenChange:t,children:l.jsxs(kr,{className:"sm:max-w-[400px]",children:[l.jsxs(Ps,{children:[l.jsxs(jr,{className:"flex items-center gap-2",children:[l.jsx(pn,{className:"h-4 w-4"})," Uninstall Skill"]}),l.jsx(Cr,{children:"This will send a command to the host CLI to remove the skill."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"uninstall-name",children:"Skill Name"}),l.jsx(ze,{id:"uninstall-name",placeholder:"Skill name to uninstall...",value:i,onChange:x=>{a(x.target.value),d("")},onKeyDown:x=>x.key==="Enter"&&f()})]}),h&&l.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:[l.jsx(Dt,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{children:h})]}),l.jsxs(Ms,{children:[l.jsx(J,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),l.jsxs(J,{variant:"destructive",onClick:f,disabled:u||!i.trim(),children:[u?l.jsx(dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(pn,{className:"mr-1.5 h-3.5 w-3.5"}),"Uninstall"]})]})]})})}function BM({open:e,onOpenChange:t,hostId:n,onSuccess:r,onError:s}){const[o,i]=p.useState(`{
395
+ "blockOnRisk": false
396
+ }`),[a,u]=p.useState(""),[c,h]=p.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 oe.hosts.sendCommand(n,"update_config",f),t(!1),r==null||r()}catch(x){const y=x instanceof Error?x.message:"Failed to send command";u(y),s==null||s(x)}finally{h(!1)}};return l.jsx(_s,{open:e,onOpenChange:t,children:l.jsxs(kr,{className:"sm:max-w-[460px]",children:[l.jsxs(Ps,{children:[l.jsxs(jr,{className:"flex items-center gap-2",children:[l.jsx(Qt,{className:"h-4 w-4"})," Update Guards Config"]}),l.jsx(Cr,{children:"Values will be merged into the existing Guards plugin configuration."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"config-json",children:"Config JSON"}),l.jsx(xf,{id:"config-json",value:o,onChange:f=>{i(f.target.value),u("")},className:"min-h-[120px] font-mono text-xs"}),a&&l.jsx("p",{className:"text-xs text-destructive",children:a})]}),l.jsxs(Ms,{children:[l.jsx(J,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),l.jsxs(J,{onClick:d,disabled:c,children:[c?l.jsx(dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(Qt,{className:"mr-1.5 h-3.5 w-3.5"}),"Update"]})]})]})})}function UM(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 WM(){const[e,t]=p.useState([]),[n,r]=p.useState(""),[s,o]=p.useState(!0),[i,a]=p.useState(null),u=p.useCallback((c,h="success")=>{a({msg:c,type:h}),setTimeout(()=>a(null),4e3)},[]);return p.useEffect(()=>{oe.hosts.list().then(c=>{const h=(c.data??[]).filter(d=>d.status==="online");t(h),h.length>0&&!n&&r(h[0].id)}).catch(()=>{}).finally(()=>o(!1))},[]),s?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading hosts..."}):e.length===0?l.jsxs("div",{className:"space-y-6",children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Plugins"}),l.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[l.jsx(Gd,{className:"h-10 w-10 text-muted-foreground/30"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No hosts connected"}),l.jsxs("p",{className:"text-xs text-muted-foreground/70",children:["Run ",l.jsx("code",{className:"rounded bg-muted px-1",children:"opentrust connect --dashboard-url ... --api-key ..."})," on a host"]})]})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Plugins"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage OpenClaw plugins on remote hosts"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-muted-foreground",children:"Host:"}),l.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:c=>r(c.target.value),children:e.map(c=>l.jsxs("option",{value:c.id,children:[c.hostname," (",c.ip||"local",")"]},c.id))})]})]}),n&&l.jsxs(l.Fragment,{children:[l.jsx(KM,{hostId:n,showToast:u}),l.jsx(YM,{hostId:n}),l.jsx(GM,{})]}),i&&l.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 ${i.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:[i.type==="success"?l.jsx(gr,{className:"h-4 w-4"}):l.jsx(Dt,{className:"h-4 w-4"}),l.jsx("span",{className:"text-sm",children:i.msg}),l.jsx("button",{onClick:()=>a(null),className:"ml-2 text-current/50 hover:text-current",children:"×"})]})]})}function KM({hostId:e,showToast:t}){const[n,r]=p.useState(!1),[s,o]=p.useState(!1);return l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(J,{size:"sm",onClick:()=>r(!0),children:[l.jsx(Kn,{className:"mr-1.5 h-3.5 w-3.5"})," Install Plugin"]}),l.jsxs(J,{size:"sm",variant:"outline",onClick:()=>o(!0),children:[l.jsx(pn,{className:"mr-1.5 h-3.5 w-3.5"})," Uninstall Plugin"]}),l.jsx(XM,{open:n,onOpenChange:r,hostId:e,showToast:t}),l.jsx(QM,{open:s,onOpenChange:o,hostId:e,showToast:t})]})}function YM({hostId:e}){const[t,n]=p.useState([]),[r,s]=p.useState(!0),[o,i]=p.useState(null),a=p.useCallback(()=>{oe.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]);p.useEffect(()=>{a()},[a]),p.useEffect(()=>{if(!t.some(d=>d.status==="pending"||d.status==="running"))return;const h=setInterval(a,5e3);return()=>clearInterval(h)},[t,a]);const u=c=>c==="completed"?l.jsx(gr,{className:"h-3.5 w-3.5 text-emerald-500"}):c==="failed"?l.jsx(Dt,{className:"h-3.5 w-3.5 text-destructive"}):c==="running"?l.jsx(dt,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):l.jsx(Kx,{className:"h-3.5 w-3.5 text-muted-foreground"});return r||t.length===0?null:l.jsxs(Ee,{children:[l.jsx($e,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(Oe,{className:"flex items-center gap-2 text-sm",children:[l.jsx(cs,{className:"h-4 w-4"})," Plugin Command History"]}),l.jsxs(J,{size:"sm",variant:"ghost",onClick:a,children:[l.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]})}),l.jsx(Te,{className:"space-y-2",children:t.map(c=>{var x,y;const h=o===c.id,d=c.type==="install_plugin"?"Install Plugin":"Uninstall Plugin",f=((x=c.payload)==null?void 0:x.spec)||((y=c.payload)==null?void 0:y.pluginId)||"";return l.jsxs("div",{className:"rounded-lg border border-border transition-colors hover:bg-muted/20",children:[l.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),l.jsx("span",{className:"text-xs font-medium",children:d}),f&&l.jsxs("span",{className:"text-xs text-muted-foreground",children:['"',f,'"']}),l.jsx("div",{className:"flex-1"}),l.jsx(je,{variant:c.status==="completed"?"default":c.status==="failed"?"destructive":"secondary",className:"text-[10px]",children:c.status}),l.jsx("span",{className:"text-[11px] text-muted-foreground",children:qM(c.createdAt)}),c.result&&(h?l.jsx(dl,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx(Yd,{className:"h-3.5 w-3.5 text-muted-foreground"}))]}),h&&c.result&&l.jsx("div",{className:"border-t border-border bg-muted/30 px-4 py-3",children:l.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 GM(){return l.jsxs(Ee,{children:[l.jsx($e,{children:l.jsx(Oe,{className:"text-sm",children:"How Plugins Work"})}),l.jsxs(Te,{className:"text-xs text-muted-foreground space-y-2",children:[l.jsx("p",{children:"OpenClaw plugins extend agent capabilities. They can be installed from npm or local paths."}),l.jsx("p",{children:"Common plugin specs:"}),l.jsxs("ul",{className:"list-inside list-disc space-y-0.5 pl-2",children:[l.jsxs("li",{children:[l.jsx("code",{className:"rounded bg-muted px-1",children:"@openclaw/voice-call"})," — Voice calling plugin"]}),l.jsxs("li",{children:[l.jsx("code",{className:"rounded bg-muted px-1",children:"@opentrust/guards"})," — Security guard plugin"]}),l.jsxs("li",{children:[l.jsx("code",{className:"rounded bg-muted px-1",children:"/path/to/plugin"})," — Local plugin path"]})]}),l.jsxs("p",{children:["Commands are sent to the host CLI which executes ",l.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins install/uninstall"}),". See ",l.jsx("a",{href:"https://docs.openclaw.ai/cli/plugins",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"OpenClaw Plugins docs"}),"."]})]})]})}function XM({open:e,onOpenChange:t,hostId:n,showToast:r}){const[s,o]=p.useState(""),[i,a]=p.useState(!1),[u,c]=p.useState(""),h=()=>{o(""),c("")},d=async()=>{if(s.trim()){a(!0),c("");try{await oe.hosts.sendCommand(n,"install_plugin",{spec:s.trim()}),h(),t(!1),r("Plugin install command sent","success")}catch(f){const x=f instanceof Error?f.message:"Failed to send command";c(x)}finally{a(!1)}}};return l.jsx(_s,{open:e,onOpenChange:f=>{f||h(),t(f)},children:l.jsxs(kr,{className:"sm:max-w-[480px]",children:[l.jsxs(Ps,{children:[l.jsxs(jr,{className:"flex items-center gap-2",children:[l.jsx(Kn,{className:"h-4 w-4"})," Install Plugin"]}),l.jsx(Cr,{children:"Install an OpenClaw plugin via npm package name or local path."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"plugin-spec",children:"Plugin Spec"}),l.jsx(ze,{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()}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",l.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins install <spec>"})," on the host via CLI."]})]}),u&&l.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:[l.jsx(Dt,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{children:u})]}),l.jsxs(Ms,{children:[l.jsx(J,{variant:"outline",onClick:()=>{h(),t(!1)},children:"Cancel"}),l.jsxs(J,{onClick:d,disabled:i||!s.trim(),children:[i?l.jsx(dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(Kn,{className:"mr-1.5 h-3.5 w-3.5"}),"Install"]})]})]})})}function QM({open:e,onOpenChange:t,hostId:n,showToast:r,initialId:s}){const[o,i]=p.useState(s??""),[a,u]=p.useState(!1),[c,h]=p.useState("");p.useEffect(()=>{s&&i(s)},[s]);const d=async()=>{if(o.trim()){u(!0),h("");try{await oe.hosts.sendCommand(n,"uninstall_plugin",{pluginId:o.trim()}),i(""),t(!1),r("Plugin uninstall command sent","success")}catch(f){const x=f instanceof Error?f.message:"Failed to send command";h(x)}finally{u(!1)}}};return l.jsx(_s,{open:e,onOpenChange:t,children:l.jsxs(kr,{className:"sm:max-w-[400px]",children:[l.jsxs(Ps,{children:[l.jsxs(jr,{className:"flex items-center gap-2",children:[l.jsx(pn,{className:"h-4 w-4"})," Uninstall Plugin"]}),l.jsx(Cr,{children:"Remove an OpenClaw plugin from the host."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"plugin-id",children:"Plugin ID"}),l.jsx(ze,{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()}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",l.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins uninstall <id> --force"})," on the host via CLI."]})]}),c&&l.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:[l.jsx(Dt,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{children:c})]}),l.jsxs(Ms,{children:[l.jsx(J,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),l.jsxs(J,{variant:"destructive",onClick:d,disabled:a||!o.trim(),children:[a?l.jsx(dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(pn,{className:"mr-1.5 h-3.5 w-3.5"}),"Uninstall"]})]})]})})}function qM(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 ZM(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 JM(){const[e,t]=p.useState([]),[n,r]=p.useState(!0),[s,o]=p.useState("dashboard"),i=p.useCallback(()=>{oe.system.services().then(a=>t(a.data??[])).catch(()=>{}).finally(()=>r(!1))},[]);return p.useEffect(()=>{i()},[i]),p.useEffect(()=>{const a=setInterval(i,1e4);return()=>clearInterval(a)},[i]),n?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-lg font-semibold",children:"System"}),l.jsxs(J,{size:"sm",variant:"ghost",onClick:i,children:[l.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]}),l.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:e.map(a=>l.jsx(Ee,{className:`cursor-pointer transition-all ${s===a.key?"ring-2 ring-primary shadow-sm":"hover:bg-muted/30"}`,onClick:()=>o(a.key),children:l.jsxs(Te,{className:"flex items-center gap-3 p-4",children:[l.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-lg ${a.healthy?"bg-emerald-100 dark:bg-emerald-950":a.running?"bg-amber-100 dark:bg-amber-950":"bg-muted"}`,children:l.jsx(Xd,{className:`h-5 w-5 ${a.healthy?"text-emerald-600 dark:text-emerald-400":a.running?"text-amber-600 dark:text-amber-400":"text-muted-foreground"}`})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("p",{className:"text-sm font-medium",children:a.name}),l.jsx(zb,{className:`h-2 w-2 fill-current ${a.healthy?"text-emerald-500":a.running?"text-amber-500":"text-muted-foreground/40"}`})]}),l.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[l.jsxs("span",{children:[":",a.port]}),a.pid&&l.jsxs("span",{children:["PID ",a.pid]}),a.logSize>0&&l.jsx("span",{children:ZM(a.logSize)})]})]}),l.jsx(je,{variant:a.healthy?"default":a.running?"secondary":"outline",className:`text-[10px] ${a.healthy?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20":""}`,children:a.healthy?"Healthy":a.running?"Running":"Stopped"})]})},a.key))}),s&&l.jsx(eI,{service:s})]})}function eI({service:e}){const[t,n]=p.useState([]),[r,s]=p.useState(0),[o,i]=p.useState(""),[a,u]=p.useState(!0),[c,h]=p.useState(!0),[d,f]=p.useState(!0),[x,y]=p.useState(200),w=p.useRef(null),N=p.useRef(null),m=p.useCallback(b=>{const j=b??x;oe.system.logs(e,j).then(k=>{n(k.data.lines),s(k.data.total),i(k.data.lastModified)}).catch(()=>{}).finally(()=>u(!1))},[e,x]);p.useEffect(()=>{u(!0),n([]),m()},[e]),p.useEffect(()=>{m()},[x]),p.useEffect(()=>{c&&w.current&&(w.current.scrollTop=w.current.scrollHeight)},[t,c]),p.useEffect(()=>(d?N.current=setInterval(()=>m(),3e3):N.current&&(clearInterval(N.current),N.current=null),()=>{N.current&&clearInterval(N.current)}),[d,m]);const v=async()=>{try{await oe.system.clearLog(e),n([]),s(0)}catch{}},g=()=>{y(b=>Math.min(b+500,2e3))},S=e.charAt(0).toUpperCase()+e.slice(1);return l.jsxs(Ee,{children:[l.jsx($e,{className:"pb-3",children:l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[l.jsxs(Oe,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Es,{className:"h-4 w-4"})," ",S," Logs",l.jsxs(je,{variant:"outline",className:"text-[10px] font-normal",children:[r.toLocaleString()," lines"]}),o&&l.jsxs("span",{className:"text-[11px] font-normal text-muted-foreground",children:["Updated ",new Date(o).toLocaleTimeString()]})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[r>x&&l.jsx(J,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:g,children:"Load more"}),l.jsxs(J,{size:"sm",variant:d?"default":"outline",className:"h-7 text-xs",onClick:()=>{f(!d),h(!d)},children:[d?l.jsx(Xb,{className:"mr-1 h-3 w-3"}):l.jsx(Ma,{className:"mr-1 h-3 w-3"}),d?"Pause":"Tail"]}),l.jsxs(J,{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:[l.jsx(Rb,{className:"mr-1 h-3 w-3"})," Bottom"]}),l.jsxs(J,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>m(),children:[l.jsx(Yn,{className:"mr-1 h-3 w-3"})," Refresh"]}),l.jsxs(J,{size:"sm",variant:"ghost",className:"h-7 text-xs text-destructive hover:text-destructive",onClick:v,children:[l.jsx(pn,{className:"mr-1 h-3 w-3"})," Clear"]})]})]})}),l.jsx(Te,{className:"p-0",children:a?l.jsx("div",{className:"flex h-60 items-center justify-center",children:l.jsx(dt,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):t.length===0?l.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-2",children:[l.jsx(Ib,{className:"h-8 w-8 text-muted-foreground/20"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No log output"})]}):l.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:j,clientHeight:k}=w.current,_=j-b-k<40;h(_)},children:l.jsx("pre",{className:"p-4 text-xs leading-5 font-mono text-zinc-300",children:t.map((b,j)=>l.jsx(tI,{line:b,lineNum:r-t.length+j+1},j))})})})]})}function tI({line:e,lineNum:t}){const n=nI(e);return l.jsxs("div",{className:"group flex hover:bg-white/5",children:[l.jsx("span",{className:"mr-3 inline-block w-10 select-none text-right text-zinc-600 group-hover:text-zinc-500",children:t}),l.jsx("span",{className:n,children:e}),`
397
+ `]})}function nI(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 rI=[{key:"og_core_url",label:"Core API URL",icon:Xd,placeholder:"http://localhost:53666",description:"OpenTrust Core service endpoint"},{key:"gateway_url",label:"Gateway URL",icon:Xx,placeholder:"http://localhost:8900",description:"AI Gateway proxy endpoint"},{key:"dashboard_mode",label:"Dashboard Mode",icon:Zb,placeholder:"selfhosted",description:"Deployment mode: selfhosted or embedded"},{key:"database_url",label:"Database URL",icon:Ob,placeholder:"file:./data/dashboard.db",description:"Database connection string",sensitive:!0}];function sI(){const[e,t]=p.useState({}),[n,r]=p.useState({}),[s,o]=p.useState(!0),[i,a]=p.useState(!1),[u,c]=p.useState(null),[h,d]=p.useState(null),[f,x]=p.useState(!1),[y,w]=p.useState(""),[N,m]=p.useState(""),[v,g]=p.useState(!1),[S,b]=p.useState(!1),j=p.useCallback(()=>{oe.settings.getApiKey(!1).then(A=>{w(A.data.key),m(""),g(!1)}).catch(()=>{})},[]),k=()=>{o(!0),oe.settings.get().then(A=>{const C=A.data??{};t(C),r(C)}).catch(()=>{}).finally(()=>o(!1))};p.useEffect(()=>{k(),j()},[j]);const _=()=>Object.keys(e).some(A=>e[A]!==n[A]),I=async()=>{a(!0);try{const A={};for(const[C,L]of Object.entries(e))L!==n[C]&&(A[C]=L);Object.keys(A).length>0&&(await oe.settings.update(A),r({...e}),R("Settings saved","success"))}catch(A){R(A instanceof Error?A.message:"Failed to save","error")}finally{a(!1)}},$=async()=>{x(!0),d(null);try{const C=await(await fetch("/api/settings/test-connection",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${JSON.parse(localStorage.getItem("opentrust_user")||"{}").apiKey||""}`}})).json();C.success&&d(C.data)}catch{d({connected:!1,message:"Request failed"})}finally{x(!1)}},R=(A,C)=>{c({msg:A,type:C}),setTimeout(()=>c(null),3e3)},T=(A,C)=>{t(L=>({...L,[A]:C}))};return s?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading settings..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Settings"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure OpenTrust system settings"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(J,{size:"sm",variant:"ghost",onClick:k,children:[l.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"})," Reload"]}),l.jsxs(J,{size:"sm",onClick:I,disabled:i||!_(),children:[i?l.jsx(dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(Qx,{className:"mr-1.5 h-3.5 w-3.5"}),"Save Changes"]})]})]}),l.jsxs(Ee,{children:[l.jsxs($e,{children:[l.jsxs(Oe,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Ub,{className:"h-4 w-4"})," System API Key"]}),l.jsx(qd,{className:"text-xs",children:"Unified key for CLI, Guards, Gateway, and Dashboard inter-component authentication"})]}),l.jsxs(Te,{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ze,{readOnly:!0,value:v?N:y,className:"font-mono text-sm",placeholder:"Loading..."}),l.jsx(J,{size:"icon",variant:"outline",title:v?"Hide":"Reveal",onClick:async()=>{if(v)g(!1);else try{const A=await oe.settings.getApiKey(!0);m(A.data.key),g(!0)}catch{R("Failed to reveal key","error")}},children:v?l.jsx(Hb,{className:"h-4 w-4"}):l.jsx(Vb,{className:"h-4 w-4"})}),l.jsx(J,{size:"icon",variant:"outline",title:"Copy to clipboard",onClick:async()=>{try{const A=await oe.settings.getApiKey(!0);await navigator.clipboard.writeText(A.data.key),R("API key copied","success")}catch{R("Failed to copy","error")}},children:l.jsx($b,{className:"h-4 w-4"})}),l.jsx(J,{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 A=await oe.settings.generateKey();m(A.data.key),w(A.data.key.slice(0,12)+"..."+A.data.key.slice(-4)),g(!0),R("New API key generated","success")}catch{R("Failed to generate key","error")}finally{b(!1)}}},children:S?l.jsx(dt,{className:"h-4 w-4 animate-spin"}):l.jsx(Ia,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"rounded-md border border-border bg-muted/50 p-3",children:[l.jsxs("p",{className:"mb-2 flex items-center gap-1.5 text-xs font-medium",children:[l.jsx(cs,{className:"h-3.5 w-3.5"})," Connection Guide"]}),l.jsxs("div",{className:"space-y-1.5 text-[11px] font-mono text-muted-foreground",children:[l.jsxs("p",{children:[l.jsx("span",{className:"text-foreground font-semibold",children:"CLI:"})," opentrust connect --dashboard-url http://<host>:53667 --api-key <key>"]}),l.jsxs("p",{children:[l.jsx("span",{className:"text-foreground font-semibold",children:"Guards:"})," Set ",l.jsx("code",{className:"rounded bg-muted px-1",children:"apiKey"})," in openclaw.json plugin config"]}),l.jsxs("p",{children:[l.jsx("span",{className:"text-foreground font-semibold",children:"Gateway:"})," Set env ",l.jsx("code",{className:"rounded bg-muted px-1",children:"OT_API_KEY=<key>"})]})]})]})]})]}),l.jsx(oI,{showToast:R}),l.jsxs(Ee,{children:[l.jsx($e,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(Oe,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Xd,{className:"h-4 w-4"})," Service Connection"]}),l.jsxs(J,{size:"sm",variant:"outline",onClick:$,disabled:f,children:[f?l.jsx(dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"}),"Test Connection"]})]})}),l.jsx(Te,{children:h?l.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?l.jsx(gr,{className:"h-4 w-4"}):l.jsx(Dt,{className:"h-4 w-4"}),l.jsx("span",{children:h.message}),h.url&&l.jsx(je,{variant:"outline",className:"ml-auto text-[10px]",children:h.url})]}):l.jsx("p",{className:"text-xs text-muted-foreground",children:'Click "Test Connection" to verify Core service connectivity'})})]}),l.jsxs(Ee,{children:[l.jsx($e,{children:l.jsxs(Oe,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Qt,{className:"h-4 w-4"})," Configuration"]})}),l.jsx(Te,{className:"space-y-5",children:rI.map(A=>{const C=A.icon,L=e[A.key]!==n[A.key];return l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(C,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsx(qe,{htmlFor:A.key,className:"text-sm font-medium",children:A.label}),L&&l.jsx(je,{variant:"secondary",className:"text-[10px]",children:"Modified"})]}),l.jsx(ze,{id:A.key,value:e[A.key]??"",onChange:M=>T(A.key,M.target.value),placeholder:A.placeholder,className:"font-mono text-sm"}),l.jsx("p",{className:"text-[11px] text-muted-foreground",children:A.description})]},A.key)})})]}),l.jsxs(Ee,{children:[l.jsx($e,{children:l.jsx(Oe,{className:"text-sm",children:"Environment"})}),l.jsx(Te,{children:l.jsxs("div",{className:"grid gap-3 text-xs sm:grid-cols-2",children:[l.jsx(zi,{label:"Dashboard Mode",value:e.dashboard_mode||"selfhosted"}),l.jsx(zi,{label:"Core URL",value:e.og_core_url||"http://localhost:53666"}),l.jsx(zi,{label:"Gateway URL",value:e.gateway_url||"http://localhost:8900"}),l.jsx(zi,{label:"Database",value:e.database_url?"Custom":"SQLite (default)"})]})})]}),u&&l.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"?l.jsx(gr,{className:"h-4 w-4"}):l.jsx(Dt,{className:"h-4 w-4"}),l.jsx("span",{className:"text-sm",children:u.msg})]})]})}function oI({showToast:e}){const[t,n]=p.useState(""),[r,s]=p.useState(""),[o,i]=p.useState(""),[a,u]=p.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,x=await fetch("/api/auth/change-password",{method:"POST",headers:{"Content-Type":"application/json",...f&&{Authorization:`Bearer ${f}`}},body:JSON.stringify({currentPassword:t,newPassword:r})}),y=await x.json();if(!x.ok||!y.success)throw new Error(y.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 l.jsxs(Ee,{children:[l.jsxs($e,{children:[l.jsxs(Oe,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Wb,{className:"h-4 w-4"})," Change Password"]}),l.jsx(qd,{className:"text-xs",children:"Update the admin login password"})]}),l.jsx(Te,{children:l.jsxs("form",{onSubmit:c,className:"space-y-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(qe,{className:"text-xs",children:"Current Password"}),l.jsx(ze,{type:"password",value:t,onChange:h=>n(h.target.value),required:!0,className:"text-sm"})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(qe,{className:"text-xs",children:"New Password"}),l.jsx(ze,{type:"password",value:r,onChange:h=>s(h.target.value),required:!0,className:"text-sm"})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(qe,{className:"text-xs",children:"Confirm New Password"}),l.jsx(ze,{type:"password",value:o,onChange:h=>i(h.target.value),required:!0,className:"text-sm"})]}),l.jsxs(J,{type:"submit",size:"sm",disabled:a,children:[a?l.jsx(dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(Qx,{className:"mr-1.5 h-3.5 w-3.5"}),"Update Password"]})]})})]})}function zi({label:e,value:t}){return l.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2",children:[l.jsx("span",{className:"text-muted-foreground",children:e}),l.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-[11px]",children:t})]})}function iI(){const[e,t]=p.useState([]),[n,r]=p.useState(!0),[s,o]=p.useState(null),[i,a]=p.useState(null),u=p.useCallback(async()=>{try{const d=await oe.hosts.list();t(d.data)}catch{}finally{r(!1)}},[]);p.useEffect(()=>{u();const d=setInterval(u,15e3);return()=>clearInterval(d)},[u]),p.useEffect(()=>{if(!i)return;const d=setTimeout(()=>a(null),4e3);return()=>clearTimeout(d)},[i]);const c=(d,f)=>a({msg:d,type:f}),h=async d=>{try{await oe.hosts.remove(d),t(f=>f.filter(x=>x.id!==d)),c("Host removed","success")}catch{c("Failed to remove host","error")}};return n?l.jsx("div",{className:"flex items-center justify-center py-24",children:l.jsx(dt,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):l.jsxs("div",{className:"space-y-6 p-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold",children:"Hosts"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage machines running OpenTrust CLI"})]}),l.jsxs(J,{variant:"outline",size:"sm",onClick:u,children:[l.jsx(Yn,{className:"h-4 w-4 mr-1"})," Refresh"]})]}),e.length===0?l.jsxs(Ee,{className:"p-8 text-center",children:[l.jsx(Gd,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),l.jsx("h3",{className:"text-lg font-medium mb-2",children:"No hosts connected"}),l.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:"}),l.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"})]}):l.jsx("div",{className:"space-y-3",children:e.map(d=>l.jsx("div",{children:l.jsx(aI,{host:d,expanded:s===d.id,onToggle:()=>o(s===d.id?null:d.id),onRemove:()=>h(d.id),showToast:c})},d.id))}),i&&l.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 ${i.type==="success"?"bg-green-600 text-white":"bg-red-600 text-white"}`,children:[i.type==="success"?l.jsx(gr,{className:"h-4 w-4"}):l.jsx(Dt,{className:"h-4 w-4"}),i.msg]})]})}function aI({host:e,expanded:t,onToggle:n,onRemove:r,showToast:s}){const o=e.status==="online",i=e.services??{},a=Object.values(i).filter(c=>c.running).length,u=Object.keys(i).length;return e.metadata,l.jsxs(Ee,{className:"overflow-hidden",children:[l.jsxs("button",{onClick:n,className:"w-full flex items-center gap-4 p-4 hover:bg-accent/30 transition-colors text-left",children:[l.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[l.jsx("div",{className:`h-2.5 w-2.5 rounded-full shrink-0 ${o?"bg-green-500":"bg-gray-400"}`}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-medium truncate",children:e.hostname}),l.jsx(je,{variant:o?"default":"secondary",className:"text-[10px] px-1.5",children:o?"online":"offline"})]}),l.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground mt-0.5",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Xx,{className:"h-3 w-3"})," ",e.ip]}),l.jsxs("span",{children:[e.os," / ",e.arch]}),l.jsxs("span",{children:["CLI v",e.cliVersion]}),l.jsxs("span",{children:[a,"/",u," services"]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex gap-1",children:Object.entries(i).map(([c,h])=>l.jsx("span",{title:`${h.name}: ${h.running?h.healthy?"healthy":"running":"stopped"}`,className:`inline-block h-4 w-4 rounded text-[8px] font-bold flex items-center justify-center ${h.running?h.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:c[0].toUpperCase()},c))}),t?l.jsx(Ab,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(dl,{className:"h-4 w-4 text-muted-foreground"})]})]}),t&&l.jsx("div",{className:"border-t border-border",children:l.jsx(lI,{host:e,onRemove:r,showToast:s})})]})}function lI({host:e,onRemove:t,showToast:n}){const[r,s]=p.useState("services");return l.jsxs(Nf,{value:r,onValueChange:s,className:"w-full",children:[l.jsxs(El,{className:"w-full justify-start rounded-none border-b bg-transparent px-4 pt-2",children:[l.jsx(yt,{value:"services",children:"Services"}),l.jsx(yt,{value:"logs",children:"Logs"}),l.jsx(yt,{value:"upgrade",children:"Upgrade"}),l.jsx(yt,{value:"config",children:"Config"}),l.jsx(yt,{value:"commands",children:"Commands"}),l.jsx(yt,{value:"info",children:"Info"})]}),l.jsxs("div",{className:"p-4",children:[l.jsx(vt,{value:"services",className:"mt-0",children:l.jsx(uI,{host:e,showToast:n})}),l.jsx(vt,{value:"logs",className:"mt-0",children:l.jsx(cI,{host:e,showToast:n})}),l.jsx(vt,{value:"upgrade",className:"mt-0",children:l.jsx(dI,{host:e,showToast:n})}),l.jsx(vt,{value:"config",className:"mt-0",children:l.jsx(fI,{host:e,showToast:n})}),l.jsx(vt,{value:"commands",className:"mt-0",children:l.jsx(hI,{hostId:e.id})}),l.jsx(vt,{value:"info",className:"mt-0",children:l.jsx(mI,{host:e,onRemove:t})})]})]})}function uI({host:e,showToast:t}){const n=e.services??{},[r,s]=p.useState(null),o=async(i,a)=>{s(`${i}-${a}`);try{await oe.hosts.sendCommand(e.id,i,{service:a}),t(`${i.replace("_"," ")} "${a}" sent`,"success")}catch{t(`Failed to send ${i}`,"error")}finally{s(null)}};return l.jsxs("div",{className:"space-y-2",children:[Object.entries(n).map(([i,a])=>l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:`h-2 w-2 rounded-full ${a.running?a.healthy?"bg-green-500":"bg-yellow-500":"bg-gray-400"}`}),l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-sm",children:a.name}),l.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:[":",a.port]}),a.pid&&l.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["PID ",a.pid]})]})]}),l.jsx("div",{className:"flex items-center gap-1",children:a.running?l.jsxs(l.Fragment,{children:[l.jsxs(J,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("restart_service",i),children:[l.jsx(Ia,{className:"h-3 w-3 mr-1"})," Restart"]}),l.jsxs(J,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("stop_service",i),children:[l.jsx(Sc,{className:"h-3 w-3 mr-1"})," Stop"]})]}):l.jsxs(J,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("start_service",i),children:[l.jsx(Ma,{className:"h-3 w-3 mr-1"})," Start"]})})]},i)),l.jsxs("div",{className:"flex gap-2 pt-2",children:[l.jsxs(J,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("start_service","all"),children:[l.jsx(Ma,{className:"h-3 w-3 mr-1"})," Start All"]}),l.jsxs(J,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("stop_service","all"),children:[l.jsx(Sc,{className:"h-3 w-3 mr-1"})," Stop All"]}),l.jsxs(J,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("restart_service","all"),children:[l.jsx(Ia,{className:"h-3 w-3 mr-1"})," Restart All"]})]})]})}function cI({host:e,showToast:t}){const n=Object.keys(e.services??{}),[r,s]=p.useState(n[0]??"core"),[o,i]=p.useState(null),[a,u]=p.useState(!1),c=async()=>{u(!0);try{await oe.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 l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(qe,{children:"Service:"}),l.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=>l.jsx("option",{value:h,children:h},h))}),l.jsxs(J,{variant:"outline",size:"sm",onClick:c,disabled:a,children:[l.jsx(Es,{className:"h-3 w-3 mr-1"})," Fetch Logs"]})]}),l.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 dI({host:e,showToast:t}){const[n,r]=p.useState(""),[s,o]=p.useState(!1),i=async()=>{o(!0);try{await oe.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 l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[l.jsxs("span",{children:["Current CLI version: ",l.jsxs("strong",{children:["v",e.cliVersion]})]}),l.jsxs("span",{children:["Project mode: ",l.jsx(je,{variant:"secondary",children:e.projectMode})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ze,{placeholder:"Target version (empty = latest)",value:n,onChange:a=>r(a.target.value),className:"max-w-xs"}),l.jsxs(J,{onClick:i,disabled:s,children:[l.jsx(Yx,{className:"h-4 w-4 mr-1"})," Upgrade"]})]}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Runs ",l.jsx("code",{children:"npm install -g @opentrust/cli@version"})," and upgrades project packages on the remote host."]})]})}function fI({host:e,showToast:t}){const[n,r]=p.useState(""),[s,o]=p.useState(""),[i,a]=p.useState(!1),u=async()=>{if(n){a(!0);try{await oe.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{a(!1)}}};return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Update environment variables in the remote host's ",l.jsx("code",{children:".env"})," file."]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2 max-w-lg",children:[l.jsxs("div",{children:[l.jsx(qe,{className:"text-xs",children:"Key"}),l.jsx(ze,{placeholder:"e.g. CORE_API_KEY",value:n,onChange:c=>r(c.target.value)})]}),l.jsxs("div",{children:[l.jsx(qe,{className:"text-xs",children:"Value"}),l.jsx(ze,{placeholder:"Value",value:s,onChange:c=>o(c.target.value)})]})]}),l.jsxs(J,{size:"sm",onClick:u,disabled:i||!n,children:[l.jsx(Qt,{className:"h-3 w-3 mr-1"})," Update .env"]})]})}function hI({hostId:e}){const[t,n]=p.useState([]),[r,s]=p.useState(!0),o=p.useCallback(async()=>{try{const u=await oe.hosts.commands(e);n(u.data)}catch{}s(!1)},[e]);p.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 l.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})},a=u=>({start_service:l.jsx(Ma,{className:"h-3 w-3"}),stop_service:l.jsx(Sc,{className:"h-3 w-3"}),restart_service:l.jsx(Ia,{className:"h-3 w-3"}),upgrade:l.jsx(Yx,{className:"h-3 w-3"}),fetch_logs:l.jsx(Es,{className:"h-3 w-3"}),update_env:l.jsx(Qt,{className:"h-3 w-3"})})[u]??l.jsx(cs,{className:"h-3 w-3"});return r?l.jsx("div",{className:"text-sm text-muted-foreground py-4",children:"Loading..."}):t.length===0?l.jsx("div",{className:"text-sm text-muted-foreground py-4",children:"No commands yet."}):l.jsx("div",{className:"space-y-2 max-h-[400px] overflow-y-auto",children:t.map(u=>l.jsxs("div",{className:"rounded border border-border p-3 text-sm",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[a(u.type),l.jsx("span",{className:"font-medium",children:u.type.replace(/_/g," ")}),i(u.status)]}),l.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(u.createdAt).toLocaleString()})]}),u.payload&&l.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&&l.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 mI({host:e,onRemove:t}){const n=e.metadata??{},[r,s]=p.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 l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2",children:o.filter(i=>i.value).map(i=>l.jsxs("div",{className:"flex gap-2 text-sm py-1",children:[l.jsxs("span",{className:"text-muted-foreground min-w-[120px]",children:[i.label,":"]}),l.jsx("span",{className:"font-mono text-xs break-all",children:i.value})]},i.label))}),l.jsx("div",{className:"border-t border-border pt-4",children:l.jsxs(J,{variant:"destructive",size:"sm",onClick:()=>s(!0),children:[l.jsx(pn,{className:"h-3 w-3 mr-1"})," Remove Host"]})}),l.jsx(_s,{open:r,onOpenChange:s,children:l.jsxs(kr,{children:[l.jsxs(Ps,{children:[l.jsx(jr,{children:"Remove Host"}),l.jsxs(Cr,{children:["Remove ",l.jsx("strong",{children:e.hostname})," from the Dashboard? The host will need to run"," ",l.jsx("code",{children:"opentrust connect"})," again to re-register."]})]}),l.jsxs(Ms,{children:[l.jsx(J,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),l.jsx(J,{variant:"destructive",onClick:()=>{s(!1),t()},children:"Remove"})]})]})})]})}function pI({children:e}){const{isAuthenticated:t,isLoading:n}=Ud();return n?l.jsx("div",{className:"flex min-h-screen items-center justify-center",children:l.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading..."})}):t?l.jsx(l.Fragment,{children:e}):l.jsx(vc,{to:"/login",replace:!0})}function gI(){return l.jsxs(hS,{children:[l.jsx(Ke,{path:"/login",element:l.jsx(hk,{})}),l.jsxs(Ke,{element:l.jsx(pI,{children:l.jsx(fk,{})}),children:[l.jsx(Ke,{index:!0,element:l.jsx(vc,{to:"/inventory/agents",replace:!0})}),l.jsx(Ke,{path:"/inventory/agents",element:l.jsx(pk,{})}),l.jsx(Ke,{path:"/inventory/agents/:id",element:l.jsx(xk,{})}),l.jsx(Ke,{path:"/inventory/identities",element:l.jsx(Sk,{})}),l.jsx(Ke,{path:"/inventory/permissions",element:l.jsx(bk,{})}),l.jsx(Ke,{path:"/secure/risk",element:l.jsx(kk,{})}),l.jsx(Ke,{path:"/secure/graph",element:l.jsx(KP,{})}),l.jsx(Ke,{path:"/ops/skills",element:l.jsx(DM,{})}),l.jsx(Ke,{path:"/ops/plugins",element:l.jsx(WM,{})}),l.jsx(Ke,{path:"/inventory/hosts",element:l.jsx(iI,{})}),l.jsx(Ke,{path:"/system/logs",element:l.jsx(JM,{})}),l.jsx(Ke,{path:"/system/settings",element:l.jsx(sI,{})})]}),l.jsx(Ke,{path:"*",element:l.jsx(vc,{to:"/inventory/agents",replace:!0})})]})}ju.createRoot(document.getElementById("root")).render(l.jsx(Bt.StrictMode,{children:l.jsx(DS,{basename:"/dashboard",children:l.jsx(KS,{children:l.jsx(GS,{children:l.jsx(gI,{})})})})}));
398
+ //# sourceMappingURL=index-C84QRqdh.js.map