var AN=e=>{throw TypeError(e)};var mv=(e,t,r)=>t.has(e)||AN("Cannot "+r);var z=(e,t,r)=>(mv(e,t,"read from private field"),r?r.call(e):t.get(e)),_e=(e,t,r)=>t.has(e)?AN("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ue=(e,t,r,n)=>(mv(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Ie=(e,t,r)=>(mv(e,t,"access private method"),r);var nm=(e,t,r,n)=>({set _(i){ue(e,t,i,r)},get _(){return z(e,t,n)}});function jL(e,t){for(var r=0;rn[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var im=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pC={exports:{}},Ay={},gC={exports:{}},ze={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Mh=Symbol.for("react.element"),_L=Symbol.for("react.portal"),NL=Symbol.for("react.fragment"),SL=Symbol.for("react.strict_mode"),kL=Symbol.for("react.profiler"),EL=Symbol.for("react.provider"),OL=Symbol.for("react.context"),AL=Symbol.for("react.forward_ref"),PL=Symbol.for("react.suspense"),CL=Symbol.for("react.memo"),TL=Symbol.for("react.lazy"),PN=Symbol.iterator;function $L(e){return e===null||typeof e!="object"?null:(e=PN&&e[PN]||e["@@iterator"],typeof e=="function"?e:null)}var yC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vC=Object.assign,xC={};function Cu(e,t,r){this.props=e,this.context=t,this.refs=xC,this.updater=r||yC}Cu.prototype.isReactComponent={};Cu.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")};Cu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function bC(){}bC.prototype=Cu.prototype;function Nj(e,t,r){this.props=e,this.context=t,this.refs=xC,this.updater=r||yC}var Sj=Nj.prototype=new bC;Sj.constructor=Nj;vC(Sj,Cu.prototype);Sj.isPureReactComponent=!0;var CN=Array.isArray,wC=Object.prototype.hasOwnProperty,kj={current:null},jC={key:!0,ref:!0,__self:!0,__source:!0};function _C(e,t,r){var n,i={},a=null,s=null;if(t!=null)for(n in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(a=""+t.key),t)wC.call(t,n)&&!jC.hasOwnProperty(n)&&(i[n]=t[n]);var l=arguments.length-2;if(l===1)i.children=r;else if(1>>1,W=R[U];if(0>>1;Ui(ee,B))lei(ve,ee)?(R[U]=ve,R[le]=B,U=le):(R[U]=ee,R[q]=B,U=q);else if(lei(ve,B))R[U]=ve,R[le]=B,U=le;else break e}}return M}function i(R,M){var B=R.sortIndex-M.sortIndex;return B!==0?B:R.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,y=!1,p=!1,x=typeof setTimeout=="function"?setTimeout:null,g=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 w(R){for(var M=r(u);M!==null;){if(M.callback===null)n(u);else if(M.startTime<=R)n(u),M.sortIndex=M.expirationTime,t(c,M);else break;M=r(u)}}function _(R){if(p=!1,w(R),!y)if(r(c)!==null)y=!0,D(j);else{var M=r(u);M!==null&&L(_,M.startTime-R)}}function j(R,M){y=!1,p&&(p=!1,g(E),E=-1),m=!0;var B=h;try{for(w(M),f=r(c);f!==null&&(!(f.expirationTime>M)||R&&!C());){var U=f.callback;if(typeof U=="function"){f.callback=null,h=f.priorityLevel;var W=U(f.expirationTime<=M);M=e.unstable_now(),typeof W=="function"?f.callback=W:f===r(c)&&n(c),w(M)}else n(c);f=r(c)}if(f!==null)var Z=!0;else{var q=r(u);q!==null&&L(_,q.startTime-M),Z=!1}return Z}finally{f=null,h=B,m=!1}}var N=!1,S=null,E=-1,k=5,A=-1;function C(){return!(e.unstable_now()-AR||125U?(R.sortIndex=B,t(u,R),r(c)===null&&R===r(u)&&(p?(g(E),E=-1):p=!0,L(_,B-U))):(R.sortIndex=W,t(c,R),y||m||(y=!0,D(j))),R},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(R){var M=h;return function(){var B=h;h=M;try{return R.apply(this,arguments)}finally{h=B}}}})(OC);EC.exports=OC;var VL=EC.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var HL=b,mn=VL;function ne(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qx=Object.prototype.hasOwnProperty,qL=/^[: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]*$/,$N={},MN={};function KL(e){return Qx.call(MN,e)?!0:Qx.call($N,e)?!1:qL.test(e)?MN[e]=!0:($N[e]=!0,!1)}function GL(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function YL(e,t,r,n){if(t===null||typeof t>"u"||GL(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.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 Fr(e,t,r,n,i,a,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=s}var pr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){pr[e]=new Fr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];pr[t]=new Fr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){pr[e]=new Fr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){pr[e]=new Fr(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){pr[e]=new Fr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){pr[e]=new Fr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){pr[e]=new Fr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){pr[e]=new Fr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){pr[e]=new Fr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Oj=/[\-:]([a-z])/g;function Aj(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(Oj,Aj);pr[t]=new Fr(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(Oj,Aj);pr[t]=new Fr(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(Oj,Aj);pr[t]=new Fr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){pr[e]=new Fr(e,1,!1,e.toLowerCase(),null,!1,!1)});pr.xlinkHref=new Fr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){pr[e]=new Fr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Pj(e,t,r,n){var i=pr.hasOwnProperty(t)?pr[t]:null;(i!==null?i.type!==0:n||!(2l||i[s]!==a[l]){var c=` `+i[s].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=s&&0<=l);break}}}finally{yv=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Td(e):""}function ZL(e){switch(e.tag){case 5:return Td(e.type);case 16:return Td("Lazy");case 13:return Td("Suspense");case 19:return Td("SuspenseList");case 0:case 2:case 15:return e=vv(e.type,!1),e;case 11:return e=vv(e.type.render,!1),e;case 1:return e=vv(e.type,!0),e;default:return""}}function rb(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 Ql:return"Fragment";case Xl:return"Portal";case Jx:return"Profiler";case Cj:return"StrictMode";case eb:return"Suspense";case tb:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case CC:return(e.displayName||"Context")+".Consumer";case PC:return(e._context.displayName||"Context")+".Provider";case Tj:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $j:return t=e.displayName||null,t!==null?t:rb(e.type)||"Memo";case Ka:t=e._payload,e=e._init;try{return rb(e(t))}catch{}}return null}function XL(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 rb(t);case 8:return t===Cj?"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 Hs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $C(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function QL(e){var t=$C(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){n=""+s,a.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function om(e){e._valueTracker||(e._valueTracker=QL(e))}function MC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=$C(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Sp(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 nb(e,t){var r=t.checked;return St({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function IN(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Hs(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function RC(e,t){t=t.checked,t!=null&&Pj(e,"checked",t,!1)}function ib(e,t){RC(e,t);var r=Hs(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ab(e,t.type,r):t.hasOwnProperty("defaultValue")&&ab(e,t.type,Hs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function DN(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function ab(e,t,r){(t!=="number"||Sp(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var $d=Array.isArray;function gc(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=lm.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function yf(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Kd={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},JL=["Webkit","ms","Moz","O"];Object.keys(Kd).forEach(function(e){JL.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Kd[t]=Kd[e]})});function FC(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Kd.hasOwnProperty(e)&&Kd[e]?(""+t).trim():t+"px"}function BC(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=FC(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var e8=St({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 lb(e,t){if(t){if(e8[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ne(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ne(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ne(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ne(62))}}function cb(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 ub=null;function Mj(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var db=null,yc=null,vc=null;function BN(e){if(e=Dh(e)){if(typeof db!="function")throw Error(ne(280));var t=e.stateNode;t&&(t=My(t),db(e.stateNode,e.type,t))}}function zC(e){yc?vc?vc.push(e):vc=[e]:yc=e}function UC(){if(yc){var e=yc,t=vc;if(vc=yc=null,BN(e),t)for(e=0;e>>=0,e===0?32:31-(d8(e)/f8|0)|0}var cm=64,um=4194304;function Md(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 Ap(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,s=r&268435455;if(s!==0){var l=s&~i;l!==0?n=Md(l):(a&=s,a!==0&&(n=Md(a)))}else s=r&~i,s!==0?n=Md(s):a!==0&&(n=Md(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Rh(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-di(t),e[t]=r}function g8(e,t){var r=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 n=e.eventTimes;for(e=e.expirationTimes;0=Yd),YN=" ",ZN=!1;function lT(e,t){switch(e){case"keyup":return V8.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cT(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jl=!1;function q8(e,t){switch(e){case"compositionend":return cT(t);case"keypress":return t.which!==32?null:(ZN=!0,YN);case"textInput":return e=t.data,e===YN&&ZN?null:e;default:return null}}function K8(e,t){if(Jl)return e==="compositionend"||!Uj&&lT(e,t)?(e=sT(),Jm=Fj=vs=null,Jl=!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)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=eS(r)}}function hT(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hT(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mT(){for(var e=window,t=Sp();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Sp(e.document)}return t}function Wj(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 rF(e){var t=mT(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&hT(r.ownerDocument.documentElement,r)){if(n!==null&&Wj(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=tS(r,a);var s=tS(r,n);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,ec=null,yb=null,Xd=null,vb=!1;function rS(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;vb||ec==null||ec!==Sp(n)||(n=ec,"selectionStart"in n&&Wj(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Xd&&_f(Xd,n)||(Xd=n,n=Tp(yb,"onSelect"),0nc||(e.current=Nb[nc],Nb[nc]=null,nc--)}function ct(e,t){nc++,Nb[nc]=e.current,e.current=t}var qs={},kr=Zs(qs),Gr=Zs(!1),il=qs;function Uc(e,t){var r=e.type.contextTypes;if(!r)return qs;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Yr(e){return e=e.childContextTypes,e!=null}function Mp(){yt(Gr),yt(kr)}function cS(e,t,r){if(kr.current!==qs)throw Error(ne(168));ct(kr,t),ct(Gr,r)}function _T(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(ne(108,XL(e)||"Unknown",i));return St({},r,n)}function Rp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qs,il=kr.current,ct(kr,e),ct(Gr,Gr.current),!0}function uS(e,t,r){var n=e.stateNode;if(!n)throw Error(ne(169));r?(e=_T(e,t,il),n.__reactInternalMemoizedMergedChildContext=e,yt(Gr),yt(kr),ct(kr,e)):yt(Gr),ct(Gr,r)}var ra=null,Ry=!1,Tv=!1;function NT(e){ra===null?ra=[e]:ra.push(e)}function mF(e){Ry=!0,NT(e)}function Xs(){if(!Tv&&ra!==null){Tv=!0;var e=0,t=et;try{var r=ra;for(et=1;e>=s,i-=s,aa=1<<32-di(t)+i|r<E?(k=S,S=null):k=S.sibling;var A=h(g,S,w[E],_);if(A===null){S===null&&(S=k);break}e&&S&&A.alternate===null&&t(g,S),v=a(A,v,E),N===null?j=A:N.sibling=A,N=A,S=k}if(E===w.length)return r(g,S),bt&&po(g,E),j;if(S===null){for(;EE?(k=S,S=null):k=S.sibling;var C=h(g,S,A.value,_);if(C===null){S===null&&(S=k);break}e&&S&&C.alternate===null&&t(g,S),v=a(C,v,E),N===null?j=C:N.sibling=C,N=C,S=k}if(A.done)return r(g,S),bt&&po(g,E),j;if(S===null){for(;!A.done;E++,A=w.next())A=f(g,A.value,_),A!==null&&(v=a(A,v,E),N===null?j=A:N.sibling=A,N=A);return bt&&po(g,E),j}for(S=n(g,S);!A.done;E++,A=w.next())A=m(S,g,E,A.value,_),A!==null&&(e&&A.alternate!==null&&S.delete(A.key===null?E:A.key),v=a(A,v,E),N===null?j=A:N.sibling=A,N=A);return e&&S.forEach(function(P){return t(g,P)}),bt&&po(g,E),j}function x(g,v,w,_){if(typeof w=="object"&&w!==null&&w.type===Ql&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case sm:e:{for(var j=w.key,N=v;N!==null;){if(N.key===j){if(j=w.type,j===Ql){if(N.tag===7){r(g,N.sibling),v=i(N,w.props.children),v.return=g,g=v;break e}}else if(N.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Ka&&hS(j)===N.type){r(g,N.sibling),v=i(N,w.props),v.ref=ad(g,N,w),v.return=g,g=v;break e}r(g,N);break}else t(g,N);N=N.sibling}w.type===Ql?(v=Zo(w.props.children,g.mode,_,w.key),v.return=g,g=v):(_=op(w.type,w.key,w.props,null,g.mode,_),_.ref=ad(g,v,w),_.return=g,g=_)}return s(g);case Xl:e:{for(N=w.key;v!==null;){if(v.key===N)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){r(g,v.sibling),v=i(v,w.children||[]),v.return=g,g=v;break e}else{r(g,v);break}else t(g,v);v=v.sibling}v=Bv(w,g.mode,_),v.return=g,g=v}return s(g);case Ka:return N=w._init,x(g,v,N(w._payload),_)}if($d(w))return y(g,v,w,_);if(ed(w))return p(g,v,w,_);ym(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(r(g,v.sibling),v=i(v,w),v.return=g,g=v):(r(g,v),v=Fv(w,g.mode,_),v.return=g,g=v),s(g)):r(g,v)}return x}var Vc=OT(!0),AT=OT(!1),Lp=Zs(null),Fp=null,sc=null,Kj=null;function Gj(){Kj=sc=Fp=null}function Yj(e){var t=Lp.current;yt(Lp),e._currentValue=t}function Eb(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function bc(e,t){Fp=e,Kj=sc=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Hr=!0),e.firstContext=null)}function Ln(e){var t=e._currentValue;if(Kj!==e)if(e={context:e,memoizedValue:t,next:null},sc===null){if(Fp===null)throw Error(ne(308));sc=e,Fp.dependencies={lanes:0,firstContext:e}}else sc=sc.next=e;return t}var Oo=null;function Zj(e){Oo===null?Oo=[e]:Oo.push(e)}function PT(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Zj(t)):(r.next=i.next,i.next=r),t.interleaved=r,ba(e,n)}function ba(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Ga=!1;function Xj(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function CT(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 ha(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ps(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,He&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,ba(e,r)}return i=n.interleaved,i===null?(t.next=t,Zj(n)):(t.next=i.next,i.next=t),n.interleaved=t,ba(e,r)}function tp(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Ij(e,r)}}function mS(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=s:a=a.next=s,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Bp(e,t,r,n){var i=e.updateQueue;Ga=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,s===null?a=u:s.next=u,s=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==s&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(a!==null){var f=i.baseState;s=0,d=u=c=null,l=a;do{var h=l.lane,m=l.eventTime;if((n&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,p=l;switch(h=t,m=r,p.tag){case 1:if(y=p.payload,typeof y=="function"){f=y.call(m,f,h);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=p.payload,h=typeof y=="function"?y.call(m,f,h):y,h==null)break e;f=St({},f,h);break e;case 2:Ga=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,s|=h;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);ol|=s,e.lanes=s,e.memoizedState=f}}function pS(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Mv.transition;Mv.transition={};try{e(!1),t()}finally{et=r,Mv.transition=n}}function GT(){return Fn().memoizedState}function vF(e,t,r){var n=Ts(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},YT(e))ZT(t,r);else if(r=PT(e,t,r,n),r!==null){var i=Dr();fi(r,e,n,i),XT(r,t,n)}}function xF(e,t,r){var n=Ts(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(YT(e))ZT(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var s=t.lastRenderedState,l=a(s,r);if(i.hasEagerState=!0,i.eagerState=l,pi(l,s)){var c=t.interleaved;c===null?(i.next=i,Zj(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}r=PT(e,t,i,n),r!==null&&(i=Dr(),fi(r,e,n,i),XT(r,t,n))}}function YT(e){var t=e.alternate;return e===Nt||t!==null&&t===Nt}function ZT(e,t){Qd=Up=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function XT(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Ij(e,r)}}var Wp={readContext:Ln,useCallback:yr,useContext:yr,useEffect:yr,useImperativeHandle:yr,useInsertionEffect:yr,useLayoutEffect:yr,useMemo:yr,useReducer:yr,useRef:yr,useState:yr,useDebugValue:yr,useDeferredValue:yr,useTransition:yr,useMutableSource:yr,useSyncExternalStore:yr,useId:yr,unstable_isNewReconciler:!1},bF={readContext:Ln,useCallback:function(e,t){return Ni().memoizedState=[e,t===void 0?null:t],e},useContext:Ln,useEffect:yS,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,np(4194308,4,WT.bind(null,t,e),r)},useLayoutEffect:function(e,t){return np(4194308,4,e,t)},useInsertionEffect:function(e,t){return np(4,2,e,t)},useMemo:function(e,t){var r=Ni();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Ni();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=vF.bind(null,Nt,e),[n.memoizedState,e]},useRef:function(e){var t=Ni();return e={current:e},t.memoizedState=e},useState:gS,useDebugValue:a2,useDeferredValue:function(e){return Ni().memoizedState=e},useTransition:function(){var e=gS(!1),t=e[0];return e=yF.bind(null,e[1]),Ni().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Nt,i=Ni();if(bt){if(r===void 0)throw Error(ne(407));r=r()}else{if(r=t(),lr===null)throw Error(ne(349));sl&30||RT(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,yS(DT.bind(null,n,a,e),[e]),n.flags|=2048,Cf(9,IT.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Ni(),t=lr.identifierPrefix;if(bt){var r=sa,n=aa;r=(n&~(1<<32-di(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Af++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=s.createElement(r,{is:n.is}):(e=s.createElement(r),r==="select"&&(s=e,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):e=s.createElementNS(e,r),e[Ti]=t,e[kf]=n,o$(e,t,!1,!1),t.stateNode=e;e:{switch(s=cb(r,n),r){case"dialog":mt("cancel",e),mt("close",e),i=n;break;case"iframe":case"object":case"embed":mt("load",e),i=n;break;case"video":case"audio":for(i=0;iKc&&(t.flags|=128,n=!0,sd(a,!1),t.lanes=4194304)}else{if(!n)if(e=zp(s),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),sd(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!bt)return vr(t),null}else 2*$t()-a.renderingStartTime>Kc&&r!==1073741824&&(t.flags|=128,n=!0,sd(a,!1),t.lanes=4194304);a.isBackwards?(s.sibling=t.child,t.child=s):(r=a.last,r!==null?r.sibling=s:t.child=s,a.last=s)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=$t(),t.sibling=null,r=_t.current,ct(_t,n?r&1|2:r&1),t):(vr(t),null);case 22:case 23:return d2(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?an&1073741824&&(vr(t),t.subtreeFlags&6&&(t.flags|=8192)):vr(t),null;case 24:return null;case 25:return null}throw Error(ne(156,t.tag))}function OF(e,t){switch(Hj(t),t.tag){case 1:return Yr(t.type)&&Mp(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hc(),yt(Gr),yt(kr),e2(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Jj(t),null;case 13:if(yt(_t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ne(340));Wc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return yt(_t),null;case 4:return Hc(),null;case 10:return Yj(t.type._context),null;case 22:case 23:return d2(),null;case 24:return null;default:return null}}var xm=!1,jr=!1,AF=typeof WeakSet=="function"?WeakSet:Set,fe=null;function oc(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Et(e,t,n)}else r.current=null}function Ib(e,t,r){try{r()}catch(n){Et(e,t,n)}}var OS=!1;function PF(e,t){if(xb=Pp,e=mT(),Wj(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var s=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==r||i!==0&&f.nodeType!==3||(l=s+i),f!==a||n!==0&&f.nodeType!==3||(c=s+n),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===r&&++u===i&&(l=s),h===a&&++d===n&&(c=s),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(bb={focusedElem:e,selectionRange:r},Pp=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;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 p=y.memoizedProps,x=y.memoizedState,g=t.stateNode,v=g.getSnapshotBeforeUpdate(t.elementType===t.type?p:Yn(t.type,p),x);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ne(163))}}catch(_){Et(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return y=OS,OS=!1,y}function Jd(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Ib(t,r,a)}i=i.next}while(i!==n)}}function Ly(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Db(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function u$(e){var t=e.alternate;t!==null&&(e.alternate=null,u$(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ti],delete t[kf],delete t[_b],delete t[fF],delete t[hF])),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 d$(e){return e.tag===5||e.tag===3||e.tag===4}function AS(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||d$(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 Lb(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=$p));else if(n!==4&&(e=e.child,e!==null))for(Lb(e,t,r),e=e.sibling;e!==null;)Lb(e,t,r),e=e.sibling}function Fb(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Fb(e,t,r),e=e.sibling;e!==null;)Fb(e,t,r),e=e.sibling}var fr=null,Qn=!1;function Fa(e,t,r){for(r=r.child;r!==null;)f$(e,t,r),r=r.sibling}function f$(e,t,r){if(Ii&&typeof Ii.onCommitFiberUnmount=="function")try{Ii.onCommitFiberUnmount(Py,r)}catch{}switch(r.tag){case 5:jr||oc(r,t);case 6:var n=fr,i=Qn;fr=null,Fa(e,t,r),fr=n,Qn=i,fr!==null&&(Qn?(e=fr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):fr.removeChild(r.stateNode));break;case 18:fr!==null&&(Qn?(e=fr,r=r.stateNode,e.nodeType===8?Cv(e.parentNode,r):e.nodeType===1&&Cv(e,r),wf(e)):Cv(fr,r.stateNode));break;case 4:n=fr,i=Qn,fr=r.stateNode.containerInfo,Qn=!0,Fa(e,t,r),fr=n,Qn=i;break;case 0:case 11:case 14:case 15:if(!jr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,s=a.destroy;a=a.tag,s!==void 0&&(a&2||a&4)&&Ib(r,t,s),i=i.next}while(i!==n)}Fa(e,t,r);break;case 1:if(!jr&&(oc(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Et(r,t,l)}Fa(e,t,r);break;case 21:Fa(e,t,r);break;case 22:r.mode&1?(jr=(n=jr)||r.memoizedState!==null,Fa(e,t,r),jr=n):Fa(e,t,r);break;default:Fa(e,t,r)}}function PS(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new AF),t.forEach(function(n){var i=FF.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Kn(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=s),n&=~a}if(n=i,n=$t()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*TF(n/1960))-n,10e?16:e,xs===null)var n=!1;else{if(e=xs,xs=null,qp=0,He&6)throw Error(ne(331));var i=He;for(He|=4,fe=e.current;fe!==null;){var a=fe,s=a.child;if(fe.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c$t()-c2?Yo(e,0):l2|=r),Zr(e,t)}function b$(e,t){t===0&&(e.mode&1?(t=um,um<<=1,!(um&130023424)&&(um=4194304)):t=1);var r=Dr();e=ba(e,t),e!==null&&(Rh(e,t,r),Zr(e,r))}function LF(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),b$(e,r)}function FF(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ne(314))}n!==null&&n.delete(t),b$(e,r)}var w$;w$=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Gr.current)Hr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Hr=!1,kF(e,t,r);Hr=!!(e.flags&131072)}else Hr=!1,bt&&t.flags&1048576&&ST(t,Dp,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;ip(e,t),e=t.pendingProps;var i=Uc(t,kr.current);bc(t,r),i=r2(null,t,n,e,i,r);var a=n2();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yr(n)?(a=!0,Rp(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Xj(t),i.updater=Dy,t.stateNode=i,i._reactInternals=t,Ab(t,n,e,r),t=Tb(null,t,n,!0,a,r)):(t.tag=0,bt&&a&&Vj(t),Ar(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(ip(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=zF(n),e=Yn(n,e),i){case 0:t=Cb(null,t,n,e,r);break e;case 1:t=SS(null,t,n,e,r);break e;case 11:t=_S(null,t,n,e,r);break e;case 14:t=NS(null,t,n,Yn(n.type,e),r);break e}throw Error(ne(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Yn(n,i),Cb(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Yn(n,i),SS(e,t,n,i,r);case 3:e:{if(i$(t),e===null)throw Error(ne(387));n=t.pendingProps,a=t.memoizedState,i=a.element,CT(e,t),Bp(t,n,null,r);var s=t.memoizedState;if(n=s.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=qc(Error(ne(423)),t),t=kS(e,t,n,r,i);break e}else if(n!==i){i=qc(Error(ne(424)),t),t=kS(e,t,n,r,i);break e}else for(cn=As(t.stateNode.containerInfo.firstChild),un=t,bt=!0,ii=null,r=AT(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Wc(),n===i){t=wa(e,t,r);break e}Ar(e,t,n,r)}t=t.child}return t;case 5:return TT(t),e===null&&kb(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,s=i.children,wb(n,i)?s=null:a!==null&&wb(n,a)&&(t.flags|=32),n$(e,t),Ar(e,t,s,r),t.child;case 6:return e===null&&kb(t),null;case 13:return a$(e,t,r);case 4:return Qj(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Vc(t,null,n,r):Ar(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Yn(n,i),_S(e,t,n,i,r);case 7:return Ar(e,t,t.pendingProps,r),t.child;case 8:return Ar(e,t,t.pendingProps.children,r),t.child;case 12:return Ar(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,s=i.value,ct(Lp,n._currentValue),n._currentValue=s,a!==null)if(pi(a.value,s)){if(a.children===i.children&&!Gr.current){t=wa(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){s=a.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(a.tag===1){c=ha(-1,r&-r),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=r,c=a.alternate,c!==null&&(c.lanes|=r),Eb(a.return,r,t),l.lanes|=r;break}c=c.next}}else if(a.tag===10)s=a.type===t.type?null:a.child;else if(a.tag===18){if(s=a.return,s===null)throw Error(ne(341));s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),Eb(s,r,t),s=a.sibling}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===t){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}Ar(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,bc(t,r),i=Ln(i),n=n(i),t.flags|=1,Ar(e,t,n,r),t.child;case 14:return n=t.type,i=Yn(n,t.pendingProps),i=Yn(n.type,i),NS(e,t,n,i,r);case 15:return t$(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Yn(n,i),ip(e,t),t.tag=1,Yr(n)?(e=!0,Rp(t)):e=!1,bc(t,r),QT(t,n,i),Ab(t,n,i,r),Tb(null,t,n,!0,e,r);case 19:return s$(e,t,r);case 22:return r$(e,t,r)}throw Error(ne(156,t.tag))};function j$(e,t){return YC(e,t)}function BF(e,t,r,n){this.tag=e,this.key=r,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tn(e,t,r,n){return new BF(e,t,r,n)}function h2(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zF(e){if(typeof e=="function")return h2(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Tj)return 11;if(e===$j)return 14}return 2}function $s(e,t){var r=e.alternate;return r===null?(r=Tn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function op(e,t,r,n,i,a){var s=2;if(n=e,typeof e=="function")h2(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Ql:return Zo(r.children,i,a,t);case Cj:s=8,i|=8;break;case Jx:return e=Tn(12,r,t,i|2),e.elementType=Jx,e.lanes=a,e;case eb:return e=Tn(13,r,t,i),e.elementType=eb,e.lanes=a,e;case tb:return e=Tn(19,r,t,i),e.elementType=tb,e.lanes=a,e;case TC:return By(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case PC:s=10;break e;case CC:s=9;break e;case Tj:s=11;break e;case $j:s=14;break e;case Ka:s=16,n=null;break e}throw Error(ne(130,e==null?e:typeof e,""))}return t=Tn(s,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function Zo(e,t,r,n){return e=Tn(7,e,n,t),e.lanes=r,e}function By(e,t,r,n){return e=Tn(22,e,n,t),e.elementType=TC,e.lanes=r,e.stateNode={isHidden:!1},e}function Fv(e,t,r){return e=Tn(6,e,null,t),e.lanes=r,e}function Bv(e,t,r){return t=Tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function UF(e,t,r,n,i){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=bv(0),this.expirationTimes=bv(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bv(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function m2(e,t,r,n,i,a,s,l,c){return e=new UF(e,t,r,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Tn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xj(a),e}function WF(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(k$)}catch(e){console.error(e)}}k$(),kC.exports=yn;var GF=kC.exports,LS=GF;Xx.createRoot=LS.createRoot,Xx.hydrateRoot=LS.hydrateRoot;var Mu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},cl=typeof window>"u"||"Deno"in globalThis;function Pr(){}function YF(e,t){return typeof e=="function"?e(t):e}function Vb(e){return typeof e=="number"&&e>=0&&e!==1/0}function E$(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ms(e,t){return typeof e=="function"?e(t):e}function ai(e,t){return typeof e=="function"?e(t):e}function FS(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:s,stale:l}=e;if(s){if(n){if(t.queryHash!==v2(s,t.options))return!1}else if(!$f(t.queryKey,s))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||a&&!a(t))}function BS(e,t){const{exact:r,status:n,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(ul(t.options.mutationKey)!==ul(a))return!1}else if(!$f(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function v2(e,t){return((t==null?void 0:t.queryKeyHashFn)||ul)(e)}function ul(e){return JSON.stringify(e,(t,r)=>Hb(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function $f(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>$f(e[r],t[r])):!1}function O$(e,t){if(e===t)return e;const r=zS(e)&&zS(t);if(r||Hb(e)&&Hb(t)){const n=r?e:Object.keys(e),i=n.length,a=r?t:Object.keys(t),s=a.length,l=r?[]:{},c=new Set(n);let u=0;for(let d=0;d{setTimeout(t,e)})}function qb(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?O$(e,t):t}function XF(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function QF(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var x2=Symbol();function A$(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===x2?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function P$(e,t){return typeof e=="function"?e(...t):!!e}var Bo,ls,Ac,aC,JF=(aC=class extends Mu{constructor(){super();_e(this,Bo);_e(this,ls);_e(this,Ac);ue(this,Ac,t=>{if(!cl&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){z(this,ls)||this.setEventListener(z(this,Ac))}onUnsubscribe(){var t;this.hasListeners()||((t=z(this,ls))==null||t.call(this),ue(this,ls,void 0))}setEventListener(t){var r;ue(this,Ac,t),(r=z(this,ls))==null||r.call(this),ue(this,ls,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){z(this,Bo)!==t&&(ue(this,Bo,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof z(this,Bo)=="boolean"?z(this,Bo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Bo=new WeakMap,ls=new WeakMap,Ac=new WeakMap,aC),b2=new JF,Pc,cs,Cc,sC,e9=(sC=class extends Mu{constructor(){super();_e(this,Pc,!0);_e(this,cs);_e(this,Cc);ue(this,Cc,t=>{if(!cl&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){z(this,cs)||this.setEventListener(z(this,Cc))}onUnsubscribe(){var t;this.hasListeners()||((t=z(this,cs))==null||t.call(this),ue(this,cs,void 0))}setEventListener(t){var r;ue(this,Cc,t),(r=z(this,cs))==null||r.call(this),ue(this,cs,t(this.setOnline.bind(this)))}setOnline(t){z(this,Pc)!==t&&(ue(this,Pc,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return z(this,Pc)}},Pc=new WeakMap,cs=new WeakMap,Cc=new WeakMap,sC),Zp=new e9;function Kb(){let e,t;const r=new Promise((i,a)=>{e=i,t=a});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}function t9(e){return Math.min(1e3*2**e,3e4)}function C$(e){return(e??"online")==="online"?Zp.isOnline():!0}var T$=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function zv(e){return e instanceof T$}function $$(e){let t=!1,r=0,n=!1,i;const a=Kb(),s=p=>{var x;n||(h(new T$(p)),(x=e.abort)==null||x.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>b2.isFocused()&&(e.networkMode==="always"||Zp.isOnline())&&e.canRun(),d=()=>C$(e.networkMode)&&e.canRun(),f=p=>{var x;n||(n=!0,(x=e.onSuccess)==null||x.call(e,p),i==null||i(),a.resolve(p))},h=p=>{var x;n||(n=!0,(x=e.onError)==null||x.call(e,p),i==null||i(),a.reject(p))},m=()=>new Promise(p=>{var x;i=g=>{(n||u())&&p(g)},(x=e.onPause)==null||x.call(e)}).then(()=>{var p;i=void 0,n||(p=e.onContinue)==null||p.call(e)}),y=()=>{if(n)return;let p;const x=r===0?e.initialPromise:void 0;try{p=x??e.fn()}catch(g){p=Promise.reject(g)}Promise.resolve(p).then(f).catch(g=>{var N;if(n)return;const v=e.retry??(cl?0:3),w=e.retryDelay??t9,_=typeof w=="function"?w(r,g):w,j=v===!0||typeof v=="number"&&ru()?void 0:m()).then(()=>{t?h(g):y()})})};return{promise:a,cancel:s,continue:()=>(i==null||i(),a),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?y():m().then(y),a)}}var r9=e=>setTimeout(e,0);function n9(){let e=[],t=0,r=l=>{l()},n=l=>{l()},i=r9;const a=l=>{t?e.push(l):i(()=>{r(l)})},s=()=>{const l=e;e=[],l.length&&i(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||s()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{i=l}}}var Zt=n9(),zo,oC,M$=(oC=class{constructor(){_e(this,zo)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vb(this.gcTime)&&ue(this,zo,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(cl?1/0:5*60*1e3))}clearGcTimeout(){z(this,zo)&&(clearTimeout(z(this,zo)),ue(this,zo,void 0))}},zo=new WeakMap,oC),Tc,Uo,kn,Wo,xr,Ph,Vo,Zn,Ji,lC,i9=(lC=class extends M${constructor(t){super();_e(this,Zn);_e(this,Tc);_e(this,Uo);_e(this,kn);_e(this,Wo);_e(this,xr);_e(this,Ph);_e(this,Vo);ue(this,Vo,!1),ue(this,Ph,t.defaultOptions),this.setOptions(t.options),this.observers=[],ue(this,Wo,t.client),ue(this,kn,z(this,Wo).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ue(this,Tc,a9(this.options)),this.state=t.state??z(this,Tc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=z(this,xr))==null?void 0:t.promise}setOptions(t){this.options={...z(this,Ph),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&z(this,kn).remove(this)}setData(t,r){const n=qb(this.state.data,t,this.options);return Ie(this,Zn,Ji).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Ie(this,Zn,Ji).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,i;const r=(n=z(this,xr))==null?void 0:n.promise;return(i=z(this,xr))==null||i.cancel(t),r?r.then(Pr).catch(Pr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(z(this,Tc))}isActive(){return this.observers.some(t=>ai(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===x2||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ms(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!E$(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=z(this,xr))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=z(this,xr))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),z(this,kn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(z(this,xr)&&(z(this,Vo)?z(this,xr).cancel({revert:!0}):z(this,xr).cancelRetry()),this.scheduleGc()),z(this,kn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ie(this,Zn,Ji).call(this,{type:"invalidate"})}fetch(t,r){var u,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(z(this,xr))return z(this,xr).continueRetry(),z(this,xr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(m=>m.options.queryFn);h&&this.setOptions(h.options)}const n=new AbortController,i=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(ue(this,Vo,!0),n.signal)})},a=()=>{const h=A$(this.options,r),y=(()=>{const p={client:z(this,Wo),queryKey:this.queryKey,meta:this.meta};return i(p),p})();return ue(this,Vo,!1),this.options.persister?this.options.persister(h,y,this):h(y)},l=(()=>{const h={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:z(this,Wo),state:this.state,fetchFn:a};return i(h),h})();(u=this.options.behavior)==null||u.onFetch(l,this),ue(this,Uo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&Ie(this,Zn,Ji).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const c=h=>{var m,y,p,x;zv(h)&&h.silent||Ie(this,Zn,Ji).call(this,{type:"error",error:h}),zv(h)||((y=(m=z(this,kn).config).onError)==null||y.call(m,h,this),(x=(p=z(this,kn).config).onSettled)==null||x.call(p,this.state.data,h,this)),this.scheduleGc()};return ue(this,xr,$$({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,abort:n.abort.bind(n),onSuccess:h=>{var m,y,p,x;if(h===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(g){c(g);return}(y=(m=z(this,kn).config).onSuccess)==null||y.call(m,h,this),(x=(p=z(this,kn).config).onSettled)==null||x.call(p,h,this.state.error,this),this.scheduleGc()},onError:c,onFail:(h,m)=>{Ie(this,Zn,Ji).call(this,{type:"failed",failureCount:h,error:m})},onPause:()=>{Ie(this,Zn,Ji).call(this,{type:"pause"})},onContinue:()=>{Ie(this,Zn,Ji).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),z(this,xr).start()}},Tc=new WeakMap,Uo=new WeakMap,kn=new WeakMap,Wo=new WeakMap,xr=new WeakMap,Ph=new WeakMap,Vo=new WeakMap,Zn=new WeakSet,Ji=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...R$(n.data,this.options),fetchMeta:t.meta??null};case"success":return ue(this,Uo,void 0),{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return zv(i)&&i.revert&&z(this,Uo)?{...z(this,Uo),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Zt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),z(this,kn).notify({query:this,type:"updated",action:t})})},lC);function R$(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:C$(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function a9(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Oi,cC,s9=(cC=class extends Mu{constructor(t={}){super();_e(this,Oi);this.config=t,ue(this,Oi,new Map)}build(t,r,n){const i=r.queryKey,a=r.queryHash??v2(i,r);let s=this.get(a);return s||(s=new i9({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){z(this,Oi).has(t.queryHash)||(z(this,Oi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=z(this,Oi).get(t.queryHash);r&&(t.destroy(),r===t&&z(this,Oi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Zt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return z(this,Oi).get(t)}getAll(){return[...z(this,Oi).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>FS(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>FS(t,n)):r}notify(t){Zt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Zt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Zt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Oi=new WeakMap,cC),Ai,Er,Ho,Pi,Va,uC,o9=(uC=class extends M${constructor(t){super();_e(this,Pi);_e(this,Ai);_e(this,Er);_e(this,Ho);this.mutationId=t.mutationId,ue(this,Er,t.mutationCache),ue(this,Ai,[]),this.state=t.state||I$(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){z(this,Ai).includes(t)||(z(this,Ai).push(t),this.clearGcTimeout(),z(this,Er).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ue(this,Ai,z(this,Ai).filter(r=>r!==t)),this.scheduleGc(),z(this,Er).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){z(this,Ai).length||(this.state.status==="pending"?this.scheduleGc():z(this,Er).remove(this))}continue(){var t;return((t=z(this,Ho))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,s,l,c,u,d,f,h,m,y,p,x,g,v,w,_,j,N,S,E;const r=()=>{Ie(this,Pi,Va).call(this,{type:"continue"})};ue(this,Ho,$$({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,A)=>{Ie(this,Pi,Va).call(this,{type:"failed",failureCount:k,error:A})},onPause:()=>{Ie(this,Pi,Va).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>z(this,Er).canRun(this)}));const n=this.state.status==="pending",i=!z(this,Ho).canStart();try{if(n)r();else{Ie(this,Pi,Va).call(this,{type:"pending",variables:t,isPaused:i}),await((s=(a=z(this,Er).config).onMutate)==null?void 0:s.call(a,t,this));const A=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));A!==this.state.context&&Ie(this,Pi,Va).call(this,{type:"pending",context:A,variables:t,isPaused:i})}const k=await z(this,Ho).start();return await((d=(u=z(this,Er).config).onSuccess)==null?void 0:d.call(u,k,t,this.state.context,this)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,k,t,this.state.context)),await((y=(m=z(this,Er).config).onSettled)==null?void 0:y.call(m,k,null,this.state.variables,this.state.context,this)),await((x=(p=this.options).onSettled)==null?void 0:x.call(p,k,null,t,this.state.context)),Ie(this,Pi,Va).call(this,{type:"success",data:k}),k}catch(k){try{throw await((v=(g=z(this,Er).config).onError)==null?void 0:v.call(g,k,t,this.state.context,this)),await((_=(w=this.options).onError)==null?void 0:_.call(w,k,t,this.state.context)),await((N=(j=z(this,Er).config).onSettled)==null?void 0:N.call(j,void 0,k,this.state.variables,this.state.context,this)),await((E=(S=this.options).onSettled)==null?void 0:E.call(S,void 0,k,t,this.state.context)),k}finally{Ie(this,Pi,Va).call(this,{type:"error",error:k})}}finally{z(this,Er).runNext(this)}}},Ai=new WeakMap,Er=new WeakMap,Ho=new WeakMap,Pi=new WeakSet,Va=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Zt.batch(()=>{z(this,Ai).forEach(n=>{n.onMutationUpdate(t)}),z(this,Er).notify({mutation:this,type:"updated",action:t})})},uC);function I$(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var na,Xn,Ch,dC,l9=(dC=class extends Mu{constructor(t={}){super();_e(this,na);_e(this,Xn);_e(this,Ch);this.config=t,ue(this,na,new Set),ue(this,Xn,new Map),ue(this,Ch,0)}build(t,r,n){const i=new o9({mutationCache:this,mutationId:++nm(this,Ch)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){z(this,na).add(t);const r=jm(t);if(typeof r=="string"){const n=z(this,Xn).get(r);n?n.push(t):z(this,Xn).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(z(this,na).delete(t)){const r=jm(t);if(typeof r=="string"){const n=z(this,Xn).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&z(this,Xn).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=jm(t);if(typeof r=="string"){const n=z(this,Xn).get(r),i=n==null?void 0:n.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=jm(t);if(typeof r=="string"){const i=(n=z(this,Xn).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Zt.batch(()=>{z(this,na).forEach(t=>{this.notify({type:"removed",mutation:t})}),z(this,na).clear(),z(this,Xn).clear()})}getAll(){return Array.from(z(this,na))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>BS(r,n))}findAll(t={}){return this.getAll().filter(r=>BS(t,r))}notify(t){Zt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Zt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Pr))))}},na=new WeakMap,Xn=new WeakMap,Ch=new WeakMap,dC);function jm(e){var t;return(t=e.options.scope)==null?void 0:t.id}function WS(e){return{onFetch:(t,r)=>{var d,f,h,m,y;const n=t.options,i=(h=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],s=((y=t.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let p=!1;const x=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},g=A$(t.options,t.fetchOptions),v=async(w,_,j)=>{if(p)return Promise.reject();if(_==null&&w.pages.length)return Promise.resolve(w);const S=(()=>{const C={client:t.client,queryKey:t.queryKey,pageParam:_,direction:j?"backward":"forward",meta:t.options.meta};return x(C),C})(),E=await g(S),{maxPages:k}=t.options,A=j?QF:XF;return{pages:A(w.pages,E,k),pageParams:A(w.pageParams,_,k)}};if(i&&a.length){const w=i==="backward",_=w?c9:VS,j={pages:a,pageParams:s},N=_(n,j);l=await v(j,N,w)}else{const w=e??a.length;do{const _=c===0?s[0]??n.initialPageParam:VS(n,l);if(c>0&&_==null)break;l=await v(l,_),c++}while(c{var p,x;return(x=(p=t.options).persister)==null?void 0:x.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function VS(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function c9(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var kt,us,ds,$c,Mc,fs,Rc,Ic,fC,u9=(fC=class{constructor(e={}){_e(this,kt);_e(this,us);_e(this,ds);_e(this,$c);_e(this,Mc);_e(this,fs);_e(this,Rc);_e(this,Ic);ue(this,kt,e.queryCache||new s9),ue(this,us,e.mutationCache||new l9),ue(this,ds,e.defaultOptions||{}),ue(this,$c,new Map),ue(this,Mc,new Map),ue(this,fs,0)}mount(){nm(this,fs)._++,z(this,fs)===1&&(ue(this,Rc,b2.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,kt).onFocus())})),ue(this,Ic,Zp.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,kt).onOnline())})))}unmount(){var e,t;nm(this,fs)._--,z(this,fs)===0&&((e=z(this,Rc))==null||e.call(this),ue(this,Rc,void 0),(t=z(this,Ic))==null||t.call(this),ue(this,Ic,void 0))}isFetching(e){return z(this,kt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return z(this,us).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=z(this,kt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=z(this,kt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ms(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return z(this,kt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=z(this,kt).get(n.queryHash),a=i==null?void 0:i.state.data,s=YF(t,a);if(s!==void 0)return z(this,kt).build(this,n).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return Zt.batch(()=>z(this,kt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=z(this,kt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=z(this,kt);Zt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=z(this,kt);return Zt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Zt.batch(()=>z(this,kt).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(Pr).catch(Pr)}invalidateQueries(e,t={}){return Zt.batch(()=>(z(this,kt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Zt.batch(()=>z(this,kt).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,r);return r.throwOnError||(a=a.catch(Pr)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(Pr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=z(this,kt).build(this,t);return r.isStaleByTime(Ms(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Pr).catch(Pr)}fetchInfiniteQuery(e){return e.behavior=WS(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Pr).catch(Pr)}ensureInfiniteQueryData(e){return e.behavior=WS(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Zp.isOnline()?z(this,us).resumePausedMutations():Promise.resolve()}getQueryCache(){return z(this,kt)}getMutationCache(){return z(this,us)}getDefaultOptions(){return z(this,ds)}setDefaultOptions(e){ue(this,ds,e)}setQueryDefaults(e,t){z(this,$c).set(ul(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...z(this,$c).values()],r={};return t.forEach(n=>{$f(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){z(this,Mc).set(ul(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...z(this,Mc).values()],r={};return t.forEach(n=>{$f(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...z(this,ds).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=v2(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===x2&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...z(this,ds).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){z(this,kt).clear(),z(this,us).clear()}},kt=new WeakMap,us=new WeakMap,ds=new WeakMap,$c=new WeakMap,Mc=new WeakMap,fs=new WeakMap,Rc=new WeakMap,Ic=new WeakMap,fC),Br,Ue,Th,Or,qo,Dc,hs,ms,$h,Lc,Fc,Ko,Go,ps,Bc,Ze,Id,Gb,Yb,Zb,Xb,Qb,Jb,ew,D$,hC,d9=(hC=class extends Mu{constructor(t,r){super();_e(this,Ze);_e(this,Br);_e(this,Ue);_e(this,Th);_e(this,Or);_e(this,qo);_e(this,Dc);_e(this,hs);_e(this,ms);_e(this,$h);_e(this,Lc);_e(this,Fc);_e(this,Ko);_e(this,Go);_e(this,ps);_e(this,Bc,new Set);this.options=r,ue(this,Br,t),ue(this,ms,null),ue(this,hs,Kb()),this.options.experimental_prefetchInRender||z(this,hs).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(z(this,Ue).addObserver(this),HS(z(this,Ue),this.options)?Ie(this,Ze,Id).call(this):this.updateResult(),Ie(this,Ze,Xb).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tw(z(this,Ue),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tw(z(this,Ue),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ie(this,Ze,Qb).call(this),Ie(this,Ze,Jb).call(this),z(this,Ue).removeObserver(this)}setOptions(t){const r=this.options,n=z(this,Ue);if(this.options=z(this,Br).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ai(this.options.enabled,z(this,Ue))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ie(this,Ze,ew).call(this),z(this,Ue).setOptions(this.options),r._defaulted&&!Yp(this.options,r)&&z(this,Br).getQueryCache().notify({type:"observerOptionsUpdated",query:z(this,Ue),observer:this});const i=this.hasListeners();i&&qS(z(this,Ue),n,this.options,r)&&Ie(this,Ze,Id).call(this),this.updateResult(),i&&(z(this,Ue)!==n||ai(this.options.enabled,z(this,Ue))!==ai(r.enabled,z(this,Ue))||Ms(this.options.staleTime,z(this,Ue))!==Ms(r.staleTime,z(this,Ue)))&&Ie(this,Ze,Gb).call(this);const a=Ie(this,Ze,Yb).call(this);i&&(z(this,Ue)!==n||ai(this.options.enabled,z(this,Ue))!==ai(r.enabled,z(this,Ue))||a!==z(this,ps))&&Ie(this,Ze,Zb).call(this,a)}getOptimisticResult(t){const r=z(this,Br).getQueryCache().build(z(this,Br),t),n=this.createResult(r,t);return h9(this,n)&&(ue(this,Or,n),ue(this,Dc,this.options),ue(this,qo,z(this,Ue).state)),n}getCurrentResult(){return z(this,Or)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),Reflect.get(n,i))})}trackProp(t){z(this,Bc).add(t)}getCurrentQuery(){return z(this,Ue)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=z(this,Br).defaultQueryOptions(t),n=z(this,Br).getQueryCache().build(z(this,Br),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Ie(this,Ze,Id).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),z(this,Or)))}createResult(t,r){var k;const n=z(this,Ue),i=this.options,a=z(this,Or),s=z(this,qo),l=z(this,Dc),u=t!==n?t.state:z(this,Th),{state:d}=t;let f={...d},h=!1,m;if(r._optimisticResults){const A=this.hasListeners(),C=!A&&HS(t,r),P=A&&qS(t,n,r,i);(C||P)&&(f={...f,...R$(d.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:y,errorUpdatedAt:p,status:x}=f;m=f.data;let g=!1;if(r.placeholderData!==void 0&&m===void 0&&x==="pending"){let A;a!=null&&a.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(A=a.data,g=!0):A=typeof r.placeholderData=="function"?r.placeholderData((k=z(this,Fc))==null?void 0:k.state.data,z(this,Fc)):r.placeholderData,A!==void 0&&(x="success",m=qb(a==null?void 0:a.data,A,r),h=!0)}if(r.select&&m!==void 0&&!g)if(a&&m===(s==null?void 0:s.data)&&r.select===z(this,$h))m=z(this,Lc);else try{ue(this,$h,r.select),m=r.select(m),m=qb(a==null?void 0:a.data,m,r),ue(this,Lc,m),ue(this,ms,null)}catch(A){ue(this,ms,A)}z(this,ms)&&(y=z(this,ms),m=z(this,Lc),p=Date.now(),x="error");const v=f.fetchStatus==="fetching",w=x==="pending",_=x==="error",j=w&&v,N=m!==void 0,E={status:x,fetchStatus:f.fetchStatus,isPending:w,isSuccess:x==="success",isError:_,isInitialLoading:j,isLoading:j,data:m,dataUpdatedAt:f.dataUpdatedAt,error:y,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!w,isLoadingError:_&&!N,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:_&&N,isStale:w2(t,r),refetch:this.refetch,promise:z(this,hs)};if(this.options.experimental_prefetchInRender){const A=$=>{E.status==="error"?$.reject(E.error):E.data!==void 0&&$.resolve(E.data)},C=()=>{const $=ue(this,hs,E.promise=Kb());A($)},P=z(this,hs);switch(P.status){case"pending":t.queryHash===n.queryHash&&A(P);break;case"fulfilled":(E.status==="error"||E.data!==P.value)&&C();break;case"rejected":(E.status!=="error"||E.error!==P.reason)&&C();break}}return E}updateResult(){const t=z(this,Or),r=this.createResult(z(this,Ue),this.options);if(ue(this,qo,z(this,Ue).state),ue(this,Dc,this.options),z(this,qo).data!==void 0&&ue(this,Fc,z(this,Ue)),Yp(r,t))return;ue(this,Or,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!z(this,Bc).size)return!0;const s=new Set(a??z(this,Bc));return this.options.throwOnError&&s.add("error"),Object.keys(z(this,Or)).some(l=>{const c=l;return z(this,Or)[c]!==t[c]&&s.has(c)})};Ie(this,Ze,D$).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ie(this,Ze,Xb).call(this)}},Br=new WeakMap,Ue=new WeakMap,Th=new WeakMap,Or=new WeakMap,qo=new WeakMap,Dc=new WeakMap,hs=new WeakMap,ms=new WeakMap,$h=new WeakMap,Lc=new WeakMap,Fc=new WeakMap,Ko=new WeakMap,Go=new WeakMap,ps=new WeakMap,Bc=new WeakMap,Ze=new WeakSet,Id=function(t){Ie(this,Ze,ew).call(this);let r=z(this,Ue).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Pr)),r},Gb=function(){Ie(this,Ze,Qb).call(this);const t=Ms(this.options.staleTime,z(this,Ue));if(cl||z(this,Or).isStale||!Vb(t))return;const n=E$(z(this,Or).dataUpdatedAt,t)+1;ue(this,Ko,setTimeout(()=>{z(this,Or).isStale||this.updateResult()},n))},Yb=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(z(this,Ue)):this.options.refetchInterval)??!1},Zb=function(t){Ie(this,Ze,Jb).call(this),ue(this,ps,t),!(cl||ai(this.options.enabled,z(this,Ue))===!1||!Vb(z(this,ps))||z(this,ps)===0)&&ue(this,Go,setInterval(()=>{(this.options.refetchIntervalInBackground||b2.isFocused())&&Ie(this,Ze,Id).call(this)},z(this,ps)))},Xb=function(){Ie(this,Ze,Gb).call(this),Ie(this,Ze,Zb).call(this,Ie(this,Ze,Yb).call(this))},Qb=function(){z(this,Ko)&&(clearTimeout(z(this,Ko)),ue(this,Ko,void 0))},Jb=function(){z(this,Go)&&(clearInterval(z(this,Go)),ue(this,Go,void 0))},ew=function(){const t=z(this,Br).getQueryCache().build(z(this,Br),this.options);if(t===z(this,Ue))return;const r=z(this,Ue);ue(this,Ue,t),ue(this,Th,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},D$=function(t){Zt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(z(this,Or))}),z(this,Br).getQueryCache().notify({query:z(this,Ue),type:"observerResultsUpdated"})})},hC);function f9(e,t){return ai(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function HS(e,t){return f9(e,t)||e.state.data!==void 0&&tw(e,t,t.refetchOnMount)}function tw(e,t,r){if(ai(t.enabled,e)!==!1&&Ms(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&w2(e,t)}return!1}function qS(e,t,r,n){return(e!==t||ai(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&w2(e,r)}function w2(e,t){return ai(t.enabled,e)!==!1&&e.isStaleByTime(Ms(t.staleTime,e))}function h9(e,t){return!Yp(e.getCurrentResult(),t)}var gs,ys,zr,ia,ya,lp,rw,mC,m9=(mC=class extends Mu{constructor(r,n){super();_e(this,ya);_e(this,gs);_e(this,ys);_e(this,zr);_e(this,ia);ue(this,gs,r),this.setOptions(n),this.bindMethods(),Ie(this,ya,lp).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var i;const n=this.options;this.options=z(this,gs).defaultMutationOptions(r),Yp(this.options,n)||z(this,gs).getMutationCache().notify({type:"observerOptionsUpdated",mutation:z(this,zr),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&ul(n.mutationKey)!==ul(this.options.mutationKey)?this.reset():((i=z(this,zr))==null?void 0:i.state.status)==="pending"&&z(this,zr).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=z(this,zr))==null||r.removeObserver(this)}onMutationUpdate(r){Ie(this,ya,lp).call(this),Ie(this,ya,rw).call(this,r)}getCurrentResult(){return z(this,ys)}reset(){var r;(r=z(this,zr))==null||r.removeObserver(this),ue(this,zr,void 0),Ie(this,ya,lp).call(this),Ie(this,ya,rw).call(this)}mutate(r,n){var i;return ue(this,ia,n),(i=z(this,zr))==null||i.removeObserver(this),ue(this,zr,z(this,gs).getMutationCache().build(z(this,gs),this.options)),z(this,zr).addObserver(this),z(this,zr).execute(r)}},gs=new WeakMap,ys=new WeakMap,zr=new WeakMap,ia=new WeakMap,ya=new WeakSet,lp=function(){var n;const r=((n=z(this,zr))==null?void 0:n.state)??I$();ue(this,ys,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},rw=function(r){Zt.batch(()=>{var n,i,a,s,l,c,u,d;if(z(this,ia)&&this.hasListeners()){const f=z(this,ys).variables,h=z(this,ys).context;(r==null?void 0:r.type)==="success"?((i=(n=z(this,ia)).onSuccess)==null||i.call(n,r.data,f,h),(s=(a=z(this,ia)).onSettled)==null||s.call(a,r.data,null,f,h)):(r==null?void 0:r.type)==="error"&&((c=(l=z(this,ia)).onError)==null||c.call(l,r.error,f,h),(d=(u=z(this,ia)).onSettled)==null||d.call(u,void 0,r.error,f,h))}this.listeners.forEach(f=>{f(z(this,ys))})})},mC),L$=b.createContext(void 0),j2=e=>{const t=b.useContext(L$);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},p9=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(L$.Provider,{value:e,children:t})),F$=b.createContext(!1),g9=()=>b.useContext(F$);F$.Provider;function y9(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var v9=b.createContext(y9()),x9=()=>b.useContext(v9),b9=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},w9=e=>{b.useEffect(()=>{e.clearReset()},[e])},j9=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||P$(r,[e.error,n])),_9=e=>{if(e.suspense){const t=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>t(r(...n)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},N9=(e,t)=>e.isLoading&&e.isFetching&&!t,S9=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,KS=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function k9(e,t,r){var f,h,m,y,p;const n=g9(),i=x9(),a=j2(),s=a.defaultQueryOptions(e);(h=(f=a.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||h.call(f,s),s._optimisticResults=n?"isRestoring":"optimistic",_9(s),b9(s,i),w9(i);const l=!a.getQueryCache().get(s.queryHash),[c]=b.useState(()=>new t(a,s)),u=c.getOptimisticResult(s),d=!n&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(x=>{const g=d?c.subscribe(Zt.batchCalls(x)):Pr;return c.updateResult(),g},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),b.useEffect(()=>{c.setOptions(s)},[s,c]),S9(s,u))throw KS(s,c,i);if(j9({result:u,errorResetBoundary:i,throwOnError:s.throwOnError,query:a.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw u.error;if((y=(m=a.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||y.call(m,s,u),s.experimental_prefetchInRender&&!cl&&N9(u,n)){const x=l?KS(s,c,i):(p=a.getQueryCache().get(s.queryHash))==null?void 0:p.promise;x==null||x.catch(Pr).finally(()=>{c.updateResult()})}return s.notifyOnChangeProps?u:c.trackResult(u)}function $r(e,t){return k9(e,d9)}function Xp(e,t){const r=j2(),[n]=b.useState(()=>new m9(r,e));b.useEffect(()=>{n.setOptions(e)},[n,e]);const i=b.useSyncExternalStore(b.useCallback(s=>n.subscribe(Zt.batchCalls(s)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=b.useCallback((s,l)=>{n.mutate(s,l).catch(Pr)},[n]);if(i.error&&P$(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}let E9={data:""},O9=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||E9,A9=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,P9=/\/\*[^]*?\*\/| +/g,GS=/\n+/g,es=(e,t)=>{let r="",n="",i="";for(let a in e){let s=e[a];a[0]=="@"?a[1]=="i"?r=a+" "+s+";":n+=a[1]=="f"?es(s,a):a+"{"+es(s,a[1]=="k"?"":t)+"}":typeof s=="object"?n+=es(s,t?t.replace(/([^,])+/g,l=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):a):s!=null&&(a=/^--/.test(a)?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=es.p?es.p(a,s):a+":"+s+";")}return r+(t&&i?t+"{"+i+"}":i)+n},Gi={},B$=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+B$(e[r]);return t}return e},C9=(e,t,r,n,i)=>{let a=B$(e),s=Gi[a]||(Gi[a]=(c=>{let u=0,d=11;for(;u>>0;return"go"+d})(a));if(!Gi[s]){let c=a!==e?e:(u=>{let d,f,h=[{}];for(;d=A9.exec(u.replace(P9,""));)d[4]?h.shift():d[3]?(f=d[3].replace(GS," ").trim(),h.unshift(h[0][f]=h[0][f]||{})):h[0][d[1]]=d[2].replace(GS," ").trim();return h[0]})(e);Gi[s]=es(i?{["@keyframes "+s]:c}:c,r?"":"."+s)}let l=r&&Gi.g?Gi.g:null;return r&&(Gi.g=Gi[s]),((c,u,d,f)=>{f?u.data=u.data.replace(f,c):u.data.indexOf(c)===-1&&(u.data=d?c+u.data:u.data+c)})(Gi[s],t,n,l),s},T9=(e,t,r)=>e.reduce((n,i,a)=>{let s=t[a];if(s&&s.call){let l=s(r),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;s=c?"."+c:l&&typeof l=="object"?l.props?"":es(l,""):l===!1?"":l}return n+i+(s??"")},"");function Hy(e){let t=this||{},r=e.call?e(t.p):e;return C9(r.unshift?r.raw?T9(r,[].slice.call(arguments,1),t.p):r.reduce((n,i)=>Object.assign(n,i&&i.call?i(t.p):i),{}):r,O9(t.target),t.g,t.o,t.k)}let z$,nw,iw;Hy.bind({g:1});let ja=Hy.bind({k:1});function $9(e,t,r,n){es.p=t,z$=e,nw=r,iw=n}function Qs(e,t){let r=this||{};return function(){let n=arguments;function i(a,s){let l=Object.assign({},a),c=l.className||i.className;r.p=Object.assign({theme:nw&&nw()},l),r.o=/ *go\d+/.test(c),l.className=Hy.apply(r,n)+(c?" "+c:"");let u=e;return e[0]&&(u=l.as||e,delete l.as),iw&&u[0]&&iw(l),z$(u,l)}return i}}var M9=e=>typeof e=="function",Qp=(e,t)=>M9(e)?e(t):e,R9=(()=>{let e=0;return()=>(++e).toString()})(),U$=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),I9=20,W$=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,I9)};case 1:return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case 2:let{toast:r}=t;return W$(e,{type:e.toasts.find(a=>a.id===r.id)?1:0,toast:r});case 3:let{toastId:n}=t;return{...e,toasts:e.toasts.map(a=>a.id===n||n===void 0?{...a,dismissed:!0,visible:!1}:a)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+i}))}}},cp=[],Po={toasts:[],pausedAt:void 0},Al=e=>{Po=W$(Po,e),cp.forEach(t=>{t(Po)})},D9={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},L9=(e={})=>{let[t,r]=b.useState(Po),n=b.useRef(Po);b.useEffect(()=>(n.current!==Po&&r(Po),cp.push(r),()=>{let a=cp.indexOf(r);a>-1&&cp.splice(a,1)}),[]);let i=t.toasts.map(a=>{var s,l,c;return{...e,...e[a.type],...a,removeDelay:a.removeDelay||((s=e[a.type])==null?void 0:s.removeDelay)||(e==null?void 0:e.removeDelay),duration:a.duration||((l=e[a.type])==null?void 0:l.duration)||(e==null?void 0:e.duration)||D9[a.type],style:{...e.style,...(c=e[a.type])==null?void 0:c.style,...a.style}}});return{...t,toasts:i}},F9=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(r==null?void 0:r.id)||R9()}),Fh=e=>(t,r)=>{let n=F9(t,e,r);return Al({type:2,toast:n}),n.id},Tr=(e,t)=>Fh("blank")(e,t);Tr.error=Fh("error");Tr.success=Fh("success");Tr.loading=Fh("loading");Tr.custom=Fh("custom");Tr.dismiss=e=>{Al({type:3,toastId:e})};Tr.remove=e=>Al({type:4,toastId:e});Tr.promise=(e,t,r)=>{let n=Tr.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(i=>{let a=t.success?Qp(t.success,i):void 0;return a?Tr.success(a,{id:n,...r,...r==null?void 0:r.success}):Tr.dismiss(n),i}).catch(i=>{let a=t.error?Qp(t.error,i):void 0;a?Tr.error(a,{id:n,...r,...r==null?void 0:r.error}):Tr.dismiss(n)}),e};var B9=(e,t)=>{Al({type:1,toast:{id:e,height:t}})},z9=()=>{Al({type:5,time:Date.now()})},rf=new Map,U9=1e3,W9=(e,t=U9)=>{if(rf.has(e))return;let r=setTimeout(()=>{rf.delete(e),Al({type:4,toastId:e})},t);rf.set(e,r)},V9=e=>{let{toasts:t,pausedAt:r}=L9(e);b.useEffect(()=>{if(r)return;let a=Date.now(),s=t.map(l=>{if(l.duration===1/0)return;let c=(l.duration||0)+l.pauseDuration-(a-l.createdAt);if(c<0){l.visible&&Tr.dismiss(l.id);return}return setTimeout(()=>Tr.dismiss(l.id),c)});return()=>{s.forEach(l=>l&&clearTimeout(l))}},[t,r]);let n=b.useCallback(()=>{r&&Al({type:6,time:Date.now()})},[r]),i=b.useCallback((a,s)=>{let{reverseOrder:l=!1,gutter:c=8,defaultPosition:u}=s||{},d=t.filter(m=>(m.position||u)===(a.position||u)&&m.height),f=d.findIndex(m=>m.id===a.id),h=d.filter((m,y)=>ym.visible).slice(...l?[h+1]:[0,h]).reduce((m,y)=>m+(y.height||0)+c,0)},[t]);return b.useEffect(()=>{t.forEach(a=>{if(a.dismissed)W9(a.id,a.removeDelay);else{let s=rf.get(a.id);s&&(clearTimeout(s),rf.delete(a.id))}})},[t]),{toasts:t,handlers:{updateHeight:B9,startPause:z9,endPause:n,calculateOffset:i}}},H9=ja` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,q9=ja` from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; }`,K9=ja` from { transform: scale(0) rotate(90deg); opacity: 0; } to { transform: scale(1) rotate(90deg); opacity: 1; }`,G9=Qs("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${e=>e.primary||"#ff4b4b"}; position: relative; transform: rotate(45deg); animation: ${H9} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; animation: ${q9} 0.15s ease-out forwards; animation-delay: 150ms; position: absolute; border-radius: 3px; opacity: 0; background: ${e=>e.secondary||"#fff"}; bottom: 9px; left: 4px; height: 2px; width: 12px; } &:before { animation: ${K9} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } `,Y9=ja` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `,Z9=Qs("div")` width: 12px; height: 12px; box-sizing: border-box; border: 2px solid; border-radius: 100%; border-color: ${e=>e.secondary||"#e0e0e0"}; border-right-color: ${e=>e.primary||"#616161"}; animation: ${Y9} 1s linear infinite; `,X9=ja` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,Q9=ja` 0% { height: 0; width: 0; opacity: 0; } 40% { height: 0; width: 6px; opacity: 1; } 100% { opacity: 1; height: 10px; }`,J9=Qs("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${e=>e.primary||"#61d345"}; position: relative; transform: rotate(45deg); animation: ${X9} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; animation: ${Q9} 0.2s ease-out forwards; opacity: 0; animation-delay: 200ms; position: absolute; border-right: 2px solid; border-bottom: 2px solid; border-color: ${e=>e.secondary||"#fff"}; bottom: 6px; left: 6px; height: 10px; width: 6px; } `,e7=Qs("div")` position: absolute; `,t7=Qs("div")` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; `,r7=ja` from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; }`,n7=Qs("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; animation: ${r7} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; `,i7=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?b.createElement(n7,null,t):t:r==="blank"?null:b.createElement(t7,null,b.createElement(Z9,{...n}),r!=="loading"&&b.createElement(e7,null,r==="error"?b.createElement(G9,{...n}):b.createElement(J9,{...n})))},a7=e=>` 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} `,s7=e=>` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;} `,o7="0%{opacity:0;} 100%{opacity:1;}",l7="0%{opacity:1;} 100%{opacity:0;}",c7=Qs("div")` display: flex; align-items: center; background: #fff; color: #363636; line-height: 1.3; will-change: transform; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); max-width: 350px; pointer-events: auto; padding: 8px 10px; border-radius: 8px; `,u7=Qs("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; `,d7=(e,t)=>{let r=e.includes("top")?1:-1,[n,i]=U$()?[o7,l7]:[a7(r),s7(r)];return{animation:t?`${ja(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${ja(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},f7=b.memo(({toast:e,position:t,style:r,children:n})=>{let i=e.height?d7(e.position||t||"top-center",e.visible):{opacity:0},a=b.createElement(i7,{toast:e}),s=b.createElement(u7,{...e.ariaProps},Qp(e.message,e));return b.createElement(c7,{className:e.className,style:{...i,...r,...e.style}},typeof n=="function"?n({icon:a,message:s}):b.createElement(b.Fragment,null,a,s))});$9(b.createElement);var h7=({id:e,className:t,style:r,onHeightUpdate:n,children:i})=>{let a=b.useCallback(s=>{if(s){let l=()=>{let c=s.getBoundingClientRect().height;n(e,c)};l(),new MutationObserver(l).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return b.createElement("div",{ref:a,className:t,style:r},i)},m7=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:U$()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...i}},p7=Hy` z-index: 9999; > * { pointer-events: auto; } `,_m=16,g7=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:i,containerStyle:a,containerClassName:s})=>{let{toasts:l,handlers:c}=V9(r);return b.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:_m,left:_m,right:_m,bottom:_m,pointerEvents:"none",...a},className:s,onMouseEnter:c.startPause,onMouseLeave:c.endPause},l.map(u=>{let d=u.position||t,f=c.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),h=m7(d,f);return b.createElement(h7,{id:u.id,key:u.id,onHeightUpdate:c.updateHeight,className:u.visible?p7:"",style:h},u.type==="custom"?Qp(u.message,u):i?i(u):b.createElement(f7,{toast:u,position:d}))}))},bs=Tr;/** * @remix-run/router v1.23.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Mf(){return Mf=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function V$(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function v7(){return Math.random().toString(36).substr(2,8)}function ZS(e,t){return{usr:e.state,key:e.key,idx:t}}function aw(e,t,r,n){return r===void 0&&(r=null),Mf({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ru(t):t,{state:r,key:t&&t.key||n||v7()})}function Jp(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Ru(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function x7(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,s=i.history,l=ws.Pop,c=null,u=d();u==null&&(u=0,s.replaceState(Mf({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function f(){l=ws.Pop;let x=d(),g=x==null?null:x-u;u=x,c&&c({action:l,location:p.location,delta:g})}function h(x,g){l=ws.Push;let v=aw(p.location,x,g);u=d()+1;let w=ZS(v,u),_=p.createHref(v);try{s.pushState(w,"",_)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(_)}a&&c&&c({action:l,location:p.location,delta:1})}function m(x,g){l=ws.Replace;let v=aw(p.location,x,g);u=d();let w=ZS(v,u),_=p.createHref(v);s.replaceState(w,"",_),a&&c&&c({action:l,location:p.location,delta:0})}function y(x){let g=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof x=="string"?x:Jp(x);return v=v.replace(/ $/,"%20"),Rt(g,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,g)}let p={get action(){return l},get location(){return e(i,s)},listen(x){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(YS,f),c=x,()=>{i.removeEventListener(YS,f),c=null}},createHref(x){return t(i,x)},createURL:y,encodeLocation(x){let g=y(x);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:h,replace:m,go(x){return s.go(x)}};return p}var XS;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(XS||(XS={}));function b7(e,t,r){return r===void 0&&(r="/"),w7(e,t,r)}function w7(e,t,r,n){let i=typeof t=="string"?Ru(t):t,a=_2(i.pathname||"/",r);if(a==null)return null;let s=H$(e);j7(s);let l=null;for(let c=0;l==null&&c{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:s,route:a};c.relativePath.startsWith("/")&&(Rt(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=Rs([n,c.relativePath]),d=r.concat(c);a.children&&a.children.length>0&&(Rt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),H$(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:A7(u,a.index),routesMeta:d})};return e.forEach((a,s)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,s);else for(let c of q$(a.path))i(a,s,c)}),t}function q$(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let s=q$(n.join("/")),l=[];return l.push(...s.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...s),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function j7(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:P7(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const _7=/^:[\w-]+$/,N7=3,S7=2,k7=1,E7=10,O7=-2,QS=e=>e==="*";function A7(e,t){let r=e.split("/"),n=r.length;return r.some(QS)&&(n+=O7),t&&(n+=S7),r.filter(i=>!QS(i)).reduce((i,a)=>i+(_7.test(a)?N7:a===""?k7:E7),n)}function P7(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function C7(e,t,r){let{routesMeta:n}=e,i={},a="/",s=[];for(let l=0;l{let{paramName:h,isOptional:m}=d;if(h==="*"){let p=l[f]||"";s=a.slice(0,a.length-p.length).replace(/(.)\/+$/,"$1")}const y=l[f];return m&&!y?u[h]=void 0:u[h]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:s,pattern:e}}function $7(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),V$(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 n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function M7(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return V$(!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 _2(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function R7(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?Ru(e):e;return{pathname:r?r.startsWith("/")?r:I7(r,t):t,search:F7(n),hash:B7(i)}}function I7(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Uv(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function D7(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function N2(e,t){let r=D7(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function S2(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=Ru(e):(i=Mf({},e),Rt(!i.pathname||!i.pathname.includes("?"),Uv("?","pathname","search",i)),Rt(!i.pathname||!i.pathname.includes("#"),Uv("#","pathname","hash",i)),Rt(!i.search||!i.search.includes("#"),Uv("#","search","hash",i)));let a=e===""||i.pathname==="",s=a?"/":i.pathname,l;if(s==null)l=r;else{let f=t.length-1;if(!n&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=R7(i,l),u=s&&s!=="/"&&s.endsWith("/"),d=(a||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Rs=e=>e.join("/").replace(/\/\/+/g,"/"),L7=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),F7=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,B7=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function z7(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const K$=["post","put","patch","delete"];new Set(K$);const U7=["get",...K$];new Set(U7);/** * React Router v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Rf(){return Rf=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),b.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let f=S2(u,JSON.parse(s),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Rs([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,s,a,e])}function Z$(){let{matches:e}=b.useContext($a),t=e[e.length-1];return t?t.params:{}}function X$(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=b.useContext(Js),{matches:i}=b.useContext($a),{pathname:a}=eo(),s=JSON.stringify(N2(i,n.v7_relativeSplatPath));return b.useMemo(()=>S2(e,JSON.parse(s),a,r==="path"),[e,s,a,r])}function q7(e,t){return K7(e,t)}function K7(e,t,r,n){Iu()||Rt(!1);let{navigator:i}=b.useContext(Js),{matches:a}=b.useContext($a),s=a[a.length-1],l=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=eo(),d;if(t){var f;let x=typeof t=="string"?Ru(t):t;c==="/"||(f=x.pathname)!=null&&f.startsWith(c)||Rt(!1),d=x}else d=u;let h=d.pathname||"/",m=h;if(c!=="/"){let x=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(x.length).join("/")}let y=b7(e,{pathname:m}),p=Q7(y&&y.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:Rs([c,i.encodeLocation?i.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:Rs([c,i.encodeLocation?i.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),a,r,n);return t&&p?b.createElement(qy.Provider,{value:{location:Rf({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:ws.Pop}},p):p}function G7(){let e=rB(),t=z7(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),r?b.createElement("pre",{style:i},r):null,null)}const Y7=b.createElement(G7,null);class Z7 extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?b.createElement($a.Provider,{value:this.props.routeContext},b.createElement(G$.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function X7(e){let{routeContext:t,match:r,children:n}=e,i=b.useContext(k2);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),b.createElement($a.Provider,{value:t},n)}function Q7(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,l=(i=r)==null?void 0:i.errors;if(l!=null){let d=s.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||Rt(!1),s=s.slice(0,Math.min(s.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((d,f,h)=>{let m,y=!1,p=null,x=null;r&&(m=l&&f.route.id?l[f.route.id]:void 0,p=f.route.errorElement||Y7,c&&(u<0&&h===0?(iB("route-fallback"),y=!0,x=null):u===h&&(y=!0,x=f.route.hydrateFallbackElement||null)));let g=t.concat(s.slice(0,h+1)),v=()=>{let w;return m?w=p:y?w=x:f.route.Component?w=b.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,b.createElement(X7,{match:f,routeContext:{outlet:d,matches:g,isDataRoute:r!=null},children:w})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?b.createElement(Z7,{location:r.location,revalidation:r.revalidation,component:p,error:m,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()},null)}var Q$=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Q$||{}),J$=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(J$||{});function J7(e){let t=b.useContext(k2);return t||Rt(!1),t}function eB(e){let t=b.useContext(W7);return t||Rt(!1),t}function tB(e){let t=b.useContext($a);return t||Rt(!1),t}function e4(e){let t=tB(),r=t.matches[t.matches.length-1];return r.route.id||Rt(!1),r.route.id}function rB(){var e;let t=b.useContext(G$),r=eB(),n=e4();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function nB(){let{router:e}=J7(Q$.UseNavigateStable),t=e4(J$.UseNavigateStable),r=b.useRef(!1);return Y$(()=>{r.current=!0}),b.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Rf({fromRouteId:t},a)))},[e,t])}const JS={};function iB(e,t,r){JS[e]||(JS[e]=!0)}function aB(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function sB(e){let{to:t,replace:r,state:n,relative:i}=e;Iu()||Rt(!1);let{future:a,static:s}=b.useContext(Js),{matches:l}=b.useContext($a),{pathname:c}=eo(),u=to(),d=S2(t,N2(l,a.v7_relativeSplatPath),c,i==="path"),f=JSON.stringify(d);return b.useEffect(()=>u(JSON.parse(f),{replace:r,state:n,relative:i}),[u,f,i,r,n]),null}function xt(e){Rt(!1)}function oB(e){let{basename:t="/",children:r=null,location:n,navigationType:i=ws.Pop,navigator:a,static:s=!1,future:l}=e;Iu()&&Rt(!1);let c=t.replace(/^\/*/,"/"),u=b.useMemo(()=>({basename:c,navigator:a,static:s,future:Rf({v7_relativeSplatPath:!1},l)}),[c,l,a,s]);typeof n=="string"&&(n=Ru(n));let{pathname:d="/",search:f="",hash:h="",state:m=null,key:y="default"}=n,p=b.useMemo(()=>{let x=_2(d,c);return x==null?null:{location:{pathname:x,search:f,hash:h,state:m,key:y},navigationType:i}},[c,d,f,h,m,y,i]);return p==null?null:b.createElement(Js.Provider,{value:u},b.createElement(qy.Provider,{children:r,value:p}))}function lB(e){let{children:t,location:r}=e;return q7(sw(t),r)}new Promise(()=>{});function sw(e,t){t===void 0&&(t=[]);let r=[];return b.Children.forEach(e,(n,i)=>{if(!b.isValidElement(n))return;let a=[...t,i];if(n.type===b.Fragment){r.push.apply(r,sw(n.props.children,a));return}n.type!==xt&&Rt(!1),!n.props.index||!n.props.children||Rt(!1);let s={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=sw(n.props.children,a)),r.push(s)}),r}/** * React Router DOM v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function ow(){return ow=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function uB(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dB(e,t){return e.button===0&&(!t||t==="_self")&&!uB(e)}const fB=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],hB="6";try{window.__reactRouterVersion=hB}catch{}const mB="startTransition",ek=Zx[mB];function pB(e){let{basename:t,children:r,future:n,window:i}=e,a=b.useRef();a.current==null&&(a.current=y7({window:i,v5Compat:!0}));let s=a.current,[l,c]=b.useState({action:s.action,location:s.location}),{v7_startTransition:u}=n||{},d=b.useCallback(f=>{u&&ek?ek(()=>c(f)):c(f)},[c,u]);return b.useLayoutEffect(()=>s.listen(d),[s,d]),b.useEffect(()=>aB(n),[n]),b.createElement(oB,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const gB=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",yB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ot=b.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:s,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=cB(t,fB),{basename:m}=b.useContext(Js),y,p=!1;if(typeof u=="string"&&yB.test(u)&&(y=u,gB))try{let w=new URL(window.location.href),_=u.startsWith("//")?new URL(w.protocol+u):new URL(u),j=_2(_.pathname,m);_.origin===w.origin&&j!=null?u=j+_.search+_.hash:p=!0}catch{}let x=V7(u,{relative:i}),g=vB(u,{replace:s,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:f});function v(w){n&&n(w),w.defaultPrevented||g(w)}return b.createElement("a",ow({},h,{href:y||x,onClick:p||a?n:v,ref:r,target:c}))});var tk;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(tk||(tk={}));var rk;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(rk||(rk={}));function vB(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:s,viewTransition:l}=t===void 0?{}:t,c=to(),u=eo(),d=X$(e,{relative:s});return b.useCallback(f=>{if(dB(f,r)){f.preventDefault();let h=n!==void 0?n:Jp(u)===Jp(d);c(e,{replace:h,state:i,preventScrollReset:a,relative:s,viewTransition:l})}},[u,c,d,n,i,r,e,a,s,l])}function gr(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,n;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?kB:SB;i4.useSyncExternalStore=Gc.useSyncExternalStore!==void 0?Gc.useSyncExternalStore:EB;n4.exports=i4;var OB=n4.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ky=b,AB=OB;function PB(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var CB=typeof Object.is=="function"?Object.is:PB,TB=AB.useSyncExternalStore,$B=Ky.useRef,MB=Ky.useEffect,RB=Ky.useMemo,IB=Ky.useDebugValue;r4.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var a=$B(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=RB(function(){function c(m){if(!u){if(u=!0,d=m,m=n(m),i!==void 0&&s.hasValue){var y=s.value;if(i(y,m))return f=y}return f=m}if(y=f,CB(d,m))return y;var p=n(m);return i!==void 0&&i(y,p)?(d=m,y):(d=m,f=p)}var u=!1,d,f,h=r===void 0?null:r;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,r,n,i]);var l=TB(e,a[0],a[1]);return MB(function(){s.hasValue=!0,s.value=l},[l]),IB(l),l};t4.exports=r4;var DB=t4.exports;const LB=Xe(DB),FB={},nk=e=>{let t;const r=new Set,n=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const m=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),r.forEach(y=>y(t,m))}},i=()=>t,c={setState:n,getState:i,getInitialState:()=>u,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(FB?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},u=t=e(n,i,c);return c},BB=e=>e?nk(e):nk,{useDebugValue:zB}=T,{useSyncExternalStoreWithSelector:UB}=LB,WB=e=>e;function a4(e,t=WB,r){const n=UB(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return zB(n),n}const ik=(e,t)=>{const r=BB(e),n=(i,a=t)=>a4(r,i,a);return Object.assign(n,r),n},VB=(e,t)=>e?ik(e,t):ik;function cr(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[n,i]of e)if(!Object.is(i,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const n of r)if(!Object.prototype.hasOwnProperty.call(t,n)||!Object.is(e[n],t[n]))return!1;return!0}var HB={value:()=>{}};function Gy(){for(var e=0,t=arguments.length,r={},n;e=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}up.prototype=Gy.prototype={constructor:up,on:function(e,t){var r=this._,n=qB(e+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a0)for(var r=new Array(i),n=0,i,a;n=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),sk.hasOwnProperty(t)?{space:sk[t],local:e}:e}function GB(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===lw&&t.documentElement.namespaceURI===lw?t.createElement(e):t.createElementNS(r,e)}}function YB(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function s4(e){var t=Yy(e);return(t.local?YB:GB)(t)}function ZB(){}function E2(e){return e==null?ZB:function(){return this.querySelector(e)}}function XB(e){typeof e!="function"&&(e=E2(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i=w&&(w=v+1);!(j=x[w])&&++w=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function jz(e){e||(e=_z);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var r=this._groups,n=r.length,i=new Array(n),a=0;at?1:e>=t?0:NaN}function Nz(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Sz(){return Array.from(this)}function kz(){for(var e=this._groups,t=0,r=e.length;t1?this.each((t==null?Dz:typeof t=="function"?Fz:Lz)(e,t,r??"")):Yc(this.node(),e)}function Yc(e,t){return e.style.getPropertyValue(t)||d4(e).getComputedStyle(e,null).getPropertyValue(t)}function zz(e){return function(){delete this[e]}}function Uz(e,t){return function(){this[e]=t}}function Wz(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function Vz(e,t){return arguments.length>1?this.each((t==null?zz:typeof t=="function"?Wz:Uz)(e,t)):this.node()[e]}function f4(e){return e.trim().split(/^|\s+/)}function O2(e){return e.classList||new h4(e)}function h4(e){this._node=e,this._names=f4(e.getAttribute("class")||"")}h4.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 m4(e,t){for(var r=O2(e),n=-1,i=t.length;++n=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function vU(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,a;r()=>e;function cw(e,{sourceEvent:t,subject:r,target:n,identifier:i,active:a,x:s,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}cw.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function OU(e){return!e.ctrlKey&&!e.button}function AU(){return this.parentNode}function PU(e,t){return t??{x:e.x,y:e.y}}function CU(){return navigator.maxTouchPoints||"ontouchstart"in this}function TU(){var e=OU,t=AU,r=PU,n=CU,i={},a=Gy("start","drag","end"),s=0,l,c,u,d,f=0;function h(_){_.on("mousedown.drag",m).filter(n).on("touchstart.drag",x).on("touchmove.drag",g,EU).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(_,j){if(!(d||!e.call(this,_,j))){var N=w(this,t.call(this,_,j),_,j,"mouse");N&&(Pn(_.view).on("mousemove.drag",y,If).on("mouseup.drag",p,If),v4(_.view),Vv(_),u=!1,l=_.clientX,c=_.clientY,N("start",_))}}function y(_){if(jc(_),!u){var j=_.clientX-l,N=_.clientY-c;u=j*j+N*N>f}i.mouse("drag",_)}function p(_){Pn(_.view).on("mousemove.drag mouseup.drag",null),x4(_.view,u),jc(_),i.mouse("end",_)}function x(_,j){if(e.call(this,_,j)){var N=_.changedTouches,S=t.call(this,_,j),E=N.length,k,A;for(k=0;k>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Sm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Sm(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=MU.exec(e))?new qr(t[1],t[2],t[3],1):(t=RU.exec(e))?new qr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=IU.exec(e))?Sm(t[1],t[2],t[3],t[4]):(t=DU.exec(e))?Sm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=LU.exec(e))?hk(t[1],t[2]/100,t[3]/100,1):(t=FU.exec(e))?hk(t[1],t[2]/100,t[3]/100,t[4]):ok.hasOwnProperty(e)?uk(ok[e]):e==="transparent"?new qr(NaN,NaN,NaN,0):null}function uk(e){return new qr(e>>16&255,e>>8&255,e&255,1)}function Sm(e,t,r,n){return n<=0&&(e=t=r=NaN),new qr(e,t,r,n)}function UU(e){return e instanceof zh||(e=dl(e)),e?(e=e.rgb(),new qr(e.r,e.g,e.b,e.opacity)):new qr}function uw(e,t,r,n){return arguments.length===1?UU(e):new qr(e,t,r,n??1)}function qr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}A2(qr,uw,b4(zh,{brighter(e){return e=e==null?tg:Math.pow(tg,e),new qr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Df:Math.pow(Df,e),new qr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qr(Xo(this.r),Xo(this.g),Xo(this.b),rg(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:dk,formatHex:dk,formatHex8:WU,formatRgb:fk,toString:fk}));function dk(){return`#${Co(this.r)}${Co(this.g)}${Co(this.b)}`}function WU(){return`#${Co(this.r)}${Co(this.g)}${Co(this.b)}${Co((isNaN(this.opacity)?1:this.opacity)*255)}`}function fk(){const e=rg(this.opacity);return`${e===1?"rgb(":"rgba("}${Xo(this.r)}, ${Xo(this.g)}, ${Xo(this.b)}${e===1?")":`, ${e})`}`}function rg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Co(e){return e=Xo(e),(e<16?"0":"")+e.toString(16)}function hk(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new oi(e,t,r,n)}function w4(e){if(e instanceof oi)return new oi(e.h,e.s,e.l,e.opacity);if(e instanceof zh||(e=dl(e)),!e)return new oi;if(e instanceof oi)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),s=NaN,l=a-i,c=(a+i)/2;return l?(t===a?s=(r-n)/l+(r0&&c<1?0:s,new oi(s,l,c,e.opacity)}function VU(e,t,r,n){return arguments.length===1?w4(e):new oi(e,t,r,n??1)}function oi(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}A2(oi,VU,b4(zh,{brighter(e){return e=e==null?tg:Math.pow(tg,e),new oi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Df:Math.pow(Df,e),new oi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new qr(Hv(e>=240?e-240:e+120,i,n),Hv(e,i,n),Hv(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new oi(mk(this.h),km(this.s),km(this.l),rg(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=rg(this.opacity);return`${e===1?"hsl(":"hsla("}${mk(this.h)}, ${km(this.s)*100}%, ${km(this.l)*100}%${e===1?")":`, ${e})`}`}}));function mk(e){return e=(e||0)%360,e<0?e+360:e}function km(e){return Math.max(0,Math.min(1,e||0))}function Hv(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const P2=e=>()=>e;function HU(e,t){return function(r){return e+r*t}}function qU(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function KU(e){return(e=+e)==1?j4:function(t,r){return r-t?qU(t,r,e):P2(isNaN(t)?r:t)}}function j4(e,t){var r=t-e;return r?HU(e,r):P2(isNaN(e)?t:e)}const ng=function e(t){var r=KU(t);function n(i,a){var s=r((i=uw(i)).r,(a=uw(a)).r),l=r(i.g,a.g),c=r(i.b,a.b),u=j4(i.opacity,a.opacity);return function(d){return i.r=s(d),i.g=l(d),i.b=c(d),i.opacity=u(d),i+""}}return n.gamma=e,n}(1);function GU(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),l[s]?l[s]+=a:l[++s]=a),(n=n[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,c.push({i:s,x:si(n,i)})),r=qv.lastIndex;return r180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(i(f)+"rotate(",null,n)-2,x:si(u,d)})):d&&f.push(i(f)+"rotate("+d+n)}function l(u,d,f,h){u!==d?h.push({i:f.push(i(f)+"skewX(",null,n)-2,x:si(u,d)}):d&&f.push(i(f)+"skewX("+d+n)}function c(u,d,f,h,m,y){if(u!==f||d!==h){var p=m.push(i(m)+"scale(",null,",",null,")");y.push({i:p-4,x:si(u,f)},{i:p-2,x:si(d,h)})}else(f!==1||h!==1)&&m.push(i(m)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),a(u.translateX,u.translateY,d.translateX,d.translateY,f,h),s(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(m){for(var y=-1,p=h.length,x;++y=0&&e._call.call(void 0,t),e=e._next;--Zc}function yk(){fl=(ag=Ff.now())+Zy,Zc=Dd=0;try{dW()}finally{Zc=0,hW(),fl=0}}function fW(){var e=Ff.now(),t=e-ag;t>k4&&(Zy-=t,ag=e)}function hW(){for(var e,t=ig,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:ig=r);Ld=e,hw(n)}function hw(e){if(!Zc){Dd&&(Dd=clearTimeout(Dd));var t=e-fl;t>24?(e<1/0&&(Dd=setTimeout(yk,e-Ff.now()-Zy)),ld&&(ld=clearInterval(ld))):(ld||(ag=Ff.now(),ld=setInterval(fW,k4)),Zc=1,E4(yk))}}function vk(e,t,r){var n=new sg;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var mW=Gy("start","end","cancel","interrupt"),pW=[],A4=0,xk=1,mw=2,dp=3,bk=4,pw=5,fp=6;function Xy(e,t,r,n,i,a){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;gW(e,r,{name:t,index:n,group:i,on:mW,tween:pW,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:A4})}function $2(e,t){var r=yi(e,t);if(r.state>A4)throw new Error("too late; already scheduled");return r}function Vi(e,t){var r=yi(e,t);if(r.state>dp)throw new Error("too late; already running");return r}function yi(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function gW(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=O4(a,0,r.time);function a(u){r.state=xk,r.timer.restart(s,r.delay,r.time),r.delay<=u&&s(u-r.delay)}function s(u){var d,f,h,m;if(r.state!==xk)return c();for(d in n)if(m=n[d],m.name===r.name){if(m.state===dp)return vk(s);m.state===bk?(m.state=fp,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete n[d]):+dmw&&n.state=0&&(t=t.slice(0,r)),!t||t==="start"})}function qW(e,t,r){var n,i,a=HW(t)?$2:Vi;return function(){var s=a(this,e),l=s.on;l!==n&&(i=(n=l).copy()).on(t,r),s.on=i}}function KW(e,t){var r=this._id;return arguments.length<2?yi(this.node(),r).on.on(e):this.each(qW(r,e,t))}function GW(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function YW(){return this.on("end.remove",GW(this._id))}function ZW(e){var t=this._name,r=this._id;typeof e!="function"&&(e=E2(e));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s()=>e;function wV(e,{sourceEvent:t,target:r,transform:n,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:i}})}function oa(e,t,r){this.k=e,this.x=t,this.y=r}oa.prototype={constructor:oa,scale:function(e){return e===1?this:new oa(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new oa(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 ma=new oa(1,0,0);oa.prototype;function Kv(e){e.stopImmediatePropagation()}function cd(e){e.preventDefault(),e.stopImmediatePropagation()}function jV(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function _V(){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 wk(){return this.__zoom||ma}function NV(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function SV(){return navigator.maxTouchPoints||"ontouchstart"in this}function kV(e,t,r){var n=e.invertX(t[0][0])-r[0][0],i=e.invertX(t[1][0])-r[1][0],a=e.invertY(t[0][1])-r[0][1],s=e.invertY(t[1][1])-r[1][1];return e.translate(i>n?(n+i)/2:Math.min(0,n)||Math.max(0,i),s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s))}function $4(){var e=jV,t=_V,r=kV,n=NV,i=SV,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,c=lW,u=Gy("start","zoom","end"),d,f,h,m=500,y=150,p=0,x=10;function g(O){O.property("__zoom",wk).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",A).filter(i).on("touchstart.zoom",C).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",$).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(O,I,D,L){var R=O.selection?O.selection():O;R.property("__zoom",wk),O!==R?j(O,I,D,L):R.interrupt().each(function(){N(this,arguments).event(L).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},g.scaleBy=function(O,I,D,L){g.scaleTo(O,function(){var R=this.__zoom.k,M=typeof I=="function"?I.apply(this,arguments):I;return R*M},D,L)},g.scaleTo=function(O,I,D,L){g.transform(O,function(){var R=t.apply(this,arguments),M=this.__zoom,B=D==null?_(R):typeof D=="function"?D.apply(this,arguments):D,U=M.invert(B),W=typeof I=="function"?I.apply(this,arguments):I;return r(w(v(M,W),B,U),R,s)},D,L)},g.translateBy=function(O,I,D,L){g.transform(O,function(){return r(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),s)},null,L)},g.translateTo=function(O,I,D,L,R){g.transform(O,function(){var M=t.apply(this,arguments),B=this.__zoom,U=L==null?_(M):typeof L=="function"?L.apply(this,arguments):L;return r(ma.translate(U[0],U[1]).scale(B.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof D=="function"?-D.apply(this,arguments):-D),M,s)},L,R)};function v(O,I){return I=Math.max(a[0],Math.min(a[1],I)),I===O.k?O:new oa(I,O.x,O.y)}function w(O,I,D){var L=I[0]-D[0]*O.k,R=I[1]-D[1]*O.k;return L===O.x&&R===O.y?O:new oa(O.k,L,R)}function _(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function j(O,I,D,L){O.on("start.zoom",function(){N(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(L).end()}).tween("zoom",function(){var R=this,M=arguments,B=N(R,M).event(L),U=t.apply(R,M),W=D==null?_(U):typeof D=="function"?D.apply(R,M):D,Z=Math.max(U[1][0]-U[0][0],U[1][1]-U[0][1]),q=R.__zoom,ee=typeof I=="function"?I.apply(R,M):I,le=c(q.invert(W).concat(Z/q.k),ee.invert(W).concat(Z/ee.k));return function(ve){if(ve===1)ve=ee;else{var Ne=le(ve),J=Z/Ne[2];ve=new oa(J,W[0]-Ne[0]*J,W[1]-Ne[1]*J)}B.zoom(null,ve)}})}function N(O,I,D){return!D&&O.__zooming||new S(O,I)}function S(O,I){this.that=O,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(O,I),this.taps=0}S.prototype={event:function(O){return O&&(this.sourceEvent=O),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(O,I){return this.mouse&&O!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&O!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&O!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(O){var I=Pn(this.that).datum();u.call(O,this.that,new wV(O,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:u}),I)}};function E(O,...I){if(!e.apply(this,arguments))return;var D=N(this,I).event(O),L=this.__zoom,R=Math.max(a[0],Math.min(a[1],L.k*Math.pow(2,n.apply(this,arguments)))),M=Jn(O);if(D.wheel)(D.mouse[0][0]!==M[0]||D.mouse[0][1]!==M[1])&&(D.mouse[1]=L.invert(D.mouse[0]=M)),clearTimeout(D.wheel);else{if(L.k===R)return;D.mouse=[M,L.invert(M)],hp(this),D.start()}cd(O),D.wheel=setTimeout(B,y),D.zoom("mouse",r(w(v(L,R),D.mouse[0],D.mouse[1]),D.extent,s));function B(){D.wheel=null,D.end()}}function k(O,...I){if(h||!e.apply(this,arguments))return;var D=O.currentTarget,L=N(this,I,!0).event(O),R=Pn(O.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",Z,!0),M=Jn(O,D),B=O.clientX,U=O.clientY;v4(O.view),Kv(O),L.mouse=[M,this.__zoom.invert(M)],hp(this),L.start();function W(q){if(cd(q),!L.moved){var ee=q.clientX-B,le=q.clientY-U;L.moved=ee*ee+le*le>p}L.event(q).zoom("mouse",r(w(L.that.__zoom,L.mouse[0]=Jn(q,D),L.mouse[1]),L.extent,s))}function Z(q){R.on("mousemove.zoom mouseup.zoom",null),x4(q.view,L.moved),cd(q),L.event(q).end()}}function A(O,...I){if(e.apply(this,arguments)){var D=this.__zoom,L=Jn(O.changedTouches?O.changedTouches[0]:O,this),R=D.invert(L),M=D.k*(O.shiftKey?.5:2),B=r(w(v(D,M),L,R),t.apply(this,I),s);cd(O),l>0?Pn(this).transition().duration(l).call(j,B,L,O):Pn(this).call(g.transform,B,L,O)}}function C(O,...I){if(e.apply(this,arguments)){var D=O.touches,L=D.length,R=N(this,I,O.changedTouches.length===L).event(O),M,B,U,W;for(Kv(O),B=0;B"[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,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,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.`},M4=Na.error001();function ft(e,t){const r=b.useContext(Qy);if(r===null)throw new Error(M4);return a4(r,e,t)}const er=()=>{const e=b.useContext(Qy);if(e===null)throw new Error(M4);return b.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},OV=e=>e.userSelectionActive?"none":"all";function Jy({position:e,children:t,className:r,style:n,...i}){const a=ft(OV),s=`${e}`.split("-");return T.createElement("div",{className:gr(["react-flow__panel",r,...s]),style:{...n,pointerEvents:a},...i},t)}function AV({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:T.createElement(Jy,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},T.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const PV=({x:e,y:t,label:r,labelStyle:n={},labelShowBg:i=!0,labelBgStyle:a={},labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d})=>{const f=b.useRef(null),[h,m]=b.useState({x:0,y:0,width:0,height:0}),y=gr(["react-flow__edge-textwrapper",u]);return b.useEffect(()=>{if(f.current){const p=f.current.getBBox();m({x:p.x,y:p.y,width:p.width,height:p.height})}},[r]),typeof r>"u"||!r?null:T.createElement("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:y,visibility:h.width?"visible":"hidden",...d},i&&T.createElement("rect",{width:h.width+2*s[0],x:-s[0],y:-s[1],height:h.height+2*s[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),T.createElement("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:f,style:n},r),c)};var CV=b.memo(PV);const R2=e=>({width:e.offsetWidth,height:e.offsetHeight}),Xc=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),I2=(e={x:0,y:0},t)=>({x:Xc(e.x,t[0][0],t[1][0]),y:Xc(e.y,t[0][1],t[1][1])}),jk=(e,t,r)=>er?-Xc(Math.abs(e-r),1,50)/50:0,R4=(e,t)=>{const r=jk(e.x,35,t.width-35)*20,n=jk(e.y,35,t.height-35)*20;return[r,n]},I4=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},D4=(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)}),Bf=({x:e,y:t,width:r,height:n})=>({x:e,y:t,x2:e+r,y2:t+n}),L4=({x:e,y:t,x2:r,y2:n})=>({x:e,y:t,width:r-e,height:n-t}),_k=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),TV=(e,t)=>L4(D4(Bf(e),Bf(t))),gw=(e,t)=>{const r=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),n=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(r*n)},$V=e=>$n(e.width)&&$n(e.height)&&$n(e.x)&&$n(e.y),$n=e=>!isNaN(e)&&isFinite(e),Pt=Symbol.for("internals"),F4=["Enter"," ","Escape"],MV=(e,t)=>{},RV=e=>"nativeEvent"in e;function yw(e){var i,a;const t=RV(e)?e.nativeEvent:e,r=((a=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:a[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(r==null?void 0:r.nodeName)||(r==null?void 0:r.hasAttribute("contenteditable"))||!!(r!=null&&r.closest(".nokey"))}const B4=e=>"clientX"in e,Is=(e,t)=>{var a,s;const r=B4(e),n=r?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,i=r?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:n-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},og=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Uh=({id:e,path:t,labelX:r,labelY:n,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:h,interactionWidth:m=20})=>T.createElement(T.Fragment,null,T.createElement("path",{id:e,style:d,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:h}),m&&T.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:m,className:"react-flow__edge-interaction"}),i&&$n(r)&&$n(n)?T.createElement(CV,{x:r,y:n,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);Uh.displayName="BaseEdge";function ud(e,t,r){return r===void 0?r:n=>{const i=t().edges.find(a=>a.id===e);i&&r(n,{...i})}}function z4({sourceX:e,sourceY:t,targetX:r,targetY:n}){const i=Math.abs(r-e)/2,a=r{const[x,g,v]=W4({sourceX:e,sourceY:t,sourcePosition:i,targetX:r,targetY:n,targetPosition:a});return T.createElement(Uh,{path:x,labelX:g,labelY:v,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:y,interactionWidth:p})});D2.displayName="SimpleBezierEdge";const Sk={[je.Left]:{x:-1,y:0},[je.Right]:{x:1,y:0},[je.Top]:{x:0,y:-1},[je.Bottom]:{x:0,y:1}},IV=({source:e,sourcePosition:t=je.Bottom,target:r})=>t===je.Left||t===je.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function DV({source:e,sourcePosition:t=je.Bottom,target:r,targetPosition:n=je.Top,center:i,offset:a}){const s=Sk[t],l=Sk[n],c={x:e.x+s.x*a,y:e.y+s.y*a},u={x:r.x+l.x*a,y:r.y+l.y*a},d=IV({source:c,sourcePosition:t,target:u}),f=d.x!==0?"x":"y",h=d[f];let m=[],y,p;const x={x:0,y:0},g={x:0,y:0},[v,w,_,j]=z4({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(s[f]*l[f]===-1){y=i.x??v,p=i.y??w;const S=[{x:y,y:c.y},{x:y,y:u.y}],E=[{x:c.x,y:p},{x:u.x,y:p}];s[f]===h?m=f==="x"?S:E:m=f==="x"?E:S}else{const S=[{x:c.x,y:u.y}],E=[{x:u.x,y:c.y}];if(f==="x"?m=s.x===h?E:S:m=s.y===h?S:E,t===n){const $=Math.abs(e[f]-r[f]);if($<=a){const O=Math.min(a-1,a-$);s[f]===h?x[f]=(c[f]>e[f]?-1:1)*O:g[f]=(u[f]>r[f]?-1:1)*O}}if(t!==n){const $=f==="x"?"y":"x",O=s[f]===l[$],I=c[$]>u[$],D=c[$]=P?(y=(k.x+A.x)/2,p=m[0].y):(y=m[0].x,p=(k.y+A.y)/2)}return[[e,{x:c.x+x.x,y:c.y+x.y},...m,{x:u.x+g.x,y:u.y+g.y},r],y,p,_,j]}function LV(e,t,r,n){const i=Math.min(kk(e,t)/2,kk(t,r)/2,n),{x:a,y:s}=t;if(e.x===a&&a===r.x||e.y===s&&s===r.y)return`L${a} ${s}`;if(e.y===s){const u=e.x{let w="";return v>0&&v{const[g,v,w]=vw({sourceX:e,sourceY:t,sourcePosition:f,targetX:r,targetY:n,targetPosition:h,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset});return T.createElement(Uh,{path:g,labelX:v,labelY:w,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:m,markerStart:y,interactionWidth:x})});e0.displayName="SmoothStepEdge";const L2=b.memo(e=>{var t;return T.createElement(e0,{...e,pathOptions:b.useMemo(()=>{var r;return{borderRadius:0,offset:(r=e.pathOptions)==null?void 0:r.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});L2.displayName="StepEdge";function FV({sourceX:e,sourceY:t,targetX:r,targetY:n}){const[i,a,s,l]=z4({sourceX:e,sourceY:t,targetX:r,targetY:n});return[`M ${e},${t}L ${r},${n}`,i,a,s,l]}const F2=b.memo(({sourceX:e,sourceY:t,targetX:r,targetY:n,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:h,interactionWidth:m})=>{const[y,p,x]=FV({sourceX:e,sourceY:t,targetX:r,targetY:n});return T.createElement(Uh,{path:y,labelX:p,labelY:x,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:h,interactionWidth:m})});F2.displayName="StraightEdge";function Am(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Ek({pos:e,x1:t,y1:r,x2:n,y2:i,c:a}){switch(e){case je.Left:return[t-Am(t-n,a),r];case je.Right:return[t+Am(n-t,a),r];case je.Top:return[t,r-Am(r-i,a)];case je.Bottom:return[t,r+Am(i-r,a)]}}function V4({sourceX:e,sourceY:t,sourcePosition:r=je.Bottom,targetX:n,targetY:i,targetPosition:a=je.Top,curvature:s=.25}){const[l,c]=Ek({pos:r,x1:e,y1:t,x2:n,y2:i,c:s}),[u,d]=Ek({pos:a,x1:n,y1:i,x2:e,y2:t,c:s}),[f,h,m,y]=U4({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${n},${i}`,f,h,m,y]}const cg=b.memo(({sourceX:e,sourceY:t,targetX:r,targetY:n,sourcePosition:i=je.Bottom,targetPosition:a=je.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:y,pathOptions:p,interactionWidth:x})=>{const[g,v,w]=V4({sourceX:e,sourceY:t,sourcePosition:i,targetX:r,targetY:n,targetPosition:a,curvature:p==null?void 0:p.curvature});return T.createElement(Uh,{path:g,labelX:v,labelY:w,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:y,interactionWidth:x})});cg.displayName="BezierEdge";const B2=b.createContext(null),BV=B2.Provider;B2.Consumer;const zV=()=>b.useContext(B2),UV=e=>"id"in e&&"source"in e&&"target"in e,WV=({source:e,sourceHandle:t,target:r,targetHandle:n})=>`reactflow__edge-${e}${t||""}-${r}${n||""}`,xw=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(n=>`${n}=${e[n]}`).join("&")}`,VV=(e,t)=>t.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),H4=(e,t)=>{if(!e.source||!e.target)return t;let r;return UV(e)?r={...e}:r={...e,id:WV(e)},VV(r,t)?t:t.concat(r)},bw=({x:e,y:t},[r,n,i],a,[s,l])=>{const c={x:(e-r)/i,y:(t-n)/i};return a?{x:s*Math.round(c.x/s),y:l*Math.round(c.y/l)}:c},q4=({x:e,y:t},[r,n,i])=>({x:e*i+r,y:t*i+n}),Qo=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const r=(e.width??0)*t[0],n=(e.height??0)*t[1],i={x:e.position.x-r,y:e.position.y-n};return{...i,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-r,y:e.positionAbsolute.y-n}:i}},t0=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((n,i)=>{const{x:a,y:s}=Qo(i,t).positionAbsolute;return D4(n,Bf({x:a,y:s,width:i.width||0,height:i.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return L4(r)},K4=(e,t,[r,n,i]=[0,0,1],a=!1,s=!1,l=[0,0])=>{const c={x:(t.x-r)/i,y:(t.y-n)/i,width:t.width/i,height:t.height/i},u=[];return e.forEach(d=>{const{width:f,height:h,selectable:m=!0,hidden:y=!1}=d;if(s&&!m||y)return!1;const{positionAbsolute:p}=Qo(d,l),x={x:p.x,y:p.y,width:f||0,height:h||0},g=gw(c,x),v=typeof f>"u"||typeof h>"u"||f===null||h===null,w=a&&g>0,_=(f||0)*(h||0);(v||w||g>=_||d.dragging)&&u.push(d)}),u},G4=(e,t)=>{const r=e.map(n=>n.id);return t.filter(n=>r.includes(n.source)||r.includes(n.target))},Y4=(e,t,r,n,i,a=.1)=>{const s=t/(e.width*(1+a)),l=r/(e.height*(1+a)),c=Math.min(s,l),u=Xc(c,n,i),d=e.x+e.width/2,f=e.y+e.height/2,h=t/2-d*u,m=r/2-f*u;return{x:h,y:m,zoom:u}},yo=(e,t=0)=>e.transition().duration(t);function Ok(e,t,r,n){return(t[r]||[]).reduce((i,a)=>{var s,l;return`${e.id}-${a.id}-${r}`!==n&&i.push({id:a.id||null,type:r,nodeId:e.id,x:(((s=e.positionAbsolute)==null?void 0:s.x)??0)+a.x+a.width/2,y:(((l=e.positionAbsolute)==null?void 0:l.y)??0)+a.y+a.height/2}),i},[])}function HV(e,t,r,n,i,a){const{x:s,y:l}=Is(e),u=t.elementsFromPoint(s,l).find(y=>y.classList.contains("react-flow__handle"));if(u){const y=u.getAttribute("data-nodeid");if(y){const p=z2(void 0,u),x=u.getAttribute("data-handleid"),g=a({nodeId:y,id:x,type:p});if(g){const v=i.find(w=>w.nodeId===y&&w.type===p&&w.id===x);return{handle:{id:x,type:p,nodeId:y,x:(v==null?void 0:v.x)||r.x,y:(v==null?void 0:v.y)||r.y},validHandleResult:g}}}}let d=[],f=1/0;if(i.forEach(y=>{const p=Math.sqrt((y.x-r.x)**2+(y.y-r.y)**2);if(p<=n){const x=a(y);p<=f&&(py.isValid),m=d.some(({handle:y})=>y.type==="target");return d.find(({handle:y,validHandleResult:p})=>m?y.type==="target":h?p.isValid:!0)||d[0]}const qV={source:null,target:null,sourceHandle:null,targetHandle:null},Z4=()=>({handleDomNode:null,isValid:!1,connection:qV,endHandle:null});function X4(e,t,r,n,i,a,s){const l=i==="target",c=s.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),u={...Z4(),handleDomNode:c};if(c){const d=z2(void 0,c),f=c.getAttribute("data-nodeid"),h=c.getAttribute("data-handleid"),m=c.classList.contains("connectable"),y=c.classList.contains("connectableend"),p={source:l?f:r,sourceHandle:l?h:n,target:l?r:f,targetHandle:l?n:h};u.connection=p,m&&y&&(t===hl.Strict?l&&d==="source"||!l&&d==="target":f!==r||h!==n)&&(u.endHandle={nodeId:f,handleId:h,type:d},u.isValid=a(p))}return u}function KV({nodes:e,nodeId:t,handleId:r,handleType:n}){return e.reduce((i,a)=>{if(a[Pt]){const{handleBounds:s}=a[Pt];let l=[],c=[];s&&(l=Ok(a,s,"source",`${t}-${r}-${n}`),c=Ok(a,s,"target",`${t}-${r}-${n}`)),i.push(...l,...c)}return i},[])}function z2(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Gv(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function GV(e,t){let r=null;return t?r="valid":e&&!t&&(r="invalid"),r}function Q4({event:e,handleId:t,nodeId:r,onConnect:n,isTarget:i,getState:a,setState:s,isValidConnection:l,edgeUpdaterType:c,onReconnectEnd:u}){const d=I4(e.target),{connectionMode:f,domNode:h,autoPanOnConnect:m,connectionRadius:y,onConnectStart:p,panBy:x,getNodes:g,cancelConnection:v}=a();let w=0,_;const{x:j,y:N}=Is(e),S=d==null?void 0:d.elementFromPoint(j,N),E=z2(c,S),k=h==null?void 0:h.getBoundingClientRect();if(!k||!E)return;let A,C=Is(e,k),P=!1,$=null,O=!1,I=null;const D=KV({nodes:g(),nodeId:r,handleId:t,handleType:E}),L=()=>{if(!m)return;const[B,U]=R4(C,k);x({x:B,y:U}),w=requestAnimationFrame(L)};s({connectionPosition:C,connectionStatus:null,connectionNodeId:r,connectionHandleId:t,connectionHandleType:E,connectionStartHandle:{nodeId:r,handleId:t,type:E},connectionEndHandle:null}),p==null||p(e,{nodeId:r,handleId:t,handleType:E});function R(B){const{transform:U}=a();C=Is(B,k);const{handle:W,validHandleResult:Z}=HV(B,d,bw(C,U,!1,[1,1]),y,D,q=>X4(q,f,r,t,i?"target":"source",l,d));if(_=W,P||(L(),P=!0),I=Z.handleDomNode,$=Z.connection,O=Z.isValid,s({connectionPosition:_&&O?q4({x:_.x,y:_.y},U):C,connectionStatus:GV(!!_,O),connectionEndHandle:Z.endHandle}),!_&&!O&&!I)return Gv(A);$.source!==$.target&&I&&(Gv(A),A=I,I.classList.add("connecting","react-flow__handle-connecting"),I.classList.toggle("valid",O),I.classList.toggle("react-flow__handle-valid",O))}function M(B){var U,W;(_||I)&&$&&O&&(n==null||n($)),(W=(U=a()).onConnectEnd)==null||W.call(U,B),c&&(u==null||u(B)),Gv(A),v(),cancelAnimationFrame(w),P=!1,O=!1,$=null,I=null,d.removeEventListener("mousemove",R),d.removeEventListener("mouseup",M),d.removeEventListener("touchmove",R),d.removeEventListener("touchend",M)}d.addEventListener("mousemove",R),d.addEventListener("mouseup",M),d.addEventListener("touchmove",R),d.addEventListener("touchend",M)}const Ak=()=>!0,YV=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),ZV=(e,t,r)=>n=>{const{connectionStartHandle:i,connectionEndHandle:a,connectionClickStartHandle:s}=n;return{connecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===r||(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.handleId)===t&&(a==null?void 0:a.type)===r,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===r}},J4=b.forwardRef(({type:e="source",position:t=je.Top,isValidConnection:r,isConnectable:n=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:s,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},m)=>{var k,A;const y=s||null,p=e==="target",x=er(),g=zV(),{connectOnClick:v,noPanClassName:w}=ft(YV,cr),{connecting:_,clickConnecting:j}=ft(ZV(g,y,e),cr);g||(A=(k=x.getState()).onError)==null||A.call(k,"010",Na.error010());const N=C=>{const{defaultEdgeOptions:P,onConnect:$,hasDefaultEdges:O}=x.getState(),I={...P,...C};if(O){const{edges:D,setEdges:L}=x.getState();L(H4(I,D))}$==null||$(I),l==null||l(I)},S=C=>{if(!g)return;const P=B4(C);i&&(P&&C.button===0||!P)&&Q4({event:C,handleId:y,nodeId:g,onConnect:N,isTarget:p,getState:x.getState,setState:x.setState,isValidConnection:r||x.getState().isValidConnection||Ak}),P?d==null||d(C):f==null||f(C)},E=C=>{const{onClickConnectStart:P,onClickConnectEnd:$,connectionClickStartHandle:O,connectionMode:I,isValidConnection:D}=x.getState();if(!g||!O&&!i)return;if(!O){P==null||P(C,{nodeId:g,handleId:y,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:g,type:e,handleId:y}});return}const L=I4(C.target),R=r||D||Ak,{connection:M,isValid:B}=X4({nodeId:g,id:y,type:e},I,O.nodeId,O.handleId||null,O.type,R,L);B&&N(M),$==null||$(C),x.setState({connectionClickStartHandle:null})};return T.createElement("div",{"data-handleid":y,"data-nodeid":g,"data-handlepos":t,"data-id":`${g}-${y}-${e}`,className:gr(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",w,u,{source:!p,target:p,connectable:n,connectablestart:i,connectableend:a,connecting:j,connectionindicator:n&&(i&&!_||a&&_)}]),onMouseDown:S,onTouchStart:S,onClick:v?E:void 0,ref:m,...h},c)});J4.displayName="Handle";var ug=b.memo(J4);const e3=({data:e,isConnectable:t,targetPosition:r=je.Top,sourcePosition:n=je.Bottom})=>T.createElement(T.Fragment,null,T.createElement(ug,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label,T.createElement(ug,{type:"source",position:n,isConnectable:t}));e3.displayName="DefaultNode";var ww=b.memo(e3);const t3=({data:e,isConnectable:t,sourcePosition:r=je.Bottom})=>T.createElement(T.Fragment,null,e==null?void 0:e.label,T.createElement(ug,{type:"source",position:r,isConnectable:t}));t3.displayName="InputNode";var r3=b.memo(t3);const n3=({data:e,isConnectable:t,targetPosition:r=je.Top})=>T.createElement(T.Fragment,null,T.createElement(ug,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label);n3.displayName="OutputNode";var i3=b.memo(n3);const U2=()=>null;U2.displayName="GroupNode";const XV=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),Pm=e=>e.id;function QV(e,t){return cr(e.selectedNodes.map(Pm),t.selectedNodes.map(Pm))&&cr(e.selectedEdges.map(Pm),t.selectedEdges.map(Pm))}const a3=b.memo(({onSelectionChange:e})=>{const t=er(),{selectedNodes:r,selectedEdges:n}=ft(XV,QV);return b.useEffect(()=>{const i={nodes:r,edges:n};e==null||e(i),t.getState().onSelectionChange.forEach(a=>a(i))},[r,n,e]),null});a3.displayName="SelectionListener";const JV=e=>!!e.onSelectionChange;function eH({onSelectionChange:e}){const t=ft(JV);return e||t?T.createElement(a3,{onSelectionChange:e}):null}const tH=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function Dl(e,t){b.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function De(e,t,r){b.useEffect(()=>{typeof t<"u"&&r({[e]:t})},[t])}const rH=({nodes:e,edges:t,defaultNodes:r,defaultEdges:n,onConnect:i,onConnectStart:a,onConnectEnd:s,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:u,nodesConnectable:d,nodesFocusable:f,edgesFocusable:h,edgesUpdatable:m,elevateNodesOnSelect:y,minZoom:p,maxZoom:x,nodeExtent:g,onNodesChange:v,onEdgesChange:w,elementsSelectable:_,connectionMode:j,snapGrid:N,snapToGrid:S,translateExtent:E,connectOnClick:k,defaultEdgeOptions:A,fitView:C,fitViewOptions:P,onNodesDelete:$,onEdgesDelete:O,onNodeDrag:I,onNodeDragStart:D,onNodeDragStop:L,onSelectionDrag:R,onSelectionDragStart:M,onSelectionDragStop:B,noPanClassName:U,nodeOrigin:W,rfId:Z,autoPanOnConnect:q,autoPanOnNodeDrag:ee,onError:le,connectionRadius:ve,isValidConnection:Ne,nodeDragThreshold:J})=>{const{setNodes:oe,setEdges:me,setDefaultNodesAndEdges:Q,setMinZoom:Pe,setMaxZoom:be,setTranslateExtent:Ee,setNodeExtent:Re,reset:Y}=ft(tH,cr),V=er();return b.useEffect(()=>{const ce=n==null?void 0:n.map(F=>({...F,...A}));return Q(r,ce),()=>{Y()}},[]),De("defaultEdgeOptions",A,V.setState),De("connectionMode",j,V.setState),De("onConnect",i,V.setState),De("onConnectStart",a,V.setState),De("onConnectEnd",s,V.setState),De("onClickConnectStart",l,V.setState),De("onClickConnectEnd",c,V.setState),De("nodesDraggable",u,V.setState),De("nodesConnectable",d,V.setState),De("nodesFocusable",f,V.setState),De("edgesFocusable",h,V.setState),De("edgesUpdatable",m,V.setState),De("elementsSelectable",_,V.setState),De("elevateNodesOnSelect",y,V.setState),De("snapToGrid",S,V.setState),De("snapGrid",N,V.setState),De("onNodesChange",v,V.setState),De("onEdgesChange",w,V.setState),De("connectOnClick",k,V.setState),De("fitViewOnInit",C,V.setState),De("fitViewOnInitOptions",P,V.setState),De("onNodesDelete",$,V.setState),De("onEdgesDelete",O,V.setState),De("onNodeDrag",I,V.setState),De("onNodeDragStart",D,V.setState),De("onNodeDragStop",L,V.setState),De("onSelectionDrag",R,V.setState),De("onSelectionDragStart",M,V.setState),De("onSelectionDragStop",B,V.setState),De("noPanClassName",U,V.setState),De("nodeOrigin",W,V.setState),De("rfId",Z,V.setState),De("autoPanOnConnect",q,V.setState),De("autoPanOnNodeDrag",ee,V.setState),De("onError",le,V.setState),De("connectionRadius",ve,V.setState),De("isValidConnection",Ne,V.setState),De("nodeDragThreshold",J,V.setState),Dl(e,oe),Dl(t,me),Dl(p,Pe),Dl(x,be),Dl(E,Ee),Dl(g,Re),null},Pk={display:"none"},nH={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},s3="react-flow__node-desc",o3="react-flow__edge-desc",iH="react-flow__aria-live",aH=e=>e.ariaLiveMessage;function sH({rfId:e}){const t=ft(aH);return T.createElement("div",{id:`${iH}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:nH},t)}function oH({rfId:e,disableKeyboardA11y:t}){return T.createElement(T.Fragment,null,T.createElement("div",{id:`${s3}-${e}`,style:Pk},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),T.createElement("div",{id:`${o3}-${e}`,style:Pk},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&T.createElement(sH,{rfId:e}))}var Uf=(e=null,t={actInsideInputWithModifier:!0})=>{const[r,n]=b.useState(!1),i=b.useRef(!1),a=b.useRef(new Set([])),[s,l]=b.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.split("+")),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return b.useEffect(()=>{const c=typeof document<"u"?document:null,u=(t==null?void 0:t.target)||c;if(e!==null){const d=m=>{if(i.current=m.ctrlKey||m.metaKey||m.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&yw(m))return!1;const p=Tk(m.code,l);a.current.add(m[p]),Ck(s,a.current,!1)&&(m.preventDefault(),n(!0))},f=m=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&yw(m))return!1;const p=Tk(m.code,l);Ck(s,a.current,!0)?(n(!1),a.current.clear()):a.current.delete(m[p]),m.key==="Meta"&&a.current.clear(),i.current=!1},h=()=>{a.current.clear(),n(!1)};return u==null||u.addEventListener("keydown",d),u==null||u.addEventListener("keyup",f),window.addEventListener("blur",h),()=>{u==null||u.removeEventListener("keydown",d),u==null||u.removeEventListener("keyup",f),window.removeEventListener("blur",h)}}},[e,n]),r};function Ck(e,t,r){return e.filter(n=>r||n.length===t.size).some(n=>n.every(i=>t.has(i)))}function Tk(e,t){return t.includes(e)?"code":"key"}function l3(e,t,r,n){var l,c;const i=e.parentNode||e.parentId;if(!i)return r;const a=t.get(i),s=Qo(a,n);return l3(a,t,{x:(r.x??0)+s.x,y:(r.y??0)+s.y,z:(((l=a[Pt])==null?void 0:l.z)??0)>(r.z??0)?((c=a[Pt])==null?void 0:c.z)??0:r.z??0},n)}function c3(e,t,r){e.forEach(n=>{var a;const i=n.parentNode||n.parentId;if(i&&!e.has(i))throw new Error(`Parent node ${i} not found`);if(i||r!=null&&r[n.id]){const{x:s,y:l,z:c}=l3(n,e,{...n.position,z:((a=n[Pt])==null?void 0:a.z)??0},t);n.positionAbsolute={x:s,y:l},n[Pt].z=c,r!=null&&r[n.id]&&(n[Pt].isParent=!0)}})}function Yv(e,t,r,n){const i=new Map,a={},s=n?1e3:0;return e.forEach(l=>{var m;const c=($n(l.zIndex)?l.zIndex:0)+(l.selected?s:0),u=t.get(l.id),d={...l,positionAbsolute:{x:l.position.x,y:l.position.y}},f=l.parentNode||l.parentId;f&&(a[f]=!0);const h=(u==null?void 0:u.type)&&(u==null?void 0:u.type)!==l.type;Object.defineProperty(d,Pt,{enumerable:!1,value:{handleBounds:h||(m=u==null?void 0:u[Pt])==null?void 0:m.handleBounds,z:c}}),i.set(l.id,d)}),c3(i,r,a),i}function u3(e,t={}){const{getNodes:r,width:n,height:i,minZoom:a,maxZoom:s,d3Zoom:l,d3Selection:c,fitViewOnInitDone:u,fitViewOnInit:d,nodeOrigin:f}=e(),h=t.initial&&!u&&d;if(l&&c&&(h||!t.initial)){const y=r().filter(x=>{var v;const g=t.includeHiddenNodes?x.width&&x.height:!x.hidden;return(v=t.nodes)!=null&&v.length?g&&t.nodes.some(w=>w.id===x.id):g}),p=y.every(x=>x.width&&x.height);if(y.length>0&&p){const x=t0(y,f),{x:g,y:v,zoom:w}=Y4(x,n,i,t.minZoom??a,t.maxZoom??s,t.padding??.1),_=ma.translate(g,v).scale(w);return typeof t.duration=="number"&&t.duration>0?l.transform(yo(c,t.duration),_):l.transform(c,_),!0}}return!1}function lH(e,t){return e.forEach(r=>{const n=t.get(r.id);n&&t.set(n.id,{...n,[Pt]:n[Pt],selected:r.selected})}),new Map(t)}function cH(e,t){return t.map(r=>{const n=e.find(i=>i.id===r.id);return n&&(r.selected=n.selected),r})}function Cm({changedNodes:e,changedEdges:t,get:r,set:n}){const{nodeInternals:i,edges:a,onNodesChange:s,onEdgesChange:l,hasDefaultNodes:c,hasDefaultEdges:u}=r();e!=null&&e.length&&(c&&n({nodeInternals:lH(e,i)}),s==null||s(e)),t!=null&&t.length&&(u&&n({edges:cH(t,a)}),l==null||l(t))}const Ll=()=>{},uH={zoomIn:Ll,zoomOut:Ll,zoomTo:Ll,getZoom:()=>1,setViewport:Ll,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Ll,fitBounds:Ll,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},dH=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),fH=()=>{const e=er(),{d3Zoom:t,d3Selection:r}=ft(dH,cr);return b.useMemo(()=>r&&t?{zoomIn:i=>t.scaleBy(yo(r,i==null?void 0:i.duration),1.2),zoomOut:i=>t.scaleBy(yo(r,i==null?void 0:i.duration),1/1.2),zoomTo:(i,a)=>t.scaleTo(yo(r,a==null?void 0:a.duration),i),getZoom:()=>e.getState().transform[2],setViewport:(i,a)=>{const[s,l,c]=e.getState().transform,u=ma.translate(i.x??s,i.y??l).scale(i.zoom??c);t.transform(yo(r,a==null?void 0:a.duration),u)},getViewport:()=>{const[i,a,s]=e.getState().transform;return{x:i,y:a,zoom:s}},fitView:i=>u3(e.getState,i),setCenter:(i,a,s)=>{const{width:l,height:c,maxZoom:u}=e.getState(),d=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:u,f=l/2-i*d,h=c/2-a*d,m=ma.translate(f,h).scale(d);t.transform(yo(r,s==null?void 0:s.duration),m)},fitBounds:(i,a)=>{const{width:s,height:l,minZoom:c,maxZoom:u}=e.getState(),{x:d,y:f,zoom:h}=Y4(i,s,l,c,u,(a==null?void 0:a.padding)??.1),m=ma.translate(d,f).scale(h);t.transform(yo(r,a==null?void 0:a.duration),m)},project:i=>{const{transform:a,snapToGrid:s,snapGrid:l}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),bw(i,a,s,l)},screenToFlowPosition:i=>{const{transform:a,snapToGrid:s,snapGrid:l,domNode:c}=e.getState();if(!c)return i;const{x:u,y:d}=c.getBoundingClientRect(),f={x:i.x-u,y:i.y-d};return bw(f,a,s,l)},flowToScreenPosition:i=>{const{transform:a,domNode:s}=e.getState();if(!s)return i;const{x:l,y:c}=s.getBoundingClientRect(),u=q4(i,a);return{x:u.x+l,y:u.y+c}},viewportInitialized:!0}:uH,[t,r])};function W2(){const e=fH(),t=er(),r=b.useCallback(()=>t.getState().getNodes().map(p=>({...p})),[]),n=b.useCallback(p=>t.getState().nodeInternals.get(p),[]),i=b.useCallback(()=>{const{edges:p=[]}=t.getState();return p.map(x=>({...x}))},[]),a=b.useCallback(p=>{const{edges:x=[]}=t.getState();return x.find(g=>g.id===p)},[]),s=b.useCallback(p=>{const{getNodes:x,setNodes:g,hasDefaultNodes:v,onNodesChange:w}=t.getState(),_=x(),j=typeof p=="function"?p(_):p;if(v)g(j);else if(w){const N=j.length===0?_.map(S=>({type:"remove",id:S.id})):j.map(S=>({item:S,type:"reset"}));w(N)}},[]),l=b.useCallback(p=>{const{edges:x=[],setEdges:g,hasDefaultEdges:v,onEdgesChange:w}=t.getState(),_=typeof p=="function"?p(x):p;if(v)g(_);else if(w){const j=_.length===0?x.map(N=>({type:"remove",id:N.id})):_.map(N=>({item:N,type:"reset"}));w(j)}},[]),c=b.useCallback(p=>{const x=Array.isArray(p)?p:[p],{getNodes:g,setNodes:v,hasDefaultNodes:w,onNodesChange:_}=t.getState();if(w){const N=[...g(),...x];v(N)}else if(_){const j=x.map(N=>({item:N,type:"add"}));_(j)}},[]),u=b.useCallback(p=>{const x=Array.isArray(p)?p:[p],{edges:g=[],setEdges:v,hasDefaultEdges:w,onEdgesChange:_}=t.getState();if(w)v([...g,...x]);else if(_){const j=x.map(N=>({item:N,type:"add"}));_(j)}},[]),d=b.useCallback(()=>{const{getNodes:p,edges:x=[],transform:g}=t.getState(),[v,w,_]=g;return{nodes:p().map(j=>({...j})),edges:x.map(j=>({...j})),viewport:{x:v,y:w,zoom:_}}},[]),f=b.useCallback(({nodes:p,edges:x})=>{const{nodeInternals:g,getNodes:v,edges:w,hasDefaultNodes:_,hasDefaultEdges:j,onNodesDelete:N,onEdgesDelete:S,onNodesChange:E,onEdgesChange:k}=t.getState(),A=(p||[]).map(I=>I.id),C=(x||[]).map(I=>I.id),P=v().reduce((I,D)=>{const L=D.parentNode||D.parentId,R=!A.includes(D.id)&&L&&I.find(B=>B.id===L);return(typeof D.deletable=="boolean"?D.deletable:!0)&&(A.includes(D.id)||R)&&I.push(D),I},[]),$=w.filter(I=>typeof I.deletable=="boolean"?I.deletable:!0),O=$.filter(I=>C.includes(I.id));if(P||O){const I=G4(P,$),D=[...O,...I],L=D.reduce((R,M)=>(R.includes(M.id)||R.push(M.id),R),[]);if((j||_)&&(j&&t.setState({edges:w.filter(R=>!L.includes(R.id))}),_&&(P.forEach(R=>{g.delete(R.id)}),t.setState({nodeInternals:new Map(g)}))),L.length>0&&(S==null||S(D),k&&k(L.map(R=>({id:R,type:"remove"})))),P.length>0&&(N==null||N(P),E)){const R=P.map(M=>({id:M.id,type:"remove"}));E(R)}}},[]),h=b.useCallback(p=>{const x=$V(p),g=x?null:t.getState().nodeInternals.get(p.id);return!x&&!g?[null,null,x]:[x?p:_k(g),g,x]},[]),m=b.useCallback((p,x=!0,g)=>{const[v,w,_]=h(p);return v?(g||t.getState().getNodes()).filter(j=>{if(!_&&(j.id===w.id||!j.positionAbsolute))return!1;const N=_k(j),S=gw(N,v);return x&&S>0||S>=v.width*v.height}):[]},[]),y=b.useCallback((p,x,g=!0)=>{const[v]=h(p);if(!v)return!1;const w=gw(v,x);return g&&w>0||w>=v.width*v.height},[]);return b.useMemo(()=>({...e,getNodes:r,getNode:n,getEdges:i,getEdge:a,setNodes:s,setEdges:l,addNodes:c,addEdges:u,toObject:d,deleteElements:f,getIntersectingNodes:m,isNodeIntersecting:y}),[e,r,n,i,a,s,l,c,u,d,f,m,y])}const hH={actInsideInputWithModifier:!1};var mH=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const r=er(),{deleteElements:n}=W2(),i=Uf(e,hH),a=Uf(t);b.useEffect(()=>{if(i){const{edges:s,getNodes:l}=r.getState(),c=l().filter(d=>d.selected),u=s.filter(d=>d.selected);n({nodes:c,edges:u}),r.setState({nodesSelectionActive:!1})}},[i]),b.useEffect(()=>{r.setState({multiSelectionActive:a})},[a])};function pH(e){const t=er();b.useEffect(()=>{let r;const n=()=>{var a,s;if(!e.current)return;const i=R2(e.current);(i.height===0||i.width===0)&&((s=(a=t.getState()).onError)==null||s.call(a,"004",Na.error004())),t.setState({width:i.width||500,height:i.height||500})};return n(),window.addEventListener("resize",n),e.current&&(r=new ResizeObserver(()=>n()),r.observe(e.current)),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}},[])}const V2={position:"absolute",width:"100%",height:"100%",top:0,left:0},gH=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Tm=e=>({x:e.x,y:e.y,zoom:e.k}),Fl=(e,t)=>e.target.closest(`.${t}`),$k=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Mk=e=>{const t=e.ctrlKey&&og()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},yH=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),vH=({onMove:e,onMoveStart:t,onMoveEnd:r,onPaneContextMenu:n,zoomOnScroll:i=!0,zoomOnPinch:a=!0,panOnScroll:s=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=To.Free,zoomOnDoubleClick:u=!0,elementsSelectable:d,panOnDrag:f=!0,defaultViewport:h,translateExtent:m,minZoom:y,maxZoom:p,zoomActivationKeyCode:x,preventScrolling:g=!0,children:v,noWheelClassName:w,noPanClassName:_})=>{const j=b.useRef(),N=er(),S=b.useRef(!1),E=b.useRef(!1),k=b.useRef(null),A=b.useRef({x:0,y:0,zoom:0}),{d3Zoom:C,d3Selection:P,d3ZoomHandler:$,userSelectionActive:O}=ft(yH,cr),I=Uf(x),D=b.useRef(0),L=b.useRef(!1),R=b.useRef();return pH(k),b.useEffect(()=>{if(k.current){const M=k.current.getBoundingClientRect(),B=$4().scaleExtent([y,p]).translateExtent(m),U=Pn(k.current).call(B),W=ma.translate(h.x,h.y).scale(Xc(h.zoom,y,p)),Z=[[0,0],[M.width,M.height]],q=B.constrain()(W,Z,m);B.transform(U,q),B.wheelDelta(Mk),N.setState({d3Zoom:B,d3Selection:U,d3ZoomHandler:U.on("wheel.zoom"),transform:[q.x,q.y,q.k],domNode:k.current.closest(".react-flow")})}},[]),b.useEffect(()=>{P&&C&&(s&&!I&&!O?P.on("wheel.zoom",M=>{if(Fl(M,w))return!1;M.preventDefault(),M.stopImmediatePropagation();const B=P.property("__zoom").k||1;if(M.ctrlKey&&a){const Ne=Jn(M),J=Mk(M),oe=B*Math.pow(2,J);C.scaleTo(P,oe,Ne,M);return}const U=M.deltaMode===1?20:1;let W=c===To.Vertical?0:M.deltaX*U,Z=c===To.Horizontal?0:M.deltaY*U;!og()&&M.shiftKey&&c!==To.Vertical&&(W=M.deltaY*U,Z=0),C.translateBy(P,-(W/B)*l,-(Z/B)*l,{internal:!0});const q=Tm(P.property("__zoom")),{onViewportChangeStart:ee,onViewportChange:le,onViewportChangeEnd:ve}=N.getState();clearTimeout(R.current),L.current||(L.current=!0,t==null||t(M,q),ee==null||ee(q)),L.current&&(e==null||e(M,q),le==null||le(q),R.current=setTimeout(()=>{r==null||r(M,q),ve==null||ve(q),L.current=!1},150))},{passive:!1}):typeof $<"u"&&P.on("wheel.zoom",function(M,B){if(!g&&M.type==="wheel"&&!M.ctrlKey||Fl(M,w))return null;M.preventDefault(),$.call(this,M,B)},{passive:!1}))},[O,s,c,P,C,$,I,a,g,w,t,e,r]),b.useEffect(()=>{C&&C.on("start",M=>{var W,Z;if(!M.sourceEvent||M.sourceEvent.internal)return null;D.current=(W=M.sourceEvent)==null?void 0:W.button;const{onViewportChangeStart:B}=N.getState(),U=Tm(M.transform);S.current=!0,A.current=U,((Z=M.sourceEvent)==null?void 0:Z.type)==="mousedown"&&N.setState({paneDragging:!0}),B==null||B(U),t==null||t(M.sourceEvent,U)})},[C,t]),b.useEffect(()=>{C&&(O&&!S.current?C.on("zoom",null):O||C.on("zoom",M=>{var U;const{onViewportChange:B}=N.getState();if(N.setState({transform:[M.transform.x,M.transform.y,M.transform.k]}),E.current=!!(n&&$k(f,D.current??0)),(e||B)&&!((U=M.sourceEvent)!=null&&U.internal)){const W=Tm(M.transform);B==null||B(W),e==null||e(M.sourceEvent,W)}}))},[O,C,e,f,n]),b.useEffect(()=>{C&&C.on("end",M=>{if(!M.sourceEvent||M.sourceEvent.internal)return null;const{onViewportChangeEnd:B}=N.getState();if(S.current=!1,N.setState({paneDragging:!1}),n&&$k(f,D.current??0)&&!E.current&&n(M.sourceEvent),E.current=!1,(r||B)&&gH(A.current,M.transform)){const U=Tm(M.transform);A.current=U,clearTimeout(j.current),j.current=setTimeout(()=>{B==null||B(U),r==null||r(M.sourceEvent,U)},s?150:0)}})},[C,s,f,r,n]),b.useEffect(()=>{C&&C.filter(M=>{const B=I||i,U=a&&M.ctrlKey;if((f===!0||Array.isArray(f)&&f.includes(1))&&M.button===1&&M.type==="mousedown"&&(Fl(M,"react-flow__node")||Fl(M,"react-flow__edge")))return!0;if(!f&&!B&&!s&&!u&&!a||O||!u&&M.type==="dblclick"||Fl(M,w)&&M.type==="wheel"||Fl(M,_)&&(M.type!=="wheel"||s&&M.type==="wheel"&&!I)||!a&&M.ctrlKey&&M.type==="wheel"||!B&&!s&&!U&&M.type==="wheel"||!f&&(M.type==="mousedown"||M.type==="touchstart")||Array.isArray(f)&&!f.includes(M.button)&&M.type==="mousedown")return!1;const W=Array.isArray(f)&&f.includes(M.button)||!M.button||M.button<=1;return(!M.ctrlKey||M.type==="wheel")&&W})},[O,C,i,a,s,u,f,d,I]),T.createElement("div",{className:"react-flow__renderer",ref:k,style:V2},v)},xH=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function bH(){const{userSelectionActive:e,userSelectionRect:t}=ft(xH,cr);return e&&t?T.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function Rk(e,t){const r=t.parentNode||t.parentId,n=e.find(i=>i.id===r);if(n){const i=t.position.x+t.width-n.width,a=t.position.y+t.height-n.height;if(i>0||a>0||t.position.x<0||t.position.y<0){if(n.style={...n.style},n.style.width=n.style.width??n.width,n.style.height=n.style.height??n.height,i>0&&(n.style.width+=i),a>0&&(n.style.height+=a),t.position.x<0){const s=Math.abs(t.position.x);n.position.x=n.position.x-s,n.style.width+=s,t.position.x=0}if(t.position.y<0){const s=Math.abs(t.position.y);n.position.y=n.position.y-s,n.style.height+=s,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function d3(e,t){if(e.some(n=>n.type==="reset"))return e.filter(n=>n.type==="reset").map(n=>n.item);const r=e.filter(n=>n.type==="add").map(n=>n.item);return t.reduce((n,i)=>{const a=e.filter(l=>l.id===i.id);if(a.length===0)return n.push(i),n;const s={...i};for(const l of a)if(l)switch(l.type){case"select":{s.selected=l.selected;break}case"position":{typeof l.position<"u"&&(s.position=l.position),typeof l.positionAbsolute<"u"&&(s.positionAbsolute=l.positionAbsolute),typeof l.dragging<"u"&&(s.dragging=l.dragging),s.expandParent&&Rk(n,s);break}case"dimensions":{typeof l.dimensions<"u"&&(s.width=l.dimensions.width,s.height=l.dimensions.height),typeof l.updateStyle<"u"&&(s.style={...s.style||{},...l.dimensions}),typeof l.resizing=="boolean"&&(s.resizing=l.resizing),s.expandParent&&Rk(n,s);break}case"remove":return n}return n.push(s),n},r)}function f3(e,t){return d3(e,t)}function wH(e,t){return d3(e,t)}const Ya=(e,t)=>({id:e,type:"select",selected:t});function cc(e,t){return e.reduce((r,n)=>{const i=t.includes(n.id);return!n.selected&&i?(n.selected=!0,r.push(Ya(n.id,!0))):n.selected&&!i&&(n.selected=!1,r.push(Ya(n.id,!1))),r},[])}const Zv=(e,t)=>r=>{r.target===t.current&&(e==null||e(r))},jH=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),h3=b.memo(({isSelecting:e,selectionMode:t=zf.Full,panOnDrag:r,onSelectionStart:n,onSelectionEnd:i,onPaneClick:a,onPaneContextMenu:s,onPaneScroll:l,onPaneMouseEnter:c,onPaneMouseMove:u,onPaneMouseLeave:d,children:f})=>{const h=b.useRef(null),m=er(),y=b.useRef(0),p=b.useRef(0),x=b.useRef(),{userSelectionActive:g,elementsSelectable:v,dragging:w}=ft(jH,cr),_=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),y.current=0,p.current=0},j=$=>{a==null||a($),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},N=$=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){$.preventDefault();return}s==null||s($)},S=l?$=>l($):void 0,E=$=>{const{resetSelectedElements:O,domNode:I}=m.getState();if(x.current=I==null?void 0:I.getBoundingClientRect(),!v||!e||$.button!==0||$.target!==h.current||!x.current)return;const{x:D,y:L}=Is($,x.current);O(),m.setState({userSelectionRect:{width:0,height:0,startX:D,startY:L,x:D,y:L}}),n==null||n($)},k=$=>{const{userSelectionRect:O,nodeInternals:I,edges:D,transform:L,onNodesChange:R,onEdgesChange:M,nodeOrigin:B,getNodes:U}=m.getState();if(!e||!x.current||!O)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const W=Is($,x.current),Z=O.startX??0,q=O.startY??0,ee={...O,x:W.xoe.id),J=ve.map(oe=>oe.id);if(y.current!==J.length){y.current=J.length;const oe=cc(le,J);oe.length&&(R==null||R(oe))}if(p.current!==Ne.length){p.current=Ne.length;const oe=cc(D,Ne);oe.length&&(M==null||M(oe))}m.setState({userSelectionRect:ee})},A=$=>{if($.button!==0)return;const{userSelectionRect:O}=m.getState();!g&&O&&$.target===h.current&&(j==null||j($)),m.setState({nodesSelectionActive:y.current>0}),_(),i==null||i($)},C=$=>{g&&(m.setState({nodesSelectionActive:y.current>0}),i==null||i($)),_()},P=v&&(e||g);return T.createElement("div",{className:gr(["react-flow__pane",{dragging:w,selection:e}]),onClick:P?void 0:Zv(j,h),onContextMenu:Zv(N,h),onWheel:Zv(S,h),onMouseEnter:P?void 0:c,onMouseDown:P?E:void 0,onMouseMove:P?k:u,onMouseUp:P?A:void 0,onMouseLeave:P?C:d,ref:h,style:V2},f,T.createElement(bH,null))});h3.displayName="Pane";function m3(e,t){const r=e.parentNode||e.parentId;if(!r)return!1;const n=t.get(r);return n?n.selected?!0:m3(n,t):!1}function Ik(e,t,r){let n=e;do{if(n!=null&&n.matches(t))return!0;if(n===r.current)return!1;n=n.parentElement}while(n);return!1}function _H(e,t,r,n){return Array.from(e.values()).filter(i=>(i.selected||i.id===n)&&(!i.parentNode||i.parentId||!m3(i,e))&&(i.draggable||t&&typeof i.draggable>"u")).map(i=>{var a,s;return{id:i.id,position:i.position||{x:0,y:0},positionAbsolute:i.positionAbsolute||{x:0,y:0},distance:{x:r.x-(((a=i.positionAbsolute)==null?void 0:a.x)??0),y:r.y-(((s=i.positionAbsolute)==null?void 0:s.y)??0)},delta:{x:0,y:0},extent:i.extent,parentNode:i.parentNode||i.parentId,parentId:i.parentNode||i.parentId,width:i.width,height:i.height,expandParent:i.expandParent}})}function NH(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function p3(e,t,r,n,i=[0,0],a){const s=NH(e,e.extent||n);let l=s;const c=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(c&&e.width&&e.height){const f=r.get(c),{x:h,y:m}=Qo(f,i).positionAbsolute;l=f&&$n(h)&&$n(m)&&$n(f.width)&&$n(f.height)?[[h+e.width*i[0],m+e.height*i[1]],[h+f.width-e.width+e.width*i[0],m+f.height-e.height+e.height*i[1]]]:l}else a==null||a("005",Na.error005()),l=s;else if(e.extent&&c&&e.extent!=="parent"){const f=r.get(c),{x:h,y:m}=Qo(f,i).positionAbsolute;l=[[e.extent[0][0]+h,e.extent[0][1]+m],[e.extent[1][0]+h,e.extent[1][1]+m]]}let u={x:0,y:0};if(c){const f=r.get(c);u=Qo(f,i).positionAbsolute}const d=l&&l!=="parent"?I2(t,l):t;return{position:{x:d.x-u.x,y:d.y-u.y},positionAbsolute:d}}function Xv({nodeId:e,dragItems:t,nodeInternals:r}){const n=t.map(i=>({...r.get(i.id),position:i.position,positionAbsolute:i.positionAbsolute}));return[e?n.find(i=>i.id===e):n[0],n]}const Dk=(e,t,r,n)=>{const i=t.querySelectorAll(e);if(!i||!i.length)return null;const a=Array.from(i),s=t.getBoundingClientRect(),l={x:s.width*n[0],y:s.height*n[1]};return a.map(c=>{const u=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),position:c.getAttribute("data-handlepos"),x:(u.left-s.left-l.x)/r,y:(u.top-s.top-l.y)/r,...R2(c)}})};function dd(e,t,r){return r===void 0?r:n=>{const i=t().nodeInternals.get(e);i&&r(n,{...i})}}function jw({id:e,store:t,unselect:r=!1,nodeRef:n}){const{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:s,nodeInternals:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",Na.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(r||u.selected&&s)&&(a({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=n==null?void 0:n.current)==null?void 0:d.blur()})):i([e])}function SH(){const e=er();return b.useCallback(({sourceEvent:r})=>{const{transform:n,snapGrid:i,snapToGrid:a}=e.getState(),s=r.touches?r.touches[0].clientX:r.clientX,l=r.touches?r.touches[0].clientY:r.clientY,c={x:(s-n[0])/n[2],y:(l-n[1])/n[2]};return{xSnapped:a?i[0]*Math.round(c.x/i[0]):c.x,ySnapped:a?i[1]*Math.round(c.y/i[1]):c.y,...c}},[])}function Qv(e){return(t,r,n)=>e==null?void 0:e(t,n)}function g3({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:n,nodeId:i,isSelectable:a,selectNodesOnDrag:s}){const l=er(),[c,u]=b.useState(!1),d=b.useRef([]),f=b.useRef({x:null,y:null}),h=b.useRef(0),m=b.useRef(null),y=b.useRef({x:0,y:0}),p=b.useRef(null),x=b.useRef(!1),g=b.useRef(!1),v=b.useRef(!1),w=SH();return b.useEffect(()=>{if(e!=null&&e.current){const _=Pn(e.current),j=({x:E,y:k})=>{const{nodeInternals:A,onNodeDrag:C,onSelectionDrag:P,updateNodePositions:$,nodeExtent:O,snapGrid:I,snapToGrid:D,nodeOrigin:L,onError:R}=l.getState();f.current={x:E,y:k};let M=!1,B={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&O){const W=t0(d.current,L);B=Bf(W)}if(d.current=d.current.map(W=>{const Z={x:E-W.distance.x,y:k-W.distance.y};D&&(Z.x=I[0]*Math.round(Z.x/I[0]),Z.y=I[1]*Math.round(Z.y/I[1]));const q=[[O[0][0],O[0][1]],[O[1][0],O[1][1]]];d.current.length>1&&O&&!W.extent&&(q[0][0]=W.positionAbsolute.x-B.x+O[0][0],q[1][0]=W.positionAbsolute.x+(W.width??0)-B.x2+O[1][0],q[0][1]=W.positionAbsolute.y-B.y+O[0][1],q[1][1]=W.positionAbsolute.y+(W.height??0)-B.y2+O[1][1]);const ee=p3(W,Z,A,q,L,R);return M=M||W.position.x!==ee.position.x||W.position.y!==ee.position.y,W.position=ee.position,W.positionAbsolute=ee.positionAbsolute,W}),!M)return;$(d.current,!0,!0),u(!0);const U=i?C:Qv(P);if(U&&p.current){const[W,Z]=Xv({nodeId:i,dragItems:d.current,nodeInternals:A});U(p.current,W,Z)}},N=()=>{if(!m.current)return;const[E,k]=R4(y.current,m.current);if(E!==0||k!==0){const{transform:A,panBy:C}=l.getState();f.current.x=(f.current.x??0)-E/A[2],f.current.y=(f.current.y??0)-k/A[2],C({x:E,y:k})&&j(f.current)}h.current=requestAnimationFrame(N)},S=E=>{var L;const{nodeInternals:k,multiSelectionActive:A,nodesDraggable:C,unselectNodesAndEdges:P,onNodeDragStart:$,onSelectionDragStart:O}=l.getState();g.current=!0;const I=i?$:Qv(O);(!s||!a)&&!A&&i&&((L=k.get(i))!=null&&L.selected||P()),i&&a&&s&&jw({id:i,store:l,nodeRef:e});const D=w(E);if(f.current=D,d.current=_H(k,C,D,i),I&&d.current){const[R,M]=Xv({nodeId:i,dragItems:d.current,nodeInternals:k});I(E.sourceEvent,R,M)}};if(t)_.on(".drag",null);else{const E=TU().on("start",k=>{const{domNode:A,nodeDragThreshold:C}=l.getState();C===0&&S(k),v.current=!1;const P=w(k);f.current=P,m.current=(A==null?void 0:A.getBoundingClientRect())||null,y.current=Is(k.sourceEvent,m.current)}).on("drag",k=>{var $,O;const A=w(k),{autoPanOnNodeDrag:C,nodeDragThreshold:P}=l.getState();if(k.sourceEvent.type==="touchmove"&&k.sourceEvent.touches.length>1&&(v.current=!0),!v.current){if(!x.current&&g.current&&C&&(x.current=!0,N()),!g.current){const I=A.xSnapped-((($=f==null?void 0:f.current)==null?void 0:$.x)??0),D=A.ySnapped-(((O=f==null?void 0:f.current)==null?void 0:O.y)??0);Math.sqrt(I*I+D*D)>P&&S(k)}(f.current.x!==A.xSnapped||f.current.y!==A.ySnapped)&&d.current&&g.current&&(p.current=k.sourceEvent,y.current=Is(k.sourceEvent,m.current),j(A))}}).on("end",k=>{if(!(!g.current||v.current)&&(u(!1),x.current=!1,g.current=!1,cancelAnimationFrame(h.current),d.current)){const{updateNodePositions:A,nodeInternals:C,onNodeDragStop:P,onSelectionDragStop:$}=l.getState(),O=i?P:Qv($);if(A(d.current,!1,!1),O){const[I,D]=Xv({nodeId:i,dragItems:d.current,nodeInternals:C});O(k.sourceEvent,I,D)}}}).filter(k=>{const A=k.target;return!k.button&&(!r||!Ik(A,`.${r}`,e))&&(!n||Ik(A,n,e))});return _.call(E),()=>{_.on(".drag",null)}}}},[e,t,r,n,a,l,i,s,w]),c}function y3(){const e=er();return b.useCallback(r=>{const{nodeInternals:n,nodeExtent:i,updateNodePositions:a,getNodes:s,snapToGrid:l,snapGrid:c,onError:u,nodesDraggable:d}=e.getState(),f=s().filter(v=>v.selected&&(v.draggable||d&&typeof v.draggable>"u")),h=l?c[0]:5,m=l?c[1]:5,y=r.isShiftPressed?4:1,p=r.x*h*y,x=r.y*m*y,g=f.map(v=>{if(v.positionAbsolute){const w={x:v.positionAbsolute.x+p,y:v.positionAbsolute.y+x};l&&(w.x=c[0]*Math.round(w.x/c[0]),w.y=c[1]*Math.round(w.y/c[1]));const{positionAbsolute:_,position:j}=p3(v,w,n,i,void 0,u);v.position=j,v.positionAbsolute=_}return v});a(g,!0,!1)},[])}const Nc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var fd=e=>{const t=({id:r,type:n,data:i,xPos:a,yPos:s,xPosOrigin:l,yPosOrigin:c,selected:u,onClick:d,onMouseEnter:f,onMouseMove:h,onMouseLeave:m,onContextMenu:y,onDoubleClick:p,style:x,className:g,isDraggable:v,isSelectable:w,isConnectable:_,isFocusable:j,selectNodesOnDrag:N,sourcePosition:S,targetPosition:E,hidden:k,resizeObserver:A,dragHandle:C,zIndex:P,isParent:$,noDragClassName:O,noPanClassName:I,initialized:D,disableKeyboardA11y:L,ariaLabel:R,rfId:M,hasHandleBounds:B})=>{const U=er(),W=b.useRef(null),Z=b.useRef(null),q=b.useRef(S),ee=b.useRef(E),le=b.useRef(n),ve=w||v||d||f||h||m,Ne=y3(),J=dd(r,U.getState,f),oe=dd(r,U.getState,h),me=dd(r,U.getState,m),Q=dd(r,U.getState,y),Pe=dd(r,U.getState,p),be=Y=>{const{nodeDragThreshold:V}=U.getState();if(w&&(!N||!v||V>0)&&jw({id:r,store:U,nodeRef:W}),d){const ce=U.getState().nodeInternals.get(r);ce&&d(Y,{...ce})}},Ee=Y=>{if(!yw(Y)&&!L)if(F4.includes(Y.key)&&w){const V=Y.key==="Escape";jw({id:r,store:U,unselect:V,nodeRef:W})}else v&&u&&Object.prototype.hasOwnProperty.call(Nc,Y.key)&&(U.setState({ariaLiveMessage:`Moved selected node ${Y.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~a}, y: ${~~s}`}),Ne({x:Nc[Y.key].x,y:Nc[Y.key].y,isShiftPressed:Y.shiftKey}))};b.useEffect(()=>()=>{Z.current&&(A==null||A.unobserve(Z.current),Z.current=null)},[]),b.useEffect(()=>{if(W.current&&!k){const Y=W.current;(!D||!B||Z.current!==Y)&&(Z.current&&(A==null||A.unobserve(Z.current)),A==null||A.observe(Y),Z.current=Y)}},[k,D,B]),b.useEffect(()=>{const Y=le.current!==n,V=q.current!==S,ce=ee.current!==E;W.current&&(Y||V||ce)&&(Y&&(le.current=n),V&&(q.current=S),ce&&(ee.current=E),U.getState().updateNodeDimensions([{id:r,nodeElement:W.current,forceUpdate:!0}]))},[r,n,S,E]);const Re=g3({nodeRef:W,disabled:k||!v,noDragClassName:O,handleSelector:C,nodeId:r,isSelectable:w,selectNodesOnDrag:N});return k?null:T.createElement("div",{className:gr(["react-flow__node",`react-flow__node-${n}`,{[I]:v},g,{selected:u,selectable:w,parent:$,dragging:Re}]),ref:W,style:{zIndex:P,transform:`translate(${l}px,${c}px)`,pointerEvents:ve?"all":"none",visibility:D?"visible":"hidden",...x},"data-id":r,"data-testid":`rf__node-${r}`,onMouseEnter:J,onMouseMove:oe,onMouseLeave:me,onContextMenu:Q,onClick:be,onDoubleClick:Pe,onKeyDown:j?Ee:void 0,tabIndex:j?0:void 0,role:j?"button":void 0,"aria-describedby":L?void 0:`${s3}-${M}`,"aria-label":R},T.createElement(BV,{value:r},T.createElement(e,{id:r,data:i,type:n,xPos:a,yPos:s,selected:u,isConnectable:_,sourcePosition:S,targetPosition:E,dragging:Re,dragHandle:C,zIndex:P})))};return t.displayName="NodeWrapper",b.memo(t)};const kH=e=>{const t=e.getNodes().filter(r=>r.selected);return{...t0(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function EH({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const n=er(),{width:i,height:a,x:s,y:l,transformString:c,userSelectionActive:u}=ft(kH,cr),d=y3(),f=b.useRef(null);if(b.useEffect(()=>{var y;r||(y=f.current)==null||y.focus({preventScroll:!0})},[r]),g3({nodeRef:f}),u||!i||!a)return null;const h=e?y=>{const p=n.getState().getNodes().filter(x=>x.selected);e(y,p)}:void 0,m=y=>{Object.prototype.hasOwnProperty.call(Nc,y.key)&&d({x:Nc[y.key].x,y:Nc[y.key].y,isShiftPressed:y.shiftKey})};return T.createElement("div",{className:gr(["react-flow__nodesselection","react-flow__container",t]),style:{transform:c}},T.createElement("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:r?void 0:-1,onKeyDown:r?void 0:m,style:{width:i,height:a,top:l,left:s}}))}var OH=b.memo(EH);const AH=e=>e.nodesSelectionActive,v3=({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:n,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:s,deleteKeyCode:l,onMove:c,onMoveStart:u,onMoveEnd:d,selectionKeyCode:f,selectionOnDrag:h,selectionMode:m,onSelectionStart:y,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:g,zoomActivationKeyCode:v,elementsSelectable:w,zoomOnScroll:_,zoomOnPinch:j,panOnScroll:N,panOnScrollSpeed:S,panOnScrollMode:E,zoomOnDoubleClick:k,panOnDrag:A,defaultViewport:C,translateExtent:P,minZoom:$,maxZoom:O,preventScrolling:I,onSelectionContextMenu:D,noWheelClassName:L,noPanClassName:R,disableKeyboardA11y:M})=>{const B=ft(AH),U=Uf(f),W=Uf(g),Z=W||A,q=W||N,ee=U||h&&Z!==!0;return mH({deleteKeyCode:l,multiSelectionKeyCode:x}),T.createElement(vH,{onMove:c,onMoveStart:u,onMoveEnd:d,onPaneContextMenu:a,elementsSelectable:w,zoomOnScroll:_,zoomOnPinch:j,panOnScroll:q,panOnScrollSpeed:S,panOnScrollMode:E,zoomOnDoubleClick:k,panOnDrag:!U&&Z,defaultViewport:C,translateExtent:P,minZoom:$,maxZoom:O,zoomActivationKeyCode:v,preventScrolling:I,noWheelClassName:L,noPanClassName:R},T.createElement(h3,{onSelectionStart:y,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:n,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:s,panOnDrag:Z,isSelecting:!!ee,selectionMode:m},e,B&&T.createElement(OH,{onSelectionContextMenu:D,noPanClassName:R,disableKeyboardA11y:M})))};v3.displayName="FlowRenderer";var PH=b.memo(v3);function CH(e){return ft(b.useCallback(r=>e?K4(r.nodeInternals,{x:0,y:0,width:r.width,height:r.height},r.transform,!0):r.getNodes(),[e]))}function TH(e){const t={input:fd(e.input||r3),default:fd(e.default||ww),output:fd(e.output||i3),group:fd(e.group||U2)},r={},n=Object.keys(e).filter(i=>!["input","default","output","group"].includes(i)).reduce((i,a)=>(i[a]=fd(e[a]||ww),i),r);return{...t,...n}}const $H=({x:e,y:t,width:r,height:n,origin:i})=>!r||!n?{x:e,y:t}:i[0]<0||i[1]<0||i[0]>1||i[1]>1?{x:e,y:t}:{x:e-r*i[0],y:t-n*i[1]},MH=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),x3=e=>{const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:n,elementsSelectable:i,updateNodeDimensions:a,onError:s}=ft(MH,cr),l=CH(e.onlyRenderVisibleElements),c=b.useRef(),u=b.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const d=new ResizeObserver(f=>{const h=f.map(m=>({id:m.target.getAttribute("data-id"),nodeElement:m.target,forceUpdate:!0}));a(h)});return c.current=d,d},[]);return b.useEffect(()=>()=>{var d;(d=c==null?void 0:c.current)==null||d.disconnect()},[]),T.createElement("div",{className:"react-flow__nodes",style:V2},l.map(d=>{var j,N,S;let f=d.type||"default";e.nodeTypes[f]||(s==null||s("003",Na.error003(f)),f="default");const h=e.nodeTypes[f]||e.nodeTypes.default,m=!!(d.draggable||t&&typeof d.draggable>"u"),y=!!(d.selectable||i&&typeof d.selectable>"u"),p=!!(d.connectable||r&&typeof d.connectable>"u"),x=!!(d.focusable||n&&typeof d.focusable>"u"),g=e.nodeExtent?I2(d.positionAbsolute,e.nodeExtent):d.positionAbsolute,v=(g==null?void 0:g.x)??0,w=(g==null?void 0:g.y)??0,_=$H({x:v,y:w,width:d.width??0,height:d.height??0,origin:e.nodeOrigin});return T.createElement(h,{key:d.id,id:d.id,className:d.className,style:d.style,type:f,data:d.data,sourcePosition:d.sourcePosition||je.Bottom,targetPosition:d.targetPosition||je.Top,hidden:d.hidden,xPos:v,yPos:w,xPosOrigin:_.x,yPosOrigin:_.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!d.selected,isDraggable:m,isSelectable:y,isConnectable:p,isFocusable:x,resizeObserver:u,dragHandle:d.dragHandle,zIndex:((j=d[Pt])==null?void 0:j.z)??0,isParent:!!((N=d[Pt])!=null&&N.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!d.width&&!!d.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:d.ariaLabel,hasHandleBounds:!!((S=d[Pt])!=null&&S.handleBounds)})}))};x3.displayName="NodeRenderer";var RH=b.memo(x3);const IH=(e,t,r)=>r===je.Left?e-t:r===je.Right?e+t:e,DH=(e,t,r)=>r===je.Top?e-t:r===je.Bottom?e+t:e,Lk="react-flow__edgeupdater",Fk=({position:e,centerX:t,centerY:r,radius:n=10,onMouseDown:i,onMouseEnter:a,onMouseOut:s,type:l})=>T.createElement("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:s,className:gr([Lk,`${Lk}-${l}`]),cx:IH(t,n,e),cy:DH(r,n,e),r:n,stroke:"transparent",fill:"transparent"}),LH=()=>!0;var Bl=e=>{const t=({id:r,className:n,type:i,data:a,onClick:s,onEdgeDoubleClick:l,selected:c,animated:u,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:p,style:x,source:g,target:v,sourceX:w,sourceY:_,targetX:j,targetY:N,sourcePosition:S,targetPosition:E,elementsSelectable:k,hidden:A,sourceHandleId:C,targetHandleId:P,onContextMenu:$,onMouseEnter:O,onMouseMove:I,onMouseLeave:D,reconnectRadius:L,onReconnect:R,onReconnectStart:M,onReconnectEnd:B,markerEnd:U,markerStart:W,rfId:Z,ariaLabel:q,isFocusable:ee,isReconnectable:le,pathOptions:ve,interactionWidth:Ne,disableKeyboardA11y:J})=>{const oe=b.useRef(null),[me,Q]=b.useState(!1),[Pe,be]=b.useState(!1),Ee=er(),Re=b.useMemo(()=>`url('#${xw(W,Z)}')`,[W,Z]),Y=b.useMemo(()=>`url('#${xw(U,Z)}')`,[U,Z]);if(A)return null;const V=ht=>{var wn;const{edges:en,addSelectedEdges:Hn,unselectNodesAndEdges:qn,multiSelectionActive:Ki}=Ee.getState(),bn=en.find(La=>La.id===r);bn&&(k&&(Ee.setState({nodesSelectionActive:!1}),bn.selected&&Ki?(qn({nodes:[],edges:[bn]}),(wn=oe.current)==null||wn.blur()):Hn([r])),s&&s(ht,bn))},ce=ud(r,Ee.getState,l),F=ud(r,Ee.getState,$),H=ud(r,Ee.getState,O),K=ud(r,Ee.getState,I),se=ud(r,Ee.getState,D),ie=(ht,en)=>{if(ht.button!==0)return;const{edges:Hn,isValidConnection:qn}=Ee.getState(),Ki=en?v:g,bn=(en?P:C)||null,wn=en?"target":"source",La=qn||LH,dv=en,Ju=Hn.find(oo=>oo.id===r);be(!0),M==null||M(ht,Ju,wn);const fv=oo=>{be(!1),B==null||B(oo,Ju,wn)};Q4({event:ht,handleId:bn,nodeId:Ki,onConnect:oo=>R==null?void 0:R(Ju,oo),isTarget:dv,getState:Ee.getState,setState:Ee.setState,isValidConnection:La,edgeUpdaterType:wn,onReconnectEnd:fv})},te=ht=>ie(ht,!0),ge=ht=>ie(ht,!1),Fe=()=>Q(!0),Ve=()=>Q(!1),qt=!k&&!s,wi=ht=>{var en;if(!J&&F4.includes(ht.key)&&k){const{unselectNodesAndEdges:Hn,addSelectedEdges:qn,edges:Ki}=Ee.getState();ht.key==="Escape"?((en=oe.current)==null||en.blur(),Hn({edges:[Ki.find(wn=>wn.id===r)]})):qn([r])}};return T.createElement("g",{className:gr(["react-flow__edge",`react-flow__edge-${i}`,n,{selected:c,animated:u,inactive:qt,updating:me}]),onClick:V,onDoubleClick:ce,onContextMenu:F,onMouseEnter:H,onMouseMove:K,onMouseLeave:se,onKeyDown:ee?wi:void 0,tabIndex:ee?0:void 0,role:ee?"button":"img","data-testid":`rf__edge-${r}`,"aria-label":q===null?void 0:q||`Edge from ${g} to ${v}`,"aria-describedby":ee?`${o3}-${Z}`:void 0,ref:oe},!Pe&&T.createElement(e,{id:r,source:g,target:v,selected:c,animated:u,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:p,data:a,style:x,sourceX:w,sourceY:_,targetX:j,targetY:N,sourcePosition:S,targetPosition:E,sourceHandleId:C,targetHandleId:P,markerStart:Re,markerEnd:Y,pathOptions:ve,interactionWidth:Ne}),le&&T.createElement(T.Fragment,null,(le==="source"||le===!0)&&T.createElement(Fk,{position:S,centerX:w,centerY:_,radius:L,onMouseDown:te,onMouseEnter:Fe,onMouseOut:Ve,type:"source"}),(le==="target"||le===!0)&&T.createElement(Fk,{position:E,centerX:j,centerY:N,radius:L,onMouseDown:ge,onMouseEnter:Fe,onMouseOut:Ve,type:"target"})))};return t.displayName="EdgeWrapper",b.memo(t)};function FH(e){const t={default:Bl(e.default||cg),straight:Bl(e.bezier||F2),step:Bl(e.step||L2),smoothstep:Bl(e.step||e0),simplebezier:Bl(e.simplebezier||D2)},r={},n=Object.keys(e).filter(i=>!["default","bezier"].includes(i)).reduce((i,a)=>(i[a]=Bl(e[a]||cg),i),r);return{...t,...n}}function Bk(e,t,r=null){const n=((r==null?void 0:r.x)||0)+t.x,i=((r==null?void 0:r.y)||0)+t.y,a=(r==null?void 0:r.width)||t.width,s=(r==null?void 0:r.height)||t.height;switch(e){case je.Top:return{x:n+a/2,y:i};case je.Right:return{x:n+a,y:i+s/2};case je.Bottom:return{x:n+a/2,y:i+s};case je.Left:return{x:n,y:i+s/2}}}function zk(e,t){return e?e.length===1||!t?e[0]:t&&e.find(r=>r.id===t)||null:null}const BH=(e,t,r,n,i,a)=>{const s=Bk(r,e,t),l=Bk(a,n,i);return{sourceX:s.x,sourceY:s.y,targetX:l.x,targetY:l.y}};function zH({sourcePos:e,targetPos:t,sourceWidth:r,sourceHeight:n,targetWidth:i,targetHeight:a,width:s,height:l,transform:c}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+r,t.x+i),y2:Math.max(e.y+n,t.y+a)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const d=Bf({x:(0-c[0])/c[2],y:(0-c[1])/c[2],width:s/c[2],height:l/c[2]}),f=Math.max(0,Math.min(d.x2,u.x2)-Math.max(d.x,u.x)),h=Math.max(0,Math.min(d.y2,u.y2)-Math.max(d.y,u.y));return Math.ceil(f*h)>0}function Uk(e){var n,i,a,s,l;const t=((n=e==null?void 0:e[Pt])==null?void 0:n.handleBounds)||null,r=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.x)<"u"&&typeof((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.y)<"u";return[{x:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)||0,y:((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!r]}const UH=[{level:0,isMaxLevel:!0,edges:[]}];function WH(e,t,r=!1){let n=-1;const i=e.reduce((s,l)=>{var d,f;const c=$n(l.zIndex);let u=c?l.zIndex:0;if(r){const h=t.get(l.target),m=t.get(l.source),y=l.selected||(h==null?void 0:h.selected)||(m==null?void 0:m.selected),p=Math.max(((d=m==null?void 0:m[Pt])==null?void 0:d.z)||0,((f=h==null?void 0:h[Pt])==null?void 0:f.z)||0,1e3);u=(c?l.zIndex:0)+(y?p:0)}return s[u]?s[u].push(l):s[u]=[l],n=u>n?u:n,s},{}),a=Object.entries(i).map(([s,l])=>{const c=+s;return{edges:l,level:c,isMaxLevel:c===n}});return a.length===0?UH:a}function VH(e,t,r){const n=ft(b.useCallback(i=>e?i.edges.filter(a=>{const s=t.get(a.source),l=t.get(a.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(l==null?void 0:l.width)&&(l==null?void 0:l.height)&&zH({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:l.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:l.width,targetHeight:l.height,width:i.width,height:i.height,transform:i.transform})}):i.edges,[e,t]));return WH(n,t,r)}const HH=({color:e="none",strokeWidth:t=1})=>T.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),qH=({color:e="none",strokeWidth:t=1})=>T.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Wk={[lg.Arrow]:HH,[lg.ArrowClosed]:qH};function KH(e){const t=er();return b.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(Wk,e)?Wk[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",Na.error009(e)),null)},[e])}const GH=({id:e,type:t,color:r,width:n=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const c=KH(t);return c?T.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${n}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0"},T.createElement(c,{color:r,strokeWidth:s})):null},YH=({defaultColor:e,rfId:t})=>r=>{const n=[];return r.edges.reduce((i,a)=>([a.markerStart,a.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const l=xw(s,t);n.includes(l)||(i.push({id:l,color:s.color||e,...s}),n.push(l))}}),i),[]).sort((i,a)=>i.id.localeCompare(a.id))},b3=({defaultColor:e,rfId:t})=>{const r=ft(b.useCallback(YH({defaultColor:e,rfId:t}),[e,t]),(n,i)=>!(n.length!==i.length||n.some((a,s)=>a.id!==i[s].id)));return T.createElement("defs",null,r.map(n=>T.createElement(GH,{id:n.id,key:n.id,type:n.type,color:n.color,width:n.width,height:n.height,markerUnits:n.markerUnits,strokeWidth:n.strokeWidth,orient:n.orient})))};b3.displayName="MarkerDefinitions";var ZH=b.memo(b3);const XH=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),w3=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:r,rfId:n,edgeTypes:i,noPanClassName:a,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,onEdgeDoubleClick:f,onReconnect:h,onReconnectStart:m,onReconnectEnd:y,reconnectRadius:p,children:x,disableKeyboardA11y:g})=>{const{edgesFocusable:v,edgesUpdatable:w,elementsSelectable:_,width:j,height:N,connectionMode:S,nodeInternals:E,onError:k}=ft(XH,cr),A=VH(t,E,r);return j?T.createElement(T.Fragment,null,A.map(({level:C,edges:P,isMaxLevel:$})=>T.createElement("svg",{key:C,style:{zIndex:C},width:j,height:N,className:"react-flow__edges react-flow__container"},$&&T.createElement(ZH,{defaultColor:e,rfId:n}),T.createElement("g",null,P.map(O=>{const[I,D,L]=Uk(E.get(O.source)),[R,M,B]=Uk(E.get(O.target));if(!L||!B)return null;let U=O.type||"default";i[U]||(k==null||k("011",Na.error011(U)),U="default");const W=i[U]||i.default,Z=S===hl.Strict?M.target:(M.target??[]).concat(M.source??[]),q=zk(D.source,O.sourceHandle),ee=zk(Z,O.targetHandle),le=(q==null?void 0:q.position)||je.Bottom,ve=(ee==null?void 0:ee.position)||je.Top,Ne=!!(O.focusable||v&&typeof O.focusable>"u"),J=O.reconnectable||O.updatable,oe=typeof h<"u"&&(J||w&&typeof J>"u");if(!q||!ee)return k==null||k("008",Na.error008(q,O)),null;const{sourceX:me,sourceY:Q,targetX:Pe,targetY:be}=BH(I,q,le,R,ee,ve);return T.createElement(W,{key:O.id,id:O.id,className:gr([O.className,a]),type:U,data:O.data,selected:!!O.selected,animated:!!O.animated,hidden:!!O.hidden,label:O.label,labelStyle:O.labelStyle,labelShowBg:O.labelShowBg,labelBgStyle:O.labelBgStyle,labelBgPadding:O.labelBgPadding,labelBgBorderRadius:O.labelBgBorderRadius,style:O.style,source:O.source,target:O.target,sourceHandleId:O.sourceHandle,targetHandleId:O.targetHandle,markerEnd:O.markerEnd,markerStart:O.markerStart,sourceX:me,sourceY:Q,targetX:Pe,targetY:be,sourcePosition:le,targetPosition:ve,elementsSelectable:_,onContextMenu:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,onEdgeDoubleClick:f,onReconnect:h,onReconnectStart:m,onReconnectEnd:y,reconnectRadius:p,rfId:n,ariaLabel:O.ariaLabel,isFocusable:Ne,isReconnectable:oe,pathOptions:"pathOptions"in O?O.pathOptions:void 0,interactionWidth:O.interactionWidth,disableKeyboardA11y:g})})))),x):null};w3.displayName="EdgeRenderer";var QH=b.memo(w3);const JH=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function eq({children:e}){const t=ft(JH);return T.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function tq(e){const t=W2(),r=b.useRef(!1);b.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const rq={[je.Left]:je.Right,[je.Right]:je.Left,[je.Top]:je.Bottom,[je.Bottom]:je.Top},j3=({nodeId:e,handleType:t,style:r,type:n=ts.Bezier,CustomComponent:i,connectionStatus:a})=>{var N,S,E;const{fromNode:s,handleId:l,toX:c,toY:u,connectionMode:d}=ft(b.useCallback(k=>({fromNode:k.nodeInternals.get(e),handleId:k.connectionHandleId,toX:(k.connectionPosition.x-k.transform[0])/k.transform[2],toY:(k.connectionPosition.y-k.transform[1])/k.transform[2],connectionMode:k.connectionMode}),[e]),cr),f=(N=s==null?void 0:s[Pt])==null?void 0:N.handleBounds;let h=f==null?void 0:f[t];if(d===hl.Loose&&(h=h||(f==null?void 0:f[t==="source"?"target":"source"])),!s||!h)return null;const m=l?h.find(k=>k.id===l):h[0],y=m?m.x+m.width/2:(s.width??0)/2,p=m?m.y+m.height/2:s.height??0,x=(((S=s.positionAbsolute)==null?void 0:S.x)??0)+y,g=(((E=s.positionAbsolute)==null?void 0:E.y)??0)+p,v=m==null?void 0:m.position,w=v?rq[v]:null;if(!v||!w)return null;if(i)return T.createElement(i,{connectionLineType:n,connectionLineStyle:r,fromNode:s,fromHandle:m,fromX:x,fromY:g,toX:c,toY:u,fromPosition:v,toPosition:w,connectionStatus:a});let _="";const j={sourceX:x,sourceY:g,sourcePosition:v,targetX:c,targetY:u,targetPosition:w};return n===ts.Bezier?[_]=V4(j):n===ts.Step?[_]=vw({...j,borderRadius:0}):n===ts.SmoothStep?[_]=vw(j):n===ts.SimpleBezier?[_]=W4(j):_=`M${x},${g} ${c},${u}`,T.createElement("path",{d:_,fill:"none",className:"react-flow__connection-path",style:r})};j3.displayName="ConnectionLine";const nq=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function iq({containerStyle:e,style:t,type:r,component:n}){const{nodeId:i,handleType:a,nodesConnectable:s,width:l,height:c,connectionStatus:u}=ft(nq,cr);return!(i&&a&&l&&s)?null:T.createElement("svg",{style:e,width:l,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},T.createElement("g",{className:gr(["react-flow__connection",u])},T.createElement(j3,{nodeId:i,handleType:a,style:t,type:r,CustomComponent:n,connectionStatus:u})))}function Vk(e,t){return b.useRef(null),er(),b.useMemo(()=>t(e),[e])}const _3=({nodeTypes:e,edgeTypes:t,onMove:r,onMoveStart:n,onMoveEnd:i,onInit:a,onNodeClick:s,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:m,onSelectionContextMenu:y,onSelectionStart:p,onSelectionEnd:x,connectionLineType:g,connectionLineStyle:v,connectionLineComponent:w,connectionLineContainerStyle:_,selectionKeyCode:j,selectionOnDrag:N,selectionMode:S,multiSelectionKeyCode:E,panActivationKeyCode:k,zoomActivationKeyCode:A,deleteKeyCode:C,onlyRenderVisibleElements:P,elementsSelectable:$,selectNodesOnDrag:O,defaultViewport:I,translateExtent:D,minZoom:L,maxZoom:R,preventScrolling:M,defaultMarkerColor:B,zoomOnScroll:U,zoomOnPinch:W,panOnScroll:Z,panOnScrollSpeed:q,panOnScrollMode:ee,zoomOnDoubleClick:le,panOnDrag:ve,onPaneClick:Ne,onPaneMouseEnter:J,onPaneMouseMove:oe,onPaneMouseLeave:me,onPaneScroll:Q,onPaneContextMenu:Pe,onEdgeContextMenu:be,onEdgeMouseEnter:Ee,onEdgeMouseMove:Re,onEdgeMouseLeave:Y,onReconnect:V,onReconnectStart:ce,onReconnectEnd:F,reconnectRadius:H,noDragClassName:K,noWheelClassName:se,noPanClassName:ie,elevateEdgesOnSelect:te,disableKeyboardA11y:ge,nodeOrigin:Fe,nodeExtent:Ve,rfId:qt})=>{const wi=Vk(e,TH),ht=Vk(t,FH);return tq(a),T.createElement(PH,{onPaneClick:Ne,onPaneMouseEnter:J,onPaneMouseMove:oe,onPaneMouseLeave:me,onPaneContextMenu:Pe,onPaneScroll:Q,deleteKeyCode:C,selectionKeyCode:j,selectionOnDrag:N,selectionMode:S,onSelectionStart:p,onSelectionEnd:x,multiSelectionKeyCode:E,panActivationKeyCode:k,zoomActivationKeyCode:A,elementsSelectable:$,onMove:r,onMoveStart:n,onMoveEnd:i,zoomOnScroll:U,zoomOnPinch:W,zoomOnDoubleClick:le,panOnScroll:Z,panOnScrollSpeed:q,panOnScrollMode:ee,panOnDrag:ve,defaultViewport:I,translateExtent:D,minZoom:L,maxZoom:R,onSelectionContextMenu:y,preventScrolling:M,noDragClassName:K,noWheelClassName:se,noPanClassName:ie,disableKeyboardA11y:ge},T.createElement(eq,null,T.createElement(QH,{edgeTypes:ht,onEdgeClick:l,onEdgeDoubleClick:u,onlyRenderVisibleElements:P,onEdgeContextMenu:be,onEdgeMouseEnter:Ee,onEdgeMouseMove:Re,onEdgeMouseLeave:Y,onReconnect:V,onReconnectStart:ce,onReconnectEnd:F,reconnectRadius:H,defaultMarkerColor:B,noPanClassName:ie,elevateEdgesOnSelect:!!te,disableKeyboardA11y:ge,rfId:qt},T.createElement(iq,{style:v,type:g,component:w,containerStyle:_})),T.createElement("div",{className:"react-flow__edgelabel-renderer"}),T.createElement(RH,{nodeTypes:wi,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:m,selectNodesOnDrag:O,onlyRenderVisibleElements:P,noPanClassName:ie,noDragClassName:K,disableKeyboardA11y:ge,nodeOrigin:Fe,nodeExtent:Ve,rfId:qt})))};_3.displayName="GraphView";var aq=b.memo(_3);const _w=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ba={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:_w,nodeExtent:_w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:hl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:MV,isValidConnection:void 0},sq=()=>VB((e,t)=>({...Ba,setNodes:r=>{const{nodeInternals:n,nodeOrigin:i,elevateNodesOnSelect:a}=t();e({nodeInternals:Yv(r,n,i,a)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:r=>{const{defaultEdgeOptions:n={}}=t();e({edges:r.map(i=>({...n,...i}))})},setDefaultNodesAndEdges:(r,n)=>{const i=typeof r<"u",a=typeof n<"u",s=i?Yv(r,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:a?n:[],hasDefaultNodes:i,hasDefaultEdges:a})},updateNodeDimensions:r=>{const{onNodesChange:n,nodeInternals:i,fitViewOnInit:a,fitViewOnInitDone:s,fitViewOnInitOptions:l,domNode:c,nodeOrigin:u}=t(),d=c==null?void 0:c.querySelector(".react-flow__viewport");if(!d)return;const f=window.getComputedStyle(d),{m22:h}=new window.DOMMatrixReadOnly(f.transform),m=r.reduce((p,x)=>{const g=i.get(x.id);if(g!=null&&g.hidden)i.set(g.id,{...g,[Pt]:{...g[Pt],handleBounds:void 0}});else if(g){const v=R2(x.nodeElement);!!(v.width&&v.height&&(g.width!==v.width||g.height!==v.height||x.forceUpdate))&&(i.set(g.id,{...g,[Pt]:{...g[Pt],handleBounds:{source:Dk(".source",x.nodeElement,h,u),target:Dk(".target",x.nodeElement,h,u)}},...v}),p.push({id:g.id,type:"dimensions",dimensions:v}))}return p},[]);c3(i,u);const y=s||a&&!s&&u3(t,{initial:!0,...l});e({nodeInternals:new Map(i),fitViewOnInitDone:y}),(m==null?void 0:m.length)>0&&(n==null||n(m))},updateNodePositions:(r,n=!0,i=!1)=>{const{triggerNodeChanges:a}=t(),s=r.map(l=>{const c={id:l.id,type:"position",dragging:i};return n&&(c.positionAbsolute=l.positionAbsolute,c.position=l.position),c});a(s)},triggerNodeChanges:r=>{const{onNodesChange:n,nodeInternals:i,hasDefaultNodes:a,nodeOrigin:s,getNodes:l,elevateNodesOnSelect:c}=t();if(r!=null&&r.length){if(a){const u=f3(r,l()),d=Yv(u,i,s,c);e({nodeInternals:d})}n==null||n(r)}},addSelectedNodes:r=>{const{multiSelectionActive:n,edges:i,getNodes:a}=t();let s,l=null;n?s=r.map(c=>Ya(c,!0)):(s=cc(a(),r),l=cc(i,[])),Cm({changedNodes:s,changedEdges:l,get:t,set:e})},addSelectedEdges:r=>{const{multiSelectionActive:n,edges:i,getNodes:a}=t();let s,l=null;n?s=r.map(c=>Ya(c,!0)):(s=cc(i,r),l=cc(a(),[])),Cm({changedNodes:l,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:r,edges:n}={})=>{const{edges:i,getNodes:a}=t(),s=r||a(),l=n||i,c=s.map(d=>(d.selected=!1,Ya(d.id,!1))),u=l.map(d=>Ya(d.id,!1));Cm({changedNodes:c,changedEdges:u,get:t,set:e})},setMinZoom:r=>{const{d3Zoom:n,maxZoom:i}=t();n==null||n.scaleExtent([r,i]),e({minZoom:r})},setMaxZoom:r=>{const{d3Zoom:n,minZoom:i}=t();n==null||n.scaleExtent([i,r]),e({maxZoom:r})},setTranslateExtent:r=>{var n;(n=t().d3Zoom)==null||n.translateExtent(r),e({translateExtent:r})},resetSelectedElements:()=>{const{edges:r,getNodes:n}=t(),a=n().filter(l=>l.selected).map(l=>Ya(l.id,!1)),s=r.filter(l=>l.selected).map(l=>Ya(l.id,!1));Cm({changedNodes:a,changedEdges:s,get:t,set:e})},setNodeExtent:r=>{const{nodeInternals:n}=t();n.forEach(i=>{i.positionAbsolute=I2(i.position,r)}),e({nodeExtent:r,nodeInternals:new Map(n)})},panBy:r=>{const{transform:n,width:i,height:a,d3Zoom:s,d3Selection:l,translateExtent:c}=t();if(!s||!l||!r.x&&!r.y)return!1;const u=ma.translate(n[0]+r.x,n[1]+r.y).scale(n[2]),d=[[0,0],[i,a]],f=s==null?void 0:s.constrain()(u,d,c);return s.transform(l,f),n[0]!==f.x||n[1]!==f.y||n[2]!==f.k},cancelConnection:()=>e({connectionNodeId:Ba.connectionNodeId,connectionHandleId:Ba.connectionHandleId,connectionHandleType:Ba.connectionHandleType,connectionStatus:Ba.connectionStatus,connectionStartHandle:Ba.connectionStartHandle,connectionEndHandle:Ba.connectionEndHandle}),reset:()=>e({...Ba})}),Object.is),H2=({children:e})=>{const t=b.useRef(null);return t.current||(t.current=sq()),T.createElement(EV,{value:t.current},e)};H2.displayName="ReactFlowProvider";const N3=({children:e})=>b.useContext(Qy)?T.createElement(T.Fragment,null,e):T.createElement(H2,null,e);N3.displayName="ReactFlowWrapper";const oq={input:r3,default:ww,output:i3,group:U2},lq={default:cg,straight:F2,step:L2,smoothstep:e0,simplebezier:D2},cq=[0,0],uq=[15,15],dq={x:0,y:0,zoom:1},fq={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},S3=b.forwardRef(({nodes:e,edges:t,defaultNodes:r,defaultEdges:n,className:i,nodeTypes:a=oq,edgeTypes:s=lq,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:m,onConnectStart:y,onConnectEnd:p,onClickConnectStart:x,onClickConnectEnd:g,onNodeMouseEnter:v,onNodeMouseMove:w,onNodeMouseLeave:_,onNodeContextMenu:j,onNodeDoubleClick:N,onNodeDragStart:S,onNodeDrag:E,onNodeDragStop:k,onNodesDelete:A,onEdgesDelete:C,onSelectionChange:P,onSelectionDragStart:$,onSelectionDrag:O,onSelectionDragStop:I,onSelectionContextMenu:D,onSelectionStart:L,onSelectionEnd:R,connectionMode:M=hl.Strict,connectionLineType:B=ts.Bezier,connectionLineStyle:U,connectionLineComponent:W,connectionLineContainerStyle:Z,deleteKeyCode:q="Backspace",selectionKeyCode:ee="Shift",selectionOnDrag:le=!1,selectionMode:ve=zf.Full,panActivationKeyCode:Ne="Space",multiSelectionKeyCode:J=og()?"Meta":"Control",zoomActivationKeyCode:oe=og()?"Meta":"Control",snapToGrid:me=!1,snapGrid:Q=uq,onlyRenderVisibleElements:Pe=!1,selectNodesOnDrag:be=!0,nodesDraggable:Ee,nodesConnectable:Re,nodesFocusable:Y,nodeOrigin:V=cq,edgesFocusable:ce,edgesUpdatable:F,elementsSelectable:H,defaultViewport:K=dq,minZoom:se=.5,maxZoom:ie=2,translateExtent:te=_w,preventScrolling:ge=!0,nodeExtent:Fe,defaultMarkerColor:Ve="#b1b1b7",zoomOnScroll:qt=!0,zoomOnPinch:wi=!0,panOnScroll:ht=!1,panOnScrollSpeed:en=.5,panOnScrollMode:Hn=To.Free,zoomOnDoubleClick:qn=!0,panOnDrag:Ki=!0,onPaneClick:bn,onPaneMouseEnter:wn,onPaneMouseMove:La,onPaneMouseLeave:dv,onPaneScroll:Ju,onPaneContextMenu:fv,children:SN,onEdgeContextMenu:oo,onEdgeDoubleClick:WD,onEdgeMouseEnter:VD,onEdgeMouseMove:HD,onEdgeMouseLeave:qD,onEdgeUpdate:KD,onEdgeUpdateStart:GD,onEdgeUpdateEnd:YD,onReconnect:ZD,onReconnectStart:XD,onReconnectEnd:QD,reconnectRadius:JD=10,edgeUpdaterRadius:eL=10,onNodesChange:tL,onEdgesChange:rL,noDragClassName:nL="nodrag",noWheelClassName:iL="nowheel",noPanClassName:kN="nopan",fitView:aL=!1,fitViewOptions:sL,connectOnClick:oL=!0,attributionPosition:lL,proOptions:cL,defaultEdgeOptions:uL,elevateNodesOnSelect:dL=!0,elevateEdgesOnSelect:fL=!1,disableKeyboardA11y:EN=!1,autoPanOnConnect:hL=!0,autoPanOnNodeDrag:mL=!0,connectionRadius:pL=20,isValidConnection:gL,onError:yL,style:vL,id:ON,nodeDragThreshold:xL,...bL},wL)=>{const hv=ON||"1";return T.createElement("div",{...bL,style:{...vL,...fq},ref:wL,className:gr(["react-flow",i]),"data-testid":"rf__wrapper",id:ON},T.createElement(N3,null,T.createElement(aq,{onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:w,onNodeMouseLeave:_,onNodeContextMenu:j,onNodeDoubleClick:N,nodeTypes:a,edgeTypes:s,connectionLineType:B,connectionLineStyle:U,connectionLineComponent:W,connectionLineContainerStyle:Z,selectionKeyCode:ee,selectionOnDrag:le,selectionMode:ve,deleteKeyCode:q,multiSelectionKeyCode:J,panActivationKeyCode:Ne,zoomActivationKeyCode:oe,onlyRenderVisibleElements:Pe,selectNodesOnDrag:be,defaultViewport:K,translateExtent:te,minZoom:se,maxZoom:ie,preventScrolling:ge,zoomOnScroll:qt,zoomOnPinch:wi,zoomOnDoubleClick:qn,panOnScroll:ht,panOnScrollSpeed:en,panOnScrollMode:Hn,panOnDrag:Ki,onPaneClick:bn,onPaneMouseEnter:wn,onPaneMouseMove:La,onPaneMouseLeave:dv,onPaneScroll:Ju,onPaneContextMenu:fv,onSelectionContextMenu:D,onSelectionStart:L,onSelectionEnd:R,onEdgeContextMenu:oo,onEdgeDoubleClick:WD,onEdgeMouseEnter:VD,onEdgeMouseMove:HD,onEdgeMouseLeave:qD,onReconnect:ZD??KD,onReconnectStart:XD??GD,onReconnectEnd:QD??YD,reconnectRadius:JD??eL,defaultMarkerColor:Ve,noDragClassName:nL,noWheelClassName:iL,noPanClassName:kN,elevateEdgesOnSelect:fL,rfId:hv,disableKeyboardA11y:EN,nodeOrigin:V,nodeExtent:Fe}),T.createElement(rH,{nodes:e,edges:t,defaultNodes:r,defaultEdges:n,onConnect:m,onConnectStart:y,onConnectEnd:p,onClickConnectStart:x,onClickConnectEnd:g,nodesDraggable:Ee,nodesConnectable:Re,nodesFocusable:Y,edgesFocusable:ce,edgesUpdatable:F,elementsSelectable:H,elevateNodesOnSelect:dL,minZoom:se,maxZoom:ie,nodeExtent:Fe,onNodesChange:tL,onEdgesChange:rL,snapToGrid:me,snapGrid:Q,connectionMode:M,translateExtent:te,connectOnClick:oL,defaultEdgeOptions:uL,fitView:aL,fitViewOptions:sL,onNodesDelete:A,onEdgesDelete:C,onNodeDragStart:S,onNodeDrag:E,onNodeDragStop:k,onSelectionDrag:O,onSelectionDragStart:$,onSelectionDragStop:I,noPanClassName:kN,nodeOrigin:V,rfId:hv,autoPanOnConnect:hL,autoPanOnNodeDrag:mL,onError:yL,connectionRadius:pL,isValidConnection:gL,nodeDragThreshold:xL}),T.createElement(eH,{onSelectionChange:P}),SN,T.createElement(AV,{proOptions:cL,position:lL}),T.createElement(oH,{rfId:hv,disableKeyboardA11y:EN})))});S3.displayName="ReactFlow";function k3(e){return t=>{const[r,n]=b.useState(t),i=b.useCallback(a=>n(s=>e(a,s)),[]);return[r,n,i]}}const hq=k3(f3),mq=k3(wH),E3=({id:e,x:t,y:r,width:n,height:i,style:a,color:s,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,onClick:h,selected:m})=>{const{background:y,backgroundColor:p}=a||{},x=s||y||p;return T.createElement("rect",{className:gr(["react-flow__minimap-node",{selected:m},u]),x:t,y:r,rx:d,ry:d,width:n,height:i,fill:x,stroke:l,strokeWidth:c,shapeRendering:f,onClick:h?g=>h(g,e):void 0})};E3.displayName="MiniMapNode";var pq=b.memo(E3);const gq=e=>e.nodeOrigin,yq=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),Jv=e=>e instanceof Function?e:()=>e;function vq({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:r="",nodeBorderRadius:n=5,nodeStrokeWidth:i=2,nodeComponent:a=pq,onClick:s}){const l=ft(yq,cr),c=ft(gq),u=Jv(t),d=Jv(e),f=Jv(r),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return T.createElement(T.Fragment,null,l.map(m=>{const{x:y,y:p}=Qo(m,c).positionAbsolute;return T.createElement(a,{key:m.id,x:y,y:p,width:m.width,height:m.height,style:m.style,selected:m.selected,className:f(m),color:u(m),borderRadius:n,strokeColor:d(m),strokeWidth:i,shapeRendering:h,onClick:s,id:m.id})}))}var xq=b.memo(vq);const bq=200,wq=150,jq=e=>{const t=e.getNodes(),r={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:r,boundingRect:t.length>0?TV(t0(t,e.nodeOrigin),r):r,rfId:e.rfId}},_q="react-flow__minimap-desc";function O3({style:e,className:t,nodeStrokeColor:r="transparent",nodeColor:n="#e2e2e2",nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:s=2,nodeComponent:l,maskColor:c="rgb(240, 240, 240, 0.6)",maskStrokeColor:u="none",maskStrokeWidth:d=1,position:f="bottom-right",onClick:h,onNodeClick:m,pannable:y=!1,zoomable:p=!1,ariaLabel:x="React Flow mini map",inversePan:g=!1,zoomStep:v=10,offsetScale:w=5}){const _=er(),j=b.useRef(null),{boundingRect:N,viewBB:S,rfId:E}=ft(jq,cr),k=(e==null?void 0:e.width)??bq,A=(e==null?void 0:e.height)??wq,C=N.width/k,P=N.height/A,$=Math.max(C,P),O=$*k,I=$*A,D=w*$,L=N.x-(O-N.width)/2-D,R=N.y-(I-N.height)/2-D,M=O+D*2,B=I+D*2,U=`${_q}-${E}`,W=b.useRef(0);W.current=$,b.useEffect(()=>{if(j.current){const ee=Pn(j.current),le=J=>{const{transform:oe,d3Selection:me,d3Zoom:Q}=_.getState();if(J.sourceEvent.type!=="wheel"||!me||!Q)return;const Pe=-J.sourceEvent.deltaY*(J.sourceEvent.deltaMode===1?.05:J.sourceEvent.deltaMode?1:.002)*v,be=oe[2]*Math.pow(2,Pe);Q.scaleTo(me,be)},ve=J=>{const{transform:oe,d3Selection:me,d3Zoom:Q,translateExtent:Pe,width:be,height:Ee}=_.getState();if(J.sourceEvent.type!=="mousemove"||!me||!Q)return;const Re=W.current*Math.max(1,oe[2])*(g?-1:1),Y={x:oe[0]-J.sourceEvent.movementX*Re,y:oe[1]-J.sourceEvent.movementY*Re},V=[[0,0],[be,Ee]],ce=ma.translate(Y.x,Y.y).scale(oe[2]),F=Q.constrain()(ce,V,Pe);Q.transform(me,F)},Ne=$4().on("zoom",y?ve:null).on("zoom.wheel",p?le:null);return ee.call(Ne),()=>{ee.on("zoom",null)}}},[y,p,g,v]);const Z=h?ee=>{const le=Jn(ee);h(ee,{x:le[0],y:le[1]})}:void 0,q=m?(ee,le)=>{const ve=_.getState().nodeInternals.get(le);m(ee,ve)}:void 0;return T.createElement(Jy,{position:f,style:e,className:gr(["react-flow__minimap",t]),"data-testid":"rf__minimap"},T.createElement("svg",{width:k,height:A,viewBox:`${L} ${R} ${M} ${B}`,role:"img","aria-labelledby":U,ref:j,onClick:Z},x&&T.createElement("title",{id:U},x),T.createElement(xq,{onClick:q,nodeColor:n,nodeStrokeColor:r,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:s,nodeComponent:l}),T.createElement("path",{className:"react-flow__minimap-mask",d:`M${L-D},${R-D}h${M+D*2}v${B+D*2}h${-M-D*2}z M${S.x},${S.y}h${S.width}v${S.height}h${-S.width}z`,fill:c,fillRule:"evenodd",stroke:u,strokeWidth:d,pointerEvents:"none"})))}O3.displayName="MiniMap";var Nq=b.memo(O3);function Sq(){return T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},T.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function kq(){return T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},T.createElement("path",{d:"M0 0h32v4.2H0z"}))}function Eq(){return T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},T.createElement("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 Oq(){return T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},T.createElement("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 Aq(){return T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},T.createElement("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"}))}const Fd=({children:e,className:t,...r})=>T.createElement("button",{type:"button",className:gr(["react-flow__controls-button",t]),...r},e);Fd.displayName="ControlButton";const Pq=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),A3=({style:e,showZoom:t=!0,showFitView:r=!0,showInteractive:n=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:s,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left"})=>{const h=er(),[m,y]=b.useState(!1),{isInteractive:p,minZoomReached:x,maxZoomReached:g}=ft(Pq,cr),{zoomIn:v,zoomOut:w,fitView:_}=W2();if(b.useEffect(()=>{y(!0)},[]),!m)return null;const j=()=>{v(),a==null||a()},N=()=>{w(),s==null||s()},S=()=>{_(i),l==null||l()},E=()=>{h.setState({nodesDraggable:!p,nodesConnectable:!p,elementsSelectable:!p}),c==null||c(!p)};return T.createElement(Jy,{className:gr(["react-flow__controls",u]),position:f,style:e,"data-testid":"rf__controls"},t&&T.createElement(T.Fragment,null,T.createElement(Fd,{onClick:j,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:g},T.createElement(Sq,null)),T.createElement(Fd,{onClick:N,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:x},T.createElement(kq,null))),r&&T.createElement(Fd,{className:"react-flow__controls-fitview",onClick:S,title:"fit view","aria-label":"fit view"},T.createElement(Eq,null)),n&&T.createElement(Fd,{className:"react-flow__controls-interactive",onClick:E,title:"toggle interactivity","aria-label":"toggle interactivity"},p?T.createElement(Aq,null):T.createElement(Oq,null)),d)};A3.displayName="Controls";var Cq=b.memo(A3),Dn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Dn||(Dn={}));function Tq({color:e,dimensions:t,lineWidth:r}){return T.createElement("path",{stroke:e,strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function $q({color:e,radius:t}){return T.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const Mq={[Dn.Dots]:"#91919a",[Dn.Lines]:"#eee",[Dn.Cross]:"#e2e2e2"},Rq={[Dn.Dots]:1,[Dn.Lines]:1,[Dn.Cross]:6},Iq=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function P3({id:e,variant:t=Dn.Dots,gap:r=20,size:n,lineWidth:i=1,offset:a=2,color:s,style:l,className:c}){const u=b.useRef(null),{transform:d,patternId:f}=ft(Iq,cr),h=s||Mq[t],m=n||Rq[t],y=t===Dn.Dots,p=t===Dn.Cross,x=Array.isArray(r)?r:[r,r],g=[x[0]*d[2]||1,x[1]*d[2]||1],v=m*d[2],w=p?[v,v]:g,_=y?[v/a,v/a]:[w[0]/a,w[1]/a];return T.createElement("svg",{className:gr(["react-flow__background",c]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:u,"data-testid":"rf__background"},T.createElement("pattern",{id:f+e,x:d[0]%g[0],y:d[1]%g[1],width:g[0],height:g[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${_[0]},-${_[1]})`},y?T.createElement($q,{color:h,radius:v/a}):T.createElement(Tq,{dimensions:w,color:h,lineWidth:i})),T.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}P3.displayName="Background";var Dq=b.memo(P3);function Lq({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75"}))}const Fq=b.forwardRef(Lq);function Bq({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const dg=b.forwardRef(Bq);function zq({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const fg=b.forwardRef(zq);function Uq({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0 0 13.5 3h-6a2.25 2.25 0 0 0-2.25 2.25v13.5A2.25 2.25 0 0 0 7.5 21h6a2.25 2.25 0 0 0 2.25-2.25V15m3 0 3-3m0 0-3-3m3 3H9"}))}const Wq=b.forwardRef(Uq);function Vq({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"}))}const lo=b.forwardRef(Vq);function Hq({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 6 9 12.75l4.286-4.286a11.948 11.948 0 0 1 4.306 6.43l.776 2.898m0 0 3.182-5.511m-3.182 5.51-5.511-3.181"}))}const qq=b.forwardRef(Hq);function Kq({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18 9 11.25l4.306 4.306a11.95 11.95 0 0 1 5.814-5.518l2.74-1.22m0 0-5.94-2.281m5.94 2.28-2.28 5.941"}))}const ex=b.forwardRef(Kq);function Gq({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"}))}const Yq=b.forwardRef(Gq);function Zq({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0"}))}const Xq=b.forwardRef(Zq);function Qq({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"}))}const Jq=b.forwardRef(Qq);function eK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.593 3.322c1.1.128 1.907 1.077 1.907 2.185V21L12 17.25 4.5 21V5.507c0-1.108.806-2.057 1.907-2.185a48.507 48.507 0 0 1 11.186 0Z"}))}const tK=b.forwardRef(eK);function rK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z"}))}const Qc=b.forwardRef(rK);function nK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"}))}const C3=b.forwardRef(nK);function iK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const dn=b.forwardRef(iK);function aK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const sK=b.forwardRef(aK);function oK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const q2=b.forwardRef(oK);function lK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"}))}const cK=b.forwardRef(lK);function uK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const dK=b.forwardRef(uK);function fK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const Hk=b.forwardRef(fK);function hK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"}))}const mK=b.forwardRef(hK);function pK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const hr=b.forwardRef(pK);function gK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const ml=b.forwardRef(gK);function yK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"}))}const Si=b.forwardRef(yK);function vK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"}))}const Ds=b.forwardRef(vK);function xK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"}))}const pl=b.forwardRef(xK);function bK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"}))}const wK=b.forwardRef(bK);function jK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const _o=b.forwardRef(jK);function _K({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 12.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 18.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5Z"}))}const NK=b.forwardRef(_K);function SK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"}))}const T3=b.forwardRef(SK);function kK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}const Ls=b.forwardRef(kK);function EK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"}))}const OK=b.forwardRef(EK);function AK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const K2=b.forwardRef(AK);function PK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const Wf=b.forwardRef(PK);function CK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"}))}const G2=b.forwardRef(CK);function TK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"}))}const $K=b.forwardRef(TK);function MK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const Bd=b.forwardRef(MK);function RK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"}))}const IK=b.forwardRef(RK);function DK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"}))}const qk=b.forwardRef(DK);function LK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const r0=b.forwardRef(LK);function FK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"}))}const BK=b.forwardRef(FK);function zK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12 3.269 3.125A59.769 59.769 0 0 1 21.485 12 59.768 59.768 0 0 1 3.27 20.875L5.999 12Zm0 0h7.5"}))}const UK=b.forwardRef(zK);function WK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25v13.5m-7.5-13.5v13.5"}))}const hg=b.forwardRef(WK);function VK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"}))}const Vf=b.forwardRef(VK);function HK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"}))}const hi=b.forwardRef(HK);function qK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const Sa=b.forwardRef(qK);function KK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 17.25v-.228a4.5 4.5 0 0 0-.12-1.03l-2.268-9.64a3.375 3.375 0 0 0-3.285-2.602H7.923a3.375 3.375 0 0 0-3.285 2.602l-2.268 9.64a4.5 4.5 0 0 0-.12 1.03v.228m19.5 0a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3m19.5 0a3 3 0 0 0-3-3H5.25a3 3 0 0 0-3 3m16.5 0h.008v.008h-.008v-.008Zm-3 0h.008v.008h-.008v-.008Z"}))}const zd=b.forwardRef(KK);function GK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"}))}const YK=b.forwardRef(GK);function ZK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z"}))}const tx=b.forwardRef(ZK);function XK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z"}))}const Kk=b.forwardRef(XK);function QK({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"}))}const JK=b.forwardRef(QK);function eG({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 0 0 5.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 0 0 9.568 3Z"}),b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6h.008v.008H6V6Z"}))}const Y2=b.forwardRef(eG);function tG({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const $3=b.forwardRef(tG);function rG({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const Nw=b.forwardRef(rG);function nG({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z"}))}const Hf=b.forwardRef(nG);function iG({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"}))}const M3=b.forwardRef(iG);function aG({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.288 15.038a5.25 5.25 0 0 1 7.424 0M5.106 11.856c3.807-3.808 9.98-3.808 13.788 0M1.924 8.674c5.565-5.565 14.587-5.565 20.152 0M12.53 18.22l-.53.53-.53-.53a.75.75 0 0 1 1.06 0Z"}))}const sG=b.forwardRef(aG);function oG({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"}))}const lG=b.forwardRef(oG);function cG({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const Kr=b.forwardRef(cG);function uG({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const qf=b.forwardRef(uG);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dG=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),R3=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var fG={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hG=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:s,...l},c)=>b.createElement("svg",{ref:c,...fG,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:R3("lucide",i),...l},[...s.map(([u,d])=>b.createElement(u,d)),...Array.isArray(a)?a:[a]]));/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tt=(e,t)=>{const r=b.forwardRef(({className:n,...i},a)=>b.createElement(hG,{ref:a,iconNode:t,className:R3(`lucide-${dG(e)}`,n),...i}));return r.displayName=`${e}`,r};/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mG=tt("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rx=tt("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pG=tt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gl=tt("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sw=tt("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nx=tt("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gG=tt("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yG=tt("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const No=tt("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const So=tt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vG=tt("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xG=tt("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bG=tt("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mg=tt("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mp=tt("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ci=tt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wG=tt("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jG=tt("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _G=tt("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gk=tt("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Yk=tt("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pg=tt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Yl=tt("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const NG=tt("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const SG=tt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kG=tt("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const EG=tt("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const I3=tt("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const OG=tt("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),AG=()=>"https://whoosh.home.deepblack.cloud",gl={baseURL:AG(),timeout:3e4},D3=b.createContext(void 0),hd=gl.baseURL+"/api",PG=({children:e})=>{const[t,r]=b.useState(null),[n,i]=b.useState(null),[a,s]=b.useState(!0),l=!!t&&!!n;b.useEffect(()=>{(async()=>{try{const v=localStorage.getItem("whoosh_tokens"),w=localStorage.getItem("whoosh_user");if(v&&w){const _=JSON.parse(v),j=JSON.parse(w);await c(_)?(i(_),r(j)):await u(_)||p()}}catch(v){console.error("Error initializing auth:",v),p()}finally{s(!1)}})()},[]);const c=async g=>{try{return(await fetch(`${hd}/auth/me`,{headers:{Authorization:`Bearer ${g.access_token}`}})).ok}catch{return!1}},u=async g=>{try{const v=await fetch(`${hd}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:g.refresh_token})});if(v.ok){const w=await v.json(),_={access_token:w.access_token,refresh_token:w.refresh_token,token_type:w.token_type,expires_in:w.expires_in};return i(_),r(w.user),localStorage.setItem("whoosh_tokens",JSON.stringify(_)),localStorage.setItem("whoosh_user",JSON.stringify(w.user)),localStorage.setItem("token",_.access_token),!0}else return!1}catch(v){return console.error("Token refresh failed:",v),!1}},d=async(g,v)=>{try{const w=new FormData;w.append("username",g),w.append("password",v);const _=await fetch(`${hd}/auth/login`,{method:"POST",body:w});if(!_.ok){const S=await _.json();throw new Error(S.detail||"Login failed")}const j=await _.json(),N={access_token:j.access_token,refresh_token:j.refresh_token,token_type:j.token_type,expires_in:j.expires_in};i(N),r(j.user),localStorage.setItem("whoosh_tokens",JSON.stringify(N)),localStorage.setItem("whoosh_user",JSON.stringify(j.user)),localStorage.setItem("token",N.access_token)}catch(w){throw new Error(w.message||"Login failed")}},f=async g=>{try{const v=await fetch(`${hd}/auth/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g)});if(!v.ok){const j=await v.json();throw new Error(j.detail||"Registration failed")}const w=await v.json(),_={access_token:w.access_token,refresh_token:w.refresh_token,token_type:w.token_type,expires_in:3600};i(_),r(w.user),localStorage.setItem("whoosh_tokens",JSON.stringify(_)),localStorage.setItem("whoosh_user",JSON.stringify(w.user)),localStorage.setItem("token",_.access_token)}catch(v){throw console.error("Registration failed:",v),v}},h=async()=>{try{n&&await fetch(`${hd}/auth/logout`,{method:"POST",headers:{Authorization:`Bearer ${n.access_token}`}})}catch(g){console.error("Logout API call failed:",g)}finally{p()}},m=async()=>n!=null&&n.refresh_token?await u(n):!1,y=g=>{if(t){const v={...t,...g};r(v),localStorage.setItem("whoosh_user",JSON.stringify(v))}},p=()=>{r(null),i(null),localStorage.removeItem("whoosh_tokens"),localStorage.removeItem("whoosh_user"),localStorage.removeItem("token")},x={user:t,tokens:n,isAuthenticated:l,isLoading:a,login:d,register:f,logout:h,refreshToken:m,updateUser:y};return o.jsx(D3.Provider,{value:x,children:e})},Wh=()=>{const e=b.useContext(D3);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e},CG=()=>{const{tokens:e,refreshToken:t,logout:r}=Wh();return async(i,a={})=>{if(!e)throw new Error("No authentication tokens available");const s={"Content-Type":"application/json",...a.headers,Authorization:`Bearer ${e.access_token}`};let l=await fetch(i,{...a,headers:s});if(l.status===401)if(await t())l=await fetch(i,{...a,headers:{...s,Authorization:`Bearer ${e.access_token}`}});else throw r(),new Error("Authentication expired");return l}};function L3({isDropdown:e=!1,onClose:t}){const{user:r,logout:n}=Wh(),i=to(),[a,s]=b.useState(!1),[l,c]=b.useState((r==null?void 0:r.name)||(r==null?void 0:r.full_name)||""),u=()=>{console.log("Saving user profile:",{name:l}),s(!1)},d=()=>{c((r==null?void 0:r.name)||(r==null?void 0:r.full_name)||""),s(!1)},f=()=>{n(),t==null||t()};return r?e?o.jsxs("div",{className:"w-64 bg-white rounded-lg shadow-lg border p-4",children:[o.jsxs("div",{className:"flex items-center space-x-3 pb-4 border-b",children:[o.jsx(Nw,{className:"h-12 w-12 text-gray-400"}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-gray-900",children:r.name||r.full_name||r.username}),o.jsxs("p",{className:"text-sm text-gray-500",children:["@",r.username]}),o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-blue-100 text-blue-800",children:r.role||(r.is_superuser?"Admin":"User")})]})]}),o.jsxs("div",{className:"pt-4 space-y-2",children:[o.jsxs("button",{onClick:()=>{i("/profile"),t==null||t()},className:"w-full flex items-center px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-md",children:[o.jsx(ml,{className:"h-4 w-4 mr-3"}),"View Profile"]}),o.jsxs("button",{onClick:f,className:"w-full flex items-center px-3 py-2 text-sm text-red-700 hover:bg-red-50 rounded-md",children:[o.jsx(Wq,{className:"h-4 w-4 mr-3"}),"Sign out"]})]})]}):o.jsx("div",{className:"max-w-2xl mx-auto",children:o.jsxs("div",{className:"bg-white shadow rounded-lg",children:[o.jsxs("div",{className:"px-6 py-4 border-b border-gray-200",children:[o.jsx("h2",{className:"text-lg font-medium text-gray-900",children:"User Profile"}),o.jsx("p",{className:"text-sm text-gray-500",children:"Manage your account settings and preferences"})]}),o.jsxs("div",{className:"px-6 py-4",children:[o.jsxs("div",{className:"flex items-center space-x-6 mb-6",children:[o.jsxs("div",{className:"relative",children:[o.jsx(Nw,{className:"h-24 w-24 text-gray-400"}),o.jsx("button",{className:"absolute bottom-0 right-0 bg-blue-600 text-white rounded-full p-2 hover:bg-blue-700",children:o.jsx(Vf,{className:"h-4 w-4"})})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:r.name||r.full_name||r.username}),o.jsxs("p",{className:"text-gray-600",children:["@",r.username]}),o.jsx("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-blue-100 text-blue-800 mt-2",children:r.role||(r.is_superuser?"Admin":"User")})]})]}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Full Name"}),a?o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("input",{type:"text",value:l,onChange:h=>c(h.target.value),className:"flex-1 border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"}),o.jsx("button",{onClick:u,className:"p-2 text-green-600 hover:text-green-800",children:o.jsx(sK,{className:"h-5 w-5"})}),o.jsx("button",{onClick:d,className:"p-2 text-red-600 hover:text-red-800",children:o.jsx(qf,{className:"h-5 w-5"})})]}):o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-gray-900",children:r.name||r.full_name||r.username}),o.jsx("button",{onClick:()=>s(!0),className:"text-blue-600 hover:text-blue-800",children:o.jsx(Vf,{className:"h-4 w-4"})})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Username"}),o.jsx("span",{className:"text-gray-900",children:r.username}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Username cannot be changed"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email"}),o.jsx("span",{className:"text-gray-900",children:r.email||"Not set"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Role"}),o.jsx("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-blue-100 text-blue-800",children:r.role||(r.is_superuser?"Admin":"User")}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Role is managed by system administrators"})]})]}),o.jsx("div",{className:"mt-8 pt-6 border-t border-gray-200",children:o.jsxs("div",{className:"flex space-x-4",children:[o.jsx("button",{className:"bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 text-sm font-medium",children:"Change Password"}),o.jsx("button",{onClick:f,className:"bg-red-600 text-white px-4 py-2 rounded-md hover:bg-red-700 text-sm font-medium",children:"Sign Out"})]})})]})]})}):null}const F3=b.createContext(void 0),Z2=()=>{const e=b.useContext(F3);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},TG=({children:e})=>{const[t,r]=b.useState(()=>{const s=localStorage.getItem("darkMode");return s!==null?JSON.parse(s):!0});b.useEffect(()=>{t?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),localStorage.setItem("darkMode",JSON.stringify(t))},[t]);const a={isDarkMode:t,toggleDarkMode:()=>{r(!t)},setDarkMode:s=>{r(s)}};return o.jsx(F3.Provider,{value:a,children:e})},B3=({className:e=""})=>{const{isDarkMode:t,toggleDarkMode:r}=Z2();return o.jsx("button",{onClick:r,className:` inline-flex items-center justify-center p-2 rounded-md text-gray-600 hover:text-gray-900 hover:bg-gray-100 dark:text-gray-300 dark:hover:text-white dark:hover:bg-gray-700 transition-colors duration-200 ${e} `,"aria-label":t?"Switch to light mode":"Switch to dark mode",title:t?"Switch to light mode":"Switch to dark mode",children:t?o.jsx(JK,{className:"h-5 w-5"}):o.jsx(BK,{className:"h-5 w-5"})})},kw="/assets/WHOOSH_symbol--J4XmCu1.png",$G=[{name:"Dashboard",href:"/",icon:$K},{name:"Projects",href:"/projects",icon:Wf},{name:"Git Repositories",href:"/git-repositories",icon:mg},{name:"Workflows",href:"/workflows",icon:ml},{name:"Cluster",href:"/cluster",icon:Ds},{name:"Executions",href:"/executions",icon:hi},{name:"Agents",href:"/agents",icon:Hf},{name:"AI Models",href:"/ai-models",icon:pl},{name:"Bzzz Chat",href:"/bzzz-chat",icon:C3},{name:"Bzzz Team",href:"/bzzz-team",icon:Hf},{name:"Analytics",href:"/analytics",icon:Qc},{name:"Settings",href:"/settings",icon:Fq}];function Ct({children:e}){const[t,r]=b.useState(!1),[n,i]=b.useState(!1),a=eo(),{user:s}=Wh(),l=b.useRef(null);b.useEffect(()=>{function u(d){l.current&&!l.current.contains(d.target)&&i(!1)}if(n)return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[n]);const c=$G.map(u=>({...u,current:a.pathname===u.href||u.href!=="/"&&a.pathname.startsWith(u.href)}));return o.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 flex",children:[t&&o.jsxs("div",{className:"fixed inset-0 z-40 lg:hidden",children:[o.jsx("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-75",onClick:()=>r(!1)}),o.jsxs("div",{className:"fixed inset-y-0 left-0 flex flex-col w-64 bg-white dark:bg-gray-800 shadow-xl",children:[o.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("img",{src:kw,alt:"WHOOSH",className:"h-8 w-8 object-contain"}),o.jsx("span",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"WHOOSH"})]}),o.jsx("button",{onClick:()=>r(!1),className:"text-gray-400 hover:text-gray-600 dark:text-gray-300 dark:hover:text-white",children:o.jsx(qf,{className:"h-6 w-6"})})]}),o.jsx("nav",{className:"flex-1 px-4 py-4 space-y-1",children:c.map(u=>o.jsxs(Ot,{to:u.href,className:` group flex items-center px-2 py-2 text-sm font-medium rounded-md transition-colors ${u.current?"bg-blue-100 dark:bg-blue-900 text-blue-900 dark:text-blue-100":"text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 hover:text-gray-900 dark:hover:text-white"} `,onClick:()=>r(!1),children:[o.jsx(u.icon,{className:`mr-3 h-5 w-5 ${u.current?"text-blue-500":"text-gray-400 dark:text-gray-500"}`}),u.name]},u.name))})]})]}),o.jsx("div",{className:"hidden lg:flex lg:flex-shrink-0",children:o.jsxs("div",{className:"flex flex-col w-64 bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700",children:[o.jsxs("div",{className:"flex items-center px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:[o.jsx("img",{src:kw,alt:"WHOOSH",className:"h-8 w-8 object-contain mr-2"}),o.jsx("span",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"WHOOSH"})]}),o.jsx("nav",{className:"flex-1 px-4 py-4 space-y-1",children:c.map(u=>o.jsxs(Ot,{to:u.href,className:` group flex items-center px-2 py-2 text-sm font-medium rounded-md transition-colors ${u.current?"bg-blue-100 dark:bg-blue-900 text-blue-900 dark:text-blue-100":"text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 hover:text-gray-900 dark:hover:text-white"} `,children:[o.jsx(u.icon,{className:`mr-3 h-5 w-5 ${u.current?"text-blue-500":"text-gray-400 dark:text-gray-500"}`}),u.name]},u.name))}),o.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 p-4",children:o.jsxs("div",{className:"flex items-center space-x-2 text-sm text-gray-500 dark:text-gray-400",children:[o.jsx("div",{className:"w-2 h-2 bg-green-400 rounded-full"}),o.jsx("span",{children:"All systems operational"})]})})]})}),o.jsxs("div",{className:"flex-1 flex flex-col",children:[o.jsx("div",{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 px-4 py-2",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("button",{onClick:()=>r(!0),className:"lg:hidden text-gray-400 hover:text-gray-600 dark:text-gray-300 dark:hover:text-white",children:o.jsx(Yq,{className:"h-6 w-6"})}),o.jsxs("div",{className:"lg:hidden flex items-center space-x-2",children:[o.jsx("span",{className:"text-2xl",children:"🐝"}),o.jsx("span",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"WHOOSH"})]})]}),o.jsxs("div",{className:"flex items-center space-x-3",children:[o.jsx(B3,{}),o.jsxs("div",{className:"relative",ref:l,children:[o.jsxs("button",{onClick:()=>i(!n),className:"flex items-center space-x-2 text-sm text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white focus:outline-none",children:[o.jsx(Nw,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"}),o.jsx("span",{className:"hidden sm:block",children:(s==null?void 0:s.name)||(s==null?void 0:s.full_name)||(s==null?void 0:s.username)}),o.jsx(q2,{className:"h-4 w-4"})]}),n&&o.jsx("div",{className:"absolute right-0 mt-2 z-50",children:o.jsx(L3,{isDropdown:!0,onClose:()=>i(!1)})})]})]})]})}),o.jsx("main",{className:"flex-1 overflow-auto",children:e})]})]})}const Ui=Object.create(null);Ui.open="0";Ui.close="1";Ui.ping="2";Ui.pong="3";Ui.message="4";Ui.upgrade="5";Ui.noop="6";const pp=Object.create(null);Object.keys(Ui).forEach(e=>{pp[Ui[e]]=e});const Ew={type:"error",data:"parser error"},z3=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",U3=typeof ArrayBuffer=="function",W3=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,X2=({type:e,data:t},r,n)=>z3&&t instanceof Blob?r?n(t):Zk(t,n):U3&&(t instanceof ArrayBuffer||W3(t))?r?n(t):Zk(new Blob([t]),n):n(Ui[e]+(t||"")),Zk=(e,t)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];t("b"+(n||""))},r.readAsDataURL(e)};function Xk(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let ix;function MG(e,t){if(z3&&e.data instanceof Blob)return e.data.arrayBuffer().then(Xk).then(t);if(U3&&(e.data instanceof ArrayBuffer||W3(e.data)))return t(Xk(e.data));X2(e,!1,r=>{ix||(ix=new TextEncoder),t(ix.encode(r))})}const Qk="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ud=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,r=e.length,n,i=0,a,s,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(n=0;n>4,d[i++]=(s&15)<<4|l>>2,d[i++]=(l&3)<<6|c&63;return u},IG=typeof ArrayBuffer=="function",Q2=(e,t)=>{if(typeof e!="string")return{type:"message",data:V3(e,t)};const r=e.charAt(0);return r==="b"?{type:"message",data:DG(e.substring(1),t)}:pp[r]?e.length>1?{type:pp[r],data:e.substring(1)}:{type:pp[r]}:Ew},DG=(e,t)=>{if(IG){const r=RG(e);return V3(r,t)}else return{base64:!0,data:e}},V3=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},H3="",LG=(e,t)=>{const r=e.length,n=new Array(r);let i=0;e.forEach((a,s)=>{X2(a,!1,l=>{n[s]=l,++i===r&&t(n.join(H3))})})},FG=(e,t)=>{const r=e.split(H3),n=[];for(let i=0;i{const n=r.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const a=new DataView(i.buffer);a.setUint8(0,126),a.setUint16(1,n)}else{i=new Uint8Array(9);const a=new DataView(i.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(n))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(r)})}})}let ax;function $m(e){return e.reduce((t,r)=>t+r.length,0)}function Mm(e,t){if(e[0].length===t)return e.shift();const r=new Uint8Array(t);let n=0;for(let i=0;iMath.pow(2,21)-1){l.enqueue(Ew);break}i=d*Math.pow(2,32)+u.getUint32(4),n=3}else{if($m(r)e){l.enqueue(Ew);break}}}})}const q3=4;function Vt(e){if(e)return UG(e)}function UG(e){for(var t in Vt.prototype)e[t]=Vt.prototype[t];return e}Vt.prototype.on=Vt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Vt.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this};Vt.prototype.off=Vt.prototype.removeListener=Vt.prototype.removeAllListeners=Vt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+e];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var n,i=0;iPromise.resolve().then(t):(t,r)=>r(t,0),An=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),WG="arraybuffer";function K3(e,...t){return t.reduce((r,n)=>(e.hasOwnProperty(n)&&(r[n]=e[n]),r),{})}const VG=An.setTimeout,HG=An.clearTimeout;function i0(e,t){t.useNativeTimers?(e.setTimeoutFn=VG.bind(An),e.clearTimeoutFn=HG.bind(An)):(e.setTimeoutFn=An.setTimeout.bind(An),e.clearTimeoutFn=An.clearTimeout.bind(An))}const qG=1.33;function KG(e){return typeof e=="string"?GG(e):Math.ceil((e.byteLength||e.size)*qG)}function GG(e){let t=0,r=0;for(let n=0,i=e.length;n=57344?r+=3:(n++,r+=4);return r}function G3(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function YG(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t}function ZG(e){let t={},r=e.split("&");for(let n=0,i=r.length;n{this.readyState="paused",t()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||r()})),this.writable||(n++,this.once("drain",function(){--n||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const r=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};FG(t,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,LG(t,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=G3()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(t,r)}}let Y3=!1;try{Y3=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const JG=Y3;function eY(){}class tY extends QG{constructor(t){if(super(t),typeof location<"u"){const r=location.protocol==="https:";let n=location.port;n||(n=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||n!==t.port}}doWrite(t,r){const n=this.request({method:"POST",data:t});n.on("success",r),n.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(r,n)=>{this.onError("xhr poll error",r,n)}),this.pollXhr=t}}let Sc=class gp extends Vt{constructor(t,r,n){super(),this.createRequest=t,i0(this,n),this._opts=n,this._method=n.method||"GET",this._uri=r,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var t;const r=K3(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(r);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var i;n.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=gp.requestsCount++,gp.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=eY,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete gp.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};Sc.requestsCount=0;Sc.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Jk);else if(typeof addEventListener=="function"){const e="onpagehide"in An?"pagehide":"unload";addEventListener(e,Jk,!1)}}function Jk(){for(let e in Sc.requests)Sc.requests.hasOwnProperty(e)&&Sc.requests[e].abort()}const rY=function(){const e=Z3({xdomain:!1});return e&&e.responseType!==null}();class nY extends tY{constructor(t){super(t);const r=t&&t.forceBase64;this.supportsBinary=rY&&!r}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Sc(Z3,this.uri(),t)}}function Z3(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||JG))return new XMLHttpRequest}catch{}if(!t)try{return new An[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const X3=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class iY extends J2{get name(){return"websocket"}doOpen(){const t=this.uri(),r=this.opts.protocols,n=X3?{}:K3(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,r,n)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let r=0;r{try{this.doWrite(n,a)}catch{}i&&n0(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=G3()),this.supportsBinary||(r.b64=1),this.createUri(t,r)}}const sx=An.WebSocket||An.MozWebSocket;class aY extends iY{createSocket(t,r,n){return X3?new sx(t,r,n):r?new sx(t,r):new sx(t)}doWrite(t,r){this.ws.send(r)}}class sY extends J2{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const r=zG(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=t.readable.pipeThrough(r).getReader(),i=BG();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const a=()=>{n.read().then(({done:l,value:c})=>{l||(this.onPacket(c),a())}).catch(l=>{})};a();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let r=0;r{i&&n0(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const oY={websocket:aY,webtransport:sY,polling:nY},lY=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,cY=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ow(e){if(e.length>8e3)throw"URI too long";const t=e,r=e.indexOf("["),n=e.indexOf("]");r!=-1&&n!=-1&&(e=e.substring(0,r)+e.substring(r,n).replace(/:/g,";")+e.substring(n,e.length));let i=lY.exec(e||""),a={},s=14;for(;s--;)a[cY[s]]=i[s]||"";return r!=-1&&n!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=uY(a,a.path),a.queryKey=dY(a,a.query),a}function uY(e,t){const r=/\/{2,9}/g,n=t.replace(r,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&n.splice(0,1),t.slice(-1)=="/"&&n.splice(n.length-1,1),n}function dY(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,a){i&&(r[i]=a)}),r}const Aw=typeof addEventListener=="function"&&typeof removeEventListener=="function",yp=[];Aw&&addEventListener("offline",()=>{yp.forEach(e=>e())},!1);class Fs extends Vt{constructor(t,r){if(super(),this.binaryType=WG,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(r=t,t=null),t){const n=Ow(t);r.hostname=n.host,r.secure=n.protocol==="https"||n.protocol==="wss",r.port=n.port,n.query&&(r.query=n.query)}else r.host&&(r.hostname=Ow(r.host).host);i0(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(n=>{const i=n.prototype.name;this.transports.push(i),this._transportsByName[i]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=ZG(this.opts.query)),Aw&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},yp.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const r=Object.assign({},this.opts.query);r.EIO=q3,r.transport=t,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Fs.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(t);r.open(),this.setTransport(r)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",Fs.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=t.data,this._onError(r);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let n=0;n0&&r>this._maxPayload)return this.writeBuffer.slice(0,n);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,n0(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,r,n){return this._sendPacket("message",t,r,n),this}send(t,r,n){return this._sendPacket("message",t,r,n),this}_sendPacket(t,r,n,i){if(typeof r=="function"&&(i=r,r=void 0),typeof n=="function"&&(i=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const a={type:t,data:r,options:n};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),t()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():t()}):this.upgrading?n():t()),this}_onError(t){if(Fs.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Aw&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=yp.indexOf(this._offlineEventListener);n!==-1&&yp.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,r),this.writeBuffer=[],this._prevBufferLen=0}}}Fs.protocol=q3;class fY extends Fs{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t{n||(r.send([{type:"ping",data:"probe"}]),r.once("packet",f=>{if(!n)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Fs.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(d(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=r.name,this.emitReserved("upgradeError",h)}}))};function a(){n||(n=!0,d(),r.close(),r=null)}const s=f=>{const h=new Error("probe error: "+f);h.transport=r.name,a(),this.emitReserved("upgradeError",h)};function l(){s("transport closed")}function c(){s("socket closed")}function u(f){r&&f.name!==r.name&&a()}const d=()=>{r.removeListener("open",i),r.removeListener("error",s),r.removeListener("close",l),this.off("close",c),this.off("upgrading",u)};r.once("open",i),r.once("error",s),r.once("close",l),this.once("close",c),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{n||r.open()},200):r.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const r=[];for(let n=0;noY[i]).filter(i=>!!i)),super(t,n)}};function mY(e,t="",r){let n=e;r=r||typeof location<"u"&&location,e==null&&(e=r.protocol+"//"+r.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=r.protocol+e:e=r.host+e),/^(https?|wss?):\/\//.test(e)||(typeof r<"u"?e=r.protocol+"//"+e:e="https://"+e),n=Ow(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const a=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+a+":"+n.port+t,n.href=n.protocol+"://"+a+(r&&r.port===n.port?"":":"+n.port),n}const pY=typeof ArrayBuffer=="function",gY=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Q3=Object.prototype.toString,yY=typeof Blob=="function"||typeof Blob<"u"&&Q3.call(Blob)==="[object BlobConstructor]",vY=typeof File=="function"||typeof File<"u"&&Q3.call(File)==="[object FileConstructor]";function e_(e){return pY&&(e instanceof ArrayBuffer||gY(e))||yY&&e instanceof Blob||vY&&e instanceof File}function vp(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let r=0,n=e.length;r=0&&e.num{delete this.acks[t];for(let l=0;l{this.io.clearTimeoutFn(a),r.apply(this,l)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...r){return new Promise((n,i)=>{const a=(s,l)=>s?i(s):n(l);a.withError=!0,r.push(a),this.emit(t,...r)})}_addToQueue(t){let r;typeof t[t.length-1]=="function"&&(r=t.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>n!==this._queue[0]?void 0:(i!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(i)):(this._queue.shift(),r&&r(null,...a)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!t||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:We.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(n=>String(n.id)===t)){const n=this.acks[t];delete this.acks[t],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case We.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case We.EVENT:case We.BINARY_EVENT:this.onevent(t);break;case We.ACK:case We.BINARY_ACK:this.onack(t);break;case We.DISCONNECT:this.ondisconnect();break;case We.CONNECT_ERROR:this.destroy();const n=new Error(t.data.message);n.data=t.data.data,this.emitReserved("connect_error",n);break}}onevent(t){const r=t.data||[];t.id!=null&&r.push(this.ack(t.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const n of r)n.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const r=this;let n=!1;return function(...i){n||(n=!0,r.packet({type:We.ACK,id:t,data:i}))}}onack(t){const r=this.acks[t.id];typeof r=="function"&&(delete this.acks[t.id],r.withError&&t.data.unshift(null),r.apply(this,t.data))}onconnect(t,r){this.id=t,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:We.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const r=this._anyListeners;for(let n=0;n0&&e.jitter<=1?e.jitter:0,this.attempts=0}Lu.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+r:e-r}return Math.min(e,this.max)|0};Lu.prototype.reset=function(){this.attempts=0};Lu.prototype.setMin=function(e){this.ms=e};Lu.prototype.setMax=function(e){this.max=e};Lu.prototype.setJitter=function(e){this.jitter=e};class Tw extends Vt{constructor(t,r){var n;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(r=t,t=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,i0(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((n=r.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new Lu({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=t;const i=r.parser||SY;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var r;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(r=this.backoff)===null||r===void 0||r.setMin(t),this)}randomizationFactor(t){var r;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(r=this.backoff)===null||r===void 0||r.setJitter(t),this)}reconnectionDelayMax(t){var r;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(r=this.backoff)===null||r===void 0||r.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new hY(this.uri,this.opts);const r=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const i=ei(r,"open",function(){n.onopen(),t&&t()}),a=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},s=ei(r,"error",a);if(this._timeout!==!1){const l=this._timeout,c=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),r.close()},l);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ei(t,"ping",this.onping.bind(this)),ei(t,"data",this.ondata.bind(this)),ei(t,"error",this.onerror.bind(this)),ei(t,"close",this.onclose.bind(this)),ei(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(r){this.onclose("parse error",r)}}ondecoded(t){n0(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,r){let n=this.nsps[t];return n?this._autoConnect&&!n.active&&n.connect():(n=new J3(this,t,r),this.nsps[t]=n),n}_destroy(t){const r=Object.keys(this.nsps);for(const n of r)if(this.nsps[n].active)return;this._close()}_packet(t){const r=this.encoder.encode(t);for(let n=0;nt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,r){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},r);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const md={};function ox(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const r=mY(e,t.path||"/socket.io"),n=r.source,i=r.id,a=r.path,s=md[i]&&a in md[i].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let c;return l?c=new Tw(n,t):(md[i]||(md[i]=new Tw(n,t)),c=md[i]),r.query&&!t.query&&(t.query=r.queryKey),c.socket(r.path,t)}Object.assign(ox,{Manager:Tw,Socket:J3,io:ox,connect:ox});b.createContext(null);function Tt({children:e,requiredRole:t}){const{isAuthenticated:r,isLoading:n,user:i}=Wh(),a=to(),s=eo();return b.useEffect(()=>{if(!n){if(!r){a("/login",{state:{from:s.pathname},replace:!0});return}if(t&&((i==null?void 0:i.role)||(i!=null&&i.is_superuser?"Admin":"User"))!==t){a("/",{replace:!0});return}}},[r,n,i,a,s.pathname,t]),n?o.jsx("div",{className:"min-h-screen flex items-center justify-center",children:o.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"})}):r?t&&((i==null?void 0:i.role)||(i!=null&&i.is_superuser?"Admin":"User"))!==t?o.jsx("div",{className:"min-h-screen flex items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Access Denied"}),o.jsx("p",{className:"text-gray-600 mt-2",children:"You don't have permission to access this page."})]})}):o.jsx(o.Fragment,{children:e}):null}const ti=({className:e="",children:t,onClick:r})=>o.jsx("div",{className:`bg-white rounded-lg shadow-md border ${e}`,onClick:r,children:t}),nf=({className:e="",children:t})=>o.jsx("div",{className:`px-6 py-4 ${e}`,children:t}),af=({className:e="",children:t})=>o.jsx("h3",{className:`text-lg font-semibold ${e}`,children:t}),lx=({className:e="",children:t})=>o.jsx("p",{className:`text-sm text-gray-600 ${e}`,children:t}),ki=({className:e="",children:t})=>o.jsx("div",{className:`px-6 pb-4 ${e}`,children:t}),zt=({className:e="",variant:t="default",size:r="default",onClick:n,disabled:i=!1,type:a="button",children:s})=>{const l="inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none",c={default:"bg-blue-600 text-white hover:bg-blue-700",destructive:"bg-red-600 text-white hover:bg-red-700",outline:"border border-gray-300 bg-white hover:bg-gray-50",secondary:"bg-gray-100 text-gray-900 hover:bg-gray-200",ghost:"hover:bg-gray-100"},u={default:"h-10 py-2 px-4",sm:"h-9 px-3 text-sm",lg:"h-11 px-8"};return o.jsx("button",{className:`${l} ${c[t]} ${u[r]} ${e}`,onClick:n,disabled:i,type:a,children:s})},wr=({className:e="",type:t="text",placeholder:r,value:n,onChange:i,disabled:a=!1,required:s=!1,id:l,name:c})=>o.jsx("input",{className:`flex h-10 w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm ring-offset-white file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-gray-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${e}`,type:t,placeholder:r,value:n,onChange:i,disabled:a,required:s,id:l,name:c}),nr=({className:e="",htmlFor:t,children:r})=>o.jsx("label",{className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 ${e}`,htmlFor:t,children:r}),rs=({children:e,onValueChange:t,value:r})=>{const[n,i]=b.useState(!1);return o.jsx("div",{className:"relative",children:T.Children.map(e,a=>T.isValidElement(a)?T.cloneElement(a,{isOpen:n,setIsOpen:i,onValueChange:t,value:r}):a)})},ns=({className:e="",children:t,isOpen:r,setIsOpen:n})=>o.jsx("button",{type:"button",className:`flex h-10 w-full items-center justify-between rounded-md border border-gray-300 bg-white px-3 py-2 text-sm ring-offset-white placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${e}`,onClick:()=>n(!r),children:t}),is=({children:e,isOpen:t,setIsOpen:r,onValueChange:n})=>t?o.jsx("div",{className:"absolute top-full z-50 w-full rounded-md border border-gray-300 bg-white shadow-lg",children:T.Children.map(e,i=>T.isValidElement(i)?T.cloneElement(i,{setIsOpen:r,onValueChange:n}):i)}):null,jt=({value:e,children:t,setIsOpen:r,onValueChange:n})=>o.jsx("div",{className:"cursor-pointer px-3 py-2 text-sm hover:bg-gray-100",onClick:()=>{n==null||n(e),r(!1)},children:t}),as=({placeholder:e,value:t})=>o.jsx("span",{className:"block truncate",children:t||e}),EY=({id:e,checked:t=!1,onCheckedChange:r,className:n="",disabled:i=!1})=>{const a=s=>{r&&r(s.target.checked)};return o.jsxs("div",{className:`relative ${n}`,children:[o.jsx("input",{id:e,type:"checkbox",checked:t,onChange:a,disabled:i,className:"sr-only"}),o.jsx("div",{className:` w-4 h-4 rounded-sm border-2 border-gray-300 bg-white flex items-center justify-center cursor-pointer ${t?"bg-blue-600 border-blue-600":""} ${i?"opacity-50 cursor-not-allowed":"hover:border-blue-500"} transition-colors duration-200 `,onClick:()=>!i&&(r==null?void 0:r(!t)),children:t&&o.jsx(pG,{className:"w-3 h-3 text-white"})})]})},Bs=({children:e,variant:t="default",className:r=""})=>{const n="relative w-full rounded-lg border p-4",i={default:"bg-blue-50 border-blue-200 text-blue-800",destructive:"bg-red-50 border-red-200 text-red-800"};return o.jsx("div",{className:`${n} ${i[t]} ${r}`,role:"alert",children:e})},zs=({children:e,className:t=""})=>o.jsx("div",{className:`text-sm ${t}`,children:e}),OY=()=>{var Re;const{isDarkMode:e}=Z2(),[t,r]=b.useState(null),[n,i]=b.useState(!0),[a,s]=b.useState(0),[l,c]=b.useState([]),[u,d]=b.useState([]),[f,h]=b.useState([]),[m,y]=b.useState(""),[p,x]=b.useState(null),[g,v]=b.useState(""),[w,_]=b.useState(!1),[j,N]=b.useState({}),[S,E]=b.useState({}),[k,A]=b.useState(!1),[C,P]=b.useState(""),[$,O]=b.useState(""),[I,D]=b.useState(""),[L,R]=b.useState({}),M=gl.baseURL+"/api",B=[{title:"Infrastructure Setup",icon:kG,description:"Configure cluster nodes and SSH connectivity"},{title:"Security Keys",icon:mp,description:"Generate Age encryption keys for P2P communication"},{title:"Model Selection",icon:Yk,description:"Choose AI models from ollama.com registry"},{title:"Cloud API Keys",icon:mp,description:"Optional external AI provider credentials"},{title:"Deploy First Agent",icon:NG,description:"Deploy coordinator BZZZ agent and pull models"},{title:"Initialize Cluster",icon:Gk,description:"Deploy remaining agents and enable P2P distribution"}];b.useEffect(()=>{U()},[]);const U=async()=>{try{i(!0);const V=await(await fetch(`${M}/cluster-setup/status`)).json();V.success?(r(V.data),V.data.infrastructure_configured?V.data.age_keys_generated?V.data.models_selected?V.data.first_agent_deployed?V.data.cluster_initialized?window.location.href="/dashboard":s(5):s(4):(s(2),W()):s(1):s(0)):v("Failed to check setup status")}catch(Y){v(`Error checking setup status: ${Y.message}`)}finally{i(!1)}},W=async()=>{try{const V=await(await fetch(`${M}/cluster-setup/models/available`)).json();V.success&&d(V.data.models)}catch(Y){console.error("Error fetching models:",Y)}},Z=()=>{k||(c([{hostname:"",ip_address:"",ssh_user:"ubuntu",ssh_port:22,role:"coordinator",is_primary:!0}]),A(!0))},q=()=>{c([...l,{hostname:"",ip_address:"",ssh_user:"ubuntu",ssh_port:22,role:"worker",is_primary:!1}])},ee=Y=>{l[Y].is_primary&&A(!1),c(l.filter((ce,F)=>F!==Y))},le=(Y,V,ce)=>{const F=[...l];F[Y]={...F[Y],[V]:ce},c(F)},ve=Y=>{N(V=>({...V,[Y]:!V[Y]}))},Ne=Y=>{E(V=>({...V,[Y]:!V[Y]}))},J=Y=>{R(V=>({...V,[Y]:!V[Y]}))},oe=async()=>{var Y;try{if(_(!0),v(""),l.length===0){v("Please add at least one node");return}const ce=await(await fetch(`${M}/cluster-setup/infrastructure/configure`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nodes:l})})).json();ce.success?(await U(),s(1)):v(((Y=ce.data)==null?void 0:Y.error)||"Infrastructure configuration failed")}catch(V){v(`Error configuring infrastructure: ${V.message}`)}finally{_(!1)}},me=async()=>{var Y;try{_(!0),v("");const ce=await(await fetch(`${M}/cluster-setup/keys/generate`,{method:"POST"})).json();ce.success?(x(ce.data),await U(),s(2),W()):v(((Y=ce.data)==null?void 0:Y.error)||"Age key generation failed")}catch(V){v(`Error generating age keys: ${V.message}`)}finally{_(!1)}},Q=async()=>{var Y;try{if(_(!0),v(""),f.length===0){v("Please select at least one model");return}const ce=await(await fetch(`${M}/cluster-setup/models/select`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_names:f})})).json();ce.success?(await U(),s(3)):v(((Y=ce.data)==null?void 0:Y.error)||"Model selection failed")}catch(V){v(`Error selecting models: ${V.message}`)}finally{_(!1)}},Pe=async()=>{var Y;try{if(_(!0),v(""),!m){v("Please select a coordinator node");return}const ce=await(await fetch(`${M}/cluster-setup/agent/deploy-first`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({coordinator_hostname:m})})).json();ce.success?(await U(),s(5)):v(((Y=ce.data)==null?void 0:Y.error)||"First agent deployment failed")}catch(V){v(`Error deploying first agent: ${V.message}`)}finally{_(!1)}},be=async()=>{var Y;try{_(!0),v("");const ce=await(await fetch(`${M}/cluster-setup/cluster/initialize`,{method:"POST"})).json();ce.success?window.location.href="/dashboard":v(((Y=ce.data)==null?void 0:Y.error)||"Cluster initialization failed")}catch(V){v(`Error initializing cluster: ${V.message}`)}finally{_(!1)}},Ee=Y=>{h(V=>V.includes(Y)?V.filter(ce=>ce!==Y):[...V,Y])};return n?o.jsx("div",{className:`min-h-screen flex items-center justify-center ${e?"bg-gradient-to-br from-gray-900 to-gray-800":"bg-gradient-to-br from-blue-50 to-indigo-100"}`,children:o.jsxs("div",{className:"text-center",children:[o.jsx(Ci,{className:`h-8 w-8 animate-spin mx-auto ${e?"text-blue-400":"text-blue-600"}`}),o.jsx("p",{className:`mt-2 ${e?"text-gray-300":"text-gray-600"}`,children:"Checking cluster status..."})]})}):o.jsx("div",{className:`min-h-screen py-8 px-4 ${e?"bg-gradient-to-br from-gray-900 to-gray-800":"bg-gradient-to-br from-blue-50 to-indigo-100"}`,children:o.jsxs("div",{className:"max-w-4xl mx-auto",children:[o.jsxs("div",{className:"text-center mb-8",children:[o.jsx("h1",{className:`text-3xl font-bold mb-2 ${e?"text-white":"text-gray-900"}`,children:"🚀 WHOOSH Cluster Setup Wizard"}),o.jsx("p",{className:`${e?"text-gray-300":"text-gray-600"}`,children:"Set up your distributed AI cluster infrastructure step by step"})]}),o.jsx("div",{className:"mb-8",children:o.jsx("div",{className:"flex items-center justify-between",children:B.map((Y,V)=>{const ce=Y.icon,F=V===a,H=Vo.jsxs(ti,{className:`p-4 ${Y.is_primary?e?"border-green-700/30 bg-green-900/10":"border-green-200 bg-green-50":e?"border-gray-700":"border-gray-200"}`,children:[o.jsxs("div",{className:"flex justify-between items-start mb-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium flex items-center gap-2",children:Y.is_primary?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:`${e?"text-green-300":"text-green-700"}`,children:"🏁 Primary Machine"}),o.jsx("span",{className:`text-xs px-2 py-1 rounded ${e?"bg-green-800/30 text-green-300":"bg-green-100 text-green-700"}`,children:"COORDINATOR"})]}):o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:`${e?"text-gray-300":"text-gray-700"}`,children:["🔧 Secondary Node ",V]}),o.jsx("span",{className:`text-xs px-2 py-1 rounded ${e?"bg-blue-800/30 text-blue-300":"bg-blue-100 text-blue-700"}`,children:"WORKER"})]})}),Y.is_primary&&o.jsx("p",{className:`text-xs mt-1 ${e?"text-green-300":"text-green-600"}`,children:"This machine will coordinate the cluster and manage deployments"})]}),o.jsx(zt,{onClick:()=>ee(V),variant:"outline",size:"sm",className:`${e?"text-red-400 hover:text-red-300 border-red-700 hover:bg-red-900/20":"text-red-600 hover:text-red-700 border-red-300 hover:bg-red-50"}`,children:o.jsx(I3,{className:"w-4 h-4"})})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx(nr,{htmlFor:`hostname-${V}`,className:`text-sm font-medium ${e?"text-gray-300":"text-gray-700"}`,children:"Machine Hostname"}),o.jsx(wr,{id:`hostname-${V}`,value:Y.hostname,onChange:ce=>le(V,"hostname",ce.target.value),placeholder:Y.is_primary?"e.g., walnut (your main machine)":"e.g., acacia, ironwood",className:"mt-1"}),o.jsx("p",{className:`text-xs mt-1 ${e?"text-gray-400":"text-gray-500"}`,children:Y.is_primary?"Friendly name for your primary machine":"Friendly name for this worker node"})]}),o.jsxs("div",{children:[o.jsx(nr,{htmlFor:`ip-${V}`,className:"text-sm font-medium text-gray-700",children:"IP Address"}),o.jsx(wr,{id:`ip-${V}`,value:Y.ip_address,onChange:ce=>le(V,"ip_address",ce.target.value),placeholder:Y.is_primary?"192.168.1.27 (primary machine IP)":"192.168.1.72 (worker IP)",className:"mt-1"}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Local network IP address for SSH connection"})]}),o.jsxs("div",{children:[o.jsx(nr,{htmlFor:`user-${V}`,className:"text-sm font-medium text-gray-700",children:"SSH Username"}),o.jsx(wr,{id:`user-${V}`,value:Y.ssh_user,onChange:ce=>le(V,"ssh_user",ce.target.value),placeholder:"ubuntu",className:"mt-1"}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Username for SSH login (must have sudo access)"})]}),o.jsxs("div",{children:[o.jsx(nr,{htmlFor:`port-${V}`,className:"text-sm font-medium text-gray-700",children:"SSH Port"}),o.jsx(wr,{id:`port-${V}`,type:"number",value:Y.ssh_port.toString(),onChange:ce=>le(V,"ssh_port",parseInt(ce.target.value)||22),placeholder:"22",className:"mt-1"}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"SSH port (usually 22)"})]}),o.jsxs("div",{children:[o.jsx(nr,{htmlFor:`password-${V}`,className:"text-sm font-medium text-gray-700",children:"SSH Password (optional)"}),o.jsxs("div",{className:"relative mt-1",children:[o.jsx(wr,{id:`password-${V}`,type:j[V]?"text":"password",value:Y.ssh_password||"",onChange:ce=>le(V,"ssh_password",ce.target.value),placeholder:"SSH password or leave empty for key auth",className:"pr-10"}),o.jsx("button",{type:"button",onClick:()=>ve(V),className:"absolute right-3 top-3 text-gray-400 hover:text-gray-600",children:j[V]?o.jsx(No,{className:"h-4 w-4"}):o.jsx(So,{className:"h-4 w-4"})})]}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Leave empty if using SSH key authentication"})]}),o.jsxs("div",{children:[o.jsxs(nr,{htmlFor:`sudo-password-${V}`,className:"text-sm font-medium text-gray-700",children:["Sudo Password ",Y.is_primary?"(required)":"(optional)"]}),o.jsxs("div",{className:"relative mt-1",children:[o.jsx(wr,{id:`sudo-password-${V}`,type:S[V]?"text":"password",value:Y.sudo_password||"",onChange:ce=>le(V,"sudo_password",ce.target.value),placeholder:Y.is_primary?"Required for Docker/system setup":"For administrative tasks",className:"pr-10"}),o.jsx("button",{type:"button",onClick:()=>Ne(V),className:"absolute right-3 top-3 text-gray-400 hover:text-gray-600",children:S[V]?o.jsx(No,{className:"h-4 w-4"}):o.jsx(So,{className:"h-4 w-4"})})]}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:Y.is_primary?"Required for installing Docker and system dependencies":"Used for installing packages and system configuration"})]})]})]},V)),l.length>0&&o.jsxs("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4 mt-6",children:[o.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"📋 Configuration Summary"}),o.jsx("div",{className:"space-y-2",children:l.map((Y,V)=>o.jsxs("div",{className:"flex justify-between items-center text-sm",children:[o.jsxs("span",{className:"text-gray-700",children:[Y.is_primary?"🏁":"🔧"," ",Y.hostname||`Node ${V+1}`]}),o.jsxs("span",{className:"text-gray-600",children:[Y.ssh_user,"@",Y.ip_address||"IP not set",":",Y.ssh_port]})]},V))}),o.jsx("p",{className:"text-xs text-gray-500 mt-3",children:"WHOOSH will test SSH connectivity and install dependencies on all machines"})]}),o.jsx(zt,{onClick:oe,disabled:w||l.length===0||!k,className:"w-full bg-blue-600 text-white hover:bg-blue-700 disabled:bg-gray-300 disabled:text-gray-500",children:w?o.jsxs(o.Fragment,{children:[o.jsx(Ci,{className:"w-4 h-4 mr-2 animate-spin"}),"Testing SSH Connectivity..."]}):`Configure ${l.length} Machine${l.length!==1?"s":""}`})]}),a===1&&o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx(mp,{className:"w-16 h-16 mx-auto text-blue-600 mb-4"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Generate Age Encryption Keys"}),o.jsx("p",{className:"text-gray-600 mb-6",children:"Age keys are used for secure P2P communication between BZZZ agents"})]}),p&&o.jsxs(Bs,{children:[o.jsx(Sw,{className:"h-4 w-4"}),o.jsxs(zs,{children:[o.jsx("strong",{children:"Keys Generated Successfully!"}),o.jsx("br",{}),"Public Key: ",p.public_key]})]}),o.jsx(zt,{onClick:me,disabled:w,className:"w-full",children:w?o.jsxs(o.Fragment,{children:[o.jsx(Ci,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating Keys..."]}):"Generate Age Keys"})]}),a===2&&o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Select AI Models"}),o.jsx("p",{className:"text-gray-600 mb-4",children:"Choose which models to deploy on your cluster. The first BZZZ agent will pull these models, then distribute them via P2P to other agents."})]}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 max-h-96 overflow-y-auto",children:u.map(Y=>o.jsx("div",{onClick:()=>Ee(Y.name),className:`bg-white rounded-lg shadow-md border p-4 cursor-pointer transition-colors ${f.includes(Y.name)?"border-blue-500 bg-blue-50":"hover:bg-gray-50"}`,children:o.jsx("div",{className:"flex items-start justify-between",children:o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[o.jsx(EY,{checked:f.includes(Y.name),onChange:()=>{}}),o.jsx("h4",{className:"font-medium",children:Y.name}),o.jsx("span",{className:"text-xs bg-gray-200 px-2 py-1 rounded",children:Y.size})]}),o.jsx("p",{className:"text-sm text-gray-600 mb-2",children:Y.description}),o.jsx("div",{className:"flex flex-wrap gap-1",children:Y.capabilities.map(V=>o.jsx("span",{className:"text-xs bg-blue-100 text-blue-700 px-2 py-1 rounded",children:V},V))})]})})},Y.name))}),f.length>0&&o.jsxs(Bs,{children:[o.jsx(Yk,{className:"h-4 w-4"}),o.jsxs(zs,{children:["Selected ",f.length," models: ",f.join(", ")]})]}),o.jsx(zt,{onClick:Q,disabled:w||f.length===0,className:"w-full",children:w?o.jsxs(o.Fragment,{children:[o.jsx(Ci,{className:"w-4 h-4 mr-2 animate-spin"}),"Confirming Selection..."]}):`Select ${f.length} Models`})]}),a===3&&o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Cloud AI Provider Keys (Optional)"}),o.jsx("p",{className:"text-gray-600 mb-4",children:"Optionally configure API keys for external cloud AI providers. These will be used by BZZZ agents when you want to leverage cloud models alongside your local Ollama models. Leave empty to use only local models."})]}),o.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6",children:[o.jsx("h4",{className:"font-medium text-blue-900 mb-2",children:"🌐 External Provider Integration"}),o.jsx("p",{className:"text-blue-800 text-sm mb-3",children:"BZZZ agents can seamlessly switch between local Ollama models and cloud providers based on task requirements."}),o.jsxs("ul",{className:"text-blue-700 text-sm space-y-1",children:[o.jsxs("li",{children:["• ",o.jsx("strong",{children:"OpenAI:"})," Access to GPT-4, GPT-3.5, and other OpenAI models"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"Anthropic:"})," Access to Claude models for advanced reasoning"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"Google Gemini:"})," Access to Gemini models for multimodal tasks"]})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx(nr,{htmlFor:"openai-key",className:"text-sm font-medium text-gray-700",children:"OpenAI API Key"}),o.jsxs("div",{className:"relative mt-1",children:[o.jsx(wr,{id:"openai-key",type:L.openai?"text":"password",value:C,onChange:Y=>P(Y.target.value),placeholder:"sk-proj-... (optional)",className:"pr-10"}),o.jsx("button",{type:"button",onClick:()=>J("openai"),className:"absolute right-3 top-3 text-gray-400 hover:text-gray-600",children:L.openai?o.jsx(No,{className:"h-4 w-4"}):o.jsx(So,{className:"h-4 w-4"})})]}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"For access to GPT-4, GPT-3.5-turbo, and other OpenAI models"})]}),o.jsxs("div",{children:[o.jsx(nr,{htmlFor:"anthropic-key",className:"text-sm font-medium text-gray-700",children:"Anthropic API Key"}),o.jsxs("div",{className:"relative mt-1",children:[o.jsx(wr,{id:"anthropic-key",type:L.anthropic?"text":"password",value:$,onChange:Y=>O(Y.target.value),placeholder:"sk-ant-api03-... (optional)",className:"pr-10"}),o.jsx("button",{type:"button",onClick:()=>J("anthropic"),className:"absolute right-3 top-3 text-gray-400 hover:text-gray-600",children:L.anthropic?o.jsx(No,{className:"h-4 w-4"}):o.jsx(So,{className:"h-4 w-4"})})]}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"For access to Claude models with advanced reasoning capabilities"})]}),o.jsxs("div",{children:[o.jsx(nr,{htmlFor:"gemini-key",className:"text-sm font-medium text-gray-700",children:"Google Gemini API Key"}),o.jsxs("div",{className:"relative mt-1",children:[o.jsx(wr,{id:"gemini-key",type:L.gemini?"text":"password",value:I,onChange:Y=>D(Y.target.value),placeholder:"AIzaSyD... (optional)",className:"pr-10"}),o.jsx("button",{type:"button",onClick:()=>J("gemini"),className:"absolute right-3 top-3 text-gray-400 hover:text-gray-600",children:L.gemini?o.jsx(No,{className:"h-4 w-4"}):o.jsx(So,{className:"h-4 w-4"})})]}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"For access to Gemini models with vision and multimodal capabilities"})]})]}),o.jsxs("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:[o.jsx("h4",{className:"font-medium text-yellow-900 mb-2",children:"🔒 Security Notice"}),o.jsx("p",{className:"text-yellow-800 text-sm",children:"API keys are encrypted and stored securely within your cluster. They are never transmitted outside your infrastructure and are only used by BZZZ agents when you explicitly request cloud model usage."})]}),o.jsx(zt,{onClick:()=>s(4),disabled:w,className:"w-full",children:"Continue to Agent Deployment"})]}),a===4&&o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Deploy Coordinator Agent"}),o.jsx("p",{className:"text-gray-600 mb-4",children:"Select which node should act as the coordinator and deploy the first BZZZ agent. This agent will pull the selected models from ollama.com."})]}),o.jsxs("div",{children:[o.jsx(nr,{htmlFor:"coordinator",children:"Coordinator Node"}),o.jsxs(rs,{value:m,onValueChange:y,children:[o.jsx(ns,{children:o.jsx(as,{placeholder:"Select coordinator node"})}),o.jsx(is,{children:(Re=t==null?void 0:t.nodes)==null?void 0:Re.map(Y=>o.jsxs(jt,{value:Y.hostname,children:[Y.hostname," (",Y.ip_address,")"]},Y.hostname))})]})]}),o.jsx(zt,{onClick:Pe,disabled:w||!m,className:"w-full",children:w?o.jsxs(o.Fragment,{children:[o.jsx(Ci,{className:"w-4 h-4 mr-2 animate-spin"}),"Deploying Agent & Pulling Models..."]}):"Deploy First Agent"})]}),a===5&&o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx(Gk,{className:"w-16 h-16 mx-auto text-blue-600 mb-4"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Initialize Complete Cluster"}),o.jsx("p",{className:"text-gray-600 mb-6",children:"Deploy BZZZ agents to remaining nodes and enable P2P model distribution"})]}),o.jsx(zt,{onClick:be,disabled:w,className:"w-full",children:w?o.jsxs(o.Fragment,{children:[o.jsx(Ci,{className:"w-4 h-4 mr-2 animate-spin"}),"Initializing Cluster..."]}):"Initialize Cluster"})]})]})]})]})})},AY=({children:e})=>{const{isDarkMode:t}=Z2(),[r,n]=b.useState(!0),[i,a]=b.useState(!1),[s,l]=b.useState(""),c=gl.baseURL+"/api";b.useEffect(()=>{u()},[]);const u=async()=>{try{n(!0),l("");const f=await(await fetch(`${c}/cluster-setup/status`)).json();f.success?a(f.data.cluster_initialized||!1):a(!1)}catch(d){console.error("Error checking cluster status:",d),a(!1)}finally{n(!1)}};return r?o.jsx("div",{className:`min-h-screen flex items-center justify-center ${t?"bg-gradient-to-br from-gray-900 to-gray-800":"bg-gradient-to-br from-blue-50 to-indigo-100"}`,children:o.jsxs("div",{className:"text-center",children:[o.jsx(Ci,{className:`h-8 w-8 animate-spin mx-auto ${t?"text-blue-400":"text-blue-600"}`}),o.jsx("p",{className:`mt-2 ${t?"text-gray-300":"text-gray-600"}`,children:"Detecting cluster status..."})]})}):s?o.jsx("div",{className:`min-h-screen flex items-center justify-center ${t?"bg-gradient-to-br from-red-900/20 to-red-800/20":"bg-gradient-to-br from-red-50 to-red-100"}`,children:o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:`mb-4 ${t?"text-red-400":"text-red-600"}`,children:o.jsx("svg",{className:"w-16 h-16 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 19c-.77.833.192 2.5 1.732 2.5z"})})}),o.jsx("h1",{className:`text-2xl font-bold mb-2 ${t?"text-red-300":"text-red-900"}`,children:"Cluster Detection Error"}),o.jsx("p",{className:`mb-4 ${t?"text-red-400":"text-red-700"}`,children:s}),o.jsx("button",{onClick:u,className:"px-4 py-2 rounded bg-red-600 text-white hover:bg-red-700",children:"Retry"})]})}):i?o.jsx(o.Fragment,{children:e}):o.jsx(OY,{})};function PY(){var y;const e=to(),t=eo(),{login:r}=Wh(),[n,i]=b.useState({username:"",password:""}),[a,s]=b.useState(!1),[l,c]=b.useState(!1),[u,d]=b.useState(null),f=((y=t.state)==null?void 0:y.from)||"/",h=async p=>{p.preventDefault(),c(!0),d(null);try{await r(n.username,n.password),e(f)}catch(x){d(x.message||"Login failed. Please try again.")}finally{c(!1)}},m=(p,x)=>{i(g=>({...g,[p]:x})),u&&d(null)};return o.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 py-12 px-4 sm:px-6 lg:px-8",children:[o.jsx("div",{className:"absolute top-4 right-4",children:o.jsx(B3,{})}),o.jsxs("div",{className:"max-w-md w-full space-y-8",children:[o.jsxs("div",{children:[o.jsx("div",{className:"mx-auto h-16 w-16 flex items-center justify-center",children:o.jsx("img",{src:kw,alt:"WHOOSH Logo",className:"h-16 w-16 object-contain"})}),o.jsx("h2",{className:"mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-white",children:"Sign in to WHOOSH"}),o.jsx("p",{className:"mt-2 text-center text-sm text-gray-600 dark:text-gray-400",children:"Distributed AI Management Platform"})]}),o.jsxs("form",{className:"mt-8 space-y-6",onSubmit:h,children:[o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Username"}),o.jsxs("div",{className:"mt-1 relative",children:[o.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:o.jsx(M3,{className:"h-5 w-5 text-gray-400 dark:text-gray-500"})}),o.jsx("input",{id:"username",name:"username",type:"text",autoComplete:"username",required:!0,value:n.username,onChange:p=>m("username",p.target.value),className:"appearance-none relative block w-full pl-10 pr-3 py-2 border border-gray-300 dark:border-gray-600 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white bg-white dark:bg-gray-700 rounded-md focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm",placeholder:"Enter your username"})]})]}),o.jsxs("div",{children:[o.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Password"}),o.jsxs("div",{className:"mt-1 relative",children:[o.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:o.jsx(IK,{className:"h-5 w-5 text-gray-400 dark:text-gray-500"})}),o.jsx("input",{id:"password",name:"password",type:a?"text":"password",autoComplete:"current-password",required:!0,value:n.password,onChange:p=>m("password",p.target.value),className:"appearance-none relative block w-full pl-10 pr-10 py-2 border border-gray-300 dark:border-gray-600 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white bg-white dark:bg-gray-700 rounded-md focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm",placeholder:"Enter your password"}),o.jsx("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center",children:o.jsx("button",{type:"button",onClick:()=>s(!a),className:"text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300",children:a?o.jsx(OK,{className:"h-5 w-5"}):o.jsx(K2,{className:"h-5 w-5"})})})]})]})]}),u&&o.jsx("div",{className:"rounded-md bg-red-50 dark:bg-red-900/20 p-4",children:o.jsxs("div",{className:"flex",children:[o.jsx("div",{className:"flex-shrink-0",children:o.jsx(T3,{className:"h-5 w-5 text-red-400"})}),o.jsxs("div",{className:"ml-3",children:[o.jsx("h3",{className:"text-sm font-medium text-red-800 dark:text-red-200",children:"Authentication failed"}),o.jsx("div",{className:"mt-2 text-sm text-red-700 dark:text-red-300",children:o.jsx("p",{children:u})})]})]})}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsx("input",{id:"remember-me",name:"remember-me",type:"checkbox",className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600 dark:bg-gray-700 rounded"}),o.jsx("label",{htmlFor:"remember-me",className:"ml-2 block text-sm text-gray-900 dark:text-gray-300",children:"Remember me"})]}),o.jsx("div",{className:"text-sm",children:o.jsx("a",{href:"#",className:"font-medium text-blue-600 hover:text-blue-500 dark:text-blue-400 dark:hover:text-blue-300",children:"Forgot your password?"})})]}),o.jsx("div",{children:o.jsx("button",{type:"submit",disabled:l,className:"group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",children:l?o.jsx("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-white"}):"Sign in"})}),o.jsx("div",{className:"rounded-md bg-blue-50 dark:bg-blue-900/20 p-4",children:o.jsxs("div",{className:"text-sm text-blue-800 dark:text-blue-200",children:[o.jsx("p",{className:"font-medium",children:"Demo Credentials:"}),o.jsxs("p",{children:["Username: ",o.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:"admin"})]}),o.jsxs("p",{children:["Password: ",o.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:"whooshadmin123"})]})]})})]})]})]})}const CY=[{id:"general",name:"General",description:"Basic system configuration and preferences",icon:ml},{id:"cluster",name:"Cluster Management",description:"Configure cluster nodes, models, and resources",icon:zd},{id:"users",name:"User Management",description:"Manage users, roles, and permissions",icon:Hf},{id:"security",name:"Security",description:"Authentication, authorization, and security policies",icon:YK},{id:"notifications",name:"Notifications",description:"Configure alerts, webhooks, and notification channels",icon:Xq},{id:"monitoring",name:"Monitoring",description:"Metrics collection, retention, and dashboard settings",icon:Qc},{id:"advanced",name:"Advanced",description:"System tuning, performance optimization, and debugging",icon:lG},{id:"logs",name:"Logs & Audit",description:"Log management, audit trails, and compliance",icon:_o}];function TY(){const[e,t]=b.useState("general"),r=()=>{switch(e){case"general":return o.jsx(tE,{});case"cluster":return o.jsx($Y,{});case"users":return o.jsx(MY,{});case"security":return o.jsx(RY,{});case"notifications":return o.jsx(IY,{});case"monitoring":return o.jsx(DY,{});case"advanced":return o.jsx(LY,{});case"logs":return o.jsx(FY,{});default:return o.jsx(tE,{})}};return o.jsx("div",{className:"min-h-screen bg-gray-50",children:o.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[o.jsxs("div",{className:"mb-8",children:[o.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Settings"}),o.jsx("p",{className:"text-gray-600 mt-2",children:"Configure and manage your WHOOSH distributed AI platform"})]}),o.jsxs("div",{className:"flex gap-8",children:[o.jsx("div",{className:"w-80 flex-shrink-0",children:o.jsxs("div",{className:"bg-white rounded-lg shadow-sm border",children:[o.jsx("div",{className:"p-4 border-b",children:o.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Configuration"})}),o.jsx("nav",{className:"p-2",children:CY.map(n=>o.jsx("button",{onClick:()=>t(n.id),className:`w-full text-left p-3 rounded-lg mb-1 transition-colors ${e===n.id?"bg-blue-50 text-blue-900 border border-blue-200":"text-gray-700 hover:bg-gray-50"}`,children:o.jsxs("div",{className:"flex items-start space-x-3",children:[o.jsx(n.icon,{className:`h-5 w-5 mt-0.5 flex-shrink-0 ${e===n.id?"text-blue-600":"text-gray-400"}`}),o.jsxs("div",{children:[o.jsx("div",{className:"font-medium",children:n.name}),o.jsx("div",{className:"text-sm text-gray-500 mt-1",children:n.description})]})]})},n.id))})]})}),o.jsx("div",{className:"flex-1",children:o.jsx("div",{className:"bg-white rounded-lg shadow-sm border",children:r()})})]})]})})}function tE(){const[e,t]=b.useState({systemName:"WHOOSH Development Cluster",description:"Distributed AI development platform for collaborative coding",timezone:"Australia/Melbourne",language:"en-US",autoRefresh:!0,refreshInterval:30});return o.jsxs("div",{className:"p-6",children:[o.jsxs("div",{className:"border-b pb-4 mb-6",children:[o.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"General Settings"}),o.jsx("p",{className:"text-gray-600 mt-1",children:"Basic system configuration and preferences"})]}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"System Information"}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"System Name"}),o.jsx("input",{type:"text",value:e.systemName,onChange:r=>t({...e,systemName:r.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Timezone"}),o.jsxs("select",{value:e.timezone,onChange:r=>t({...e,timezone:r.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:[o.jsx("option",{value:"Australia/Melbourne",children:"Australia/Melbourne"}),o.jsx("option",{value:"UTC",children:"UTC"}),o.jsx("option",{value:"America/New_York",children:"America/New_York"}),o.jsx("option",{value:"Europe/London",children:"Europe/London"})]})]})]}),o.jsxs("div",{className:"mt-4",children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Description"}),o.jsx("textarea",{value:e.description,onChange:r=>t({...e,description:r.target.value}),rows:3,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Interface Settings"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-900",children:"Auto Refresh"}),o.jsx("p",{className:"text-sm text-gray-500",children:"Automatically refresh data in real-time"})]}),o.jsx("button",{onClick:()=>t({...e,autoRefresh:!e.autoRefresh}),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${e.autoRefresh?"bg-blue-600":"bg-gray-200"}`,children:o.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${e.autoRefresh?"translate-x-6":"translate-x-1"}`})})]}),e.autoRefresh&&o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Refresh Interval (seconds)"}),o.jsx("input",{type:"number",min:"5",max:"300",value:e.refreshInterval,onChange:r=>t({...e,refreshInterval:parseInt(r.target.value)}),className:"w-32 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]})]}),o.jsx("div",{className:"pt-6 border-t",children:o.jsxs("div",{className:"flex space-x-3",children:[o.jsx("button",{className:"bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 text-sm font-medium",children:"Save Changes"}),o.jsx("button",{className:"border border-gray-300 text-gray-700 px-4 py-2 rounded-md hover:bg-gray-50 text-sm font-medium",children:"Reset to Defaults"})]})})]})]})}function $Y(){return o.jsxs("div",{className:"p-6",children:[o.jsxs("div",{className:"border-b pb-4 mb-6",children:[o.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Cluster Management"}),o.jsx("p",{className:"text-gray-600 mt-1",children:"Configure cluster nodes, models, and resources"})]}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Cluster Nodes"}),o.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"bg-white p-4 rounded-lg border",children:[o.jsx("h4",{className:"font-medium text-gray-900",children:"WALNUT"}),o.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Primary Node"}),o.jsx("div",{className:"mt-2",children:o.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:"Online"})})]}),o.jsxs("div",{className:"bg-white p-4 rounded-lg border",children:[o.jsx("h4",{className:"font-medium text-gray-900",children:"IRONWOOD"}),o.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"GPU Node - 2x GTX 1070 + 2x Tesla P4"}),o.jsx("div",{className:"mt-2",children:o.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:"Online"})})]}),o.jsxs("div",{className:"bg-white p-4 rounded-lg border",children:[o.jsx("h4",{className:"font-medium text-gray-900",children:"ACACIA"}),o.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Secondary Node"}),o.jsx("div",{className:"mt-2",children:o.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-yellow-100 text-yellow-800",children:"Offline"})})]})]})})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Model Configuration"}),o.jsx("div",{className:"space-y-4",children:o.jsxs("div",{className:"flex items-center justify-between py-3 px-4 bg-gray-50 rounded-lg",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-gray-900",children:"Default Model"}),o.jsx("p",{className:"text-sm text-gray-500",children:"Primary model for new tasks"})]}),o.jsxs("select",{className:"px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:[o.jsx("option",{value:"codellama:34b",children:"CodeLlama 34B"}),o.jsx("option",{value:"codellama:13b",children:"CodeLlama 13B"}),o.jsx("option",{value:"deepseek-coder:33b",children:"DeepSeek Coder 33B"})]})]})})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Resource Limits"}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Max Concurrent Tasks per Node"}),o.jsx("input",{type:"number",min:"1",max:"10",defaultValue:"2",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Task Timeout (minutes)"}),o.jsx("input",{type:"number",min:"5",max:"120",defaultValue:"30",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]})]})]})]})}function MY(){return o.jsxs("div",{className:"p-6",children:[o.jsxs("div",{className:"border-b pb-4 mb-6",children:[o.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"User Management"}),o.jsx("p",{className:"text-gray-600 mt-1",children:"Manage users, roles, and permissions"})]}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[o.jsx("h3",{className:"text-lg font-medium text-blue-900 mb-2",children:"Development Mode"}),o.jsx("p",{className:"text-blue-800",children:"User management is currently in development mode. Only the demo admin account is available. Full user management features will be implemented in a future release."})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Current Users"}),o.jsx("div",{className:"bg-white border rounded-lg overflow-hidden",children:o.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[o.jsx("thead",{className:"bg-gray-50",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"User"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Role"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Last Login"})]})}),o.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:o.jsxs("tr",{children:[o.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx("div",{className:"h-8 w-8 bg-blue-100 rounded-full flex items-center justify-center",children:o.jsx("span",{className:"text-blue-600 font-medium text-sm",children:"A"})}),o.jsxs("div",{className:"ml-3",children:[o.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Administrator"}),o.jsx("div",{className:"text-sm text-gray-500",children:"admin@whoosh.local"})]})]})}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:o.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-purple-100 text-purple-800",children:"Administrator"})}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:o.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:"Active"})}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:"Just now"})]})})]})})]})]})]})}function RY(){return o.jsxs("div",{className:"p-6",children:[o.jsxs("div",{className:"border-b pb-4 mb-6",children:[o.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Security Settings"}),o.jsx("p",{className:"text-gray-600 mt-1",children:"Authentication, authorization, and security policies"})]}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:[o.jsx("h3",{className:"text-lg font-medium text-yellow-900 mb-2",children:"Demo Mode"}),o.jsx("p",{className:"text-yellow-800",children:"Security features are currently in demo mode. Authentication uses mock tokens and passwords are not encrypted. Do not use in production environments."})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Authentication"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between py-3 px-4 bg-gray-50 rounded-lg",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-gray-900",children:"Session Timeout"}),o.jsx("p",{className:"text-sm text-gray-500",children:"Automatic logout after inactivity"})]}),o.jsxs("select",{className:"px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:[o.jsx("option",{value:"30",children:"30 minutes"}),o.jsx("option",{value:"60",children:"1 hour"}),o.jsx("option",{value:"240",children:"4 hours"}),o.jsx("option",{value:"480",children:"8 hours"})]})]}),o.jsxs("div",{className:"flex items-center justify-between py-3 px-4 bg-gray-50 rounded-lg",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-gray-900",children:"Remember Login"}),o.jsx("p",{className:"text-sm text-gray-500",children:"Allow users to stay logged in across sessions"})]}),o.jsx("button",{className:"relative inline-flex h-6 w-11 items-center rounded-full bg-blue-600",children:o.jsx("span",{className:"inline-block h-4 w-4 transform rounded-full bg-white translate-x-6"})})]})]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"API Security"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"API Rate Limit (requests per minute)"}),o.jsx("input",{type:"number",min:"10",max:"1000",defaultValue:"60",className:"w-32 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),o.jsxs("div",{className:"flex items-center justify-between py-3 px-4 bg-gray-50 rounded-lg",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-gray-900",children:"CORS Enabled"}),o.jsx("p",{className:"text-sm text-gray-500",children:"Allow cross-origin requests"})]}),o.jsx("button",{className:"relative inline-flex h-6 w-11 items-center rounded-full bg-blue-600",children:o.jsx("span",{className:"inline-block h-4 w-4 transform rounded-full bg-white translate-x-6"})})]})]})]})]})]})}function IY(){return o.jsxs("div",{className:"p-6",children:[o.jsxs("div",{className:"border-b pb-4 mb-6",children:[o.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Notification Settings"}),o.jsx("p",{className:"text-gray-600 mt-1",children:"Configure alerts, webhooks, and notification channels"})]}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Email Notifications"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between py-3 px-4 bg-gray-50 rounded-lg",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-gray-900",children:"Task Completion"}),o.jsx("p",{className:"text-sm text-gray-500",children:"Notify when tasks complete or fail"})]}),o.jsx("button",{className:"relative inline-flex h-6 w-11 items-center rounded-full bg-blue-600",children:o.jsx("span",{className:"inline-block h-4 w-4 transform rounded-full bg-white translate-x-6"})})]}),o.jsxs("div",{className:"flex items-center justify-between py-3 px-4 bg-gray-50 rounded-lg",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-gray-900",children:"System Alerts"}),o.jsx("p",{className:"text-sm text-gray-500",children:"Notify about system issues and maintenance"})]}),o.jsx("button",{className:"relative inline-flex h-6 w-11 items-center rounded-full bg-blue-600",children:o.jsx("span",{className:"inline-block h-4 w-4 transform rounded-full bg-white translate-x-6"})})]})]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Webhook Configuration"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Webhook URL"}),o.jsx("input",{type:"url",placeholder:"https://your-webhook-endpoint.com/whoosh",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Events to Send"}),o.jsx("div",{className:"space-y-2",children:["task.completed","task.failed","agent.registered","system.alert"].map(e=>o.jsxs("label",{className:"flex items-center",children:[o.jsx("input",{type:"checkbox",className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500",defaultChecked:!0}),o.jsx("span",{className:"ml-2 text-sm text-gray-700",children:e})]},e))})]})]})]})]})]})}function DY(){return o.jsxs("div",{className:"p-6",children:[o.jsxs("div",{className:"border-b pb-4 mb-6",children:[o.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Monitoring Settings"}),o.jsx("p",{className:"text-gray-600 mt-1",children:"Metrics collection, retention, and dashboard settings"})]}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Metrics Collection"}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Collection Interval (seconds)"}),o.jsx("input",{type:"number",min:"10",max:"300",defaultValue:"30",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Retention Period (days)"}),o.jsx("input",{type:"number",min:"1",max:"365",defaultValue:"30",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Performance Monitoring"}),o.jsx("div",{className:"space-y-4",children:["CPU Usage","Memory Usage","GPU Utilization","Network I/O","Disk I/O"].map(e=>o.jsxs("div",{className:"flex items-center justify-between py-3 px-4 bg-gray-50 rounded-lg",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-gray-900",children:e}),o.jsxs("p",{className:"text-sm text-gray-500",children:["Monitor ",e.toLowerCase()," across cluster nodes"]})]}),o.jsx("button",{className:"relative inline-flex h-6 w-11 items-center rounded-full bg-blue-600",children:o.jsx("span",{className:"inline-block h-4 w-4 transform rounded-full bg-white translate-x-6"})})]},e))})]})]})]})}function LY(){return o.jsxs("div",{className:"p-6",children:[o.jsxs("div",{className:"border-b pb-4 mb-6",children:[o.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Advanced Settings"}),o.jsx("p",{className:"text-gray-600 mt-1",children:"System tuning, performance optimization, and debugging"})]}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:[o.jsx("h3",{className:"text-lg font-medium text-red-900 mb-2",children:"Warning"}),o.jsx("p",{className:"text-red-800",children:"These settings are for advanced users only. Incorrect configuration may impact system performance or stability."})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Debug & Logging"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Log Level"}),o.jsxs("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:[o.jsx("option",{value:"ERROR",children:"ERROR"}),o.jsx("option",{value:"WARN",children:"WARN"}),o.jsx("option",{value:"INFO",selected:!0,children:"INFO"}),o.jsx("option",{value:"DEBUG",children:"DEBUG"})]})]}),o.jsxs("div",{className:"flex items-center justify-between py-3 px-4 bg-gray-50 rounded-lg",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-gray-900",children:"Enable Debug Mode"}),o.jsx("p",{className:"text-sm text-gray-500",children:"Show detailed error messages and stack traces"})]}),o.jsx("button",{className:"relative inline-flex h-6 w-11 items-center rounded-full bg-gray-200",children:o.jsx("span",{className:"inline-block h-4 w-4 transform rounded-full bg-white translate-x-1"})})]})]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Performance Tuning"}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Connection Pool Size"}),o.jsx("input",{type:"number",min:"5",max:"100",defaultValue:"20",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Worker Threads"}),o.jsx("input",{type:"number",min:"1",max:"16",defaultValue:"4",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]})]})]})]})}function FY(){return o.jsxs("div",{className:"p-6",children:[o.jsxs("div",{className:"border-b pb-4 mb-6",children:[o.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Logs & Audit"}),o.jsx("p",{className:"text-gray-600 mt-1",children:"Log management, audit trails, and compliance"})]}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Log Management"}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Log Retention (days)"}),o.jsx("input",{type:"number",min:"1",max:"365",defaultValue:"90",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Max Log File Size (MB)"}),o.jsx("input",{type:"number",min:"10",max:"1000",defaultValue:"100",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Audit Trail"}),o.jsx("div",{className:"space-y-4",children:["User Authentication","Task Execution","Configuration Changes","API Access"].map(e=>o.jsxs("div",{className:"flex items-center justify-between py-3 px-4 bg-gray-50 rounded-lg",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-gray-900",children:e}),o.jsxs("p",{className:"text-sm text-gray-500",children:["Log ",e.toLowerCase()," events"]})]}),o.jsx("button",{className:"relative inline-flex h-6 w-11 items-center rounded-full bg-blue-600",children:o.jsx("span",{className:"inline-block h-4 w-4 transform rounded-full bg-white translate-x-6"})})]},e))})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Export Options"}),o.jsxs("div",{className:"flex space-x-3",children:[o.jsx("button",{className:"bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 text-sm font-medium",children:"Export System Logs"}),o.jsx("button",{className:"border border-gray-300 text-gray-700 px-4 py-2 rounded-md hover:bg-gray-50 text-sm font-medium",children:"Export Audit Trail"})]})]})]})]})}function BY({title:e,titleId:t,...r},n){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?b.createElement("title",{id:t},e):null,b.createElement("path",{fillRule:"evenodd",d:"M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005Z",clipRule:"evenodd"}))}const pd=b.forwardRef(BY);function zY({data:e,columns:t,searchable:r=!0,searchPlaceholder:n="Search...",pageSize:i=10,loading:a=!1,emptyMessage:s="No data available",className:l="",onRowClick:c}){const[u,d]=b.useState(""),[f,h]=b.useState(null),[m,y]=b.useState({}),[p,x]=b.useState(1),[g,v]=b.useState(!1),w=(P,$)=>typeof $=="string"&&$.includes(".")?$.split(".").reduce((O,I)=>O==null?void 0:O[I],P):P[$],_=b.useMemo(()=>{let P=[...e];return u&&(P=P.filter($=>t.some(O=>{const I=w($,O.key);return String(I).toLowerCase().includes(u.toLowerCase())}))),Object.entries(m).forEach(([$,O])=>{O!==""&&O!==null&&O!==void 0&&(P=P.filter(I=>{const D=w(I,$);return typeof O=="string"?String(D).toLowerCase().includes(O.toLowerCase()):D===O}))}),P},[e,u,m,t]),j=b.useMemo(()=>f?[..._].sort((P,$)=>{const O=w(P,f.key),I=w($,f.key);return O==null?1:I==null?-1:OI?f.direction==="asc"?1:-1:0}):_,[_,f]),N=b.useMemo(()=>{const P=(p-1)*i;return j.slice(P,P+i)},[j,p,i]),S=Math.ceil(j.length/i),E=P=>{if(!P.sortable)return;const $=P.key;let O="asc";f&&f.key===$&&f.direction==="asc"&&(O="desc"),h({key:$,direction:O})},k=(P,$)=>{y(O=>({...O,[P]:$})),x(1)},A=()=>{y({}),d(""),x(1)},C=P=>P.sortable?!f||f.key!==P.key?o.jsx(Hk,{className:"h-4 w-4 text-gray-300"}):f.direction==="asc"?o.jsx(Hk,{className:"h-4 w-4 text-blue-600"}):o.jsx(q2,{className:"h-4 w-4 text-blue-600"}):null;return a?o.jsx("div",{className:`bg-white rounded-lg shadow-sm border ${l}`,children:o.jsxs("div",{className:"p-8 text-center",children:[o.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600 mx-auto"}),o.jsx("p",{className:"text-gray-500 mt-2",children:"Loading..."})]})}):o.jsxs("div",{className:`bg-white rounded-lg shadow-sm border ${l}`,children:[o.jsxs("div",{className:"p-4 border-b border-gray-200",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center space-x-4",children:[r&&o.jsxs("div",{className:"relative",children:[o.jsx(r0,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),o.jsx("input",{type:"text",placeholder:n,value:u,onChange:P=>{d(P.target.value),x(1)},className:"pl-10 pr-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]}),o.jsxs("button",{onClick:()=>v(!g),className:`flex items-center space-x-2 px-3 py-2 text-sm font-medium rounded-md transition-colors ${g||Object.keys(m).some(P=>m[P])?"bg-blue-100 text-blue-700":"text-gray-700 hover:bg-gray-100"}`,children:[o.jsx(G2,{className:"h-4 w-4"}),o.jsx("span",{children:"Filters"})]}),(u||Object.keys(m).some(P=>m[P]))&&o.jsxs("button",{onClick:A,className:"flex items-center space-x-2 px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 rounded-md",children:[o.jsx(qf,{className:"h-4 w-4"}),o.jsx("span",{children:"Clear"})]})]}),o.jsxs("div",{className:"text-sm text-gray-500",children:["Showing ",N.length," of ",j.length," entries"]})]}),g&&o.jsx("div",{className:"mt-4 pt-4 border-t border-gray-200",children:o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:t.filter(P=>P.filterable).map(P=>{var $;return o.jsxs("div",{children:[o.jsx("label",{className:"block text-xs font-medium text-gray-700 mb-1",children:P.header}),P.filterType==="select"?o.jsxs("select",{value:m[String(P.key)]||"",onChange:O=>k(String(P.key),O.target.value),className:"w-full px-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:[o.jsx("option",{value:"",children:"All"}),($=P.filterOptions)==null?void 0:$.map(O=>o.jsx("option",{value:O.value,children:O.label},O.value))]}):o.jsx("input",{type:P.filterType||"text",value:m[String(P.key)]||"",onChange:O=>k(String(P.key),O.target.value),className:"w-full px-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:`Filter ${P.header.toLowerCase()}...`})]},String(P.key))})})})]}),o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[o.jsx("thead",{className:"bg-gray-50",children:o.jsx("tr",{children:t.map(P=>o.jsx("th",{className:`px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider ${P.sortable?"cursor-pointer hover:bg-gray-100":""} ${P.width?P.width:""}`,onClick:()=>E(P),children:o.jsxs("div",{className:"flex items-center space-x-1",children:[o.jsx("span",{children:P.header}),C(P)]})},String(P.key)))})}),o.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:N.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:t.length,className:"px-6 py-12 text-center text-gray-500",children:s})}):N.map((P,$)=>o.jsx("tr",{className:`hover:bg-gray-50 ${c?"cursor-pointer":""}`,onClick:()=>c==null?void 0:c(P),children:t.map(O=>{const I=w(P,O.key);return o.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:O.render?O.render(P,I):String(I||"")},String(O.key))})},$))})]})}),S>1&&o.jsx("div",{className:"px-6 py-4 border-t border-gray-200",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"text-sm text-gray-700",children:["Page ",p," of ",S]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("button",{onClick:()=>x(P=>Math.max(P-1,1)),disabled:p===1,className:"relative inline-flex items-center px-2 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed rounded-md",children:o.jsx(cK,{className:"h-4 w-4"})}),Array.from({length:Math.min(5,S)},(P,$)=>{const O=Math.max(1,Math.min(S-4,p-2))+$;return O>S?null:o.jsx("button",{onClick:()=>x(O),className:`relative inline-flex items-center px-3 py-2 border text-sm font-medium rounded-md ${p===O?"bg-blue-600 border-blue-600 text-white":"bg-white border-gray-300 text-gray-700 hover:bg-gray-50"}`,children:O},O)}),o.jsx("button",{onClick:()=>x(P=>Math.min(P+1,S)),disabled:p===S,className:"relative inline-flex items-center px-2 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed rounded-md",children:o.jsx(dK,{className:"h-4 w-4"})})]})]})})]})}function gg(e){"@babel/helpers - typeof";return gg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gg(e)}function yl(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function vt(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function ut(e){vt(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||gg(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function UY(e,t){vt(2,arguments);var r=ut(e).getTime(),n=yl(t);return new Date(r+n)}var WY={};function Vh(){return WY}function $w(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function xp(e,t){vt(2,arguments);var r=ut(e),n=ut(t),i=r.getTime()-n.getTime();return i<0?-1:i>0?1:i}function VY(e){return vt(1,arguments),e instanceof Date||gg(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function HY(e){if(vt(1,arguments),!VY(e)&&typeof e!="number")return!1;var t=ut(e);return!isNaN(Number(t))}function qY(e,t){vt(2,arguments);var r=ut(e),n=ut(t),i=r.getFullYear()-n.getFullYear(),a=r.getMonth()-n.getMonth();return i*12+a}function KY(e,t){return vt(2,arguments),ut(e).getTime()-ut(t).getTime()}var GY={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},YY="trunc";function ZY(e){return GY[YY]}function XY(e){vt(1,arguments);var t=ut(e);return t.setHours(23,59,59,999),t}function QY(e){vt(1,arguments);var t=ut(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function JY(e){vt(1,arguments);var t=ut(e);return XY(t).getTime()===QY(t).getTime()}function eZ(e,t){vt(2,arguments);var r=ut(e),n=ut(t),i=xp(r,n),a=Math.abs(qY(r,n)),s;if(a<1)s=0;else{r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*a);var l=xp(r,n)===-i;JY(ut(e))&&a===1&&xp(e,n)===1&&(l=!1),s=i*(a-Number(l))}return s===0?0:s}function tZ(e,t,r){vt(2,arguments);var n=KY(e,t)/1e3;return ZY()(n)}function rZ(e,t){vt(2,arguments);var r=yl(t);return UY(e,-r)}var nZ=864e5;function iZ(e){vt(1,arguments);var t=ut(e),r=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),i=r-n;return Math.floor(i/nZ)+1}function yg(e){vt(1,arguments);var t=1,r=ut(e),n=r.getUTCDay(),i=(n=i.getTime()?r+1:t.getTime()>=s.getTime()?r:r-1}function aZ(e){vt(1,arguments);var t=eM(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var n=yg(r);return n}var sZ=6048e5;function oZ(e){vt(1,arguments);var t=ut(e),r=yg(t).getTime()-aZ(t).getTime();return Math.round(r/sZ)+1}function vg(e,t){var r,n,i,a,s,l,c,u;vt(1,arguments);var d=Vh(),f=yl((r=(n=(i=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(l=s.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&i!==void 0?i:d.weekStartsOn)!==null&&n!==void 0?n:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=ut(e),m=h.getUTCDay(),y=(m=1&&m<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(f+1,0,m),y.setUTCHours(0,0,0,0);var p=vg(y,t),x=new Date(0);x.setUTCFullYear(f,0,m),x.setUTCHours(0,0,0,0);var g=vg(x,t);return d.getTime()>=p.getTime()?f+1:d.getTime()>=g.getTime()?f:f-1}function lZ(e,t){var r,n,i,a,s,l,c,u;vt(1,arguments);var d=Vh(),f=yl((r=(n=(i=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(l=s.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&i!==void 0?i:d.firstWeekContainsDate)!==null&&n!==void 0?n:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:1),h=tM(e,t),m=new Date(0);m.setUTCFullYear(h,0,f),m.setUTCHours(0,0,0,0);var y=vg(m,t);return y}var cZ=6048e5;function uZ(e,t){vt(1,arguments);var r=ut(e),n=vg(r,t).getTime()-lZ(r,t).getTime();return Math.round(n/cZ)+1}function Qe(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length0?n:1-n;return Qe(r==="yy"?i%100:i,r.length)},M:function(t,r){var n=t.getUTCMonth();return r==="M"?String(n+1):Qe(n+1,2)},d:function(t,r){return Qe(t.getUTCDate(),r.length)},a:function(t,r){var n=t.getUTCHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(t,r){return Qe(t.getUTCHours()%12||12,r.length)},H:function(t,r){return Qe(t.getUTCHours(),r.length)},m:function(t,r){return Qe(t.getUTCMinutes(),r.length)},s:function(t,r){return Qe(t.getUTCSeconds(),r.length)},S:function(t,r){var n=r.length,i=t.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,n-3));return Qe(a,r.length)}},zl={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},dZ={G:function(t,r,n){var i=t.getUTCFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(t,r,n){if(r==="yo"){var i=t.getUTCFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return za.y(t,r)},Y:function(t,r,n,i){var a=tM(t,i),s=a>0?a:1-a;if(r==="YY"){var l=s%100;return Qe(l,2)}return r==="Yo"?n.ordinalNumber(s,{unit:"year"}):Qe(s,r.length)},R:function(t,r){var n=eM(t);return Qe(n,r.length)},u:function(t,r){var n=t.getUTCFullYear();return Qe(n,r.length)},Q:function(t,r,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(r){case"Q":return String(i);case"QQ":return Qe(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,r,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(r){case"q":return String(i);case"qq":return Qe(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,r,n){var i=t.getUTCMonth();switch(r){case"M":case"MM":return za.M(t,r);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,r,n){var i=t.getUTCMonth();switch(r){case"L":return String(i+1);case"LL":return Qe(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,r,n,i){var a=uZ(t,i);return r==="wo"?n.ordinalNumber(a,{unit:"week"}):Qe(a,r.length)},I:function(t,r,n){var i=oZ(t);return r==="Io"?n.ordinalNumber(i,{unit:"week"}):Qe(i,r.length)},d:function(t,r,n){return r==="do"?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):za.d(t,r)},D:function(t,r,n){var i=iZ(t);return r==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Qe(i,r.length)},E:function(t,r,n){var i=t.getUTCDay();switch(r){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,r,n,i){var a=t.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(r){case"e":return String(s);case"ee":return Qe(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,r,n,i){var a=t.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(r){case"c":return String(s);case"cc":return Qe(s,r.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,r,n){var i=t.getUTCDay(),a=i===0?7:i;switch(r){case"i":return String(a);case"ii":return Qe(a,r.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,r,n){var i=t.getUTCHours(),a=i/12>=1?"pm":"am";switch(r){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,r,n){var i=t.getUTCHours(),a;switch(i===12?a=zl.noon:i===0?a=zl.midnight:a=i/12>=1?"pm":"am",r){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,r,n){var i=t.getUTCHours(),a;switch(i>=17?a=zl.evening:i>=12?a=zl.afternoon:i>=4?a=zl.morning:a=zl.night,r){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,r,n){if(r==="ho"){var i=t.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return za.h(t,r)},H:function(t,r,n){return r==="Ho"?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):za.H(t,r)},K:function(t,r,n){var i=t.getUTCHours()%12;return r==="Ko"?n.ordinalNumber(i,{unit:"hour"}):Qe(i,r.length)},k:function(t,r,n){var i=t.getUTCHours();return i===0&&(i=24),r==="ko"?n.ordinalNumber(i,{unit:"hour"}):Qe(i,r.length)},m:function(t,r,n){return r==="mo"?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):za.m(t,r)},s:function(t,r,n){return r==="so"?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):za.s(t,r)},S:function(t,r){return za.S(t,r)},X:function(t,r,n,i){var a=i._originalDate||t,s=a.getTimezoneOffset();if(s===0)return"Z";switch(r){case"X":return nE(s);case"XXXX":case"XX":return vo(s);case"XXXXX":case"XXX":default:return vo(s,":")}},x:function(t,r,n,i){var a=i._originalDate||t,s=a.getTimezoneOffset();switch(r){case"x":return nE(s);case"xxxx":case"xx":return vo(s);case"xxxxx":case"xxx":default:return vo(s,":")}},O:function(t,r,n,i){var a=i._originalDate||t,s=a.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+rE(s,":");case"OOOO":default:return"GMT"+vo(s,":")}},z:function(t,r,n,i){var a=i._originalDate||t,s=a.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+rE(s,":");case"zzzz":default:return"GMT"+vo(s,":")}},t:function(t,r,n,i){var a=i._originalDate||t,s=Math.floor(a.getTime()/1e3);return Qe(s,r.length)},T:function(t,r,n,i){var a=i._originalDate||t,s=a.getTime();return Qe(s,r.length)}};function rE(e,t){var r=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),a=n%60;if(a===0)return r+String(i);var s=t;return r+String(i)+s+Qe(a,2)}function nE(e,t){if(e%60===0){var r=e>0?"-":"+";return r+Qe(Math.abs(e)/60,2)}return vo(e,t)}function vo(e,t){var r=t||"",n=e>0?"-":"+",i=Math.abs(e),a=Qe(Math.floor(i/60),2),s=Qe(i%60,2);return n+a+r+s}var iE=function(t,r){switch(t){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},rM=function(t,r){switch(t){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},fZ=function(t,r){var n=t.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return iE(t,r);var s;switch(i){case"P":s=r.dateTime({width:"short"});break;case"PP":s=r.dateTime({width:"medium"});break;case"PPP":s=r.dateTime({width:"long"});break;case"PPPP":default:s=r.dateTime({width:"full"});break}return s.replace("{{date}}",iE(i,r)).replace("{{time}}",rM(a,r))},hZ={p:rM,P:fZ},mZ=["D","DD"],pZ=["YY","YYYY"];function gZ(e){return mZ.indexOf(e)!==-1}function yZ(e){return pZ.indexOf(e)!==-1}function aE(e,t,r){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var vZ={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},xZ=function(t,r,n){var i,a=vZ[t];return typeof a=="string"?i=a:r===1?i=a.one:i=a.other.replace("{{count}}",r.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function cx(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.width?String(t.width):e.defaultWidth,n=e.formats[r]||e.formats[e.defaultWidth];return n}}var bZ={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},wZ={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},jZ={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},_Z={date:cx({formats:bZ,defaultWidth:"full"}),time:cx({formats:wZ,defaultWidth:"full"}),dateTime:cx({formats:jZ,defaultWidth:"full"})},NZ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},SZ=function(t,r,n,i){return NZ[t]};function gd(e){return function(t,r){var n=r!=null&&r.context?String(r.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,s=r!=null&&r.width?String(r.width):a;i=e.formattingValues[s]||e.formattingValues[a]}else{var l=e.defaultWidth,c=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[c]||e.values[l]}var u=e.argumentCallback?e.argumentCallback(t):t;return i[u]}}var kZ={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},EZ={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},OZ={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},AZ={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},PZ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},CZ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},TZ=function(t,r){var n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},$Z={ordinalNumber:TZ,era:gd({values:kZ,defaultWidth:"wide"}),quarter:gd({values:EZ,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:gd({values:OZ,defaultWidth:"wide"}),day:gd({values:AZ,defaultWidth:"wide"}),dayPeriod:gd({values:PZ,defaultWidth:"wide",formattingValues:CZ,defaultFormattingWidth:"wide"})};function yd(e){return function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;var s=a[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?RZ(l,function(f){return f.test(s)}):MZ(l,function(f){return f.test(s)}),u;u=e.valueCallback?e.valueCallback(c):c,u=r.valueCallback?r.valueCallback(u):u;var d=t.slice(s.length);return{value:u,rest:d}}}function MZ(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}function RZ(e,t){for(var r=0;r1&&arguments[1]!==void 0?arguments[1]:{},n=t.match(e.matchPattern);if(!n)return null;var i=n[0],a=t.match(e.parsePattern);if(!a)return null;var s=e.valueCallback?e.valueCallback(a[0]):a[0];s=r.valueCallback?r.valueCallback(s):s;var l=t.slice(i.length);return{value:s,rest:l}}}var DZ=/^(\d+)(th|st|nd|rd)?/i,LZ=/\d+/i,FZ={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},BZ={any:[/^b/i,/^(a|c)/i]},zZ={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},UZ={any:[/1/i,/2/i,/3/i,/4/i]},WZ={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},VZ={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},HZ={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},qZ={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},KZ={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},GZ={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},YZ={ordinalNumber:IZ({matchPattern:DZ,parsePattern:LZ,valueCallback:function(t){return parseInt(t,10)}}),era:yd({matchPatterns:FZ,defaultMatchWidth:"wide",parsePatterns:BZ,defaultParseWidth:"any"}),quarter:yd({matchPatterns:zZ,defaultMatchWidth:"wide",parsePatterns:UZ,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:yd({matchPatterns:WZ,defaultMatchWidth:"wide",parsePatterns:VZ,defaultParseWidth:"any"}),day:yd({matchPatterns:HZ,defaultMatchWidth:"wide",parsePatterns:qZ,defaultParseWidth:"any"}),dayPeriod:yd({matchPatterns:KZ,defaultMatchWidth:"any",parsePatterns:GZ,defaultParseWidth:"any"})},nM={code:"en-US",formatDistance:xZ,formatLong:_Z,formatRelative:SZ,localize:$Z,match:YZ,options:{weekStartsOn:0,firstWeekContainsDate:1}},ZZ=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,XZ=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,QZ=/^'([^]*?)'?$/,JZ=/''/g,eX=/[a-zA-Z]/;function sf(e,t,r){var n,i,a,s,l,c,u,d,f,h,m,y,p,x;vt(2,arguments);var g=String(t),v=Vh(),w=(n=(i=void 0)!==null&&i!==void 0?i:v.locale)!==null&&n!==void 0?n:nM,_=yl((a=(s=(l=(c=void 0)!==null&&c!==void 0?c:void 0)!==null&&l!==void 0?l:v.firstWeekContainsDate)!==null&&s!==void 0?s:(u=v.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(_>=1&&_<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=yl((f=(h=(m=(y=void 0)!==null&&y!==void 0?y:void 0)!==null&&m!==void 0?m:v.weekStartsOn)!==null&&h!==void 0?h:(p=v.locale)===null||p===void 0||(x=p.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&f!==void 0?f:0);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!w.localize)throw new RangeError("locale must contain localize property");if(!w.formatLong)throw new RangeError("locale must contain formatLong property");var N=ut(e);if(!HY(N))throw new RangeError("Invalid time value");var S=$w(N),E=rZ(N,S),k={firstWeekContainsDate:_,weekStartsOn:j,locale:w,_originalDate:N},A=g.match(XZ).map(function(C){var P=C[0];if(P==="p"||P==="P"){var $=hZ[P];return $(C,w.formatLong)}return C}).join("").match(ZZ).map(function(C){if(C==="''")return"'";var P=C[0];if(P==="'")return tX(C);var $=dZ[P];if($)return yZ(C)&&aE(C,t,String(e)),gZ(C)&&aE(C,t,String(e)),$(E,C,w.localize,k);if(P.match(eX))throw new RangeError("Format string contains an unescaped latin alphabet character `"+P+"`");return C}).join("");return A}function tX(e){var t=e.match(QZ);return t?t[1].replace(JZ,"'"):e}function iM(e,t){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}function rX(e){return iM({},e)}var sE=1440,nX=2520,ux=43200,iX=86400;function aX(e,t,r){var n,i;vt(2,arguments);var a=Vh(),s=(n=(i=r==null?void 0:r.locale)!==null&&i!==void 0?i:a.locale)!==null&&n!==void 0?n:nM;if(!s.formatDistance)throw new RangeError("locale must contain formatDistance property");var l=xp(e,t);if(isNaN(l))throw new RangeError("Invalid time value");var c=iM(rX(r),{addSuffix:!!(r!=null&&r.addSuffix),comparison:l}),u,d;l>0?(u=ut(t),d=ut(e)):(u=ut(e),d=ut(t));var f=tZ(d,u),h=($w(d)-$w(u))/1e3,m=Math.round((f-h)/60),y;if(m<2)return r!=null&&r.includeSeconds?f<5?s.formatDistance("lessThanXSeconds",5,c):f<10?s.formatDistance("lessThanXSeconds",10,c):f<20?s.formatDistance("lessThanXSeconds",20,c):f<40?s.formatDistance("halfAMinute",0,c):f<60?s.formatDistance("lessThanXMinutes",1,c):s.formatDistance("xMinutes",1,c):m===0?s.formatDistance("lessThanXMinutes",1,c):s.formatDistance("xMinutes",m,c);if(m<45)return s.formatDistance("xMinutes",m,c);if(m<90)return s.formatDistance("aboutXHours",1,c);if(mu()}),u=()=>{const g=["Development","Testing","Data Processing","Documentation","DevOps","AI/ML"],v=["beginner","intermediate","advanced"],w=["kernel_dev","pytorch_dev","profiler","docs_writer","tester"];return["Python Code Review Pipeline","React Component Generator","API Documentation Builder","Database Migration Runner","Model Training Pipeline","Test Suite Generator","Security Audit Workflow","Performance Profiling","Docker Container Builder","CI/CD Pipeline Setup","Data Validation Framework","Microservice Scaffold","Machine Learning Experiment","Code Quality Analysis","Deployment Automation"].map((j,N)=>{const S=g[Math.floor(Math.random()*g.length)],E=v[Math.floor(Math.random()*v.length)],k=Math.floor(Math.random()*8)+3,A=Array.from({length:k},(P,$)=>({id:`step-${$+1}`,name:`Step ${$+1}`,type:["task","condition","loop","parallel"][Math.floor(Math.random()*4)],agent_type:w[Math.floor(Math.random()*w.length)],description:`Description for step ${$+1}`,config:{timeout:300,retry_count:3},dependencies:$>0?[`step-${$}`]:[]})),C=[{name:"project_path",type:"string",required:!0,description:"Path to the project directory"},{name:"environment",type:"string",required:!1,default_value:"development",description:"Target environment"}];return{id:`template-${String(N+1).padStart(3,"0")}`,name:j,description:`${j} workflow template for automated ${S.toLowerCase()} tasks`,category:S,difficulty:E,estimated_duration:Math.floor(Math.random()*120)+15,created_by:`user-${Math.floor(Math.random()*5)+1}`,created_at:new Date(Date.now()-Math.random()*90*24*60*60*1e3).toISOString(),updated_at:new Date(Date.now()-Math.random()*30*24*60*60*1e3).toISOString(),usage_count:Math.floor(Math.random()*500),rating:Math.round((Math.random()*2+3)*10)/10,is_favorite:Math.random()>.8,tags:[S.toLowerCase(),E,"automation"].concat(Math.random()>.5?["popular"]:[],Math.random()>.7?["community"]:[]),steps:A,variables:C,version:`1.${Math.floor(Math.random()*10)}.${Math.floor(Math.random()*10)}`,is_public:Math.random()>.3}})},d=g=>`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium ${{beginner:"bg-green-100 text-green-800",intermediate:"bg-yellow-100 text-yellow-800",advanced:"bg-red-100 text-red-800"}[g]}`,f=g=>{const w={Development:Vf,Testing:hi,"Data Processing":_o,Documentation:_o,DevOps:Wf,"AI/ML":tx}[g]||_o;return o.jsx(w,{className:"h-4 w-4"})},h=g=>{console.log("Toggle favorite for template:",g.id),c()},m=(g,v)=>{console.log(`${g} template:`,v.id),c()};if(templatesError)return o.jsxs("div",{className:"p-6",children:[o.jsxs("div",{className:"mb-6",children:[o.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Workflow Templates"}),o.jsx("p",{className:"text-gray-600 mt-1",children:"Pre-built workflow templates to accelerate your development"})]}),o.jsx("div",{className:"bg-white rounded-lg border p-8",children:o.jsxs("div",{className:"text-center",children:[o.jsx(Ls,{className:"h-16 w-16 text-yellow-500 mx-auto mb-4"}),o.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Templates Service Not Available"}),o.jsx("p",{className:"text-gray-600 mb-4",children:"The workflow templates service is not yet configured. This feature will be available in a future update."}),o.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-md p-4 mt-4",children:o.jsxs("p",{className:"text-sm text-blue-800",children:[o.jsx(_o,{className:"h-4 w-4 inline mr-1"}),"In the meantime, you can create workflows manually using the Workflow Editor."]})})]})})]});const y=["all",...Array.from(new Set(s.map(g=>g.category)))],p=i==="all"?s:s.filter(g=>g.category===i),x=[{key:"name",header:"Template",sortable:!0,filterable:!0,render:g=>o.jsxs("div",{className:"flex items-start space-x-3",children:[o.jsx("div",{className:"flex-shrink-0 mt-1",children:f(g.category)}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("span",{className:"font-medium text-gray-900",children:g.name}),g.is_favorite&&o.jsx(pd,{className:"h-4 w-4 text-yellow-500"})]}),o.jsx("p",{className:"text-sm text-gray-500 mt-1 line-clamp-2",children:g.description}),o.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[o.jsx("span",{className:d(g.difficulty),children:g.difficulty}),o.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:g.category})]})]})]})},{key:"estimated_duration",header:"Duration",sortable:!0,render:g=>o.jsxs("div",{className:"flex items-center space-x-1 text-sm text-gray-900",children:[o.jsx(hr,{className:"h-4 w-4 text-gray-400"}),o.jsxs("span",{children:[g.estimated_duration,"m"]})]})},{key:"usage_count",header:"Usage",sortable:!0,render:g=>o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-sm font-medium text-gray-900",children:g.usage_count}),o.jsx("div",{className:"text-xs text-gray-500",children:"times used"})]})},{key:"rating",header:"Rating",sortable:!0,render:g=>o.jsxs("div",{className:"flex items-center space-x-1",children:[o.jsx(pd,{className:"h-4 w-4 text-yellow-500"}),o.jsx("span",{className:"text-sm font-medium text-gray-900",children:g.rating})]})},{key:"created_by",header:"Author",sortable:!0,filterable:!0,render:g=>o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(M3,{className:"h-4 w-4 text-gray-400"}),o.jsx("span",{className:"text-sm text-gray-900",children:g.created_by})]})},{key:"updated_at",header:"Updated",sortable:!0,render:g=>o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-gray-900",children:kc(new Date(g.updated_at),{addSuffix:!0})}),o.jsxs("div",{className:"text-xs text-gray-500",children:["v",g.version]})]})},{key:"actions",header:"Actions",render:g=>o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("button",{onClick:v=>{v.stopPropagation(),t(g),n(!0)},className:"text-blue-600 hover:text-blue-800",title:"View Details",children:o.jsx(K2,{className:"h-4 w-4"})}),o.jsx("button",{onClick:v=>{v.stopPropagation(),h(g)},className:`${g.is_favorite?"text-yellow-500":"text-gray-400"} hover:text-yellow-600`,title:"Toggle Favorite",children:g.is_favorite?o.jsx(pd,{className:"h-4 w-4"}):o.jsx(tx,{className:"h-4 w-4"})}),o.jsx("button",{onClick:v=>{v.stopPropagation(),m("use",g)},className:"text-green-600 hover:text-green-800",title:"Use Template",children:o.jsx(hi,{className:"h-4 w-4"})}),o.jsx("button",{onClick:v=>{v.stopPropagation(),m("duplicate",g)},className:"text-purple-600 hover:text-purple-800",title:"Duplicate Template",children:o.jsx(wK,{className:"h-4 w-4"})})]})}];return o.jsxs("div",{className:"p-6",children:[o.jsxs("div",{className:"flex items-center justify-between mb-6",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Workflow Templates"}),o.jsx("p",{className:"text-gray-600 mt-1",children:"Discover and manage reusable workflow templates for common development tasks"})]}),o.jsxs("button",{onClick:()=>console.log("Create template form coming soon"),className:"bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 flex items-center space-x-2",children:[o.jsx(Sa,{className:"h-4 w-4"}),o.jsx("span",{children:"Create Template"})]})]}),o.jsx("div",{className:"mb-6",children:o.jsx("div",{className:"flex items-center space-x-2 overflow-x-auto",children:y.map(g=>o.jsx("button",{onClick:()=>a(g),className:`px-4 py-2 rounded-full text-sm font-medium whitespace-nowrap transition-colors ${i===g?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-100"}`,children:g==="all"?"All Categories":g},g))})}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4 mb-6",children:[o.jsx("div",{className:"bg-white rounded-lg shadow-sm border p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Templates"}),o.jsx("p",{className:"text-2xl font-bold text-gray-900",children:s.length})]}),o.jsx(_o,{className:"h-8 w-8 text-blue-500"})]})}),o.jsx("div",{className:"bg-white rounded-lg shadow-sm border p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Favorites"}),o.jsx("p",{className:"text-2xl font-bold text-gray-900",children:s.filter(g=>g.is_favorite).length})]}),o.jsx(pd,{className:"h-8 w-8 text-yellow-500"})]})}),o.jsx("div",{className:"bg-white rounded-lg shadow-sm border p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Usage"}),o.jsx("p",{className:"text-2xl font-bold text-gray-900",children:s.reduce((g,v)=>g+v.usage_count,0).toLocaleString()})]}),o.jsx(hi,{className:"h-8 w-8 text-green-500"})]})}),o.jsx("div",{className:"bg-white rounded-lg shadow-sm border p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Avg Rating"}),o.jsx("p",{className:"text-2xl font-bold text-gray-900",children:(s.reduce((g,v)=>g+v.rating,0)/s.length).toFixed(1)})]}),o.jsx(tx,{className:"h-8 w-8 text-purple-500"})]})})]}),o.jsx(zY,{data:p,columns:x,loading:l,searchPlaceholder:"Search templates...",pageSize:10,emptyMessage:"No templates found",onRowClick:g=>{t(g),n(!0)}}),r&&e&&o.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:o.jsxs("div",{className:"flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[o.jsx("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",onClick:()=>n(!1)}),o.jsxs("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-4xl sm:w-full",children:[o.jsxs("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 max-h-96 overflow-y-auto",children:[o.jsxs("div",{className:"flex items-start justify-between mb-4",children:[o.jsxs("div",{className:"flex items-center space-x-3",children:[f(e.category),o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900",children:e.name}),o.jsxs("p",{className:"text-sm text-gray-500",children:["v",e.version]})]})]}),o.jsx("button",{onClick:()=>n(!1),className:"text-gray-400 hover:text-gray-600",children:"×"})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Description"}),o.jsx("p",{className:"text-sm text-gray-700",children:e.description})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Details"}),o.jsxs("div",{className:"space-y-2 text-sm",children:[o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{className:"text-gray-600",children:"Category:"}),o.jsx("span",{className:"font-medium",children:e.category})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{className:"text-gray-600",children:"Difficulty:"}),o.jsx("span",{className:d(e.difficulty),children:e.difficulty})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{className:"text-gray-600",children:"Duration:"}),o.jsxs("span",{className:"font-medium",children:[e.estimated_duration," minutes"]})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{className:"text-gray-600",children:"Rating:"}),o.jsxs("div",{className:"flex items-center space-x-1",children:[o.jsx(pd,{className:"h-4 w-4 text-yellow-500"}),o.jsx("span",{className:"font-medium",children:e.rating})]})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{className:"text-gray-600",children:"Usage Count:"}),o.jsx("span",{className:"font-medium",children:e.usage_count})]})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Tags"}),o.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map((g,v)=>o.jsxs("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-800",children:[o.jsx(Y2,{className:"h-3 w-3 mr-1"}),g]},v))})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsxs("h4",{className:"font-medium text-gray-900 mb-2",children:["Workflow Steps (",e.steps.length,")"]}),o.jsx("div",{className:"space-y-2 max-h-40 overflow-y-auto",children:e.steps.map(g=>o.jsxs("div",{className:"border border-gray-200 rounded p-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm font-medium text-gray-900",children:g.name}),o.jsx("span",{className:"text-xs text-gray-500",children:g.type})]}),o.jsx("p",{className:"text-xs text-gray-600 mt-1",children:g.description}),g.agent_type&&o.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded text-xs font-medium bg-blue-100 text-blue-800 mt-1",children:g.agent_type})]},g.id))})]}),o.jsxs("div",{children:[o.jsxs("h4",{className:"font-medium text-gray-900 mb-2",children:["Variables (",e.variables.length,")"]}),o.jsx("div",{className:"space-y-2 max-h-32 overflow-y-auto",children:e.variables.map((g,v)=>o.jsxs("div",{className:"border border-gray-200 rounded p-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm font-medium text-gray-900",children:g.name}),o.jsxs("div",{className:"flex items-center space-x-1",children:[o.jsx("span",{className:"text-xs text-gray-500",children:g.type}),g.required&&o.jsx("span",{className:"text-xs text-red-600",children:"*"})]})]}),o.jsx("p",{className:"text-xs text-gray-600 mt-1",children:g.description})]},v))})]})]})]})]}),o.jsxs("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[o.jsx("button",{onClick:()=>m("use",e),className:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm",children:"Use Template"}),o.jsx("button",{onClick:()=>n(!1),className:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm",children:"Close"})]})]})]})})]})}function aM(e,t){return function(){return e.apply(t,arguments)}}const{toString:oX}=Object.prototype,{getPrototypeOf:r_}=Object,{iterator:a0,toStringTag:sM}=Symbol,s0=(e=>t=>{const r=oX.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),vi=e=>(e=e.toLowerCase(),t=>s0(t)===e),o0=e=>t=>typeof t===e,{isArray:Fu}=Array,Kf=o0("undefined");function lX(e){return e!==null&&!Kf(e)&&e.constructor!==null&&!Kf(e.constructor)&&Xr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const oM=vi("ArrayBuffer");function cX(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&oM(e.buffer),t}const uX=o0("string"),Xr=o0("function"),lM=o0("number"),l0=e=>e!==null&&typeof e=="object",dX=e=>e===!0||e===!1,bp=e=>{if(s0(e)!=="object")return!1;const t=r_(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(sM in e)&&!(a0 in e)},fX=vi("Date"),hX=vi("File"),mX=vi("Blob"),pX=vi("FileList"),gX=e=>l0(e)&&Xr(e.pipe),yX=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Xr(e.append)&&((t=s0(e))==="formdata"||t==="object"&&Xr(e.toString)&&e.toString()==="[object FormData]"))},vX=vi("URLSearchParams"),[xX,bX,wX,jX]=["ReadableStream","Request","Response","Headers"].map(vi),_X=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Hh(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),Fu(e))for(n=0,i=e.length;n0;)if(i=r[n],t===i.toLowerCase())return i;return null}const $o=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,uM=e=>!Kf(e)&&e!==$o;function Mw(){const{caseless:e}=uM(this)&&this||{},t={},r=(n,i)=>{const a=e&&cM(t,i)||i;bp(t[a])&&bp(n)?t[a]=Mw(t[a],n):bp(n)?t[a]=Mw({},n):Fu(n)?t[a]=n.slice():t[a]=n};for(let n=0,i=arguments.length;n(Hh(t,(i,a)=>{r&&Xr(i)?e[a]=aM(i,r):e[a]=i},{allOwnKeys:n}),e),SX=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),kX=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},EX=(e,t,r,n)=>{let i,a,s;const l={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],(!n||n(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=r!==!1&&r_(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},OX=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},AX=e=>{if(!e)return null;if(Fu(e))return e;let t=e.length;if(!lM(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},PX=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&r_(Uint8Array)),CX=(e,t)=>{const n=(e&&e[a0]).call(e);let i;for(;(i=n.next())&&!i.done;){const a=i.value;t.call(e,a[0],a[1])}},TX=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},$X=vi("HTMLFormElement"),MX=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),oE=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),RX=vi("RegExp"),dM=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Hh(r,(i,a)=>{let s;(s=t(i,a,e))!==!1&&(n[a]=s||i)}),Object.defineProperties(e,n)},IX=e=>{dM(e,(t,r)=>{if(Xr(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(Xr(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},DX=(e,t)=>{const r={},n=i=>{i.forEach(a=>{r[a]=!0})};return Fu(e)?n(e):n(String(e).split(t)),r},LX=()=>{},FX=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function BX(e){return!!(e&&Xr(e.append)&&e[sM]==="FormData"&&e[a0])}const zX=e=>{const t=new Array(10),r=(n,i)=>{if(l0(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const a=Fu(n)?[]:{};return Hh(n,(s,l)=>{const c=r(s,i+1);!Kf(c)&&(a[l]=c)}),t[i]=void 0,a}}return n};return r(e,0)},UX=vi("AsyncFunction"),WX=e=>e&&(l0(e)||Xr(e))&&Xr(e.then)&&Xr(e.catch),fM=((e,t)=>e?setImmediate:t?((r,n)=>($o.addEventListener("message",({source:i,data:a})=>{i===$o&&a===r&&n.length&&n.shift()()},!1),i=>{n.push(i),$o.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Xr($o.postMessage)),VX=typeof queueMicrotask<"u"?queueMicrotask.bind($o):typeof process<"u"&&process.nextTick||fM,HX=e=>e!=null&&Xr(e[a0]),G={isArray:Fu,isArrayBuffer:oM,isBuffer:lX,isFormData:yX,isArrayBufferView:cX,isString:uX,isNumber:lM,isBoolean:dX,isObject:l0,isPlainObject:bp,isReadableStream:xX,isRequest:bX,isResponse:wX,isHeaders:jX,isUndefined:Kf,isDate:fX,isFile:hX,isBlob:mX,isRegExp:RX,isFunction:Xr,isStream:gX,isURLSearchParams:vX,isTypedArray:PX,isFileList:pX,forEach:Hh,merge:Mw,extend:NX,trim:_X,stripBOM:SX,inherits:kX,toFlatObject:EX,kindOf:s0,kindOfTest:vi,endsWith:OX,toArray:AX,forEachEntry:CX,matchAll:TX,isHTMLForm:$X,hasOwnProperty:oE,hasOwnProp:oE,reduceDescriptors:dM,freezeMethods:IX,toObjectSet:DX,toCamelCase:MX,noop:LX,toFiniteNumber:FX,findKey:cM,global:$o,isContextDefined:uM,isSpecCompliantForm:BX,toJSONObject:zX,isAsyncFn:UX,isThenable:WX,setImmediate:fM,asap:VX,isIterable:HX};function Me(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}G.inherits(Me,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:G.toJSONObject(this.config),code:this.code,status:this.status}}});const hM=Me.prototype,mM={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{mM[e]={value:e}});Object.defineProperties(Me,mM);Object.defineProperty(hM,"isAxiosError",{value:!0});Me.from=(e,t,r,n,i,a)=>{const s=Object.create(hM);return G.toFlatObject(e,s,function(c){return c!==Error.prototype},l=>l!=="isAxiosError"),Me.call(s,e.message,t,r,n,i),s.cause=e,s.name=e.name,a&&Object.assign(s,a),s};const qX=null;function Rw(e){return G.isPlainObject(e)||G.isArray(e)}function pM(e){return G.endsWith(e,"[]")?e.slice(0,-2):e}function lE(e,t,r){return e?e.concat(t).map(function(i,a){return i=pM(i),!r&&a?"["+i+"]":i}).join(r?".":""):t}function KX(e){return G.isArray(e)&&!e.some(Rw)}const GX=G.toFlatObject(G,{},null,function(t){return/^is[A-Z]/.test(t)});function c0(e,t,r){if(!G.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=G.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,x){return!G.isUndefined(x[p])});const n=r.metaTokens,i=r.visitor||d,a=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&G.isSpecCompliantForm(t);if(!G.isFunction(i))throw new TypeError("visitor must be a function");function u(y){if(y===null)return"";if(G.isDate(y))return y.toISOString();if(G.isBoolean(y))return y.toString();if(!c&&G.isBlob(y))throw new Me("Blob is not supported. Use a Buffer instead.");return G.isArrayBuffer(y)||G.isTypedArray(y)?c&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function d(y,p,x){let g=y;if(y&&!x&&typeof y=="object"){if(G.endsWith(p,"{}"))p=n?p:p.slice(0,-2),y=JSON.stringify(y);else if(G.isArray(y)&&KX(y)||(G.isFileList(y)||G.endsWith(p,"[]"))&&(g=G.toArray(y)))return p=pM(p),g.forEach(function(w,_){!(G.isUndefined(w)||w===null)&&t.append(s===!0?lE([p],_,a):s===null?p:p+"[]",u(w))}),!1}return Rw(y)?!0:(t.append(lE(x,p,a),u(y)),!1)}const f=[],h=Object.assign(GX,{defaultVisitor:d,convertValue:u,isVisitable:Rw});function m(y,p){if(!G.isUndefined(y)){if(f.indexOf(y)!==-1)throw Error("Circular reference detected in "+p.join("."));f.push(y),G.forEach(y,function(g,v){(!(G.isUndefined(g)||g===null)&&i.call(t,g,G.isString(v)?v.trim():v,p,h))===!0&&m(g,p?p.concat(v):[v])}),f.pop()}}if(!G.isObject(e))throw new TypeError("data must be an object");return m(e),t}function cE(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function n_(e,t){this._pairs=[],e&&c0(e,this,t)}const gM=n_.prototype;gM.append=function(t,r){this._pairs.push([t,r])};gM.toString=function(t){const r=t?function(n){return t.call(this,n,cE)}:cE;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function YX(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function yM(e,t,r){if(!t)return e;const n=r&&r.encode||YX;G.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let a;if(i?a=i(t,r):a=G.isURLSearchParams(t)?t.toString():new n_(t,r).toString(n),a){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class uE{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){G.forEach(this.handlers,function(n){n!==null&&t(n)})}}const vM={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ZX=typeof URLSearchParams<"u"?URLSearchParams:n_,XX=typeof FormData<"u"?FormData:null,QX=typeof Blob<"u"?Blob:null,JX={isBrowser:!0,classes:{URLSearchParams:ZX,FormData:XX,Blob:QX},protocols:["http","https","file","blob","url","data"]},i_=typeof window<"u"&&typeof document<"u",Iw=typeof navigator=="object"&&navigator||void 0,eQ=i_&&(!Iw||["ReactNative","NativeScript","NS"].indexOf(Iw.product)<0),tQ=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",rQ=i_&&window.location.href||"http://localhost",nQ=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:i_,hasStandardBrowserEnv:eQ,hasStandardBrowserWebWorkerEnv:tQ,navigator:Iw,origin:rQ},Symbol.toStringTag,{value:"Module"})),Nr={...nQ,...JX};function iQ(e,t){return c0(e,new Nr.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,a){return Nr.isNode&&G.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function aQ(e){return G.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function sQ(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n=r.length;return s=!s&&G.isArray(i)?i.length:s,c?(G.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!l):((!i[s]||!G.isObject(i[s]))&&(i[s]=[]),t(r,n,i[s],a)&&G.isArray(i[s])&&(i[s]=sQ(i[s])),!l)}if(G.isFormData(e)&&G.isFunction(e.entries)){const r={};return G.forEachEntry(e,(n,i)=>{t(aQ(n),i,r,0)}),r}return null}function oQ(e,t,r){if(G.isString(e))try{return(t||JSON.parse)(e),G.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const qh={transitional:vM,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=G.isObject(t);if(a&&G.isHTMLForm(t)&&(t=new FormData(t)),G.isFormData(t))return i?JSON.stringify(xM(t)):t;if(G.isArrayBuffer(t)||G.isBuffer(t)||G.isStream(t)||G.isFile(t)||G.isBlob(t)||G.isReadableStream(t))return t;if(G.isArrayBufferView(t))return t.buffer;if(G.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return iQ(t,this.formSerializer).toString();if((l=G.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return c0(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),oQ(t)):t}],transformResponse:[function(t){const r=this.transitional||qh.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(G.isResponse(t)||G.isReadableStream(t))return t;if(t&&G.isString(t)&&(n&&!this.responseType||i)){const s=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(l){if(s)throw l.name==="SyntaxError"?Me.from(l,Me.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Nr.classes.FormData,Blob:Nr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};G.forEach(["delete","get","head","post","put","patch"],e=>{qh.headers[e]={}});const lQ=G.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),cQ=e=>{const t={};let r,n,i;return e&&e.split(` `).forEach(function(s){i=s.indexOf(":"),r=s.substring(0,i).trim().toLowerCase(),n=s.substring(i+1).trim(),!(!r||t[r]&&lQ[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},dE=Symbol("internals");function vd(e){return e&&String(e).trim().toLowerCase()}function wp(e){return e===!1||e==null?e:G.isArray(e)?e.map(wp):String(e)}function uQ(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const dQ=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function dx(e,t,r,n,i){if(G.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!G.isString(t)){if(G.isString(n))return t.indexOf(n)!==-1;if(G.isRegExp(n))return n.test(t)}}function fQ(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function hQ(e,t){const r=G.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,a,s){return this[n].call(this,t,i,a,s)},configurable:!0})})}let Qr=class{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function a(l,c,u){const d=vd(c);if(!d)throw new Error("header name must be a non-empty string");const f=G.findKey(i,d);(!f||i[f]===void 0||u===!0||u===void 0&&i[f]!==!1)&&(i[f||c]=wp(l))}const s=(l,c)=>G.forEach(l,(u,d)=>a(u,d,c));if(G.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(G.isString(t)&&(t=t.trim())&&!dQ(t))s(cQ(t),r);else if(G.isObject(t)&&G.isIterable(t)){let l={},c,u;for(const d of t){if(!G.isArray(d))throw TypeError("Object iterator must return a key-value pair");l[u=d[0]]=(c=l[u])?G.isArray(c)?[...c,d[1]]:[c,d[1]]:d[1]}s(l,r)}else t!=null&&a(r,t,n);return this}get(t,r){if(t=vd(t),t){const n=G.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return uQ(i);if(G.isFunction(r))return r.call(this,i,n);if(G.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=vd(t),t){const n=G.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||dx(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function a(s){if(s=vd(s),s){const l=G.findKey(n,s);l&&(!r||dx(n,n[l],l,r))&&(delete n[l],i=!0)}}return G.isArray(t)?t.forEach(a):a(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const a=r[n];(!t||dx(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){const r=this,n={};return G.forEach(this,(i,a)=>{const s=G.findKey(n,a);if(s){r[s]=wp(i),delete r[a];return}const l=t?fQ(a):String(a).trim();l!==a&&delete r[a],r[l]=wp(i),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return G.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&G.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[dE]=this[dE]={accessors:{}}).accessors,i=this.prototype;function a(s){const l=vd(s);n[l]||(hQ(i,s),n[l]=!0)}return G.isArray(t)?t.forEach(a):a(t),this}};Qr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);G.reduceDescriptors(Qr.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});G.freezeMethods(Qr);function fx(e,t){const r=this||qh,n=t||r,i=Qr.from(n.headers);let a=n.data;return G.forEach(e,function(l){a=l.call(r,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function bM(e){return!!(e&&e.__CANCEL__)}function Bu(e,t,r){Me.call(this,e??"canceled",Me.ERR_CANCELED,t,r),this.name="CanceledError"}G.inherits(Bu,Me,{__CANCEL__:!0});function wM(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new Me("Request failed with status code "+r.status,[Me.ERR_BAD_REQUEST,Me.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function mQ(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function pQ(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,a=0,s;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=n[a];s||(s=u),r[i]=c,n[i]=u;let f=a,h=0;for(;f!==i;)h+=r[f++],f=f%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),u-s{r=d,i=null,a&&(clearTimeout(a),a=null),e.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-r;f>=n?s(u,d):(i=u,a||(a=setTimeout(()=>{a=null,s(i)},n-f)))},()=>i&&s(i)]}const xg=(e,t,r=3)=>{let n=0;const i=pQ(50,250);return gQ(a=>{const s=a.loaded,l=a.lengthComputable?a.total:void 0,c=s-n,u=i(c),d=s<=l;n=s;const f={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&d?(l-s)/u:void 0,event:a,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},r)},fE=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},hE=e=>(...t)=>G.asap(()=>e(...t)),yQ=Nr.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Nr.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Nr.origin),Nr.navigator&&/(msie|trident)/i.test(Nr.navigator.userAgent)):()=>!0,vQ=Nr.hasStandardBrowserEnv?{write(e,t,r,n,i,a){const s=[e+"="+encodeURIComponent(t)];G.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),G.isString(n)&&s.push("path="+n),G.isString(i)&&s.push("domain="+i),a===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function xQ(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function bQ(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function jM(e,t,r){let n=!xQ(t);return e&&(n||r==!1)?bQ(e,t):t}const mE=e=>e instanceof Qr?{...e}:e;function vl(e,t){t=t||{};const r={};function n(u,d,f,h){return G.isPlainObject(u)&&G.isPlainObject(d)?G.merge.call({caseless:h},u,d):G.isPlainObject(d)?G.merge({},d):G.isArray(d)?d.slice():d}function i(u,d,f,h){if(G.isUndefined(d)){if(!G.isUndefined(u))return n(void 0,u,f,h)}else return n(u,d,f,h)}function a(u,d){if(!G.isUndefined(d))return n(void 0,d)}function s(u,d){if(G.isUndefined(d)){if(!G.isUndefined(u))return n(void 0,u)}else return n(void 0,d)}function l(u,d,f){if(f in t)return n(u,d);if(f in e)return n(void 0,u)}const c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(u,d,f)=>i(mE(u),mE(d),f,!0)};return G.forEach(Object.keys(Object.assign({},e,t)),function(d){const f=c[d]||i,h=f(e[d],t[d],d);G.isUndefined(h)&&f!==l||(r[d]=h)}),r}const _M=e=>{const t=vl({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:l}=t;t.headers=s=Qr.from(s),t.url=yM(jM(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(G.isFormData(r)){if(Nr.hasStandardBrowserEnv||Nr.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){const[u,...d]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];s.setContentType([u||"multipart/form-data",...d].join("; "))}}if(Nr.hasStandardBrowserEnv&&(n&&G.isFunction(n)&&(n=n(t)),n||n!==!1&&yQ(t.url))){const u=i&&a&&vQ.read(a);u&&s.set(i,u)}return t},wQ=typeof XMLHttpRequest<"u",jQ=wQ&&function(e){return new Promise(function(r,n){const i=_M(e);let a=i.data;const s=Qr.from(i.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=i,d,f,h,m,y;function p(){m&&m(),y&&y(),i.cancelToken&&i.cancelToken.unsubscribe(d),i.signal&&i.signal.removeEventListener("abort",d)}let x=new XMLHttpRequest;x.open(i.method.toUpperCase(),i.url,!0),x.timeout=i.timeout;function g(){if(!x)return;const w=Qr.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),j={data:!l||l==="text"||l==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:w,config:e,request:x};wM(function(S){r(S),p()},function(S){n(S),p()},j),x=null}"onloadend"in x?x.onloadend=g:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(g)},x.onabort=function(){x&&(n(new Me("Request aborted",Me.ECONNABORTED,e,x)),x=null)},x.onerror=function(){n(new Me("Network Error",Me.ERR_NETWORK,e,x)),x=null},x.ontimeout=function(){let _=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const j=i.transitional||vM;i.timeoutErrorMessage&&(_=i.timeoutErrorMessage),n(new Me(_,j.clarifyTimeoutError?Me.ETIMEDOUT:Me.ECONNABORTED,e,x)),x=null},a===void 0&&s.setContentType(null),"setRequestHeader"in x&&G.forEach(s.toJSON(),function(_,j){x.setRequestHeader(j,_)}),G.isUndefined(i.withCredentials)||(x.withCredentials=!!i.withCredentials),l&&l!=="json"&&(x.responseType=i.responseType),u&&([h,y]=xg(u,!0),x.addEventListener("progress",h)),c&&x.upload&&([f,m]=xg(c),x.upload.addEventListener("progress",f),x.upload.addEventListener("loadend",m)),(i.cancelToken||i.signal)&&(d=w=>{x&&(n(!w||w.type?new Bu(null,e,x):w),x.abort(),x=null)},i.cancelToken&&i.cancelToken.subscribe(d),i.signal&&(i.signal.aborted?d():i.signal.addEventListener("abort",d)));const v=mQ(i.url);if(v&&Nr.protocols.indexOf(v)===-1){n(new Me("Unsupported protocol "+v+":",Me.ERR_BAD_REQUEST,e));return}x.send(a||null)})},_Q=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i;const a=function(u){if(!i){i=!0,l();const d=u instanceof Error?u:this.reason;n.abort(d instanceof Me?d:new Bu(d instanceof Error?d.message:d))}};let s=t&&setTimeout(()=>{s=null,a(new Me(`timeout ${t} of ms exceeded`,Me.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),e=null)};e.forEach(u=>u.addEventListener("abort",a));const{signal:c}=n;return c.unsubscribe=()=>G.asap(l),c}},NQ=function*(e,t){let r=e.byteLength;if(r{const i=SQ(e,t);let a=0,s,l=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await i.next();if(u){l(),c.close();return}let f=d.byteLength;if(r){let h=a+=f;r(h)}c.enqueue(new Uint8Array(d))}catch(u){throw l(u),u}},cancel(c){return l(c),i.return()}},{highWaterMark:2})},u0=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",NM=u0&&typeof ReadableStream=="function",EQ=u0&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),SM=(e,...t)=>{try{return!!e(...t)}catch{return!1}},OQ=NM&&SM(()=>{let e=!1;const t=new Request(Nr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),gE=64*1024,Dw=NM&&SM(()=>G.isReadableStream(new Response("").body)),bg={stream:Dw&&(e=>e.body)};u0&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!bg[t]&&(bg[t]=G.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new Me(`Response type '${t}' is not supported`,Me.ERR_NOT_SUPPORT,n)})})})(new Response);const AQ=async e=>{if(e==null)return 0;if(G.isBlob(e))return e.size;if(G.isSpecCompliantForm(e))return(await new Request(Nr.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(G.isArrayBufferView(e)||G.isArrayBuffer(e))return e.byteLength;if(G.isURLSearchParams(e)&&(e=e+""),G.isString(e))return(await EQ(e)).byteLength},PQ=async(e,t)=>{const r=G.toFiniteNumber(e.getContentLength());return r??AQ(t)},CQ=u0&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:a,timeout:s,onDownloadProgress:l,onUploadProgress:c,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:h}=_M(e);u=u?(u+"").toLowerCase():"text";let m=_Q([i,a&&a.toAbortSignal()],s),y;const p=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let x;try{if(c&&OQ&&r!=="get"&&r!=="head"&&(x=await PQ(d,n))!==0){let j=new Request(t,{method:"POST",body:n,duplex:"half"}),N;if(G.isFormData(n)&&(N=j.headers.get("content-type"))&&d.setContentType(N),j.body){const[S,E]=fE(x,xg(hE(c)));n=pE(j.body,gE,S,E)}}G.isString(f)||(f=f?"include":"omit");const g="credentials"in Request.prototype;y=new Request(t,{...h,signal:m,method:r.toUpperCase(),headers:d.normalize().toJSON(),body:n,duplex:"half",credentials:g?f:void 0});let v=await fetch(y,h);const w=Dw&&(u==="stream"||u==="response");if(Dw&&(l||w&&p)){const j={};["status","statusText","headers"].forEach(k=>{j[k]=v[k]});const N=G.toFiniteNumber(v.headers.get("content-length")),[S,E]=l&&fE(N,xg(hE(l),!0))||[];v=new Response(pE(v.body,gE,S,()=>{E&&E(),p&&p()}),j)}u=u||"text";let _=await bg[G.findKey(bg,u)||"text"](v,e);return!w&&p&&p(),await new Promise((j,N)=>{wM(j,N,{data:_,headers:Qr.from(v.headers),status:v.status,statusText:v.statusText,config:e,request:y})})}catch(g){throw p&&p(),g&&g.name==="TypeError"&&/Load failed|fetch/i.test(g.message)?Object.assign(new Me("Network Error",Me.ERR_NETWORK,e,y),{cause:g.cause||g}):Me.from(g,g&&g.code,e,y)}}),Lw={http:qX,xhr:jQ,fetch:CQ};G.forEach(Lw,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const yE=e=>`- ${e}`,TQ=e=>G.isFunction(e)||e===null||e===!1,kM={getAdapter:e=>{e=G.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let a=0;a`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=t?a.length>1?`since : `+a.map(yE).join(` `):" "+yE(a[0]):"as no adapter specified";throw new Me("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return n},adapters:Lw};function hx(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Bu(null,e)}function vE(e){return hx(e),e.headers=Qr.from(e.headers),e.data=fx.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),kM.getAdapter(e.adapter||qh.adapter)(e).then(function(n){return hx(e),n.data=fx.call(e,e.transformResponse,n),n.headers=Qr.from(n.headers),n},function(n){return bM(n)||(hx(e),n&&n.response&&(n.response.data=fx.call(e,e.transformResponse,n.response),n.response.headers=Qr.from(n.response.headers))),Promise.reject(n)})}const EM="1.10.0",d0={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{d0[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const xE={};d0.transitional=function(t,r,n){function i(a,s){return"[Axios v"+EM+"] Transitional option '"+a+"'"+s+(n?". "+n:"")}return(a,s,l)=>{if(t===!1)throw new Me(i(s," has been removed"+(r?" in "+r:"")),Me.ERR_DEPRECATED);return r&&!xE[s]&&(xE[s]=!0,console.warn(i(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,s,l):!0}};d0.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function $Q(e,t,r){if(typeof e!="object")throw new Me("options must be an object",Me.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],s=t[a];if(s){const l=e[a],c=l===void 0||s(l,a,e);if(c!==!0)throw new Me("option "+a+" must be "+c,Me.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Me("Unknown option "+a,Me.ERR_BAD_OPTION)}}const jp={assertOptions:$Q,validators:d0},_i=jp.validators;let Jo=class{constructor(t){this.defaults=t||{},this.interceptors={request:new uE,response:new uE}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=` `+a):n.stack=a}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=vl(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:a}=r;n!==void 0&&jp.assertOptions(n,{silentJSONParsing:_i.transitional(_i.boolean),forcedJSONParsing:_i.transitional(_i.boolean),clarifyTimeoutError:_i.transitional(_i.boolean)},!1),i!=null&&(G.isFunction(i)?r.paramsSerializer={serialize:i}:jp.assertOptions(i,{encode:_i.function,serialize:_i.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),jp.assertOptions(r,{baseUrl:_i.spelling("baseURL"),withXsrfToken:_i.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=a&&G.merge(a.common,a[r.method]);a&&G.forEach(["delete","get","head","post","put","patch","common"],y=>{delete a[y]}),r.headers=Qr.concat(s,a);const l=[];let c=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(r)===!1||(c=c&&p.synchronous,l.unshift(p.fulfilled,p.rejected))});const u=[];this.interceptors.response.forEach(function(p){u.push(p.fulfilled,p.rejected)});let d,f=0,h;if(!c){const y=[vE.bind(this),void 0];for(y.unshift.apply(y,l),y.push.apply(y,u),h=y.length,d=Promise.resolve(r);f{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a;const s=new Promise(l=>{n.subscribe(l),a=l}).then(i);return s.cancel=function(){n.unsubscribe(a)},s},t(function(a,s,l){n.reason||(n.reason=new Bu(a,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new OM(function(i){t=i}),cancel:t}}};function RQ(e){return function(r){return e.apply(null,r)}}function IQ(e){return G.isObject(e)&&e.isAxiosError===!0}const Fw={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Fw).forEach(([e,t])=>{Fw[t]=e});function AM(e){const t=new Jo(e),r=aM(Jo.prototype.request,t);return G.extend(r,Jo.prototype,t,{allOwnKeys:!0}),G.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return AM(vl(e,i))},r}const Dt=AM(qh);Dt.Axios=Jo;Dt.CanceledError=Bu;Dt.CancelToken=MQ;Dt.isCancel=bM;Dt.VERSION=EM;Dt.toFormData=c0;Dt.AxiosError=Me;Dt.Cancel=Dt.CanceledError;Dt.all=function(t){return Promise.all(t)};Dt.spread=RQ;Dt.isAxiosError=IQ;Dt.mergeConfig=vl;Dt.AxiosHeaders=Qr;Dt.formToJSON=e=>xM(G.isHTMLForm(e)?new FormData(e):e);Dt.getAdapter=kM.getAdapter;Dt.HttpStatusCode=Fw;Dt.default=Dt;const{Axios:sEe,AxiosError:oEe,CanceledError:lEe,isCancel:cEe,CancelToken:uEe,VERSION:dEe,all:fEe,Cancel:hEe,isAxiosError:mEe,spread:pEe,toFormData:gEe,AxiosHeaders:yEe,HttpStatusCode:vEe,formToJSON:xEe,getAdapter:bEe,mergeConfig:wEe}=Dt,Oe=Dt.create({baseURL:gl.baseURL,timeout:gl.timeout,headers:{"Content-Type":"application/json"}});Oe.interceptors.request.use(e=>{const t=localStorage.getItem("token");return t&&(e.headers.Authorization=`Bearer ${t}`),e},e=>Promise.reject(e));Oe.interceptors.response.use(e=>e,e=>{var t;return((t=e.response)==null?void 0:t.status)===401&&(localStorage.removeItem("token"),localStorage.removeItem("refresh_token"),window.location.href="/login"),Promise.reject(e)});const uc={getProjects:async()=>{const e=await Oe.get("/api/bzzz/active-repos");return e.data&&e.data.repositories?e.data.repositories.map(t=>({id:t.project_id,name:t.name,description:`${t.name} - ${t.owner}/${t.repository}`,status:t.ready_to_claim?"active":"inactive",git_url:t.git_url,owner:t.owner,repository:t.repository,branch:t.branch,bzzz_enabled:t.bzzz_enabled,ready_to_claim:t.ready_to_claim,private_repo:t.private_repo,github_token_required:t.github_token_required,created_at:new Date().toISOString(),updated_at:new Date().toISOString()})):[]},getProject:async e=>(await Oe.get(`/projects/${e}`)).data,createProject:async e=>(await Oe.post("/projects",e)).data,updateProject:async(e,t)=>(await Oe.put(`/projects/${e}`,t)).data,deleteProject:async e=>{await Oe.delete(`/projects/${e}`)},getProjectMetrics:async e=>(await Oe.get(`/projects/${e}/metrics`)).data,getProjectWorkflows:async e=>(await Oe.get(`/projects/${e}/workflows`)).data,getProjectExecutions:async e=>(await Oe.get(`/projects/${e}/executions`)).data},Ha={getExecutions:async()=>(await Oe.get("/executions")).data,getExecution:async e=>(await Oe.get(`/executions/${e}`)).data,cancelExecution:async e=>{await Oe.post(`/api/executions/${e}/cancel`)},retryExecution:async e=>(await Oe.post(`/api/executions/${e}/retry`)).data,pauseExecution:async e=>(await Oe.post(`/api/executions/${e}/pause`)).data,resumeExecution:async e=>(await Oe.post(`/api/executions/${e}/resume`)).data,getExecutionLogs:async e=>(await Oe.get(`/api/executions/${e}/logs`)).data,getExecutionSteps:async e=>(await Oe.get(`/api/executions/${e}/steps`)).data},Ul={getAgents:async()=>(await Oe.get("/api/agents")).data.agents||[],getAgentStatus:async e=>(await Oe.get(`/api/agents/${e}/status`)).data,registerAgent:async e=>(await Oe.post("/api/agents",e)).data,getCliAgents:async()=>(await Oe.get("/api/cli-agents/")).data,registerCliAgent:async e=>(await Oe.post("/api/cli-agents/register",e)).data,registerPredefinedCliAgents:async()=>(await Oe.post("/api/cli-agents/register-predefined")).data,healthCheckCliAgent:async e=>(await Oe.post(`/cli-agents/${e}/health-check`)).data,getCliAgentStatistics:async()=>(await Oe.get("/cli-agents/statistics/all")).data,unregisterCliAgent:async e=>(await Oe.delete(`/cli-agents/${e}`)).data},DQ={getStatus:async()=>(await Oe.get("/api/status")).data,getHealth:async()=>(await Oe.get("/api/health")).data,getMetrics:async()=>(await Oe.get("/api/metrics")).data,getConfig:async()=>(await Oe.get("/api/config")).data,updateConfig:async e=>(await Oe.put("/api/config",e)).data,getLogs:async e=>(await Oe.get("/api/logs",{params:e})).data,restart:async()=>(await Oe.post("/api/system/restart")).data,shutdown:async()=>(await Oe.post("/api/system/shutdown")).data},Gf={getOverview:async()=>(await Oe.get("/api/cluster/overview")).data,getNodes:async()=>(await Oe.get("/api/cluster/nodes")).data,getNode:async e=>(await Oe.get(`/api/cluster/nodes/${e}`)).data,getModels:async()=>(await Oe.get("/api/cluster/models")).data,getWorkflows:async()=>(await Oe.get("/api/cluster/workflows")).data,getMetrics:async()=>(await Oe.get("/api/cluster/metrics")).data,getExecutions:async(e=10)=>(await Oe.get(`/api/cluster/executions?limit=${e}`)).data,addNode:async e=>(await Oe.post("/api/cluster/nodes",e)).data,removeNode:async e=>(await Oe.delete(`/api/cluster/nodes/${e}`)).data,startNode:async e=>(await Oe.post(`/api/cluster/nodes/${e}/start`)).data,stopNode:async e=>(await Oe.post(`/api/cluster/nodes/${e}/stop`)).data,restartNode:async e=>(await Oe.post(`/api/cluster/nodes/${e}/restart`)).data};function LQ(){const[e,t]=b.useState(null),{data:r=[]}=$r({queryKey:["projects"],queryFn:()=>uc.getProjects(),select:c=>Array.isArray(c)?c:[]}),{data:n}=$r({queryKey:["cluster-overview"],queryFn:()=>Gf.getOverview()}),{data:i=[]}=$r({queryKey:["workflows"],queryFn:()=>Gf.getWorkflows(),select:c=>Array.isArray(c)?c:[]}),a=Array.isArray(r)?r:[],s=Array.isArray(i)?i:[],l={projects:{total:a.length,active:a.filter(c=>c.status==="active").length},workflows:{total:s.length,active:s.filter(c=>c.active).length},cluster:{total_nodes:(n==null?void 0:n.total_nodes)||0,active_nodes:(n==null?void 0:n.active_nodes)||0,total_models:(n==null?void 0:n.total_models)||0},executions:{recent:0,success_rate:.95}};return b.useEffect(()=>{const c=async()=>{try{const d=await DQ.getHealth();t(d)}catch(d){console.error("Failed to fetch system status:",d)}};c();const u=setInterval(c,3e4);return()=>clearInterval(u)},[]),o.jsxs("div",{className:"p-6",children:[o.jsx("div",{className:"mb-8",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Welcome to WHOOSH"}),o.jsx("p",{className:"text-gray-600 mt-2",children:"Monitor your distributed AI orchestration platform"})]}),o.jsxs("div",{className:"flex items-center space-x-2 bg-white rounded-lg border px-4 py-2",children:[o.jsx("div",{className:`w-3 h-3 rounded-full ${(e==null?void 0:e.status)==="healthy"?"bg-green-500":"bg-yellow-500"}`}),o.jsx("span",{className:"text-sm font-medium",children:(e==null?void 0:e.status)==="healthy"?"All Systems Operational":"System Initializing"})]})]})}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:[o.jsx(Ot,{to:"/projects",className:"group",children:o.jsxs("div",{className:"bg-white rounded-lg border p-6 hover:shadow-md transition-shadow",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsx("div",{className:"p-2 bg-blue-100 rounded-lg",children:o.jsx(Wf,{className:"h-6 w-6 text-blue-600"})}),o.jsxs("div",{className:"ml-4",children:[o.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[l.projects.active,"/",l.projects.total]}),o.jsx("p",{className:"text-sm text-gray-500",children:"Active Projects"})]})]}),o.jsxs("div",{className:"mt-4 flex items-center text-sm text-blue-600 group-hover:text-blue-800",children:[o.jsx("span",{children:"View all projects"}),o.jsx(lo,{className:"h-4 w-4 ml-1"})]})]})}),o.jsx(Ot,{to:"/workflows",className:"group",children:o.jsxs("div",{className:"bg-white rounded-lg border p-6 hover:shadow-md transition-shadow",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsx("div",{className:"p-2 bg-purple-100 rounded-lg",children:o.jsx(ml,{className:"h-6 w-6 text-purple-600"})}),o.jsxs("div",{className:"ml-4",children:[o.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[l.workflows.active,"/",l.workflows.total]}),o.jsx("p",{className:"text-sm text-gray-500",children:"Active Workflows"})]})]}),o.jsxs("div",{className:"mt-4 flex items-center text-sm text-purple-600 group-hover:text-purple-800",children:[o.jsx("span",{children:"Manage workflows"}),o.jsx(lo,{className:"h-4 w-4 ml-1"})]})]})}),o.jsx(Ot,{to:"/executions",className:"group",children:o.jsxs("div",{className:"bg-white rounded-lg border p-6 hover:shadow-md transition-shadow",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsx("div",{className:"p-2 bg-green-100 rounded-lg",children:o.jsx(hi,{className:"h-6 w-6 text-green-600"})}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:l.executions.recent}),o.jsx("p",{className:"text-sm text-gray-500",children:"Recent Executions"})]})]}),o.jsxs("div",{className:"mt-4 flex items-center text-sm text-green-600 group-hover:text-green-800",children:[o.jsxs("span",{children:[(l.executions.success_rate*100).toFixed(0),"% success rate"]}),o.jsx(lo,{className:"h-4 w-4 ml-1"})]})]})}),o.jsx(Ot,{to:"/cluster",className:"group",children:o.jsxs("div",{className:"bg-white rounded-lg border p-6 hover:shadow-md transition-shadow",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsx("div",{className:"p-2 bg-orange-100 rounded-lg",children:o.jsx(Ds,{className:"h-6 w-6 text-orange-600"})}),o.jsxs("div",{className:"ml-4",children:[o.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[l.cluster.active_nodes,"/",l.cluster.total_nodes]}),o.jsx("p",{className:"text-sm text-gray-500",children:"Active Nodes"})]})]}),o.jsxs("div",{className:"mt-4 flex items-center text-sm text-orange-600 group-hover:text-orange-800",children:[o.jsxs("span",{children:[l.cluster.total_models," models available"]}),o.jsx(lo,{className:"h-4 w-4 ml-1"})]})]})})]}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[o.jsxs("div",{className:"bg-white rounded-lg border p-6",children:[o.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Quick Actions"}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs(Ot,{to:"/projects/new",className:"flex items-center p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors",children:[o.jsx("div",{className:"p-2 bg-blue-100 rounded-lg",children:o.jsx(Sa,{className:"h-5 w-5 text-blue-600"})}),o.jsxs("div",{className:"ml-3",children:[o.jsx("p",{className:"font-medium text-gray-900",children:"Create New Project"}),o.jsx("p",{className:"text-sm text-gray-500",children:"Start organizing your workflows"})]}),o.jsx(lo,{className:"h-5 w-5 text-gray-400 ml-auto"})]}),o.jsxs(Ot,{to:"/workflows/new",className:"flex items-center p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors",children:[o.jsx("div",{className:"p-2 bg-purple-100 rounded-lg",children:o.jsx(ml,{className:"h-5 w-5 text-purple-600"})}),o.jsxs("div",{className:"ml-3",children:[o.jsx("p",{className:"font-medium text-gray-900",children:"Build Workflow"}),o.jsx("p",{className:"text-sm text-gray-500",children:"Design automation processes"})]}),o.jsx(lo,{className:"h-5 w-5 text-gray-400 ml-auto"})]}),o.jsxs(Ot,{to:"/cluster",className:"flex items-center p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors",children:[o.jsx("div",{className:"p-2 bg-orange-100 rounded-lg",children:o.jsx(Ds,{className:"h-5 w-5 text-orange-600"})}),o.jsxs("div",{className:"ml-3",children:[o.jsx("p",{className:"font-medium text-gray-900",children:"Monitor Cluster"}),o.jsx("p",{className:"text-sm text-gray-500",children:"View nodes and AI models"})]}),o.jsx(lo,{className:"h-5 w-5 text-gray-400 ml-auto"})]})]})]}),o.jsxs("div",{className:"bg-white rounded-lg border p-6",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Recent Activity"}),o.jsx(Ot,{to:"/activity",className:"text-sm text-blue-600 hover:text-blue-800",children:"View all"})]}),o.jsx("div",{className:"space-y-3",children:o.jsxs("div",{className:"text-center py-8 text-gray-500",children:[o.jsx(hr,{className:"h-8 w-8 mx-auto mb-2 text-gray-300"}),o.jsx("p",{className:"text-sm",children:"Recent activity will appear here"}),o.jsx("p",{className:"text-xs",children:"Activity from projects and workflows will be shown"})]})})]})]}),e&&e.status==="healthy"&&o.jsxs("div",{className:"mt-6 bg-white rounded-lg border p-6",children:[o.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"System Components"}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-3",children:[o.jsx("div",{className:"w-3 h-3 bg-green-500 rounded-full"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-gray-900",children:"API"}),o.jsx("p",{className:"text-xs text-gray-500",children:e.components.api})]})]}),o.jsxs("div",{className:"flex items-center space-x-3",children:[o.jsx("div",{className:"w-3 h-3 bg-green-500 rounded-full"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-gray-900",children:"Database"}),o.jsx("p",{className:"text-xs text-gray-500",children:e.components.database})]})]}),o.jsxs("div",{className:"flex items-center space-x-3",children:[o.jsx("div",{className:"w-3 h-3 bg-green-500 rounded-full"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-gray-900",children:"Coordinator"}),o.jsx("p",{className:"text-xs text-gray-500",children:e.components.coordinator})]})]})]})]})]})}function FQ(){const[e,t]=b.useState(!1),[r,n]=b.useState(!1),[i,a]=b.useState("ollama"),[s,l]=b.useState({name:"",endpoint:"",model:"",specialty:"general",max_concurrent:1}),[c,u]=b.useState({id:"",host:"",node_version:"",model:"gemini-2.5-pro",specialization:"general_ai",max_concurrent:2,command_timeout:60,ssh_timeout:5,agent_type:"gemini"}),{data:d=[],isLoading:f,error:h,refetch:m}=$r({queryKey:["agents"],queryFn:()=>Ul.getAgents(),refetchInterval:3e4,retry:2,retryDelay:1e3}),y=async A=>{var C;A.preventDefault();try{await((C=Ul.registerAgent)==null?void 0:C.call(Ul,s)),l({name:"",endpoint:"",model:"",specialty:"general",max_concurrent:1}),t(!1),m()}catch(P){console.error("Failed to register agent:",P)}},p=async A=>{A.preventDefault();try{await Ul.registerCliAgent(c),u({id:"",host:"",node_version:"",model:"gemini-2.5-pro",specialization:"general_ai",max_concurrent:2,command_timeout:60,ssh_timeout:5,agent_type:"gemini"}),n(!1),m()}catch(C){console.error("Failed to register CLI agent:",C)}},x=async()=>{try{await Ul.registerPredefinedCliAgents(),m()}catch(A){console.error("Failed to register predefined CLI agents:",A)}},g=A=>{switch(A){case"online":case"available":return o.jsx(dn,{className:"h-5 w-5 text-green-500"});case"busy":return o.jsx(hr,{className:"h-5 w-5 text-yellow-500 animate-pulse"});case"idle":return o.jsx(hr,{className:"h-5 w-5 text-blue-500"});case"offline":return o.jsx(Kr,{className:"h-5 w-5 text-red-500"});default:return o.jsx(Ls,{className:"h-5 w-5 text-gray-400"})}},v=A=>{switch(A){case"cli":return o.jsx(Si,{className:"h-5 w-5 text-purple-500"});case"ollama":default:return o.jsx(zd,{className:"h-5 w-5 text-blue-500"})}},w=A=>{const C="inline-flex items-center px-2 py-1 rounded text-xs font-medium";switch(A){case"cli":return`${C} bg-purple-100 text-purple-800`;case"ollama":default:return`${C} bg-blue-100 text-blue-800`}},_=A=>{const C="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium";switch(A){case"online":case"available":return`${C} bg-green-100 text-green-800`;case"busy":return`${C} bg-yellow-100 text-yellow-800`;case"idle":return`${C} bg-blue-100 text-blue-800`;case"offline":return`${C} bg-red-100 text-red-800`;default:return`${C} bg-gray-100 text-gray-800`}};if(f)return o.jsx("div",{className:"p-6",children:o.jsxs("div",{className:"animate-pulse",children:[o.jsx("div",{className:"h-8 bg-gray-200 rounded w-1/4 mb-6"}),o.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:[1,2,3].map(A=>o.jsx("div",{className:"h-64 bg-gray-200 rounded"},A))})]})});if(h)return o.jsxs("div",{className:"p-6",children:[o.jsx("div",{className:"mb-6",children:o.jsx("div",{className:"flex justify-between items-center",children:o.jsxs("div",{children:[o.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Agents"}),o.jsx("p",{className:"text-gray-600",children:"Manage AI agents in your distributed cluster"})]})})}),o.jsx("div",{className:"bg-white rounded-lg border p-8",children:o.jsxs("div",{className:"text-center",children:[o.jsx(Kr,{className:"h-16 w-16 text-red-500 mx-auto mb-4"}),o.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Unable to Load Agents"}),o.jsx("p",{className:"text-gray-600 mb-4",children:"There's a connectivity issue with the agent management service. Please check your connection and try again."}),o.jsxs("div",{className:"flex justify-center space-x-4",children:[o.jsxs("button",{onClick:()=>m(),className:"inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[o.jsx(Jq,{className:"h-4 w-4 mr-2"}),"Retry Connection"]}),o.jsxs("button",{onClick:x,className:"inline-flex items-center px-4 py-2 border border-purple-600 rounded-md text-sm font-medium text-purple-600 bg-white hover:bg-purple-50",children:[o.jsx(Si,{className:"h-4 w-4 mr-2"}),"Quick Setup CLI"]})]})]})})]});const j=Array.isArray(d)?d:[],N=j.filter(A=>A.status==="online"||A.status==="available").length;j.filter(A=>A.status==="busy").length;const S=j.filter(A=>!A.agent_type||A.agent_type==="ollama").length,E=j.filter(A=>A.agent_type==="cli").length,k=j.reduce((A,C)=>{var P;return A+(((P=C.metrics)==null?void 0:P.tasks_completed)||0)},0);return o.jsxs("div",{className:"p-6",children:[o.jsx("div",{className:"mb-6",children:o.jsxs("div",{className:"flex justify-between items-center",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Agents"}),o.jsx("p",{className:"text-gray-600",children:"Manage AI agents in your distributed cluster"})]}),o.jsxs("div",{className:"flex space-x-3",children:[o.jsxs("button",{onClick:x,className:"inline-flex items-center px-4 py-2 border border-purple-600 rounded-md text-sm font-medium text-purple-600 bg-white hover:bg-purple-50",children:[o.jsx(Si,{className:"h-4 w-4 mr-2"}),"Quick Setup CLI"]}),o.jsx("div",{className:"relative",children:o.jsxs("button",{onClick:()=>t(!0),className:"inline-flex items-center px-4 py-2 border border-transparent rounded-md text-sm font-medium text-white bg-blue-600 hover:bg-blue-700",children:[o.jsx(Sa,{className:"h-4 w-4 mr-2"}),"Register Agent",o.jsx(q2,{className:"h-4 w-4 ml-1"})]})})]})]})}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-6 mb-8",children:[o.jsx("div",{className:"bg-white rounded-lg border p-6",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(Ds,{className:"h-8 w-8 text-blue-500"}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:d.length}),o.jsx("p",{className:"text-sm text-gray-500",children:"Total Agents"})]})]})}),o.jsx("div",{className:"bg-white rounded-lg border p-6",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(zd,{className:"h-8 w-8 text-blue-500"}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:S}),o.jsx("p",{className:"text-sm text-gray-500",children:"Ollama Agents"})]})]})}),o.jsx("div",{className:"bg-white rounded-lg border p-6",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(Si,{className:"h-8 w-8 text-purple-500"}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:E}),o.jsx("p",{className:"text-sm text-gray-500",children:"CLI Agents"})]})]})}),o.jsx("div",{className:"bg-white rounded-lg border p-6",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(dn,{className:"h-8 w-8 text-green-500"}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:N}),o.jsx("p",{className:"text-sm text-gray-500",children:"Available"})]})]})}),o.jsx("div",{className:"bg-white rounded-lg border p-6",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(pl,{className:"h-8 w-8 text-indigo-500"}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:k}),o.jsx("p",{className:"text-sm text-gray-500",children:"Tasks Completed"})]})]})})]}),o.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:d.length===0?o.jsx("div",{className:"col-span-full",children:o.jsxs("div",{className:"text-center py-12 bg-white rounded-lg border",children:[o.jsx(Ds,{className:"h-16 w-16 text-gray-400 mx-auto mb-4"}),o.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"No Agents Registered"}),o.jsx("p",{className:"text-gray-600 mb-6",children:"Get started by registering your first AI agent. You can add Ollama or CLI-based agents to your cluster."}),o.jsxs("div",{className:"flex justify-center space-x-4",children:[o.jsxs("button",{onClick:x,className:"inline-flex items-center px-4 py-2 border border-purple-600 rounded-md text-sm font-medium text-purple-600 bg-white hover:bg-purple-50",children:[o.jsx(Si,{className:"h-4 w-4 mr-2"}),"Quick Setup CLI"]}),o.jsxs("button",{onClick:()=>t(!0),className:"inline-flex items-center px-4 py-2 border border-transparent rounded-md text-sm font-medium text-white bg-blue-600 hover:bg-blue-700",children:[o.jsx(Sa,{className:"h-4 w-4 mr-2"}),"Register Agent"]})]})]})}):d.map(A=>{var C;return o.jsxs("div",{className:"bg-white rounded-lg border p-6 hover:shadow-lg transition-shadow",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{className:"flex items-center space-x-3",children:[v(A.agent_type),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:A.name}),o.jsx("span",{className:w(A.agent_type),children:A.agent_type==="cli"?"⚡ CLI":"🤖 API"})]}),o.jsx("p",{className:"text-sm text-gray-500",children:A.specialty}),((C=A.cli_config)==null?void 0:C.host)&&o.jsxs("p",{className:"text-xs text-purple-600",children:["SSH: ",A.cli_config.host," (Node ",A.cli_config.node_version,")"]})]})]}),o.jsx("span",{className:_(A.status),children:A.status})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm text-gray-500",children:"Model"}),o.jsx("span",{className:"text-sm font-medium text-gray-900",children:A.model})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm text-gray-500",children:"Tasks"}),o.jsxs("span",{className:"text-sm font-medium text-gray-900",children:[A.current_tasks,"/",A.max_concurrent]})]}),A.metrics&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm text-gray-500",children:"Completed"}),o.jsx("span",{className:"text-sm font-medium text-gray-900",children:A.metrics.tasks_completed})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm text-gray-500",children:"Uptime"}),o.jsx("span",{className:"text-sm font-medium text-gray-900",children:A.metrics.uptime})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm text-gray-500",children:"Response Time"}),o.jsxs("span",{className:"text-sm font-medium text-gray-900",children:[A.metrics.response_time,"s"]})]})]})]}),A.capabilities&&A.capabilities.length>0&&o.jsxs("div",{className:"mt-4",children:[o.jsx("p",{className:"text-sm text-gray-500 mb-2",children:"Capabilities"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:A.capabilities.map(P=>o.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded text-xs bg-gray-100 text-gray-600",children:P},P))})]}),o.jsxs("div",{className:"mt-4 flex items-center space-x-2",children:[g(A.status),o.jsxs("span",{className:"text-sm text-gray-500",children:["Last seen: ",new Date(A.last_seen).toLocaleTimeString()]})]})]},A.id)})}),e&&o.jsx("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-50",children:o.jsx("div",{className:"relative top-10 mx-auto p-5 border w-[500px] shadow-lg rounded-md bg-white max-h-[90vh] overflow-y-auto",children:o.jsxs("div",{className:"mt-3",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Register New Agent"}),o.jsx("button",{onClick:()=>t(!1),className:"text-gray-400 hover:text-gray-600",children:o.jsx(Kr,{className:"h-6 w-6"})})]}),o.jsxs("div",{className:"flex space-x-1 mb-6 bg-gray-100 p-1 rounded-lg",children:[o.jsxs("button",{onClick:()=>a("ollama"),className:`flex-1 py-2 px-4 rounded-md text-sm font-medium transition-colors ${i==="ollama"?"bg-white text-blue-600 shadow":"text-gray-600 hover:text-gray-900"}`,children:[o.jsx(zd,{className:"h-4 w-4 inline mr-2"}),"Ollama Agent"]}),o.jsxs("button",{onClick:()=>a("cli"),className:`flex-1 py-2 px-4 rounded-md text-sm font-medium transition-colors ${i==="cli"?"bg-white text-purple-600 shadow":"text-gray-600 hover:text-gray-900"}`,children:[o.jsx(Si,{className:"h-4 w-4 inline mr-2"}),"CLI Agent"]})]}),i==="ollama"&&o.jsxs("form",{onSubmit:y,className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Agent Name"}),o.jsx("input",{type:"text",value:s.name,onChange:A=>l({...s,name:A.target.value}),className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2",placeholder:"e.g., WALNUT",required:!0})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Endpoint URL"}),o.jsx("input",{type:"url",value:s.endpoint,onChange:A=>l({...s,endpoint:A.target.value}),className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2",placeholder:"http://192.168.1.100:11434",required:!0})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Model"}),o.jsx("input",{type:"text",value:s.model,onChange:A=>l({...s,model:A.target.value}),className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2",placeholder:"deepseek-coder-v2:latest",required:!0})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Specialty"}),o.jsxs("select",{value:s.specialty,onChange:A=>l({...s,specialty:A.target.value}),className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2",children:[o.jsx("option",{value:"kernel_dev",children:"Kernel Development"}),o.jsx("option",{value:"pytorch_dev",children:"PyTorch Development"}),o.jsx("option",{value:"profiler",children:"Profiler"}),o.jsx("option",{value:"docs_writer",children:"Documentation"}),o.jsx("option",{value:"tester",children:"Testing"})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Max Concurrent Tasks"}),o.jsx("input",{type:"number",min:"1",max:"10",value:s.max_concurrent,onChange:A=>l({...s,max_concurrent:parseInt(A.target.value)}),className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2"})]}),o.jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[o.jsx("button",{type:"button",onClick:()=>t(!1),className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50",children:"Cancel"}),o.jsxs("button",{type:"submit",className:"px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md hover:bg-blue-700",children:[o.jsx(zd,{className:"h-4 w-4 inline mr-2"}),"Register Ollama Agent"]})]})]}),i==="cli"&&o.jsxs("form",{onSubmit:p,className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Agent ID"}),o.jsx("input",{type:"text",value:c.id,onChange:A=>u({...c,id:A.target.value}),className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2",placeholder:"e.g., walnut-gemini",required:!0})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"SSH Host"}),o.jsxs("select",{value:c.host,onChange:A=>u({...c,host:A.target.value}),className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2",required:!0,children:[o.jsx("option",{value:"",children:"Select host..."}),o.jsx("option",{value:"walnut",children:"WALNUT (192.168.1.27)"}),o.jsx("option",{value:"ironwood",children:"IRONWOOD (192.168.1.113)"})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Node.js Version"}),o.jsxs("select",{value:c.node_version,onChange:A=>u({...c,node_version:A.target.value}),className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2",required:!0,children:[o.jsx("option",{value:"",children:"Select version..."}),o.jsx("option",{value:"v22.14.0",children:"v22.14.0 (WALNUT)"}),o.jsx("option",{value:"v22.17.0",children:"v22.17.0 (IRONWOOD)"})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Model"}),o.jsxs("select",{value:c.model,onChange:A=>u({...c,model:A.target.value}),className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2",children:[o.jsx("option",{value:"gemini-2.5-pro",children:"Gemini 2.5 Pro"}),o.jsx("option",{value:"gemini-1.5-pro",children:"Gemini 1.5 Pro"})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Specialization"}),o.jsxs("select",{value:c.specialization,onChange:A=>u({...c,specialization:A.target.value}),className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2",children:[o.jsx("option",{value:"general_ai",children:"General AI"}),o.jsx("option",{value:"reasoning",children:"Advanced Reasoning"}),o.jsx("option",{value:"code_analysis",children:"Code Analysis"}),o.jsx("option",{value:"documentation",children:"Documentation"}),o.jsx("option",{value:"testing",children:"Testing"})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Max Concurrent"}),o.jsx("input",{type:"number",min:"1",max:"5",value:c.max_concurrent,onChange:A=>u({...c,max_concurrent:parseInt(A.target.value)}),className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Timeout (sec)"}),o.jsx("input",{type:"number",min:"30",max:"300",value:c.command_timeout,onChange:A=>u({...c,command_timeout:parseInt(A.target.value)}),className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2"})]})]}),o.jsx("div",{className:"bg-purple-50 p-3 rounded-md",children:o.jsxs("p",{className:"text-sm text-purple-700",children:[o.jsx(Si,{className:"h-4 w-4 inline mr-1"}),"CLI agents require SSH access to the target machine and Gemini CLI installation."]})}),o.jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[o.jsx("button",{type:"button",onClick:()=>t(!1),className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50",children:"Cancel"}),o.jsxs("button",{type:"submit",className:"px-4 py-2 text-sm font-medium text-white bg-purple-600 border border-transparent rounded-md hover:bg-purple-700",children:[o.jsx(Si,{className:"h-4 w-4 inline mr-2"}),"Register CLI Agent"]})]})]})]})})})]})}function BQ(){const[e,t]=b.useState("all"),[r,n]=b.useState(""),[i,a]=b.useState(null),[s,l]=b.useState(!1),{data:c=[],isLoading:u,error:d,refetch:f}=$r({queryKey:["executions"],queryFn:()=>Ha.getExecutions(),refetchInterval:5e3,retry:2,retryDelay:1e3}),h=async(_,j)=>{var N,S;try{j==="cancel"?await((N=Ha.cancelExecution)==null?void 0:N.call(Ha,_)):j==="retry"&&await((S=Ha.retryExecution)==null?void 0:S.call(Ha,_)),f()}catch(E){console.error(`Failed to ${j} execution:`,E)}},m=_=>{switch(_){case"completed":return o.jsx(dn,{className:"h-5 w-5 text-green-500"});case"failed":return o.jsx(Kr,{className:"h-5 w-5 text-red-500"});case"running":return o.jsx(hr,{className:"h-5 w-5 text-blue-500 animate-spin"});case"pending":return o.jsx(hr,{className:"h-5 w-5 text-yellow-500"});case"cancelled":return o.jsx(Kk,{className:"h-5 w-5 text-gray-500"});default:return o.jsx(Ls,{className:"h-5 w-5 text-gray-400"})}},y=_=>{const j="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium";switch(_){case"completed":return`${j} bg-green-100 text-green-800`;case"failed":return`${j} bg-red-100 text-red-800`;case"running":return`${j} bg-blue-100 text-blue-800`;case"pending":return`${j} bg-yellow-100 text-yellow-800`;case"cancelled":return`${j} bg-gray-100 text-gray-800`;default:return`${j} bg-gray-100 text-gray-800`}},p=_=>{const j=Math.floor(_/60),N=_%60;return`${j}m ${N}s`},x=c.filter(_=>{var S;const j=e==="all"||_.status===e,N=r===""||((S=_.workflow_name)==null?void 0:S.toLowerCase().includes(r.toLowerCase()))||_.id.toLowerCase().includes(r.toLowerCase());return j&&N}),g=c.filter(_=>_.status==="completed").length,v=c.filter(_=>_.status==="running").length,w=c.length>0?Math.round(g/c.length*100):0;return u?o.jsx("div",{className:"p-6",children:o.jsxs("div",{className:"animate-pulse",children:[o.jsx("div",{className:"h-8 bg-gray-200 rounded w-1/4 mb-6"}),o.jsx("div",{className:"h-64 bg-gray-200 rounded"})]})}):d?o.jsxs("div",{className:"p-6",children:[o.jsxs("div",{className:"mb-6",children:[o.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Executions"}),o.jsx("p",{className:"text-gray-600",children:"Monitor and manage workflow executions"})]}),o.jsx("div",{className:"bg-white rounded-lg border p-8",children:o.jsxs("div",{className:"text-center",children:[o.jsx(Kr,{className:"h-16 w-16 text-red-500 mx-auto mb-4"}),o.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Unable to Load Executions"}),o.jsx("p",{className:"text-gray-600 mb-4",children:"There's a connectivity issue with the execution service. Please check your connection and try again."}),o.jsxs("button",{onClick:()=>f(),className:"inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[o.jsx(fg,{className:"h-4 w-4 mr-2"}),"Retry Connection"]})]})})]}):o.jsxs("div",{className:"p-6",children:[o.jsxs("div",{className:"mb-6",children:[o.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Executions"}),o.jsx("p",{className:"text-gray-600",children:"Monitor and manage workflow executions"})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:[o.jsx("div",{className:"bg-white rounded-lg border p-6",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(hi,{className:"h-8 w-8 text-blue-500"}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:c.length}),o.jsx("p",{className:"text-sm text-gray-500",children:"Total Executions"})]})]})}),o.jsx("div",{className:"bg-white rounded-lg border p-6",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(dn,{className:"h-8 w-8 text-green-500"}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:g}),o.jsx("p",{className:"text-sm text-gray-500",children:"Completed"})]})]})}),o.jsx("div",{className:"bg-white rounded-lg border p-6",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(hr,{className:"h-8 w-8 text-yellow-500"}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:v}),o.jsx("p",{className:"text-sm text-gray-500",children:"Running"})]})]})}),o.jsx("div",{className:"bg-white rounded-lg border p-6",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(Kr,{className:"h-8 w-8 text-red-500"}),o.jsxs("div",{className:"ml-4",children:[o.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[w,"%"]}),o.jsx("p",{className:"text-sm text-gray-500",children:"Success Rate"})]})]})})]}),o.jsx("div",{className:"bg-white rounded-lg border p-6 mb-6",children:o.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(G2,{className:"h-5 w-5 text-gray-400"}),o.jsxs("select",{value:e,onChange:_=>t(_.target.value),className:"border border-gray-300 rounded-md px-3 py-2 text-sm",children:[o.jsx("option",{value:"all",children:"All Status"}),o.jsx("option",{value:"completed",children:"Completed"}),o.jsx("option",{value:"running",children:"Running"}),o.jsx("option",{value:"failed",children:"Failed"}),o.jsx("option",{value:"pending",children:"Pending"}),o.jsx("option",{value:"cancelled",children:"Cancelled"})]})]}),o.jsxs("div",{className:"flex items-center space-x-2 flex-1",children:[o.jsx(r0,{className:"h-5 w-5 text-gray-400"}),o.jsx("input",{type:"text",placeholder:"Search executions...",value:r,onChange:_=>n(_.target.value),className:"flex-1 border border-gray-300 rounded-md px-3 py-2 text-sm"})]})]})}),o.jsx("div",{className:"bg-white rounded-lg border overflow-hidden",children:c.length===0?o.jsxs("div",{className:"text-center py-12",children:[o.jsx(hr,{className:"h-16 w-16 text-gray-400 mx-auto mb-4"}),o.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"No Executions Found"}),o.jsx("p",{className:"text-gray-600",children:"No workflow executions have been started yet. Create and run a workflow to see executions here."})]}):o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[o.jsx("thead",{className:"bg-gray-50",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Execution"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Workflow"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Agent"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Duration"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Started"}),o.jsx("th",{className:"relative px-6 py-3",children:o.jsx("span",{className:"sr-only",children:"Actions"})})]})}),o.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:x.map(_=>o.jsxs("tr",{className:"hover:bg-gray-50",children:[o.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:o.jsxs("div",{className:"flex items-center",children:[m(_.status),o.jsx("div",{className:"ml-3",children:o.jsx("div",{className:"text-sm font-medium text-gray-900",children:_.id})})]})}),o.jsxs("td",{className:"px-6 py-4 whitespace-nowrap",children:[o.jsx("div",{className:"text-sm font-medium text-gray-900",children:_.workflow_name}),o.jsx("div",{className:"text-sm text-gray-500",children:_.workflow_id})]}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:o.jsx("span",{className:y(_.status),children:_.status})}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:_.agent_id||"-"}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:_.duration?p(_.duration):"-"}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:kc(new Date(_.started_at),{addSuffix:!0})}),o.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium space-x-2",children:[o.jsx("button",{onClick:()=>{a(_),l(!0)},className:"text-blue-600 hover:text-blue-900",children:o.jsx(K2,{className:"h-4 w-4"})}),_.status==="running"&&o.jsx("button",{onClick:()=>h(_.id,"cancel"),className:"text-red-600 hover:text-red-900",children:o.jsx(Kk,{className:"h-4 w-4"})}),(_.status==="failed"||_.status==="cancelled")&&o.jsx("button",{onClick:()=>h(_.id,"retry"),className:"text-green-600 hover:text-green-900",children:o.jsx(fg,{className:"h-4 w-4"})})]})]},_.id))})]})})}),s&&i&&o.jsx("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-50",children:o.jsx("div",{className:"relative top-20 mx-auto p-5 border w-3/4 max-w-4xl shadow-lg rounded-md bg-white",children:o.jsxs("div",{className:"mt-3",children:[o.jsxs("div",{className:"flex justify-between items-center mb-4",children:[o.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Execution Details"}),o.jsx("button",{onClick:()=>l(!1),className:"text-gray-400 hover:text-gray-600",children:o.jsx(Kr,{className:"h-6 w-6"})})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-md font-medium text-gray-900 mb-2",children:"Basic Information"}),o.jsxs("dl",{className:"space-y-2",children:[o.jsxs("div",{children:[o.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Execution ID"}),o.jsx("dd",{className:"text-sm text-gray-900",children:i.id})]}),o.jsxs("div",{children:[o.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Workflow"}),o.jsx("dd",{className:"text-sm text-gray-900",children:i.workflow_name})]}),o.jsxs("div",{children:[o.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Status"}),o.jsx("dd",{children:o.jsx("span",{className:y(i.status),children:i.status})})]}),o.jsxs("div",{children:[o.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Agent"}),o.jsx("dd",{className:"text-sm text-gray-900",children:i.agent_id||"Not assigned"})]})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-md font-medium text-gray-900 mb-2",children:"Timing"}),o.jsxs("dl",{className:"space-y-2",children:[o.jsxs("div",{children:[o.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Started"}),o.jsx("dd",{className:"text-sm text-gray-900",children:sf(new Date(i.started_at),"PPp")})]}),i.completed_at&&o.jsxs("div",{children:[o.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Completed"}),o.jsx("dd",{className:"text-sm text-gray-900",children:sf(new Date(i.completed_at),"PPp")})]}),i.duration&&o.jsxs("div",{children:[o.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Duration"}),o.jsx("dd",{className:"text-sm text-gray-900",children:p(i.duration)})]})]})]})]}),i.error&&o.jsxs("div",{className:"mt-6",children:[o.jsx("h4",{className:"text-md font-medium text-red-900 mb-2",children:"Error Details"}),o.jsx("div",{className:"bg-red-50 border border-red-200 rounded-md p-3",children:o.jsx("p",{className:"text-sm text-red-800",children:i.error})})]}),i.output&&o.jsxs("div",{className:"mt-6",children:[o.jsx("h4",{className:"text-md font-medium text-gray-900 mb-2",children:"Output"}),o.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-md p-3",children:o.jsx("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:JSON.stringify(i.output,null,2)})})]})]})})})]})}function PM(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}var Fee=Lee,Bee=h0;function zee(e,t){var r=this.__data__,n=Bee(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Uee=zee,Wee=See,Vee=$ee,Hee=Iee,qee=Fee,Kee=Uee;function Vu(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},Mo=function(t){return xl(t)&&t.indexOf("%")===t.length-1},re=function(t){return hre(t)&&!qu(t)},yre=function(t){return Ae(t)},Jt=function(t){return re(t)||xl(t)},vre=0,Cl=function(t){var r=++vre;return"".concat(t||"").concat(r)},Rr=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!re(t)&&!xl(t))return n;var a;if(Mo(t)){var s=t.indexOf("%");a=r*parseFloat(t.slice(0,s))/100}else a=+t;return qu(a)&&(a=n),i&&a>r&&(a=r),a},ss=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},xre=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function zw(e){"@babel/helpers - typeof";return zw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zw(e)}var CE={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},pa=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},TE=null,gx=null,g_=function e(t){if(t===TE&&Array.isArray(gx))return gx;var r=[];return b.Children.forEach(t,function(n){Ae(n)||(lre.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),gx=r,TE=t,r};function hn(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return pa(i)}):n=[pa(t)],g_(e).forEach(function(i){var a=fn(i,"type.displayName")||fn(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function sn(e,t){var r=hn(e,t);return r&&r[0]}var $E=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!re(n)||n<=0||!re(i)||i<=0)},Ere=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Ore=function(t){return t&&t.type&&xl(t.type)&&Ere.indexOf(t.type)>=0},WM=function(t){return t&&zw(t)==="object"&&"clipDot"in t},Are=function(t,r,n,i){var a,s=(a=px==null?void 0:px[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!ke(t)&&(i&&s.includes(r)||jre.includes(r))||n&&p_.includes(r)},we=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(b.isValidElement(t)&&(i=t.props),!Uu(i))return null;var a={};return Object.keys(i).forEach(function(s){var l;Are((l=i)===null||l===void 0?void 0:l[s],s,r,n)&&(a[s]=i[s])}),a},Uw=function e(t,r){if(t===r)return!0;var n=b.Children.count(t);if(n!==b.Children.count(r))return!1;if(n===0)return!0;if(n===1)return ME(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Mre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Vw(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,s=e.style,l=e.title,c=e.desc,u=$re(e,Tre),d=i||{width:r,height:n,x:0,y:0},f=$e("recharts-surface",a);return T.createElement("svg",Ww({},we(u,!0,"svg"),{className:f,width:r,height:n,style:s,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),T.createElement("title",null,l),T.createElement("desc",null,c),t)}var Rre=["children","className"];function Hw(){return Hw=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Dre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Be=T.forwardRef(function(e,t){var r=e.children,n=e.className,i=Ire(e,Rre),a=$e("recharts-layer",n);return T.createElement("g",Hw({className:a},we(i,!0),{ref:t}),r)}),mi=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=n?e:Bre(e,t,r)}var Ure=zre,Wre="\\ud800-\\udfff",Vre="\\u0300-\\u036f",Hre="\\ufe20-\\ufe2f",qre="\\u20d0-\\u20ff",Kre=Vre+Hre+qre,Gre="\\ufe0e\\ufe0f",Yre="\\u200d",Zre=RegExp("["+Yre+Wre+Kre+Gre+"]");function Xre(e){return Zre.test(e)}var VM=Xre;function Qre(e){return e.split("")}var Jre=Qre,HM="\\ud800-\\udfff",ene="\\u0300-\\u036f",tne="\\ufe20-\\ufe2f",rne="\\u20d0-\\u20ff",nne=ene+tne+rne,ine="\\ufe0e\\ufe0f",ane="["+HM+"]",qw="["+nne+"]",Kw="\\ud83c[\\udffb-\\udfff]",sne="(?:"+qw+"|"+Kw+")",qM="[^"+HM+"]",KM="(?:\\ud83c[\\udde6-\\uddff]){2}",GM="[\\ud800-\\udbff][\\udc00-\\udfff]",one="\\u200d",YM=sne+"?",ZM="["+ine+"]?",lne="(?:"+one+"(?:"+[qM,KM,GM].join("|")+")"+ZM+YM+")*",cne=ZM+YM+lne,une="(?:"+[qM+qw+"?",qw,KM,GM,ane].join("|")+")",dne=RegExp(Kw+"(?="+Kw+")|"+une+cne,"g");function fne(e){return e.match(dne)||[]}var hne=fne,mne=Jre,pne=VM,gne=hne;function yne(e){return pne(e)?gne(e):mne(e)}var vne=yne,xne=Ure,bne=VM,wne=vne,jne=DM;function _ne(e){return function(t){t=jne(t);var r=bne(t)?wne(t):void 0,n=r?r[0]:t.charAt(0),i=r?xne(r,1).join(""):t.slice(1);return n[e]()+i}}var Nne=_ne,Sne=Nne,kne=Sne("toUpperCase"),Ene=kne;const E0=Xe(Ene);function lt(e){return function(){return e}}const XM=Math.cos,_g=Math.sin,xi=Math.sqrt,Ng=Math.PI,O0=2*Ng,Gw=Math.PI,Yw=2*Gw,xo=1e-6,One=Yw-xo;function QM(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return QM;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;ixo)if(!(Math.abs(f*c-u*d)>xo)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let m=n-s,y=i-l,p=c*c+u*u,x=m*m+y*y,g=Math.sqrt(p),v=Math.sqrt(h),w=a*Math.tan((Gw-Math.acos((p+h-x)/(2*g*v)))/2),_=w/v,j=w/g;Math.abs(_-1)>xo&&this._append`L${t+_*d},${r+_*f}`,this._append`A${a},${a},0,0,${+(f*m>d*y)},${this._x1=t+j*c},${this._y1=r+j*u}`}}arc(t,r,n,i,a,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),c=n*Math.sin(i),u=t+l,d=r+c,f=1^s,h=s?i-a:a-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>xo||Math.abs(this._y1-d)>xo)&&this._append`L${u},${d}`,n&&(h<0&&(h=h%Yw+Yw),h>One?this._append`A${n},${n},0,1,${f},${t-l},${r-c}A${n},${n},0,1,${f},${this._x1=u},${this._y1=d}`:h>xo&&this._append`A${n},${n},0,${+(h>=Gw)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function y_(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new Pne(t)}function v_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function JM(e){this._context=e}JM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function A0(e){return new JM(e)}function eR(e){return e[0]}function tR(e){return e[1]}function rR(e,t){var r=lt(!0),n=null,i=A0,a=null,s=y_(l);e=typeof e=="function"?e:e===void 0?eR:lt(e),t=typeof t=="function"?t:t===void 0?tR:lt(t);function l(c){var u,d=(c=v_(c)).length,f,h=!1,m;for(n==null&&(a=i(m=s())),u=0;u<=d;++u)!(u=m;--y)l.point(w[y],_[y]);l.lineEnd(),l.areaEnd()}g&&(w[h]=+e(x,h,f),_[h]=+t(x,h,f),l.point(n?+n(x,h,f):w[h],r?+r(x,h,f):_[h]))}if(v)return l=null,v+""||null}function d(){return rR().defined(i).curve(s).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:lt(+f),n=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:lt(+f),u):e},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:lt(+f),u):n},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:lt(+f),r=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:lt(+f),u):t},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:lt(+f),u):r},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(r)},u.lineX1=function(){return d().x(n).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:lt(!!f),u):i},u.curve=function(f){return arguments.length?(s=f,a!=null&&(l=s(a)),u):s},u.context=function(f){return arguments.length?(f==null?a=l=null:l=s(a=f),u):a},u}class nR{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Cne(e){return new nR(e,!0)}function Tne(e){return new nR(e,!1)}const x_={draw(e,t){const r=xi(t/Ng);e.moveTo(r,0),e.arc(0,0,r,0,O0)}},$ne={draw(e,t){const r=xi(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},iR=xi(1/3),Mne=iR*2,Rne={draw(e,t){const r=xi(t/Mne),n=r*iR;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Ine={draw(e,t){const r=xi(t),n=-r/2;e.rect(n,n,r,r)}},Dne=.8908130915292852,aR=_g(Ng/10)/_g(7*Ng/10),Lne=_g(O0/10)*aR,Fne=-XM(O0/10)*aR,Bne={draw(e,t){const r=xi(t*Dne),n=Lne*r,i=Fne*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const s=O0*a/5,l=XM(s),c=_g(s);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*i,c*n+l*i)}e.closePath()}},yx=xi(3),zne={draw(e,t){const r=-xi(t/(yx*3));e.moveTo(0,r*2),e.lineTo(-yx*r,-r),e.lineTo(yx*r,-r),e.closePath()}},jn=-.5,_n=xi(3)/2,Zw=1/xi(12),Une=(Zw/2+1)*3,Wne={draw(e,t){const r=xi(t/Une),n=r/2,i=r*Zw,a=n,s=r*Zw+r,l=-a,c=s;e.moveTo(n,i),e.lineTo(a,s),e.lineTo(l,c),e.lineTo(jn*n-_n*i,_n*n+jn*i),e.lineTo(jn*a-_n*s,_n*a+jn*s),e.lineTo(jn*l-_n*c,_n*l+jn*c),e.lineTo(jn*n+_n*i,jn*i-_n*n),e.lineTo(jn*a+_n*s,jn*s-_n*a),e.lineTo(jn*l+_n*c,jn*c-_n*l),e.closePath()}};function Vne(e,t){let r=null,n=y_(i);e=typeof e=="function"?e:lt(e||x_),t=typeof t=="function"?t:lt(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:lt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:lt(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function Sg(){}function kg(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function sR(e){this._context=e}sR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:kg(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:kg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Hne(e){return new sR(e)}function oR(e){this._context=e}oR.prototype={areaStart:Sg,areaEnd:Sg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:kg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qne(e){return new oR(e)}function lR(e){this._context=e}lR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:kg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Kne(e){return new lR(e)}function cR(e){this._context=e}cR.prototype={areaStart:Sg,areaEnd:Sg,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Gne(e){return new cR(e)}function IE(e){return e<0?-1:1}function DE(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),s=(r-e._y1)/(i||n<0&&-0),l=(a*i+s*n)/(n+i);return(IE(a)+IE(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(l))||0}function LE(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function vx(e,t,r){var n=e._x0,i=e._y0,a=e._x1,s=e._y1,l=(a-n)/3;e._context.bezierCurveTo(n+l,i+l*t,a-l,s-l*r,a,s)}function Eg(e){this._context=e}Eg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:vx(this,this._t0,LE(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,vx(this,LE(this,r=DE(this,e,t)),r);break;default:vx(this,this._t0,r=DE(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function uR(e){this._context=new dR(e)}(uR.prototype=Object.create(Eg.prototype)).point=function(e,t){Eg.prototype.point.call(this,t,e)};function dR(e){this._context=e}dR.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function Yne(e){return new Eg(e)}function Zne(e){return new uR(e)}function fR(e){this._context=e}fR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=FE(e),i=FE(t),a=0,s=1;s=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Qne(e){return new P0(e,.5)}function Jne(e){return new P0(e,0)}function eie(e){return new P0(e,1)}function Jc(e,t){if((s=e.length)>1)for(var r=1,n,i,a=e[t[0]],s,l=a.length;r=0;)r[t]=t;return r}function tie(e,t){return e[t]}function rie(e){const t=[];return t.key=e,t}function nie(){var e=lt([]),t=Xw,r=Jc,n=tie;function i(a){var s=Array.from(e.apply(this,arguments),rie),l,c=s.length,u=-1,d;for(const f of a)for(l=0,++u;l0){for(var r,n,i=0,a=e[0].length,s;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,s;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function fie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var hR={symbolCircle:x_,symbolCross:$ne,symbolDiamond:Rne,symbolSquare:Ine,symbolStar:Bne,symbolTriangle:zne,symbolWye:Wne},hie=Math.PI/180,mie=function(t){var r="symbol".concat(E0(t));return hR[r]||x_},pie=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*hie;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},gie=function(t,r){hR["symbol".concat(E0(t))]=r},b_=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,s=t.sizeType,l=s===void 0?"area":s,c=die(t,oie),u=zE(zE({},c),{},{type:n,size:a,sizeType:l}),d=function(){var x=mie(n),g=Vne().type(x).size(pie(a,l,n));return g()},f=u.className,h=u.cx,m=u.cy,y=we(u,!0);return h===+h&&m===+m&&a===+a?T.createElement("path",Qw({},y,{className:$e("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(m,")"),d:d()})):null};b_.registerSymbol=gie;function eu(e){"@babel/helpers - typeof";return eu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eu(e)}function Jw(){return Jw=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var v=m.inactive?u:m.color;return T.createElement("li",Jw({className:x,style:f,key:"legend-item-".concat(y)},bl(n.props,m,y)),T.createElement(Vw,{width:s,height:s,viewBox:d,style:h},n.renderIcon(m)),T.createElement("span",{className:"recharts-legend-item-text",style:{color:v}},p?p(g,m,y):g))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,s=n.align;if(!i||!i.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?s:"left"};return T.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(b.PureComponent);Zf(w_,"displayName","Legend");Zf(w_,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var kie=m0;function Eie(){this.__data__=new kie,this.size=0}var Oie=Eie;function Aie(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Pie=Aie;function Cie(e){return this.__data__.get(e)}var Tie=Cie;function $ie(e){return this.__data__.has(e)}var Mie=$ie,Rie=m0,Iie=l_,Die=c_,Lie=200;function Fie(e,t){var r=this.__data__;if(r instanceof Rie){var n=r.__data__;if(!Iie||n.lengthl))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,m=r&oae?new nae:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=dse}var S_=fse,hse=Ma,mse=S_,pse=Ra,gse="[object Arguments]",yse="[object Array]",vse="[object Boolean]",xse="[object Date]",bse="[object Error]",wse="[object Function]",jse="[object Map]",_se="[object Number]",Nse="[object Object]",Sse="[object RegExp]",kse="[object Set]",Ese="[object String]",Ose="[object WeakMap]",Ase="[object ArrayBuffer]",Pse="[object DataView]",Cse="[object Float32Array]",Tse="[object Float64Array]",$se="[object Int8Array]",Mse="[object Int16Array]",Rse="[object Int32Array]",Ise="[object Uint8Array]",Dse="[object Uint8ClampedArray]",Lse="[object Uint16Array]",Fse="[object Uint32Array]",pt={};pt[Cse]=pt[Tse]=pt[$se]=pt[Mse]=pt[Rse]=pt[Ise]=pt[Dse]=pt[Lse]=pt[Fse]=!0;pt[gse]=pt[yse]=pt[Ase]=pt[vse]=pt[Pse]=pt[xse]=pt[bse]=pt[wse]=pt[jse]=pt[_se]=pt[Nse]=pt[Sse]=pt[kse]=pt[Ese]=pt[Ose]=!1;function Bse(e){return pse(e)&&mse(e.length)&&!!pt[hse(e)]}var zse=Bse;function Use(e){return function(t){return e(t)}}var NR=Use,Cg={exports:{}};Cg.exports;(function(e,t){var r=CM,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,s=a&&r.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();e.exports=l})(Cg,Cg.exports);var Wse=Cg.exports,Vse=zse,Hse=NR,GE=Wse,YE=GE&&GE.isTypedArray,qse=YE?Hse(YE):Vse,SR=qse,Kse=Zae,Gse=__,Yse=Jr,Zse=_R,Xse=N_,Qse=SR,Jse=Object.prototype,eoe=Jse.hasOwnProperty;function toe(e,t){var r=Yse(e),n=!r&&Gse(e),i=!r&&!n&&Zse(e),a=!r&&!n&&!i&&Qse(e),s=r||n||i||a,l=s?Kse(e.length,String):[],c=l.length;for(var u in e)(t||eoe.call(e,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Xse(u,c)))&&l.push(u);return l}var roe=toe,noe=Object.prototype;function ioe(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||noe;return e===r}var aoe=ioe;function soe(e,t){return function(r){return e(t(r))}}var kR=soe,ooe=kR,loe=ooe(Object.keys,Object),coe=loe,uoe=aoe,doe=coe,foe=Object.prototype,hoe=foe.hasOwnProperty;function moe(e){if(!uoe(e))return doe(e);var t=[];for(var r in Object(e))hoe.call(e,r)&&r!="constructor"&&t.push(r);return t}var poe=moe,goe=s_,yoe=S_;function voe(e){return e!=null&&yoe(e.length)&&!goe(e)}var Gh=voe,xoe=roe,boe=poe,woe=Gh;function joe(e){return woe(e)?xoe(e):boe(e)}var C0=joe,_oe=Lae,Noe=Gae,Soe=C0;function koe(e){return _oe(e,Soe,Noe)}var Eoe=koe,ZE=Eoe,Ooe=1,Aoe=Object.prototype,Poe=Aoe.hasOwnProperty;function Coe(e,t,r,n,i,a){var s=r&Ooe,l=ZE(e),c=l.length,u=ZE(t),d=u.length;if(c!=d&&!s)return!1;for(var f=c;f--;){var h=l[f];if(!(s?h in t:Poe.call(t,h)))return!1}var m=a.get(e),y=a.get(t);if(m&&y)return m==t&&y==e;var p=!0;a.set(e,t),a.set(t,e);for(var x=s;++f-1}var Ace=Oce;function Pce(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=Hce){var u=t?null:Wce(e);if(u)return Vce(u);s=!1,i=Uce,c=new Fce}else c=t?[]:l;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function oue(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function lue(e){return e.value}function cue(e,t){if(T.isValidElement(e))return T.cloneElement(e,t);if(typeof e=="function")return T.createElement(e,t);t.ref;var r=sue(t,Qce);return T.createElement(w_,r)}var fO=1,Us=function(e){function t(){var r;Jce(this,t);for(var n=arguments.length,i=new Array(n),a=0;afO||Math.abs(i.height-this.lastBoundingBox.height)>fO)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Zi({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,s=i.align,l=i.verticalAlign,c=i.margin,u=i.chartWidth,d=i.chartHeight,f,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(s==="center"&&a==="vertical"){var m=this.getBBoxSnapshot();f={left:((u||0)-m.width)/2}}else f=s==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var y=this.getBBoxSnapshot();h={top:((d||0)-y.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Zi(Zi({},f),h)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,s=i.width,l=i.height,c=i.wrapperStyle,u=i.payloadUniqBy,d=i.payload,f=Zi(Zi({position:"absolute",width:s||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return T.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(m){n.wrapperNode=m}},cue(a,Zi(Zi({},this.props),{},{payload:$R(d,u,lue)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Zi(Zi({},this.defaultProps),n.props),s=a.layout;return s==="vertical"&&re(n.props.height)?{height:n.props.height}:s==="horizontal"?{width:n.props.width||i}:null}}])}(b.PureComponent);T0(Us,"displayName","Legend");T0(Us,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var hO=Kh,uue=__,due=Jr,mO=hO?hO.isConcatSpreadable:void 0;function fue(e){return due(e)||uue(e)||!!(mO&&e&&e[mO])}var hue=fue,mue=wR,pue=hue;function IR(e,t,r,n,i){var a=-1,s=e.length;for(r||(r=pue),i||(i=[]);++a0&&r(l)?t>1?IR(l,t-1,r,n,i):mue(i,l):n||(i[i.length]=l)}return i}var DR=IR;function gue(e){return function(t,r,n){for(var i=-1,a=Object(t),s=n(t),l=s.length;l--;){var c=s[e?l:++i];if(r(a[c],c,a)===!1)break}return t}}var yue=gue,vue=yue,xue=vue(),bue=xue,wue=bue,jue=C0;function _ue(e,t){return e&&wue(e,t,jue)}var LR=_ue,Nue=Gh;function Sue(e,t){return function(r,n){if(r==null)return r;if(!Nue(r))return e(r,n);for(var i=r.length,a=t?i:-1,s=Object(r);(t?a--:++at||a&&s&&c&&!l&&!u||n&&s&&c||!r&&c||!i)return 1;if(!n&&!a&&!u&&e=l)return c;var u=r[n];return c*(u=="desc"?-1:1)}}return e.index-t.index}var Fue=Lue,jx=d_,Bue=f_,zue=qi,Uue=FR,Wue=Mue,Vue=NR,Hue=Fue,que=Yu,Kue=Jr;function Gue(e,t,r){t.length?t=jx(t,function(a){return Kue(a)?function(s){return Bue(s,a.length===1?a[0]:a)}:a}):t=[que];var n=-1;t=jx(t,Vue(zue));var i=Uue(e,function(a,s,l){var c=jx(t,function(u){return u(a)});return{criteria:c,index:++n,value:a}});return Wue(i,function(a,s){return Hue(a,s,r)})}var Yue=Gue;function Zue(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Xue=Zue,Que=Xue,gO=Math.max;function Jue(e,t,r){return t=gO(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=gO(n.length-t,0),s=Array(a);++i0){if(++t>=cde)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var hde=fde,mde=lde,pde=hde,gde=pde(mde),yde=gde,vde=Yu,xde=ede,bde=yde;function wde(e,t){return bde(xde(e,t,vde),e+"")}var jde=wde,_de=o_,Nde=Gh,Sde=N_,kde=ro;function Ede(e,t,r){if(!kde(r))return!1;var n=typeof t;return(n=="number"?Nde(r)&&Sde(t,r.length):n=="string"&&t in r)?_de(r[t],e):!1}var $0=Ede,Ode=DR,Ade=Yue,Pde=jde,vO=$0,Cde=Pde(function(e,t){if(e==null)return[];var r=t.length;return r>1&&vO(e,t[0],t[1])?t=[]:r>2&&vO(t[0],t[1],t[2])&&(t=[t[0]]),Ade(e,Ode(t,1),[])}),Tde=Cde;const O_=Xe(Tde);function Xf(e){"@babel/helpers - typeof";return Xf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xf(e)}function o1(){return o1=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(bd,"-left"),re(r)&&t&&re(t.x)&&r=t.y),"".concat(bd,"-top"),re(n)&&t&&re(t.y)&&np?Math.max(d,c[n]):Math.max(f,c[n])}function Kde(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function Gde(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,s=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return s.height>0&&s.width>0&&r?(d=wO({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:s.width,viewBox:c,viewBoxDimension:c.width}),f=wO({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:s.height,viewBox:c,viewBoxDimension:c.height}),u=Kde({translateX:d,translateY:f,useTranslate3d:l})):u=Hde,{cssProperties:u,cssClasses:qde({translateX:d,translateY:f,coordinate:r})}}function ru(e){"@babel/helpers - typeof";return ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ru(e)}function jO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _O(e){for(var t=1;tNO||Math.abs(n.height-this.state.lastBoundingBox.height)>NO)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,s=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.children,d=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,m=i.offset,y=i.position,p=i.reverseDirection,x=i.useTranslate3d,g=i.viewBox,v=i.wrapperStyle,w=Gde({allowEscapeViewBox:s,coordinate:d,offsetTopLeft:m,position:y,reverseDirection:p,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:g}),_=w.cssClasses,j=w.cssProperties,N=_O(_O({transition:h&&a?"transform ".concat(l,"ms ").concat(c):void 0},j),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},v);return T.createElement("div",{tabIndex:-1,className:_,style:N,ref:function(E){n.wrapperNode=E}},u)}}])}(b.PureComponent),ife=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},no={isSsr:ife()};function nu(e){"@babel/helpers - typeof";return nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nu(e)}function SO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function kO(e){for(var t=1;t0;return T.createElement(nfe,{allowEscapeViewBox:s,animationDuration:l,animationEasing:c,isAnimationActive:h,active:a,coordinate:d,hasPayload:N,offset:m,position:x,reverseDirection:g,useTranslate3d:v,viewBox:w,wrapperStyle:_},mfe(u,kO(kO({},this.props),{},{payload:j})))}}])}(b.PureComponent);A_(Wr,"displayName","Tooltip");A_(Wr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!no.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var pfe=Hi,gfe=function(){return pfe.Date.now()},yfe=gfe,vfe=/\s/;function xfe(e){for(var t=e.length;t--&&vfe.test(e.charAt(t)););return t}var bfe=xfe,wfe=bfe,jfe=/^\s+/;function _fe(e){return e&&e.slice(0,wfe(e)+1).replace(jfe,"")}var Nfe=_fe,Sfe=Nfe,EO=ro,kfe=zu,OO=NaN,Efe=/^[-+]0x[0-9a-f]+$/i,Ofe=/^0b[01]+$/i,Afe=/^0o[0-7]+$/i,Pfe=parseInt;function Cfe(e){if(typeof e=="number")return e;if(kfe(e))return OO;if(EO(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=EO(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Sfe(e);var r=Ofe.test(e);return r||Afe.test(e)?Pfe(e.slice(2),r?2:8):Efe.test(e)?OO:+e}var HR=Cfe,Tfe=ro,Nx=yfe,AO=HR,$fe="Expected a function",Mfe=Math.max,Rfe=Math.min;function Ife(e,t,r){var n,i,a,s,l,c,u=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError($fe);t=AO(t)||0,Tfe(r)&&(d=!!r.leading,f="maxWait"in r,a=f?Mfe(AO(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h);function m(N){var S=n,E=i;return n=i=void 0,u=N,s=e.apply(E,S),s}function y(N){return u=N,l=setTimeout(g,t),d?m(N):s}function p(N){var S=N-c,E=N-u,k=t-S;return f?Rfe(k,a-E):k}function x(N){var S=N-c,E=N-u;return c===void 0||S>=t||S<0||f&&E>=a}function g(){var N=Nx();if(x(N))return v(N);l=setTimeout(g,p(N))}function v(N){return l=void 0,h&&n?m(N):(n=i=void 0,s)}function w(){l!==void 0&&clearTimeout(l),u=0,n=c=i=l=void 0}function _(){return l===void 0?s:v(Nx())}function j(){var N=Nx(),S=x(N);if(n=arguments,i=this,c=N,S){if(l===void 0)return y(c);if(f)return clearTimeout(l),l=setTimeout(g,t),m(c)}return l===void 0&&(l=setTimeout(g,t)),s}return j.cancel=w,j.flush=_,j}var Dfe=Ife,Lfe=Dfe,Ffe=ro,Bfe="Expected a function";function zfe(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(Bfe);return Ffe(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Lfe(e,t,{leading:n,maxWait:t,trailing:i})}var Ufe=zfe;const qR=Xe(Ufe);function Jf(e){"@babel/helpers - typeof";return Jf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jf(e)}function PO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Lm(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&($=qR($,p,{trailing:!0,leading:!1}));var O=new ResizeObserver($),I=j.current.getBoundingClientRect(),D=I.width,L=I.height;return C(D,L),O.observe(j.current),function(){O.disconnect()}},[C,p]);var P=b.useMemo(function(){var $=k.containerWidth,O=k.containerHeight;if($<0||O<0)return null;mi(Mo(s)||Mo(c),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,s,c),mi(!r||r>0,"The aspect(%s) must be greater than zero.",r);var I=Mo(s)?$:s,D=Mo(c)?O:c;r&&r>0&&(I?D=I/r:D&&(I=D*r),h&&D>h&&(D=h)),mi(I>0||D>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the height and width.`,I,D,s,c,d,f,r);var L=!Array.isArray(m)&&pa(m.type).endsWith("Chart");return T.Children.map(m,function(R){return T.isValidElement(R)?b.cloneElement(R,Lm({width:I,height:D},L?{style:Lm({height:"100%",width:"100%",maxHeight:D,maxWidth:I},R.props.style)}:{})):R})},[r,m,c,h,f,d,k,s]);return T.createElement("div",{id:x?"".concat(x):void 0,className:$e("recharts-responsive-container",g),style:Lm(Lm({},_),{},{width:s,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:j},P)}),M0=function(t){return null};M0.displayName="Cell";function eh(e){"@babel/helpers - typeof";return eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eh(e)}function TO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function d1(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||no.isSsr)return{width:0,height:0};var n=rhe(r),i=JSON.stringify({text:t,copyStyle:n});if(Wl.widthCache[i])return Wl.widthCache[i];try{var a=document.getElementById($O);a||(a=document.createElement("span"),a.setAttribute("id",$O),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var s=d1(d1({},the),n);Object.assign(a.style,s),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return Wl.widthCache[i]=c,++Wl.cacheCount>ehe&&(Wl.cacheCount=0,Wl.widthCache={}),c}catch{return{width:0,height:0}}},nhe=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function th(e){"@babel/helpers - typeof";return th=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},th(e)}function Rg(e,t){return ohe(e)||she(e,t)||ahe(e,t)||ihe()}function ihe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ahe(e,t){if(e){if(typeof e=="string")return MO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return MO(e,t)}}function MO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function whe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function BO(e,t){return She(e)||Nhe(e,t)||_he(e,t)||jhe()}function jhe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _he(e,t){if(e){if(typeof e=="string")return zO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zO(e,t)}}function zO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return I.reduce(function(D,L){var R=L.word,M=L.width,B=D[D.length-1];if(B&&(i==null||a||B.width+M+nL.width?D:L})};if(!d)return m;for(var p="…",x=function(I){var D=f.slice(0,I),L=ZR({breakAll:u,style:c,children:D+p}).wordsWithComputedWidth,R=h(L),M=R.length>s||y(R).width>Number(i);return[M,R]},g=0,v=f.length-1,w=0,_;g<=v&&w<=f.length-1;){var j=Math.floor((g+v)/2),N=j-1,S=x(N),E=BO(S,2),k=E[0],A=E[1],C=x(j),P=BO(C,1),$=P[0];if(!k&&!$&&(g=j+1),k&&$&&(v=j-1),!k&&$){_=A;break}w++}return _||m},UO=function(t){var r=Ae(t)?[]:t.toString().split(YR);return[{words:r}]},Ehe=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,s=t.breakAll,l=t.maxLines;if((r||n)&&!no.isSsr){var c,u,d=ZR({breakAll:s,children:i,style:a});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return UO(i);return khe({breakAll:s,children:i,maxLines:l,style:a},c,u,r,n)}return UO(i)},WO="#808080",wl=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,s=t.lineHeight,l=s===void 0?"1em":s,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,h=t.textAnchor,m=h===void 0?"start":h,y=t.verticalAnchor,p=y===void 0?"end":y,x=t.fill,g=x===void 0?WO:x,v=FO(t,xhe),w=b.useMemo(function(){return Ehe({breakAll:v.breakAll,children:v.children,maxLines:v.maxLines,scaleToFit:f,style:v.style,width:v.width})},[v.breakAll,v.children,v.maxLines,f,v.style,v.width]),_=v.dx,j=v.dy,N=v.angle,S=v.className,E=v.breakAll,k=FO(v,bhe);if(!Jt(n)||!Jt(a))return null;var A=n+(re(_)?_:0),C=a+(re(j)?j:0),P;switch(p){case"start":P=Sx("calc(".concat(u,")"));break;case"middle":P=Sx("calc(".concat((w.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:P=Sx("calc(".concat(w.length-1," * -").concat(l,")"));break}var $=[];if(f){var O=w[0].width,I=v.width;$.push("scale(".concat((re(I)?I/O:1)/O,")"))}return N&&$.push("rotate(".concat(N,", ").concat(A,", ").concat(C,")")),$.length&&(k.transform=$.join(" ")),T.createElement("text",f1({},we(k,!0),{x:A,y:C,className:$e("recharts-text",S),textAnchor:m,fill:g.includes("url")?WO:g}),w.map(function(D,L){var R=D.words.join(E?"":" ");return T.createElement("tspan",{x:A,dy:L===0?P:l,key:"".concat(R,"-").concat(L)},R)}))};function Ws(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function Ohe(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function P_(e){let t,r,n;e.length!==2?(t=Ws,r=(l,c)=>Ws(e(l),c),n=(l,c)=>e(l)-c):(t=e===Ws||e===Ohe?e:Ahe,r=e,n=e);function i(l,c,u=0,d=l.length){if(u>>1;r(l[f],c)<0?u=f+1:d=f}while(u>>1;r(l[f],c)<=0?u=f+1:d=f}while(uu&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:i,center:s,right:a}}function Ahe(){return 0}function XR(e){return e===null?NaN:+e}function*Phe(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const Che=P_(Ws),Yh=Che.right;P_(XR).center;class VO extends Map{constructor(t,r=Mhe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(HO(this,t))}has(t){return super.has(HO(this,t))}set(t,r){return super.set(The(this,t),r)}delete(t){return super.delete($he(this,t))}}function HO({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function The({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function $he({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function Mhe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Rhe(e=Ws){if(e===Ws)return QR;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function QR(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const Ihe=Math.sqrt(50),Dhe=Math.sqrt(10),Lhe=Math.sqrt(2);function Ig(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=Ihe?10:a>=Dhe?5:a>=Lhe?2:1;let l,c,u;return i<0?(u=Math.pow(10,-i)/s,l=Math.round(e*u),c=Math.round(t*u),l/ut&&--c,u=-u):(u=Math.pow(10,i)*s,l=Math.round(e/u),c=Math.round(t/u),l*ut&&--c),c0))return[];if(e===t)return[e];const n=t=i))return[];const l=a-i+1,c=new Array(l);if(n)if(s<0)for(let u=0;u=n)&&(r=n);return r}function KO(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function JR(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?QR:Rhe(i);n>r;){if(n-r>600){const c=n-r+1,u=t-r+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),m=Math.max(r,Math.floor(t-u*f/c+h)),y=Math.min(n,Math.floor(t+(c-u)*f/c+h));JR(e,t,m,y,i)}const a=e[t];let s=r,l=n;for(jd(e,r,t),i(e[n],a)>0&&jd(e,r,n);s0;)--l}i(e[r],a)===0?jd(e,r,l):(++l,jd(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function jd(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function Fhe(e,t,r){if(e=Float64Array.from(Phe(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return KO(e);if(t>=1)return qO(e);var n,i=(n-1)*t,a=Math.floor(i),s=qO(JR(e,a).subarray(0,a+1)),l=KO(e.subarray(a+1));return s+(l-s)*(i-a)}}function Bhe(e,t,r=XR){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),s=+r(e[a],a,e),l=+r(e[a+1],a+1,e);return s+(l-s)*(i-a)}}function zhe(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++nt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Vhe(e,t,r){var n=e[0],i=e[1],a=t[0],s=t[1];return i2?Hhe:Vhe,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(c||(c=l(e.map(n),t,r)))(n(s(h)))}return f.invert=function(h){return s(i((u||(u=l(t,e.map(n),si)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Dg),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),r=C2,d()},f.clamp=function(h){return arguments.length?(s=h?!0:Ir,d()):s!==Ir},f.interpolate=function(h){return arguments.length?(r=h,d()):r},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,m){return n=h,i=m,d()}}function T_(){return R0()(Ir,Ir)}function qhe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Lg(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function iu(e){return e=Lg(Math.abs(e)),e?e[1]:NaN}function Khe(e,t){return function(r,n){for(var i=r.length,a=[],s=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),a.push(r.substring(i-=l,i+l)),!((c+=l+1)>n));)l=e[s=(s+1)%e.length];return a.reverse().join(t)}}function Ghe(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Yhe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function nh(e){if(!(t=Yhe.exec(e)))throw new Error("invalid format: "+e);var t;return new $_({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}nh.prototype=$_.prototype;function $_(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}$_.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Zhe(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var t6;function Xhe(e,t){var r=Lg(e,t);if(!r)return e+"";var n=r[0],i=r[1],a=i-(t6=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Lg(e,Math.max(0,t+a-1))[0]}function YO(e,t){var r=Lg(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const ZO={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:qhe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>YO(e*100,t),r:YO,s:Xhe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function XO(e){return e}var QO=Array.prototype.map,JO=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Qhe(e){var t=e.grouping===void 0||e.thousands===void 0?XO:Khe(QO.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?XO:Ghe(QO.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f){f=nh(f);var h=f.fill,m=f.align,y=f.sign,p=f.symbol,x=f.zero,g=f.width,v=f.comma,w=f.precision,_=f.trim,j=f.type;j==="n"?(v=!0,j="g"):ZO[j]||(w===void 0&&(w=12),_=!0,j="g"),(x||h==="0"&&m==="=")&&(x=!0,h="0",m="=");var N=p==="$"?r:p==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():"",S=p==="$"?n:/[%p]/.test(j)?s:"",E=ZO[j],k=/[defgprs%]/.test(j);w=w===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function A(C){var P=N,$=S,O,I,D;if(j==="c")$=E(C)+$,C="";else{C=+C;var L=C<0||1/C<0;if(C=isNaN(C)?c:E(Math.abs(C),w),_&&(C=Zhe(C)),L&&+C==0&&y!=="+"&&(L=!1),P=(L?y==="("?y:l:y==="-"||y==="("?"":y)+P,$=(j==="s"?JO[8+t6/3]:"")+$+(L&&y==="("?")":""),k){for(O=-1,I=C.length;++OD||D>57){$=(D===46?i+C.slice(O+1):C.slice(O))+$,C=C.slice(0,O);break}}}v&&!x&&(C=t(C,1/0));var R=P.length+C.length+$.length,M=R>1)+P+C+$+M.slice(R);break;default:C=M+P+C+$;break}return a(C)}return A.toString=function(){return f+""},A}function d(f,h){var m=u((f=nh(f),f.type="f",f)),y=Math.max(-8,Math.min(8,Math.floor(iu(h)/3)))*3,p=Math.pow(10,-y),x=JO[8+y/3];return function(g){return m(p*g)+x}}return{format:u,formatPrefix:d}}var Bm,M_,r6;Jhe({thousands:",",grouping:[3],currency:["$",""]});function Jhe(e){return Bm=Qhe(e),M_=Bm.format,r6=Bm.formatPrefix,Bm}function eme(e){return Math.max(0,-iu(Math.abs(e)))}function tme(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(iu(t)/3)))*3-iu(Math.abs(e)))}function rme(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,iu(t)-iu(e))+1}function n6(e,t,r,n){var i=p1(e,t,r),a;switch(n=nh(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=tme(i,s))&&(n.precision=a),r6(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=rme(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=eme(i))&&(n.precision=a-(n.type==="%")*2);break}}return M_(n)}function io(e){var t=e.domain;return e.ticks=function(r){var n=t();return h1(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return n6(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,s=n[i],l=n[a],c,u,d=10;for(l0;){if(u=m1(s,l,r),u===c)return n[i]=s,n[a]=l,t(n);if(u>0)s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u;else if(u<0)s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function Fg(){var e=T_();return e.copy=function(){return Zh(e,Fg())},Un.apply(e,arguments),io(e)}function i6(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Dg),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return i6(e).unknown(t)},e=arguments.length?Array.from(e,Dg):[0,1],io(r)}function a6(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],s;return aMath.pow(e,t)}function ome(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function rA(e){return(t,r)=>-e(-t,r)}function R_(e){const t=e(eA,tA),r=t.domain;let n=10,i,a;function s(){return i=ome(n),a=sme(n),r()[0]<0?(i=rA(i),a=rA(a),e(nme,ime)):e(eA,tA),t}return t.base=function(l){return arguments.length?(n=+l,s()):n},t.domain=function(l){return arguments.length?(r(l),s()):r()},t.ticks=l=>{const c=r();let u=c[0],d=c[c.length-1];const f=d0){for(;h<=m;++h)for(y=1;yd)break;g.push(p)}}else for(;h<=m;++h)for(y=n-1;y>=1;--y)if(p=h>0?y/a(-h):y*a(h),!(pd)break;g.push(p)}g.length*2{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=nh(c)).precision==null&&(c.trim=!0),c=M_(c)),l===1/0)return c;const u=Math.max(1,n*l/t.ticks().length);return d=>{let f=d/a(Math.round(i(d)));return f*nr(a6(r(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function s6(){const e=R_(R0()).domain([1,10]);return e.copy=()=>Zh(e,s6()).base(e.base()),Un.apply(e,arguments),e}function nA(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function iA(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function I_(e){var t=1,r=e(nA(t),iA(t));return r.constant=function(n){return arguments.length?e(nA(t=+n),iA(t)):t},io(r)}function o6(){var e=I_(R0());return e.copy=function(){return Zh(e,o6()).constant(e.constant())},Un.apply(e,arguments)}function aA(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function lme(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function cme(e){return e<0?-e*e:e*e}function D_(e){var t=e(Ir,Ir),r=1;function n(){return r===1?e(Ir,Ir):r===.5?e(lme,cme):e(aA(r),aA(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},io(t)}function L_(){var e=D_(R0());return e.copy=function(){return Zh(e,L_()).exponent(e.exponent())},Un.apply(e,arguments),e}function ume(){return L_.apply(null,arguments).exponent(.5)}function sA(e){return Math.sign(e)*e*e}function dme(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function l6(){var e=T_(),t=[0,1],r=!1,n;function i(a){var s=dme(e(a));return isNaN(s)?n:r?Math.round(s):s}return i.invert=function(a){return e.invert(sA(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Dg)).map(sA)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return l6(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Un.apply(i,arguments),io(i)}function c6(){var e=[],t=[],r=[],n;function i(){var s=0,l=Math.max(1,t.length);for(r=new Array(l-1);++s0?r[l-1]:e[0],l=r?[n[r-1],t]:[n[u-1],n[u]]},s.unknown=function(c){return arguments.length&&(a=c),s},s.thresholds=function(){return n.slice()},s.copy=function(){return u6().domain([e,t]).range(i).unknown(a)},Un.apply(io(s),arguments)}function d6(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[Yh(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var s=t.indexOf(a);return[e[s-1],e[s]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return d6().domain(e).range(t).unknown(r)},Un.apply(i,arguments)}const kx=new Date,Ex=new Date;function tr(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const s=i(a),l=i.ceil(a);return a-s(t(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,l)=>{const c=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(utr(s=>{if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;t(s,-1),!a(s););else for(;--l>=0;)for(;t(s,1),!a(s););}),r&&(i.count=(a,s)=>(kx.setTime(+a),Ex.setTime(+s),e(kx),e(Ex),Math.floor(r(kx,Ex))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const Bg=tr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Bg.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?tr(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Bg);Bg.range;const la=1e3,Mn=la*60,ca=Mn*60,ka=ca*24,F_=ka*7,oA=ka*30,Ox=ka*365,Ro=tr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*la)},(e,t)=>(t-e)/la,e=>e.getUTCSeconds());Ro.range;const B_=tr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*la)},(e,t)=>{e.setTime(+e+t*Mn)},(e,t)=>(t-e)/Mn,e=>e.getMinutes());B_.range;const z_=tr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Mn)},(e,t)=>(t-e)/Mn,e=>e.getUTCMinutes());z_.range;const U_=tr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*la-e.getMinutes()*Mn)},(e,t)=>{e.setTime(+e+t*ca)},(e,t)=>(t-e)/ca,e=>e.getHours());U_.range;const W_=tr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ca)},(e,t)=>(t-e)/ca,e=>e.getUTCHours());W_.range;const Xh=tr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Mn)/ka,e=>e.getDate()-1);Xh.range;const I0=tr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ka,e=>e.getUTCDate()-1);I0.range;const f6=tr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ka,e=>Math.floor(e/ka));f6.range;function Tl(e){return tr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Mn)/F_)}const D0=Tl(0),zg=Tl(1),fme=Tl(2),hme=Tl(3),au=Tl(4),mme=Tl(5),pme=Tl(6);D0.range;zg.range;fme.range;hme.range;au.range;mme.range;pme.range;function $l(e){return tr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/F_)}const L0=$l(0),Ug=$l(1),gme=$l(2),yme=$l(3),su=$l(4),vme=$l(5),xme=$l(6);L0.range;Ug.range;gme.range;yme.range;su.range;vme.range;xme.range;const V_=tr(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());V_.range;const H_=tr(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());H_.range;const Ea=tr(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Ea.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:tr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Ea.range;const Oa=tr(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Oa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:tr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Oa.range;function h6(e,t,r,n,i,a){const s=[[Ro,1,la],[Ro,5,5*la],[Ro,15,15*la],[Ro,30,30*la],[a,1,Mn],[a,5,5*Mn],[a,15,15*Mn],[a,30,30*Mn],[i,1,ca],[i,3,3*ca],[i,6,6*ca],[i,12,12*ca],[n,1,ka],[n,2,2*ka],[r,1,F_],[t,1,oA],[t,3,3*oA],[e,1,Ox]];function l(u,d,f){const h=dx).right(s,h);if(m===s.length)return e.every(p1(u/Ox,d/Ox,f));if(m===0)return Bg.every(Math.max(p1(u,d,f),1));const[y,p]=s[h/s[m-1][2]53)return null;"w"in Q||(Q.w=1),"Z"in Q?(be=Px(_d(Q.y,0,1)),Ee=be.getUTCDay(),be=Ee>4||Ee===0?Ug.ceil(be):Ug(be),be=I0.offset(be,(Q.V-1)*7),Q.y=be.getUTCFullYear(),Q.m=be.getUTCMonth(),Q.d=be.getUTCDate()+(Q.w+6)%7):(be=Ax(_d(Q.y,0,1)),Ee=be.getDay(),be=Ee>4||Ee===0?zg.ceil(be):zg(be),be=Xh.offset(be,(Q.V-1)*7),Q.y=be.getFullYear(),Q.m=be.getMonth(),Q.d=be.getDate()+(Q.w+6)%7)}else("W"in Q||"U"in Q)&&("w"in Q||(Q.w="u"in Q?Q.u%7:"W"in Q?1:0),Ee="Z"in Q?Px(_d(Q.y,0,1)).getUTCDay():Ax(_d(Q.y,0,1)).getDay(),Q.m=0,Q.d="W"in Q?(Q.w+6)%7+Q.W*7-(Ee+5)%7:Q.w+Q.U*7-(Ee+6)%7);return"Z"in Q?(Q.H+=Q.Z/100|0,Q.M+=Q.Z%100,Px(Q)):Ax(Q)}}function E(J,oe,me,Q){for(var Pe=0,be=oe.length,Ee=me.length,Re,Y;Pe=Ee)return-1;if(Re=oe.charCodeAt(Pe++),Re===37){if(Re=oe.charAt(Pe++),Y=j[Re in lA?oe.charAt(Pe++):Re],!Y||(Q=Y(J,me,Q))<0)return-1}else if(Re!=me.charCodeAt(Q++))return-1}return Q}function k(J,oe,me){var Q=u.exec(oe.slice(me));return Q?(J.p=d.get(Q[0].toLowerCase()),me+Q[0].length):-1}function A(J,oe,me){var Q=m.exec(oe.slice(me));return Q?(J.w=y.get(Q[0].toLowerCase()),me+Q[0].length):-1}function C(J,oe,me){var Q=f.exec(oe.slice(me));return Q?(J.w=h.get(Q[0].toLowerCase()),me+Q[0].length):-1}function P(J,oe,me){var Q=g.exec(oe.slice(me));return Q?(J.m=v.get(Q[0].toLowerCase()),me+Q[0].length):-1}function $(J,oe,me){var Q=p.exec(oe.slice(me));return Q?(J.m=x.get(Q[0].toLowerCase()),me+Q[0].length):-1}function O(J,oe,me){return E(J,t,oe,me)}function I(J,oe,me){return E(J,r,oe,me)}function D(J,oe,me){return E(J,n,oe,me)}function L(J){return s[J.getDay()]}function R(J){return a[J.getDay()]}function M(J){return c[J.getMonth()]}function B(J){return l[J.getMonth()]}function U(J){return i[+(J.getHours()>=12)]}function W(J){return 1+~~(J.getMonth()/3)}function Z(J){return s[J.getUTCDay()]}function q(J){return a[J.getUTCDay()]}function ee(J){return c[J.getUTCMonth()]}function le(J){return l[J.getUTCMonth()]}function ve(J){return i[+(J.getUTCHours()>=12)]}function Ne(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var oe=N(J+="",w);return oe.toString=function(){return J},oe},parse:function(J){var oe=S(J+="",!1);return oe.toString=function(){return J},oe},utcFormat:function(J){var oe=N(J+="",_);return oe.toString=function(){return J},oe},utcParse:function(J){var oe=S(J+="",!0);return oe.toString=function(){return J},oe}}}var lA={"-":"",_:" ",0:"0"},ur=/^\s*\d+/,Sme=/^%/,kme=/[\\^$*+?|[\]().{}]/g;function Ge(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function Ome(e,t,r){var n=ur.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function Ame(e,t,r){var n=ur.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Pme(e,t,r){var n=ur.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Cme(e,t,r){var n=ur.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function Tme(e,t,r){var n=ur.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function cA(e,t,r){var n=ur.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function uA(e,t,r){var n=ur.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function $me(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Mme(e,t,r){var n=ur.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Rme(e,t,r){var n=ur.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function dA(e,t,r){var n=ur.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Ime(e,t,r){var n=ur.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function fA(e,t,r){var n=ur.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Dme(e,t,r){var n=ur.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Lme(e,t,r){var n=ur.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Fme(e,t,r){var n=ur.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Bme(e,t,r){var n=ur.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function zme(e,t,r){var n=Sme.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Ume(e,t,r){var n=ur.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Wme(e,t,r){var n=ur.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function hA(e,t){return Ge(e.getDate(),t,2)}function Vme(e,t){return Ge(e.getHours(),t,2)}function Hme(e,t){return Ge(e.getHours()%12||12,t,2)}function qme(e,t){return Ge(1+Xh.count(Ea(e),e),t,3)}function m6(e,t){return Ge(e.getMilliseconds(),t,3)}function Kme(e,t){return m6(e,t)+"000"}function Gme(e,t){return Ge(e.getMonth()+1,t,2)}function Yme(e,t){return Ge(e.getMinutes(),t,2)}function Zme(e,t){return Ge(e.getSeconds(),t,2)}function Xme(e){var t=e.getDay();return t===0?7:t}function Qme(e,t){return Ge(D0.count(Ea(e)-1,e),t,2)}function p6(e){var t=e.getDay();return t>=4||t===0?au(e):au.ceil(e)}function Jme(e,t){return e=p6(e),Ge(au.count(Ea(e),e)+(Ea(e).getDay()===4),t,2)}function epe(e){return e.getDay()}function tpe(e,t){return Ge(zg.count(Ea(e)-1,e),t,2)}function rpe(e,t){return Ge(e.getFullYear()%100,t,2)}function npe(e,t){return e=p6(e),Ge(e.getFullYear()%100,t,2)}function ipe(e,t){return Ge(e.getFullYear()%1e4,t,4)}function ape(e,t){var r=e.getDay();return e=r>=4||r===0?au(e):au.ceil(e),Ge(e.getFullYear()%1e4,t,4)}function spe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ge(t/60|0,"0",2)+Ge(t%60,"0",2)}function mA(e,t){return Ge(e.getUTCDate(),t,2)}function ope(e,t){return Ge(e.getUTCHours(),t,2)}function lpe(e,t){return Ge(e.getUTCHours()%12||12,t,2)}function cpe(e,t){return Ge(1+I0.count(Oa(e),e),t,3)}function g6(e,t){return Ge(e.getUTCMilliseconds(),t,3)}function upe(e,t){return g6(e,t)+"000"}function dpe(e,t){return Ge(e.getUTCMonth()+1,t,2)}function fpe(e,t){return Ge(e.getUTCMinutes(),t,2)}function hpe(e,t){return Ge(e.getUTCSeconds(),t,2)}function mpe(e){var t=e.getUTCDay();return t===0?7:t}function ppe(e,t){return Ge(L0.count(Oa(e)-1,e),t,2)}function y6(e){var t=e.getUTCDay();return t>=4||t===0?su(e):su.ceil(e)}function gpe(e,t){return e=y6(e),Ge(su.count(Oa(e),e)+(Oa(e).getUTCDay()===4),t,2)}function ype(e){return e.getUTCDay()}function vpe(e,t){return Ge(Ug.count(Oa(e)-1,e),t,2)}function xpe(e,t){return Ge(e.getUTCFullYear()%100,t,2)}function bpe(e,t){return e=y6(e),Ge(e.getUTCFullYear()%100,t,2)}function wpe(e,t){return Ge(e.getUTCFullYear()%1e4,t,4)}function jpe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?su(e):su.ceil(e),Ge(e.getUTCFullYear()%1e4,t,4)}function _pe(){return"+0000"}function pA(){return"%"}function gA(e){return+e}function yA(e){return Math.floor(+e/1e3)}var Vl,v6,x6;Npe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Npe(e){return Vl=Nme(e),v6=Vl.format,Vl.parse,x6=Vl.utcFormat,Vl.utcParse,Vl}function Spe(e){return new Date(e)}function kpe(e){return e instanceof Date?+e:+new Date(+e)}function q_(e,t,r,n,i,a,s,l,c,u){var d=T_(),f=d.invert,h=d.domain,m=u(".%L"),y=u(":%S"),p=u("%I:%M"),x=u("%I %p"),g=u("%a %d"),v=u("%b %d"),w=u("%B"),_=u("%Y");function j(N){return(c(N)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>Fhe(e,a/n))},r.copy=function(){return _6(t).domain(e)},Ia.apply(r,arguments)}function B0(){var e=0,t=.5,r=1,n=1,i,a,s,l,c,u=Ir,d,f=!1,h;function m(p){return isNaN(p=+p)?h:(p=.5+((p=+d(p))-a)*(n*pt}var E6=$pe,Mpe=z0,Rpe=E6,Ipe=Yu;function Dpe(e){return e&&e.length?Mpe(e,Ipe,Rpe):void 0}var Lpe=Dpe;const js=Xe(Lpe);function Fpe(e,t){return ee.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};he.decimalPlaces=he.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*gt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};he.dividedBy=he.div=function(e){return ga(this,new this.constructor(e))};he.dividedToIntegerBy=he.idiv=function(e){var t=this,r=t.constructor;return st(ga(t,new r(e),0,1),r.precision)};he.equals=he.eq=function(e){return!this.cmp(e)};he.exponent=function(){return Ht(this)};he.greaterThan=he.gt=function(e){return this.cmp(e)>0};he.greaterThanOrEqualTo=he.gte=function(e){return this.cmp(e)>=0};he.isInteger=he.isint=function(){return this.e>this.d.length-2};he.isNegative=he.isneg=function(){return this.s<0};he.isPositive=he.ispos=function(){return this.s>0};he.isZero=function(){return this.s===0};he.lessThan=he.lt=function(e){return this.cmp(e)<0};he.lessThanOrEqualTo=he.lte=function(e){return this.cmp(e)<1};he.logarithm=he.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(ln))throw Error(Bn+"NaN");if(r.s<1)throw Error(Bn+(r.s?"NaN":"-Infinity"));return r.eq(ln)?new n(0):(wt=!1,t=ga(ih(r,a),ih(e,a),a),wt=!0,st(t,i))};he.minus=he.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?T6(t,e):P6(t,(e.s=-e.s,e))};he.modulo=he.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Bn+"NaN");return r.s?(wt=!1,t=ga(r,e,0,1).times(e),wt=!0,r.minus(t)):st(new n(r),i)};he.naturalExponential=he.exp=function(){return C6(this)};he.naturalLogarithm=he.ln=function(){return ih(this)};he.negated=he.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};he.plus=he.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?P6(t,e):T6(t,(e.s=-e.s,e))};he.precision=he.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(el+e);if(t=Ht(i)+1,n=i.d.length-1,r=n*gt+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};he.squareRoot=he.sqrt=function(){var e,t,r,n,i,a,s,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Bn+"NaN")}for(e=Ht(l),wt=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=$i(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Xu((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(i.toString()),r=c.precision,i=s=r+3;;)if(a=n,n=a.plus(ga(l,a,s+2)).times(.5),$i(a.d).slice(0,s)===(t=$i(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(st(a,r+1,0),a.times(a).eq(l)){n=a;break}}else if(t!="9999")break;s+=4}return wt=!0,st(n,r)};he.times=he.mul=function(e){var t,r,n,i,a,s,l,c,u,d=this,f=d.constructor,h=d.d,m=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,r=d.e+e.e,c=h.length,u=m.length,c=0;){for(t=0,i=c+n;i>n;)l=a[i]+m[n]*h[i-n-1]+t,a[i--]=l%ir|0,t=l/ir|0;a[i]=(a[i]+t)%ir|0}for(;!a[--s];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,wt?st(e,f.precision):e};he.toDecimalPlaces=he.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Wi(e,0,Zu),t===void 0?t=n.rounding:Wi(t,0,8),st(r,e+Ht(r)+1,t))};he.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=_l(n,!0):(Wi(e,0,Zu),t===void 0?t=i.rounding:Wi(t,0,8),n=st(new i(n),e+1,t),r=_l(n,!0,e+1)),r};he.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?_l(i):(Wi(e,0,Zu),t===void 0?t=a.rounding:Wi(t,0,8),n=st(new a(i),e+Ht(i)+1,t),r=_l(n.abs(),!1,e+Ht(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};he.toInteger=he.toint=function(){var e=this,t=e.constructor;return st(new t(e),Ht(e)+1,t.rounding)};he.toNumber=function(){return+this};he.toPower=he.pow=function(e){var t,r,n,i,a,s,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(ln);if(l=new c(l),!l.s){if(e.s<1)throw Error(Bn+"Infinity");return l}if(l.eq(ln))return l;if(n=c.precision,e.eq(ln))return st(l,n);if(t=e.e,r=e.d.length-1,s=t>=r,a=l.s,s){if((r=d<0?-d:d)<=A6){for(i=new c(ln),t=Math.ceil(n/gt+4),wt=!1;r%2&&(i=i.times(l),bA(i.d,t)),r=Xu(r/2),r!==0;)l=l.times(l),bA(l.d,t);return wt=!0,e.s<0?new c(ln).div(i):st(i,n)}}else if(a<0)throw Error(Bn+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,wt=!1,i=e.times(ih(l,n+u)),wt=!0,i=C6(i),i.s=a,i};he.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=Ht(i),n=_l(i,r<=a.toExpNeg||r>=a.toExpPos)):(Wi(e,1,Zu),t===void 0?t=a.rounding:Wi(t,0,8),i=st(new a(i),e,t),r=Ht(i),n=_l(i,e<=r||r<=a.toExpNeg,e)),n};he.toSignificantDigits=he.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Wi(e,1,Zu),t===void 0?t=n.rounding:Wi(t,0,8)),st(new n(r),e,t)};he.toString=he.valueOf=he.val=he.toJSON=he[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Ht(e),r=e.constructor;return _l(e,t<=r.toExpNeg||t>=r.toExpPos)};function P6(e,t){var r,n,i,a,s,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),wt?st(t,f):t;if(c=e.d,u=t.d,s=e.e,i=t.e,c=c.slice(),a=s-i,a){for(a<0?(n=c,a=-a,l=u.length):(n=u,i=s,l=c.length),s=Math.ceil(f/gt),l=s>l?s+1:l+1,a>l&&(a=l,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,n=u,u=c,c=n),r=0;a;)r=(c[--a]=c[a]+u[a]+r)/ir|0,c[a]%=ir;for(r&&(c.unshift(r),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,wt?st(t,f):t}function Wi(e,t,r){if(e!==~~e||er)throw Error(el+e)}function $i(e){var t,r,n,i=e.length-1,a="",s=e[0];if(i>0){for(a+=s,t=1;ts?1:-1;else for(l=c=0;li[l]?1:-1;break}return c}function r(n,i,a){for(var s=0;a--;)n[a]-=s,s=n[a]1;)n.shift()}return function(n,i,a,s){var l,c,u,d,f,h,m,y,p,x,g,v,w,_,j,N,S,E,k=n.constructor,A=n.s==i.s?1:-1,C=n.d,P=i.d;if(!n.s)return new k(n);if(!i.s)throw Error(Bn+"Division by zero");for(c=n.e-i.e,S=P.length,j=C.length,m=new k(A),y=m.d=[],u=0;P[u]==(C[u]||0);)++u;if(P[u]>(C[u]||0)&&--c,a==null?v=a=k.precision:s?v=a+(Ht(n)-Ht(i))+1:v=a,v<0)return new k(0);if(v=v/gt+2|0,u=0,S==1)for(d=0,P=P[0],v++;(u1&&(P=e(P,d),C=e(C,d),S=P.length,j=C.length),_=S,p=C.slice(0,S),x=p.length;x=ir/2&&++N;do d=0,l=t(P,p,S,x),l<0?(g=p[0],S!=x&&(g=g*ir+(p[1]||0)),d=g/N|0,d>1?(d>=ir&&(d=ir-1),f=e(P,d),h=f.length,x=p.length,l=t(f,p,h,x),l==1&&(d--,r(f,S16)throw Error(Y_+Ht(e));if(!e.s)return new d(ln);for(wt=!1,l=f,s=new d(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(n=Math.log(wo(2,u))/Math.LN10*2+5|0,l+=n,r=i=a=new d(ln),d.precision=l;;){if(i=st(i.times(e),l),r=r.times(++c),s=a.plus(ga(i,r,l)),$i(s.d).slice(0,l)===$i(a.d).slice(0,l)){for(;u--;)a=st(a.times(a),l);return d.precision=f,t==null?(wt=!0,st(a,f)):a}a=s}}function Ht(e){for(var t=e.e*gt,r=e.d[0];r>=10;r/=10)t++;return t}function Cx(e,t,r){if(t>e.LN10.sd())throw wt=!0,r&&(e.precision=r),Error(Bn+"LN10 precision limit exceeded");return st(new e(e.LN10),t)}function Za(e){for(var t="";e--;)t+="0";return t}function ih(e,t){var r,n,i,a,s,l,c,u,d,f=1,h=10,m=e,y=m.d,p=m.constructor,x=p.precision;if(m.s<1)throw Error(Bn+(m.s?"NaN":"-Infinity"));if(m.eq(ln))return new p(0);if(t==null?(wt=!1,u=x):u=t,m.eq(10))return t==null&&(wt=!0),Cx(p,u);if(u+=h,p.precision=u,r=$i(y),n=r.charAt(0),a=Ht(m),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)m=m.times(e),r=$i(m.d),n=r.charAt(0),f++;a=Ht(m),n>1?(m=new p("0."+r),a++):m=new p(n+"."+r.slice(1))}else return c=Cx(p,u+2,x).times(a+""),m=ih(new p(n+"."+r.slice(1)),u-h).plus(c),p.precision=x,t==null?(wt=!0,st(m,x)):m;for(l=s=m=ga(m.minus(ln),m.plus(ln),u),d=st(m.times(m),u),i=3;;){if(s=st(s.times(d),u),c=l.plus(ga(s,new p(i),u)),$i(c.d).slice(0,u)===$i(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(Cx(p,u+2,x).times(a+""))),l=ga(l,new p(f),u),p.precision=x,t==null?(wt=!0,st(l,x)):l;l=c,i+=2}}function xA(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Xu(r/gt),e.d=[],n=(r+1)%gt,r<0&&(n+=gt),nWg||e.e<-Wg))throw Error(Y_+r)}else e.s=0,e.e=0,e.d=[0];return e}function st(e,t,r){var n,i,a,s,l,c,u,d,f=e.d;for(s=1,a=f[0];a>=10;a/=10)s++;if(n=t-s,n<0)n+=gt,i=t,u=f[d=0];else{if(d=Math.ceil((n+1)/gt),a=f.length,d>=a)return e;for(u=a=f[d],s=1;a>=10;a/=10)s++;n%=gt,i=n-gt+s}if(r!==void 0&&(a=wo(10,s-i-1),l=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?i>0?u/wo(10,s-i):0:f[d-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(a=Ht(e),f.length=1,t=t-a-1,f[0]=wo(10,(gt-t%gt)%gt),e.e=Xu(-t/gt)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=d,a=1,d--):(f.length=d+1,a=wo(10,gt-n),f[d]=i>0?(u/wo(10,s-i)%wo(10,i)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==ir&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=ir)break;f[d--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(wt&&(e.e>Wg||e.e<-Wg))throw Error(Y_+Ht(e));return e}function T6(e,t){var r,n,i,a,s,l,c,u,d,f,h=e.constructor,m=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),wt?st(t,m):t;if(c=e.d,f=t.d,n=t.e,u=e.e,c=c.slice(),s=u-n,s){for(d=s<0,d?(r=c,s=-s,l=f.length):(r=f,n=u,l=c.length),i=Math.max(Math.ceil(m/gt),l)+2,s>i&&(s=i,r.length=1),r.reverse(),i=s;i--;)r.push(0);r.reverse()}else{for(i=c.length,l=f.length,d=i0;--i)c[l++]=0;for(i=f.length;i>s;){if(c[--i]0?a=a.charAt(0)+"."+a.slice(1)+Za(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Za(-i-1)+a,r&&(n=r-s)>0&&(a+=Za(n))):i>=s?(a+=Za(i+1-s),r&&(n=r-i-1)>0&&(a=a+"."+Za(n))):((n=i+1)0&&(i+1===s&&(a+="."),a+=Za(n))),e.s<0?"-"+a:a}function bA(e,t){if(e.length>t)return e.length=t,!0}function $6(e){var t,r,n;function i(a){var s=this;if(!(s instanceof i))return new i(a);if(s.constructor=i,a instanceof i){s.s=a.s,s.e=a.e,s.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(el+a);if(a>0)s.s=1;else if(a<0)a=-a,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(a===~~a&&a<1e7){s.e=0,s.d=[a];return}return xA(s,a.toString())}else if(typeof a!="string")throw Error(el+a);if(a.charCodeAt(0)===45?(a=a.slice(1),s.s=-1):s.s=1,sge.test(a))xA(s,a);else throw Error(el+a)}if(i.prototype=he,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=$6,i.config=i.set=oge,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(el+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(el+r+": "+n);return this}var Z_=$6(age);ln=new Z_(1);const nt=Z_;function lge(e){return fge(e)||dge(e)||uge(e)||cge()}function cge(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uge(e,t){if(e){if(typeof e=="string")return v1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v1(e,t)}}function dge(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function fge(e){if(Array.isArray(e))return v1(e)}function v1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-s,wA(function(){for(var l=arguments.length,c=new Array(l),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var s=e[Symbol.iterator](),l;!(n=(l=s.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(c){i=!0,a=c}finally{try{!n&&s.return!=null&&s.return()}finally{if(i)throw a}}return r}}function Ege(e){if(Array.isArray(e))return e}function L6(e){var t=ah(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function F6(e,t,r){if(e.lte(0))return new nt(0);var n=V0.getDigitCount(e.toNumber()),i=new nt(10).pow(n),a=e.div(i),s=n!==1?.05:.1,l=new nt(Math.ceil(a.div(s).toNumber())).add(r).mul(s),c=l.mul(i);return t?c:new nt(Math.ceil(c))}function Oge(e,t,r){var n=1,i=new nt(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new nt(10).pow(V0.getDigitCount(e)-1),i=new nt(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new nt(Math.floor(e)))}else e===0?i=new nt(Math.floor((t-1)/2)):r||(i=new nt(Math.floor(e)));var s=Math.floor((t-1)/2),l=gge(pge(function(c){return i.add(new nt(c-s).mul(n)).toNumber()}),x1);return l(0,t)}function B6(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new nt(0),tickMin:new nt(0),tickMax:new nt(0)};var a=F6(new nt(t).sub(e).div(r-1),n,i),s;e<=0&&t>=0?s=new nt(0):(s=new nt(e).add(t).div(2),s=s.sub(new nt(s).mod(a)));var l=Math.ceil(s.sub(e).div(a).toNumber()),c=Math.ceil(new nt(t).sub(s).div(a).toNumber()),u=l+c+1;return u>r?B6(e,t,r,n,i+1):(u0?c+(r-u):c,l=t>0?l:l+(r-u)),{step:a,tickMin:s.sub(new nt(l).mul(a)),tickMax:s.add(new nt(c).mul(a))})}function Age(e){var t=ah(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(i,2),l=L6([r,n]),c=ah(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(w1(x1(0,i-1).map(function(){return 1/0}))):[].concat(w1(x1(0,i-1).map(function(){return-1/0})),[d]);return r>n?b1(f):f}if(u===d)return Oge(u,i,a);var h=B6(u,d,s,a),m=h.step,y=h.tickMin,p=h.tickMax,x=V0.rangeStep(y,p.add(new nt(.1).mul(m)),m);return r>n?b1(x):x}function Pge(e,t){var r=ah(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=L6([n,i]),l=ah(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[n,i];if(c===u)return[c];var d=Math.max(t,2),f=F6(new nt(u).sub(c).div(d-1),a,0),h=[].concat(w1(V0.rangeStep(new nt(c),new nt(u).sub(new nt(.99).mul(f)),f)),[u]);return n>i?b1(h):h}var Cge=I6(Age),Tge=I6(Pge),$ge="Invariant failed";function Nl(e,t){throw new Error($ge)}var Mge=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ou(e){"@babel/helpers - typeof";return ou=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ou(e)}function Vg(){return Vg=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zge(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Uge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wge(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,s=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,u=0;u0?i[u-1].coordinate:i[l-1].coordinate,f=i[u].coordinate,h=u>=l-1?i[0].coordinate:i[u+1].coordinate,m=void 0;if(Mr(f-d)!==Mr(h-f)){var y=[];if(Mr(h-f)===Mr(c[1]-c[0])){m=h;var p=f+c[1]-c[0];y[0]=Math.min(p,(p+d)/2),y[1]=Math.max(p,(p+d)/2)}else{m=d;var x=h+c[1]-c[0];y[0]=Math.min(f,(x+f)/2),y[1]=Math.max(f,(x+f)/2)}var g=[Math.min(f,(m+f)/2),Math.max(f,(m+f)/2)];if(t>g[0]&&t<=g[1]||t>=y[0]&&t<=y[1]){s=i[u].index;break}}else{var v=Math.min(d,h),w=Math.max(d,h);if(t>(v+f)/2&&t<=(w+f)/2){s=i[u].index;break}}}else for(var _=0;_0&&_(n[_].coordinate+n[_-1].coordinate)/2&&t<=(n[_].coordinate+n[_+1].coordinate)/2||_===l-1&&t>(n[_].coordinate+n[_-1].coordinate)/2){s=n[_].index;break}return s},X_=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?At(At({},t.type.defaultProps),t.props):t.props,s=a.stroke,l=a.fill,c;switch(i){case"Line":c=s;break;case"Area":case"Radar":c=s&&s!=="none"?s:l;break;default:c=l;break}return c},sye=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var s={},l=Object.keys(a),c=0,u=l.length;c=0});if(g&&g.length){var v=g[0].type.defaultProps,w=v!==void 0?At(At({},v),g[0].props):g[0].props,_=w.barSize,j=w[x];s[j]||(s[j]=[]);var N=Ae(_)?r:_;s[j].push({item:g[0],stackList:g.slice(1),barSize:Ae(N)?void 0:Rr(N,n,0)})}}return s},oye=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,s=a===void 0?[]:a,l=t.maxBarSize,c=s.length;if(c<1)return null;var u=Rr(r,i,0,!0),d,f=[];if(s[0].barSize===+s[0].barSize){var h=!1,m=i/c,y=s.reduce(function(_,j){return _+j.barSize||0},0);y+=(c-1)*u,y>=i&&(y-=(c-1)*u,u=0),y>=i&&m>0&&(h=!0,m*=.9,y=c*m);var p=(i-y)/2>>0,x={offset:p-u,size:0};d=s.reduce(function(_,j){var N={item:j.item,position:{offset:x.offset+x.size+u,size:h?m:j.barSize}},S=[].concat(NA(_),[N]);return x=S[S.length-1].position,j.stackList&&j.stackList.length&&j.stackList.forEach(function(E){S.push({item:E,position:x})}),S},f)}else{var g=Rr(n,i,0,!0);i-2*g-(c-1)*u<=0&&(u=0);var v=(i-2*g-(c-1)*u)/c;v>1&&(v>>=0);var w=l===+l?Math.min(v,l):v;d=s.reduce(function(_,j,N){var S=[].concat(NA(_),[{item:j.item,position:{offset:g+(v+u)*N+(v-w)/2,size:w}}]);return j.stackList&&j.stackList.length&&j.stackList.forEach(function(E){S.push({item:E,position:S[S.length-1].position})}),S},f)}return d},lye=function(t,r,n,i){var a=n.children,s=n.width,l=n.margin,c=s-(l.left||0)-(l.right||0),u=V6({children:a,legendWidth:c});if(u){var d=i||{},f=d.width,h=d.height,m=u.align,y=u.verticalAlign,p=u.layout;if((p==="vertical"||p==="horizontal"&&y==="middle")&&m!=="center"&&re(t[m]))return At(At({},t),{},Oc({},m,t[m]+(f||0)));if((p==="horizontal"||p==="vertical"&&m==="center")&&y!=="middle"&&re(t[y]))return At(At({},t),{},Oc({},y,t[y]+(h||0)))}return t},cye=function(t,r,n){return Ae(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},H6=function(t,r,n,i,a){var s=r.props.children,l=hn(s,Qh).filter(function(u){return cye(i,a,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=Mt(d,n);if(Ae(f))return u;var h=Array.isArray(f)?[U0(f),js(f)]:[f,f],m=c.reduce(function(y,p){var x=Mt(d,p,0),g=h[0]-Math.abs(Array.isArray(x)?x[0]:x),v=h[1]+Math.abs(Array.isArray(x)?x[1]:x);return[Math.min(g,y[0]),Math.max(v,y[1])]},[1/0,-1/0]);return[Math.min(m[0],u[0]),Math.max(m[1],u[1])]},[1/0,-1/0])}return null},uye=function(t,r,n,i,a){var s=r.map(function(l){return H6(t,l,n,a,i)}).filter(function(l){return!Ae(l)});return s&&s.length?s.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},q6=function(t,r,n,i,a){var s=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&H6(t,c,u,i)||cf(t,u,n,a)});if(n==="number")return s.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return s.reduce(function(c,u){for(var d=0,f=u.length;d=2?Mr(l[0]-l[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=a?a.indexOf(f):f;return{coordinate:i(h)+u,value:f,offset:u}});return d.filter(function(f){return!qu(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:i(f)+u,value:f,index:h,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(f){return{coordinate:i(f)+u,value:f,offset:u}}):i.domain().map(function(f,h){return{coordinate:i(f)+u,value:a?a[f]:f,index:h,offset:u}})},Tx=new WeakMap,zm=function(t,r){if(typeof r!="function")return t;Tx.has(t)||Tx.set(t,new WeakMap);var n=Tx.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},Y6=function(t,r,n){var i=t.scale,a=t.type,s=t.layout,l=t.axisType;if(i==="auto")return s==="radial"&&l==="radiusAxis"?{scale:rh(),realScaleType:"band"}:s==="radial"&&l==="angleAxis"?{scale:Fg(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:lf(),realScaleType:"point"}:a==="category"?{scale:rh(),realScaleType:"band"}:{scale:Fg(),realScaleType:"linear"};if(xl(i)){var c="scale".concat(E0(i));return{scale:(vA[c]||lf)(),realScaleType:vA[c]?c:"point"}}return ke(i)?{scale:i}:{scale:lf(),realScaleType:"point"}},kA=1e-4,Z6=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-kA,s=Math.max(i[0],i[1])+kA,l=t(r[0]),c=t(r[n-1]);(ls||cs)&&t.domain([r[0],r[n-1]])}},dye=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[l][n][0]=a,t[l][n][1]=a+c,a=t[l][n][1]):(t[l][n][0]=s,t[l][n][1]=s+c,s=t[l][n][1])}},mye=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[s][n][0]=a,t[s][n][1]=a+l,a=t[s][n][1]):(t[s][n][0]=0,t[s][n][1]=0)}},pye={sign:hye,expand:iie,none:Jc,silhouette:aie,wiggle:sie,positive:mye},gye=function(t,r,n){var i=r.map(function(l){return l.props.dataKey}),a=pye[n],s=nie().keys(i).value(function(l,c){return+Mt(l,c,0)}).order(Xw).offset(a);return s(t)},yye=function(t,r,n,i,a,s){if(!t)return null;var l=s?r.reverse():r,c={},u=l.reduce(function(f,h){var m,y=(m=h.type)!==null&&m!==void 0&&m.defaultProps?At(At({},h.type.defaultProps),h.props):h.props,p=y.stackId,x=y.hide;if(x)return f;var g=y[n],v=f[g]||{hasStack:!1,stackGroups:{}};if(Jt(p)){var w=v.stackGroups[p]||{numericAxisId:n,cateAxisId:i,items:[]};w.items.push(h),v.hasStack=!0,v.stackGroups[p]=w}else v.stackGroups[Cl("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return At(At({},f),{},Oc({},g,v))},c),d={};return Object.keys(u).reduce(function(f,h){var m=u[h];if(m.hasStack){var y={};m.stackGroups=Object.keys(m.stackGroups).reduce(function(p,x){var g=m.stackGroups[x];return At(At({},p),{},Oc({},x,{numericAxisId:n,cateAxisId:i,items:g.items,stackedData:gye(t,g.items,a)}))},y)}return At(At({},f),{},Oc({},h,m))},d)},X6=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,s=r.originalDomain,l=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&i==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=Cge(u,a,l);return t.domain([U0(d),js(d)]),{niceTicks:d}}if(a&&i==="number"){var f=t.domain(),h=Tge(f,a,l);return{niceTicks:h}}return null};function qg(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ae(i[t.dataKey])){var l=wg(r,"value",i[t.dataKey]);if(l)return l.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var c=Mt(i,Ae(s)?t.dataKey:s);return Ae(c)?null:t.scale(c)}var EA=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,s=t.entry,l=t.index;if(r.type==="category")return n[l]?n[l].coordinate+i:null;var c=Mt(s,r.dataKey,r.domain[l]);return Ae(c)?null:r.scale(c)-a/2+i},vye=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},xye=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?At(At({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(Jt(a)){var s=r[a];if(s){var l=s.items.indexOf(t);return l>=0?s.stackedData[l]:null}}return null},bye=function(t){return t.reduce(function(r,n){return[U0(n.concat([r[0]]).filter(re)),js(n.concat([r[1]]).filter(re))]},[1/0,-1/0])},Q6=function(t,r,n){return Object.keys(t).reduce(function(i,a){var s=t[a],l=s.stackedData,c=l.reduce(function(u,d){var f=bye(d.slice(r,n+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},OA=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,AA=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,S1=function(t,r,n){if(ke(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(re(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(OA.test(t[0])){var a=+OA.exec(t[0])[1];i[0]=r[0]-a}else ke(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(re(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(AA.test(t[1])){var s=+AA.exec(t[1])[1];i[1]=r[1]+s}else ke(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},Kg=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=O_(r,function(f){return f.coordinate}),s=1/0,l=1,c=a.length;le.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},Aye=function(t,r,n,i,a){var s=t.width,l=t.height,c=t.startAngle,u=t.endAngle,d=Rr(t.cx,s,s/2),f=Rr(t.cy,l,l/2),h=tI(s,l,n),m=Rr(t.innerRadius,h,0),y=Rr(t.outerRadius,h,h*.8),p=Object.keys(r);return p.reduce(function(x,g){var v=r[g],w=v.domain,_=v.reversed,j;if(Ae(v.range))i==="angleAxis"?j=[c,u]:i==="radiusAxis"&&(j=[m,y]),_&&(j=[j[1],j[0]]);else{j=v.range;var N=j,S=_ye(N,2);c=S[0],u=S[1]}var E=Y6(v,a),k=E.realScaleType,A=E.scale;A.domain(w).range(j),Z6(A);var C=X6(A,ta(ta({},v),{},{realScaleType:k})),P=ta(ta(ta({},v),C),{},{range:j,radius:y,realScaleType:k,scale:A,cx:d,cy:f,innerRadius:m,outerRadius:y,startAngle:c,endAngle:u});return ta(ta({},x),{},eI({},g,P))},{})},Pye=function(t,r){var n=t.x,i=t.y,a=r.x,s=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-s,2))},Cye=function(t,r){var n=t.x,i=t.y,a=r.cx,s=r.cy,l=Pye({x:n,y:i},{x:a,y:s});if(l<=0)return{radius:l};var c=(n-a)/l,u=Math.acos(c);return i>s&&(u=2*Math.PI-u),{radius:l,angle:Oye(u),angleInRadian:u}},Tye=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),s=Math.min(i,a);return{startAngle:r-s*360,endAngle:n-s*360}},$ye=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),s=Math.floor(i/360),l=Math.min(a,s);return t+l*360},$A=function(t,r){var n=t.x,i=t.y,a=Cye({x:n,y:i},r),s=a.radius,l=a.angle,c=r.innerRadius,u=r.outerRadius;if(su)return!1;if(s===0)return!0;var d=Tye(r),f=d.startAngle,h=d.endAngle,m=l,y;if(f<=h){for(;m>h;)m-=360;for(;m=f&&m<=h}else{for(;m>f;)m-=360;for(;m=h&&m<=f}return y?ta(ta({},r),{},{radius:s,angle:$ye(m,r)}):null},rI=function(t){return!b.isValidElement(t)&&!ke(t)&&typeof t!="boolean"?t.className:""};function ch(e){"@babel/helpers - typeof";return ch=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ch(e)}var Mye=["offset"];function Rye(e){return Fye(e)||Lye(e)||Dye(e)||Iye()}function Iye(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dye(e,t){if(e){if(typeof e=="string")return k1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return k1(e,t)}}function Lye(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Fye(e){if(Array.isArray(e))return k1(e)}function k1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zye(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function MA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Gt(e){for(var t=1;t=0?1:-1,w,_;i==="insideStart"?(w=m+v*s,_=p):i==="insideEnd"?(w=y-v*s,_=!p):i==="end"&&(w=y+v*s,_=p),_=g<=0?_:!_;var j=dt(u,d,x,w),N=dt(u,d,x,w+(_?1:-1)*359),S="M".concat(j.x,",").concat(j.y,` A`).concat(x,",").concat(x,",0,1,").concat(_?0:1,`, `).concat(N.x,",").concat(N.y),E=Ae(t.id)?Cl("recharts-radial-line-"):t.id;return T.createElement("text",uh({},n,{dominantBaseline:"central",className:$e("recharts-radial-bar-label",l)}),T.createElement("defs",null,T.createElement("path",{id:E,d:S})),T.createElement("textPath",{xlinkHref:"#".concat(E)},r))},Gye=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,s=a.cx,l=a.cy,c=a.innerRadius,u=a.outerRadius,d=a.startAngle,f=a.endAngle,h=(d+f)/2;if(i==="outside"){var m=dt(s,l,u+n,h),y=m.x,p=m.y;return{x:y,y:p,textAnchor:y>=s?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"end"};var x=(c+u)/2,g=dt(s,l,x,h),v=g.x,w=g.y;return{x:v,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Yye=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,s=r,l=s.x,c=s.y,u=s.width,d=s.height,f=d>=0?1:-1,h=f*i,m=f>0?"end":"start",y=f>0?"start":"end",p=u>=0?1:-1,x=p*i,g=p>0?"end":"start",v=p>0?"start":"end";if(a==="top"){var w={x:l+u/2,y:c-f*i,textAnchor:"middle",verticalAnchor:m};return Gt(Gt({},w),n?{height:Math.max(c-n.y,0),width:u}:{})}if(a==="bottom"){var _={x:l+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:y};return Gt(Gt({},_),n?{height:Math.max(n.y+n.height-(c+d),0),width:u}:{})}if(a==="left"){var j={x:l-x,y:c+d/2,textAnchor:g,verticalAnchor:"middle"};return Gt(Gt({},j),n?{width:Math.max(j.x-n.x,0),height:d}:{})}if(a==="right"){var N={x:l+u+x,y:c+d/2,textAnchor:v,verticalAnchor:"middle"};return Gt(Gt({},N),n?{width:Math.max(n.x+n.width-N.x,0),height:d}:{})}var S=n?{width:u,height:d}:{};return a==="insideLeft"?Gt({x:l+x,y:c+d/2,textAnchor:v,verticalAnchor:"middle"},S):a==="insideRight"?Gt({x:l+u-x,y:c+d/2,textAnchor:g,verticalAnchor:"middle"},S):a==="insideTop"?Gt({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:y},S):a==="insideBottom"?Gt({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:m},S):a==="insideTopLeft"?Gt({x:l+x,y:c+h,textAnchor:v,verticalAnchor:y},S):a==="insideTopRight"?Gt({x:l+u-x,y:c+h,textAnchor:g,verticalAnchor:y},S):a==="insideBottomLeft"?Gt({x:l+x,y:c+d-h,textAnchor:v,verticalAnchor:m},S):a==="insideBottomRight"?Gt({x:l+u-x,y:c+d-h,textAnchor:g,verticalAnchor:m},S):Uu(a)&&(re(a.x)||Mo(a.x))&&(re(a.y)||Mo(a.y))?Gt({x:l+Rr(a.x,u),y:c+Rr(a.y,d),textAnchor:"end",verticalAnchor:"end"},S):Gt({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},S)},Zye=function(t){return"cx"in t&&re(t.cx)};function sr(e){var t=e.offset,r=t===void 0?5:t,n=Bye(e,Mye),i=Gt({offset:r},n),a=i.viewBox,s=i.position,l=i.value,c=i.children,u=i.content,d=i.className,f=d===void 0?"":d,h=i.textBreakAll;if(!a||Ae(l)&&Ae(c)&&!b.isValidElement(u)&&!ke(u))return null;if(b.isValidElement(u))return b.cloneElement(u,i);var m;if(ke(u)){if(m=b.createElement(u,i),b.isValidElement(m))return m}else m=Hye(i);var y=Zye(a),p=we(i,!0);if(y&&(s==="insideStart"||s==="insideEnd"||s==="end"))return Kye(i,m,p);var x=y?Gye(i):Yye(i);return T.createElement(wl,uh({className:$e("recharts-label",f)},p,x,{breakAll:h}),m)}sr.displayName="Label";var nI=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,s=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,h=t.y,m=t.top,y=t.left,p=t.width,x=t.height,g=t.clockWise,v=t.labelViewBox;if(v)return v;if(re(p)&&re(x)){if(re(f)&&re(h))return{x:f,y:h,width:p,height:x};if(re(m)&&re(y))return{x:m,y,width:p,height:x}}return re(f)&&re(h)?{x:f,y:h,width:0,height:0}:re(r)&&re(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:s||i||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:g}:t.viewBox?t.viewBox:{}},Xye=function(t,r){return t?t===!0?T.createElement(sr,{key:"label-implicit",viewBox:r}):Jt(t)?T.createElement(sr,{key:"label-implicit",viewBox:r,value:t}):b.isValidElement(t)?t.type===sr?b.cloneElement(t,{key:"label-implicit",viewBox:r}):T.createElement(sr,{key:"label-implicit",content:t,viewBox:r}):ke(t)?T.createElement(sr,{key:"label-implicit",content:t,viewBox:r}):Uu(t)?T.createElement(sr,uh({viewBox:r},t,{key:"label-implicit"})):null:null},Qye=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=nI(t),s=hn(i,sr).map(function(c,u){return b.cloneElement(c,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return s;var l=Xye(t.label,r||a);return[l].concat(Rye(s))};sr.parseViewBox=nI;sr.renderCallByParent=Qye;function Jye(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var e0e=Jye;const t0e=Xe(e0e);function dh(e){"@babel/helpers - typeof";return dh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dh(e)}var r0e=["valueAccessor"],n0e=["data","dataKey","clockWise","id","textBreakAll"];function i0e(e){return l0e(e)||o0e(e)||s0e(e)||a0e()}function a0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s0e(e,t){if(e){if(typeof e=="string")return E1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return E1(e,t)}}function o0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function l0e(e){if(Array.isArray(e))return E1(e)}function E1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function f0e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var h0e=function(t){return Array.isArray(t.value)?t0e(t.value):t.value};function Fi(e){var t=e.valueAccessor,r=t===void 0?h0e:t,n=DA(e,r0e),i=n.data,a=n.dataKey,s=n.clockWise,l=n.id,c=n.textBreakAll,u=DA(n,n0e);return!i||!i.length?null:T.createElement(Be,{className:"recharts-label-list"},i.map(function(d,f){var h=Ae(a)?r(d,f):Mt(d&&d.payload,a),m=Ae(l)?{}:{id:"".concat(l,"-").concat(f)};return T.createElement(sr,Yg({},we(d,!0),u,m,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:sr.parseViewBox(Ae(s)?d:IA(IA({},d),{},{clockWise:s})),key:"label-".concat(f),index:f}))}))}Fi.displayName="LabelList";function m0e(e,t){return e?e===!0?T.createElement(Fi,{key:"labelList-implicit",data:t}):T.isValidElement(e)||ke(e)?T.createElement(Fi,{key:"labelList-implicit",data:t,content:e}):Uu(e)?T.createElement(Fi,Yg({data:t},e,{key:"labelList-implicit"})):null:null}function p0e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=hn(n,Fi).map(function(s,l){return b.cloneElement(s,{data:t,key:"labelList-".concat(l)})});if(!r)return i;var a=m0e(e.label,t);return[a].concat(i0e(i))}Fi.renderCallByParent=p0e;function fh(e){"@babel/helpers - typeof";return fh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fh(e)}function O1(){return O1=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(s>u),`, `).concat(f.x,",").concat(f.y,` `);if(i>0){var m=dt(r,n,i,s),y=dt(r,n,i,u);h+="L ".concat(y.x,",").concat(y.y,` A `).concat(i,",").concat(i,`,0, `).concat(+(Math.abs(c)>180),",").concat(+(s<=u),`, `).concat(m.x,",").concat(m.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},b0e=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,s=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=Mr(d-u),h=Um({cx:r,cy:n,radius:a,angle:u,sign:f,cornerRadius:s,cornerIsExternal:c}),m=h.circleTangency,y=h.lineTangency,p=h.theta,x=Um({cx:r,cy:n,radius:a,angle:d,sign:-f,cornerRadius:s,cornerIsExternal:c}),g=x.circleTangency,v=x.lineTangency,w=x.theta,_=c?Math.abs(u-d):Math.abs(u-d)-p-w;if(_<0)return l?"M ".concat(y.x,",").concat(y.y,` a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0 a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0 `):iI({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:u,endAngle:d});var j="M ".concat(y.x,",").concat(y.y,` A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(m.x,",").concat(m.y,` A`).concat(a,",").concat(a,",0,").concat(+(_>180),",").concat(+(f<0),",").concat(g.x,",").concat(g.y,` A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(v.x,",").concat(v.y,` `);if(i>0){var N=Um({cx:r,cy:n,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),S=N.circleTangency,E=N.lineTangency,k=N.theta,A=Um({cx:r,cy:n,radius:i,angle:d,sign:-f,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),C=A.circleTangency,P=A.lineTangency,$=A.theta,O=c?Math.abs(u-d):Math.abs(u-d)-k-$;if(O<0&&s===0)return"".concat(j,"L").concat(r,",").concat(n,"Z");j+="L".concat(P.x,",").concat(P.y,` A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(C.x,",").concat(C.y,` A`).concat(i,",").concat(i,",0,").concat(+(O>180),",").concat(+(f>0),",").concat(S.x,",").concat(S.y,` A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(E.x,",").concat(E.y,"Z")}else j+="L".concat(r,",").concat(n,"Z");return j},w0e={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},aI=function(t){var r=FA(FA({},w0e),t),n=r.cx,i=r.cy,a=r.innerRadius,s=r.outerRadius,l=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,d=r.startAngle,f=r.endAngle,h=r.className;if(s0&&Math.abs(d-f)<360?x=b0e({cx:n,cy:i,innerRadius:a,outerRadius:s,cornerRadius:Math.min(p,y/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):x=iI({cx:n,cy:i,innerRadius:a,outerRadius:s,startAngle:d,endAngle:f}),T.createElement("path",O1({},we(r,!0),{className:m,d:x,role:"img"}))};function hh(e){"@babel/helpers - typeof";return hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hh(e)}function A1(){return A1=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function B0e(e,t){return Ml(e.getTime(),t.getTime())}function z0e(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function U0e(e,t){return e===t}function KA(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.entries(),s,l,c=0;(s=a.next())&&!s.done;){for(var u=t.entries(),d=!1,f=0;(l=u.next())&&!l.done;){if(i[f]){f++;continue}var h=s.value,m=l.value;if(r.equals(h[0],m[0],c,f,e,t,r)&&r.equals(h[1],m[1],h[0],m[0],e,t,r)){d=i[f]=!0;break}f++}if(!d)return!1;c++}return!0}var W0e=Ml;function V0e(e,t,r){var n=qA(e),i=n.length;if(qA(t).length!==i)return!1;for(;i-- >0;)if(!cI(e,t,r,n[i]))return!1;return!0}function Od(e,t,r){var n=VA(e),i=n.length;if(VA(t).length!==i)return!1;for(var a,s,l;i-- >0;)if(a=n[i],!cI(e,t,r,a)||(s=HA(e,a),l=HA(t,a),(s||l)&&(!s||!l||s.configurable!==l.configurable||s.enumerable!==l.enumerable||s.writable!==l.writable)))return!1;return!0}function H0e(e,t){return Ml(e.valueOf(),t.valueOf())}function q0e(e,t){return e.source===t.source&&e.flags===t.flags}function GA(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.values(),s,l;(s=a.next())&&!s.done;){for(var c=t.values(),u=!1,d=0;(l=c.next())&&!l.done;){if(!i[d]&&r.equals(s.value,l.value,s.value,l.value,e,t,r)){u=i[d]=!0;break}d++}if(!u)return!1}return!0}function K0e(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function G0e(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function cI(e,t,r,n){return(n===L0e||n===D0e||n===I0e)&&(e.$$typeof||t.$$typeof)?!0:R0e(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var Y0e="[object Arguments]",Z0e="[object Boolean]",X0e="[object Date]",Q0e="[object Error]",J0e="[object Map]",eve="[object Number]",tve="[object Object]",rve="[object RegExp]",nve="[object Set]",ive="[object String]",ave="[object URL]",sve=Array.isArray,YA=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,ZA=Object.assign,ove=Object.prototype.toString.call.bind(Object.prototype.toString);function lve(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,i=e.areFunctionsEqual,a=e.areMapsEqual,s=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,d=e.areSetsEqual,f=e.areTypedArraysEqual,h=e.areUrlsEqual;return function(y,p,x){if(y===p)return!0;if(y==null||p==null)return!1;var g=typeof y;if(g!==typeof p)return!1;if(g!=="object")return g==="number"?s(y,p,x):g==="function"?i(y,p,x):!1;var v=y.constructor;if(v!==p.constructor)return!1;if(v===Object)return l(y,p,x);if(sve(y))return t(y,p,x);if(YA!=null&&YA(y))return f(y,p,x);if(v===Date)return r(y,p,x);if(v===RegExp)return u(y,p,x);if(v===Map)return a(y,p,x);if(v===Set)return d(y,p,x);var w=ove(y);return w===X0e?r(y,p,x):w===rve?u(y,p,x):w===J0e?a(y,p,x):w===nve?d(y,p,x):w===tve?typeof y.then!="function"&&typeof p.then!="function"&&l(y,p,x):w===ave?h(y,p,x):w===Q0e?n(y,p,x):w===Y0e?l(y,p,x):w===Z0e||w===eve||w===ive?c(y,p,x):!1}}function cve(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?Od:F0e,areDatesEqual:B0e,areErrorsEqual:z0e,areFunctionsEqual:U0e,areMapsEqual:n?WA(KA,Od):KA,areNumbersEqual:W0e,areObjectsEqual:n?Od:V0e,arePrimitiveWrappersEqual:H0e,areRegExpsEqual:q0e,areSetsEqual:n?WA(GA,Od):GA,areTypedArraysEqual:n?Od:K0e,areUrlsEqual:G0e};if(r&&(i=ZA({},i,r(i))),t){var a=Vm(i.areArraysEqual),s=Vm(i.areMapsEqual),l=Vm(i.areObjectsEqual),c=Vm(i.areSetsEqual);i=ZA({},i,{areArraysEqual:a,areMapsEqual:s,areObjectsEqual:l,areSetsEqual:c})}return i}function uve(e){return function(t,r,n,i,a,s,l){return e(t,r,l)}}function dve(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,a=e.strict;if(n)return function(c,u){var d=n(),f=d.cache,h=f===void 0?t?new WeakMap:void 0:f,m=d.meta;return r(c,u,{cache:h,equals:i,meta:m,strict:a})};if(t)return function(c,u){return r(c,u,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var s={cache:void 0,equals:i,meta:void 0,strict:a};return function(c,u){return r(c,u,s)}}var fve=so();so({strict:!0});so({circular:!0});so({circular:!0,strict:!0});so({createInternalComparator:function(){return Ml}});so({strict:!0,createInternalComparator:function(){return Ml}});so({circular:!0,createInternalComparator:function(){return Ml}});so({circular:!0,createInternalComparator:function(){return Ml},strict:!0});function so(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,a=e.strict,s=a===void 0?!1:a,l=cve(e),c=lve(l),u=n?n(c):uve(c);return dve({circular:r,comparator:c,createState:i,equals:u,strict:s})}function hve(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function XA(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):hve(i)};requestAnimationFrame(n)}function P1(e){"@babel/helpers - typeof";return P1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P1(e)}function mve(e){return vve(e)||yve(e)||gve(e)||pve()}function pve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gve(e,t){if(e){if(typeof e=="string")return QA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return QA(e,t)}}function QA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:g<0?0:g},p=function(g){for(var v=g>1?1:g,w=v,_=0;_<8;++_){var j=f(w)-v,N=m(w);if(Math.abs(j-v)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,s=t.dt,l=s===void 0?17:s,c=function(d,f,h){var m=-(d-f)*n,y=h*a,p=h+(m-y)*l/1e3,x=h*l/1e3+d;return Math.abs(x-f)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Yve(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function $x(e){return Jve(e)||Qve(e)||Xve(e)||Zve()}function Zve(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xve(e,t){if(e){if(typeof e=="string")return R1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R1(e,t)}}function Qve(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Jve(e){if(Array.isArray(e))return R1(e)}function R1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Qg(e){return Qg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Qg(e)}var gi=function(e){ixe(r,e);var t=axe(r);function r(n,i){var a;exe(this,r),a=t.call(this,n,i);var s=a.props,l=s.isActive,c=s.attributeName,u=s.from,d=s.to,f=s.steps,h=s.children,m=s.duration;if(a.handleStyleChange=a.handleStyleChange.bind(L1(a)),a.changeStyle=a.changeStyle.bind(L1(a)),!l||m<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:d}),D1(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof h=="function")return a.state={style:u},D1(a);a.state={style:c?Wd({},c,u):u}}else a.state={style:{}};return a}return rxe(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,s=i.canBegin;this.mounted=!0,!(!a||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,s=a.isActive,l=a.canBegin,c=a.attributeName,u=a.shouldReAnimate,d=a.to,f=a.from,h=this.state.style;if(l){if(!s){var m={style:c?Wd({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(m);return}if(!(fve(i.to,d)&&i.canBegin&&i.isActive)){var y=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var p=y||u?f:i.to;if(this.state&&h){var x={style:c?Wd({},c,p):p};(c&&h[c]!==p||!c&&h!==p)&&this.setState(x)}this.runAnimation(Gn(Gn({},this.props),{},{from:p,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,s=i.from,l=i.to,c=i.duration,u=i.easing,d=i.begin,f=i.onAnimationEnd,h=i.onAnimationStart,m=qve(s,l,Rve(u),c,this.changeStyle),y=function(){a.stopJSAnimation=m()};this.manager.start([h,d,y,c,f])}},{key:"runStepAnimation",value:function(i){var a=this,s=i.steps,l=i.begin,c=i.onAnimationStart,u=s[0],d=u.style,f=u.duration,h=f===void 0?0:f,m=function(p,x,g){if(g===0)return p;var v=x.duration,w=x.easing,_=w===void 0?"ease":w,j=x.style,N=x.properties,S=x.onAnimationEnd,E=g>0?s[g-1]:x,k=N||Object.keys(j);if(typeof _=="function"||_==="spring")return[].concat($x(p),[a.runJSAnimation.bind(a,{from:E.style,to:j,duration:v,easing:_}),v]);var A=tP(k,v,_),C=Gn(Gn(Gn({},E.style),j),{},{transition:A});return[].concat($x(p),[C,v,S]).filter(_ve)};return this.manager.start([c].concat($x(s.reduce(m,[d,Math.max(h,l)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=xve());var a=i.begin,s=i.duration,l=i.attributeName,c=i.to,u=i.easing,d=i.onAnimationStart,f=i.onAnimationEnd,h=i.steps,m=i.children,y=this.manager;if(this.unSubscribe=y.subscribe(this.handleStyleChange),typeof u=="function"||typeof m=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var p=l?Wd({},l,c):c,x=tP(Object.keys(p),s,u);y.start([d,a,Gn(Gn({},p),{},{transition:x}),s,f])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var s=i.duration;i.attributeName,i.easing;var l=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=Gve(i,Kve),u=b.Children.count(a),d=this.state.style;if(typeof a=="function")return a(d);if(!l||u===0||s<=0)return a;var f=function(m){var y=m.props,p=y.style,x=p===void 0?{}:p,g=y.className,v=b.cloneElement(m,Gn(Gn({},c),{},{style:Gn(Gn({},x),d),className:g}));return v};return u===1?f(b.Children.only(a)):T.createElement("div",null,b.Children.map(a,function(h){return f(h)}))}}]),r}(b.PureComponent);gi.displayName="Animate";gi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};gi.propTypes={from:Ye.oneOfType([Ye.object,Ye.string]),to:Ye.oneOfType([Ye.object,Ye.string]),attributeName:Ye.string,duration:Ye.number,begin:Ye.number,easing:Ye.oneOfType([Ye.string,Ye.func]),steps:Ye.arrayOf(Ye.shape({duration:Ye.number.isRequired,style:Ye.object.isRequired,easing:Ye.oneOfType([Ye.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ye.func]),properties:Ye.arrayOf("string"),onAnimationEnd:Ye.func})),children:Ye.oneOfType([Ye.node,Ye.func]),isActive:Ye.bool,canBegin:Ye.bool,onAnimationEnd:Ye.func,shouldReAnimate:Ye.bool,onAnimationStart:Ye.func,onAnimationReStart:Ye.func};function gh(e){"@babel/helpers - typeof";return gh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gh(e)}function Jg(){return Jg=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,c=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,d;if(s>0&&a instanceof Array){for(var f=[0,0,0,0],h=0,m=4;hs?s:a[h];d="M".concat(t,",").concat(r+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(r)),d+="L ".concat(t+n-c*f[1],",").concat(r),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`, `).concat(t+n,",").concat(r+l*f[1])),d+="L ".concat(t+n,",").concat(r+i-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`, `).concat(t+n-c*f[2],",").concat(r+i)),d+="L ".concat(t+c*f[3],",").concat(r+i),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`, `).concat(t,",").concat(r+i-l*f[3])),d+="Z"}else if(s>0&&a===+a&&a>0){var y=Math.min(s,a);d="M ".concat(t,",").concat(r+l*y,` A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(t+c*y,",").concat(r,` L `).concat(t+n-c*y,",").concat(r,` A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(t+n,",").concat(r+l*y,` L `).concat(t+n,",").concat(r+i-l*y,` A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(t+n-c*y,",").concat(r+i,` L `).concat(t+c*y,",").concat(r+i,` A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(t,",").concat(r+i-l*y," Z")}else d="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return d},pxe=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,s=r.y,l=r.width,c=r.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(a,a+l),d=Math.max(a,a+l),f=Math.min(s,s+c),h=Math.max(s,s+c);return n>=u&&n<=d&&i>=f&&i<=h}return!1},gxe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Q_=function(t){var r=cP(cP({},gxe),t),n=b.useRef(),i=b.useState(-1),a=oxe(i,2),s=a[0],l=a[1];b.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var _=n.current.getTotalLength();_&&l(_)}catch{}},[]);var c=r.x,u=r.y,d=r.width,f=r.height,h=r.radius,m=r.className,y=r.animationEasing,p=r.animationDuration,x=r.animationBegin,g=r.isAnimationActive,v=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var w=$e("recharts-rectangle",m);return v?T.createElement(gi,{canBegin:s>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:p,animationEasing:y,isActive:v},function(_){var j=_.width,N=_.height,S=_.x,E=_.y;return T.createElement(gi,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:p,isActive:g,easing:y},T.createElement("path",Jg({},we(r,!0),{className:w,d:uP(S,E,j,N,h),ref:n})))}):T.createElement("path",Jg({},we(r,!0),{className:w,d:uP(c,u,d,f,h)}))},yxe=["points","className","baseLinePoints","connectNulls"];function fc(){return fc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xxe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function dP(e){return _xe(e)||jxe(e)||wxe(e)||bxe()}function bxe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wxe(e,t){if(e){if(typeof e=="string")return F1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return F1(e,t)}}function jxe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _xe(e){if(Array.isArray(e))return F1(e)}function F1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){fP(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),fP(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},df=function(t,r){var n=Nxe(t);r&&(n=[n.reduce(function(a,s){return[].concat(dP(a),dP(s))},[])]);var i=n.map(function(a){return a.reduce(function(s,l,c){return"".concat(s).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},Sxe=function(t,r,n){var i=df(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(df(r.reverse(),n).slice(1))},kxe=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,s=vxe(t,yxe);if(!r||!r.length)return null;var l=$e("recharts-polygon",n);if(i&&i.length){var c=s.stroke&&s.stroke!=="none",u=Sxe(r,i,a);return T.createElement("g",{className:l},T.createElement("path",fc({},we(s,!0),{fill:u.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:u})),c?T.createElement("path",fc({},we(s,!0),{fill:"none",d:df(r,a)})):null,c?T.createElement("path",fc({},we(s,!0),{fill:"none",d:df(i,a)})):null)}var d=df(r,a);return T.createElement("path",fc({},we(s,!0),{fill:d.slice(-1)==="Z"?s.fill:"none",className:l,d}))};function B1(){return B1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $xe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Mxe=function(t,r,n,i,a,s){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(s,",").concat(r,"h").concat(n)},Rxe=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,s=t.top,l=s===void 0?0:s,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,h=t.height,m=h===void 0?0:h,y=t.className,p=Txe(t,Exe),x=Oxe({x:n,y:a,top:l,left:u,width:f,height:m},p);return!re(n)||!re(a)||!re(f)||!re(m)||!re(l)||!re(u)?null:T.createElement("path",z1({},we(x,!0),{className:$e("recharts-cross",y),d:Mxe(n,a,f,m,l,u)}))},Ixe=z0,Dxe=E6,Lxe=qi;function Fxe(e,t){return e&&e.length?Ixe(e,Lxe(t),Dxe):void 0}var Bxe=Fxe;const zxe=Xe(Bxe);var Uxe=z0,Wxe=qi,Vxe=O6;function Hxe(e,t){return e&&e.length?Uxe(e,Wxe(t),Vxe):void 0}var qxe=Hxe;const Kxe=Xe(qxe);var Gxe=["cx","cy","angle","ticks","axisLine"],Yxe=["ticks","tick","angle","tickFormatter","stroke"];function cu(e){"@babel/helpers - typeof";return cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cu(e)}function ff(){return ff=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zxe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Xxe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gP(e,t){for(var r=0;rxP?s=i==="outer"?"start":"end":a<-xP?s=i==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,s=n.radius,l=n.axisLine,c=n.axisLineType,u=fo(fo({},we(this.props,!1)),{},{fill:"none"},we(l,!1));if(c==="circle")return T.createElement(Jh,ko({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:a,r:s}));var d=this.props.ticks,f=d.map(function(h){return dt(i,a,s,h.coordinate)});return T.createElement(kxe,ko({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,s=i.tick,l=i.tickLine,c=i.tickFormatter,u=i.stroke,d=we(this.props,!1),f=we(s,!1),h=fo(fo({},d),{},{fill:"none"},we(l,!1)),m=a.map(function(y,p){var x=n.getTickLineCoord(y),g=n.getTickTextAnchor(y),v=fo(fo(fo({textAnchor:g},d),{},{stroke:"none",fill:u},f),{},{index:p,payload:y,x:x.x2,y:x.y2});return T.createElement(Be,ko({className:$e("recharts-polar-angle-axis-tick",rI(s)),key:"tick-".concat(y.coordinate)},bl(n.props,y,p)),l&&T.createElement("line",ko({className:"recharts-polar-angle-axis-tick-line"},h,x)),s&&t.renderTickItem(s,v,c?c(y.value,p):y.value))});return T.createElement(Be,{className:"recharts-polar-angle-axis-ticks"},m)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,s=n.axisLine;return a<=0||!i||!i.length?null:T.createElement(Be,{className:$e("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var s;return T.isValidElement(n)?s=T.cloneElement(n,i):ke(n)?s=n(i):s=T.createElement(wl,ko({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),s}}])}(b.PureComponent);K0(G0,"displayName","PolarAngleAxis");K0(G0,"axisType","angleAxis");K0(G0,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var fbe=kR,hbe=fbe(Object.getPrototypeOf,Object),mbe=hbe,pbe=Ma,gbe=mbe,ybe=Ra,vbe="[object Object]",xbe=Function.prototype,bbe=Object.prototype,bI=xbe.toString,wbe=bbe.hasOwnProperty,jbe=bI.call(Object);function _be(e){if(!ybe(e)||pbe(e)!=vbe)return!1;var t=gbe(e);if(t===null)return!0;var r=wbe.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&bI.call(r)==jbe}var Nbe=_be;const Sbe=Xe(Nbe);var kbe=Ma,Ebe=Ra,Obe="[object Boolean]";function Abe(e){return e===!0||e===!1||Ebe(e)&&kbe(e)==Obe}var Pbe=Abe;const Cbe=Xe(Pbe);function vh(e){"@babel/helpers - typeof";return vh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vh(e)}function ry(){return ry=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:c,y:u},duration:p,animationEasing:y,isActive:g},function(w){var _=w.upperWidth,j=w.lowerWidth,N=w.height,S=w.x,E=w.y;return T.createElement(gi,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:p,easing:y},T.createElement("path",ry({},we(r,!0),{className:v,d:_P(S,E,_,j,N),ref:n})))}):T.createElement("g",null,T.createElement("path",ry({},we(r,!0),{className:v,d:_P(c,u,d,f,h)})))},Ube=["option","shapeType","propTransformer","activeClassName","isActive"];function xh(e){"@babel/helpers - typeof";return xh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xh(e)}function Wbe(e,t){if(e==null)return{};var r=Vbe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Vbe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function NP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ny(e){for(var t=1;t0?fn(w,"paddingAngle",0):0;if(j){var S=Xt(j.endAngle-j.startAngle,w.endAngle-w.startAngle),E=ot(ot({},w),{},{startAngle:v+N,endAngle:v+S(p)+N});x.push(E),v=E.endAngle}else{var k=w.endAngle,A=w.startAngle,C=Xt(0,k-A),P=C(p),$=ot(ot({},w),{},{startAngle:v+N,endAngle:v+P+N});x.push($),v=$.endAngle}}),T.createElement(Be,null,n.renderSectorsStatically(x))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var s=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"ArrowRight":{var l=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[l].focus(),i.setState({sectorToFocus:l});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,s=this.state.prevSectors;return a&&i&&i.length&&(!s||!jl(s,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,s=i.sectors,l=i.className,c=i.label,u=i.cx,d=i.cy,f=i.innerRadius,h=i.outerRadius,m=i.isAnimationActive,y=this.state.isAnimationFinished;if(a||!s||!s.length||!re(u)||!re(d)||!re(f)||!re(h))return null;var p=$e("recharts-pie",l);return T.createElement(Be,{tabIndex:this.props.rootTabIndex,className:p,ref:function(g){n.pieRef=g}},this.renderSectors(),c&&this.renderLabels(s),sr.renderCallByParent(this.props,null,!1),(!m||y)&&Fi.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?v:v-1)*c,_=x-v*m-w,j=i.reduce(function(E,k){var A=Mt(k,g,0);return E+(re(A)?A:0)},0),N;if(j>0){var S;N=i.map(function(E,k){var A=Mt(E,g,0),C=Mt(E,d,k),P=(re(A)?A:0)/j,$;k?$=S.endAngle+Mr(p)*c*(A!==0?1:0):$=s;var O=$+Mr(p)*((A!==0?m:0)+P*_),I=($+O)/2,D=(y.innerRadius+y.outerRadius)/2,L=[{name:C,value:A,payload:E,dataKey:g,type:h}],R=dt(y.cx,y.cy,D,I);return S=ot(ot(ot({percent:P,cornerRadius:a,name:C,tooltipPayload:L,midAngle:I,middleRadius:D,tooltipPosition:R},E),y),{},{value:Mt(E,g),startAngle:$,endAngle:O,payload:E,paddingAngle:Mr(p)*c}),S})}return ot(ot({},y),{},{sectors:N,data:i})});var dwe=Math.ceil,fwe=Math.max;function hwe(e,t,r,n){for(var i=-1,a=fwe(dwe((t-e)/(r||1)),0),s=Array(a);a--;)s[n?a:++i]=e,e+=r;return s}var mwe=hwe,pwe=HR,OP=1/0,gwe=17976931348623157e292;function ywe(e){if(!e)return e===0?e:0;if(e=pwe(e),e===OP||e===-OP){var t=e<0?-1:1;return t*gwe}return e===e?e:0}var NI=ywe,vwe=mwe,xwe=$0,Mx=NI;function bwe(e){return function(t,r,n){return n&&typeof n!="number"&&xwe(t,r,n)&&(r=n=void 0),t=Mx(t),r===void 0?(r=t,t=0):r=Mx(r),n=n===void 0?t0&&n.handleDrag(i.changedTouches[0])}),rn(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,s=i.onDragEnd,l=i.startIndex;s==null||s({endIndex:a,startIndex:l})}),n.detachDragEndListener()}),rn(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),rn(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),rn(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),rn(n,"handleSlideDragStart",function(i){var a=$P(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return Mwe(t,e),Pwe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,s=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(i,a),h=Math.max(i,a),m=t.getIndexInRange(s,f),y=t.getIndexInRange(s,h);return{startIndex:m-m%c,endIndex:y===d?d:y-y%c}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,s=i.tickFormatter,l=i.dataKey,c=Mt(a[n],l,n);return ke(s)?s(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,s=i.startX,l=i.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,h=c.startIndex,m=c.endIndex,y=c.onChange,p=n.pageX-a;p>0?p=Math.min(p,u+d-f-l,u+d-f-s):p<0&&(p=Math.max(p,u-s,u-l));var x=this.getIndex({startX:s+p,endX:l+p});(x.startIndex!==h||x.endIndex!==m)&&y&&y(x),this.setState({startX:s+p,endX:l+p,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=$P(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,s=i.movingTravellerId,l=i.endX,c=i.startX,u=this.state[s],d=this.props,f=d.x,h=d.width,m=d.travellerWidth,y=d.onChange,p=d.gap,x=d.data,g={startX:this.state.startX,endX:this.state.endX},v=n.pageX-a;v>0?v=Math.min(v,f+h-m-u):v<0&&(v=Math.max(v,f-u)),g[s]=u+v;var w=this.getIndex(g),_=w.startIndex,j=w.endIndex,N=function(){var E=x.length-1;return s==="startX"&&(l>c?_%p===0:j%p===0)||lc?j%p===0:_%p===0)||l>c&&j===E};this.setState(rn(rn({},s,u+v),"brushMoveStartX",n.pageX),function(){y&&N()&&y(w)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,s=this.state,l=s.scaleValues,c=s.startX,u=s.endX,d=this.state[i],f=l.indexOf(d);if(f!==-1){var h=f+n;if(!(h===-1||h>=l.length)){var m=l[h];i==="startX"&&m>=u||i==="endX"&&m<=c||this.setState(rn({},i,m),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,s=n.width,l=n.height,c=n.fill,u=n.stroke;return T.createElement("rect",{stroke:u,fill:c,x:i,y:a,width:s,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,s=n.width,l=n.height,c=n.data,u=n.children,d=n.padding,f=b.Children.only(u);return f?T.cloneElement(f,{x:i,y:a,width:s,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,s,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,h=c.traveller,m=c.ariaLabel,y=c.data,p=c.startIndex,x=c.endIndex,g=Math.max(n,this.props.x),v=Rx(Rx({},we(this.props,!1)),{},{x:g,y:u,width:d,height:f}),w=m||"Min value: ".concat((a=y[p])===null||a===void 0?void 0:a.name,", Max value: ").concat((s=y[x])===null||s===void 0?void 0:s.name);return T.createElement(Be,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(j){["ArrowLeft","ArrowRight"].includes(j.key)&&(j.preventDefault(),j.stopPropagation(),l.handleTravellerMoveKeyboard(j.key==="ArrowRight"?1:-1,i))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,v))}},{key:"renderSlide",value:function(n,i){var a=this.props,s=a.y,l=a.height,c=a.stroke,u=a.travellerWidth,d=Math.min(n,i)+u,f=Math.max(Math.abs(i-n)-u,0);return T.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:s,width:f,height:l})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,s=n.y,l=n.height,c=n.travellerWidth,u=n.stroke,d=this.state,f=d.startX,h=d.endX,m=5,y={pointerEvents:"none",fill:u};return T.createElement(Be,{className:"recharts-brush-texts"},T.createElement(wl,sy({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-m,y:s+l/2},y),this.getTextOfTick(i)),T.createElement(wl,sy({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+m,y:s+l/2},y),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,s=n.children,l=n.x,c=n.y,u=n.width,d=n.height,f=n.alwaysShowText,h=this.state,m=h.startX,y=h.endX,p=h.isTextActive,x=h.isSlideMoving,g=h.isTravellerMoving,v=h.isTravellerFocused;if(!i||!i.length||!re(l)||!re(c)||!re(u)||!re(d)||u<=0||d<=0)return null;var w=$e("recharts-brush",a),_=T.Children.count(s)===1,j=Owe("userSelect","none");return T.createElement(Be,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:j},this.renderBackground(),_&&this.renderPanorama(),this.renderSlide(m,y),this.renderTravellerLayer(m,"startX"),this.renderTravellerLayer(y,"endX"),(p||x||g||v||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,s=n.width,l=n.height,c=n.stroke,u=Math.floor(a+l/2)-1;return T.createElement(T.Fragment,null,T.createElement("rect",{x:i,y:a,width:s,height:l,fill:c,stroke:"none"}),T.createElement("line",{x1:i+1,y1:u,x2:i+s-1,y2:u,fill:"none",stroke:"#fff"}),T.createElement("line",{x1:i+1,y1:u+2,x2:i+s-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return T.isValidElement(n)?a=T.cloneElement(n,i):ke(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,s=n.width,l=n.x,c=n.travellerWidth,u=n.updateId,d=n.startIndex,f=n.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return Rx({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s},a&&a.length?Iwe({data:a,width:s,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||l!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([l,l+s-c]);var h=i.scale.domain().map(function(m){return i.scale(m)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,s=0,l=a-1;l-s>1;){var c=Math.floor((s+l)/2);n[c]>i?l=c:s=c}return i>=n[l]?l:s}}])}(b.PureComponent);rn(hu,"displayName","Brush");rn(hu,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Dwe=E_;function Lwe(e,t){var r;return Dwe(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var Fwe=Lwe,Bwe=vR,zwe=qi,Uwe=Fwe,Wwe=Jr,Vwe=$0;function Hwe(e,t,r){var n=Wwe(e)?Bwe:Uwe;return r&&Vwe(e,t,r)&&(t=void 0),n(e,zwe(t))}var qwe=Hwe;const Kwe=Xe(qwe);var Bi=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},MP=BR;function Gwe(e,t,r){t=="__proto__"&&MP?MP(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Ywe=Gwe,Zwe=Ywe,Xwe=LR,Qwe=qi;function Jwe(e,t){var r={};return t=Qwe(t),Xwe(e,function(n,i,a){Zwe(r,i,t(n,i,a))}),r}var e1e=Jwe;const t1e=Xe(e1e);function r1e(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function x1e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function b1e(e,t){var r=e.x,n=e.y,i=v1e(e,m1e),a="".concat(r),s=parseInt(a,10),l="".concat(n),c=parseInt(l,10),u="".concat(t.height||i.height),d=parseInt(u,10),f="".concat(t.width||i.width),h=parseInt(f,10);return Ad(Ad(Ad(Ad(Ad({},t),i),s?{x:s}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function IP(e){return T.createElement(wI,q1({shapeType:"rectangle",propTransformer:b1e,activeClassName:"recharts-active-bar"},e))}var w1e=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=re(n)||yre(n);return a?t(n,i):(a||Nl(),r)}},j1e=["value","background"],AI;function mu(e){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mu(e)}function _1e(e,t){if(e==null)return{};var r=N1e(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function N1e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ly(){return ly=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(I)0&&Math.abs(O)0&&($=Math.min((q||0)-(O[ee-1]||0),$))}),Number.isFinite($)){var I=$/P,D=p.layout==="vertical"?n.height:n.width;if(p.padding==="gap"&&(S=I*D/2),p.padding==="no-gap"){var L=Rr(t.barCategoryGap,I*D),R=I*D/2;S=R-L-(R-L)/D*L}}}i==="xAxis"?E=[n.left+(w.left||0)+(S||0),n.left+n.width-(w.right||0)-(S||0)]:i==="yAxis"?E=c==="horizontal"?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(S||0),n.top+n.height-(w.bottom||0)-(S||0)]:E=p.range,j&&(E=[E[1],E[0]]);var M=Y6(p,a,h),B=M.scale,U=M.realScaleType;B.domain(g).range(E),Z6(B);var W=X6(B,ri(ri({},p),{},{realScaleType:U}));i==="xAxis"?(C=x==="top"&&!_||x==="bottom"&&_,k=n.left,A=f[N]-C*p.height):i==="yAxis"&&(C=x==="left"&&!_||x==="right"&&_,k=f[N]-C*p.width,A=n.top);var Z=ri(ri(ri({},p),W),{},{realScaleType:U,x:k,y:A,scale:B,width:i==="xAxis"?n.width:p.width,height:i==="yAxis"?n.height:p.height});return Z.bandSize=Kg(Z,W),!p.hide&&i==="xAxis"?f[N]+=(C?-1:1)*Z.height:p.hide||(f[N]+=(C?-1:1)*Z.width),ri(ri({},m),{},X0({},y,Z))},{})},$I=function(t,r){var n=t.x,i=t.y,a=r.x,s=r.y;return{x:Math.min(n,a),y:Math.min(i,s),width:Math.abs(a-n),height:Math.abs(s-i)}},R1e=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return $I({x:r,y:n},{x:i,y:a})},MI=function(){function e(t){T1e(this,e),this.scale=t}return $1e(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+s}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();X0(MI,"EPS",1e-4);var eN=function(t){var r=Object.keys(t).reduce(function(n,i){return ri(ri({},n),{},X0({},i,MI.create(t[i])))},{});return ri(ri({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=a.bandAware,l=a.position;return t1e(i,function(c,u){return r[u].apply(c,{bandAware:s,position:l})})},isInRange:function(i){return OI(i,function(a,s){return r[s].isInRange(a)})}})};function I1e(e){return(e%180+180)%180}var D1e=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=I1e(i),s=a*Math.PI/180,l=Math.atan(n/r),c=s>l&&s-1?i[a?t[s]:s]:void 0}}var U1e=z1e,W1e=NI;function V1e(e){var t=W1e(e),r=t%1;return t===t?r?t-r:t:0}var H1e=V1e,q1e=TR,K1e=qi,G1e=H1e,Y1e=Math.max;function Z1e(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:G1e(r);return i<0&&(i=Y1e(n+i,0)),q1e(e,K1e(t),i)}var X1e=Z1e,Q1e=U1e,J1e=X1e,eje=Q1e(J1e),tje=eje;const rje=Xe(tje);var nje=_te(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),tN=b.createContext(void 0),rN=b.createContext(void 0),RI=b.createContext(void 0),II=b.createContext({}),DI=b.createContext(void 0),LI=b.createContext(0),FI=b.createContext(0),zP=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,s=t.clipPathId,l=t.children,c=t.width,u=t.height,d=nje(a);return T.createElement(tN.Provider,{value:n},T.createElement(rN.Provider,{value:i},T.createElement(II.Provider,{value:a},T.createElement(RI.Provider,{value:d},T.createElement(DI.Provider,{value:s},T.createElement(LI.Provider,{value:u},T.createElement(FI.Provider,{value:c},l)))))))},ije=function(){return b.useContext(DI)},BI=function(t){var r=b.useContext(tN);r==null&&Nl();var n=r[t];return n==null&&Nl(),n},aje=function(){var t=b.useContext(tN);return ss(t)},sje=function(){var t=b.useContext(rN),r=rje(t,function(n){return OI(n.domain,Number.isFinite)});return r||ss(t)},zI=function(t){var r=b.useContext(rN);r==null&&Nl();var n=r[t];return n==null&&Nl(),n},oje=function(){var t=b.useContext(RI);return t},lje=function(){return b.useContext(II)},nN=function(){return b.useContext(FI)},iN=function(){return b.useContext(LI)};function pu(e){"@babel/helpers - typeof";return pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pu(e)}function cje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uje(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function Hje(e,t){return GI(e,t+1)}function qje(e,t,r,n,i){for(var a=(n||[]).slice(),s=t.start,l=t.end,c=0,u=1,d=s,f=function(){var y=n==null?void 0:n[c];if(y===void 0)return{v:GI(n,u)};var p=c,x,g=function(){return x===void 0&&(x=r(y,p)),x},v=y.coordinate,w=c===0||hy(e,v,g,d,l);w||(c=0,d=s,u+=1),w&&(d=v+e*(g()/2+i),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function Nh(e){"@babel/helpers - typeof";return Nh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nh(e)}function YP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function br(e){for(var t=1;t0?m.coordinate-x*e:m.coordinate})}else a[h]=m=br(br({},m),{},{tickCoord:m.coordinate});var g=hy(e,m.tickCoord,p,l,c);g&&(c=m.tickCoord-e*(p()/2+i),a[h]=br(br({},m),{},{isShow:!0}))},d=s-1;d>=0;d--)u(d);return a}function Xje(e,t,r,n,i,a){var s=(n||[]).slice(),l=s.length,c=t.start,u=t.end;if(a){var d=n[l-1],f=r(d,l-1),h=e*(d.coordinate+e*f/2-u);s[l-1]=d=br(br({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var m=hy(e,d.tickCoord,function(){return f},c,u);m&&(u=d.tickCoord-e*(f/2+i),s[l-1]=br(br({},d),{},{isShow:!0}))}for(var y=a?l-1:l,p=function(v){var w=s[v],_,j=function(){return _===void 0&&(_=r(w,v)),_};if(v===0){var N=e*(w.coordinate-e*j()/2-c);s[v]=w=br(br({},w),{},{tickCoord:N<0?w.coordinate-N*e:w.coordinate})}else s[v]=w=br(br({},w),{},{tickCoord:w.coordinate});var S=hy(e,w.tickCoord,j,c,u);S&&(c=w.tickCoord+e*(j()/2+i),s[v]=br(br({},w),{},{isShow:!0}))},x=0;x=2?Mr(i[1].coordinate-i[0].coordinate):1,g=Vje(a,x,m);return c==="equidistantPreserveStart"?qje(x,g,p,i,s):(c==="preserveStart"||c==="preserveStartEnd"?h=Xje(x,g,p,i,s,c==="preserveStartEnd"):h=Zje(x,g,p,i,s),h.filter(function(v){return v.isShow}))}var Qje=["viewBox"],Jje=["viewBox"],e2e=["ticks"];function vu(e){"@babel/helpers - typeof";return vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vu(e)}function mc(){return mc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function t2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function r2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XP(e,t){for(var r=0;r0?c(this.props):c(m)),s<=0||l<=0||!y||!y.length?null:T.createElement(Be,{className:$e("recharts-cartesian-axis",u),ref:function(x){n.layerReference=x}},a&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),sr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var s,l=$e(i.className,"recharts-cartesian-axis-tick-value");return T.isValidElement(n)?s=T.cloneElement(n,Kt(Kt({},i),{},{className:l})):ke(n)?s=n(Kt(Kt({},i),{},{className:l})):s=T.createElement(wl,mc({},i,{className:"recharts-cartesian-axis-tick-value"}),a),s}}])}(b.Component);lN(Qu,"displayName","CartesianAxis");lN(Qu,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var c2e=["x1","y1","x2","y2","key"],u2e=["offset"];function Sl(e){"@babel/helpers - typeof";return Sl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sl(e)}function QP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _r(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function m2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var p2e=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,a=t.y,s=t.width,l=t.height,c=t.ry;return T.createElement("rect",{x:i,y:a,ry:c,width:s,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function XI(e,t){var r;if(T.isValidElement(e))r=T.cloneElement(e,t);else if(ke(e))r=e(t);else{var n=t.x1,i=t.y1,a=t.x2,s=t.y2,l=t.key,c=JP(t,c2e),u=we(c,!1);u.offset;var d=JP(u,u2e);r=T.createElement("line",Io({},d,{x1:n,y1:i,x2:a,y2:s,fill:"none",key:l}))}return r}function g2e(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var s=a.map(function(l,c){var u=_r(_r({},e),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return XI(i,u)});return T.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function y2e(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,a=e.verticalPoints;if(!i||!a||!a.length)return null;var s=a.map(function(l,c){var u=_r(_r({},e),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return XI(i,u)});return T.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function v2e(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,s=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(h){return Math.round(h+i-i)}).sort(function(h,m){return h-m});i!==d[0]&&d.unshift(0);var f=d.map(function(h,m){var y=!d[m+1],p=y?i+s-h:d[m+1]-h;if(p<=0)return null;var x=m%t.length;return T.createElement("rect",{key:"react-".concat(m),y:h,x:n,height:p,width:a,stroke:"none",fill:t[x],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return T.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function x2e(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,a=e.x,s=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var d=u.map(function(h){return Math.round(h+a-a)}).sort(function(h,m){return h-m});a!==d[0]&&d.unshift(0);var f=d.map(function(h,m){var y=!d[m+1],p=y?a+l-h:d[m+1]-h;if(p<=0)return null;var x=m%n.length;return T.createElement("rect",{key:"react-".concat(m),x:h,y:s,width:p,height:c,stroke:"none",fill:n[x],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return T.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var b2e=function(t,r){var n=t.xAxis,i=t.width,a=t.height,s=t.offset;return G6(oN(_r(_r(_r({},Qu.defaultProps),n),{},{ticks:ua(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),s.left,s.left+s.width,r)},w2e=function(t,r){var n=t.yAxis,i=t.width,a=t.height,s=t.offset;return G6(oN(_r(_r(_r({},Qu.defaultProps),n),{},{ticks:ua(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),s.top,s.top+s.height,r)},Hl={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Vd(e){var t,r,n,i,a,s,l=nN(),c=iN(),u=lje(),d=_r(_r({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Hl.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Hl.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Hl.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Hl.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:Hl.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:Hl.verticalFill,x:re(e.x)?e.x:u.left,y:re(e.y)?e.y:u.top,width:re(e.width)?e.width:u.width,height:re(e.height)?e.height:u.height}),f=d.x,h=d.y,m=d.width,y=d.height,p=d.syncWithTicks,x=d.horizontalValues,g=d.verticalValues,v=aje(),w=sje();if(!re(m)||m<=0||!re(y)||y<=0||!re(f)||f!==+f||!re(h)||h!==+h)return null;var _=d.verticalCoordinatesGenerator||b2e,j=d.horizontalCoordinatesGenerator||w2e,N=d.horizontalPoints,S=d.verticalPoints;if((!N||!N.length)&&ke(j)){var E=x&&x.length,k=j({yAxis:w?_r(_r({},w),{},{ticks:E?x:w.ticks}):void 0,width:l,height:c,offset:u},E?!0:p);mi(Array.isArray(k),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Sl(k),"]")),Array.isArray(k)&&(N=k)}if((!S||!S.length)&&ke(_)){var A=g&&g.length,C=_({xAxis:v?_r(_r({},v),{},{ticks:A?g:v.ticks}):void 0,width:l,height:c,offset:u},A?!0:p);mi(Array.isArray(C),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Sl(C),"]")),Array.isArray(C)&&(S=C)}return T.createElement("g",{className:"recharts-cartesian-grid"},T.createElement(p2e,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),T.createElement(g2e,Io({},d,{offset:u,horizontalPoints:N,xAxis:v,yAxis:w})),T.createElement(y2e,Io({},d,{offset:u,verticalPoints:S,xAxis:v,yAxis:w})),T.createElement(v2e,Io({},d,{horizontalPoints:N})),T.createElement(x2e,Io({},d,{verticalPoints:S})))}Vd.displayName="CartesianGrid";var j2e=["type","layout","connectNulls","ref"],_2e=["key"];function xu(e){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xu(e)}function e5(e,t){if(e==null)return{};var r=N2e(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function N2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function hf(){return hf=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rf){m=[].concat(ql(c.slice(0,y)),[f-p]);break}var x=m.length%2===0?[0,h]:[h];return[].concat(ql(t.repeat(c,d)),ql(m),x).map(function(g){return"".concat(g,"px")}).join(", ")}),ni(r,"id",Cl("recharts-line-")),ni(r,"pathRef",function(s){r.mainCurve=s}),ni(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),ni(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return M2e(t,e),P2e(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.points,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,f=hn(d,Qh);if(!f)return null;var h=function(p,x){return{x:p.x,y:p.y,value:p.value,errorVal:Mt(p.payload,x)}},m={clipPath:n?"url(#clipPath-".concat(i,")"):null};return T.createElement(Be,m,f.map(function(y){return T.cloneElement(y,{key:"bar-".concat(y.props.dataKey),data:s,xAxis:l,yAxis:c,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,i,a){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,d=l.dataKey,f=we(this.props,!1),h=we(c,!0),m=u.map(function(p,x){var g=tn(tn(tn({key:"dot-".concat(x),r:3},f),h),{},{index:x,cx:p.x,cy:p.y,value:p.value,dataKey:d,payload:p.payload,points:u});return t.renderDotItem(c,g)}),y={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return T.createElement(Be,hf({className:"recharts-line-dots",key:"dots"},y),m)}},{key:"renderCurveStatically",value:function(n,i,a,s){var l=this.props,c=l.type,u=l.layout,d=l.connectNulls;l.ref;var f=e5(l,j2e),h=tn(tn(tn({},we(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},s),{},{type:c,layout:u,connectNulls:d});return T.createElement(tl,hf({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,s=this.props,l=s.points,c=s.strokeDasharray,u=s.isAnimationActive,d=s.animationBegin,f=s.animationDuration,h=s.animationEasing,m=s.animationId,y=s.animateNewValues,p=s.width,x=s.height,g=this.state,v=g.prevPoints,w=g.totalLength;return T.createElement(gi,{begin:d,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(_){var j=_.t;if(v){var N=v.length/l.length,S=l.map(function(P,$){var O=Math.floor($*N);if(v[O]){var I=v[O],D=Xt(I.x,P.x),L=Xt(I.y,P.y);return tn(tn({},P),{},{x:D(j),y:L(j)})}if(y){var R=Xt(p*2,P.x),M=Xt(x/2,P.y);return tn(tn({},P),{},{x:R(j),y:M(j)})}return tn(tn({},P),{},{x:P.x,y:P.y})});return a.renderCurveStatically(S,n,i)}var E=Xt(0,w),k=E(j),A;if(c){var C="".concat(c).split(/[,\s]+/gim).map(function(P){return parseFloat(P)});A=a.getStrokeDasharray(k,w,C)}else A=a.generateSimpleStrokeDasharray(w,k);return a.renderCurveStatically(l,n,i,{strokeDasharray:A})})}},{key:"renderCurve",value:function(n,i){var a=this.props,s=a.points,l=a.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return l&&s&&s.length&&(!u&&d>0||!jl(u,s))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(s,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,s=i.dot,l=i.points,c=i.className,u=i.xAxis,d=i.yAxis,f=i.top,h=i.left,m=i.width,y=i.height,p=i.isAnimationActive,x=i.id;if(a||!l||!l.length)return null;var g=this.state.isAnimationFinished,v=l.length===1,w=$e("recharts-line",c),_=u&&u.allowDataOverflow,j=d&&d.allowDataOverflow,N=_||j,S=Ae(x)?this.id:x,E=(n=we(s,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},k=E.r,A=k===void 0?3:k,C=E.strokeWidth,P=C===void 0?2:C,$=WM(s)?s:{},O=$.clipDot,I=O===void 0?!0:O,D=A*2+P;return T.createElement(Be,{className:w},_||j?T.createElement("defs",null,T.createElement("clipPath",{id:"clipPath-".concat(S)},T.createElement("rect",{x:_?h:h-m/2,y:j?f:f-y/2,width:_?m:m*2,height:j?y:y*2})),!I&&T.createElement("clipPath",{id:"clipPath-dots-".concat(S)},T.createElement("rect",{x:h-D/2,y:f-D/2,width:m+D,height:y+D}))):null,!v&&this.renderCurve(N,S),this.renderErrorBar(N,S),(v||s)&&this.renderDots(N,I,S),(!p||g)&&Fi.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(ql(n),[0]):n,s=[],l=0;l=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function L2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Do(){return Do=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!jl(d,s)||!jl(f,l))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(s,l,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,s=i.dot,l=i.points,c=i.className,u=i.top,d=i.left,f=i.xAxis,h=i.yAxis,m=i.width,y=i.height,p=i.isAnimationActive,x=i.id;if(a||!l||!l.length)return null;var g=this.state.isAnimationFinished,v=l.length===1,w=$e("recharts-area",c),_=f&&f.allowDataOverflow,j=h&&h.allowDataOverflow,N=_||j,S=Ae(x)?this.id:x,E=(n=we(s,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},k=E.r,A=k===void 0?3:k,C=E.strokeWidth,P=C===void 0?2:C,$=WM(s)?s:{},O=$.clipDot,I=O===void 0?!0:O,D=A*2+P;return T.createElement(Be,{className:w},_||j?T.createElement("defs",null,T.createElement("clipPath",{id:"clipPath-".concat(S)},T.createElement("rect",{x:_?d:d-m/2,y:j?u:u-y/2,width:_?m:m*2,height:j?y:y*2})),!I&&T.createElement("clipPath",{id:"clipPath-dots-".concat(S)},T.createElement("rect",{x:d-D/2,y:u-D/2,width:m+D,height:y+D}))):null,v?null:this.renderArea(N,S),(s||v)&&this.renderDots(N,I,S),(!p||g)&&Fi.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(b.PureComponent);eD=Aa;Mi(Aa,"displayName","Area");Mi(Aa,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!no.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Mi(Aa,"getBaseValue",function(e,t,r,n){var i=e.layout,a=e.baseValue,s=t.props.baseValue,l=s??a;if(re(l)&&typeof l=="number")return l;var c=i==="horizontal"?n:r,u=c.scale.domain();if(c.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return l==="dataMin"?f:l==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});Mi(Aa,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,i=e.yAxis,a=e.xAxisTicks,s=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,m=t.layout,y=u&&u.length,p=eD.getBaseValue(t,r,n,i),x=m==="horizontal",g=!1,v=f.map(function(_,j){var N;y?N=u[d+j]:(N=Mt(_,c),Array.isArray(N)?g=!0:N=[p,N]);var S=N[1]==null||y&&Mt(_,c)==null;return x?{x:qg({axis:n,ticks:a,bandSize:l,entry:_,index:j}),y:S?null:i.scale(N[1]),value:N,payload:_}:{x:S?null:n.scale(N[1]),y:qg({axis:i,ticks:s,bandSize:l,entry:_,index:j}),value:N,payload:_}}),w;return y||g?w=v.map(function(_){var j=Array.isArray(_.value)?_.value[0]:null;return x?{x:_.x,y:j!=null&&_.y!=null?i.scale(j):null}:{x:j!=null?n.scale(j):null,y:_.y}}):w=x?i.scale(p):n.scale(p),qa({points:v,baseLine:w,layout:m,isRange:g},h)});Mi(Aa,"renderDotItem",function(e,t){var r;if(T.isValidElement(e))r=T.cloneElement(e,t);else if(ke(e))r=e(t);else{var n=$e("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=tD(t,D2e);r=T.createElement(Jh,Do({},a,{key:i,className:n}))}return r});function wu(e){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wu(e)}function q2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K2e(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $_e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function M_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R_e(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?s:t&&t.length&&re(i)&&re(a)?t.slice(i,a+1):[]};function yD(e){return e==="number"?[0,"auto"]:void 0}var fj=function(t,r,n,i){var a=t.graphicalItems,s=t.tooltipAxis,l=rv(r,t);return n<0||!a||!a.length||n>=l.length?null:a.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:r;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(s.dataKey&&!s.allowDuplicatedCategory){var m=f===void 0?l:f;h=wg(m,s.dataKey,i)}else h=f&&f[n]||l[n];return h?[].concat(Nu(c),[J6(u,h)]):c},[])},u5=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},s=K_e(a,n),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=aye(s,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=fj(t,r,d,f),m=G_e(n,l,d,a);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:m}}return null},Y_e=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,s=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,m=K6(d,a);return n.reduce(function(y,p){var x,g=p.type.defaultProps!==void 0?X(X({},p.type.defaultProps),p.props):p.props,v=g.type,w=g.dataKey,_=g.allowDataOverflow,j=g.allowDuplicatedCategory,N=g.scale,S=g.ticks,E=g.includeHidden,k=g[s];if(y[k])return y;var A=rv(t.data,{graphicalItems:i.filter(function(W){var Z,q=s in W.props?W.props[s]:(Z=W.type.defaultProps)===null||Z===void 0?void 0:Z[s];return q===k}),dataStartIndex:c,dataEndIndex:u}),C=A.length,P,$,O;w_e(g.domain,_,v)&&(P=S1(g.domain,null,_),m&&(v==="number"||N!=="auto")&&(O=cf(A,w,"category")));var I=yD(v);if(!P||P.length===0){var D,L=(D=g.domain)!==null&&D!==void 0?D:I;if(w){if(P=cf(A,w,v),v==="category"&&m){var R=xre(P);j&&R?($=P,P=ay(0,C)):j||(P=PA(L,P,p).reduce(function(W,Z){return W.indexOf(Z)>=0?W:[].concat(Nu(W),[Z])},[]))}else if(v==="category")j?P=P.filter(function(W){return W!==""&&!Ae(W)}):P=PA(L,P,p).reduce(function(W,Z){return W.indexOf(Z)>=0||Z===""||Ae(Z)?W:[].concat(Nu(W),[Z])},[]);else if(v==="number"){var M=uye(A,i.filter(function(W){var Z,q,ee=s in W.props?W.props[s]:(Z=W.type.defaultProps)===null||Z===void 0?void 0:Z[s],le="hide"in W.props?W.props.hide:(q=W.type.defaultProps)===null||q===void 0?void 0:q.hide;return ee===k&&(E||!le)}),w,a,d);M&&(P=M)}m&&(v==="number"||N!=="auto")&&(O=cf(A,w,"category"))}else m?P=ay(0,C):l&&l[k]&&l[k].hasStack&&v==="number"?P=h==="expand"?[0,1]:Q6(l[k].stackGroups,c,u):P=q6(A,i.filter(function(W){var Z=s in W.props?W.props[s]:W.type.defaultProps[s],q="hide"in W.props?W.props.hide:W.type.defaultProps.hide;return Z===k&&(E||!q)}),v,d,!0);if(v==="number")P=cj(f,P,k,a,S),L&&(P=S1(L,P,_));else if(v==="category"&&L){var B=L,U=P.every(function(W){return B.indexOf(W)>=0});U&&(P=B)}}return X(X({},y),{},Se({},k,X(X({},g),{},{axisType:a,domain:P,categoricalDomain:O,duplicateDomain:$,originalDomain:(x=g.domain)!==null&&x!==void 0?x:I,isCategorical:m,layout:d})))},{})},Z_e=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,s=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,h=rv(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),m=h.length,y=K6(d,a),p=-1;return n.reduce(function(x,g){var v=g.type.defaultProps!==void 0?X(X({},g.type.defaultProps),g.props):g.props,w=v[s],_=yD("number");if(!x[w]){p++;var j;return y?j=ay(0,m):l&&l[w]&&l[w].hasStack?(j=Q6(l[w].stackGroups,c,u),j=cj(f,j,w,a)):(j=S1(_,q6(h,n.filter(function(N){var S,E,k=s in N.props?N.props[s]:(S=N.type.defaultProps)===null||S===void 0?void 0:S[s],A="hide"in N.props?N.props.hide:(E=N.type.defaultProps)===null||E===void 0?void 0:E.hide;return k===w&&!A}),"number",d),i.defaultProps.allowDataOverflow),j=cj(f,j,w,a)),X(X({},x),{},Se({},w,X(X({axisType:a},i.defaultProps),{},{hide:!0,orientation:fn(H_e,"".concat(a,".").concat(p%2),null),domain:j,originalDomain:_,isCategorical:y,layout:d})))}return x},{})},X_e=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,s=r.graphicalItems,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.children,f="".concat(i,"Id"),h=hn(d,a),m={};return h&&h.length?m=Y_e(t,{axes:h,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):s&&s.length&&(m=Z_e(t,{Axis:a,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),m},Q_e=function(t){var r=ss(t),n=ua(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:O_(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Kg(r,n)}},d5=function(t){var r=t.children,n=t.defaultShowTooltip,i=sn(r,hu),a=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!n}},J_e=function(t){return!t||!t.length?!1:t.some(function(r){var n=pa(r&&r.type);return n&&n.indexOf("Bar")>=0})},f5=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},eNe=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,s=a===void 0?{}:a,l=t.yAxisMap,c=l===void 0?{}:l,u=n.width,d=n.height,f=n.children,h=n.margin||{},m=sn(f,hu),y=sn(f,Us),p=Object.keys(c).reduce(function(j,N){var S=c[N],E=S.orientation;return!S.mirror&&!S.hide?X(X({},j),{},Se({},E,j[E]+S.width)):j},{left:h.left||0,right:h.right||0}),x=Object.keys(s).reduce(function(j,N){var S=s[N],E=S.orientation;return!S.mirror&&!S.hide?X(X({},j),{},Se({},E,fn(j,"".concat(E))+S.height)):j},{top:h.top||0,bottom:h.bottom||0}),g=X(X({},x),p),v=g.bottom;m&&(g.bottom+=m.props.height||hu.defaultProps.height),y&&r&&(g=lye(g,i,n,r));var w=u-g.left-g.right,_=d-g.top-g.bottom;return X(X({brushBottom:v},g),{},{width:Math.max(w,0),height:Math.max(_,0)})},tNe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},nv=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,s=t.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(g,v){var w=v.graphicalItems,_=v.stackGroups,j=v.offset,N=v.updateId,S=v.dataStartIndex,E=v.dataEndIndex,k=g.barSize,A=g.layout,C=g.barGap,P=g.barCategoryGap,$=g.maxBarSize,O=f5(A),I=O.numericAxisName,D=O.cateAxisName,L=J_e(w),R=[];return w.forEach(function(M,B){var U=rv(g.data,{graphicalItems:[M],dataStartIndex:S,dataEndIndex:E}),W=M.type.defaultProps!==void 0?X(X({},M.type.defaultProps),M.props):M.props,Z=W.dataKey,q=W.maxBarSize,ee=W["".concat(I,"Id")],le=W["".concat(D,"Id")],ve={},Ne=c.reduce(function(H,K){var se=v["".concat(K.axisType,"Map")],ie=W["".concat(K.axisType,"Id")];se&&se[ie]||K.axisType==="zAxis"||Nl();var te=se[ie];return X(X({},H),{},Se(Se({},K.axisType,te),"".concat(K.axisType,"Ticks"),ua(te)))},ve),J=Ne[D],oe=Ne["".concat(D,"Ticks")],me=_&&_[ee]&&_[ee].hasStack&&xye(M,_[ee].stackGroups),Q=pa(M.type).indexOf("Bar")>=0,Pe=Kg(J,oe),be=[],Ee=L&&sye({barSize:k,stackGroups:_,totalSize:tNe(Ne,D)});if(Q){var Re,Y,V=Ae(q)?$:q,ce=(Re=(Y=Kg(J,oe,!0))!==null&&Y!==void 0?Y:V)!==null&&Re!==void 0?Re:0;be=oye({barGap:C,barCategoryGap:P,bandSize:ce!==Pe?ce:Pe,sizeList:Ee[le],maxBarSize:V}),ce!==Pe&&(be=be.map(function(H){return X(X({},H),{},{position:X(X({},H.position),{},{offset:H.position.offset-ce/2})})}))}var F=M&&M.type&&M.type.getComposedData;F&&R.push({props:X(X({},F(X(X({},Ne),{},{displayedData:U,props:g,dataKey:Z,item:M,bandSize:Pe,barPosition:be,offset:j,stackedData:me,layout:A,dataStartIndex:S,dataEndIndex:E}))),{},Se(Se(Se({key:M.key||"item-".concat(B)},I,Ne[I]),D,Ne[D]),"animationId",N)),childIndex:Cre(M,g.children),item:M})}),R},m=function(g,v){var w=g.props,_=g.dataStartIndex,j=g.dataEndIndex,N=g.updateId;if(!$E({props:w}))return null;var S=w.children,E=w.layout,k=w.stackOffset,A=w.data,C=w.reverseStackOrder,P=f5(E),$=P.numericAxisName,O=P.cateAxisName,I=hn(S,n),D=yye(A,I,"".concat($,"Id"),"".concat(O,"Id"),k,C),L=c.reduce(function(W,Z){var q="".concat(Z.axisType,"Map");return X(X({},W),{},Se({},q,X_e(w,X(X({},Z),{},{graphicalItems:I,stackGroups:Z.axisType===$&&D,dataStartIndex:_,dataEndIndex:j}))))},{}),R=eNe(X(X({},L),{},{props:w,graphicalItems:I}),v==null?void 0:v.legendBBox);Object.keys(L).forEach(function(W){L[W]=d(w,L[W],R,W.replace("Map",""),r)});var M=L["".concat(O,"Map")],B=Q_e(M),U=h(w,X(X({},L),{},{dataStartIndex:_,dataEndIndex:j,updateId:N,graphicalItems:I,stackGroups:D,offset:R}));return X(X({formattedGraphicalItems:U,graphicalItems:I,offset:R,stackGroups:D},B),L)},y=function(x){function g(v){var w,_,j;return M_e(this,g),j=D_e(this,g,[v]),Se(j,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Se(j,"accessibilityManager",new b_e),Se(j,"handleLegendBBoxUpdate",function(N){if(N){var S=j.state,E=S.dataStartIndex,k=S.dataEndIndex,A=S.updateId;j.setState(X({legendBBox:N},m({props:j.props,dataStartIndex:E,dataEndIndex:k,updateId:A},X(X({},j.state),{},{legendBBox:N}))))}}),Se(j,"handleReceiveSyncEvent",function(N,S,E){if(j.props.syncId===N){if(E===j.eventEmitterSymbol&&typeof j.props.syncMethod!="function")return;j.applySyncEvent(S)}}),Se(j,"handleBrushChange",function(N){var S=N.startIndex,E=N.endIndex;if(S!==j.state.dataStartIndex||E!==j.state.dataEndIndex){var k=j.state.updateId;j.setState(function(){return X({dataStartIndex:S,dataEndIndex:E},m({props:j.props,dataStartIndex:S,dataEndIndex:E,updateId:k},j.state))}),j.triggerSyncEvent({dataStartIndex:S,dataEndIndex:E})}}),Se(j,"handleMouseEnter",function(N){var S=j.getMouseInfo(N);if(S){var E=X(X({},S),{},{isTooltipActive:!0});j.setState(E),j.triggerSyncEvent(E);var k=j.props.onMouseEnter;ke(k)&&k(E,N)}}),Se(j,"triggeredAfterMouseMove",function(N){var S=j.getMouseInfo(N),E=S?X(X({},S),{},{isTooltipActive:!0}):{isTooltipActive:!1};j.setState(E),j.triggerSyncEvent(E);var k=j.props.onMouseMove;ke(k)&&k(E,N)}),Se(j,"handleItemMouseEnter",function(N){j.setState(function(){return{isTooltipActive:!0,activeItem:N,activePayload:N.tooltipPayload,activeCoordinate:N.tooltipPosition||{x:N.cx,y:N.cy}}})}),Se(j,"handleItemMouseLeave",function(){j.setState(function(){return{isTooltipActive:!1}})}),Se(j,"handleMouseMove",function(N){N.persist(),j.throttleTriggeredAfterMouseMove(N)}),Se(j,"handleMouseLeave",function(N){j.throttleTriggeredAfterMouseMove.cancel();var S={isTooltipActive:!1};j.setState(S),j.triggerSyncEvent(S);var E=j.props.onMouseLeave;ke(E)&&E(S,N)}),Se(j,"handleOuterEvent",function(N){var S=Pre(N),E=fn(j.props,"".concat(S));if(S&&ke(E)){var k,A;/.*touch.*/i.test(S)?A=j.getMouseInfo(N.changedTouches[0]):A=j.getMouseInfo(N),E((k=A)!==null&&k!==void 0?k:{},N)}}),Se(j,"handleClick",function(N){var S=j.getMouseInfo(N);if(S){var E=X(X({},S),{},{isTooltipActive:!0});j.setState(E),j.triggerSyncEvent(E);var k=j.props.onClick;ke(k)&&k(E,N)}}),Se(j,"handleMouseDown",function(N){var S=j.props.onMouseDown;if(ke(S)){var E=j.getMouseInfo(N);S(E,N)}}),Se(j,"handleMouseUp",function(N){var S=j.props.onMouseUp;if(ke(S)){var E=j.getMouseInfo(N);S(E,N)}}),Se(j,"handleTouchMove",function(N){N.changedTouches!=null&&N.changedTouches.length>0&&j.throttleTriggeredAfterMouseMove(N.changedTouches[0])}),Se(j,"handleTouchStart",function(N){N.changedTouches!=null&&N.changedTouches.length>0&&j.handleMouseDown(N.changedTouches[0])}),Se(j,"handleTouchEnd",function(N){N.changedTouches!=null&&N.changedTouches.length>0&&j.handleMouseUp(N.changedTouches[0])}),Se(j,"handleDoubleClick",function(N){var S=j.props.onDoubleClick;if(ke(S)){var E=j.getMouseInfo(N);S(E,N)}}),Se(j,"handleContextMenu",function(N){var S=j.props.onContextMenu;if(ke(S)){var E=j.getMouseInfo(N);S(E,N)}}),Se(j,"triggerSyncEvent",function(N){j.props.syncId!==void 0&&Dx.emit(Lx,j.props.syncId,N,j.eventEmitterSymbol)}),Se(j,"applySyncEvent",function(N){var S=j.props,E=S.layout,k=S.syncMethod,A=j.state.updateId,C=N.dataStartIndex,P=N.dataEndIndex;if(N.dataStartIndex!==void 0||N.dataEndIndex!==void 0)j.setState(X({dataStartIndex:C,dataEndIndex:P},m({props:j.props,dataStartIndex:C,dataEndIndex:P,updateId:A},j.state)));else if(N.activeTooltipIndex!==void 0){var $=N.chartX,O=N.chartY,I=N.activeTooltipIndex,D=j.state,L=D.offset,R=D.tooltipTicks;if(!L)return;if(typeof k=="function")I=k(R,N);else if(k==="value"){I=-1;for(var M=0;M=0){var me,Q;if($.dataKey&&!$.allowDuplicatedCategory){var Pe=typeof $.dataKey=="function"?oe:"payload.".concat($.dataKey.toString());me=wg(M,Pe,I),Q=B&&U&&wg(U,Pe,I)}else me=M==null?void 0:M[O],Q=B&&U&&U[O];if(le||ee){var be=N.props.activeIndex!==void 0?N.props.activeIndex:O;return[b.cloneElement(N,X(X(X({},k.props),Ne),{},{activeIndex:be})),null,null]}if(!Ae(me))return[J].concat(Nu(j.renderActivePoints({item:k,activePoint:me,basePoint:Q,childIndex:O,isRange:B})))}else{var Ee,Re=(Ee=j.getItemByXY(j.state.activeCoordinate))!==null&&Ee!==void 0?Ee:{graphicalItem:J},Y=Re.graphicalItem,V=Y.item,ce=V===void 0?N:V,F=Y.childIndex,H=X(X(X({},k.props),Ne),{},{activeIndex:F});return[b.cloneElement(ce,H),null,null]}return B?[J,null,null]:[J,null]}),Se(j,"renderCustomized",function(N,S,E){return b.cloneElement(N,X(X({key:"recharts-customized-".concat(E)},j.props),j.state))}),Se(j,"renderMap",{CartesianGrid:{handler:qm,once:!0},ReferenceArea:{handler:j.renderReferenceElement},ReferenceLine:{handler:qm},ReferenceDot:{handler:j.renderReferenceElement},XAxis:{handler:qm},YAxis:{handler:qm},Brush:{handler:j.renderBrush,once:!0},Bar:{handler:j.renderGraphicChild},Line:{handler:j.renderGraphicChild},Area:{handler:j.renderGraphicChild},Radar:{handler:j.renderGraphicChild},RadialBar:{handler:j.renderGraphicChild},Scatter:{handler:j.renderGraphicChild},Pie:{handler:j.renderGraphicChild},Funnel:{handler:j.renderGraphicChild},Tooltip:{handler:j.renderCursor,once:!0},PolarGrid:{handler:j.renderPolarGrid,once:!0},PolarAngleAxis:{handler:j.renderPolarAxis},PolarRadiusAxis:{handler:j.renderPolarAxis},Customized:{handler:j.renderCustomized}}),j.clipPathId="".concat((w=v.id)!==null&&w!==void 0?w:Cl("recharts"),"-clip"),j.throttleTriggeredAfterMouseMove=qR(j.triggeredAfterMouseMove,(_=v.throttleDelay)!==null&&_!==void 0?_:1e3/60),j.state={},j}return B_e(g,x),I_e(g,[{key:"componentDidMount",value:function(){var w,_;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,_=w.children,j=w.data,N=w.height,S=w.layout,E=sn(_,Wr);if(E){var k=E.props.defaultIndex;if(!(typeof k!="number"||k<0||k>this.state.tooltipTicks.length-1)){var A=this.state.tooltipTicks[k]&&this.state.tooltipTicks[k].value,C=fj(this.state,j,k,A),P=this.state.tooltipTicks[k].coordinate,$=(this.state.offset.top+N)/2,O=S==="horizontal",I=O?{x:P,y:$}:{y:P,x:$},D=this.state.formattedGraphicalItems.find(function(R){var M=R.item;return M.type.name==="Scatter"});D&&(I=X(X({},I),D.props.points[k].tooltipPosition),C=D.props.points[k].tooltipPayload);var L={activeTooltipIndex:k,isTooltipActive:!0,activeLabel:A,activePayload:C,activeCoordinate:I};this.setState(L),this.renderCursor(E),this.accessibilityManager.setIndex(k)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,_){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==_.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var j,N;this.accessibilityManager.setDetails({offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(N=this.props.margin.top)!==null&&N!==void 0?N:0}})}return null}},{key:"componentDidUpdate",value:function(w){Uw([sn(w.children,Wr)],[sn(this.props.children,Wr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=sn(this.props.children,Wr);if(w&&typeof w.props.shared=="boolean"){var _=w.props.shared?"axis":"item";return l.indexOf(_)>=0?_:a}return a}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var _=this.container,j=_.getBoundingClientRect(),N=nhe(j),S={chartX:Math.round(w.pageX-N.left),chartY:Math.round(w.pageY-N.top)},E=j.width/_.offsetWidth||1,k=this.inRange(S.chartX,S.chartY,E);if(!k)return null;var A=this.state,C=A.xAxisMap,P=A.yAxisMap,$=this.getTooltipEventType(),O=u5(this.state,this.props.data,this.props.layout,k);if($!=="axis"&&C&&P){var I=ss(C).scale,D=ss(P).scale,L=I&&I.invert?I.invert(S.chartX):null,R=D&&D.invert?D.invert(S.chartY):null;return X(X({},S),{},{xValue:L,yValue:R},O)}return O?X(X({},S),O):null}},{key:"inRange",value:function(w,_){var j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,N=this.props.layout,S=w/j,E=_/j;if(N==="horizontal"||N==="vertical"){var k=this.state.offset,A=S>=k.left&&S<=k.left+k.width&&E>=k.top&&E<=k.top+k.height;return A?{x:S,y:E}:null}var C=this.state,P=C.angleAxisMap,$=C.radiusAxisMap;if(P&&$){var O=ss(P);return $A({x:S,y:E},O)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,_=this.getTooltipEventType(),j=sn(w,Wr),N={};j&&_==="axis"&&(j.props.trigger==="click"?N={onClick:this.handleClick}:N={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var S=jg(this.props,this.handleOuterEvent);return X(X({},S),N)}},{key:"addListener",value:function(){Dx.on(Lx,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Dx.removeListener(Lx,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,_,j){for(var N=this.state.formattedGraphicalItems,S=0,E=N.length;SHa.getExecutions(),refetchInterval:3e4}),{data:a,isLoading:s,error:l}=$r({queryKey:["system-metrics",e],queryFn:async()=>{const g=await fetch(`${gl.baseURL}/api/monitoring/metrics?range=${e}`);if(!g.ok)throw new Error("Metrics not available");return g.json()},refetchInterval:3e4,retry:!1}),u=(()=>{if(!r.length||i)return null;const g=[],v=new Date,w=e==="24h"?24:e==="7d"?168:720,_=e==="24h"?1:e==="7d"?6:24;for(let j=w;j>=0;j-=_){const N=new Date(v.getTime()-j*60*60*1e3),S=new Date(v.getTime()-(j-_)*60*60*1e3),E=r.filter(k=>{const A=new Date(k.started_at);return A>=N&&Ak.status==="running").length,completed_executions:E.filter(k=>k.status==="completed").length,failed_executions:E.filter(k=>k.status==="failed").length,response_time:0})}return g})(),d=Array.isArray(r)?r:[],f={total:d.length,completed:d.filter(g=>g.status==="completed").length,failed:d.filter(g=>g.status==="failed").length,running:d.filter(g=>g.status==="running").length,success_rate:d.length>0?Math.round(d.filter(g=>g.status==="completed").length/d.length*100):0},h=[{name:"Completed",value:f.completed,color:"#10B981"},{name:"Failed",value:f.failed,color:"#EF4444"},{name:"Running",value:f.running,color:"#3B82F6"},{name:"Pending",value:d.filter(g=>g.status==="pending").length,color:"#F59E0B"}].filter(g=>g.value>0),m=u?u.slice(-7).map((g,v)=>({day:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"][v%7],executions:g.completed_executions,response_time:g.response_time,success_rate:g.completed_executions>0?g.completed_executions/(g.completed_executions+g.failed_executions)*100:0})):[],y=[];i&&y.push({id:"executions-error",type:"error",message:"Unable to fetch execution data - API connectivity issue",timestamp:new Date().toISOString()}),l&&y.push({id:"metrics-error",type:"warning",message:"System metrics unavailable - Monitoring service not configured",timestamp:new Date().toISOString()}),d.length>0&&d.filter(v=>v.status==="failed"&&v.completed_at).sort((v,w)=>new Date(w.completed_at).getTime()-new Date(v.completed_at).getTime()).slice(0,3).forEach((v,w)=>{y.push({id:`exec-failure-${v.id}`,type:"error",message:`Execution failed: ${v.workflow_name||v.id} - ${v.error||"Unknown error"}`,timestamp:v.completed_at})}),y.length===0&&y.push({id:"system-ok",type:"info",message:"All systems operational",timestamp:new Date().toISOString(),resolved:!0});const p=g=>{const v=new Date(g);return e==="24h"?v.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}):v.toLocaleDateString("en-US",{month:"short",day:"numeric"})},x=g=>{switch(g){case"error":return o.jsx(Kr,{className:"h-5 w-5 text-red-500"});case"warning":return o.jsx(Ls,{className:"h-5 w-5 text-yellow-500"});case"info":return o.jsx(dn,{className:"h-5 w-5 text-blue-500"});default:return o.jsx(Ls,{className:"h-5 w-5 text-gray-500"})}};return o.jsxs("div",{className:"p-6",children:[o.jsx("div",{className:"mb-6",children:o.jsxs("div",{className:"flex justify-between items-center",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Analytics"}),o.jsx("p",{className:"text-gray-600",children:"System performance and execution analytics"})]}),o.jsx("div",{className:"flex items-center space-x-4",children:o.jsxs("select",{value:e,onChange:g=>t(g.target.value),className:"border border-gray-300 rounded-md px-3 py-2 text-sm",children:[o.jsx("option",{value:"24h",children:"Last 24 Hours"}),o.jsx("option",{value:"7d",children:"Last 7 Days"}),o.jsx("option",{value:"30d",children:"Last 30 Days"})]})})]})}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:[o.jsxs("div",{className:"bg-white rounded-lg border p-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:f.total}),o.jsx("p",{className:"text-sm text-gray-500",children:"Total Executions"})]}),o.jsx(Qc,{className:"h-8 w-8 text-blue-500"})]}),o.jsxs("div",{className:"mt-2 flex items-center",children:[o.jsx(ex,{className:"h-4 w-4 text-green-500 mr-1"}),o.jsx("span",{className:"text-sm text-green-600",children:"+12% from yesterday"})]})]}),o.jsxs("div",{className:"bg-white rounded-lg border p-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[f.success_rate,"%"]}),o.jsx("p",{className:"text-sm text-gray-500",children:"Success Rate"})]}),o.jsx(dn,{className:"h-8 w-8 text-green-500"})]}),o.jsxs("div",{className:"mt-2 flex items-center",children:[o.jsx(ex,{className:"h-4 w-4 text-green-500 mr-1"}),o.jsx("span",{className:"text-sm text-green-600",children:"+2.1% improvement"})]})]}),o.jsxs("div",{className:"bg-white rounded-lg border p-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:"2.3s"}),o.jsx("p",{className:"text-sm text-gray-500",children:"Avg Response Time"})]}),o.jsx(hr,{className:"h-8 w-8 text-yellow-500"})]}),o.jsxs("div",{className:"mt-2 flex items-center",children:[o.jsx(qq,{className:"h-4 w-4 text-green-500 mr-1"}),o.jsx("span",{className:"text-sm text-green-600",children:"-0.2s faster"})]})]}),o.jsxs("div",{className:"bg-white rounded-lg border p-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:f.running}),o.jsx("p",{className:"text-sm text-gray-500",children:"Active Executions"})]}),o.jsx(pl,{className:"h-8 w-8 text-purple-500"})]}),o.jsx("div",{className:"mt-2 flex items-center",children:o.jsx("span",{className:"text-sm text-gray-600",children:"Currently processing"})})]})]}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8",children:[o.jsxs("div",{className:"bg-white rounded-lg border p-6",children:[o.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Execution Trends"}),u&&u.length>0?o.jsx(wd,{width:"100%",height:300,children:o.jsxs(h5,{data:u,children:[o.jsx(Vd,{strokeDasharray:"3 3"}),o.jsx(da,{dataKey:"timestamp",tickFormatter:p,interval:"preserveStartEnd"}),o.jsx(fa,{}),o.jsx(Wr,{labelFormatter:g=>p(g),formatter:(g,v)=>[g,v==="completed_executions"?"Completed":"Failed"]}),o.jsx(Us,{}),o.jsx(rl,{type:"monotone",dataKey:"completed_executions",stroke:"#10B981",strokeWidth:2,name:"Completed"}),o.jsx(rl,{type:"monotone",dataKey:"failed_executions",stroke:"#EF4444",strokeWidth:2,name:"Failed"})]})}):o.jsx("div",{className:"flex items-center justify-center h-[300px] bg-gray-50 rounded-lg",children:o.jsxs("div",{className:"text-center",children:[o.jsx(Ls,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),o.jsx("p",{className:"text-gray-600 font-medium",children:"Execution data unavailable"}),o.jsx("p",{className:"text-sm text-gray-500 mt-1",children:i?"API connectivity issue":"No execution data found"})]})})]}),o.jsxs("div",{className:"bg-white rounded-lg border p-6",children:[o.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Resource Usage"}),u&&u.length>0?o.jsx(wd,{width:"100%",height:300,children:o.jsxs(iNe,{data:u,children:[o.jsx(Vd,{strokeDasharray:"3 3"}),o.jsx(da,{dataKey:"timestamp",tickFormatter:p,interval:"preserveStartEnd"}),o.jsx(fa,{domain:[0,100]}),o.jsx(Wr,{labelFormatter:g=>p(g),formatter:(g,v)=>[`${Math.round(g)}%`,v==="cpu_usage"?"CPU":"Memory"]}),o.jsx(Us,{}),o.jsx(Aa,{type:"monotone",dataKey:"cpu_usage",stackId:"1",stroke:"#3B82F6",fill:"#3B82F6",fillOpacity:.3,name:"CPU Usage"}),o.jsx(Aa,{type:"monotone",dataKey:"memory_usage",stackId:"2",stroke:"#8B5CF6",fill:"#8B5CF6",fillOpacity:.3,name:"Memory Usage"})]})}):o.jsx("div",{className:"flex items-center justify-center h-[300px] bg-gray-50 rounded-lg",children:o.jsxs("div",{className:"text-center",children:[o.jsx(pl,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),o.jsx("p",{className:"text-gray-600 font-medium",children:"System metrics unavailable"}),o.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Resource monitoring not configured"})]})})]})]}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8",children:[o.jsxs("div",{className:"bg-white rounded-lg border p-6",children:[o.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Execution Status"}),h.length>0?o.jsx(wd,{width:"100%",height:250,children:o.jsxs(nNe,{children:[o.jsx(Da,{data:h,cx:"50%",cy:"50%",outerRadius:80,dataKey:"value",label:({name:g,percent:v})=>`${g} ${(v*100).toFixed(0)}%`,children:h.map((g,v)=>o.jsx(M0,{fill:g.color},`cell-${v}`))}),o.jsx(Wr,{})]})}):o.jsx("div",{className:"flex items-center justify-center h-[250px] bg-gray-50 rounded-lg",children:o.jsxs("div",{className:"text-center",children:[o.jsx(Qc,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),o.jsx("p",{className:"text-gray-600 font-medium",children:"No execution data"}),o.jsx("p",{className:"text-sm text-gray-500 mt-1",children:i?"Unable to load executions":"No executions found"})]})})]}),o.jsxs("div",{className:"bg-white rounded-lg border p-6",children:[o.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Weekly Performance"}),m.length>0?o.jsx(wd,{width:"100%",height:250,children:o.jsxs(rNe,{data:m,children:[o.jsx(Vd,{strokeDasharray:"3 3"}),o.jsx(da,{dataKey:"day"}),o.jsx(fa,{}),o.jsx(Wr,{}),o.jsx(Rl,{dataKey:"executions",fill:"#3B82F6",name:"Executions"})]})}):o.jsx("div",{className:"flex items-center justify-center h-[250px] bg-gray-50 rounded-lg",children:o.jsxs("div",{className:"text-center",children:[o.jsx(ex,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),o.jsx("p",{className:"text-gray-600 font-medium",children:"Performance data unavailable"}),o.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Insufficient historical data"})]})})]}),o.jsxs("div",{className:"bg-white rounded-lg border p-6",children:[o.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"System Alerts"}),o.jsx("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:y.map(g=>o.jsxs("div",{className:`flex items-start space-x-3 p-3 rounded-md ${g.resolved?"bg-gray-50":g.type==="error"?"bg-red-50":g.type==="warning"?"bg-yellow-50":"bg-blue-50"}`,children:[x(g.type),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:`text-sm ${g.resolved?"text-gray-600":"text-gray-900"}`,children:g.message}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:new Date(g.timestamp).toLocaleString()})]}),g.resolved&&o.jsx(dn,{className:"h-4 w-4 text-gray-400"})]},g.id))})]})]}),o.jsxs("div",{className:"bg-white rounded-lg border p-6",children:[o.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Response Time Trends"}),u&&u.length>0?o.jsx(wd,{width:"100%",height:200,children:o.jsxs(h5,{data:u,children:[o.jsx(Vd,{strokeDasharray:"3 3"}),o.jsx(da,{dataKey:"timestamp",tickFormatter:p,interval:"preserveStartEnd"}),o.jsx(fa,{domain:[0,"dataMax"]}),o.jsx(Wr,{labelFormatter:g=>p(g),formatter:g=>[`${g.toFixed(2)}s`,"Response Time"]}),o.jsx(rl,{type:"monotone",dataKey:"response_time",stroke:"#F59E0B",strokeWidth:2,dot:{r:3}})]})}):o.jsx("div",{className:"flex items-center justify-center h-[200px] bg-gray-50 rounded-lg",children:o.jsxs("div",{className:"text-center",children:[o.jsx(hr,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),o.jsx("p",{className:"text-gray-600 font-medium",children:"Response time data unavailable"}),o.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Performance monitoring not configured"})]})})]})]})}var sNe=Object.defineProperty,oNe=(e,t,r)=>t in e?sNe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Bx=(e,t,r)=>(oNe(e,typeof t!="symbol"?t+"":t,r),r);let lNe=class{constructor(){Bx(this,"current",this.detect()),Bx(this,"handoffState","pending"),Bx(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},nl=new lNe,Sr=(e,t)=>{nl.isServer?b.useEffect(e,t):b.useLayoutEffect(e,t)};function Rn(e){let t=b.useRef(e);return Sr(()=>{t.current=e},[e]),t}let Je=function(e){let t=Rn(e);return T.useCallback((...r)=>t.current(...r),[t])};function vD(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Pa(){let e=[],t={addEventListener(r,n,i,a){return r.addEventListener(n,i,a),t.add(()=>r.removeEventListener(n,i,a))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return vD(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,i){let a=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:i}),this.add(()=>{Object.assign(r.style,{[n]:a})})},group(r){let n=Pa();return r(n),this.add(()=>n.dispose())},add(r){return e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let i of e.splice(n,1))i()}},dispose(){for(let r of e.splice(0))r()}};return t}function iv(){let[e]=b.useState(Pa);return b.useEffect(()=>()=>e.dispose(),[e]),e}function cNe(){let e=typeof document>"u";return"useSyncExternalStore"in Zx?(t=>t.useSyncExternalStore)(Zx)(()=>()=>{},()=>!1,()=>!e):!1}function cN(){let e=cNe(),[t,r]=b.useState(nl.isHandoffComplete);return t&&nl.isHandoffComplete===!1&&r(!1),b.useEffect(()=>{t!==!0&&r(!0)},[t]),b.useEffect(()=>nl.handoff(),[]),e?!1:t}var m5;let em=(m5=T.useId)!=null?m5:function(){let e=cN(),[t,r]=T.useState(e?()=>nl.nextId():null);return Sr(()=>{t===null&&r(nl.nextId())},[t]),t!=null?""+t:void 0};function or(e,t,...r){if(e in t){let i=t[e];return typeof i=="function"?i(...r):i}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,or),n}function tm(e){return nl.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let hj=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var nn=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(nn||{}),Hd=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Hd||{}),uNe=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(uNe||{});function xD(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(hj)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var uN=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(uN||{});function dN(e,t=0){var r;return e===((r=tm(e))==null?void 0:r.body)?!1:or(t,{0(){return e.matches(hj)},1(){let n=e;for(;n!==null;){if(n.matches(hj))return!0;n=n.parentElement}return!1}})}function bD(e){let t=tm(e);Pa().nextFrame(()=>{t&&!dN(t.activeElement,0)&&fNe(e)})}var dNe=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(dNe||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function fNe(e){e==null||e.focus({preventScroll:!0})}let hNe=["textarea","input"].join(",");function mNe(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,hNe))!=null?r:!1}function Lo(e,t=r=>r){return e.slice().sort((r,n)=>{let i=t(r),a=t(n);if(i===null||a===null)return 0;let s=i.compareDocumentPosition(a);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function pNe(e,t){return jo(xD(),t,{relativeTo:e})}function jo(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,s=Array.isArray(e)?r?Lo(e):e:xD(e);i.length>0&&s.length>1&&(s=s.filter(m=>!i.includes(m))),n=n??a.activeElement;let l=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,s.indexOf(n))-1;if(t&4)return Math.max(0,s.indexOf(n))+1;if(t&8)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},d=0,f=s.length,h;do{if(d>=f||d+f<=0)return 0;let m=c+d;if(t&16)m=(m+f)%f;else{if(m<0)return 3;if(m>=f)return 1}h=s[m],h==null||h.focus(u),d+=l}while(h!==a.activeElement);return t&6&&mNe(h)&&h.select(),2}function gNe(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function yNe(){return/Android/gi.test(window.navigator.userAgent)}function vNe(){return gNe()||yNe()}function Km(e,t,r){let n=Rn(t);b.useEffect(()=>{function i(a){n.current(a)}return document.addEventListener(e,i,r),()=>document.removeEventListener(e,i,r)},[e,r])}function xNe(e,t,r){let n=Rn(t);b.useEffect(()=>{function i(a){n.current(a)}return window.addEventListener(e,i,r),()=>window.removeEventListener(e,i,r)},[e,r])}function bNe(e,t,r=!0){let n=b.useRef(!1);b.useEffect(()=>{requestAnimationFrame(()=>{n.current=r})},[r]);function i(s,l){if(!n.current||s.defaultPrevented)return;let c=l(s);if(c===null||!c.getRootNode().contains(c)||!c.isConnected)return;let u=function d(f){return typeof f=="function"?d(f()):Array.isArray(f)||f instanceof Set?f:[f]}(e);for(let d of u){if(d===null)continue;let f=d instanceof HTMLElement?d:d.current;if(f!=null&&f.contains(c)||s.composed&&s.composedPath().includes(f))return}return!dN(c,uN.Loose)&&c.tabIndex!==-1&&s.preventDefault(),t(s,c)}let a=b.useRef(null);Km("pointerdown",s=>{var l,c;n.current&&(a.current=((c=(l=s.composedPath)==null?void 0:l.call(s))==null?void 0:c[0])||s.target)},!0),Km("mousedown",s=>{var l,c;n.current&&(a.current=((c=(l=s.composedPath)==null?void 0:l.call(s))==null?void 0:c[0])||s.target)},!0),Km("click",s=>{vNe()||a.current&&(i(s,()=>a.current),a.current=null)},!0),Km("touchend",s=>i(s,()=>s.target instanceof HTMLElement?s.target:null),!0),xNe("blur",s=>i(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function wNe(...e){return b.useMemo(()=>tm(...e),[...e])}function p5(e){var t;if(e.type)return e.type;let r=(t=e.as)!=null?t:"button";if(typeof r=="string"&&r.toLowerCase()==="button")return"button"}function wD(e,t){let[r,n]=b.useState(()=>p5(e));return Sr(()=>{n(p5(e))},[e.type,e.as]),Sr(()=>{r||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&n("button")},[r,t]),r}let jNe=Symbol();function bi(...e){let t=b.useRef(e);b.useEffect(()=>{t.current=e},[e]);let r=Je(n=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(n):i.current=n)});return e.every(n=>n==null||(n==null?void 0:n[jNe]))?void 0:r}function g5(e){return[e.screenX,e.screenY]}function _Ne(){let e=b.useRef([-1,-1]);return{wasMoved(t){let r=g5(t);return e.current[0]===r[0]&&e.current[1]===r[1]?!1:(e.current=r,!0)},update(t){e.current=g5(t)}}}function NNe({container:e,accept:t,walk:r,enabled:n=!0}){let i=b.useRef(t),a=b.useRef(r);b.useEffect(()=>{i.current=t,a.current=r},[t,r]),Sr(()=>{if(!e||!n)return;let s=tm(e);if(!s)return;let l=i.current,c=a.current,u=Object.assign(f=>l(f),{acceptNode:l}),d=s.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,u,!1);for(;d.nextNode();)c(d.currentNode)},[e,n,i,a])}function by(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Su=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Su||{}),Ns=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Ns||{});function Wn({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:i,visible:a=!0,name:s,mergeRefs:l}){l=l??SNe;let c=jD(t,e);if(a)return Gm(c,r,n,s,l);let u=i??0;if(u&2){let{static:d=!1,...f}=c;if(d)return Gm(f,r,n,s,l)}if(u&1){let{unmount:d=!0,...f}=c;return or(d?0:1,{0(){return null},1(){return Gm({...f,hidden:!0,style:{display:"none"}},r,n,s,l)}})}return Gm(c,r,n,s,l)}function Gm(e,t={},r,n,i){let{as:a=r,children:s,refName:l="ref",...c}=zx(e,["unmount","static"]),u=e.ref!==void 0?{[l]:e.ref}:{},d=typeof s=="function"?s(t):s;"className"in c&&c.className&&typeof c.className=="function"&&(c.className=c.className(t));let f={};if(t){let h=!1,m=[];for(let[y,p]of Object.entries(t))typeof p=="boolean"&&(h=!0),p===!0&&m.push(y);h&&(f["data-headlessui-state"]=m.join(" "))}if(a===b.Fragment&&Object.keys(y5(c)).length>0){if(!b.isValidElement(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(c).map(p=>` - ${p}`).join(` `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(p=>` - ${p}`).join(` `)].join(` `));let h=d.props,m=typeof(h==null?void 0:h.className)=="function"?(...p)=>by(h==null?void 0:h.className(...p),c.className):by(h==null?void 0:h.className,c.className),y=m?{className:m}:{};return b.cloneElement(d,Object.assign({},jD(d.props,y5(zx(c,["ref"]))),f,u,{ref:i(d.ref,u.ref)},y))}return b.createElement(a,Object.assign({},zx(c,["ref"]),a!==b.Fragment&&u,a!==b.Fragment&&f),d)}function SNe(...e){return e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}function jD(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let i in n)i.startsWith("on")&&typeof n[i]=="function"?(r[i]!=null||(r[i]=[]),r[i].push(n[i])):t[i]=n[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(r).map(n=>[n,void 0])));for(let n in r)Object.assign(t,{[n](i,...a){let s=r[n];for(let l of s){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;l(i,...a)}}});return t}function xn(e){var t;return Object.assign(b.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function y5(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function zx(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}let kNe="div";var _D=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(_D||{});function ENe(e,t){var r;let{features:n=1,...i}=e,a={ref:t,"aria-hidden":(n&2)===2?!0:(r=i["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Wn({ourProps:a,theirProps:i,slot:{},defaultTag:kNe,name:"Hidden"})}let ND=xn(ENe),fN=b.createContext(null);fN.displayName="OpenClosedContext";var on=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(on||{});function hN(){return b.useContext(fN)}function SD({value:e,children:t}){return T.createElement(fN.Provider,{value:e},t)}function ONe(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let n=(t==null?void 0:t.getAttribute("disabled"))==="";return n&&ANe(r)?!1:n}function ANe(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function PNe(e){throw new Error("Unexpected object: "+e)}var ui=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(ui||{});function CNe(e,t){let r=t.resolveItems();if(r.length<=0)return null;let n=t.resolveActiveIndex(),i=n??-1;switch(e.focus){case 0:{for(let a=0;a=0;--a)if(!t.resolveDisabled(r[a],a,r))return a;return n}case 2:{for(let a=i+1;a=0;--a)if(!t.resolveDisabled(r[a],a,r))return a;return n}case 4:{for(let a=0;a(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(at||{});function av(){let e=b.useRef(!1);return Sr(()=>(e.current=!0,()=>{e.current=!1}),[]),e}let v5=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function x5(e){var t,r;let n=(t=e.innerText)!=null?t:"",i=e.cloneNode(!0);if(!(i instanceof HTMLElement))return n;let a=!1;for(let l of i.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),a=!0;let s=a?(r=i.innerText)!=null?r:"":n;return v5.test(s)&&(s=s.replace(v5,"")),s}function TNe(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let r=e.getAttribute("aria-labelledby");if(r){let n=r.split(" ").map(i=>{let a=document.getElementById(i);if(a){let s=a.getAttribute("aria-label");return typeof s=="string"?s.trim():x5(a).trim()}return null}).filter(Boolean);if(n.length>0)return n.join(", ")}return x5(e).trim()}function $Ne(e){let t=b.useRef(""),r=b.useRef("");return Je(()=>{let n=e.current;if(!n)return"";let i=n.innerText;if(t.current===i)return r.current;let a=TNe(n).trim().toLowerCase();return t.current=i,r.current=a,a})}var MNe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(MNe||{}),RNe=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(RNe||{}),INe=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(INe||{});function Ux(e,t=r=>r){let r=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,n=Lo(t(e.items.slice()),a=>a.dataRef.current.domRef.current),i=r?n.indexOf(r):null;return i===-1&&(i=null),{items:n,activeItemIndex:i}}let DNe={1(e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},0(e){return e.menuState===0?e:{...e,__demoMode:!1,menuState:0}},2:(e,t)=>{var r;let n=Ux(e),i=CNe(t,{resolveItems:()=>n.items,resolveActiveIndex:()=>n.activeItemIndex,resolveId:a=>a.id,resolveDisabled:a=>a.dataRef.current.disabled});return{...e,...n,searchQuery:"",activeItemIndex:i,activationTrigger:(r=t.trigger)!=null?r:1}},3:(e,t)=>{let r=e.searchQuery!==""?0:1,n=e.searchQuery+t.value.toLowerCase(),i=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+r).concat(e.items.slice(0,e.activeItemIndex+r)):e.items).find(s=>{var l;return((l=s.dataRef.current.textValue)==null?void 0:l.startsWith(n))&&!s.dataRef.current.disabled}),a=i?e.items.indexOf(i):-1;return a===-1||a===e.activeItemIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeItemIndex:a,activationTrigger:1}},4(e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},5:(e,t)=>{let r=Ux(e,n=>[...n,{id:t.id,dataRef:t.dataRef}]);return{...e,...r}},6:(e,t)=>{let r=Ux(e,n=>{let i=n.findIndex(a=>a.id===t.id);return i!==-1&&n.splice(i,1),n});return{...e,...r,activationTrigger:1}}},mN=b.createContext(null);mN.displayName="MenuContext";function sv(e){let t=b.useContext(mN);if(t===null){let r=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,sv),r}return t}function LNe(e,t){return or(t.type,DNe,e,t)}let FNe=b.Fragment;function BNe(e,t){let{__demoMode:r=!1,...n}=e,i=b.useReducer(LNe,{__demoMode:r,menuState:r?0:1,buttonRef:b.createRef(),itemsRef:b.createRef(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:a,itemsRef:s,buttonRef:l},c]=i,u=bi(t);bNe([l,s],(m,y)=>{var p;c({type:1}),dN(y,uN.Loose)||(m.preventDefault(),(p=l.current)==null||p.focus())},a===0);let d=Je(()=>{c({type:1})}),f=b.useMemo(()=>({open:a===0,close:d}),[a,d]),h={ref:u};return T.createElement(mN.Provider,{value:i},T.createElement(SD,{value:or(a,{0:on.Open,1:on.Closed})},Wn({ourProps:h,theirProps:n,slot:f,defaultTag:FNe,name:"Menu"})))}let zNe="button";function UNe(e,t){var r;let n=em(),{id:i=`headlessui-menu-button-${n}`,...a}=e,[s,l]=sv("Menu.Button"),c=bi(s.buttonRef,t),u=iv(),d=Je(p=>{switch(p.key){case at.Space:case at.Enter:case at.ArrowDown:p.preventDefault(),p.stopPropagation(),l({type:0}),u.nextFrame(()=>l({type:2,focus:ui.First}));break;case at.ArrowUp:p.preventDefault(),p.stopPropagation(),l({type:0}),u.nextFrame(()=>l({type:2,focus:ui.Last}));break}}),f=Je(p=>{switch(p.key){case at.Space:p.preventDefault();break}}),h=Je(p=>{if(ONe(p.currentTarget))return p.preventDefault();e.disabled||(s.menuState===0?(l({type:1}),u.nextFrame(()=>{var x;return(x=s.buttonRef.current)==null?void 0:x.focus({preventScroll:!0})})):(p.preventDefault(),l({type:0})))}),m=b.useMemo(()=>({open:s.menuState===0}),[s]),y={ref:c,id:i,type:wD(e,s.buttonRef),"aria-haspopup":"menu","aria-controls":(r=s.itemsRef.current)==null?void 0:r.id,"aria-expanded":s.menuState===0,onKeyDown:d,onKeyUp:f,onClick:h};return Wn({ourProps:y,theirProps:a,slot:m,defaultTag:zNe,name:"Menu.Button"})}let WNe="div",VNe=Su.RenderStrategy|Su.Static;function HNe(e,t){var r,n;let i=em(),{id:a=`headlessui-menu-items-${i}`,...s}=e,[l,c]=sv("Menu.Items"),u=bi(l.itemsRef,t),d=wNe(l.itemsRef),f=iv(),h=hN(),m=h!==null?(h&on.Open)===on.Open:l.menuState===0;b.useEffect(()=>{let v=l.itemsRef.current;v&&l.menuState===0&&v!==(d==null?void 0:d.activeElement)&&v.focus({preventScroll:!0})},[l.menuState,l.itemsRef,d]),NNe({container:l.itemsRef.current,enabled:l.menuState===0,accept(v){return v.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:v.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(v){v.setAttribute("role","none")}});let y=Je(v=>{var w,_;switch(f.dispose(),v.key){case at.Space:if(l.searchQuery!=="")return v.preventDefault(),v.stopPropagation(),c({type:3,value:v.key});case at.Enter:if(v.preventDefault(),v.stopPropagation(),c({type:1}),l.activeItemIndex!==null){let{dataRef:j}=l.items[l.activeItemIndex];(_=(w=j.current)==null?void 0:w.domRef.current)==null||_.click()}bD(l.buttonRef.current);break;case at.ArrowDown:return v.preventDefault(),v.stopPropagation(),c({type:2,focus:ui.Next});case at.ArrowUp:return v.preventDefault(),v.stopPropagation(),c({type:2,focus:ui.Previous});case at.Home:case at.PageUp:return v.preventDefault(),v.stopPropagation(),c({type:2,focus:ui.First});case at.End:case at.PageDown:return v.preventDefault(),v.stopPropagation(),c({type:2,focus:ui.Last});case at.Escape:v.preventDefault(),v.stopPropagation(),c({type:1}),Pa().nextFrame(()=>{var j;return(j=l.buttonRef.current)==null?void 0:j.focus({preventScroll:!0})});break;case at.Tab:v.preventDefault(),v.stopPropagation(),c({type:1}),Pa().nextFrame(()=>{pNe(l.buttonRef.current,v.shiftKey?nn.Previous:nn.Next)});break;default:v.key.length===1&&(c({type:3,value:v.key}),f.setTimeout(()=>c({type:4}),350));break}}),p=Je(v=>{switch(v.key){case at.Space:v.preventDefault();break}}),x=b.useMemo(()=>({open:l.menuState===0}),[l]),g={"aria-activedescendant":l.activeItemIndex===null||(r=l.items[l.activeItemIndex])==null?void 0:r.id,"aria-labelledby":(n=l.buttonRef.current)==null?void 0:n.id,id:a,onKeyDown:y,onKeyUp:p,role:"menu",tabIndex:0,ref:u};return Wn({ourProps:g,theirProps:s,slot:x,defaultTag:WNe,features:VNe,visible:m,name:"Menu.Items"})}let qNe=b.Fragment;function KNe(e,t){let r=em(),{id:n=`headlessui-menu-item-${r}`,disabled:i=!1,...a}=e,[s,l]=sv("Menu.Item"),c=s.activeItemIndex!==null?s.items[s.activeItemIndex].id===n:!1,u=b.useRef(null),d=bi(t,u);Sr(()=>{if(s.__demoMode||s.menuState!==0||!c||s.activationTrigger===0)return;let j=Pa();return j.requestAnimationFrame(()=>{var N,S;(S=(N=u.current)==null?void 0:N.scrollIntoView)==null||S.call(N,{block:"nearest"})}),j.dispose},[s.__demoMode,u,c,s.menuState,s.activationTrigger,s.activeItemIndex]);let f=$Ne(u),h=b.useRef({disabled:i,domRef:u,get textValue(){return f()}});Sr(()=>{h.current.disabled=i},[h,i]),Sr(()=>(l({type:5,id:n,dataRef:h}),()=>l({type:6,id:n})),[h,n]);let m=Je(()=>{l({type:1})}),y=Je(j=>{if(i)return j.preventDefault();l({type:1}),bD(s.buttonRef.current)}),p=Je(()=>{if(i)return l({type:2,focus:ui.Nothing});l({type:2,focus:ui.Specific,id:n})}),x=_Ne(),g=Je(j=>x.update(j)),v=Je(j=>{x.wasMoved(j)&&(i||c||l({type:2,focus:ui.Specific,id:n,trigger:0}))}),w=Je(j=>{x.wasMoved(j)&&(i||c&&l({type:2,focus:ui.Nothing}))}),_=b.useMemo(()=>({active:c,disabled:i,close:m}),[c,i,m]);return Wn({ourProps:{id:n,ref:d,role:"menuitem",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,disabled:void 0,onClick:y,onFocus:p,onPointerEnter:g,onMouseEnter:g,onPointerMove:v,onMouseMove:v,onPointerLeave:w,onMouseLeave:w},theirProps:a,slot:_,defaultTag:qNe,name:"Menu.Item"})}let GNe=xn(BNe),YNe=xn(UNe),ZNe=xn(HNe),XNe=xn(KNe),ho=Object.assign(GNe,{Button:YNe,Items:ZNe,Item:XNe});function QNe(e=0){let[t,r]=b.useState(e),n=av(),i=b.useCallback(c=>{n.current&&r(u=>u|c)},[t,n]),a=b.useCallback(c=>!!(t&c),[t]),s=b.useCallback(c=>{n.current&&r(u=>u&~c)},[r,n]),l=b.useCallback(c=>{n.current&&r(u=>u^c)},[r]);return{flags:t,addFlag:i,hasFlag:a,removeFlag:s,toggleFlag:l}}function JNe({onFocus:e}){let[t,r]=b.useState(!0),n=av();return t?T.createElement(ND,{as:"button",type:"button",features:_D.Focusable,onFocus:i=>{i.preventDefault();let a,s=50;function l(){if(s--<=0){a&&cancelAnimationFrame(a);return}if(e()){if(cancelAnimationFrame(a),!n.current)return;r(!1);return}a=requestAnimationFrame(l)}a=requestAnimationFrame(l)}}):null}const kD=b.createContext(null);function eSe(){return{groups:new Map,get(e,t){var r;let n=this.groups.get(e);n||(n=new Map,this.groups.set(e,n));let i=(r=n.get(t))!=null?r:0;n.set(t,i+1);let a=Array.from(n.keys()).indexOf(t);function s(){let l=n.get(t);l>1?n.set(t,l-1):n.delete(t)}return[a,s]}}}function tSe({children:e}){let t=b.useRef(eSe());return b.createElement(kD.Provider,{value:t},e)}function ED(e){let t=b.useContext(kD);if(!t)throw new Error("You must wrap your component in a ");let r=rSe(),[n,i]=t.current.get(e,r);return b.useEffect(()=>i,[]),n}function rSe(){var e,t,r;let n=(r=(t=(e=b.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)==null?void 0:e.ReactCurrentOwner)==null?void 0:t.current)!=null?r:null;if(!n)return Symbol();let i=[],a=n;for(;a;)i.push(a.index),a=a.return;return"$."+i.join(".")}var nSe=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(nSe||{}),iSe=(e=>(e[e.Less=-1]="Less",e[e.Equal=0]="Equal",e[e.Greater=1]="Greater",e))(iSe||{}),aSe=(e=>(e[e.SetSelectedIndex=0]="SetSelectedIndex",e[e.RegisterTab=1]="RegisterTab",e[e.UnregisterTab=2]="UnregisterTab",e[e.RegisterPanel=3]="RegisterPanel",e[e.UnregisterPanel=4]="UnregisterPanel",e))(aSe||{});let sSe={0(e,t){var r;let n=Lo(e.tabs,d=>d.current),i=Lo(e.panels,d=>d.current),a=n.filter(d=>{var f;return!((f=d.current)!=null&&f.hasAttribute("disabled"))}),s={...e,tabs:n,panels:i};if(t.index<0||t.index>n.length-1){let d=or(Math.sign(t.index-e.selectedIndex),{[-1]:()=>1,0:()=>or(Math.sign(t.index),{[-1]:()=>0,0:()=>0,1:()=>1}),1:()=>0});if(a.length===0)return s;let f=or(d,{0:()=>n.indexOf(a[0]),1:()=>n.indexOf(a[a.length-1])});return{...s,selectedIndex:f===-1?e.selectedIndex:f}}let l=n.slice(0,t.index),c=[...n.slice(t.index),...l].find(d=>a.includes(d));if(!c)return s;let u=(r=n.indexOf(c))!=null?r:e.selectedIndex;return u===-1&&(u=e.selectedIndex),{...s,selectedIndex:u}},1(e,t){if(e.tabs.includes(t.tab))return e;let r=e.tabs[e.selectedIndex],n=Lo([...e.tabs,t.tab],a=>a.current),i=e.selectedIndex;return e.info.current.isControlled||(i=n.indexOf(r),i===-1&&(i=e.selectedIndex)),{...e,tabs:n,selectedIndex:i}},2(e,t){return{...e,tabs:e.tabs.filter(r=>r!==t.tab)}},3(e,t){return e.panels.includes(t.panel)?e:{...e,panels:Lo([...e.panels,t.panel],r=>r.current)}},4(e,t){return{...e,panels:e.panels.filter(r=>r!==t.panel)}}},pN=b.createContext(null);pN.displayName="TabsDataContext";function ku(e){let t=b.useContext(pN);if(t===null){let r=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ku),r}return t}let gN=b.createContext(null);gN.displayName="TabsActionsContext";function yN(e){let t=b.useContext(gN);if(t===null){let r=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,yN),r}return t}function oSe(e,t){return or(t.type,sSe,e,t)}let lSe=b.Fragment;function cSe(e,t){let{defaultIndex:r=0,vertical:n=!1,manual:i=!1,onChange:a,selectedIndex:s=null,...l}=e;const c=n?"vertical":"horizontal",u=i?"manual":"auto";let d=s!==null,f=Rn({isControlled:d}),h=bi(t),[m,y]=b.useReducer(oSe,{info:f,selectedIndex:s??r,tabs:[],panels:[]}),p=b.useMemo(()=>({selectedIndex:m.selectedIndex}),[m.selectedIndex]),x=Rn(a||(()=>{})),g=Rn(m.tabs),v=b.useMemo(()=>({orientation:c,activation:u,...m}),[c,u,m]),w=Je(k=>(y({type:1,tab:k}),()=>y({type:2,tab:k}))),_=Je(k=>(y({type:3,panel:k}),()=>y({type:4,panel:k}))),j=Je(k=>{N.current!==k&&x.current(k),d||y({type:0,index:k})}),N=Rn(d?e.selectedIndex:m.selectedIndex),S=b.useMemo(()=>({registerTab:w,registerPanel:_,change:j}),[]);Sr(()=>{y({type:0,index:s??r})},[s]),Sr(()=>{if(N.current===void 0||m.tabs.length<=0)return;let k=Lo(m.tabs,A=>A.current);k.some((A,C)=>m.tabs[C]!==A)&&j(k.indexOf(m.tabs[N.current]))});let E={ref:h};return T.createElement(tSe,null,T.createElement(gN.Provider,{value:S},T.createElement(pN.Provider,{value:v},v.tabs.length<=0&&T.createElement(JNe,{onFocus:()=>{var k,A;for(let C of g.current)if(((k=C.current)==null?void 0:k.tabIndex)===0)return(A=C.current)==null||A.focus(),!0;return!1}}),Wn({ourProps:E,theirProps:l,slot:p,defaultTag:lSe,name:"Tabs"}))))}let uSe="div";function dSe(e,t){let{orientation:r,selectedIndex:n}=ku("Tab.List"),i=bi(t);return Wn({ourProps:{ref:i,role:"tablist","aria-orientation":r},theirProps:e,slot:{selectedIndex:n},defaultTag:uSe,name:"Tabs.List"})}let fSe="button";function hSe(e,t){var r,n;let i=em(),{id:a=`headlessui-tabs-tab-${i}`,...s}=e,{orientation:l,activation:c,selectedIndex:u,tabs:d,panels:f}=ku("Tab"),h=yN("Tab"),m=ku("Tab"),y=b.useRef(null),p=bi(y,t);Sr(()=>h.registerTab(y),[h,y]);let x=ED("tabs"),g=d.indexOf(y);g===-1&&(g=x);let v=g===u,w=Je(A=>{var C;let P=A();if(P===Hd.Success&&c==="auto"){let $=(C=tm(y))==null?void 0:C.activeElement,O=m.tabs.findIndex(I=>I.current===$);O!==-1&&h.change(O)}return P}),_=Je(A=>{let C=d.map(P=>P.current).filter(Boolean);if(A.key===at.Space||A.key===at.Enter){A.preventDefault(),A.stopPropagation(),h.change(g);return}switch(A.key){case at.Home:case at.PageUp:return A.preventDefault(),A.stopPropagation(),w(()=>jo(C,nn.First));case at.End:case at.PageDown:return A.preventDefault(),A.stopPropagation(),w(()=>jo(C,nn.Last))}if(w(()=>or(l,{vertical(){return A.key===at.ArrowUp?jo(C,nn.Previous|nn.WrapAround):A.key===at.ArrowDown?jo(C,nn.Next|nn.WrapAround):Hd.Error},horizontal(){return A.key===at.ArrowLeft?jo(C,nn.Previous|nn.WrapAround):A.key===at.ArrowRight?jo(C,nn.Next|nn.WrapAround):Hd.Error}}))===Hd.Success)return A.preventDefault()}),j=b.useRef(!1),N=Je(()=>{var A;j.current||(j.current=!0,(A=y.current)==null||A.focus({preventScroll:!0}),h.change(g),vD(()=>{j.current=!1}))}),S=Je(A=>{A.preventDefault()}),E=b.useMemo(()=>{var A;return{selected:v,disabled:(A=e.disabled)!=null?A:!1}},[v,e.disabled]),k={ref:p,onKeyDown:_,onMouseDown:S,onClick:N,id:a,role:"tab",type:wD(e,y),"aria-controls":(n=(r=f[g])==null?void 0:r.current)==null?void 0:n.id,"aria-selected":v,tabIndex:v?0:-1};return Wn({ourProps:k,theirProps:s,slot:E,defaultTag:fSe,name:"Tabs.Tab"})}let mSe="div";function pSe(e,t){let{selectedIndex:r}=ku("Tab.Panels"),n=bi(t),i=b.useMemo(()=>({selectedIndex:r}),[r]);return Wn({ourProps:{ref:n},theirProps:e,slot:i,defaultTag:mSe,name:"Tabs.Panels"})}let gSe="div",ySe=Su.RenderStrategy|Su.Static;function vSe(e,t){var r,n,i,a;let s=em(),{id:l=`headlessui-tabs-panel-${s}`,tabIndex:c=0,...u}=e,{selectedIndex:d,tabs:f,panels:h}=ku("Tab.Panel"),m=yN("Tab.Panel"),y=b.useRef(null),p=bi(y,t);Sr(()=>m.registerPanel(y),[m,y,l]);let x=ED("panels"),g=h.indexOf(y);g===-1&&(g=x);let v=g===d,w=b.useMemo(()=>({selected:v}),[v]),_={ref:p,id:l,role:"tabpanel","aria-labelledby":(n=(r=f[g])==null?void 0:r.current)==null?void 0:n.id,tabIndex:v?c:-1};return!v&&((i=u.unmount)==null||i)&&!((a=u.static)!=null&&a)?T.createElement(ND,{as:"span","aria-hidden":"true",..._}):Wn({ourProps:_,theirProps:u,slot:w,defaultTag:gSe,features:ySe,visible:v,name:"Tabs.Panel"})}let xSe=xn(hSe),bSe=xn(cSe),wSe=xn(dSe),jSe=xn(pSe),_Se=xn(vSe),Ua=Object.assign(xSe,{Group:bSe,List:wSe,Panels:jSe,Panel:_Se});function NSe(e){let t={called:!1};return(...r)=>{if(!t.called)return t.called=!0,e(...r)}}function Wx(e,...t){e&&t.length>0&&e.classList.add(...t)}function Vx(e,...t){e&&t.length>0&&e.classList.remove(...t)}function SSe(e,t){let r=Pa();if(!e)return r.dispose;let{transitionDuration:n,transitionDelay:i}=getComputedStyle(e),[a,s]=[n,i].map(c=>{let[u=0]=c.split(",").filter(Boolean).map(d=>d.includes("ms")?parseFloat(d):parseFloat(d)*1e3).sort((d,f)=>f-d);return u}),l=a+s;if(l!==0){r.group(u=>{u.setTimeout(()=>{t(),u.dispose()},l),u.addEventListener(e,"transitionrun",d=>{d.target===d.currentTarget&&u.dispose()})});let c=r.addEventListener(e,"transitionend",u=>{u.target===u.currentTarget&&(t(),c())})}else t();return r.add(()=>t()),r.dispose}function kSe(e,t,r,n){let i=r?"enter":"leave",a=Pa(),s=n!==void 0?NSe(n):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let l=or(i,{enter:()=>t.enter,leave:()=>t.leave}),c=or(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),u=or(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Vx(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Wx(e,...t.base,...l,...u),a.nextFrame(()=>{Vx(e,...t.base,...l,...u),Wx(e,...t.base,...l,...c),SSe(e,()=>(Vx(e,...t.base,...l),Wx(e,...t.base,...t.entered),s()))}),a.dispose}function ESe({immediate:e,container:t,direction:r,classes:n,onStart:i,onStop:a}){let s=av(),l=iv(),c=Rn(r);Sr(()=>{e&&(c.current="enter")},[e]),Sr(()=>{let u=Pa();l.add(u.dispose);let d=t.current;if(d&&c.current!=="idle"&&s.current)return u.dispose(),i.current(c.current),u.add(kSe(d,n.current,c.current==="enter",()=>{u.dispose(),a.current(c.current)})),u.dispose},[r])}function Wa(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let ov=b.createContext(null);ov.displayName="TransitionContext";var OSe=(e=>(e.Visible="visible",e.Hidden="hidden",e))(OSe||{});function ASe(){let e=b.useContext(ov);if(e===null)throw new Error("A is used but it is missing a parent or .");return e}function PSe(){let e=b.useContext(lv);if(e===null)throw new Error("A is used but it is missing a parent or .");return e}let lv=b.createContext(null);lv.displayName="NestingContext";function cv(e){return"children"in e?cv(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function OD(e,t){let r=Rn(e),n=b.useRef([]),i=av(),a=iv(),s=Je((m,y=Ns.Hidden)=>{let p=n.current.findIndex(({el:x})=>x===m);p!==-1&&(or(y,{[Ns.Unmount](){n.current.splice(p,1)},[Ns.Hidden](){n.current[p].state="hidden"}}),a.microTask(()=>{var x;!cv(n)&&i.current&&((x=r.current)==null||x.call(r))}))}),l=Je(m=>{let y=n.current.find(({el:p})=>p===m);return y?y.state!=="visible"&&(y.state="visible"):n.current.push({el:m,state:"visible"}),()=>s(m,Ns.Unmount)}),c=b.useRef([]),u=b.useRef(Promise.resolve()),d=b.useRef({enter:[],leave:[],idle:[]}),f=Je((m,y,p)=>{c.current.splice(0),t&&(t.chains.current[y]=t.chains.current[y].filter(([x])=>x!==m)),t==null||t.chains.current[y].push([m,new Promise(x=>{c.current.push(x)})]),t==null||t.chains.current[y].push([m,new Promise(x=>{Promise.all(d.current[y].map(([g,v])=>v)).then(()=>x())})]),y==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>p(y)):p(y)}),h=Je((m,y,p)=>{Promise.all(d.current[y].splice(0).map(([x,g])=>g)).then(()=>{var x;(x=c.current.shift())==null||x()}).then(()=>p(y))});return b.useMemo(()=>({children:n,register:l,unregister:s,onStart:f,onStop:h,wait:u,chains:d}),[l,s,n,f,h,d,u])}function CSe(){}let TSe=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function b5(e){var t;let r={};for(let n of TSe)r[n]=(t=e[n])!=null?t:CSe;return r}function $Se(e){let t=b.useRef(b5(e));return b.useEffect(()=>{t.current=b5(e)},[e]),t}let MSe="div",AD=Su.RenderStrategy;function RSe(e,t){var r,n;let{beforeEnter:i,afterEnter:a,beforeLeave:s,afterLeave:l,enter:c,enterFrom:u,enterTo:d,entered:f,leave:h,leaveFrom:m,leaveTo:y,...p}=e,x=b.useRef(null),g=bi(x,t),v=(r=p.unmount)==null||r?Ns.Unmount:Ns.Hidden,{show:w,appear:_,initial:j}=ASe(),[N,S]=b.useState(w?"visible":"hidden"),E=PSe(),{register:k,unregister:A}=E;b.useEffect(()=>k(x),[k,x]),b.useEffect(()=>{if(v===Ns.Hidden&&x.current){if(w&&N!=="visible"){S("visible");return}return or(N,{hidden:()=>A(x),visible:()=>k(x)})}},[N,x,k,A,w,v]);let C=Rn({base:Wa(p.className),enter:Wa(c),enterFrom:Wa(u),enterTo:Wa(d),entered:Wa(f),leave:Wa(h),leaveFrom:Wa(m),leaveTo:Wa(y)}),P=$Se({beforeEnter:i,afterEnter:a,beforeLeave:s,afterLeave:l}),$=cN();b.useEffect(()=>{if($&&N==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,N,$]);let O=j&&!_,I=_&&w&&j,D=!$||O?"idle":w?"enter":"leave",L=QNe(0),R=Je(q=>or(q,{enter:()=>{L.addFlag(on.Opening),P.current.beforeEnter()},leave:()=>{L.addFlag(on.Closing),P.current.beforeLeave()},idle:()=>{}})),M=Je(q=>or(q,{enter:()=>{L.removeFlag(on.Opening),P.current.afterEnter()},leave:()=>{L.removeFlag(on.Closing),P.current.afterLeave()},idle:()=>{}})),B=OD(()=>{S("hidden"),A(x)},E),U=b.useRef(!1);ESe({immediate:I,container:x,classes:C,direction:D,onStart:Rn(q=>{U.current=!0,B.onStart(x,q,R)}),onStop:Rn(q=>{U.current=!1,B.onStop(x,q,M),q==="leave"&&!cv(B)&&(S("hidden"),A(x))})});let W=p,Z={ref:g};return I?W={...W,className:by(p.className,...C.current.enter,...C.current.enterFrom)}:U.current&&(W.className=by(p.className,(n=x.current)==null?void 0:n.className),W.className===""&&delete W.className),T.createElement(lv.Provider,{value:B},T.createElement(SD,{value:or(N,{visible:on.Open,hidden:on.Closed})|L.flags},Wn({ourProps:Z,theirProps:W,defaultTag:MSe,features:AD,visible:N==="visible",name:"Transition.Child"})))}function ISe(e,t){let{show:r,appear:n=!1,unmount:i=!0,...a}=e,s=b.useRef(null),l=bi(s,t);cN();let c=hN();if(r===void 0&&c!==null&&(r=(c&on.Open)===on.Open),![!0,!1].includes(r))throw new Error("A is used but it is missing a `show={true | false}` prop.");let[u,d]=b.useState(r?"visible":"hidden"),f=OD(()=>{d("hidden")}),[h,m]=b.useState(!0),y=b.useRef([r]);Sr(()=>{h!==!1&&y.current[y.current.length-1]!==r&&(y.current.push(r),m(!1))},[y,r]);let p=b.useMemo(()=>({show:r,appear:n,initial:h}),[r,n,h]);b.useEffect(()=>{if(r)d("visible");else if(!cv(f))d("hidden");else{let w=s.current;if(!w)return;let _=w.getBoundingClientRect();_.x===0&&_.y===0&&_.width===0&&_.height===0&&d("hidden")}},[r,f]);let x={unmount:i},g=Je(()=>{var w;h&&m(!1),(w=e.beforeEnter)==null||w.call(e)}),v=Je(()=>{var w;h&&m(!1),(w=e.beforeLeave)==null||w.call(e)});return T.createElement(lv.Provider,{value:f},T.createElement(ov.Provider,{value:p},Wn({ourProps:{...x,as:b.Fragment,children:T.createElement(PD,{ref:l,...x,...a,beforeEnter:g,beforeLeave:v})},theirProps:{},defaultTag:b.Fragment,features:AD,visible:u==="visible",name:"Transition"})))}function DSe(e,t){let r=b.useContext(ov)!==null,n=hN()!==null;return T.createElement(T.Fragment,null,!r&&n?T.createElement(mj,{ref:t,...e}):T.createElement(PD,{ref:t,...e}))}let mj=xn(ISe),PD=xn(RSe),LSe=xn(DSe),FSe=Object.assign(mj,{Child:LSe,Root:mj});function BSe(){const[e,t]=b.useState(""),[r,n]=b.useState("all"),[i,a]=b.useState("all"),{data:s=[],isLoading:l,error:c}=$r({queryKey:["projects"],queryFn:async()=>await uc.getProjects()}),u=s.filter(f=>{var x,g;const h=f.name.toLowerCase().includes(e.toLowerCase())||((x=f.description)==null?void 0:x.toLowerCase().includes(e.toLowerCase())),m=r==="all"||f.status===r,y=((g=f.bzzz_config)==null?void 0:g.bzzz_enabled)||!1;return h&&m&&(i==="all"||i==="enabled"&&y||i==="disabled"&&!y)}),d=f=>{const h="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium";switch(f){case"active":return`${h} bg-green-100 text-green-800`;case"inactive":return`${h} bg-gray-100 text-gray-800`;case"arcwhooshd":return`${h} bg-red-100 text-red-800`;default:return`${h} bg-gray-100 text-gray-800`}};return l?o.jsx("div",{className:"p-6",children:o.jsxs("div",{className:"animate-pulse",children:[o.jsx("div",{className:"h-8 bg-gray-200 rounded w-1/4 mb-6"}),o.jsx("div",{className:"space-y-4",children:[1,2,3].map(f=>o.jsxs("div",{className:"bg-white rounded-lg border p-6",children:[o.jsx("div",{className:"h-6 bg-gray-200 rounded w-1/3 mb-4"}),o.jsx("div",{className:"h-4 bg-gray-200 rounded w-2/3 mb-2"}),o.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2"})]},f))})]})}):c?o.jsx("div",{className:"p-6",children:o.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-md p-4",children:[o.jsx("h3",{className:"text-sm font-medium text-red-800",children:"Error loading projects"}),o.jsx("p",{className:"mt-1 text-sm text-red-700",children:c instanceof Error?c.message:"Failed to load projects"})]})}):o.jsxs("div",{className:"p-6",children:[o.jsxs("div",{className:"sm:flex sm:items-center sm:justify-between mb-6",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Projects"}),o.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Manage your workflow projects and track their performance"})]}),o.jsx("div",{className:"mt-4 sm:mt-0",children:o.jsxs(Ot,{to:"/projects/new",className:"inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[o.jsx(Sa,{className:"h-4 w-4 mr-2"}),"New Project"]})})]}),o.jsxs("div",{className:"mb-6 flex flex-col sm:flex-row gap-4",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:o.jsx(r0,{className:"h-5 w-5 text-gray-400"})}),o.jsx("input",{type:"text",placeholder:"Search projects...",value:e,onChange:f=>t(f.target.value),className:"block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md leading-5 bg-white placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 focus:ring-1 focus:ring-blue-500 focus:border-blue-500"})]}),o.jsxs("div",{className:"flex items-center space-x-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(G2,{className:"h-5 w-5 text-gray-400"}),o.jsxs("select",{value:r,onChange:f=>n(f.target.value),className:"border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500",children:[o.jsx("option",{value:"all",children:"All Status"}),o.jsx("option",{value:"active",children:"Active"}),o.jsx("option",{value:"inactive",children:"Inactive"}),o.jsx("option",{value:"arcwhooshd",children:"Arcwhooshd"})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("span",{className:"text-sm text-gray-500",children:"🐝"}),o.jsxs("select",{value:i,onChange:f=>a(f.target.value),className:"border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500",children:[o.jsx("option",{value:"all",children:"All Projects"}),o.jsx("option",{value:"enabled",children:"Bzzz Enabled"}),o.jsx("option",{value:"disabled",children:"Bzzz Disabled"})]})]})]})]}),u.length===0?o.jsxs("div",{className:"text-center py-12",children:[o.jsx(Wf,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),o.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No projects found"}),o.jsx("p",{className:"text-gray-500 mb-4",children:e||r!=="all"?"Try adjusting your search or filter criteria.":"Get started by creating your first project."}),o.jsxs(Ot,{to:"/projects/new",className:"inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700",children:[o.jsx(Sa,{className:"h-4 w-4 mr-2"}),"Create Project"]})]}):o.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:u.map(f=>{var h,m,y,p,x;return o.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 hover:shadow-md transition-shadow",children:[o.jsxs("div",{className:"p-6 pb-4",children:[o.jsxs("div",{className:"flex items-start justify-between",children:[o.jsxs("div",{className:"flex-1",children:[o.jsx(Ot,{to:`/projects/${f.id}`,className:"text-lg font-semibold text-gray-900 hover:text-blue-600 line-clamp-1",children:f.name}),o.jsx("p",{className:"text-sm text-gray-500 mt-1 line-clamp-2",children:f.description})]}),o.jsxs(ho,{as:"div",className:"relative",children:[o.jsx(ho.Button,{className:"p-1 rounded-full hover:bg-gray-100",children:o.jsx(NK,{className:"h-5 w-5 text-gray-400"})}),o.jsx(FSe,{as:b.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:o.jsx(ho.Items,{className:"absolute right-0 z-10 mt-2 w-48 bg-white rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:o.jsxs("div",{className:"py-1",children:[o.jsx(ho.Item,{children:({active:g})=>o.jsx(Ot,{to:`/projects/${f.id}/edit`,className:`${g?"bg-gray-100":""} block px-4 py-2 text-sm text-gray-700`,children:"Edit Project"})}),o.jsx(ho.Item,{children:({active:g})=>o.jsx(Ot,{to:`/projects/${f.id}/workflows`,className:`${g?"bg-gray-100":""} block px-4 py-2 text-sm text-gray-700`,children:"Manage Workflows"})}),o.jsx(ho.Item,{children:({active:g})=>o.jsx(Ot,{to:`/projects/${f.id}/bzzz`,className:`${g?"bg-gray-100":""} block px-4 py-2 text-sm text-gray-700`,children:"🐝 Bzzz Integration"})}),o.jsx(ho.Item,{children:({active:g})=>o.jsx("button",{className:`${g?"bg-gray-100":""} block w-full text-left px-4 py-2 text-sm text-red-700`,onClick:()=>{},children:"Arcwhoosh Project"})})]})})})]})]}),o.jsxs("div",{className:"flex items-center justify-between mt-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("span",{className:d(f.status),children:f.status}),((h=f.bzzz_config)==null?void 0:h.bzzz_enabled)&&o.jsxs("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-yellow-100 text-yellow-800",children:["🐝 Bzzz",((m=f.bzzz_config)==null?void 0:m.ready_to_claim)&&o.jsx("span",{className:"ml-1 inline-block w-2 h-2 bg-green-400 rounded-full"})]})]}),o.jsxs("div",{className:"flex items-center space-x-1",children:[(y=f.tags)==null?void 0:y.slice(0,2).map(g=>o.jsxs("span",{className:"inline-flex items-center px-2 py-1 rounded text-xs bg-gray-100 text-gray-600",children:[o.jsx(Y2,{className:"h-3 w-3 mr-1"}),g]},g)),f.tags&&f.tags.length>2&&o.jsxs("span",{className:"text-xs text-gray-500",children:["+",f.tags.length-2]})]})]}),((p=f.bzzz_config)==null?void 0:p.bzzz_enabled)&&((x=f.bzzz_config)==null?void 0:x.git_url)&&o.jsx("div",{className:"mt-3 text-xs text-gray-500",children:o.jsxs("div",{className:"flex items-center space-x-1",children:[o.jsx("svg",{className:"h-3 w-3",fill:"currentColor",viewBox:"0 0 20 20",children:o.jsx("path",{fillRule:"evenodd",d:"M10 0C4.477 0 0 4.484 0 10.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0110 4.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.942.359.31.678.921.678 1.856 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0020 10.017C20 4.484 15.522 0 10 0z",clipRule:"evenodd"})}),o.jsxs("span",{children:[f.bzzz_config.git_owner,"/",f.bzzz_config.git_repository]}),f.bzzz_config.ready_to_claim&&o.jsx("span",{className:"text-green-600",children:"• Ready for tasks"})]})})]}),o.jsx("div",{className:"border-t px-6 py-4",children:o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(ml,{className:"h-4 w-4 text-gray-400"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-gray-900",children:f.workflow_count||0}),o.jsx("p",{className:"text-xs text-gray-500",children:"Workflows"})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Wf,{className:"h-4 w-4 text-gray-400"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-gray-900",children:f.file_count||0}),o.jsx("p",{className:"text-xs text-gray-500",children:"Files"})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Qc,{className:"h-4 w-4 text-gray-400"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-gray-900",children:f.has_project_plan?"Yes":"No"}),o.jsx("p",{className:"text-xs text-gray-500",children:"Project Plan"})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(hr,{className:"h-4 w-4 text-gray-400"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-gray-900",children:kc(new Date(f.updated_at),{addSuffix:!0})}),o.jsx("p",{className:"text-xs text-gray-500",children:"Last Update"})]})]})]})}),o.jsx("div",{className:"border-t px-6 py-3 bg-gray-50 rounded-b-lg",children:o.jsxs("div",{className:"flex justify-between",children:[o.jsx(Ot,{to:`/projects/${f.id}/workflows`,className:"text-sm text-blue-600 hover:text-blue-800 font-medium",children:"View Workflows"}),o.jsx(Ot,{to:`/projects/${f.id}`,className:"text-sm text-gray-600 hover:text-gray-800 font-medium",children:"View Details →"})]})})]},f.id)})})]})}function zSe(){var m,y;const{id:e}=Z$(),t=to(),[r,n]=b.useState(0),{data:i,isLoading:a,error:s}=$r({queryKey:["project",e],queryFn:async()=>{if(!e)throw new Error("Project ID is required");return await uc.getProject(e)},enabled:!!e}),{data:l=[]}=$r({queryKey:["project",e,"workflows"],queryFn:async()=>{if(!e)throw new Error("Project ID is required");return await uc.getProjectWorkflows(e)},enabled:!!e}),{data:c=[]}=$r({queryKey:["project",e,"executions"],queryFn:async()=>{if(!e)throw new Error("Project ID is required");return await uc.getProjectExecutions(e)},enabled:!!e}),{data:u}=$r({queryKey:["project",e,"metrics"],queryFn:async()=>{if(!e)throw new Error("Project ID is required");return await uc.getProjectMetrics(e)},enabled:!!e}),d=p=>{const x="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium";switch(p){case"active":return`${x} bg-green-100 text-green-800`;case"inactive":return`${x} bg-gray-100 text-gray-800`;case"draft":return`${x} bg-yellow-100 text-yellow-800`;case"completed":return`${x} bg-green-100 text-green-800`;case"failed":return`${x} bg-red-100 text-red-800`;case"running":return`${x} bg-blue-100 text-blue-800`;case"pending":return`${x} bg-yellow-100 text-yellow-800`;default:return`${x} bg-gray-100 text-gray-800`}},f=p=>{switch(p){case"completed":return o.jsx(dn,{className:"h-5 w-5 text-green-500"});case"failed":return o.jsx(Kr,{className:"h-5 w-5 text-red-500"});case"running":return o.jsx(hr,{className:"h-5 w-5 text-blue-500 animate-spin"});default:return o.jsx(hr,{className:"h-5 w-5 text-gray-400"})}};if(a)return o.jsx("div",{className:"p-6",children:o.jsxs("div",{className:"animate-pulse",children:[o.jsx("div",{className:"h-8 bg-gray-200 rounded w-1/4 mb-6"}),o.jsx("div",{className:"h-32 bg-gray-200 rounded mb-6"}),o.jsx("div",{className:"h-64 bg-gray-200 rounded"})]})});if(s||!i)return o.jsx("div",{className:"p-6",children:o.jsxs("div",{className:"text-center py-12",children:[o.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Project not found"}),o.jsx("p",{className:"text-gray-600 mb-4",children:"The project you're looking for doesn't exist or has been deleted."}),o.jsxs("button",{onClick:()=>t("/projects"),className:"inline-flex items-center px-4 py-2 border border-transparent rounded-md text-sm font-medium text-white bg-blue-600 hover:bg-blue-700",children:[o.jsx(dg,{className:"h-4 w-4 mr-2"}),"Back to Projects"]})]})});const h=[{name:"Overview",count:null},{name:"Workflows",count:l.length},{name:"Executions",count:c.length},{name:"Settings",count:null}];return o.jsxs("div",{className:"p-6",children:[o.jsxs("div",{className:"mb-6",children:[o.jsx("div",{className:"flex items-center space-x-4 mb-4",children:o.jsxs("button",{onClick:()=>t("/projects"),className:"flex items-center text-gray-500 hover:text-gray-700",children:[o.jsx(dg,{className:"h-5 w-5 mr-1"}),"Back to Projects"]})}),o.jsxs("div",{className:"flex justify-between items-start",children:[o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"flex items-center space-x-3 mb-2",children:[o.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:i.name}),o.jsx("span",{className:d(i.status),children:i.status})]}),o.jsx("p",{className:"text-gray-600 max-w-3xl",children:i.description}),i.tags&&i.tags.length>0&&o.jsxs("div",{className:"flex items-center space-x-2 mt-3",children:[o.jsx(Y2,{className:"h-4 w-4 text-gray-400"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:i.tags.map(p=>o.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded text-xs bg-gray-100 text-gray-600",children:p},p))})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsxs("button",{onClick:()=>t(`/projects/${e}/edit`),className:"inline-flex items-center px-3 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50",children:[o.jsx(Vf,{className:"h-4 w-4 mr-2"}),"Edit"]}),o.jsxs("button",{className:"inline-flex items-center px-3 py-2 border border-red-300 rounded-md text-sm font-medium text-red-700 bg-white hover:bg-red-50",children:[o.jsx($3,{className:"h-4 w-4 mr-2"}),"Arcwhoosh"]})]})]})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:[o.jsx("div",{className:"bg-white rounded-lg border p-6",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(ml,{className:"h-8 w-8 text-blue-500"}),o.jsxs("div",{className:"ml-4",children:[o.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[(u==null?void 0:u.active_workflows)||l.filter(p=>p.status==="active").length,"/",(u==null?void 0:u.total_workflows)||l.length]}),o.jsx("p",{className:"text-sm text-gray-500",children:"Active Workflows"})]})]})}),o.jsx("div",{className:"bg-white rounded-lg border p-6",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(hi,{className:"h-8 w-8 text-green-500"}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:(u==null?void 0:u.total_executions)||c.length}),o.jsx("p",{className:"text-sm text-gray-500",children:"Total Executions"})]})]})}),o.jsx("div",{className:"bg-white rounded-lg border p-6",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(Qc,{className:"h-8 w-8 text-purple-500"}),o.jsxs("div",{className:"ml-4",children:[o.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[u!=null&&u.success_rate?(u.success_rate*100).toFixed(0):c.length>0?Math.round(c.filter(p=>p.status==="completed").length/c.length*100):0,"%"]}),o.jsx("p",{className:"text-sm text-gray-500",children:"Success Rate"})]})]})}),o.jsx("div",{className:"bg-white rounded-lg border p-6",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(hr,{className:"h-8 w-8 text-orange-500"}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-lg font-semibold text-gray-900",children:kc(new Date((u==null?void 0:u.last_activity)||i.updated_at),{addSuffix:!0})}),o.jsx("p",{className:"text-sm text-gray-500",children:"Last Activity"})]})]})})]}),o.jsxs(Ua.Group,{selectedIndex:r,onChange:n,children:[o.jsx(Ua.List,{className:"flex space-x-1 rounded-xl bg-gray-100 p-1",children:h.map(p=>o.jsx(Ua,{className:({selected:x})=>`w-full rounded-lg py-2.5 text-sm font-medium leading-5 transition-all ${x?"bg-white text-blue-700 shadow":"text-gray-600 hover:bg-white/[0.12] hover:text-gray-900"}`,children:o.jsxs("span",{className:"flex items-center justify-center space-x-2",children:[o.jsx("span",{children:p.name}),p.count!==null&&o.jsx("span",{className:"bg-gray-200 text-gray-600 px-2 py-1 rounded-full text-xs",children:p.count})]})},p.name))}),o.jsxs(Ua.Panels,{className:"mt-6",children:[o.jsx(Ua.Panel,{children:o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[o.jsxs("div",{className:"bg-white rounded-lg border p-6",children:[o.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Project Information"}),o.jsxs("dl",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Created"}),o.jsx("dd",{className:"text-sm text-gray-900",children:sf(new Date(i.created_at),"PPP")})]}),o.jsxs("div",{children:[o.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Last Updated"}),o.jsx("dd",{className:"text-sm text-gray-900",children:sf(new Date(i.updated_at),"PPP")})]}),((m=i.metadata)==null?void 0:m.owner)&&o.jsxs("div",{children:[o.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Owner"}),o.jsx("dd",{className:"text-sm text-gray-900",children:i.metadata.owner})]}),((y=i.metadata)==null?void 0:y.department)&&o.jsxs("div",{children:[o.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Department"}),o.jsx("dd",{className:"text-sm text-gray-900",children:i.metadata.department})]})]})]}),o.jsxs("div",{className:"bg-white rounded-lg border p-6",children:[o.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Recent Executions"}),o.jsx("div",{className:"space-y-3",children:c.slice(0,5).map(p=>{const x=l.find(g=>g.id===p.workflow_id);return o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center space-x-3",children:[f(p.status),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-gray-900",children:x==null?void 0:x.name}),o.jsx("p",{className:"text-xs text-gray-500",children:kc(new Date(p.started_at),{addSuffix:!0})})]})]}),o.jsx("span",{className:d(p.status),children:p.status})]},p.id)})})]})]})}),o.jsx(Ua.Panel,{children:o.jsxs("div",{className:"bg-white rounded-lg border",children:[o.jsx("div",{className:"p-6 border-b",children:o.jsxs("div",{className:"flex justify-between items-center",children:[o.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Workflows"}),o.jsxs(Ot,{to:`/projects/${e}/workflows/new`,className:"inline-flex items-center px-3 py-2 border border-transparent rounded-md text-sm font-medium text-white bg-blue-600 hover:bg-blue-700",children:[o.jsx(Sa,{className:"h-4 w-4 mr-2"}),"Add Workflow"]})]})}),o.jsx("div",{className:"divide-y",children:l.map(p=>o.jsx("div",{className:"p-6",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"flex items-center space-x-3",children:[o.jsx(Ot,{to:`/workflows/${p.id}`,className:"text-lg font-medium text-gray-900 hover:text-blue-600",children:p.name}),o.jsx("span",{className:d(p.status),children:p.status})]}),o.jsx("p",{className:"text-gray-600 mt-1",children:p.description}),o.jsxs("p",{className:"text-sm text-gray-500 mt-2",children:["Updated ",kc(new Date(p.updated_at),{addSuffix:!0})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("button",{className:"p-2 text-gray-400 hover:text-gray-600",children:p.status==="active"?o.jsx(hg,{className:"h-5 w-5"}):o.jsx(hi,{className:"h-5 w-5"})}),o.jsx(Ot,{to:`/workflows/${p.id}/edit`,className:"p-2 text-gray-400 hover:text-gray-600",children:o.jsx(Vf,{className:"h-5 w-5"})})]})]})},p.id))})]})}),o.jsx(Ua.Panel,{children:o.jsxs("div",{className:"bg-white rounded-lg border",children:[o.jsx("div",{className:"p-6 border-b",children:o.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Execution History"})}),o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[o.jsx("thead",{className:"bg-gray-50",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Workflow"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Started"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Duration"}),o.jsx("th",{className:"relative px-6 py-3",children:o.jsx("span",{className:"sr-only",children:"Actions"})})]})}),o.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:c.map(p=>{const x=l.find(v=>v.id===p.workflow_id),g=p.completed_at?new Date(p.completed_at).getTime()-new Date(p.started_at).getTime():null;return o.jsxs("tr",{children:[o.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:o.jsxs("div",{className:"flex items-center",children:[f(p.status),o.jsxs("div",{className:"ml-3",children:[o.jsx("div",{className:"text-sm font-medium text-gray-900",children:x==null?void 0:x.name}),o.jsx("div",{className:"text-sm text-gray-500",children:p.id})]})]})}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:o.jsx("span",{className:d(p.status),children:p.status})}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:sf(new Date(p.started_at),"PPp")}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:g?`${Math.round(g/1e3)}s`:"-"}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium",children:o.jsx(Ot,{to:`/executions/${p.id}`,className:"text-blue-600 hover:text-blue-900",children:"View Details"})})]},p.id)})})]})})]})}),o.jsx(Ua.Panel,{children:o.jsxs("div",{className:"bg-white rounded-lg border p-6",children:[o.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Project Settings"}),o.jsx("p",{className:"text-gray-600",children:"Project settings and configuration options will be available here."})]})})]})]})]})}var rm=e=>e.type==="checkbox",Fo=e=>e instanceof Date,Cr=e=>e==null;const CD=e=>typeof e=="object";var It=e=>!Cr(e)&&!Array.isArray(e)&&CD(e)&&!Fo(e),USe=e=>It(e)&&e.target?rm(e.target)?e.target.checked:e.target.value:e,WSe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,VSe=(e,t)=>e.has(WSe(t)),HSe=e=>{const t=e.constructor&&e.constructor.prototype;return It(t)&&t.hasOwnProperty("isPrototypeOf")},vN=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function rr(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(vN&&(e instanceof Blob||n))&&(r||It(e)))if(t=r?[]:{},!r&&!HSe(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=rr(e[i]));else return e;return t}var uv=e=>/^\w*$/.test(e),Ut=e=>e===void 0,xN=e=>Array.isArray(e)?e.filter(Boolean):[],bN=e=>xN(e.replace(/["|']|\]/g,"").split(/\.|\[/)),pe=(e,t,r)=>{if(!t||!It(e))return r;const n=(uv(t)?[t]:bN(t)).reduce((i,a)=>Cr(i)?i:i[a],e);return Ut(n)||n===e?Ut(e[t])?r:e[t]:n},Ei=e=>typeof e=="boolean",it=(e,t,r)=>{let n=-1;const i=uv(t)?[t]:bN(t),a=i.length,s=a-1;for(;++n{const i={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(i,a,{get:()=>{const s=a;return t._proxyFormState[s]!==li.all&&(t._proxyFormState[s]=!n||li.all),e[s]}});return i};const GSe=typeof window<"u"?b.useLayoutEffect:b.useEffect;var Ri=e=>typeof e=="string",YSe=(e,t,r,n,i)=>Ri(e)?(n&&t.watch.add(e),pe(r,e,i)):Array.isArray(e)?e.map(a=>(n&&t.watch.add(a),pe(r,a))):(n&&(t.watchAll=!0),r),TD=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},mf=e=>Array.isArray(e)?e:[e],j5=()=>{let e=[];return{get observers(){return e},next:i=>{for(const a of e)a.next&&a.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(a=>a!==i)}}),unsubscribe:()=>{e=[]}}},pj=e=>Cr(e)||!CD(e);function os(e,t,r=new WeakSet){if(pj(e)||pj(t))return e===t;if(Fo(e)&&Fo(t))return e.getTime()===t.getTime();const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of n){const s=e[a];if(!i.includes(a))return!1;if(a!=="ref"){const l=t[a];if(Fo(s)&&Fo(l)||It(s)&&It(l)||Array.isArray(s)&&Array.isArray(l)?!os(s,l,r):s!==l)return!1}}return!0}var Ur=e=>It(e)&&!Object.keys(e).length,wN=e=>e.type==="file",ci=e=>typeof e=="function",wy=e=>{if(!vN)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},$D=e=>e.type==="select-multiple",jN=e=>e.type==="radio",ZSe=e=>jN(e)||rm(e),Hx=e=>wy(e)&&e.isConnected;function XSe(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{for(const t in e)if(ci(e[t]))return!0;return!1};function jy(e,t={}){const r=Array.isArray(e);if(It(e)||r)for(const n in e)Array.isArray(e[n])||It(e[n])&&!MD(e[n])?(t[n]=Array.isArray(e[n])?[]:{},jy(e[n],t[n])):Cr(e[n])||(t[n]=!0);return t}function RD(e,t,r){const n=Array.isArray(e);if(It(e)||n)for(const i in e)Array.isArray(e[i])||It(e[i])&&!MD(e[i])?Ut(t)||pj(r[i])?r[i]=Array.isArray(e[i])?jy(e[i],[]):{...jy(e[i])}:RD(e[i],Cr(t)?{}:t[i],r[i]):r[i]=!os(e[i],t[i]);return r}var Pd=(e,t)=>RD(e,t,jy(t));const _5={value:!1,isValid:!1},N5={value:!0,isValid:!0};var ID=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ut(e[0].attributes.value)?Ut(e[0].value)||e[0].value===""?N5:{value:e[0].value,isValid:!0}:N5:_5}return _5},DD=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Ut(e)?e:t?e===""?NaN:e&&+e:r&&Ri(e)?new Date(e):n?n(e):e;const S5={isValid:!1,value:null};var LD=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,S5):S5;function k5(e){const t=e.ref;return wN(t)?t.files:jN(t)?LD(e.refs).value:$D(t)?[...t.selectedOptions].map(({value:r})=>r):rm(t)?ID(e.refs).value:DD(Ut(t.value)?e.ref.value:t.value,e)}var JSe=(e,t,r,n)=>{const i={};for(const a of e){const s=pe(t,a);s&&it(i,a,s._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},_y=e=>e instanceof RegExp,Cd=e=>Ut(e)?e:_y(e)?e.source:It(e)?_y(e.value)?e.value.source:e.value:e,E5=e=>({isOnSubmit:!e||e===li.onSubmit,isOnBlur:e===li.onBlur,isOnChange:e===li.onChange,isOnAll:e===li.all,isOnTouch:e===li.onTouched});const O5="AsyncFunction";var eke=e=>!!e&&!!e.validate&&!!(ci(e.validate)&&e.validate.constructor.name===O5||It(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===O5)),tke=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),A5=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const pf=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const a=pe(e,i);if(a){const{_f:s,...l}=a;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],i)&&!n)return!0;if(s.ref&&t(s.ref,s.name)&&!n)return!0;if(pf(l,t))break}else if(It(l)&&pf(l,t))break}}};function P5(e,t,r){const n=pe(e,r);if(n||uv(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const a=i.join("."),s=pe(t,a),l=pe(e,a);if(s&&!Array.isArray(s)&&r!==a)return{name:r};if(l&&l.type)return{name:a,error:l};if(l&&l.root&&l.root.type)return{name:`${a}.root`,error:l.root};i.pop()}return{name:r}}var rke=(e,t,r,n)=>{r(e);const{name:i,...a}=e;return Ur(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(s=>t[s]===(!n||li.all))},nke=(e,t,r)=>!e||!t||e===t||mf(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),ike=(e,t,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?n.isOnChange:i.isOnChange)?e:!0,ake=(e,t)=>!xN(pe(e,t)).length&&Lt(e,t),ske=(e,t,r)=>{const n=mf(pe(e,r));return it(n,"root",t[r]),it(e,r,n),e},Np=e=>Ri(e);function C5(e,t,r="validate"){if(Np(e)||Array.isArray(e)&&e.every(Np)||Ei(e)&&!e)return{type:r,message:Np(e)?e:"",ref:t}}var Kl=e=>It(e)&&!_y(e)?e:{value:e,message:""},T5=async(e,t,r,n,i,a)=>{const{ref:s,refs:l,required:c,maxLength:u,minLength:d,min:f,max:h,pattern:m,validate:y,name:p,valueAsNumber:x,mount:g}=e._f,v=pe(r,p);if(!g||t.has(p))return{};const w=l?l[0]:s,_=P=>{i&&w.reportValidity&&(w.setCustomValidity(Ei(P)?"":P||""),w.reportValidity())},j={},N=jN(s),S=rm(s),E=N||S,k=(x||wN(s))&&Ut(s.value)&&Ut(v)||wy(s)&&s.value===""||v===""||Array.isArray(v)&&!v.length,A=TD.bind(null,p,n,j),C=(P,$,O,I=Xi.maxLength,D=Xi.minLength)=>{const L=P?$:O;j[p]={type:P?I:D,message:L,ref:s,...A(P?I:D,L)}};if(a?!Array.isArray(v)||!v.length:c&&(!E&&(k||Cr(v))||Ei(v)&&!v||S&&!ID(l).isValid||N&&!LD(l).isValid)){const{value:P,message:$}=Np(c)?{value:!!c,message:c}:Kl(c);if(P&&(j[p]={type:Xi.required,message:$,ref:w,...A(Xi.required,$)},!n))return _($),j}if(!k&&(!Cr(f)||!Cr(h))){let P,$;const O=Kl(h),I=Kl(f);if(!Cr(v)&&!isNaN(v)){const D=s.valueAsNumber||v&&+v;Cr(O.value)||(P=D>O.value),Cr(I.value)||($=Dnew Date(new Date().toDateString()+" "+B),R=s.type=="time",M=s.type=="week";Ri(O.value)&&v&&(P=R?L(v)>L(O.value):M?v>O.value:D>new Date(O.value)),Ri(I.value)&&v&&($=R?L(v)+P.value,I=!Cr($.value)&&v.length<+$.value;if((O||I)&&(C(O,P.message,$.message),!n))return _(j[p].message),j}if(m&&!k&&Ri(v)){const{value:P,message:$}=Kl(m);if(_y(P)&&!v.match(P)&&(j[p]={type:Xi.pattern,message:$,ref:s,...A(Xi.pattern,$)},!n))return _($),j}if(y){if(ci(y)){const P=await y(v,r),$=C5(P,w);if($&&(j[p]={...$,...A(Xi.validate,$.message)},!n))return _($.message),j}else if(It(y)){let P={};for(const $ in y){if(!Ur(P)&&!n)break;const O=C5(await y[$](v,r),w,$);O&&(P={...O,...A($,O.message)},_(O.message),n&&(j[p]=P))}if(!Ur(P)&&(j[p]={ref:w,...P},!n))return j}}return _(!0),j};const oke={mode:li.onSubmit,reValidateMode:li.onChange,shouldFocusError:!0};function lke(e={}){let t={...oke,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:ci(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=It(t.defaultValues)||It(t.values)?rr(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:rr(i),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let f={...d};const h={array:j5(),state:j5()},m=t.criteriaMode===li.all,y=F=>H=>{clearTimeout(u),u=setTimeout(F,H)},p=async F=>{if(!t.disabled&&(d.isValid||f.isValid||F)){const H=t.resolver?Ur((await S()).errors):await k(n,!0);H!==r.isValid&&h.state.next({isValid:H})}},x=(F,H)=>{!t.disabled&&(d.isValidating||d.validatingFields||f.isValidating||f.validatingFields)&&((F||Array.from(l.mount)).forEach(K=>{K&&(H?it(r.validatingFields,K,H):Lt(r.validatingFields,K))}),h.state.next({validatingFields:r.validatingFields,isValidating:!Ur(r.validatingFields)}))},g=(F,H=[],K,se,ie=!0,te=!0)=>{if(se&&K&&!t.disabled){if(s.action=!0,te&&Array.isArray(pe(n,F))){const ge=K(pe(n,F),se.argA,se.argB);ie&&it(n,F,ge)}if(te&&Array.isArray(pe(r.errors,F))){const ge=K(pe(r.errors,F),se.argA,se.argB);ie&&it(r.errors,F,ge),ake(r.errors,F)}if((d.touchedFields||f.touchedFields)&&te&&Array.isArray(pe(r.touchedFields,F))){const ge=K(pe(r.touchedFields,F),se.argA,se.argB);ie&&it(r.touchedFields,F,ge)}(d.dirtyFields||f.dirtyFields)&&(r.dirtyFields=Pd(i,a)),h.state.next({name:F,isDirty:C(F,H),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else it(a,F,H)},v=(F,H)=>{it(r.errors,F,H),h.state.next({errors:r.errors})},w=F=>{r.errors=F,h.state.next({errors:r.errors,isValid:!1})},_=(F,H,K,se)=>{const ie=pe(n,F);if(ie){const te=pe(a,F,Ut(K)?pe(i,F):K);Ut(te)||se&&se.defaultChecked||H?it(a,F,H?te:k5(ie._f)):O(F,te),s.mount&&p()}},j=(F,H,K,se,ie)=>{let te=!1,ge=!1;const Fe={name:F};if(!t.disabled){if(!K||se){(d.isDirty||f.isDirty)&&(ge=r.isDirty,r.isDirty=Fe.isDirty=C(),te=ge!==Fe.isDirty);const Ve=os(pe(i,F),H);ge=!!pe(r.dirtyFields,F),Ve?Lt(r.dirtyFields,F):it(r.dirtyFields,F,!0),Fe.dirtyFields=r.dirtyFields,te=te||(d.dirtyFields||f.dirtyFields)&&ge!==!Ve}if(K){const Ve=pe(r.touchedFields,F);Ve||(it(r.touchedFields,F,K),Fe.touchedFields=r.touchedFields,te=te||(d.touchedFields||f.touchedFields)&&Ve!==K)}te&&ie&&h.state.next(Fe)}return te?Fe:{}},N=(F,H,K,se)=>{const ie=pe(r.errors,F),te=(d.isValid||f.isValid)&&Ei(H)&&r.isValid!==H;if(t.delayError&&K?(c=y(()=>v(F,K)),c(t.delayError)):(clearTimeout(u),c=null,K?it(r.errors,F,K):Lt(r.errors,F)),(K?!os(ie,K):ie)||!Ur(se)||te){const ge={...se,...te&&Ei(H)?{isValid:H}:{},errors:r.errors,name:F};r={...r,...ge},h.state.next(ge)}},S=async F=>{x(F,!0);const H=await t.resolver(a,t.context,JSe(F||l.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return x(F),H},E=async F=>{const{errors:H}=await S(F);if(F)for(const K of F){const se=pe(H,K);se?it(r.errors,K,se):Lt(r.errors,K)}else r.errors=H;return H},k=async(F,H,K={valid:!0})=>{for(const se in F){const ie=F[se];if(ie){const{_f:te,...ge}=ie;if(te){const Fe=l.array.has(te.name),Ve=ie._f&&eke(ie._f);Ve&&d.validatingFields&&x([se],!0);const qt=await T5(ie,l.disabled,a,m,t.shouldUseNativeValidation&&!H,Fe);if(Ve&&d.validatingFields&&x([se]),qt[te.name]&&(K.valid=!1,H))break;!H&&(pe(qt,te.name)?Fe?ske(r.errors,qt,te.name):it(r.errors,te.name,qt[te.name]):Lt(r.errors,te.name))}!Ur(ge)&&await k(ge,H,K)}}return K.valid},A=()=>{for(const F of l.unMount){const H=pe(n,F);H&&(H._f.refs?H._f.refs.every(K=>!Hx(K)):!Hx(H._f.ref))&&ve(F)}l.unMount=new Set},C=(F,H)=>!t.disabled&&(F&&H&&it(a,F,H),!os(B(),i)),P=(F,H,K)=>YSe(F,l,{...s.mount?a:Ut(H)?i:Ri(F)?{[F]:H}:H},K,H),$=F=>xN(pe(s.mount?a:i,F,t.shouldUnregister?pe(i,F,[]):[])),O=(F,H,K={})=>{const se=pe(n,F);let ie=H;if(se){const te=se._f;te&&(!te.disabled&&it(a,F,DD(H,te)),ie=wy(te.ref)&&Cr(H)?"":H,$D(te.ref)?[...te.ref.options].forEach(ge=>ge.selected=ie.includes(ge.value)):te.refs?rm(te.ref)?te.refs.forEach(ge=>{(!ge.defaultChecked||!ge.disabled)&&(Array.isArray(ie)?ge.checked=!!ie.find(Fe=>Fe===ge.value):ge.checked=ie===ge.value||!!ie)}):te.refs.forEach(ge=>ge.checked=ge.value===ie):wN(te.ref)?te.ref.value="":(te.ref.value=ie,te.ref.type||h.state.next({name:F,values:rr(a)})))}(K.shouldDirty||K.shouldTouch)&&j(F,ie,K.shouldTouch,K.shouldDirty,!0),K.shouldValidate&&M(F)},I=(F,H,K)=>{for(const se in H){if(!H.hasOwnProperty(se))return;const ie=H[se],te=F+"."+se,ge=pe(n,te);(l.array.has(F)||It(ie)||ge&&!ge._f)&&!Fo(ie)?I(te,ie,K):O(te,ie,K)}},D=(F,H,K={})=>{const se=pe(n,F),ie=l.array.has(F),te=rr(H);it(a,F,te),ie?(h.array.next({name:F,values:rr(a)}),(d.isDirty||d.dirtyFields||f.isDirty||f.dirtyFields)&&K.shouldDirty&&h.state.next({name:F,dirtyFields:Pd(i,a),isDirty:C(F,te)})):se&&!se._f&&!Cr(te)?I(F,te,K):O(F,te,K),A5(F,l)&&h.state.next({...r}),h.state.next({name:s.mount?F:void 0,values:rr(a)})},L=async F=>{s.mount=!0;const H=F.target;let K=H.name,se=!0;const ie=pe(n,K),te=Ve=>{se=Number.isNaN(Ve)||Fo(Ve)&&isNaN(Ve.getTime())||os(Ve,pe(a,K,Ve))},ge=E5(t.mode),Fe=E5(t.reValidateMode);if(ie){let Ve,qt;const wi=H.type?k5(ie._f):USe(F),ht=F.type===w5.BLUR||F.type===w5.FOCUS_OUT,en=!tke(ie._f)&&!t.resolver&&!pe(r.errors,K)&&!ie._f.deps||ike(ht,pe(r.touchedFields,K),r.isSubmitted,Fe,ge),Hn=A5(K,l,ht);it(a,K,wi),ht?(ie._f.onBlur&&ie._f.onBlur(F),c&&c(0)):ie._f.onChange&&ie._f.onChange(F);const qn=j(K,wi,ht),Ki=!Ur(qn)||Hn;if(!ht&&h.state.next({name:K,type:F.type,values:rr(a)}),en)return(d.isValid||f.isValid)&&(t.mode==="onBlur"?ht&&p():ht||p()),Ki&&h.state.next({name:K,...Hn?{}:qn});if(!ht&&Hn&&h.state.next({...r}),t.resolver){const{errors:bn}=await S([K]);if(te(wi),se){const wn=P5(r.errors,n,K),La=P5(bn,n,wn.name||K);Ve=La.error,K=La.name,qt=Ur(bn)}}else x([K],!0),Ve=(await T5(ie,l.disabled,a,m,t.shouldUseNativeValidation))[K],x([K]),te(wi),se&&(Ve?qt=!1:(d.isValid||f.isValid)&&(qt=await k(n,!0)));se&&(ie._f.deps&&M(ie._f.deps),N(K,qt,Ve,qn))}},R=(F,H)=>{if(pe(r.errors,H)&&F.focus)return F.focus(),1},M=async(F,H={})=>{let K,se;const ie=mf(F);if(t.resolver){const te=await E(Ut(F)?F:ie);K=Ur(te),se=F?!ie.some(ge=>pe(te,ge)):K}else F?(se=(await Promise.all(ie.map(async te=>{const ge=pe(n,te);return await k(ge&&ge._f?{[te]:ge}:ge)}))).every(Boolean),!(!se&&!r.isValid)&&p()):se=K=await k(n);return h.state.next({...!Ri(F)||(d.isValid||f.isValid)&&K!==r.isValid?{}:{name:F},...t.resolver||!F?{isValid:K}:{},errors:r.errors}),H.shouldFocus&&!se&&pf(n,R,F?ie:l.mount),se},B=F=>{const H={...s.mount?a:i};return Ut(F)?H:Ri(F)?pe(H,F):F.map(K=>pe(H,K))},U=(F,H)=>({invalid:!!pe((H||r).errors,F),isDirty:!!pe((H||r).dirtyFields,F),error:pe((H||r).errors,F),isValidating:!!pe(r.validatingFields,F),isTouched:!!pe((H||r).touchedFields,F)}),W=F=>{F&&mf(F).forEach(H=>Lt(r.errors,H)),h.state.next({errors:F?r.errors:{}})},Z=(F,H,K)=>{const se=(pe(n,F,{_f:{}})._f||{}).ref,ie=pe(r.errors,F)||{},{ref:te,message:ge,type:Fe,...Ve}=ie;it(r.errors,F,{...Ve,...H,ref:se}),h.state.next({name:F,errors:r.errors,isValid:!1}),K&&K.shouldFocus&&se&&se.focus&&se.focus()},q=(F,H)=>ci(F)?h.state.subscribe({next:K=>F(P(void 0,H),K)}):P(F,H,!0),ee=F=>h.state.subscribe({next:H=>{nke(F.name,H.name,F.exact)&&rke(H,F.formState||d,Y,F.reRenderRoot)&&F.callback({values:{...a},...r,...H})}}).unsubscribe,le=F=>(s.mount=!0,f={...f,...F.formState},ee({...F,formState:f})),ve=(F,H={})=>{for(const K of F?mf(F):l.mount)l.mount.delete(K),l.array.delete(K),H.keepValue||(Lt(n,K),Lt(a,K)),!H.keepError&&Lt(r.errors,K),!H.keepDirty&&Lt(r.dirtyFields,K),!H.keepTouched&&Lt(r.touchedFields,K),!H.keepIsValidating&&Lt(r.validatingFields,K),!t.shouldUnregister&&!H.keepDefaultValue&&Lt(i,K);h.state.next({values:rr(a)}),h.state.next({...r,...H.keepDirty?{isDirty:C()}:{}}),!H.keepIsValid&&p()},Ne=({disabled:F,name:H})=>{(Ei(F)&&s.mount||F||l.disabled.has(H))&&(F?l.disabled.add(H):l.disabled.delete(H))},J=(F,H={})=>{let K=pe(n,F);const se=Ei(H.disabled)||Ei(t.disabled);return it(n,F,{...K||{},_f:{...K&&K._f?K._f:{ref:{name:F}},name:F,mount:!0,...H}}),l.mount.add(F),K?Ne({disabled:Ei(H.disabled)?H.disabled:t.disabled,name:F}):_(F,!0,H.value),{...se?{disabled:H.disabled||t.disabled}:{},...t.progressive?{required:!!H.required,min:Cd(H.min),max:Cd(H.max),minLength:Cd(H.minLength),maxLength:Cd(H.maxLength),pattern:Cd(H.pattern)}:{},name:F,onChange:L,onBlur:L,ref:ie=>{if(ie){J(F,H),K=pe(n,F);const te=Ut(ie.value)&&ie.querySelectorAll&&ie.querySelectorAll("input,select,textarea")[0]||ie,ge=ZSe(te),Fe=K._f.refs||[];if(ge?Fe.find(Ve=>Ve===te):te===K._f.ref)return;it(n,F,{_f:{...K._f,...ge?{refs:[...Fe.filter(Hx),te,...Array.isArray(pe(i,F))?[{}]:[]],ref:{type:te.type,name:F}}:{ref:te}}}),_(F,!1,void 0,te)}else K=pe(n,F,{}),K._f&&(K._f.mount=!1),(t.shouldUnregister||H.shouldUnregister)&&!(VSe(l.array,F)&&s.action)&&l.unMount.add(F)}}},oe=()=>t.shouldFocusError&&pf(n,R,l.mount),me=F=>{Ei(F)&&(h.state.next({disabled:F}),pf(n,(H,K)=>{const se=pe(n,K);se&&(H.disabled=se._f.disabled||F,Array.isArray(se._f.refs)&&se._f.refs.forEach(ie=>{ie.disabled=se._f.disabled||F}))},0,!1))},Q=(F,H)=>async K=>{let se;K&&(K.preventDefault&&K.preventDefault(),K.persist&&K.persist());let ie=rr(a);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:te,values:ge}=await S();r.errors=te,ie=rr(ge)}else await k(n);if(l.disabled.size)for(const te of l.disabled)Lt(ie,te);if(Lt(r.errors,"root"),Ur(r.errors)){h.state.next({errors:{}});try{await F(ie,K)}catch(te){se=te}}else H&&await H({...r.errors},K),oe(),setTimeout(oe);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ur(r.errors)&&!se,submitCount:r.submitCount+1,errors:r.errors}),se)throw se},Pe=(F,H={})=>{pe(n,F)&&(Ut(H.defaultValue)?D(F,rr(pe(i,F))):(D(F,H.defaultValue),it(i,F,rr(H.defaultValue))),H.keepTouched||Lt(r.touchedFields,F),H.keepDirty||(Lt(r.dirtyFields,F),r.isDirty=H.defaultValue?C(F,rr(pe(i,F))):C()),H.keepError||(Lt(r.errors,F),d.isValid&&p()),h.state.next({...r}))},be=(F,H={})=>{const K=F?rr(F):i,se=rr(K),ie=Ur(F),te=ie?i:se;if(H.keepDefaultValues||(i=K),!H.keepValues){if(H.keepDirtyValues){const ge=new Set([...l.mount,...Object.keys(Pd(i,a))]);for(const Fe of Array.from(ge))pe(r.dirtyFields,Fe)?it(te,Fe,pe(a,Fe)):D(Fe,pe(te,Fe))}else{if(vN&&Ut(F))for(const ge of l.mount){const Fe=pe(n,ge);if(Fe&&Fe._f){const Ve=Array.isArray(Fe._f.refs)?Fe._f.refs[0]:Fe._f.ref;if(wy(Ve)){const qt=Ve.closest("form");if(qt){qt.reset();break}}}}if(H.keepFieldsRef)for(const ge of l.mount)D(ge,pe(te,ge));else n={}}a=t.shouldUnregister?H.keepDefaultValues?rr(i):{}:rr(te),h.array.next({values:{...te}}),h.state.next({values:{...te}})}l={mount:H.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!d.isValid||!!H.keepIsValid||!!H.keepDirtyValues,s.watch=!!t.shouldUnregister,h.state.next({submitCount:H.keepSubmitCount?r.submitCount:0,isDirty:ie?!1:H.keepDirty?r.isDirty:!!(H.keepDefaultValues&&!os(F,i)),isSubmitted:H.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:ie?{}:H.keepDirtyValues?H.keepDefaultValues&&a?Pd(i,a):r.dirtyFields:H.keepDefaultValues&&F?Pd(i,F):H.keepDirty?r.dirtyFields:{},touchedFields:H.keepTouched?r.touchedFields:{},errors:H.keepErrors?r.errors:{},isSubmitSuccessful:H.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Ee=(F,H)=>be(ci(F)?F(a):F,H),Re=(F,H={})=>{const K=pe(n,F),se=K&&K._f;if(se){const ie=se.refs?se.refs[0]:se.ref;ie.focus&&(ie.focus(),H.shouldSelect&&ci(ie.select)&&ie.select())}},Y=F=>{r={...r,...F}},ce={control:{register:J,unregister:ve,getFieldState:U,handleSubmit:Q,setError:Z,_subscribe:ee,_runSchema:S,_focusError:oe,_getWatch:P,_getDirty:C,_setValid:p,_setFieldArray:g,_setDisabledField:Ne,_setErrors:w,_getFieldArray:$,_reset:be,_resetDefaultValues:()=>ci(t.defaultValues)&&t.defaultValues().then(F=>{Ee(F,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:A,_disableForm:me,_subjects:h,_proxyFormState:d,get _fields(){return n},get _formValues(){return a},get _state(){return s},set _state(F){s=F},get _defaultValues(){return i},get _names(){return l},set _names(F){l=F},get _formState(){return r},get _options(){return t},set _options(F){t={...t,...F}}},subscribe:le,trigger:M,register:J,handleSubmit:Q,watch:q,setValue:D,getValues:B,reset:Ee,resetField:Pe,clearErrors:W,unregister:ve,setError:Z,setFocus:Re,getFieldState:U};return{...ce,formControl:ce}}function cke(e={}){const t=T.useRef(void 0),r=T.useRef(void 0),[n,i]=T.useState({isDirty:!1,isValidating:!1,isLoading:ci(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:ci(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!ci(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:s,...l}=lke(e);t.current={...l,formState:n}}const a=t.current.control;return a._options=e,GSe(()=>{const s=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState}),reRenderRoot:!0});return i(l=>({...l,isReady:!0})),a._formState.isReady=!0,s},[a]),T.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),T.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),T.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),T.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),T.useEffect(()=>{if(a._proxyFormState.isDirty){const s=a._getDirty();s!==n.isDirty&&a._subjects.state.next({isDirty:s})}},[a,n.isDirty]),T.useEffect(()=>{e.values&&!os(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),r.current=e.values,i(s=>({...s}))):a._resetDefaultValues()},[a,e.values]),T.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=KSe(n,a),t.current}const $5=(e,t,r)=>{if(e&&"reportValidity"in e){const n=pe(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},FD=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?$5(n.ref,r,e):n.refs&&n.refs.forEach(i=>$5(i,r,e))}},uke=(e,t)=>{t.shouldUseNativeValidation&&FD(e,t);const r={};for(const n in e){const i=pe(t.fields,n),a=Object.assign(e[n]||{},{ref:i&&i.ref});if(dke(t.names||Object.keys(e),n)){const s=Object.assign({},pe(r,n));it(s,"root",a),it(r,n,s)}else it(r,n,a)}return r},dke=(e,t)=>e.some(r=>r.startsWith(t+"."));var fke=function(e,t){for(var r={};e.length;){var n=e[0],i=n.code,a=n.message,s=n.path.join(".");if(!r[s])if("unionErrors"in n){var l=n.unionErrors[0].errors[0];r[s]={message:l.message,type:l.code}}else r[s]={message:a,type:i};if("unionErrors"in n&&n.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),t){var c=r[s].types,u=c&&c[n.code];r[s]=TD(s,t,r,i,u?[].concat(u,n.message):n.message)}e.shift()}return r},hke=function(e,t,r){return r===void 0&&(r={}),function(n,i,a){try{return Promise.resolve(function(s,l){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return a.shouldUseNativeValidation&&FD({},a),{errors:{},values:r.raw?n:u}})}catch(u){return l(u)}return c&&c.then?c.then(void 0,l):c}(0,function(s){if(function(l){return Array.isArray(l==null?void 0:l.errors)}(s))return{values:{},errors:uke(fke(s.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw s}))}catch(s){return Promise.reject(s)}}},Ke;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},e.getValidEnumValues=i=>{const a=e.objectKeys(i).filter(l=>typeof i[i[l]]!="number"),s={};for(const l of a)s[l]=i[l];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},e.find=(i,a)=>{for(const s of i)if(a(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Ke||(Ke={}));var M5;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(M5||(M5={}));const ye=Ke.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xa=e=>{switch(typeof e){case"undefined":return ye.undefined;case"string":return ye.string;case"number":return Number.isNaN(e)?ye.nan:ye.number;case"boolean":return ye.boolean;case"function":return ye.function;case"bigint":return ye.bigint;case"symbol":return ye.symbol;case"object":return Array.isArray(e)?ye.array:e===null?ye.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ye.promise:typeof Map<"u"&&e instanceof Map?ye.map:typeof Set<"u"&&e instanceof Set?ye.set:typeof Date<"u"&&e instanceof Date?ye.date:ye.object;default:return ye.unknown}},ae=Ke.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Ca extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(a){return a.message},n={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let l=n,c=0;for(;cr.message){const r={},n=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];r[a]=r[a]||[],r[a].push(t(i))}else n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Ca.create=e=>new Ca(e);const gj=(e,t)=>{let r;switch(e.code){case ae.invalid_type:e.received===ye.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ae.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ke.jsonStringifyReplacer)}`;break;case ae.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ke.joinValues(e.keys,", ")}`;break;case ae.invalid_union:r="Invalid input";break;case ae.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ke.joinValues(e.options)}`;break;case ae.invalid_enum_value:r=`Invalid enum value. Expected ${Ke.joinValues(e.options)}, received '${e.received}'`;break;case ae.invalid_arguments:r="Invalid function arguments";break;case ae.invalid_return_type:r="Invalid function return type";break;case ae.invalid_date:r="Invalid date";break;case ae.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Ke.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ae.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ae.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ae.custom:r="Invalid input";break;case ae.invalid_intersection_types:r="Intersection results could not be merged";break;case ae.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ae.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ke.assertNever(e)}return{message:r}};let mke=gj;function pke(){return mke}const gke=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],s={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let l="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)l=u(s,{data:t,defaultError:l}).message;return{...i,path:a,message:l}};function de(e,t){const r=pke(),n=gke({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===gj?void 0:gj].filter(i=>!!i)});e.common.issues.push(n)}class gn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const i of r){if(i.status==="aborted")return Ce;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const i of r){const a=await i.key,s=await i.value;n.push({key:a,value:s})}return gn.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const i of r){const{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return Ce;a.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[a.value]=s.value)}return{status:t.value,value:n}}}const Ce=Object.freeze({status:"aborted"}),qd=e=>({status:"dirty",value:e}),Vn=e=>({status:"valid",value:e}),R5=e=>e.status==="aborted",I5=e=>e.status==="dirty",Eu=e=>e.status==="valid",Ny=e=>typeof Promise<"u"&&e instanceof Promise;var xe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(xe||(xe={}));class Ks{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const D5=(e,t)=>{if(Eu(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ca(e.common.issues);return this._error=r,this._error}}};function Le(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,l)=>{const{message:c}=e;return s.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??n??l.defaultError}:s.code!=="invalid_type"?{message:l.defaultError}:{message:c??r??l.defaultError}},description:i}}class qe{get description(){return this._def.description}_getType(t){return Xa(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Xa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new gn,ctx:{common:t.parent.common,data:t.data,parsedType:Xa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Ny(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xa(t)},i=this._parseSync({data:t,path:n.path,parent:n});return D5(n,i)}"~validate"(t){var n,i;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xa(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:r});return Eu(a)?{value:a.value}:{issues:r.common.issues}}catch(a){(i=(n=a==null?void 0:a.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(a=>Eu(a)?{value:a.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xa(t)},i=this._parse({data:t,path:n.path,parent:n}),a=await(Ny(i)?i:Promise.resolve(i));return D5(n,a)}refine(t,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{const s=t(i),l=()=>a.addIssue({code:ae.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(l(),!1)):s?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new Au({schema:this,typeName:Te.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Vs.create(this,this._def)}nullable(){return Pu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return zi.create(this)}promise(){return Oy.create(this,this._def)}or(t){return ky.create([this,t],this._def)}and(t){return Ey.create(this,t,this._def)}transform(t){return new Au({...Le(this._def),schema:this,typeName:Te.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new xj({...Le(this._def),innerType:this,defaultValue:r,typeName:Te.ZodDefault})}brand(){return new Fke({typeName:Te.ZodBranded,type:this,...Le(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new bj({...Le(this._def),innerType:this,catchValue:r,typeName:Te.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return _N.create(this,t)}readonly(){return wj.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const yke=/^c[^\s-]{8,}$/i,vke=/^[0-9a-z]+$/,xke=/^[0-9A-HJKMNP-TV-Z]{26}$/i,bke=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,wke=/^[a-z0-9_-]{21}$/i,jke=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,_ke=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Nke=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ske="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let qx;const kke=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Eke=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Oke=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Ake=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Pke=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Cke=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,BD="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Tke=new RegExp(`^${BD}$`);function zD(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function $ke(e){return new RegExp(`^${zD(e)}$`)}function Mke(e){let t=`${BD}T${zD(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Rke(e,t){return!!((t==="v4"||!t)&&kke.test(e)||(t==="v6"||!t)&&Oke.test(e))}function Ike(e,t){if(!jke.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function Dke(e,t){return!!((t==="v4"||!t)&&Eke.test(e)||(t==="v6"||!t)&&Ake.test(e))}class Ss extends qe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ye.string){const a=this._getOrReturnCtx(t);return de(a,{code:ae.invalid_type,expected:ye.string,received:a.parsedType}),Ce}const n=new gn;let i;for(const a of this._def.checks)if(a.kind==="min")t.data.lengtha.value&&(i=this._getOrReturnCtx(t,i),de(i,{code:ae.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const s=t.data.length>a.value,l=t.data.lengtht.test(i),{validation:r,code:ae.invalid_string,...xe.errToObj(n)})}_addCheck(t){return new Ss({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...xe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...xe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...xe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...xe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...xe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...xe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...xe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...xe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...xe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...xe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...xe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...xe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...xe.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...xe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...xe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...xe.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...xe.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...xe.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...xe.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...xe.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...xe.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...xe.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...xe.errToObj(r)})}nonempty(t){return this.min(1,xe.errToObj(t))}trim(){return new Ss({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ss({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ss({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Ss({checks:[],typeName:Te.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Le(e)});function Lke(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,a=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return a%s/10**i}class Eh extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ye.number){const a=this._getOrReturnCtx(t);return de(a,{code:ae.invalid_type,expected:ye.number,received:a.parsedType}),Ce}let n;const i=new gn;for(const a of this._def.checks)a.kind==="int"?Ke.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),de(n,{code:ae.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),de(n,{code:ae.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Lke(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),de(n,{code:ae.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),de(n,{code:ae.not_finite,message:a.message}),i.dirty()):Ke.assertNever(a);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,xe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,xe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,xe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,xe.toString(r))}setLimit(t,r,n,i){return new Eh({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:xe.toString(i)}]})}_addCheck(t){return new Eh({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:xe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:xe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:xe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:xe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:xe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:xe.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:xe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:xe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:xe.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&Ke.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew Eh({checks:[],typeName:Te.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Le(e)});class Oh extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ye.bigint)return this._getInvalidInput(t);let n;const i=new gn;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),de(n,{code:ae.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),de(n,{code:ae.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):Ke.assertNever(a);return{status:i.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return de(r,{code:ae.invalid_type,expected:ye.bigint,received:r.parsedType}),Ce}gte(t,r){return this.setLimit("min",t,!0,xe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,xe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,xe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,xe.toString(r))}setLimit(t,r,n,i){return new Oh({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:xe.toString(i)}]})}_addCheck(t){return new Oh({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:xe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:xe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:xe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:xe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:xe.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Oh({checks:[],typeName:Te.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Le(e)});class yj extends qe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ye.boolean){const n=this._getOrReturnCtx(t);return de(n,{code:ae.invalid_type,expected:ye.boolean,received:n.parsedType}),Ce}return Vn(t.data)}}yj.create=e=>new yj({typeName:Te.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Le(e)});class Sy extends qe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ye.date){const a=this._getOrReturnCtx(t);return de(a,{code:ae.invalid_type,expected:ye.date,received:a.parsedType}),Ce}if(Number.isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return de(a,{code:ae.invalid_date}),Ce}const n=new gn;let i;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()a.value&&(i=this._getOrReturnCtx(t,i),de(i,{code:ae.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Ke.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Sy({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:xe.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:xe.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Sy({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Te.ZodDate,...Le(e)});class L5 extends qe{_parse(t){if(this._getType(t)!==ye.symbol){const n=this._getOrReturnCtx(t);return de(n,{code:ae.invalid_type,expected:ye.symbol,received:n.parsedType}),Ce}return Vn(t.data)}}L5.create=e=>new L5({typeName:Te.ZodSymbol,...Le(e)});class F5 extends qe{_parse(t){if(this._getType(t)!==ye.undefined){const n=this._getOrReturnCtx(t);return de(n,{code:ae.invalid_type,expected:ye.undefined,received:n.parsedType}),Ce}return Vn(t.data)}}F5.create=e=>new F5({typeName:Te.ZodUndefined,...Le(e)});class B5 extends qe{_parse(t){if(this._getType(t)!==ye.null){const n=this._getOrReturnCtx(t);return de(n,{code:ae.invalid_type,expected:ye.null,received:n.parsedType}),Ce}return Vn(t.data)}}B5.create=e=>new B5({typeName:Te.ZodNull,...Le(e)});class z5 extends qe{constructor(){super(...arguments),this._any=!0}_parse(t){return Vn(t.data)}}z5.create=e=>new z5({typeName:Te.ZodAny,...Le(e)});class U5 extends qe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Vn(t.data)}}U5.create=e=>new U5({typeName:Te.ZodUnknown,...Le(e)});class Gs extends qe{_parse(t){const r=this._getOrReturnCtx(t);return de(r,{code:ae.invalid_type,expected:ye.never,received:r.parsedType}),Ce}}Gs.create=e=>new Gs({typeName:Te.ZodNever,...Le(e)});class W5 extends qe{_parse(t){if(this._getType(t)!==ye.undefined){const n=this._getOrReturnCtx(t);return de(n,{code:ae.invalid_type,expected:ye.void,received:n.parsedType}),Ce}return Vn(t.data)}}W5.create=e=>new W5({typeName:Te.ZodVoid,...Le(e)});class zi extends qe{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==ye.array)return de(r,{code:ae.invalid_type,expected:ye.array,received:r.parsedType}),Ce;if(i.exactLength!==null){const s=r.data.length>i.exactLength.value,l=r.data.lengthi.maxLength.value&&(de(r,{code:ae.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,l)=>i.type._parseAsync(new Ks(r,s,r.path,l)))).then(s=>gn.mergeArray(n,s));const a=[...r.data].map((s,l)=>i.type._parseSync(new Ks(r,s,r.path,l)));return gn.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new zi({...this._def,minLength:{value:t,message:xe.toString(r)}})}max(t,r){return new zi({...this._def,maxLength:{value:t,message:xe.toString(r)}})}length(t,r){return new zi({...this._def,exactLength:{value:t,message:xe.toString(r)}})}nonempty(t){return this.min(1,t)}}zi.create=(e,t)=>new zi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Te.ZodArray,...Le(t)});function Zl(e){if(e instanceof Bt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Vs.create(Zl(n))}return new Bt({...e._def,shape:()=>t})}else return e instanceof zi?new zi({...e._def,type:Zl(e.element)}):e instanceof Vs?Vs.create(Zl(e.unwrap())):e instanceof Pu?Pu.create(Zl(e.unwrap())):e instanceof kl?kl.create(e.items.map(t=>Zl(t))):e}class Bt extends qe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=Ke.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ye.object){const u=this._getOrReturnCtx(t);return de(u,{code:ae.invalid_type,expected:ye.object,received:u.parsedType}),Ce}const{status:n,ctx:i}=this._processInputParams(t),{shape:a,keys:s}=this._getCached(),l=[];if(!(this._def.catchall instanceof Gs&&this._def.unknownKeys==="strip"))for(const u in i.data)s.includes(u)||l.push(u);const c=[];for(const u of s){const d=a[u],f=i.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Ks(i,f,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Gs){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")l.length>0&&(de(i,{code:ae.unrecognized_keys,keys:l}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const f=i.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Ks(i,f,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>gn.mergeObjectSync(n,u)):gn.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return xe.errToObj,new Bt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,s;const i=((s=(a=this._def).errorMap)==null?void 0:s.call(a,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:xe.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new Bt({...this._def,unknownKeys:"strip"})}passthrough(){return new Bt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Bt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Bt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Te.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Bt({...this._def,catchall:t})}pick(t){const r={};for(const n of Ke.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Bt({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Ke.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Bt({...this._def,shape:()=>r})}deepPartial(){return Zl(this)}partial(t){const r={};for(const n of Ke.objectKeys(this.shape)){const i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new Bt({...this._def,shape:()=>r})}required(t){const r={};for(const n of Ke.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Vs;)a=a._def.innerType;r[n]=a}return new Bt({...this._def,shape:()=>r})}keyof(){return UD(Ke.objectKeys(this.shape))}}Bt.create=(e,t)=>new Bt({shape:()=>e,unknownKeys:"strip",catchall:Gs.create(),typeName:Te.ZodObject,...Le(t)});Bt.strictCreate=(e,t)=>new Bt({shape:()=>e,unknownKeys:"strict",catchall:Gs.create(),typeName:Te.ZodObject,...Le(t)});Bt.lazycreate=(e,t)=>new Bt({shape:e,unknownKeys:"strip",catchall:Gs.create(),typeName:Te.ZodObject,...Le(t)});class ky extends qe{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function i(a){for(const l of a)if(l.result.status==="valid")return l.result;for(const l of a)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;const s=a.map(l=>new Ca(l.ctx.common.issues));return de(r,{code:ae.invalid_union,unionErrors:s}),Ce}if(r.common.async)return Promise.all(n.map(async a=>{const s={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let a;const s=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const l=s.map(c=>new Ca(c));return de(r,{code:ae.invalid_union,unionErrors:l}),Ce}}get options(){return this._def.options}}ky.create=(e,t)=>new ky({options:e,typeName:Te.ZodUnion,...Le(t)});function vj(e,t){const r=Xa(e),n=Xa(t);if(e===t)return{valid:!0,data:e};if(r===ye.object&&n===ye.object){const i=Ke.objectKeys(t),a=Ke.objectKeys(e).filter(l=>i.indexOf(l)!==-1),s={...e,...t};for(const l of a){const c=vj(e[l],t[l]);if(!c.valid)return{valid:!1};s[l]=c.data}return{valid:!0,data:s}}else if(r===ye.array&&n===ye.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let a=0;a{if(R5(a)||R5(s))return Ce;const l=vj(a.value,s.value);return l.valid?((I5(a)||I5(s))&&r.dirty(),{status:r.value,value:l.data}):(de(n,{code:ae.invalid_intersection_types}),Ce)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,s])=>i(a,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Ey.create=(e,t,r)=>new Ey({left:e,right:t,typeName:Te.ZodIntersection,...Le(r)});class kl extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.array)return de(n,{code:ae.invalid_type,expected:ye.array,received:n.parsedType}),Ce;if(n.data.lengththis._def.items.length&&(de(n,{code:ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((s,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new Ks(n,s,n.path,l)):null}).filter(s=>!!s);return n.common.async?Promise.all(a).then(s=>gn.mergeArray(r,s)):gn.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new kl({...this._def,rest:t})}}kl.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new kl({items:e,typeName:Te.ZodTuple,rest:null,...Le(t)})};class V5 extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.map)return de(n,{code:ae.invalid_type,expected:ye.map,received:n.parsedType}),Ce;const i=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map(([l,c],u)=>({key:i._parse(new Ks(n,l,n.path,[u,"key"])),value:a._parse(new Ks(n,c,n.path,[u,"value"]))}));if(n.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of s){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return Ce;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}})}else{const l=new Map;for(const c of s){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return Ce;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}}}}V5.create=(e,t,r)=>new V5({valueType:t,keyType:e,typeName:Te.ZodMap,...Le(r)});class Ah extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.set)return de(n,{code:ae.invalid_type,expected:ye.set,received:n.parsedType}),Ce;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(de(n,{code:ae.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const a=this._def.valueType;function s(c){const u=new Set;for(const d of c){if(d.status==="aborted")return Ce;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const l=[...n.data.values()].map((c,u)=>a._parse(new Ks(n,c,n.path,u)));return n.common.async?Promise.all(l).then(c=>s(c)):s(l)}min(t,r){return new Ah({...this._def,minSize:{value:t,message:xe.toString(r)}})}max(t,r){return new Ah({...this._def,maxSize:{value:t,message:xe.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Ah.create=(e,t)=>new Ah({valueType:e,minSize:null,maxSize:null,typeName:Te.ZodSet,...Le(t)});class H5 extends qe{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}H5.create=(e,t)=>new H5({getter:e,typeName:Te.ZodLazy,...Le(t)});class q5 extends qe{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return de(r,{received:r.data,code:ae.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:t.data}}get value(){return this._def.value}}q5.create=(e,t)=>new q5({value:e,typeName:Te.ZodLiteral,...Le(t)});function UD(e,t){return new Ou({values:e,typeName:Te.ZodEnum,...Le(t)})}class Ou extends qe{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return de(r,{expected:Ke.joinValues(n),received:r.parsedType,code:ae.invalid_type}),Ce}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return de(r,{received:r.data,code:ae.invalid_enum_value,options:n}),Ce}return Vn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Ou.create(t,{...this._def,...r})}exclude(t,r=this._def){return Ou.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Ou.create=UD;class K5 extends qe{_parse(t){const r=Ke.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ye.string&&n.parsedType!==ye.number){const i=Ke.objectValues(r);return de(n,{expected:Ke.joinValues(i),received:n.parsedType,code:ae.invalid_type}),Ce}if(this._cache||(this._cache=new Set(Ke.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=Ke.objectValues(r);return de(n,{received:n.data,code:ae.invalid_enum_value,options:i}),Ce}return Vn(t.data)}get enum(){return this._def.values}}K5.create=(e,t)=>new K5({values:e,typeName:Te.ZodNativeEnum,...Le(t)});class Oy extends qe{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.promise&&r.common.async===!1)return de(r,{code:ae.invalid_type,expected:ye.promise,received:r.parsedType}),Ce;const n=r.parsedType===ye.promise?r.data:Promise.resolve(r.data);return Vn(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Oy.create=(e,t)=>new Oy({type:e,typeName:Te.ZodPromise,...Le(t)});class Au extends qe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:s=>{de(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const s=i.transform(n.data,a);if(n.common.async)return Promise.resolve(s).then(async l=>{if(r.value==="aborted")return Ce;const c=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return c.status==="aborted"?Ce:c.status==="dirty"||r.value==="dirty"?qd(c.value):c});{if(r.value==="aborted")return Ce;const l=this._def.schema._parseSync({data:s,path:n.path,parent:n});return l.status==="aborted"?Ce:l.status==="dirty"||r.value==="dirty"?qd(l.value):l}}if(i.type==="refinement"){const s=l=>{const c=i.refinement(l,a);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?Ce:(l.status==="dirty"&&r.dirty(),s(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?Ce:(l.status==="dirty"&&r.dirty(),s(l.value).then(()=>({status:r.value,value:l.value}))))}if(i.type==="transform")if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Eu(s))return Ce;const l=i.transform(s.value,a);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Eu(s)?Promise.resolve(i.transform(s.value,a)).then(l=>({status:r.value,value:l})):Ce);Ke.assertNever(i)}}Au.create=(e,t,r)=>new Au({schema:e,typeName:Te.ZodEffects,effect:t,...Le(r)});Au.createWithPreprocess=(e,t,r)=>new Au({schema:t,effect:{type:"preprocess",transform:e},typeName:Te.ZodEffects,...Le(r)});class Vs extends qe{_parse(t){return this._getType(t)===ye.undefined?Vn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Vs.create=(e,t)=>new Vs({innerType:e,typeName:Te.ZodOptional,...Le(t)});class Pu extends qe{_parse(t){return this._getType(t)===ye.null?Vn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Pu.create=(e,t)=>new Pu({innerType:e,typeName:Te.ZodNullable,...Le(t)});class xj extends qe{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ye.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}xj.create=(e,t)=>new xj({innerType:e,typeName:Te.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Le(t)});class bj extends qe{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ny(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ca(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ca(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}bj.create=(e,t)=>new bj({innerType:e,typeName:Te.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Le(t)});class G5 extends qe{_parse(t){if(this._getType(t)!==ye.nan){const n=this._getOrReturnCtx(t);return de(n,{code:ae.invalid_type,expected:ye.nan,received:n.parsedType}),Ce}return{status:"valid",value:t.data}}}G5.create=e=>new G5({typeName:Te.ZodNaN,...Le(e)});class Fke extends qe{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class _N extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ce:a.status==="dirty"?(r.dirty(),qd(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Ce:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new _N({in:t,out:r,typeName:Te.ZodPipeline})}}class wj extends qe{_parse(t){const r=this._def.innerType._parse(t),n=i=>(Eu(i)&&(i.value=Object.freeze(i.value)),i);return Ny(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}}wj.create=(e,t)=>new wj({innerType:e,typeName:Te.ZodReadonly,...Le(t)});var Te;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Te||(Te={}));const Sn=Ss.create,Qi=yj.create;Gs.create;const Y5=zi.create,mo=Bt.create;ky.create;Ey.create;kl.create;const Ym=Ou.create;Oy.create;Vs.create;Pu.create;const Bke=mo({name:Sn().min(1,"Project name is required").max(100,"Name must be less than 100 characters"),description:Sn().max(500,"Description must be less than 500 characters").optional(),tags:Y5(Sn()).optional(),template_id:Sn().optional(),age_config:mo({generate_new_key:Qi().default(!0),master_key_passphrase:Sn().optional(),key_backup_location:Sn().optional()}).optional(),git_config:mo({repo_type:Ym(["new","existing","import"]).default("new"),repo_name:Sn().optional(),git_url:Sn().optional(),git_owner:Sn().default("whoosh"),git_branch:Sn().default("main"),auto_initialize:Qi().default(!0),private:Qi().default(!1),license_type:Sn().default("MIT")}),bzzz_config:mo({enable_bzzz:Qi().default(!1),task_coordination:Qi().default(!0),ai_agent_access:Qi().default(!1),auto_discovery:Qi().default(!0)}).optional(),member_config:mo({initial_members:Y5(mo({email:Sn().email(),role:Ym(["owner","maintainer","developer","viewer"]).default("developer")})).optional()}).optional(),advanced_config:mo({project_visibility:Ym(["private","internal","public"]).default("private"),security_level:Ym(["standard","high","maximum"]).default("standard"),backup_enabled:Qi().default(!0),monitoring_enabled:Qi().default(!0)}).optional()});function Z5({mode:e,initialData:t,projectId:r}){var D,L,R,M,B,U,W,Z,q,ee,le,ve,Ne,J,oe,me,Q,Pe,be,Ee,Re,Y;const n=to(),i=j2(),[a,s]=b.useState(""),[l,c]=b.useState("basic"),[u,d]=b.useState([]),[f,h]=b.useState(!1),{register:m,handleSubmit:y,formState:{errors:p,isSubmitting:x},watch:g,setValue:v,trigger:w}=cke({resolver:hke(Bke),mode:"onChange",defaultValues:{name:(t==null?void 0:t.name)||"",description:(t==null?void 0:t.description)||"",tags:(t==null?void 0:t.tags)||[],template_id:(t==null?void 0:t.template_id)||"",age_config:{generate_new_key:((D=t==null?void 0:t.age_config)==null?void 0:D.generate_new_key)??!0,master_key_passphrase:((L=t==null?void 0:t.age_config)==null?void 0:L.master_key_passphrase)||"",key_backup_location:((R=t==null?void 0:t.age_config)==null?void 0:R.key_backup_location)||""},git_config:{repo_type:((M=t==null?void 0:t.git_config)==null?void 0:M.repo_type)||"new",repo_name:((B=t==null?void 0:t.git_config)==null?void 0:B.repo_name)||"",git_url:((U=t==null?void 0:t.git_config)==null?void 0:U.git_url)||"",git_owner:((W=t==null?void 0:t.git_config)==null?void 0:W.git_owner)||"whoosh",git_branch:((Z=t==null?void 0:t.git_config)==null?void 0:Z.git_branch)||"main",auto_initialize:((q=t==null?void 0:t.git_config)==null?void 0:q.auto_initialize)??!0,private:((ee=t==null?void 0:t.git_config)==null?void 0:ee.private)??!1,license_type:((le=t==null?void 0:t.git_config)==null?void 0:le.license_type)||"MIT"},bzzz_config:{enable_bzzz:((ve=t==null?void 0:t.bzzz_config)==null?void 0:ve.enable_bzzz)??!1,task_coordination:((Ne=t==null?void 0:t.bzzz_config)==null?void 0:Ne.task_coordination)??!0,ai_agent_access:((J=t==null?void 0:t.bzzz_config)==null?void 0:J.ai_agent_access)??!1,auto_discovery:((oe=t==null?void 0:t.bzzz_config)==null?void 0:oe.auto_discovery)??!0},member_config:{initial_members:((me=t==null?void 0:t.member_config)==null?void 0:me.initial_members)||[]},advanced_config:{project_visibility:((Q=t==null?void 0:t.advanced_config)==null?void 0:Q.project_visibility)||"private",security_level:((Pe=t==null?void 0:t.advanced_config)==null?void 0:Pe.security_level)||"standard",backup_enabled:((be=t==null?void 0:t.advanced_config)==null?void 0:be.backup_enabled)??!0,monitoring_enabled:((Ee=t==null?void 0:t.advanced_config)==null?void 0:Ee.monitoring_enabled)??!0}}}),_=g("tags")||[];g("template_id");const j=g("git_config.repo_type")||"new",N=g("name")||"",S=g("bzzz_config.enable_bzzz")||!1,E=g("age_config.generate_new_key")??!0,{data:k}=$r({queryKey:["project-templates"],queryFn:async()=>{const V=await fetch("/api/project-setup/templates");if(!V.ok)throw new Error("Failed to fetch templates");return V.json()}});b.useEffect(()=>{if(N&&j==="new"){const V=N.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-");v("git_config.repo_name",V)}},[N,j,v]);const A=Xp({mutationFn:async V=>{h(!0),d([]);const ce=await fetch("/api/project-setup/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(V)});if(!ce.ok){const F=await ce.json();throw new Error(F.detail||"Failed to create project")}return ce.json()},onSuccess:V=>{h(!1),d(V.progress||[]),i.invalidateQueries({queryKey:["projects"]}),bs.success("Project created successfully!"),setTimeout(()=>{n(`/projects/${V.project_id}`)},2e3)},onError:V=>{h(!1),bs.error(`Failed to create project: ${V.message}`),console.error("Create project error:",V)}}),C=Xp({mutationFn:async V=>{const ce=await fetch(`/api/projects/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(V)});if(!ce.ok)throw new Error("Failed to update project");return ce.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["project",r]}),i.invalidateQueries({queryKey:["projects"]}),bs.success("Project updated successfully!"),n(`/projects/${r}`)},onError:V=>{bs.error("Failed to update project"),console.error("Update project error:",V)}}),P=V=>{e==="create"?(c("review"),A.mutate(V)):C.mutate(V)},$=()=>{if(a.trim()&&!_.includes(a.trim())){const V=[..._,a.trim()];v("tags",V),s("")}},O=V=>{const ce=_.filter(F=>F!==V);v("tags",ce)},I=V=>{V.key==="Enter"&&(V.preventDefault(),$())};return o.jsx("div",{className:"min-h-screen bg-gray-50",children:o.jsxs("div",{className:"max-w-3xl mx-auto py-6 px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"mb-8",children:[o.jsx("div",{className:"flex items-center space-x-4 mb-4",children:o.jsxs("button",{onClick:()=>n("/projects"),className:"flex items-center text-gray-500 hover:text-gray-700",children:[o.jsx(dg,{className:"h-5 w-5 mr-1"}),"Back to Projects"]})}),o.jsxs("div",{children:[o.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:e==="create"?"Create New Project":"Edit Project"}),o.jsx("p",{className:"text-gray-600 mt-2",children:e==="create"?"Set up a new project to organize your workflows and track their progress.":"Update your project details and configuration."})]})]}),o.jsxs("form",{onSubmit:y(P),className:"space-y-8",children:[o.jsxs("div",{className:"bg-white shadow-sm rounded-lg",children:[o.jsxs("div",{className:"px-6 py-4 border-b border-gray-200",children:[o.jsx("h2",{className:"text-lg font-medium text-gray-900",children:"Basic Information"}),o.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Provide the essential details for your project."})]}),o.jsxs("div",{className:"px-6 py-4 space-y-6",children:[o.jsxs("div",{children:[o.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-2",children:"Project Name *"}),o.jsx("input",{type:"text",id:"name",...m("name"),className:"block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"Enter project name"}),p.name&&o.jsx("p",{className:"mt-1 text-sm text-red-600",children:p.name.message})]}),o.jsxs("div",{children:[o.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700 mb-2",children:"Description"}),o.jsx("textarea",{id:"description",rows:4,...m("description"),className:"block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"Describe the purpose and goals of this project"}),o.jsxs("p",{className:"mt-1 text-sm text-gray-500",children:[((Re=g("description"))==null?void 0:Re.length)||0,"/500 characters"]}),p.description&&o.jsx("p",{className:"mt-1 text-sm text-red-600",children:p.description.message})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Tags"}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex space-x-2",children:[o.jsx("input",{type:"text",value:a,onChange:V=>s(V.target.value),onKeyPress:I,className:"flex-1 border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"Add a tag"}),o.jsx("button",{type:"button",onClick:$,className:"inline-flex items-center px-3 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50",children:o.jsx(Sa,{className:"h-4 w-4"})})]}),_.length>0&&o.jsx("div",{className:"flex flex-wrap gap-2",children:_.map(V=>o.jsxs("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-blue-100 text-blue-800",children:[V,o.jsx("button",{type:"button",onClick:()=>O(V),className:"ml-2 text-blue-600 hover:text-blue-800",children:o.jsx(qf,{className:"h-4 w-4"})})]},V))})]}),o.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Tags help categorize and filter your projects."})]})]})]}),o.jsxs("div",{className:"bg-white shadow-sm rounded-lg",children:[o.jsxs("div",{className:"px-6 py-4 border-b border-gray-200",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("h2",{className:"text-lg font-medium text-gray-900",children:"🔐 Age Encryption Keys"}),o.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800",children:"Secure"})]}),o.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Generate master encryption keys for secure project data and member communication."})]}),o.jsxs("div",{className:"px-6 py-4 space-y-6",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center space-x-3",children:[o.jsx("input",{type:"checkbox",id:"generate_age_keys",...m("age_config.generate_new_key"),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),o.jsx("label",{htmlFor:"generate_age_keys",className:"text-sm font-medium text-gray-700",children:"Generate Age master key pair for this project"})]}),o.jsx("p",{className:"text-sm text-gray-500 mt-1 ml-7",children:"Creates secure encryption keys for project data, member communication, and sensitive information."})]}),E&&o.jsxs("div",{className:"space-y-4 ml-7",children:[o.jsxs("div",{children:[o.jsx("label",{htmlFor:"master_key_passphrase",className:"block text-sm font-medium text-gray-700 mb-2",children:"Master Key Passphrase (Optional)"}),o.jsx("input",{type:"password",id:"master_key_passphrase",...m("age_config.master_key_passphrase"),className:"block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"Enter a strong passphrase for additional security"}),o.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Encrypts your private key with a passphrase. Leave empty for unencrypted storage."})]}),o.jsxs("div",{children:[o.jsx("label",{htmlFor:"key_backup_location",className:"block text-sm font-medium text-gray-700 mb-2",children:"Key Backup Location (Optional)"}),o.jsx("input",{type:"text",id:"key_backup_location",...m("age_config.key_backup_location"),className:"block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"/secure/backup/location or cloud storage path"}),o.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Automatically create a backup of your encryption keys at this location."})]}),o.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:o.jsxs("div",{className:"flex",children:[o.jsx(Bd,{className:"h-5 w-5 text-blue-400"}),o.jsxs("div",{className:"ml-3",children:[o.jsx("h3",{className:"text-sm font-medium text-blue-800",children:"Age Encryption Features"}),o.jsxs("div",{className:"mt-2 text-sm text-blue-700",children:[o.jsx("p",{children:"Your Age master keys will enable:"}),o.jsxs("ul",{className:"list-disc list-inside mt-1 space-y-1",children:[o.jsx("li",{children:"End-to-end encryption of sensitive project data"}),o.jsx("li",{children:"Secure member-to-member communication"}),o.jsx("li",{children:"Encrypted project configuration and secrets"}),o.jsx("li",{children:"12-word recovery phrase generation"}),o.jsx("li",{children:"Automatic key backup and distribution"})]}),o.jsx("p",{className:"mt-2 font-medium",children:"Keys are stored securely with restricted file permissions."})]})]})]})})]})]})]}),o.jsxs("div",{className:"bg-white shadow-sm rounded-lg",children:[o.jsxs("div",{className:"px-6 py-4 border-b border-gray-200",children:[o.jsx("h2",{className:"text-lg font-medium text-gray-900",children:"Project Metadata"}),o.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Additional information to help organize and manage your project."})]}),o.jsxs("div",{className:"px-6 py-4 space-y-6",children:[o.jsxs("div",{children:[o.jsx("label",{htmlFor:"owner",className:"block text-sm font-medium text-gray-700 mb-2",children:"Project Owner"}),o.jsx("input",{type:"text",id:"owner",...m("metadata.owner"),className:"block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"Enter owner name"})]}),o.jsxs("div",{children:[o.jsx("label",{htmlFor:"department",className:"block text-sm font-medium text-gray-700 mb-2",children:"Department"}),o.jsx("input",{type:"text",id:"department",...m("metadata.department"),className:"block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"Enter department name"})]}),o.jsxs("div",{children:[o.jsx("label",{htmlFor:"priority",className:"block text-sm font-medium text-gray-700 mb-2",children:"Priority"}),o.jsxs("select",{id:"priority",...m("metadata.priority"),className:"block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[o.jsx("option",{value:"low",children:"Low"}),o.jsx("option",{value:"medium",children:"Medium"}),o.jsx("option",{value:"high",children:"High"})]})]})]})]}),o.jsxs("div",{className:"bg-white shadow-sm rounded-lg",children:[o.jsxs("div",{className:"px-6 py-4 border-b border-gray-200",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("h2",{className:"text-lg font-medium text-gray-900",children:"🐝 Bzzz P2P Integration"}),o.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-800",children:"Beta"})]}),o.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Configure this project for distributed AI task coordination via the Bzzz P2P network."})]}),o.jsxs("div",{className:"px-6 py-4 space-y-6",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center space-x-3",children:[o.jsx("input",{type:"checkbox",id:"bzzz_enabled",...m("bzzz_config.enable_bzzz"),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),o.jsx("label",{htmlFor:"bzzz_enabled",className:"text-sm font-medium text-gray-700",children:"Enable BZZZ P2P coordination for this project"})]}),o.jsx("p",{className:"text-sm text-gray-500 mt-1 ml-7",children:"Allow Bzzz agents to discover and work on tasks from this project's GitHub repository."})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-4",children:"🔗 Git Repository Setup"}),o.jsxs("div",{className:"mb-4",children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Repository Type"}),o.jsxs("select",{...m("git_config.repo_type"),className:"block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[o.jsx("option",{value:"new",children:"Create new repository"}),o.jsx("option",{value:"existing",children:"Use existing repository"})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("label",{htmlFor:"git_owner",className:"block text-sm font-medium text-gray-700 mb-2",children:"Repository Owner"}),o.jsx("input",{type:"text",id:"git_owner",...m("git_config.git_owner"),className:"block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"whoosh"})]}),o.jsxs("div",{children:[o.jsx("label",{htmlFor:"git_repository",className:"block text-sm font-medium text-gray-700 mb-2",children:"Repository Name"}),o.jsx("input",{type:"text",id:"git_repository",...m("git_config.repo_name"),className:"block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"Auto-generated from project name",readOnly:j==="new"})]})]}),o.jsxs("div",{className:"mt-4",children:[o.jsx("label",{htmlFor:"git_branch",className:"block text-sm font-medium text-gray-700 mb-2",children:"Default Branch"}),o.jsx("input",{type:"text",id:"git_branch",...m("git_config.git_branch"),className:"block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"main"})]}),o.jsx("div",{className:"mt-4",children:o.jsxs("div",{className:"flex items-center space-x-3",children:[o.jsx("input",{type:"checkbox",id:"private_repo",...m("git_config.private"),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),o.jsx("label",{htmlFor:"private_repo",className:"text-sm text-gray-700",children:"Private repository"})]})})]}),S&&o.jsxs("div",{className:"space-y-4",children:[o.jsx("h3",{className:"text-sm font-medium text-gray-700",children:"BZZZ Task Coordination Features"}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center space-x-3",children:[o.jsx("input",{type:"checkbox",id:"task_coordination",...m("bzzz_config.task_coordination"),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),o.jsx("label",{htmlFor:"task_coordination",className:"text-sm text-gray-700",children:"Enable automatic task coordination"})]}),o.jsxs("div",{className:"flex items-center space-x-3",children:[o.jsx("input",{type:"checkbox",id:"ai_agent_access",...m("bzzz_config.ai_agent_access"),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),o.jsx("label",{htmlFor:"ai_agent_access",className:"text-sm text-gray-700",children:"Allow AI agents to access and modify project files"})]}),o.jsxs("div",{className:"flex items-center space-x-3",children:[o.jsx("input",{type:"checkbox",id:"auto_discovery",...m("bzzz_config.auto_discovery"),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),o.jsx("label",{htmlFor:"auto_discovery",className:"text-sm text-gray-700",children:"Enable automatic peer discovery"})]})]})]}),o.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:o.jsxs("div",{className:"flex",children:[o.jsx(Bd,{className:"h-5 w-5 text-yellow-400"}),o.jsxs("div",{className:"ml-3",children:[o.jsx("h3",{className:"text-sm font-medium text-yellow-800",children:"How BZZZ Integration Works"}),o.jsxs("div",{className:"mt-2 text-sm text-yellow-700",children:[o.jsx("p",{children:"When enabled, BZZZ agents will:"}),o.jsxs("ul",{className:"list-disc list-inside mt-1 space-y-1",children:[o.jsx("li",{children:"Monitor GITEA issues labeled with 'bzzz-task'"}),o.jsx("li",{children:"Coordinate P2P to assign tasks based on agent capabilities"}),o.jsx("li",{children:"Execute tasks using distributed AI reasoning"}),o.jsx("li",{children:"Report progress and escalate when needed"})]}),o.jsx("p",{className:"mt-2 font-medium",children:"A GITEA repository will be automatically created with proper BZZZ labels configured."})]})]})]})})]})]}),o.jsxs("div",{className:"bg-white shadow-sm rounded-lg",children:[o.jsxs("div",{className:"px-6 py-4 border-b border-gray-200",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("h2",{className:"text-lg font-medium text-gray-900",children:"👥 Team Members"}),o.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:"Optional"})]}),o.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Invite team members to collaborate on this project from the start."})]}),o.jsxs("div",{className:"px-6 py-4 space-y-6",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-3",children:"Initial Team Members"}),((Y=g("member_config.initial_members"))==null?void 0:Y.length)>0&&o.jsx("div",{className:"space-y-2 mb-4",children:g("member_config.initial_members").map((V,ce)=>o.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[o.jsx("div",{className:"flex-1",children:o.jsxs("div",{className:"flex items-center space-x-3",children:[o.jsx("span",{className:"text-sm font-medium text-gray-900",children:V.email}),o.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${V.role==="owner"?"bg-purple-100 text-purple-800":V.role==="maintainer"?"bg-blue-100 text-blue-800":V.role==="developer"?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"}`,children:V.role.charAt(0).toUpperCase()+V.role.slice(1)})]})}),o.jsx("button",{type:"button",onClick:()=>{const H=(g("member_config.initial_members")||[]).filter((K,se)=>se!==ce);v("member_config.initial_members",H)},className:"text-red-600 hover:text-red-800",children:o.jsx(qf,{className:"h-4 w-4"})})]},ce))}),o.jsxs("div",{className:"border-2 border-dashed border-gray-300 rounded-lg p-4",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[o.jsx("div",{children:o.jsx("input",{type:"email",placeholder:"team.member@company.com",className:"block w-full border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",onKeyPress:V=>{var ce,F;if(V.key==="Enter"){V.preventDefault();const H=V.target,K=(F=(ce=H.parentElement)==null?void 0:ce.nextElementSibling)==null?void 0:F.querySelector("select");if(H.value&&(K!=null&&K.value)){const se=g("member_config.initial_members")||[],ie={email:H.value,role:K.value};v("member_config.initial_members",[...se,ie]),H.value="",K.value="developer"}}}})}),o.jsx("div",{children:o.jsxs("select",{className:"block w-full border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",defaultValue:"developer",children:[o.jsx("option",{value:"developer",children:"Developer"}),o.jsx("option",{value:"maintainer",children:"Maintainer"}),o.jsx("option",{value:"viewer",children:"Viewer"}),o.jsx("option",{value:"owner",children:"Owner"})]})}),o.jsx("div",{children:o.jsxs("button",{type:"button",onClick:()=>{const V=document.querySelector(".border-dashed"),ce=V==null?void 0:V.querySelector('input[type="email"]'),F=V==null?void 0:V.querySelector("select");if(ce!=null&&ce.value&&(F!=null&&F.value)){const H=g("member_config.initial_members")||[],K={email:ce.value,role:F.value};v("member_config.initial_members",[...H,K]),ce.value="",F.value="developer"}},className:"w-full inline-flex items-center justify-center px-3 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[o.jsx(Sa,{className:"h-4 w-4 mr-1"}),"Add Member"]})})]}),o.jsx("p",{className:"mt-2 text-xs text-gray-500",children:'Press Enter in the email field or click "Add Member" to add team members'})]})]}),o.jsx("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4",children:o.jsxs("div",{className:"flex",children:[o.jsx(Bd,{className:"h-5 w-5 text-green-400"}),o.jsxs("div",{className:"ml-3",children:[o.jsx("h3",{className:"text-sm font-medium text-green-800",children:"Team Member Features"}),o.jsxs("div",{className:"mt-2 text-sm text-green-700",children:[o.jsx("p",{children:"Team members will receive:"}),o.jsxs("ul",{className:"list-disc list-inside mt-1 space-y-1",children:[o.jsx("li",{children:"Email invitation with project details and role information"}),o.jsx("li",{children:"Access to GITEA repository based on their role"}),o.jsx("li",{children:"Age encryption keys for secure project communication"}),o.jsx("li",{children:"Role-based permissions for project management"}),o.jsx("li",{children:"Integration with BZZZ task coordination system"})]})]})]})]})})]})]}),o.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:o.jsxs("div",{className:"flex",children:[o.jsx(Bd,{className:"h-5 w-5 text-blue-400"}),o.jsxs("div",{className:"ml-3",children:[o.jsx("h3",{className:"text-sm font-medium text-blue-800",children:"What happens next?"}),o.jsxs("div",{className:"mt-2 text-sm text-blue-700",children:[o.jsx("p",{children:"After creating your project, you can:"}),o.jsxs("ul",{className:"list-disc list-inside mt-1 space-y-1",children:[o.jsx("li",{children:"Add workflows to automate your processes"}),o.jsx("li",{children:"Configure project settings and permissions"}),o.jsx("li",{children:"Monitor execution history and performance"}),o.jsx("li",{children:"Collaborate with team members"})]})]})]})]})}),o.jsxs("div",{className:"flex justify-end space-x-4 pt-6",children:[o.jsx("button",{type:"button",onClick:()=>n("/projects"),className:"px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Cancel"}),o.jsx("button",{type:"submit",disabled:x,className:"px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",children:x?e==="create"?"Creating...":"Updating...":e==="create"?"Create Project":"Update Project"})]})]})]})})}const zke=({data:e,selected:t})=>o.jsx("div",{className:`px-4 py-2 shadow-md rounded-md bg-white border-2 min-w-[150px] ${t?"border-blue-500":"border-gray-200"}`,children:o.jsxs("div",{className:"flex items-center",children:[o.jsx("div",{className:"rounded-full w-3 h-3 mr-2 bg-blue-500"}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm font-bold",children:e.label}),o.jsx("div",{className:"text-xs text-gray-500",children:e.nodeType})]})]})}),Uke=({selected:e})=>o.jsx("div",{className:`px-4 py-2 shadow-md rounded-md bg-green-100 border-2 min-w-[120px] ${e?"border-green-500":"border-green-300"}`,children:o.jsxs("div",{className:"flex items-center",children:[o.jsx("div",{className:"rounded-full w-3 h-3 mr-2 bg-green-500"}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm font-bold text-green-800",children:"Start"}),o.jsx("div",{className:"text-xs text-green-600",children:"Trigger"})]})]})}),Wke=({selected:e})=>o.jsx("div",{className:`px-4 py-2 shadow-md rounded-md bg-red-100 border-2 min-w-[120px] ${e?"border-red-500":"border-red-300"}`,children:o.jsxs("div",{className:"flex items-center",children:[o.jsx("div",{className:"rounded-full w-3 h-3 mr-2 bg-red-500"}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm font-bold text-red-800",children:"End"}),o.jsx("div",{className:"text-xs text-red-600",children:"Output"})]})]})}),Vke={custom:zke,start:Uke,end:Wke},X5=[{id:"1",type:"start",position:{x:250,y:25},data:{label:"Start",nodeType:"trigger"}},{id:"2",type:"custom",position:{x:250,y:125},data:{label:"Process Data",nodeType:"function"}},{id:"3",type:"custom",position:{x:100,y:225},data:{label:"Send Email",nodeType:"notification"}},{id:"4",type:"custom",position:{x:400,y:225},data:{label:"Save to DB",nodeType:"database"}},{id:"5",type:"end",position:{x:250,y:325},data:{label:"End",nodeType:"output"}}],Q5=[{id:"e1-2",source:"1",target:"2",animated:!0},{id:"e2-3",source:"2",target:"3",animated:!0},{id:"e2-4",source:"2",target:"4",animated:!0},{id:"e3-5",source:"3",target:"5",animated:!0},{id:"e4-5",source:"4",target:"5",animated:!0}],J5=[{type:"trigger",label:"HTTP Trigger",icon:"🌐"},{type:"function",label:"Function",icon:"⚙️"},{type:"database",label:"Database",icon:"🗄️"},{type:"notification",label:"Email",icon:"📧"},{type:"webhook",label:"Webhook",icon:"🔗"},{type:"condition",label:"Condition",icon:"🔀"},{type:"delay",label:"Delay",icon:"⏱️"},{type:"transform",label:"Transform",icon:"🔄"}];function Kx(){const{id:e}=Z$(),t=to(),r=b.useRef(null),[n,i]=b.useState(null),[a,s,l]=hq(X5),[c,u,d]=mq(Q5),[f,h]=b.useState(null),[m,y]=b.useState(!1),{data:p,isLoading:x}=$r({queryKey:["workflow",e],queryFn:async()=>({id:e||"new",name:e?"Sample Workflow":"New Workflow",description:"A sample workflow for demonstration",status:"draft",nodes:X5,edges:Q5,created_at:new Date().toISOString(),updated_at:new Date().toISOString()})}),g=Xp({mutationFn:async C=>(await new Promise(P=>setTimeout(P,1e3)),C),onSuccess:()=>{bs.success("Workflow saved successfully!")},onError:()=>{bs.error("Failed to save workflow")}}),v=Xp({mutationFn:async()=>(y(!0),await new Promise(C=>setTimeout(C,3e3)),{status:"completed",executionId:"exec-123"}),onSuccess:C=>{y(!1),bs.success(`Workflow executed successfully! (${C.executionId})`)},onError:()=>{y(!1),bs.error("Workflow execution failed")}}),w=b.useCallback(C=>u(P=>H4(C,P)),[u]),_=b.useCallback((C,P)=>{h(P)},[]),j=b.useCallback(C=>{C.preventDefault(),C.dataTransfer.dropEffect="move"},[]),N=b.useCallback(C=>{var D;C.preventDefault();const P=(D=r.current)==null?void 0:D.getBoundingClientRect(),$=C.dataTransfer.getData("application/reactflow");if(typeof $>"u"||!$||!P)return;const O=n.project({x:C.clientX-P.left,y:C.clientY-P.top}),I={id:`${a.length+1}`,type:"custom",position:O,data:{label:`New ${$}`,nodeType:$}};s(L=>L.concat(I))},[n,a,s]),S=(C,P)=>{C.dataTransfer.setData("application/reactflow",P),C.dataTransfer.effectAllowed="move"},E=()=>{const C={id:p==null?void 0:p.id,name:p==null?void 0:p.name,nodes:a,edges:c};g.mutate(C)},k=()=>{v.mutate()},A=()=>{f&&(s(C=>C.filter(P=>P.id!==f.id)),u(C=>C.filter(P=>P.source!==f.id&&P.target!==f.id)),h(null))};return x?o.jsx("div",{className:"h-screen flex items-center justify-center",children:o.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-blue-500"})}):o.jsxs("div",{className:"h-screen flex flex-col",children:[o.jsx("div",{className:"bg-white border-b border-gray-200 px-6 py-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center space-x-4",children:[o.jsxs("button",{onClick:()=>t("/workflows"),className:"flex items-center text-gray-500 hover:text-gray-700",children:[o.jsx(dg,{className:"h-5 w-5 mr-1"}),"Back"]}),o.jsxs("div",{children:[o.jsx("h1",{className:"text-xl font-semibold text-gray-900",children:p==null?void 0:p.name}),o.jsx("p",{className:"text-sm text-gray-500",children:"Workflow Editor"})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsxs("button",{onClick:E,disabled:g.isPending,className:"inline-flex items-center px-3 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 disabled:opacity-50",children:[o.jsx(tK,{className:"h-4 w-4 mr-2"}),g.isPending?"Saving...":"Save"]}),o.jsx("button",{onClick:k,disabled:m,className:"inline-flex items-center px-3 py-2 border border-transparent rounded-md text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 disabled:opacity-50",children:m?o.jsxs(o.Fragment,{children:[o.jsx(hg,{className:"h-4 w-4 mr-2 animate-spin"}),"Running..."]}):o.jsxs(o.Fragment,{children:[o.jsx(hi,{className:"h-4 w-4 mr-2"}),"Execute"]})})]})]})}),o.jsxs("div",{className:"flex flex-1",children:[o.jsxs("div",{className:"w-64 bg-white border-r border-gray-200 p-4",children:[o.jsxs("div",{className:"mb-6",children:[o.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-3",children:"Add Nodes"}),o.jsx("div",{className:"space-y-2",children:J5.map(C=>o.jsxs("div",{className:"flex items-center p-2 border border-gray-200 rounded-md cursor-move hover:bg-gray-50",onDragStart:P=>S(P,C.type),draggable:!0,children:[o.jsx("span",{className:"text-lg mr-3",children:C.icon}),o.jsx("span",{className:"text-sm text-gray-700",children:C.label})]},C.type))})]}),f&&o.jsxs("div",{className:"border-t pt-4",children:[o.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-3",children:"Node Properties"}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-xs font-medium text-gray-700 mb-1",children:"Label"}),o.jsx("input",{type:"text",value:f.data.label,onChange:C=>{s(P=>P.map($=>$.id===f.id?{...$,data:{...$.data,label:C.target.value}}:$)),h({...f,data:{...f.data,label:C.target.value}})},className:"block w-full text-xs border border-gray-300 rounded px-2 py-1"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-xs font-medium text-gray-700 mb-1",children:"Type"}),o.jsx("select",{value:f.data.nodeType,onChange:C=>{s(P=>P.map($=>$.id===f.id?{...$,data:{...$.data,nodeType:C.target.value}}:$)),h({...f,data:{...f.data,nodeType:C.target.value}})},className:"block w-full text-xs border border-gray-300 rounded px-2 py-1",children:J5.map(C=>o.jsx("option",{value:C.type,children:C.label},C.type))})]}),o.jsxs("button",{onClick:A,className:"w-full flex items-center justify-center px-3 py-2 border border-red-300 rounded-md text-xs font-medium text-red-700 bg-white hover:bg-red-50",children:[o.jsx($3,{className:"h-3 w-3 mr-1"}),"Delete Node"]})]})]})]}),o.jsx("div",{className:"flex-1",ref:r,children:o.jsxs(S3,{nodes:a,edges:c,onNodesChange:l,onEdgesChange:d,onConnect:w,onNodeClick:_,onInit:i,onDrop:N,onDragOver:j,nodeTypes:Vke,fitView:!0,attributionPosition:"top-right",children:[o.jsx(Cq,{}),o.jsx(Nq,{}),o.jsx(Dq,{variant:Dn.Dots,gap:12,size:1}),o.jsx(Jy,{position:"top-left",children:o.jsx("div",{className:"bg-white rounded-lg shadow-lg border p-3",children:o.jsxs("div",{className:"flex items-center space-x-3",children:[o.jsx("div",{className:`w-3 h-3 rounded-full ${m?"bg-blue-500 animate-pulse":"bg-green-500"}`}),o.jsx("span",{className:"text-sm font-medium",children:m?"Executing...":"Ready"}),o.jsxs("span",{className:"text-xs text-gray-500",children:[a.length," nodes, ",c.length," connections"]})]})})})]})})]})]})}const Hke=()=>{const[e,t]=b.useState([]),[r,n]=b.useState([]),[i,a]=b.useState(!0),[s,l]=b.useState(null);b.useEffect(()=>{c();const y=setInterval(c,3e4);return()=>clearInterval(y)},[]);const c=async()=>{try{const[y,p]=await Promise.all([Gf.getWorkflows(),Gf.getExecutions()]);t(y),n(p),l(null)}catch(y){l("Failed to fetch workflow data"),console.error("Error fetching workflow data:",y)}finally{a(!1)}},u=y=>{switch(y){case"success":return o.jsx(dn,{className:"h-5 w-5 text-green-500"});case"running":return o.jsx(fg,{className:"h-5 w-5 text-blue-500 animate-spin"});case"error":return o.jsx(Kr,{className:"h-5 w-5 text-red-500"});default:return o.jsx(hr,{className:"h-5 w-5 text-gray-500"})}},d=y=>{if(!y)return"N/A";if(y<60)return`${y}s`;const p=Math.floor(y/60),x=y%60;return`${p}m ${x}s`},f=y=>new Date(y).toLocaleString();if(i)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})});if(s)return o.jsx("div",{className:"bg-red-50 border border-red-200 rounded-md p-4",children:o.jsxs("div",{className:"flex",children:[o.jsx(Kr,{className:"h-5 w-5 text-red-400"}),o.jsxs("div",{className:"ml-3",children:[o.jsx("h3",{className:"text-sm font-medium text-red-800",children:"Error"}),o.jsx("p",{className:"mt-1 text-sm text-red-700",children:s})]})]})});const h=e.filter(y=>y.active),m=e.filter(y=>!y.active);return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[o.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"n8n Workflow Overview"}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[o.jsx("div",{className:"bg-blue-50 rounded-lg p-4",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(pl,{className:"h-8 w-8 text-blue-600"}),o.jsxs("div",{className:"ml-3",children:[o.jsx("p",{className:"text-sm font-medium text-blue-600",children:"Total Workflows"}),o.jsx("p",{className:"text-2xl font-bold text-blue-900",children:e.length})]})]})}),o.jsx("div",{className:"bg-green-50 rounded-lg p-4",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(hi,{className:"h-8 w-8 text-green-600"}),o.jsxs("div",{className:"ml-3",children:[o.jsx("p",{className:"text-sm font-medium text-green-600",children:"Active"}),o.jsx("p",{className:"text-2xl font-bold text-green-900",children:h.length})]})]})}),o.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(hg,{className:"h-8 w-8 text-gray-600"}),o.jsxs("div",{className:"ml-3",children:[o.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Inactive"}),o.jsx("p",{className:"text-2xl font-bold text-gray-900",children:m.length})]})]})}),o.jsx("div",{className:"bg-purple-50 rounded-lg p-4",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(hr,{className:"h-8 w-8 text-purple-600"}),o.jsxs("div",{className:"ml-3",children:[o.jsx("p",{className:"text-sm font-medium text-purple-600",children:"Recent Executions"}),o.jsx("p",{className:"text-2xl font-bold text-purple-900",children:r.length})]})]})})]})]}),o.jsxs("div",{className:"bg-white rounded-lg shadow",children:[o.jsx("div",{className:"px-6 py-4 border-b border-gray-200",children:o.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Active Workflows"})}),o.jsx("div",{className:"p-6",children:h.length===0?o.jsx("p",{className:"text-gray-500 text-center py-8",children:"No active workflows"}):o.jsx("div",{className:"space-y-4",children:h.map(y=>o.jsxs("div",{className:"border border-gray-200 rounded-lg p-4",children:[o.jsxs("div",{className:"flex items-center justify-between mb-3",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsx(hi,{className:"h-5 w-5 text-green-500 mr-2"}),o.jsx("h4",{className:"text-lg font-medium text-gray-900",children:y.name})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("span",{className:"px-2 py-1 text-xs font-medium bg-green-100 text-green-800 rounded-full",children:"Active"}),o.jsxs("span",{className:"px-2 py-1 text-xs font-medium bg-gray-100 text-gray-800 rounded-full",children:[y.node_count," nodes"]})]})]}),o.jsx("p",{className:"text-sm text-gray-600 mb-3",children:y.description}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center space-x-4",children:[o.jsxs("span",{className:"text-sm text-gray-500",children:["Updated: ",f(y.updated_at)]}),y.tags.length>0&&o.jsx("div",{className:"flex space-x-1",children:y.tags.map((p,x)=>o.jsx("span",{className:"px-2 py-1 text-xs bg-blue-100 text-blue-800 rounded",children:p},x))})]}),y.webhook_url&&o.jsxs("a",{href:y.webhook_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-3 py-1 border border-gray-300 rounded-md text-xs font-medium text-gray-700 hover:bg-gray-50",children:[o.jsx(qk,{className:"h-4 w-4 mr-1"}),"Webhook"]})]})]},y.id))})})]}),o.jsxs("div",{className:"bg-white rounded-lg shadow",children:[o.jsx("div",{className:"px-6 py-4 border-b border-gray-200",children:o.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Recent Executions"})}),o.jsx("div",{className:"p-6",children:r.length===0?o.jsx("p",{className:"text-gray-500 text-center py-8",children:"No recent executions"}):o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[o.jsx("thead",{className:"bg-gray-50",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Mode"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Started"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Duration"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Workflow ID"})]})}),o.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:r.map(y=>o.jsxs("tr",{children:[o.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:o.jsxs("div",{className:"flex items-center",children:[u(y.status),o.jsx("span",{className:"ml-2 text-sm font-medium text-gray-900",children:y.status})]})}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:y.mode}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:f(y.started_at)}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:d(y.duration)}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:y.workflow_id})]},y.id))})]})})})]}),m.length>0&&o.jsxs("div",{className:"bg-white rounded-lg shadow",children:[o.jsx("div",{className:"px-6 py-4 border-b border-gray-200",children:o.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Inactive Workflows"})}),o.jsx("div",{className:"p-6",children:o.jsx("div",{className:"space-y-4",children:m.map(y=>o.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 bg-gray-50",children:[o.jsxs("div",{className:"flex items-center justify-between mb-3",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsx(hg,{className:"h-5 w-5 text-gray-500 mr-2"}),o.jsx("h4",{className:"text-lg font-medium text-gray-700",children:y.name})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("span",{className:"px-2 py-1 text-xs font-medium bg-gray-100 text-gray-600 rounded-full",children:"Inactive"}),o.jsxs("span",{className:"px-2 py-1 text-xs font-medium bg-gray-100 text-gray-600 rounded-full",children:[y.node_count," nodes"]})]})]}),o.jsx("p",{className:"text-sm text-gray-600 mb-3",children:y.description}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm text-gray-500",children:["Updated: ",f(y.updated_at)]}),y.webhook_url&&o.jsxs("a",{href:y.webhook_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-3 py-1 border border-gray-300 rounded-md text-xs font-medium text-gray-700 hover:bg-gray-50",children:[o.jsx(qk,{className:"h-4 w-4 mr-1"}),"Webhook"]})]})]},y.id))})})]})]})},eC=()=>{const[e,t]=b.useState(null),[r,n]=b.useState(!0),[i,a]=b.useState(null);b.useEffect(()=>{s();const d=setInterval(s,3e4);return()=>clearInterval(d)},[]);const s=async()=>{try{const d=await Gf.getOverview();t(d),a(null)}catch(d){a("Failed to fetch cluster overview"),console.error("Error fetching cluster overview:",d)}finally{n(!1)}},l=d=>{switch(d){case"online":return o.jsx(dn,{className:"h-5 w-5 text-green-500"});case"offline":return o.jsx(Kr,{className:"h-5 w-5 text-red-500"});default:return o.jsx(T3,{className:"h-5 w-5 text-yellow-500"})}},c=d=>{if(d===0)return"0 Bytes";const f=1024,h=["Bytes","KB","MB","GB","TB"],m=Math.floor(Math.log(d)/Math.log(f));return parseFloat((d/Math.pow(f,m)).toFixed(2))+" "+h[m]},u=d=>d?d<70?"bg-green-500":d<90?"bg-yellow-500":"bg-red-500":"bg-gray-200";return r?o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})}):i?o.jsx("div",{className:"bg-red-50 border border-red-200 rounded-md p-4",children:o.jsxs("div",{className:"flex",children:[o.jsx(Kr,{className:"h-5 w-5 text-red-400"}),o.jsxs("div",{className:"ml-3",children:[o.jsx("h3",{className:"text-sm font-medium text-red-800",children:"Error"}),o.jsx("p",{className:"mt-1 text-sm text-red-700",children:i})]})]})}):e?o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[o.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Cluster Overview"}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[o.jsx("div",{className:"bg-blue-50 rounded-lg p-4",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(Ds,{className:"h-8 w-8 text-blue-600"}),o.jsxs("div",{className:"ml-3",children:[o.jsx("p",{className:"text-sm font-medium text-blue-600",children:"Total Nodes"}),o.jsx("p",{className:"text-2xl font-bold text-blue-900",children:e.total_nodes})]})]})}),o.jsx("div",{className:"bg-green-50 rounded-lg p-4",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(dn,{className:"h-8 w-8 text-green-600"}),o.jsxs("div",{className:"ml-3",children:[o.jsx("p",{className:"text-sm font-medium text-green-600",children:"Active Nodes"}),o.jsx("p",{className:"text-2xl font-bold text-green-900",children:e.active_nodes})]})]})}),o.jsx("div",{className:"bg-purple-50 rounded-lg p-4",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(pl,{className:"h-8 w-8 text-purple-600"}),o.jsxs("div",{className:"ml-3",children:[o.jsx("p",{className:"text-sm font-medium text-purple-600",children:"Total Models"}),o.jsx("p",{className:"text-2xl font-bold text-purple-900",children:e.total_models})]})]})}),o.jsx("div",{className:"bg-orange-50 rounded-lg p-4",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(mK,{className:"h-8 w-8 text-orange-600"}),o.jsxs("div",{className:"ml-3",children:[o.jsx("p",{className:"text-sm font-medium text-orange-600",children:"Cluster Health"}),o.jsxs("p",{className:"text-2xl font-bold text-orange-900",children:[Math.round(e.active_nodes/e.total_nodes*100),"%"]})]})]})})]})]}),o.jsxs("div",{className:"bg-white rounded-lg shadow",children:[o.jsx("div",{className:"px-6 py-4 border-b border-gray-200",children:o.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Cluster Nodes"})}),o.jsx("div",{className:"p-6",children:o.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:e.nodes.map(d=>o.jsxs("div",{className:"border border-gray-200 rounded-lg p-4",children:[o.jsxs("div",{className:"flex items-center justify-between mb-3",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsx(Ds,{className:"h-6 w-6 text-gray-500 mr-2"}),o.jsx("h4",{className:"text-lg font-medium text-gray-900",children:d.hostname}),o.jsx("span",{className:`ml-2 px-2 py-1 text-xs font-medium rounded-full ${d.role==="manager"?"bg-blue-100 text-blue-800":"bg-gray-100 text-gray-800"}`,children:d.role})]}),o.jsxs("div",{className:"flex items-center",children:[l(d.status),o.jsx("span",{className:"ml-1 text-sm font-medium text-gray-700",children:d.status})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm text-gray-600",children:"IP Address"}),o.jsx("p",{className:"text-sm font-medium text-gray-900",children:d.ip})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm text-gray-600",children:"Models"}),o.jsx("p",{className:"text-sm font-medium text-gray-900",children:d.model_count})]})]}),o.jsxs("div",{className:"space-y-2 mb-4",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm text-gray-600",children:"CPU"}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("p",{className:"text-sm font-medium text-gray-900",children:d.hardware.cpu}),d.metrics.cpu_percent&&o.jsxs("span",{className:"text-xs text-gray-500",children:[d.metrics.cpu_percent.toFixed(1),"%"]})]}),d.metrics.cpu_percent&&o.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2 mt-1",children:o.jsx("div",{className:`h-2 rounded-full ${u(d.metrics.cpu_percent)}`,style:{width:`${d.metrics.cpu_percent}%`}})})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm text-gray-600",children:"Memory"}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("p",{className:"text-sm font-medium text-gray-900",children:d.hardware.memory}),d.metrics.memory_percent&&o.jsxs("span",{className:"text-xs text-gray-500",children:[d.metrics.memory_percent.toFixed(1),"%"]})]}),d.metrics.memory_percent&&o.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2 mt-1",children:o.jsx("div",{className:`h-2 rounded-full ${u(d.metrics.memory_percent)}`,style:{width:`${d.metrics.memory_percent}%`}})})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm text-gray-600",children:"GPU"}),o.jsx("p",{className:"text-sm font-medium text-gray-900",children:d.hardware.gpu})]})]}),d.metrics.disk_usage&&o.jsxs("div",{className:"mb-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("p",{className:"text-sm text-gray-600",children:"Disk Usage"}),o.jsxs("span",{className:"text-xs text-gray-500",children:[c(d.metrics.disk_usage.used)," / ",c(d.metrics.disk_usage.total)]})]}),o.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2 mt-1",children:o.jsx("div",{className:`h-2 rounded-full ${u(d.metrics.disk_usage.percent)}`,style:{width:`${d.metrics.disk_usage.percent}%`}})})]}),o.jsxs("div",{className:"flex space-x-2",children:[o.jsxs("a",{href:d.services.ollama,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-3 py-1 border border-gray-300 rounded-md text-xs font-medium text-gray-700 hover:bg-gray-50",children:[o.jsx(Si,{className:"h-4 w-4 mr-1"}),"Ollama"]}),o.jsxs("a",{href:d.services.cockpit,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-3 py-1 border border-gray-300 rounded-md text-xs font-medium text-gray-700 hover:bg-gray-50",children:[o.jsx(Ds,{className:"h-4 w-4 mr-1"}),"Cockpit"]})]})]},d.id))})})]})]}):o.jsx("div",{children:"No cluster data available"})};function qke(){const[e,t]=b.useState([]),[r,n]=b.useState(null),[i,a]=b.useState([]),[s,l]=b.useState(""),[c,u]=b.useState(!1),[d,f]=b.useState(!0),[h,m]=b.useState(null),[y,p]=b.useState([]),x=b.useRef(null),g=b.useRef(null);b.useEffect(()=>{const E=()=>{try{const k=`ws://${window.location.host}/api/bzzz/logs/stream`,A=new WebSocket(k);A.onopen=()=>{console.log("🔗 Connected to Bzzz log stream"),u(!0),m(null)},A.onmessage=C=>{try{const P=JSON.parse(C.data);if(P.type==="initial_logs"){const $=P.messages||[];v($)}else if(P.type==="new_messages"){const $=P.messages||[];v($,!0)}else P.type==="heartbeat"&&A.send(JSON.stringify({type:"ping"}))}catch(P){console.error("Failed to parse WebSocket message:",P)}},A.onclose=()=>{console.log("🔌 Disconnected from Bzzz log stream"),u(!1),setTimeout(E,5e3)},A.onerror=C=>{console.error("WebSocket error:",C),m("Failed to connect to Bzzz log stream"),u(!1)},g.current=A}catch(k){console.error("Failed to create WebSocket connection:",k),m("Failed to initialize real-time connection")}};return E(),()=>{g.current&&g.current.close()}},[]),b.useEffect(()=>{(async()=>{f(!0);try{const k=await fetch("/api/bzzz/agents");if(k.ok){const A=await k.json();p(A.agents||[])}if(!c){const A=await fetch("/api/bzzz/logs?limit=100");if(A.ok){const C=await A.json();v(C.logs||[])}}}catch(k){console.error("Failed to fetch initial data:",k),m("Failed to load Bzzz data")}finally{f(!1)}})()},[c]);const v=(E,k=!1)=>{const A=new Map,C=new Map;E.forEach(P=>{const $=P.channel||"unknown",O={id:P.id||`log-${Date.now()}-${Math.random()}`,senderId:P.senderId||P.agent_id||"unknown",senderName:P.senderName||P.senderId||P.agent_id||"Unknown",content:P.content||"No content",timestamp:P.timestamp,messageType:P.messageType||"received",channel:$,swarmId:P.swarmId,isDelivered:P.isDelivered!==!1,isRead:P.isRead!==!1,logType:P.logType,hash:P.hash};A.has($)||A.set($,{id:$,name:w($),participants:[],unreadCount:0,isActive:!0,swarmId:P.swarmId||`swarm-${$}`});const I=A.get($);I.participants.includes(O.senderName)||I.participants.push(O.senderName),I.lastMessage=O,C.has($)||C.set($,[]),C.get($).push(O)}),k?(t(P=>{const $=[...P];return A.forEach((O,I)=>{const D=$.findIndex(L=>L.id===I);D>=0?$[D]={...$[D],...O}:$.push(O)}),$}),a(P=>{const $=Array.from(C.values()).flat();return[...P,...$].sort((O,I)=>new Date(O.timestamp).getTime()-new Date(I.timestamp).getTime())})):(t(Array.from(A.values())),a(Array.from(C.values()).flat().sort((P,$)=>new Date(P.timestamp).getTime()-new Date($.timestamp).getTime())),A.size>0&&!r&&n(Array.from(A.keys())[0]))},w=E=>E==="bzzz"?"Bzzz Coordination":E==="antennae"?"Antennae Meta-Discussion":E==="unknown"?"Unknown Channel":E.replace(/_/g," ").replace(/\b\w/g,k=>k.toUpperCase()),_=E=>new Date(E).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),j=E=>{const k=new Date,A=new Date(E),C=k.getTime()-A.getTime(),P=Math.floor(C/6e4),$=Math.floor(C/36e5),O=Math.floor(C/864e5);return P<1?"now":P<60?`${P}m`:$<24?`${$}h`:`${O}d`};b.useEffect(()=>{var E;(E=x.current)==null||E.scrollIntoView({behavior:"smooth"})},[i]);const N=e.find(E=>E.id===r),S=i.filter(E=>E.channel===r);return d?o.jsx("div",{className:"h-full flex items-center justify-center bg-gray-50 dark:bg-gray-900",children:o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600 mx-auto mb-4"}),o.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"Loading Bzzz Network"}),o.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Connecting to hypercore logging system..."})]})}):h?o.jsx("div",{className:"h-full flex items-center justify-center bg-gray-50 dark:bg-gray-900",children:o.jsxs("div",{className:"text-center",children:[o.jsx(Ls,{className:"h-12 w-12 text-red-500 mx-auto mb-4"}),o.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"Connection Error"}),o.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-4",children:h}),o.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700",children:"Retry Connection"})]})}):o.jsxs("div",{className:"h-full flex bg-white dark:bg-gray-900",children:[o.jsxs("div",{className:"w-80 border-r border-gray-200 dark:border-gray-700 flex flex-col",children:[o.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Bzzz Network"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(sG,{className:`w-4 h-4 ${c?"text-green-500":"text-red-500"}`}),o.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:c?"Live":"Disconnected"})]})]}),o.jsxs("div",{className:"relative",children:[o.jsx(r0,{className:"h-4 w-4 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),o.jsx("input",{type:"text",placeholder:"Search channels...",value:s,onChange:E=>l(E.target.value),className:"w-full pl-9 pr-3 py-2 bg-gray-100 dark:bg-gray-800 border-0 rounded-lg text-sm text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-2 focus:ring-blue-500"})]})]}),o.jsx("div",{className:"flex-1 overflow-y-auto",children:e.length===0?o.jsx("div",{className:"p-4 text-center",children:o.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"No channels found. Waiting for Bzzz agents to come online..."})}):e.map(E=>o.jsx("div",{onClick:()=>n(E.id),className:`p-4 border-b border-gray-100 dark:border-gray-800 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 ${r===E.id?"bg-blue-50 dark:bg-blue-900/20":""}`,children:o.jsx("div",{className:"flex items-center justify-between",children:o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h3",{className:"font-medium text-gray-900 dark:text-white text-sm",children:E.name}),o.jsxs("div",{className:"flex items-center space-x-2",children:[E.lastMessage&&o.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:j(E.lastMessage.timestamp)}),E.unreadCount>0&&o.jsx("span",{className:"bg-blue-500 text-white text-xs rounded-full px-2 py-1 min-w-[20px] text-center",children:E.unreadCount})]})]}),o.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:[E.participants.length," participants • ",E.swarmId]}),E.lastMessage&&o.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1 truncate",children:[o.jsxs("span",{className:"font-medium",children:[E.lastMessage.senderName,":"]})," ",E.lastMessage.content]})]})})},E.id))})]}),N?o.jsxs("div",{className:"flex-1 flex flex-col",children:[o.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"font-semibold text-gray-900 dark:text-white",children:N.name}),o.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:N.participants.join(", ")})]}),o.jsx("div",{className:"flex items-center space-x-2",children:o.jsx("button",{className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg",children:o.jsx(Bd,{className:"h-5 w-5 text-gray-500 dark:text-gray-400"})})})]})}),o.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-gray-50 dark:bg-gray-900",children:[S.length===0?o.jsx("div",{className:"text-center py-8",children:o.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"No messages in this channel yet."})}):S.map(E=>o.jsx("div",{className:`flex ${E.messageType==="sent"?"justify-end":E.messageType==="system"?"justify-center":"justify-start"}`,children:E.messageType==="system"?o.jsx("div",{className:"bg-gray-200 dark:bg-gray-700 px-3 py-1 rounded-full",children:o.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 text-center",children:E.content})}):o.jsxs("div",{className:`max-w-xs lg:max-w-md px-4 py-2 rounded-2xl ${E.messageType==="sent"?"bg-blue-500 text-white":"bg-white dark:bg-gray-800 text-gray-900 dark:text-white shadow-sm"}`,children:[E.messageType==="received"&&o.jsx("p",{className:"text-xs font-medium mb-1 text-blue-600 dark:text-blue-400",children:E.senderName}),o.jsx("p",{className:"text-sm",children:E.content}),o.jsxs("div",{className:"flex items-center justify-between mt-1",children:[o.jsx("span",{className:`text-xs ${E.messageType==="sent"?"text-blue-100":"text-gray-500 dark:text-gray-400"}`,children:_(E.timestamp)}),E.logType&&o.jsx("span",{className:"text-xs opacity-50 ml-2",children:E.logType})]})]})},E.id)),o.jsx("div",{ref:x})]}),o.jsxs("div",{className:"p-4 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800",children:[o.jsxs("div",{className:"flex items-center space-x-3",children:[o.jsx("div",{className:"flex-1 bg-gray-100 dark:bg-gray-700 rounded-lg px-4 py-2",children:o.jsx("input",{type:"text",placeholder:"Monitoring mode - messages are read-only",disabled:!0,className:"w-full bg-transparent border-0 text-gray-500 dark:text-gray-400 placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none text-sm"})}),o.jsx("button",{disabled:!0,className:"p-2 text-gray-400 dark:text-gray-500 cursor-not-allowed",children:o.jsx(UK,{className:"h-5 w-5"})})]}),o.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-2 text-center",children:["🐝 Real-time monitoring of hypercore P2P network • ",y.length," agents detected"]})]})]}):o.jsx("div",{className:"flex-1 flex items-center justify-center bg-gray-50 dark:bg-gray-900",children:o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-6xl mb-4",children:"🐝"}),o.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"Select a channel to monitor"}),o.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Choose a Bzzz hypercore channel to view real-time agent communications"})]})})]})}const Kke=()=>{const[e,t]=b.useState(null),[r,n]=b.useState([]),[i,a]=b.useState([]),[s,l]=b.useState(!0),[c,u]=b.useState(null),[d,f]=b.useState(!1),[h,m]=b.useState({task_description:"",required_capabilities:[],priority:"medium"}),[y,p]=b.useState(!1),[x,g]=b.useState({title:"",description:"",context:{},ucxl_address:""});b.useEffect(()=>{v();const k=setInterval(v,3e4);return()=>clearInterval(k)},[]);const v=async()=>{try{u(null);const k=await fetch("/api/bzzz/status");if(k.ok){const P=await k.json();t(P)}const A=await fetch("/api/bzzz/members");if(A.ok){const P=await A.json();n(P)}const C=await fetch("/api/bzzz/decisions?limit=10");if(C.ok){const P=await C.json();a(P)}}catch(k){u(k instanceof Error?k.message:"Failed to load BZZZ data")}finally{l(!1)}},w=async()=>{try{const k=await fetch("/api/bzzz/tasks/assign",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(h)});if(k.ok){const A=await k.json();alert(`Task assigned to: ${A.assigned_to}`),f(!1),m({task_description:"",required_capabilities:[],priority:"medium"}),v()}else throw new Error("Failed to assign task")}catch(k){alert(`Error: ${k instanceof Error?k.message:"Failed to assign task"}`)}},_=async()=>{try{const k=await fetch("/api/bzzz/decisions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)});if(k.ok){const A=await k.json();alert(`Decision published with ID: ${A.decision_id}`),p(!1),g({title:"",description:"",context:{},ucxl_address:""}),v()}else throw new Error("Failed to publish decision")}catch(k){alert(`Error: ${k instanceof Error?k.message:"Failed to publish decision"}`)}},j=async()=>{try{if((await fetch("/api/bzzz/network/discover",{method:"POST"})).ok)await v(),alert("Network rediscovery completed");else throw new Error("Failed to rediscover network")}catch(k){alert(`Error: ${k instanceof Error?k.message:"Failed to rediscover network"}`)}},N=k=>{switch(k){case"senior_architect":return"🏗️";case"frontend_developer":return"🎨";case"backend_developer":return"⚙️";case"devops_engineer":return"🚀";case"project_manager":return"👑";case"ai_coordinator":return"🧠";default:return"👤"}},S=k=>{switch(k){case"online":return"text-green-500";case"offline":return"text-red-500";case"busy":return"text-yellow-500";default:return"text-gray-500"}},E=k=>k>=.8?"text-green-500":k>=.5?"text-yellow-500":"text-red-500";return s?o.jsx("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 flex items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),o.jsx("p",{className:"mt-4 text-gray-600 dark:text-gray-400",children:"Loading BZZZ Team..."})]})}):o.jsx("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:o.jsxs("div",{className:"max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8",children:[o.jsx("div",{className:"mb-8",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white flex items-center",children:[o.jsx(Hf,{className:"w-8 h-8 mr-3 text-blue-600"}),"BZZZ Team Collaboration"]}),o.jsx("p",{className:"mt-2 text-gray-600 dark:text-gray-400",children:"Distributed AI team coordination and decision consensus"})]}),o.jsx("div",{className:"flex space-x-3",children:o.jsxs("button",{onClick:j,className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 flex items-center",children:[o.jsx(fg,{className:"w-4 h-4 mr-2"}),"Rediscover"]})})]})}),c&&o.jsx("div",{className:"mb-6 bg-red-100 dark:bg-red-900 border border-red-400 text-red-700 dark:text-red-200 px-4 py-3 rounded",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(Ls,{className:"w-5 h-5 mr-2"}),c]})}),e&&o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:[o.jsx("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(Hf,{className:"w-8 h-8 text-blue-600"}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"Team Members"}),o.jsxs("p",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:[e.online_members,"/",e.total_members]})]})]})}),o.jsx("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(dn,{className:`w-8 h-8 ${E(e.network_health)}`}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"Network Health"}),o.jsxs("p",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:[(e.network_health*100).toFixed(0),"%"]})]})]})}),o.jsx("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(_o,{className:"w-8 h-8 text-green-600"}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"Active Decisions"}),o.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:e.active_decisions})]})]})}),o.jsx("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(pl,{className:"w-8 h-8 text-purple-600"}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"Role Types"}),o.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:Object.keys(e.role_distribution).length})]})]})})]}),o.jsx("div",{className:"mb-8",children:o.jsxs("div",{className:"flex space-x-4",children:[o.jsxs("button",{onClick:()=>f(!0),className:"px-6 py-3 bg-green-600 text-white rounded-lg hover:bg-green-700 flex items-center",children:[o.jsx(Si,{className:"w-5 h-5 mr-2"}),"Assign Task"]}),o.jsxs("button",{onClick:()=>p(!0),className:"px-6 py-3 bg-purple-600 text-white rounded-lg hover:bg-purple-700 flex items-center",children:[o.jsx(C3,{className:"w-5 h-5 mr-2"}),"Publish Decision"]})]})}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[o.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow",children:[o.jsx("div",{className:"p-6 border-b border-gray-200 dark:border-gray-700",children:o.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white",children:"Team Members"})}),o.jsx("div",{className:"p-6",children:o.jsx("div",{className:"space-y-4",children:r.map(k=>o.jsxs("div",{className:"flex items-center justify-between p-4 border border-gray-200 dark:border-gray-700 rounded-lg",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsx("span",{className:"text-2xl mr-3",children:N(k.role)}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:k.agent_id}),o.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:k.role.replace("_"," ")}),o.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[k.capabilities.slice(0,3).map(A=>o.jsx("span",{className:"px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:A},A)),k.capabilities.length>3&&o.jsxs("span",{className:"px-2 py-1 text-xs bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 rounded",children:["+",k.capabilities.length-3," more"]})]})]})]}),o.jsxs("div",{className:`flex items-center ${S(k.status)}`,children:[k.status==="online"?o.jsx(dn,{className:"w-5 h-5"}):o.jsx(Kr,{className:"w-5 h-5"}),o.jsx("span",{className:"ml-1 text-sm font-medium",children:k.status})]})]},k.agent_id))})})]}),o.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow",children:[o.jsx("div",{className:"p-6 border-b border-gray-200 dark:border-gray-700",children:o.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white",children:"Recent Decisions"})}),o.jsx("div",{className:"p-6",children:o.jsx("div",{className:"space-y-4",children:i.map(k=>o.jsx("div",{className:"p-4 border border-gray-200 dark:border-gray-700 rounded-lg",children:o.jsx("div",{className:"flex items-start justify-between",children:o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"font-medium text-gray-900 dark:text-white",children:k.title}),k.description&&o.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:k.description}),o.jsxs("div",{className:"flex items-center mt-2 text-xs text-gray-500 dark:text-gray-400",children:[o.jsx("span",{className:"mr-1",children:N(k.author_role)}),o.jsx("span",{className:"mr-3",children:k.author_role.replace("_"," ")}),o.jsx(hr,{className:"w-4 h-4 mr-1"}),o.jsx("span",{children:new Date(k.timestamp).toLocaleString()})]})]})})},k.decision_id||k.id))})})]})]}),d&&o.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:o.jsxs("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow-xl max-w-md w-full mx-4",children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:"Assign Task"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Task Description"}),o.jsx("textarea",{value:h.task_description,onChange:k=>m({...h,task_description:k.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md dark:bg-gray-700 dark:text-white",rows:3})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Required Capabilities (comma-separated)"}),o.jsx("input",{type:"text",value:h.required_capabilities.join(", "),onChange:k=>m({...h,required_capabilities:k.target.value.split(",").map(A=>A.trim()).filter(A=>A)}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md dark:bg-gray-700 dark:text-white",placeholder:"frontend, backend, devops"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Priority"}),o.jsxs("select",{value:h.priority,onChange:k=>m({...h,priority:k.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md dark:bg-gray-700 dark:text-white",children:[o.jsx("option",{value:"low",children:"Low"}),o.jsx("option",{value:"medium",children:"Medium"}),o.jsx("option",{value:"high",children:"High"}),o.jsx("option",{value:"urgent",children:"Urgent"})]})]})]}),o.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[o.jsx("button",{onClick:()=>f(!1),className:"px-4 py-2 text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-white",children:"Cancel"}),o.jsx("button",{onClick:w,className:"px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700",children:"Assign Task"})]})]})}),y&&o.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:o.jsxs("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow-xl max-w-md w-full mx-4",children:[o.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:"Publish Decision"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Title"}),o.jsx("input",{type:"text",value:x.title,onChange:k=>g({...x,title:k.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md dark:bg-gray-700 dark:text-white"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Description"}),o.jsx("textarea",{value:x.description,onChange:k=>g({...x,description:k.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md dark:bg-gray-700 dark:text-white",rows:4})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"UCXL Address (optional)"}),o.jsx("input",{type:"text",value:x.ucxl_address,onChange:k=>g({...x,ucxl_address:k.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md dark:bg-gray-700 dark:text-white",placeholder:"ucxl://any:any@PROJECT:COMPONENT/path"})]})]}),o.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[o.jsx("button",{onClick:()=>p(!1),className:"px-4 py-2 text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-white",children:"Cancel"}),o.jsx("button",{onClick:_,className:"px-4 py-2 bg-purple-600 text-white rounded-md hover:bg-purple-700",children:"Publish Decision"})]})]})})]})})},jj=({className:e="",variant:t="default",children:r})=>{const n={default:"bg-blue-600 text-white",secondary:"bg-gray-100 text-gray-900",destructive:"bg-red-600 text-white",outline:"border border-gray-300 bg-white",success:"bg-green-600 text-white",warning:"bg-yellow-600 text-white"};return o.jsx("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${n[t]} ${e}`,children:r})},_j=({className:e="",placeholder:t,value:r,onChange:n,disabled:i=!1,required:a=!1,id:s,name:l,rows:c=4})=>o.jsx("textarea",{className:`flex min-h-[80px] w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm ring-offset-white placeholder:text-gray-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${e}`,placeholder:t,value:r,onChange:n,disabled:i,required:a,id:s,name:l,rows:c}),NN=b.createContext(void 0),Gke=({defaultValue:e="",value:t,onValueChange:r,className:n="",children:i})=>{const[a,s]=b.useState(e),l=t??a,c=u=>{r?r(u):s(u)};return o.jsx(NN.Provider,{value:{value:l,onValueChange:c},children:o.jsx("div",{className:n,children:i})})},Yke=({className:e="",children:t})=>o.jsx("div",{className:`inline-flex h-10 items-center justify-center rounded-md bg-gray-100 p-1 text-gray-500 ${e}`,children:t}),Gx=({className:e="",value:t,children:r})=>{const n=b.useContext(NN);if(!n)throw new Error("TabsTrigger must be used within Tabs");const i=n.value===t;return o.jsx("button",{className:`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 ${i?"bg-white text-gray-950 shadow-sm":"text-gray-500 hover:text-gray-900"} ${e}`,onClick:()=>n.onValueChange(t),children:r})},Yx=({className:e="",value:t,children:r})=>{const n=b.useContext(NN);if(!n)throw new Error("TabsContent must be used within Tabs");return n.value!==t?null:o.jsx("div",{className:`mt-2 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 ${e}`,children:r})},Zke=()=>{const[e,t]=b.useState([]),[r,n]=b.useState(null),[i,a]=b.useState(!0),[s,l]=b.useState(!1),[c,u]=b.useState(""),[d,f]=b.useState("all"),[h,m]=b.useState(""),[y,p]=b.useState(""),[x,g]=b.useState(""),[v,w]=b.useState(""),[_,j]=b.useState(null),[N,S]=b.useState(!1),[E,k]=b.useState(""),[A,C]=b.useState("python"),[P,$]=b.useState("clean"),[O,I]=b.useState(null),D={code_generation:nx,code_review:mg,documentation:vG,testing:SG,architecture:EG,debugging:gG,refactoring:Yl,general_chat:_G,specialized_domain:rx},L={code_generation:"bg-blue-100 text-blue-800",code_review:"bg-green-100 text-green-800",documentation:"bg-purple-100 text-purple-800",testing:"bg-orange-100 text-orange-800",architecture:"bg-red-100 text-red-800",debugging:"bg-yellow-100 text-yellow-800",refactoring:"bg-indigo-100 text-indigo-800",general_chat:"bg-gray-100 text-gray-800",specialized_domain:"bg-pink-100 text-pink-800"};b.useEffect(()=>{R()},[]);const R=async()=>{a(!0);try{const[q,ee]=await Promise.all([fetch("/api/ai-models/models"),fetch("/api/ai-models/status")]);if(q.ok){const le=await q.json();t(le)}if(ee.ok){const le=await ee.json();n(le)}}catch(q){console.error("Error fetching AI models data:",q)}finally{a(!1)}},M=async()=>{l(!0);try{await fetch("/api/ai-models/refresh-models",{method:"POST"}),await R()}catch(q){console.error("Error refreshing models:",q)}finally{l(!1)}},B=async()=>{if(h.trim()){S(!0);try{const ee=await(await fetch("/api/ai-models/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:h,system_prompt:y||void 0,model_name:x||void 0,task_type:v||void 0,max_tokens:1e3,temperature:.7})})).json();j(ee)}catch(q){console.error("Error generating completion:",q),j({success:!1,error:"Failed to generate completion",model:x||"unknown"})}finally{S(!1)}}},U=async()=>{if(E.trim()){S(!0);try{const ee=await(await fetch("/api/ai-models/code/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:E,language:A,style:P,max_tokens:2e3})})).json();I(ee)}catch(q){console.error("Error generating code:",q),I({success:!1,error:"Failed to generate code",model:"unknown"})}finally{S(!1)}}},W=e.filter(q=>{var ve;const ee=q.name.toLowerCase().includes(c.toLowerCase())||((ve=q.specialization)==null?void 0:ve.toLowerCase().includes(c.toLowerCase())),le=d==="all"||q.capabilities.includes(d);return ee&&le}),Z=Array.from(new Set(e.flatMap(q=>q.capabilities))).sort();return i?o.jsx("div",{className:"flex items-center justify-center h-96",children:o.jsxs("div",{className:"text-center",children:[o.jsx(Yl,{className:"mx-auto h-12 w-12 animate-spin text-blue-500"}),o.jsx("p",{className:"mt-4 text-gray-600",children:"Loading AI models..."})]})}):o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"AI Models"}),o.jsx("p",{className:"mt-2 text-gray-600",children:"Manage and interact with the distributed Ollama cluster"})]}),o.jsxs(zt,{onClick:M,disabled:s,children:[o.jsx(Yl,{className:`mr-2 h-4 w-4 ${s?"animate-spin":""}`}),"Refresh Models"]})]}),r&&o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[o.jsx(ti,{children:o.jsx(ki,{className:"p-6",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(mG,{className:"h-8 w-8 text-green-500"}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Healthy Nodes"}),o.jsxs("p",{className:"text-2xl font-bold text-gray-900",children:[r.healthy_nodes,"/",r.total_nodes]})]})]})})}),o.jsx(ti,{children:o.jsx(ki,{className:"p-6",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(rx,{className:"h-8 w-8 text-blue-500"}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Models"}),o.jsx("p",{className:"text-2xl font-bold text-gray-900",children:r.total_models})]})]})})}),o.jsx(ti,{children:o.jsx(ki,{className:"p-6",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(bG,{className:"h-8 w-8 text-orange-500"}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Cluster Load"}),o.jsx("p",{className:"text-2xl font-bold text-gray-900",children:r.cluster_load.toFixed(1)})]})]})})}),o.jsx(ti,{children:o.jsx(ki,{className:"p-6",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(nx,{className:"h-8 w-8 text-purple-500"}),o.jsxs("div",{className:"ml-4",children:[o.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Code Models"}),o.jsx("p",{className:"text-2xl font-bold text-gray-900",children:r.models_by_capability.code_generation||0})]})]})})})]}),o.jsxs(Gke,{defaultValue:"models",className:"space-y-4",children:[o.jsxs(Yke,{children:[o.jsx(Gx,{value:"models",children:"Available Models"}),o.jsx(Gx,{value:"chat",children:"AI Chat"}),o.jsx(Gx,{value:"code",children:"Code Generation"})]}),o.jsxs(Yx,{value:"models",className:"space-y-4",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[o.jsx("div",{className:"flex-1",children:o.jsx(wr,{placeholder:"Search models...",value:c,onChange:q=>u(q.target.value),className:"w-full"})}),o.jsxs(rs,{value:d,onValueChange:f,children:[o.jsx(ns,{className:"w-full sm:w-48",children:o.jsx(as,{placeholder:"Filter by capability"})}),o.jsxs(is,{children:[o.jsx(jt,{value:"all",children:"All Capabilities"}),Z.map(q=>o.jsx(jt,{value:q,children:q.replace("_"," ").replace(/\b\w/g,ee=>ee.toUpperCase())},q))]})]})]}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:W.map(q=>o.jsxs(ti,{className:`${q.availability?"":"opacity-50"}`,children:[o.jsx(nf,{children:o.jsxs("div",{className:"flex items-start justify-between",children:[o.jsxs("div",{children:[o.jsx(af,{className:"text-lg",children:q.name}),o.jsxs(lx,{children:[q.parameter_count," parameters • ",q.context_length.toLocaleString()," context"]})]}),o.jsx(jj,{variant:q.availability?"default":"secondary",children:q.availability?"Available":"Offline"})]})}),o.jsxs(ki,{children:[q.specialization&&o.jsxs("p",{className:"text-sm text-gray-600 mb-3",children:["Specialized in: ",q.specialization]}),o.jsx("div",{className:"flex flex-wrap gap-1 mb-3",children:q.capabilities.map(ee=>{const le=D[ee]||rx;return o.jsxs(jj,{variant:"outline",className:`${L[ee]||"bg-gray-100 text-gray-800"} text-xs`,children:[o.jsx(le,{className:"w-3 h-3 mr-1"}),ee.replace("_"," ")]},ee)})}),o.jsxs("div",{className:"text-xs text-gray-500 space-y-1",children:[o.jsxs("div",{children:["Usage: ",q.usage_count," requests"]}),q.avg_response_time>0&&o.jsxs("div",{children:["Avg Response: ",q.avg_response_time.toFixed(2),"s"]}),o.jsxs("div",{children:["Performance: ",(q.performance_score*100).toFixed(0),"%"]})]})]})]},q.name))})]}),o.jsx(Yx,{value:"chat",className:"space-y-4",children:o.jsxs(ti,{children:[o.jsxs(nf,{children:[o.jsx(af,{children:"AI Chat Interface"}),o.jsx(lx,{children:"Interact with AI models for various tasks"})]}),o.jsxs(ki,{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs(rs,{value:x,onValueChange:g,children:[o.jsx(ns,{children:o.jsx(as,{placeholder:"Select model (auto if empty)"})}),o.jsxs(is,{children:[o.jsx(jt,{value:"",children:"Auto-select best model"}),e.filter(q=>q.availability).map(q=>o.jsxs(jt,{value:q.name,children:[q.name," (",q.parameter_count,")"]},q.name))]})]}),o.jsxs(rs,{value:v,onValueChange:w,children:[o.jsx(ns,{children:o.jsx(as,{placeholder:"Task type (optional)"})}),o.jsxs(is,{children:[o.jsx(jt,{value:"",children:"Any task"}),Z.map(q=>o.jsx(jt,{value:q,children:q.replace("_"," ").replace(/\b\w/g,ee=>ee.toUpperCase())},q))]})]})]}),o.jsx(wr,{placeholder:"System prompt (optional)",value:y,onChange:q=>p(q.target.value)}),o.jsx(_j,{placeholder:"Enter your prompt...",value:h,onChange:q=>m(q.target.value),rows:4}),o.jsx(zt,{onClick:B,disabled:N||!h.trim(),className:"w-full",children:N?o.jsxs(o.Fragment,{children:[o.jsx(Yl,{className:"mr-2 h-4 w-4 animate-spin"}),"Generating..."]}):o.jsxs(o.Fragment,{children:[o.jsx(OG,{className:"mr-2 h-4 w-4"}),"Generate Response"]})}),_&&o.jsx(Bs,{className:_.success?"border-green-200":"border-red-200",children:o.jsx(zs,{children:_.success?o.jsxs("div",{children:[o.jsxs("div",{className:"font-semibold mb-2",children:["Response from ",_.model,_.response_time&&` (${_.response_time.toFixed(2)}s)`,":"]}),o.jsx("pre",{className:"whitespace-pre-wrap text-sm bg-gray-50 p-3 rounded",children:_.content})]}):o.jsxs("div",{className:"text-red-600",children:["Error: ",_.error]})})})]})]})}),o.jsx(Yx,{value:"code",className:"space-y-4",children:o.jsxs(ti,{children:[o.jsxs(nf,{children:[o.jsx(af,{children:"Code Generation"}),o.jsx(lx,{children:"Generate code using specialized programming models"})]}),o.jsxs(ki,{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs(rs,{value:A,onValueChange:C,children:[o.jsx(ns,{children:o.jsx(as,{placeholder:"Programming language"})}),o.jsxs(is,{children:[o.jsx(jt,{value:"python",children:"Python"}),o.jsx(jt,{value:"javascript",children:"JavaScript"}),o.jsx(jt,{value:"typescript",children:"TypeScript"}),o.jsx(jt,{value:"rust",children:"Rust"}),o.jsx(jt,{value:"go",children:"Go"}),o.jsx(jt,{value:"java",children:"Java"}),o.jsx(jt,{value:"cpp",children:"C++"}),o.jsx(jt,{value:"bash",children:"Bash"})]})]}),o.jsxs(rs,{value:P,onValueChange:$,children:[o.jsx(ns,{children:o.jsx(as,{placeholder:"Code style"})}),o.jsxs(is,{children:[o.jsx(jt,{value:"clean",children:"Clean & Readable"}),o.jsx(jt,{value:"optimized",children:"Performance Optimized"}),o.jsx(jt,{value:"documented",children:"Well Documented"})]})]})]}),o.jsx(_j,{placeholder:"Describe the code you want to generate...",value:E,onChange:q=>k(q.target.value),rows:4}),o.jsx(zt,{onClick:U,disabled:N||!E.trim(),className:"w-full",children:N?o.jsxs(o.Fragment,{children:[o.jsx(Yl,{className:"mr-2 h-4 w-4 animate-spin"}),"Generating Code..."]}):o.jsxs(o.Fragment,{children:[o.jsx(nx,{className:"mr-2 h-4 w-4"}),"Generate Code"]})}),O&&o.jsx(Bs,{className:O.success?"border-green-200":"border-red-200",children:o.jsx(zs,{children:O.success?o.jsxs("div",{children:[o.jsxs("div",{className:"font-semibold mb-2",children:["Code generated using ",O.model,O.response_time&&` (${O.response_time.toFixed(2)}s)`,":"]}),o.jsx("pre",{className:"whitespace-pre-wrap text-sm bg-gray-900 text-green-400 p-4 rounded overflow-x-auto",children:O.content})]}):o.jsxs("div",{className:"text-red-600",children:["Error: ",O.error]})})})]})]})})]})]})},tC=({open:e,onOpenChange:t,children:r})=>e?o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[o.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),o.jsx("div",{className:"relative bg-white rounded-lg shadow-lg max-w-md w-full mx-4 p-6",children:r})]}):null,Xke=({children:e})=>o.jsx(o.Fragment,{children:e}),rC=({children:e,className:t=""})=>o.jsx("div",{className:`relative ${t}`,children:e}),nC=({children:e,className:t=""})=>o.jsx("div",{className:`flex flex-col space-y-1.5 text-center sm:text-left ${t}`,children:e}),iC=({children:e,className:t=""})=>o.jsx("h2",{className:`text-lg font-semibold leading-none tracking-tight ${t}`,children:e}),Qke=()=>{var L;const[e,t]=b.useState([]),[r,n]=b.useState([]),[i,a]=b.useState(!0),[s,l]=b.useState(!1),[c,u]=b.useState({name:"",url:"",project_id:"",auth_type:"https",username:"",password:"",ssh_key_content:""}),[d,f]=b.useState(!1),[h,m]=b.useState(""),[y,p]=b.useState(!1),[x,g]=b.useState(null),[v,w]=b.useState(null),[_,j]=b.useState(null),N=CG(),S=gl.baseURL+"/api";b.useEffect(()=>{E(),k()},[]);const E=async()=>{try{const M=await(await N(`${S}/git-repositories/`)).json();M.success?t(M.data.repositories):m("Failed to load repositories")}catch(R){m(`Error loading repositories: ${R.message}`)}finally{a(!1)}},k=async()=>{try{const M=await(await N(`${S}/projects`)).json();M.success&&n(M.data.projects||[])}catch(R){console.error("Error loading projects:",R)}},A=async()=>{var R;try{f(!0),m("");const M={auth_type:c.auth_type,username:c.username||void 0,password:c.password||void 0,ssh_key_content:c.ssh_key_content||void 0},U=await(await N(`${S}/git-repositories/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:c.name,url:c.url,project_id:c.project_id||void 0,credentials:M})})).json();U.success?(l(!1),u({name:"",url:"",project_id:"",auth_type:"https",username:"",password:"",ssh_key_content:""}),E()):m(((R=U.data)==null?void 0:R.error)||"Failed to add repository")}catch(M){m(`Error adding repository: ${M.message}`)}finally{f(!1)}},C=async R=>{var M;try{const U=await(await N(`${S}/git-repositories/${R}/update`,{method:"POST"})).json();U.success?E():m(((M=U.data)==null?void 0:M.error)||"Failed to update repository")}catch(B){m(`Error updating repository: ${B.message}`)}},P=async R=>{var M;if(confirm("Are you sure you want to remove this repository?"))try{const U=await(await N(`${S}/git-repositories/${R}`,{method:"DELETE"})).json();U.success?E():m(((M=U.data)==null?void 0:M.error)||"Failed to remove repository")}catch(B){m(`Error removing repository: ${B.message}`)}},$=async R=>{var M;try{const U=await(await N(`${S}/git-repositories/${R}/files`)).json();U.success?(j(U.data.structure),w(R)):m(((M=U.data)==null?void 0:M.error)||"Failed to load file structure")}catch(B){m(`Error loading files: ${B.message}`)}},O=R=>{switch(R){case"ready":return o.jsx(Sw,{className:"w-4 h-4 text-green-600"});case"cloning":return o.jsx(Ci,{className:"w-4 h-4 text-blue-600 animate-spin"});case"error":return o.jsx(Gl,{className:"w-4 h-4 text-red-600"});default:return o.jsx(Gl,{className:"w-4 h-4 text-gray-400"})}},I=R=>{switch(R){case"ready":return"bg-green-100 text-green-800";case"cloning":return"bg-blue-100 text-blue-800";case"error":return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},D=R=>{switch(R){case"ssh":return o.jsx(mp,{className:"w-4 h-4"});case"https":return o.jsx(jG,{className:"w-4 h-4"});default:return o.jsx(wG,{className:"w-4 h-4"})}};return i?o.jsx("div",{className:"p-6",children:o.jsxs("div",{className:"flex items-center justify-center py-12",children:[o.jsx(Ci,{className:"h-8 w-8 animate-spin text-blue-600"}),o.jsx("span",{className:"ml-2 text-gray-600",children:"Loading repositories..."})]})}):o.jsxs("div",{className:"p-6 space-y-6",children:[o.jsxs("div",{className:"flex justify-between items-center",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Git Repositories"}),o.jsx("p",{className:"text-gray-600 mt-2",children:"Manage git repositories for your projects with secure credential storage"})]}),o.jsxs(tC,{open:s,onOpenChange:l,children:[o.jsx(Xke,{asChild:!0,children:o.jsxs(zt,{children:[o.jsx(pg,{className:"w-4 h-4 mr-2"}),"Add Repository"]})}),o.jsxs(rC,{className:"max-w-2xl",children:[o.jsx(nC,{children:o.jsx(iC,{children:"Add Git Repository"})}),o.jsxs("div",{className:"space-y-4",children:[h&&o.jsxs(Bs,{variant:"destructive",children:[o.jsx(Gl,{className:"h-4 w-4"}),o.jsx(zs,{children:h})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx(nr,{htmlFor:"name",children:"Repository Name"}),o.jsx(wr,{id:"name",value:c.name,onChange:R=>u(M=>({...M,name:R.target.value})),placeholder:"My Project Repository"})]}),o.jsxs("div",{children:[o.jsx(nr,{htmlFor:"project",children:"Project (Optional)"}),o.jsxs(rs,{value:c.project_id,onValueChange:R=>u(M=>({...M,project_id:R})),children:[o.jsx(ns,{children:o.jsx(as,{placeholder:"Select project"})}),o.jsxs(is,{children:[o.jsx(jt,{value:"",children:"No project"}),r.map(R=>o.jsx(jt,{value:R.id,children:R.name},R.id))]})]})]})]}),o.jsxs("div",{children:[o.jsx(nr,{htmlFor:"url",children:"Repository URL"}),o.jsx(wr,{id:"url",value:c.url,onChange:R=>u(M=>({...M,url:R.target.value})),placeholder:"https://github.com/user/repo.git or git@github.com:user/repo.git"})]}),o.jsxs("div",{children:[o.jsx(nr,{htmlFor:"auth_type",children:"Authentication Type"}),o.jsxs(rs,{value:c.auth_type,onValueChange:R=>u(M=>({...M,auth_type:R})),children:[o.jsx(ns,{children:o.jsx(as,{})}),o.jsxs(is,{children:[o.jsx(jt,{value:"https",children:"HTTPS (Username/Password)"}),o.jsx(jt,{value:"ssh",children:"SSH Key"}),o.jsx(jt,{value:"token",children:"Personal Access Token"})]})]})]}),c.auth_type==="https"&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx(nr,{htmlFor:"username",children:"Username"}),o.jsx(wr,{id:"username",value:c.username,onChange:R=>u(M=>({...M,username:R.target.value})),placeholder:"Git username"})]}),o.jsxs("div",{children:[o.jsx(nr,{htmlFor:"password",children:"Password/Token"}),o.jsxs("div",{className:"relative",children:[o.jsx(wr,{id:"password",type:y?"text":"password",value:c.password,onChange:R=>u(M=>({...M,password:R.target.value})),placeholder:"Password or personal access token",className:"pr-10"}),o.jsx("button",{type:"button",onClick:()=>p(!y),className:"absolute right-3 top-3 text-gray-400 hover:text-gray-600",children:y?o.jsx(No,{className:"h-4 w-4"}):o.jsx(So,{className:"h-4 w-4"})})]})]})]})}),c.auth_type==="ssh"&&o.jsxs("div",{children:[o.jsx(nr,{htmlFor:"ssh_key",children:"SSH Private Key"}),o.jsx(_j,{id:"ssh_key",value:c.ssh_key_content,onChange:R=>u(M=>({...M,ssh_key_content:R.target.value})),placeholder:`-----BEGIN OPENSSH PRIVATE KEY----- ... -----END OPENSSH PRIVATE KEY-----`,rows:8}),o.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Paste your private SSH key content here"})]}),c.auth_type==="token"&&o.jsxs("div",{children:[o.jsx(nr,{htmlFor:"token",children:"Personal Access Token"}),o.jsxs("div",{className:"relative",children:[o.jsx(wr,{id:"token",type:y?"text":"password",value:c.password,onChange:R=>u(M=>({...M,password:R.target.value})),placeholder:"ghp_xxxxxxxxxxxxxxxxxxxx",className:"pr-10"}),o.jsx("button",{type:"button",onClick:()=>p(!y),className:"absolute right-3 top-3 text-gray-400 hover:text-gray-600",children:y?o.jsx(No,{className:"h-4 w-4"}):o.jsx(So,{className:"h-4 w-4"})})]}),o.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Generate a personal access token from your git provider"})]}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(zt,{variant:"outline",onClick:()=>l(!1),children:"Cancel"}),o.jsx(zt,{onClick:A,disabled:d||!c.name||!c.url,children:d?o.jsxs(o.Fragment,{children:[o.jsx(Ci,{className:"w-4 h-4 mr-2 animate-spin"}),"Adding..."]}):"Add Repository"})]})]})]})]})]}),h&&o.jsxs(Bs,{variant:"destructive",children:[o.jsx(Gl,{className:"h-4 w-4"}),o.jsx(zs,{children:h})]}),o.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:e.length===0?o.jsx(ti,{className:"col-span-full",children:o.jsxs(ki,{className:"text-center py-12",children:[o.jsx(mg,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),o.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"No Repositories"}),o.jsx("p",{className:"text-gray-600 mb-4",children:"Add your first git repository to start working with your codebase"}),o.jsxs(zt,{onClick:()=>l(!0),children:[o.jsx(pg,{className:"w-4 h-4 mr-2"}),"Add Repository"]})]})}):e.map(R=>o.jsxs(ti,{children:[o.jsx(nf,{children:o.jsxs("div",{className:"flex items-start justify-between",children:[o.jsxs("div",{className:"flex-1",children:[o.jsxs(af,{className:"flex items-center gap-2",children:[o.jsx(mg,{className:"w-5 h-5"}),R.name,o.jsxs(jj,{className:`ml-2 ${I(R.status)}`,children:[O(R.status),o.jsx("span",{className:"ml-1",children:R.status})]})]}),o.jsx("p",{className:"text-sm text-gray-600 mt-1",children:R.url})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[D(R.credentials.auth_type),o.jsx("span",{className:"text-xs text-gray-500",children:R.credentials.auth_type})]})]})}),o.jsx(ki,{children:o.jsxs("div",{className:"space-y-3",children:[R.commit_hash&&o.jsxs("div",{className:"text-sm",children:[o.jsx("span",{className:"font-medium",children:"Latest commit:"}),o.jsxs("div",{className:"mt-1 p-2 bg-gray-50 rounded text-xs",children:[o.jsx("div",{className:"font-mono text-gray-700",children:R.commit_hash.substring(0,8)}),R.commit_message&&o.jsx("div",{className:"text-gray-600 mt-1",children:R.commit_message})]})]}),R.error_message&&o.jsxs(Bs,{variant:"destructive",children:[o.jsx(Gl,{className:"h-4 w-4"}),o.jsx(zs,{className:"text-xs",children:R.error_message})]}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsxs(zt,{variant:"outline",size:"sm",onClick:()=>C(R.id),disabled:R.status==="cloning",children:[o.jsx(Yl,{className:"w-4 h-4 mr-1"}),"Update"]}),o.jsxs(zt,{variant:"outline",size:"sm",onClick:()=>$(R.id),disabled:R.status!=="ready",children:[o.jsx(xG,{className:"w-4 h-4 mr-1"}),"Browse"]}),o.jsxs(zt,{variant:"outline",size:"sm",onClick:()=>window.open(R.url,"_blank"),children:[o.jsx(yG,{className:"w-4 h-4 mr-1"}),"Remote"]}),o.jsxs(zt,{variant:"outline",size:"sm",onClick:()=>P(R.id),className:"text-red-600 hover:text-red-700",children:[o.jsx(I3,{className:"w-4 h-4 mr-1"}),"Remove"]})]})]})})]},R.id))}),v&&_&&o.jsx(tC,{open:!!v,onOpenChange:()=>w(null),children:o.jsxs(rC,{className:"max-w-4xl max-h-[80vh] overflow-y-auto",children:[o.jsx(nC,{children:o.jsx(iC,{children:"Repository Files"})}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"text-sm text-gray-600 mb-4",children:["Browsing: ",(L=e.find(R=>R.id===v))==null?void 0:L.name]}),o.jsx("div",{className:"border rounded p-4 bg-gray-50 font-mono text-sm",children:o.jsx("pre",{children:JSON.stringify(_,null,2)})})]})]})})]})};function Jke(){const e=()=>o.jsxs(lB,{children:[o.jsx(xt,{path:"/login",element:o.jsx(PY,{})}),o.jsx(xt,{path:"/",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(LQ,{})})})}),o.jsx(xt,{path:"/projects",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(BSe,{})})})}),o.jsx(xt,{path:"/projects/new",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(Z5,{mode:"create"})})})}),o.jsx(xt,{path:"/projects/:id",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(zSe,{})})})}),o.jsx(xt,{path:"/projects/:id/edit",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(Z5,{mode:"edit"})})})}),o.jsx(xt,{path:"/workflows",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(Hke,{})})})}),o.jsx(xt,{path:"/workflows/new",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(Kx,{})})})}),o.jsx(xt,{path:"/workflows/:id",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(Kx,{})})})}),o.jsx(xt,{path:"/workflows/:id/edit",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(Kx,{})})})}),o.jsx(xt,{path:"/workflows/templates",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(sX,{})})})}),o.jsx(xt,{path:"/cluster",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(eC,{})})})}),o.jsx(xt,{path:"/cluster/nodes",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(eC,{})})})}),o.jsx(xt,{path:"/agents",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(FQ,{})})})}),o.jsx(xt,{path:"/ai-models",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(Zke,{})})})}),o.jsx(xt,{path:"/git-repositories",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(Qke,{})})})}),o.jsx(xt,{path:"/bzzz-chat",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(qke,{})})})}),o.jsx(xt,{path:"/bzzz-team",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(Kke,{})})})}),o.jsx(xt,{path:"/executions",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(BQ,{})})})}),o.jsx(xt,{path:"/analytics",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(aNe,{})})})}),o.jsx(xt,{path:"/profile",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(L3,{})})})}),o.jsx(xt,{path:"/settings",element:o.jsx(Tt,{children:o.jsx(Ct,{children:o.jsx(TY,{})})})}),o.jsx(xt,{path:"*",element:o.jsx(sB,{to:"/",replace:!0})})]});return o.jsx(pB,{children:o.jsx(TG,{children:o.jsx(AY,{children:o.jsx(PG,{children:o.jsx(H2,{children:o.jsx(e,{})})})})})})}const eEe=new u9({defaultOptions:{queries:{retry:3,staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!1}}});Xx.createRoot(document.getElementById("root")).render(o.jsx(T.StrictMode,{children:o.jsxs(p9,{client:eEe,children:[o.jsx(Jke,{}),o.jsx(g7,{position:"top-right",toastOptions:{duration:4e3,style:{background:"#363636",color:"#fff"},success:{style:{background:"#10b981"}},error:{style:{background:"#ef4444"}}}})]})}));