@opentrust/dashboard 7.3.20 → 7.3.22

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.
@@ -1,353 +0,0 @@
1
- function Bw(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function Fc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lm={exports:{}},Ul={},am={exports:{}},re={};/**
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 Ds=Symbol.for("react.element"),Vw=Symbol.for("react.portal"),Uw=Symbol.for("react.fragment"),Ww=Symbol.for("react.strict_mode"),Yw=Symbol.for("react.profiler"),Gw=Symbol.for("react.provider"),Xw=Symbol.for("react.context"),Kw=Symbol.for("react.forward_ref"),Qw=Symbol.for("react.suspense"),qw=Symbol.for("react.memo"),Zw=Symbol.for("react.lazy"),Pf=Symbol.iterator;function Jw(e){return e===null||typeof e!="object"?null:(e=Pf&&e[Pf]||e["@@iterator"],typeof e=="function"?e:null)}var um={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},cm=Object.assign,dm={};function yo(e,t,n){this.props=e,this.context=t,this.refs=dm,this.updater=n||um}yo.prototype.isReactComponent={};yo.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")};yo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function fm(){}fm.prototype=yo.prototype;function Hc(e,t,n){this.props=e,this.context=t,this.refs=dm,this.updater=n||um}var Bc=Hc.prototype=new fm;Bc.constructor=Hc;cm(Bc,yo.prototype);Bc.isPureReactComponent=!0;var Mf=Array.isArray,hm=Object.prototype.hasOwnProperty,Vc={current:null},pm={key:!0,ref:!0,__self:!0,__source:!0};function mm(e,t,n){var r,o={},s=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)hm.call(t,r)&&!pm.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var a=Array(l),c=0;c<l;c++)a[c]=arguments[c+2];o.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:Ds,type:e,key:s,ref:i,props:o,_owner:Vc.current}}function e1(e,t){return{$$typeof:Ds,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Uc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ds}function t1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var If=/\/+/g;function Ia(e,t){return typeof e=="object"&&e!==null&&e.key!=null?t1(""+e.key):t.toString(36)}function zi(e,t,n,r,o){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Ds:case Vw:i=!0}}if(i)return i=e,o=o(i),e=r===""?"."+Ia(i,0):r,Mf(o)?(n="",e!=null&&(n=e.replace(If,"$&/")+"/"),zi(o,t,n,"",function(c){return c})):o!=null&&(Uc(o)&&(o=e1(o,n+(!o.key||i&&i.key===o.key?"":(""+o.key).replace(If,"$&/")+"/")+e)),t.push(o)),1;if(i=0,r=r===""?".":r+":",Mf(e))for(var l=0;l<e.length;l++){s=e[l];var a=r+Ia(s,l);i+=zi(s,t,n,a,o)}else if(a=Jw(e),typeof a=="function")for(e=a.call(e),l=0;!(s=e.next()).done;)s=s.value,a=r+Ia(s,l++),i+=zi(s,t,n,a,o);else if(s==="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 ni(e,t,n){if(e==null)return e;var r=[],o=0;return zi(e,r,"","",function(s){return t.call(n,s,o++)}),r}function n1(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 Qe={current:null},Di={transition:null},r1={ReactCurrentDispatcher:Qe,ReactCurrentBatchConfig:Di,ReactCurrentOwner:Vc};re.Children={map:ni,forEach:function(e,t,n){ni(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ni(e,function(){t++}),t},toArray:function(e){return ni(e,function(t){return t})||[]},only:function(e){if(!Uc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};re.Component=yo;re.Fragment=Uw;re.Profiler=Yw;re.PureComponent=Hc;re.StrictMode=Ww;re.Suspense=Qw;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=r1;re.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=cm({},e.props),o=e.key,s=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,i=Vc.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)hm.call(t,a)&&!pm.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var c=0;c<a;c++)l[c]=arguments[c+2];r.children=l}return{$$typeof:Ds,type:e.type,key:o,ref:s,props:r,_owner:i}};re.createContext=function(e){return e={$$typeof:Xw,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Gw,_context:e},e.Consumer=e};re.createElement=mm;re.createFactory=function(e){var t=mm.bind(null,e);return t.type=e,t};re.createRef=function(){return{current:null}};re.forwardRef=function(e){return{$$typeof:Kw,render:e}};re.isValidElement=Uc;re.lazy=function(e){return{$$typeof:Zw,_payload:{_status:-1,_result:e},_init:n1}};re.memo=function(e,t){return{$$typeof:qw,type:e,compare:t===void 0?null:t}};re.startTransition=function(e){var t=Di.transition;Di.transition={};try{e()}finally{Di.transition=t}};re.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};re.useCallback=function(e,t){return Qe.current.useCallback(e,t)};re.useContext=function(e){return Qe.current.useContext(e)};re.useDebugValue=function(){};re.useDeferredValue=function(e){return Qe.current.useDeferredValue(e)};re.useEffect=function(e,t){return Qe.current.useEffect(e,t)};re.useId=function(){return Qe.current.useId()};re.useImperativeHandle=function(e,t,n){return Qe.current.useImperativeHandle(e,t,n)};re.useInsertionEffect=function(e,t){return Qe.current.useInsertionEffect(e,t)};re.useLayoutEffect=function(e,t){return Qe.current.useLayoutEffect(e,t)};re.useMemo=function(e,t){return Qe.current.useMemo(e,t)};re.useReducer=function(e,t,n){return Qe.current.useReducer(e,t,n)};re.useRef=function(e){return Qe.current.useRef(e)};re.useState=function(e){return Qe.current.useState(e)};re.useSyncExternalStore=function(e,t,n){return Qe.current.useSyncExternalStore(e,t,n)};re.useTransition=function(){return Qe.current.useTransition()};re.version="18.3.0";am.exports=re;var m=am.exports;const $t=Fc(m),o1=Bw({__proto__:null,default:$t},[m]);/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var s1=m,i1=Symbol.for("react.element"),l1=Symbol.for("react.fragment"),a1=Object.prototype.hasOwnProperty,u1=s1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c1={key:!0,ref:!0,__self:!0,__source:!0};function gm(e,t,n){var r,o={},s=null,i=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)a1.call(t,r)&&!c1.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:i1,type:e,key:s,ref:i,props:o,_owner:u1.current}}Ul.Fragment=l1;Ul.jsx=gm;Ul.jsxs=gm;lm.exports=Ul;var u=lm.exports,bu={},xm={exports:{}},dt={},ym={exports:{}},vm={};/**
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(C,P){var L=C.length;C.push(P);e:for(;0<L;){var O=L-1>>>1,$=C[O];if(0<o($,P))C[O]=P,C[L]=$,L=O;else break e}}function n(C){return C.length===0?null:C[0]}function r(C){if(C.length===0)return null;var P=C[0],L=C.pop();if(L!==P){C[0]=L;e:for(var O=0,$=C.length,U=$>>>1;O<U;){var V=2*(O+1)-1,Y=C[V],G=V+1,X=C[G];if(0>o(Y,L))G<$&&0>o(X,Y)?(C[O]=X,C[G]=L,O=G):(C[O]=Y,C[V]=L,O=V);else if(G<$&&0>o(X,L))C[O]=X,C[G]=L,O=G;else break e}}return P}function o(C,P){var L=C.sortIndex-P.sortIndex;return L!==0?L:C.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var a=[],c=[],h=1,f=null,d=3,x=!1,y=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(C){for(var P=n(c);P!==null;){if(P.callback===null)r(c);else if(P.startTime<=C)r(c),P.sortIndex=P.expirationTime,t(a,P);else break;P=n(c)}}function N(C){if(w=!1,g(C),!y)if(n(a)!==null)y=!0,M(k);else{var P=n(c);P!==null&&z(N,P.startTime-C)}}function k(C,P){y=!1,w&&(w=!1,p(_),_=-1),x=!0;var L=d;try{for(g(P),f=n(a);f!==null&&(!(f.expirationTime>P)||C&&!R());){var O=f.callback;if(typeof O=="function"){f.callback=null,d=f.priorityLevel;var $=O(f.expirationTime<=P);P=e.unstable_now(),typeof $=="function"?f.callback=$:f===n(a)&&r(a),g(P)}else r(a);f=n(a)}if(f!==null)var U=!0;else{var V=n(c);V!==null&&z(N,V.startTime-P),U=!1}return U}finally{f=null,d=L,x=!1}}var b=!1,E=null,_=-1,I=5,D=-1;function R(){return!(e.unstable_now()-D<I)}function T(){if(E!==null){var C=e.unstable_now();D=C;var P=!0;try{P=E(!0,C)}finally{P?F():(b=!1,E=null)}}else b=!1}var F;if(typeof v=="function")F=function(){v(T)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,A=j.port2;j.port1.onmessage=T,F=function(){A.postMessage(null)}}else F=function(){S(T,0)};function M(C){E=C,b||(b=!0,F())}function z(C,P){_=S(function(){C(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(C){C.callback=null},e.unstable_continueExecution=function(){y||x||(y=!0,M(k))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(C){switch(d){case 1:case 2:case 3:var P=3;break;default:P=d}var L=d;d=P;try{return C()}finally{d=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,P){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var L=d;d=C;try{return P()}finally{d=L}},e.unstable_scheduleCallback=function(C,P,L){var O=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?O+L:O):L=O,C){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=L+$,C={id:h++,callback:P,priorityLevel:C,startTime:L,expirationTime:$,sortIndex:-1},L>O?(C.sortIndex=L,t(c,C),n(a)===null&&C===n(c)&&(w?(p(_),_=-1):w=!0,z(N,L-O))):(C.sortIndex=$,t(a,C),y||x||(y=!0,M(k))),C},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(C){var P=d;return function(){var L=d;d=P;try{return C.apply(this,arguments)}finally{d=L}}}})(vm);ym.exports=vm;var d1=ym.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 f1=m,ut=d1;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 wm=new Set,cs={};function wr(e,t){Jr(e,t),Jr(e+"Capture",t)}function Jr(e,t){for(cs[e]=t,e=0;e<t.length;e++)wm.add(t[e])}var cn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Eu=Object.prototype.hasOwnProperty,h1=/^[: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]*$/,Tf={},Rf={};function p1(e){return Eu.call(Rf,e)?!0:Eu.call(Tf,e)?!1:h1.test(e)?Rf[e]=!0:(Tf[e]=!0,!1)}function m1(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 g1(e,t,n,r){if(t===null||typeof t>"u"||m1(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 qe(e,t,n,r,o,s,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var He={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){He[e]=new qe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];He[t]=new qe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){He[e]=new qe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){He[e]=new qe(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){He[e]=new qe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){He[e]=new qe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){He[e]=new qe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){He[e]=new qe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){He[e]=new qe(e,5,!1,e.toLowerCase(),null,!1,!1)});var Wc=/[\-:]([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(Wc,Yc);He[t]=new qe(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(Wc,Yc);He[t]=new qe(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(Wc,Yc);He[t]=new qe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){He[e]=new qe(e,1,!1,e.toLowerCase(),null,!1,!1)});He.xlinkHref=new qe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){He[e]=new qe(e,1,!1,e.toLowerCase(),null,!0,!0)});function Gc(e,t,n,r){var o=He.hasOwnProperty(t)?He[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(g1(t,n,o,r)&&(n=null),r||o===null?p1(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var mn=f1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ri=Symbol.for("react.element"),_r=Symbol.for("react.portal"),Pr=Symbol.for("react.fragment"),Xc=Symbol.for("react.strict_mode"),Cu=Symbol.for("react.profiler"),Nm=Symbol.for("react.provider"),Sm=Symbol.for("react.context"),Kc=Symbol.for("react.forward_ref"),ju=Symbol.for("react.suspense"),_u=Symbol.for("react.suspense_list"),Qc=Symbol.for("react.memo"),bn=Symbol.for("react.lazy"),km=Symbol.for("react.offscreen"),Lf=Symbol.iterator;function To(e){return e===null||typeof e!="object"?null:(e=Lf&&e[Lf]||e["@@iterator"],typeof e=="function"?e:null)}var Ne=Object.assign,Ta;function Yo(e){if(Ta===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ta=t&&t[1]||""}return`
34
- `+Ta+e}var Ra=!1;function La(e,t){if(!e||Ra)return"";Ra=!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 o=c.stack.split(`
35
- `),s=r.stack.split(`
36
- `),i=o.length-1,l=s.length-1;1<=i&&0<=l&&o[i]!==s[l];)l--;for(;1<=i&&0<=l;i--,l--)if(o[i]!==s[l]){if(i!==1||l!==1)do if(i--,l--,0>l||o[i]!==s[l]){var a=`
37
- `+o[i].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=i&&0<=l);break}}}finally{Ra=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Yo(e):""}function x1(e){switch(e.tag){case 5:return Yo(e.type);case 16:return Yo("Lazy");case 13:return Yo("Suspense");case 19:return Yo("SuspenseList");case 0:case 2:case 15:return e=La(e.type,!1),e;case 11:return e=La(e.type.render,!1),e;case 1:return e=La(e.type,!0),e;default:return""}}function Pu(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 Pr:return"Fragment";case _r:return"Portal";case Cu:return"Profiler";case Xc:return"StrictMode";case ju:return"Suspense";case _u:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Sm:return(e.displayName||"Context")+".Consumer";case Nm:return(e._context.displayName||"Context")+".Provider";case Kc: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:Pu(e.type)||"Memo";case bn:t=e._payload,e=e._init;try{return Pu(e(t))}catch{}}return null}function y1(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 Pu(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 Fn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function bm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function v1(e){var t=bm(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 o=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){r=""+i,s.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=v1(e))}function Em(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=bm(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ol(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 Mu(e,t){var n=t.checked;return Ne({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Af(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Fn(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 Cm(e,t){t=t.checked,t!=null&&Gc(e,"checked",t,!1)}function Iu(e,t){Cm(e,t);var n=Fn(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,Fn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function zf(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"||ol(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Go=Array.isArray;function Br(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Fn(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ru(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return Ne({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Df(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(Go(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Fn(n)}}function jm(e,t){var n=Fn(t.value),r=Fn(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 $f(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function _m(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 Lu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?_m(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var si,Pm=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(si=si||document.createElement("div"),si.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=si.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ds(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Zo={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},w1=["Webkit","ms","Moz","O"];Object.keys(Zo).forEach(function(e){w1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zo[t]=Zo[e]})});function Mm(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Zo.hasOwnProperty(e)&&Zo[e]?(""+t).trim():t+"px"}function Im(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Mm(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var N1=Ne({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 Au(e,t){if(t){if(N1[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 zu(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 Du=null;function qc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $u=null,Vr=null,Ur=null;function Of(e){if(e=Fs(e)){if(typeof $u!="function")throw Error(H(280));var t=e.stateNode;t&&(t=Kl(t),$u(e.stateNode,e.type,t))}}function Tm(e){Vr?Ur?Ur.push(e):Ur=[e]:Vr=e}function Rm(){if(Vr){var e=Vr,t=Ur;if(Ur=Vr=null,Of(e),t)for(e=0;e<t.length;e++)Of(t[e])}}function Lm(e,t){return e(t)}function Am(){}var Aa=!1;function zm(e,t,n){if(Aa)return e(t,n);Aa=!0;try{return Lm(e,t,n)}finally{Aa=!1,(Vr!==null||Ur!==null)&&(Am(),Rm())}}function fs(e,t){var n=e.stateNode;if(n===null)return null;var r=Kl(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 Ou=!1;if(cn)try{var Ro={};Object.defineProperty(Ro,"passive",{get:function(){Ou=!0}}),window.addEventListener("test",Ro,Ro),window.removeEventListener("test",Ro,Ro)}catch{Ou=!1}function S1(e,t,n,r,o,s,i,l,a){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(h){this.onError(h)}}var Jo=!1,sl=null,il=!1,Fu=null,k1={onError:function(e){Jo=!0,sl=e}};function b1(e,t,n,r,o,s,i,l,a){Jo=!1,sl=null,S1.apply(k1,arguments)}function E1(e,t,n,r,o,s,i,l,a){if(b1.apply(this,arguments),Jo){if(Jo){var c=sl;Jo=!1,sl=null}else throw Error(H(198));il||(il=!0,Fu=c)}}function Nr(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 Dm(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 Ff(e){if(Nr(e)!==e)throw Error(H(188))}function C1(e){var t=e.alternate;if(!t){if(t=Nr(e),t===null)throw Error(H(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var s=o.alternate;if(s===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===s.child){for(s=o.child;s;){if(s===n)return Ff(o),e;if(s===r)return Ff(o),t;s=s.sibling}throw Error(H(188))}if(n.return!==r.return)n=o,r=s;else{for(var i=!1,l=o.child;l;){if(l===n){i=!0,n=o,r=s;break}if(l===r){i=!0,r=o,n=s;break}l=l.sibling}if(!i){for(l=s.child;l;){if(l===n){i=!0,n=s,r=o;break}if(l===r){i=!0,r=s,n=o;break}l=l.sibling}if(!i)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 $m(e){return e=C1(e),e!==null?Om(e):null}function Om(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Om(e);if(t!==null)return t;e=e.sibling}return null}var Fm=ut.unstable_scheduleCallback,Hf=ut.unstable_cancelCallback,j1=ut.unstable_shouldYield,_1=ut.unstable_requestPaint,Ee=ut.unstable_now,P1=ut.unstable_getCurrentPriorityLevel,Zc=ut.unstable_ImmediatePriority,Hm=ut.unstable_UserBlockingPriority,ll=ut.unstable_NormalPriority,M1=ut.unstable_LowPriority,Bm=ut.unstable_IdlePriority,Wl=null,Bt=null;function I1(e){if(Bt&&typeof Bt.onCommitFiberRoot=="function")try{Bt.onCommitFiberRoot(Wl,e,void 0,(e.current.flags&128)===128)}catch{}}var Pt=Math.clz32?Math.clz32:L1,T1=Math.log,R1=Math.LN2;function L1(e){return e>>>=0,e===0?32:31-(T1(e)/R1|0)|0}var ii=64,li=4194304;function Xo(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 al(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,s=e.pingedLanes,i=n&268435455;if(i!==0){var l=i&~o;l!==0?r=Xo(l):(s&=i,s!==0&&(r=Xo(s)))}else i=n&~o,i!==0?r=Xo(i):s!==0&&(r=Xo(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,s=t&-t,o>=s||o===16&&(s&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-Pt(t),o=1<<n,r|=e[n],t&=~o;return r}function A1(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 z1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,s=e.pendingLanes;0<s;){var i=31-Pt(s),l=1<<i,a=o[i];a===-1?(!(l&n)||l&r)&&(o[i]=A1(l,t)):a<=t&&(e.expiredLanes|=l),s&=~l}}function Hu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Vm(){var e=ii;return ii<<=1,!(ii&4194240)&&(ii=64),e}function za(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $s(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Pt(t),e[t]=n}function D1(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 o=31-Pt(n),s=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~s}}function Jc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Pt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ue=0;function Um(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Wm,ed,Ym,Gm,Xm,Bu=!1,ai=[],In=null,Tn=null,Rn=null,hs=new Map,ps=new Map,Cn=[],$1="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 Bf(e,t){switch(e){case"focusin":case"focusout":In=null;break;case"dragenter":case"dragleave":Tn=null;break;case"mouseover":case"mouseout":Rn=null;break;case"pointerover":case"pointerout":hs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ps.delete(t.pointerId)}}function Lo(e,t,n,r,o,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[o]},t!==null&&(t=Fs(t),t!==null&&ed(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function O1(e,t,n,r,o){switch(t){case"focusin":return In=Lo(In,e,t,n,r,o),!0;case"dragenter":return Tn=Lo(Tn,e,t,n,r,o),!0;case"mouseover":return Rn=Lo(Rn,e,t,n,r,o),!0;case"pointerover":var s=o.pointerId;return hs.set(s,Lo(hs.get(s)||null,e,t,n,r,o)),!0;case"gotpointercapture":return s=o.pointerId,ps.set(s,Lo(ps.get(s)||null,e,t,n,r,o)),!0}return!1}function Km(e){var t=Jn(e.target);if(t!==null){var n=Nr(t);if(n!==null){if(t=n.tag,t===13){if(t=Dm(n),t!==null){e.blockedOn=t,Xm(e.priority,function(){Ym(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 $i(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Vu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Du=r,n.target.dispatchEvent(r),Du=null}else return t=Fs(n),t!==null&&ed(t),e.blockedOn=n,!1;t.shift()}return!0}function Vf(e,t,n){$i(e)&&n.delete(t)}function F1(){Bu=!1,In!==null&&$i(In)&&(In=null),Tn!==null&&$i(Tn)&&(Tn=null),Rn!==null&&$i(Rn)&&(Rn=null),hs.forEach(Vf),ps.forEach(Vf)}function Ao(e,t){e.blockedOn===t&&(e.blockedOn=null,Bu||(Bu=!0,ut.unstable_scheduleCallback(ut.unstable_NormalPriority,F1)))}function ms(e){function t(o){return Ao(o,e)}if(0<ai.length){Ao(ai[0],e);for(var n=1;n<ai.length;n++){var r=ai[n];r.blockedOn===e&&(r.blockedOn=null)}}for(In!==null&&Ao(In,e),Tn!==null&&Ao(Tn,e),Rn!==null&&Ao(Rn,e),hs.forEach(t),ps.forEach(t),n=0;n<Cn.length;n++)r=Cn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Cn.length&&(n=Cn[0],n.blockedOn===null);)Km(n),n.blockedOn===null&&Cn.shift()}var Wr=mn.ReactCurrentBatchConfig,ul=!0;function H1(e,t,n,r){var o=ue,s=Wr.transition;Wr.transition=null;try{ue=1,td(e,t,n,r)}finally{ue=o,Wr.transition=s}}function B1(e,t,n,r){var o=ue,s=Wr.transition;Wr.transition=null;try{ue=4,td(e,t,n,r)}finally{ue=o,Wr.transition=s}}function td(e,t,n,r){if(ul){var o=Vu(e,t,n,r);if(o===null)Ya(e,t,r,cl,n),Bf(e,r);else if(O1(o,e,t,n,r))r.stopPropagation();else if(Bf(e,r),t&4&&-1<$1.indexOf(e)){for(;o!==null;){var s=Fs(o);if(s!==null&&Wm(s),s=Vu(e,t,n,r),s===null&&Ya(e,t,r,cl,n),s===o)break;o=s}o!==null&&r.stopPropagation()}else Ya(e,t,r,null,n)}}var cl=null;function Vu(e,t,n,r){if(cl=null,e=qc(r),e=Jn(e),e!==null)if(t=Nr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Dm(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 cl=e,null}function Qm(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(P1()){case Zc:return 1;case Hm:return 4;case ll:case M1:return 16;case Bm:return 536870912;default:return 16}default:return 16}}var Pn=null,nd=null,Oi=null;function qm(){if(Oi)return Oi;var e,t=nd,n=t.length,r,o="value"in Pn?Pn.value:Pn.textContent,s=o.length;for(e=0;e<n&&t[e]===o[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===o[s-r];r++);return Oi=o.slice(e,1<r?1-r:void 0)}function Fi(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 ui(){return!0}function Uf(){return!1}function ft(e){function t(n,r,o,s,i){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=s,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?ui:Uf,this.isPropagationStopped=Uf,this}return Ne(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=ui)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ui)},persist:function(){},isPersistent:ui}),t}var vo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rd=ft(vo),Os=Ne({},vo,{view:0,detail:0}),V1=ft(Os),Da,$a,zo,Yl=Ne({},Os,{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!==zo&&(zo&&e.type==="mousemove"?(Da=e.screenX-zo.screenX,$a=e.screenY-zo.screenY):$a=Da=0,zo=e),Da)},movementY:function(e){return"movementY"in e?e.movementY:$a}}),Wf=ft(Yl),U1=Ne({},Yl,{dataTransfer:0}),W1=ft(U1),Y1=Ne({},Os,{relatedTarget:0}),Oa=ft(Y1),G1=Ne({},vo,{animationName:0,elapsedTime:0,pseudoElement:0}),X1=ft(G1),K1=Ne({},vo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Q1=ft(K1),q1=Ne({},vo,{data:0}),Yf=ft(q1),Z1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},J1={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"},e2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function t2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=e2[e])?!!t[e]:!1}function od(){return t2}var n2=Ne({},Os,{key:function(e){if(e.key){var t=Z1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?J1[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"?Fi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),r2=ft(n2),o2=Ne({},Yl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gf=ft(o2),s2=Ne({},Os,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:od}),i2=ft(s2),l2=Ne({},vo,{propertyName:0,elapsedTime:0,pseudoElement:0}),a2=ft(l2),u2=Ne({},Yl,{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}),c2=ft(u2),d2=[9,13,27,32],sd=cn&&"CompositionEvent"in window,es=null;cn&&"documentMode"in document&&(es=document.documentMode);var f2=cn&&"TextEvent"in window&&!es,Zm=cn&&(!sd||es&&8<es&&11>=es),Xf=" ",Kf=!1;function Jm(e,t){switch(e){case"keyup":return d2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function eg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Mr=!1;function h2(e,t){switch(e){case"compositionend":return eg(t);case"keypress":return t.which!==32?null:(Kf=!0,Xf);case"textInput":return e=t.data,e===Xf&&Kf?null:e;default:return null}}function p2(e,t){if(Mr)return e==="compositionend"||!sd&&Jm(e,t)?(e=qm(),Oi=nd=Pn=null,Mr=!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 Zm&&t.locale!=="ko"?null:t.data;default:return null}}var m2={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 Qf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!m2[e.type]:t==="textarea"}function tg(e,t,n,r){Tm(r),t=dl(t,"onChange"),0<t.length&&(n=new rd("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ts=null,gs=null;function g2(e){fg(e,0)}function Gl(e){var t=Rr(e);if(Em(t))return e}function x2(e,t){if(e==="change")return t}var ng=!1;if(cn){var Fa;if(cn){var Ha="oninput"in document;if(!Ha){var qf=document.createElement("div");qf.setAttribute("oninput","return;"),Ha=typeof qf.oninput=="function"}Fa=Ha}else Fa=!1;ng=Fa&&(!document.documentMode||9<document.documentMode)}function Zf(){ts&&(ts.detachEvent("onpropertychange",rg),gs=ts=null)}function rg(e){if(e.propertyName==="value"&&Gl(gs)){var t=[];tg(t,gs,e,qc(e)),zm(g2,t)}}function y2(e,t,n){e==="focusin"?(Zf(),ts=t,gs=n,ts.attachEvent("onpropertychange",rg)):e==="focusout"&&Zf()}function v2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Gl(gs)}function w2(e,t){if(e==="click")return Gl(t)}function N2(e,t){if(e==="input"||e==="change")return Gl(t)}function S2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var It=typeof Object.is=="function"?Object.is:S2;function xs(e,t){if(It(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 o=n[r];if(!Eu.call(t,o)||!It(e[o],t[o]))return!1}return!0}function Jf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function eh(e,t){var n=Jf(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=Jf(n)}}function og(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?og(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function sg(){for(var e=window,t=ol();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ol(e.document)}return t}function id(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 k2(e){var t=sg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&og(n.ownerDocument.documentElement,n)){if(r!==null&&id(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 o=n.textContent.length,s=Math.min(r.start,o);r=r.end===void 0?s:Math.min(r.end,o),!e.extend&&s>r&&(o=r,r=s,s=o),o=eh(n,s);var i=eh(n,r);o&&i&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),s>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 b2=cn&&"documentMode"in document&&11>=document.documentMode,Ir=null,Uu=null,ns=null,Wu=!1;function th(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Wu||Ir==null||Ir!==ol(r)||(r=Ir,"selectionStart"in r&&id(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}),ns&&xs(ns,r)||(ns=r,r=dl(Uu,"onSelect"),0<r.length&&(t=new rd("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ir)))}function ci(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Tr={animationend:ci("Animation","AnimationEnd"),animationiteration:ci("Animation","AnimationIteration"),animationstart:ci("Animation","AnimationStart"),transitionend:ci("Transition","TransitionEnd")},Ba={},ig={};cn&&(ig=document.createElement("div").style,"AnimationEvent"in window||(delete Tr.animationend.animation,delete Tr.animationiteration.animation,delete Tr.animationstart.animation),"TransitionEvent"in window||delete Tr.transitionend.transition);function Xl(e){if(Ba[e])return Ba[e];if(!Tr[e])return e;var t=Tr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ig)return Ba[e]=t[n];return e}var lg=Xl("animationend"),ag=Xl("animationiteration"),ug=Xl("animationstart"),cg=Xl("transitionend"),dg=new Map,nh="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 Yn(e,t){dg.set(e,t),wr(t,[e])}for(var Va=0;Va<nh.length;Va++){var Ua=nh[Va],E2=Ua.toLowerCase(),C2=Ua[0].toUpperCase()+Ua.slice(1);Yn(E2,"on"+C2)}Yn(lg,"onAnimationEnd");Yn(ag,"onAnimationIteration");Yn(ug,"onAnimationStart");Yn("dblclick","onDoubleClick");Yn("focusin","onFocus");Yn("focusout","onBlur");Yn(cg,"onTransitionEnd");Jr("onMouseEnter",["mouseout","mouseover"]);Jr("onMouseLeave",["mouseout","mouseover"]);Jr("onPointerEnter",["pointerout","pointerover"]);Jr("onPointerLeave",["pointerout","pointerover"]);wr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));wr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));wr("onBeforeInput",["compositionend","keypress","textInput","paste"]);wr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));wr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));wr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ko="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(" "),j2=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ko));function rh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,E1(r,t,void 0,e),e.currentTarget=null}function fg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],a=l.instance,c=l.currentTarget;if(l=l.listener,a!==s&&o.isPropagationStopped())break e;rh(o,l,c),s=a}else for(i=0;i<r.length;i++){if(l=r[i],a=l.instance,c=l.currentTarget,l=l.listener,a!==s&&o.isPropagationStopped())break e;rh(o,l,c),s=a}}}if(il)throw e=Fu,il=!1,Fu=null,e}function he(e,t){var n=t[Qu];n===void 0&&(n=t[Qu]=new Set);var r=e+"__bubble";n.has(r)||(hg(t,e,2,!1),n.add(r))}function Wa(e,t,n){var r=0;t&&(r|=4),hg(n,e,r,t)}var di="_reactListening"+Math.random().toString(36).slice(2);function ys(e){if(!e[di]){e[di]=!0,wm.forEach(function(n){n!=="selectionchange"&&(j2.has(n)||Wa(n,!1,e),Wa(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[di]||(t[di]=!0,Wa("selectionchange",!1,t))}}function hg(e,t,n,r){switch(Qm(t)){case 1:var o=H1;break;case 4:o=B1;break;default:o=td}n=o.bind(null,t,n,e),o=void 0,!Ou||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Ya(e,t,n,r,o){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(i===4)for(i=r.return;i!==null;){var a=i.tag;if((a===3||a===4)&&(a=i.stateNode.containerInfo,a===o||a.nodeType===8&&a.parentNode===o))return;i=i.return}for(;l!==null;){if(i=Jn(l),i===null)return;if(a=i.tag,a===5||a===6){r=s=i;continue e}l=l.parentNode}}r=r.return}zm(function(){var c=s,h=qc(n),f=[];e:{var d=dg.get(e);if(d!==void 0){var x=rd,y=e;switch(e){case"keypress":if(Fi(n)===0)break e;case"keydown":case"keyup":x=r2;break;case"focusin":y="focus",x=Oa;break;case"focusout":y="blur",x=Oa;break;case"beforeblur":case"afterblur":x=Oa;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=Wf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=W1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=i2;break;case lg:case ag:case ug:x=X1;break;case cg:x=a2;break;case"scroll":x=V1;break;case"wheel":x=c2;break;case"copy":case"cut":case"paste":x=Q1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Gf}var w=(t&4)!==0,S=!w&&e==="scroll",p=w?d!==null?d+"Capture":null:d;w=[];for(var v=c,g;v!==null;){g=v;var N=g.stateNode;if(g.tag===5&&N!==null&&(g=N,p!==null&&(N=fs(v,p),N!=null&&w.push(vs(v,N,g)))),S)break;v=v.return}0<w.length&&(d=new x(d,y,null,n,h),f.push({event:d,listeners:w}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",d&&n!==Du&&(y=n.relatedTarget||n.fromElement)&&(Jn(y)||y[dn]))break e;if((x||d)&&(d=h.window===h?h:(d=h.ownerDocument)?d.defaultView||d.parentWindow:window,x?(y=n.relatedTarget||n.toElement,x=c,y=y?Jn(y):null,y!==null&&(S=Nr(y),y!==S||y.tag!==5&&y.tag!==6)&&(y=null)):(x=null,y=c),x!==y)){if(w=Wf,N="onMouseLeave",p="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(w=Gf,N="onPointerLeave",p="onPointerEnter",v="pointer"),S=x==null?d:Rr(x),g=y==null?d:Rr(y),d=new w(N,v+"leave",x,n,h),d.target=S,d.relatedTarget=g,N=null,Jn(h)===c&&(w=new w(p,v+"enter",y,n,h),w.target=g,w.relatedTarget=S,N=w),S=N,x&&y)t:{for(w=x,p=y,v=0,g=w;g;g=kr(g))v++;for(g=0,N=p;N;N=kr(N))g++;for(;0<v-g;)w=kr(w),v--;for(;0<g-v;)p=kr(p),g--;for(;v--;){if(w===p||p!==null&&w===p.alternate)break t;w=kr(w),p=kr(p)}w=null}else w=null;x!==null&&oh(f,d,x,w,!1),y!==null&&S!==null&&oh(f,S,y,w,!0)}}e:{if(d=c?Rr(c):window,x=d.nodeName&&d.nodeName.toLowerCase(),x==="select"||x==="input"&&d.type==="file")var k=x2;else if(Qf(d))if(ng)k=N2;else{k=v2;var b=y2}else(x=d.nodeName)&&x.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(k=w2);if(k&&(k=k(e,c))){tg(f,k,n,h);break e}b&&b(e,d,c),e==="focusout"&&(b=d._wrapperState)&&b.controlled&&d.type==="number"&&Tu(d,"number",d.value)}switch(b=c?Rr(c):window,e){case"focusin":(Qf(b)||b.contentEditable==="true")&&(Ir=b,Uu=c,ns=null);break;case"focusout":ns=Uu=Ir=null;break;case"mousedown":Wu=!0;break;case"contextmenu":case"mouseup":case"dragend":Wu=!1,th(f,n,h);break;case"selectionchange":if(b2)break;case"keydown":case"keyup":th(f,n,h)}var E;if(sd)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else Mr?Jm(e,n)&&(_="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(Zm&&n.locale!=="ko"&&(Mr||_!=="onCompositionStart"?_==="onCompositionEnd"&&Mr&&(E=qm()):(Pn=h,nd="value"in Pn?Pn.value:Pn.textContent,Mr=!0)),b=dl(c,_),0<b.length&&(_=new Yf(_,e,null,n,h),f.push({event:_,listeners:b}),E?_.data=E:(E=eg(n),E!==null&&(_.data=E)))),(E=f2?h2(e,n):p2(e,n))&&(c=dl(c,"onBeforeInput"),0<c.length&&(h=new Yf("onBeforeInput","beforeinput",null,n,h),f.push({event:h,listeners:c}),h.data=E))}fg(f,t)})}function vs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function dl(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,s=o.stateNode;o.tag===5&&s!==null&&(o=s,s=fs(e,n),s!=null&&r.unshift(vs(e,s,o)),s=fs(e,t),s!=null&&r.push(vs(e,s,o))),e=e.return}return r}function kr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function oh(e,t,n,r,o){for(var s=t._reactName,i=[];n!==null&&n!==r;){var l=n,a=l.alternate,c=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&c!==null&&(l=c,o?(a=fs(n,s),a!=null&&i.unshift(vs(n,a,l))):o||(a=fs(n,s),a!=null&&i.push(vs(n,a,l)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var _2=/\r\n?/g,P2=/\u0000|\uFFFD/g;function sh(e){return(typeof e=="string"?e:""+e).replace(_2,`
38
- `).replace(P2,"")}function fi(e,t,n){if(t=sh(t),sh(e)!==t&&n)throw Error(H(425))}function fl(){}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 Ku=typeof setTimeout=="function"?setTimeout:void 0,M2=typeof clearTimeout=="function"?clearTimeout:void 0,ih=typeof Promise=="function"?Promise:void 0,I2=typeof queueMicrotask=="function"?queueMicrotask:typeof ih<"u"?function(e){return ih.resolve(null).then(e).catch(T2)}:Ku;function T2(e){setTimeout(function(){throw e})}function Ga(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),ms(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);ms(t)}function Ln(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 lh(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 wo=Math.random().toString(36).slice(2),Ft="__reactFiber$"+wo,ws="__reactProps$"+wo,dn="__reactContainer$"+wo,Qu="__reactEvents$"+wo,R2="__reactListeners$"+wo,L2="__reactHandles$"+wo;function Jn(e){var t=e[Ft];if(t)return t;for(var n=e.parentNode;n;){if(t=n[dn]||n[Ft]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=lh(e);e!==null;){if(n=e[Ft])return n;e=lh(e)}return t}e=n,n=e.parentNode}return null}function Fs(e){return e=e[Ft]||e[dn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Rr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function Kl(e){return e[ws]||null}var qu=[],Lr=-1;function Gn(e){return{current:e}}function pe(e){0>Lr||(e.current=qu[Lr],qu[Lr]=null,Lr--)}function ce(e,t){Lr++,qu[Lr]=e.current,e.current=t}var Hn={},Ye=Gn(Hn),nt=Gn(!1),ur=Hn;function eo(e,t){var n=e.type.contextTypes;if(!n)return Hn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},s;for(s in n)o[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function rt(e){return e=e.childContextTypes,e!=null}function hl(){pe(nt),pe(Ye)}function ah(e,t,n){if(Ye.current!==Hn)throw Error(H(168));ce(Ye,t),ce(nt,n)}function pg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(H(108,y1(e)||"Unknown",o));return Ne({},n,r)}function pl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Hn,ur=Ye.current,ce(Ye,e),ce(nt,nt.current),!0}function uh(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=pg(e,t,ur),r.__reactInternalMemoizedMergedChildContext=e,pe(nt),pe(Ye),ce(Ye,e)):pe(nt),ce(nt,n)}var nn=null,Ql=!1,Xa=!1;function mg(e){nn===null?nn=[e]:nn.push(e)}function A2(e){Ql=!0,mg(e)}function Xn(){if(!Xa&&nn!==null){Xa=!0;var e=0,t=ue;try{var n=nn;for(ue=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}nn=null,Ql=!1}catch(o){throw nn!==null&&(nn=nn.slice(e+1)),Fm(Zc,Xn),o}finally{ue=t,Xa=!1}}return null}var Ar=[],zr=0,ml=null,gl=0,ht=[],pt=0,cr=null,rn=1,on="";function Qn(e,t){Ar[zr++]=gl,Ar[zr++]=ml,ml=e,gl=t}function gg(e,t,n){ht[pt++]=rn,ht[pt++]=on,ht[pt++]=cr,cr=e;var r=rn;e=on;var o=32-Pt(r)-1;r&=~(1<<o),n+=1;var s=32-Pt(t)+o;if(30<s){var i=o-o%5;s=(r&(1<<i)-1).toString(32),r>>=i,o-=i,rn=1<<32-Pt(t)+o|n<<o|r,on=s+e}else rn=1<<s|n<<o|r,on=e}function ld(e){e.return!==null&&(Qn(e,1),gg(e,1,0))}function ad(e){for(;e===ml;)ml=Ar[--zr],Ar[zr]=null,gl=Ar[--zr],Ar[zr]=null;for(;e===cr;)cr=ht[--pt],ht[pt]=null,on=ht[--pt],ht[pt]=null,rn=ht[--pt],ht[pt]=null}var at=null,lt=null,me=!1,Et=null;function xg(e,t){var n=mt(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 ch(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,at=e,lt=Ln(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,at=e,lt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=cr!==null?{id:rn,overflow:on}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=mt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,at=e,lt=null,!0):!1;default:return!1}}function Zu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ju(e){if(me){var t=lt;if(t){var n=t;if(!ch(e,t)){if(Zu(e))throw Error(H(418));t=Ln(n.nextSibling);var r=at;t&&ch(e,t)?xg(r,n):(e.flags=e.flags&-4097|2,me=!1,at=e)}}else{if(Zu(e))throw Error(H(418));e.flags=e.flags&-4097|2,me=!1,at=e}}}function dh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;at=e}function hi(e){if(e!==at)return!1;if(!me)return dh(e),me=!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=lt)){if(Zu(e))throw yg(),Error(H(418));for(;t;)xg(e,t),t=Ln(t.nextSibling)}if(dh(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){lt=Ln(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}lt=null}}else lt=at?Ln(e.stateNode.nextSibling):null;return!0}function yg(){for(var e=lt;e;)e=Ln(e.nextSibling)}function to(){lt=at=null,me=!1}function ud(e){Et===null?Et=[e]:Et.push(e)}var z2=mn.ReactCurrentBatchConfig;function Do(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 o=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(i){var l=o.refs;i===null?delete l[s]:l[s]=i},t._stringRef=s,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 fh(e){var t=e._init;return t(e._payload)}function vg(e){function t(p,v){if(e){var g=p.deletions;g===null?(p.deletions=[v],p.flags|=16):g.push(v)}}function n(p,v){if(!e)return null;for(;v!==null;)t(p,v),v=v.sibling;return null}function r(p,v){for(p=new Map;v!==null;)v.key!==null?p.set(v.key,v):p.set(v.index,v),v=v.sibling;return p}function o(p,v){return p=$n(p,v),p.index=0,p.sibling=null,p}function s(p,v,g){return p.index=g,e?(g=p.alternate,g!==null?(g=g.index,g<v?(p.flags|=2,v):g):(p.flags|=2,v)):(p.flags|=1048576,v)}function i(p){return e&&p.alternate===null&&(p.flags|=2),p}function l(p,v,g,N){return v===null||v.tag!==6?(v=tu(g,p.mode,N),v.return=p,v):(v=o(v,g),v.return=p,v)}function a(p,v,g,N){var k=g.type;return k===Pr?h(p,v,g.props.children,N,g.key):v!==null&&(v.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===bn&&fh(k)===v.type)?(N=o(v,g.props),N.ref=Do(p,v,g),N.return=p,N):(N=Gi(g.type,g.key,g.props,null,p.mode,N),N.ref=Do(p,v,g),N.return=p,N)}function c(p,v,g,N){return v===null||v.tag!==4||v.stateNode.containerInfo!==g.containerInfo||v.stateNode.implementation!==g.implementation?(v=nu(g,p.mode,N),v.return=p,v):(v=o(v,g.children||[]),v.return=p,v)}function h(p,v,g,N,k){return v===null||v.tag!==7?(v=sr(g,p.mode,N,k),v.return=p,v):(v=o(v,g),v.return=p,v)}function f(p,v,g){if(typeof v=="string"&&v!==""||typeof v=="number")return v=tu(""+v,p.mode,g),v.return=p,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case ri:return g=Gi(v.type,v.key,v.props,null,p.mode,g),g.ref=Do(p,null,v),g.return=p,g;case _r:return v=nu(v,p.mode,g),v.return=p,v;case bn:var N=v._init;return f(p,N(v._payload),g)}if(Go(v)||To(v))return v=sr(v,p.mode,g,null),v.return=p,v;pi(p,v)}return null}function d(p,v,g,N){var k=v!==null?v.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return k!==null?null:l(p,v,""+g,N);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ri:return g.key===k?a(p,v,g,N):null;case _r:return g.key===k?c(p,v,g,N):null;case bn:return k=g._init,d(p,v,k(g._payload),N)}if(Go(g)||To(g))return k!==null?null:h(p,v,g,N,null);pi(p,g)}return null}function x(p,v,g,N,k){if(typeof N=="string"&&N!==""||typeof N=="number")return p=p.get(g)||null,l(v,p,""+N,k);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case ri:return p=p.get(N.key===null?g:N.key)||null,a(v,p,N,k);case _r:return p=p.get(N.key===null?g:N.key)||null,c(v,p,N,k);case bn:var b=N._init;return x(p,v,g,b(N._payload),k)}if(Go(N)||To(N))return p=p.get(g)||null,h(v,p,N,k,null);pi(v,N)}return null}function y(p,v,g,N){for(var k=null,b=null,E=v,_=v=0,I=null;E!==null&&_<g.length;_++){E.index>_?(I=E,E=null):I=E.sibling;var D=d(p,E,g[_],N);if(D===null){E===null&&(E=I);break}e&&E&&D.alternate===null&&t(p,E),v=s(D,v,_),b===null?k=D:b.sibling=D,b=D,E=I}if(_===g.length)return n(p,E),me&&Qn(p,_),k;if(E===null){for(;_<g.length;_++)E=f(p,g[_],N),E!==null&&(v=s(E,v,_),b===null?k=E:b.sibling=E,b=E);return me&&Qn(p,_),k}for(E=r(p,E);_<g.length;_++)I=x(E,p,_,g[_],N),I!==null&&(e&&I.alternate!==null&&E.delete(I.key===null?_:I.key),v=s(I,v,_),b===null?k=I:b.sibling=I,b=I);return e&&E.forEach(function(R){return t(p,R)}),me&&Qn(p,_),k}function w(p,v,g,N){var k=To(g);if(typeof k!="function")throw Error(H(150));if(g=k.call(g),g==null)throw Error(H(151));for(var b=k=null,E=v,_=v=0,I=null,D=g.next();E!==null&&!D.done;_++,D=g.next()){E.index>_?(I=E,E=null):I=E.sibling;var R=d(p,E,D.value,N);if(R===null){E===null&&(E=I);break}e&&E&&R.alternate===null&&t(p,E),v=s(R,v,_),b===null?k=R:b.sibling=R,b=R,E=I}if(D.done)return n(p,E),me&&Qn(p,_),k;if(E===null){for(;!D.done;_++,D=g.next())D=f(p,D.value,N),D!==null&&(v=s(D,v,_),b===null?k=D:b.sibling=D,b=D);return me&&Qn(p,_),k}for(E=r(p,E);!D.done;_++,D=g.next())D=x(E,p,_,D.value,N),D!==null&&(e&&D.alternate!==null&&E.delete(D.key===null?_:D.key),v=s(D,v,_),b===null?k=D:b.sibling=D,b=D);return e&&E.forEach(function(T){return t(p,T)}),me&&Qn(p,_),k}function S(p,v,g,N){if(typeof g=="object"&&g!==null&&g.type===Pr&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case ri:e:{for(var k=g.key,b=v;b!==null;){if(b.key===k){if(k=g.type,k===Pr){if(b.tag===7){n(p,b.sibling),v=o(b,g.props.children),v.return=p,p=v;break e}}else if(b.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===bn&&fh(k)===b.type){n(p,b.sibling),v=o(b,g.props),v.ref=Do(p,b,g),v.return=p,p=v;break e}n(p,b);break}else t(p,b);b=b.sibling}g.type===Pr?(v=sr(g.props.children,p.mode,N,g.key),v.return=p,p=v):(N=Gi(g.type,g.key,g.props,null,p.mode,N),N.ref=Do(p,v,g),N.return=p,p=N)}return i(p);case _r:e:{for(b=g.key;v!==null;){if(v.key===b)if(v.tag===4&&v.stateNode.containerInfo===g.containerInfo&&v.stateNode.implementation===g.implementation){n(p,v.sibling),v=o(v,g.children||[]),v.return=p,p=v;break e}else{n(p,v);break}else t(p,v);v=v.sibling}v=nu(g,p.mode,N),v.return=p,p=v}return i(p);case bn:return b=g._init,S(p,v,b(g._payload),N)}if(Go(g))return y(p,v,g,N);if(To(g))return w(p,v,g,N);pi(p,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,v!==null&&v.tag===6?(n(p,v.sibling),v=o(v,g),v.return=p,p=v):(n(p,v),v=tu(g,p.mode,N),v.return=p,p=v),i(p)):n(p,v)}return S}var no=vg(!0),wg=vg(!1),xl=Gn(null),yl=null,Dr=null,cd=null;function dd(){cd=Dr=yl=null}function fd(e){var t=xl.current;pe(xl),e._currentValue=t}function ec(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 Yr(e,t){yl=e,cd=Dr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(et=!0),e.firstContext=null)}function xt(e){var t=e._currentValue;if(cd!==e)if(e={context:e,memoizedValue:t,next:null},Dr===null){if(yl===null)throw Error(H(308));Dr=e,yl.dependencies={lanes:0,firstContext:e}}else Dr=Dr.next=e;return t}var er=null;function hd(e){er===null?er=[e]:er.push(e)}function Ng(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,hd(t)):(n.next=o.next,o.next=n),t.interleaved=n,fn(e,r)}function fn(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 En=!1;function pd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Sg(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 ln(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function An(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ie&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,fn(e,n)}return o=r.interleaved,o===null?(t.next=t,hd(r)):(t.next=o.next,o.next=t),r.interleaved=t,fn(e,n)}function Hi(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,Jc(e,n)}}function hh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,s=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};s===null?o=s=i:s=s.next=i,n=n.next}while(n!==null);s===null?o=s=t:s=s.next=t}else o=s=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:s,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 vl(e,t,n,r){var o=e.updateQueue;En=!1;var s=o.firstBaseUpdate,i=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var a=l,c=a.next;a.next=null,i===null?s=c:i.next=c,i=a;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==i&&(l===null?h.firstBaseUpdate=c:l.next=c,h.lastBaseUpdate=a))}if(s!==null){var f=o.baseState;i=0,h=c=a=null,l=s;do{var d=l.lane,x=l.eventTime;if((r&d)===d){h!==null&&(h=h.next={eventTime:x,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,w=l;switch(d=t,x=n,w.tag){case 1:if(y=w.payload,typeof y=="function"){f=y.call(x,f,d);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=w.payload,d=typeof y=="function"?y.call(x,f,d):y,d==null)break e;f=Ne({},f,d);break e;case 2:En=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,d=o.effects,d===null?o.effects=[l]:d.push(l))}else x={eventTime:x,lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(c=h=x,a=f):h=h.next=x,i|=d;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;d=l,l=d.next,d.next=null,o.lastBaseUpdate=d,o.shared.pending=null}}while(!0);if(h===null&&(a=f),o.baseState=a,o.firstBaseUpdate=c,o.lastBaseUpdate=h,t=o.shared.interleaved,t!==null){o=t;do i|=o.lane,o=o.next;while(o!==t)}else s===null&&(o.shared.lanes=0);fr|=i,e.lanes=i,e.memoizedState=f}}function ph(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(H(191,o));o.call(r)}}}var Hs={},Vt=Gn(Hs),Ns=Gn(Hs),Ss=Gn(Hs);function tr(e){if(e===Hs)throw Error(H(174));return e}function md(e,t){switch(ce(Ss,t),ce(Ns,e),ce(Vt,Hs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Lu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Lu(t,e)}pe(Vt),ce(Vt,t)}function ro(){pe(Vt),pe(Ns),pe(Ss)}function kg(e){tr(Ss.current);var t=tr(Vt.current),n=Lu(t,e.type);t!==n&&(ce(Ns,e),ce(Vt,n))}function gd(e){Ns.current===e&&(pe(Vt),pe(Ns))}var ve=Gn(0);function wl(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 Ka=[];function xd(){for(var e=0;e<Ka.length;e++)Ka[e]._workInProgressVersionPrimary=null;Ka.length=0}var Bi=mn.ReactCurrentDispatcher,Qa=mn.ReactCurrentBatchConfig,dr=0,we=null,Me=null,Le=null,Nl=!1,rs=!1,ks=0,D2=0;function Ve(){throw Error(H(321))}function yd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!It(e[n],t[n]))return!1;return!0}function vd(e,t,n,r,o,s){if(dr=s,we=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Bi.current=e===null||e.memoizedState===null?H2:B2,e=n(r,o),rs){s=0;do{if(rs=!1,ks=0,25<=s)throw Error(H(301));s+=1,Le=Me=null,t.updateQueue=null,Bi.current=V2,e=n(r,o)}while(rs)}if(Bi.current=Sl,t=Me!==null&&Me.next!==null,dr=0,Le=Me=we=null,Nl=!1,t)throw Error(H(300));return e}function wd(){var e=ks!==0;return ks=0,e}function Dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Le===null?we.memoizedState=Le=e:Le=Le.next=e,Le}function yt(){if(Me===null){var e=we.alternate;e=e!==null?e.memoizedState:null}else e=Me.next;var t=Le===null?we.memoizedState:Le.next;if(t!==null)Le=t,Me=e;else{if(e===null)throw Error(H(310));Me=e,e={memoizedState:Me.memoizedState,baseState:Me.baseState,baseQueue:Me.baseQueue,queue:Me.queue,next:null},Le===null?we.memoizedState=Le=e:Le=Le.next=e}return Le}function bs(e,t){return typeof t=="function"?t(e):t}function qa(e){var t=yt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=Me,o=r.baseQueue,s=n.pending;if(s!==null){if(o!==null){var i=o.next;o.next=s.next,s.next=i}r.baseQueue=o=s,n.pending=null}if(o!==null){s=o.next,r=r.baseState;var l=i=null,a=null,c=s;do{var h=c.lane;if((dr&h)===h)a!==null&&(a=a.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 f={lane:h,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};a===null?(l=a=f,i=r):a=a.next=f,we.lanes|=h,fr|=h}c=c.next}while(c!==null&&c!==s);a===null?i=r:a.next=l,It(r,t.memoizedState)||(et=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do s=o.lane,we.lanes|=s,fr|=s,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Za(e){var t=yt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,s=t.memoizedState;if(o!==null){n.pending=null;var i=o=o.next;do s=e(s,i.action),i=i.next;while(i!==o);It(s,t.memoizedState)||(et=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function bg(){}function Eg(e,t){var n=we,r=yt(),o=t(),s=!It(r.memoizedState,o);if(s&&(r.memoizedState=o,et=!0),r=r.queue,Nd(_g.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Le!==null&&Le.memoizedState.tag&1){if(n.flags|=2048,Es(9,jg.bind(null,n,r,o,t),void 0,null),Ae===null)throw Error(H(349));dr&30||Cg(n,t,o)}return o}function Cg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=we.updateQueue,t===null?(t={lastEffect:null,stores:null},we.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function jg(e,t,n,r){t.value=n,t.getSnapshot=r,Pg(t)&&Mg(e)}function _g(e,t,n){return n(function(){Pg(t)&&Mg(e)})}function Pg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!It(e,n)}catch{return!0}}function Mg(e){var t=fn(e,1);t!==null&&Mt(t,e,1,-1)}function mh(e){var t=Dt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:e},t.queue=e,e=e.dispatch=F2.bind(null,we,e),[t.memoizedState,e]}function Es(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=we.updateQueue,t===null?(t={lastEffect:null,stores:null},we.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 Ig(){return yt().memoizedState}function Vi(e,t,n,r){var o=Dt();we.flags|=e,o.memoizedState=Es(1|t,n,void 0,r===void 0?null:r)}function ql(e,t,n,r){var o=yt();r=r===void 0?null:r;var s=void 0;if(Me!==null){var i=Me.memoizedState;if(s=i.destroy,r!==null&&yd(r,i.deps)){o.memoizedState=Es(t,n,s,r);return}}we.flags|=e,o.memoizedState=Es(1|t,n,s,r)}function gh(e,t){return Vi(8390656,8,e,t)}function Nd(e,t){return ql(2048,8,e,t)}function Tg(e,t){return ql(4,2,e,t)}function Rg(e,t){return ql(4,4,e,t)}function Lg(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 Ag(e,t,n){return n=n!=null?n.concat([e]):null,ql(4,4,Lg.bind(null,t,e),n)}function Sd(){}function zg(e,t){var n=yt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&yd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Dg(e,t){var n=yt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&yd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function $g(e,t,n){return dr&21?(It(n,t)||(n=Vm(),we.lanes|=n,fr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,et=!0),e.memoizedState=n)}function $2(e,t){var n=ue;ue=n!==0&&4>n?n:4,e(!0);var r=Qa.transition;Qa.transition={};try{e(!1),t()}finally{ue=n,Qa.transition=r}}function Og(){return yt().memoizedState}function O2(e,t,n){var r=Dn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Fg(e))Hg(t,n);else if(n=Ng(e,t,n,r),n!==null){var o=Ke();Mt(n,e,r,o),Bg(n,t,r)}}function F2(e,t,n){var r=Dn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fg(e))Hg(t,o);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,l=s(i,n);if(o.hasEagerState=!0,o.eagerState=l,It(l,i)){var a=t.interleaved;a===null?(o.next=o,hd(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=Ng(e,t,o,r),n!==null&&(o=Ke(),Mt(n,e,r,o),Bg(n,t,r))}}function Fg(e){var t=e.alternate;return e===we||t!==null&&t===we}function Hg(e,t){rs=Nl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Bg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jc(e,n)}}var Sl={readContext:xt,useCallback:Ve,useContext:Ve,useEffect:Ve,useImperativeHandle:Ve,useInsertionEffect:Ve,useLayoutEffect:Ve,useMemo:Ve,useReducer:Ve,useRef:Ve,useState:Ve,useDebugValue:Ve,useDeferredValue:Ve,useTransition:Ve,useMutableSource:Ve,useSyncExternalStore:Ve,useId:Ve,unstable_isNewReconciler:!1},H2={readContext:xt,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:xt,useEffect:gh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Vi(4194308,4,Lg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vi(4194308,4,e,t)},useInsertionEffect:function(e,t){return Vi(4,2,e,t)},useMemo:function(e,t){var n=Dt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Dt();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=O2.bind(null,we,e),[r.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:mh,useDebugValue:Sd,useDeferredValue:function(e){return Dt().memoizedState=e},useTransition:function(){var e=mh(!1),t=e[0];return e=$2.bind(null,e[1]),Dt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=we,o=Dt();if(me){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),Ae===null)throw Error(H(349));dr&30||Cg(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,gh(_g.bind(null,r,s,e),[e]),r.flags|=2048,Es(9,jg.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Dt(),t=Ae.identifierPrefix;if(me){var n=on,r=rn;n=(r&~(1<<32-Pt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ks++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=D2++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},B2={readContext:xt,useCallback:zg,useContext:xt,useEffect:Nd,useImperativeHandle:Ag,useInsertionEffect:Tg,useLayoutEffect:Rg,useMemo:Dg,useReducer:qa,useRef:Ig,useState:function(){return qa(bs)},useDebugValue:Sd,useDeferredValue:function(e){var t=yt();return $g(t,Me.memoizedState,e)},useTransition:function(){var e=qa(bs)[0],t=yt().memoizedState;return[e,t]},useMutableSource:bg,useSyncExternalStore:Eg,useId:Og,unstable_isNewReconciler:!1},V2={readContext:xt,useCallback:zg,useContext:xt,useEffect:Nd,useImperativeHandle:Ag,useInsertionEffect:Tg,useLayoutEffect:Rg,useMemo:Dg,useReducer:Za,useRef:Ig,useState:function(){return Za(bs)},useDebugValue:Sd,useDeferredValue:function(e){var t=yt();return Me===null?t.memoizedState=e:$g(t,Me.memoizedState,e)},useTransition:function(){var e=Za(bs)[0],t=yt().memoizedState;return[e,t]},useMutableSource:bg,useSyncExternalStore:Eg,useId:Og,unstable_isNewReconciler:!1};function St(e,t){if(e&&e.defaultProps){t=Ne({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function tc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ne({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Zl={isMounted:function(e){return(e=e._reactInternals)?Nr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ke(),o=Dn(e),s=ln(r,o);s.payload=t,n!=null&&(s.callback=n),t=An(e,s,o),t!==null&&(Mt(t,e,o,r),Hi(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ke(),o=Dn(e),s=ln(r,o);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=An(e,s,o),t!==null&&(Mt(t,e,o,r),Hi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ke(),r=Dn(e),o=ln(n,r);o.tag=2,t!=null&&(o.callback=t),t=An(e,o,r),t!==null&&(Mt(t,e,r,n),Hi(t,e,r))}};function xh(e,t,n,r,o,s,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,i):t.prototype&&t.prototype.isPureReactComponent?!xs(n,r)||!xs(o,s):!0}function Vg(e,t,n){var r=!1,o=Hn,s=t.contextType;return typeof s=="object"&&s!==null?s=xt(s):(o=rt(t)?ur:Ye.current,r=t.contextTypes,s=(r=r!=null)?eo(e,o):Hn),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Zl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=s),t}function yh(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&&Zl.enqueueReplaceState(t,t.state,null)}function nc(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},pd(e);var s=t.contextType;typeof s=="object"&&s!==null?o.context=xt(s):(s=rt(t)?ur:Ye.current,o.context=eo(e,s)),o.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(tc(e,t,s,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Zl.enqueueReplaceState(o,o.state,null),vl(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function oo(e,t){try{var n="",r=t;do n+=x1(r),r=r.return;while(r);var o=n}catch(s){o=`
39
- Error generating stack: `+s.message+`
40
- `+s.stack}return{value:e,source:t,stack:o,digest:null}}function Ja(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function rc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var U2=typeof WeakMap=="function"?WeakMap:Map;function Ug(e,t,n){n=ln(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){bl||(bl=!0,hc=r),rc(e,t)},n}function Wg(e,t,n){n=ln(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){rc(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){rc(e,t),typeof r!="function"&&(zn===null?zn=new Set([this]):zn.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function vh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new U2;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=oN.bind(null,e,t,n),t.then(e,e))}function wh(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 Nh(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,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=ln(-1,1),t.tag=2,An(n,t,1))),n.lanes|=1),e)}var W2=mn.ReactCurrentOwner,et=!1;function Xe(e,t,n,r){t.child=e===null?wg(t,null,n,r):no(t,e.child,n,r)}function Sh(e,t,n,r,o){n=n.render;var s=t.ref;return Yr(t,o),r=vd(e,t,n,r,s,o),n=wd(),e!==null&&!et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,hn(e,t,o)):(me&&n&&ld(t),t.flags|=1,Xe(e,t,r,o),t.child)}function kh(e,t,n,r,o){if(e===null){var s=n.type;return typeof s=="function"&&!Md(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Yg(e,t,s,r,o)):(e=Gi(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&o)){var i=s.memoizedProps;if(n=n.compare,n=n!==null?n:xs,n(i,r)&&e.ref===t.ref)return hn(e,t,o)}return t.flags|=1,e=$n(s,r),e.ref=t.ref,e.return=t,t.child=e}function Yg(e,t,n,r,o){if(e!==null){var s=e.memoizedProps;if(xs(s,r)&&e.ref===t.ref)if(et=!1,t.pendingProps=r=s,(e.lanes&o)!==0)e.flags&131072&&(et=!0);else return t.lanes=e.lanes,hn(e,t,o)}return oc(e,t,n,r,o)}function Gg(e,t,n){var r=t.pendingProps,o=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ce(Or,st),st|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ce(Or,st),st|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,ce(Or,st),st|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,ce(Or,st),st|=r;return Xe(e,t,o,n),t.child}function Xg(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,o){var s=rt(n)?ur:Ye.current;return s=eo(t,s),Yr(t,o),n=vd(e,t,n,r,s,o),r=wd(),e!==null&&!et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,hn(e,t,o)):(me&&r&&ld(t),t.flags|=1,Xe(e,t,n,o),t.child)}function bh(e,t,n,r,o){if(rt(n)){var s=!0;pl(t)}else s=!1;if(Yr(t,o),t.stateNode===null)Ui(e,t),Vg(t,n,r),nc(t,n,r,o),r=!0;else if(e===null){var i=t.stateNode,l=t.memoizedProps;i.props=l;var a=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=xt(c):(c=rt(n)?ur:Ye.current,c=eo(t,c));var h=n.getDerivedStateFromProps,f=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==r||a!==c)&&yh(t,i,r,c),En=!1;var d=t.memoizedState;i.state=d,vl(t,r,i,o),a=t.memoizedState,l!==r||d!==a||nt.current||En?(typeof h=="function"&&(tc(t,n,h,r),a=t.memoizedState),(l=En||xh(t,n,l,r,d,a,c))?(f||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=a),i.props=r,i.state=a,i.context=c,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Sg(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:St(t.type,l),i.props=c,f=t.pendingProps,d=i.context,a=n.contextType,typeof a=="object"&&a!==null?a=xt(a):(a=rt(n)?ur:Ye.current,a=eo(t,a));var x=n.getDerivedStateFromProps;(h=typeof x=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==f||d!==a)&&yh(t,i,r,a),En=!1,d=t.memoizedState,i.state=d,vl(t,r,i,o);var y=t.memoizedState;l!==f||d!==y||nt.current||En?(typeof x=="function"&&(tc(t,n,x,r),y=t.memoizedState),(c=En||xh(t,n,c,r,d,y,a)||!1)?(h||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,y,a),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,y,a)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),i.props=r,i.state=y,i.context=a,r=c):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return sc(e,t,n,r,s,o)}function sc(e,t,n,r,o,s){Xg(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return o&&uh(t,n,!1),hn(e,t,s);r=t.stateNode,W2.current=t;var l=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=no(t,e.child,null,s),t.child=no(t,null,l,s)):Xe(e,t,l,s),t.memoizedState=r.state,o&&uh(t,n,!0),t.child}function Kg(e){var t=e.stateNode;t.pendingContext?ah(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ah(e,t.context,!1),md(e,t.containerInfo)}function Eh(e,t,n,r,o){return to(),ud(o),t.flags|=256,Xe(e,t,n,r),t.child}var ic={dehydrated:null,treeContext:null,retryLane:0};function lc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Qg(e,t,n){var r=t.pendingProps,o=ve.current,s=!1,i=(t.flags&128)!==0,l;if((l=i)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ce(ve,o&1),e===null)return Ju(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,s?(r=t.mode,s=t.child,i={mode:"hidden",children:i},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=i):s=ta(i,r,0,null),e=sr(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=lc(n),t.memoizedState=ic,e):kd(t,i));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return Y2(e,t,i,r,l,o,n);if(s){s=r.fallback,i=t.mode,o=e.child,l=o.sibling;var a={mode:"hidden",children:r.children};return!(i&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=$n(o,a),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?s=$n(l,s):(s=sr(s,i,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,i=e.child.memoizedState,i=i===null?lc(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},s.memoizedState=i,s.childLanes=e.childLanes&~n,t.memoizedState=ic,r}return s=e.child,e=s.sibling,r=$n(s,{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=ta({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function mi(e,t,n,r){return r!==null&&ud(r),no(t,e.child,null,n),e=kd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Y2(e,t,n,r,o,s,i){if(n)return t.flags&256?(t.flags&=-257,r=Ja(Error(H(422))),mi(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,o=t.mode,r=ta({mode:"visible",children:r.children},o,0,null),s=sr(s,o,i,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&no(t,e.child,null,i),t.child.memoizedState=lc(i),t.memoizedState=ic,s);if(!(t.mode&1))return mi(e,t,i,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,s=Error(H(419)),r=Ja(s,r,void 0),mi(e,t,i,r)}if(l=(i&e.childLanes)!==0,et||l){if(r=Ae,r!==null){switch(i&-i){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|i)?0:o,o!==0&&o!==s.retryLane&&(s.retryLane=o,fn(e,o),Mt(r,e,o,-1))}return Pd(),r=Ja(Error(H(421))),mi(e,t,i,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=sN.bind(null,e),o._reactRetry=t,null):(e=s.treeContext,lt=Ln(o.nextSibling),at=t,me=!0,Et=null,e!==null&&(ht[pt++]=rn,ht[pt++]=on,ht[pt++]=cr,rn=e.id,on=e.overflow,cr=t),t=kd(t,r.children),t.flags|=4096,t)}function Ch(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ec(e.return,t,n)}function eu(e,t,n,r,o){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=o)}function qg(e,t,n){var r=t.pendingProps,o=r.revealOrder,s=r.tail;if(Xe(e,t,r.children,n),r=ve.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&&Ch(e,n,t);else if(e.tag===19)Ch(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(ce(ve,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&wl(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),eu(t,!1,o,n,s);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&wl(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}eu(t,!0,n,null,s);break;case"together":eu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ui(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function hn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),fr|=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=$n(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$n(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function G2(e,t,n){switch(t.tag){case 3:Kg(t),to();break;case 5:kg(t);break;case 1:rt(t.type)&&pl(t);break;case 4:md(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ce(xl,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ce(ve,ve.current&1),t.flags|=128,null):n&t.child.childLanes?Qg(e,t,n):(ce(ve,ve.current&1),e=hn(e,t,n),e!==null?e.sibling:null);ce(ve,ve.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return qg(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ce(ve,ve.current),r)break;return null;case 22:case 23:return t.lanes=0,Gg(e,t,n)}return hn(e,t,n)}var Zg,ac,Jg,ex;Zg=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}};ac=function(){};Jg=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,tr(Vt.current);var s=null;switch(n){case"input":o=Mu(e,o),r=Mu(e,r),s=[];break;case"select":o=Ne({},o,{value:void 0}),r=Ne({},r,{value:void 0}),s=[];break;case"textarea":o=Ru(e,o),r=Ru(e,r),s=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=fl)}Au(n,r);var i;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var l=o[c];for(i in l)l.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(cs.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var a=r[c];if(l=o!=null?o[c]:void 0,r.hasOwnProperty(c)&&a!==l&&(a!=null||l!=null))if(c==="style")if(l){for(i in l)!l.hasOwnProperty(i)||a&&a.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in a)a.hasOwnProperty(i)&&l[i]!==a[i]&&(n||(n={}),n[i]=a[i])}else n||(s||(s=[]),s.push(c,n)),n=a;else c==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(s=s||[]).push(c,a)):c==="children"?typeof a!="string"&&typeof a!="number"||(s=s||[]).push(c,""+a):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(cs.hasOwnProperty(c)?(a!=null&&c==="onScroll"&&he("scroll",e),s||l===a||(s=[])):(s=s||[]).push(c,a))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};ex=function(e,t,n,r){n!==r&&(t.flags|=4)};function $o(e,t){if(!me)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 Ue(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function X2(e,t,n){var r=t.pendingProps;switch(ad(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ue(t),null;case 1:return rt(t.type)&&hl(),Ue(t),null;case 3:return r=t.stateNode,ro(),pe(nt),pe(Ye),xd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(hi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Et!==null&&(gc(Et),Et=null))),ac(e,t),Ue(t),null;case 5:gd(t);var o=tr(Ss.current);if(n=t.type,e!==null&&t.stateNode!=null)Jg(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(H(166));return Ue(t),null}if(e=tr(Vt.current),hi(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Ft]=t,r[ws]=s,e=(t.mode&1)!==0,n){case"dialog":he("cancel",r),he("close",r);break;case"iframe":case"object":case"embed":he("load",r);break;case"video":case"audio":for(o=0;o<Ko.length;o++)he(Ko[o],r);break;case"source":he("error",r);break;case"img":case"image":case"link":he("error",r),he("load",r);break;case"details":he("toggle",r);break;case"input":Af(r,s),he("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},he("invalid",r);break;case"textarea":Df(r,s),he("invalid",r)}Au(n,s),o=null;for(var i in s)if(s.hasOwnProperty(i)){var l=s[i];i==="children"?typeof l=="string"?r.textContent!==l&&(s.suppressHydrationWarning!==!0&&fi(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&fi(r.textContent,l,e),o=["children",""+l]):cs.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&he("scroll",r)}switch(n){case"input":oi(r),zf(r,s,!0);break;case"textarea":oi(r),$f(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=fl)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=_m(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[Ft]=t,e[ws]=r,Zg(e,t,!1,!1),t.stateNode=e;e:{switch(i=zu(n,r),n){case"dialog":he("cancel",e),he("close",e),o=r;break;case"iframe":case"object":case"embed":he("load",e),o=r;break;case"video":case"audio":for(o=0;o<Ko.length;o++)he(Ko[o],e);o=r;break;case"source":he("error",e),o=r;break;case"img":case"image":case"link":he("error",e),he("load",e),o=r;break;case"details":he("toggle",e),o=r;break;case"input":Af(e,r),o=Mu(e,r),he("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ne({},r,{value:void 0}),he("invalid",e);break;case"textarea":Df(e,r),o=Ru(e,r),he("invalid",e);break;default:o=r}Au(n,o),l=o;for(s in l)if(l.hasOwnProperty(s)){var a=l[s];s==="style"?Im(e,a):s==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Pm(e,a)):s==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&ds(e,a):typeof a=="number"&&ds(e,""+a):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(cs.hasOwnProperty(s)?a!=null&&s==="onScroll"&&he("scroll",e):a!=null&&Gc(e,s,a,i))}switch(n){case"input":oi(e),zf(e,r,!1);break;case"textarea":oi(e),$f(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Fn(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Br(e,!!r.multiple,s,!1):r.defaultValue!=null&&Br(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=fl)}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 Ue(t),null;case 6:if(e&&t.stateNode!=null)ex(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=tr(Ss.current),tr(Vt.current),hi(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ft]=t,(s=r.nodeValue!==n)&&(e=at,e!==null))switch(e.tag){case 3:fi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&fi(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ft]=t,t.stateNode=r}return Ue(t),null;case 13:if(pe(ve),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(me&&lt!==null&&t.mode&1&&!(t.flags&128))yg(),to(),t.flags|=98560,s=!1;else if(s=hi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(H(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(H(317));s[Ft]=t}else to(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ue(t),s=!1}else Et!==null&&(gc(Et),Et=null),s=!0;if(!s)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||ve.current&1?Ie===0&&(Ie=3):Pd())),t.updateQueue!==null&&(t.flags|=4),Ue(t),null);case 4:return ro(),ac(e,t),e===null&&ys(t.stateNode.containerInfo),Ue(t),null;case 10:return fd(t.type._context),Ue(t),null;case 17:return rt(t.type)&&hl(),Ue(t),null;case 19:if(pe(ve),s=t.memoizedState,s===null)return Ue(t),null;if(r=(t.flags&128)!==0,i=s.rendering,i===null)if(r)$o(s,!1);else{if(Ie!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=wl(e),i!==null){for(t.flags|=128,$o(s,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,i=s.alternate,i===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=i.childLanes,s.lanes=i.lanes,s.child=i.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=i.memoizedProps,s.memoizedState=i.memoizedState,s.updateQueue=i.updateQueue,s.type=i.type,e=i.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ce(ve,ve.current&1|2),t.child}e=e.sibling}s.tail!==null&&Ee()>so&&(t.flags|=128,r=!0,$o(s,!1),t.lanes=4194304)}else{if(!r)if(e=wl(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),$o(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!me)return Ue(t),null}else 2*Ee()-s.renderingStartTime>so&&n!==1073741824&&(t.flags|=128,r=!0,$o(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(n=s.last,n!==null?n.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ee(),t.sibling=null,n=ve.current,ce(ve,r?n&1|2:n&1),t):(Ue(t),null);case 22:case 23:return _d(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?st&1073741824&&(Ue(t),t.subtreeFlags&6&&(t.flags|=8192)):Ue(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function K2(e,t){switch(ad(t),t.tag){case 1:return rt(t.type)&&hl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ro(),pe(nt),pe(Ye),xd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return gd(t),null;case 13:if(pe(ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));to()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pe(ve),null;case 4:return ro(),null;case 10:return fd(t.type._context),null;case 22:case 23:return _d(),null;case 24:return null;default:return null}}var gi=!1,We=!1,Q2=typeof WeakSet=="function"?WeakSet:Set,W=null;function $r(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){be(e,t,r)}else n.current=null}function uc(e,t,n){try{n()}catch(r){be(e,t,r)}}var jh=!1;function q2(e,t){if(Yu=ul,e=sg(),id(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 o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,l=-1,a=-1,c=0,h=0,f=e,d=null;t:for(;;){for(var x;f!==n||o!==0&&f.nodeType!==3||(l=i+o),f!==s||r!==0&&f.nodeType!==3||(a=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(x=f.firstChild)!==null;)d=f,f=x;for(;;){if(f===e)break t;if(d===n&&++c===o&&(l=i),d===s&&++h===r&&(a=i),(x=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=x}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Gu={focusedElem:e,selectionRange:n},ul=!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,S=y.memoizedState,p=t.stateNode,v=p.getSnapshotBeforeUpdate(t.elementType===t.type?w:St(t.type,w),S);p.__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(N){be(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return y=jh,jh=!1,y}function os(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,s!==void 0&&uc(t,n,s)}o=o.next}while(o!==r)}}function Jl(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 cc(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 tx(e){var t=e.alternate;t!==null&&(e.alternate=null,tx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ft],delete t[ws],delete t[Qu],delete t[R2],delete t[L2])),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 nx(e){return e.tag===5||e.tag===3||e.tag===4}function _h(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nx(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 dc(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=fl));else if(r!==4&&(e=e.child,e!==null))for(dc(e,t,n),e=e.sibling;e!==null;)dc(e,t,n),e=e.sibling}function fc(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(fc(e,t,n),e=e.sibling;e!==null;)fc(e,t,n),e=e.sibling}var ze=null,kt=!1;function yn(e,t,n){for(n=n.child;n!==null;)rx(e,t,n),n=n.sibling}function rx(e,t,n){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount(Wl,n)}catch{}switch(n.tag){case 5:We||$r(n,t);case 6:var r=ze,o=kt;ze=null,yn(e,t,n),ze=r,kt=o,ze!==null&&(kt?(e=ze,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ze.removeChild(n.stateNode));break;case 18:ze!==null&&(kt?(e=ze,n=n.stateNode,e.nodeType===8?Ga(e.parentNode,n):e.nodeType===1&&Ga(e,n),ms(e)):Ga(ze,n.stateNode));break;case 4:r=ze,o=kt,ze=n.stateNode.containerInfo,kt=!0,yn(e,t,n),ze=r,kt=o;break;case 0:case 11:case 14:case 15:if(!We&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var s=o,i=s.destroy;s=s.tag,i!==void 0&&(s&2||s&4)&&uc(n,t,i),o=o.next}while(o!==r)}yn(e,t,n);break;case 1:if(!We&&($r(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){be(n,t,l)}yn(e,t,n);break;case 21:yn(e,t,n);break;case 22:n.mode&1?(We=(r=We)||n.memoizedState!==null,yn(e,t,n),We=r):yn(e,t,n);break;default:yn(e,t,n)}}function Ph(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Q2),t.forEach(function(r){var o=iN.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Nt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var s=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 5:ze=l.stateNode,kt=!1;break e;case 3:ze=l.stateNode.containerInfo,kt=!0;break e;case 4:ze=l.stateNode.containerInfo,kt=!0;break e}l=l.return}if(ze===null)throw Error(H(160));rx(s,i,o),ze=null,kt=!1;var a=o.alternate;a!==null&&(a.return=null),o.return=null}catch(c){be(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ox(t,e),t=t.sibling}function ox(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Nt(t,e),zt(e),r&4){try{os(3,e,e.return),Jl(3,e)}catch(w){be(e,e.return,w)}try{os(5,e,e.return)}catch(w){be(e,e.return,w)}}break;case 1:Nt(t,e),zt(e),r&512&&n!==null&&$r(n,n.return);break;case 5:if(Nt(t,e),zt(e),r&512&&n!==null&&$r(n,n.return),e.flags&32){var o=e.stateNode;try{ds(o,"")}catch(w){be(e,e.return,w)}}if(r&4&&(o=e.stateNode,o!=null)){var s=e.memoizedProps,i=n!==null?n.memoizedProps:s,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&Cm(o,s),zu(l,i);var c=zu(l,s);for(i=0;i<a.length;i+=2){var h=a[i],f=a[i+1];h==="style"?Im(o,f):h==="dangerouslySetInnerHTML"?Pm(o,f):h==="children"?ds(o,f):Gc(o,h,f,c)}switch(l){case"input":Iu(o,s);break;case"textarea":jm(o,s);break;case"select":var d=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!s.multiple;var x=s.value;x!=null?Br(o,!!s.multiple,x,!1):d!==!!s.multiple&&(s.defaultValue!=null?Br(o,!!s.multiple,s.defaultValue,!0):Br(o,!!s.multiple,s.multiple?[]:"",!1))}o[ws]=s}catch(w){be(e,e.return,w)}}break;case 6:if(Nt(t,e),zt(e),r&4){if(e.stateNode===null)throw Error(H(162));o=e.stateNode,s=e.memoizedProps;try{o.nodeValue=s}catch(w){be(e,e.return,w)}}break;case 3:if(Nt(t,e),zt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ms(t.containerInfo)}catch(w){be(e,e.return,w)}break;case 4:Nt(t,e),zt(e);break;case 13:Nt(t,e),zt(e),o=e.child,o.flags&8192&&(s=o.memoizedState!==null,o.stateNode.isHidden=s,!s||o.alternate!==null&&o.alternate.memoizedState!==null||(Cd=Ee())),r&4&&Ph(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(We=(c=We)||h,Nt(t,e),We=c):Nt(t,e),zt(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(f=W=h;W!==null;){switch(d=W,x=d.child,d.tag){case 0:case 11:case 14:case 15:os(4,d,d.return);break;case 1:$r(d,d.return);var y=d.stateNode;if(typeof y.componentWillUnmount=="function"){r=d,n=d.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(w){be(r,n,w)}}break;case 5:$r(d,d.return);break;case 22:if(d.memoizedState!==null){Ih(f);continue}}x!==null?(x.return=d,W=x):Ih(f)}h=h.sibling}e:for(h=null,f=e;;){if(f.tag===5){if(h===null){h=f;try{o=f.stateNode,c?(s=o.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=f.stateNode,a=f.memoizedProps.style,i=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=Mm("display",i))}catch(w){be(e,e.return,w)}}}else if(f.tag===6){if(h===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(w){be(e,e.return,w)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;h===f&&(h=null),f=f.return}h===f&&(h=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Nt(t,e),zt(e),r&4&&Ph(e);break;case 21:break;default:Nt(t,e),zt(e)}}function zt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(nx(n)){var r=n;break e}n=n.return}throw Error(H(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(ds(o,""),r.flags&=-33);var s=_h(e);fc(e,s,o);break;case 3:case 4:var i=r.stateNode.containerInfo,l=_h(e);dc(e,l,i);break;default:throw Error(H(161))}}catch(a){be(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Z2(e,t,n){W=e,sx(e)}function sx(e,t,n){for(var r=(e.mode&1)!==0;W!==null;){var o=W,s=o.child;if(o.tag===22&&r){var i=o.memoizedState!==null||gi;if(!i){var l=o.alternate,a=l!==null&&l.memoizedState!==null||We;l=gi;var c=We;if(gi=i,(We=a)&&!c)for(W=o;W!==null;)i=W,a=i.child,i.tag===22&&i.memoizedState!==null?Th(o):a!==null?(a.return=i,W=a):Th(o);for(;s!==null;)W=s,sx(s),s=s.sibling;W=o,gi=l,We=c}Mh(e)}else o.subtreeFlags&8772&&s!==null?(s.return=o,W=s):Mh(e)}}function Mh(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:We||Jl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!We)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:St(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&ph(t,s,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}ph(t,i,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.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 f=h.dehydrated;f!==null&&ms(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}We||t.flags&512&&cc(t)}catch(d){be(t,t.return,d)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function Ih(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 Th(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Jl(4,t)}catch(a){be(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(a){be(t,o,a)}}var s=t.return;try{cc(t)}catch(a){be(t,s,a)}break;case 5:var i=t.return;try{cc(t)}catch(a){be(t,i,a)}}}catch(a){be(t,t.return,a)}if(t===e){W=null;break}var l=t.sibling;if(l!==null){l.return=t.return,W=l;break}W=t.return}}var J2=Math.ceil,kl=mn.ReactCurrentDispatcher,bd=mn.ReactCurrentOwner,gt=mn.ReactCurrentBatchConfig,ie=0,Ae=null,_e=null,Oe=0,st=0,Or=Gn(0),Ie=0,Cs=null,fr=0,ea=0,Ed=0,ss=null,Je=null,Cd=0,so=1/0,tn=null,bl=!1,hc=null,zn=null,xi=!1,Mn=null,El=0,is=0,pc=null,Wi=-1,Yi=0;function Ke(){return ie&6?Ee():Wi!==-1?Wi:Wi=Ee()}function Dn(e){return e.mode&1?ie&2&&Oe!==0?Oe&-Oe:z2.transition!==null?(Yi===0&&(Yi=Vm()),Yi):(e=ue,e!==0||(e=window.event,e=e===void 0?16:Qm(e.type)),e):1}function Mt(e,t,n,r){if(50<is)throw is=0,pc=null,Error(H(185));$s(e,n,r),(!(ie&2)||e!==Ae)&&(e===Ae&&(!(ie&2)&&(ea|=n),Ie===4&&jn(e,Oe)),ot(e,r),n===1&&ie===0&&!(t.mode&1)&&(so=Ee()+500,Ql&&Xn()))}function ot(e,t){var n=e.callbackNode;z1(e,t);var r=al(e,e===Ae?Oe:0);if(r===0)n!==null&&Hf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Hf(n),t===1)e.tag===0?A2(Rh.bind(null,e)):mg(Rh.bind(null,e)),I2(function(){!(ie&6)&&Xn()}),n=null;else{switch(Um(r)){case 1:n=Zc;break;case 4:n=Hm;break;case 16:n=ll;break;case 536870912:n=Bm;break;default:n=ll}n=hx(n,ix.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ix(e,t){if(Wi=-1,Yi=0,ie&6)throw Error(H(327));var n=e.callbackNode;if(Gr()&&e.callbackNode!==n)return null;var r=al(e,e===Ae?Oe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Cl(e,r);else{t=r;var o=ie;ie|=2;var s=ax();(Ae!==e||Oe!==t)&&(tn=null,so=Ee()+500,or(e,t));do try{nN();break}catch(l){lx(e,l)}while(!0);dd(),kl.current=s,ie=o,_e!==null?t=0:(Ae=null,Oe=0,t=Ie)}if(t!==0){if(t===2&&(o=Hu(e),o!==0&&(r=o,t=mc(e,o))),t===1)throw n=Cs,or(e,0),jn(e,r),ot(e,Ee()),n;if(t===6)jn(e,r);else{if(o=e.current.alternate,!(r&30)&&!eN(o)&&(t=Cl(e,r),t===2&&(s=Hu(e),s!==0&&(r=s,t=mc(e,s))),t===1))throw n=Cs,or(e,0),jn(e,r),ot(e,Ee()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:qn(e,Je,tn);break;case 3:if(jn(e,r),(r&130023424)===r&&(t=Cd+500-Ee(),10<t)){if(al(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ke(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Ku(qn.bind(null,e,Je,tn),t);break}qn(e,Je,tn);break;case 4:if(jn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var i=31-Pt(r);s=1<<i,i=t[i],i>o&&(o=i),r&=~s}if(r=o,r=Ee()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*J2(r/1960))-r,10<r){e.timeoutHandle=Ku(qn.bind(null,e,Je,tn),r);break}qn(e,Je,tn);break;case 5:qn(e,Je,tn);break;default:throw Error(H(329))}}}return ot(e,Ee()),e.callbackNode===n?ix.bind(null,e):null}function mc(e,t){var n=ss;return e.current.memoizedState.isDehydrated&&(or(e,t).flags|=256),e=Cl(e,t),e!==2&&(t=Je,Je=n,t!==null&&gc(t)),e}function gc(e){Je===null?Je=e:Je.push.apply(Je,e)}function eN(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 o=n[r],s=o.getSnapshot;o=o.value;try{if(!It(s(),o))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 jn(e,t){for(t&=~Ed,t&=~ea,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Pt(t),r=1<<n;e[n]=-1,t&=~r}}function Rh(e){if(ie&6)throw Error(H(327));Gr();var t=al(e,0);if(!(t&1))return ot(e,Ee()),null;var n=Cl(e,t);if(e.tag!==0&&n===2){var r=Hu(e);r!==0&&(t=r,n=mc(e,r))}if(n===1)throw n=Cs,or(e,0),jn(e,t),ot(e,Ee()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,qn(e,Je,tn),ot(e,Ee()),null}function jd(e,t){var n=ie;ie|=1;try{return e(t)}finally{ie=n,ie===0&&(so=Ee()+500,Ql&&Xn())}}function hr(e){Mn!==null&&Mn.tag===0&&!(ie&6)&&Gr();var t=ie;ie|=1;var n=gt.transition,r=ue;try{if(gt.transition=null,ue=1,e)return e()}finally{ue=r,gt.transition=n,ie=t,!(ie&6)&&Xn()}}function _d(){st=Or.current,pe(Or)}function or(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,M2(n)),_e!==null)for(n=_e.return;n!==null;){var r=n;switch(ad(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&hl();break;case 3:ro(),pe(nt),pe(Ye),xd();break;case 5:gd(r);break;case 4:ro();break;case 13:pe(ve);break;case 19:pe(ve);break;case 10:fd(r.type._context);break;case 22:case 23:_d()}n=n.return}if(Ae=e,_e=e=$n(e.current,null),Oe=st=t,Ie=0,Cs=null,Ed=ea=fr=0,Je=ss=null,er!==null){for(t=0;t<er.length;t++)if(n=er[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,s=n.pending;if(s!==null){var i=s.next;s.next=o,r.next=i}n.pending=r}er=null}return e}function lx(e,t){do{var n=_e;try{if(dd(),Bi.current=Sl,Nl){for(var r=we.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Nl=!1}if(dr=0,Le=Me=we=null,rs=!1,ks=0,bd.current=null,n===null||n.return===null){Ie=1,Cs=t,_e=null;break}e:{var s=e,i=n.return,l=n,a=t;if(t=Oe,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var c=a,h=l,f=h.tag;if(!(h.mode&1)&&(f===0||f===11||f===15)){var d=h.alternate;d?(h.updateQueue=d.updateQueue,h.memoizedState=d.memoizedState,h.lanes=d.lanes):(h.updateQueue=null,h.memoizedState=null)}var x=wh(i);if(x!==null){x.flags&=-257,Nh(x,i,l,s,t),x.mode&1&&vh(s,c,t),t=x,a=c;var y=t.updateQueue;if(y===null){var w=new Set;w.add(a),t.updateQueue=w}else y.add(a);break e}else{if(!(t&1)){vh(s,c,t),Pd();break e}a=Error(H(426))}}else if(me&&l.mode&1){var S=wh(i);if(S!==null){!(S.flags&65536)&&(S.flags|=256),Nh(S,i,l,s,t),ud(oo(a,l));break e}}s=a=oo(a,l),Ie!==4&&(Ie=2),ss===null?ss=[s]:ss.push(s),s=i;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var p=Ug(s,a,t);hh(s,p);break e;case 1:l=a;var v=s.type,g=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(zn===null||!zn.has(g)))){s.flags|=65536,t&=-t,s.lanes|=t;var N=Wg(s,l,t);hh(s,N);break e}}s=s.return}while(s!==null)}cx(n)}catch(k){t=k,_e===n&&n!==null&&(_e=n=n.return);continue}break}while(!0)}function ax(){var e=kl.current;return kl.current=Sl,e===null?Sl:e}function Pd(){(Ie===0||Ie===3||Ie===2)&&(Ie=4),Ae===null||!(fr&268435455)&&!(ea&268435455)||jn(Ae,Oe)}function Cl(e,t){var n=ie;ie|=2;var r=ax();(Ae!==e||Oe!==t)&&(tn=null,or(e,t));do try{tN();break}catch(o){lx(e,o)}while(!0);if(dd(),ie=n,kl.current=r,_e!==null)throw Error(H(261));return Ae=null,Oe=0,Ie}function tN(){for(;_e!==null;)ux(_e)}function nN(){for(;_e!==null&&!j1();)ux(_e)}function ux(e){var t=fx(e.alternate,e,st);e.memoizedProps=e.pendingProps,t===null?cx(e):_e=t,bd.current=null}function cx(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=K2(n,t),n!==null){n.flags&=32767,_e=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ie=6,_e=null;return}}else if(n=X2(n,t,st),n!==null){_e=n;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);Ie===0&&(Ie=5)}function qn(e,t,n){var r=ue,o=gt.transition;try{gt.transition=null,ue=1,rN(e,t,n,r)}finally{gt.transition=o,ue=r}return null}function rN(e,t,n,r){do Gr();while(Mn!==null);if(ie&6)throw Error(H(327));n=e.finishedWork;var o=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 s=n.lanes|n.childLanes;if(D1(e,s),e===Ae&&(_e=Ae=null,Oe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||xi||(xi=!0,hx(ll,function(){return Gr(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=gt.transition,gt.transition=null;var i=ue;ue=1;var l=ie;ie|=4,bd.current=null,q2(e,n),ox(n,e),k2(Gu),ul=!!Yu,Gu=Yu=null,e.current=n,Z2(n),_1(),ie=l,ue=i,gt.transition=s}else e.current=n;if(xi&&(xi=!1,Mn=e,El=o),s=e.pendingLanes,s===0&&(zn=null),I1(n.stateNode),ot(e,Ee()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(bl)throw bl=!1,e=hc,hc=null,e;return El&1&&e.tag!==0&&Gr(),s=e.pendingLanes,s&1?e===pc?is++:(is=0,pc=e):is=0,Xn(),null}function Gr(){if(Mn!==null){var e=Um(El),t=gt.transition,n=ue;try{if(gt.transition=null,ue=16>e?16:e,Mn===null)var r=!1;else{if(e=Mn,Mn=null,El=0,ie&6)throw Error(H(331));var o=ie;for(ie|=4,W=e.current;W!==null;){var s=W,i=s.child;if(W.flags&16){var l=s.deletions;if(l!==null){for(var a=0;a<l.length;a++){var c=l[a];for(W=c;W!==null;){var h=W;switch(h.tag){case 0:case 11:case 15:os(8,h,s)}var f=h.child;if(f!==null)f.return=h,W=f;else for(;W!==null;){h=W;var d=h.sibling,x=h.return;if(tx(h),h===c){W=null;break}if(d!==null){d.return=x,W=d;break}W=x}}}var y=s.alternate;if(y!==null){var w=y.child;if(w!==null){y.child=null;do{var S=w.sibling;w.sibling=null,w=S}while(w!==null)}}W=s}}if(s.subtreeFlags&2064&&i!==null)i.return=s,W=i;else e:for(;W!==null;){if(s=W,s.flags&2048)switch(s.tag){case 0:case 11:case 15:os(9,s,s.return)}var p=s.sibling;if(p!==null){p.return=s.return,W=p;break e}W=s.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(l=W,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Jl(9,l)}}catch(k){be(l,l.return,k)}if(l===i){W=null;break e}var N=l.sibling;if(N!==null){N.return=l.return,W=N;break e}W=l.return}}if(ie=o,Xn(),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(Wl,e)}catch{}r=!0}return r}finally{ue=n,gt.transition=t}}return!1}function Lh(e,t,n){t=oo(n,t),t=Ug(e,t,1),e=An(e,t,1),t=Ke(),e!==null&&($s(e,1,t),ot(e,t))}function be(e,t,n){if(e.tag===3)Lh(e,e,n);else for(;t!==null;){if(t.tag===3){Lh(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(zn===null||!zn.has(r))){e=oo(n,e),e=Wg(t,e,1),t=An(t,e,1),e=Ke(),t!==null&&($s(t,1,e),ot(t,e));break}}t=t.return}}function oN(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ke(),e.pingedLanes|=e.suspendedLanes&n,Ae===e&&(Oe&n)===n&&(Ie===4||Ie===3&&(Oe&130023424)===Oe&&500>Ee()-Cd?or(e,0):Ed|=n),ot(e,t)}function dx(e,t){t===0&&(e.mode&1?(t=li,li<<=1,!(li&130023424)&&(li=4194304)):t=1);var n=Ke();e=fn(e,t),e!==null&&($s(e,t,n),ot(e,n))}function sN(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),dx(e,n)}function iN(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(H(314))}r!==null&&r.delete(t),dx(e,n)}var fx;fx=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||nt.current)et=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return et=!1,G2(e,t,n);et=!!(e.flags&131072)}else et=!1,me&&t.flags&1048576&&gg(t,gl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ui(e,t),e=t.pendingProps;var o=eo(t,Ye.current);Yr(t,n),o=vd(null,t,r,e,o,n);var s=wd();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,rt(r)?(s=!0,pl(t)):s=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,pd(t),o.updater=Zl,t.stateNode=o,o._reactInternals=t,nc(t,r,e,n),t=sc(null,t,r,!0,s,n)):(t.tag=0,me&&s&&ld(t),Xe(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ui(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=aN(r),e=St(r,e),o){case 0:t=oc(null,t,r,e,n);break e;case 1:t=bh(null,t,r,e,n);break e;case 11:t=Sh(null,t,r,e,n);break e;case 14:t=kh(null,t,r,St(r.type,e),n);break e}throw Error(H(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:St(r,o),oc(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:St(r,o),bh(e,t,r,o,n);case 3:e:{if(Kg(t),e===null)throw Error(H(387));r=t.pendingProps,s=t.memoizedState,o=s.element,Sg(e,t),vl(t,r,null,n);var i=t.memoizedState;if(r=i.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){o=oo(Error(H(423)),t),t=Eh(e,t,r,n,o);break e}else if(r!==o){o=oo(Error(H(424)),t),t=Eh(e,t,r,n,o);break e}else for(lt=Ln(t.stateNode.containerInfo.firstChild),at=t,me=!0,Et=null,n=wg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(to(),r===o){t=hn(e,t,n);break e}Xe(e,t,r,n)}t=t.child}return t;case 5:return kg(t),e===null&&Ju(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,i=o.children,Xu(r,o)?i=null:s!==null&&Xu(r,s)&&(t.flags|=32),Xg(e,t),Xe(e,t,i,n),t.child;case 6:return e===null&&Ju(t),null;case 13:return Qg(e,t,n);case 4:return md(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=no(t,null,r,n):Xe(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:St(r,o),Sh(e,t,r,o,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,o=t.pendingProps,s=t.memoizedProps,i=o.value,ce(xl,r._currentValue),r._currentValue=i,s!==null)if(It(s.value,i)){if(s.children===o.children&&!nt.current){t=hn(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){i=s.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(s.tag===1){a=ln(-1,n&-n),a.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?a.next=a:(a.next=h.next,h.next=a),c.pending=a}}s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),ec(s.return,n,t),l.lanes|=n;break}a=a.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error(H(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),ec(i,n,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}Xe(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Yr(t,n),o=xt(o),r=r(o),t.flags|=1,Xe(e,t,r,n),t.child;case 14:return r=t.type,o=St(r,t.pendingProps),o=St(r.type,o),kh(e,t,r,o,n);case 15:return Yg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:St(r,o),Ui(e,t),t.tag=1,rt(r)?(e=!0,pl(t)):e=!1,Yr(t,n),Vg(t,r,o),nc(t,r,o,n),sc(null,t,r,!0,e,n);case 19:return qg(e,t,n);case 22:return Gg(e,t,n)}throw Error(H(156,t.tag))};function hx(e,t){return Fm(e,t)}function lN(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 mt(e,t,n,r){return new lN(e,t,n,r)}function Md(e){return e=e.prototype,!(!e||!e.isReactComponent)}function aN(e){if(typeof e=="function")return Md(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Kc)return 11;if(e===Qc)return 14}return 2}function $n(e,t){var n=e.alternate;return n===null?(n=mt(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,o,s){var i=2;if(r=e,typeof e=="function")Md(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Pr:return sr(n.children,o,s,t);case Xc:i=8,o|=8;break;case Cu:return e=mt(12,n,t,o|2),e.elementType=Cu,e.lanes=s,e;case ju:return e=mt(13,n,t,o),e.elementType=ju,e.lanes=s,e;case _u:return e=mt(19,n,t,o),e.elementType=_u,e.lanes=s,e;case km:return ta(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Nm:i=10;break e;case Sm:i=9;break e;case Kc:i=11;break e;case Qc:i=14;break e;case bn:i=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=mt(i,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function sr(e,t,n,r){return e=mt(7,e,r,t),e.lanes=n,e}function ta(e,t,n,r){return e=mt(22,e,r,t),e.elementType=km,e.lanes=n,e.stateNode={isHidden:!1},e}function tu(e,t,n){return e=mt(6,e,null,t),e.lanes=n,e}function nu(e,t,n){return t=mt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function uN(e,t,n,r,o){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=za(0),this.expirationTimes=za(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=za(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Id(e,t,n,r,o,s,i,l,a){return e=new uN(e,t,n,l,a),t===1?(t=1,s===!0&&(t|=8)):t=0,s=mt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},pd(s),e}function cN(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_r,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function px(e){if(!e)return Hn;e=e._reactInternals;e:{if(Nr(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(rt(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(rt(n))return pg(e,n,t)}return t}function mx(e,t,n,r,o,s,i,l,a){return e=Id(n,r,!0,e,o,s,i,l,a),e.context=px(null),n=e.current,r=Ke(),o=Dn(n),s=ln(r,o),s.callback=t??null,An(n,s,o),e.current.lanes=o,$s(e,o,r),ot(e,r),e}function na(e,t,n,r){var o=t.current,s=Ke(),i=Dn(o);return n=px(n),t.context===null?t.context=n:t.pendingContext=n,t=ln(s,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=An(o,t,i),e!==null&&(Mt(e,o,i,s),Hi(e,o,i)),i}function jl(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 Ah(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){Ah(e,t),(e=e.alternate)&&Ah(e,t)}function dN(){return null}var gx=typeof reportError=="function"?reportError:function(e){console.error(e)};function Rd(e){this._internalRoot=e}ra.prototype.render=Rd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));na(e,t,null,null)};ra.prototype.unmount=Rd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hr(function(){na(null,e,null,null)}),t[dn]=null}};function ra(e){this._internalRoot=e}ra.prototype.unstable_scheduleHydration=function(e){if(e){var t=Gm();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cn.length&&t!==0&&t<Cn[n].priority;n++);Cn.splice(n,0,e),n===0&&Km(e)}};function Ld(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function oa(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function zh(){}function fN(e,t,n,r,o){if(o){if(typeof r=="function"){var s=r;r=function(){var c=jl(i);s.call(c)}}var i=mx(t,r,e,0,null,!1,!1,"",zh);return e._reactRootContainer=i,e[dn]=i.current,ys(e.nodeType===8?e.parentNode:e),hr(),i}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var c=jl(a);l.call(c)}}var a=Id(e,0,!1,null,null,!1,!1,"",zh);return e._reactRootContainer=a,e[dn]=a.current,ys(e.nodeType===8?e.parentNode:e),hr(function(){na(t,a,n,r)}),a}function sa(e,t,n,r,o){var s=n._reactRootContainer;if(s){var i=s;if(typeof o=="function"){var l=o;o=function(){var a=jl(i);l.call(a)}}na(t,i,e,o)}else i=fN(n,t,e,o,r);return jl(i)}Wm=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Xo(t.pendingLanes);n!==0&&(Jc(t,n|1),ot(t,Ee()),!(ie&6)&&(so=Ee()+500,Xn()))}break;case 13:hr(function(){var r=fn(e,1);if(r!==null){var o=Ke();Mt(r,e,1,o)}}),Td(e,1)}};ed=function(e){if(e.tag===13){var t=fn(e,134217728);if(t!==null){var n=Ke();Mt(t,e,134217728,n)}Td(e,134217728)}};Ym=function(e){if(e.tag===13){var t=Dn(e),n=fn(e,t);if(n!==null){var r=Ke();Mt(n,e,t,r)}Td(e,t)}};Gm=function(){return ue};Xm=function(e,t){var n=ue;try{return ue=e,t()}finally{ue=n}};$u=function(e,t,n){switch(t){case"input":if(Iu(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 o=Kl(r);if(!o)throw Error(H(90));Em(r),Iu(r,o)}}}break;case"textarea":jm(e,n);break;case"select":t=n.value,t!=null&&Br(e,!!n.multiple,t,!1)}};Lm=jd;Am=hr;var hN={usingClientEntryPoint:!1,Events:[Fs,Rr,Kl,Tm,Rm,jd]},Oo={findFiberByHostInstance:Jn,bundleType:0,version:"18.3.0",rendererPackageName:"react-dom"},pN={bundleType:Oo.bundleType,version:Oo.version,rendererPackageName:Oo.rendererPackageName,rendererConfig:Oo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:mn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=$m(e),e===null?null:e.stateNode},findFiberByHostInstance:Oo.findFiberByHostInstance||dN,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 yi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yi.isDisabled&&yi.supportsFiber)try{Wl=yi.inject(pN),Bt=yi}catch{}}dt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hN;dt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ld(t))throw Error(H(200));return cN(e,t,null,n)};dt.createRoot=function(e,t){if(!Ld(e))throw Error(H(299));var n=!1,r="",o=gx;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Id(e,1,!1,null,null,n,!1,r,o),e[dn]=t.current,ys(e.nodeType===8?e.parentNode:e),new Rd(t)};dt.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=$m(t),e=e===null?null:e.stateNode,e};dt.flushSync=function(e){return hr(e)};dt.hydrate=function(e,t,n){if(!oa(t))throw Error(H(200));return sa(null,e,t,!0,n)};dt.hydrateRoot=function(e,t,n){if(!Ld(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,o=!1,s="",i=gx;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=mx(t,null,e,1,n??null,o,!1,s,i),e[dn]=t.current,ys(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new ra(t)};dt.render=function(e,t,n){if(!oa(t))throw Error(H(200));return sa(null,e,t,!1,n)};dt.unmountComponentAtNode=function(e){if(!oa(e))throw Error(H(40));return e._reactRootContainer?(hr(function(){sa(null,null,e,!1,function(){e._reactRootContainer=null,e[dn]=null})}),!0):!1};dt.unstable_batchedUpdates=jd;dt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!oa(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return sa(e,t,n,!1,r)};dt.version="18.3.0-next-8a015b68cc-20240425";function xx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(xx)}catch(e){console.error(e)}}xx(),xm.exports=dt;var ia=xm.exports;const mN=Fc(ia);var Dh=ia;bu.createRoot=Dh.createRoot,bu.hydrateRoot=Dh.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 $h="popstate";function gN(e={}){function t(r,o){let{pathname:s,search:i,hash:l}=r.location;return xc("",{pathname:s,search:i,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:js(o)}return yN(t,n,null,e)}function ge(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function vt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function xN(){return Math.random().toString(36).substring(2,10)}function Oh(e,t){return{usr:e.state,key:e.key,idx:t}}function xc(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?No(t):t,state:n,key:t&&t.key||r||xN()}}function js({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 No(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 yN(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:s=!1}=r,i=o.history,l="POP",a=null,c=h();c==null&&(c=0,i.replaceState({...i.state,idx:c},""));function h(){return(i.state||{idx:null}).idx}function f(){l="POP";let S=h(),p=S==null?null:S-c;c=S,a&&a({action:l,location:w.location,delta:p})}function d(S,p){l="PUSH";let v=xc(w.location,S,p);c=h()+1;let g=Oh(v,c),N=w.createHref(v);try{i.pushState(g,"",N)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;o.location.assign(N)}s&&a&&a({action:l,location:w.location,delta:1})}function x(S,p){l="REPLACE";let v=xc(w.location,S,p);c=h();let g=Oh(v,c),N=w.createHref(v);i.replaceState(g,"",N),s&&a&&a({action:l,location:w.location,delta:0})}function y(S){let p=o.location.origin!=="null"?o.location.origin:o.location.href,v=typeof S=="string"?S:js(S);return v=v.replace(/ $/,"%20"),ge(p,`No window.location.(origin|href) available to create URL for href: ${v}`),new URL(v,p)}let w={get action(){return l},get location(){return e(o,i)},listen(S){if(a)throw new Error("A history only accepts one active listener");return o.addEventListener($h,f),a=S,()=>{o.removeEventListener($h,f),a=null}},createHref(S){return t(o,S)},createURL:y,encodeLocation(S){let p=y(S);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:d,replace:x,go(S){return i.go(S)}};return w}function yx(e,t,n="/"){return vN(e,t,n,!1)}function vN(e,t,n,r){let o=typeof t=="string"?No(t):t,s=Bn(o.pathname||"/",n);if(s==null)return null;let i=vx(e);wN(i);let l=null;for(let a=0;l==null&&a<i.length;++a){let c=IN(s);l=PN(i[a],c,r)}return l}function vx(e,t=[],n=[],r=""){let o=(s,i,l)=>{let a={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:i,route:s};a.relativePath.startsWith("/")&&(ge(a.relativePath.startsWith(r),`Absolute route path "${a.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),a.relativePath=a.relativePath.slice(r.length));let c=an([r,a.relativePath]),h=n.concat(a);s.children&&s.children.length>0&&(ge(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),vx(s.children,t,h,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:jN(c,s.index),routesMeta:h})};return e.forEach((s,i)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))o(s,i);else for(let a of wx(s.path))o(s,i,a)}),t}function wx(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return o?[s,""]:[s];let i=wx(r.join("/")),l=[];return l.push(...i.map(a=>a===""?s:[s,a].join("/"))),o&&l.push(...i),l.map(a=>e.startsWith("/")&&a===""?"/":a)}function wN(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:_N(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var NN=/^:[\w-]+$/,SN=3,kN=2,bN=1,EN=10,CN=-2,Fh=e=>e==="*";function jN(e,t){let n=e.split("/"),r=n.length;return n.some(Fh)&&(r+=CN),t&&(r+=kN),n.filter(o=>!Fh(o)).reduce((o,s)=>o+(NN.test(s)?SN:s===""?bN:EN),r)}function _N(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function PN(e,t,n=!1){let{routesMeta:r}=e,o={},s="/",i=[];for(let l=0;l<r.length;++l){let a=r[l],c=l===r.length-1,h=s==="/"?t:t.slice(s.length)||"/",f=_l({path:a.relativePath,caseSensitive:a.caseSensitive,end:c},h),d=a.route;if(!f&&c&&n&&!r[r.length-1].route.index&&(f=_l({path:a.relativePath,caseSensitive:a.caseSensitive,end:!1},h)),!f)return null;Object.assign(o,f.params),i.push({params:o,pathname:an([s,f.pathname]),pathnameBase:AN(an([s,f.pathnameBase])),route:d}),f.pathnameBase!=="/"&&(s=an([s,f.pathnameBase]))}return i}function _l(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=MN(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let s=o[0],i=s.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:r.reduce((c,{paramName:h,isOptional:f},d)=>{if(h==="*"){let y=l[d]||"";i=s.slice(0,s.length-y.length).replace(/(.)\/+$/,"$1")}const x=l[d];return f&&!x?c[h]=void 0:c[h]=(x||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:i,pattern:e}}function MN(e,t=!1,n=!0){vt(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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,a)=>(r.push({paramName:l,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function IN(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return vt(!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 Bn(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 TN(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?No(e):e;return{pathname:n?n.startsWith("/")?n:RN(n,t):t,search:zN(r),hash:DN(o)}}function RN(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function ru(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 LN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ad(e){let t=LN(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function zd(e,t,n,r=!1){let o;typeof e=="string"?o=No(e):(o={...e},ge(!o.pathname||!o.pathname.includes("?"),ru("?","pathname","search",o)),ge(!o.pathname||!o.pathname.includes("#"),ru("#","pathname","hash",o)),ge(!o.search||!o.search.includes("#"),ru("#","search","hash",o)));let s=e===""||o.pathname==="",i=s?"/":o.pathname,l;if(i==null)l=n;else{let f=t.length-1;if(!r&&i.startsWith("..")){let d=i.split("/");for(;d[0]==="..";)d.shift(),f-=1;o.pathname=d.join("/")}l=f>=0?t[f]:"/"}let a=TN(o,l),c=i&&i!=="/"&&i.endsWith("/"),h=(s||i===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(c||h)&&(a.pathname+="/"),a}var an=e=>e.join("/").replace(/\/\/+/g,"/"),AN=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),zN=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,DN=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function $N(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Nx=["POST","PUT","PATCH","DELETE"];new Set(Nx);var ON=["GET",...Nx];new Set(ON);var So=m.createContext(null);So.displayName="DataRouter";var la=m.createContext(null);la.displayName="DataRouterState";var Sx=m.createContext({isTransitioning:!1});Sx.displayName="ViewTransition";var FN=m.createContext(new Map);FN.displayName="Fetchers";var HN=m.createContext(null);HN.displayName="Await";var Rt=m.createContext(null);Rt.displayName="Navigation";var Bs=m.createContext(null);Bs.displayName="Location";var wt=m.createContext({outlet:null,matches:[],isDataRoute:!1});wt.displayName="Route";var Dd=m.createContext(null);Dd.displayName="RouteError";function BN(e,{relative:t}={}){ge(ko(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=m.useContext(Rt),{hash:o,pathname:s,search:i}=Vs(e,{relative:t}),l=s;return n!=="/"&&(l=s==="/"?n:an([n,s])),r.createHref({pathname:l,search:i,hash:o})}function ko(){return m.useContext(Bs)!=null}function Qt(){return ge(ko(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(Bs).location}var kx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function bx(e){m.useContext(Rt).static||m.useLayoutEffect(e)}function aa(){let{isDataRoute:e}=m.useContext(wt);return e?oS():VN()}function VN(){ge(ko(),"useNavigate() may be used only in the context of a <Router> component.");let e=m.useContext(So),{basename:t,navigator:n}=m.useContext(Rt),{matches:r}=m.useContext(wt),{pathname:o}=Qt(),s=JSON.stringify(Ad(r)),i=m.useRef(!1);return bx(()=>{i.current=!0}),m.useCallback((a,c={})=>{if(vt(i.current,kx),!i.current)return;if(typeof a=="number"){n.go(a);return}let h=zd(a,JSON.parse(s),o,c.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:an([t,h.pathname])),(c.replace?n.replace:n.push)(h,c.state,c)},[t,n,s,o,e])}var UN=m.createContext(null);function WN(e){let t=m.useContext(wt).outlet;return t&&m.createElement(UN.Provider,{value:e},t)}function YN(){let{matches:e}=m.useContext(wt),t=e[e.length-1];return t?t.params:{}}function Vs(e,{relative:t}={}){let{matches:n}=m.useContext(wt),{pathname:r}=Qt(),o=JSON.stringify(Ad(n));return m.useMemo(()=>zd(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function GN(e,t){return Ex(e,t)}function Ex(e,t,n,r){var p;ge(ko(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=m.useContext(Rt),{matches:s}=m.useContext(wt),i=s[s.length-1],l=i?i.params:{},a=i?i.pathname:"/",c=i?i.pathnameBase:"/",h=i&&i.route;{let v=h&&h.path||"";Cx(a,!h||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${a}" (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 f=Qt(),d;if(t){let v=typeof t=="string"?No(t):t;ge(c==="/"||((p=v.pathname)==null?void 0:p.startsWith(c)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${v.pathname}" was given in the \`location\` prop.`),d=v}else d=f;let x=d.pathname||"/",y=x;if(c!=="/"){let v=c.replace(/^\//,"").split("/");y="/"+x.replace(/^\//,"").split("/").slice(v.length).join("/")}let w=yx(e,{pathname:y});vt(h||w!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),vt(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 "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=ZN(w&&w.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:an([c,o.encodeLocation?o.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:an([c,o.encodeLocation?o.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),s,n,r);return t&&S?m.createElement(Bs.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...d},navigationType:"POP"}},S):S}function XN(){let e=rS(),t=$N(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)",o={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:s},"ErrorBoundary")," or"," ",m.createElement("code",{style:s},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:o},n):null,i)}var KN=m.createElement(XN,null),QN=class extends m.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?m.createElement(wt.Provider,{value:this.props.routeContext},m.createElement(Dd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function qN({routeContext:e,match:t,children:n}){let r=m.useContext(So);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(wt.Provider,{value:e},n)}function ZN(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 o=e,s=n==null?void 0:n.errors;if(s!=null){let a=o.findIndex(c=>c.route.id&&(s==null?void 0:s[c.route.id])!==void 0);ge(a>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),o=o.slice(0,Math.min(o.length,a+1))}let i=!1,l=-1;if(n)for(let a=0;a<o.length;a++){let c=o[a];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(l=a),c.route.id){let{loaderData:h,errors:f}=n,d=c.route.loader&&!h.hasOwnProperty(c.route.id)&&(!f||f[c.route.id]===void 0);if(c.route.lazy||d){i=!0,l>=0?o=o.slice(0,l+1):o=[o[0]];break}}}return o.reduceRight((a,c,h)=>{let f,d=!1,x=null,y=null;n&&(f=s&&c.route.id?s[c.route.id]:void 0,x=c.route.errorElement||KN,i&&(l<0&&h===0?(Cx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,y=null):l===h&&(d=!0,y=c.route.hydrateFallbackElement||null)));let w=t.concat(o.slice(0,h+1)),S=()=>{let p;return f?p=x:d?p=y:c.route.Component?p=m.createElement(c.route.Component,null):c.route.element?p=c.route.element:p=a,m.createElement(qN,{match:c,routeContext:{outlet:a,matches:w,isDataRoute:n!=null},children:p})};return n&&(c.route.ErrorBoundary||c.route.errorElement||h===0)?m.createElement(QN,{location:n.location,revalidation:n.revalidation,component:x,error:f,children:S(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):S()},null)}function $d(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function JN(e){let t=m.useContext(So);return ge(t,$d(e)),t}function eS(e){let t=m.useContext(la);return ge(t,$d(e)),t}function tS(e){let t=m.useContext(wt);return ge(t,$d(e)),t}function Od(e){let t=tS(e),n=t.matches[t.matches.length-1];return ge(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function nS(){return Od("useRouteId")}function rS(){var r;let e=m.useContext(Dd),t=eS("useRouteError"),n=Od("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function oS(){let{router:e}=JN("useNavigate"),t=Od("useNavigate"),n=m.useRef(!1);return bx(()=>{n.current=!0}),m.useCallback(async(o,s={})=>{vt(n.current,kx),n.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:t,...s}))},[e,t])}var Hh={};function Cx(e,t,n){!t&&!Hh[e]&&(Hh[e]=!0,vt(!1,n))}m.memo(sS);function sS({routes:e,future:t,state:n}){return Ex(e,void 0,n,t)}function yc({to:e,replace:t,state:n,relative:r}){ge(ko(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=m.useContext(Rt);vt(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=m.useContext(wt),{pathname:i}=Qt(),l=aa(),a=zd(e,Ad(s),i,r==="path"),c=JSON.stringify(a);return m.useEffect(()=>{l(JSON.parse(c),{replace:t,state:n,relative:r})},[l,c,r,t,n]),null}function iS(e){return WN(e.context)}function Ge(e){ge(!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 lS({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:s=!1}){ge(!ko(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),l=m.useMemo(()=>({basename:i,navigator:o,static:s,future:{}}),[i,o,s]);typeof n=="string"&&(n=No(n));let{pathname:a="/",search:c="",hash:h="",state:f=null,key:d="default"}=n,x=m.useMemo(()=>{let y=Bn(a,i);return y==null?null:{location:{pathname:y,search:c,hash:h,state:f,key:d},navigationType:r}},[i,a,c,h,f,d,r]);return vt(x!=null,`<Router basename="${i}"> is not able to match the URL "${a}${c}${h}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:m.createElement(Rt.Provider,{value:l},m.createElement(Bs.Provider,{children:t,value:x}))}function aS({children:e,location:t}){return GN(vc(e),t)}function vc(e,t=[]){let n=[];return m.Children.forEach(e,(r,o)=>{if(!m.isValidElement(r))return;let s=[...t,o];if(r.type===m.Fragment){n.push.apply(n,vc(r.props.children,s));return}ge(r.type===Ge,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ge(!r.props.index||!r.props.children,"An index route cannot have child routes.");let i={id:r.props.id||s.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=vc(r.props.children,s)),n.push(i)}),n}var Xi="get",Ki="application/x-www-form-urlencoded";function ua(e){return e!=null&&typeof e.tagName=="string"}function uS(e){return ua(e)&&e.tagName.toLowerCase()==="button"}function cS(e){return ua(e)&&e.tagName.toLowerCase()==="form"}function dS(e){return ua(e)&&e.tagName.toLowerCase()==="input"}function fS(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function hS(e,t){return e.button===0&&(!t||t==="_self")&&!fS(e)}function wc(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function pS(e,t){let n=wc(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(s=>{n.append(o,s)})}),n}var vi=null;function mS(){if(vi===null)try{new FormData(document.createElement("form"),0),vi=!1}catch{vi=!0}return vi}var gS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ou(e){return e!=null&&!gS.has(e)?(vt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ki}"`),null):e}function xS(e,t){let n,r,o,s,i;if(cS(e)){let l=e.getAttribute("action");r=l?Bn(l,t):null,n=e.getAttribute("method")||Xi,o=ou(e.getAttribute("enctype"))||Ki,s=new FormData(e)}else if(uS(e)||dS(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let a=e.getAttribute("formaction")||l.getAttribute("action");if(r=a?Bn(a,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||Xi,o=ou(e.getAttribute("formenctype"))||ou(l.getAttribute("enctype"))||Ki,s=new FormData(l,e),!mS()){let{name:c,type:h,value:f}=e;if(h==="image"){let d=c?`${c}.`:"";s.append(`${d}x`,"0"),s.append(`${d}y`,"0")}else c&&s.append(c,f)}}else{if(ua(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Xi,r=null,o=Ki,i=e}return s&&o==="text/plain"&&(i=s,s=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:s,body:i}}function Fd(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function yS(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 vS(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 wS(e,t,n){let r=await Promise.all(e.map(async o=>{let s=t.routes[o.route.id];if(s){let i=await yS(s,n);return i.links?i.links():[]}return[]}));return bS(r.flat(1).filter(vS).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Bh(e,t,n,r,o,s){let i=(a,c)=>n[c]?a.route.id!==n[c].route.id:!0,l=(a,c)=>{var h;return n[c].pathname!==a.pathname||((h=n[c].route.path)==null?void 0:h.endsWith("*"))&&n[c].params["*"]!==a.params["*"]};return s==="assets"?t.filter((a,c)=>i(a,c)||l(a,c)):s==="data"?t.filter((a,c)=>{var f;let h=r.routes[a.route.id];if(!h||!h.hasLoader)return!1;if(i(a,c)||l(a,c))return!0;if(a.route.shouldRevalidate){let d=a.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((f=n[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:a.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function NS(e,t){return SS(e.map(n=>{let r=t.routes[n.route.id];if(!r)return[];let o=[r.module];return r.imports&&(o=o.concat(r.imports)),o}).flat(1))}function SS(e){return[...new Set(e)]}function kS(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function bS(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let s=JSON.stringify(kS(o));return n.has(s)||(n.add(s),r.push({key:s,link:o})),r},[])}function ES(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 CS(){let e=m.useContext(So);return Fd(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function jS(){let e=m.useContext(la);return Fd(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Hd=m.createContext(void 0);Hd.displayName="FrameworkContext";function jx(){let e=m.useContext(Hd);return Fd(e,"You must render this element inside a <HydratedRouter> element"),e}function _S(e,t){let n=m.useContext(Hd),[r,o]=m.useState(!1),[s,i]=m.useState(!1),{onFocus:l,onBlur:a,onMouseEnter:c,onMouseLeave:h,onTouchStart:f}=t,d=m.useRef(null);m.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let w=p=>{p.forEach(v=>{i(v.isIntersecting)})},S=new IntersectionObserver(w,{threshold:.5});return d.current&&S.observe(d.current),()=>{S.disconnect()}}},[e]),m.useEffect(()=>{if(r){let w=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(w)}}},[r]);let x=()=>{o(!0)},y=()=>{o(!1),i(!1)};return n?e!=="intent"?[s,d,{}]:[s,d,{onFocus:Fo(l,x),onBlur:Fo(a,y),onMouseEnter:Fo(c,x),onMouseLeave:Fo(h,y),onTouchStart:Fo(f,x)}]:[!1,d,{}]}function Fo(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function PS({page:e,...t}){let{router:n}=CS(),r=m.useMemo(()=>yx(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?m.createElement(IS,{page:e,matches:r,...t}):null}function MS(e){let{manifest:t,routeModules:n}=jx(),[r,o]=m.useState([]);return m.useEffect(()=>{let s=!1;return wS(e,t,n).then(i=>{s||o(i)}),()=>{s=!0}},[e,t,n]),r}function IS({page:e,matches:t,...n}){let r=Qt(),{manifest:o,routeModules:s}=jx(),{loaderData:i,matches:l}=jS(),a=m.useMemo(()=>Bh(e,t,l,o,r,"data"),[e,t,l,o,r]),c=m.useMemo(()=>Bh(e,t,l,o,r,"assets"),[e,t,l,o,r]),h=m.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let x=new Set,y=!1;if(t.forEach(S=>{var v;let p=o.routes[S.route.id];!p||!p.hasLoader||(!a.some(g=>g.route.id===S.route.id)&&S.route.id in i&&((v=s[S.route.id])!=null&&v.shouldRevalidate)||p.hasClientLoader?y=!0:x.add(S.route.id))}),x.size===0)return[];let w=ES(e);return y&&x.size>0&&w.searchParams.set("_routes",t.filter(S=>x.has(S.route.id)).map(S=>S.route.id).join(",")),[w.pathname+w.search]},[i,r,o,a,t,e,s]),f=m.useMemo(()=>NS(c,o),[c,o]),d=MS(c);return m.createElement(m.Fragment,null,h.map(x=>m.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...n})),f.map(x=>m.createElement("link",{key:x,rel:"modulepreload",href:x,...n})),d.map(({key:x,link:y})=>m.createElement("link",{key:x,...y})))}function TS(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var _x=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{_x&&(window.__reactRouterVersion="7.1.0")}catch{}function RS({basename:e,children:t,window:n}){let r=m.useRef();r.current==null&&(r.current=gN({window:n,v5Compat:!0}));let o=r.current,[s,i]=m.useState({action:o.action,location:o.location}),l=m.useCallback(a=>{m.startTransition(()=>i(a))},[i]);return m.useLayoutEffect(()=>o.listen(l),[o,l]),m.createElement(lS,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:o})}var Px=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,io=m.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:s,replace:i,state:l,target:a,to:c,preventScrollReset:h,viewTransition:f,...d},x){let{basename:y}=m.useContext(Rt),w=typeof c=="string"&&Px.test(c),S,p=!1;if(typeof c=="string"&&w&&(S=c,_x))try{let I=new URL(window.location.href),D=c.startsWith("//")?new URL(I.protocol+c):new URL(c),R=Bn(D.pathname,y);D.origin===I.origin&&R!=null?c=R+D.search+D.hash:p=!0}catch{vt(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let v=BN(c,{relative:o}),[g,N,k]=_S(r,d),b=zS(c,{replace:i,state:l,target:a,preventScrollReset:h,relative:o,viewTransition:f});function E(I){t&&t(I),I.defaultPrevented||b(I)}let _=m.createElement("a",{...d,...k,href:S||v,onClick:p||s?t:E,ref:TS(x,N),target:a,"data-discover":!w&&n==="render"?"true":void 0});return g&&!w?m.createElement(m.Fragment,null,_,m.createElement(PS,{page:v})):_});io.displayName="Link";var Mx=m.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:s,to:i,viewTransition:l,children:a,...c},h){let f=Vs(i,{relative:c.relative}),d=Qt(),x=m.useContext(la),{navigator:y,basename:w}=m.useContext(Rt),S=x!=null&&BS(f)&&l===!0,p=y.encodeLocation?y.encodeLocation(f).pathname:f.pathname,v=d.pathname,g=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(v=v.toLowerCase(),g=g?g.toLowerCase():null,p=p.toLowerCase()),g&&w&&(g=Bn(g,w)||g);const N=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let k=v===p||!o&&v.startsWith(p)&&v.charAt(N)==="/",b=g!=null&&(g===p||!o&&g.startsWith(p)&&g.charAt(p.length)==="/"),E={isActive:k,isPending:b,isTransitioning:S},_=k?t:void 0,I;typeof r=="function"?I=r(E):I=[r,k?"active":null,b?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let D=typeof s=="function"?s(E):s;return m.createElement(io,{...c,"aria-current":_,className:I,ref:h,style:D,to:i,viewTransition:l},typeof a=="function"?a(E):a)});Mx.displayName="NavLink";var LS=m.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:s,method:i=Xi,action:l,onSubmit:a,relative:c,preventScrollReset:h,viewTransition:f,...d},x)=>{let y=FS(),w=HS(l,{relative:c}),S=i.toLowerCase()==="get"?"get":"post",p=typeof l=="string"&&Px.test(l),v=g=>{if(a&&a(g),g.defaultPrevented)return;g.preventDefault();let N=g.nativeEvent.submitter,k=(N==null?void 0:N.getAttribute("formmethod"))||i;y(N||g.currentTarget,{fetcherKey:t,method:k,navigate:n,replace:o,state:s,relative:c,preventScrollReset:h,viewTransition:f})};return m.createElement("form",{ref:x,method:S,action:w,onSubmit:r?a:v,...d,"data-discover":!p&&e==="render"?"true":void 0})});LS.displayName="Form";function AS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ix(e){let t=m.useContext(So);return ge(t,AS(e)),t}function zS(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:s,viewTransition:i}={}){let l=aa(),a=Qt(),c=Vs(e,{relative:s});return m.useCallback(h=>{if(hS(h,t)){h.preventDefault();let f=n!==void 0?n:js(a)===js(c);l(e,{replace:f,state:r,preventScrollReset:o,relative:s,viewTransition:i})}},[a,l,c,n,r,t,e,o,s,i])}function DS(e){vt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=m.useRef(wc(e)),n=m.useRef(!1),r=Qt(),o=m.useMemo(()=>pS(r.search,n.current?null:t.current),[r.search]),s=aa(),i=m.useCallback((l,a)=>{const c=wc(typeof l=="function"?l(o):l);n.current=!0,s("?"+c,a)},[s,o]);return[o,i]}var $S=0,OS=()=>`__${String(++$S)}__`;function FS(){let{router:e}=Ix("useSubmit"),{basename:t}=m.useContext(Rt),n=nS();return m.useCallback(async(r,o={})=>{let{action:s,method:i,encType:l,formData:a,body:c}=xS(r,t);if(o.navigate===!1){let h=o.fetcherKey||OS();await e.fetch(h,n,o.action||s,{preventScrollReset:o.preventScrollReset,formData:a,body:c,formMethod:o.method||i,formEncType:o.encType||l,flushSync:o.flushSync})}else await e.navigate(o.action||s,{preventScrollReset:o.preventScrollReset,formData:a,body:c,formMethod:o.method||i,formEncType:o.encType||l,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,n])}function HS(e,{relative:t}={}){let{basename:n}=m.useContext(Rt),r=m.useContext(wt);ge(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...Vs(e||".",{relative:t})},i=Qt();if(e==null){s.search=i.search;let l=new URLSearchParams(s.search),a=l.getAll("index");if(a.some(h=>h==="")){l.delete("index"),a.filter(f=>f).forEach(f=>l.append("index",f));let h=l.toString();s.search=h?`?${h}`:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:an([n,s.pathname])),js(s)}function BS(e,t={}){let n=m.useContext(Sx);ge(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Ix("useViewTransitionState"),o=Vs(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=Bn(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Bn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return _l(o.pathname,i)!=null||_l(o.pathname,s)!=null}new TextEncoder;const Tx=m.createContext(null);function VS({children:e}){const[t,n]=m.useState(()=>localStorage.getItem("opentrust_theme")||"dark"),r=o=>{n(o),localStorage.setItem("opentrust_theme",o)};return m.useEffect(()=>{const o=document.documentElement;if(o.classList.remove("light","dark"),t==="system"){const s=window.matchMedia("(prefers-color-scheme: dark)").matches;o.classList.add(s?"dark":"light")}else o.classList.add(t)},[t]),u.jsx(Tx.Provider,{value:{theme:t,setTheme:r},children:e})}function US(){const e=m.useContext(Tx);if(!e)throw new Error("useTheme must be within ThemeProvider");return e}const WS={email:"dev@localhost",apiKey:"sk-og-dev"},Rx=m.createContext(null);function YS({children:e}){const[t,n]=m.useState(()=>{const l=localStorage.getItem("opentrust_user");return l?JSON.parse(l):null}),[r,o]=m.useState(!localStorage.getItem("opentrust_user"));m.useEffect(()=>{if(t){o(!1);return}let l=!1;return(async()=>{try{const a=await fetch("/api/auth/config");if(!a.ok)return;const c=await a.json();!l&&c.devMode&&n(WS)}catch{}finally{l||o(!1)}})(),()=>{l=!0}},[t]);const s=m.useCallback(async(l,a)=>{const c=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:l,apiKey:a})});if(!c.ok)throw new Error("Login failed");const h=await c.json();if(!h.success)throw new Error(h.error??"Login failed");const f={email:l,apiKey:a};n(f),localStorage.setItem("opentrust_user",JSON.stringify(f))},[]),i=m.useCallback(()=>{n(null),localStorage.removeItem("opentrust_user")},[]);return u.jsx(Rx.Provider,{value:{user:t,isAuthenticated:!!t,isLoading:r,login:s,logout:i},children:e})}function Bd(){const e=m.useContext(Rx);if(!e)throw new Error("useAuth must be within AuthProvider");return e}function Lx(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Lx(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function GS(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Lx(e))&&(r&&(r+=" "),r+=t);return r}const Vd="-";function XS(e){const t=QS(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(i){const l=i.split(Vd);return l[0]===""&&l.length!==1&&l.shift(),Ax(l,t)||KS(i)}function s(i,l){const a=n[i]||[];return l&&r[i]?[...a,...r[i]]:a}return{getClassGroupId:o,getConflictingClassGroupIds:s}}function Ax(e,t){var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Ax(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Vd);return(i=t.validators.find(({validator:l})=>l(s)))==null?void 0:i.classGroupId}const Vh=/^\[(.+)\]$/;function KS(e){if(Vh.test(e)){const t=Vh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function QS(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ZS(Object.entries(e.classGroups),n).forEach(([s,i])=>{Nc(i,r,s,t)}),r}function Nc(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Uh(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(qS(o)){Nc(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Nc(i,Uh(t,s),n,r)})})}function Uh(e,t){let n=e;return t.split(Vd).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function qS(e){return e.isThemeGetter}function ZS(e,t){return t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,l])=>[t+i,l])):s);return[n,o]}):e}function JS(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(s,i){n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)}return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}}const zx="!";function ek(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(i){const l=[];let a=0,c=0,h;for(let w=0;w<i.length;w++){let S=i[w];if(a===0){if(S===r&&(n||i.slice(w,w+o)===t)){l.push(i.slice(c,w)),c=w+o;continue}if(S==="/"){h=w;continue}}S==="["?a++:S==="]"&&a--}const f=l.length===0?i:i.substring(c),d=f.startsWith(zx),x=d?f.substring(1):f,y=h&&h>c?h-c:void 0;return{modifiers:l,hasImportantModifier:d,baseClassName:x,maybePostfixModifierPosition:y}}}function tk(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 nk(e){return{cache:JS(e.cacheSize),splitModifiers:ek(e),...XS(e)}}const rk=/\s+/;function ok(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=new Set;return e.trim().split(rk).map(i=>{const{modifiers:l,hasImportantModifier:a,baseClassName:c,maybePostfixModifierPosition:h}=n(i);let f=r(h?c.substring(0,h):c),d=!!h;if(!f){if(!h)return{isTailwindClass:!1,originalClassName:i};if(f=r(c),!f)return{isTailwindClass:!1,originalClassName:i};d=!1}const x=tk(l).join(":");return{isTailwindClass:!0,modifierId:a?x+zx:x,classGroupId:f,originalClassName:i,hasPostfixModifier:d}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:l,classGroupId:a,hasPostfixModifier:c}=i,h=l+a;return s.has(h)?!1:(s.add(h),o(a,c).forEach(f=>s.add(l+f)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function sk(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Dx(t))&&(r&&(r+=" "),r+=n);return r}function Dx(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Dx(e[r]))&&(n&&(n+=" "),n+=t);return n}function ik(e,...t){let n,r,o,s=i;function i(a){const c=t.reduce((h,f)=>f(h),e());return n=nk(c),r=n.cache.get,o=n.cache.set,s=l,l(a)}function l(a){const c=r(a);if(c)return c;const h=ok(a,n);return o(a,h),h}return function(){return s(sk.apply(null,arguments))}}function fe(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const $x=/^\[(?:([a-z-]+):)?(.+)\]$/i,lk=/^\d+\/\d+$/,ak=new Set(["px","full","screen"]),uk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ck=/\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$/,dk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,fk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Jt(e){return nr(e)||ak.has(e)||lk.test(e)}function vn(e){return bo(e,"length",Nk)}function nr(e){return!!e&&!Number.isNaN(Number(e))}function wi(e){return bo(e,"number",nr)}function Ho(e){return!!e&&Number.isInteger(Number(e))}function pk(e){return e.endsWith("%")&&nr(e.slice(0,-1))}function ee(e){return $x.test(e)}function wn(e){return uk.test(e)}const mk=new Set(["length","size","percentage"]);function gk(e){return bo(e,mk,Ox)}function xk(e){return bo(e,"position",Ox)}const yk=new Set(["image","url"]);function vk(e){return bo(e,yk,kk)}function wk(e){return bo(e,"",Sk)}function Bo(){return!0}function bo(e,t,n){const r=$x.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function Nk(e){return ck.test(e)&&!dk.test(e)}function Ox(){return!1}function Sk(e){return fk.test(e)}function kk(e){return hk.test(e)}function bk(){const e=fe("colors"),t=fe("spacing"),n=fe("blur"),r=fe("brightness"),o=fe("borderColor"),s=fe("borderRadius"),i=fe("borderSpacing"),l=fe("borderWidth"),a=fe("contrast"),c=fe("grayscale"),h=fe("hueRotate"),f=fe("invert"),d=fe("gap"),x=fe("gradientColorStops"),y=fe("gradientColorStopPositions"),w=fe("inset"),S=fe("margin"),p=fe("opacity"),v=fe("padding"),g=fe("saturate"),N=fe("scale"),k=fe("sepia"),b=fe("skew"),E=fe("space"),_=fe("translate"),I=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",ee,t],T=()=>[ee,t],F=()=>["",Jt,vn],j=()=>["auto",nr,ee],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],C=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",ee],L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[nr,wi],$=()=>[nr,ee];return{cacheSize:500,separator:":",theme:{colors:[Bo],spacing:[Jt,vn],blur:["none","",wn,ee],brightness:O(),borderColor:[e],borderRadius:["none","","full",wn,ee],borderSpacing:T(),borderWidth:F(),contrast:O(),grayscale:P(),hueRotate:$(),invert:P(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[pk,vn],inset:R(),margin:R(),opacity:O(),padding:T(),saturate:O(),scale:O(),sepia:P(),skew:$(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",ee]}],container:["container"],columns:[{columns:[wn]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"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:[...A(),ee]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],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",Ho,ee]}],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",ee]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",Ho,ee]}],"grid-cols":[{"grid-cols":[Bo]}],"col-start-end":[{col:["auto",{span:["full",Ho,ee]},ee]}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":[Bo]}],"row-start-end":[{row:["auto",{span:[Ho,ee]},ee]}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ee]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ee]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...C()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...C(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...C(),"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:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ee,t]}],"min-w":[{"min-w":[ee,t,"min","max","fit"]}],"max-w":[{"max-w":[ee,t,"none","full","min","max","fit","prose",{screen:[wn]},wn]}],h:[{h:[ee,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ee,t,"auto","min","max","fit"]}],"font-size":[{text:["base",wn,vn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",wi]}],"font-family":[{font:[Bo]}],"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",ee]}],"line-clamp":[{"line-clamp":["none",nr,wi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Jt,ee]}],"list-image":[{"list-image":["none",ee]}],"list-style-type":[{list:["none","disc","decimal",ee]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[p]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Jt,vn]}],"underline-offset":[{"underline-offset":["auto",Jt,ee]}],"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",ee]}],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",ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[p]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...A(),xk]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",gk]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},vk]}],"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:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[p]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[p]}],"divide-style":[{divide:M()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...M()]}],"outline-offset":[{"outline-offset":[Jt,ee]}],"outline-w":[{outline:[Jt,vn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[Jt,vn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",wn,wk]}],"shadow-color":[{shadow:[Bo]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",wn,ee]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[f]}],saturate:[{saturate:[g]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[g]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"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",ee]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",ee]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",ee]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[Ho,ee]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[b]}],"skew-y":[{"skew-y":[b]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ee]}],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",ee]}],"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",ee]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Jt,vn,wi]}],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 Ek=ik(bk);function je(...e){return Ek(GS(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 Ck=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Fx=(...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 jk={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 _k=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...l},a)=>m.createElement("svg",{ref:a,...jk,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Fx("lucide",o),...l},[...i.map(([c,h])=>m.createElement(c,h)),...Array.isArray(s)?s:[s]]));/**
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 te=(e,t)=>{const n=m.forwardRef(({className:r,...o},s)=>m.createElement(_k,{ref:s,iconNode:t,className:Fx(`lucide-${Ck(e)}`,r),...o}));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 Pk=te("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 Mk=te("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 Ik=te("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 Tk=te("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 ca=te("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 Ud=te("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 Wd=te("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 Hx=te("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"}]]);/**
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 lo=te("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
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 Wt=te("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"}]]);/**
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 Rk=te("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
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 Lk=te("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
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 Ak=te("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"}]]);/**
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 Vn=te("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"}]]);/**
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 zk=te("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"}]]);/**
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 da=te("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"}]]);/**
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 Bx=te("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"}]]);/**
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 Dk=te("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"}]]);/**
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 $k=te("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"}]]);/**
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 Ok=te("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"}]]);/**
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 Yt=te("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
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 Fk=te("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"}]]);/**
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 Hk=te("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
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 Bk=te("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"}]]);/**
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 ir=te("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"}]]);/**
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 Vk=te("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"}]]);/**
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 Uk=te("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
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 Qi=te("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"}]]);/**
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 pr=te("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"}]]);/**
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 Wk=te("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"}]]);/**
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 Yk=te("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"}]]);/**
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 Vx=te("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 Yd=te("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"}]]);/**
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 Un=te("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"}]]);/**
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 Gk=te("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"}]]);/**
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 Xk=te("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"}]]);/**
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 Pl=te("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
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 Gt=te("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"}]]);/**
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 Ux=te("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"}]]);/**
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 Wx=te("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"}]]);/**
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 Kk=te("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Qk=[{label:"Discovery",items:[{to:"/inventory/agents",label:"Agents",icon:ca},{to:"/inventory/identities",label:"Identities",icon:Bx},{to:"/inventory/permissions",label:"Permissions",icon:$k}]},{label:"Secure",items:[{to:"/secure/risk",label:"Risk",icon:Ux},{to:"/secure/graph",label:"Graph",icon:Bk}]},{label:"Operations",items:[{to:"/ops/skills",label:"Skills",icon:Wx},{to:"/ops/plugins",label:"Plugins",icon:Qi}]},{label:"System",items:[{to:"/system/logs",label:"Logs",icon:Yk},{to:"/system/settings",label:"Settings",icon:Un}]}];function qk(){const e=Qt(),[t,n]=m.useState("");return m.useEffect(()=>{fetch("/health").then(r=>r.json()).then(r=>n(r.version??"")).catch(()=>{})},[]),u.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[u.jsxs("div",{className:"flex h-14 items-center gap-2 border-b border-border px-4",children:[u.jsx("img",{src:"/dashboard/logo-512.png",alt:"OpenTrust",className:"h-6 w-6 dark:brightness-[1.8] dark:contrast-125"}),u.jsx("span",{className:"text-sm font-semibold tracking-tight text-foreground",children:"OpenTrust"})]}),u.jsx("nav",{className:"flex-1 space-y-6 px-3 py-4",children:Qk.map(r=>u.jsxs("div",{children:[u.jsx("p",{className:"mb-2 px-2 text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:r.label}),u.jsx("div",{className:"space-y-0.5",children:r.items.map(o=>u.jsxs(Mx,{to:o.to,className:je("flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm transition-colors",e.pathname.startsWith(o.to)?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[u.jsx(o.icon,{className:"h-4 w-4 shrink-0"}),o.label]},o.to))})]},r.label))}),u.jsx("div",{className:"border-t border-border px-4 py-3",children:u.jsx("p",{className:"text-[11px] text-muted-foreground",children:t?`v${t}`:""})})]})}function Zk(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Yx(...e){return t=>e.forEach(n=>Zk(n,t))}function Xt(...e){return m.useCallback(Yx(...e),e)}var ao=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),s=o.find(eb);if(s){const i=s.props.children,l=o.map(a=>a===s?m.Children.count(i)>1?m.Children.only(null):m.isValidElement(i)?i.props.children:null:a);return u.jsx(Sc,{...r,ref:t,children:m.isValidElement(i)?m.cloneElement(i,void 0,l):null})}return u.jsx(Sc,{...r,ref:t,children:n})});ao.displayName="Slot";var Sc=m.forwardRef((e,t)=>{const{children:n,...r}=e;if(m.isValidElement(n)){const o=nb(n);return m.cloneElement(n,{...tb(r,n.props),ref:t?Yx(t,o):o})}return m.Children.count(n)>1?m.Children.only(null):null});Sc.displayName="SlotClone";var Jk=({children:e})=>u.jsx(u.Fragment,{children:e});function eb(e){return m.isValidElement(e)&&e.type===Jk}function tb(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{s(...l),o(...l)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function nb(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Gx(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=Gx(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function rb(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Gx(e))&&(r&&(r+=" "),r+=t);return r}const Wh=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Yh=rb,ob=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Yh(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const h=n==null?void 0:n[c],f=s==null?void 0:s[c];if(h===null)return null;const d=Wh(h)||Wh(f);return o[c][d]}),l=n&&Object.entries(n).reduce((c,h)=>{let[f,d]=h;return d===void 0||(c[f]=d),c},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,h)=>{let{class:f,className:d,...x}=h;return Object.entries(x).every(y=>{let[w,S]=y;return Array.isArray(S)?S.includes({...s,...l}[w]):{...s,...l}[w]===S})?[...c,f,d]:c},[]);return Yh(e,i,a,n==null?void 0:n.class,n==null?void 0:n.className)},sb=ob("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"}}),oe=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?ao:"button";return u.jsx(i,{className:je(sb({variant:t,size:n,className:e})),ref:s,...o})});oe.displayName="Button";function ib(){const{user:e,logout:t}=Bd(),{theme:n,setTheme:r}=US();return u.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border bg-card px-6",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"h-2 w-2 rounded-full bg-success"}),u.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[(e==null?void 0:e.email)&&u.jsx("span",{className:"text-xs text-muted-foreground",children:e.email}),u.jsx(oe,{variant:"ghost",size:"icon",onClick:()=>r(n==="dark"?"light":"dark"),className:"h-8 w-8",children:n==="dark"?u.jsx(Xk,{className:"h-4 w-4"}):u.jsx(Hk,{className:"h-4 w-4"})}),u.jsx(oe,{variant:"ghost",size:"icon",onClick:t,className:"h-8 w-8",children:u.jsx(Fk,{className:"h-4 w-4"})})]})]})}function lb(){return u.jsxs("div",{className:"flex h-screen overflow-hidden bg-background",children:[u.jsx(qk,{}),u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[u.jsx(ib,{}),u.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:u.jsx(iS,{})})]})]})}const Tt=m.forwardRef(({className:e,type:t,...n},r)=>u.jsx("input",{type:t,className:je("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}));Tt.displayName="Input";function ab(){const[e]=DS(),[t,n]=m.useState(e.get("email")??""),[r,o]=m.useState(e.get("key")??""),[s,i]=m.useState(""),[l,a]=m.useState(!1),{login:c,isAuthenticated:h,isLoading:f}=Bd(),d=aa();if(m.useEffect(()=>{h&&d("/inventory/agents",{replace:!0})},[h,d]),f)return u.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:u.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading..."})});const x=async y=>{y.preventDefault(),i(""),a(!0);try{await c(t,r),d("/inventory/agents",{replace:!0})}catch(w){i(w instanceof Error?w.message:"Login failed")}finally{a(!1)}};return u.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:u.jsxs("div",{className:"w-full max-w-sm space-y-8 px-4",children:[u.jsxs("div",{className:"flex flex-col items-center gap-3",children:[u.jsx("img",{src:"/dashboard/logo-512.png",alt:"OpenTrust",className:"h-12 w-12 dark:brightness-[1.8] dark:contrast-125"}),u.jsxs("div",{className:"text-center",children:[u.jsx("h1",{className:"text-lg font-semibold tracking-tight text-foreground",children:"OpenTrust"}),u.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Sign in to your dashboard"})]})]}),u.jsxs("form",{onSubmit:x,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx("label",{className:"text-sm font-medium text-foreground",children:"Email"}),u.jsx(Tt,{type:"email",placeholder:"you@example.com",value:t,onChange:y=>n(y.target.value),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("label",{className:"text-sm font-medium text-foreground",children:"API Key"}),u.jsx(Tt,{type:"password",placeholder:"sk-og-...",value:r,onChange:y=>o(y.target.value),required:!0})]}),s&&u.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:s}),u.jsx(oe,{type:"submit",className:"w-full",disabled:l,children:l?"Signing in...":"Sign in"})]}),u.jsx("p",{className:"text-center text-xs text-muted-foreground",children:"API Key is generated when registering an agent with the Core API."})]})})}const ub="/api";async function ke(e,t){const n=localStorage.getItem("opentrust_user"),r=n?JSON.parse(n).apiKey:null,o=await fetch(`${ub}${e}`,{...t,headers:{"Content-Type":"application/json",...r&&{Authorization:`Bearer ${r}`},...t==null?void 0:t.headers}});if(!o.ok)throw new Error(`API ${o.status}: ${await o.text()}`);return o.json()}const Se={agents:{list:()=>ke("/agents"),get:e=>ke(`/agents/${e}`),create:e=>ke("/agents",{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>ke(`/agents/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>ke(`/agents/${e}`,{method:"DELETE"})},discovery:{agents:()=>ke("/discovery/agents"),profile:e=>ke(`/discovery/agents/${e}/profile`)},observations:{recent:(e=50)=>ke(`/observations?limit=${e}`),permissions:()=>ke("/observations/permissions"),anomalies:()=>ke("/observations/anomalies"),summary:()=>ke("/observations/summary"),agentPermissions:e=>ke(`/observations/agents/${e}/permissions`)},commands:{list:e=>ke(`/commands?agentId=${e}`),create:e=>ke("/commands",{method:"POST",body:JSON.stringify(e)})},system:{services:()=>ke("/system/services"),logs:(e,t=200)=>ke(`/system/logs/${e}?lines=${t}`),clearLog:e=>ke(`/system/logs/${e}`,{method:"DELETE"})},detect:e=>ke("/detect",{method:"POST",body:JSON.stringify(e)}),usage:{summary:(e=30)=>ke(`/usage/summary?days=${e}`),daily:(e=30)=>ke(`/usage/daily?days=${e}`)},settings:{get:()=>ke("/settings"),update:e=>ke("/settings",{method:"PUT",body:JSON.stringify(e)})}};function Ce({className:e,variant:t="default",...n}){return u.jsx("div",{className:je("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 cb(){const[e,t]=m.useState([]),[n,r]=m.useState(""),[o,s]=m.useState(!0),i=async()=>{s(!0);try{const c=await Se.discovery.agents();t(c.data??[])}catch{}s(!1)};m.useEffect(()=>{i()},[]);const l=e.filter(c=>{var h;return!n||((h=c.name)==null?void 0:h.toLowerCase().includes(n.toLowerCase()))}),a=c=>c==="active"?"success":c==="inactive"?"secondary":"warning";return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Agents"}),u.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," agent",e.length!==1?"s":""," discovered"]})]}),u.jsxs(oe,{variant:"outline",size:"sm",onClick:i,children:[u.jsx(pr,{className:"h-3.5 w-3.5"}),"Scan"]})]}),u.jsxs("div",{className:"relative max-w-sm",children:[u.jsx(Vx,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),u.jsx(Tt,{placeholder:"Search agents...",className:"pl-9",value:n,onChange:c=>r(c.target.value)})]}),o?u.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.length===0?u.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border",children:[u.jsx(ca,{className:"h-8 w-8 text-muted-foreground/50"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents found"})]}):u.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:l.map(c=>{var h;return u.jsxs(io,{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:[u.jsxs("div",{className:"flex items-start justify-between",children:[u.jsxs("div",{className:"flex items-center gap-2.5",children:[u.jsx("span",{className:"text-xl",children:c.emoji||"🤖"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-foreground group-hover:text-foreground",children:c.name}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:[c.provider||"unknown",c.model?` · ${c.model}`:""]})]})]}),u.jsx(Ce,{variant:a(c.status??"inactive"),className:"text-[10px]",children:c.status??"inactive"})]}),((h=c.skills)==null?void 0:h.length)>0&&u.jsxs("div",{className:"flex flex-wrap gap-1",children:[c.skills.slice(0,4).map(f=>u.jsx("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:typeof f=="string"?f:f.name},f.name??f)),c.skills.length>4&&u.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 Te=m.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:je("rounded-lg border border-border bg-card text-card-foreground shadow-sm",e),...t}));Te.displayName="Card";const De=m.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:je("flex flex-col space-y-1.5 p-6",e),...t}));De.displayName="CardHeader";const $e=m.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:je("font-semibold leading-none tracking-tight",e),...t}));$e.displayName="CardTitle";const db=m.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:je("text-sm text-muted-foreground",e),...t}));db.displayName="CardDescription";const Re=m.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:je("p-6 pt-0",e),...t}));Re.displayName="CardContent";const fb=["Profile","Tasks","Identities","Permissions"];function hb(){const{id:e}=YN(),[t,n]=m.useState(null),[r,o]=m.useState([]),[s,i]=m.useState("Profile"),[l,a]=m.useState(!0);return m.useEffect(()=>{e&&(a(!0),(async()=>{const c=await Se.discovery.profile(e).catch(()=>null),h=(c==null?void 0:c.data)??null;n(h);const f=(h==null?void 0:h.registeredAgentId)??e,d=await Se.observations.agentPermissions(f).catch(()=>({data:[]}));o((d==null?void 0:d.data)??[]),a(!1)})())},[e]),l?u.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):t?u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(io,{to:"/inventory/agents",className:"rounded-md p-1.5 hover:bg-accent",children:u.jsx(Ik,{className:"h-4 w-4"})}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"text-2xl",children:t.emoji||"🤖"}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-lg font-semibold",children:t.name||e}),u.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.provider||"unknown",t.model?` / ${t.model}`:""]})]})]})]}),u.jsx("div",{className:"flex gap-1 border-b border-border",children:fb.map(c=>u.jsx("button",{onClick:()=>i(c),className:je("border-b-2 px-4 py-2 text-sm font-medium transition-colors",s===c?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:c},c))}),s==="Profile"&&u.jsx(pb,{profile:t}),s==="Tasks"&&u.jsx(mb,{profile:t}),s==="Identities"&&u.jsx(gb,{profile:t}),s==="Permissions"&&u.jsx(xb,{permissions:r})]}):u.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Agent not found"})}function pb({profile:e}){const t=e.skills??[];return u.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[u.jsxs(Te,{children:[u.jsx(De,{children:u.jsx($e,{className:"text-sm",children:"Info"})}),u.jsxs(Re,{className:"space-y-2 text-sm",children:[u.jsx(Vo,{label:"Owner",value:e.ownerName||"—"}),u.jsx(Vo,{label:"Creature",value:e.creature||"—"}),u.jsx(Vo,{label:"Vibe",value:e.vibe||"—"}),u.jsx(Vo,{label:"Sessions",value:String(e.sessionCount??0)}),u.jsx(Vo,{label:"Last Active",value:e.lastActive??"never"})]})]}),u.jsxs(Te,{children:[u.jsx(De,{children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[u.jsx(Wx,{className:"h-4 w-4"})," Skills (",t.length,")"]}),u.jsx(io,{to:"/ops/skills",children:u.jsxs(oe,{size:"sm",variant:"ghost",className:"h-7 text-xs text-muted-foreground",children:["Manage ",u.jsx(zk,{className:"ml-1 h-3 w-3"})]})})]})}),u.jsx(Re,{children:t.length===0?u.jsxs("div",{className:"flex flex-col items-center gap-2 py-4",children:[u.jsx(ir,{className:"h-8 w-8 text-muted-foreground/30"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"No skills installed"}),u.jsx(io,{to:"/ops/skills",children:u.jsx(oe,{size:"sm",variant:"ghost",className:"h-7 text-xs",children:"Go to Operations to install skills"})})]}):u.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(n=>u.jsxs(Ce,{variant:"secondary",className:"text-xs font-normal",children:[u.jsx(ir,{className:"mr-1 h-3 w-3"})," ",n.name]},n.name))})})]}),u.jsxs(Te,{children:[u.jsx(De,{children:u.jsx($e,{className:"text-sm",children:"Plugins"})}),u.jsx(Re,{children:(e.plugins??[]).length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins"}):u.jsx("div",{className:"space-y-1.5",children:(e.plugins??[]).map(n=>u.jsxs("div",{className:"flex items-center justify-between text-sm",children:[u.jsx("span",{children:n.name}),u.jsx(Ce,{variant:n.enabled?"success":"secondary",className:"text-[10px]",children:n.enabled?"on":"off"})]},n.name))})})]}),u.jsxs(Te,{children:[u.jsx(De,{children:u.jsx($e,{className:"text-sm",children:"Connected Systems"})}),u.jsx(Re,{children:(e.connectedSystems??[]).length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"None"}):u.jsx("div",{className:"flex flex-wrap gap-1.5",children:(e.connectedSystems??[]).map(n=>u.jsx(Ce,{variant:"outline",className:"text-xs",children:n},n))})})]})]})}function mb({profile:e}){const t=e.cronJobs??[];return u.jsxs(Te,{children:[u.jsx(De,{children:u.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[u.jsx(Lk,{className:"h-4 w-4"})," Scheduled Tasks (",t.length,")"]})}),u.jsx(Re,{children:t.length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"No scheduled tasks"}):u.jsx("div",{className:"space-y-2",children:t.map((n,r)=>u.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2 text-sm",children:[u.jsxs("div",{children:[u.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:n.schedule}),u.jsx("span",{className:"ml-2",children:n.task??n.id})]}),u.jsx(Ce,{variant:n.enabled!==!1?"success":"secondary",className:"text-[10px]",children:n.enabled!==!1?"active":"paused"})]},r))})})]})}function gb({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 u.jsx("div",{className:"space-y-4",children:n.length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"No identity files found"}):n.map(r=>u.jsxs(Te,{children:[u.jsx(De,{children:u.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[u.jsx(da,{className:"h-4 w-4"})," ",r.label]})}),u.jsx(Re,{children:u.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 xb({permissions:e}){return e.length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"No observed permissions"}):u.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[u.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Tool"}),u.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),u.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Access"}),u.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"Calls"}),u.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"Errors"})]})}),u.jsx("tbody",{children:e.map(t=>u.jsxs("tr",{className:"border-b border-border last:border-0",children:[u.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:t.toolName}),u.jsx("td",{className:"px-4 py-2.5",children:u.jsx(Ce,{variant:"outline",className:"text-[10px]",children:t.category??"—"})}),u.jsx("td",{className:"px-4 py-2.5",children:u.jsx(Ce,{variant:t.accessPattern==="write"?"warning":t.accessPattern==="admin"?"destructive":"secondary",className:"text-[10px]",children:t.accessPattern??"read"})}),u.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs",children:t.callCount}),u.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs text-destructive",children:t.errorCount||"—"})]},t.id))})]})})}function Vo({label:e,value:t}){return u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-muted-foreground",children:e}),u.jsx("span",{className:"font-medium",children:t})]})}function yb(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[o,s]=m.useState(new Set);m.useEffect(()=>{Se.discovery.agents().then(a=>{t(a.data??[]),r(!1)}).catch(()=>r(!1))},[]);const i=[{category:"Agents",items:e.map(a=>({id:a.id,name:a.name,emoji:a.emoji,provider:a.provider,status:a.status}))},{category:"Owners",items:[...new Set(e.map(a=>a.ownerName).filter(Boolean))].map(a=>({id:a,name:a,type:"owner"}))},{category:"Connected Systems",items:[...new Set(e.flatMap(a=>a.connectedSystems??[]))].map(a=>({id:a,name:a,type:"system"}))}],l=a=>{s(c=>{const h=new Set(c);return h.has(a)?h.delete(a):h.add(a),h})};return n?u.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Identities"}),u.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Agents, owners, and connected systems"})]}),u.jsx("div",{className:"space-y-3",children:i.map(a=>u.jsxs(Te,{children:[u.jsxs("button",{onClick:()=>l(a.category),className:"flex w-full items-center justify-between p-4 text-left",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Bx,{className:"h-4 w-4 text-muted-foreground"}),u.jsx("span",{className:"text-sm font-medium",children:a.category}),u.jsx(Ce,{variant:"secondary",className:"text-[10px]",children:a.items.length})]}),o.has(a.category)?u.jsx(Ud,{className:"h-4 w-4 text-muted-foreground"}):u.jsx(Wd,{className:"h-4 w-4 text-muted-foreground"})]}),o.has(a.category)&&u.jsx(Re,{className:"border-t border-border pt-3",children:a.items.length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"None"}):u.jsx("div",{className:"space-y-1.5",children:a.items.map(c=>u.jsxs("div",{className:"flex items-center justify-between rounded-md px-3 py-2 text-sm hover:bg-muted/50",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[c.emoji&&u.jsx("span",{className:"text-base",children:c.emoji}),u.jsx("span",{children:c.name})]}),c.status&&u.jsx(Ce,{variant:c.status==="active"?"success":"secondary",className:"text-[10px]",children:c.status}),c.type&&u.jsx(Ce,{variant:"outline",className:"text-[10px]",children:c.type})]},c.id))})})]},a.category))})]})}function vb(){const[e,t]=m.useState([]),[n,r]=m.useState(""),[o,s]=m.useState("callCount"),[i,l]=m.useState(!1),[a,c]=m.useState(!0);m.useEffect(()=>{Se.observations.permissions().then(d=>{t(d.data??[]),c(!1)}).catch(()=>c(!1))},[]);const h=m.useMemo(()=>{let d=e;if(n){const x=n.toLowerCase();d=d.filter(y=>{var w,S;return((w=y.toolName)==null?void 0:w.toLowerCase().includes(x))||((S=y.category)==null?void 0:S.toLowerCase().includes(x))})}return[...d].sort((x,y)=>{const w=x[o]??0,S=y[o]??0;return typeof w=="string"?i?w.localeCompare(S):S.localeCompare(w):i?w-S:S-w})},[e,n,o,i]),f=d=>{o===d?l(!i):(s(d),l(!1))};return a?u.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Permissions"}),u.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," observed tool permission",e.length!==1?"s":""]})]}),u.jsxs("div",{className:"relative max-w-sm",children:[u.jsx(Vx,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),u.jsx(Tt,{placeholder:"Filter by tool or category...",className:"pl-9",value:n,onChange:d=>r(d.target.value)})]}),u.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[u.jsx(su,{label:"Tool",sortKey:"toolName",current:o,asc:i,onSort:f}),u.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),u.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Access"}),u.jsx(su,{label:"Calls",sortKey:"callCount",current:o,asc:i,onSort:f,align:"right"}),u.jsx(su,{label:"Errors",sortKey:"errorCount",current:o,asc:i,onSort:f,align:"right"})]})}),u.jsx("tbody",{children:h.length===0?u.jsx("tr",{children:u.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-muted-foreground",children:"No permissions"})}):h.map(d=>u.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-muted/30",children:[u.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:d.toolName}),u.jsx("td",{className:"px-4 py-2.5",children:u.jsx(Ce,{variant:"outline",className:"text-[10px]",children:d.category??"—"})}),u.jsx("td",{className:"px-4 py-2.5",children:u.jsx(Ce,{variant:d.accessPattern==="write"?"warning":d.accessPattern==="admin"?"destructive":"secondary",className:"text-[10px]",children:d.accessPattern??"read"})}),u.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs",children:d.callCount}),u.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs text-destructive",children:d.errorCount||"—"})]},d.id))})]})})]})}function su({label:e,sortKey:t,current:n,asc:r,onSort:o,align:s="left"}){return u.jsx("th",{className:`cursor-pointer px-4 py-2.5 font-medium text-muted-foreground hover:text-foreground ${s==="right"?"text-right":"text-left"}`,onClick:()=>o(t),children:u.jsxs("span",{className:"inline-flex items-center gap-1",children:[e,n===t&&u.jsx(Tk,{className:"h-3 w-3"})]})})}function wb(){const[e,t]=m.useState([]),[n,r]=m.useState(!0);m.useEffect(()=>{Se.observations.anomalies().then(i=>{t(i.data??[]),r(!1)}).catch(()=>r(!1))},[]);const o=i=>i.blocked||i.errorCount>3?"high":i.callCount===1||i.errorCount>0?"medium":"low",s=i=>i==="high"?"destructive":i==="medium"?"warning":"secondary";return n?u.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Risk Overview"}),u.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," anomal",e.length!==1?"ies":"y"," detected"]})]}),e.length===0?u.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border",children:[u.jsx(Ux,{className:"h-8 w-8 text-muted-foreground/50"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"No anomalies detected"})]}):u.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[u.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Tool"}),u.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Agent"}),u.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Risk"}),u.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),u.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"First Seen"})]})}),u.jsx("tbody",{children:e.map(i=>{var a;const l=o(i);return u.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-muted/30",children:[u.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:i.toolName}),u.jsx("td",{className:"px-4 py-2.5 text-xs text-muted-foreground",children:((a=i.agentId)==null?void 0:a.slice(0,8))??"—"}),u.jsx("td",{className:"px-4 py-2.5",children:u.jsx(Ce,{variant:s(l),className:"text-[10px]",children:l})}),u.jsx("td",{className:"px-4 py-2.5",children:u.jsx(Ce,{variant:"outline",className:"text-[10px]",children:i.category??"—"})}),u.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 Pe(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=Pe(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Nb={value:()=>{}};function fa(){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 Sb(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}qi.prototype=fa.prototype={constructor:qi,on:function(e,t){var n=this._,r=Sb(e+"",n),o,s=-1,i=r.length;if(arguments.length<2){for(;++s<i;)if((o=(e=r[s]).type)&&(o=kb(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<i;)if(o=(e=r[s]).type)n[o]=Gh(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Gh(n[o],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((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,s;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,o=s.length;r<o;++r)s[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],o=0,s=r.length;o<s;++o)r[o].value.apply(t,n)}};function kb(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Gh(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=Nb,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 Xh={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 ha(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Xh.hasOwnProperty(t)?{space:Xh[t],local:e}:e}function bb(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 Eb(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Xx(e){var t=ha(e);return(t.local?Eb:bb)(t)}function Cb(){}function Gd(e){return e==null?Cb:function(){return this.querySelector(e)}}function jb(e){typeof e!="function"&&(e=Gd(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var s=t[o],i=s.length,l=r[o]=new Array(i),a,c,h=0;h<i;++h)(a=s[h])&&(c=e.call(a,a.__data__,h,s))&&("__data__"in a&&(c.__data__=a.__data__),l[h]=c);return new ct(r,this._parents)}function _b(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Pb(){return[]}function Kx(e){return e==null?Pb:function(){return this.querySelectorAll(e)}}function Mb(e){return function(){return _b(e.apply(this,arguments))}}function Ib(e){typeof e=="function"?e=Mb(e):e=Kx(e);for(var t=this._groups,n=t.length,r=[],o=[],s=0;s<n;++s)for(var i=t[s],l=i.length,a,c=0;c<l;++c)(a=i[c])&&(r.push(e.call(a,a.__data__,c,i)),o.push(a));return new ct(r,o)}function Qx(e){return function(){return this.matches(e)}}function qx(e){return function(t){return t.matches(e)}}var Tb=Array.prototype.find;function Rb(e){return function(){return Tb.call(this.children,e)}}function Lb(){return this.firstElementChild}function Ab(e){return this.select(e==null?Lb:Rb(typeof e=="function"?e:qx(e)))}var zb=Array.prototype.filter;function Db(){return Array.from(this.children)}function $b(e){return function(){return zb.call(this.children,e)}}function Ob(e){return this.selectAll(e==null?Db:$b(typeof e=="function"?e:qx(e)))}function Fb(e){typeof e!="function"&&(e=Qx(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var s=t[o],i=s.length,l=r[o]=[],a,c=0;c<i;++c)(a=s[c])&&e.call(a,a.__data__,c,s)&&l.push(a);return new ct(r,this._parents)}function Zx(e){return new Array(e.length)}function Hb(){return new ct(this._enter||this._groups.map(Zx),this._parents)}function Ml(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ml.prototype={constructor:Ml,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 Bb(e){return function(){return e}}function Vb(e,t,n,r,o,s){for(var i=0,l,a=t.length,c=s.length;i<c;++i)(l=t[i])?(l.__data__=s[i],r[i]=l):n[i]=new Ml(e,s[i]);for(;i<a;++i)(l=t[i])&&(o[i]=l)}function Ub(e,t,n,r,o,s,i){var l,a,c=new Map,h=t.length,f=s.length,d=new Array(h),x;for(l=0;l<h;++l)(a=t[l])&&(d[l]=x=i.call(a,a.__data__,l,t)+"",c.has(x)?o[l]=a:c.set(x,a));for(l=0;l<f;++l)x=i.call(e,s[l],l,s)+"",(a=c.get(x))?(r[l]=a,a.__data__=s[l],c.delete(x)):n[l]=new Ml(e,s[l]);for(l=0;l<h;++l)(a=t[l])&&c.get(d[l])===a&&(o[l]=a)}function Wb(e){return e.__data__}function Yb(e,t){if(!arguments.length)return Array.from(this,Wb);var n=t?Ub:Vb,r=this._parents,o=this._groups;typeof e!="function"&&(e=Bb(e));for(var s=o.length,i=new Array(s),l=new Array(s),a=new Array(s),c=0;c<s;++c){var h=r[c],f=o[c],d=f.length,x=Gb(e.call(h,h&&h.__data__,c,r)),y=x.length,w=l[c]=new Array(y),S=i[c]=new Array(y),p=a[c]=new Array(d);n(h,f,w,S,p,x,t);for(var v=0,g=0,N,k;v<y;++v)if(N=w[v]){for(v>=g&&(g=v+1);!(k=S[g])&&++g<y;);N._next=k||null}}return i=new ct(i,r),i._enter=l,i._exit=a,i}function Gb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Xb(){return new ct(this._exit||this._groups.map(Zx),this._parents)}function Kb(e,t,n){var r=this.enter(),o=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?s.remove():n(s),r&&o?r.merge(o).order():o}function Qb(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,s=r.length,i=Math.min(o,s),l=new Array(o),a=0;a<i;++a)for(var c=n[a],h=r[a],f=c.length,d=l[a]=new Array(f),x,y=0;y<f;++y)(x=c[y]||h[y])&&(d[y]=x);for(;a<o;++a)l[a]=n[a];return new ct(l,this._parents)}function qb(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,s=r[o],i;--o>=0;)(i=r[o])&&(s&&i.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(i,s),s=i);return this}function Zb(e){e||(e=Jb);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,r=n.length,o=new Array(r),s=0;s<r;++s){for(var i=n[s],l=i.length,a=o[s]=new Array(l),c,h=0;h<l;++h)(c=i[h])&&(a[h]=c);a.sort(t)}return new ct(o,this._parents).order()}function Jb(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function eE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function tE(){return Array.from(this)}function nE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,s=r.length;o<s;++o){var i=r[o];if(i)return i}return null}function rE(){let e=0;for(const t of this)++e;return e}function oE(){return!this.node()}function sE(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],s=0,i=o.length,l;s<i;++s)(l=o[s])&&e.call(l,l.__data__,s,o);return this}function iE(e){return function(){this.removeAttribute(e)}}function lE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function aE(e,t){return function(){this.setAttribute(e,t)}}function uE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function cE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function dE(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 fE(e,t){var n=ha(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?lE:iE:typeof t=="function"?n.local?dE:cE:n.local?uE:aE)(n,t))}function Jx(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function hE(e){return function(){this.style.removeProperty(e)}}function pE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function mE(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function gE(e,t,n){return arguments.length>1?this.each((t==null?hE:typeof t=="function"?mE:pE)(e,t,n??"")):uo(this.node(),e)}function uo(e,t){return e.style.getPropertyValue(t)||Jx(e).getComputedStyle(e,null).getPropertyValue(t)}function xE(e){return function(){delete this[e]}}function yE(e,t){return function(){this[e]=t}}function vE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function wE(e,t){return arguments.length>1?this.each((t==null?xE:typeof t=="function"?vE:yE)(e,t)):this.node()[e]}function ey(e){return e.trim().split(/^|\s+/)}function Xd(e){return e.classList||new ty(e)}function ty(e){this._node=e,this._names=ey(e.getAttribute("class")||"")}ty.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 ny(e,t){for(var n=Xd(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function ry(e,t){for(var n=Xd(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function NE(e){return function(){ny(this,e)}}function SE(e){return function(){ry(this,e)}}function kE(e,t){return function(){(t.apply(this,arguments)?ny:ry)(this,e)}}function bE(e,t){var n=ey(e+"");if(arguments.length<2){for(var r=Xd(this.node()),o=-1,s=n.length;++o<s;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?kE:t?NE:SE)(n,t))}function EE(){this.textContent=""}function CE(e){return function(){this.textContent=e}}function jE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function _E(e){return arguments.length?this.each(e==null?EE:(typeof e=="function"?jE:CE)(e)):this.node().textContent}function PE(){this.innerHTML=""}function ME(e){return function(){this.innerHTML=e}}function IE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function TE(e){return arguments.length?this.each(e==null?PE:(typeof e=="function"?IE:ME)(e)):this.node().innerHTML}function RE(){this.nextSibling&&this.parentNode.appendChild(this)}function LE(){return this.each(RE)}function AE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function zE(){return this.each(AE)}function DE(e){var t=typeof e=="function"?e:Xx(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function $E(){return null}function OE(e,t){var n=typeof e=="function"?e:Xx(e),r=t==null?$E:typeof t=="function"?t:Gd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function FE(){var e=this.parentNode;e&&e.removeChild(this)}function HE(){return this.each(FE)}function BE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function VE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function UE(e){return this.select(e?VE:BE)}function WE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function YE(e){return function(t){e.call(this,t,this.__data__)}}function GE(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 XE(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,s;n<o;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function KE(e,t,n){return function(){var r=this.__on,o,s=YE(t);if(r){for(var i=0,l=r.length;i<l;++i)if((o=r[i]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=s,o.options=n),o.value=t;return}}this.addEventListener(e.type,s,n),o={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(o):this.__on=[o]}}function QE(e,t,n){var r=GE(e+""),o,s=r.length,i;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,c=l.length,h;a<c;++a)for(o=0,h=l[a];o<s;++o)if((i=r[o]).type===h.type&&i.name===h.name)return h.value}return}for(l=t?KE:XE,o=0;o<s;++o)this.each(l(r[o],t,n));return this}function oy(e,t,n){var r=Jx(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function qE(e,t){return function(){return oy(this,e,t)}}function ZE(e,t){return function(){return oy(this,e,t.apply(this,arguments))}}function JE(e,t){return this.each((typeof t=="function"?ZE:qE)(e,t))}function*eC(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,s=r.length,i;o<s;++o)(i=r[o])&&(yield i)}var sy=[null];function ct(e,t){this._groups=e,this._parents=t}function Us(){return new ct([[document.documentElement]],sy)}function tC(){return this}ct.prototype=Us.prototype={constructor:ct,select:jb,selectAll:Ib,selectChild:Ab,selectChildren:Ob,filter:Fb,data:Yb,enter:Hb,exit:Xb,join:Kb,merge:Qb,selection:tC,order:qb,sort:Zb,call:eE,nodes:tE,node:nE,size:rE,empty:oE,each:sE,attr:fE,style:gE,property:wE,classed:bE,text:_E,html:TE,raise:LE,lower:zE,append:DE,insert:OE,remove:HE,clone:UE,datum:WE,on:QE,dispatch:JE,[Symbol.iterator]:eC};function it(e){return typeof e=="string"?new ct([[document.querySelector(e)]],[document.documentElement]):new ct([[e]],sy)}function nC(e){let t;for(;t=e.sourceEvent;)e=t;return e}function bt(e,t){if(e=nC(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 o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const rC={passive:!1},_s={capture:!0,passive:!1};function iu(e){e.stopImmediatePropagation()}function Xr(e){e.preventDefault(),e.stopImmediatePropagation()}function iy(e){var t=e.document.documentElement,n=it(e).on("dragstart.drag",Xr,_s);"onselectstart"in t?n.on("selectstart.drag",Xr,_s):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ly(e,t){var n=e.document.documentElement,r=it(e).on("dragstart.drag",null);t&&(r.on("click.drag",Xr,_s),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 Ni=e=>()=>e;function bc(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:s,x:i,y:l,dx:a,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:o,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}bc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function oC(e){return!e.ctrlKey&&!e.button}function sC(){return this.parentNode}function iC(e,t){return t??{x:e.x,y:e.y}}function lC(){return navigator.maxTouchPoints||"ontouchstart"in this}function ay(){var e=oC,t=sC,n=iC,r=lC,o={},s=fa("start","drag","end"),i=0,l,a,c,h,f=0;function d(N){N.on("mousedown.drag",x).filter(r).on("touchstart.drag",S).on("touchmove.drag",p,rC).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(N,k){if(!(h||!e.call(this,N,k))){var b=g(this,t.call(this,N,k),N,k,"mouse");b&&(it(N.view).on("mousemove.drag",y,_s).on("mouseup.drag",w,_s),iy(N.view),iu(N),c=!1,l=N.clientX,a=N.clientY,b("start",N))}}function y(N){if(Xr(N),!c){var k=N.clientX-l,b=N.clientY-a;c=k*k+b*b>f}o.mouse("drag",N)}function w(N){it(N.view).on("mousemove.drag mouseup.drag",null),ly(N.view,c),Xr(N),o.mouse("end",N)}function S(N,k){if(e.call(this,N,k)){var b=N.changedTouches,E=t.call(this,N,k),_=b.length,I,D;for(I=0;I<_;++I)(D=g(this,E,N,k,b[I].identifier,b[I]))&&(iu(N),D("start",N,b[I]))}}function p(N){var k=N.changedTouches,b=k.length,E,_;for(E=0;E<b;++E)(_=o[k[E].identifier])&&(Xr(N),_("drag",N,k[E]))}function v(N){var k=N.changedTouches,b=k.length,E,_;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),E=0;E<b;++E)(_=o[k[E].identifier])&&(iu(N),_("end",N,k[E]))}function g(N,k,b,E,_,I){var D=s.copy(),R=bt(I||b,k),T,F,j;if((j=n.call(N,new bc("beforestart",{sourceEvent:b,target:d,identifier:_,active:i,x:R[0],y:R[1],dx:0,dy:0,dispatch:D}),E))!=null)return T=j.x-R[0]||0,F=j.y-R[1]||0,function A(M,z,C){var P=R,L;switch(M){case"start":o[_]=A,L=i++;break;case"end":delete o[_],--i;case"drag":R=bt(C||z,k),L=i;break}D.call(M,N,new bc(M,{sourceEvent:z,subject:j,target:d,identifier:_,active:L,x:R[0]+T,y:R[1]+F,dx:R[0]-P[0],dy:R[1]-P[1],dispatch:D}),E)}}return d.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Ni(!!N),d):e},d.container=function(N){return arguments.length?(t=typeof N=="function"?N:Ni(N),d):t},d.subject=function(N){return arguments.length?(n=typeof N=="function"?N:Ni(N),d):n},d.touchable=function(N){return arguments.length?(r=typeof N=="function"?N:Ni(!!N),d):r},d.on=function(){var N=s.on.apply(s,arguments);return N===s?d:N},d.clickDistance=function(N){return arguments.length?(f=(N=+N)*N,d):Math.sqrt(f)},d}function Kd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function uy(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ws(){}var Ps=.7,Il=1/Ps,Kr="\\s*([+-]?\\d+)\\s*",Ms="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ut="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",aC=/^#([0-9a-f]{3,8})$/,uC=new RegExp(`^rgb\\(${Kr},${Kr},${Kr}\\)$`),cC=new RegExp(`^rgb\\(${Ut},${Ut},${Ut}\\)$`),dC=new RegExp(`^rgba\\(${Kr},${Kr},${Kr},${Ms}\\)$`),fC=new RegExp(`^rgba\\(${Ut},${Ut},${Ut},${Ms}\\)$`),hC=new RegExp(`^hsl\\(${Ms},${Ut},${Ut}\\)$`),pC=new RegExp(`^hsla\\(${Ms},${Ut},${Ut},${Ms}\\)$`),Kh={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};Kd(Ws,mr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Qh,formatHex:Qh,formatHex8:mC,formatHsl:gC,formatRgb:qh,toString:qh});function Qh(){return this.rgb().formatHex()}function mC(){return this.rgb().formatHex8()}function gC(){return cy(this).formatHsl()}function qh(){return this.rgb().formatRgb()}function mr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=aC.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Zh(t):n===3?new tt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Si(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Si(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=uC.exec(e))?new tt(t[1],t[2],t[3],1):(t=cC.exec(e))?new tt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=dC.exec(e))?Si(t[1],t[2],t[3],t[4]):(t=fC.exec(e))?Si(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=hC.exec(e))?tp(t[1],t[2]/100,t[3]/100,1):(t=pC.exec(e))?tp(t[1],t[2]/100,t[3]/100,t[4]):Kh.hasOwnProperty(e)?Zh(Kh[e]):e==="transparent"?new tt(NaN,NaN,NaN,0):null}function Zh(e){return new tt(e>>16&255,e>>8&255,e&255,1)}function Si(e,t,n,r){return r<=0&&(e=t=n=NaN),new tt(e,t,n,r)}function xC(e){return e instanceof Ws||(e=mr(e)),e?(e=e.rgb(),new tt(e.r,e.g,e.b,e.opacity)):new tt}function Ec(e,t,n,r){return arguments.length===1?xC(e):new tt(e,t,n,r??1)}function tt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Kd(tt,Ec,uy(Ws,{brighter(e){return e=e==null?Il:Math.pow(Il,e),new tt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ps:Math.pow(Ps,e),new tt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new tt(lr(this.r),lr(this.g),lr(this.b),Tl(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:Jh,formatHex:Jh,formatHex8:yC,formatRgb:ep,toString:ep}));function Jh(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}`}function yC(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}${rr((isNaN(this.opacity)?1:this.opacity)*255)}`}function ep(){const e=Tl(this.opacity);return`${e===1?"rgb(":"rgba("}${lr(this.r)}, ${lr(this.g)}, ${lr(this.b)}${e===1?")":`, ${e})`}`}function Tl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function lr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rr(e){return e=lr(e),(e<16?"0":"")+e.toString(16)}function tp(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ct(e,t,n,r)}function cy(e){if(e instanceof Ct)return new Ct(e.h,e.s,e.l,e.opacity);if(e instanceof Ws||(e=mr(e)),!e)return new Ct;if(e instanceof Ct)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),s=Math.max(t,n,r),i=NaN,l=s-o,a=(s+o)/2;return l?(t===s?i=(n-r)/l+(n<r)*6:n===s?i=(r-t)/l+2:i=(t-n)/l+4,l/=a<.5?s+o:2-s-o,i*=60):l=a>0&&a<1?0:i,new Ct(i,l,a,e.opacity)}function vC(e,t,n,r){return arguments.length===1?cy(e):new Ct(e,t,n,r??1)}function Ct(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Kd(Ct,vC,uy(Ws,{brighter(e){return e=e==null?Il:Math.pow(Il,e),new Ct(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ps:Math.pow(Ps,e),new Ct(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,o=2*n-r;return new tt(lu(e>=240?e-240:e+120,o,r),lu(e,o,r),lu(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Ct(np(this.h),ki(this.s),ki(this.l),Tl(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=Tl(this.opacity);return`${e===1?"hsl(":"hsla("}${np(this.h)}, ${ki(this.s)*100}%, ${ki(this.l)*100}%${e===1?")":`, ${e})`}`}}));function np(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 Qd=e=>()=>e;function wC(e,t){return function(n){return e+n*t}}function NC(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 SC(e){return(e=+e)==1?dy:function(t,n){return n-t?NC(t,n,e):Qd(isNaN(t)?n:t)}}function dy(e,t){var n=t-e;return n?wC(e,n):Qd(isNaN(e)?t:e)}const Rl=function e(t){var n=SC(t);function r(o,s){var i=n((o=Ec(o)).r,(s=Ec(s)).r),l=n(o.g,s.g),a=n(o.b,s.b),c=dy(o.opacity,s.opacity);return function(h){return o.r=i(h),o.g=l(h),o.b=a(h),o.opacity=c(h),o+""}}return r.gamma=e,r}(1);function kC(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(s){for(o=0;o<n;++o)r[o]=e[o]*(1-s)+t[o]*s;return r}}function bC(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function EC(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),s=new Array(n),i;for(i=0;i<r;++i)o[i]=ls(e[i],t[i]);for(;i<n;++i)s[i]=t[i];return function(l){for(i=0;i<r;++i)s[i]=o[i](l);return s}}function CC(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ot(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function jC(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=ls(e[o],t[o]):r[o]=t[o];return function(s){for(o in n)r[o]=n[o](s);return r}}var Cc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,au=new RegExp(Cc.source,"g");function _C(e){return function(){return e}}function PC(e){return function(t){return e(t)+""}}function fy(e,t){var n=Cc.lastIndex=au.lastIndex=0,r,o,s,i=-1,l=[],a=[];for(e=e+"",t=t+"";(r=Cc.exec(e))&&(o=au.exec(t));)(s=o.index)>n&&(s=t.slice(n,s),l[i]?l[i]+=s:l[++i]=s),(r=r[0])===(o=o[0])?l[i]?l[i]+=o:l[++i]=o:(l[++i]=null,a.push({i,x:Ot(r,o)})),n=au.lastIndex;return n<t.length&&(s=t.slice(n),l[i]?l[i]+=s:l[++i]=s),l.length<2?a[0]?PC(a[0].x):_C(t):(t=a.length,function(c){for(var h=0,f;h<t;++h)l[(f=a[h]).i]=f.x(c);return l.join("")})}function ls(e,t){var n=typeof t,r;return t==null||n==="boolean"?Qd(t):(n==="number"?Ot:n==="string"?(r=mr(t))?(t=r,Rl):fy:t instanceof mr?Rl:t instanceof Date?CC:bC(t)?kC:Array.isArray(t)?EC:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?jC:Ot)(e,t)}var rp=180/Math.PI,jc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function hy(e,t,n,r,o,s){var i,l,a;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,a/=l),e*r<t*n&&(e=-e,t=-t,a=-a,i=-i),{translateX:o,translateY:s,rotate:Math.atan2(t,e)*rp,skewX:Math.atan(a)*rp,scaleX:i,scaleY:l}}var bi;function MC(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?jc:hy(t.a,t.b,t.c,t.d,t.e,t.f)}function IC(e){return e==null||(bi||(bi=document.createElementNS("http://www.w3.org/2000/svg","g")),bi.setAttribute("transform",e),!(e=bi.transform.baseVal.consolidate()))?jc:(e=e.matrix,hy(e.a,e.b,e.c,e.d,e.e,e.f))}function py(e,t,n,r){function o(c){return c.length?c.pop()+" ":""}function s(c,h,f,d,x,y){if(c!==f||h!==d){var w=x.push("translate(",null,t,null,n);y.push({i:w-4,x:Ot(c,f)},{i:w-2,x:Ot(h,d)})}else(f||d)&&x.push("translate("+f+t+d+n)}function i(c,h,f,d){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),d.push({i:f.push(o(f)+"rotate(",null,r)-2,x:Ot(c,h)})):h&&f.push(o(f)+"rotate("+h+r)}function l(c,h,f,d){c!==h?d.push({i:f.push(o(f)+"skewX(",null,r)-2,x:Ot(c,h)}):h&&f.push(o(f)+"skewX("+h+r)}function a(c,h,f,d,x,y){if(c!==f||h!==d){var w=x.push(o(x)+"scale(",null,",",null,")");y.push({i:w-4,x:Ot(c,f)},{i:w-2,x:Ot(h,d)})}else(f!==1||d!==1)&&x.push(o(x)+"scale("+f+","+d+")")}return function(c,h){var f=[],d=[];return c=e(c),h=e(h),s(c.translateX,c.translateY,h.translateX,h.translateY,f,d),i(c.rotate,h.rotate,f,d),l(c.skewX,h.skewX,f,d),a(c.scaleX,c.scaleY,h.scaleX,h.scaleY,f,d),c=h=null,function(x){for(var y=-1,w=d.length,S;++y<w;)f[(S=d[y]).i]=S.x(x);return f.join("")}}}var TC=py(MC,"px, ","px)","deg)"),RC=py(IC,", ",")",")"),LC=1e-12;function op(e){return((e=Math.exp(e))+1/e)/2}function AC(e){return((e=Math.exp(e))-1/e)/2}function zC(e){return((e=Math.exp(2*e))-1)/(e+1)}const Zi=function e(t,n,r){function o(s,i){var l=s[0],a=s[1],c=s[2],h=i[0],f=i[1],d=i[2],x=h-l,y=f-a,w=x*x+y*y,S,p;if(w<LC)p=Math.log(d/c)/t,S=function(E){return[l+E*x,a+E*y,c*Math.exp(t*E*p)]};else{var v=Math.sqrt(w),g=(d*d-c*c+r*w)/(2*c*n*v),N=(d*d-c*c-r*w)/(2*d*n*v),k=Math.log(Math.sqrt(g*g+1)-g),b=Math.log(Math.sqrt(N*N+1)-N);p=(b-k)/t,S=function(E){var _=E*p,I=op(k),D=c/(n*v)*(I*zC(t*_+k)-AC(k));return[l+D*x,a+D*y,c*I/op(t*_+k)]}}return S.duration=p*1e3*t/Math.SQRT2,S}return o.rho=function(s){var i=Math.max(.001,+s),l=i*i,a=l*l;return e(i,l,a)},o}(Math.SQRT2,2,4);var co=0,Qo=0,Uo=0,my=1e3,Ll,qo,Al=0,gr=0,pa=0,Is=typeof performance=="object"&&performance.now?performance:Date,gy=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function qd(){return gr||(gy(DC),gr=Is.now()+pa)}function DC(){gr=0}function zl(){this._call=this._time=this._next=null}zl.prototype=xy.prototype={constructor:zl,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?qd():+n)+(t==null?0:+t),!this._next&&qo!==this&&(qo?qo._next=this:Ll=this,qo=this),this._call=e,this._time=n,_c()},stop:function(){this._call&&(this._call=null,this._time=1/0,_c())}};function xy(e,t,n){var r=new zl;return r.restart(e,t,n),r}function $C(){qd(),++co;for(var e=Ll,t;e;)(t=gr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--co}function sp(){gr=(Al=Is.now())+pa,co=Qo=0;try{$C()}finally{co=0,FC(),gr=0}}function OC(){var e=Is.now(),t=e-Al;t>my&&(pa-=t,Al=e)}function FC(){for(var e,t=Ll,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:Ll=n);qo=e,_c(r)}function _c(e){if(!co){Qo&&(Qo=clearTimeout(Qo));var t=e-gr;t>24?(e<1/0&&(Qo=setTimeout(sp,e-Is.now()-pa)),Uo&&(Uo=clearInterval(Uo))):(Uo||(Al=Is.now(),Uo=setInterval(OC,my)),co=1,gy(sp))}}function ip(e,t,n){var r=new zl;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var HC=fa("start","end","cancel","interrupt"),BC=[],yy=0,lp=1,Pc=2,Ji=3,ap=4,Mc=5,el=6;function ma(e,t,n,r,o,s){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;VC(e,n,{name:t,index:r,group:o,on:HC,tween:BC,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:yy})}function Zd(e,t){var n=Lt(e,t);if(n.state>yy)throw new Error("too late; already scheduled");return n}function qt(e,t){var n=Lt(e,t);if(n.state>Ji)throw new Error("too late; already running");return n}function Lt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function VC(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=xy(s,0,n.time);function s(c){n.state=lp,n.timer.restart(i,n.delay,n.time),n.delay<=c&&i(c-n.delay)}function i(c){var h,f,d,x;if(n.state!==lp)return a();for(h in r)if(x=r[h],x.name===n.name){if(x.state===Ji)return ip(i);x.state===ap?(x.state=el,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete r[h]):+h<t&&(x.state=el,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete r[h])}if(ip(function(){n.state===Ji&&(n.state=ap,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=Pc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Pc){for(n.state=Ji,o=new Array(d=n.tween.length),h=0,f=-1;h<d;++h)(x=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(o[++f]=x);o.length=f+1}}function l(c){for(var h=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(a),n.state=Mc,1),f=-1,d=o.length;++f<d;)o[f].call(e,h);n.state===Mc&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=el,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function tl(e,t){var n=e.__transition,r,o,s=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((r=n[i]).name!==t){s=!1;continue}o=r.state>Pc&&r.state<Mc,r.state=el,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}s&&delete e.__transition}}function UC(e){return this.each(function(){tl(this,e)})}function WC(e,t){var n,r;return function(){var o=qt(this,e),s=o.tween;if(s!==n){r=n=s;for(var i=0,l=r.length;i<l;++i)if(r[i].name===t){r=r.slice(),r.splice(i,1);break}}o.tween=r}}function YC(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var s=qt(this,e),i=s.tween;if(i!==r){o=(r=i).slice();for(var l={name:t,value:n},a=0,c=o.length;a<c;++a)if(o[a].name===t){o[a]=l;break}a===c&&o.push(l)}s.tween=o}}function GC(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Lt(this.node(),n).tween,o=0,s=r.length,i;o<s;++o)if((i=r[o]).name===e)return i.value;return null}return this.each((t==null?WC:YC)(n,e,t))}function Jd(e,t,n){var r=e._id;return e.each(function(){var o=qt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Lt(o,r).value[t]}}function vy(e,t){var n;return(typeof t=="number"?Ot:t instanceof mr?Rl:(n=mr(t))?(t=n,Rl):fy)(e,t)}function XC(e){return function(){this.removeAttribute(e)}}function KC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function QC(e,t,n){var r,o=n+"",s;return function(){var i=this.getAttribute(e);return i===o?null:i===r?s:s=t(r=i,n)}}function qC(e,t,n){var r,o=n+"",s;return function(){var i=this.getAttributeNS(e.space,e.local);return i===o?null:i===r?s:s=t(r=i,n)}}function ZC(e,t,n){var r,o,s;return function(){var i,l=n(this),a;return l==null?void this.removeAttribute(e):(i=this.getAttribute(e),a=l+"",i===a?null:i===r&&a===o?s:(o=a,s=t(r=i,l)))}}function JC(e,t,n){var r,o,s;return function(){var i,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),a=l+"",i===a?null:i===r&&a===o?s:(o=a,s=t(r=i,l)))}}function ej(e,t){var n=ha(e),r=n==="transform"?RC:vy;return this.attrTween(e,typeof t=="function"?(n.local?JC:ZC)(n,r,Jd(this,"attr."+e,t)):t==null?(n.local?KC:XC)(n):(n.local?qC:QC)(n,r,t))}function tj(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function nj(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function rj(e,t){var n,r;function o(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&nj(e,s)),n}return o._value=t,o}function oj(e,t){var n,r;function o(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&tj(e,s)),n}return o._value=t,o}function sj(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=ha(e);return this.tween(n,(r.local?rj:oj)(r,t))}function ij(e,t){return function(){Zd(this,e).delay=+t.apply(this,arguments)}}function lj(e,t){return t=+t,function(){Zd(this,e).delay=t}}function aj(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ij:lj)(t,e)):Lt(this.node(),t).delay}function uj(e,t){return function(){qt(this,e).duration=+t.apply(this,arguments)}}function cj(e,t){return t=+t,function(){qt(this,e).duration=t}}function dj(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?uj:cj)(t,e)):Lt(this.node(),t).duration}function fj(e,t){if(typeof t!="function")throw new Error;return function(){qt(this,e).ease=t}}function hj(e){var t=this._id;return arguments.length?this.each(fj(t,e)):Lt(this.node(),t).ease}function pj(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;qt(this,e).ease=n}}function mj(e){if(typeof e!="function")throw new Error;return this.each(pj(this._id,e))}function gj(e){typeof e!="function"&&(e=Qx(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var s=t[o],i=s.length,l=r[o]=[],a,c=0;c<i;++c)(a=s[c])&&e.call(a,a.__data__,c,s)&&l.push(a);return new pn(r,this._parents,this._name,this._id)}function xj(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,s=Math.min(r,o),i=new Array(r),l=0;l<s;++l)for(var a=t[l],c=n[l],h=a.length,f=i[l]=new Array(h),d,x=0;x<h;++x)(d=a[x]||c[x])&&(f[x]=d);for(;l<r;++l)i[l]=t[l];return new pn(i,this._parents,this._name,this._id)}function yj(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 vj(e,t,n){var r,o,s=yj(t)?Zd:qt;return function(){var i=s(this,e),l=i.on;l!==r&&(o=(r=l).copy()).on(t,n),i.on=o}}function wj(e,t){var n=this._id;return arguments.length<2?Lt(this.node(),n).on.on(e):this.each(vj(n,e,t))}function Nj(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Sj(){return this.on("end.remove",Nj(this._id))}function kj(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Gd(e));for(var r=this._groups,o=r.length,s=new Array(o),i=0;i<o;++i)for(var l=r[i],a=l.length,c=s[i]=new Array(a),h,f,d=0;d<a;++d)(h=l[d])&&(f=e.call(h,h.__data__,d,l))&&("__data__"in h&&(f.__data__=h.__data__),c[d]=f,ma(c[d],t,n,d,c,Lt(h,n)));return new pn(s,this._parents,t,n)}function bj(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Kx(e));for(var r=this._groups,o=r.length,s=[],i=[],l=0;l<o;++l)for(var a=r[l],c=a.length,h,f=0;f<c;++f)if(h=a[f]){for(var d=e.call(h,h.__data__,f,a),x,y=Lt(h,n),w=0,S=d.length;w<S;++w)(x=d[w])&&ma(x,t,n,w,d,y);s.push(d),i.push(h)}return new pn(s,i,t,n)}var Ej=Us.prototype.constructor;function Cj(){return new Ej(this._groups,this._parents)}function jj(e,t){var n,r,o;return function(){var s=uo(this,e),i=(this.style.removeProperty(e),uo(this,e));return s===i?null:s===n&&i===r?o:o=t(n=s,r=i)}}function wy(e){return function(){this.style.removeProperty(e)}}function _j(e,t,n){var r,o=n+"",s;return function(){var i=uo(this,e);return i===o?null:i===r?s:s=t(r=i,n)}}function Pj(e,t,n){var r,o,s;return function(){var i=uo(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),uo(this,e))),i===a?null:i===r&&a===o?s:(o=a,s=t(r=i,l))}}function Mj(e,t){var n,r,o,s="style."+t,i="end."+s,l;return function(){var a=qt(this,e),c=a.on,h=a.value[s]==null?l||(l=wy(t)):void 0;(c!==n||o!==h)&&(r=(n=c).copy()).on(i,o=h),a.on=r}}function Ij(e,t,n){var r=(e+="")=="transform"?TC:vy;return t==null?this.styleTween(e,jj(e,r)).on("end.style."+e,wy(e)):typeof t=="function"?this.styleTween(e,Pj(e,r,Jd(this,"style."+e,t))).each(Mj(this._id,e)):this.styleTween(e,_j(e,r,t),n).on("end.style."+e,null)}function Tj(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Rj(e,t,n){var r,o;function s(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&Tj(e,i,n)),r}return s._value=t,s}function Lj(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,Rj(e,t,n??""))}function Aj(e){return function(){this.textContent=e}}function zj(e){return function(){var t=e(this);this.textContent=t??""}}function Dj(e){return this.tween("text",typeof e=="function"?zj(Jd(this,"text",e)):Aj(e==null?"":e+""))}function $j(e){return function(t){this.textContent=e.call(this,t)}}function Oj(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&$j(o)),t}return r._value=e,r}function Fj(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,Oj(e))}function Hj(){for(var e=this._name,t=this._id,n=Ny(),r=this._groups,o=r.length,s=0;s<o;++s)for(var i=r[s],l=i.length,a,c=0;c<l;++c)if(a=i[c]){var h=Lt(a,t);ma(a,e,n,c,i,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new pn(r,this._parents,e,n)}function Bj(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(s,i){var l={value:i},a={value:function(){--o===0&&s()}};n.each(function(){var c=qt(this,r),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),c.on=t}),o===0&&s()})}var Vj=0;function pn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Ny(){return++Vj}var en=Us.prototype;pn.prototype={constructor:pn,select:kj,selectAll:bj,selectChild:en.selectChild,selectChildren:en.selectChildren,filter:gj,merge:xj,selection:Cj,transition:Hj,call:en.call,nodes:en.nodes,node:en.node,size:en.size,empty:en.empty,each:en.each,on:wj,attr:ej,attrTween:sj,style:Ij,styleTween:Lj,text:Dj,textTween:Fj,remove:Sj,tween:GC,delay:aj,duration:dj,ease:hj,easeVarying:mj,end:Bj,[Symbol.iterator]:en[Symbol.iterator]};function Uj(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Wj={time:null,delay:0,duration:250,ease:Uj};function Yj(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 Gj(e){var t,n;e instanceof pn?(t=e._id,e=e._name):(t=Ny(),(n=Wj).time=qd(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,s=0;s<o;++s)for(var i=r[s],l=i.length,a,c=0;c<l;++c)(a=i[c])&&ma(a,e,t,c,i,n||Yj(a,t));return new pn(r,this._parents,e,t)}Us.prototype.interrupt=UC;Us.prototype.transition=Gj;const Ei=e=>()=>e;function Xj(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){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:o}})}function sn(e,t,n){this.k=e,this.x=t,this.y=n}sn.prototype={constructor:sn,scale:function(e){return e===1?this:new sn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new sn(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 ga=new sn(1,0,0);Sy.prototype=sn.prototype;function Sy(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ga;return e.__zoom}function uu(e){e.stopImmediatePropagation()}function Wo(e){e.preventDefault(),e.stopImmediatePropagation()}function Kj(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Qj(){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 up(){return this.__zoom||ga}function qj(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Zj(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jj(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i))}function ky(){var e=Kj,t=Qj,n=Jj,r=qj,o=Zj,s=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,a=Zi,c=fa("start","zoom","end"),h,f,d,x=500,y=150,w=0,S=10;function p(j){j.property("__zoom",up).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",D).filter(o).on("touchstart.zoom",R).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(j,A,M,z){var C=j.selection?j.selection():j;C.property("__zoom",up),j!==C?k(j,A,M,z):C.interrupt().each(function(){b(this,arguments).event(z).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},p.scaleBy=function(j,A,M,z){p.scaleTo(j,function(){var C=this.__zoom.k,P=typeof A=="function"?A.apply(this,arguments):A;return C*P},M,z)},p.scaleTo=function(j,A,M,z){p.transform(j,function(){var C=t.apply(this,arguments),P=this.__zoom,L=M==null?N(C):typeof M=="function"?M.apply(this,arguments):M,O=P.invert(L),$=typeof A=="function"?A.apply(this,arguments):A;return n(g(v(P,$),L,O),C,i)},M,z)},p.translateBy=function(j,A,M,z){p.transform(j,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),i)},null,z)},p.translateTo=function(j,A,M,z,C){p.transform(j,function(){var P=t.apply(this,arguments),L=this.__zoom,O=z==null?N(P):typeof z=="function"?z.apply(this,arguments):z;return n(ga.translate(O[0],O[1]).scale(L.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof M=="function"?-M.apply(this,arguments):-M),P,i)},z,C)};function v(j,A){return A=Math.max(s[0],Math.min(s[1],A)),A===j.k?j:new sn(A,j.x,j.y)}function g(j,A,M){var z=A[0]-M[0]*j.k,C=A[1]-M[1]*j.k;return z===j.x&&C===j.y?j:new sn(j.k,z,C)}function N(j){return[(+j[0][0]+ +j[1][0])/2,(+j[0][1]+ +j[1][1])/2]}function k(j,A,M,z){j.on("start.zoom",function(){b(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){b(this,arguments).event(z).end()}).tween("zoom",function(){var C=this,P=arguments,L=b(C,P).event(z),O=t.apply(C,P),$=M==null?N(O):typeof M=="function"?M.apply(C,P):M,U=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),V=C.__zoom,Y=typeof A=="function"?A.apply(C,P):A,G=a(V.invert($).concat(U/V.k),Y.invert($).concat(U/Y.k));return function(X){if(X===1)X=Y;else{var B=G(X),Q=U/B[2];X=new sn(Q,$[0]-B[0]*Q,$[1]-B[1]*Q)}L.zoom(null,X)}})}function b(j,A,M){return!M&&j.__zooming||new E(j,A)}function E(j,A){this.that=j,this.args=A,this.active=0,this.sourceEvent=null,this.extent=t.apply(j,A),this.taps=0}E.prototype={event:function(j){return j&&(this.sourceEvent=j),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(j,A){return this.mouse&&j!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&j!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&j!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(j){var A=it(this.that).datum();c.call(j,this.that,new Xj(j,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:c}),A)}};function _(j,...A){if(!e.apply(this,arguments))return;var M=b(this,A).event(j),z=this.__zoom,C=Math.max(s[0],Math.min(s[1],z.k*Math.pow(2,r.apply(this,arguments)))),P=bt(j);if(M.wheel)(M.mouse[0][0]!==P[0]||M.mouse[0][1]!==P[1])&&(M.mouse[1]=z.invert(M.mouse[0]=P)),clearTimeout(M.wheel);else{if(z.k===C)return;M.mouse=[P,z.invert(P)],tl(this),M.start()}Wo(j),M.wheel=setTimeout(L,y),M.zoom("mouse",n(g(v(z,C),M.mouse[0],M.mouse[1]),M.extent,i));function L(){M.wheel=null,M.end()}}function I(j,...A){if(d||!e.apply(this,arguments))return;var M=j.currentTarget,z=b(this,A,!0).event(j),C=it(j.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",U,!0),P=bt(j,M),L=j.clientX,O=j.clientY;iy(j.view),uu(j),z.mouse=[P,this.__zoom.invert(P)],tl(this),z.start();function $(V){if(Wo(V),!z.moved){var Y=V.clientX-L,G=V.clientY-O;z.moved=Y*Y+G*G>w}z.event(V).zoom("mouse",n(g(z.that.__zoom,z.mouse[0]=bt(V,M),z.mouse[1]),z.extent,i))}function U(V){C.on("mousemove.zoom mouseup.zoom",null),ly(V.view,z.moved),Wo(V),z.event(V).end()}}function D(j,...A){if(e.apply(this,arguments)){var M=this.__zoom,z=bt(j.changedTouches?j.changedTouches[0]:j,this),C=M.invert(z),P=M.k*(j.shiftKey?.5:2),L=n(g(v(M,P),z,C),t.apply(this,A),i);Wo(j),l>0?it(this).transition().duration(l).call(k,L,z,j):it(this).call(p.transform,L,z,j)}}function R(j,...A){if(e.apply(this,arguments)){var M=j.touches,z=M.length,C=b(this,A,j.changedTouches.length===z).event(j),P,L,O,$;for(uu(j),L=0;L<z;++L)O=M[L],$=bt(O,this),$=[$,this.__zoom.invert($),O.identifier],C.touch0?!C.touch1&&C.touch0[2]!==$[2]&&(C.touch1=$,C.taps=0):(C.touch0=$,P=!0,C.taps=1+!!h);h&&(h=clearTimeout(h)),P&&(C.taps<2&&(f=$[0],h=setTimeout(function(){h=null},x)),tl(this),C.start())}}function T(j,...A){if(this.__zooming){var M=b(this,A).event(j),z=j.changedTouches,C=z.length,P,L,O,$;for(Wo(j),P=0;P<C;++P)L=z[P],O=bt(L,this),M.touch0&&M.touch0[2]===L.identifier?M.touch0[0]=O:M.touch1&&M.touch1[2]===L.identifier&&(M.touch1[0]=O);if(L=M.that.__zoom,M.touch1){var U=M.touch0[0],V=M.touch0[1],Y=M.touch1[0],G=M.touch1[1],X=(X=Y[0]-U[0])*X+(X=Y[1]-U[1])*X,B=(B=G[0]-V[0])*B+(B=G[1]-V[1])*B;L=v(L,Math.sqrt(X/B)),O=[(U[0]+Y[0])/2,(U[1]+Y[1])/2],$=[(V[0]+G[0])/2,(V[1]+G[1])/2]}else if(M.touch0)O=M.touch0[0],$=M.touch0[1];else return;M.zoom("touch",n(g(L,O,$),M.extent,i))}}function F(j,...A){if(this.__zooming){var M=b(this,A).event(j),z=j.changedTouches,C=z.length,P,L;for(uu(j),d&&clearTimeout(d),d=setTimeout(function(){d=null},x),P=0;P<C;++P)L=z[P],M.touch0&&M.touch0[2]===L.identifier?delete M.touch0:M.touch1&&M.touch1[2]===L.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&&(L=bt(L,this),Math.hypot(f[0]-L[0],f[1]-L[1])<S)){var O=it(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return p.wheelDelta=function(j){return arguments.length?(r=typeof j=="function"?j:Ei(+j),p):r},p.filter=function(j){return arguments.length?(e=typeof j=="function"?j:Ei(!!j),p):e},p.touchable=function(j){return arguments.length?(o=typeof j=="function"?j:Ei(!!j),p):o},p.extent=function(j){return arguments.length?(t=typeof j=="function"?j:Ei([[+j[0][0],+j[0][1]],[+j[1][0],+j[1][1]]]),p):t},p.scaleExtent=function(j){return arguments.length?(s[0]=+j[0],s[1]=+j[1],p):[s[0],s[1]]},p.translateExtent=function(j){return arguments.length?(i[0][0]=+j[0][0],i[1][0]=+j[1][0],i[0][1]=+j[0][1],i[1][1]=+j[1][1],p):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},p.constrain=function(j){return arguments.length?(n=j,p):n},p.duration=function(j){return arguments.length?(l=+j,p):l},p.interpolate=function(j){return arguments.length?(a=j,p):a},p.on=function(){var j=c.on.apply(c,arguments);return j===c?p:j},p.clickDistance=function(j){return arguments.length?(w=(j=+j)*j,p):Math.sqrt(w)},p.tapDistance=function(j){return arguments.length?(S=+j,p):S},p}const Kt={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."},Ts=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],by=["Enter"," ","Escape"],Ey={"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 fo;(function(e){e.Strict="strict",e.Loose="loose"})(fo||(fo={}));var ar;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ar||(ar={}));var Rs;(function(e){e.Partial="partial",e.Full="full"})(Rs||(Rs={}));const Cy={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var _n;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(_n||(_n={}));var Dl;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Dl||(Dl={}));var K;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(K||(K={}));const cp={[K.Left]:K.Right,[K.Right]:K.Left,[K.Top]:K.Bottom,[K.Bottom]:K.Top};function jy(e){return e===null?null:e?"valid":"invalid"}const _y=e=>"id"in e&&"source"in e&&"target"in e,e_=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ef=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ys=(e,t=[0,0])=>{const{width:n,height:r}=gn(e),o=e.origin??t,s=n*o[0],i=r*o[1];return{x:e.position.x-s,y:e.position.y-i}},t_=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const s=typeof o=="string";let i=!t.nodeLookup&&!s?o:void 0;t.nodeLookup&&(i=s?t.nodeLookup.get(o):ef(o)?o:t.nodeLookup.get(o.id));const l=i?$l(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return xa(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ya(n)},Gs=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=xa(n,$l(o)),r=!0)}),r?ya(n):{x:0,y:0,width:0,height:0}},tf=(e,t,[n,r,o]=[0,0,1],s=!1,i=!1)=>{const l={...Ks(t,[n,r,o]),width:t.width/o,height:t.height/o},a=[];for(const c of e.values()){const{measured:h,selectable:f=!0,hidden:d=!1}=c;if(i&&!f||d)continue;const x=h.width??c.width??c.initialWidth??null,y=h.height??c.height??c.initialHeight??null,w=Ls(l,po(c)),S=(x??0)*(y??0),p=s&&w>0;(!c.internals.handleBounds||p||w>=S||c.dragging)&&a.push(c)}return a},n_=(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 r_(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function o_({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:s},i){if(e.size===0)return Promise.resolve(!0);const l=r_(e,i),a=Gs(l),c=nf(a,t,n,(i==null?void 0:i.minZoom)??o,(i==null?void 0:i.maxZoom)??s,(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 Py({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:s}){const i=n.get(e),l=i.parentId?n.get(i.parentId):void 0,{x:a,y:c}=l?l.internals.positionAbsolute:{x:0,y:0},h=i.origin??r;let f=i.extent||o;if(i.extent==="parent"&&!i.expandParent)if(!l)s==null||s("005",Kt.error005());else{const x=l.measured.width,y=l.measured.height;x&&y&&(f=[[a,c],[a+x,c+y]])}else l&&mo(i.extent)&&(f=[[i.extent[0][0]+a,i.extent[0][1]+c],[i.extent[1][0]+a,i.extent[1][1]+c]]);const d=mo(f)?xr(t,f,i.measured):t;return(i.measured.width===void 0||i.measured.height===void 0)&&(s==null||s("015",Kt.error015())),{position:{x:d.x-a+(i.measured.width??0)*h[0],y:d.y-c+(i.measured.height??0)*h[1]},positionAbsolute:d}}async function s_({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const s=new Set(e.map(d=>d.id)),i=[];for(const d of n){if(d.deletable===!1)continue;const x=s.has(d.id),y=!x&&d.parentId&&i.find(w=>w.id===d.parentId);(x||y)&&i.push(d)}const l=new Set(t.map(d=>d.id)),a=r.filter(d=>d.deletable!==!1),h=n_(i,a);for(const d of a)l.has(d.id)&&!h.find(y=>y.id===d.id)&&h.push(d);if(!o)return{edges:h,nodes:i};const f=await o({nodes:i,edges:h});return typeof f=="boolean"?f?{edges:h,nodes:i}:{edges:[],nodes:[]}:f}const ho=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),xr=(e={x:0,y:0},t,n)=>({x:ho(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ho(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function My(e,t,n){const{width:r,height:o}=gn(n),{x:s,y:i}=n.internals.positionAbsolute;return xr(e,[[s,i],[s+r,i+o]],t)}const dp=(e,t,n)=>e<t?ho(Math.abs(e-t),1,t)/t:e>n?-ho(Math.abs(e-n),1,t)/t:0,Iy=(e,t,n=15,r=40)=>{const o=dp(e.x,r,t.width-r)*n,s=dp(e.y,r,t.height-r)*n;return[o,s]},xa=(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)}),Ic=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),ya=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),po=(e,t=[0,0])=>{var o,s;const{x:n,y:r}=ef(e)?e.internals.positionAbsolute:Ys(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},$l=(e,t=[0,0])=>{var o,s;const{x:n,y:r}=ef(e)?e.internals.positionAbsolute:Ys(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},Ty=(e,t)=>ya(xa(Ic(e),Ic(t))),Ls=(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)},fp=e=>jt(e.width)&&jt(e.height)&&jt(e.x)&&jt(e.y),jt=e=>!isNaN(e)&&isFinite(e),i_=(e,t)=>{},Xs=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Ks=({x:e,y:t},[n,r,o],s=!1,i=[1,1])=>{const l={x:(e-n)/o,y:(t-r)/o};return s?Xs(l,i):l},Ol=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function br(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 l_(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=br(e,n),o=br(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=br(e.top??e.y??0,n),o=br(e.bottom??e.y??0,n),s=br(e.left??e.x??0,t),i=br(e.right??e.x??0,t);return{top:r,right:i,bottom:o,left:s,x:s+i,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function a_(e,t,n,r,o,s){const{x:i,y:l}=Ol(e,[t,n,r]),{x:a,y:c}=Ol({x:e.x+e.width,y:e.y+e.height},[t,n,r]),h=o-a,f=s-c;return{left:Math.floor(i),top:Math.floor(l),right:Math.floor(h),bottom:Math.floor(f)}}const nf=(e,t,n,r,o,s)=>{const i=l_(s,t,n),l=(t-i.x)/e.width,a=(n-i.y)/e.height,c=Math.min(l,a),h=ho(c,r,o),f=e.x+e.width/2,d=e.y+e.height/2,x=t/2-f*h,y=n/2-d*h,w=a_(e,x,y,h,t,n),S={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-S.left+S.right,y:y-S.top+S.bottom,zoom:h}},As=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function mo(e){return e!=null&&e!=="parent"}function gn(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 Ry(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 Ly(e,t={width:0,height:0},n,r,o){const s={...e},i=r.get(n);if(i){const l=i.origin||o;s.x+=i.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=i.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function hp(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function u_(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function c_(e){return{...Ey,...e||{}}}function as(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:s,y:i}=_t(e),l=Ks({x:s-((o==null?void 0:o.left)??0),y:i-((o==null?void 0:o.top)??0)},r),{x:a,y:c}=n?Xs(l,t):l;return{xSnapped:a,ySnapped:c,...l}}const rf=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ay=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},d_=["INPUT","SELECT","TEXTAREA"];function zy(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:d_.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Dy=e=>"clientX"in e,_t=(e,t)=>{var s,i;const n=Dy(e),r=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,o=n?e.clientY:(i=e.touches)==null?void 0:i[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},pp=(e,t,n,r,o)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(i=>{const l=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:e,nodeId:o,position:i.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...rf(i)}})};function $y({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:s,targetControlX:i,targetControlY:l}){const a=e*.125+o*.375+i*.375+n*.125,c=t*.125+s*.375+l*.375+r*.125,h=Math.abs(a-e),f=Math.abs(c-t);return[a,c,h,f]}function Ci(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function mp({pos:e,x1:t,y1:n,x2:r,y2:o,c:s}){switch(e){case K.Left:return[t-Ci(t-r,s),n];case K.Right:return[t+Ci(r-t,s),n];case K.Top:return[t,n-Ci(n-o,s)];case K.Bottom:return[t,n+Ci(o-n,s)]}}function Oy({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:o,targetPosition:s=K.Top,curvature:i=.25}){const[l,a]=mp({pos:n,x1:e,y1:t,x2:r,y2:o,c:i}),[c,h]=mp({pos:s,x1:r,y1:o,x2:e,y2:t,c:i}),[f,d,x,y]=$y({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:a,targetControlX:c,targetControlY:h});return[`M${e},${t} C${l},${a} ${c},${h} ${r},${o}`,f,d,x,y]}function Fy({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,s=n<e?n+o:n-o,i=Math.abs(r-t)/2,l=r<t?r+i:r-i;return[s,l,o,i]}function f_({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:s="basic"}){if(s==="manual")return r;const i=o&&n?r+1e3:r,l=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return i+l}function h_({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const s=xa($l(e),$l(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const i={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return Ls(i,ya(s))>0}const p_=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,m_=(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)),g_=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||p_;let o;return _y(e)?o={...e}:o={...e,id:r(e)},m_(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function Hy({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,s,i,l]=Fy({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,s,i,l]}const gp={[K.Left]:{x:-1,y:0},[K.Right]:{x:1,y:0},[K.Top]:{x:0,y:-1},[K.Bottom]:{x:0,y:1}},x_=({source:e,sourcePosition:t=K.Bottom,target:n})=>t===K.Left||t===K.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},xp=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function y_({source:e,sourcePosition:t=K.Bottom,target:n,targetPosition:r=K.Top,center:o,offset:s,stepPosition:i}){const l=gp[t],a=gp[r],c={x:e.x+l.x*s,y:e.y+l.y*s},h={x:n.x+a.x*s,y:n.y+a.y*s},f=x_({source:c,sourcePosition:t,target:h}),d=f.x!==0?"x":"y",x=f[d];let y=[],w,S;const p={x:0,y:0},v={x:0,y:0},[,,g,N]=Fy({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[d]*a[d]===-1){d==="x"?(w=o.x??c.x+(h.x-c.x)*i,S=o.y??(c.y+h.y)/2):(w=o.x??(c.x+h.x)/2,S=o.y??c.y+(h.y-c.y)*i);const b=[{x:w,y:c.y},{x:w,y:h.y}],E=[{x:c.x,y:S},{x:h.x,y:S}];l[d]===x?y=d==="x"?b:E:y=d==="x"?E:b}else{const b=[{x:c.x,y:h.y}],E=[{x:h.x,y:c.y}];if(d==="x"?y=l.x===x?E:b:y=l.y===x?b:E,t===r){const T=Math.abs(e[d]-n[d]);if(T<=s){const F=Math.min(s-1,s-T);l[d]===x?p[d]=(c[d]>e[d]?-1:1)*F:v[d]=(h[d]>n[d]?-1:1)*F}}if(t!==r){const T=d==="x"?"y":"x",F=l[d]===a[T],j=c[T]>h[T],A=c[T]<h[T];(l[d]===1&&(!F&&j||F&&A)||l[d]!==1&&(!F&&A||F&&j))&&(y=d==="x"?b:E)}const _={x:c.x+p.x,y:c.y+p.y},I={x:h.x+v.x,y:h.y+v.y},D=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));D>=R?(w=(_.x+I.x)/2,S=y[0].y):(w=y[0].x,S=(_.y+I.y)/2)}return[[e,{x:c.x+p.x,y:c.y+p.y},...y,{x:h.x+v.x,y:h.y+v.y},n],w,S,g,N]}function v_(e,t,n,r){const o=Math.min(xp(e,t)/2,xp(t,n)/2,r),{x:s,y:i}=t;if(e.x===s&&s===n.x||e.y===i&&i===n.y)return`L${s} ${i}`;if(e.y===i){const c=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${s+o*c},${i}Q ${s},${i} ${s},${i+o*h}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${s},${i+o*a}Q ${s},${i} ${s+o*l},${i}`}function Tc({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:o,targetPosition:s=K.Top,borderRadius:i=5,centerX:l,centerY:a,offset:c=20,stepPosition:h=.5}){const[f,d,x,y,w]=y_({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:s,center:{x:l,y:a},offset:c,stepPosition:h});return[f.reduce((p,v,g)=>{let N="";return g>0&&g<f.length-1?N=v_(f[g-1],v,f[g+1],i):N=`${g===0?"M":"L"}${v.x} ${v.y}`,p+=N,p},""),d,x,y,w]}function yp(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function w_(e){var f;const{sourceNode:t,targetNode:n}=e;if(!yp(t)||!yp(n))return null;const r=t.internals.handleBounds||vp(t.handles),o=n.internals.handleBounds||vp(n.handles),s=wp((r==null?void 0:r.source)??[],e.sourceHandle),i=wp(e.connectionMode===fo.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!s||!i)return(f=e.onError)==null||f.call(e,"008",Kt.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(s==null?void 0:s.position)||K.Bottom,a=(i==null?void 0:i.position)||K.Top,c=yr(t,s,l),h=yr(n,i,a);return{sourceX:c.x,sourceY:c.y,targetX:h.x,targetY:h.y,sourcePosition:l,targetPosition:a}}function vp(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 yr(e,t,n=K.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,s=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:i,height:l}=t??gn(e);if(r)return{x:o+i/2,y:s+l/2};switch((t==null?void 0:t.position)??n){case K.Top:return{x:o+i/2,y:s};case K.Right:return{x:o+i,y:s+l/2};case K.Bottom:return{x:o+i/2,y:s+l};case K.Left:return{x:o,y:s+l/2}}}function wp(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Rc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function N_(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const s=new Set;return e.reduce((i,l)=>([l.markerStart||r,l.markerEnd||o].forEach(a=>{if(a&&typeof a=="object"){const c=Rc(a,t);s.has(c)||(i.push({id:c,color:a.color||n,...a}),s.add(c))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))}const By=1e3,S_=10,of={nodeOrigin:[0,0],nodeExtent:Ts,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},k_={...of,checkEquality:!0};function sf(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function b_(e,t,n){const r=sf(of,n);for(const o of e.values())if(o.parentId)af(o,e,t,r);else{const s=Ys(o,r.nodeOrigin),i=mo(o.extent)?o.extent:r.nodeExtent,l=xr(s,i,gn(o));o.internals.positionAbsolute=l}}function E_(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const s={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(s):o.type==="target"&&r.push(s)}return{source:n,target:r}}function lf(e){return e==="manual"}function Lc(e,t,n,r={}){var c,h;const o=sf(k_,r),s={i:0},i=new Map(t),l=o!=null&&o.elevateNodesOnSelect&&!lf(o.zIndexMode)?By:0;let a=e.length>0;t.clear(),n.clear();for(const f of e){let d=i.get(f.id);if(o.checkEquality&&f===(d==null?void 0:d.internals.userNode))t.set(f.id,d);else{const x=Ys(f,o.nodeOrigin),y=mo(f.extent)?f.extent:o.nodeExtent,w=xr(x,y,gn(f));d={...o.defaults,...f,measured:{width:(c=f.measured)==null?void 0:c.width,height:(h=f.measured)==null?void 0:h.height},internals:{positionAbsolute:w,handleBounds:E_(f,d),z:Vy(f,l,o.zIndexMode),userNode:f}},t.set(f.id,d)}(d.measured===void 0||d.measured.width===void 0||d.measured.height===void 0)&&!d.hidden&&(a=!1),f.parentId&&af(d,t,n,r,s)}return a}function C_(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 af(e,t,n,r,o){const{elevateNodesOnSelect:s,nodeOrigin:i,nodeExtent:l,zIndexMode:a}=sf(of,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}C_(e,n),o&&!h.parentId&&h.internals.rootParentIndex===void 0&&a==="auto"&&(h.internals.rootParentIndex=++o.i,h.internals.z=h.internals.z+o.i*S_),o&&h.internals.rootParentIndex!==void 0&&(o.i=h.internals.rootParentIndex);const f=s&&!lf(a)?By:0,{x:d,y:x,z:y}=j_(e,h,i,l,f,a),{positionAbsolute:w}=e.internals,S=d!==w.x||x!==w.y;(S||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x:d,y:x}:w,z:y}})}function Vy(e,t,n){const r=jt(e.zIndex)?e.zIndex:0;return lf(n)?r:r+(e.selected?t:0)}function j_(e,t,n,r,o,s){const{x:i,y:l}=t.internals.positionAbsolute,a=gn(e),c=Ys(e,n),h=mo(e.extent)?xr(c,e.extent,a):c;let f=xr({x:i+h.x,y:l+h.y},r,a);e.extent==="parent"&&(f=My(f,a,t));const d=Vy(e,o,s),x=t.internals.z??0;return{x:f.x,y:f.y,z:x>=d?x+1:d}}function uf(e,t,n,r=[0,0]){var i;const o=[],s=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const c=((i=s.get(l.parentId))==null?void 0:i.expandedRect)??po(a),h=Ty(c,l.rect);s.set(l.parentId,{expandedRect:h,parent:a})}return s.size>0&&s.forEach(({expandedRect:l,parent:a},c)=>{var g;const h=a.internals.positionAbsolute,f=gn(a),d=a.origin??r,x=l.x<h.x?Math.round(Math.abs(h.x-l.x)):0,y=l.y<h.y?Math.round(Math.abs(h.y-l.y)):0,w=Math.max(f.width,Math.round(l.width)),S=Math.max(f.height,Math.round(l.height)),p=(w-f.width)*d[0],v=(S-f.height)*d[1];(x>0||y>0||p||v)&&(o.push({id:c,type:"position",position:{x:a.position.x-x+p,y:a.position.y-y+v}}),(g=n.get(c))==null||g.forEach(N=>{e.some(k=>k.id===N.id)||o.push({id:N.id,type:"position",position:{x:N.position.x+x,y:N.position.y+y}})})),(f.width<l.width||f.height<l.height||x||y)&&o.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:w+(x?d[0]*x-p:0),height:S+(y?d[1]*y-v:0)}})}),o}function __(e,t,n,r,o,s,i){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let a=!1;if(!l)return{changes:[],updatedInternals:a};const c=[],h=window.getComputedStyle(l),{m22:f}=new window.DOMMatrixReadOnly(h.transform),d=[];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}}),a=!0;continue}const w=rf(x.nodeElement),S=y.measured.width!==w.width||y.measured.height!==w.height;if(!!(w.width&&w.height&&(S||!y.internals.handleBounds||x.force))){const v=x.nodeElement.getBoundingClientRect(),g=mo(y.extent)?y.extent:s;let{positionAbsolute:N}=y.internals;y.parentId&&y.extent==="parent"?N=My(N,w,t.get(y.parentId)):g&&(N=xr(N,g,w));const k={...y,measured:w,internals:{...y.internals,positionAbsolute:N,handleBounds:{source:pp("source",x.nodeElement,v,f,y.id),target:pp("target",x.nodeElement,v,f,y.id)}}};t.set(y.id,k),y.parentId&&af(k,t,n,{nodeOrigin:o,zIndexMode:i}),a=!0,S&&(c.push({id:y.id,type:"dimensions",dimensions:w}),y.expandParent&&y.parentId&&d.push({id:y.id,parentId:y.parentId,rect:po(k,o)}))}}if(d.length>0){const x=uf(d,t,n,o);c.push(...x)}return{changes:c,updatedInternals:a}}async function P_({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:s}){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],[o,s]],r),l=!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2]);return Promise.resolve(l)}function Np(e,t,n,r,o,s){let i=o;const l=r.get(i)||new Map;r.set(i,l.set(n,t)),i=`${o}-${e}`;const a=r.get(i)||new Map;if(r.set(i,a.set(n,t)),s){i=`${o}-${e}-${s}`;const c=r.get(i)||new Map;r.set(i,c.set(n,t))}}function Uy(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:s,sourceHandle:i=null,targetHandle:l=null}=r,a={edgeId:r.id,source:o,target:s,sourceHandle:i,targetHandle:l},c=`${o}-${i}--${s}-${l}`,h=`${s}-${l}--${o}-${i}`;Np("source",a,h,e,o,i),Np("target",a,c,e,s,l),t.set(r.id,r)}}function Wy(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Wy(n,t):!1}function Sp(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function M_(e,t,n,r){const o=new Map;for(const[s,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!Wy(i,e))&&(i.draggable||t&&typeof i.draggable>"u")){const l=e.get(s);l&&o.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return o}function cu({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var i,l,a;const o=[];for(const[c,h]of t){const f=(i=n.get(c))==null?void 0:i.internals.userNode;f&&o.push({...f,position:h.position,dragging:r})}if(!e)return[o[0],o];const s=(l=n.get(e))==null?void 0:l.internals.userNode;return[s?{...s,position:((a=t.get(e))==null?void 0:a.position)||s.position,dragging:r}:o[0],o]}function I_({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const s={x:n-o.distance.x,y:r-o.distance.y},i=Xs(s,t);return{x:i.x-s.x,y:i.y-s.y}}function T_({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let s={x:null,y:null},i=0,l=new Map,a=!1,c={x:0,y:0},h=null,f=!1,d=null,x=!1,y=!1,w=null;function S({noDragClassName:v,handleSelector:g,domNode:N,isSelectable:k,nodeId:b,nodeClickDistance:E=0}){d=it(N);function _({x:T,y:F}){const{nodeLookup:j,nodeExtent:A,snapGrid:M,snapToGrid:z,nodeOrigin:C,onNodeDrag:P,onSelectionDrag:L,onError:O,updateNodePositions:$}=t();s={x:T,y:F};let U=!1;const V=l.size>1,Y=V&&A?Ic(Gs(l)):null,G=V&&z?I_({dragItems:l,snapGrid:M,x:T,y:F}):null;for(const[X,B]of l){if(!j.has(X))continue;let Q={x:T-B.distance.x,y:F-B.distance.y};z&&(Q=G?{x:Math.round(Q.x+G.x),y:Math.round(Q.y+G.y)}:Xs(Q,M));let ne=null;if(V&&A&&!B.extent&&Y){const{positionAbsolute:q}=B.internals,ae=q.x-Y.x+A[0][0],de=q.x+B.measured.width-Y.x2+A[1][0],le=q.y-Y.y+A[0][1],Be=q.y+B.measured.height-Y.y2+A[1][1];ne=[[ae,le],[de,Be]]}const{position:J,positionAbsolute:Z}=Py({nodeId:X,nextPosition:Q,nodeLookup:j,nodeExtent:ne||A,nodeOrigin:C,onError:O});U=U||B.position.x!==J.x||B.position.y!==J.y,B.position=J,B.internals.positionAbsolute=Z}if(y=y||U,!!U&&($(l,!0),w&&(r||P||!b&&L))){const[X,B]=cu({nodeId:b,dragItems:l,nodeLookup:j});r==null||r(w,l,X,B),P==null||P(w,X,B),b||L==null||L(w,B)}}async function I(){if(!h)return;const{transform:T,panBy:F,autoPanSpeed:j,autoPanOnNodeDrag:A}=t();if(!A){a=!1,cancelAnimationFrame(i);return}const[M,z]=Iy(c,h,j);(M!==0||z!==0)&&(s.x=(s.x??0)-M/T[2],s.y=(s.y??0)-z/T[2],await F({x:M,y:z})&&_(s)),i=requestAnimationFrame(I)}function D(T){var V;const{nodeLookup:F,multiSelectionActive:j,nodesDraggable:A,transform:M,snapGrid:z,snapToGrid:C,selectNodesOnDrag:P,onNodeDragStart:L,onSelectionDragStart:O,unselectNodesAndEdges:$}=t();f=!0,(!P||!k)&&!j&&b&&((V=F.get(b))!=null&&V.selected||$()),k&&P&&b&&(e==null||e(b));const U=as(T.sourceEvent,{transform:M,snapGrid:z,snapToGrid:C,containerBounds:h});if(s=U,l=M_(F,A,U,b),l.size>0&&(n||L||!b&&O)){const[Y,G]=cu({nodeId:b,dragItems:l,nodeLookup:F});n==null||n(T.sourceEvent,l,Y,G),L==null||L(T.sourceEvent,Y,G),b||O==null||O(T.sourceEvent,G)}}const R=ay().clickDistance(E).on("start",T=>{const{domNode:F,nodeDragThreshold:j,transform:A,snapGrid:M,snapToGrid:z}=t();h=(F==null?void 0:F.getBoundingClientRect())||null,x=!1,y=!1,w=T.sourceEvent,j===0&&D(T),s=as(T.sourceEvent,{transform:A,snapGrid:M,snapToGrid:z,containerBounds:h}),c=_t(T.sourceEvent,h)}).on("drag",T=>{const{autoPanOnNodeDrag:F,transform:j,snapGrid:A,snapToGrid:M,nodeDragThreshold:z,nodeLookup:C}=t(),P=as(T.sourceEvent,{transform:j,snapGrid:A,snapToGrid:M,containerBounds:h});if(w=T.sourceEvent,(T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1||b&&!C.has(b))&&(x=!0),!x){if(!a&&F&&f&&(a=!0,I()),!f){const L=_t(T.sourceEvent,h),O=L.x-c.x,$=L.y-c.y;Math.sqrt(O*O+$*$)>z&&D(T)}(s.x!==P.xSnapped||s.y!==P.ySnapped)&&l&&f&&(c=_t(T.sourceEvent,h),_(P))}}).on("end",T=>{if(!(!f||x)&&(a=!1,f=!1,cancelAnimationFrame(i),l.size>0)){const{nodeLookup:F,updateNodePositions:j,onNodeDragStop:A,onSelectionDragStop:M}=t();if(y&&(j(l,!1),y=!1),o||A||!b&&M){const[z,C]=cu({nodeId:b,dragItems:l,nodeLookup:F,dragging:!1});o==null||o(T.sourceEvent,l,z,C),A==null||A(T.sourceEvent,z,C),b||M==null||M(T.sourceEvent,C)}}}).filter(T=>{const F=T.target;return!T.button&&(!v||!Sp(F,`.${v}`,N))&&(!g||Sp(F,g,N))});d.call(R)}function p(){d==null||d.on(".drag",null)}return{update:S,destroy:p}}function R_(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())Ls(o,po(s))>0&&r.push(s);return r}const L_=250;function A_(e,t,n,r){var l,a;let o=[],s=1/0;const i=R_(e,n,t+L_);for(const c of i){const h=[...((l=c.internals.handleBounds)==null?void 0:l.source)??[],...((a=c.internals.handleBounds)==null?void 0:a.target)??[]];for(const f of h){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:d,y:x}=yr(c,f,f.position,!0),y=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(x-e.y,2));y>t||(y<s?(o=[{...f,x:d,y:x}],s=y):y===s&&o.push({...f,x:d,y:x}))}}if(!o.length)return null;if(o.length>1){const c=r.type==="source"?"target":"source";return o.find(h=>h.type===c)??o[0]}return o[0]}function Yy(e,t,n,r,o,s=!1){var c,h,f;const i=r.get(e);if(!i)return null;const l=o==="strict"?(c=i.internals.handleBounds)==null?void 0:c[t]:[...((h=i.internals.handleBounds)==null?void 0:h.source)??[],...((f=i.internals.handleBounds)==null?void 0:f.target)??[]],a=(n?l==null?void 0:l.find(d=>d.id===n):l==null?void 0:l[0])??null;return a&&s?{...a,...yr(i,a,a.position,!0)}:a}function Gy(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function z_(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Xy=()=>!0;function D_(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:s,isTarget:i,domNode:l,nodeLookup:a,lib:c,autoPanOnConnect:h,flowId:f,panBy:d,cancelConnection:x,onConnectStart:y,onConnect:w,onConnectEnd:S,isValidConnection:p=Xy,onReconnectEnd:v,updateConnection:g,getTransform:N,getFromHandle:k,autoPanSpeed:b,dragThreshold:E=1,handleDomNode:_}){const I=Ay(e.target);let D=0,R;const{x:T,y:F}=_t(e),j=Gy(s,_),A=l==null?void 0:l.getBoundingClientRect();let M=!1;if(!A||!j)return;const z=Yy(o,j,r,a,t);if(!z)return;let C=_t(e,A),P=!1,L=null,O=!1,$=null;function U(){if(!h||!A)return;const[J,Z]=Iy(C,A,b);d({x:J,y:Z}),D=requestAnimationFrame(U)}const V={...z,nodeId:o,type:j,position:z.position},Y=a.get(o);let X={inProgress:!0,isValid:null,from:yr(Y,V,K.Left,!0),fromHandle:V,fromPosition:V.position,fromNode:Y,to:C,toHandle:null,toPosition:cp[V.position],toNode:null,pointer:C};function B(){M=!0,g(X),y==null||y(e,{nodeId:o,handleId:r,handleType:j})}E===0&&B();function Q(J){if(!M){const{x:Be,y:xn}=_t(J),Zt=Be-T,Kn=xn-F;if(!(Zt*Zt+Kn*Kn>E*E))return;B()}if(!k()||!V){ne(J);return}const Z=N();C=_t(J,A),R=A_(Ks(C,Z,!1,[1,1]),n,a,V),P||(U(),P=!0);const q=Ky(J,{handle:R,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:i?"target":"source",isValidConnection:p,doc:I,lib:c,flowId:f,nodeLookup:a});$=q.handleDomNode,L=q.connection,O=z_(!!R,q.isValid);const ae=a.get(o),de=ae?yr(ae,V,K.Left,!0):X.from,le={...X,from:de,isValid:O,to:q.toHandle&&O?Ol({x:q.toHandle.x,y:q.toHandle.y},Z):C,toHandle:q.toHandle,toPosition:O&&q.toHandle?q.toHandle.position:cp[V.position],toNode:q.toHandle?a.get(q.toHandle.nodeId):null,pointer:C};g(le),X=le}function ne(J){if(!("touches"in J&&J.touches.length>0)){if(M){(R||$)&&L&&O&&(w==null||w(L));const{inProgress:Z,...q}=X,ae={...q,toPosition:X.toHandle?X.toPosition:null};S==null||S(J,ae),s&&(v==null||v(J,ae))}x(),cancelAnimationFrame(D),P=!1,O=!1,L=null,$=null,I.removeEventListener("mousemove",Q),I.removeEventListener("mouseup",ne),I.removeEventListener("touchmove",Q),I.removeEventListener("touchend",ne)}}I.addEventListener("mousemove",Q),I.addEventListener("mouseup",ne),I.addEventListener("touchmove",Q),I.addEventListener("touchend",ne)}function Ky(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:s,doc:i,lib:l,flowId:a,isValidConnection:c=Xy,nodeLookup:h}){const f=s==="target",d=t?i.querySelector(`.${l}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x,y}=_t(e),w=i.elementFromPoint(x,y),S=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:d,p={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const v=Gy(void 0,S),g=S.getAttribute("data-nodeid"),N=S.getAttribute("data-handleid"),k=S.classList.contains("connectable"),b=S.classList.contains("connectableend");if(!g||!v)return p;const E={source:f?g:r,sourceHandle:f?N:o,target:f?r:g,targetHandle:f?o:N};p.connection=E;const I=k&&b&&(n===fo.Strict?f&&v==="source"||!f&&v==="target":g!==r||N!==o);p.isValid=I&&c(E),p.toHandle=Yy(g,v,N,h,n,!0)}return p}const Ac={onPointerDown:D_,isValid:Ky};function $_({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=it(e);function s({translateExtent:l,width:a,height:c,zoomStep:h=1,pannable:f=!0,zoomable:d=!0,inversePan:x=!1}){const y=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const N=n(),k=g.sourceEvent.ctrlKey&&As()?10:1,b=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*h,E=N[2]*Math.pow(2,b*k);t.scaleTo(E)};let w=[0,0];const S=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])},p=g=>{const N=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const k=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],b=[k[0]-w[0],k[1]-w[1]];w=k;const E=r()*Math.max(N[2],Math.log(N[2]))*(x?-1:1),_={x:N[0]-b[0]*E,y:N[1]-b[1]*E},I=[[0,0],[a,c]];t.setViewportConstrained({x:_.x,y:_.y,zoom:N[2]},I,l)},v=ky().on("start",S).on("zoom",f?p:null).on("zoom.wheel",d?y:null);o.call(v,{})}function i(){o.on("zoom",null)}return{update:s,destroy:i,pointer:bt}}const va=e=>({x:e.x,y:e.y,zoom:e.k}),du=({x:e,y:t,zoom:n})=>ga.translate(e,t).scale(n),Fr=(e,t)=>e.target.closest(`.${t}`),Qy=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),O_=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,fu=(e,t=0,n=O_,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},qy=e=>{const t=e.ctrlKey&&As()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function F_({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:s,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:c}){return h=>{if(Fr(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(h.ctrlKey&&i){const S=bt(h),p=qy(h),v=f*Math.pow(2,p);r.scaleTo(n,v,S,h);return}const d=h.deltaMode===1?20:1;let x=o===ar.Vertical?0:h.deltaX*d,y=o===ar.Horizontal?0:h.deltaY*d;!As()&&h.shiftKey&&o!==ar.Vertical&&(x=h.deltaY*d,y=0),r.translateBy(n,-(x/f)*s,-(y/f)*s,{internal:!0});const w=va(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(a==null||a(h,w),e.panScrollTimeout=setTimeout(()=>{c==null||c(h,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(h,w))}}function H_({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const s=r.type==="wheel",i=!t&&s&&!r.ctrlKey,l=Fr(r,e);if(r.ctrlKey&&s&&l&&r.preventDefault(),i||l)return null;r.preventDefault(),n.call(this,r,o)}}function B_({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var s,i,l;if((s=r.sourceEvent)!=null&&s.internal)return;const o=va(r.transform);e.mouseButton=((i=r.sourceEvent)==null?void 0:i.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function V_({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return s=>{var i,l;e.usedRightMouseButton=!!(n&&Qy(t,e.mouseButton??0)),(i=s.sourceEvent)!=null&&i.sync||r([s.transform.x,s.transform.y,s.transform.k]),o&&!((l=s.sourceEvent)!=null&&l.internal)&&(o==null||o(s.sourceEvent,va(s.transform)))}}function U_({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:s}){return i=>{var l;if(!((l=i.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,s&&Qy(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&s(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const a=va(i.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(i.sourceEvent,a)},n?150:0)}}}function W_({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:s,userSelectionActive:i,noWheelClassName:l,noPanClassName:a,lib:c,connectionInProgress:h}){return f=>{var S;const d=e||t,x=n&&f.ctrlKey,y=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Fr(f,`${c}-flow__node`)||Fr(f,`${c}-flow__edge`)))return!0;if(!r&&!d&&!o&&!s&&!n||i||h&&!y||Fr(f,l)&&y||Fr(f,a)&&(!y||o&&y&&!e)||!n&&f.ctrlKey&&y)return!1;if(!n&&f.type==="touchstart"&&((S=f.touches)==null?void 0:S.length)>1)return f.preventDefault(),!1;if(!d&&!o&&!x&&y||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||y)&&w}}function Y_({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:s,onPanZoomStart:i,onPanZoomEnd:l,onDraggingChange:a}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),f=ky().scaleExtent([t,n]).translateExtent(r),d=it(e).call(f);v({x:o.x,y:o.y,zoom:ho(o.zoom,t,n)},[[0,0],[h.width,h.height]],r);const x=d.on("wheel.zoom"),y=d.on("dblclick.zoom");f.wheelDelta(qy);function w(R,T){return d?new Promise(F=>{f==null||f.interpolate((T==null?void 0:T.interpolate)==="linear"?ls:Zi).transform(fu(d,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>F(!0)),R)}):Promise.resolve(!1)}function S({noWheelClassName:R,noPanClassName:T,onPaneContextMenu:F,userSelectionActive:j,panOnScroll:A,panOnDrag:M,panOnScrollMode:z,panOnScrollSpeed:C,preventScrolling:P,zoomOnPinch:L,zoomOnScroll:O,zoomOnDoubleClick:$,zoomActivationKeyPressed:U,lib:V,onTransformChange:Y,connectionInProgress:G,paneClickDistance:X,selectionOnDrag:B}){j&&!c.isZoomingOrPanning&&p();const Q=A&&!U&&!j;f.clickDistance(B?1/0:!jt(X)||X<0?0:X);const ne=Q?F_({zoomPanValues:c,noWheelClassName:R,d3Selection:d,d3Zoom:f,panOnScrollMode:z,panOnScrollSpeed:C,zoomOnPinch:L,onPanZoomStart:i,onPanZoom:s,onPanZoomEnd:l}):H_({noWheelClassName:R,preventScrolling:P,d3ZoomHandler:x});if(d.on("wheel.zoom",ne,{passive:!1}),!j){const Z=B_({zoomPanValues:c,onDraggingChange:a,onPanZoomStart:i});f.on("start",Z);const q=V_({zoomPanValues:c,panOnDrag:M,onPaneContextMenu:!!F,onPanZoom:s,onTransformChange:Y});f.on("zoom",q);const ae=U_({zoomPanValues:c,panOnDrag:M,panOnScroll:A,onPaneContextMenu:F,onPanZoomEnd:l,onDraggingChange:a});f.on("end",ae)}const J=W_({zoomActivationKeyPressed:U,panOnDrag:M,zoomOnScroll:O,panOnScroll:A,zoomOnDoubleClick:$,zoomOnPinch:L,userSelectionActive:j,noPanClassName:T,noWheelClassName:R,lib:V,connectionInProgress:G});f.filter(J),$?d.on("dblclick.zoom",y):d.on("dblclick.zoom",null)}function p(){f.on("zoom",null)}async function v(R,T,F){const j=du(R),A=f==null?void 0:f.constrain()(j,T,F);return A&&await w(A),new Promise(M=>M(A))}async function g(R,T){const F=du(R);return await w(F,T),new Promise(j=>j(F))}function N(R){if(d){const T=du(R),F=d.property("__zoom");(F.k!==R.zoom||F.x!==R.x||F.y!==R.y)&&(f==null||f.transform(d,T,null,{sync:!0}))}}function k(){const R=d?Sy(d.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}function b(R,T){return d?new Promise(F=>{f==null||f.interpolate((T==null?void 0:T.interpolate)==="linear"?ls:Zi).scaleTo(fu(d,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>F(!0)),R)}):Promise.resolve(!1)}function E(R,T){return d?new Promise(F=>{f==null||f.interpolate((T==null?void 0:T.interpolate)==="linear"?ls:Zi).scaleBy(fu(d,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>F(!0)),R)}):Promise.resolve(!1)}function _(R){f==null||f.scaleExtent(R)}function I(R){f==null||f.translateExtent(R)}function D(R){const T=!jt(R)||R<0?0:R;f==null||f.clickDistance(T)}return{update:S,destroy:p,setViewport:g,setViewportConstrained:v,getViewport:k,scaleTo:b,scaleBy:E,setScaleExtent:_,setTranslateExtent:I,syncViewport:N,setClickDistance:D}}var go;(function(e){e.Line="line",e.Handle="handle"})(go||(go={}));function G_({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:s}){const i=e-t,l=n-r,a=[i>0?1:i<0?-1:0,l>0?1:l<0?-1:0];return i&&o&&(a[0]=a[0]*-1),l&&s&&(a[1]=a[1]*-1),a}function kp(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function Nn(e,t){return Math.max(0,t-e)}function Sn(e,t){return Math.max(0,e-t)}function ji(e,t,n){return Math.max(0,t-e,e-n)}function bp(e,t){return e?!t:t}function X_(e,t,n,r,o,s,i,l){let{affectsX:a,affectsY:c}=t;const{isHorizontal:h,isVertical:f}=t,d=h&&f,{xSnapped:x,ySnapped:y}=n,{minWidth:w,maxWidth:S,minHeight:p,maxHeight:v}=r,{x:g,y:N,width:k,height:b,aspectRatio:E}=e;let _=Math.floor(h?x-e.pointerX:0),I=Math.floor(f?y-e.pointerY:0);const D=k+(a?-_:_),R=b+(c?-I:I),T=-s[0]*k,F=-s[1]*b;let j=ji(D,w,S),A=ji(R,p,v);if(i){let C=0,P=0;a&&_<0?C=Nn(g+_+T,i[0][0]):!a&&_>0&&(C=Sn(g+D+T,i[1][0])),c&&I<0?P=Nn(N+I+F,i[0][1]):!c&&I>0&&(P=Sn(N+R+F,i[1][1])),j=Math.max(j,C),A=Math.max(A,P)}if(l){let C=0,P=0;a&&_>0?C=Sn(g+_,l[0][0]):!a&&_<0&&(C=Nn(g+D,l[1][0])),c&&I>0?P=Sn(N+I,l[0][1]):!c&&I<0&&(P=Nn(N+R,l[1][1])),j=Math.max(j,C),A=Math.max(A,P)}if(o){if(h){const C=ji(D/E,p,v)*E;if(j=Math.max(j,C),i){let P=0;!a&&!c||a&&!c&&d?P=Sn(N+F+D/E,i[1][1])*E:P=Nn(N+F+(a?_:-_)/E,i[0][1])*E,j=Math.max(j,P)}if(l){let P=0;!a&&!c||a&&!c&&d?P=Nn(N+D/E,l[1][1])*E:P=Sn(N+(a?_:-_)/E,l[0][1])*E,j=Math.max(j,P)}}if(f){const C=ji(R*E,w,S)/E;if(A=Math.max(A,C),i){let P=0;!a&&!c||c&&!a&&d?P=Sn(g+R*E+T,i[1][0])/E:P=Nn(g+(c?I:-I)*E+T,i[0][0])/E,A=Math.max(A,P)}if(l){let P=0;!a&&!c||c&&!a&&d?P=Nn(g+R*E,l[1][0])/E:P=Sn(g+(c?I:-I)*E,l[0][0])/E,A=Math.max(A,P)}}}I=I+(I<0?A:-A),_=_+(_<0?j:-j),o&&(d?D>R*E?I=(bp(a,c)?-_:_)/E:_=(bp(a,c)?-I:I)*E:h?(I=_/E,c=a):(_=I*E,a=c));const M=a?g+_:g,z=c?N+I:N;return{width:k+(a?-_:_),height:b+(c?-I:I),x:s[0]*_*(a?-1:1)+M,y:s[1]*I*(c?-1:1)+z}}const Zy={width:0,height:0,x:0,y:0},K_={...Zy,pointerX:0,pointerY:0,aspectRatio:1};function Q_(e){return[[0,0],[e.measured.width,e.measured.height]]}function q_(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,s=e.measured.width??0,i=e.measured.height??0,l=n[0]*s,a=n[1]*i;return[[r-l,o-a],[r+s-l,o+i-a]]}function Z_({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const s=it(e);let i={controlDirection:kp("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:c,boundaries:h,keepAspectRatio:f,resizeDirection:d,onResizeStart:x,onResize:y,onResizeEnd:w,shouldResize:S}){let p={...Zy},v={...K_};i={boundaries:h,resizeDirection:d,keepAspectRatio:f,controlDirection:kp(c)};let g,N=null,k=[],b,E,_,I=!1;const D=ay().on("start",R=>{const{nodeLookup:T,transform:F,snapGrid:j,snapToGrid:A,nodeOrigin:M,paneDomNode:z}=n();if(g=T.get(t),!g)return;N=(z==null?void 0:z.getBoundingClientRect())??null;const{xSnapped:C,ySnapped:P}=as(R.sourceEvent,{transform:F,snapGrid:j,snapToGrid:A,containerBounds:N});p={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},v={...p,pointerX:C,pointerY:P,aspectRatio:p.width/p.height},b=void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(b=T.get(g.parentId),E=b&&g.extent==="parent"?Q_(b):void 0),k=[],_=void 0;for(const[L,O]of T)if(O.parentId===t&&(k.push({id:L,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const $=q_(O,g,O.origin??M);_?_=[[Math.min($[0][0],_[0][0]),Math.min($[0][1],_[0][1])],[Math.max($[1][0],_[1][0]),Math.max($[1][1],_[1][1])]]:_=$}x==null||x(R,{...p})}).on("drag",R=>{const{transform:T,snapGrid:F,snapToGrid:j,nodeOrigin:A}=n(),M=as(R.sourceEvent,{transform:T,snapGrid:F,snapToGrid:j,containerBounds:N}),z=[];if(!g)return;const{x:C,y:P,width:L,height:O}=p,$={},U=g.origin??A,{width:V,height:Y,x:G,y:X}=X_(v,i.controlDirection,M,i.boundaries,i.keepAspectRatio,U,E,_),B=V!==L,Q=Y!==O,ne=G!==C&&B,J=X!==P&&Q;if(!ne&&!J&&!B&&!Q)return;if((ne||J||U[0]===1||U[1]===1)&&($.x=ne?G:p.x,$.y=J?X:p.y,p.x=$.x,p.y=$.y,k.length>0)){const de=G-C,le=X-P;for(const Be of k)Be.position={x:Be.position.x-de+U[0]*(V-L),y:Be.position.y-le+U[1]*(Y-O)},z.push(Be)}if((B||Q)&&($.width=B&&(!i.resizeDirection||i.resizeDirection==="horizontal")?V:p.width,$.height=Q&&(!i.resizeDirection||i.resizeDirection==="vertical")?Y:p.height,p.width=$.width,p.height=$.height),b&&g.expandParent){const de=U[0]*($.width??0);$.x&&$.x<de&&(p.x=de,v.x=v.x-($.x-de));const le=U[1]*($.height??0);$.y&&$.y<le&&(p.y=le,v.y=v.y-($.y-le))}const Z=G_({width:p.width,prevWidth:L,height:p.height,prevHeight:O,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),q={...p,direction:Z};(S==null?void 0:S(R,q))!==!1&&(I=!0,y==null||y(R,q),r($,z))}).on("end",R=>{I&&(w==null||w(R,{...p}),o==null||o({...p}),I=!1)});s.call(D)}function a(){s.on(".drag",null)}return{update:l,destroy:a}}var Jy={exports:{}},e0={},t0={exports:{}},n0={};/**
277
- * @license React
278
- * use-sync-external-store-shim.production.js
279
- *
280
- * Copyright (c) Meta Platforms, Inc. and affiliates.
281
- *
282
- * This source code is licensed under the MIT license found in the
283
- * LICENSE file in the root directory of this source tree.
284
- */var xo=m;function J_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var e3=typeof Object.is=="function"?Object.is:J_,t3=xo.useState,n3=xo.useEffect,r3=xo.useLayoutEffect,o3=xo.useDebugValue;function s3(e,t){var n=t(),r=t3({inst:{value:n,getSnapshot:t}}),o=r[0].inst,s=r[1];return r3(function(){o.value=n,o.getSnapshot=t,hu(o)&&s({inst:o})},[e,n,t]),n3(function(){return hu(o)&&s({inst:o}),e(function(){hu(o)&&s({inst:o})})},[e]),o3(n),n}function hu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!e3(e,n)}catch{return!0}}function i3(e,t){return t()}var l3=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?i3:s3;n0.useSyncExternalStore=xo.useSyncExternalStore!==void 0?xo.useSyncExternalStore:l3;t0.exports=n0;var a3=t0.exports;/**
285
- * @license React
286
- * use-sync-external-store-shim/with-selector.production.js
287
- *
288
- * Copyright (c) Meta Platforms, Inc. and affiliates.
289
- *
290
- * This source code is licensed under the MIT license found in the
291
- * LICENSE file in the root directory of this source tree.
292
- */var wa=m,u3=a3;function c3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var d3=typeof Object.is=="function"?Object.is:c3,f3=u3.useSyncExternalStore,h3=wa.useRef,p3=wa.useEffect,m3=wa.useMemo,g3=wa.useDebugValue;e0.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var s=h3(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=m3(function(){function a(x){if(!c){if(c=!0,h=x,x=r(x),o!==void 0&&i.hasValue){var y=i.value;if(o(y,x))return f=y}return f=x}if(y=f,d3(h,x))return y;var w=r(x);return o!==void 0&&o(y,w)?(h=x,y):(h=x,f=w)}var c=!1,h,f,d=n===void 0?null:n;return[function(){return a(t())},d===null?void 0:function(){return a(d())}]},[t,n,r,o]);var l=f3(e,s[0],s[1]);return p3(function(){i.hasValue=!0,i.value=l},[l]),g3(l),l};Jy.exports=e0;var x3=Jy.exports;const y3=Fc(x3),v3={},Ep=e=>{let t;const n=new Set,r=(h,f)=>{const d=typeof h=="function"?h(t):h;if(!Object.is(d,t)){const x=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(y=>y(t,x))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>c,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(v3?"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,o,a);return a},w3=e=>e?Ep(e):Ep,{useDebugValue:N3}=$t,{useSyncExternalStoreWithSelector:S3}=y3,k3=e=>e;function r0(e,t=k3,n){const r=S3(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return N3(r),r}const Cp=(e,t)=>{const n=w3(e),r=(o,s=t)=>r0(n,o,s);return Object.assign(r,n),r},b3=(e,t)=>e?Cp(e,t):Cp;function xe(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,o]of e)if(!Object.is(o,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 Na=m.createContext(null),E3=Na.Provider,o0=Kt.error001();function se(e,t){const n=m.useContext(Na);if(n===null)throw new Error(o0);return r0(n,e,t)}function ye(){const e=m.useContext(Na);if(e===null)throw new Error(o0);return m.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const jp={display:"none"},C3={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},s0="react-flow__node-desc",i0="react-flow__edge-desc",j3="react-flow__aria-live",_3=e=>e.ariaLiveMessage,P3=e=>e.ariaLabelConfig;function M3({rfId:e}){const t=se(_3);return u.jsx("div",{id:`${j3}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:C3,children:t})}function I3({rfId:e,disableKeyboardA11y:t}){const n=se(P3);return u.jsxs(u.Fragment,{children:[u.jsx("div",{id:`${s0}-${e}`,style:jp,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),u.jsx("div",{id:`${i0}-${e}`,style:jp,children:n["edge.a11yDescription.default"]}),!t&&u.jsx(M3,{rfId:e})]})}const Sa=m.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},s)=>{const i=`${e}`.split("-");return u.jsx("div",{className:Pe(["react-flow__panel",n,...i]),style:r,ref:s,...o,children:t})});Sa.displayName="Panel";function T3({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:u.jsx(Sa,{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:u.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const R3=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}},_i=e=>e.id;function L3(e,t){return xe(e.selectedNodes.map(_i),t.selectedNodes.map(_i))&&xe(e.selectedEdges.map(_i),t.selectedEdges.map(_i))}function A3({onSelectionChange:e}){const t=ye(),{selectedNodes:n,selectedEdges:r}=se(R3,L3);return m.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(s=>s(o))},[n,r,e]),null}const z3=e=>!!e.onSelectionChangeHandlers;function D3({onSelectionChange:e}){const t=se(z3);return e||t?u.jsx(A3,{onSelectionChange:e}):null}const l0=[0,0],$3={x:0,y:0,zoom:1},O3=["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"],_p=[...O3,"rfId"],F3=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}),Pp={translateExtent:Ts,nodeOrigin:l0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function H3(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:s,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:a}=se(F3,xe),c=ye();m.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{h.current=Pp,l()}),[]);const h=m.useRef(Pp);return m.useEffect(()=>{for(const f of _p){const d=e[f],x=h.current[f];d!==x&&(typeof e[f]>"u"||(f==="nodes"?t(d):f==="edges"?n(d):f==="minZoom"?r(d):f==="maxZoom"?o(d):f==="translateExtent"?s(d):f==="nodeExtent"?i(d):f==="ariaLabelConfig"?c.setState({ariaLabelConfig:c_(d)}):f==="fitView"?c.setState({fitViewQueued:d}):f==="fitViewOptions"?c.setState({fitViewOptions:d}):c.setState({[f]:d})))}h.current=e},_p.map(f=>e[f])),null}function Mp(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function B3(e){var r;const[t,n]=m.useState(e==="system"?null:e);return m.useEffect(()=>{if(e!=="system"){n(e);return}const o=Mp(),s=()=>n(o!=null&&o.matches?"dark":"light");return s(),o==null||o.addEventListener("change",s),()=>{o==null||o.removeEventListener("change",s)}},[e]),t!==null?t:(r=Mp())!=null&&r.matches?"dark":"light"}const Ip=typeof document<"u"?document:null;function zs(e=null,t={target:Ip,actInsideInputWithModifier:!0}){const[n,r]=m.useState(!1),o=m.useRef(!1),s=m.useRef(new Set([])),[i,l]=m.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",`
293
- `).replace(`
294
-
295
- `,`
296
- +`).split(`
297
- `)),h=c.reduce((f,d)=>f.concat(...d),[]);return[c,h]}return[[],[]]},[e]);return m.useEffect(()=>{const a=(t==null?void 0:t.target)??Ip,c=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=x=>{var S,p;if(o.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!o.current||o.current&&!c)&&zy(x))return!1;const w=Rp(x.code,l);if(s.current.add(x[w]),Tp(i,s.current,!1)){const v=((p=(S=x.composedPath)==null?void 0:S.call(x))==null?void 0:p[0])||x.target,g=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";t.preventDefault!==!1&&(o.current||!g)&&x.preventDefault(),r(!0)}},f=x=>{const y=Rp(x.code,l);Tp(i,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(x[y]),x.key==="Meta"&&s.current.clear(),o.current=!1},d=()=>{s.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",h),a==null||a.addEventListener("keyup",f),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{a==null||a.removeEventListener("keydown",h),a==null||a.removeEventListener("keyup",f),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,r]),n}function Tp(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Rp(e,t){return t.includes(e)?"code":"key"}const V3=()=>{const e=ye();return m.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,o,s],panZoom:i}=e.getState();return i?(await i.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??s},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:o,minZoom:s,maxZoom:i,panZoom:l}=e.getState(),a=nf(t,r,o,s,i,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(a,{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:o,snapToGrid:s,domNode:i}=e.getState();if(!i)return t;const{x:l,y:a}=i.getBoundingClientRect(),c={x:t.x-l,y:t.y-a},h=n.snapGrid??o,f=n.snapToGrid??s;return Ks(c,r,f,h)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:s}=r.getBoundingClientRect(),i=Ol(t,n);return{x:i.x+o,y:i.y+s}}}),[])};function a0(e,t){const n=[],r=new Map,o=[];for(const s of e)if(s.type==="add"){o.push(s);continue}else if(s.type==="remove"||s.type==="replace")r.set(s.id,[s]);else{const i=r.get(s.id);i?i.push(s):r.set(s.id,[s])}for(const s of t){const i=r.get(s.id);if(!i){n.push(s);continue}if(i[0].type==="remove")continue;if(i[0].type==="replace"){n.push({...i[0].item});continue}const l={...s};for(const a of i)U3(a,l);n.push(l)}return o.length&&o.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function U3(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 W3(e,t){return a0(e,t)}function Y3(e,t){return a0(e,t)}function Zn(e,t){return{id:e,type:"select",selected:t}}function Hr(e,t=new Set,n=!1){const r=[];for(const[o,s]of e){const i=t.has(o);!(s.selected===void 0&&!i)&&s.selected!==i&&(n&&(s.selected=i),r.push(Zn(s.id,i)))}return r}function Lp({items:e=[],lookup:t}){var o;const n=[],r=new Map(e.map(s=>[s.id,s]));for(const[s,i]of e.entries()){const l=t.get(i.id),a=((o=l==null?void 0:l.internals)==null?void 0:o.userNode)??l;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:s})}for(const[s]of t)r.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function Ap(e){return{id:e.id,type:"remove"}}const zp=e=>e_(e),G3=e=>_y(e);function u0(e){return m.forwardRef(e)}const X3=typeof window<"u"?m.useLayoutEffect:m.useEffect;function Dp(e){const[t,n]=m.useState(BigInt(0)),[r]=m.useState(()=>K3(()=>n(o=>o+BigInt(1))));return X3(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function K3(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const c0=m.createContext(null);function Q3({children:e}){const t=ye(),n=m.useCallback(l=>{const{nodes:a=[],setNodes:c,hasDefaultNodes:h,onNodesChange:f,nodeLookup:d,fitViewQueued:x,onNodesChangeMiddlewareMap:y}=t.getState();let w=a;for(const p of l)w=typeof p=="function"?p(w):p;let S=Lp({items:w,lookup:d});for(const p of y.values())S=p(S);h&&c(w),S.length>0?f==null||f(S):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:p,nodes:v,setNodes:g}=t.getState();p&&g(v)})},[]),r=Dp(n),o=m.useCallback(l=>{const{edges:a=[],setEdges:c,hasDefaultEdges:h,onEdgesChange:f,edgeLookup:d}=t.getState();let x=a;for(const y of l)x=typeof y=="function"?y(x):y;h?c(x):f&&f(Lp({items:x,lookup:d}))},[]),s=Dp(o),i=m.useMemo(()=>({nodeQueue:r,edgeQueue:s}),[]);return u.jsx(c0.Provider,{value:i,children:e})}function q3(){const e=m.useContext(c0);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Z3=e=>!!e.panZoom;function cf(){const e=V3(),t=ye(),n=q3(),r=se(Z3),o=m.useMemo(()=>{const s=f=>t.getState().nodeLookup.get(f),i=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},a=f=>{var p,v;const{nodeLookup:d,nodeOrigin:x}=t.getState(),y=zp(f)?f:d.get(f.id),w=y.parentId?Ly(y.position,y.measured,y.parentId,d,x):y.position,S={...y,position:w,width:((p=y.measured)==null?void 0:p.width)??y.width,height:((v=y.measured)==null?void 0:v.height)??y.height};return po(S)},c=(f,d,x={replace:!1})=>{i(y=>y.map(w=>{if(w.id===f){const S=typeof d=="function"?d(w):d;return x.replace&&zp(S)?S:{...w,...S}}return w}))},h=(f,d,x={replace:!1})=>{l(y=>y.map(w=>{if(w.id===f){const S=typeof d=="function"?d(w):d;return x.replace&&G3(S)?S:{...w,...S}}return w}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var d;return(d=s(f))==null?void 0:d.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(d=>({...d}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:i,setEdges:l,addNodes:f=>{const d=Array.isArray(f)?f:[f];n.nodeQueue.push(x=>[...x,...d])},addEdges:f=>{const d=Array.isArray(f)?f:[f];n.edgeQueue.push(x=>[...x,...d])},toObject:()=>{const{nodes:f=[],edges:d=[],transform:x}=t.getState(),[y,w,S]=x;return{nodes:f.map(p=>({...p})),edges:d.map(p=>({...p})),viewport:{x:y,y:w,zoom:S}}},deleteElements:async({nodes:f=[],edges:d=[]})=>{const{nodes:x,edges:y,onNodesDelete:w,onEdgesDelete:S,triggerNodeChanges:p,triggerEdgeChanges:v,onDelete:g,onBeforeDelete:N}=t.getState(),{nodes:k,edges:b}=await s_({nodesToRemove:f,edgesToRemove:d,nodes:x,edges:y,onBeforeDelete:N}),E=b.length>0,_=k.length>0;if(E){const I=b.map(Ap);S==null||S(b),v(I)}if(_){const I=k.map(Ap);w==null||w(k),p(I)}return(_||E)&&(g==null||g({nodes:k,edges:b})),{deletedNodes:k,deletedEdges:b}},getIntersectingNodes:(f,d=!0,x)=>{const y=fp(f),w=y?f:a(f),S=x!==void 0;return w?(x||t.getState().nodes).filter(p=>{const v=t.getState().nodeLookup.get(p.id);if(v&&!y&&(p.id===f.id||!v.internals.positionAbsolute))return!1;const g=po(S?p:v),N=Ls(g,w);return d&&N>0||N>=g.width*g.height||N>=w.width*w.height}):[]},isNodeIntersecting:(f,d,x=!0)=>{const w=fp(f)?f:a(f);if(!w)return!1;const S=Ls(w,d);return x&&S>0||S>=d.width*d.height||S>=w.width*w.height},updateNode:c,updateNodeData:(f,d,x={replace:!1})=>{c(f,y=>{const w=typeof d=="function"?d(y):d;return x.replace?{...y,data:w}:{...y,data:{...y.data,...w}}},x)},updateEdge:h,updateEdgeData:(f,d,x={replace:!1})=>{h(f,y=>{const w=typeof d=="function"?d(y):d;return x.replace?{...y,data:w}:{...y,data:{...y.data,...w}}},x)},getNodesBounds:f=>{const{nodeLookup:d,nodeOrigin:x}=t.getState();return t_(f,{nodeLookup:d,nodeOrigin:x})},getHandleConnections:({type:f,id:d,nodeId:x})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${x}-${f}${d?`-${d}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:f,handleId:d,nodeId:x})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${x}${f?d?`-${f}-${d}`:`-${f}`:""}`))==null?void 0:y.values())??[])},fitView:async f=>{const d=t.getState().fitViewResolver??u_();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:d}),n.nodeQueue.push(x=>[...x]),d.promise}}},[]);return m.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const $p=e=>e.selected,J3=typeof window<"u"?window:void 0;function eP({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ye(),{deleteElements:r}=cf(),o=zs(e,{actInsideInputWithModifier:!1}),s=zs(t,{target:J3});m.useEffect(()=>{if(o){const{edges:i,nodes:l}=n.getState();r({nodes:l.filter($p),edges:i.filter($p)}),n.setState({nodesSelectionActive:!1})}},[o]),m.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function tP(e){const t=ye();m.useEffect(()=>{const n=()=>{var o,s,i,l;if(!e.current||!(((s=(o=e.current).checkVisibility)==null?void 0:s.call(o))??!0))return!1;const r=rf(e.current);(r.height===0||r.width===0)&&((l=(i=t.getState()).onError)==null||l.call(i,"004",Kt.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 ka={position:"absolute",width:"100%",height:"100%",top:0,left:0},nP=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function rP({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:s=ar.Free,zoomOnDoubleClick:i=!0,panOnDrag:l=!0,defaultViewport:a,translateExtent:c,minZoom:h,maxZoom:f,zoomActivationKeyCode:d,preventScrolling:x=!0,children:y,noWheelClassName:w,noPanClassName:S,onViewportChange:p,isControlledViewport:v,paneClickDistance:g,selectionOnDrag:N}){const k=ye(),b=m.useRef(null),{userSelectionActive:E,lib:_,connectionInProgress:I}=se(nP,xe),D=zs(d),R=m.useRef();tP(b);const T=m.useCallback(F=>{p==null||p({x:F[0],y:F[1],zoom:F[2]}),v||k.setState({transform:F})},[p,v]);return m.useEffect(()=>{if(b.current){R.current=Y_({domNode:b.current,minZoom:h,maxZoom:f,translateExtent:c,viewport:a,onDraggingChange:M=>k.setState({paneDragging:M}),onPanZoomStart:(M,z)=>{const{onViewportChangeStart:C,onMoveStart:P}=k.getState();P==null||P(M,z),C==null||C(z)},onPanZoom:(M,z)=>{const{onViewportChange:C,onMove:P}=k.getState();P==null||P(M,z),C==null||C(z)},onPanZoomEnd:(M,z)=>{const{onViewportChangeEnd:C,onMoveEnd:P}=k.getState();P==null||P(M,z),C==null||C(z)}});const{x:F,y:j,zoom:A}=R.current.getViewport();return k.setState({panZoom:R.current,transform:[F,j,A],domNode:b.current.closest(".react-flow")}),()=>{var M;(M=R.current)==null||M.destroy()}}},[]),m.useEffect(()=>{var F;(F=R.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:s,zoomOnDoubleClick:i,panOnDrag:l,zoomActivationKeyPressed:D,preventScrolling:x,noPanClassName:S,userSelectionActive:E,noWheelClassName:w,lib:_,onTransformChange:T,connectionInProgress:I,selectionOnDrag:N,paneClickDistance:g})},[e,t,n,r,o,s,i,l,D,x,S,E,w,_,T,I,N,g]),u.jsx("div",{className:"react-flow__renderer",ref:b,style:ka,children:y})}const oP=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function sP(){const{userSelectionActive:e,userSelectionRect:t}=se(oP,xe);return e&&t?u.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))},iP=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function lP({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Rs.Full,panOnDrag:r,paneClickDistance:o,selectionOnDrag:s,onSelectionStart:i,onSelectionEnd:l,onPaneClick:a,onPaneContextMenu:c,onPaneScroll:h,onPaneMouseEnter:f,onPaneMouseMove:d,onPaneMouseLeave:x,children:y}){const w=ye(),{userSelectionActive:S,elementsSelectable:p,dragging:v,connectionInProgress:g}=se(iP,xe),N=p&&(e||S),k=m.useRef(null),b=m.useRef(),E=m.useRef(new Set),_=m.useRef(new Set),I=m.useRef(!1),D=C=>{if(I.current||g){I.current=!1;return}a==null||a(C),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},R=C=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){C.preventDefault();return}c==null||c(C)},T=h?C=>h(C):void 0,F=C=>{I.current&&(C.stopPropagation(),I.current=!1)},j=C=>{var Y,G;const{domNode:P}=w.getState();if(b.current=P==null?void 0:P.getBoundingClientRect(),!b.current)return;const L=C.target===k.current;if(!L&&!!C.target.closest(".nokey")||!e||!(s&&L||t)||C.button!==0||!C.isPrimary)return;(G=(Y=C.target)==null?void 0:Y.setPointerCapture)==null||G.call(Y,C.pointerId),I.current=!1;const{x:U,y:V}=_t(C.nativeEvent,b.current);w.setState({userSelectionRect:{width:0,height:0,startX:U,startY:V,x:U,y:V}}),L||(C.stopPropagation(),C.preventDefault())},A=C=>{const{userSelectionRect:P,transform:L,nodeLookup:O,edgeLookup:$,connectionLookup:U,triggerNodeChanges:V,triggerEdgeChanges:Y,defaultEdgeOptions:G,resetSelectedElements:X}=w.getState();if(!b.current||!P)return;const{x:B,y:Q}=_t(C.nativeEvent,b.current),{startX:ne,startY:J}=P;if(!I.current){const le=t?0:o;if(Math.hypot(B-ne,Q-J)<=le)return;X(),i==null||i(C)}I.current=!0;const Z={startX:ne,startY:J,x:B<ne?B:ne,y:Q<J?Q:J,width:Math.abs(B-ne),height:Math.abs(Q-J)},q=E.current,ae=_.current;E.current=new Set(tf(O,Z,L,n===Rs.Partial,!0).map(le=>le.id)),_.current=new Set;const de=(G==null?void 0:G.selectable)??!0;for(const le of E.current){const Be=U.get(le);if(Be)for(const{edgeId:xn}of Be.values()){const Zt=$.get(xn);Zt&&(Zt.selectable??de)&&_.current.add(xn)}}if(!hp(q,E.current)){const le=Hr(O,E.current,!0);V(le)}if(!hp(ae,_.current)){const le=Hr($,_.current);Y(le)}w.setState({userSelectionRect:Z,userSelectionActive:!0,nodesSelectionActive:!1})},M=C=>{var P,L;C.button===0&&((L=(P=C.target)==null?void 0:P.releasePointerCapture)==null||L.call(P,C.pointerId),!S&&C.target===k.current&&w.getState().userSelectionRect&&(D==null||D(C)),w.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(l==null||l(C),w.setState({nodesSelectionActive:E.current.size>0})))},z=r===!0||Array.isArray(r)&&r.includes(0);return u.jsxs("div",{className:Pe(["react-flow__pane",{draggable:z,dragging:v,selection:e}]),onClick:N?void 0:pu(D,k),onContextMenu:pu(R,k),onWheel:pu(T,k),onPointerEnter:N?void 0:f,onPointerMove:N?A:d,onPointerUp:N?M:void 0,onPointerDownCapture:N?j:void 0,onClickCapture:N?F:void 0,onPointerLeave:x,ref:k,style:ka,children:[y,u.jsx(sP,{})]})}function zc({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:s,multiSelectionActive:i,nodeLookup:l,onError:a}=t.getState(),c=l.get(e);if(!c){a==null||a("012",Kt.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(s({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):o([e])}function d0({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:s,nodeClickDistance:i}){const l=ye(),[a,c]=m.useState(!1),h=m.useRef();return m.useEffect(()=>{h.current=T_({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{zc({id:f,store:l,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),m.useEffect(()=>{var f,d;if(t)(f=h.current)==null||f.destroy();else if(e.current)return(d=h.current)==null||d.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:s,nodeId:o,nodeClickDistance:i}),()=>{var x;(x=h.current)==null||x.destroy()}},[n,r,t,s,e,o]),a}const aP=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function f0(){const e=ye();return m.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:s,nodesDraggable:i,onError:l,updateNodePositions:a,nodeLookup:c,nodeOrigin:h}=e.getState(),f=new Map,d=aP(i),x=o?s[0]:5,y=o?s[1]:5,w=n.direction.x*x*n.factor,S=n.direction.y*y*n.factor;for(const[,p]of c){if(!d(p))continue;let v={x:p.internals.positionAbsolute.x+w,y:p.internals.positionAbsolute.y+S};o&&(v=Xs(v,s));const{position:g,positionAbsolute:N}=Py({nodeId:p.id,nextPosition:v,nodeLookup:c,nodeExtent:r,nodeOrigin:h,onError:l});p.position=g,p.internals.positionAbsolute=N,f.set(p.id,p)}a(f)},[])}const df=m.createContext(null),uP=df.Provider;df.Consumer;const h0=()=>m.useContext(df),cP=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),dP=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:s,connection:i}=r,{fromHandle:l,toHandle:a,isValid:c}=i,h=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:h,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:s===fo.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!o,valid:h&&c}};function fP({type:e="source",position:t=K.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:s=!0,id:i,onConnect:l,children:a,className:c,onMouseDown:h,onTouchStart:f,...d},x){var A,M;const y=i||null,w=e==="target",S=ye(),p=h0(),{connectOnClick:v,noPanClassName:g,rfId:N}=se(cP,xe),{connectingFrom:k,connectingTo:b,clickConnecting:E,isPossibleEndHandle:_,connectionInProcess:I,clickConnectionInProcess:D,valid:R}=se(dP(p,y,e),xe);p||(M=(A=S.getState()).onError)==null||M.call(A,"010",Kt.error010());const T=z=>{const{defaultEdgeOptions:C,onConnect:P,hasDefaultEdges:L}=S.getState(),O={...C,...z};if(L){const{edges:$,setEdges:U}=S.getState();U(g_(O,$))}P==null||P(O),l==null||l(O)},F=z=>{if(!p)return;const C=Dy(z.nativeEvent);if(o&&(C&&z.button===0||!C)){const P=S.getState();Ac.onPointerDown(z.nativeEvent,{handleDomNode:z.currentTarget,autoPanOnConnect:P.autoPanOnConnect,connectionMode:P.connectionMode,connectionRadius:P.connectionRadius,domNode:P.domNode,nodeLookup:P.nodeLookup,lib:P.lib,isTarget:w,handleId:y,nodeId:p,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:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:P.autoPanSpeed,dragThreshold:P.connectionDragThreshold})}C?h==null||h(z):f==null||f(z)},j=z=>{const{onClickConnectStart:C,onClickConnectEnd:P,connectionClickStartHandle:L,connectionMode:O,isValidConnection:$,lib:U,rfId:V,nodeLookup:Y,connection:G}=S.getState();if(!p||!L&&!o)return;if(!L){C==null||C(z.nativeEvent,{nodeId:p,handleId:y,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:p,type:e,id:y}});return}const X=Ay(z.target),B=n||$,{connection:Q,isValid:ne}=Ac.isValid(z.nativeEvent,{handle:{nodeId:p,id:y,type:e},connectionMode:O,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:B,flowId:V,doc:X,lib:U,nodeLookup:Y});ne&&Q&&T(Q);const J=structuredClone(G);delete J.inProgress,J.toPosition=J.toHandle?J.toHandle.position:null,P==null||P(z,J),S.setState({connectionClickStartHandle:null})};return u.jsx("div",{"data-handleid":y,"data-nodeid":p,"data-handlepos":t,"data-id":`${N}-${p}-${y}-${e}`,className:Pe(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,c,{source:!w,target:w,connectable:r,connectablestart:o,connectableend:s,clickconnecting:E,connectingfrom:k,connectingto:b,valid:R,connectionindicator:r&&(!I||_)&&(I||D?s:o)}]),onMouseDown:F,onTouchStart:F,onClick:v?j:void 0,ref:x,...d,children:a})}const Fl=m.memo(u0(fP));function hP({data:e,isConnectable:t,sourcePosition:n=K.Bottom}){return u.jsxs(u.Fragment,{children:[e==null?void 0:e.label,u.jsx(Fl,{type:"source",position:n,isConnectable:t})]})}function pP({data:e,isConnectable:t,targetPosition:n=K.Top,sourcePosition:r=K.Bottom}){return u.jsxs(u.Fragment,{children:[u.jsx(Fl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,u.jsx(Fl,{type:"source",position:r,isConnectable:t})]})}function mP(){return null}function gP({data:e,isConnectable:t,targetPosition:n=K.Top}){return u.jsxs(u.Fragment,{children:[u.jsx(Fl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Hl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Op={input:hP,default:pP,output:gP,group:mP};function xP(e){var t,n,r,o;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??((o=e.style)==null?void 0:o.height)}}const yP=e=>{const{width:t,height:n,x:r,y:o}=Gs(e.nodeLookup,{filter:s=>!!s.selected});return{width:jt(t)?t:null,height:jt(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function vP({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ye(),{width:o,height:s,transformString:i,userSelectionActive:l}=se(yP,xe),a=f0(),c=m.useRef(null);if(m.useEffect(()=>{var d;n||(d=c.current)==null||d.focus({preventScroll:!0})},[n]),d0({nodeRef:c}),l||!o||!s)return null;const h=e?d=>{const x=r.getState().nodes.filter(y=>y.selected);e(d,x)}:void 0,f=d=>{Object.prototype.hasOwnProperty.call(Hl,d.key)&&(d.preventDefault(),a({direction:Hl[d.key],factor:d.shiftKey?4:1}))};return u.jsx("div",{className:Pe(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:u.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:o,height:s}})})}const Fp=typeof window<"u"?window:void 0,wP=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function p0({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:i,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:c,selectionOnDrag:h,selectionMode:f,onSelectionStart:d,onSelectionEnd:x,multiSelectionKeyCode:y,panActivationKeyCode:w,zoomActivationKeyCode:S,elementsSelectable:p,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:N,panOnScrollSpeed:k,panOnScrollMode:b,zoomOnDoubleClick:E,panOnDrag:_,defaultViewport:I,translateExtent:D,minZoom:R,maxZoom:T,preventScrolling:F,onSelectionContextMenu:j,noWheelClassName:A,noPanClassName:M,disableKeyboardA11y:z,onViewportChange:C,isControlledViewport:P}){const{nodesSelectionActive:L,userSelectionActive:O}=se(wP,xe),$=zs(c,{target:Fp}),U=zs(w,{target:Fp}),V=U||_,Y=U||N,G=h&&V!==!0,X=$||O||G;return eP({deleteKeyCode:a,multiSelectionKeyCode:y}),u.jsx(rP,{onPaneContextMenu:s,elementsSelectable:p,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:Y,panOnScrollSpeed:k,panOnScrollMode:b,zoomOnDoubleClick:E,panOnDrag:!$&&V,defaultViewport:I,translateExtent:D,minZoom:R,maxZoom:T,zoomActivationKeyCode:S,preventScrolling:F,noWheelClassName:A,noPanClassName:M,onViewportChange:C,isControlledViewport:P,paneClickDistance:l,selectionOnDrag:G,children:u.jsxs(lP,{onSelectionStart:d,onSelectionEnd:x,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:i,panOnDrag:V,isSelecting:!!X,selectionMode:f,selectionKeyPressed:$,paneClickDistance:l,selectionOnDrag:G,children:[e,L&&u.jsx(vP,{onSelectionContextMenu:j,noPanClassName:M,disableKeyboardA11y:z})]})})}p0.displayName="FlowRenderer";const NP=m.memo(p0),SP=e=>t=>e?tf(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 kP(e){return se(m.useCallback(SP(e),[e]),xe)}const bP=e=>e.updateNodeInternals;function EP(){const e=se(bP),[t]=m.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(o=>{const s=o.target.getAttribute("data-id");r.set(s,{id:s,nodeElement:o.target,force:!0})}),e(r)}));return m.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function CP({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=ye(),s=m.useRef(null),i=m.useRef(null),l=m.useRef(e.sourcePosition),a=m.useRef(e.targetPosition),c=m.useRef(t),h=n&&!!e.internals.handleBounds;return m.useEffect(()=>{s.current&&!e.hidden&&(!h||i.current!==s.current)&&(i.current&&(r==null||r.unobserve(i.current)),r==null||r.observe(s.current),i.current=s.current)},[h,e.hidden]),m.useEffect(()=>()=>{i.current&&(r==null||r.unobserve(i.current),i.current=null)},[]),m.useEffect(()=>{if(s.current){const f=c.current!==t,d=l.current!==e.sourcePosition,x=a.current!==e.targetPosition;(f||d||x)&&(c.current=t,l.current=e.sourcePosition,a.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function jP({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:s,onDoubleClick:i,nodesDraggable:l,elementsSelectable:a,nodesConnectable:c,nodesFocusable:h,resizeObserver:f,noDragClassName:d,noPanClassName:x,disableKeyboardA11y:y,rfId:w,nodeTypes:S,nodeClickDistance:p,onError:v}){const{node:g,internals:N,isParent:k}=se(B=>{const Q=B.nodeLookup.get(e),ne=B.parentLookup.has(e);return{node:Q,internals:Q.internals,isParent:ne}},xe);let b=g.type||"default",E=(S==null?void 0:S[b])||Op[b];E===void 0&&(v==null||v("003",Kt.error003(b)),b="default",E=(S==null?void 0:S.default)||Op.default);const _=!!(g.draggable||l&&typeof g.draggable>"u"),I=!!(g.selectable||a&&typeof g.selectable>"u"),D=!!(g.connectable||c&&typeof g.connectable>"u"),R=!!(g.focusable||h&&typeof g.focusable>"u"),T=ye(),F=Ry(g),j=CP({node:g,nodeType:b,hasDimensions:F,resizeObserver:f}),A=d0({nodeRef:j,disabled:g.hidden||!_,noDragClassName:d,handleSelector:g.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:p}),M=f0();if(g.hidden)return null;const z=gn(g),C=xP(g),P=I||_||t||n||r||o,L=n?B=>n(B,{...N.userNode}):void 0,O=r?B=>r(B,{...N.userNode}):void 0,$=o?B=>o(B,{...N.userNode}):void 0,U=s?B=>s(B,{...N.userNode}):void 0,V=i?B=>i(B,{...N.userNode}):void 0,Y=B=>{const{selectNodesOnDrag:Q,nodeDragThreshold:ne}=T.getState();I&&(!Q||!_||ne>0)&&zc({id:e,store:T,nodeRef:j}),t&&t(B,{...N.userNode})},G=B=>{if(!(zy(B.nativeEvent)||y)){if(by.includes(B.key)&&I){const Q=B.key==="Escape";zc({id:e,store:T,unselect:Q,nodeRef:j})}else if(_&&g.selected&&Object.prototype.hasOwnProperty.call(Hl,B.key)){B.preventDefault();const{ariaLabelConfig:Q}=T.getState();T.setState({ariaLiveMessage:Q["node.a11yDescription.ariaLiveMessage"]({direction:B.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),M({direction:Hl[B.key],factor:B.shiftKey?4:1})}}},X=()=>{var ae;if(y||!((ae=j.current)!=null&&ae.matches(":focus-visible")))return;const{transform:B,width:Q,height:ne,autoPanOnNodeFocus:J,setCenter:Z}=T.getState();if(!J)return;tf(new Map([[e,g]]),{x:0,y:0,width:Q,height:ne},B,!0).length>0||Z(g.position.x+z.width/2,g.position.y+z.height/2,{zoom:B[2]})};return u.jsx("div",{className:Pe(["react-flow__node",`react-flow__node-${b}`,{[x]:_},g.className,{selected:g.selected,selectable:I,parent:k,draggable:_,dragging:A}]),ref:j,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:F?"visible":"hidden",...g.style,...C},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:O,onMouseLeave:$,onContextMenu:U,onClick:Y,onDoubleClick:V,onKeyDown:R?G:void 0,tabIndex:R?0:void 0,onFocus:R?X:void 0,role:g.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${s0}-${w}`,"aria-label":g.ariaLabel,...g.domAttributes,children:u.jsx(uP,{value:e,children:u.jsx(E,{id:e,data:g.data,type:b,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:g.selected??!1,selectable:I,draggable:_,deletable:g.deletable??!0,isConnectable:D,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:A,dragHandle:g.dragHandle,zIndex:N.z,parentId:g.parentId,...z})})})}var _P=m.memo(jP);const PP=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function m0(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,onError:s}=se(PP,xe),i=kP(e.onlyRenderVisibleElements),l=EP();return u.jsx("div",{className:"react-flow__nodes",style:ka,children:i.map(a=>u.jsx(_P,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:s},a))})}m0.displayName="NodeRenderer";const MP=m.memo(m0);function IP(e){return se(m.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const r=[];if(n.width&&n.height)for(const o of n.edges){const s=n.nodeLookup.get(o.source),i=n.nodeLookup.get(o.target);s&&i&&h_({sourceNode:s,targetNode:i,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),xe)}const TP=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return u.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},RP=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return u.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Hp={[Dl.Arrow]:TP,[Dl.ArrowClosed]:RP};function LP(e){const t=ye();return m.useMemo(()=>{var o,s;return Object.prototype.hasOwnProperty.call(Hp,e)?Hp[e]:((s=(o=t.getState()).onError)==null||s.call(o,"009",Kt.error009(e)),null)},[e])}const AP=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:s="strokeWidth",strokeWidth:i,orient:l="auto-start-reverse"})=>{const a=LP(t);return a?u.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:u.jsx(a,{color:n,strokeWidth:i})}):null},g0=({defaultColor:e,rfId:t})=>{const n=se(s=>s.edges),r=se(s=>s.defaultEdgeOptions),o=m.useMemo(()=>N_(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return o.length?u.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:u.jsx("defs",{children:o.map(s=>u.jsx(AP,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};g0.displayName="MarkerDefinitions";var zP=m.memo(g0);function x0({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:s,labelBgPadding:i=[2,4],labelBgBorderRadius:l=2,children:a,className:c,...h}){const[f,d]=m.useState({x:1,y:0,width:0,height:0}),x=Pe(["react-flow__edge-textwrapper",c]),y=m.useRef(null);return m.useEffect(()=>{if(y.current){const w=y.current.getBBox();d({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?u.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:x,visibility:f.width?"visible":"hidden",...h,children:[o&&u.jsx("rect",{width:f.width+2*i[0],x:-i[0],y:-i[1],height:f.height+2*i[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),u.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:y,style:r,children:n}),a]}):null}x0.displayName="EdgeText";const DP=m.memo(x0);function ba({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:s,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:a,interactionWidth:c=20,...h}){return u.jsxs(u.Fragment,{children:[u.jsx("path",{...h,d:e,fill:"none",className:Pe(["react-flow__edge-path",h.className])}),c?u.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&jt(t)&&jt(n)?u.jsx(DP,{x:t,y:n,label:r,labelStyle:o,labelShowBg:s,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function Bp({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===K.Left||e===K.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function y0({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:o,targetPosition:s=K.Top}){const[i,l]=Bp({pos:n,x1:e,y1:t,x2:r,y2:o}),[a,c]=Bp({pos:s,x1:r,y1:o,x2:e,y2:t}),[h,f,d,x]=$y({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:i,sourceControlY:l,targetControlX:a,targetControlY:c});return[`M${e},${t} C${i},${l} ${a},${c} ${r},${o}`,h,f,d,x]}function v0(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:s,sourcePosition:i,targetPosition:l,label:a,labelStyle:c,labelShowBg:h,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:S,interactionWidth:p})=>{const[v,g,N]=y0({sourceX:n,sourceY:r,sourcePosition:i,targetX:o,targetY:s,targetPosition:l}),k=e.isInternal?void 0:t;return u.jsx(ba,{id:k,path:v,labelX:g,labelY:N,label:a,labelStyle:c,labelShowBg:h,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:S,interactionWidth:p})})}const $P=v0({isInternal:!1}),w0=v0({isInternal:!0});$P.displayName="SimpleBezierEdge";w0.displayName="SimpleBezierEdgeInternal";function N0(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:s,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:f,style:d,sourcePosition:x=K.Bottom,targetPosition:y=K.Top,markerEnd:w,markerStart:S,pathOptions:p,interactionWidth:v})=>{const[g,N,k]=Tc({sourceX:n,sourceY:r,sourcePosition:x,targetX:o,targetY:s,targetPosition:y,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset,stepPosition:p==null?void 0:p.stepPosition}),b=e.isInternal?void 0:t;return u.jsx(ba,{id:b,path:g,labelX:N,labelY:k,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:f,style:d,markerEnd:w,markerStart:S,interactionWidth:v})})}const S0=N0({isInternal:!1}),k0=N0({isInternal:!0});S0.displayName="SmoothStepEdge";k0.displayName="SmoothStepEdgeInternal";function b0(e){return m.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return u.jsx(S0,{...n,id:r,pathOptions:m.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const OP=b0({isInternal:!1}),E0=b0({isInternal:!0});OP.displayName="StepEdge";E0.displayName="StepEdgeInternal";function C0(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:s,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:f,style:d,markerEnd:x,markerStart:y,interactionWidth:w})=>{const[S,p,v]=Hy({sourceX:n,sourceY:r,targetX:o,targetY:s}),g=e.isInternal?void 0:t;return u.jsx(ba,{id:g,path:S,labelX:p,labelY:v,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:f,style:d,markerEnd:x,markerStart:y,interactionWidth:w})})}const FP=C0({isInternal:!1}),j0=C0({isInternal:!0});FP.displayName="StraightEdge";j0.displayName="StraightEdgeInternal";function _0(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:s,sourcePosition:i=K.Bottom,targetPosition:l=K.Top,label:a,labelStyle:c,labelShowBg:h,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:S,pathOptions:p,interactionWidth:v})=>{const[g,N,k]=Oy({sourceX:n,sourceY:r,sourcePosition:i,targetX:o,targetY:s,targetPosition:l,curvature:p==null?void 0:p.curvature}),b=e.isInternal?void 0:t;return u.jsx(ba,{id:b,path:g,labelX:N,labelY:k,label:a,labelStyle:c,labelShowBg:h,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:S,interactionWidth:v})})}const HP=_0({isInternal:!1}),P0=_0({isInternal:!0});HP.displayName="BezierEdge";P0.displayName="BezierEdgeInternal";const Vp={default:P0,straight:j0,step:E0,smoothstep:k0,simplebezier:w0},Up={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},BP=(e,t,n)=>n===K.Left?e-t:n===K.Right?e+t:e,VP=(e,t,n)=>n===K.Top?e-t:n===K.Bottom?e+t:e,Wp="react-flow__edgeupdater";function Yp({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:s,onMouseOut:i,type:l}){return u.jsx("circle",{onMouseDown:o,onMouseEnter:s,onMouseOut:i,className:Pe([Wp,`${Wp}-${l}`]),cx:BP(t,r,e),cy:VP(n,r,e),r,stroke:"transparent",fill:"transparent"})}function UP({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:s,targetY:i,sourcePosition:l,targetPosition:a,onReconnect:c,onReconnectStart:h,onReconnectEnd:f,setReconnecting:d,setUpdateHover:x}){const y=ye(),w=(N,k)=>{if(N.button!==0)return;const{autoPanOnConnect:b,domNode:E,isValidConnection:_,connectionMode:I,connectionRadius:D,lib:R,onConnectStart:T,onConnectEnd:F,cancelConnection:j,nodeLookup:A,rfId:M,panBy:z,updateConnection:C}=y.getState(),P=k.type==="target",L=(U,V)=>{d(!1),f==null||f(U,n,k.type,V)},O=U=>c==null?void 0:c(n,U),$=(U,V)=>{d(!0),h==null||h(N,n,k.type),T==null||T(U,V)};Ac.onPointerDown(N.nativeEvent,{autoPanOnConnect:b,connectionMode:I,connectionRadius:D,domNode:E,handleId:k.id,nodeId:k.nodeId,nodeLookup:A,isTarget:P,edgeUpdaterType:k.type,lib:R,flowId:M,cancelConnection:j,panBy:z,isValidConnection:_,onConnect:O,onConnectStart:$,onConnectEnd:F,onReconnectEnd:L,updateConnection:C,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},S=N=>w(N,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),p=N=>w(N,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>x(!0),g=()=>x(!1);return u.jsxs(u.Fragment,{children:[(e===!0||e==="source")&&u.jsx(Yp,{position:l,centerX:r,centerY:o,radius:t,onMouseDown:S,onMouseEnter:v,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&u.jsx(Yp,{position:a,centerX:s,centerY:i,radius:t,onMouseDown:p,onMouseEnter:v,onMouseOut:g,type:"target"})]})}function WP({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:s,onContextMenu:i,onMouseEnter:l,onMouseMove:a,onMouseLeave:c,reconnectRadius:h,onReconnect:f,onReconnectStart:d,onReconnectEnd:x,rfId:y,edgeTypes:w,noPanClassName:S,onError:p,disableKeyboardA11y:v}){let g=se(Z=>Z.edgeLookup.get(e));const N=se(Z=>Z.defaultEdgeOptions);g=N?{...N,...g}:g;let k=g.type||"default",b=(w==null?void 0:w[k])||Vp[k];b===void 0&&(p==null||p("011",Kt.error011(k)),k="default",b=(w==null?void 0:w.default)||Vp.default);const E=!!(g.focusable||t&&typeof g.focusable>"u"),_=typeof f<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),I=!!(g.selectable||r&&typeof g.selectable>"u"),D=m.useRef(null),[R,T]=m.useState(!1),[F,j]=m.useState(!1),A=ye(),{zIndex:M,sourceX:z,sourceY:C,targetX:P,targetY:L,sourcePosition:O,targetPosition:$}=se(m.useCallback(Z=>{const q=Z.nodeLookup.get(g.source),ae=Z.nodeLookup.get(g.target);if(!q||!ae)return{zIndex:g.zIndex,...Up};const de=w_({id:e,sourceNode:q,targetNode:ae,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:Z.connectionMode,onError:p});return{zIndex:f_({selected:g.selected,zIndex:g.zIndex,sourceNode:q,targetNode:ae,elevateOnSelect:Z.elevateEdgesOnSelect,zIndexMode:Z.zIndexMode}),...de||Up}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex]),xe),U=m.useMemo(()=>g.markerStart?`url('#${Rc(g.markerStart,y)}')`:void 0,[g.markerStart,y]),V=m.useMemo(()=>g.markerEnd?`url('#${Rc(g.markerEnd,y)}')`:void 0,[g.markerEnd,y]);if(g.hidden||z===null||C===null||P===null||L===null)return null;const Y=Z=>{var le;const{addSelectedEdges:q,unselectNodesAndEdges:ae,multiSelectionActive:de}=A.getState();I&&(A.setState({nodesSelectionActive:!1}),g.selected&&de?(ae({nodes:[],edges:[g]}),(le=D.current)==null||le.blur()):q([e])),o&&o(Z,g)},G=s?Z=>{s(Z,{...g})}:void 0,X=i?Z=>{i(Z,{...g})}:void 0,B=l?Z=>{l(Z,{...g})}:void 0,Q=a?Z=>{a(Z,{...g})}:void 0,ne=c?Z=>{c(Z,{...g})}:void 0,J=Z=>{var q;if(!v&&by.includes(Z.key)&&I){const{unselectNodesAndEdges:ae,addSelectedEdges:de}=A.getState();Z.key==="Escape"?((q=D.current)==null||q.blur(),ae({edges:[g]})):de([e])}};return u.jsx("svg",{style:{zIndex:M},children:u.jsxs("g",{className:Pe(["react-flow__edge",`react-flow__edge-${k}`,g.className,S,{selected:g.selected,animated:g.animated,inactive:!I&&!o,updating:R,selectable:I}]),onClick:Y,onDoubleClick:G,onContextMenu:X,onMouseEnter:B,onMouseMove:Q,onMouseLeave:ne,onKeyDown:E?J:void 0,tabIndex:E?0:void 0,role:g.ariaRole??(E?"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":E?`${i0}-${y}`:void 0,ref:D,...g.domAttributes,children:[!F&&u.jsx(b,{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:z,sourceY:C,targetX:P,targetY:L,sourcePosition:O,targetPosition:$,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:U,markerEnd:V,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),_&&u.jsx(UP,{edge:g,isReconnectable:_,reconnectRadius:h,onReconnect:f,onReconnectStart:d,onReconnectEnd:x,sourceX:z,sourceY:C,targetX:P,targetY:L,sourcePosition:O,targetPosition:$,setUpdateHover:T,setReconnecting:j})]})})}var YP=m.memo(WP);const GP=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function M0({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:s,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:c,onEdgeClick:h,reconnectRadius:f,onEdgeDoubleClick:d,onReconnectStart:x,onReconnectEnd:y,disableKeyboardA11y:w}){const{edgesFocusable:S,edgesReconnectable:p,elementsSelectable:v,onError:g}=se(GP,xe),N=IP(t);return u.jsxs("div",{className:"react-flow__edges",children:[u.jsx(zP,{defaultColor:e,rfId:n}),N.map(k=>u.jsx(YP,{id:k,edgesFocusable:S,edgesReconnectable:p,elementsSelectable:v,noPanClassName:o,onReconnect:s,onContextMenu:i,onMouseEnter:l,onMouseMove:a,onMouseLeave:c,onClick:h,reconnectRadius:f,onDoubleClick:d,onReconnectStart:x,onReconnectEnd:y,rfId:n,onError:g,edgeTypes:r,disableKeyboardA11y:w},k))]})}M0.displayName="EdgeRenderer";const XP=m.memo(M0),KP=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function QP({children:e}){const t=se(KP);return u.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function qP(e){const t=cf(),n=m.useRef(!1);m.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const ZP=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function JP(e){const t=se(ZP),n=ye();return m.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function e4(e){return e.connection.inProgress?{...e.connection,to:Ks(e.connection.to,e.transform)}:{...e.connection}}function t4(e){return e4}function n4(e){const t=t4();return se(t,xe)}const r4=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function o4({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:s,height:i,isValid:l,inProgress:a}=se(r4,xe);return!(s&&o&&a)?null:u.jsx("svg",{style:e,width:s,height:i,className:"react-flow__connectionline react-flow__container",children:u.jsx("g",{className:Pe(["react-flow__connection",jy(l)]),children:u.jsx(I0,{style:t,type:n,CustomComponent:r,isValid:l})})})}const I0=({style:e,type:t=_n.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:s,fromNode:i,fromHandle:l,fromPosition:a,to:c,toNode:h,toHandle:f,toPosition:d,pointer:x}=n4();if(!o)return;if(n)return u.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:l,fromX:s.x,fromY:s.y,toX:c.x,toY:c.y,fromPosition:a,toPosition:d,connectionStatus:jy(r),toNode:h,toHandle:f,pointer:x});let y="";const w={sourceX:s.x,sourceY:s.y,sourcePosition:a,targetX:c.x,targetY:c.y,targetPosition:d};switch(t){case _n.Bezier:[y]=Oy(w);break;case _n.SimpleBezier:[y]=y0(w);break;case _n.Step:[y]=Tc({...w,borderRadius:0});break;case _n.SmoothStep:[y]=Tc(w);break;default:[y]=Hy(w)}return u.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};I0.displayName="ConnectionLine";const s4={};function Gp(e=s4){m.useRef(e),ye(),m.useEffect(()=>{},[e])}function i4(){ye(),m.useRef(!1),m.useEffect(()=>{},[])}function T0({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:s,onEdgeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:c,onNodeContextMenu:h,onSelectionContextMenu:f,onSelectionStart:d,onSelectionEnd:x,connectionLineType:y,connectionLineStyle:w,connectionLineComponent:S,connectionLineContainerStyle:p,selectionKeyCode:v,selectionOnDrag:g,selectionMode:N,multiSelectionKeyCode:k,panActivationKeyCode:b,zoomActivationKeyCode:E,deleteKeyCode:_,onlyRenderVisibleElements:I,elementsSelectable:D,defaultViewport:R,translateExtent:T,minZoom:F,maxZoom:j,preventScrolling:A,defaultMarkerColor:M,zoomOnScroll:z,zoomOnPinch:C,panOnScroll:P,panOnScrollSpeed:L,panOnScrollMode:O,zoomOnDoubleClick:$,panOnDrag:U,onPaneClick:V,onPaneMouseEnter:Y,onPaneMouseMove:G,onPaneMouseLeave:X,onPaneScroll:B,onPaneContextMenu:Q,paneClickDistance:ne,nodeClickDistance:J,onEdgeContextMenu:Z,onEdgeMouseEnter:q,onEdgeMouseMove:ae,onEdgeMouseLeave:de,reconnectRadius:le,onReconnect:Be,onReconnectStart:xn,onReconnectEnd:Zt,noDragClassName:Kn,noWheelClassName:_o,noPanClassName:Po,disableKeyboardA11y:Mo,nodeExtent:_a,rfId:ei,viewport:Sr,onViewportChange:Io}){return Gp(e),Gp(t),i4(),qP(n),JP(Sr),u.jsx(NP,{onPaneClick:V,onPaneMouseEnter:Y,onPaneMouseMove:G,onPaneMouseLeave:X,onPaneContextMenu:Q,onPaneScroll:B,paneClickDistance:ne,deleteKeyCode:_,selectionKeyCode:v,selectionOnDrag:g,selectionMode:N,onSelectionStart:d,onSelectionEnd:x,multiSelectionKeyCode:k,panActivationKeyCode:b,zoomActivationKeyCode:E,elementsSelectable:D,zoomOnScroll:z,zoomOnPinch:C,zoomOnDoubleClick:$,panOnScroll:P,panOnScrollSpeed:L,panOnScrollMode:O,panOnDrag:U,defaultViewport:R,translateExtent:T,minZoom:F,maxZoom:j,onSelectionContextMenu:f,preventScrolling:A,noDragClassName:Kn,noWheelClassName:_o,noPanClassName:Po,disableKeyboardA11y:Mo,onViewportChange:Io,isControlledViewport:!!Sr,children:u.jsxs(QP,{children:[u.jsx(XP,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:i,onReconnect:Be,onReconnectStart:xn,onReconnectEnd:Zt,onlyRenderVisibleElements:I,onEdgeContextMenu:Z,onEdgeMouseEnter:q,onEdgeMouseMove:ae,onEdgeMouseLeave:de,reconnectRadius:le,defaultMarkerColor:M,noPanClassName:Po,disableKeyboardA11y:Mo,rfId:ei}),u.jsx(o4,{style:w,type:y,component:S,containerStyle:p}),u.jsx("div",{className:"react-flow__edgelabel-renderer"}),u.jsx(MP,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:c,onNodeContextMenu:h,nodeClickDistance:J,onlyRenderVisibleElements:I,noPanClassName:Po,noDragClassName:Kn,disableKeyboardA11y:Mo,nodeExtent:_a,rfId:ei}),u.jsx("div",{className:"react-flow__viewport-portal"})]})})}T0.displayName="GraphView";const l4=m.memo(T0),Xp=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:s,fitView:i,fitViewOptions:l,minZoom:a=.5,maxZoom:c=2,nodeOrigin:h,nodeExtent:f,zIndexMode:d="basic"}={})=>{const x=new Map,y=new Map,w=new Map,S=new Map,p=r??t??[],v=n??e??[],g=h??[0,0],N=f??Ts;Uy(w,S,p);const k=Lc(v,x,y,{nodeOrigin:g,nodeExtent:N,zIndexMode:d});let b=[0,0,1];if(i&&o&&s){const E=Gs(x,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:_,y:I,zoom:D}=nf(E,o,s,a,c,(l==null?void 0:l.padding)??.1);b=[_,I,D]}return{rfId:"1",width:o??0,height:s??0,transform:b,nodes:v,nodesInitialized:k,nodeLookup:x,parentLookup:y,edges:p,edgeLookup:S,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:a,maxZoom:c,translateExtent:Ts,nodeExtent:N,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:fo.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:l,fitViewResolver:null,connection:{...Cy},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:i_,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Ey,zIndexMode:d,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},a4=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:s,fitView:i,fitViewOptions:l,minZoom:a,maxZoom:c,nodeOrigin:h,nodeExtent:f,zIndexMode:d})=>b3((x,y)=>{async function w(){const{nodeLookup:S,panZoom:p,fitViewOptions:v,fitViewResolver:g,width:N,height:k,minZoom:b,maxZoom:E}=y();p&&(await o_({nodes:S,width:N,height:k,panZoom:p,minZoom:b,maxZoom:E},v),g==null||g.resolve(!0),x({fitViewResolver:null}))}return{...Xp({nodes:e,edges:t,width:o,height:s,fitView:i,fitViewOptions:l,minZoom:a,maxZoom:c,nodeOrigin:h,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:d}),setNodes:S=>{const{nodeLookup:p,parentLookup:v,nodeOrigin:g,elevateNodesOnSelect:N,fitViewQueued:k,zIndexMode:b}=y(),E=Lc(S,p,v,{nodeOrigin:g,nodeExtent:f,elevateNodesOnSelect:N,checkEquality:!0,zIndexMode:b});k&&E?(w(),x({nodes:S,nodesInitialized:E,fitViewQueued:!1,fitViewOptions:void 0})):x({nodes:S,nodesInitialized:E})},setEdges:S=>{const{connectionLookup:p,edgeLookup:v}=y();Uy(p,v,S),x({edges:S})},setDefaultNodesAndEdges:(S,p)=>{if(S){const{setNodes:v}=y();v(S),x({hasDefaultNodes:!0})}if(p){const{setEdges:v}=y();v(p),x({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:p,nodeLookup:v,parentLookup:g,domNode:N,nodeOrigin:k,nodeExtent:b,debug:E,fitViewQueued:_,zIndexMode:I}=y(),{changes:D,updatedInternals:R}=__(S,v,g,N,k,b,I);R&&(b_(v,g,{nodeOrigin:k,nodeExtent:b,zIndexMode:I}),_?(w(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),(D==null?void 0:D.length)>0&&(E&&console.log("React Flow: trigger node changes",D),p==null||p(D)))},updateNodePositions:(S,p=!1)=>{const v=[];let g=[];const{nodeLookup:N,triggerNodeChanges:k,connection:b,updateConnection:E,onNodesChangeMiddlewareMap:_}=y();for(const[I,D]of S){const R=N.get(I),T=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&(D!=null&&D.position)),F={id:I,type:"position",position:T?{x:Math.max(0,D.position.x),y:Math.max(0,D.position.y)}:D.position,dragging:p};if(R&&b.inProgress&&b.fromNode.id===R.id){const j=yr(R,b.fromHandle,K.Left,!0);E({...b,from:j})}T&&R.parentId&&v.push({id:I,parentId:R.parentId,rect:{...D.internals.positionAbsolute,width:D.measured.width??0,height:D.measured.height??0}}),g.push(F)}if(v.length>0){const{parentLookup:I,nodeOrigin:D}=y(),R=uf(v,N,I,D);g.push(...R)}for(const I of _.values())g=I(g);k(g)},triggerNodeChanges:S=>{const{onNodesChange:p,setNodes:v,nodes:g,hasDefaultNodes:N,debug:k}=y();if(S!=null&&S.length){if(N){const b=W3(S,g);v(b)}k&&console.log("React Flow: trigger node changes",S),p==null||p(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:p,setEdges:v,edges:g,hasDefaultEdges:N,debug:k}=y();if(S!=null&&S.length){if(N){const b=Y3(S,g);v(b)}k&&console.log("React Flow: trigger edge changes",S),p==null||p(S)}},addSelectedNodes:S=>{const{multiSelectionActive:p,edgeLookup:v,nodeLookup:g,triggerNodeChanges:N,triggerEdgeChanges:k}=y();if(p){const b=S.map(E=>Zn(E,!0));N(b);return}N(Hr(g,new Set([...S]),!0)),k(Hr(v))},addSelectedEdges:S=>{const{multiSelectionActive:p,edgeLookup:v,nodeLookup:g,triggerNodeChanges:N,triggerEdgeChanges:k}=y();if(p){const b=S.map(E=>Zn(E,!0));k(b);return}k(Hr(v,new Set([...S]))),N(Hr(g,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:p}={})=>{const{edges:v,nodes:g,nodeLookup:N,triggerNodeChanges:k,triggerEdgeChanges:b}=y(),E=S||g,_=p||v,I=E.map(R=>{const T=N.get(R.id);return T&&(T.selected=!1),Zn(R.id,!1)}),D=_.map(R=>Zn(R.id,!1));k(I),b(D)},setMinZoom:S=>{const{panZoom:p,maxZoom:v}=y();p==null||p.setScaleExtent([S,v]),x({minZoom:S})},setMaxZoom:S=>{const{panZoom:p,minZoom:v}=y();p==null||p.setScaleExtent([v,S]),x({maxZoom:S})},setTranslateExtent:S=>{var p;(p=y().panZoom)==null||p.setTranslateExtent(S),x({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:p,triggerNodeChanges:v,triggerEdgeChanges:g,elementsSelectable:N}=y();if(!N)return;const k=p.reduce((E,_)=>_.selected?[...E,Zn(_.id,!1)]:E,[]),b=S.reduce((E,_)=>_.selected?[...E,Zn(_.id,!1)]:E,[]);v(k),g(b)},setNodeExtent:S=>{const{nodes:p,nodeLookup:v,parentLookup:g,nodeOrigin:N,elevateNodesOnSelect:k,nodeExtent:b,zIndexMode:E}=y();S[0][0]===b[0][0]&&S[0][1]===b[0][1]&&S[1][0]===b[1][0]&&S[1][1]===b[1][1]||(Lc(p,v,g,{nodeOrigin:N,nodeExtent:S,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:E}),x({nodeExtent:S}))},panBy:S=>{const{transform:p,width:v,height:g,panZoom:N,translateExtent:k}=y();return P_({delta:S,panZoom:N,transform:p,translateExtent:k,width:v,height:g})},setCenter:async(S,p,v)=>{const{width:g,height:N,maxZoom:k,panZoom:b}=y();if(!b)return Promise.resolve(!1);const E=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:k;return await b.setViewport({x:g/2-S*E,y:N/2-p*E,zoom:E},{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:{...Cy}})},updateConnection:S=>{x({connection:S})},reset:()=>x({...Xp()})}},Object.is);function u4({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:s,initialMinZoom:i,initialMaxZoom:l,initialFitViewOptions:a,fitView:c,nodeOrigin:h,nodeExtent:f,zIndexMode:d,children:x}){const[y]=m.useState(()=>a4({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:s,fitView:c,minZoom:i,maxZoom:l,fitViewOptions:a,nodeOrigin:h,nodeExtent:f,zIndexMode:d}));return u.jsx(E3,{value:y,children:u.jsx(Q3,{children:x})})}function c4({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:s,height:i,fitView:l,fitViewOptions:a,minZoom:c,maxZoom:h,nodeOrigin:f,nodeExtent:d,zIndexMode:x}){return m.useContext(Na)?u.jsx(u.Fragment,{children:e}):u.jsx(u4,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:s,initialHeight:i,fitView:l,initialFitViewOptions:a,initialMinZoom:c,initialMaxZoom:h,nodeOrigin:f,nodeExtent:d,zIndexMode:x,children:e})}const d4={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function f4({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:s,edgeTypes:i,onNodeClick:l,onEdgeClick:a,onInit:c,onMove:h,onMoveStart:f,onMoveEnd:d,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:p,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:N,onNodeContextMenu:k,onNodeDoubleClick:b,onNodeDragStart:E,onNodeDrag:_,onNodeDragStop:I,onNodesDelete:D,onEdgesDelete:R,onDelete:T,onSelectionChange:F,onSelectionDragStart:j,onSelectionDrag:A,onSelectionDragStop:M,onSelectionContextMenu:z,onSelectionStart:C,onSelectionEnd:P,onBeforeDelete:L,connectionMode:O,connectionLineType:$=_n.Bezier,connectionLineStyle:U,connectionLineComponent:V,connectionLineContainerStyle:Y,deleteKeyCode:G="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:B=!1,selectionMode:Q=Rs.Full,panActivationKeyCode:ne="Space",multiSelectionKeyCode:J=As()?"Meta":"Control",zoomActivationKeyCode:Z=As()?"Meta":"Control",snapToGrid:q,snapGrid:ae,onlyRenderVisibleElements:de=!1,selectNodesOnDrag:le,nodesDraggable:Be,autoPanOnNodeFocus:xn,nodesConnectable:Zt,nodesFocusable:Kn,nodeOrigin:_o=l0,edgesFocusable:Po,edgesReconnectable:Mo,elementsSelectable:_a=!0,defaultViewport:ei=$3,minZoom:Sr=.5,maxZoom:Io=2,translateExtent:Nf=Ts,preventScrolling:Ov=!0,nodeExtent:Pa,defaultMarkerColor:Fv="#b1b1b7",zoomOnScroll:Hv=!0,zoomOnPinch:Bv=!0,panOnScroll:Vv=!1,panOnScrollSpeed:Uv=.5,panOnScrollMode:Wv=ar.Free,zoomOnDoubleClick:Yv=!0,panOnDrag:Gv=!0,onPaneClick:Xv,onPaneMouseEnter:Kv,onPaneMouseMove:Qv,onPaneMouseLeave:qv,onPaneScroll:Zv,onPaneContextMenu:Jv,paneClickDistance:ew=1,nodeClickDistance:tw=0,children:nw,onReconnect:rw,onReconnectStart:ow,onReconnectEnd:sw,onEdgeContextMenu:iw,onEdgeDoubleClick:lw,onEdgeMouseEnter:aw,onEdgeMouseMove:uw,onEdgeMouseLeave:cw,reconnectRadius:dw=10,onNodesChange:fw,onEdgesChange:hw,noDragClassName:pw="nodrag",noWheelClassName:mw="nowheel",noPanClassName:Sf="nopan",fitView:kf,fitViewOptions:bf,connectOnClick:gw,attributionPosition:xw,proOptions:yw,defaultEdgeOptions:vw,elevateNodesOnSelect:ww=!0,elevateEdgesOnSelect:Nw=!1,disableKeyboardA11y:Ef=!1,autoPanOnConnect:Sw,autoPanOnNodeDrag:kw,autoPanSpeed:bw,connectionRadius:Ew,isValidConnection:Cw,onError:jw,style:_w,id:Cf,nodeDragThreshold:Pw,connectionDragThreshold:Mw,viewport:Iw,onViewportChange:Tw,width:Rw,height:Lw,colorMode:Aw="light",debug:zw,onScroll:ti,ariaLabelConfig:Dw,zIndexMode:jf="basic",...$w},Ow){const Ma=Cf||"1",Fw=B3(Aw),Hw=m.useCallback(_f=>{_f.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ti==null||ti(_f)},[ti]);return u.jsx("div",{"data-testid":"rf__wrapper",...$w,onScroll:Hw,style:{..._w,...d4},ref:Ow,className:Pe(["react-flow",o,Fw]),id:Cf,role:"application",children:u.jsxs(c4,{nodes:e,edges:t,width:Rw,height:Lw,fitView:kf,fitViewOptions:bf,minZoom:Sr,maxZoom:Io,nodeOrigin:_o,nodeExtent:Pa,zIndexMode:jf,children:[u.jsx(l4,{onInit:c,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:N,onNodeContextMenu:k,onNodeDoubleClick:b,nodeTypes:s,edgeTypes:i,connectionLineType:$,connectionLineStyle:U,connectionLineComponent:V,connectionLineContainerStyle:Y,selectionKeyCode:X,selectionOnDrag:B,selectionMode:Q,deleteKeyCode:G,multiSelectionKeyCode:J,panActivationKeyCode:ne,zoomActivationKeyCode:Z,onlyRenderVisibleElements:de,defaultViewport:ei,translateExtent:Nf,minZoom:Sr,maxZoom:Io,preventScrolling:Ov,zoomOnScroll:Hv,zoomOnPinch:Bv,zoomOnDoubleClick:Yv,panOnScroll:Vv,panOnScrollSpeed:Uv,panOnScrollMode:Wv,panOnDrag:Gv,onPaneClick:Xv,onPaneMouseEnter:Kv,onPaneMouseMove:Qv,onPaneMouseLeave:qv,onPaneScroll:Zv,onPaneContextMenu:Jv,paneClickDistance:ew,nodeClickDistance:tw,onSelectionContextMenu:z,onSelectionStart:C,onSelectionEnd:P,onReconnect:rw,onReconnectStart:ow,onReconnectEnd:sw,onEdgeContextMenu:iw,onEdgeDoubleClick:lw,onEdgeMouseEnter:aw,onEdgeMouseMove:uw,onEdgeMouseLeave:cw,reconnectRadius:dw,defaultMarkerColor:Fv,noDragClassName:pw,noWheelClassName:mw,noPanClassName:Sf,rfId:Ma,disableKeyboardA11y:Ef,nodeExtent:Pa,viewport:Iw,onViewportChange:Tw}),u.jsx(H3,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:p,nodesDraggable:Be,autoPanOnNodeFocus:xn,nodesConnectable:Zt,nodesFocusable:Kn,edgesFocusable:Po,edgesReconnectable:Mo,elementsSelectable:_a,elevateNodesOnSelect:ww,elevateEdgesOnSelect:Nw,minZoom:Sr,maxZoom:Io,nodeExtent:Pa,onNodesChange:fw,onEdgesChange:hw,snapToGrid:q,snapGrid:ae,connectionMode:O,translateExtent:Nf,connectOnClick:gw,defaultEdgeOptions:vw,fitView:kf,fitViewOptions:bf,onNodesDelete:D,onEdgesDelete:R,onDelete:T,onNodeDragStart:E,onNodeDrag:_,onNodeDragStop:I,onSelectionDrag:A,onSelectionDragStart:j,onSelectionDragStop:M,onMove:h,onMoveStart:f,onMoveEnd:d,noPanClassName:Sf,nodeOrigin:_o,rfId:Ma,autoPanOnConnect:Sw,autoPanOnNodeDrag:kw,autoPanSpeed:bw,onError:jw,connectionRadius:Ew,isValidConnection:Cw,selectNodesOnDrag:le,nodeDragThreshold:Pw,connectionDragThreshold:Mw,onBeforeDelete:L,debug:zw,ariaLabelConfig:Dw,zIndexMode:jf}),u.jsx(D3,{onSelectionChange:F}),nw,u.jsx(T3,{proOptions:yw,position:xw}),u.jsx(I3,{rfId:Ma,disableKeyboardA11y:Ef})]})})}var h4=u0(f4);function p4({dimensions:e,lineWidth:t,variant:n,className:r}){return u.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Pe(["react-flow__background-pattern",n,r])})}function m4({radius:e,className:t}){return u.jsx("circle",{cx:e,cy:e,r:e,className:Pe(["react-flow__background-pattern","dots",t])})}var On;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(On||(On={}));const g4={[On.Dots]:1,[On.Lines]:1,[On.Cross]:6},x4=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function R0({id:e,variant:t=On.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=0,color:i,bgColor:l,style:a,className:c,patternClassName:h}){const f=m.useRef(null),{transform:d,patternId:x}=se(x4,xe),y=r||g4[t],w=t===On.Dots,S=t===On.Cross,p=Array.isArray(n)?n:[n,n],v=[p[0]*d[2]||1,p[1]*d[2]||1],g=y*d[2],N=Array.isArray(s)?s:[s,s],k=S?[g,g]:v,b=[N[0]*d[2]||1+k[0]/2,N[1]*d[2]||1+k[1]/2],E=`${x}${e||""}`;return u.jsxs("svg",{className:Pe(["react-flow__background",c]),style:{...a,...ka,"--xy-background-color-props":l,"--xy-background-pattern-color-props":i},ref:f,"data-testid":"rf__background",children:[u.jsx("pattern",{id:E,x:d[0]%v[0],y:d[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${b[0]},-${b[1]})`,children:w?u.jsx(m4,{radius:g/2,className:h}):u.jsx(p4,{dimensions:k,lineWidth:o,variant:t,className:h})}),u.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${E})`})]})}R0.displayName="Background";const y4=m.memo(R0);function v4(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:u.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function w4(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:u.jsx("path",{d:"M0 0h32v4.2H0z"})})}function N4(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:u.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 S4(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.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 k4(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.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 Pi({children:e,className:t,...n}){return u.jsx("button",{type:"button",className:Pe(["react-flow__controls-button",t]),...n,children:e})}const b4=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function L0({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:s,onZoomOut:i,onFitView:l,onInteractiveChange:a,className:c,children:h,position:f="bottom-left",orientation:d="vertical","aria-label":x}){const y=ye(),{isInteractive:w,minZoomReached:S,maxZoomReached:p,ariaLabelConfig:v}=se(b4,xe),{zoomIn:g,zoomOut:N,fitView:k}=cf(),b=()=>{g(),s==null||s()},E=()=>{N(),i==null||i()},_=()=>{k(o),l==null||l()},I=()=>{y.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),a==null||a(!w)},D=d==="horizontal"?"horizontal":"vertical";return u.jsxs(Sa,{className:Pe(["react-flow__controls",D,c]),position:f,style:e,"data-testid":"rf__controls","aria-label":x??v["controls.ariaLabel"],children:[t&&u.jsxs(u.Fragment,{children:[u.jsx(Pi,{onClick:b,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:p,children:u.jsx(v4,{})}),u.jsx(Pi,{onClick:E,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:S,children:u.jsx(w4,{})})]}),n&&u.jsx(Pi,{className:"react-flow__controls-fitview",onClick:_,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:u.jsx(N4,{})}),r&&u.jsx(Pi,{className:"react-flow__controls-interactive",onClick:I,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:w?u.jsx(k4,{}):u.jsx(S4,{})}),h]})}L0.displayName="Controls";const E4=m.memo(L0);function C4({id:e,x:t,y:n,width:r,height:o,style:s,color:i,strokeColor:l,strokeWidth:a,className:c,borderRadius:h,shapeRendering:f,selected:d,onClick:x}){const{background:y,backgroundColor:w}=s||{},S=i||y||w;return u.jsx("rect",{className:Pe(["react-flow__minimap-node",{selected:d},c]),x:t,y:n,rx:h,ry:h,width:r,height:o,style:{fill:S,stroke:l,strokeWidth:a},shapeRendering:f,onClick:x?p=>x(p,e):void 0})}const j4=m.memo(C4),_4=e=>e.nodes.map(t=>t.id),mu=e=>e instanceof Function?e:()=>e;function P4({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:s=j4,onClick:i}){const l=se(_4,xe),a=mu(t),c=mu(e),h=mu(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return u.jsx(u.Fragment,{children:l.map(d=>u.jsx(I4,{id:d,nodeColorFunc:a,nodeStrokeColorFunc:c,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:s,onClick:i,shapeRendering:f},d))})}function M4({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:s,shapeRendering:i,NodeComponent:l,onClick:a}){const{node:c,x:h,y:f,width:d,height:x}=se(y=>{const{internals:w}=y.nodeLookup.get(e),S=w.userNode,{x:p,y:v}=w.positionAbsolute,{width:g,height:N}=gn(S);return{node:S,x:p,y:v,width:g,height:N}},xe);return!c||c.hidden||!Ry(c)?null:u.jsx(l,{x:h,y:f,width:d,height:x,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:o,strokeColor:n(c),strokeWidth:s,shapeRendering:i,onClick:a,id:c.id})}const I4=m.memo(M4);var T4=m.memo(P4);const R4=200,L4=150,A4=e=>!e.hidden,z4=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?Ty(Gs(e.nodeLookup,{filter:A4}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},D4="react-flow__minimap-desc";function A0({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:i,nodeComponent:l,bgColor:a,maskColor:c,maskStrokeColor:h,maskStrokeWidth:f,position:d="bottom-right",onClick:x,onNodeClick:y,pannable:w=!1,zoomable:S=!1,ariaLabel:p,inversePan:v,zoomStep:g=1,offsetScale:N=5}){const k=ye(),b=m.useRef(null),{boundingRect:E,viewBB:_,rfId:I,panZoom:D,translateExtent:R,flowWidth:T,flowHeight:F,ariaLabelConfig:j}=se(z4,xe),A=(e==null?void 0:e.width)??R4,M=(e==null?void 0:e.height)??L4,z=E.width/A,C=E.height/M,P=Math.max(z,C),L=P*A,O=P*M,$=N*P,U=E.x-(L-E.width)/2-$,V=E.y-(O-E.height)/2-$,Y=L+$*2,G=O+$*2,X=`${D4}-${I}`,B=m.useRef(0),Q=m.useRef();B.current=P,m.useEffect(()=>{if(b.current&&D)return Q.current=$_({domNode:b.current,panZoom:D,getTransform:()=>k.getState().transform,getViewScale:()=>B.current}),()=>{var q;(q=Q.current)==null||q.destroy()}},[D]),m.useEffect(()=>{var q;(q=Q.current)==null||q.update({translateExtent:R,width:T,height:F,inversePan:v,pannable:w,zoomStep:g,zoomable:S})},[w,S,v,g,R,T,F]);const ne=x?q=>{var le;const[ae,de]=((le=Q.current)==null?void 0:le.pointer(q))||[0,0];x(q,{x:ae,y:de})}:void 0,J=y?m.useCallback((q,ae)=>{const de=k.getState().nodeLookup.get(ae).internals.userNode;y(q,de)},[]):void 0,Z=p??j["minimap.ariaLabel"];return u.jsx(Sa,{position:d,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a: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 f=="number"?f*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:Pe(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:u.jsxs("svg",{width:A,height:M,viewBox:`${U} ${V} ${Y} ${G}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:b,onClick:ne,children:[Z&&u.jsx("title",{id:X,children:Z}),u.jsx(T4,{onClick:J,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:i,nodeComponent:l}),u.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-$},${V-$}h${Y+$*2}v${G+$*2}h${-Y-$*2}z
298
- M${_.x},${_.y}h${_.width}v${_.height}h${-_.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}A0.displayName="MiniMap";m.memo(A0);const $4=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,O4={[go.Line]:"right",[go.Handle]:"bottom-right"};function F4({nodeId:e,position:t,variant:n=go.Handle,className:r,style:o=void 0,children:s,color:i,minWidth:l=10,minHeight:a=10,maxWidth:c=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:d,autoScale:x=!0,shouldResize:y,onResizeStart:w,onResize:S,onResizeEnd:p}){const v=h0(),g=typeof e=="string"?e:v,N=ye(),k=m.useRef(null),b=n===go.Handle,E=se(m.useCallback($4(b&&x),[b,x]),xe),_=m.useRef(null),I=t??O4[n];m.useEffect(()=>{if(!(!k.current||!g))return _.current||(_.current=Z_({domNode:k.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:R,transform:T,snapGrid:F,snapToGrid:j,nodeOrigin:A,domNode:M}=N.getState();return{nodeLookup:R,transform:T,snapGrid:F,snapToGrid:j,nodeOrigin:A,paneDomNode:M}},onChange:(R,T)=>{const{triggerNodeChanges:F,nodeLookup:j,parentLookup:A,nodeOrigin:M}=N.getState(),z=[],C={x:R.x,y:R.y},P=j.get(g);if(P&&P.expandParent&&P.parentId){const L=P.origin??M,O=R.width??P.measured.width??0,$=R.height??P.measured.height??0,U={id:P.id,parentId:P.parentId,rect:{width:O,height:$,...Ly({x:R.x??P.position.x,y:R.y??P.position.y},{width:O,height:$},P.parentId,j,L)}},V=uf([U],j,A,M);z.push(...V),C.x=R.x?Math.max(L[0]*O,R.x):void 0,C.y=R.y?Math.max(L[1]*$,R.y):void 0}if(C.x!==void 0&&C.y!==void 0){const L={id:g,type:"position",position:{...C}};z.push(L)}if(R.width!==void 0&&R.height!==void 0){const O={id:g,type:"dimensions",resizing:!0,setAttributes:d?d==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};z.push(O)}for(const L of T){const O={...L,type:"position"};z.push(O)}F(z)},onEnd:({width:R,height:T})=>{const F={id:g,type:"dimensions",resizing:!1,dimensions:{width:R,height:T}};N.getState().triggerNodeChanges([F])}})),_.current.update({controlPosition:I,boundaries:{minWidth:l,minHeight:a,maxWidth:c,maxHeight:h},keepAspectRatio:f,resizeDirection:d,onResizeStart:w,onResize:S,onResizeEnd:p,shouldResize:y}),()=>{var R;(R=_.current)==null||R.destroy()}},[I,l,a,c,h,f,w,S,p,y]);const D=I.split("-");return u.jsx("div",{className:Pe(["react-flow__resize-control","nodrag",...D,n,r]),ref:k,style:{...o,scale:E,...i&&{[b?"backgroundColor":"borderColor"]:i}},children:s})}m.memo(F4);function H4(){const[e,t]=m.useState(()=>document.documentElement.classList.contains("dark"));return m.useEffect(()=>{const n=new MutationObserver(()=>t(document.documentElement.classList.contains("dark")));return n.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>n.disconnect()},[]),e}function B4(){const[e,t]=m.useState([]),[n,r]=m.useState([]),[o,s]=m.useState(!0),i=H4();m.useEffect(()=>{Promise.all([Se.discovery.agents(),Se.observations.permissions()]).then(([c,h])=>{t(c.data??[]),r(h.data??[]),s(!1)}).catch(()=>s(!1))},[]);const{nodes:l,edges:a}=m.useMemo(()=>{const c=[],h=[],f=new Set,d=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",S=i?"#27272a":"#e4e4e7";return e.forEach((p,v)=>{const g=`agent-${p.id}`;p.registeredAgentId&&d.set(p.registeredAgentId,g),d.set(p.id,g),c.push({id:g,position:{x:100,y:v*120},data:{label:`${p.emoji||"🤖"} ${p.name}`},style:{...x,borderRadius:"8px",padding:"8px 16px",fontSize:"13px"}})}),n.forEach(p=>{const v=`tool-${p.toolName}`;f.has(p.toolName)||(f.add(p.toolName),c.push({id:v,position:{x:400,y:f.size*80},data:{label:`🔧 ${p.toolName}`},style:{...y,borderRadius:"8px",padding:"6px 12px",fontSize:"12px"}}));const g=d.get(p.agentId)??`agent-${p.agentId}`;h.push({id:`e-${p.agentId}-${p.toolName}`,source:g,target:v,animated:p.accessPattern==="write",style:{stroke:p.accessPattern==="write"?"#eab308":w}})}),{nodes:c,edges:h,bgColor:S}},[e,n,i]);return o?u.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Identity Graph"}),u.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Agent-to-tool relationship visualization"})]}),u.jsx("div",{className:"h-[600px] rounded-lg border border-border bg-card",children:u.jsxs(h4,{nodes:l,edges:a,fitView:!0,proOptions:{hideAttribution:!0},children:[u.jsx(y4,{color:i?"#27272a":"#e4e4e7",gap:20}),u.jsx(E4,{})]})})]})}const ff=m.forwardRef(({className:e,...t},n)=>u.jsx("textarea",{className:je("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}));ff.displayName="Textarea";const un=m.forwardRef(({className:e,...t},n)=>u.jsx("label",{ref:n,className:je("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));un.displayName="Label";function Fe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function V4(e,t){const n=m.createContext(t);function r(s){const{children:i,...l}=s,a=m.useMemo(()=>l,Object.values(l));return u.jsx(n.Provider,{value:a,children:i})}function o(s){const i=m.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,o]}function Ea(e,t=[]){let n=[];function r(s,i){const l=m.createContext(i),a=n.length;n=[...n,i];function c(f){const{scope:d,children:x,...y}=f,w=(d==null?void 0:d[e][a])||l,S=m.useMemo(()=>y,Object.values(y));return u.jsx(w.Provider,{value:S,children:x})}function h(f,d){const x=(d==null?void 0:d[e][a])||l,y=m.useContext(x);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,h]}const o=()=>{const s=n.map(i=>m.createContext(i));return function(l){const a=(l==null?void 0:l[e])||s;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:a}}),[l,a])}};return o.scopeName=e,[r,U4(o,...t)]}function U4(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((l,{useScope:a,scopeName:c})=>{const f=a(s)[`__scope${c}`];return{...l,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function W4(e){const t=e+"CollectionProvider",[n,r]=Ea(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=x=>{const{scope:y,children:w}=x,S=$t.useRef(null),p=$t.useRef(new Map).current;return u.jsx(o,{scope:y,itemMap:p,collectionRef:S,children:w})};i.displayName=t;const l=e+"CollectionSlot",a=$t.forwardRef((x,y)=>{const{scope:w,children:S}=x,p=s(l,w),v=Xt(y,p.collectionRef);return u.jsx(ao,{ref:v,children:S})});a.displayName=l;const c=e+"CollectionItemSlot",h="data-radix-collection-item",f=$t.forwardRef((x,y)=>{const{scope:w,children:S,...p}=x,v=$t.useRef(null),g=Xt(y,v),N=s(c,w);return $t.useEffect(()=>(N.itemMap.set(v,{ref:v,...p}),()=>void N.itemMap.delete(v))),u.jsx(ao,{[h]:"",ref:g,children:S})});f.displayName=c;function d(x){const y=s(e+"CollectionConsumer",x);return $t.useCallback(()=>{const S=y.collectionRef.current;if(!S)return[];const p=Array.from(S.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((N,k)=>p.indexOf(N.ref.current)-p.indexOf(k.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:a,ItemSlot:f},d,r]}var Bl=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},Y4=o1.useId||(()=>{}),G4=0;function us(e){const[t,n]=m.useState(Y4());return Bl(()=>{n(r=>r??String(G4++))},[e]),t?`radix-${t}`:""}var X4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ze=X4.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:s,...i}=r,l=s?ao:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function K4(e,t){e&&ia.flushSync(()=>e.dispatchEvent(t))}function Wn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function hf({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Q4({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,l=Wn(n),a=m.useCallback(c=>{if(s){const f=typeof c=="function"?c(e):c;f!==e&&l(f)}else o(c)},[s,e,o,l]);return[i,a]}function Q4({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),s=Wn(t);return m.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var q4=m.createContext(void 0);function z0(e){const t=m.useContext(q4);return e||t||"ltr"}var gu="rovingFocusGroup.onEntryFocus",Z4={bubbles:!1,cancelable:!0},Ca="RovingFocusGroup",[Dc,D0,J4]=W4(Ca),[e5,$0]=Ea(Ca,[J4]),[t5,n5]=e5(Ca),O0=m.forwardRef((e,t)=>u.jsx(Dc.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(Dc.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(r5,{...e,ref:t})})}));O0.displayName=Ca;var r5=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:a,onEntryFocus:c,preventScrollOnEntryFocus:h=!1,...f}=e,d=m.useRef(null),x=Xt(t,d),y=z0(s),[w=null,S]=hf({prop:i,defaultProp:l,onChange:a}),[p,v]=m.useState(!1),g=Wn(c),N=D0(n),k=m.useRef(!1),[b,E]=m.useState(0);return m.useEffect(()=>{const _=d.current;if(_)return _.addEventListener(gu,g),()=>_.removeEventListener(gu,g)},[g]),u.jsx(t5,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:w,onItemFocus:m.useCallback(_=>S(_),[S]),onItemShiftTab:m.useCallback(()=>v(!0),[]),onFocusableItemAdd:m.useCallback(()=>E(_=>_+1),[]),onFocusableItemRemove:m.useCallback(()=>E(_=>_-1),[]),children:u.jsx(Ze.div,{tabIndex:p||b===0?-1:0,"data-orientation":r,...f,ref:x,style:{outline:"none",...e.style},onMouseDown:Fe(e.onMouseDown,()=>{k.current=!0}),onFocus:Fe(e.onFocus,_=>{const I=!k.current;if(_.target===_.currentTarget&&I&&!p){const D=new CustomEvent(gu,Z4);if(_.currentTarget.dispatchEvent(D),!D.defaultPrevented){const R=N().filter(M=>M.focusable),T=R.find(M=>M.active),F=R.find(M=>M.id===w),A=[T,F,...R].filter(Boolean).map(M=>M.ref.current);B0(A,h)}}k.current=!1}),onBlur:Fe(e.onBlur,()=>v(!1))})})}),F0="RovingFocusGroupItem",H0=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,l=us(),a=s||l,c=n5(F0,n),h=c.currentTabStopId===a,f=D0(n),{onFocusableItemAdd:d,onFocusableItemRemove:x}=c;return m.useEffect(()=>{if(r)return d(),()=>x()},[r,d,x]),u.jsx(Dc.ItemSlot,{scope:n,id:a,focusable:r,active:o,children:u.jsx(Ze.span,{tabIndex:h?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:Fe(e.onMouseDown,y=>{r?c.onItemFocus(a):y.preventDefault()}),onFocus:Fe(e.onFocus,()=>c.onItemFocus(a)),onKeyDown:Fe(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const w=i5(y,c.orientation,c.dir);if(w!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let p=f().filter(v=>v.focusable).map(v=>v.ref.current);if(w==="last")p.reverse();else if(w==="prev"||w==="next"){w==="prev"&&p.reverse();const v=p.indexOf(y.currentTarget);p=c.loop?l5(p,v+1):p.slice(v+1)}setTimeout(()=>B0(p))}})})})});H0.displayName=F0;var o5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function s5(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function i5(e,t,n){const r=s5(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return o5[r]}function B0(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function l5(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var a5=O0,u5=H0;function c5(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Qs=e=>{const{present:t,children:n}=e,r=d5(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),s=Xt(r.ref,f5(o));return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:s}):null};Qs.displayName="Presence";function d5(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),s=m.useRef("none"),i=e?"mounted":"unmounted",[l,a]=c5(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Mi(r.current);s.current=l==="mounted"?c:"none"},[l]),Bl(()=>{const c=r.current,h=o.current;if(h!==e){const d=s.current,x=Mi(c);e?a("MOUNT"):x==="none"||(c==null?void 0:c.display)==="none"?a("UNMOUNT"):a(h&&d!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,a]),Bl(()=>{if(t){const c=f=>{const x=Mi(r.current).includes(f.animationName);f.target===t&&x&&ia.flushSync(()=>a("ANIMATION_END"))},h=f=>{f.target===t&&(s.current=Mi(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 a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Mi(e){return(e==null?void 0:e.animationName)||"none"}function f5(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pf="Tabs",[h5]=Ea(pf,[$0]),V0=$0(),[p5,mf]=h5(pf),U0=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:l,activationMode:a="automatic",...c}=e,h=z0(l),[f,d]=hf({prop:r,onChange:o,defaultProp:s});return u.jsx(p5,{scope:n,baseId:us(),value:f,onValueChange:d,orientation:i,dir:h,activationMode:a,children:u.jsx(Ze.div,{dir:h,"data-orientation":i,...c,ref:t})})});U0.displayName=pf;var W0="TabsList",Y0=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=mf(W0,n),i=V0(n);return u.jsx(a5,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:u.jsx(Ze.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Y0.displayName=W0;var G0="TabsTrigger",X0=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=mf(G0,n),l=V0(n),a=q0(i.baseId,r),c=Z0(i.baseId,r),h=r===i.value;return u.jsx(u5,{asChild:!0,...l,focusable:!o,active:h,children:u.jsx(Ze.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":c,"data-state":h?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:a,...s,ref:t,onMouseDown:Fe(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?i.onValueChange(r):f.preventDefault()}),onKeyDown:Fe(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(r)}),onFocus:Fe(e.onFocus,()=>{const f=i.activationMode!=="manual";!h&&!o&&f&&i.onValueChange(r)})})})});X0.displayName=G0;var K0="TabsContent",Q0=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,l=mf(K0,n),a=q0(l.baseId,r),c=Z0(l.baseId,r),h=r===l.value,f=m.useRef(h);return m.useEffect(()=>{const d=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(d)},[]),u.jsx(Qs,{present:o||h,children:({present:d})=>u.jsx(Ze.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":a,hidden:!d,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:d&&s})})});Q0.displayName=K0;function q0(e,t){return`${e}-trigger-${t}`}function Z0(e,t){return`${e}-content-${t}`}var m5=U0,J0=Y0,ev=X0,tv=Q0;const nv=m5,gf=m.forwardRef(({className:e,...t},n)=>u.jsx(J0,{ref:n,className:je("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));gf.displayName=J0.displayName;const Qr=m.forwardRef(({className:e,...t},n)=>u.jsx(ev,{ref:n,className:je("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}));Qr.displayName=ev.displayName;const qr=m.forwardRef(({className:e,...t},n)=>u.jsx(tv,{ref:n,className:je("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));qr.displayName=tv.displayName;function g5(e,t=globalThis==null?void 0:globalThis.document){const n=Wn(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var x5="DismissableLayer",$c="dismissableLayer.update",y5="dismissableLayer.pointerDownOutside",v5="dismissableLayer.focusOutside",Kp,rv=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ov=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:l,...a}=e,c=m.useContext(rv),[h,f]=m.useState(null),d=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=m.useState({}),y=Xt(t,E=>f(E)),w=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),p=w.indexOf(S),v=h?w.indexOf(h):-1,g=c.layersWithOutsidePointerEventsDisabled.size>0,N=v>=p,k=S5(E=>{const _=E.target,I=[...c.branches].some(D=>D.contains(_));!N||I||(o==null||o(E),i==null||i(E),E.defaultPrevented||l==null||l())},d),b=k5(E=>{const _=E.target;[...c.branches].some(D=>D.contains(_))||(s==null||s(E),i==null||i(E),E.defaultPrevented||l==null||l())},d);return g5(E=>{v===c.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&l&&(E.preventDefault(),l()))},d),m.useEffect(()=>{if(h)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Kp=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),Qp(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=Kp)}},[h,d,n,c]),m.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),Qp())},[h,c]),m.useEffect(()=>{const E=()=>x({});return document.addEventListener($c,E),()=>document.removeEventListener($c,E)},[]),u.jsx(Ze.div,{...a,ref:y,style:{pointerEvents:g?N?"auto":"none":void 0,...e.style},onFocusCapture:Fe(e.onFocusCapture,b.onFocusCapture),onBlurCapture:Fe(e.onBlurCapture,b.onBlurCapture),onPointerDownCapture:Fe(e.onPointerDownCapture,k.onPointerDownCapture)})});ov.displayName=x5;var w5="DismissableLayerBranch",N5=m.forwardRef((e,t)=>{const n=m.useContext(rv),r=m.useRef(null),o=Xt(t,r);return m.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),u.jsx(Ze.div,{...e,ref:o})});N5.displayName=w5;function S5(e,t=globalThis==null?void 0:globalThis.document){const n=Wn(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const s=l=>{if(l.target&&!r.current){let a=function(){sv(y5,n,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=a,t.addEventListener("click",o.current,{once:!0})):a()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function k5(e,t=globalThis==null?void 0:globalThis.document){const n=Wn(e),r=m.useRef(!1);return m.useEffect(()=>{const o=s=>{s.target&&!r.current&&sv(v5,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Qp(){const e=new CustomEvent($c);document.dispatchEvent(e)}function sv(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?K4(o,s):o.dispatchEvent(s)}var xu="focusScope.autoFocusOnMount",yu="focusScope.autoFocusOnUnmount",qp={bubbles:!1,cancelable:!0},b5="FocusScope",iv=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[l,a]=m.useState(null),c=Wn(o),h=Wn(s),f=m.useRef(null),d=Xt(t,w=>a(w)),x=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let w=function(g){if(x.paused||!l)return;const N=g.target;l.contains(N)?f.current=N:kn(f.current,{select:!0})},S=function(g){if(x.paused||!l)return;const N=g.relatedTarget;N!==null&&(l.contains(N)||kn(f.current,{select:!0}))},p=function(g){if(document.activeElement===document.body)for(const k of g)k.removedNodes.length>0&&kn(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",S);const v=new MutationObserver(p);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",S),v.disconnect()}}},[r,l,x.paused]),m.useEffect(()=>{if(l){Jp.add(x);const w=document.activeElement;if(!l.contains(w)){const p=new CustomEvent(xu,qp);l.addEventListener(xu,c),l.dispatchEvent(p),p.defaultPrevented||(E5(M5(lv(l)),{select:!0}),document.activeElement===w&&kn(l))}return()=>{l.removeEventListener(xu,c),setTimeout(()=>{const p=new CustomEvent(yu,qp);l.addEventListener(yu,h),l.dispatchEvent(p),p.defaultPrevented||kn(w??document.body,{select:!0}),l.removeEventListener(yu,h),Jp.remove(x)},0)}}},[l,c,h,x]);const y=m.useCallback(w=>{if(!n&&!r||x.paused)return;const S=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,p=document.activeElement;if(S&&p){const v=w.currentTarget,[g,N]=C5(v);g&&N?!w.shiftKey&&p===N?(w.preventDefault(),n&&kn(g,{select:!0})):w.shiftKey&&p===g&&(w.preventDefault(),n&&kn(N,{select:!0})):p===v&&w.preventDefault()}},[n,r,x.paused]);return u.jsx(Ze.div,{tabIndex:-1,...i,ref:d,onKeyDown:y})});iv.displayName=b5;function E5(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(kn(r,{select:t}),document.activeElement!==n)return}function C5(e){const t=lv(e),n=Zp(t,e),r=Zp(t.reverse(),e);return[n,r]}function lv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Zp(e,t){for(const n of e)if(!j5(n,{upTo:t}))return n}function j5(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 _5(e){return e instanceof HTMLInputElement&&"select"in e}function kn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&_5(e)&&t&&e.select()}}var Jp=P5();function P5(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=em(e,t),e.unshift(t)},remove(t){var n;e=em(e,t),(n=e[0])==null||n.resume()}}}function em(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function M5(e){return e.filter(t=>t.tagName!=="A")}var I5="Portal",av=m.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[o,s]=m.useState(!1);Bl(()=>s(!0),[]);const i=n||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return i?mN.createPortal(u.jsx(Ze.div,{...r,ref:t}),i):null});av.displayName=I5;var vu=0;function T5(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??tm()),document.body.insertAdjacentElement("beforeend",e[1]??tm()),vu++,()=>{vu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),vu--}},[])}function tm(){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 Ht=function(){return Ht=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Ht.apply(this,arguments)};function uv(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function R5(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var nl="right-scroll-bar-position",rl="width-before-scroll-bar",L5="with-scroll-bars-hidden",A5="--removed-body-scroll-bar-size";function wu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function z5(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var D5=typeof window<"u"?m.useLayoutEffect:m.useEffect,nm=new WeakMap;function $5(e,t){var n=z5(null,function(r){return e.forEach(function(o){return wu(o,r)})});return D5(function(){var r=nm.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(l){s.has(l)||wu(l,null)}),s.forEach(function(l){o.has(l)||wu(l,i)})}nm.set(n,e)},[e]),n}function O5(e){return e}function F5(e,t){t===void 0&&(t=O5);var n=[],r=!1,o={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(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(s),i=n}var a=function(){var h=i;i=[],h.forEach(s)},c=function(){return Promise.resolve().then(a)};c(),n={push:function(h){i.push(h),c()},filter:function(h){return i=i.filter(h),n}}}};return o}function H5(e){e===void 0&&(e={});var t=F5(null);return t.options=Ht({async:!0,ssr:!1},e),t}var cv=function(e){var t=e.sideCar,n=uv(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,Ht({},n))};cv.isSideCarExport=!0;function B5(e,t){return e.useMedium(t),cv}var dv=H5(),Nu=function(){},ja=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Nu,onWheelCapture:Nu,onTouchMoveCapture:Nu}),o=r[0],s=r[1],i=e.forwardProps,l=e.children,a=e.className,c=e.removeScrollBar,h=e.enabled,f=e.shards,d=e.sideCar,x=e.noIsolation,y=e.inert,w=e.allowPinchZoom,S=e.as,p=S===void 0?"div":S,v=e.gapMode,g=uv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=d,k=$5([n,t]),b=Ht(Ht({},g),o);return m.createElement(m.Fragment,null,h&&m.createElement(N,{sideCar:dv,removeScrollBar:c,shards:f,noIsolation:x,inert:y,setCallbacks:s,allowPinchZoom:!!w,lockRef:n,gapMode:v}),i?m.cloneElement(m.Children.only(l),Ht(Ht({},b),{ref:k})):m.createElement(p,Ht({},b,{className:a,ref:k}),l))});ja.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ja.classNames={fullWidth:rl,zeroRight:nl};var V5=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function U5(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=V5();return t&&e.setAttribute("nonce",t),e}function W5(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Y5(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var G5=function(){var e=0,t=null;return{add:function(n){e==0&&(t=U5())&&(W5(t,n),Y5(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},X5=function(){var e=G5();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},fv=function(){var e=X5(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},K5={left:0,top:0,right:0,gap:0},Su=function(e){return parseInt(e||"",10)||0},Q5=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Su(n),Su(r),Su(o)]},q5=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return K5;var t=Q5(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])}},Z5=fv(),Zr="data-scroll-locked",J5=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),`
299
- .`.concat(L5,` {
300
- overflow: hidden `).concat(r,`;
301
- padding-right: `).concat(l,"px ").concat(r,`;
302
- }
303
- body[`).concat(Zr,`] {
304
- overflow: hidden `).concat(r,`;
305
- overscroll-behavior: contain;
306
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
307
- padding-left: `.concat(o,`px;
308
- padding-top: `).concat(s,`px;
309
- padding-right: `).concat(i,`px;
310
- margin-left:0;
311
- margin-top:0;
312
- margin-right: `).concat(l,"px ").concat(r,`;
313
- `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
314
- }
315
-
316
- .`).concat(nl,` {
317
- right: `).concat(l,"px ").concat(r,`;
318
- }
319
-
320
- .`).concat(rl,` {
321
- margin-right: `).concat(l,"px ").concat(r,`;
322
- }
323
-
324
- .`).concat(nl," .").concat(nl,` {
325
- right: 0 `).concat(r,`;
326
- }
327
-
328
- .`).concat(rl," .").concat(rl,` {
329
- margin-right: 0 `).concat(r,`;
330
- }
331
-
332
- body[`).concat(Zr,`] {
333
- `).concat(A5,": ").concat(l,`px;
334
- }
335
- `)},rm=function(){var e=parseInt(document.body.getAttribute(Zr)||"0",10);return isFinite(e)?e:0},eM=function(){m.useEffect(function(){return document.body.setAttribute(Zr,(rm()+1).toString()),function(){var e=rm()-1;e<=0?document.body.removeAttribute(Zr):document.body.setAttribute(Zr,e.toString())}},[])},tM=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;eM();var s=m.useMemo(function(){return q5(o)},[o]);return m.createElement(Z5,{styles:J5(s,!t,o,n?"":"!important")})},Oc=!1;if(typeof window<"u")try{var Ii=Object.defineProperty({},"passive",{get:function(){return Oc=!0,!0}});window.addEventListener("test",Ii,Ii),window.removeEventListener("test",Ii,Ii)}catch{Oc=!1}var Er=Oc?{passive:!1}:!1,nM=function(e){return e.tagName==="TEXTAREA"},hv=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!nM(e)&&n[t]==="visible")},rM=function(e){return hv(e,"overflowY")},oM=function(e){return hv(e,"overflowX")},om=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=pv(e,r);if(o){var s=mv(e,r),i=s[1],l=s[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},sM=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},iM=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},pv=function(e,t){return e==="v"?rM(t):oM(t)},mv=function(e,t){return e==="v"?sM(t):iM(t)},lM=function(e,t){return e==="h"&&t==="rtl"?-1:1},aM=function(e,t,n,r,o){var s=lM(e,window.getComputedStyle(t).direction),i=s*r,l=n.target,a=t.contains(l),c=!1,h=i>0,f=0,d=0;do{var x=mv(e,l),y=x[0],w=x[1],S=x[2],p=w-S-s*y;(y||p)&&pv(e,l)&&(f+=p,d+=y),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!a&&l!==document.body||a&&(t.contains(l)||t===l));return(h&&Math.abs(f)<1||!h&&Math.abs(d)<1)&&(c=!0),c},Ti=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sm=function(e){return[e.deltaX,e.deltaY]},im=function(e){return e&&"current"in e?e.current:e},uM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cM=function(e){return`
336
- .block-interactivity-`.concat(e,` {pointer-events: none;}
337
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
338
- `)},dM=0,Cr=[];function fM(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(dM++)[0],s=m.useState(fv)[0],i=m.useRef(e);m.useEffect(function(){i.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=R5([e.lockRef.current],(e.shards||[]).map(im),!0).filter(Boolean);return w.forEach(function(S){return S.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(w,S){if("touches"in w&&w.touches.length===2)return!i.current.allowPinchZoom;var p=Ti(w),v=n.current,g="deltaX"in w?w.deltaX:v[0]-p[0],N="deltaY"in w?w.deltaY:v[1]-p[1],k,b=w.target,E=Math.abs(g)>Math.abs(N)?"h":"v";if("touches"in w&&E==="h"&&b.type==="range")return!1;var _=om(E,b);if(!_)return!0;if(_?k=E:(k=E==="v"?"h":"v",_=om(E,b)),!_)return!1;if(!r.current&&"changedTouches"in w&&(g||N)&&(r.current=k),!k)return!0;var I=r.current||k;return aM(I,S,w,I==="h"?g:N)},[]),a=m.useCallback(function(w){var S=w;if(!(!Cr.length||Cr[Cr.length-1]!==s)){var p="deltaY"in S?sm(S):Ti(S),v=t.current.filter(function(k){return k.name===S.type&&(k.target===S.target||S.target===k.shadowParent)&&uM(k.delta,p)})[0];if(v&&v.should){S.cancelable&&S.preventDefault();return}if(!v){var g=(i.current.shards||[]).map(im).filter(Boolean).filter(function(k){return k.contains(S.target)}),N=g.length>0?l(S,g[0]):!i.current.noIsolation;N&&S.cancelable&&S.preventDefault()}}},[]),c=m.useCallback(function(w,S,p,v){var g={name:w,delta:S,target:p,should:v,shadowParent:hM(p)};t.current.push(g),setTimeout(function(){t.current=t.current.filter(function(N){return N!==g})},1)},[]),h=m.useCallback(function(w){n.current=Ti(w),r.current=void 0},[]),f=m.useCallback(function(w){c(w.type,sm(w),w.target,l(w,e.lockRef.current))},[]),d=m.useCallback(function(w){c(w.type,Ti(w),w.target,l(w,e.lockRef.current))},[]);m.useEffect(function(){return Cr.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",a,Er),document.addEventListener("touchmove",a,Er),document.addEventListener("touchstart",h,Er),function(){Cr=Cr.filter(function(w){return w!==s}),document.removeEventListener("wheel",a,Er),document.removeEventListener("touchmove",a,Er),document.removeEventListener("touchstart",h,Er)}},[]);var x=e.removeScrollBar,y=e.inert;return m.createElement(m.Fragment,null,y?m.createElement(s,{styles:cM(o)}):null,x?m.createElement(tM,{gapMode:e.gapMode}):null)}function hM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const pM=B5(dv,fM);var gv=m.forwardRef(function(e,t){return m.createElement(ja,Ht({},e,{ref:t,sideCar:pM}))});gv.classNames=ja.classNames;var mM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},jr=new WeakMap,Ri=new WeakMap,Li={},ku=0,xv=function(e){return e&&(e.host||xv(e.parentNode))},gM=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=xv(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})},xM=function(e,t,n,r){var o=gM(t,Array.isArray(e)?e:[e]);Li[n]||(Li[n]=new WeakMap);var s=Li[n],i=[],l=new Set,a=new Set(o),c=function(f){!f||l.has(f)||(l.add(f),c(f.parentNode))};o.forEach(c);var h=function(f){!f||a.has(f)||Array.prototype.forEach.call(f.children,function(d){if(l.has(d))h(d);else try{var x=d.getAttribute(r),y=x!==null&&x!=="false",w=(jr.get(d)||0)+1,S=(s.get(d)||0)+1;jr.set(d,w),s.set(d,S),i.push(d),w===1&&y&&Ri.set(d,!0),S===1&&d.setAttribute(n,"true"),y||d.setAttribute(r,"true")}catch(p){console.error("aria-hidden: cannot operate on ",d,p)}})};return h(t),l.clear(),ku++,function(){i.forEach(function(f){var d=jr.get(f)-1,x=s.get(f)-1;jr.set(f,d),s.set(f,x),d||(Ri.has(f)||f.removeAttribute(r),Ri.delete(f)),x||f.removeAttribute(n)}),ku--,ku||(jr=new WeakMap,jr=new WeakMap,Ri=new WeakMap,Li={})}},yM=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=mM(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),xM(r,o,n,"aria-hidden")):function(){return null}},xf="Dialog",[yv]=Ea(xf),[vM,At]=yv(xf),vv=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,l=m.useRef(null),a=m.useRef(null),[c=!1,h]=hf({prop:r,defaultProp:o,onChange:s});return u.jsx(vM,{scope:t,triggerRef:l,contentRef:a,contentId:us(),titleId:us(),descriptionId:us(),open:c,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(f=>!f),[h]),modal:i,children:n})};vv.displayName=xf;var wv="DialogTrigger",wM=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=At(wv,n),s=Xt(t,o.triggerRef);return u.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":wf(o.open),...r,ref:s,onClick:Fe(e.onClick,o.onOpenToggle)})});wM.displayName=wv;var yf="DialogPortal",[NM,Nv]=yv(yf,{forceMount:void 0}),Sv=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=At(yf,t);return u.jsx(NM,{scope:t,forceMount:n,children:m.Children.map(r,i=>u.jsx(Qs,{present:n||s.open,children:u.jsx(av,{asChild:!0,container:o,children:i})}))})};Sv.displayName=yf;var Vl="DialogOverlay",kv=m.forwardRef((e,t)=>{const n=Nv(Vl,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=At(Vl,e.__scopeDialog);return s.modal?u.jsx(Qs,{present:r||s.open,children:u.jsx(SM,{...o,ref:t})}):null});kv.displayName=Vl;var SM=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=At(Vl,n);return u.jsx(gv,{as:ao,allowPinchZoom:!0,shards:[o.contentRef],children:u.jsx(Ze.div,{"data-state":wf(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),vr="DialogContent",bv=m.forwardRef((e,t)=>{const n=Nv(vr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=At(vr,e.__scopeDialog);return u.jsx(Qs,{present:r||s.open,children:s.modal?u.jsx(kM,{...o,ref:t}):u.jsx(bM,{...o,ref:t})})});bv.displayName=vr;var kM=m.forwardRef((e,t)=>{const n=At(vr,e.__scopeDialog),r=m.useRef(null),o=Xt(t,n.contentRef,r);return m.useEffect(()=>{const s=r.current;if(s)return yM(s)},[]),u.jsx(Ev,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Fe(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Fe(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&s.preventDefault()}),onFocusOutside:Fe(e.onFocusOutside,s=>s.preventDefault())})}),bM=m.forwardRef((e,t)=>{const n=At(vr,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return u.jsx(Ev,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var a,c;(a=e.onInteractOutside)==null||a.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Ev=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,l=At(vr,n),a=m.useRef(null),c=Xt(t,a);return T5(),u.jsxs(u.Fragment,{children:[u.jsx(iv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:u.jsx(ov,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":wf(l.open),...i,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(EM,{titleId:l.titleId}),u.jsx(jM,{contentRef:a,descriptionId:l.descriptionId})]})]})}),vf="DialogTitle",Cv=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=At(vf,n);return u.jsx(Ze.h2,{id:o.titleId,...r,ref:t})});Cv.displayName=vf;var jv="DialogDescription",_v=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=At(jv,n);return u.jsx(Ze.p,{id:o.descriptionId,...r,ref:t})});_v.displayName=jv;var Pv="DialogClose",Mv=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=At(Pv,n);return u.jsx(Ze.button,{type:"button",...r,ref:t,onClick:Fe(e.onClick,()=>o.onOpenChange(!1))})});Mv.displayName=Pv;function wf(e){return e?"open":"closed"}var Iv="DialogTitleWarning",[rI,Tv]=V4(Iv,{contentName:vr,titleName:vf,docsSlug:"dialog"}),EM=({titleId:e})=>{const t=Tv(Iv),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
339
-
340
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
341
-
342
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},CM="DialogDescriptionWarning",jM=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Tv(CM).contentName}}.`;return m.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},_M=vv,PM=Sv,Rv=kv,Lv=bv,Av=Cv,zv=_v,MM=Mv;const qs=_M,IM=PM,Dv=m.forwardRef(({className:e,...t},n)=>u.jsx(Rv,{ref:n,className:je("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}));Dv.displayName=Rv.displayName;const Eo=m.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(IM,{children:[u.jsx(Dv,{}),u.jsxs(Lv,{ref:r,className:je("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,u.jsxs(MM,{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:[u.jsx(Kk,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Eo.displayName=Lv.displayName;const Zs=({className:e,...t})=>u.jsx("div",{className:je("flex flex-col space-y-1.5 text-center sm:text-left",e),...t}),Js=({className:e,...t})=>u.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t}),Co=m.forwardRef(({className:e,...t},n)=>u.jsx(Av,{ref:n,className:je("text-lg font-semibold leading-none tracking-tight",e),...t}));Co.displayName=Av.displayName;const jo=m.forwardRef(({className:e,...t},n)=>u.jsx(zv,{ref:n,className:je("text-sm text-muted-foreground",e),...t}));jo.displayName=zv.displayName;function TM({message:e,type:t,onClose:n}){return m.useEffect(()=>{const r=setTimeout(n,4e3);return()=>clearTimeout(r)},[n]),u.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"?u.jsx(lo,{className:"h-4 w-4"}):u.jsx(Wt,{className:"h-4 w-4"}),u.jsx("span",{className:"text-sm",children:e}),u.jsx("button",{onClick:n,className:"ml-2 text-current/50 hover:text-current",children:"×"})]})}function RM(){const[e,t]=m.useState([]),[n,r]=m.useState(""),[o,s]=m.useState(!0),[i,l]=m.useState("skills"),[a,c]=m.useState(null),h=m.useRef(null),f=m.useCallback((y,w="success")=>{c({message:y,type:w})},[]),d=m.useCallback(()=>{f("Command sent to agent"),l("commands"),setTimeout(()=>{var y;return(y=h.current)==null?void 0:y.call(h)},300)},[f]),x=m.useCallback(y=>{const w=y instanceof Error?y.message:"Failed to send command";f(w,"error")},[f]);return m.useEffect(()=>{Se.discovery.agents().then(y=>{const w=y.data??[];t(w),w.length>0&&!n&&r(w[0].registeredAgentId??w[0].id)}).catch(()=>{}).finally(()=>s(!1))},[]),o?u.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading agents..."}):e.length===0?u.jsxs("div",{className:"space-y-6",children:[u.jsx("h1",{className:"text-lg font-semibold",children:"Operations"}),u.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[u.jsx(ca,{className:"h-10 w-10 text-muted-foreground/30"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents discovered yet"}),u.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Connect an agent with the Guards plugin to get started"})]})]}):u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h1",{className:"text-lg font-semibold",children:"Operations"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-xs text-muted-foreground",children:"Agent:"}),u.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=>u.jsxs("option",{value:y.registeredAgentId??y.id,children:[y.emoji?`${y.emoji} `:"",y.name]},y.registeredAgentId??y.id))})]})]}),n&&u.jsxs(nv,{value:i,onValueChange:l,className:"w-full",children:[u.jsxs(gf,{children:[u.jsxs(Qr,{value:"skills",children:[u.jsx(ir,{className:"mr-1.5 h-3.5 w-3.5"})," Skills"]}),u.jsxs(Qr,{value:"commands",children:[u.jsx(Pl,{className:"mr-1.5 h-3.5 w-3.5"})," Commands"]}),u.jsxs(Qr,{value:"config",children:[u.jsx(Un,{className:"mr-1.5 h-3.5 w-3.5"})," Config"]})]}),u.jsx(qr,{value:"skills",children:u.jsx(LM,{agentId:n,agents:e,onCommandSent:d,onCommandError:x})}),u.jsx(qr,{value:"commands",children:u.jsx(AM,{agentId:n,refreshRef:h})}),u.jsx(qr,{value:"config",children:u.jsx(zM,{agentId:n,onCommandSent:d,onCommandError:x})})]}),a&&u.jsx(TM,{message:a.message,type:a.type,onClose:()=>c(null)})]})}function LM({agentId:e,agents:t,onCommandSent:n,onCommandError:r}){const o=t.find(h=>(h.registeredAgentId??h.id)===e),s=(o==null?void 0:o.skills)??[],[i,l]=m.useState(!1),[a,c]=m.useState(null);return u.jsxs("div",{className:"space-y-4 pt-4",children:[u.jsx("div",{className:"flex gap-2",children:u.jsxs(oe,{size:"sm",onClick:()=>l(!0),children:[u.jsx(Vn,{className:"mr-1.5 h-3.5 w-3.5"})," Install Skill"]})}),u.jsxs(Te,{children:[u.jsx(De,{children:u.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[u.jsx(ir,{className:"h-4 w-4"})," Installed Skills (",s.length,")"]})}),u.jsx(Re,{children:s.length===0?u.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[u.jsx(ir,{className:"h-10 w-10 text-muted-foreground/20"}),u.jsxs("div",{className:"text-center",children:[u.jsx("p",{className:"text-sm text-muted-foreground",children:"No skills installed"}),u.jsxs("p",{className:"mt-1 text-xs text-muted-foreground/70",children:["Install skills from ",u.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"ClawHub"})," or provide custom skill content"]})]}),u.jsx(oe,{size:"sm",variant:"outline",onClick:()=>l(!0),children:"Install your first skill"})]}):u.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:s.map(h=>u.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border p-3 transition-colors hover:bg-muted/30",children:[u.jsxs("div",{className:"flex items-center gap-2.5",children:[u.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-muted",children:u.jsx(ir,{className:"h-4 w-4 text-muted-foreground"})}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium",children:h.name}),h.description&&u.jsx("p",{className:"text-[11px] text-muted-foreground line-clamp-1",children:h.description})]})]}),u.jsx(oe,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>c(h.name),children:u.jsx(Gt,{className:"h-3.5 w-3.5"})})]},h.name))})})]}),u.jsxs(Te,{children:[u.jsx(De,{children:u.jsx($e,{className:"text-sm",children:"How Skills Work"})}),u.jsxs(Re,{className:"text-xs text-muted-foreground space-y-2",children:[u.jsxs("p",{children:["Skills are ",u.jsx("a",{href:"https://agentskills.io",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"AgentSkills"}),"-compatible folders containing a ",u.jsx("code",{className:"rounded bg-muted px-1",children:"SKILL.md"})," with YAML frontmatter and instructions."]}),u.jsx("p",{children:"Skills are loaded from three locations (highest to lowest precedence):"}),u.jsxs("ol",{className:"list-inside list-decimal space-y-0.5 pl-2",children:[u.jsxs("li",{children:[u.jsx("code",{className:"rounded bg-muted px-1",children:"<workspace>/skills"})," — per-agent workspace skills"]}),u.jsxs("li",{children:[u.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/workspace/skills"})," — shared managed skills"]}),u.jsx("li",{children:"Bundled skills — shipped with the OpenClaw install"})]}),u.jsxs("p",{children:["Browse and discover skills at ",u.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"clawhub.com"}),". Registry installs use ",u.jsx("code",{className:"rounded bg-muted px-1",children:"clawhub install <slug>"}),"."]})]})]}),u.jsx(DM,{open:i,onOpenChange:l,agentId:e,onSuccess:n,onError:r}),u.jsx($M,{open:a!==null,onOpenChange:h=>{h||c(null)},agentId:e,initialName:a??"",onSuccess:n,onError:r})]})}function AM({agentId:e,refreshRef:t}){const[n,r]=m.useState([]),[o,s]=m.useState(!0),[i,l]=m.useState(null),a=m.useCallback(()=>{Se.commands.list(e).then(d=>r(d.data??[])).catch(()=>{}).finally(()=>s(!1))},[e]);m.useEffect(()=>(t&&(t.current=a),()=>{t&&(t.current=null)}),[a,t]),m.useEffect(()=>{a()},[a]),m.useEffect(()=>{if(!n.some(y=>y.status==="pending"||y.status==="running"))return;const x=setInterval(a,5e3);return()=>clearInterval(x)},[n,a]);const c=d=>d==="completed"?u.jsx(lo,{className:"h-3.5 w-3.5 text-emerald-500"}):d==="failed"?u.jsx(Wt,{className:"h-3.5 w-3.5 text-destructive"}):d==="running"?u.jsx(Yt,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):u.jsx(Hx,{className:"h-3.5 w-3.5 text-muted-foreground"}),h=d=>d==="completed"?"success":d==="failed"?"destructive":d==="running"?"warning":"secondary",f=d=>({install_skill:{icon:u.jsx(Vn,{className:"h-3 w-3"}),label:"Install Skill"},install_custom_skill:{icon:u.jsx(da,{className:"h-3 w-3"}),label:"Custom Skill"},uninstall_skill:{icon:u.jsx(Gt,{className:"h-3 w-3"}),label:"Uninstall Skill"},install_plugin:{icon:u.jsx(Vn,{className:"h-3 w-3"}),label:"Install Plugin"},uninstall_plugin:{icon:u.jsx(Gt,{className:"h-3 w-3"}),label:"Uninstall Plugin"},update_config:{icon:u.jsx(Un,{className:"h-3 w-3"}),label:"Update Config"}})[d]??{icon:u.jsx(Pl,{className:"h-3 w-3"}),label:d};return o?u.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):u.jsxs("div",{className:"space-y-4 pt-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("p",{className:"text-sm text-muted-foreground",children:"Command history for this agent"}),u.jsxs(oe,{size:"sm",variant:"ghost",onClick:a,children:[u.jsx(pr,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]}),n.length===0?u.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[u.jsx(Pl,{className:"h-8 w-8 text-muted-foreground/30"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"No commands sent yet"})]}):u.jsx("div",{className:"space-y-2",children:n.map(d=>{var S,p,v;const x=f(d.type),y=i===d.id,w=d.result||d.type==="install_custom_skill"&&((S=d.payload)==null?void 0:S.content);return u.jsxs("div",{className:"rounded-lg border border-border transition-colors hover:bg-muted/20",children:[u.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-4 py-3",onClick:()=>w&&l(y?null:d.id),children:[c(d.status),u.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[x.icon," ",u.jsx("span",{children:x.label})]}),u.jsxs("span",{className:"text-xs text-muted-foreground",children:[((p=d.payload)==null?void 0:p.skillName)&&`"${d.payload.skillName}"`,d.type==="update_config"&&d.payload&&!d.payload.skillName&&Object.keys(d.payload).join(", ")]}),u.jsx("div",{className:"flex-1"}),u.jsx(Ce,{variant:h(d.status),className:"text-[10px]",children:d.status}),u.jsx("span",{className:"text-[11px] text-muted-foreground",children:FM(d.createdAt)}),w&&(y?u.jsx(Ud,{className:"h-3.5 w-3.5 text-muted-foreground"}):u.jsx(Wd,{className:"h-3.5 w-3.5 text-muted-foreground"}))]}),y&&w&&u.jsxs("div",{className:"border-t border-border bg-muted/30 px-4 py-3 text-xs",children:[d.result&&u.jsxs("div",{className:"space-y-1",children:[u.jsx("p",{className:"font-medium text-muted-foreground",children:"Result"}),u.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 d.result=="string"?d.result:JSON.stringify(d.result,null,2)})]}),d.type==="install_custom_skill"&&((v=d.payload)==null?void 0:v.content)&&u.jsxs("div",{className:"mt-2 space-y-1",children:[u.jsx("p",{className:"font-medium text-muted-foreground",children:"Skill Content"}),u.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:d.payload.content})]})]})]},d.id)})})]})}function zM({agentId:e,onCommandSent:t,onCommandError:n}){const[r,o]=m.useState(!1);return u.jsxs("div",{className:"space-y-4 pt-4",children:[u.jsxs(Te,{children:[u.jsx(De,{children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[u.jsx(Un,{className:"h-4 w-4"})," Guards Configuration"]}),u.jsxs(oe,{size:"sm",variant:"outline",onClick:()=>o(!0),children:[u.jsx(Un,{className:"mr-1.5 h-3.5 w-3.5"})," Update Config"]})]})}),u.jsxs(Re,{className:"text-xs text-muted-foreground space-y-3",children:[u.jsxs("p",{children:["Send configuration updates to the Guards plugin running on this agent. Changes are merged with the existing config in ",u.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/openclaw.json"}),"."]}),u.jsxs("div",{className:"rounded-md bg-muted p-3 space-y-1.5",children:[u.jsx("p",{className:"font-medium text-foreground text-xs",children:"Available settings:"}),u.jsxs("div",{className:"grid gap-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"blockOnRisk"}),u.jsx("span",{children:"Block tool calls when risk is detected"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"logLevel"}),u.jsx("span",{children:"Logging verbosity (debug, info, warn, error)"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"timeoutMs"}),u.jsx("span",{children:"Request timeout in milliseconds"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"enabled"}),u.jsx("span",{children:"Enable/disable the Guards plugin"})]})]})]})]})]}),u.jsx(OM,{open:r,onOpenChange:o,agentId:e,onSuccess:t,onError:n})]})}function DM({open:e,onOpenChange:t,agentId:n,onSuccess:r,onError:o}){const[s,i]=m.useState("registry"),[l,a]=m.useState(""),[c,h]=m.useState(""),[f,d]=m.useState(!1),[x,y]=m.useState(""),w=()=>{a(""),h(""),i("registry"),y("")},S=async()=>{if(!(s==="registry"&&!l.trim())&&!(s==="custom"&&(!l.trim()||!c.trim()))){d(!0),y("");try{s==="registry"?await Se.commands.create({agentId:n,type:"install_skill",payload:{skillName:l.trim()}}):await Se.commands.create({agentId:n,type:"install_custom_skill",payload:{skillName:l.trim(),content:c}}),w(),t(!1),r==null||r()}catch(p){const v=p instanceof Error?p.message:"Failed to send command";y(v),o==null||o(p)}finally{d(!1)}}};return u.jsx(qs,{open:e,onOpenChange:p=>{p||w(),t(p)},children:u.jsxs(Eo,{className:"sm:max-w-[560px]",children:[u.jsxs(Zs,{children:[u.jsxs(Co,{className:"flex items-center gap-2",children:[u.jsx(Vn,{className:"h-4 w-4"})," Install Skill"]}),u.jsxs(jo,{children:["Install from ",u.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."]})]}),u.jsxs(nv,{value:s,onValueChange:p=>{i(p),y("")},children:[u.jsxs(gf,{className:"w-full",children:[u.jsxs(Qr,{value:"registry",className:"flex-1",children:[u.jsx(ir,{className:"mr-1.5 h-3.5 w-3.5"})," ClawHub Registry"]}),u.jsxs(Qr,{value:"custom",className:"flex-1",children:[u.jsx(da,{className:"mr-1.5 h-3.5 w-3.5"})," Custom SKILL.md"]})]}),u.jsx(qr,{value:"registry",className:"space-y-4 pt-2",children:u.jsxs("div",{className:"space-y-2",children:[u.jsx(un,{htmlFor:"reg-skill-name",children:"Skill Slug"}),u.jsx(Tt,{id:"reg-skill-name",placeholder:"e.g. web-search, code-review, self-improving-agent...",value:l,onChange:p=>{a(p.target.value),y("")},onKeyDown:p=>p.key==="Enter"&&S()}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",u.jsx("code",{className:"rounded bg-muted px-1",children:"clawhub install <slug>"})," on the agent. Browse available skills at ",u.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"clawhub.com"}),"."]})]})}),u.jsxs(qr,{value:"custom",className:"space-y-4 pt-2",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(un,{htmlFor:"custom-skill-name",children:"Skill Name"}),u.jsx(Tt,{id:"custom-skill-name",placeholder:"my-custom-skill",value:l,onChange:p=>{a(p.target.value),y("")}})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(un,{htmlFor:"custom-skill-content",children:"SKILL.md Content"}),u.jsx(ff,{id:"custom-skill-content",placeholder:`---
343
- name: my-custom-skill
344
- description: My custom skill
345
- ---
346
-
347
- Instructions for the agent...
348
-
349
- Use {baseDir} to reference the skill folder path.`,value:c,onChange:p=>{h(p.target.value),y("")},className:"min-h-[200px] font-mono text-xs"}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:["The content will be saved as ",u.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/workspace/skills/<name>/SKILL.md"}),". Use YAML frontmatter with ",u.jsx("code",{className:"rounded bg-muted px-1",children:"name"})," and ",u.jsx("code",{className:"rounded bg-muted px-1",children:"description"})," fields."]})]})]})]}),x&&u.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:[u.jsx(Wt,{className:"h-3.5 w-3.5 shrink-0"}),u.jsx("span",{children:x})]}),u.jsxs(Js,{children:[u.jsx(oe,{variant:"outline",onClick:()=>{w(),t(!1)},children:"Cancel"}),u.jsxs(oe,{onClick:S,disabled:f||!l.trim()||s==="custom"&&!c.trim(),children:[f?u.jsx(Yt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):u.jsx(Vn,{className:"mr-1.5 h-3.5 w-3.5"}),"Install"]})]})]})})}function $M({open:e,onOpenChange:t,agentId:n,initialName:r,onSuccess:o,onError:s}){const[i,l]=m.useState(r??""),[a,c]=m.useState(!1),[h,f]=m.useState("");m.useEffect(()=>{r&&l(r)},[r]);const d=async()=>{if(i.trim()){c(!0),f("");try{await Se.commands.create({agentId:n,type:"uninstall_skill",payload:{skillName:i.trim()}}),l(""),t(!1),o==null||o()}catch(x){const y=x instanceof Error?x.message:"Failed to send command";f(y),s==null||s(x)}finally{c(!1)}}};return u.jsx(qs,{open:e,onOpenChange:t,children:u.jsxs(Eo,{className:"sm:max-w-[400px]",children:[u.jsxs(Zs,{children:[u.jsxs(Co,{className:"flex items-center gap-2",children:[u.jsx(Gt,{className:"h-4 w-4"})," Uninstall Skill"]}),u.jsx(jo,{children:"This will send a command to remove the skill from the agent."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(un,{htmlFor:"uninstall-name",children:"Skill Name"}),u.jsx(Tt,{id:"uninstall-name",placeholder:"Skill name to uninstall...",value:i,onChange:x=>{l(x.target.value),f("")},onKeyDown:x=>x.key==="Enter"&&d()})]}),h&&u.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:[u.jsx(Wt,{className:"h-3.5 w-3.5 shrink-0"}),u.jsx("span",{children:h})]}),u.jsxs(Js,{children:[u.jsx(oe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),u.jsxs(oe,{variant:"destructive",onClick:d,disabled:a||!i.trim(),children:[a?u.jsx(Yt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):u.jsx(Gt,{className:"mr-1.5 h-3.5 w-3.5"}),"Uninstall"]})]})]})})}function OM({open:e,onOpenChange:t,agentId:n,onSuccess:r,onError:o}){const[s,i]=m.useState(`{
350
- "blockOnRisk": false
351
- }`),[l,a]=m.useState(""),[c,h]=m.useState(!1),f=async()=>{a("");let d;try{d=JSON.parse(s)}catch{a("Invalid JSON");return}if(typeof d!="object"||d===null||Array.isArray(d)){a("Must be a JSON object");return}h(!0);try{await Se.commands.create({agentId:n,type:"update_config",payload:d}),t(!1),r==null||r()}catch(x){const y=x instanceof Error?x.message:"Failed to send command";a(y),o==null||o(x)}finally{h(!1)}};return u.jsx(qs,{open:e,onOpenChange:t,children:u.jsxs(Eo,{className:"sm:max-w-[460px]",children:[u.jsxs(Zs,{children:[u.jsxs(Co,{className:"flex items-center gap-2",children:[u.jsx(Un,{className:"h-4 w-4"})," Update Guards Config"]}),u.jsx(jo,{children:"Values will be merged into the existing Guards plugin configuration."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(un,{htmlFor:"config-json",children:"Config JSON"}),u.jsx(ff,{id:"config-json",value:s,onChange:d=>{i(d.target.value),a("")},className:"min-h-[120px] font-mono text-xs"}),l&&u.jsx("p",{className:"text-xs text-destructive",children:l})]}),u.jsxs(Js,{children:[u.jsx(oe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),u.jsxs(oe,{onClick:f,disabled:c,children:[c?u.jsx(Yt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):u.jsx(Un,{className:"mr-1.5 h-3.5 w-3.5"}),"Update"]})]})]})})}function FM(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 o=Math.floor(r/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function HM(){const[e,t]=m.useState([]),[n,r]=m.useState(""),[o,s]=m.useState(!0),[i,l]=m.useState(null),a=m.useCallback((f,d="success")=>{l({msg:f,type:d}),setTimeout(()=>l(null),4e3)},[]);if(m.useEffect(()=>{Se.discovery.agents().then(f=>{const d=f.data??[];t(d),d.length>0&&!n&&r(d[0].registeredAgentId??d[0].id)}).catch(()=>{}).finally(()=>s(!1))},[]),o)return u.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading agents..."});if(e.length===0)return u.jsxs("div",{className:"space-y-6",children:[u.jsx("h1",{className:"text-lg font-semibold",children:"Plugins"}),u.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[u.jsx(ca,{className:"h-10 w-10 text-muted-foreground/30"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents discovered yet"}),u.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Connect an agent with the Guards plugin to get started"})]})]});const c=e.find(f=>(f.registeredAgentId??f.id)===n),h=(c==null?void 0:c.plugins)??[];return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-lg font-semibold",children:"Plugins"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage OpenClaw plugins on remote agents"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-xs text-muted-foreground",children:"Agent:"}),u.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:f=>r(f.target.value),children:e.map(f=>u.jsxs("option",{value:f.registeredAgentId??f.id,children:[f.emoji?`${f.emoji} `:"",f.name]},f.registeredAgentId??f.id))})]})]}),n&&u.jsxs(u.Fragment,{children:[u.jsx(BM,{agentId:n,showToast:a}),u.jsx(VM,{plugins:h,agentId:n,showToast:a}),u.jsx(UM,{agentId:n}),u.jsx(WM,{})]}),i&&u.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"?u.jsx(lo,{className:"h-4 w-4"}):u.jsx(Wt,{className:"h-4 w-4"}),u.jsx("span",{className:"text-sm",children:i.msg}),u.jsx("button",{onClick:()=>l(null),className:"ml-2 text-current/50 hover:text-current",children:"×"})]})]})}function BM({agentId:e,showToast:t}){const[n,r]=m.useState(!1),[o,s]=m.useState(!1);return u.jsxs("div",{className:"flex gap-2",children:[u.jsxs(oe,{size:"sm",onClick:()=>r(!0),children:[u.jsx(Vn,{className:"mr-1.5 h-3.5 w-3.5"})," Install Plugin"]}),u.jsxs(oe,{size:"sm",variant:"outline",onClick:()=>s(!0),children:[u.jsx(Gt,{className:"mr-1.5 h-3.5 w-3.5"})," Uninstall Plugin"]}),u.jsx(YM,{open:n,onOpenChange:r,agentId:e,showToast:t}),u.jsx($v,{open:o,onOpenChange:s,agentId:e,showToast:t})]})}function VM({plugins:e,agentId:t,showToast:n}){const[r,o]=m.useState(null);return u.jsxs(u.Fragment,{children:[u.jsxs(Te,{children:[u.jsx(De,{children:u.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[u.jsx(Qi,{className:"h-4 w-4"})," Installed Plugins (",e.length,")"]})}),u.jsx(Re,{children:e.length===0?u.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[u.jsx(Qi,{className:"h-10 w-10 text-muted-foreground/20"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins detected"}),u.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Plugin information is reported by the Guards agent"})]}):u.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:e.map(s=>u.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border p-3 transition-colors hover:bg-muted/30",children:[u.jsxs("div",{className:"flex items-center gap-2.5",children:[u.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-muted",children:u.jsx(Qi,{className:"h-4 w-4 text-muted-foreground"})}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium",children:s.name}),u.jsx(Ce,{variant:s.enabled?"default":"secondary",className:"text-[10px]",children:s.enabled?"Enabled":"Disabled"})]})]}),u.jsx(oe,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>o(s.name),children:u.jsx(Gt,{className:"h-3.5 w-3.5"})})]},s.name))})})]}),u.jsx($v,{open:r!==null,onOpenChange:s=>{s||o(null)},agentId:t,showToast:n,initialId:r??""})]})}function UM({agentId:e}){const[t,n]=m.useState([]),[r,o]=m.useState(!0),[s,i]=m.useState(null),l=m.useCallback(()=>{Se.commands.list(e).then(c=>{const h=(c.data??[]).filter(f=>f.type==="install_plugin"||f.type==="uninstall_plugin");n(h)}).catch(()=>{}).finally(()=>o(!1))},[e]);m.useEffect(()=>{l()},[l]),m.useEffect(()=>{if(!t.some(f=>f.status==="pending"||f.status==="running"))return;const h=setInterval(l,5e3);return()=>clearInterval(h)},[t,l]);const a=c=>c==="completed"?u.jsx(lo,{className:"h-3.5 w-3.5 text-emerald-500"}):c==="failed"?u.jsx(Wt,{className:"h-3.5 w-3.5 text-destructive"}):c==="running"?u.jsx(Yt,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):u.jsx(Hx,{className:"h-3.5 w-3.5 text-muted-foreground"});return r||t.length===0?null:u.jsxs(Te,{children:[u.jsx(De,{children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[u.jsx(Pl,{className:"h-4 w-4"})," Plugin Command History"]}),u.jsxs(oe,{size:"sm",variant:"ghost",onClick:l,children:[u.jsx(pr,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]})}),u.jsx(Re,{className:"space-y-2",children:t.map(c=>{var x,y;const h=s===c.id,f=c.type==="install_plugin"?"Install Plugin":"Uninstall Plugin",d=((x=c.payload)==null?void 0:x.spec)||((y=c.payload)==null?void 0:y.pluginId)||"";return u.jsxs("div",{className:"rounded-lg border border-border transition-colors hover:bg-muted/20",children:[u.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-4 py-3",onClick:()=>c.result&&i(h?null:c.id),children:[a(c.status),u.jsx("span",{className:"text-xs font-medium",children:f}),d&&u.jsxs("span",{className:"text-xs text-muted-foreground",children:['"',d,'"']}),u.jsx("div",{className:"flex-1"}),u.jsx(Ce,{variant:c.status==="completed"?"default":c.status==="failed"?"destructive":"secondary",className:"text-[10px]",children:c.status}),u.jsx("span",{className:"text-[11px] text-muted-foreground",children:GM(c.createdAt)}),c.result&&(h?u.jsx(Ud,{className:"h-3.5 w-3.5 text-muted-foreground"}):u.jsx(Wd,{className:"h-3.5 w-3.5 text-muted-foreground"}))]}),h&&c.result&&u.jsx("div",{className:"border-t border-border bg-muted/30 px-4 py-3",children:u.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 WM(){return u.jsxs(Te,{children:[u.jsx(De,{children:u.jsx($e,{className:"text-sm",children:"How Plugins Work"})}),u.jsxs(Re,{className:"text-xs text-muted-foreground space-y-2",children:[u.jsx("p",{children:"OpenClaw plugins extend agent capabilities. They can be installed from npm or local paths."}),u.jsx("p",{children:"Common plugin specs:"}),u.jsxs("ul",{className:"list-inside list-disc space-y-0.5 pl-2",children:[u.jsxs("li",{children:[u.jsx("code",{className:"rounded bg-muted px-1",children:"@openclaw/voice-call"})," — Voice calling plugin"]}),u.jsxs("li",{children:[u.jsx("code",{className:"rounded bg-muted px-1",children:"@opentrust/guards"})," — Security guard plugin"]}),u.jsxs("li",{children:[u.jsx("code",{className:"rounded bg-muted px-1",children:"/path/to/plugin"})," — Local plugin path"]})]}),u.jsxs("p",{children:["Commands are executed via ",u.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins install/uninstall"})," on the agent. See ",u.jsx("a",{href:"https://docs.openclaw.ai/cli/plugins",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"OpenClaw Plugins docs"}),"."]})]})]})}function YM({open:e,onOpenChange:t,agentId:n,showToast:r}){const[o,s]=m.useState(""),[i,l]=m.useState(!1),[a,c]=m.useState(""),h=()=>{s(""),c("")},f=async()=>{if(o.trim()){l(!0),c("");try{await Se.commands.create({agentId:n,type:"install_plugin",payload:{spec:o.trim()}}),h(),t(!1),r("Plugin install command sent","success")}catch(d){const x=d instanceof Error?d.message:"Failed to send command";c(x)}finally{l(!1)}}};return u.jsx(qs,{open:e,onOpenChange:d=>{d||h(),t(d)},children:u.jsxs(Eo,{className:"sm:max-w-[480px]",children:[u.jsxs(Zs,{children:[u.jsxs(Co,{className:"flex items-center gap-2",children:[u.jsx(Vn,{className:"h-4 w-4"})," Install Plugin"]}),u.jsx(jo,{children:"Install an OpenClaw plugin via npm package name or local path."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(un,{htmlFor:"plugin-spec",children:"Plugin Spec"}),u.jsx(Tt,{id:"plugin-spec",placeholder:"e.g. @openclaw/voice-call, @opentrust/guards, /path/to/plugin",value:o,onChange:d=>{s(d.target.value),c("")},onKeyDown:d=>d.key==="Enter"&&f()}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",u.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins install <spec>"})," on the agent."]})]}),a&&u.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:[u.jsx(Wt,{className:"h-3.5 w-3.5 shrink-0"}),u.jsx("span",{children:a})]}),u.jsxs(Js,{children:[u.jsx(oe,{variant:"outline",onClick:()=>{h(),t(!1)},children:"Cancel"}),u.jsxs(oe,{onClick:f,disabled:i||!o.trim(),children:[i?u.jsx(Yt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):u.jsx(Vn,{className:"mr-1.5 h-3.5 w-3.5"}),"Install"]})]})]})})}function $v({open:e,onOpenChange:t,agentId:n,showToast:r,initialId:o}){const[s,i]=m.useState(o??""),[l,a]=m.useState(!1),[c,h]=m.useState("");m.useEffect(()=>{o&&i(o)},[o]);const f=async()=>{if(s.trim()){a(!0),h("");try{await Se.commands.create({agentId:n,type:"uninstall_plugin",payload:{pluginId:s.trim()}}),i(""),t(!1),r("Plugin uninstall command sent","success")}catch(d){const x=d instanceof Error?d.message:"Failed to send command";h(x)}finally{a(!1)}}};return u.jsx(qs,{open:e,onOpenChange:t,children:u.jsxs(Eo,{className:"sm:max-w-[400px]",children:[u.jsxs(Zs,{children:[u.jsxs(Co,{className:"flex items-center gap-2",children:[u.jsx(Gt,{className:"h-4 w-4"})," Uninstall Plugin"]}),u.jsx(jo,{children:"Remove an OpenClaw plugin from the agent."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(un,{htmlFor:"plugin-id",children:"Plugin ID"}),u.jsx(Tt,{id:"plugin-id",placeholder:"e.g. voice-call, opentrust-guard",value:s,onChange:d=>{i(d.target.value),h("")},onKeyDown:d=>d.key==="Enter"&&f()}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",u.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins uninstall <id> --force"})," on the agent."]})]}),c&&u.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:[u.jsx(Wt,{className:"h-3.5 w-3.5 shrink-0"}),u.jsx("span",{children:c})]}),u.jsxs(Js,{children:[u.jsx(oe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),u.jsxs(oe,{variant:"destructive",onClick:f,disabled:l||!s.trim(),children:[l?u.jsx(Yt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):u.jsx(Gt,{className:"mr-1.5 h-3.5 w-3.5"}),"Uninstall"]})]})]})})}function GM(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 o=Math.floor(r/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function XM(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 KM(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[o,s]=m.useState("dashboard"),i=m.useCallback(()=>{Se.system.services().then(l=>t(l.data??[])).catch(()=>{}).finally(()=>r(!1))},[]);return m.useEffect(()=>{i()},[i]),m.useEffect(()=>{const l=setInterval(i,1e4);return()=>clearInterval(l)},[i]),n?u.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h1",{className:"text-lg font-semibold",children:"System"}),u.jsxs(oe,{size:"sm",variant:"ghost",onClick:i,children:[u.jsx(pr,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]}),u.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:e.map(l=>u.jsx(Te,{className:`cursor-pointer transition-all ${o===l.key?"ring-2 ring-primary shadow-sm":"hover:bg-muted/30"}`,onClick:()=>s(l.key),children:u.jsxs(Re,{className:"flex items-center gap-3 p-4",children:[u.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-lg ${l.healthy?"bg-emerald-100 dark:bg-emerald-950":l.running?"bg-amber-100 dark:bg-amber-950":"bg-muted"}`,children:u.jsx(Yd,{className:`h-5 w-5 ${l.healthy?"text-emerald-600 dark:text-emerald-400":l.running?"text-amber-600 dark:text-amber-400":"text-muted-foreground"}`})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("p",{className:"text-sm font-medium",children:l.name}),u.jsx(Rk,{className:`h-2 w-2 fill-current ${l.healthy?"text-emerald-500":l.running?"text-amber-500":"text-muted-foreground/40"}`})]}),u.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[u.jsxs("span",{children:[":",l.port]}),l.pid&&u.jsxs("span",{children:["PID ",l.pid]}),l.logSize>0&&u.jsx("span",{children:XM(l.logSize)})]})]}),u.jsx(Ce,{variant:l.healthy?"default":l.running?"secondary":"outline",className:`text-[10px] ${l.healthy?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20":""}`,children:l.healthy?"Healthy":l.running?"Running":"Stopped"})]})},l.key))}),o&&u.jsx(QM,{service:o})]})}function QM({service:e}){const[t,n]=m.useState([]),[r,o]=m.useState(0),[s,i]=m.useState(""),[l,a]=m.useState(!0),[c,h]=m.useState(!0),[f,d]=m.useState(!0),[x,y]=m.useState(200),w=m.useRef(null),S=m.useRef(null),p=m.useCallback(k=>{const b=k??x;Se.system.logs(e,b).then(E=>{n(E.data.lines),o(E.data.total),i(E.data.lastModified)}).catch(()=>{}).finally(()=>a(!1))},[e,x]);m.useEffect(()=>{a(!0),n([]),p()},[e]),m.useEffect(()=>{p()},[x]),m.useEffect(()=>{c&&w.current&&(w.current.scrollTop=w.current.scrollHeight)},[t,c]),m.useEffect(()=>(f?S.current=setInterval(()=>p(),3e3):S.current&&(clearInterval(S.current),S.current=null),()=>{S.current&&clearInterval(S.current)}),[f,p]);const v=async()=>{try{await Se.system.clearLog(e),n([]),o(0)}catch{}},g=()=>{y(k=>Math.min(k+500,2e3))},N=e.charAt(0).toUpperCase()+e.slice(1);return u.jsxs(Te,{children:[u.jsx(De,{className:"pb-3",children:u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[u.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[u.jsx(da,{className:"h-4 w-4"})," ",N," Logs",u.jsxs(Ce,{variant:"outline",className:"text-[10px] font-normal",children:[r.toLocaleString()," lines"]}),s&&u.jsxs("span",{className:"text-[11px] font-normal text-muted-foreground",children:["Updated ",new Date(s).toLocaleTimeString()]})]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[r>x&&u.jsx(oe,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:g,children:"Load more"}),u.jsxs(oe,{size:"sm",variant:f?"default":"outline",className:"h-7 text-xs",onClick:()=>{d(!f),h(!f)},children:[f?u.jsx(Vk,{className:"mr-1 h-3 w-3"}):u.jsx(Uk,{className:"mr-1 h-3 w-3"}),f?"Pause":"Tail"]}),u.jsxs(oe,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>{var k;h(!0),(k=w.current)==null||k.scrollTo({top:w.current.scrollHeight,behavior:"smooth"})},children:[u.jsx(Mk,{className:"mr-1 h-3 w-3"})," Bottom"]}),u.jsxs(oe,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>p(),children:[u.jsx(pr,{className:"mr-1 h-3 w-3"})," Refresh"]}),u.jsxs(oe,{size:"sm",variant:"ghost",className:"h-7 text-xs text-destructive hover:text-destructive",onClick:v,children:[u.jsx(Gt,{className:"mr-1 h-3 w-3"})," Clear"]})]})]})}),u.jsx(Re,{className:"p-0",children:l?u.jsx("div",{className:"flex h-60 items-center justify-center",children:u.jsx(Yt,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):t.length===0?u.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-2",children:[u.jsx(Pk,{className:"h-8 w-8 text-muted-foreground/20"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"No log output"})]}):u.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:k,scrollHeight:b,clientHeight:E}=w.current,_=b-k-E<40;h(_)},children:u.jsx("pre",{className:"p-4 text-xs leading-5 font-mono text-zinc-300",children:t.map((k,b)=>u.jsx(qM,{line:k,lineNum:r-t.length+b+1},b))})})})]})}function qM({line:e,lineNum:t}){const n=ZM(e);return u.jsxs("div",{className:"group flex hover:bg-white/5",children:[u.jsx("span",{className:"mr-3 inline-block w-10 select-none text-right text-zinc-600 group-hover:text-zinc-500",children:t}),u.jsx("span",{className:n,children:e}),`
352
- `]})}function ZM(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 JM=[{key:"og_core_url",label:"Core API URL",icon:Yd,placeholder:"http://localhost:53666",description:"OpenTrust Core service endpoint"},{key:"og_core_key",label:"Core API Key",icon:Ok,placeholder:"sk-og-***",description:"API key for Core authentication (masked for security)",sensitive:!0},{key:"gateway_url",label:"Gateway URL",icon:Dk,placeholder:"http://localhost:8900",description:"AI Gateway proxy endpoint"},{key:"dashboard_mode",label:"Dashboard Mode",icon:Gk,placeholder:"selfhosted",description:"Deployment mode: selfhosted or embedded"},{key:"database_url",label:"Database URL",icon:Ak,placeholder:"file:./data/dashboard.db",description:"Database connection string",sensitive:!0}];function eI(){const[e,t]=m.useState({}),[n,r]=m.useState({}),[o,s]=m.useState(!0),[i,l]=m.useState(!1),[a,c]=m.useState(null),[h,f]=m.useState(null),[d,x]=m.useState(!1),y=()=>{s(!0),Se.settings.get().then(N=>{const k=N.data??{};t(k),r(k)}).catch(()=>{}).finally(()=>s(!1))};m.useEffect(()=>{y()},[]);const w=()=>Object.keys(e).some(N=>e[N]!==n[N]),S=async()=>{l(!0);try{const N={};for(const[k,b]of Object.entries(e))b!==n[k]&&(N[k]=b);Object.keys(N).length>0&&(await Se.settings.update(N),r({...e}),v("Settings saved","success"))}catch(N){v(N instanceof Error?N.message:"Failed to save","error")}finally{l(!1)}},p=async()=>{x(!0),f(null);try{const k=await(await fetch("/api/settings/test-connection",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${JSON.parse(localStorage.getItem("opentrust_user")||"{}").apiKey||""}`}})).json();k.success&&f(k.data)}catch{f({connected:!1,message:"Request failed"})}finally{x(!1)}},v=(N,k)=>{c({msg:N,type:k}),setTimeout(()=>c(null),3e3)},g=(N,k)=>{t(b=>({...b,[N]:k}))};return o?u.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading settings..."}):u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-lg font-semibold",children:"Settings"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure OpenTrust system settings"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(oe,{size:"sm",variant:"ghost",onClick:y,children:[u.jsx(pr,{className:"mr-1.5 h-3.5 w-3.5"})," Reload"]}),u.jsxs(oe,{size:"sm",onClick:S,disabled:i||!w(),children:[i?u.jsx(Yt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):u.jsx(Wk,{className:"mr-1.5 h-3.5 w-3.5"}),"Save Changes"]})]})]}),u.jsxs(Te,{children:[u.jsx(De,{children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[u.jsx(Yd,{className:"h-4 w-4"})," Service Connection"]}),u.jsxs(oe,{size:"sm",variant:"outline",onClick:p,disabled:d,children:[d?u.jsx(Yt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):u.jsx(pr,{className:"mr-1.5 h-3.5 w-3.5"}),"Test Connection"]})]})}),u.jsx(Re,{children:h?u.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?u.jsx(lo,{className:"h-4 w-4"}):u.jsx(Wt,{className:"h-4 w-4"}),u.jsx("span",{children:h.message}),h.url&&u.jsx(Ce,{variant:"outline",className:"ml-auto text-[10px]",children:h.url})]}):u.jsx("p",{className:"text-xs text-muted-foreground",children:'Click "Test Connection" to verify Core service connectivity'})})]}),u.jsxs(Te,{children:[u.jsx(De,{children:u.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[u.jsx(Un,{className:"h-4 w-4"})," Configuration"]})}),u.jsx(Re,{className:"space-y-5",children:JM.map(N=>{const k=N.icon,b=e[N.key]!==n[N.key];return u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(k,{className:"h-3.5 w-3.5 text-muted-foreground"}),u.jsx(un,{htmlFor:N.key,className:"text-sm font-medium",children:N.label}),b&&u.jsx(Ce,{variant:"secondary",className:"text-[10px]",children:"Modified"})]}),u.jsx(Tt,{id:N.key,value:e[N.key]??"",onChange:E=>g(N.key,E.target.value),placeholder:N.placeholder,className:"font-mono text-sm"}),u.jsx("p",{className:"text-[11px] text-muted-foreground",children:N.description})]},N.key)})})]}),u.jsxs(Te,{children:[u.jsx(De,{children:u.jsx($e,{className:"text-sm",children:"Environment"})}),u.jsx(Re,{children:u.jsxs("div",{className:"grid gap-3 text-xs sm:grid-cols-2",children:[u.jsx(Ai,{label:"Dashboard Mode",value:e.dashboard_mode||"selfhosted"}),u.jsx(Ai,{label:"Core URL",value:e.og_core_url||"http://localhost:53666"}),u.jsx(Ai,{label:"Gateway URL",value:e.gateway_url||"http://localhost:8900"}),u.jsx(Ai,{label:"Database",value:e.database_url?"Custom":"SQLite (default)"})]})})]}),a&&u.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 ${a.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:[a.type==="success"?u.jsx(lo,{className:"h-4 w-4"}):u.jsx(Wt,{className:"h-4 w-4"}),u.jsx("span",{className:"text-sm",children:a.msg})]})]})}function Ai({label:e,value:t}){return u.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2",children:[u.jsx("span",{className:"text-muted-foreground",children:e}),u.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-[11px]",children:t})]})}function tI({children:e}){const{isAuthenticated:t,isLoading:n}=Bd();return n?u.jsx("div",{className:"flex min-h-screen items-center justify-center",children:u.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading..."})}):t?u.jsx(u.Fragment,{children:e}):u.jsx(yc,{to:"/login",replace:!0})}function nI(){return u.jsxs(aS,{children:[u.jsx(Ge,{path:"/login",element:u.jsx(ab,{})}),u.jsxs(Ge,{element:u.jsx(tI,{children:u.jsx(lb,{})}),children:[u.jsx(Ge,{index:!0,element:u.jsx(yc,{to:"/inventory/agents",replace:!0})}),u.jsx(Ge,{path:"/inventory/agents",element:u.jsx(cb,{})}),u.jsx(Ge,{path:"/inventory/agents/:id",element:u.jsx(hb,{})}),u.jsx(Ge,{path:"/inventory/identities",element:u.jsx(yb,{})}),u.jsx(Ge,{path:"/inventory/permissions",element:u.jsx(vb,{})}),u.jsx(Ge,{path:"/secure/risk",element:u.jsx(wb,{})}),u.jsx(Ge,{path:"/secure/graph",element:u.jsx(B4,{})}),u.jsx(Ge,{path:"/ops/skills",element:u.jsx(RM,{})}),u.jsx(Ge,{path:"/ops/plugins",element:u.jsx(HM,{})}),u.jsx(Ge,{path:"/system/logs",element:u.jsx(KM,{})}),u.jsx(Ge,{path:"/system/settings",element:u.jsx(eI,{})})]}),u.jsx(Ge,{path:"*",element:u.jsx(yc,{to:"/inventory/agents",replace:!0})})]})}bu.createRoot(document.getElementById("root")).render(u.jsx($t.StrictMode,{children:u.jsx(RS,{basename:"/dashboard",children:u.jsx(VS,{children:u.jsx(YS,{children:u.jsx(nI,{})})})})}));
353
- //# sourceMappingURL=index-CsaCaL1R.js.map