- Migrated from HIVE branding to WHOOSH across all components - Enhanced backend API with new services: AI models, BZZZ integration, templates, members - Added comprehensive testing suite with security, performance, and integration tests - Improved frontend with new components for project setup, AI models, and team management - Updated MCP server implementation with WHOOSH-specific tools and resources - Enhanced deployment configurations with production-ready Docker setups - Added comprehensive documentation and setup guides - Implemented age encryption service and UCXL integration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
530 lines
1.3 MiB
530 lines
1.3 MiB
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;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>n[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<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)i[n]===void 0&&(i[n]=l[n]);return{$$typeof:Mh,type:e,key:a,ref:s,props:i,_owner:kj.current}}function ML(e,t){return{$$typeof:Mh,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ej(e){return typeof e=="object"&&e!==null&&e.$$typeof===Mh}function RL(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var TN=/\/+/g;function pv(e,t){return typeof e=="object"&&e!==null&&e.key!=null?RL(""+e.key):t.toString(36)}function Zm(e,t,r,n,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(a){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Mh:case _L:s=!0}}if(s)return s=e,i=i(s),e=n===""?"."+pv(s,0):n,CN(i)?(r="",e!=null&&(r=e.replace(TN,"$&/")+"/"),Zm(i,t,r,"",function(u){return u})):i!=null&&(Ej(i)&&(i=ML(i,r+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(TN,"$&/")+"/")+e)),t.push(i)),1;if(s=0,n=n===""?".":n+":",CN(e))for(var l=0;l<e.length;l++){a=e[l];var c=n+pv(a,l);s+=Zm(a,t,r,c,i)}else if(c=$L(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=n+pv(a,l++),s+=Zm(a,t,r,c,i);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function am(e,t,r){if(e==null)return e;var n=[],i=0;return Zm(e,n,"","",function(a){return t.call(r,a,i++)}),n}function IL(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Lr={current:null},Xm={transition:null},DL={ReactCurrentDispatcher:Lr,ReactCurrentBatchConfig:Xm,ReactCurrentOwner:kj};function NC(){throw Error("act(...) is not supported in production builds of React.")}ze.Children={map:am,forEach:function(e,t,r){am(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return am(e,function(){t++}),t},toArray:function(e){return am(e,function(t){return t})||[]},only:function(e){if(!Ej(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ze.Component=Cu;ze.Fragment=NL;ze.Profiler=kL;ze.PureComponent=Nj;ze.StrictMode=SL;ze.Suspense=PL;ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=DL;ze.act=NC;ze.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=vC({},e.props),i=e.key,a=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,s=kj.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)wC.call(t,c)&&!jC.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:Mh,type:e.type,key:i,ref:a,props:n,_owner:s}};ze.createContext=function(e){return e={$$typeof:OL,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:EL,_context:e},e.Consumer=e};ze.createElement=_C;ze.createFactory=function(e){var t=_C.bind(null,e);return t.type=e,t};ze.createRef=function(){return{current:null}};ze.forwardRef=function(e){return{$$typeof:AL,render:e}};ze.isValidElement=Ej;ze.lazy=function(e){return{$$typeof:TL,_payload:{_status:-1,_result:e},_init:IL}};ze.memo=function(e,t){return{$$typeof:CL,type:e,compare:t===void 0?null:t}};ze.startTransition=function(e){var t=Xm.transition;Xm.transition={};try{e()}finally{Xm.transition=t}};ze.unstable_act=NC;ze.useCallback=function(e,t){return Lr.current.useCallback(e,t)};ze.useContext=function(e){return Lr.current.useContext(e)};ze.useDebugValue=function(){};ze.useDeferredValue=function(e){return Lr.current.useDeferredValue(e)};ze.useEffect=function(e,t){return Lr.current.useEffect(e,t)};ze.useId=function(){return Lr.current.useId()};ze.useImperativeHandle=function(e,t,r){return Lr.current.useImperativeHandle(e,t,r)};ze.useInsertionEffect=function(e,t){return Lr.current.useInsertionEffect(e,t)};ze.useLayoutEffect=function(e,t){return Lr.current.useLayoutEffect(e,t)};ze.useMemo=function(e,t){return Lr.current.useMemo(e,t)};ze.useReducer=function(e,t,r){return Lr.current.useReducer(e,t,r)};ze.useRef=function(e){return Lr.current.useRef(e)};ze.useState=function(e){return Lr.current.useState(e)};ze.useSyncExternalStore=function(e,t,r){return Lr.current.useSyncExternalStore(e,t,r)};ze.useTransition=function(){return Lr.current.useTransition()};ze.version="18.3.1";gC.exports=ze;var b=gC.exports;const T=Xe(b),Zx=jL({__proto__:null,default:T},[b]);/**
|
||
* @license React
|
||
* react-jsx-runtime.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 LL=b,FL=Symbol.for("react.element"),BL=Symbol.for("react.fragment"),zL=Object.prototype.hasOwnProperty,UL=LL.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,WL={key:!0,ref:!0,__self:!0,__source:!0};function SC(e,t,r){var n,i={},a=null,s=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(s=t.ref);for(n in t)zL.call(t,n)&&!WL.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:FL,type:e,key:a,ref:s,props:i,_owner:UL.current}}Ay.Fragment=BL;Ay.jsx=SC;Ay.jsxs=SC;pC.exports=Ay;var o=pC.exports,Xx={},kC={exports:{}},yn={},EC={exports:{}},OC={};/**
|
||
* @license React
|
||
* scheduler.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.
|
||
*/(function(e){function t(R,M){var B=R.length;R.push(M);e:for(;0<B;){var U=B-1>>>1,W=R[U];if(0<i(W,M))R[U]=M,R[B]=W,B=U;else break e}}function r(R){return R.length===0?null:R[0]}function n(R){if(R.length===0)return null;var M=R[0],B=R.pop();if(B!==M){R[0]=B;e:for(var U=0,W=R.length,Z=W>>>1;U<Z;){var q=2*(U+1)-1,ee=R[q],le=q+1,ve=R[le];if(0>i(ee,B))le<W&&0>i(ve,ee)?(R[U]=ve,R[le]=B,U=le):(R[U]=ee,R[q]=B,U=q);else if(le<W&&0>i(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()-A<k)}function P(){if(S!==null){var R=e.unstable_now();A=R;var M=!0;try{M=S(!0,R)}finally{M?$():(N=!1,S=null)}}else N=!1}var $;if(typeof v=="function")$=function(){v(P)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,I=O.port2;O.port1.onmessage=P,$=function(){I.postMessage(null)}}else $=function(){x(P,0)};function D(R){S=R,N||(N=!0,$())}function L(R,M){E=x(function(){R(e.unstable_now())},M)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_continueExecution=function(){y||m||(y=!0,D(j))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(R){switch(h){case 1:case 2:case 3:var M=3;break;default:M=h}var B=h;h=M;try{return R()}finally{h=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,M){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var B=h;h=R;try{return M()}finally{h=B}},e.unstable_scheduleCallback=function(R,M,B){var U=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?U+B:U):B=U,R){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=B+W,R={id:d++,callback:M,priorityLevel:R,startTime:B,expirationTime:W,sortIndex:-1},B>U?(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<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var AC=new Set,gf={};function El(e,t){zc(e,t),zc(e+"Capture",t)}function zc(e,t){for(gf[e]=t,e=0;e<t.length;e++)AC.add(t[e])}var va=!(typeof window>"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||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(YL(t,r,i,n)&&(r=null),n||i===null?KL(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=r===null?i.type===3?!1:"":r:(t=i.attributeName,n=i.attributeNamespace,r===null?e.removeAttribute(t):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Ta=HL.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,sm=Symbol.for("react.element"),Xl=Symbol.for("react.portal"),Ql=Symbol.for("react.fragment"),Cj=Symbol.for("react.strict_mode"),Jx=Symbol.for("react.profiler"),PC=Symbol.for("react.provider"),CC=Symbol.for("react.context"),Tj=Symbol.for("react.forward_ref"),eb=Symbol.for("react.suspense"),tb=Symbol.for("react.suspense_list"),$j=Symbol.for("react.memo"),Ka=Symbol.for("react.lazy"),TC=Symbol.for("react.offscreen"),RN=Symbol.iterator;function ed(e){return e===null||typeof e!="object"?null:(e=RN&&e[RN]||e["@@iterator"],typeof e=="function"?e:null)}var St=Object.assign,gv;function Td(e){if(gv===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);gv=t&&t[1]||""}return`
|
||
`+gv+e}var yv=!1;function vv(e,t){if(!e||yv)return"";yv=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var i=u.stack.split(`
|
||
`),a=n.stack.split(`
|
||
`),s=i.length-1,l=a.length-1;1<=s&&0<=l&&i[s]!==a[l];)l--;for(;1<=s&&0<=l;s--,l--)if(i[s]!==a[l]){if(s!==1||l!==1)do if(s--,l--,0>l||i[s]!==a[l]){var c=`
|
||
`+i[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",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<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Hs(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function sb(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ne(91));return St({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function LN(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(ne(92));if($d(r)){if(1<r.length)throw Error(ne(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Hs(r)}}function IC(e,t){var r=Hs(t.value),n=Hs(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function FN(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function DC(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ob(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?DC(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var lm,LC=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(lm=lm||document.createElement("div"),lm.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",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<t.length;e++)BN(t[e])}}function WC(e,t){return e(t)}function VC(){}var xv=!1;function HC(e,t,r){if(xv)return e(t,r);xv=!0;try{return WC(e,t,r)}finally{xv=!1,(yc!==null||vc!==null)&&(VC(),UC())}}function vf(e,t){var r=e.stateNode;if(r===null)return null;var n=My(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(ne(231,t,typeof r));return r}var fb=!1;if(va)try{var td={};Object.defineProperty(td,"passive",{get:function(){fb=!0}}),window.addEventListener("test",td,td),window.removeEventListener("test",td,td)}catch{fb=!1}function t8(e,t,r,n,i,a,s,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(d){this.onError(d)}}var Gd=!1,kp=null,Ep=!1,hb=null,r8={onError:function(e){Gd=!0,kp=e}};function n8(e,t,r,n,i,a,s,l,c){Gd=!1,kp=null,t8.apply(r8,arguments)}function i8(e,t,r,n,i,a,s,l,c){if(n8.apply(this,arguments),Gd){if(Gd){var u=kp;Gd=!1,kp=null}else throw Error(ne(198));Ep||(Ep=!0,hb=u)}}function Ol(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function qC(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function zN(e){if(Ol(e)!==e)throw Error(ne(188))}function a8(e){var t=e.alternate;if(!t){if(t=Ol(e),t===null)throw Error(ne(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var a=i.alternate;if(a===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return zN(i),e;if(a===n)return zN(i),t;a=a.sibling}throw Error(ne(188))}if(r.return!==n.return)r=i,n=a;else{for(var s=!1,l=i.child;l;){if(l===r){s=!0,r=i,n=a;break}if(l===n){s=!0,n=i,r=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===r){s=!0,r=a,n=i;break}if(l===n){s=!0,n=a,r=i;break}l=l.sibling}if(!s)throw Error(ne(189))}}if(r.alternate!==n)throw Error(ne(190))}if(r.tag!==3)throw Error(ne(188));return r.stateNode.current===r?e:t}function KC(e){return e=a8(e),e!==null?GC(e):null}function GC(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=GC(e);if(t!==null)return t;e=e.sibling}return null}var YC=mn.unstable_scheduleCallback,UN=mn.unstable_cancelCallback,s8=mn.unstable_shouldYield,o8=mn.unstable_requestPaint,$t=mn.unstable_now,l8=mn.unstable_getCurrentPriorityLevel,Rj=mn.unstable_ImmediatePriority,ZC=mn.unstable_UserBlockingPriority,Op=mn.unstable_NormalPriority,c8=mn.unstable_LowPriority,XC=mn.unstable_IdlePriority,Py=null,Ii=null;function u8(e){if(Ii&&typeof Ii.onCommitFiberRoot=="function")try{Ii.onCommitFiberRoot(Py,e,void 0,(e.current.flags&128)===128)}catch{}}var di=Math.clz32?Math.clz32:h8,d8=Math.log,f8=Math.LN2;function h8(e){return 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;0<t;)r=31-di(t),i=1<<r,n|=e[r],t&=~i;return n}function m8(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function p8(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var s=31-di(a),l=1<<s,c=i[s];c===-1?(!(l&r)||l&n)&&(i[s]=m8(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function mb(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function QC(){var e=cm;return cm<<=1,!(cm&4194240)&&(cm=64),e}function bv(e){for(var t=[],r=0;31>r;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<r;){var i=31-di(r),a=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~a}}function Ij(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-di(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var et=0;function JC(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var eT,Dj,tT,rT,nT,pb=!1,dm=[],ks=null,Es=null,Os=null,xf=new Map,bf=new Map,Qa=[],y8="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function WN(e,t){switch(e){case"focusin":case"focusout":ks=null;break;case"dragenter":case"dragleave":Es=null;break;case"mouseover":case"mouseout":Os=null;break;case"pointerover":case"pointerout":xf.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":bf.delete(t.pointerId)}}function rd(e,t,r,n,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Dh(t),t!==null&&Dj(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function v8(e,t,r,n,i){switch(t){case"focusin":return ks=rd(ks,e,t,r,n,i),!0;case"dragenter":return Es=rd(Es,e,t,r,n,i),!0;case"mouseover":return Os=rd(Os,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return xf.set(a,rd(xf.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,bf.set(a,rd(bf.get(a)||null,e,t,r,n,i)),!0}return!1}function iT(e){var t=Eo(e.target);if(t!==null){var r=Ol(t);if(r!==null){if(t=r.tag,t===13){if(t=qC(r),t!==null){e.blockedOn=t,nT(e.priority,function(){tT(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Qm(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=gb(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);ub=n,r.target.dispatchEvent(n),ub=null}else return t=Dh(r),t!==null&&Dj(t),e.blockedOn=r,!1;t.shift()}return!0}function VN(e,t,r){Qm(e)&&r.delete(t)}function x8(){pb=!1,ks!==null&&Qm(ks)&&(ks=null),Es!==null&&Qm(Es)&&(Es=null),Os!==null&&Qm(Os)&&(Os=null),xf.forEach(VN),bf.forEach(VN)}function nd(e,t){e.blockedOn===t&&(e.blockedOn=null,pb||(pb=!0,mn.unstable_scheduleCallback(mn.unstable_NormalPriority,x8)))}function wf(e){function t(i){return nd(i,e)}if(0<dm.length){nd(dm[0],e);for(var r=1;r<dm.length;r++){var n=dm[r];n.blockedOn===e&&(n.blockedOn=null)}}for(ks!==null&&nd(ks,e),Es!==null&&nd(Es,e),Os!==null&&nd(Os,e),xf.forEach(t),bf.forEach(t),r=0;r<Qa.length;r++)n=Qa[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Qa.length&&(r=Qa[0],r.blockedOn===null);)iT(r),r.blockedOn===null&&Qa.shift()}var xc=Ta.ReactCurrentBatchConfig,Pp=!0;function b8(e,t,r,n){var i=et,a=xc.transition;xc.transition=null;try{et=1,Lj(e,t,r,n)}finally{et=i,xc.transition=a}}function w8(e,t,r,n){var i=et,a=xc.transition;xc.transition=null;try{et=4,Lj(e,t,r,n)}finally{et=i,xc.transition=a}}function Lj(e,t,r,n){if(Pp){var i=gb(e,t,r,n);if(i===null)Pv(e,t,n,Cp,r),WN(e,n);else if(v8(i,e,t,r,n))n.stopPropagation();else if(WN(e,n),t&4&&-1<y8.indexOf(e)){for(;i!==null;){var a=Dh(i);if(a!==null&&eT(a),a=gb(e,t,r,n),a===null&&Pv(e,t,n,Cp,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else Pv(e,t,n,null,r)}}var Cp=null;function gb(e,t,r,n){if(Cp=null,e=Mj(n),e=Eo(e),e!==null)if(t=Ol(e),t===null)e=null;else if(r=t.tag,r===13){if(e=qC(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Cp=e,null}function aT(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(l8()){case Rj:return 1;case ZC:return 4;case Op:case c8:return 16;case XC:return 536870912;default:return 16}default:return 16}}var vs=null,Fj=null,Jm=null;function sT(){if(Jm)return Jm;var e,t=Fj,r=t.length,n,i="value"in vs?vs.value:vs.textContent,a=i.length;for(e=0;e<r&&t[e]===i[e];e++);var s=r-e;for(n=1;n<=s&&t[r-n]===i[a-n];n++);return Jm=i.slice(e,1<n?1-n:void 0)}function ep(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function fm(){return!0}function HN(){return!1}function vn(e){function t(r,n,i,a,s){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=a,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?fm:HN,this.isPropagationStopped=HN,this}return St(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=fm)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=fm)},persist:function(){},isPersistent:fm}),t}var Tu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bj=vn(Tu),Ih=St({},Tu,{view:0,detail:0}),j8=vn(Ih),wv,jv,id,Cy=St({},Ih,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zj,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==id&&(id&&e.type==="mousemove"?(wv=e.screenX-id.screenX,jv=e.screenY-id.screenY):jv=wv=0,id=e),wv)},movementY:function(e){return"movementY"in e?e.movementY:jv}}),qN=vn(Cy),_8=St({},Cy,{dataTransfer:0}),N8=vn(_8),S8=St({},Ih,{relatedTarget:0}),_v=vn(S8),k8=St({},Tu,{animationName:0,elapsedTime:0,pseudoElement:0}),E8=vn(k8),O8=St({},Tu,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),A8=vn(O8),P8=St({},Tu,{data:0}),KN=vn(P8),C8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},T8={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},$8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function M8(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$8[e])?!!t[e]:!1}function zj(){return M8}var R8=St({},Ih,{key:function(e){if(e.key){var t=C8[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ep(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?T8[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zj,charCode:function(e){return e.type==="keypress"?ep(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ep(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),I8=vn(R8),D8=St({},Cy,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),GN=vn(D8),L8=St({},Ih,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zj}),F8=vn(L8),B8=St({},Tu,{propertyName:0,elapsedTime:0,pseudoElement:0}),z8=vn(B8),U8=St({},Cy,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),W8=vn(U8),V8=[9,13,27,32],Uj=va&&"CompositionEvent"in window,Yd=null;va&&"documentMode"in document&&(Yd=document.documentMode);var H8=va&&"TextEvent"in window&&!Yd,oT=va&&(!Uj||Yd&&8<Yd&&11>=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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return oT&&t.locale!=="ko"?null:t.data;default:return null}}var G8={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function XN(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!G8[e.type]:t==="textarea"}function uT(e,t,r,n){zC(n),t=Tp(t,"onChange"),0<t.length&&(r=new Bj("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Zd=null,jf=null;function Y8(e){wT(e,0)}function Ty(e){var t=rc(e);if(MC(t))return e}function Z8(e,t){if(e==="change")return t}var dT=!1;if(va){var Nv;if(va){var Sv="oninput"in document;if(!Sv){var QN=document.createElement("div");QN.setAttribute("oninput","return;"),Sv=typeof QN.oninput=="function"}Nv=Sv}else Nv=!1;dT=Nv&&(!document.documentMode||9<document.documentMode)}function JN(){Zd&&(Zd.detachEvent("onpropertychange",fT),jf=Zd=null)}function fT(e){if(e.propertyName==="value"&&Ty(jf)){var t=[];uT(t,jf,e,Mj(e)),HC(Y8,t)}}function X8(e,t,r){e==="focusin"?(JN(),Zd=t,jf=r,Zd.attachEvent("onpropertychange",fT)):e==="focusout"&&JN()}function Q8(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ty(jf)}function J8(e,t){if(e==="click")return Ty(t)}function eF(e,t){if(e==="input"||e==="change")return Ty(t)}function tF(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pi=typeof Object.is=="function"?Object.is:tF;function _f(e,t){if(pi(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!Qx.call(t,i)||!pi(e[i],t[i]))return!1}return!0}function eS(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tS(e,t){var r=eS(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=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<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var nF=va&&"documentMode"in document&&11>=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"),0<n.length&&(t=new Bj("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=ec)))}function hm(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var tc={animationend:hm("Animation","AnimationEnd"),animationiteration:hm("Animation","AnimationIteration"),animationstart:hm("Animation","AnimationStart"),transitionend:hm("Transition","TransitionEnd")},kv={},pT={};va&&(pT=document.createElement("div").style,"AnimationEvent"in window||(delete tc.animationend.animation,delete tc.animationiteration.animation,delete tc.animationstart.animation),"TransitionEvent"in window||delete tc.transitionend.transition);function $y(e){if(kv[e])return kv[e];if(!tc[e])return e;var t=tc[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in pT)return kv[e]=t[r];return e}var gT=$y("animationend"),yT=$y("animationiteration"),vT=$y("animationstart"),xT=$y("transitionend"),bT=new Map,nS="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ys(e,t){bT.set(e,t),El(t,[e])}for(var Ev=0;Ev<nS.length;Ev++){var Ov=nS[Ev],iF=Ov.toLowerCase(),aF=Ov[0].toUpperCase()+Ov.slice(1);Ys(iF,"on"+aF)}Ys(gT,"onAnimationEnd");Ys(yT,"onAnimationIteration");Ys(vT,"onAnimationStart");Ys("dblclick","onDoubleClick");Ys("focusin","onFocus");Ys("focusout","onBlur");Ys(xT,"onTransitionEnd");zc("onMouseEnter",["mouseout","mouseover"]);zc("onMouseLeave",["mouseout","mouseover"]);zc("onPointerEnter",["pointerout","pointerover"]);zc("onPointerLeave",["pointerout","pointerover"]);El("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));El("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));El("onBeforeInput",["compositionend","keypress","textInput","paste"]);El("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));El("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));El("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rd="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),sF=new Set("cancel close invalid load scroll toggle".split(" ").concat(Rd));function iS(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,i8(n,t,void 0,e),e.currentTarget=null}function wT(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var s=n.length-1;0<=s;s--){var l=n[s],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&i.isPropagationStopped())break e;iS(i,l,u),a=c}else for(s=0;s<n.length;s++){if(l=n[s],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&i.isPropagationStopped())break e;iS(i,l,u),a=c}}}if(Ep)throw e=hb,Ep=!1,hb=null,e}function mt(e,t){var r=t[_b];r===void 0&&(r=t[_b]=new Set);var n=e+"__bubble";r.has(n)||(jT(t,e,2,!1),r.add(n))}function Av(e,t,r){var n=0;t&&(n|=4),jT(r,e,n,t)}var mm="_reactListening"+Math.random().toString(36).slice(2);function Nf(e){if(!e[mm]){e[mm]=!0,AC.forEach(function(r){r!=="selectionchange"&&(sF.has(r)||Av(r,!1,e),Av(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[mm]||(t[mm]=!0,Av("selectionchange",!1,t))}}function jT(e,t,r,n){switch(aT(t)){case 1:var i=b8;break;case 4:i=w8;break;default:i=Lj}r=i.bind(null,t,r,e),i=void 0,!fb||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function Pv(e,t,r,n,i){var a=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var s=n.tag;if(s===3||s===4){var l=n.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(s===4)for(s=n.return;s!==null;){var c=s.tag;if((c===3||c===4)&&(c=s.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;s=s.return}for(;l!==null;){if(s=Eo(l),s===null)return;if(c=s.tag,c===5||c===6){n=a=s;continue e}l=l.parentNode}}n=n.return}HC(function(){var u=a,d=Mj(r),f=[];e:{var h=bT.get(e);if(h!==void 0){var m=Bj,y=e;switch(e){case"keypress":if(ep(r)===0)break e;case"keydown":case"keyup":m=I8;break;case"focusin":y="focus",m=_v;break;case"focusout":y="blur",m=_v;break;case"beforeblur":case"afterblur":m=_v;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=qN;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=N8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=F8;break;case gT:case yT:case vT:m=E8;break;case xT:m=z8;break;case"scroll":m=j8;break;case"wheel":m=W8;break;case"copy":case"cut":case"paste":m=A8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=GN}var p=(t&4)!==0,x=!p&&e==="scroll",g=p?h!==null?h+"Capture":null:h;p=[];for(var v=u,w;v!==null;){w=v;var _=w.stateNode;if(w.tag===5&&_!==null&&(w=_,g!==null&&(_=vf(v,g),_!=null&&p.push(Sf(v,_,w)))),x)break;v=v.return}0<p.length&&(h=new m(h,y,null,r,d),f.push({event:h,listeners:p}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&r!==ub&&(y=r.relatedTarget||r.fromElement)&&(Eo(y)||y[xa]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(y=r.relatedTarget||r.toElement,m=u,y=y?Eo(y):null,y!==null&&(x=Ol(y),y!==x||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=u),m!==y)){if(p=qN,_="onMouseLeave",g="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(p=GN,_="onPointerLeave",g="onPointerEnter",v="pointer"),x=m==null?h:rc(m),w=y==null?h:rc(y),h=new p(_,v+"leave",m,r,d),h.target=x,h.relatedTarget=w,_=null,Eo(d)===u&&(p=new p(g,v+"enter",y,r,d),p.target=w,p.relatedTarget=x,_=p),x=_,m&&y)t:{for(p=m,g=y,v=0,w=p;w;w=Il(w))v++;for(w=0,_=g;_;_=Il(_))w++;for(;0<v-w;)p=Il(p),v--;for(;0<w-v;)g=Il(g),w--;for(;v--;){if(p===g||g!==null&&p===g.alternate)break t;p=Il(p),g=Il(g)}p=null}else p=null;m!==null&&aS(f,h,m,p,!1),y!==null&&x!==null&&aS(f,x,y,p,!0)}}e:{if(h=u?rc(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var j=Z8;else if(XN(h))if(dT)j=eF;else{j=Q8;var N=X8}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=J8);if(j&&(j=j(e,u))){uT(f,j,r,d);break e}N&&N(e,h,u),e==="focusout"&&(N=h._wrapperState)&&N.controlled&&h.type==="number"&&ab(h,"number",h.value)}switch(N=u?rc(u):window,e){case"focusin":(XN(N)||N.contentEditable==="true")&&(ec=N,yb=u,Xd=null);break;case"focusout":Xd=yb=ec=null;break;case"mousedown":vb=!0;break;case"contextmenu":case"mouseup":case"dragend":vb=!1,rS(f,r,d);break;case"selectionchange":if(nF)break;case"keydown":case"keyup":rS(f,r,d)}var S;if(Uj)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Jl?lT(e,r)&&(E="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(E="onCompositionStart");E&&(oT&&r.locale!=="ko"&&(Jl||E!=="onCompositionStart"?E==="onCompositionEnd"&&Jl&&(S=sT()):(vs=d,Fj="value"in vs?vs.value:vs.textContent,Jl=!0)),N=Tp(u,E),0<N.length&&(E=new KN(E,e,null,r,d),f.push({event:E,listeners:N}),S?E.data=S:(S=cT(r),S!==null&&(E.data=S)))),(S=H8?q8(e,r):K8(e,r))&&(u=Tp(u,"onBeforeInput"),0<u.length&&(d=new KN("onBeforeInput","beforeinput",null,r,d),f.push({event:d,listeners:u}),d.data=S))}wT(f,t)})}function Sf(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Tp(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=vf(e,r),a!=null&&n.unshift(Sf(e,a,i)),a=vf(e,t),a!=null&&n.push(Sf(e,a,i))),e=e.return}return n}function Il(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function aS(e,t,r,n,i){for(var a=t._reactName,s=[];r!==null&&r!==n;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&u!==null&&(l=u,i?(c=vf(r,a),c!=null&&s.unshift(Sf(r,c,l))):i||(c=vf(r,a),c!=null&&s.push(Sf(r,c,l)))),r=r.return}s.length!==0&&e.push({event:t,listeners:s})}var oF=/\r\n?/g,lF=/\u0000|\uFFFD/g;function sS(e){return(typeof e=="string"?e:""+e).replace(oF,`
|
||
`).replace(lF,"")}function pm(e,t,r){if(t=sS(t),sS(e)!==t&&r)throw Error(ne(425))}function $p(){}var xb=null,bb=null;function wb(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var jb=typeof setTimeout=="function"?setTimeout:void 0,cF=typeof clearTimeout=="function"?clearTimeout:void 0,oS=typeof Promise=="function"?Promise:void 0,uF=typeof queueMicrotask=="function"?queueMicrotask:typeof oS<"u"?function(e){return oS.resolve(null).then(e).catch(dF)}:jb;function dF(e){setTimeout(function(){throw e})}function Cv(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),wf(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);wf(t)}function As(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function lS(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var $u=Math.random().toString(36).slice(2),Ti="__reactFiber$"+$u,kf="__reactProps$"+$u,xa="__reactContainer$"+$u,_b="__reactEvents$"+$u,fF="__reactListeners$"+$u,hF="__reactHandles$"+$u;function Eo(e){var t=e[Ti];if(t)return t;for(var r=e.parentNode;r;){if(t=r[xa]||r[Ti]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=lS(e);e!==null;){if(r=e[Ti])return r;e=lS(e)}return t}e=r,r=e.parentNode}return null}function Dh(e){return e=e[Ti]||e[xa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function rc(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ne(33))}function My(e){return e[kf]||null}var Nb=[],nc=-1;function Zs(e){return{current:e}}function yt(e){0>nc||(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<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}ra=null,Ry=!1}catch(i){throw ra!==null&&(ra=ra.slice(e+1)),YC(Rj,Xs),i}finally{et=t,Tv=!1}}return null}var ic=[],ac=0,Ip=null,Dp=0,En=[],On=0,al=null,aa=1,sa="";function po(e,t){ic[ac++]=Dp,ic[ac++]=Ip,Ip=e,Dp=t}function ST(e,t,r){En[On++]=aa,En[On++]=sa,En[On++]=al,al=e;var n=aa;e=sa;var i=32-di(n)-1;n&=~(1<<i),r+=1;var a=32-di(t)+i;if(30<a){var s=i-i%5;a=(n&(1<<s)-1).toString(32),n>>=s,i-=s,aa=1<<32-di(t)+i|r<<i|n,sa=a+e}else aa=1<<a|r<<i|n,sa=e}function Vj(e){e.return!==null&&(po(e,1),ST(e,1,0))}function Hj(e){for(;e===Ip;)Ip=ic[--ac],ic[ac]=null,Dp=ic[--ac],ic[ac]=null;for(;e===al;)al=En[--On],En[On]=null,sa=En[--On],En[On]=null,aa=En[--On],En[On]=null}var un=null,cn=null,bt=!1,ii=null;function kT(e,t){var r=Tn(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function dS(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,un=e,cn=As(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,un=e,cn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=al!==null?{id:aa,overflow:sa}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Tn(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,un=e,cn=null,!0):!1;default:return!1}}function Sb(e){return(e.mode&1)!==0&&(e.flags&128)===0}function kb(e){if(bt){var t=cn;if(t){var r=t;if(!dS(e,t)){if(Sb(e))throw Error(ne(418));t=As(r.nextSibling);var n=un;t&&dS(e,t)?kT(n,r):(e.flags=e.flags&-4097|2,bt=!1,un=e)}}else{if(Sb(e))throw Error(ne(418));e.flags=e.flags&-4097|2,bt=!1,un=e}}}function fS(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;un=e}function gm(e){if(e!==un)return!1;if(!bt)return fS(e),bt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!wb(e.type,e.memoizedProps)),t&&(t=cn)){if(Sb(e))throw ET(),Error(ne(418));for(;t;)kT(e,t),t=As(t.nextSibling)}if(fS(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ne(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){cn=As(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}cn=null}}else cn=un?As(e.stateNode.nextSibling):null;return!0}function ET(){for(var e=cn;e;)e=As(e.nextSibling)}function Wc(){cn=un=null,bt=!1}function qj(e){ii===null?ii=[e]:ii.push(e)}var pF=Ta.ReactCurrentBatchConfig;function ad(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(ne(309));var n=r.stateNode}if(!n)throw Error(ne(147,e));var i=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(s){var l=i.refs;s===null?delete l[a]:l[a]=s},t._stringRef=a,t)}if(typeof e!="string")throw Error(ne(284));if(!r._owner)throw Error(ne(290,e))}return e}function ym(e,t){throw e=Object.prototype.toString.call(t),Error(ne(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function hS(e){var t=e._init;return t(e._payload)}function OT(e){function t(g,v){if(e){var w=g.deletions;w===null?(g.deletions=[v],g.flags|=16):w.push(v)}}function r(g,v){if(!e)return null;for(;v!==null;)t(g,v),v=v.sibling;return null}function n(g,v){for(g=new Map;v!==null;)v.key!==null?g.set(v.key,v):g.set(v.index,v),v=v.sibling;return g}function i(g,v){return g=$s(g,v),g.index=0,g.sibling=null,g}function a(g,v,w){return g.index=w,e?(w=g.alternate,w!==null?(w=w.index,w<v?(g.flags|=2,v):w):(g.flags|=2,v)):(g.flags|=1048576,v)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,v,w,_){return v===null||v.tag!==6?(v=Fv(w,g.mode,_),v.return=g,v):(v=i(v,w),v.return=g,v)}function c(g,v,w,_){var j=w.type;return j===Ql?d(g,v,w.props.children,_,w.key):v!==null&&(v.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Ka&&hS(j)===v.type)?(_=i(v,w.props),_.ref=ad(g,v,w),_.return=g,_):(_=op(w.type,w.key,w.props,null,g.mode,_),_.ref=ad(g,v,w),_.return=g,_)}function u(g,v,w,_){return v===null||v.tag!==4||v.stateNode.containerInfo!==w.containerInfo||v.stateNode.implementation!==w.implementation?(v=Bv(w,g.mode,_),v.return=g,v):(v=i(v,w.children||[]),v.return=g,v)}function d(g,v,w,_,j){return v===null||v.tag!==7?(v=Zo(w,g.mode,_,j),v.return=g,v):(v=i(v,w),v.return=g,v)}function f(g,v,w){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Fv(""+v,g.mode,w),v.return=g,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case sm:return w=op(v.type,v.key,v.props,null,g.mode,w),w.ref=ad(g,null,v),w.return=g,w;case Xl:return v=Bv(v,g.mode,w),v.return=g,v;case Ka:var _=v._init;return f(g,_(v._payload),w)}if($d(v)||ed(v))return v=Zo(v,g.mode,w,null),v.return=g,v;ym(g,v)}return null}function h(g,v,w,_){var j=v!==null?v.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return j!==null?null:l(g,v,""+w,_);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case sm:return w.key===j?c(g,v,w,_):null;case Xl:return w.key===j?u(g,v,w,_):null;case Ka:return j=w._init,h(g,v,j(w._payload),_)}if($d(w)||ed(w))return j!==null?null:d(g,v,w,_,null);ym(g,w)}return null}function m(g,v,w,_,j){if(typeof _=="string"&&_!==""||typeof _=="number")return g=g.get(w)||null,l(v,g,""+_,j);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case sm:return g=g.get(_.key===null?w:_.key)||null,c(v,g,_,j);case Xl:return g=g.get(_.key===null?w:_.key)||null,u(v,g,_,j);case Ka:var N=_._init;return m(g,v,w,N(_._payload),j)}if($d(_)||ed(_))return g=g.get(w)||null,d(v,g,_,j,null);ym(v,_)}return null}function y(g,v,w,_){for(var j=null,N=null,S=v,E=v=0,k=null;S!==null&&E<w.length;E++){S.index>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(;E<w.length;E++)S=f(g,w[E],_),S!==null&&(v=a(S,v,E),N===null?j=S:N.sibling=S,N=S);return bt&&po(g,E),j}for(S=n(g,S);E<w.length;E++)k=m(S,g,E,w[E],_),k!==null&&(e&&k.alternate!==null&&S.delete(k.key===null?E:k.key),v=a(k,v,E),N===null?j=k:N.sibling=k,N=k);return e&&S.forEach(function(C){return t(g,C)}),bt&&po(g,E),j}function p(g,v,w,_){var j=ed(w);if(typeof j!="function")throw Error(ne(150));if(w=j.call(w),w==null)throw Error(ne(151));for(var N=j=null,S=v,E=v=0,k=null,A=w.next();S!==null&&!A.done;E++,A=w.next()){S.index>E?(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;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(ne(191,i));i.call(n)}}}var Lh={},Di=Zs(Lh),Ef=Zs(Lh),Of=Zs(Lh);function Ao(e){if(e===Lh)throw Error(ne(174));return e}function Qj(e,t){switch(ct(Of,t),ct(Ef,e),ct(Di,Lh),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ob(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ob(t,e)}yt(Di),ct(Di,t)}function Hc(){yt(Di),yt(Ef),yt(Of)}function TT(e){Ao(Of.current);var t=Ao(Di.current),r=ob(t,e.type);t!==r&&(ct(Ef,e),ct(Di,r))}function Jj(e){Ef.current===e&&(yt(Di),yt(Ef))}var _t=Zs(0);function zp(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var $v=[];function e2(){for(var e=0;e<$v.length;e++)$v[e]._workInProgressVersionPrimary=null;$v.length=0}var rp=Ta.ReactCurrentDispatcher,Mv=Ta.ReactCurrentBatchConfig,sl=0,Nt=null,Yt=null,ar=null,Up=!1,Qd=!1,Af=0,gF=0;function yr(){throw Error(ne(321))}function t2(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!pi(e[r],t[r]))return!1;return!0}function r2(e,t,r,n,i,a){if(sl=a,Nt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,rp.current=e===null||e.memoizedState===null?bF:wF,e=r(n,i),Qd){a=0;do{if(Qd=!1,Af=0,25<=a)throw Error(ne(301));a+=1,ar=Yt=null,t.updateQueue=null,rp.current=jF,e=r(n,i)}while(Qd)}if(rp.current=Wp,t=Yt!==null&&Yt.next!==null,sl=0,ar=Yt=Nt=null,Up=!1,t)throw Error(ne(300));return e}function n2(){var e=Af!==0;return Af=0,e}function Ni(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ar===null?Nt.memoizedState=ar=e:ar=ar.next=e,ar}function Fn(){if(Yt===null){var e=Nt.alternate;e=e!==null?e.memoizedState:null}else e=Yt.next;var t=ar===null?Nt.memoizedState:ar.next;if(t!==null)ar=t,Yt=e;else{if(e===null)throw Error(ne(310));Yt=e,e={memoizedState:Yt.memoizedState,baseState:Yt.baseState,baseQueue:Yt.baseQueue,queue:Yt.queue,next:null},ar===null?Nt.memoizedState=ar=e:ar=ar.next=e}return ar}function Pf(e,t){return typeof t=="function"?t(e):t}function Rv(e){var t=Fn(),r=t.queue;if(r===null)throw Error(ne(311));r.lastRenderedReducer=e;var n=Yt,i=n.baseQueue,a=r.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}n.baseQueue=i=a,r.pending=null}if(i!==null){a=i.next,n=n.baseState;var l=s=null,c=null,u=a;do{var d=u.lane;if((sl&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,s=n):c=c.next=f,Nt.lanes|=d,ol|=d}u=u.next}while(u!==null&&u!==a);c===null?s=n:c.next=l,pi(n,t.memoizedState)||(Hr=!0),t.memoizedState=n,t.baseState=s,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){i=e;do a=i.lane,Nt.lanes|=a,ol|=a,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Iv(e){var t=Fn(),r=t.queue;if(r===null)throw Error(ne(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(i!==null){r.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);pi(a,t.memoizedState)||(Hr=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function $T(){}function MT(e,t){var r=Nt,n=Fn(),i=t(),a=!pi(n.memoizedState,i);if(a&&(n.memoizedState=i,Hr=!0),n=n.queue,i2(DT.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||ar!==null&&ar.memoizedState.tag&1){if(r.flags|=2048,Cf(9,IT.bind(null,r,n,i,t),void 0,null),lr===null)throw Error(ne(349));sl&30||RT(r,t,i)}return i}function RT(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Nt.updateQueue,t===null?(t={lastEffect:null,stores:null},Nt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function IT(e,t,r,n){t.value=r,t.getSnapshot=n,LT(t)&&FT(e)}function DT(e,t,r){return r(function(){LT(t)&&FT(e)})}function LT(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!pi(e,r)}catch{return!0}}function FT(e){var t=ba(e,1);t!==null&&fi(t,e,1,-1)}function gS(e){var t=Ni();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Pf,lastRenderedState:e},t.queue=e,e=e.dispatch=xF.bind(null,Nt,e),[t.memoizedState,e]}function Cf(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Nt.updateQueue,t===null?(t={lastEffect:null,stores:null},Nt.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function BT(){return Fn().memoizedState}function np(e,t,r,n){var i=Ni();Nt.flags|=e,i.memoizedState=Cf(1|t,r,void 0,n===void 0?null:n)}function Iy(e,t,r,n){var i=Fn();n=n===void 0?null:n;var a=void 0;if(Yt!==null){var s=Yt.memoizedState;if(a=s.destroy,n!==null&&t2(n,s.deps)){i.memoizedState=Cf(t,r,a,n);return}}Nt.flags|=e,i.memoizedState=Cf(1|t,r,a,n)}function yS(e,t){return np(8390656,8,e,t)}function i2(e,t){return Iy(2048,8,e,t)}function zT(e,t){return Iy(4,2,e,t)}function UT(e,t){return Iy(4,4,e,t)}function WT(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function VT(e,t,r){return r=r!=null?r.concat([e]):null,Iy(4,4,WT.bind(null,t,e),r)}function a2(){}function HT(e,t){var r=Fn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&t2(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function qT(e,t){var r=Fn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&t2(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function KT(e,t,r){return sl&21?(pi(r,t)||(r=QC(),Nt.lanes|=r,ol|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Hr=!0),e.memoizedState=r)}function yF(e,t){var r=et;et=r!==0&&4>r?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<r&&(t+="H"+r.toString(32)),t+=":"}else r=gF++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},wF={readContext:Ln,useCallback:HT,useContext:Ln,useEffect:i2,useImperativeHandle:VT,useInsertionEffect:zT,useLayoutEffect:UT,useMemo:qT,useReducer:Rv,useRef:BT,useState:function(){return Rv(Pf)},useDebugValue:a2,useDeferredValue:function(e){var t=Fn();return KT(t,Yt.memoizedState,e)},useTransition:function(){var e=Rv(Pf)[0],t=Fn().memoizedState;return[e,t]},useMutableSource:$T,useSyncExternalStore:MT,useId:GT,unstable_isNewReconciler:!1},jF={readContext:Ln,useCallback:HT,useContext:Ln,useEffect:i2,useImperativeHandle:VT,useInsertionEffect:zT,useLayoutEffect:UT,useMemo:qT,useReducer:Iv,useRef:BT,useState:function(){return Iv(Pf)},useDebugValue:a2,useDeferredValue:function(e){var t=Fn();return Yt===null?t.memoizedState=e:KT(t,Yt.memoizedState,e)},useTransition:function(){var e=Iv(Pf)[0],t=Fn().memoizedState;return[e,t]},useMutableSource:$T,useSyncExternalStore:MT,useId:GT,unstable_isNewReconciler:!1};function Yn(e,t){if(e&&e.defaultProps){t=St({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Ob(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:St({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Dy={isMounted:function(e){return(e=e._reactInternals)?Ol(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Dr(),i=Ts(e),a=ha(n,i);a.payload=t,r!=null&&(a.callback=r),t=Ps(e,a,i),t!==null&&(fi(t,e,i,n),tp(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Dr(),i=Ts(e),a=ha(n,i);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=Ps(e,a,i),t!==null&&(fi(t,e,i,n),tp(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Dr(),n=Ts(e),i=ha(r,n);i.tag=2,t!=null&&(i.callback=t),t=Ps(e,i,n),t!==null&&(fi(t,e,n,r),tp(t,e,n))}};function vS(e,t,r,n,i,a,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,s):t.prototype&&t.prototype.isPureReactComponent?!_f(r,n)||!_f(i,a):!0}function QT(e,t,r){var n=!1,i=qs,a=t.contextType;return typeof a=="object"&&a!==null?a=Ln(a):(i=Yr(t)?il:kr.current,n=t.contextTypes,a=(n=n!=null)?Uc(e,i):qs),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Dy,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function xS(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Dy.enqueueReplaceState(t,t.state,null)}function Ab(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},Xj(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Ln(a):(a=Yr(t)?il:kr.current,i.context=Uc(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Ob(e,t,a,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Dy.enqueueReplaceState(i,i.state,null),Bp(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function qc(e,t){try{var r="",n=t;do r+=ZL(n),n=n.return;while(n);var i=r}catch(a){i=`
|
||
Error generating stack: `+a.message+`
|
||
`+a.stack}return{value:e,source:t,stack:i,digest:null}}function Dv(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Pb(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var _F=typeof WeakMap=="function"?WeakMap:Map;function JT(e,t,r){r=ha(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Hp||(Hp=!0,Bb=n),Pb(e,t)},r}function e$(e,t,r){r=ha(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){Pb(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Pb(e,t),typeof n!="function"&&(Cs===null?Cs=new Set([this]):Cs.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),r}function bS(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new _F;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=DF.bind(null,e,t,r),t.then(e,e))}function wS(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function jS(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=ha(-1,1),t.tag=2,Ps(r,t,1))),r.lanes|=1),e)}var NF=Ta.ReactCurrentOwner,Hr=!1;function Ar(e,t,r,n){t.child=e===null?AT(t,null,r,n):Vc(t,e.child,r,n)}function _S(e,t,r,n,i){r=r.render;var a=t.ref;return bc(t,i),n=r2(e,t,r,n,a,i),r=n2(),e!==null&&!Hr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,wa(e,t,i)):(bt&&r&&Vj(t),t.flags|=1,Ar(e,t,n,i),t.child)}function NS(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!h2(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,t$(e,t,a,n,i)):(e=op(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var s=a.memoizedProps;if(r=r.compare,r=r!==null?r:_f,r(s,n)&&e.ref===t.ref)return wa(e,t,i)}return t.flags|=1,e=$s(a,n),e.ref=t.ref,e.return=t,t.child=e}function t$(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(_f(a,n)&&e.ref===t.ref)if(Hr=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(Hr=!0);else return t.lanes=e.lanes,wa(e,t,i)}return Cb(e,t,r,n,i)}function r$(e,t,r){var n=t.pendingProps,i=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ct(lc,an),an|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ct(lc,an),an|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,ct(lc,an),an|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,ct(lc,an),an|=n;return Ar(e,t,i,r),t.child}function n$(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Cb(e,t,r,n,i){var a=Yr(r)?il:kr.current;return a=Uc(t,a),bc(t,i),r=r2(e,t,r,n,a,i),n=n2(),e!==null&&!Hr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,wa(e,t,i)):(bt&&n&&Vj(t),t.flags|=1,Ar(e,t,r,i),t.child)}function SS(e,t,r,n,i){if(Yr(r)){var a=!0;Rp(t)}else a=!1;if(bc(t,i),t.stateNode===null)ip(e,t),QT(t,r,n),Ab(t,r,n,i),n=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var c=s.context,u=r.contextType;typeof u=="object"&&u!==null?u=Ln(u):(u=Yr(r)?il:kr.current,u=Uc(t,u));var d=r.getDerivedStateFromProps,f=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==n||c!==u)&&xS(t,s,n,u),Ga=!1;var h=t.memoizedState;s.state=h,Bp(t,n,s,i),c=t.memoizedState,l!==n||h!==c||Gr.current||Ga?(typeof d=="function"&&(Ob(t,r,d,n),c=t.memoizedState),(l=Ga||vS(t,r,l,n,h,c,u))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),s.props=n,s.state=c,s.context=u,n=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{s=t.stateNode,CT(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Yn(t.type,l),s.props=u,f=t.pendingProps,h=s.context,c=r.contextType,typeof c=="object"&&c!==null?c=Ln(c):(c=Yr(r)?il:kr.current,c=Uc(t,c));var m=r.getDerivedStateFromProps;(d=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==f||h!==c)&&xS(t,s,n,c),Ga=!1,h=t.memoizedState,s.state=h,Bp(t,n,s,i);var y=t.memoizedState;l!==f||h!==y||Gr.current||Ga?(typeof m=="function"&&(Ob(t,r,m,n),y=t.memoizedState),(u=Ga||vS(t,r,u,n,h,y,c)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,y,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,y,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=y),s.props=n,s.state=y,s.context=c,n=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return Tb(e,t,r,n,a,i)}function Tb(e,t,r,n,i,a){n$(e,t);var s=(t.flags&128)!==0;if(!n&&!s)return i&&uS(t,r,!1),wa(e,t,a);n=t.stateNode,NF.current=t;var l=s&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&s?(t.child=Vc(t,e.child,null,a),t.child=Vc(t,null,l,a)):Ar(e,t,l,a),t.memoizedState=n.state,i&&uS(t,r,!0),t.child}function i$(e){var t=e.stateNode;t.pendingContext?cS(e,t.pendingContext,t.pendingContext!==t.context):t.context&&cS(e,t.context,!1),Qj(e,t.containerInfo)}function kS(e,t,r,n,i){return Wc(),qj(i),t.flags|=256,Ar(e,t,r,n),t.child}var $b={dehydrated:null,treeContext:null,retryLane:0};function Mb(e){return{baseLanes:e,cachePool:null,transitions:null}}function a$(e,t,r){var n=t.pendingProps,i=_t.current,a=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ct(_t,i&1),e===null)return kb(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=n.children,e=n.fallback,a?(n=t.mode,a=t.child,s={mode:"hidden",children:s},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=s):a=By(s,n,0,null),e=Zo(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Mb(r),t.memoizedState=$b,e):s2(t,s));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return SF(e,t,s,n,l,i,r);if(a){a=n.fallback,s=t.mode,i=e.child,l=i.sibling;var c={mode:"hidden",children:n.children};return!(s&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=$s(i,c),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=$s(l,a):(a=Zo(a,s,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,s=e.child.memoizedState,s=s===null?Mb(r):{baseLanes:s.baseLanes|r,cachePool:null,transitions:s.transitions},a.memoizedState=s,a.childLanes=e.childLanes&~r,t.memoizedState=$b,n}return a=e.child,e=a.sibling,n=$s(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function s2(e,t){return t=By({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function vm(e,t,r,n){return n!==null&&qj(n),Vc(t,e.child,null,r),e=s2(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function SF(e,t,r,n,i,a,s){if(r)return t.flags&256?(t.flags&=-257,n=Dv(Error(ne(422))),vm(e,t,s,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=By({mode:"visible",children:n.children},i,0,null),a=Zo(a,i,s,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&Vc(t,e.child,null,s),t.child.memoizedState=Mb(s),t.memoizedState=$b,a);if(!(t.mode&1))return vm(e,t,s,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var l=n.dgst;return n=l,a=Error(ne(419)),n=Dv(a,n,void 0),vm(e,t,s,n)}if(l=(s&e.childLanes)!==0,Hr||l){if(n=lr,n!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|s)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,ba(e,i),fi(n,e,i,-1))}return f2(),n=Dv(Error(ne(421))),vm(e,t,s,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=LF.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,cn=As(i.nextSibling),un=t,bt=!0,ii=null,e!==null&&(En[On++]=aa,En[On++]=sa,En[On++]=al,aa=e.id,sa=e.overflow,al=t),t=s2(t,n.children),t.flags|=4096,t)}function ES(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Eb(e.return,t,r)}function Lv(e,t,r,n,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function s$(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(Ar(e,t,n.children,r),n=_t.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ES(e,r,t);else if(e.tag===19)ES(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(ct(_t,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&zp(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),Lv(t,!1,i,r,a);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&zp(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}Lv(t,!0,r,null,a);break;case"together":Lv(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ip(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function wa(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),ol|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ne(153));if(t.child!==null){for(e=t.child,r=$s(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=$s(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function kF(e,t,r){switch(t.tag){case 3:i$(t),Wc();break;case 5:TT(t);break;case 1:Yr(t.type)&&Rp(t);break;case 4:Qj(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;ct(Lp,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(ct(_t,_t.current&1),t.flags|=128,null):r&t.child.childLanes?a$(e,t,r):(ct(_t,_t.current&1),e=wa(e,t,r),e!==null?e.sibling:null);ct(_t,_t.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return s$(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ct(_t,_t.current),n)break;return null;case 22:case 23:return t.lanes=0,r$(e,t,r)}return wa(e,t,r)}var o$,Rb,l$,c$;o$=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Rb=function(){};l$=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,Ao(Di.current);var a=null;switch(r){case"input":i=nb(e,i),n=nb(e,n),a=[];break;case"select":i=St({},i,{value:void 0}),n=St({},n,{value:void 0}),a=[];break;case"textarea":i=sb(e,i),n=sb(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=$p)}lb(r,n);var s;r=null;for(u in i)if(!n.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(s in l)l.hasOwnProperty(s)&&(r||(r={}),r[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(gf.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in n){var c=n[u];if(l=i!=null?i[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in c)c.hasOwnProperty(s)&&l[s]!==c[s]&&(r||(r={}),r[s]=c[s])}else r||(a||(a=[]),a.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(gf.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&mt("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}r&&(a=a||[]).push("style",r);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};c$=function(e,t,r,n){r!==n&&(t.flags|=4)};function sd(e,t){if(!bt)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function vr(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function EF(e,t,r){var n=t.pendingProps;switch(Hj(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vr(t),null;case 1:return Yr(t.type)&&Mp(),vr(t),null;case 3:return n=t.stateNode,Hc(),yt(Gr),yt(kr),e2(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(gm(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ii!==null&&(Wb(ii),ii=null))),Rb(e,t),vr(t),null;case 5:Jj(t);var i=Ao(Of.current);if(r=t.type,e!==null&&t.stateNode!=null)l$(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(ne(166));return vr(t),null}if(e=Ao(Di.current),gm(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[Ti]=t,n[kf]=a,e=(t.mode&1)!==0,r){case"dialog":mt("cancel",n),mt("close",n);break;case"iframe":case"object":case"embed":mt("load",n);break;case"video":case"audio":for(i=0;i<Rd.length;i++)mt(Rd[i],n);break;case"source":mt("error",n);break;case"img":case"image":case"link":mt("error",n),mt("load",n);break;case"details":mt("toggle",n);break;case"input":IN(n,a),mt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},mt("invalid",n);break;case"textarea":LN(n,a),mt("invalid",n)}lb(r,a),i=null;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="children"?typeof l=="string"?n.textContent!==l&&(a.suppressHydrationWarning!==!0&&pm(n.textContent,l,e),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&pm(n.textContent,l,e),i=["children",""+l]):gf.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&mt("scroll",n)}switch(r){case"input":om(n),DN(n,a,!0);break;case"textarea":om(n),FN(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=$p)}n=i,t.updateQueue=n,n!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=DC(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/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;i<Rd.length;i++)mt(Rd[i],e);i=n;break;case"source":mt("error",e),i=n;break;case"img":case"image":case"link":mt("error",e),mt("load",e),i=n;break;case"details":mt("toggle",e),i=n;break;case"input":IN(e,n),i=nb(e,n),mt("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=St({},n,{value:void 0}),mt("invalid",e);break;case"textarea":LN(e,n),i=sb(e,n),mt("invalid",e);break;default:i=n}lb(r,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?BC(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&LC(e,c)):a==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&yf(e,c):typeof c=="number"&&yf(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(gf.hasOwnProperty(a)?c!=null&&a==="onScroll"&&mt("scroll",e):c!=null&&Pj(e,a,c,s))}switch(r){case"input":om(e),DN(e,n,!1);break;case"textarea":om(e),FN(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Hs(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?gc(e,!!n.multiple,a,!1):n.defaultValue!=null&&gc(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=$p)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return vr(t),null;case 6:if(e&&t.stateNode!=null)c$(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(ne(166));if(r=Ao(Of.current),Ao(Di.current),gm(t)){if(n=t.stateNode,r=t.memoizedProps,n[Ti]=t,(a=n.nodeValue!==r)&&(e=un,e!==null))switch(e.tag){case 3:pm(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&pm(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Ti]=t,t.stateNode=n}return vr(t),null;case 13:if(yt(_t),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(bt&&cn!==null&&t.mode&1&&!(t.flags&128))ET(),Wc(),t.flags|=98560,a=!1;else if(a=gm(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(ne(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(ne(317));a[Ti]=t}else Wc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vr(t),a=!1}else ii!==null&&(Wb(ii),ii=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||_t.current&1?Qt===0&&(Qt=3):f2())),t.updateQueue!==null&&(t.flags|=4),vr(t),null);case 4:return Hc(),Rb(e,t),e===null&&Nf(t.stateNode.containerInfo),vr(t),null;case 10:return Yj(t.type._context),vr(t),null;case 17:return Yr(t.type)&&Mp(),vr(t),null;case 19:if(yt(_t),a=t.memoizedState,a===null)return vr(t),null;if(n=(t.flags&128)!==0,s=a.rendering,s===null)if(n)sd(a,!1);else{if(Qt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=zp(e),s!==null){for(t.flags|=128,sd(a,!1),n=s.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)a=r,e=n,a.flags&=14680066,s=a.alternate,s===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=s.childLanes,a.lanes=s.lanes,a.child=s.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=s.memoizedProps,a.memoizedState=s.memoizedState,a.updateQueue=s.updateQueue,a.type=s.type,e=s.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return ct(_t,_t.current&1|2),t.child}e=e.sibling}a.tail!==null&&$t()>Kc&&(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;n<r.length;n++){var i=r[n];try{var a=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:fr=l.stateNode,Qn=!1;break e;case 3:fr=l.stateNode.containerInfo,Qn=!0;break e;case 4:fr=l.stateNode.containerInfo,Qn=!0;break e}l=l.return}if(fr===null)throw Error(ne(160));f$(a,s,i),fr=null,Qn=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){Et(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)h$(t,e),t=t.sibling}function h$(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Kn(t,e),ji(e),n&4){try{Jd(3,e,e.return),Ly(3,e)}catch(p){Et(e,e.return,p)}try{Jd(5,e,e.return)}catch(p){Et(e,e.return,p)}}break;case 1:Kn(t,e),ji(e),n&512&&r!==null&&oc(r,r.return);break;case 5:if(Kn(t,e),ji(e),n&512&&r!==null&&oc(r,r.return),e.flags&32){var i=e.stateNode;try{yf(i,"")}catch(p){Et(e,e.return,p)}}if(n&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,s=r!==null?r.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&RC(i,a),cb(l,s);var u=cb(l,a);for(s=0;s<c.length;s+=2){var d=c[s],f=c[s+1];d==="style"?BC(i,f):d==="dangerouslySetInnerHTML"?LC(i,f):d==="children"?yf(i,f):Pj(i,d,f,u)}switch(l){case"input":ib(i,a);break;case"textarea":IC(i,a);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var m=a.value;m!=null?gc(i,!!a.multiple,m,!1):h!==!!a.multiple&&(a.defaultValue!=null?gc(i,!!a.multiple,a.defaultValue,!0):gc(i,!!a.multiple,a.multiple?[]:"",!1))}i[kf]=a}catch(p){Et(e,e.return,p)}}break;case 6:if(Kn(t,e),ji(e),n&4){if(e.stateNode===null)throw Error(ne(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(p){Et(e,e.return,p)}}break;case 3:if(Kn(t,e),ji(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{wf(t.containerInfo)}catch(p){Et(e,e.return,p)}break;case 4:Kn(t,e),ji(e);break;case 13:Kn(t,e),ji(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(c2=$t())),n&4&&PS(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(jr=(u=jr)||d,Kn(t,e),jr=u):Kn(t,e),ji(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(fe=e,d=e.child;d!==null;){for(f=fe=d;fe!==null;){switch(h=fe,m=h.child,h.tag){case 0:case 11:case 14:case 15:Jd(4,h,h.return);break;case 1:oc(h,h.return);var y=h.stateNode;if(typeof y.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(p){Et(n,r,p)}}break;case 5:oc(h,h.return);break;case 22:if(h.memoizedState!==null){TS(f);continue}}m!==null?(m.return=h,fe=m):TS(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{i=f.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=f.stateNode,c=f.memoizedProps.style,s=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=FC("display",s))}catch(p){Et(e,e.return,p)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(p){Et(e,e.return,p)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Kn(t,e),ji(e),n&4&&PS(e);break;case 21:break;default:Kn(t,e),ji(e)}}function ji(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(d$(r)){var n=r;break e}r=r.return}throw Error(ne(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(yf(i,""),n.flags&=-33);var a=AS(e);Fb(e,a,i);break;case 3:case 4:var s=n.stateNode.containerInfo,l=AS(e);Lb(e,l,s);break;default:throw Error(ne(161))}}catch(c){Et(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function CF(e,t,r){fe=e,m$(e)}function m$(e,t,r){for(var n=(e.mode&1)!==0;fe!==null;){var i=fe,a=i.child;if(i.tag===22&&n){var s=i.memoizedState!==null||xm;if(!s){var l=i.alternate,c=l!==null&&l.memoizedState!==null||jr;l=xm;var u=jr;if(xm=s,(jr=c)&&!u)for(fe=i;fe!==null;)s=fe,c=s.child,s.tag===22&&s.memoizedState!==null?$S(i):c!==null?(c.return=s,fe=c):$S(i);for(;a!==null;)fe=a,m$(a),a=a.sibling;fe=i,xm=l,jr=u}CS(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,fe=a):CS(e)}}function CS(e){for(;fe!==null;){var t=fe;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:jr||Ly(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!jr)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:Yn(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&pS(t,a,n);break;case 3:var s=t.updateQueue;if(s!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}pS(t,s,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&wf(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ne(163))}jr||t.flags&512&&Db(t)}catch(h){Et(t,t.return,h)}}if(t===e){fe=null;break}if(r=t.sibling,r!==null){r.return=t.return,fe=r;break}fe=t.return}}function TS(e){for(;fe!==null;){var t=fe;if(t===e){fe=null;break}var r=t.sibling;if(r!==null){r.return=t.return,fe=r;break}fe=t.return}}function $S(e){for(;fe!==null;){var t=fe;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Ly(4,t)}catch(c){Et(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(c){Et(t,i,c)}}var a=t.return;try{Db(t)}catch(c){Et(t,a,c)}break;case 5:var s=t.return;try{Db(t)}catch(c){Et(t,s,c)}}}catch(c){Et(t,t.return,c)}if(t===e){fe=null;break}var l=t.sibling;if(l!==null){l.return=t.return,fe=l;break}fe=t.return}}var TF=Math.ceil,Vp=Ta.ReactCurrentDispatcher,o2=Ta.ReactCurrentOwner,In=Ta.ReactCurrentBatchConfig,He=0,lr=null,Wt=null,mr=0,an=0,lc=Zs(0),Qt=0,Tf=null,ol=0,Fy=0,l2=0,ef=null,Vr=null,c2=0,Kc=1/0,ea=null,Hp=!1,Bb=null,Cs=null,bm=!1,xs=null,qp=0,tf=0,zb=null,ap=-1,sp=0;function Dr(){return He&6?$t():ap!==-1?ap:ap=$t()}function Ts(e){return e.mode&1?He&2&&mr!==0?mr&-mr:pF.transition!==null?(sp===0&&(sp=QC()),sp):(e=et,e!==0||(e=window.event,e=e===void 0?16:aT(e.type)),e):1}function fi(e,t,r,n){if(50<tf)throw tf=0,zb=null,Error(ne(185));Rh(e,r,n),(!(He&2)||e!==lr)&&(e===lr&&(!(He&2)&&(Fy|=r),Qt===4&&Ja(e,mr)),Zr(e,n),r===1&&He===0&&!(t.mode&1)&&(Kc=$t()+500,Ry&&Xs()))}function Zr(e,t){var r=e.callbackNode;p8(e,t);var n=Ap(e,e===lr?mr:0);if(n===0)r!==null&&UN(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&UN(r),t===1)e.tag===0?mF(MS.bind(null,e)):NT(MS.bind(null,e)),uF(function(){!(He&6)&&Xs()}),r=null;else{switch(JC(n)){case 1:r=Rj;break;case 4:r=ZC;break;case 16:r=Op;break;case 536870912:r=XC;break;default:r=Op}r=j$(r,p$.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function p$(e,t){if(ap=-1,sp=0,He&6)throw Error(ne(327));var r=e.callbackNode;if(wc()&&e.callbackNode!==r)return null;var n=Ap(e,e===lr?mr:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Kp(e,n);else{t=n;var i=He;He|=2;var a=y$();(lr!==e||mr!==t)&&(ea=null,Kc=$t()+500,Yo(e,t));do try{RF();break}catch(l){g$(e,l)}while(!0);Gj(),Vp.current=a,He=i,Wt!==null?t=0:(lr=null,mr=0,t=Qt)}if(t!==0){if(t===2&&(i=mb(e),i!==0&&(n=i,t=Ub(e,i))),t===1)throw r=Tf,Yo(e,0),Ja(e,n),Zr(e,$t()),r;if(t===6)Ja(e,n);else{if(i=e.current.alternate,!(n&30)&&!$F(i)&&(t=Kp(e,n),t===2&&(a=mb(e),a!==0&&(n=a,t=Ub(e,a))),t===1))throw r=Tf,Yo(e,0),Ja(e,n),Zr(e,$t()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(ne(345));case 2:go(e,Vr,ea);break;case 3:if(Ja(e,n),(n&130023424)===n&&(t=c2+500-$t(),10<t)){if(Ap(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){Dr(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=jb(go.bind(null,e,Vr,ea),t);break}go(e,Vr,ea);break;case 4:if(Ja(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var s=31-di(n);a=1<<s,s=t[s],s>i&&(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,10<n){e.timeoutHandle=jb(go.bind(null,e,Vr,ea),n);break}go(e,Vr,ea);break;case 5:go(e,Vr,ea);break;default:throw Error(ne(329))}}}return Zr(e,$t()),e.callbackNode===r?p$.bind(null,e):null}function Ub(e,t){var r=ef;return e.current.memoizedState.isDehydrated&&(Yo(e,t).flags|=256),e=Kp(e,t),e!==2&&(t=Vr,Vr=r,t!==null&&Wb(t)),e}function Wb(e){Vr===null?Vr=e:Vr.push.apply(Vr,e)}function $F(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],a=i.getSnapshot;i=i.value;try{if(!pi(a(),i))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ja(e,t){for(t&=~l2,t&=~Fy,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-di(t),n=1<<r;e[r]=-1,t&=~n}}function MS(e){if(He&6)throw Error(ne(327));wc();var t=Ap(e,0);if(!(t&1))return Zr(e,$t()),null;var r=Kp(e,t);if(e.tag!==0&&r===2){var n=mb(e);n!==0&&(t=n,r=Ub(e,n))}if(r===1)throw r=Tf,Yo(e,0),Ja(e,t),Zr(e,$t()),r;if(r===6)throw Error(ne(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,go(e,Vr,ea),Zr(e,$t()),null}function u2(e,t){var r=He;He|=1;try{return e(t)}finally{He=r,He===0&&(Kc=$t()+500,Ry&&Xs())}}function ll(e){xs!==null&&xs.tag===0&&!(He&6)&&wc();var t=He;He|=1;var r=In.transition,n=et;try{if(In.transition=null,et=1,e)return e()}finally{et=n,In.transition=r,He=t,!(He&6)&&Xs()}}function d2(){an=lc.current,yt(lc)}function Yo(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,cF(r)),Wt!==null)for(r=Wt.return;r!==null;){var n=r;switch(Hj(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Mp();break;case 3:Hc(),yt(Gr),yt(kr),e2();break;case 5:Jj(n);break;case 4:Hc();break;case 13:yt(_t);break;case 19:yt(_t);break;case 10:Yj(n.type._context);break;case 22:case 23:d2()}r=r.return}if(lr=e,Wt=e=$s(e.current,null),mr=an=t,Qt=0,Tf=null,l2=Fy=ol=0,Vr=ef=null,Oo!==null){for(t=0;t<Oo.length;t++)if(r=Oo[t],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,a=r.pending;if(a!==null){var s=a.next;a.next=i,n.next=s}r.pending=n}Oo=null}return e}function g$(e,t){do{var r=Wt;try{if(Gj(),rp.current=Wp,Up){for(var n=Nt.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Up=!1}if(sl=0,ar=Yt=Nt=null,Qd=!1,Af=0,o2.current=null,r===null||r.return===null){Qt=1,Tf=t,Wt=null;break}e:{var a=e,s=r.return,l=r,c=t;if(t=mr,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=wS(s);if(m!==null){m.flags&=-257,jS(m,s,l,a,t),m.mode&1&&bS(a,u,t),t=m,c=u;var y=t.updateQueue;if(y===null){var p=new Set;p.add(c),t.updateQueue=p}else y.add(c);break e}else{if(!(t&1)){bS(a,u,t),f2();break e}c=Error(ne(426))}}else if(bt&&l.mode&1){var x=wS(s);if(x!==null){!(x.flags&65536)&&(x.flags|=256),jS(x,s,l,a,t),qj(qc(c,l));break e}}a=c=qc(c,l),Qt!==4&&(Qt=2),ef===null?ef=[a]:ef.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var g=JT(a,c,t);mS(a,g);break e;case 1:l=c;var v=a.type,w=a.stateNode;if(!(a.flags&128)&&(typeof v.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Cs===null||!Cs.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var _=e$(a,l,t);mS(a,_);break e}}a=a.return}while(a!==null)}x$(r)}catch(j){t=j,Wt===r&&r!==null&&(Wt=r=r.return);continue}break}while(!0)}function y$(){var e=Vp.current;return Vp.current=Wp,e===null?Wp:e}function f2(){(Qt===0||Qt===3||Qt===2)&&(Qt=4),lr===null||!(ol&268435455)&&!(Fy&268435455)||Ja(lr,mr)}function Kp(e,t){var r=He;He|=2;var n=y$();(lr!==e||mr!==t)&&(ea=null,Yo(e,t));do try{MF();break}catch(i){g$(e,i)}while(!0);if(Gj(),He=r,Vp.current=n,Wt!==null)throw Error(ne(261));return lr=null,mr=0,Qt}function MF(){for(;Wt!==null;)v$(Wt)}function RF(){for(;Wt!==null&&!s8();)v$(Wt)}function v$(e){var t=w$(e.alternate,e,an);e.memoizedProps=e.pendingProps,t===null?x$(e):Wt=t,o2.current=null}function x$(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=OF(r,t),r!==null){r.flags&=32767,Wt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Qt=6,Wt=null;return}}else if(r=EF(r,t,an),r!==null){Wt=r;return}if(t=t.sibling,t!==null){Wt=t;return}Wt=t=e}while(t!==null);Qt===0&&(Qt=5)}function go(e,t,r){var n=et,i=In.transition;try{In.transition=null,et=1,IF(e,t,r,n)}finally{In.transition=i,et=n}return null}function IF(e,t,r,n){do wc();while(xs!==null);if(He&6)throw Error(ne(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(ne(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(g8(e,a),e===lr&&(Wt=lr=null,mr=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||bm||(bm=!0,j$(Op,function(){return wc(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=In.transition,In.transition=null;var s=et;et=1;var l=He;He|=4,o2.current=null,PF(e,r),h$(r,e),rF(bb),Pp=!!xb,bb=xb=null,e.current=r,CF(r),o8(),He=l,et=s,In.transition=a}else e.current=r;if(bm&&(bm=!1,xs=e,qp=i),a=e.pendingLanes,a===0&&(Cs=null),u8(r.stateNode),Zr(e,$t()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(Hp)throw Hp=!1,e=Bb,Bb=null,e;return qp&1&&e.tag!==0&&wc(),a=e.pendingLanes,a&1?e===zb?tf++:(tf=0,zb=e):tf=0,Xs(),null}function wc(){if(xs!==null){var e=JC(qp),t=In.transition,r=et;try{if(In.transition=null,et=16>e?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<l.length;c++){var u=l[c];for(fe=u;fe!==null;){var d=fe;switch(d.tag){case 0:case 11:case 15:Jd(8,d,a)}var f=d.child;if(f!==null)f.return=d,fe=f;else for(;fe!==null;){d=fe;var h=d.sibling,m=d.return;if(u$(d),d===u){fe=null;break}if(h!==null){h.return=m,fe=h;break}fe=m}}}var y=a.alternate;if(y!==null){var p=y.child;if(p!==null){y.child=null;do{var x=p.sibling;p.sibling=null,p=x}while(p!==null)}}fe=a}}if(a.subtreeFlags&2064&&s!==null)s.return=a,fe=s;else e:for(;fe!==null;){if(a=fe,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Jd(9,a,a.return)}var g=a.sibling;if(g!==null){g.return=a.return,fe=g;break e}fe=a.return}}var v=e.current;for(fe=v;fe!==null;){s=fe;var w=s.child;if(s.subtreeFlags&2064&&w!==null)w.return=s,fe=w;else e:for(s=v;fe!==null;){if(l=fe,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Ly(9,l)}}catch(j){Et(l,l.return,j)}if(l===s){fe=null;break e}var _=l.sibling;if(_!==null){_.return=l.return,fe=_;break e}fe=l.return}}if(He=i,Xs(),Ii&&typeof Ii.onPostCommitFiberRoot=="function")try{Ii.onPostCommitFiberRoot(Py,e)}catch{}n=!0}return n}finally{et=r,In.transition=t}}return!1}function RS(e,t,r){t=qc(r,t),t=JT(e,t,1),e=Ps(e,t,1),t=Dr(),e!==null&&(Rh(e,1,t),Zr(e,t))}function Et(e,t,r){if(e.tag===3)RS(e,e,r);else for(;t!==null;){if(t.tag===3){RS(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Cs===null||!Cs.has(n))){e=qc(r,e),e=e$(t,e,1),t=Ps(t,e,1),e=Dr(),t!==null&&(Rh(t,1,e),Zr(t,e));break}}t=t.return}}function DF(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Dr(),e.pingedLanes|=e.suspendedLanes&r,lr===e&&(mr&r)===r&&(Qt===4||Qt===3&&(mr&130023424)===mr&&500>$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<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Xl,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function _$(e){if(!e)return qs;e=e._reactInternals;e:{if(Ol(e)!==e||e.tag!==1)throw Error(ne(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Yr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ne(171))}if(e.tag===1){var r=e.type;if(Yr(r))return _T(e,r,t)}return t}function N$(e,t,r,n,i,a,s,l,c){return e=m2(r,n,!0,e,i,a,s,l,c),e.context=_$(null),r=e.current,n=Dr(),i=Ts(r),a=ha(n,i),a.callback=t??null,Ps(r,a,i),e.current.lanes=i,Rh(e,i,n),Zr(e,n),e}function zy(e,t,r,n){var i=t.current,a=Dr(),s=Ts(i);return r=_$(r),t.context===null?t.context=r:t.pendingContext=r,t=ha(a,s),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Ps(i,t,s),e!==null&&(fi(e,i,s,a),tp(e,i,s)),s}function Gp(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function IS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function p2(e,t){IS(e,t),(e=e.alternate)&&IS(e,t)}function VF(){return null}var S$=typeof reportError=="function"?reportError:function(e){console.error(e)};function g2(e){this._internalRoot=e}Uy.prototype.render=g2.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ne(409));zy(e,t,null,null)};Uy.prototype.unmount=g2.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ll(function(){zy(null,e,null,null)}),t[xa]=null}};function Uy(e){this._internalRoot=e}Uy.prototype.unstable_scheduleHydration=function(e){if(e){var t=rT();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Qa.length&&t!==0&&t<Qa[r].priority;r++);Qa.splice(r,0,e),r===0&&iT(e)}};function y2(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Wy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function DS(){}function HF(e,t,r,n,i){if(i){if(typeof n=="function"){var a=n;n=function(){var u=Gp(s);a.call(u)}}var s=N$(t,n,e,0,null,!1,!1,"",DS);return e._reactRootContainer=s,e[xa]=s.current,Nf(e.nodeType===8?e.parentNode:e),ll(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var u=Gp(c);l.call(u)}}var c=m2(e,0,!1,null,null,!1,!1,"",DS);return e._reactRootContainer=c,e[xa]=c.current,Nf(e.nodeType===8?e.parentNode:e),ll(function(){zy(t,c,r,n)}),c}function Vy(e,t,r,n,i){var a=r._reactRootContainer;if(a){var s=a;if(typeof i=="function"){var l=i;i=function(){var c=Gp(s);l.call(c)}}zy(t,s,e,i)}else s=HF(r,t,e,i,n);return Gp(s)}eT=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Md(t.pendingLanes);r!==0&&(Ij(t,r|1),Zr(t,$t()),!(He&6)&&(Kc=$t()+500,Xs()))}break;case 13:ll(function(){var n=ba(e,1);if(n!==null){var i=Dr();fi(n,e,1,i)}}),p2(e,1)}};Dj=function(e){if(e.tag===13){var t=ba(e,134217728);if(t!==null){var r=Dr();fi(t,e,134217728,r)}p2(e,134217728)}};tT=function(e){if(e.tag===13){var t=Ts(e),r=ba(e,t);if(r!==null){var n=Dr();fi(r,e,t,n)}p2(e,t)}};rT=function(){return et};nT=function(e,t){var r=et;try{return et=e,t()}finally{et=r}};db=function(e,t,r){switch(t){case"input":if(ib(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=My(n);if(!i)throw Error(ne(90));MC(n),ib(n,i)}}}break;case"textarea":IC(e,r);break;case"select":t=r.value,t!=null&&gc(e,!!r.multiple,t,!1)}};WC=u2;VC=ll;var qF={usingClientEntryPoint:!1,Events:[Dh,rc,My,zC,UC,u2]},od={findFiberByHostInstance:Eo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},KF={bundleType:od.bundleType,version:od.version,rendererPackageName:od.rendererPackageName,rendererConfig:od.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ta.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=KC(e),e===null?null:e.stateNode},findFiberByHostInstance:od.findFiberByHostInstance||VF,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wm.isDisabled&&wm.supportsFiber)try{Py=wm.inject(KF),Ii=wm}catch{}}yn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qF;yn.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y2(t))throw Error(ne(200));return WF(e,t,null,r)};yn.createRoot=function(e,t){if(!y2(e))throw Error(ne(299));var r=!1,n="",i=S$;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=m2(e,1,!1,null,null,r,!1,n,i),e[xa]=t.current,Nf(e.nodeType===8?e.parentNode:e),new g2(t)};yn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ne(188)):(e=Object.keys(e).join(","),Error(ne(268,e)));return e=KC(t),e=e===null?null:e.stateNode,e};yn.flushSync=function(e){return ll(e)};yn.hydrate=function(e,t,r){if(!Wy(t))throw Error(ne(200));return Vy(null,e,t,!0,r)};yn.hydrateRoot=function(e,t,r){if(!y2(e))throw Error(ne(405));var n=r!=null&&r.hydratedSources||null,i=!1,a="",s=S$;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(s=r.onRecoverableError)),t=N$(t,null,e,1,r??null,i,!1,a,s),e[xa]=t.current,Nf(e),n)for(e=0;e<n.length;e++)r=n[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new Uy(t)};yn.render=function(e,t,r){if(!Wy(t))throw Error(ne(200));return Vy(null,e,t,!1,r)};yn.unmountComponentAtNode=function(e){if(!Wy(e))throw Error(ne(40));return e._reactRootContainer?(ll(function(){Vy(null,null,e,!1,function(){e._reactRootContainer=null,e[xa]=null})}),!0):!1};yn.unstable_batchedUpdates=u2;yn.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Wy(r))throw Error(ne(200));if(e==null||e._reactInternals===void 0)throw Error(ne(38));return Vy(e,t,r,!1,n)};yn.version="18.3.1-next-f1338f8080-20240426";function k$(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"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<s;d++){const f=r?d:a[d];(!r&&c.has(f)||r)&&e[f]===void 0&&t[f]===void 0?(l[f]=void 0,u++):(l[f]=O$(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&u++)}return i===s&&u===i?e:l}return t}function Yp(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function zS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Hb(e){if(!US(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!US(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function US(e){return Object.prototype.toString.call(e)==="[object Object]"}function ZF(e){return new Promise(t=>{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"&&r<v||typeof v=="function"&&v(r,g);if(t||!j){h(g);return}r++,(N=e.onFail)==null||N.call(e,r,g),ZF(_).then(()=>u()?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<w)}return l};t.options.persister?t.fetchFn=()=>{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<c.length;)d=101*d+c.charCodeAt(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)=>y<f&&m.visible).length;return d.filter(m=>m.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<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mf.apply(this,arguments)}var ws;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ws||(ws={}));const YS="popstate";function y7(e){e===void 0&&(e={});function t(n,i){let{pathname:a,search:s,hash:l}=n.location;return aw("",{pathname:a,search:s,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){return typeof i=="string"?i:Jp(i)}return x7(t,r,null,e)}function Rt(e,t){if(e===!1||e===null||typeof e>"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<s.length;++c){let u=M7(a);l=C7(s[c],u)}return l}function H$(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let i=(a,s,l)=>{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<n.length;++l){let c=n[l],u=l===n.length-1,d=a==="/"?t:t.slice(a.length)||"/",f=T7({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f)return null;Object.assign(i,f.params),s.push({params:i,pathname:Rs([a,f.pathname]),pathnameBase:L7(Rs([a,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(a=Rs([a,f.pathnameBase]))}return s}function T7(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=$7(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let a=i[0],s=a.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:n.reduce((u,d,f)=>{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 <Link to="..."> 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<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rf.apply(this,arguments)}const k2=b.createContext(null),W7=b.createContext(null),Js=b.createContext(null),qy=b.createContext(null),$a=b.createContext({outlet:null,matches:[],isDataRoute:!1}),G$=b.createContext(null);function V7(e,t){let{relative:r}=t===void 0?{}:t;Iu()||Rt(!1);let{basename:n,navigator:i}=b.useContext(Js),{hash:a,pathname:s,search:l}=X$(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:Rs([n,s])),i.createHref({pathname:c,search:l,hash:a})}function Iu(){return b.useContext(qy)!=null}function eo(){return Iu()||Rt(!1),b.useContext(qy).location}function Y$(e){b.useContext(Js).static||b.useLayoutEffect(e)}function to(){let{isDataRoute:e}=b.useContext($a);return e?nB():H7()}function H7(){Iu()||Rt(!1);let e=b.useContext(k2),{basename:t,future:r,navigator:n}=b.useContext(Js),{matches:i}=b.useContext($a),{pathname:a}=eo(),s=JSON.stringify(N2(i,r.v7_relativeSplatPath)),l=b.useRef(!1);return Y$(()=>{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<s.length;d++){let f=s[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:m}=r,y=f.route.loader&&h[f.route.id]===void 0&&(!m||m[f.route.id]===void 0);if(f.route.lazy||y){c=!0,u>=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<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ow.apply(this,arguments)}function cB(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=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<e.length;r++)(n=gr(e[r]))!==""&&(t+=(t&&" ")+n);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}var t4={exports:{}},r4={},n4={exports:{}},i4={};/**
|
||
* @license React
|
||
* use-sync-external-store-shim.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 Gc=b;function xB(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bB=typeof Object.is=="function"?Object.is:xB,wB=Gc.useState,jB=Gc.useEffect,_B=Gc.useLayoutEffect,NB=Gc.useDebugValue;function SB(e,t){var r=t(),n=wB({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return _B(function(){i.value=r,i.getSnapshot=t,Wv(i)&&a({inst:i})},[e,r,t]),jB(function(){return Wv(i)&&a({inst:i}),e(function(){Wv(i)&&a({inst:i})})},[e]),NB(r),r}function Wv(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!bB(e,r)}catch{return!0}}function kB(e,t){return t()}var EB=typeof window>"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<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new up(r)}function up(e){this._=e}function qB(e,t){return e.trim().split(/^|\s+/).map(function(r){var n="",i=r.indexOf(".");if(i>=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(;++a<s;)if((i=(e=n[a]).type)&&(i=KB(r[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<s;)if(i=(e=n[a]).type)r[i]=ak(r[i],e.name,t);else if(t==null)for(i in r)r[i]=ak(r[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new up(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var r=new Array(i),n=0,i,a;n<i;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],n=0,i=a.length;n<i;++n)a[n].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],i=0,a=n.length;i<a;++i)n[i].value.apply(t,r)}};function KB(e,t){for(var r=0,n=e.length,i;r<n;++r)if((i=e[r]).name===t)return i.value}function ak(e,t,r){for(var n=0,i=e.length;n<i;++n)if(e[n].name===t){e[n]=HB,e=e.slice(0,n).concat(e.slice(n+1));break}return r!=null&&e.push({name:t,value:r}),e}var lw="http://www.w3.org/1999/xhtml";const sk={svg:"http://www.w3.org/2000/svg",xhtml:lw,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Yy(e){var t=e+="",r=t.indexOf(":");return r>=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<r;++i)for(var a=t[i],s=a.length,l=n[i]=new Array(s),c,u,d=0;d<s;++d)(c=a[d])&&(u=e.call(c,c.__data__,d,a))&&("__data__"in c&&(u.__data__=c.__data__),l[d]=u);return new pn(n,this._parents)}function QB(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function JB(){return[]}function o4(e){return e==null?JB:function(){return this.querySelectorAll(e)}}function ez(e){return function(){return QB(e.apply(this,arguments))}}function tz(e){typeof e=="function"?e=ez(e):e=o4(e);for(var t=this._groups,r=t.length,n=[],i=[],a=0;a<r;++a)for(var s=t[a],l=s.length,c,u=0;u<l;++u)(c=s[u])&&(n.push(e.call(c,c.__data__,u,s)),i.push(c));return new pn(n,i)}function l4(e){return function(){return this.matches(e)}}function c4(e){return function(t){return t.matches(e)}}var rz=Array.prototype.find;function nz(e){return function(){return rz.call(this.children,e)}}function iz(){return this.firstElementChild}function az(e){return this.select(e==null?iz:nz(typeof e=="function"?e:c4(e)))}var sz=Array.prototype.filter;function oz(){return Array.from(this.children)}function lz(e){return function(){return sz.call(this.children,e)}}function cz(e){return this.selectAll(e==null?oz:lz(typeof e=="function"?e:c4(e)))}function uz(e){typeof e!="function"&&(e=l4(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],s=a.length,l=n[i]=[],c,u=0;u<s;++u)(c=a[u])&&e.call(c,c.__data__,u,a)&&l.push(c);return new pn(n,this._parents)}function u4(e){return new Array(e.length)}function dz(){return new pn(this._enter||this._groups.map(u4),this._parents)}function eg(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}eg.prototype={constructor:eg,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function fz(e){return function(){return e}}function hz(e,t,r,n,i,a){for(var s=0,l,c=t.length,u=a.length;s<u;++s)(l=t[s])?(l.__data__=a[s],n[s]=l):r[s]=new eg(e,a[s]);for(;s<c;++s)(l=t[s])&&(i[s]=l)}function mz(e,t,r,n,i,a,s){var l,c,u=new Map,d=t.length,f=a.length,h=new Array(d),m;for(l=0;l<d;++l)(c=t[l])&&(h[l]=m=s.call(c,c.__data__,l,t)+"",u.has(m)?i[l]=c:u.set(m,c));for(l=0;l<f;++l)m=s.call(e,a[l],l,a)+"",(c=u.get(m))?(n[l]=c,c.__data__=a[l],u.delete(m)):r[l]=new eg(e,a[l]);for(l=0;l<d;++l)(c=t[l])&&u.get(h[l])===c&&(i[l]=c)}function pz(e){return e.__data__}function gz(e,t){if(!arguments.length)return Array.from(this,pz);var r=t?mz:hz,n=this._parents,i=this._groups;typeof e!="function"&&(e=fz(e));for(var a=i.length,s=new Array(a),l=new Array(a),c=new Array(a),u=0;u<a;++u){var d=n[u],f=i[u],h=f.length,m=yz(e.call(d,d&&d.__data__,u,n)),y=m.length,p=l[u]=new Array(y),x=s[u]=new Array(y),g=c[u]=new Array(h);r(d,f,p,x,g,m,t);for(var v=0,w=0,_,j;v<y;++v)if(_=p[v]){for(v>=w&&(w=v+1);!(j=x[w])&&++w<y;);_._next=j||null}}return s=new pn(s,n),s._enter=l,s._exit=c,s}function yz(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function vz(){return new pn(this._exit||this._groups.map(u4),this._parents)}function xz(e,t,r){var n=this.enter(),i=this,a=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?a.remove():r(a),n&&i?n.merge(i).order():i}function bz(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,i=r.length,a=n.length,s=Math.min(i,a),l=new Array(i),c=0;c<s;++c)for(var u=r[c],d=n[c],f=u.length,h=l[c]=new Array(f),m,y=0;y<f;++y)(m=u[y]||d[y])&&(h[y]=m);for(;c<i;++c)l[c]=r[c];return new pn(l,this._parents)}function wz(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n=e[t],i=n.length-1,a=n[i],s;--i>=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;a<n;++a){for(var s=r[a],l=s.length,c=i[a]=new Array(l),u,d=0;d<l;++d)(u=s[d])&&(c[d]=u);c.sort(t)}return new pn(i,this._parents).order()}function _z(e,t){return e<t?-1:e>t?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;t<r;++t)for(var n=e[t],i=0,a=n.length;i<a;++i){var s=n[i];if(s)return s}return null}function Ez(){let e=0;for(const t of this)++e;return e}function Oz(){return!this.node()}function Az(e){for(var t=this._groups,r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,s=i.length,l;a<s;++a)(l=i[a])&&e.call(l,l.__data__,a,i);return this}function Pz(e){return function(){this.removeAttribute(e)}}function Cz(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Tz(e,t){return function(){this.setAttribute(e,t)}}function $z(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Mz(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function Rz(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function Iz(e,t){var r=Yy(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?Cz:Pz:typeof t=="function"?r.local?Rz:Mz:r.local?$z:Tz)(r,t))}function d4(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Dz(e){return function(){this.style.removeProperty(e)}}function Lz(e,t,r){return function(){this.style.setProperty(e,t,r)}}function Fz(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function Bz(e,t,r){return arguments.length>1?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<i;)r.add(t[n])}function p4(e,t){for(var r=O2(e),n=-1,i=t.length;++n<i;)r.remove(t[n])}function Hz(e){return function(){m4(this,e)}}function qz(e){return function(){p4(this,e)}}function Kz(e,t){return function(){(t.apply(this,arguments)?m4:p4)(this,e)}}function Gz(e,t){var r=f4(e+"");if(arguments.length<2){for(var n=O2(this.node()),i=-1,a=r.length;++i<a;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof t=="function"?Kz:t?Hz:qz)(r,t))}function Yz(){this.textContent=""}function Zz(e){return function(){this.textContent=e}}function Xz(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Qz(e){return arguments.length?this.each(e==null?Yz:(typeof e=="function"?Xz:Zz)(e)):this.node().textContent}function Jz(){this.innerHTML=""}function eU(e){return function(){this.innerHTML=e}}function tU(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function rU(e){return arguments.length?this.each(e==null?Jz:(typeof e=="function"?tU:eU)(e)):this.node().innerHTML}function nU(){this.nextSibling&&this.parentNode.appendChild(this)}function iU(){return this.each(nU)}function aU(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function sU(){return this.each(aU)}function oU(e){var t=typeof e=="function"?e:s4(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function lU(){return null}function cU(e,t){var r=typeof e=="function"?e:s4(e),n=t==null?lU:typeof t=="function"?t:E2(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function uU(){var e=this.parentNode;e&&e.removeChild(this)}function dU(){return this.each(uU)}function fU(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function hU(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function mU(e){return this.select(e?hU:fU)}function pU(e){return arguments.length?this.property("__data__",e):this.node().__data__}function gU(e){return function(t){e.call(this,t,this.__data__)}}function yU(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return 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<i;++r)a=t[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++n]=a;++n?t.length=n:delete this.__on}}}function xU(e,t,r){return function(){var n=this.__on,i,a=gU(t);if(n){for(var s=0,l=n.length;s<l;++s)if((i=n[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=r),i.value=t;return}}this.addEventListener(e.type,a,r),i={type:e.type,name:e.name,value:t,listener:a,options:r},n?n.push(i):this.__on=[i]}}function bU(e,t,r){var n=yU(e+""),i,a=n.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,d;c<u;++c)for(i=0,d=l[c];i<a;++i)if((s=n[i]).type===d.type&&s.name===d.name)return d.value}return}for(l=t?xU:vU,i=0;i<a;++i)this.each(l(n[i],t,r));return this}function g4(e,t,r){var n=d4(e),i=n.CustomEvent;typeof i=="function"?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function wU(e,t){return function(){return g4(this,e,t)}}function jU(e,t){return function(){return g4(this,e,t.apply(this,arguments))}}function _U(e,t){return this.each((typeof t=="function"?jU:wU)(e,t))}function*NU(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,a=n.length,s;i<a;++i)(s=n[i])&&(yield s)}var y4=[null];function pn(e,t){this._groups=e,this._parents=t}function Bh(){return new pn([[document.documentElement]],y4)}function SU(){return this}pn.prototype=Bh.prototype={constructor:pn,select:XB,selectAll:tz,selectChild:az,selectChildren:cz,filter:uz,data:gz,enter:dz,exit:vz,join:xz,merge:bz,selection:SU,order:wz,sort:jz,call:Nz,nodes:Sz,node:kz,size:Ez,empty:Oz,each:Az,attr:Iz,style:Bz,property:Vz,classed:Gz,text:Qz,html:rU,raise:iU,lower:sU,append:oU,insert:cU,remove:dU,clone:mU,datum:pU,on:bU,dispatch:_U,[Symbol.iterator]:NU};function Pn(e){return typeof e=="string"?new pn([[document.querySelector(e)]],[document.documentElement]):new pn([[e]],y4)}function kU(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Jn(e,t){if(e=kU(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const EU={passive:!1},If={capture:!0,passive:!1};function Vv(e){e.stopImmediatePropagation()}function jc(e){e.preventDefault(),e.stopImmediatePropagation()}function v4(e){var t=e.document.documentElement,r=Pn(e).on("dragstart.drag",jc,If);"onselectstart"in t?r.on("selectstart.drag",jc,If):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function x4(e,t){var r=e.document.documentElement,n=Pn(e).on("dragstart.drag",null);t&&(n.on("click.drag",jc,If),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const Nm=e=>()=>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<E;++k)(A=w(this,S,_,j,N[k].identifier,N[k]))&&(Vv(_),A("start",_,N[k]))}}function g(_){var j=_.changedTouches,N=j.length,S,E;for(S=0;S<N;++S)(E=i[j[S].identifier])&&(jc(_),E("drag",_,j[S]))}function v(_){var j=_.changedTouches,N=j.length,S,E;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),S=0;S<N;++S)(E=i[j[S].identifier])&&(Vv(_),E("end",_,j[S]))}function w(_,j,N,S,E,k){var A=a.copy(),C=Jn(k||N,j),P,$,O;if((O=r.call(_,new cw("beforestart",{sourceEvent:N,target:h,identifier:E,active:s,x:C[0],y:C[1],dx:0,dy:0,dispatch:A}),S))!=null)return P=O.x-C[0]||0,$=O.y-C[1]||0,function I(D,L,R){var M=C,B;switch(D){case"start":i[E]=I,B=s++;break;case"end":delete i[E],--s;case"drag":C=Jn(R||L,j),B=s;break}A.call(D,_,new cw(D,{sourceEvent:L,subject:O,target:h,identifier:E,active:B,x:C[0]+P,y:C[1]+$,dx:C[0]-M[0],dy:C[1]-M[1],dispatch:A}),S)}}return h.filter=function(_){return arguments.length?(e=typeof _=="function"?_:Nm(!!_),h):e},h.container=function(_){return arguments.length?(t=typeof _=="function"?_:Nm(_),h):t},h.subject=function(_){return arguments.length?(r=typeof _=="function"?_:Nm(_),h):r},h.touchable=function(_){return arguments.length?(n=typeof _=="function"?_:Nm(!!_),h):n},h.on=function(){var _=a.on.apply(a,arguments);return _===a?h:_},h.clickDistance=function(_){return arguments.length?(f=(_=+_)*_,h):Math.sqrt(f)},h}function A2(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function b4(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function zh(){}var Df=.7,tg=1/Df,_c="\\s*([+-]?\\d+)\\s*",Lf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Li="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$U=/^#([0-9a-f]{3,8})$/,MU=new RegExp(`^rgb\\(${_c},${_c},${_c}\\)$`),RU=new RegExp(`^rgb\\(${Li},${Li},${Li}\\)$`),IU=new RegExp(`^rgba\\(${_c},${_c},${_c},${Lf}\\)$`),DU=new RegExp(`^rgba\\(${Li},${Li},${Li},${Lf}\\)$`),LU=new RegExp(`^hsl\\(${Lf},${Li},${Li}\\)$`),FU=new RegExp(`^hsla\\(${Lf},${Li},${Li},${Lf}\\)$`),ok={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};A2(zh,dl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:lk,formatHex:lk,formatHex8:BU,formatHsl:zU,formatRgb:ck,toString:ck});function lk(){return this.rgb().formatHex()}function BU(){return this.rgb().formatHex8()}function zU(){return w4(this).formatHsl()}function ck(){return this.rgb().formatRgb()}function dl(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=$U.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?uk(t):r===3?new qr(t>>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+(r<n)*6:r===a?s=(n-t)/l+2:s=(t-r)/l+4,l/=c<.5?a+i:2-a-i,s*=60):l=c>0&&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;i<r;++i)n[i]=e[i]*(1-a)+t[i]*a;return n}}function YU(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ZU(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),a=new Array(r),s;for(s=0;s<n;++s)i[s]=Du(e[s],t[s]);for(;s<r;++s)a[s]=t[s];return function(l){for(s=0;s<n;++s)a[s]=i[s](l);return a}}function XU(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function si(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function QU(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=Du(e[i],t[i]):n[i]=t[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var dw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qv=new RegExp(dw.source,"g");function JU(e){return function(){return e}}function eW(e){return function(t){return e(t)+""}}function _4(e,t){var r=dw.lastIndex=qv.lastIndex=0,n,i,a,s=-1,l=[],c=[];for(e=e+"",t=t+"";(n=dw.exec(e))&&(i=qv.exec(t));)(a=i.index)>r&&(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 r<t.length&&(a=t.slice(r),l[s]?l[s]+=a:l[++s]=a),l.length<2?c[0]?eW(c[0].x):JU(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function Du(e,t){var r=typeof t,n;return t==null||r==="boolean"?P2(t):(r==="number"?si:r==="string"?(n=dl(t))?(t=n,ng):_4:t instanceof dl?ng:t instanceof Date?XU:YU(t)?GU:Array.isArray(t)?ZU:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?QU:si)(e,t)}function C2(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var pk=180/Math.PI,fw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function N4(e,t,r,n,i,a){var s,l,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*r+t*n)&&(r-=e*c,n-=t*c),(l=Math.sqrt(r*r+n*n))&&(r/=l,n/=l,c/=l),e*n<t*r&&(e=-e,t=-t,c=-c,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*pk,skewX:Math.atan(c)*pk,scaleX:s,scaleY:l}}var Em;function tW(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?fw:N4(t.a,t.b,t.c,t.d,t.e,t.f)}function rW(e){return e==null||(Em||(Em=document.createElementNS("http://www.w3.org/2000/svg","g")),Em.setAttribute("transform",e),!(e=Em.transform.baseVal.consolidate()))?fw:(e=e.matrix,N4(e.a,e.b,e.c,e.d,e.e,e.f))}function S4(e,t,r,n){function i(u){return u.length?u.pop()+" ":""}function a(u,d,f,h,m,y){if(u!==f||d!==h){var p=m.push("translate(",null,t,null,r);y.push({i:p-4,x:si(u,f)},{i:p-2,x:si(d,h)})}else(f||h)&&m.push("translate("+f+t+h+r)}function s(u,d,f,h){u!==d?(u-d>180?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<p;)f[(x=h[y]).i]=x.x(m);return f.join("")}}}var nW=S4(tW,"px, ","px)","deg)"),iW=S4(rW,", ",")",")"),aW=1e-12;function gk(e){return((e=Math.exp(e))+1/e)/2}function sW(e){return((e=Math.exp(e))-1/e)/2}function oW(e){return((e=Math.exp(2*e))-1)/(e+1)}const lW=function e(t,r,n){function i(a,s){var l=a[0],c=a[1],u=a[2],d=s[0],f=s[1],h=s[2],m=d-l,y=f-c,p=m*m+y*y,x,g;if(p<aW)g=Math.log(h/u)/t,x=function(S){return[l+S*m,c+S*y,u*Math.exp(t*S*g)]};else{var v=Math.sqrt(p),w=(h*h-u*u+n*p)/(2*u*r*v),_=(h*h-u*u-n*p)/(2*h*r*v),j=Math.log(Math.sqrt(w*w+1)-w),N=Math.log(Math.sqrt(_*_+1)-_);g=(N-j)/t,x=function(S){var E=S*g,k=gk(j),A=u/(r*v)*(k*oW(t*E+j)-sW(j));return[l+A*m,c+A*y,u*k/gk(t*E+j)]}}return x.duration=g*1e3*t/Math.SQRT2,x}return i.rho=function(a){var s=Math.max(.001,+a),l=s*s,c=l*l;return e(s,l,c)},i}(Math.SQRT2,2,4);function cW(e,t){t===void 0&&(t=e,e=Du);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return function(s){var l=Math.max(0,Math.min(n-1,Math.floor(s*=n)));return a[l](s-l)}}var Zc=0,Dd=0,ld=0,k4=1e3,ig,Ld,ag=0,fl=0,Zy=0,Ff=typeof performance=="object"&&performance.now?performance:Date,E4=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function T2(){return fl||(E4(uW),fl=Ff.now()+Zy)}function uW(){fl=0}function sg(){this._call=this._time=this._next=null}sg.prototype=O4.prototype={constructor:sg,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?T2():+r)+(t==null?0:+t),!this._next&&Ld!==this&&(Ld?Ld._next=this:ig=this,Ld=this),this._call=e,this._time=r,hw()},stop:function(){this._call&&(this._call=null,this._time=1/0,hw())}};function O4(e,t,r){var n=new sg;return n.restart(e,t,r),n}function dW(){T2(),++Zc;for(var e=ig,t;e;)(t=fl-e._time)>=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]):+d<t&&(m.state=fp,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete n[d])}if(vk(function(){r.state===dp&&(r.state=bk,r.timer.restart(l,r.delay,r.time),l(u))}),r.state=mw,r.on.call("start",e,e.__data__,r.index,r.group),r.state===mw){for(r.state=dp,i=new Array(h=r.tween.length),d=0,f=-1;d<h;++d)(m=r.tween[d].value.call(e,e.__data__,r.index,r.group))&&(i[++f]=m);i.length=f+1}}function l(u){for(var d=u<r.duration?r.ease.call(null,u/r.duration):(r.timer.restart(c),r.state=pw,1),f=-1,h=i.length;++f<h;)i[f].call(e,d);r.state===pw&&(r.on.call("end",e,e.__data__,r.index,r.group),c())}function c(){r.state=fp,r.timer.stop(),delete n[t];for(var u in n)return;delete e.__transition}}function hp(e,t){var r=e.__transition,n,i,a=!0,s;if(r){t=t==null?null:t+"";for(s in r){if((n=r[s]).name!==t){a=!1;continue}i=n.state>mw&&n.state<pw,n.state=fp,n.timer.stop(),n.on.call(i?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete r[s]}a&&delete e.__transition}}function yW(e){return this.each(function(){hp(this,e)})}function vW(e,t){var r,n;return function(){var i=Vi(this,e),a=i.tween;if(a!==r){n=r=a;for(var s=0,l=n.length;s<l;++s)if(n[s].name===t){n=n.slice(),n.splice(s,1);break}}i.tween=n}}function xW(e,t,r){var n,i;if(typeof r!="function")throw new Error;return function(){var a=Vi(this,e),s=a.tween;if(s!==n){i=(n=s).slice();for(var l={name:t,value:r},c=0,u=i.length;c<u;++c)if(i[c].name===t){i[c]=l;break}c===u&&i.push(l)}a.tween=i}}function bW(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n=yi(this.node(),r).tween,i=0,a=n.length,s;i<a;++i)if((s=n[i]).name===e)return s.value;return null}return this.each((t==null?vW:xW)(r,e,t))}function M2(e,t,r){var n=e._id;return e.each(function(){var i=Vi(this,n);(i.value||(i.value={}))[t]=r.apply(this,arguments)}),function(i){return yi(i,n).value[t]}}function P4(e,t){var r;return(typeof t=="number"?si:t instanceof dl?ng:(r=dl(t))?(t=r,ng):_4)(e,t)}function wW(e){return function(){this.removeAttribute(e)}}function jW(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _W(e,t,r){var n,i=r+"",a;return function(){var s=this.getAttribute(e);return s===i?null:s===n?a:a=t(n=s,r)}}function NW(e,t,r){var n,i=r+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===n?a:a=t(n=s,r)}}function SW(e,t,r){var n,i,a;return function(){var s,l=r(this),c;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=l+"",s===c?null:s===n&&c===i?a:(i=c,a=t(n=s,l)))}}function kW(e,t,r){var n,i,a;return function(){var s,l=r(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=l+"",s===c?null:s===n&&c===i?a:(i=c,a=t(n=s,l)))}}function EW(e,t){var r=Yy(e),n=r==="transform"?iW:P4;return this.attrTween(e,typeof t=="function"?(r.local?kW:SW)(r,n,M2(this,"attr."+e,t)):t==null?(r.local?jW:wW)(r):(r.local?NW:_W)(r,n,t))}function OW(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function AW(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function PW(e,t){var r,n;function i(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&AW(e,a)),r}return i._value=t,i}function CW(e,t){var r,n;function i(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&OW(e,a)),r}return i._value=t,i}function TW(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=Yy(e);return this.tween(r,(n.local?PW:CW)(n,t))}function $W(e,t){return function(){$2(this,e).delay=+t.apply(this,arguments)}}function MW(e,t){return t=+t,function(){$2(this,e).delay=t}}function RW(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$W:MW)(t,e)):yi(this.node(),t).delay}function IW(e,t){return function(){Vi(this,e).duration=+t.apply(this,arguments)}}function DW(e,t){return t=+t,function(){Vi(this,e).duration=t}}function LW(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?IW:DW)(t,e)):yi(this.node(),t).duration}function FW(e,t){if(typeof t!="function")throw new Error;return function(){Vi(this,e).ease=t}}function BW(e){var t=this._id;return arguments.length?this.each(FW(t,e)):yi(this.node(),t).ease}function zW(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Vi(this,e).ease=r}}function UW(e){if(typeof e!="function")throw new Error;return this.each(zW(this._id,e))}function WW(e){typeof e!="function"&&(e=l4(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],s=a.length,l=n[i]=[],c,u=0;u<s;++u)(c=a[u])&&e.call(c,c.__data__,u,a)&&l.push(c);return new _a(n,this._parents,this._name,this._id)}function VW(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,i=r.length,a=Math.min(n,i),s=new Array(n),l=0;l<a;++l)for(var c=t[l],u=r[l],d=c.length,f=s[l]=new Array(d),h,m=0;m<d;++m)(h=c[m]||u[m])&&(f[m]=h);for(;l<n;++l)s[l]=t[l];return new _a(s,this._parents,this._name,this._id)}function HW(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=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<i;++s)for(var l=n[s],c=l.length,u=a[s]=new Array(c),d,f,h=0;h<c;++h)(d=l[h])&&(f=e.call(d,d.__data__,h,l))&&("__data__"in d&&(f.__data__=d.__data__),u[h]=f,Xy(u[h],t,r,h,u,yi(d,r)));return new _a(a,this._parents,t,r)}function XW(e){var t=this._name,r=this._id;typeof e!="function"&&(e=o4(e));for(var n=this._groups,i=n.length,a=[],s=[],l=0;l<i;++l)for(var c=n[l],u=c.length,d,f=0;f<u;++f)if(d=c[f]){for(var h=e.call(d,d.__data__,f,c),m,y=yi(d,r),p=0,x=h.length;p<x;++p)(m=h[p])&&Xy(m,t,r,p,h,y);a.push(h),s.push(d)}return new _a(a,s,t,r)}var QW=Bh.prototype.constructor;function JW(){return new QW(this._groups,this._parents)}function eV(e,t){var r,n,i;return function(){var a=Yc(this,e),s=(this.style.removeProperty(e),Yc(this,e));return a===s?null:a===r&&s===n?i:i=t(r=a,n=s)}}function C4(e){return function(){this.style.removeProperty(e)}}function tV(e,t,r){var n,i=r+"",a;return function(){var s=Yc(this,e);return s===i?null:s===n?a:a=t(n=s,r)}}function rV(e,t,r){var n,i,a;return function(){var s=Yc(this,e),l=r(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),Yc(this,e))),s===c?null:s===n&&c===i?a:(i=c,a=t(n=s,l))}}function nV(e,t){var r,n,i,a="style."+t,s="end."+a,l;return function(){var c=Vi(this,e),u=c.on,d=c.value[a]==null?l||(l=C4(t)):void 0;(u!==r||i!==d)&&(n=(r=u).copy()).on(s,i=d),c.on=n}}function iV(e,t,r){var n=(e+="")=="transform"?nW:P4;return t==null?this.styleTween(e,eV(e,n)).on("end.style."+e,C4(e)):typeof t=="function"?this.styleTween(e,rV(e,n,M2(this,"style."+e,t))).each(nV(this._id,e)):this.styleTween(e,tV(e,n,t),r).on("end.style."+e,null)}function aV(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function sV(e,t,r){var n,i;function a(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&aV(e,s,r)),n}return a._value=t,a}function oV(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,sV(e,t,r??""))}function lV(e){return function(){this.textContent=e}}function cV(e){return function(){var t=e(this);this.textContent=t??""}}function uV(e){return this.tween("text",typeof e=="function"?cV(M2(this,"text",e)):lV(e==null?"":e+""))}function dV(e){return function(t){this.textContent=e.call(this,t)}}function fV(e){var t,r;function n(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&dV(i)),t}return n._value=e,n}function hV(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,fV(e))}function mV(){for(var e=this._name,t=this._id,r=T4(),n=this._groups,i=n.length,a=0;a<i;++a)for(var s=n[a],l=s.length,c,u=0;u<l;++u)if(c=s[u]){var d=yi(c,t);Xy(c,e,r,u,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new _a(n,this._parents,e,r)}function pV(){var e,t,r=this,n=r._id,i=r.size();return new Promise(function(a,s){var l={value:s},c={value:function(){--i===0&&a()}};r.each(function(){var u=Vi(this,n),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),u.on=t}),i===0&&a()})}var gV=0;function _a(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function T4(){return++gV}var Yi=Bh.prototype;_a.prototype={constructor:_a,select:ZW,selectAll:XW,selectChild:Yi.selectChild,selectChildren:Yi.selectChildren,filter:WW,merge:VW,selection:JW,transition:mV,call:Yi.call,nodes:Yi.nodes,node:Yi.node,size:Yi.size,empty:Yi.empty,each:Yi.each,on:KW,attr:EW,attrTween:TW,style:iV,styleTween:oV,text:uV,textTween:hV,remove:YW,tween:bW,delay:RW,duration:LW,ease:BW,easeVarying:UW,end:pV,[Symbol.iterator]:Yi[Symbol.iterator]};function yV(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var vV={time:null,delay:0,duration:250,ease:yV};function xV(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function bV(e){var t,r;e instanceof _a?(t=e._id,e=e._name):(t=T4(),(r=vV).time=T2(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,a=0;a<i;++a)for(var s=n[a],l=s.length,c,u=0;u<l;++u)(c=s[u])&&Xy(c,e,t,u,s,r||xV(c,t));return new _a(n,this._parents,e,t)}Bh.prototype.interrupt=yW;Bh.prototype.transition=bV;const Om=e=>()=>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<L;++B)U=D[B],W=Jn(U,this),W=[W,this.__zoom.invert(W),U.identifier],R.touch0?!R.touch1&&R.touch0[2]!==W[2]&&(R.touch1=W,R.taps=0):(R.touch0=W,M=!0,R.taps=1+!!d);d&&(d=clearTimeout(d)),M&&(R.taps<2&&(f=W[0],d=setTimeout(function(){d=null},m)),hp(this),R.start())}}function P(O,...I){if(this.__zooming){var D=N(this,I).event(O),L=O.changedTouches,R=L.length,M,B,U,W;for(cd(O),M=0;M<R;++M)B=L[M],U=Jn(B,this),D.touch0&&D.touch0[2]===B.identifier?D.touch0[0]=U:D.touch1&&D.touch1[2]===B.identifier&&(D.touch1[0]=U);if(B=D.that.__zoom,D.touch1){var Z=D.touch0[0],q=D.touch0[1],ee=D.touch1[0],le=D.touch1[1],ve=(ve=ee[0]-Z[0])*ve+(ve=ee[1]-Z[1])*ve,Ne=(Ne=le[0]-q[0])*Ne+(Ne=le[1]-q[1])*Ne;B=v(B,Math.sqrt(ve/Ne)),U=[(Z[0]+ee[0])/2,(Z[1]+ee[1])/2],W=[(q[0]+le[0])/2,(q[1]+le[1])/2]}else if(D.touch0)U=D.touch0[0],W=D.touch0[1];else return;D.zoom("touch",r(w(B,U,W),D.extent,s))}}function $(O,...I){if(this.__zooming){var D=N(this,I).event(O),L=O.changedTouches,R=L.length,M,B;for(Kv(O),h&&clearTimeout(h),h=setTimeout(function(){h=null},m),M=0;M<R;++M)B=L[M],D.touch0&&D.touch0[2]===B.identifier?delete D.touch0:D.touch1&&D.touch1[2]===B.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(B=Jn(B,this),Math.hypot(f[0]-B[0],f[1]-B[1])<x)){var U=Pn(this).on("dblclick.zoom");U&&U.apply(this,arguments)}}}return g.wheelDelta=function(O){return arguments.length?(n=typeof O=="function"?O:Om(+O),g):n},g.filter=function(O){return arguments.length?(e=typeof O=="function"?O:Om(!!O),g):e},g.touchable=function(O){return arguments.length?(i=typeof O=="function"?O:Om(!!O),g):i},g.extent=function(O){return arguments.length?(t=typeof O=="function"?O:Om([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),g):t},g.scaleExtent=function(O){return arguments.length?(a[0]=+O[0],a[1]=+O[1],g):[a[0],a[1]]},g.translateExtent=function(O){return arguments.length?(s[0][0]=+O[0][0],s[1][0]=+O[1][0],s[0][1]=+O[0][1],s[1][1]=+O[1][1],g):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},g.constrain=function(O){return arguments.length?(r=O,g):r},g.duration=function(O){return arguments.length?(l=+O,g):l},g.interpolate=function(O){return arguments.length?(c=O,g):c},g.on=function(){var O=u.on.apply(u,arguments);return O===u?g:O},g.clickDistance=function(O){return arguments.length?(p=(O=+O)*O,g):Math.sqrt(p)},g.tapDistance=function(O){return arguments.length?(x=+O,g):x},g}const Qy=b.createContext(null),EV=Qy.Provider,Na={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,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)=>e<t?Xc(Math.abs(e-t),1,50)/50:e>r?-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<e?r+i:r-i,s=Math.abs(n-t)/2,l=n<t?n+s:n-s;return[a,l,i,s]}function U4({sourceX:e,sourceY:t,targetX:r,targetY:n,sourceControlX:i,sourceControlY:a,targetControlX:s,targetControlY:l}){const c=e*.125+i*.375+s*.375+r*.125,u=t*.125+a*.375+l*.375+n*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}var hl;(function(e){e.Strict="strict",e.Loose="loose"})(hl||(hl={}));var To;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(To||(To={}));var zf;(function(e){e.Partial="partial",e.Full="full"})(zf||(zf={}));var ts;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ts||(ts={}));var lg;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(lg||(lg={}));var je;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(je||(je={}));function Nk({pos:e,x1:t,y1:r,x2:n,y2:i}){return e===je.Left||e===je.Right?[.5*(t+n),r]:[t,.5*(r+i)]}function W4({sourceX:e,sourceY:t,sourcePosition:r=je.Bottom,targetX:n,targetY:i,targetPosition:a=je.Top}){const[s,l]=Nk({pos:r,x1:e,y1:t,x2:n,y2:i}),[c,u]=Nk({pos:a,x1:n,y1:i,x2:e,y2:t}),[d,f,h,m]=U4({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${n},${i}`,d,f,h,m]}const D2=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,interactionWidth:p})=>{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.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},kk=(e,t)=>Math.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[$]<u[$];(s[f]===1&&(!O&&I||O&&D)||s[f]!==1&&(!O&&D||O&&I))&&(m=f==="x"?S:E)}const k={x:c.x+x.x,y:c.y+x.y},A={x:u.x+g.x,y:u.y+g.y},C=Math.max(Math.abs(k.x-m[0].x),Math.abs(A.x-m[0].x)),P=Math.max(Math.abs(k.y-m[0].y),Math.abs(A.y-m[0].y));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<r.x?-1:1,d=e.y<r.y?1:-1;return`L ${a+i*u},${s}Q ${a},${s} ${a},${s+i*d}`}const l=e.x<r.x?1:-1,c=e.y<r.y?-1:1;return`L ${a},${s+i*c}Q ${a},${s} ${a+i*l},${s}`}function vw({sourceX:e,sourceY:t,sourcePosition:r=je.Bottom,targetX:n,targetY:i,targetPosition:a=je.Top,borderRadius:s=5,centerX:l,centerY:c,offset:u=20}){const[d,f,h,m,y]=DV({source:{x:e,y:t},sourcePosition:r,target:{x:n,y:i},targetPosition:a,center:{x:l,y:c},offset:u});return[d.reduce((x,g,v)=>{let w="";return v>0&&v<d.length-1?w=LV(d[v-1],g,d[v+1],s):w=`${v===0?"M":"L"}${g.x} ${g.y}`,x+=w,x},""),f,h,m,y]}const e0=b.memo(({sourceX:e,sourceY:t,targetX:r,targetY:n,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,sourcePosition:f=je.Bottom,targetPosition:h=je.Top,markerEnd:m,markerStart:y,pathOptions:p,interactionWidth:x})=>{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&&(p<f?d=[{handle:y,validHandleResult:x}]:p===f&&d.push({handle:y,validHandleResult:x}),f=p)}}),!d.length)return{handle:null,validHandleResult:Z4()};if(d.length===1)return d[0];const h=d.some(({validHandleResult:y})=>y.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.x<Z?W.x:Z,y:W.y<q?W.y:q,width:Math.abs(W.x-Z),height:Math.abs(W.y-q)},le=U(),ve=K4(I,ee,L,t===zf.Partial,!0,B),Ne=G4(ve,D).map(oe=>oe.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<Qk.length;e++)Ud[Qk.charCodeAt(e)]=e;const RG=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<r;n+=4)a=Ud[e.charCodeAt(n)],s=Ud[e.charCodeAt(n+1)],l=Ud[e.charCodeAt(n+2)],c=Ud[e.charCodeAt(n+3)],d[i++]=a<<2|s>>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<r.length;i++){const a=Q2(r[i],t);if(n.push(a),a.type==="error")break}return n};function BG(){return new TransformStream({transform(e,t){MG(e,r=>{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;i<t;i++)r[i]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}function zG(e,t){ax||(ax=new TextDecoder);const r=[];let n=0,i=-1,a=!1;return new TransformStream({transform(s,l){for(r.push(s);;){if(n===0){if($m(r)<1)break;const c=Mm(r,1);a=(c[0]&128)===128,i=c[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if($m(r)<2)break;const c=Mm(r,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if($m(r)<8)break;const c=Mm(r,8),u=new DataView(c.buffer,c.byteOffset,c.length),d=u.getUint32(0);if(d>Math.pow(2,21)-1){l.enqueue(Ew);break}i=d*Math.pow(2,32)+u.getUint32(4),n=3}else{if($m(r)<i)break;const c=Mm(r,i);l.enqueue(Q2(a?c:ax.decode(c),t)),n=0}if(i===0||i>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;i<r.length;i++)if(n=r[i],n===t||n.fn===t){r.splice(i,1);break}return r.length===0&&delete this._callbacks["$"+e],this};Vt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,i=r.length;n<i;++n)r[n].apply(this,t)}return this};Vt.prototype.emitReserved=Vt.prototype.emit;Vt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Vt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const n0=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.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<i;n++)t=e.charCodeAt(n),t<128?r+=1:t<2048?r+=2:t<55296||t>=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<i;n++){let a=r[n].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class XG extends Error{constructor(t,r,n){super(t),this.description=r,this.context=n,this.type="TransportError"}}class J2 extends Vt{constructor(t){super(),this.writable=!1,i0(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,r,n){return super.emitReserved("error",new XG(t,r,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const r=Q2(t,this.socket.binaryType);this.onPacket(r)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,r={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const r=YG(t);return r.length?"?"+r:""}}class QG extends J2{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const r=()=>{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<t.length;r++){const n=t[r],i=r===t.length-1;X2(n,this.supportsBinary,a=>{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<t.length;r++){const n=t[r],i=r===t.length-1;this._writer.write(n).then(()=>{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;n<this.writeBuffer.length;n++){const i=this.writeBuffer[n].data;if(i&&(r+=KG(i)),n>0&&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<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let r=this.createTransport(t),n=!1;Fs.priorWebsocketSuccess=!1;const i=()=>{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;n<t.length;n++)~this.transports.indexOf(t[n])&&r.push(t[n]);return r}}let hY=class extends fY{constructor(t,r={}){const n=typeof t=="object"?t:r;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(i=>oY[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<n;r++)if(vp(e[r]))return!0;return!1}if(e_(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return vp(e.toJSON(),!0);for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&vp(e[r]))return!0;return!1}function xY(e){const t=[],r=e.data,n=e;return n.data=Pw(r,t),n.attachments=t.length,{packet:n,buffers:t}}function Pw(e,t){if(!e)return e;if(e_(e)){const r={_placeholder:!0,num:t.length};return t.push(e),r}else if(Array.isArray(e)){const r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=Pw(e[n],t);return r}else if(typeof e=="object"&&!(e instanceof Date)){const r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=Pw(e[n],t));return r}return e}function bY(e,t){return e.data=Cw(e.data,t),delete e.attachments,e}function Cw(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r]=Cw(e[r],t);else if(typeof e=="object")for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=Cw(e[r],t));return e}const wY=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],jY=5;var We;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(We||(We={}));class _Y{constructor(t){this.replacer=t}encode(t){return(t.type===We.EVENT||t.type===We.ACK)&&vp(t)?this.encodeAsBinary({type:t.type===We.EVENT?We.BINARY_EVENT:We.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let r=""+t.type;return(t.type===We.BINARY_EVENT||t.type===We.BINARY_ACK)&&(r+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(r+=t.nsp+","),t.id!=null&&(r+=t.id),t.data!=null&&(r+=JSON.stringify(t.data,this.replacer)),r}encodeAsBinary(t){const r=xY(t),n=this.encodeAsString(r.packet),i=r.buffers;return i.unshift(n),i}}function eE(e){return Object.prototype.toString.call(e)==="[object Object]"}class t_ extends Vt{constructor(t){super(),this.reviver=t}add(t){let r;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(t);const n=r.type===We.BINARY_EVENT;n||r.type===We.BINARY_ACK?(r.type=n?We.EVENT:We.ACK,this.reconstructor=new NY(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(e_(t)||t.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(t),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let r=0;const n={type:Number(t.charAt(0))};if(We[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===We.BINARY_EVENT||n.type===We.BINARY_ACK){const a=r+1;for(;t.charAt(++r)!=="-"&&r!=t.length;);const s=t.substring(a,r);if(s!=Number(s)||t.charAt(r)!=="-")throw new Error("Illegal attachments");n.attachments=Number(s)}if(t.charAt(r+1)==="/"){const a=r+1;for(;++r&&!(t.charAt(r)===","||r===t.length););n.nsp=t.substring(a,r)}else n.nsp="/";const i=t.charAt(r+1);if(i!==""&&Number(i)==i){const a=r+1;for(;++r;){const s=t.charAt(r);if(s==null||Number(s)!=s){--r;break}if(r===t.length)break}n.id=Number(t.substring(a,r+1))}if(t.charAt(++r)){const a=this.tryParse(t.substr(r));if(t_.isPayloadValid(n.type,a))n.data=a;else throw new Error("invalid payload")}return n}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,r){switch(t){case We.CONNECT:return eE(r);case We.DISCONNECT:return r===void 0;case We.CONNECT_ERROR:return typeof r=="string"||eE(r);case We.EVENT:case We.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&wY.indexOf(r[0])===-1);case We.ACK:case We.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class NY{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const r=bY(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const SY=Object.freeze(Object.defineProperty({__proto__:null,Decoder:t_,Encoder:_Y,get PacketType(){return We},protocol:jY},Symbol.toStringTag,{value:"Module"}));function ei(e,t,r){return e.on(t,r),function(){e.off(t,r)}}const kY=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class J3 extends Vt{constructor(t,r,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=r,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[ei(t,"open",this.onopen.bind(this)),ei(t,"packet",this.onpacket.bind(this)),ei(t,"error",this.onerror.bind(this)),ei(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...r){var n,i,a;if(kY.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(r.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const s={type:We.EVENT,data:r};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const d=this.ids++,f=r.pop();this._registerAckCallback(d,f),s.id=d}const l=(i=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||i===void 0?void 0:i.writable,c=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!l||(c?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,r){var n;const i=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(i===void 0){this.acks[t]=r;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);r.call(this,new Error("operation has timed out"))},i),s=(...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;n<r.length;n++)if(t===r[n])return r.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const r=this._anyOutgoingListeners;for(let n=0;n<r.length;n++)if(t===r[n])return r.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const n of r)n.apply(this,t.data)}}}function Lu(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&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;n<r.length;n++)this.engine.write(r[n],t.options)}cleanup(){this.subs.forEach(t=>t()),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=V<a;return o.jsxs("div",{className:"flex flex-col items-center",children:[o.jsx("div",{className:`
|
||
w-12 h-12 rounded-full flex items-center justify-center mb-2
|
||
${H?"bg-green-500 text-white":F?e?"bg-blue-500 text-white":"bg-blue-600 text-white":e?"bg-gray-700 text-gray-400":"bg-gray-200 text-gray-400"}
|
||
`,children:H?o.jsx(Sw,{className:"w-6 h-6"}):o.jsx(ce,{className:"w-6 h-6"})}),o.jsx("span",{className:`text-sm font-medium ${F?e?"text-blue-400":"text-blue-600":e?"text-gray-400":"text-gray-500"}`,children:Y.title})]},V)})})}),g&&o.jsxs(Bs,{variant:"destructive",className:"mb-6",children:[o.jsx(Gl,{className:"h-4 w-4"}),o.jsx(zs,{children:g})]}),o.jsxs(ti,{children:[o.jsxs(nf,{children:[o.jsxs(af,{className:`flex items-center gap-2 ${e?"text-white":"text-gray-900"}`,children:[T.createElement(B[a].icon,{className:"w-5 h-5"}),B[a].title]}),o.jsx("p",{className:`${e?"text-gray-300":"text-gray-600"}`,children:B[a].description})]}),o.jsxs(ki,{children:[a===0&&o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:`rounded-lg p-4 mb-6 ${e?"bg-blue-900/20 border border-blue-700/30":"bg-blue-50 border border-blue-200"}`,children:[o.jsx("h4",{className:`font-medium mb-2 ${e?"text-blue-300":"text-blue-900"}`,children:"🎯 Cluster Configuration Guide"}),o.jsx("p",{className:`text-sm mb-3 ${e?"text-blue-200":"text-blue-800"}`,children:"Set up your distributed AI cluster by first adding your primary machine, then any additional worker nodes."}),o.jsxs("ul",{className:`text-sm space-y-1 ${e?"text-blue-200":"text-blue-700"}`,children:[o.jsxs("li",{children:["• ",o.jsx("strong",{children:"Primary Machine:"})," Your main coordinator node that will manage the cluster"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"Secondary Nodes:"})," Additional worker machines for distributed processing"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"SSH Access:"})," Ensure SSH is enabled and you have sudo privileges on all machines"]})]})]}),!k&&o.jsxs("div",{className:`rounded-lg p-4 ${e?"bg-green-900/20 border border-green-700/30":"bg-green-50 border border-green-200"}`,children:[o.jsx("h4",{className:`font-medium mb-2 ${e?"text-green-300":"text-green-900"}`,children:"🏁 Step 1: Configure Primary Machine"}),o.jsx("p",{className:`text-sm mb-3 ${e?"text-green-200":"text-green-800"}`,children:"Start by adding your primary machine that will act as the cluster coordinator."}),o.jsxs(zt,{onClick:Z,variant:"outline",size:"sm",className:`${e?"border-green-600 text-green-400 hover:bg-green-900/30":"border-green-300 text-green-700 hover:bg-green-100"}`,children:[o.jsx(pg,{className:"w-4 h-4 mr-2"}),"Add Primary Machine"]})]}),k&&o.jsxs("div",{className:"flex justify-between items-center",children:[o.jsx("h3",{className:`text-lg font-semibold ${e?"text-white":"text-gray-900"}`,children:"Cluster Nodes"}),o.jsxs(zt,{onClick:q,variant:"outline",size:"sm",className:`${e?"border-gray-600 text-gray-300 hover:bg-gray-700":"border-gray-300 text-gray-700 hover:bg-gray-50"}`,children:[o.jsx(pg,{className:"w-4 h-4 mr-2"}),"Add Secondary Node"]})]}),l.map((Y,V)=>o.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:O<I?f.direction==="asc"?-1:1:O>I?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.length<e)throw new TypeError(e+" argument"+(e>1?"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<t?7:0)+n-t;return r.setUTCDate(r.getUTCDate()-i),r.setUTCHours(0,0,0,0),r}function eM(e){vt(1,arguments);var t=ut(e),r=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(r+1,0,4),n.setUTCHours(0,0,0,0);var i=yg(n),a=new Date(0);a.setUTCFullYear(r,0,4),a.setUTCHours(0,0,0,0);var s=yg(a);return t.getTime()>=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<f?7:0)+m-f;return h.setUTCDate(h.getUTCDate()-y),h.setUTCHours(0,0,0,0),h}function tM(e,t){var r,n,i,a,s,l,c,u;vt(1,arguments);var d=ut(e),f=d.getUTCFullYear(),h=Vh(),m=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:h.firstWeekContainsDate)!==null&&n!==void 0?n:(c=h.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:1);if(!(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.length<t;)n="0"+n;return r+n}var za={y:function(t,r){var n=t.getUTCFullYear(),i=n>0?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;r<e.length;r++)if(t(e[r]))return r}function IZ(e){return function(t){var r=arguments.length>1&&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(m<sE){var p=Math.round(m/60);return s.formatDistance("aboutXHours",p,c)}else{if(m<nX)return s.formatDistance("xDays",1,c);if(m<ux){var x=Math.round(m/sE);return s.formatDistance("xDays",x,c)}else if(m<iX)return y=Math.round(m/ux),s.formatDistance("aboutXMonths",y,c)}if(y=eZ(d,u),y<12){var g=Math.round(m/ux);return s.formatDistance("xMonths",g,c)}else{var v=y%12,w=Math.floor(y/12);return v<3?s.formatDistance("aboutXYears",w,c):v<9?s.formatDistance("overXYears",w,c):s.formatDistance("almostXYears",w+1,c)}}function kc(e,t){return vt(1,arguments),aX(e,Date.now(),t)}function sX(){const[e,t]=b.useState(null),[r,n]=b.useState(!1),[i,a]=b.useState("all"),{data:s=[],isLoading:l,refetch:c}=$r({queryKey:["workflow-templates"],queryFn:async()=>u()}),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;n<i;n++)t.call(null,e[n],n,e);else{const a=r?Object.getOwnPropertyNames(e):Object.keys(e),s=a.length;let l;for(n=0;n<s;n++)l=a[n],t.call(null,e[l],l,e)}}function cM(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length,i;for(;n-- >0;)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<i;n++)arguments[n]&&Hh(arguments[n],r);return t}const NX=(e,t,r,{allOwnKeys: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<i;n++)a=r[n],t[a]=e[a];return t}function xM(e){function t(r,n,i,a){let s=r[a++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=a>=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<t)return;const m=d&&u-d;return m?Math.round(h*1e3/m):void 0}}function gQ(e,t){let r=0,n=1e3/t,i,a;const s=(u,d=Date.now())=>{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<t){yield e;return}let n=0,i;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},SQ=async function*(e,t){for await(const r of kQ(e))yield*NQ(r,t)},kQ=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},pE=(e,t,r,n)=>{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<t;a++){r=e[a];let s;if(n=r,!TQ(r)&&(n=Lw[(s=String(r)).toLowerCase()],n===void 0))throw new Me(`Unknown adapter '${s}'`);if(n)break;i[s||"#"+a]=n}if(!n){const a=Object.entries(i).map(([l,c])=>`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<h;)d=d.then(y[f++],y[f++]);return d}h=l.length;let m=r;for(f=0;f<h;){const y=l[f++],p=l[f++];try{m=y(m)}catch(x){p.call(this,x);break}}try{d=vE.call(this,m)}catch(y){return Promise.reject(y)}for(f=0,h=u.length;f<h;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=vl(this.defaults,t);const r=jM(t.baseURL,t.url,t.allowAbsoluteUrls);return yM(r,t.params,t.paramsSerializer)}};G.forEach(["delete","get","head","options"],function(t){Jo.prototype[t]=function(r,n){return this.request(vl(n||{},{method:t,url:r,data:(n||{}).data}))}});G.forEach(["post","put","patch"],function(t){function r(n){return function(a,s,l){return this.request(vl(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:a,data:s}))}}Jo.prototype[t]=r(),Jo.prototype[t+"Form"]=r(!0)});let MQ=class OM{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(a){r=a});const n=this;this.promise.then(i=>{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<i;t++)e[t]&&(r=PM(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function $e(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=PM(e))&&(n&&(n+=" "),n+=t);return n}var zQ=Array.isArray,Jr=zQ,UQ=typeof im=="object"&&im&&im.Object===Object&&im,CM=UQ,WQ=CM,VQ=typeof self=="object"&&self&&self.Object===Object&&self,HQ=WQ||VQ||Function("return this")(),Hi=HQ,qQ=Hi,KQ=qQ.Symbol,Kh=KQ,bE=Kh,TM=Object.prototype,GQ=TM.hasOwnProperty,YQ=TM.toString,xd=bE?bE.toStringTag:void 0;function ZQ(e){var t=GQ.call(e,xd),r=e[xd];try{e[xd]=void 0;var n=!0}catch{}var i=YQ.call(e);return n&&(t?e[xd]=r:delete e[xd]),i}var XQ=ZQ,QQ=Object.prototype,JQ=QQ.toString;function eJ(e){return JQ.call(e)}var tJ=eJ,wE=Kh,rJ=XQ,nJ=tJ,iJ="[object Null]",aJ="[object Undefined]",jE=wE?wE.toStringTag:void 0;function sJ(e){return e==null?e===void 0?aJ:iJ:jE&&jE in Object(e)?rJ(e):nJ(e)}var Ma=sJ;function oJ(e){return e!=null&&typeof e=="object"}var Ra=oJ,lJ=Ma,cJ=Ra,uJ="[object Symbol]";function dJ(e){return typeof e=="symbol"||cJ(e)&&lJ(e)==uJ}var zu=dJ,fJ=Jr,hJ=zu,mJ=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pJ=/^\w*$/;function gJ(e,t){if(fJ(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||hJ(e)?!0:pJ.test(e)||!mJ.test(e)||t!=null&&e in Object(t)}var a_=gJ;function yJ(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ro=yJ;const Uu=Xe(ro);var vJ=Ma,xJ=ro,bJ="[object AsyncFunction]",wJ="[object Function]",jJ="[object GeneratorFunction]",_J="[object Proxy]";function NJ(e){if(!xJ(e))return!1;var t=vJ(e);return t==wJ||t==jJ||t==bJ||t==_J}var s_=NJ;const ke=Xe(s_);var SJ=Hi,kJ=SJ["__core-js_shared__"],EJ=kJ,mx=EJ,_E=function(){var e=/[^.]+$/.exec(mx&&mx.keys&&mx.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function OJ(e){return!!_E&&_E in e}var AJ=OJ,PJ=Function.prototype,CJ=PJ.toString;function TJ(e){if(e!=null){try{return CJ.call(e)}catch{}try{return e+""}catch{}}return""}var $M=TJ,$J=s_,MJ=AJ,RJ=ro,IJ=$M,DJ=/[\\^$.*+?()[\]{}|]/g,LJ=/^\[object .+?Constructor\]$/,FJ=Function.prototype,BJ=Object.prototype,zJ=FJ.toString,UJ=BJ.hasOwnProperty,WJ=RegExp("^"+zJ.call(UJ).replace(DJ,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function VJ(e){if(!RJ(e)||MJ(e))return!1;var t=$J(e)?WJ:LJ;return t.test(IJ(e))}var HJ=VJ;function qJ(e,t){return e==null?void 0:e[t]}var KJ=qJ,GJ=HJ,YJ=KJ;function ZJ(e,t){var r=YJ(e,t);return GJ(r)?r:void 0}var Pl=ZJ,XJ=Pl,QJ=XJ(Object,"create"),f0=QJ,NE=f0;function JJ(){this.__data__=NE?NE(null):{},this.size=0}var eee=JJ;function tee(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var ree=tee,nee=f0,iee="__lodash_hash_undefined__",aee=Object.prototype,see=aee.hasOwnProperty;function oee(e){var t=this.__data__;if(nee){var r=t[e];return r===iee?void 0:r}return see.call(t,e)?t[e]:void 0}var lee=oee,cee=f0,uee=Object.prototype,dee=uee.hasOwnProperty;function fee(e){var t=this.__data__;return cee?t[e]!==void 0:dee.call(t,e)}var hee=fee,mee=f0,pee="__lodash_hash_undefined__";function gee(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=mee&&t===void 0?pee:t,this}var yee=gee,vee=eee,xee=ree,bee=lee,wee=hee,jee=yee;function Wu(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Wu.prototype.clear=vee;Wu.prototype.delete=xee;Wu.prototype.get=bee;Wu.prototype.has=wee;Wu.prototype.set=jee;var _ee=Wu;function Nee(){this.__data__=[],this.size=0}var See=Nee;function kee(e,t){return e===t||e!==e&&t!==t}var o_=kee,Eee=o_;function Oee(e,t){for(var r=e.length;r--;)if(Eee(e[r][0],t))return r;return-1}var h0=Oee,Aee=h0,Pee=Array.prototype,Cee=Pee.splice;function Tee(e){var t=this.__data__,r=Aee(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Cee.call(t,r,1),--this.size,!0}var $ee=Tee,Mee=h0;function Ree(e){var t=this.__data__,r=Mee(t,e);return r<0?void 0:t[r][1]}var Iee=Ree,Dee=h0;function Lee(e){return Dee(this.__data__,e)>-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();++t<r;){var n=e[t];this.set(n[0],n[1])}}Vu.prototype.clear=Wee;Vu.prototype.delete=Vee;Vu.prototype.get=Hee;Vu.prototype.has=qee;Vu.prototype.set=Kee;var m0=Vu,Gee=Pl,Yee=Hi,Zee=Gee(Yee,"Map"),l_=Zee,SE=_ee,Xee=m0,Qee=l_;function Jee(){this.size=0,this.__data__={hash:new SE,map:new(Qee||Xee),string:new SE}}var ete=Jee;function tte(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var rte=tte,nte=rte;function ite(e,t){var r=e.__data__;return nte(t)?r[typeof t=="string"?"string":"hash"]:r.map}var p0=ite,ate=p0;function ste(e){var t=ate(this,e).delete(e);return this.size-=t?1:0,t}var ote=ste,lte=p0;function cte(e){return lte(this,e).get(e)}var ute=cte,dte=p0;function fte(e){return dte(this,e).has(e)}var hte=fte,mte=p0;function pte(e,t){var r=mte(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var gte=pte,yte=ete,vte=ote,xte=ute,bte=hte,wte=gte;function Hu(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Hu.prototype.clear=yte;Hu.prototype.delete=vte;Hu.prototype.get=xte;Hu.prototype.has=bte;Hu.prototype.set=wte;var c_=Hu,MM=c_,jte="Expected a function";function u_(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(jte);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=e.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(u_.Cache||MM),r}u_.Cache=MM;var RM=u_;const _te=Xe(RM);var Nte=RM,Ste=500;function kte(e){var t=Nte(e,function(n){return r.size===Ste&&r.clear(),n}),r=t.cache;return t}var Ete=kte,Ote=Ete,Ate=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pte=/\\(\\)?/g,Cte=Ote(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Ate,function(r,n,i,a){t.push(i?a.replace(Pte,"$1"):n||r)}),t}),Tte=Cte;function $te(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var d_=$te,kE=Kh,Mte=d_,Rte=Jr,Ite=zu,EE=kE?kE.prototype:void 0,OE=EE?EE.toString:void 0;function IM(e){if(typeof e=="string")return e;if(Rte(e))return Mte(e,IM)+"";if(Ite(e))return OE?OE.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Dte=IM,Lte=Dte;function Fte(e){return e==null?"":Lte(e)}var DM=Fte,Bte=Jr,zte=a_,Ute=Tte,Wte=DM;function Vte(e,t){return Bte(e)?e:zte(e,t)?[e]:Ute(Wte(e))}var LM=Vte,Hte=zu;function qte(e){if(typeof e=="string"||Hte(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var g0=qte,Kte=LM,Gte=g0;function Yte(e,t){t=Kte(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[Gte(t[r++])];return r&&r==n?e:void 0}var f_=Yte,Zte=f_;function Xte(e,t,r){var n=e==null?void 0:Zte(e,t);return n===void 0?r:n}var FM=Xte;const fn=Xe(FM);function Qte(e){return e==null}var Jte=Qte;const Ae=Xe(Jte);var ere=Ma,tre=Jr,rre=Ra,nre="[object String]";function ire(e){return typeof e=="string"||!tre(e)&&rre(e)&&ere(e)==nre}var are=ire;const xl=Xe(are);var BM={exports:{}},rt={};/**
|
||
* @license React
|
||
* react-is.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 h_=Symbol.for("react.element"),m_=Symbol.for("react.portal"),y0=Symbol.for("react.fragment"),v0=Symbol.for("react.strict_mode"),x0=Symbol.for("react.profiler"),b0=Symbol.for("react.provider"),w0=Symbol.for("react.context"),sre=Symbol.for("react.server_context"),j0=Symbol.for("react.forward_ref"),_0=Symbol.for("react.suspense"),N0=Symbol.for("react.suspense_list"),S0=Symbol.for("react.memo"),k0=Symbol.for("react.lazy"),ore=Symbol.for("react.offscreen"),zM;zM=Symbol.for("react.module.reference");function zn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case h_:switch(e=e.type,e){case y0:case x0:case v0:case _0:case N0:return e;default:switch(e=e&&e.$$typeof,e){case sre:case w0:case j0:case k0:case S0:case b0:return e;default:return t}}case m_:return t}}}rt.ContextConsumer=w0;rt.ContextProvider=b0;rt.Element=h_;rt.ForwardRef=j0;rt.Fragment=y0;rt.Lazy=k0;rt.Memo=S0;rt.Portal=m_;rt.Profiler=x0;rt.StrictMode=v0;rt.Suspense=_0;rt.SuspenseList=N0;rt.isAsyncMode=function(){return!1};rt.isConcurrentMode=function(){return!1};rt.isContextConsumer=function(e){return zn(e)===w0};rt.isContextProvider=function(e){return zn(e)===b0};rt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===h_};rt.isForwardRef=function(e){return zn(e)===j0};rt.isFragment=function(e){return zn(e)===y0};rt.isLazy=function(e){return zn(e)===k0};rt.isMemo=function(e){return zn(e)===S0};rt.isPortal=function(e){return zn(e)===m_};rt.isProfiler=function(e){return zn(e)===x0};rt.isStrictMode=function(e){return zn(e)===v0};rt.isSuspense=function(e){return zn(e)===_0};rt.isSuspenseList=function(e){return zn(e)===N0};rt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===y0||e===x0||e===v0||e===_0||e===N0||e===ore||typeof e=="object"&&e!==null&&(e.$$typeof===k0||e.$$typeof===S0||e.$$typeof===b0||e.$$typeof===w0||e.$$typeof===j0||e.$$typeof===zM||e.getModuleId!==void 0)};rt.typeOf=zn;BM.exports=rt;var lre=BM.exports,cre=Ma,ure=Ra,dre="[object Number]";function fre(e){return typeof e=="number"||ure(e)&&cre(e)==dre}var UM=fre;const hre=Xe(UM);var mre=UM;function pre(e){return mre(e)&&e!=+e}var gre=pre;const qu=Xe(gre);var Mr=function(t){return t===0?0:t>0?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<r;i++)if(!n[t[i]])n[t[i]]=!0;else return!0;return!1},Xt=function(t,r){return re(t)&&re(r)?function(n){return t+n*(r-t)}:function(){return r}};function wg(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):fn(n,t))===r})}var bre=function(t,r){return re(t)&&re(r)?t-r:xl(t)&&xl(r)?t.localeCompare(r):t instanceof Date&&r instanceof Date?t.getTime()-r.getTime():String(t).localeCompare(String(r))};function Ec(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function Bw(e){"@babel/helpers - typeof";return Bw=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},Bw(e)}var wre=["viewBox","children"],jre=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],AE=["points","pathLength"],px={svg:wre,polygon:AE,polyline:AE},p_=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],jg=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(b.isValidElement(t)&&(n=t.props),!Uu(n))return null;var i={};return Object.keys(n).forEach(function(a){p_.includes(a)&&(i[a]=r||function(s){return n[a](n,s)})}),i},_re=function(t,r,n){return function(i){return t(r,n,i),null}},bl=function(t,r,n){if(!Uu(t)||Bw(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(a){var s=t[a];p_.includes(a)&&typeof s=="function"&&(i||(i={}),i[a]=_re(s,r,n))}),i},Nre=["children"],Sre=["children"];function PE(e,t){if(e==null)return{};var r=kre(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=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<n;i++){var a=t[i],s=r[i];if(Array.isArray(a)||Array.isArray(s)){if(!e(a,s))return!1}else if(!ME(a,s))return!1}return!0},ME=function(t,r){if(Ae(t)&&Ae(r))return!0;if(!Ae(t)&&!Ae(r)){var n=t.props||{},i=n.children,a=PE(n,Nre),s=r.props||{},l=s.children,c=PE(s,Sre);return i&&l?Ec(a,c)&&Uw(i,l):!i&&!l?Ec(a,c):!1}return!1},RE=function(t,r){var n=[],i={};return g_(t).forEach(function(a,s){if(Ore(a))n.push(a);else if(a){var l=pa(a.type),c=r[l]||{},u=c.handler,d=c.once;if(u&&(!d||!i[l])){var f=u(a,l,s);n.push(f),i[l]=!0}}}),n},Pre=function(t){var r=t&&t.type;return r&&CE[r]?CE[r]:null},Cre=function(t,r){return g_(r).indexOf(t)},Tre=["children","width","height","viewBox","className","style","title","desc"];function Ww(){return Ww=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ww.apply(this,arguments)}function $re(e,t){if(e==null)return{};var r=Mre(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=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<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hw.apply(this,arguments)}function Ire(e,t){if(e==null)return{};var r=Dre(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=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;a<n;a++)i[a-2]=arguments[a]};function Lre(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?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<i;)a[n]=e[n+t];return a}var Fre=Lre,Bre=Fre;function zre(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=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<r;++t)this._+=arguments[t]+e[t]}function Ane(e){let t=Math.floor(e);if(!(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;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class Pne{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?QM:Ane(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,a,s){this._append`C${+t},${+r},${+n},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(t,r,n,i,a){if(t=+t,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,l=this._y1,c=n-t,u=i-r,d=s-t,f=l-r,h=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>xo)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<d&&r(f=c[u],u,c))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(f,u,c),+t(f,u,c));if(m)return a=null,m+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:lt(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:lt(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:lt(!!c),l):r},l.curve=function(c){return arguments.length?(i=c,n!=null&&(a=i(n)),l):i},l.context=function(c){return arguments.length?(c==null?n=a=null:a=i(n=c),l):n},l}function Rm(e,t,r){var n=null,i=lt(!0),a=null,s=A0,l=null,c=y_(u);e=typeof e=="function"?e:e===void 0?eR:lt(+e),t=typeof t=="function"?t:lt(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?tR:lt(+r);function u(f){var h,m,y,p=(f=v_(f)).length,x,g=!1,v,w=new Array(p),_=new Array(p);for(a==null&&(l=s(v=c())),h=0;h<=p;++h){if(!(h<p&&i(x=f[h],h,f))===g)if(g=!g)m=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),y=h-1;y>=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<r;++a,++s)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],e[s],t[s]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function FE(e){var t,r=e.length-1,n,i=new Array(r),a=new Array(r),s=new Array(r);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,a[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/a[t-1],a[t]-=n,s[t]-=n*s[t-1];for(i[r-1]=s[r-1]/a[r-1],t=r-2;t>=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Xne(e){return new fR(e)}function P0(e,t){this._context=e,this._t=t}P0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=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<s;++r)for(i=a,a=e[t[r]],n=0;n<l;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Xw(e){for(var t=e.length,r=new Array(t);--t>=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;l<c;++l)(s[l][u]=[0,+n(f,s[l].key,u,a)]).data=f;for(l=0,d=v_(t(s));l<c;++l)s[d[l]].index=l;return r(s,d),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:lt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:lt(+a),i):n},i.order=function(a){return arguments.length?(t=a==null?Xw:typeof a=="function"?a:lt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(r=a??Jc,i):r},i}function iie(e,t){if((n=e.length)>0){for(var r,n,i=0,a=e[0].length,s;i<a;++i){for(s=r=0;r<n;++r)s+=e[r][i][1]||0;if(s)for(r=0;r<n;++r)e[r][i][1]/=s}Jc(e,t)}}function aie(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,a=n.length;r<a;++r){for(var s=0,l=0;s<i;++s)l+=e[s][r][1]||0;n[r][1]+=n[r][0]=-l/2}Jc(e,t)}}function sie(e,t){if(!(!((s=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,s;n<a;++n){for(var l=0,c=0,u=0;l<s;++l){for(var d=e[t[l]],f=d[n][1]||0,h=d[n-1][1]||0,m=(f-h)/2,y=0;y<l;++y){var p=e[t[y]],x=p[n][1]||0,g=p[n-1][1]||0;m+=x-g}c+=f,u+=m*f}i[n-1][1]+=i[n-1][0]=r,c&&(r-=u/c)}i[n-1][1]+=i[n-1][0]=r,Jc(e,t)}}function Yf(e){"@babel/helpers - typeof";return Yf=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},Yf(e)}var oie=["type","size","sizeType"];function Qw(){return Qw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qw.apply(this,arguments)}function BE(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 zE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?BE(Object(r),!0).forEach(function(n){lie(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lie(e,t,r){return t=cie(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cie(e){var t=uie(e,"string");return Yf(t)=="symbol"?t:t+""}function uie(e,t){if(Yf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Yf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function die(e,t){if(e==null)return{};var r=fie(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(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<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jw.apply(this,arguments)}function UE(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 yie(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?UE(Object(r),!0).forEach(function(n){Zf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):UE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xie(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pR(n.key),n)}}function bie(e,t,r){return t&&xie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function wie(e,t,r){return t=Og(t),jie(e,mR()?Reflect.construct(t,r||[],Og(e).constructor):t.apply(e,r))}function jie(e,t){if(t&&(eu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _ie(e)}function _ie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mR=function(){return!!e})()}function Og(e){return Og=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Og(e)}function Nie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&e1(e,t)}function e1(e,t){return e1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},e1(e,t)}function Zf(e,t,r){return t=pR(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pR(e){var t=Sie(e,"string");return eu(t)=="symbol"?t:t+""}function Sie(e,t){if(eu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(eu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Nn=32,w_=function(e){function t(){return vie(this,t),wie(this,t,arguments)}return Nie(t,e),bie(t,[{key:"renderIcon",value:function(n){var i=this.props.inactiveColor,a=Nn/2,s=Nn/6,l=Nn/3,c=n.inactive?i:n.color;if(n.type==="plainline")return T.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:a,x2:Nn,y2:a,className:"recharts-legend-icon"});if(n.type==="line")return T.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(l,`
|
||
A`).concat(s,",").concat(s,",0,1,1,").concat(2*l,",").concat(a,`
|
||
H`).concat(Nn,"M").concat(2*l,",").concat(a,`
|
||
A`).concat(s,",").concat(s,",0,1,1,").concat(l,",").concat(a),className:"recharts-legend-icon"});if(n.type==="rect")return T.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Nn/8,"h").concat(Nn,"v").concat(Nn*3/4,"h").concat(-Nn,"z"),className:"recharts-legend-icon"});if(T.isValidElement(n.legendIcon)){var u=yie({},n);return delete u.legendIcon,T.cloneElement(n.legendIcon,u)}return T.createElement(b_,{fill:c,cx:a,cy:a,size:Nn,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,a=i.payload,s=i.iconSize,l=i.layout,c=i.formatter,u=i.inactiveColor,d={x:0,y:0,width:Nn,height:Nn},f={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(m,y){var p=m.formatter||c,x=$e(Zf(Zf({"recharts-legend-item":!0},"legend-item-".concat(y),!0),"inactive",m.inactive));if(m.type==="none")return null;var g=ke(m.value)?null:m.value;mi(!ke(m.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);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.length<Lie-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Die(n)}return r.set(e,t),this.size=r.size,this}var Bie=Fie,zie=m0,Uie=Oie,Wie=Pie,Vie=Tie,Hie=Mie,qie=Bie;function Ku(e){var t=this.__data__=new zie(e);this.size=t.size}Ku.prototype.clear=Uie;Ku.prototype.delete=Wie;Ku.prototype.get=Vie;Ku.prototype.has=Hie;Ku.prototype.set=qie;var gR=Ku,Kie="__lodash_hash_undefined__";function Gie(e){return this.__data__.set(e,Kie),this}var Yie=Gie;function Zie(e){return this.__data__.has(e)}var Xie=Zie,Qie=c_,Jie=Yie,eae=Xie;function Ag(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Qie;++t<r;)this.add(e[t])}Ag.prototype.add=Ag.prototype.push=Jie;Ag.prototype.has=eae;var yR=Ag;function tae(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var vR=tae;function rae(e,t){return e.has(t)}var xR=rae,nae=yR,iae=vR,aae=xR,sae=1,oae=2;function lae(e,t,r,n,i,a){var s=r&sae,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))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<l;){var y=e[f],p=t[f];if(n)var x=s?n(p,y,f,t,e,a):n(y,p,f,e,t,a);if(x!==void 0){if(x)continue;h=!1;break}if(m){if(!iae(t,function(g,v){if(!aae(m,v)&&(y===g||i(y,g,r,n,a)))return m.push(v)})){h=!1;break}}else if(!(y===p||i(y,p,r,n,a))){h=!1;break}}return a.delete(e),a.delete(t),h}var bR=lae,cae=Hi,uae=cae.Uint8Array,dae=uae;function fae(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var hae=fae;function mae(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var j_=mae,WE=Kh,VE=dae,pae=o_,gae=bR,yae=hae,vae=j_,xae=1,bae=2,wae="[object Boolean]",jae="[object Date]",_ae="[object Error]",Nae="[object Map]",Sae="[object Number]",kae="[object RegExp]",Eae="[object Set]",Oae="[object String]",Aae="[object Symbol]",Pae="[object ArrayBuffer]",Cae="[object DataView]",HE=WE?WE.prototype:void 0,xx=HE?HE.valueOf:void 0;function Tae(e,t,r,n,i,a,s){switch(r){case Cae:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Pae:return!(e.byteLength!=t.byteLength||!a(new VE(e),new VE(t)));case wae:case jae:case Sae:return pae(+e,+t);case _ae:return e.name==t.name&&e.message==t.message;case kae:case Oae:return e==t+"";case Nae:var l=yae;case Eae:var c=n&xae;if(l||(l=vae),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;n|=bae,s.set(e,t);var d=gae(l(e),l(t),n,i,a,s);return s.delete(e),d;case Aae:if(xx)return xx.call(e)==xx.call(t)}return!1}var $ae=Tae;function Mae(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var wR=Mae,Rae=wR,Iae=Jr;function Dae(e,t,r){var n=t(e);return Iae(e)?n:Rae(n,r(e))}var Lae=Dae;function Fae(e,t){for(var r=-1,n=e==null?0:e.length,i=0,a=[];++r<n;){var s=e[r];t(s,r,e)&&(a[i++]=s)}return a}var Bae=Fae;function zae(){return[]}var Uae=zae,Wae=Bae,Vae=Uae,Hae=Object.prototype,qae=Hae.propertyIsEnumerable,qE=Object.getOwnPropertySymbols,Kae=qE?function(e){return e==null?[]:(e=Object(e),Wae(qE(e),function(t){return qae.call(e,t)}))}:Vae,Gae=Kae;function Yae(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var Zae=Yae,Xae=Ma,Qae=Ra,Jae="[object Arguments]";function ese(e){return Qae(e)&&Xae(e)==Jae}var tse=ese,KE=tse,rse=Ra,jR=Object.prototype,nse=jR.hasOwnProperty,ise=jR.propertyIsEnumerable,ase=KE(function(){return arguments}())?KE:function(e){return rse(e)&&nse.call(e,"callee")&&!ise.call(e,"callee")},__=ase,Pg={exports:{}};function sse(){return!1}var ose=sse;Pg.exports;(function(e,t){var r=Hi,n=ose,i=t&&!t.nodeType&&t,a=i&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===i,l=s?r.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||n;e.exports=u})(Pg,Pg.exports);var _R=Pg.exports,lse=9007199254740991,cse=/^(?:0|[1-9]\d*)$/;function use(e,t){var r=typeof e;return t=t??lse,!!t&&(r=="number"||r!="symbol"&&cse.test(e))&&e>-1&&e%1==0&&e<t}var N_=use,dse=9007199254740991;function fse(e){return typeof e=="number"&&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<c;){h=l[f];var g=e[h],v=t[h];if(n)var w=s?n(v,g,h,t,e,a):n(g,v,h,e,t,a);if(!(w===void 0?g===v||i(g,v,r,n,a):w)){p=!1;break}x||(x=h=="constructor")}if(p&&!x){var _=e.constructor,j=t.constructor;_!=j&&"constructor"in e&&"constructor"in t&&!(typeof _=="function"&&_ instanceof _&&typeof j=="function"&&j instanceof j)&&(p=!1)}return a.delete(e),a.delete(t),p}var Toe=Coe,$oe=Pl,Moe=Hi,Roe=$oe(Moe,"DataView"),Ioe=Roe,Doe=Pl,Loe=Hi,Foe=Doe(Loe,"Promise"),Boe=Foe,zoe=Pl,Uoe=Hi,Woe=zoe(Uoe,"Set"),ER=Woe,Voe=Pl,Hoe=Hi,qoe=Voe(Hoe,"WeakMap"),Koe=qoe,t1=Ioe,r1=l_,n1=Boe,i1=ER,a1=Koe,OR=Ma,Gu=$M,XE="[object Map]",Goe="[object Object]",QE="[object Promise]",JE="[object Set]",eO="[object WeakMap]",tO="[object DataView]",Yoe=Gu(t1),Zoe=Gu(r1),Xoe=Gu(n1),Qoe=Gu(i1),Joe=Gu(a1),bo=OR;(t1&&bo(new t1(new ArrayBuffer(1)))!=tO||r1&&bo(new r1)!=XE||n1&&bo(n1.resolve())!=QE||i1&&bo(new i1)!=JE||a1&&bo(new a1)!=eO)&&(bo=function(e){var t=OR(e),r=t==Goe?e.constructor:void 0,n=r?Gu(r):"";if(n)switch(n){case Yoe:return tO;case Zoe:return XE;case Xoe:return QE;case Qoe:return JE;case Joe:return eO}return t});var ele=bo,bx=gR,tle=bR,rle=$ae,nle=Toe,rO=ele,nO=Jr,iO=_R,ile=SR,ale=1,aO="[object Arguments]",sO="[object Array]",Im="[object Object]",sle=Object.prototype,oO=sle.hasOwnProperty;function ole(e,t,r,n,i,a){var s=nO(e),l=nO(t),c=s?sO:rO(e),u=l?sO:rO(t);c=c==aO?Im:c,u=u==aO?Im:u;var d=c==Im,f=u==Im,h=c==u;if(h&&iO(e)){if(!iO(t))return!1;s=!0,d=!1}if(h&&!d)return a||(a=new bx),s||ile(e)?tle(e,t,r,n,i,a):rle(e,t,c,r,n,i,a);if(!(r&ale)){var m=d&&oO.call(e,"__wrapped__"),y=f&&oO.call(t,"__wrapped__");if(m||y){var p=m?e.value():e,x=y?t.value():t;return a||(a=new bx),i(p,x,r,n,a)}}return h?(a||(a=new bx),nle(e,t,r,n,i,a)):!1}var lle=ole,cle=lle,lO=Ra;function AR(e,t,r,n,i){return e===t?!0:e==null||t==null||!lO(e)&&!lO(t)?e!==e&&t!==t:cle(e,t,r,n,AR,i)}var k_=AR,ule=gR,dle=k_,fle=1,hle=2;function mle(e,t,r,n){var i=r.length,a=i,s=!n;if(e==null)return!a;for(e=Object(e);i--;){var l=r[i];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<a;){l=r[i];var c=l[0],u=e[c],d=l[1];if(s&&l[2]){if(u===void 0&&!(c in e))return!1}else{var f=new ule;if(n)var h=n(u,d,c,e,t,f);if(!(h===void 0?dle(d,u,fle|hle,n,f):h))return!1}}return!0}var ple=mle,gle=ro;function yle(e){return e===e&&!gle(e)}var PR=yle,vle=PR,xle=C0;function ble(e){for(var t=xle(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,vle(i)]}return t}var wle=ble;function jle(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var CR=jle,_le=ple,Nle=wle,Sle=CR;function kle(e){var t=Nle(e);return t.length==1&&t[0][2]?Sle(t[0][0],t[0][1]):function(r){return r===e||_le(r,e,t)}}var Ele=kle;function Ole(e,t){return e!=null&&t in Object(e)}var Ale=Ole,Ple=LM,Cle=__,Tle=Jr,$le=N_,Mle=S_,Rle=g0;function Ile(e,t,r){t=Ple(t,e);for(var n=-1,i=t.length,a=!1;++n<i;){var s=Rle(t[n]);if(!(a=e!=null&&r(e,s)))break;e=e[s]}return a||++n!=i?a:(i=e==null?0:e.length,!!i&&Mle(i)&&$le(s,i)&&(Tle(e)||Cle(e)))}var Dle=Ile,Lle=Ale,Fle=Dle;function Ble(e,t){return e!=null&&Fle(e,t,Lle)}var zle=Ble,Ule=k_,Wle=FM,Vle=zle,Hle=a_,qle=PR,Kle=CR,Gle=g0,Yle=1,Zle=2;function Xle(e,t){return Hle(e)&&qle(t)?Kle(Gle(e),t):function(r){var n=Wle(r,e);return n===void 0&&n===t?Vle(r,e):Ule(t,n,Yle|Zle)}}var Qle=Xle;function Jle(e){return e}var Yu=Jle;function ece(e){return function(t){return t==null?void 0:t[e]}}var tce=ece,rce=f_;function nce(e){return function(t){return rce(t,e)}}var ice=nce,ace=tce,sce=ice,oce=a_,lce=g0;function cce(e){return oce(e)?ace(lce(e)):sce(e)}var uce=cce,dce=Ele,fce=Qle,hce=Yu,mce=Jr,pce=uce;function gce(e){return typeof e=="function"?e:e==null?hce:typeof e=="object"?mce(e)?fce(e[0],e[1]):dce(e):pce(e)}var qi=gce;function yce(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}var TR=yce;function vce(e){return e!==e}var xce=vce;function bce(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var wce=bce,jce=TR,_ce=xce,Nce=wce;function Sce(e,t,r){return t===t?Nce(e,t,r):jce(e,_ce,r)}var kce=Sce,Ece=kce;function Oce(e,t){var r=e==null?0:e.length;return!!r&&Ece(e,t,0)>-1}var Ace=Oce;function Pce(e,t,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}var Cce=Pce;function Tce(){}var $ce=Tce,wx=ER,Mce=$ce,Rce=j_,Ice=1/0,Dce=wx&&1/Rce(new wx([,-0]))[1]==Ice?function(e){return new wx(e)}:Mce,Lce=Dce,Fce=yR,Bce=Ace,zce=Cce,Uce=xR,Wce=Lce,Vce=j_,Hce=200;function qce(e,t,r){var n=-1,i=Bce,a=e.length,s=!0,l=[],c=l;if(r)s=!1,i=zce;else if(a>=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<a;){var d=e[n],f=t?t(d):d;if(d=r||d!==0?d:0,s&&f===f){for(var h=c.length;h--;)if(c[h]===f)continue e;t&&c.push(f),l.push(d)}else i(c,f,r)||(c!==l&&c.push(f),l.push(d))}return l}var Kce=qce,Gce=qi,Yce=Kce;function Zce(e,t){return e&&e.length?Yce(e,Gce(t)):[]}var Xce=Zce;const cO=Xe(Xce);function $R(e,t,r){return t===!0?cO(e,r):ke(t)?cO(e,t):e}function tu(e){"@babel/helpers - typeof";return tu=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},tu(e)}var Qce=["ref"];function uO(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 Zi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uO(Object(r),!0).forEach(function(n){T0(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Jce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dO(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,RR(n.key),n)}}function eue(e,t,r){return t&&dO(e.prototype,t),r&&dO(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function tue(e,t,r){return t=Tg(t),rue(e,MR()?Reflect.construct(t,r||[],Tg(e).constructor):t.apply(e,r))}function rue(e,t){if(t&&(tu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nue(e)}function nue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function MR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(MR=function(){return!!e})()}function Tg(e){return Tg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Tg(e)}function iue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s1(e,t)}function s1(e,t){return s1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},s1(e,t)}function T0(e,t,r){return t=RR(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RR(e){var t=aue(e,"string");return tu(t)=="symbol"?t:t+""}function aue(e,t){if(tu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(tu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function sue(e,t){if(e==null)return{};var r=oue(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(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;a<n;a++)i[a]=arguments[a];return r=tue(this,t,[].concat(i)),T0(r,"lastBoundingBox",{width:-1,height:-1}),r}return iue(t,e),eue(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>fO||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=[]);++a<s;){var l=e[a];t>0&&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--:++a<i)&&n(s[a],a,s)!==!1;);return r}}var kue=Sue,Eue=LR,Oue=kue,Aue=Oue(Eue),E_=Aue,Pue=E_,Cue=Gh;function Tue(e,t){var r=-1,n=Cue(e)?Array(e.length):[];return Pue(e,function(i,a,s){n[++r]=t(i,a,s)}),n}var FR=Tue;function $ue(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}var Mue=$ue,pO=zu;function Rue(e,t){if(e!==t){var r=e!==void 0,n=e===null,i=e===e,a=pO(e),s=t!==void 0,l=t===null,c=t===t,u=pO(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||n&&s&&c||!r&&c||!i)return 1;if(!n&&!a&&!u&&e<t||u&&r&&i&&!n&&!a||l&&r&&i||!s&&i||!c)return-1}return 0}var Iue=Rue,Due=Iue;function Lue(e,t,r){for(var n=-1,i=e.criteria,a=t.criteria,s=i.length,l=r.length;++n<s;){var c=Due(i[n],a[n]);if(c){if(n>=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);++i<a;)s[i]=n[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=n[i];return l[t]=r(s),Que(e,this,l)}}var ede=Jue;function tde(e){return function(){return e}}var rde=tde,nde=Pl,ide=function(){try{var e=nde(Object,"defineProperty");return e({},"",{}),e}catch{}}(),BR=ide,ade=rde,yO=BR,sde=Yu,ode=yO?function(e,t){return yO(e,"toString",{configurable:!0,enumerable:!1,value:ade(t),writable:!0})}:sde,lde=ode,cde=800,ude=16,dde=Date.now;function fde(e){var t=0,r=0;return function(){var n=dde(),i=ude-(n-r);if(r=n,i>0){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;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o1.apply(this,arguments)}function $de(e,t){return Dde(e)||Ide(e,t)||Rde(e,t)||Mde()}function Mde(){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 Rde(e,t){if(e){if(typeof e=="string")return xO(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 xO(e,t)}}function xO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ide(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Dde(e){if(Array.isArray(e))return e}function bO(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 _x(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bO(Object(r),!0).forEach(function(n){Lde(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Lde(e,t,r){return t=Fde(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fde(e){var t=Bde(e,"string");return Xf(t)=="symbol"?t:t+""}function Bde(e,t){if(Xf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Xf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zde(e){return Array.isArray(e)&&Jt(e[0])&&Jt(e[1])?e.join(" ~ "):e}var Ude=function(t){var r=t.separator,n=r===void 0?" : ":r,i=t.contentStyle,a=i===void 0?{}:i,s=t.itemStyle,l=s===void 0?{}:s,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,f=t.formatter,h=t.itemSorter,m=t.wrapperClassName,y=t.labelClassName,p=t.label,x=t.labelFormatter,g=t.accessibilityLayer,v=g===void 0?!1:g,w=function(){if(d&&d.length){var P={padding:0,margin:0},$=(h?O_(d,h):d).map(function(O,I){if(O.type==="none")return null;var D=_x({display:"block",paddingTop:4,paddingBottom:4,color:O.color||"#000"},l),L=O.formatter||f||zde,R=O.value,M=O.name,B=R,U=M;if(L&&B!=null&&U!=null){var W=L(R,M,O,I,d);if(Array.isArray(W)){var Z=$de(W,2);B=Z[0],U=Z[1]}else B=W}return T.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(I),style:D},Jt(U)?T.createElement("span",{className:"recharts-tooltip-item-name"},U):null,Jt(U)?T.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,T.createElement("span",{className:"recharts-tooltip-item-value"},B),T.createElement("span",{className:"recharts-tooltip-item-unit"},O.unit||""))});return T.createElement("ul",{className:"recharts-tooltip-item-list",style:P},$)}return null},_=_x({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),j=_x({margin:0},u),N=!Ae(p),S=N?p:"",E=$e("recharts-default-tooltip",m),k=$e("recharts-tooltip-label",y);N&&x&&d!==void 0&&d!==null&&(S=x(p,d));var A=v?{role:"status","aria-live":"assertive"}:{};return T.createElement("div",o1({className:E,style:_},A),T.createElement("p",{className:k,style:j},T.isValidElement(S)?S:"".concat(S)),w())};function Qf(e){"@babel/helpers - typeof";return Qf=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},Qf(e)}function Dm(e,t,r){return t=Wde(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wde(e){var t=Vde(e,"string");return Qf(t)=="symbol"?t:t+""}function Vde(e,t){if(Qf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Qf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bd="recharts-tooltip-wrapper",Hde={visibility:"hidden"};function qde(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return $e(bd,Dm(Dm(Dm(Dm({},"".concat(bd,"-right"),re(r)&&t&&re(t.x)&&r>=t.x),"".concat(bd,"-left"),re(r)&&t&&re(t.x)&&r<t.x),"".concat(bd,"-bottom"),re(n)&&t&&re(t.y)&&n>=t.y),"".concat(bd,"-top"),re(n)&&t&&re(t.y)&&n<t.y))}function wO(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,i=e.offsetTopLeft,a=e.position,s=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(a&&re(a[n]))return a[n];var d=r[n]-l-i,f=r[n]+i;if(t[n])return s[n]?d:f;if(s[n]){var h=d,m=c[n];return h<m?Math.max(f,c[n]):Math.max(d,c[n])}var y=f+l,p=c[n]+u;return y>p?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;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jO(Object(r),!0).forEach(function(n){c1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Yde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zde(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,UR(n.key),n)}}function Xde(e,t,r){return t&&Zde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qde(e,t,r){return t=$g(t),Jde(e,zR()?Reflect.construct(t,r||[],$g(e).constructor):t.apply(e,r))}function Jde(e,t){if(t&&(ru(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return efe(e)}function efe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zR=function(){return!!e})()}function $g(e){return $g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$g(e)}function tfe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l1(e,t)}function l1(e,t){return l1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},l1(e,t)}function c1(e,t,r){return t=UR(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UR(e){var t=rfe(e,"string");return ru(t)=="symbol"?t:t+""}function rfe(e,t){if(ru(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ru(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var NO=1,nfe=function(e){function t(){var r;Yde(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=Qde(this,t,[].concat(i)),c1(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),c1(r,"handleKeyDown",function(s){if(s.key==="Escape"){var l,c,u,d;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=r.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),r}return tfe(t,e),Xde(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>NO||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;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?SO(Object(r),!0).forEach(function(n){A_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function afe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sfe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,VR(n.key),n)}}function ofe(e,t,r){return t&&sfe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function lfe(e,t,r){return t=Mg(t),cfe(e,WR()?Reflect.construct(t,r||[],Mg(e).constructor):t.apply(e,r))}function cfe(e,t){if(t&&(nu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ufe(e)}function ufe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WR=function(){return!!e})()}function Mg(e){return Mg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Mg(e)}function dfe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u1(e,t)}function u1(e,t){return u1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},u1(e,t)}function A_(e,t,r){return t=VR(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VR(e){var t=ffe(e,"string");return nu(t)=="symbol"?t:t+""}function ffe(e,t){if(nu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(nu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function hfe(e){return e.dataKey}function mfe(e,t){return T.isValidElement(e)?T.cloneElement(e,t):typeof e=="function"?T.createElement(e,t):T.createElement(Ude,t)}var Wr=function(e){function t(){return afe(this,t),lfe(this,t,arguments)}return dfe(t,e),ofe(t,[{key:"render",value:function(){var n=this,i=this.props,a=i.active,s=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.content,d=i.coordinate,f=i.filterNull,h=i.isAnimationActive,m=i.offset,y=i.payload,p=i.payloadUniqBy,x=i.position,g=i.reverseDirection,v=i.useTranslate3d,w=i.viewBox,_=i.wrapperStyle,j=y??[];f&&j.length&&(j=$R(y.filter(function(S){return S.value!=null&&(S.hide!==!0||n.props.includeHidden)}),p,hfe));var N=j.length>0;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;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?PO(Object(r),!0).forEach(function(n){Wfe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wfe(e,t,r){return t=Vfe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vfe(e){var t=Hfe(e,"string");return Jf(t)=="symbol"?t:t+""}function Hfe(e,t){if(Jf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Jf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qfe(e,t){return Zfe(e)||Yfe(e,t)||Gfe(e,t)||Kfe()}function Kfe(){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 Gfe(e,t){if(e){if(typeof e=="string")return CO(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 CO(e,t)}}function CO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Yfe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Zfe(e){if(Array.isArray(e))return e}var wd=b.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,i=n===void 0?{width:-1,height:-1}:n,a=e.width,s=a===void 0?"100%":a,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,f=e.minHeight,h=e.maxHeight,m=e.children,y=e.debounce,p=y===void 0?0:y,x=e.id,g=e.className,v=e.onResize,w=e.style,_=w===void 0?{}:w,j=b.useRef(null),N=b.useRef();N.current=v,b.useImperativeHandle(t,function(){return Object.defineProperty(j.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),j.current},configurable:!0})});var S=b.useState({containerWidth:i.width,containerHeight:i.height}),E=qfe(S,2),k=E[0],A=E[1],C=b.useCallback(function($,O){A(function(I){var D=Math.round($),L=Math.round(O);return I.containerWidth===D&&I.containerHeight===L?I:{containerWidth:D,containerHeight:L}})},[]);b.useEffect(function(){var $=function(M){var B,U=M[0].contentRect,W=U.width,Z=U.height;C(W,Z),(B=N.current)===null||B===void 0||B.call(N,W,Z)};p>0&&($=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;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?TO(Object(r),!0).forEach(function(n){Xfe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):TO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xfe(e,t,r){return t=Qfe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qfe(e){var t=Jfe(e,"string");return eh(t)=="symbol"?t:t+""}function Jfe(e,t){if(eh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(eh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wl={widthCache:{},cacheCount:0},ehe=2e3,the={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},$O="recharts_measurement_span";function rhe(e){var t=d1({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var of=function(t){var r=arguments.length>1&&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<t;r++)n[r]=e[r];return n}function she(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function ohe(e){if(Array.isArray(e))return e}function lhe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RO(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,uhe(n.key),n)}}function che(e,t,r){return t&&RO(e.prototype,t),r&&RO(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function uhe(e){var t=dhe(e,"string");return th(t)=="symbol"?t:t+""}function dhe(e,t){if(th(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(th(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var IO=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,DO=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,fhe=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,hhe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,KR={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},mhe=Object.keys(KR),dc="NaN";function phe(e,t){return e*KR[t]}var Fm=function(){function e(t,r){lhe(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!fhe.test(r)&&(this.num=NaN,this.unit=""),mhe.includes(r)&&(this.num=phe(t,r),this.unit="px")}return che(e,[{key:"add",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,i=(n=hhe.exec(r))!==null&&n!==void 0?n:[],a=Rg(i,3),s=a[1],l=a[2];return new e(parseFloat(s),l??"")}}])}();function GR(e){if(e.includes(dc))return dc;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=IO.exec(t))!==null&&r!==void 0?r:[],i=Rg(n,4),a=i[1],s=i[2],l=i[3],c=Fm.parse(a??""),u=Fm.parse(l??""),d=s==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return dc;t=t.replace(IO,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=DO.exec(t))!==null&&f!==void 0?f:[],m=Rg(h,4),y=m[1],p=m[2],x=m[3],g=Fm.parse(y??""),v=Fm.parse(x??""),w=p==="+"?g.add(v):g.subtract(v);if(w.isNaN())return dc;t=t.replace(DO,w.toString())}return t}var LO=/\(([^()]*)\)/;function ghe(e){for(var t=e;t.includes("(");){var r=LO.exec(t),n=Rg(r,2),i=n[1];t=t.replace(LO,GR(i))}return t}function yhe(e){var t=e.replace(/\s+/g,"");return t=ghe(t),t=GR(t),t}function vhe(e){try{return yhe(e)}catch{return dc}}function Sx(e){var t=vhe(e.slice(5,-1));return t===dc?"":t}var xhe=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],bhe=["dx","dy","angle","className","breakAll"];function f1(){return f1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f1.apply(this,arguments)}function FO(e,t){if(e==null)return{};var r=whe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=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);r<t;r++)n[r]=e[r];return n}function Nhe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function She(e){if(Array.isArray(e))return e}var YR=/[ \f\n\r\t\v\u2028\u2029]+/,ZR=function(t){var r=t.children,n=t.breakAll,i=t.style;try{var a=[];Ae(r)||(n?a=r.toString().split(""):a=r.toString().split(YR));var s=a.map(function(c){return{word:c,width:of(c,i).width}}),l=n?0:of(" ",i).width;return{wordsWithComputedWidth:s,spaceWidth:l}}catch{return null}},khe=function(t,r,n,i,a){var s=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=re(s),f=l,h=function(){var I=arguments.length>0&&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+n<Number(i)))B.words.push(R),B.width+=M+n;else{var U={words:[R],width:M};D.push(U)}return D},[])},m=h(r),y=function(I){return I.reduce(function(D,L){return D.width>L.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:e<t?-1:e>t?1:e>=t?0:NaN}function Ohe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?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<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function s(l,c,u=0,d=l.length){const f=i(l,c,u,d-1);return f>u&&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))||(e<t?-1:e>t?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/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,i)*s,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=r&&r<2?Ig(e,t,r*2):[l,c,u]}function h1(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[i,a,s]=n?Ig(t,e,r):Ig(e,t,r);if(!(a>=i))return[];const l=a-i+1,c=new Array(l);if(n)if(s<0)for(let u=0;u<l;++u)c[u]=(a-u)/-s;else for(let u=0;u<l;++u)c[u]=(a-u)*s;else if(s<0)for(let u=0;u<l;++u)c[u]=(i+u)/-s;else for(let u=0;u<l;++u)c[u]=(i+u)*s;return c}function m1(e,t,r){return t=+t,e=+e,r=+r,Ig(e,t,r)[2]}function p1(e,t,r){t=+t,e=+e,r=+r;const n=t<e,i=n?m1(t,e,r):m1(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function qO(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=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);s<l;){for(jd(e,s,l),++s,--l;i(e[s],a)<0;)++s;for(;i(e[l],a)>0;)--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);++n<i;)a[n]=e+n*r;return a}function Un(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ia(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const g1=Symbol("implicit");function C_(){var e=new VO,t=[],r=[],n=g1;function i(a){let s=e.get(a);if(s===void 0){if(n!==g1)return n;e.set(a,s=t.push(a)-1)}return r[s%r.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new VO;for(const s of a)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(a){return arguments.length?(r=Array.from(a),i):r.slice()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return C_(t,r).unknown(n)},Un.apply(i,arguments),i}function rh(){var e=C_().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,a,s,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,m=i<n,y=m?i:n,p=m?n:i;a=(p-y)/Math.max(1,h-c+u*2),l&&(a=Math.floor(a)),y+=(p-y-a*(h-c))*d,s=a*(1-c),l&&(y=Math.round(y),s=Math.round(s));var x=zhe(h).map(function(g){return y+a*g});return r(m?x.reverse():x)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([n,i]=h,n=+n,i=+i,f()):[n,i]},e.rangeRound=function(h){return[n,i]=h,n=+n,i=+i,l=!0,f()},e.bandwidth=function(){return s},e.step=function(){return a},e.round=function(h){return arguments.length?(l=!!h,f()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),f()):d},e.copy=function(){return rh(t(),[n,i]).round(l).paddingInner(c).paddingOuter(u).align(d)},Un.apply(f(),arguments)}function e6(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return e6(t())},e}function lf(){return e6(rh.apply(null,arguments).paddingInner(1))}function Uhe(e){return function(){return e}}function Dg(e){return+e}var GO=[0,1];function Ir(e){return e}function y1(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:Uhe(isNaN(t)?NaN:.5)}function Whe(e,t){var r;return e>t&&(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 i<n?(n=y1(i,n),a=r(s,a)):(n=y1(n,i),a=r(a,s)),function(l){return a(n(l))}}function Hhe(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),a=new Array(n),s=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<n;)i[s]=y1(e[s],e[s+1]),a[s]=r(t[s],t[s+1]);return function(l){var c=Yh(e,l,1,n)-1;return a[c](i[c](l))}}function Zh(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function R0(){var e=GO,t=GO,r=Du,n,i,a,s=Ir,l,c,u;function d(){var h=Math.min(e.length,t.length);return s!==Ir&&(s=Whe(e[0],e[h-1])),l=h>2?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;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break e;n>0&&(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;++O<I;)if(D=C.charCodeAt(O),48>D||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<g?new Array(g-R+1).join(h):"";switch(v&&x&&(C=t(M+C,M.length?g-$.length:1/0),M=""),m){case"<":C=P+C+$+M;break;case"=":C=P+M+C+$;break;case"^":C=M.slice(0,R=M.length>>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(l<s&&(u=s,s=l,l=u,u=i,i=a,a=u);d-- >0;){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 a<i&&(s=r,r=n,n=s,s=i,i=a,a=s),e[r]=t.floor(i),e[n]=t.ceil(a),e}function eA(e){return Math.log(e)}function tA(e){return Math.exp(e)}function nme(e){return-Math.log(-e)}function ime(e){return-Math.exp(-e)}function ame(e){return isFinite(e)?+("1e"+e):e<0?0:e}function sme(e){return e===10?ame:e===Math.E?Math.exp:t=>Math.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=d<u;f&&([u,d]=[d,u]);let h=i(u),m=i(d),y,p;const x=l==null?10:+l;let g=[];if(!(n%1)&&m-h<x){if(h=Math.floor(h),m=Math.ceil(m),u>0){for(;h<=m;++h)for(y=1;y<n;++y)if(p=h<0?y/a(-h):y*a(h),!(p<u)){if(p>d)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),!(p<u)){if(p>d)break;g.push(p)}g.length*2<x&&(g=h1(u,d,x))}else g=h1(h,m,Math.min(m-h,x)).map(a);return f?g.reverse():g},t.tickFormat=(l,c)=>{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*n<n-.5&&(f*=n),f<=u?c(d):""}},t.nice=()=>r(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);++s<l;)r[s-1]=Bhe(e,s/l);return a}function a(s){return s==null||isNaN(s=+s)?n:t[Yh(r,s)]}return a.invertExtent=function(s){var l=t.indexOf(s);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},a.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let l of s)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Ws),i()},a.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},a.unknown=function(s){return arguments.length?(n=s,a):n},a.quantiles=function(){return r.slice()},a.copy=function(){return c6().domain(e).range(t).unknown(n)},Un.apply(a,arguments)}function u6(){var e=0,t=1,r=1,n=[.5],i=[0,1],a;function s(c){return c!=null&&c<=c?i[Yh(n,c,0,r)]:a}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return s}return s.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},s.range=function(c){return arguments.length?(r=(i=Array.from(c)).length-1,l()):i.slice()},s.invertExtent=function(c){var u=i.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,n[0]]:u>=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<l-a?s:l},i.offset=(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),!(a<s)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<s);return c},i.filter=a=>tr(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=d<u;h&&([u,d]=[d,u]);const m=f&&typeof f.range=="function"?f:c(u,d,f),y=m?m.range(u,+d+1):[];return h?y.reverse():y}function c(u,d,f){const h=Math.abs(d-u)/f,m=P_(([,,x])=>x).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]<s[m][2]/h?m-1:m];return y.every(p)}return[l,c]}const[bme,wme]=h6(Oa,H_,L0,f6,W_,z_),[jme,_me]=h6(Ea,V_,D0,Xh,U_,B_);function Ax(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Px(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function _d(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function Nme(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,a=e.days,s=e.shortDays,l=e.months,c=e.shortMonths,u=Nd(i),d=Sd(i),f=Nd(a),h=Sd(a),m=Nd(s),y=Sd(s),p=Nd(l),x=Sd(l),g=Nd(c),v=Sd(c),w={a:L,A:R,b:M,B,c:null,d:hA,e:hA,f:Kme,g:npe,G:ape,H:Vme,I:Hme,j:qme,L:m6,m:Gme,M:Yme,p:U,q:W,Q:gA,s:yA,S:Zme,u:Xme,U:Qme,V:Jme,w:epe,W:tpe,x:null,X:null,y:rpe,Y:ipe,Z:spe,"%":pA},_={a:Z,A:q,b:ee,B:le,c:null,d:mA,e:mA,f:upe,g:bpe,G:jpe,H:ope,I:lpe,j:cpe,L:g6,m:dpe,M:fpe,p:ve,q:Ne,Q:gA,s:yA,S:hpe,u:mpe,U:ppe,V:gpe,w:ype,W:vpe,x:null,X:null,y:xpe,Y:wpe,Z:_pe,"%":pA},j={a:A,A:C,b:P,B:$,c:O,d:dA,e:dA,f:Bme,g:uA,G:cA,H:fA,I:fA,j:Ime,L:Fme,m:Rme,M:Dme,p:k,q:Mme,Q:Ume,s:Wme,S:Lme,u:Ame,U:Pme,V:Cme,w:Ome,W:Tme,x:I,X:D,y:uA,Y:cA,Z:$me,"%":zme};w.x=N(r,w),w.X=N(n,w),w.c=N(t,w),_.x=N(r,_),_.X=N(n,_),_.c=N(t,_);function N(J,oe){return function(me){var Q=[],Pe=-1,be=0,Ee=J.length,Re,Y,V;for(me instanceof Date||(me=new Date(+me));++Pe<Ee;)J.charCodeAt(Pe)===37&&(Q.push(J.slice(be,Pe)),(Y=lA[Re=J.charAt(++Pe)])!=null?Re=J.charAt(++Pe):Y=Re==="e"?" ":"0",(V=oe[Re])&&(Re=V(me,Y)),Q.push(Re),be=Pe+1);return Q.push(J.slice(be,Pe)),Q.join("")}}function S(J,oe){return function(me){var Q=_d(1900,void 0,1),Pe=E(Q,J,me+="",0),be,Ee;if(Pe!=me.length)return null;if("Q"in Q)return new Date(Q.Q);if("s"in Q)return new Date(Q.s*1e3+("L"in Q?Q.L:0));if(oe&&!("Z"in Q)&&(Q.Z=0),"p"in Q&&(Q.H=Q.H%12+Q.p*12),Q.m===void 0&&(Q.m="q"in Q?Q.q:0),"V"in Q){if(Q.V<1||Q.V>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<be;){if(Q>=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<r?new Array(r-a+1).join(t)+i:i)}function Eme(e){return e.replace(kme,"\\$&")}function Nd(e){return new RegExp("^(?:"+e.map(Eme).join("|")+")","i")}function Sd(e){return new Map(e.map((t,r)=>[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)<N?m:l(N)<N?y:s(N)<N?p:a(N)<N?x:n(N)<N?i(N)<N?g:v:r(N)<N?w:_)(N)}return d.invert=function(N){return new Date(f(N))},d.domain=function(N){return arguments.length?h(Array.from(N,kpe)):h().map(Spe)},d.ticks=function(N){var S=h();return e(S[0],S[S.length-1],N??10)},d.tickFormat=function(N,S){return S==null?j:u(S)},d.nice=function(N){var S=h();return(!N||typeof N.range!="function")&&(N=t(S[0],S[S.length-1],N??10)),N?h(a6(S,N)):d},d.copy=function(){return Zh(d,q_(e,t,r,n,i,a,s,l,c,u))},d}function Epe(){return Un.apply(q_(jme,_me,Ea,V_,D0,Xh,U_,B_,Ro,v6).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Ope(){return Un.apply(q_(bme,wme,Oa,H_,L0,I0,W_,z_,Ro,x6).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function F0(){var e=0,t=1,r,n,i,a,s=Ir,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:s(i===0?.5:(f=(a(f)-r)*i,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,r=a(e=+e),n=a(t=+t),i=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(s=f,u):s};function d(f){return function(h){var m,y;return arguments.length?([m,y]=h,s=f(m,y),u):[s(0),s(1)]}}return u.range=d(Du),u.rangeRound=d(C2),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return a=f,r=f(e),n=f(t),i=r===n?0:1/(n-r),u}}function ao(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function b6(){var e=io(F0()(Ir));return e.copy=function(){return ao(e,b6())},Ia.apply(e,arguments)}function w6(){var e=R_(F0()).domain([1,10]);return e.copy=function(){return ao(e,w6()).base(e.base())},Ia.apply(e,arguments)}function j6(){var e=I_(F0());return e.copy=function(){return ao(e,j6()).constant(e.constant())},Ia.apply(e,arguments)}function K_(){var e=D_(F0());return e.copy=function(){return ao(e,K_()).exponent(e.exponent())},Ia.apply(e,arguments)}function Ape(){return K_.apply(null,arguments).exponent(.5)}function _6(){var e=[],t=Ir;function r(n){if(n!=null&&!isNaN(n=+n))return t((Yh(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Ws),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>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*p<n*a?l:c),u(f?Math.max(0,Math.min(1,p)):p))}m.domain=function(p){return arguments.length?([e,t,r]=p,i=d(e=+e),a=d(t=+t),s=d(r=+r),l=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),n=a<i?-1:1,m):[e,t,r]},m.clamp=function(p){return arguments.length?(f=!!p,m):f},m.interpolator=function(p){return arguments.length?(u=p,m):u};function y(p){return function(x){var g,v,w;return arguments.length?([g,v,w]=x,u=cW(p,[g,v,w]),m):[u(0),u(.5),u(1)]}}return m.range=y(Du),m.rangeRound=y(C2),m.unknown=function(p){return arguments.length?(h=p,m):h},function(p){return d=p,i=p(e),a=p(t),s=p(r),l=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),n=a<i?-1:1,m}}function N6(){var e=io(B0()(Ir));return e.copy=function(){return ao(e,N6())},Ia.apply(e,arguments)}function S6(){var e=R_(B0()).domain([.1,1,10]);return e.copy=function(){return ao(e,S6()).base(e.base())},Ia.apply(e,arguments)}function k6(){var e=I_(B0());return e.copy=function(){return ao(e,k6()).constant(e.constant())},Ia.apply(e,arguments)}function G_(){var e=D_(B0());return e.copy=function(){return ao(e,G_()).exponent(e.exponent())},Ia.apply(e,arguments)}function Ppe(){return G_.apply(null,arguments).exponent(.5)}const vA=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:rh,scaleDiverging:N6,scaleDivergingLog:S6,scaleDivergingPow:G_,scaleDivergingSqrt:Ppe,scaleDivergingSymlog:k6,scaleIdentity:i6,scaleImplicit:g1,scaleLinear:Fg,scaleLog:s6,scaleOrdinal:C_,scalePoint:lf,scalePow:L_,scaleQuantile:c6,scaleQuantize:u6,scaleRadial:l6,scaleSequential:b6,scaleSequentialLog:w6,scaleSequentialPow:K_,scaleSequentialQuantile:_6,scaleSequentialSqrt:Ape,scaleSequentialSymlog:j6,scaleSqrt:ume,scaleSymlog:o6,scaleThreshold:d6,scaleTime:Epe,scaleUtc:Ope,tickFormat:n6},Symbol.toStringTag,{value:"Module"}));var Cpe=zu;function Tpe(e,t,r){for(var n=-1,i=e.length;++n<i;){var a=e[n],s=t(a);if(s!=null&&(l===void 0?s===s&&!Cpe(s):r(s,l)))var l=s,c=a}return c}var z0=Tpe;function $pe(e,t){return e>t}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 e<t}var O6=Fpe,Bpe=z0,zpe=O6,Upe=Yu;function Wpe(e){return e&&e.length?Bpe(e,Upe,zpe):void 0}var Vpe=Wpe;const U0=Xe(Vpe);var Hpe=d_,qpe=qi,Kpe=FR,Gpe=Jr;function Ype(e,t){var r=Gpe(e)?Hpe:Kpe;return r(e,qpe(t))}var Zpe=Ype,Xpe=DR,Qpe=Zpe;function Jpe(e,t){return Xpe(Qpe(e,t),1)}var ege=Jpe;const tge=Xe(ege);var rge=k_;function nge(e,t){return rge(e,t)}var ige=nge;const jl=Xe(ige);var Zu=1e9,age={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Z_,wt=!0,Bn="[DecimalError] ",el=Bn+"Invalid argument: ",Y_=Bn+"Exponent out of range: ",Xu=Math.floor,wo=Math.pow,sge=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ln,ir=1e7,gt=7,A6=9007199254740991,Wg=Xu(A6/gt),he={};he.absoluteValue=he.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};he.comparedTo=he.cmp=function(e){var t,r,n,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=n<i?n:i;t<r;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.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<u&&(a=h,h=m,m=a,s=c,c=u,u=s),a=[],s=c+u,n=s;n--;)a.push(0);for(n=u;--n>=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||e<t||e>r)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;t<i;t++)n=e[t]+"",r=gt-n.length,r&&(a+=Za(r)),a+=n;s=e[t],n=s+"",r=gt-n.length,r&&(a+=Za(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return a+s}var ga=function(){function e(n,i){var a,s=0,l=n.length;for(n=n.slice();l--;)a=n[l]*i+s,n[l]=a%ir|0,s=a/ir|0;return s&&n.unshift(s),n}function t(n,i,a,s){var l,c;if(a!=s)c=a>s?1:-1;else for(l=c=0;l<a;l++)if(n[l]!=i[l]){c=n[l]>i[l]?1:-1;break}return c}function r(n,i,a){for(var s=0;a--;)n[a]-=s,s=n[a]<i[a]?1:0,n[a]=s*ir+n[a]-i[a];for(;!n[0]&&n.length>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++;(u<j||d)&&v--;u++)w=d*ir+(C[u]||0),y[u]=w/P|0,d=w%P|0;else{for(d=ir/(P[0]+1)|0,d>1&&(P=e(P,d),C=e(C,d),S=P.length,j=C.length),_=S,p=C.slice(0,S),x=p.length;x<S;)p[x++]=0;E=P.slice(),E.unshift(0),N=P[0],P[1]>=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,S<h?E:P,h))):(d==0&&(l=d=1),f=P.slice()),h=f.length,h<x&&f.unshift(0),r(p,f,x),l==-1&&(x=p.length,l=t(P,p,S,x),l<1&&(d++,r(p,S<x?E:P,x))),x=p.length):l===0&&(d++,p=[0]),y[u++]=d,l&&p[0]?p[x++]=C[_]||0:(p=[C[_]],x=1);while((_++<j||p[0]!==void 0)&&v--)}return y[0]||y.shift(),m.e=c,st(m,s?a+Ht(m)+1:a)}}();function C6(e,t){var r,n,i,a,s,l,c=0,u=0,d=e.constructor,f=d.precision;if(Ht(e)>16)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),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=gt;n<i;)e.d.push(+t.slice(n,n+=gt));t=t.slice(n),n=gt-t.length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),wt&&(e.e>Wg||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=i<l,d&&(l=i),i=0;i<l;i++)if(c[i]!=f[i]){d=c[i]<f[i];break}s=0}for(d&&(r=c,c=f,f=r,t.s=-t.s),l=c.length,i=f.length-l;i>0;--i)c[l++]=0;for(i=f.length;i>s;){if(c[--i]<f[i]){for(a=i;a&&c[--a]===0;)c[a]=ir-1;--c[a],c[i]+=ir}c[i]-=f[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,wt?st(t,m):t):new h(0)}function _l(e,t,r){var n,i=Ht(e),a=$i(e.d),s=a.length;return t?(r&&(n=r-s)>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)<s&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-s)>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<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function oge(e){if(!e||typeof e!="object")throw Error(Bn+"Object expected");var t,r,n,i=["precision",1,Zu,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((n=e[r=i[t]])!==void 0)if(Xu(n)===n&&n>=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++)n[r]=e[r];return n}var hge=function(t){return t},M6={},R6=function(t){return t===M6},wA=function(t){return function r(){return arguments.length===0||arguments.length===1&&R6(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},mge=function e(t,r){return t===1?r:wA(function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var s=i.filter(function(l){return l!==M6}).length;return s>=t?r.apply(void 0,i):e(t-s,wA(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=i.map(function(f){return R6(f)?c.shift():f});return r.apply(void 0,lge(d).concat(c))}))})},W0=function(t){return mge(t.length,t)},x1=function(t,r){for(var n=[],i=t;i<r;++i)n[i-t]=i;return n},pge=W0(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),gge=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return hge;var i=r.reverse(),a=i[0],s=i.slice(1);return function(){return s.reduce(function(l,c){return c(l)},a.apply(void 0,arguments))}},b1=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},I6=function(t){var r=null,n=null;return function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r&&a.every(function(l,c){return l===r[c]})||(r=a,n=t.apply(void 0,a)),n}};function yge(e){var t;return e===0?t=1:t=Math.floor(new nt(e).abs().log(10).toNumber())+1,t}function vge(e,t,r){for(var n=new nt(e),i=0,a=[];n.lt(t)&&i<1e5;)a.push(n.toNumber()),n=n.add(r),i++;return a}var xge=W0(function(e,t,r){var n=+e,i=+t;return n+r*(i-n)}),bge=W0(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),wge=W0(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const V0={rangeStep:vge,getDigitCount:yge,interpolateNumber:xge,uninterpolateNumber:bge,uninterpolateTruncation:wge};function w1(e){return Nge(e)||_ge(e)||D6(e)||jge()}function jge(){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 _ge(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Nge(e){if(Array.isArray(e))return j1(e)}function ah(e,t){return Ege(e)||kge(e,t)||D6(e,t)||Sge()}function Sge(){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 D6(e,t){if(e){if(typeof e=="string")return j1(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 j1(e,t)}}function j1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kge(e,t){if(!(typeof Symbol>"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):(u<r&&(c=t>0?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;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vg.apply(this,arguments)}function Rge(e,t){return Fge(e)||Lge(e,t)||Dge(e,t)||Ige()}function Ige(){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 Dge(e,t){if(e){if(typeof e=="string")return jA(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 jA(e,t)}}function jA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Lge(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Fge(e){if(Array.isArray(e))return e}function Bge(e,t){if(e==null)return{};var r=zge(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=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;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,W6(n.key),n)}}function Vge(e,t,r){return t&&Wge(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hge(e,t,r){return t=Hg(t),qge(e,z6()?Reflect.construct(t,r||[],Hg(e).constructor):t.apply(e,r))}function qge(e,t){if(t&&(ou(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kge(e)}function Kge(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function z6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(z6=function(){return!!e})()}function Hg(e){return Hg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Hg(e)}function Gge(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_1(e,t)}function _1(e,t){return _1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},_1(e,t)}function U6(e,t,r){return t=W6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function W6(e){var t=Yge(e,"string");return ou(t)=="symbol"?t:t+""}function Yge(e,t){if(ou(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ou(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Qh=function(e){function t(){return Uge(this,t),Hge(this,t,arguments)}return Gge(t,e),Vge(t,[{key:"render",value:function(){var n=this.props,i=n.offset,a=n.layout,s=n.width,l=n.dataKey,c=n.data,u=n.dataPointFormatter,d=n.xAxis,f=n.yAxis,h=Bge(n,Mge),m=we(h,!1);this.props.direction==="x"&&d.type!=="number"&&Nl();var y=c.map(function(p){var x=u(p,l),g=x.x,v=x.y,w=x.value,_=x.errorVal;if(!_)return null;var j=[],N,S;if(Array.isArray(_)){var E=Rge(_,2);N=E[0],S=E[1]}else N=S=_;if(a==="vertical"){var k=d.scale,A=v+i,C=A+s,P=A-s,$=k(w-N),O=k(w+S);j.push({x1:O,y1:C,x2:O,y2:P}),j.push({x1:$,y1:A,x2:O,y2:A}),j.push({x1:$,y1:C,x2:$,y2:P})}else if(a==="horizontal"){var I=f.scale,D=g+i,L=D-s,R=D+s,M=I(w-N),B=I(w+S);j.push({x1:L,y1:B,x2:R,y2:B}),j.push({x1:D,y1:M,x2:D,y2:B}),j.push({x1:L,y1:M,x2:R,y2:M})}return T.createElement(Be,Vg({className:"recharts-errorBar",key:"bar-".concat(j.map(function(U){return"".concat(U.x1,"-").concat(U.x2,"-").concat(U.y1,"-").concat(U.y2)}))},m),j.map(function(U){return T.createElement("line",Vg({},U,{key:"line-".concat(U.x1,"-").concat(U.x2,"-").concat(U.y1,"-").concat(U.y2)}))}))});return T.createElement(Be,{className:"recharts-errorBars"},y)}}])}(T.Component);U6(Qh,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});U6(Qh,"displayName","ErrorBar");function sh(e){"@babel/helpers - typeof";return sh=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},sh(e)}function _A(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 co(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_A(Object(r),!0).forEach(function(n){Zge(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_A(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Zge(e,t,r){return t=Xge(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xge(e){var t=Qge(e,"string");return sh(t)=="symbol"?t:t+""}function Qge(e,t){if(sh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(sh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var V6=function(t){var r=t.children,n=t.formattedGraphicalItems,i=t.legendWidth,a=t.legendContent,s=sn(r,Us);if(!s)return null;var l=Us.defaultProps,c=l!==void 0?co(co({},l),s.props):{},u;return s.props&&s.props.payload?u=s.props&&s.props.payload:a==="children"?u=(n||[]).reduce(function(d,f){var h=f.item,m=f.props,y=m.sectors||m.data||[];return d.concat(y.map(function(p){return{type:s.props.iconType||h.props.legendType,value:p.name,color:p.fill,payload:p}}))},[]):u=(n||[]).map(function(d){var f=d.item,h=f.type.defaultProps,m=h!==void 0?co(co({},h),f.props):{},y=m.dataKey,p=m.name,x=m.legendType,g=m.hide;return{inactive:g,dataKey:y,type:c.iconType||x||"square",color:X_(f),value:p||y,payload:m}}),co(co(co({},c),Us.getWithHeight(s,i)),{},{payload:u,item:s})};function oh(e){"@babel/helpers - typeof";return oh=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},oh(e)}function NA(e){return rye(e)||tye(e)||eye(e)||Jge()}function Jge(){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 eye(e,t){if(e){if(typeof e=="string")return N1(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 N1(e,t)}}function tye(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rye(e){if(Array.isArray(e))return N1(e)}function N1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function SA(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 At(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?SA(Object(r),!0).forEach(function(n){Oc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Oc(e,t,r){return t=nye(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nye(e){var t=iye(e,"string");return oh(t)=="symbol"?t:t+""}function iye(e,t){if(oh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(oh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mt(e,t,r){return Ae(e)||Ae(t)?r:Jt(t)?fn(e,t,r):ke(t)?t(e):r}function cf(e,t,r,n){var i=tge(e,function(l){return Mt(l,t)});if(r==="number"){var a=i.filter(function(l){return re(l)||parseFloat(l)});return a.length?[U0(a),js(a)]:[1/0,-1/0]}var s=n?i.filter(function(l){return!Ae(l)}):i;return s.map(function(l){return Jt(l)||l instanceof Date?l:""})}var aye=function(t){var r,n=arguments.length>1&&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;u<l;u++){var d=u>0?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;_<l;_++)if(_===0&&t<=(n[_].coordinate+n[_+1].coordinate)/2||_>0&&_<l-1&&t>(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<u;c++)for(var d=a[l[c]].stackGroups,f=Object.keys(d),h=0,m=f.length;h<m;h++){var y=d[f[h]],p=y.items,x=y.cateAxisId,g=p.filter(function(S){return pa(S.type).indexOf("Bar")>=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<f;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},K6=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},G6=function(t,r,n,i){if(i)return t.map(function(c){return c.coordinate});var a,s,l=t.map(function(c){return c.coordinate===r&&(a=!0),c.coordinate===n&&(s=!0),c.coordinate});return a||l.push(r),s||l.push(n),l},ua=function(t,r,n){if(!t)return null;var i=t.scale,a=t.duplicateDomain,s=t.type,l=t.range,c=t.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(r||n)&&s==="category"&&i.bandwidth?i.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=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]);(l<a||l>s||c<a||c>s)&&t.domain([r[0],r[n-1]])}},dye=function(t,r){if(!t)return null;for(var n=0,i=t.length;n<i;n++)if(t[n].item===r)return t[n].position;return null},fye=function(t,r){if(!r||r.length!==2||!re(r[0])||!re(r[1]))return t;var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]),a=[t[0],t[1]];return(!re(t[0])||t[0]<n)&&(a[0]=n),(!re(t[1])||t[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<n&&(a[1]=n),a},hye=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n<i;++n)for(var a=0,s=0,l=0;l<r;++l){var c=qu(t[l][n][1])?t[l][n][0]:t[l][n][1];c>=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<i;++n)for(var a=0,s=0;s<r;++s){var l=qu(t[s][n][1])?t[s][n][0]:t[s][n][1];l>=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;l<c;l++){var u=a[l],d=a[l-1];s=Math.min((u.coordinate||0)-(d.coordinate||0),s)}return s===1/0?0:s}return n?void 0:0},PA=function(t,r,n){return!t||!t.length||jl(t,fn(n,"type.defaultProps.domain"))?r:t},J6=function(t,r){var n=t.type.defaultProps?At(At({},t.type.defaultProps),t.props):t.props,i=n.dataKey,a=n.name,s=n.unit,l=n.formatter,c=n.tooltipType,u=n.chartType,d=n.hide;return At(At({},we(t,!1)),{},{dataKey:i,unit:s,formatter:l,name:a||i,color:X_(t),value:Mt(r,i),type:c,payload:r,chartType:u,hide:d})};function lh(e){"@babel/helpers - typeof";return lh=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},lh(e)}function CA(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 ta(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?CA(Object(r),!0).forEach(function(n){eI(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function eI(e,t,r){return t=wye(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wye(e){var t=jye(e,"string");return lh(t)=="symbol"?t:t+""}function jye(e,t){if(lh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(lh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _ye(e,t){return Eye(e)||kye(e,t)||Sye(e,t)||Nye()}function Nye(){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 Sye(e,t){if(e){if(typeof e=="string")return TA(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 TA(e,t)}}function TA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Eye(e){if(Array.isArray(e))return e}var Gg=Math.PI/180,Oye=function(t){return t*180/Math.PI},dt=function(t,r,n,i){return{x:t+Math.cos(-Gg*i)*n,y:r+Math.sin(-Gg*i)*n}},tI=function(t,r){var n=arguments.length>2&&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(s<c||s>u)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+=360;y=m>=f&&m<=h}else{for(;m>f;)m-=360;for(;m<h;)m+=360;y=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<t;r++)n[r]=e[r];return n}function Bye(e,t){if(e==null)return{};var r=zye(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=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<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?MA(Object(r),!0).forEach(function(n){Uye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Uye(e,t,r){return t=Wye(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wye(e){var t=Vye(e,"string");return ch(t)=="symbol"?t:t+""}function Vye(e,t){if(ch(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ch(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uh(){return uh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uh.apply(this,arguments)}var Hye=function(t){var r=t.value,n=t.formatter,i=Ae(t.children)?r:t.children;return ke(n)?n(i):i},qye=function(t,r){var n=Mr(r-t),i=Math.min(Math.abs(r-t),360);return n*i},Kye=function(t,r,n){var i=t.position,a=t.viewBox,s=t.offset,l=t.className,c=a,u=c.cx,d=c.cy,f=c.innerRadius,h=c.outerRadius,m=c.startAngle,y=c.endAngle,p=c.clockWise,x=(f+h)/2,g=qye(m,y),v=g>=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<t;r++)n[r]=e[r];return n}function Yg(){return Yg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yg.apply(this,arguments)}function RA(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 IA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?RA(Object(r),!0).forEach(function(n){c0e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):RA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function c0e(e,t,r){return t=u0e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u0e(e){var t=d0e(e,"string");return dh(t)=="symbol"?t:t+""}function d0e(e,t){if(dh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(dh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DA(e,t){if(e==null)return{};var r=f0e(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=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;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},O1.apply(this,arguments)}function LA(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 FA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?LA(Object(r),!0).forEach(function(n){g0e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function g0e(e,t,r){return t=y0e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y0e(e){var t=v0e(e,"string");return fh(t)=="symbol"?t:t+""}function v0e(e,t){if(fh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(fh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var x0e=function(t,r){var n=Mr(r-t),i=Math.min(Math.abs(r-t),359.999);return n*i},Um=function(t){var r=t.cx,n=t.cy,i=t.radius,a=t.angle,s=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+i,f=Math.asin(c/d)/Gg,h=u?a:a+s*f,m=dt(r,n,d,h),y=dt(r,n,i,h),p=u?a-s*f:a,x=dt(r,n,d*Math.cos(f*Gg),p);return{center:m,circleTangency:y,lineTangency:x,theta:f}},iI=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,s=t.startAngle,l=t.endAngle,c=x0e(s,l),u=s+c,d=dt(r,n,a,s),f=dt(r,n,a,u),h="M ".concat(d.x,",").concat(d.y,`
|
||
A `).concat(a,",").concat(a,`,0,
|
||
`).concat(+(Math.abs(c)>180),",").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(s<a||d===f)return null;var m=$e("recharts-sector",h),y=s-a,p=Rr(l,y,0,!0),x;return p>0&&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;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},A1.apply(this,arguments)}function BA(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 zA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?BA(Object(r),!0).forEach(function(n){j0e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function j0e(e,t,r){return t=_0e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _0e(e){var t=N0e(e,"string");return hh(t)=="symbol"?t:t+""}function N0e(e,t){if(hh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(hh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var UA={curveBasisClosed:qne,curveBasisOpen:Kne,curveBasis:Hne,curveBumpX:Cne,curveBumpY:Tne,curveLinearClosed:Gne,curveLinear:A0,curveMonotoneX:Yne,curveMonotoneY:Zne,curveNatural:Xne,curveStep:Qne,curveStepAfter:eie,curveStepBefore:Jne},Wm=function(t){return t.x===+t.x&&t.y===+t.y},kd=function(t){return t.x},Ed=function(t){return t.y},S0e=function(t,r){if(ke(t))return t;var n="curve".concat(E0(t));return(n==="curveMonotone"||n==="curveBump")&&r?UA["".concat(n).concat(r==="vertical"?"Y":"X")]:UA[n]||A0},k0e=function(t){var r=t.type,n=r===void 0?"linear":r,i=t.points,a=i===void 0?[]:i,s=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=S0e(n,l),f=u?a.filter(function(p){return Wm(p)}):a,h;if(Array.isArray(s)){var m=u?s.filter(function(p){return Wm(p)}):s,y=f.map(function(p,x){return zA(zA({},p),{},{base:m[x]})});return l==="vertical"?h=Rm().y(Ed).x1(kd).x0(function(p){return p.base.x}):h=Rm().x(kd).y1(Ed).y0(function(p){return p.base.y}),h.defined(Wm).curve(d),h(y)}return l==="vertical"&&re(s)?h=Rm().y(Ed).x1(kd).x0(s):re(s)?h=Rm().x(kd).y1(Ed).y0(s):h=rR().x(kd).y(Ed),h.defined(Wm).curve(d),h(f)},tl=function(t){var r=t.className,n=t.points,i=t.path,a=t.pathRef;if((!n||!n.length)&&!i)return null;var s=n&&n.length?k0e(t):i;return b.createElement("path",A1({},we(t,!1),jg(t),{className:$e("recharts-curve",r),d:s,ref:a}))},sI={exports:{}},E0e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",O0e=E0e,A0e=O0e;function oI(){}function lI(){}lI.resetWarningCache=oI;var P0e=function(){function e(n,i,a,s,l,c){if(c!==A0e){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:lI,resetWarningCache:oI};return r.PropTypes=r,r};sI.exports=P0e();var C0e=sI.exports;const Ye=Xe(C0e);var T0e=Object.getOwnPropertyNames,$0e=Object.getOwnPropertySymbols,M0e=Object.prototype.hasOwnProperty;function WA(e,t){return function(n,i,a){return e(n,i,a)&&t(n,i,a)}}function Vm(e){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,i);var a=i.cache,s=a.get(r),l=a.get(n);if(s&&l)return s===n&&l===r;a.set(r,n),a.set(n,r);var c=e(r,n,i);return a.delete(r),a.delete(n),c}}function VA(e){return T0e(e).concat($0e(e))}var R0e=Object.hasOwn||function(e,t){return M0e.call(e,t)};function Ml(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var I0e="__v",D0e="__o",L0e="_owner",HA=Object.getOwnPropertyDescriptor,qA=Object.keys;function F0e(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)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);r<t;r++)n[r]=e[r];return n}function yve(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vve(e){if(Array.isArray(e))return e}function xve(){var e={},t=function(){return null},r=!1,n=function i(a){if(!r){if(Array.isArray(a)){if(!a.length)return;var s=a,l=mve(s),c=l[0],u=l.slice(1);if(typeof c=="number"){XA(i.bind(null,u),c);return}i(c),XA(i.bind(null,u));return}P1(a)==="object"&&(e=a,t(e)),typeof a=="function"&&a()}};return{stop:function(){r=!0},start:function(a){r=!1,n(a)},subscribe:function(a){return t=a,function(){t=function(){return null}}}}}function mh(e){"@babel/helpers - typeof";return mh=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},mh(e)}function JA(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 eP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?JA(Object(r),!0).forEach(function(n){uI(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):JA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uI(e,t,r){return t=bve(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bve(e){var t=wve(e,"string");return mh(t)==="symbol"?t:String(t)}function wve(e,t){if(mh(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(mh(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jve=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(n,i){return n.filter(function(a){return i.includes(a)})})},_ve=function(t){return t},Nve=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},uf=function(t,r){return Object.keys(r).reduce(function(n,i){return eP(eP({},n),{},uI({},i,t(i,r[i])))},{})},tP=function(t,r,n){return t.map(function(i){return"".concat(Nve(i)," ").concat(r,"ms ").concat(n)}).join(",")};function Sve(e,t){return Ove(e)||Eve(e,t)||dI(e,t)||kve()}function kve(){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 Eve(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Ove(e){if(Array.isArray(e))return e}function Ave(e){return Tve(e)||Cve(e)||dI(e)||Pve()}function Pve(){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 dI(e,t){if(e){if(typeof e=="string")return C1(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 C1(e,t)}}function Cve(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Tve(e){if(Array.isArray(e))return C1(e)}function C1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Zg=1e-4,fI=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},hI=function(t,r){return t.map(function(n,i){return n*Math.pow(r,i)}).reduce(function(n,i){return n+i})},rP=function(t,r){return function(n){var i=fI(t,r);return hI(i,n)}},$ve=function(t,r){return function(n){var i=fI(t,r),a=[].concat(Ave(i.map(function(s,l){return s*l}).slice(1)),[0]);return hI(a,n)}},nP=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r[0],a=r[1],s=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":i=0,a=0,s=1,l=1;break;case"ease":i=.25,a=.1,s=.25,l=1;break;case"ease-in":i=.42,a=0,s=1,l=1;break;case"ease-out":i=.42,a=0,s=.58,l=1;break;case"ease-in-out":i=0,a=0,s=.58,l=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(x){return parseFloat(x)}),d=Sve(u,4);i=d[0],a=d[1],s=d[2],l=d[3]}}}var f=rP(i,s),h=rP(a,l),m=$ve(i,s),y=function(g){return g>1?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)<Zg||N<Zg)return h(w);w=y(w-j/N)}return h(w)};return p.isStepper=!1,p},Mve=function(){var t=arguments.length>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)<Zg&&Math.abs(p)<Zg?[f,0]:[x,p]};return c.isStepper=!0,c.dt=l,c},Rve=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return nP(i);case"spring":return Mve();default:if(i.split("(")[0]==="cubic-bezier")return nP(i)}return typeof i=="function"?i:null};function ph(e){"@babel/helpers - typeof";return ph=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},ph(e)}function iP(e){return Lve(e)||Dve(e)||mI(e)||Ive()}function Ive(){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 Dve(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Lve(e){if(Array.isArray(e))return $1(e)}function aP(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 dr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?aP(Object(r),!0).forEach(function(n){T1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function T1(e,t,r){return t=Fve(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fve(e){var t=Bve(e,"string");return ph(t)==="symbol"?t:String(t)}function Bve(e,t){if(ph(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ph(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zve(e,t){return Vve(e)||Wve(e,t)||mI(e,t)||Uve()}function Uve(){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 mI(e,t){if(e){if(typeof e=="string")return $1(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 $1(e,t)}}function $1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Wve(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Vve(e){if(Array.isArray(e))return e}var Xg=function(t,r,n){return t+(r-t)*n},M1=function(t){var r=t.from,n=t.to;return r!==n},Hve=function e(t,r,n){var i=uf(function(a,s){if(M1(s)){var l=t(s.from,s.to,s.velocity),c=zve(l,2),u=c[0],d=c[1];return dr(dr({},s),{},{from:u,velocity:d})}return s},r);return n<1?uf(function(a,s){return M1(s)?dr(dr({},s),{},{velocity:Xg(s.velocity,i[a].velocity,n),from:Xg(s.from,i[a].from,n)}):s},r):e(t,i,n-1)};const qve=function(e,t,r,n,i){var a=jve(e,t),s=a.reduce(function(x,g){return dr(dr({},x),{},T1({},g,[e[g],t[g]]))},{}),l=a.reduce(function(x,g){return dr(dr({},x),{},T1({},g,{from:e[g],velocity:0,to:t[g]}))},{}),c=-1,u,d,f=function(){return null},h=function(){return uf(function(g,v){return v.from},l)},m=function(){return!Object.values(l).filter(M1).length},y=function(g){u||(u=g);var v=g-u,w=v/r.dt;l=Hve(r,l,w),i(dr(dr(dr({},e),t),h())),u=g,m()||(c=requestAnimationFrame(f))},p=function(g){d||(d=g);var v=(g-d)/n,w=uf(function(j,N){return Xg.apply(void 0,iP(N).concat([r(v)]))},s);if(i(dr(dr(dr({},e),t),w)),v<1)c=requestAnimationFrame(f);else{var _=uf(function(j,N){return Xg.apply(void 0,iP(N).concat([r(1)]))},s);i(dr(dr(dr({},e),t),_))}};return f=r.isStepper?y:p,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function lu(e){"@babel/helpers - typeof";return lu=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},lu(e)}var Kve=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Gve(e,t){if(e==null)return{};var r=Yve(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=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<n.length;a++)i=n[a],!(t.indexOf(i)>=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<t;r++)n[r]=e[r];return n}function sP(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 Gn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sP(Object(r),!0).forEach(function(n){Wd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wd(e,t,r){return t=pI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function exe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function txe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pI(n.key),n)}}function rxe(e,t,r){return t&&txe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pI(e){var t=nxe(e,"string");return lu(t)==="symbol"?t:String(t)}function nxe(e,t){if(lu(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(lu(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ixe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&I1(e,t)}function I1(e,t){return I1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},I1(e,t)}function axe(e){var t=sxe();return function(){var n=Qg(e),i;if(t){var a=Qg(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return D1(this,i)}}function D1(e,t){if(t&&(lu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return L1(e)}function L1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sxe(){if(typeof Reflect>"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;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jg.apply(this,arguments)}function oxe(e,t){return dxe(e)||uxe(e,t)||cxe(e,t)||lxe()}function lxe(){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 cxe(e,t){if(e){if(typeof e=="string")return oP(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 oP(e,t)}}function oP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function uxe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function dxe(e){if(Array.isArray(e))return e}function lP(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 cP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lP(Object(r),!0).forEach(function(n){fxe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fxe(e,t,r){return t=hxe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hxe(e){var t=mxe(e,"string");return gh(t)=="symbol"?t:t+""}function mxe(e,t){if(gh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(gh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uP=function(t,r,n,i,a){var s=Math.min(Math.abs(n)/2,Math.abs(i)/2),l=i>=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;h<m;h++)f[h]=a[h]>s?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<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fc.apply(this,arguments)}function vxe(e,t){if(e==null)return{};var r=xxe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=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);r<t;r++)n[r]=e[r];return n}var fP=function(t){return t&&t.x===+t.x&&t.y===+t.y},Nxe=function(){var t=arguments.length>0&&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<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},B1.apply(this,arguments)}var Jh=function(t){var r=t.cx,n=t.cy,i=t.r,a=t.className,s=$e("recharts-dot",a);return r===+r&&n===+n&&i===+i?b.createElement("circle",B1({},we(t,!1),jg(t),{className:s,cx:r,cy:n,r:i})):null};function yh(e){"@babel/helpers - typeof";return yh=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},yh(e)}var Exe=["x","y","top","left","width","height","className"];function z1(){return z1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z1.apply(this,arguments)}function hP(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 Oxe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hP(Object(r),!0).forEach(function(n){Axe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Axe(e,t,r){return t=Pxe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Pxe(e){var t=Cxe(e,"string");return yh(t)=="symbol"?t:t+""}function Cxe(e,t){if(yh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(yh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Txe(e,t){if(e==null)return{};var r=$xe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=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<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ff.apply(this,arguments)}function mP(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 uo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mP(Object(r),!0).forEach(function(n){H0(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pP(e,t){if(e==null)return{};var r=Zxe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=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;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,yI(n.key),n)}}function Qxe(e,t,r){return t&&gP(e.prototype,t),r&&gP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jxe(e,t,r){return t=ey(t),ebe(e,gI()?Reflect.construct(t,r||[],ey(e).constructor):t.apply(e,r))}function ebe(e,t){if(t&&(cu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tbe(e)}function tbe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gI=function(){return!!e})()}function ey(e){return ey=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ey(e)}function rbe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&U1(e,t)}function U1(e,t){return U1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},U1(e,t)}function H0(e,t,r){return t=yI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yI(e){var t=nbe(e,"string");return cu(t)=="symbol"?t:t+""}function nbe(e,t){if(cu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(cu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var q0=function(e){function t(){return Xxe(this,t),Jxe(this,t,arguments)}return rbe(t,e),Qxe(t,[{key:"getTickValueCoord",value:function(n){var i=n.coordinate,a=this.props,s=a.angle,l=a.cx,c=a.cy;return dt(l,c,i,s)}},{key:"getTickTextAnchor",value:function(){var n=this.props.orientation,i;switch(n){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var n=this.props,i=n.cx,a=n.cy,s=n.angle,l=n.ticks,c=zxe(l,function(d){return d.coordinate||0}),u=Kxe(l,function(d){return d.coordinate||0});return{cx:i,cy:a,startAngle:s,endAngle:s,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,s=n.angle,l=n.ticks,c=n.axisLine,u=pP(n,Gxe),d=l.reduce(function(y,p){return[Math.min(y[0],p.coordinate),Math.max(y[1],p.coordinate)]},[1/0,-1/0]),f=dt(i,a,d[0],s),h=dt(i,a,d[1],s),m=uo(uo(uo({},we(u,!1)),{},{fill:"none"},we(c,!1)),{},{x1:f.x,y1:f.y,x2:h.x,y2:h.y});return T.createElement("line",ff({className:"recharts-polar-radius-axis-line"},m))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,s=i.tick,l=i.angle,c=i.tickFormatter,u=i.stroke,d=pP(i,Yxe),f=this.getTickTextAnchor(),h=we(d,!1),m=we(s,!1),y=a.map(function(p,x){var g=n.getTickValueCoord(p),v=uo(uo(uo(uo({textAnchor:f,transform:"rotate(".concat(90-l,", ").concat(g.x,", ").concat(g.y,")")},h),{},{stroke:"none",fill:u},m),{},{index:x},g),{},{payload:p});return T.createElement(Be,ff({className:$e("recharts-polar-radius-axis-tick",rI(s)),key:"tick-".concat(p.coordinate)},bl(n.props,p,x)),t.renderTickItem(s,v,c?c(p.value,x):p.value))});return T.createElement(Be,{className:"recharts-polar-radius-axis-ticks"},y)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.axisLine,s=n.tick;return!i||!i.length?null:T.createElement(Be,{className:$e("recharts-polar-radius-axis",this.props.className)},a&&this.renderAxisLine(),s&&this.renderTicks(),sr.renderCallByParent(this.props,this.getViewBox()))}}],[{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,ff({},i,{className:"recharts-polar-radius-axis-tick-value"}),a),s}}])}(b.PureComponent);H0(q0,"displayName","PolarRadiusAxis");H0(q0,"axisType","radiusAxis");H0(q0,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function uu(e){"@babel/helpers - typeof";return uu=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},uu(e)}function ko(){return ko=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ko.apply(this,arguments)}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 fo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yP(Object(r),!0).forEach(function(n){K0(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ibe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xI(n.key),n)}}function abe(e,t,r){return t&&vP(e.prototype,t),r&&vP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function sbe(e,t,r){return t=ty(t),obe(e,vI()?Reflect.construct(t,r||[],ty(e).constructor):t.apply(e,r))}function obe(e,t){if(t&&(uu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lbe(e)}function lbe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vI=function(){return!!e})()}function ty(e){return ty=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ty(e)}function cbe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W1(e,t)}function W1(e,t){return W1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},W1(e,t)}function K0(e,t,r){return t=xI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xI(e){var t=ube(e,"string");return uu(t)=="symbol"?t:t+""}function ube(e,t){if(uu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(uu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var dbe=Math.PI/180,xP=1e-5,G0=function(e){function t(){return ibe(this,t),sbe(this,t,arguments)}return cbe(t,e),abe(t,[{key:"getTickLineCoord",value:function(n){var i=this.props,a=i.cx,s=i.cy,l=i.radius,c=i.orientation,u=i.tickSize,d=u||8,f=dt(a,s,l,n.coordinate),h=dt(a,s,l+(c==="inner"?-1:1)*d,n.coordinate);return{x1:f.x,y1:f.y,x2:h.x,y2:h.y}}},{key:"getTickTextAnchor",value:function(n){var i=this.props.orientation,a=Math.cos(-n.coordinate*dbe),s;return a>xP?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;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ry.apply(this,arguments)}function Tbe(e,t){return Ibe(e)||Rbe(e,t)||Mbe(e,t)||$be()}function $be(){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 Mbe(e,t){if(e){if(typeof e=="string")return bP(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 bP(e,t)}}function bP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Rbe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Ibe(e){if(Array.isArray(e))return e}function wP(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 jP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wP(Object(r),!0).forEach(function(n){Dbe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Dbe(e,t,r){return t=Lbe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lbe(e){var t=Fbe(e,"string");return vh(t)=="symbol"?t:t+""}function Fbe(e,t){if(vh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(vh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _P=function(t,r,n,i,a){var s=n-i,l;return l="M ".concat(t,",").concat(r),l+="L ".concat(t+n,",").concat(r),l+="L ".concat(t+n-s/2,",").concat(r+a),l+="L ".concat(t+n-s/2-i,",").concat(r+a),l+="L ".concat(t,",").concat(r," Z"),l},Bbe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},zbe=function(t){var r=jP(jP({},Bbe),t),n=b.useRef(),i=b.useState(-1),a=Tbe(i,2),s=a[0],l=a[1];b.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var w=n.current.getTotalLength();w&&l(w)}catch{}},[]);var c=r.x,u=r.y,d=r.upperWidth,f=r.lowerWidth,h=r.height,m=r.className,y=r.animationEasing,p=r.animationDuration,x=r.animationBegin,g=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||h!==+h||d===0&&f===0||h===0)return null;var v=$e("recharts-trapezoid",m);return g?T.createElement(gi,{canBegin:s>0,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<a.length;i++)n=a[i],!(t.indexOf(n)>=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;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?NP(Object(r),!0).forEach(function(n){Hbe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):NP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Hbe(e,t,r){return t=qbe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qbe(e){var t=Kbe(e,"string");return xh(t)=="symbol"?t:t+""}function Kbe(e,t){if(xh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(xh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gbe(e,t){return ny(ny({},t),e)}function Ybe(e,t){return e==="symbols"}function SP(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return T.createElement(Q_,r);case"trapezoid":return T.createElement(zbe,r);case"sector":return T.createElement(aI,r);case"symbols":if(Ybe(t))return T.createElement(b_,r);break;default:return null}}function Zbe(e){return b.isValidElement(e)?e.props:e}function wI(e){var t=e.option,r=e.shapeType,n=e.propTransformer,i=n===void 0?Gbe:n,a=e.activeClassName,s=a===void 0?"recharts-active-shape":a,l=e.isActive,c=Wbe(e,Ube),u;if(b.isValidElement(t))u=b.cloneElement(t,ny(ny({},c),Zbe(t)));else if(ke(t))u=t(c);else if(Sbe(t)&&!Cbe(t)){var d=i(t,c);u=T.createElement(SP,{shapeType:r,elementProps:d})}else{var f=c;u=T.createElement(SP,{shapeType:r,elementProps:f})}return l?T.createElement(Be,{className:s},u):u}function Y0(e,t){return t!=null&&"trapezoids"in e.props}function Z0(e,t){return t!=null&&"sectors"in e.props}function bh(e,t){return t!=null&&"points"in e.props}function Xbe(e,t){var r,n,i=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,a=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return i&&a}function Qbe(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function Jbe(e,t){var r=e.x===t.x,n=e.y===t.y,i=e.z===t.z;return r&&n&&i}function ewe(e,t){var r;return Y0(e,t)?r=Xbe:Z0(e,t)?r=Qbe:bh(e,t)&&(r=Jbe),r}function twe(e,t){var r;return Y0(e,t)?r="trapezoids":Z0(e,t)?r="sectors":bh(e,t)&&(r="points"),r}function rwe(e,t){if(Y0(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(Z0(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return bh(e,t)?t.payload:{}}function nwe(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,i=twe(r,t),a=rwe(r,t),s=n.filter(function(c,u){var d=jl(a,c),f=r.props[i].filter(function(y){var p=ewe(r,t);return p(y,t)}),h=r.props[i].indexOf(f[f.length-1]),m=u===h;return d&&m}),l=n.indexOf(s[s.length-1]);return l}var _p;function du(e){"@babel/helpers - typeof";return du=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},du(e)}function hc(){return hc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hc.apply(this,arguments)}function kP(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 ot(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kP(Object(r),!0).forEach(function(n){Cn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_I(n.key),n)}}function awe(e,t,r){return t&&EP(e.prototype,t),r&&EP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function swe(e,t,r){return t=iy(t),owe(e,jI()?Reflect.construct(t,r||[],iy(e).constructor):t.apply(e,r))}function owe(e,t){if(t&&(du(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lwe(e)}function lwe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jI=function(){return!!e})()}function iy(e){return iy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},iy(e)}function cwe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&V1(e,t)}function V1(e,t){return V1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},V1(e,t)}function Cn(e,t,r){return t=_I(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _I(e){var t=uwe(e,"string");return du(t)=="symbol"?t:t+""}function uwe(e,t){if(du(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(du(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Da=function(e){function t(r){var n;return iwe(this,t),n=swe(this,t,[r]),Cn(n,"pieRef",null),Cn(n,"sectorRefs",[]),Cn(n,"id",Cl("recharts-pie-")),Cn(n,"handleAnimationEnd",function(){var i=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),ke(i)&&i()}),Cn(n,"handleAnimationStart",function(){var i=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),ke(i)&&i()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return cwe(t,e),awe(t,[{key:"isActiveIndex",value:function(n){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(n)!==-1:n===i}},{key:"hasActiveIndex",value:function(){var n=this.props.activeIndex;return Array.isArray(n)?n.length!==0:n||n===0}},{key:"renderLabels",value:function(n){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.label,l=a.labelLine,c=a.dataKey,u=a.valueKey,d=we(this.props,!1),f=we(s,!1),h=we(l,!1),m=s&&s.offsetRadius||20,y=n.map(function(p,x){var g=(p.startAngle+p.endAngle)/2,v=dt(p.cx,p.cy,p.outerRadius+m,g),w=ot(ot(ot(ot({},d),p),{},{stroke:"none"},f),{},{index:x,textAnchor:t.getTextAnchor(v.x,p.cx)},v),_=ot(ot(ot(ot({},d),p),{},{fill:"none",stroke:p.fill},h),{},{index:x,points:[dt(p.cx,p.cy,p.outerRadius,g),v]}),j=c;return Ae(c)&&Ae(u)?j="value":Ae(c)&&(j=u),T.createElement(Be,{key:"label-".concat(p.startAngle,"-").concat(p.endAngle,"-").concat(p.midAngle,"-").concat(x)},l&&t.renderLabelLineItem(l,_,"line"),t.renderLabelItem(s,w,Mt(p,j)))});return T.createElement(Be,{className:"recharts-pie-labels"},y)}},{key:"renderSectorsStatically",value:function(n){var i=this,a=this.props,s=a.activeShape,l=a.blendStroke,c=a.inactiveShape;return n.map(function(u,d){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&n.length!==1)return null;var f=i.isActiveIndex(d),h=c&&i.hasActiveIndex()?c:null,m=f?s:h,y=ot(ot({},u),{},{stroke:l?u.fill:u.stroke,tabIndex:-1});return T.createElement(Be,hc({ref:function(x){x&&!i.sectorRefs.includes(x)&&i.sectorRefs.push(x)},tabIndex:-1,className:"recharts-pie-sector"},bl(i.props,u,d),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(d)}),T.createElement(wI,hc({option:m,isActive:f,shapeType:"sector"},y)))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,i=this.props,a=i.sectors,s=i.isAnimationActive,l=i.animationBegin,c=i.animationDuration,u=i.animationEasing,d=i.animationId,f=this.state,h=f.prevSectors,m=f.prevIsAnimationActive;return T.createElement(gi,{begin:l,duration:c,isActive:s,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d,"-").concat(m),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(y){var p=y.t,x=[],g=a&&a[0],v=g.startAngle;return a.forEach(function(w,_){var j=h&&h[_],N=_>0?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<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(n,i,a){if(T.isValidElement(n))return T.cloneElement(n,i);if(ke(n))return n(i);var s=$e("recharts-pie-label-line",typeof n!="boolean"?n.className:"");return T.createElement(tl,hc({},i,{key:a,type:"linear",className:s}))}},{key:"renderLabelItem",value:function(n,i,a){if(T.isValidElement(n))return T.cloneElement(n,i);var s=a;if(ke(n)&&(s=n(i),T.isValidElement(s)))return s;var l=$e("recharts-pie-label-text",typeof n!="boolean"&&!ke(n)?n.className:"");return T.createElement(wl,hc({},i,{alignmentBaseline:"middle",className:l}),s)}}])}(b.PureComponent);_p=Da;Cn(Da,"displayName","Pie");Cn(Da,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!no.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Cn(Da,"parseDeltaAngle",function(e,t){var r=Mr(t-e),n=Math.min(Math.abs(t-e),360);return r*n});Cn(Da,"getRealPieData",function(e){var t=e.data,r=e.children,n=we(e,!1),i=hn(r,M0);return t&&t.length?t.map(function(a,s){return ot(ot(ot({payload:a},n),a),i&&i[s]&&i[s].props)}):i&&i.length?i.map(function(a){return ot(ot({},n),a.props)}):[]});Cn(Da,"parseCoordinateOfPie",function(e,t){var r=t.top,n=t.left,i=t.width,a=t.height,s=tI(i,a),l=n+Rr(e.cx,i,i/2),c=r+Rr(e.cy,a,a/2),u=Rr(e.innerRadius,s,0),d=Rr(e.outerRadius,s,s*.8),f=e.maxRadius||Math.sqrt(i*i+a*a)/2;return{cx:l,cy:c,innerRadius:u,outerRadius:d,maxRadius:f}});Cn(Da,"getComposedData",function(e){var t=e.item,r=e.offset,n=t.type.defaultProps!==void 0?ot(ot({},t.type.defaultProps),t.props):t.props,i=_p.getRealPieData(n);if(!i||!i.length)return null;var a=n.cornerRadius,s=n.startAngle,l=n.endAngle,c=n.paddingAngle,u=n.dataKey,d=n.nameKey,f=n.valueKey,h=n.tooltipType,m=Math.abs(n.minAngle),y=_p.parseCoordinateOfPie(n,r),p=_p.parseDeltaAngle(s,l),x=Math.abs(p),g=u;Ae(u)&&Ae(f)?(mi(!1,`Use "dataKey" to specify the value of pie,
|
||
the props "valueKey" will be deprecated in 1.1.0`),g="value"):Ae(u)&&(mi(!1,`Use "dataKey" to specify the value of pie,
|
||
the props "valueKey" will be deprecated in 1.1.0`),g=f);var v=i.filter(function(E){return Mt(E,g,0)!==0}).length,w=(x>=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?t<r?1:-1:Mx(n),vwe(t,r,n,e)}}var wwe=bwe,jwe=wwe,_we=jwe(),Nwe=_we;const ay=Xe(Nwe);function wh(e){"@babel/helpers - typeof";return wh=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},wh(e)}function AP(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 PP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?AP(Object(r),!0).forEach(function(n){SI(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):AP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SI(e,t,r){return t=Swe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Swe(e){var t=kwe(e,"string");return wh(t)=="symbol"?t:t+""}function kwe(e,t){if(wh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(wh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ewe=["Webkit","Moz","O","ms"],Owe=function(t,r){var n=t.replace(/(\w)/,function(a){return a.toUpperCase()}),i=Ewe.reduce(function(a,s){return PP(PP({},a),{},SI({},s+n,r))},{});return i[t]=r,i};function fu(e){"@babel/helpers - typeof";return fu=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},fu(e)}function sy(){return sy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sy.apply(this,arguments)}function CP(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 Rx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?CP(Object(r),!0).forEach(function(n){rn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Awe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,EI(n.key),n)}}function Pwe(e,t,r){return t&&TP(e.prototype,t),r&&TP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Cwe(e,t,r){return t=oy(t),Twe(e,kI()?Reflect.construct(t,r||[],oy(e).constructor):t.apply(e,r))}function Twe(e,t){if(t&&(fu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $we(e)}function $we(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kI=function(){return!!e})()}function oy(e){return oy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},oy(e)}function Mwe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&H1(e,t)}function H1(e,t){return H1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},H1(e,t)}function rn(e,t,r){return t=EI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EI(e){var t=Rwe(e,"string");return fu(t)=="symbol"?t:t+""}function Rwe(e,t){if(fu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(fu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Iwe=function(t){var r=t.data,n=t.startIndex,i=t.endIndex,a=t.x,s=t.width,l=t.travellerWidth;if(!r||!r.length)return{};var c=r.length,u=lf().domain(ay(0,c)).range([a,a+s-l]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(n),endX:u(i),scale:u,scaleValues:d}},$P=function(t){return t.changedTouches&&!!t.changedTouches.length},hu=function(e){function t(r){var n;return Awe(this,t),n=Cwe(this,t,[r]),rn(n,"handleDrag",function(i){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(i):n.state.isSlideMoving&&n.handleSlideDrag(i)}),rn(n,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&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)||l<c&&j===E||s==="endX"&&(l>c?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<n;)if(!t(e[r],r,e))return!1;return!0}var n1e=r1e,i1e=E_;function a1e(e,t){var r=!0;return i1e(e,function(n,i,a){return r=!!t(n,i,a),r}),r}var s1e=a1e,o1e=n1e,l1e=s1e,c1e=qi,u1e=Jr,d1e=$0;function f1e(e,t,r){var n=u1e(e)?o1e:l1e;return r&&d1e(e,t,r)&&(t=void 0),n(e,c1e(t))}var h1e=f1e;const OI=Xe(h1e);var m1e=["x","y"];function jh(e){"@babel/helpers - typeof";return jh=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},jh(e)}function q1(){return q1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},q1.apply(this,arguments)}function RP(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 Ad(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?RP(Object(r),!0).forEach(function(n){p1e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):RP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function p1e(e,t,r){return t=g1e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function g1e(e){var t=y1e(e,"string");return jh(t)=="symbol"?t:t+""}function y1e(e,t){if(jh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(jh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function v1e(e,t){if(e==null)return{};var r=x1e(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=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<a.length;i++)n=a[i],!(t.indexOf(n)>=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;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ly.apply(this,arguments)}function DP(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 Ft(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DP(Object(r),!0).forEach(function(n){_s(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function S1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,CI(n.key),n)}}function k1e(e,t,r){return t&&LP(e.prototype,t),r&&LP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function E1e(e,t,r){return t=cy(t),O1e(e,PI()?Reflect.construct(t,r||[],cy(e).constructor):t.apply(e,r))}function O1e(e,t){if(t&&(mu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return A1e(e)}function A1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function PI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(PI=function(){return!!e})()}function cy(e){return cy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},cy(e)}function P1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&K1(e,t)}function K1(e,t){return K1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},K1(e,t)}function _s(e,t,r){return t=CI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CI(e){var t=C1e(e,"string");return mu(t)=="symbol"?t:t+""}function C1e(e,t){if(mu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(mu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Rl=function(e){function t(){var r;S1e(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=E1e(this,t,[].concat(i)),_s(r,"state",{isAnimationFinished:!1}),_s(r,"id",Cl("recharts-bar-")),_s(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),s&&s()}),_s(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),s&&s()}),r}return P1e(t,e),k1e(t,[{key:"renderRectanglesStatically",value:function(n){var i=this,a=this.props,s=a.shape,l=a.dataKey,c=a.activeIndex,u=a.activeBar,d=we(this.props,!1);return n&&n.map(function(f,h){var m=h===c,y=m?u:s,p=Ft(Ft(Ft({},d),f),{},{isActive:m,option:y,index:h,dataKey:l,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return T.createElement(Be,ly({className:"recharts-bar-rectangle"},bl(i.props,f,h),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(h)}),T.createElement(IP,p))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,i=this.props,a=i.data,s=i.layout,l=i.isAnimationActive,c=i.animationBegin,u=i.animationDuration,d=i.animationEasing,f=i.animationId,h=this.state.prevData;return T.createElement(gi,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(m){var y=m.t,p=a.map(function(x,g){var v=h&&h[g];if(v){var w=Xt(v.x,x.x),_=Xt(v.y,x.y),j=Xt(v.width,x.width),N=Xt(v.height,x.height);return Ft(Ft({},x),{},{x:w(y),y:_(y),width:j(y),height:N(y)})}if(s==="horizontal"){var S=Xt(0,x.height),E=S(y);return Ft(Ft({},x),{},{y:x.y+x.height-E,height:E})}var k=Xt(0,x.width),A=k(y);return Ft(Ft({},x),{},{width:A})});return T.createElement(Be,null,n.renderRectanglesStatically(p))})}},{key:"renderRectangles",value:function(){var n=this.props,i=n.data,a=n.isAnimationActive,s=this.state.prevData;return a&&i&&i.length&&(!s||!jl(s,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var n=this,i=this.props,a=i.data,s=i.dataKey,l=i.activeIndex,c=we(this.props.background,!1);return a.map(function(u,d){u.value;var f=u.background,h=_1e(u,j1e);if(!f)return null;var m=Ft(Ft(Ft(Ft(Ft({},h),{},{fill:"#eee"},f),c),bl(n.props,u,d)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:s,index:d,className:"recharts-bar-background-rectangle"});return T.createElement(IP,ly({key:"background-bar-".concat(d),option:n.props.background,isActive:d===l},m))})}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.data,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,f=hn(d,Qh);if(!f)return null;var h=u==="vertical"?s[0].height/2:s[0].width/2,m=function(x,g){var v=Array.isArray(x.value)?x.value[1]:x.value;return{x:x.x,y:x.y,value:v,errorVal:Mt(x,g)}},y={clipPath:n?"url(#clipPath-".concat(i,")"):null};return T.createElement(Be,y,f.map(function(p){return T.cloneElement(p,{key:"error-bar-".concat(i,"-").concat(p.props.dataKey),data:s,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:m})}))}},{key:"render",value:function(){var n=this.props,i=n.hide,a=n.data,s=n.className,l=n.xAxis,c=n.yAxis,u=n.left,d=n.top,f=n.width,h=n.height,m=n.isAnimationActive,y=n.background,p=n.id;if(i||!a||!a.length)return null;var x=this.state.isAnimationFinished,g=$e("recharts-bar",s),v=l&&l.allowDataOverflow,w=c&&c.allowDataOverflow,_=v||w,j=Ae(p)?this.id:p;return T.createElement(Be,{className:g},v||w?T.createElement("defs",null,T.createElement("clipPath",{id:"clipPath-".concat(j)},T.createElement("rect",{x:v?u:u-f/2,y:w?d:d-h/2,width:v?f:f*2,height:w?h:h*2}))):null,T.createElement(Be,{className:"recharts-bar-rectangles",clipPath:_?"url(#clipPath-".concat(j,")"):null},y?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(_,j),(!m||x)&&Fi.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:i.curData}:n.data!==i.curData?{curData:n.data}:null}}])}(b.PureComponent);AI=Rl;_s(Rl,"displayName","Bar");_s(Rl,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!no.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});_s(Rl,"getComposedData",function(e){var t=e.props,r=e.item,n=e.barPosition,i=e.bandSize,a=e.xAxis,s=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,m=dye(n,r);if(!m)return null;var y=t.layout,p=r.type.defaultProps,x=p!==void 0?Ft(Ft({},p),r.props):r.props,g=x.dataKey,v=x.children,w=x.minPointSize,_=y==="horizontal"?s:a,j=u?_.scale.domain():null,N=vye({numericAxis:_}),S=hn(v,M0),E=f.map(function(k,A){var C,P,$,O,I,D;u?C=fye(u[d+A],j):(C=Mt(k,g),Array.isArray(C)||(C=[N,C]));var L=w1e(w,AI.defaultProps.minPointSize)(C[1],A);if(y==="horizontal"){var R,M=[s.scale(C[0]),s.scale(C[1])],B=M[0],U=M[1];P=EA({axis:a,ticks:l,bandSize:i,offset:m.offset,entry:k,index:A}),$=(R=U??B)!==null&&R!==void 0?R:void 0,O=m.size;var W=B-U;if(I=Number.isNaN(W)?0:W,D={x:P,y:s.y,width:O,height:s.height},Math.abs(L)>0&&Math.abs(I)<Math.abs(L)){var Z=Mr(I||L)*(Math.abs(L)-Math.abs(I));$-=Z,I+=Z}}else{var q=[a.scale(C[0]),a.scale(C[1])],ee=q[0],le=q[1];if(P=ee,$=EA({axis:s,ticks:c,bandSize:i,offset:m.offset,entry:k,index:A}),O=le-ee,I=m.size,D={x:a.x,y:$,width:a.width,height:I},Math.abs(L)>0&&Math.abs(O)<Math.abs(L)){var ve=Mr(O||L)*(Math.abs(L)-Math.abs(O));O+=ve}}return Ft(Ft(Ft({},k),{},{x:P,y:$,width:O,height:I,value:u?C:C[1],payload:k,background:D},S&&S[A]&&S[A].props),{},{tooltipPayload:[J6(r,k)],tooltipPosition:{x:P+O/2,y:$+I/2}})});return Ft({data:E,layout:y},h)});function _h(e){"@babel/helpers - typeof";return _h=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},_h(e)}function T1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,TI(n.key),n)}}function $1e(e,t,r){return t&&FP(e.prototype,t),r&&FP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function BP(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 ri(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?BP(Object(r),!0).forEach(function(n){X0(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function X0(e,t,r){return t=TI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TI(e){var t=M1e(e,"string");return _h(t)=="symbol"?t:t+""}function M1e(e,t){if(_h(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(_h(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var J_=function(t,r,n,i,a){var s=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(r),f={left:n.left,leftMirror:n.left,right:s-n.right,rightMirror:s-n.right,top:n.top,topMirror:n.top,bottom:l-n.bottom,bottomMirror:l-n.bottom},h=!!sn(u,Rl);return d.reduce(function(m,y){var p=r[y],x=p.orientation,g=p.domain,v=p.padding,w=v===void 0?{}:v,_=p.mirror,j=p.reversed,N="".concat(x).concat(_?"Mirror":""),S,E,k,A,C;if(p.type==="number"&&(p.padding==="gap"||p.padding==="no-gap")){var P=g[1]-g[0],$=1/0,O=p.categoricalDomain.sort(bre);if(O.forEach(function(q,ee){ee>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<Math.PI-l?n/Math.sin(s):r/Math.cos(s);return Math.abs(c)},L1e=qi,F1e=Gh,B1e=C0;function z1e(e){return function(t,r,n){var i=Object(t);if(!F1e(t)){var a=L1e(r);t=B1e(t),r=function(l){return a(i[l],l,i)}}var s=e(t,r,n);return 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;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,WI(n.key),n)}}function dje(e,t,r){return t&&uje(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function fje(e,t,r){return t=uy(t),hje(e,UI()?Reflect.construct(t,r||[],uy(e).constructor):t.apply(e,r))}function hje(e,t){if(t&&(pu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mje(e)}function mje(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(UI=function(){return!!e})()}function uy(e){return uy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},uy(e)}function pje(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G1(e,t)}function G1(e,t){return G1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},G1(e,t)}function UP(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 WP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?UP(Object(r),!0).forEach(function(n){aN(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):UP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aN(e,t,r){return t=WI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WI(e){var t=gje(e,"string");return pu(t)=="symbol"?t:t+""}function gje(e,t){if(pu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(pu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function yje(e,t){return wje(e)||bje(e,t)||xje(e,t)||vje()}function vje(){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 xje(e,t){if(e){if(typeof e=="string")return VP(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 VP(e,t)}}function VP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function bje(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function wje(e){if(Array.isArray(e))return e}function Y1(){return Y1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Y1.apply(this,arguments)}var jje=function(t,r){var n;return T.isValidElement(t)?n=T.cloneElement(t,r):ke(t)?n=t(r):n=T.createElement("line",Y1({},r,{className:"recharts-reference-line-line"})),n},_je=function(t,r,n,i,a,s,l,c,u){var d=a.x,f=a.y,h=a.width,m=a.height;if(n){var y=u.y,p=t.y.apply(y,{position:s});if(Bi(u,"discard")&&!t.y.isInRange(p))return null;var x=[{x:d+h,y:p},{x:d,y:p}];return c==="left"?x.reverse():x}if(r){var g=u.x,v=t.x.apply(g,{position:s});if(Bi(u,"discard")&&!t.x.isInRange(v))return null;var w=[{x:v,y:f+m},{x:v,y:f}];return l==="top"?w.reverse():w}if(i){var _=u.segment,j=_.map(function(N){return t.apply(N,{position:s})});return Bi(u,"discard")&&Kwe(j,function(N){return!t.isInRange(N)})?null:j}return null};function Nje(e){var t=e.x,r=e.y,n=e.segment,i=e.xAxisId,a=e.yAxisId,s=e.shape,l=e.className,c=e.alwaysShow,u=ije(),d=BI(i),f=zI(a),h=oje();if(!u||!h)return null;mi(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var m=eN({x:d.scale,y:f.scale}),y=Jt(t),p=Jt(r),x=n&&n.length===2,g=_je(m,y,p,x,h,e.position,d.orientation,f.orientation,e);if(!g)return null;var v=yje(g,2),w=v[0],_=w.x,j=w.y,N=v[1],S=N.x,E=N.y,k=Bi(e,"hidden")?"url(#".concat(u,")"):void 0,A=WP(WP({clipPath:k},we(e,!0)),{},{x1:_,y1:j,x2:S,y2:E});return T.createElement(Be,{className:$e("recharts-reference-line",l)},jje(s,A),sr.renderCallByParent(e,R1e({x1:_,y1:j,x2:S,y2:E})))}var sN=function(e){function t(){return cje(this,t),fje(this,t,arguments)}return pje(t,e),dje(t,[{key:"render",value:function(){return T.createElement(Nje,this.props)}}])}(T.Component);aN(sN,"displayName","ReferenceLine");aN(sN,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Z1(){return Z1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Z1.apply(this,arguments)}function gu(e){"@babel/helpers - typeof";return gu=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},gu(e)}function HP(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 qP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?HP(Object(r),!0).forEach(function(n){Q0(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kje(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,HI(n.key),n)}}function Eje(e,t,r){return t&&kje(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oje(e,t,r){return t=dy(t),Aje(e,VI()?Reflect.construct(t,r||[],dy(e).constructor):t.apply(e,r))}function Aje(e,t){if(t&&(gu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pje(e)}function Pje(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function VI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(VI=function(){return!!e})()}function dy(e){return dy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},dy(e)}function Cje(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&X1(e,t)}function X1(e,t){return X1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},X1(e,t)}function Q0(e,t,r){return t=HI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HI(e){var t=Tje(e,"string");return gu(t)=="symbol"?t:t+""}function Tje(e,t){if(gu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(gu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var $je=function(t){var r=t.x,n=t.y,i=t.xAxis,a=t.yAxis,s=eN({x:i.scale,y:a.scale}),l=s.apply({x:r,y:n},{bandAware:!0});return Bi(t,"discard")&&!s.isInRange(l)?null:l},J0=function(e){function t(){return Sje(this,t),Oje(this,t,arguments)}return Cje(t,e),Eje(t,[{key:"render",value:function(){var n=this.props,i=n.x,a=n.y,s=n.r,l=n.alwaysShow,c=n.clipPathId,u=Jt(i),d=Jt(a);if(mi(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=$je(this.props);if(!f)return null;var h=f.x,m=f.y,y=this.props,p=y.shape,x=y.className,g=Bi(this.props,"hidden")?"url(#".concat(c,")"):void 0,v=qP(qP({clipPath:g},we(this.props,!0)),{},{cx:h,cy:m});return T.createElement(Be,{className:$e("recharts-reference-dot",x)},t.renderDot(p,v),sr.renderCallByParent(this.props,{x:h-s,y:m-s,width:2*s,height:2*s}))}}])}(T.Component);Q0(J0,"displayName","ReferenceDot");Q0(J0,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Q0(J0,"renderDot",function(e,t){var r;return T.isValidElement(e)?r=T.cloneElement(e,t):ke(e)?r=e(t):r=T.createElement(Jh,Z1({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function Q1(){return Q1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Q1.apply(this,arguments)}function yu(e){"@babel/helpers - typeof";return yu=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},yu(e)}function KP(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 GP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?KP(Object(r),!0).forEach(function(n){ev(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):KP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rje(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,KI(n.key),n)}}function Ije(e,t,r){return t&&Rje(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Dje(e,t,r){return t=fy(t),Lje(e,qI()?Reflect.construct(t,r||[],fy(e).constructor):t.apply(e,r))}function Lje(e,t){if(t&&(yu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fje(e)}function Fje(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qI=function(){return!!e})()}function fy(e){return fy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},fy(e)}function Bje(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&J1(e,t)}function J1(e,t){return J1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},J1(e,t)}function ev(e,t,r){return t=KI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KI(e){var t=zje(e,"string");return yu(t)=="symbol"?t:t+""}function zje(e,t){if(yu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(yu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Uje=function(t,r,n,i,a){var s=a.x1,l=a.x2,c=a.y1,u=a.y2,d=a.xAxis,f=a.yAxis;if(!d||!f)return null;var h=eN({x:d.scale,y:f.scale}),m={x:t?h.x.apply(s,{position:"start"}):h.x.rangeMin,y:n?h.y.apply(c,{position:"start"}):h.y.rangeMin},y={x:r?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:i?h.y.apply(u,{position:"end"}):h.y.rangeMax};return Bi(a,"discard")&&(!h.isInRange(m)||!h.isInRange(y))?null:$I(m,y)},tv=function(e){function t(){return Mje(this,t),Dje(this,t,arguments)}return Bje(t,e),Ije(t,[{key:"render",value:function(){var n=this.props,i=n.x1,a=n.x2,s=n.y1,l=n.y2,c=n.className,u=n.alwaysShow,d=n.clipPathId;mi(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Jt(i),h=Jt(a),m=Jt(s),y=Jt(l),p=this.props.shape;if(!f&&!h&&!m&&!y&&!p)return null;var x=Uje(f,h,m,y,this.props);if(!x&&!p)return null;var g=Bi(this.props,"hidden")?"url(#".concat(d,")"):void 0;return T.createElement(Be,{className:$e("recharts-reference-area",c)},t.renderRect(p,GP(GP({clipPath:g},we(this.props,!0)),x)),sr.renderCallByParent(this.props,x))}}])}(T.Component);ev(tv,"displayName","ReferenceArea");ev(tv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});ev(tv,"renderRect",function(e,t){var r;return T.isValidElement(e)?r=T.cloneElement(e,t):ke(e)?r=e(t):r=T.createElement(Q_,Q1({},t,{className:"recharts-reference-area-rect"})),r});function GI(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],i=0;i<e.length;i+=t)n.push(e[i]);return n}function Wje(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return D1e(n,r)}function Vje(e,t,r){var n=r==="width",i=e.x,a=e.y,s=e.width,l=e.height;return t===1?{start:n?i:a,end:n?i+s:a+l}:{start:n?i+s:a+l,end:n?i:a}}function hy(e,t,r,n,i){if(e*t<e*n||e*t>e*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;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YP(Object(r),!0).forEach(function(n){Kje(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Kje(e,t,r){return t=Gje(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gje(e){var t=Yje(e,"string");return Nh(t)=="symbol"?t:t+""}function Yje(e,t){if(Nh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Nh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zje(e,t,r,n,i){for(var a=(n||[]).slice(),s=a.length,l=t.start,c=t.end,u=function(h){var m=a[h],y,p=function(){return y===void 0&&(y=r(m,h)),y};if(h===s-1){var x=e*(m.coordinate+e*p()/2-c);a[h]=m=br(br({},m),{},{tickCoord:x>0?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<y;x++)p(x);return s}function oN(e,t,r){var n=e.tick,i=e.ticks,a=e.viewBox,s=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!i||!i.length||!n)return[];if(re(c)||no.isSsr)return Hje(i,typeof c=="number"&&re(c)?c:0);var h=[],m=l==="top"||l==="bottom"?"width":"height",y=d&&m==="width"?of(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},p=function(w,_){var j=ke(u)?u(w.value,_):w.value;return m==="width"?Wje(of(j,{fontSize:t,letterSpacing:r}),y,f):of(j,{fontSize:t,letterSpacing:r})[m]},x=i.length>=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<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mc.apply(this,arguments)}function ZP(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 Kt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZP(Object(r),!0).forEach(function(n){lN(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ix(e,t){if(e==null)return{};var r=t2e(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=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;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ZI(n.key),n)}}function n2e(e,t,r){return t&&XP(e.prototype,t),r&&XP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function i2e(e,t,r){return t=my(t),a2e(e,YI()?Reflect.construct(t,r||[],my(e).constructor):t.apply(e,r))}function a2e(e,t){if(t&&(vu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s2e(e)}function s2e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function YI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(YI=function(){return!!e})()}function my(e){return my=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},my(e)}function o2e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ej(e,t)}function ej(e,t){return ej=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ej(e,t)}function lN(e,t,r){return t=ZI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZI(e){var t=l2e(e,"string");return vu(t)=="symbol"?t:t+""}function l2e(e,t){if(vu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(vu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Qu=function(e){function t(r){var n;return r2e(this,t),n=i2e(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return o2e(t,e),n2e(t,[{key:"shouldComponentUpdate",value:function(n,i){var a=n.viewBox,s=Ix(n,Qje),l=this.props,c=l.viewBox,u=Ix(l,Jje);return!Ec(a,c)||!Ec(s,u)||!Ec(i,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var i=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var i=this.props,a=i.x,s=i.y,l=i.width,c=i.height,u=i.orientation,d=i.tickSize,f=i.mirror,h=i.tickMargin,m,y,p,x,g,v,w=f?-1:1,_=n.tickSize||d,j=re(n.tickCoord)?n.tickCoord:n.coordinate;switch(u){case"top":m=y=n.coordinate,x=s+ +!f*c,p=x-w*_,v=p-w*h,g=j;break;case"left":p=x=n.coordinate,y=a+ +!f*l,m=y-w*_,g=m-w*h,v=j;break;case"right":p=x=n.coordinate,y=a+ +f*l,m=y+w*_,g=m+w*h,v=j;break;default:m=y=n.coordinate,x=s+ +f*c,p=x+w*_,v=p+w*h,g=j;break}return{line:{x1:m,y1:p,x2:y,y2:x},tick:{x:g,y:v}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,i=n.orientation,a=n.mirror,s;switch(i){case"left":s=a?"start":"end";break;case"right":s=a?"end":"start";break;default:s="middle";break}return s}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,i=n.orientation,a=n.mirror,s="end";switch(i){case"left":case"right":s="middle";break;case"top":s=a?"start":"end";break;default:s=a?"end":"start";break}return s}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.x,a=n.y,s=n.width,l=n.height,c=n.orientation,u=n.mirror,d=n.axisLine,f=Kt(Kt(Kt({},we(this.props,!1)),we(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);f=Kt(Kt({},f),{},{x1:i,y1:a+h*l,x2:i+s,y2:a+h*l})}else{var m=+(c==="left"&&!u||c==="right"&&u);f=Kt(Kt({},f),{},{x1:i+m*s,y1:a,x2:i+m*s,y2:a+l})}return T.createElement("line",mc({},f,{className:$e("recharts-cartesian-axis-line",fn(d,"className"))}))}},{key:"renderTicks",value:function(n,i,a){var s=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,h=l.unit,m=oN(Kt(Kt({},this.props),{},{ticks:n}),i,a),y=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),x=we(this.props,!1),g=we(d,!1),v=Kt(Kt({},x),{},{fill:"none"},we(c,!1)),w=m.map(function(_,j){var N=s.getTickLineCoord(_),S=N.line,E=N.tick,k=Kt(Kt(Kt(Kt({textAnchor:y,verticalAnchor:p},x),{},{stroke:"none",fill:u},g),E),{},{index:j,payload:_,visibleTicksCount:m.length,tickFormatter:f});return T.createElement(Be,mc({className:"recharts-cartesian-axis-tick",key:"tick-".concat(_.value,"-").concat(_.coordinate,"-").concat(_.tickCoord)},bl(s.props,_,j)),c&&T.createElement("line",mc({},v,S,{className:$e("recharts-cartesian-axis-tick-line",fn(c,"className"))})),d&&t.renderTickItem(d,k,"".concat(ke(f)?f(_.value,j):_.value).concat(h||"")))});return T.createElement("g",{className:"recharts-cartesian-axis-ticks"},w)}},{key:"render",value:function(){var n=this,i=this.props,a=i.axisLine,s=i.width,l=i.height,c=i.ticksGenerator,u=i.className,d=i.hide;if(d)return null;var f=this.props,h=f.ticks,m=Ix(f,e2e),y=h;return ke(c)&&(y=h&&h.length>0?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<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QP(Object(r),!0).forEach(function(n){d2e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function d2e(e,t,r){return t=f2e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f2e(e){var t=h2e(e,"string");return Sl(t)=="symbol"?t:t+""}function h2e(e,t){if(Sl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Sl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Io(){return Io=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Io.apply(this,arguments)}function JP(e,t){if(e==null)return{};var r=m2e(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=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<a.length;i++)n=a[i],!(t.indexOf(n)>=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;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hf.apply(this,arguments)}function t5(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 tn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?t5(Object(r),!0).forEach(function(n){ni(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ql(e){return O2e(e)||E2e(e)||k2e(e)||S2e()}function S2e(){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 k2e(e,t){if(e){if(typeof e=="string")return tj(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 tj(e,t)}}function E2e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function O2e(e){if(Array.isArray(e))return tj(e)}function tj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function A2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r5(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,JI(n.key),n)}}function P2e(e,t,r){return t&&r5(e.prototype,t),r&&r5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function C2e(e,t,r){return t=py(t),T2e(e,QI()?Reflect.construct(t,r||[],py(e).constructor):t.apply(e,r))}function T2e(e,t){if(t&&(xu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $2e(e)}function $2e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function QI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(QI=function(){return!!e})()}function py(e){return py=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},py(e)}function M2e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rj(e,t)}function rj(e,t){return rj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},rj(e,t)}function ni(e,t,r){return t=JI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JI(e){var t=R2e(e,"string");return xu(t)=="symbol"?t:t+""}function R2e(e,t){if(xu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(xu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var rl=function(e){function t(){var r;A2e(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=C2e(this,t,[].concat(i)),ni(r,"state",{isAnimationFinished:!0,totalLength:0}),ni(r,"generateSimpleStrokeDasharray",function(s,l){return"".concat(l,"px ").concat(s-l,"px")}),ni(r,"getStrokeDasharray",function(s,l,c){var u=c.reduce(function(g,v){return g+v});if(!u)return r.generateSimpleStrokeDasharray(l,s);for(var d=Math.floor(s/u),f=s%u,h=l-s,m=[],y=0,p=0;y<c.length;p+=c[y],++y)if(p+c[y]>f){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<i;++l)s=[].concat(ql(s),ql(a));return s}},{key:"renderDotItem",value:function(n,i){var a;if(T.isValidElement(n))a=T.cloneElement(n,i);else if(ke(n))a=n(i);else{var s=i.key,l=e5(i,_2e),c=$e("recharts-line-dot",typeof n!="boolean"?n.className:"");a=T.createElement(Jh,hf({key:s},l,{className:c}))}return a}}])}(b.PureComponent);ni(rl,"displayName","Line");ni(rl,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!no.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});ni(rl,"getComposedData",function(e){var t=e.props,r=e.xAxis,n=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,s=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout,f=c.map(function(h,m){var y=Mt(h,s);return d==="horizontal"?{x:qg({axis:r,ticks:i,bandSize:l,entry:h,index:m}),y:Ae(y)?null:n.scale(y),value:y,payload:h}:{x:Ae(y)?null:r.scale(y),y:qg({axis:n,ticks:a,bandSize:l,entry:h,index:m}),value:y,payload:h}});return tn({points:f,layout:d},u)});var I2e=["layout","type","stroke","connectNulls","isRange","ref"],D2e=["key"],eD;function bu(e){"@babel/helpers - typeof";return bu=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},bu(e)}function tD(e,t){if(e==null)return{};var r=L2e(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=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;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Do.apply(this,arguments)}function n5(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 qa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?n5(Object(r),!0).forEach(function(n){Mi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function F2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i5(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,nD(n.key),n)}}function B2e(e,t,r){return t&&i5(e.prototype,t),r&&i5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function z2e(e,t,r){return t=gy(t),U2e(e,rD()?Reflect.construct(t,r||[],gy(e).constructor):t.apply(e,r))}function U2e(e,t){if(t&&(bu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return W2e(e)}function W2e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rD=function(){return!!e})()}function gy(e){return gy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},gy(e)}function V2e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nj(e,t)}function nj(e,t){return nj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},nj(e,t)}function Mi(e,t,r){return t=nD(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nD(e){var t=H2e(e,"string");return bu(t)=="symbol"?t:t+""}function H2e(e,t){if(bu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(bu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Aa=function(e){function t(){var r;F2e(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=z2e(this,t,[].concat(i)),Mi(r,"state",{isAnimationFinished:!0}),Mi(r,"id",Cl("recharts-area-")),Mi(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),ke(s)&&s()}),Mi(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),ke(s)&&s()}),r}return V2e(t,e),B2e(t,[{key:"renderDots",value:function(n,i,a){var s=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(s&&!l)return null;var c=this.props,u=c.dot,d=c.points,f=c.dataKey,h=we(this.props,!1),m=we(u,!0),y=d.map(function(x,g){var v=qa(qa(qa({key:"dot-".concat(g),r:3},h),m),{},{index:g,cx:x.x,cy:x.y,dataKey:f,value:x.value,payload:x.payload,points:d});return t.renderDotItem(u,v)}),p={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return T.createElement(Be,Do({className:"recharts-area-dots"},p),y)}},{key:"renderHorizontalRect",value:function(n){var i=this.props,a=i.baseLine,s=i.points,l=i.strokeWidth,c=s[0].x,u=s[s.length-1].x,d=n*Math.abs(c-u),f=js(s.map(function(h){return h.y||0}));return re(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(js(a.map(function(h){return h.y||0})),f)),re(f)?T.createElement("rect",{x:c<u?c:c-d,y:0,width:d,height:Math.floor(f+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(n){var i=this.props,a=i.baseLine,s=i.points,l=i.strokeWidth,c=s[0].y,u=s[s.length-1].y,d=n*Math.abs(c-u),f=js(s.map(function(h){return h.x||0}));return re(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(js(a.map(function(h){return h.x||0})),f)),re(f)?T.createElement("rect",{x:0,y:c<u?c:c-d,width:f+(l?parseInt("".concat(l),10):1),height:Math.floor(d)}):null}},{key:"renderClipRect",value:function(n){var i=this.props.layout;return i==="vertical"?this.renderVerticalRect(n):this.renderHorizontalRect(n)}},{key:"renderAreaStatically",value:function(n,i,a,s){var l=this.props,c=l.layout,u=l.type,d=l.stroke,f=l.connectNulls,h=l.isRange;l.ref;var m=tD(l,I2e);return T.createElement(Be,{clipPath:a?"url(#clipPath-".concat(s,")"):null},T.createElement(tl,Do({},we(m,!0),{points:n,connectNulls:f,type:u,baseLine:i,layout:c,stroke:"none",className:"recharts-area-area"})),d!=="none"&&T.createElement(tl,Do({},we(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:n})),d!=="none"&&h&&T.createElement(tl,Do({},we(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:i})))}},{key:"renderAreaWithAnimation",value:function(n,i){var a=this,s=this.props,l=s.points,c=s.baseLine,u=s.isAnimationActive,d=s.animationBegin,f=s.animationDuration,h=s.animationEasing,m=s.animationId,y=this.state,p=y.prevPoints,x=y.prevBaseLine;return T.createElement(gi,{begin:d,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"area-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(g){var v=g.t;if(p){var w=p.length/l.length,_=l.map(function(E,k){var A=Math.floor(k*w);if(p[A]){var C=p[A],P=Xt(C.x,E.x),$=Xt(C.y,E.y);return qa(qa({},E),{},{x:P(v),y:$(v)})}return E}),j;if(re(c)&&typeof c=="number"){var N=Xt(x,c);j=N(v)}else if(Ae(c)||qu(c)){var S=Xt(x,0);j=S(v)}else j=c.map(function(E,k){var A=Math.floor(k*w);if(x[A]){var C=x[A],P=Xt(C.x,E.x),$=Xt(C.y,E.y);return qa(qa({},E),{},{x:P(v),y:$(v)})}return E});return a.renderAreaStatically(_,j,n,i)}return T.createElement(Be,null,T.createElement("defs",null,T.createElement("clipPath",{id:"animationClipPath-".concat(i)},a.renderClipRect(v))),T.createElement(Be,{clipPath:"url(#animationClipPath-".concat(i,")")},a.renderAreaStatically(l,c,n,i)))})}},{key:"renderArea",value:function(n,i){var a=this.props,s=a.points,l=a.baseLine,c=a.isAnimationActive,u=this.state,d=u.prevPoints,f=u.prevBaseLine,h=u.totalLength;return c&&s&&s.length&&(!d&&h>0||!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;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,sD(n.key),n)}}function G2e(e,t,r){return t&&K2e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Y2e(e,t,r){return t=yy(t),Z2e(e,iD()?Reflect.construct(t,r||[],yy(e).constructor):t.apply(e,r))}function Z2e(e,t){if(t&&(wu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return X2e(e)}function X2e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(iD=function(){return!!e})()}function yy(e){return yy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yy(e)}function Q2e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ij(e,t)}function ij(e,t){return ij=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ij(e,t)}function aD(e,t,r){return t=sD(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sD(e){var t=J2e(e,"string");return wu(t)=="symbol"?t:t+""}function J2e(e,t){if(wu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(wu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function aj(){return aj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aj.apply(this,arguments)}function e_e(e){var t=e.xAxisId,r=nN(),n=iN(),i=BI(t);return i==null?null:b.createElement(Qu,aj({},i,{className:$e("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(s){return ua(s,!0)}}))}var da=function(e){function t(){return q2e(this,t),Y2e(this,t,arguments)}return Q2e(t,e),G2e(t,[{key:"render",value:function(){return b.createElement(e_e,this.props)}}])}(b.Component);aD(da,"displayName","XAxis");aD(da,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function ju(e){"@babel/helpers - typeof";return ju=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},ju(e)}function t_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;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,cD(n.key),n)}}function n_e(e,t,r){return t&&r_e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function i_e(e,t,r){return t=vy(t),a_e(e,oD()?Reflect.construct(t,r||[],vy(e).constructor):t.apply(e,r))}function a_e(e,t){if(t&&(ju(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s_e(e)}function s_e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oD=function(){return!!e})()}function vy(e){return vy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vy(e)}function o_e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sj(e,t)}function sj(e,t){return sj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},sj(e,t)}function lD(e,t,r){return t=cD(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cD(e){var t=l_e(e,"string");return ju(t)=="symbol"?t:t+""}function l_e(e,t){if(ju(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ju(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function oj(){return oj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oj.apply(this,arguments)}var c_e=function(t){var r=t.yAxisId,n=nN(),i=iN(),a=zI(r);return a==null?null:b.createElement(Qu,oj({},a,{className:$e("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:i},ticksGenerator:function(l){return ua(l,!0)}}))},fa=function(e){function t(){return t_e(this,t),i_e(this,t,arguments)}return o_e(t,e),n_e(t,[{key:"render",value:function(){return b.createElement(c_e,this.props)}}])}(b.Component);lD(fa,"displayName","YAxis");lD(fa,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function a5(e){return h_e(e)||f_e(e)||d_e(e)||u_e()}function u_e(){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 d_e(e,t){if(e){if(typeof e=="string")return lj(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 lj(e,t)}}function f_e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function h_e(e){if(Array.isArray(e))return lj(e)}function lj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var cj=function(t,r,n,i,a){var s=hn(t,sN),l=hn(t,J0),c=[].concat(a5(s),a5(l)),u=hn(t,tv),d="".concat(i,"Id"),f=i[0],h=r;if(c.length&&(h=c.reduce(function(p,x){if(x.props[d]===n&&Bi(x.props,"extendDomain")&&re(x.props[f])){var g=x.props[f];return[Math.min(p[0],g),Math.max(p[1],g)]}return p},h)),u.length){var m="".concat(f,"1"),y="".concat(f,"2");h=u.reduce(function(p,x){if(x.props[d]===n&&Bi(x.props,"extendDomain")&&re(x.props[m])&&re(x.props[y])){var g=x.props[m],v=x.props[y];return[Math.min(p[0],g,v),Math.max(p[1],g,v)]}return p},h)}return a&&a.length&&(h=a.reduce(function(p,x){return re(x)?[Math.min(p[0],x),Math.max(p[1],x)]:p},h)),h},uD={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var m=new i(d,f||c,h),y=r?r+u:u;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],m]:c._events[y].push(m):(c._events[y]=m,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=r?r+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,m=f.length,y=new Array(m);h<m;h++)y[h]=f[h].fn;return y},l.prototype.listenerCount=function(u){var d=r?r+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,h,m,y){var p=r?r+u:u;if(!this._events[p])return!1;var x=this._events[p],g=arguments.length,v,w;if(x.fn){switch(x.once&&this.removeListener(u,x.fn,void 0,!0),g){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,d),!0;case 3:return x.fn.call(x.context,d,f),!0;case 4:return x.fn.call(x.context,d,f,h),!0;case 5:return x.fn.call(x.context,d,f,h,m),!0;case 6:return x.fn.call(x.context,d,f,h,m,y),!0}for(w=1,v=new Array(g-1);w<g;w++)v[w-1]=arguments[w];x.fn.apply(x.context,v)}else{var _=x.length,j;for(w=0;w<_;w++)switch(x[w].once&&this.removeListener(u,x[w].fn,void 0,!0),g){case 1:x[w].fn.call(x[w].context);break;case 2:x[w].fn.call(x[w].context,d);break;case 3:x[w].fn.call(x[w].context,d,f);break;case 4:x[w].fn.call(x[w].context,d,f,h);break;default:if(!v)for(j=1,v=new Array(g-1);j<g;j++)v[j-1]=arguments[j];x[w].fn.apply(x[w].context,v)}}return!0},l.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return a(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,h){var m=r?r+u:u;if(!this._events[m])return this;if(!d)return s(this,m),this;var y=this._events[m];if(y.fn)y.fn===d&&(!h||y.once)&&(!f||y.context===f)&&s(this,m);else{for(var p=0,x=[],g=y.length;p<g;p++)(y[p].fn!==d||h&&!y[p].once||f&&y[p].context!==f)&&x.push(y[p]);x.length?this._events[m]=x.length===1?x[0]:x:s(this,m)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=r?r+u:u,this._events[d]&&s(this,d)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(uD);var m_e=uD.exports;const p_e=Xe(m_e);var Dx=new p_e,Lx="recharts.syncMouseEvents";function Sh(e){"@babel/helpers - typeof";return Sh=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},Sh(e)}function g_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y_e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,dD(n.key),n)}}function v_e(e,t,r){return t&&y_e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fx(e,t,r){return t=dD(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dD(e){var t=x_e(e,"string");return Sh(t)=="symbol"?t:t+""}function x_e(e,t){if(Sh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Sh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var b_e=function(){function e(){g_e(this,e),Fx(this,"activeIndex",0),Fx(this,"coordinateList",[]),Fx(this,"layout","horizontal")}return v_e(e,[{key:"setDetails",value:function(r){var n,i=r.coordinateList,a=i===void 0?null:i,s=r.container,l=s===void 0?null:s,c=r.layout,u=c===void 0?null:c,d=r.offset,f=d===void 0?null:d,h=r.mouseHandlerCallback,m=h===void 0?null:h;this.coordinateList=(n=a??this.coordinateList)!==null&&n!==void 0?n:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=m??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),a=i.x,s=i.y,l=i.height,c=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,d=((n=window)===null||n===void 0?void 0:n.scrollY)||0,f=a+c+u,h=s+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])}();function w_e(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e==null?void 0:e[0],i=e==null?void 0:e[1];if(n&&i&&re(n)&&re(i))return!0}return!1}function j_e(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-i,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function fD(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,a=e.endAngle,s=dt(t,r,n,i),l=dt(t,r,n,a);return{points:[s,l],cx:t,cy:r,radius:n,startAngle:i,endAngle:a}}function __e(e,t,r){var n,i,a,s;if(e==="horizontal")n=t.x,a=n,i=r.top,s=r.top+r.height;else if(e==="vertical")i=t.y,s=i,n=r.left,a=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,f=t.angle,h=dt(l,c,u,f),m=dt(l,c,d,f);n=h.x,i=h.y,a=m.x,s=m.y}else return fD(t);return[{x:n,y:i},{x:a,y:s}]}function kh(e){"@babel/helpers - typeof";return kh=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},kh(e)}function s5(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 Hm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?s5(Object(r),!0).forEach(function(n){N_e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function N_e(e,t,r){return t=S_e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S_e(e){var t=k_e(e,"string");return kh(t)=="symbol"?t:t+""}function k_e(e,t){if(kh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(kh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function E_e(e){var t,r,n=e.element,i=e.tooltipEventType,a=e.isActive,s=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,h=e.chartName,m=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!m||!a||!s||h!=="ScatterChart"&&i!=="axis")return null;var y,p=tl;if(h==="ScatterChart")y=s,p=Rxe;else if(h==="BarChart")y=j_e(f,s,c,d),p=Q_;else if(f==="radial"){var x=fD(s),g=x.cx,v=x.cy,w=x.radius,_=x.startAngle,j=x.endAngle;y={cx:g,cy:v,startAngle:_,endAngle:j,innerRadius:w,outerRadius:w},p=aI}else y={points:__e(f,s,c)},p=tl;var N=Hm(Hm(Hm(Hm({stroke:"#ccc",pointerEvents:"none"},c),y),we(m,!1)),{},{payload:l,payloadIndex:u,className:$e("recharts-tooltip-cursor",m.className)});return b.isValidElement(m)?b.cloneElement(m,N):b.createElement(p,N)}var O_e=["item"],A_e=["children","className","width","height","style","compact","title","desc"];function _u(e){"@babel/helpers - typeof";return _u=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},_u(e)}function pc(){return pc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pc.apply(this,arguments)}function o5(e,t){return T_e(e)||C_e(e,t)||mD(e,t)||P_e()}function P_e(){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 C_e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function T_e(e){if(Array.isArray(e))return e}function l5(e,t){if(e==null)return{};var r=$_e(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=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;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pD(n.key),n)}}function I_e(e,t,r){return t&&R_e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function D_e(e,t,r){return t=xy(t),L_e(e,hD()?Reflect.construct(t,r||[],xy(e).constructor):t.apply(e,r))}function L_e(e,t){if(t&&(_u(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return F_e(e)}function F_e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hD=function(){return!!e})()}function xy(e){return xy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xy(e)}function B_e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uj(e,t)}function uj(e,t){return uj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},uj(e,t)}function Nu(e){return W_e(e)||U_e(e)||mD(e)||z_e()}function z_e(){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 mD(e,t){if(e){if(typeof e=="string")return dj(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 dj(e,t)}}function U_e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function W_e(e){if(Array.isArray(e))return dj(e)}function dj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function c5(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 X(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?c5(Object(r),!0).forEach(function(n){Se(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Se(e,t,r){return t=pD(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pD(e){var t=V_e(e,"string");return _u(t)=="symbol"?t:t+""}function V_e(e,t){if(_u(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(_u(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var H_e={xAxis:["bottom","top"],yAxis:["left","right"]},q_e={width:"100%",height:"100%"},gD={x:0,y:0};function qm(e){return e}var K_e=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},G_e=function(t,r,n,i){var a=r.find(function(d){return d&&d.index===n});if(a){if(t==="horizontal")return{x:a.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:a.coordinate};if(t==="centric"){var s=a.coordinate,l=i.radius;return X(X(X({},i),dt(i.cx,i.cy,l,s)),{},{angle:s,radius:l})}var c=a.coordinate,u=i.angle;return X(X(X({},i),dt(i.cx,i.cy,c,u)),{},{angle:u,radius:c})}return gD},rv=function(t,r){var n=r.graphicalItems,i=r.dataStartIndex,a=r.dataEndIndex,s=(n??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(Nu(l),Nu(u)):l},[]);return s.length>0?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<R.length;M++)if(R[M].value===N.activeLabel){I=M;break}}var B=X(X({},L),{},{x:L.left,y:L.top}),U=Math.min($,B.x+B.width),W=Math.min(O,B.y+B.height),Z=R[I]&&R[I].value,q=fj(j.state,j.props.data,I),ee=R[I]?{x:E==="horizontal"?R[I].coordinate:U,y:E==="horizontal"?W:R[I].coordinate}:gD;j.setState(X(X({},N),{},{activeLabel:Z,activeCoordinate:ee,activePayload:q,activeTooltipIndex:I}))}else j.setState(N)}),Se(j,"renderCursor",function(N){var S,E=j.state,k=E.isTooltipActive,A=E.activeCoordinate,C=E.activePayload,P=E.offset,$=E.activeTooltipIndex,O=E.tooltipAxisBandSize,I=j.getTooltipEventType(),D=(S=N.props.active)!==null&&S!==void 0?S:k,L=j.props.layout,R=N.key||"_recharts-cursor";return T.createElement(E_e,{key:R,activeCoordinate:A,activePayload:C,activeTooltipIndex:$,chartName:r,element:N,isActive:D,layout:L,offset:P,tooltipAxisBandSize:O,tooltipEventType:I})}),Se(j,"renderPolarAxis",function(N,S,E){var k=fn(N,"type.axisType"),A=fn(j.state,"".concat(k,"Map")),C=N.type.defaultProps,P=C!==void 0?X(X({},C),N.props):N.props,$=A&&A[P["".concat(k,"Id")]];return b.cloneElement(N,X(X({},$),{},{className:$e(k,$.className),key:N.key||"".concat(S,"-").concat(E),ticks:ua($,!0)}))}),Se(j,"renderPolarGrid",function(N){var S=N.props,E=S.radialLines,k=S.polarAngles,A=S.polarRadius,C=j.state,P=C.radiusAxisMap,$=C.angleAxisMap,O=ss(P),I=ss($),D=I.cx,L=I.cy,R=I.innerRadius,M=I.outerRadius;return b.cloneElement(N,{polarAngles:Array.isArray(k)?k:ua(I,!0).map(function(B){return B.coordinate}),polarRadius:Array.isArray(A)?A:ua(O,!0).map(function(B){return B.coordinate}),cx:D,cy:L,innerRadius:R,outerRadius:M,key:N.key||"polar-grid",radialLines:E})}),Se(j,"renderLegend",function(){var N=j.state.formattedGraphicalItems,S=j.props,E=S.children,k=S.width,A=S.height,C=j.props.margin||{},P=k-(C.left||0)-(C.right||0),$=V6({children:E,formattedGraphicalItems:N,legendWidth:P,legendContent:u});if(!$)return null;var O=$.item,I=l5($,O_e);return b.cloneElement(O,X(X({},I),{},{chartWidth:k,chartHeight:A,margin:C,onBBoxUpdate:j.handleLegendBBoxUpdate}))}),Se(j,"renderTooltip",function(){var N,S=j.props,E=S.children,k=S.accessibilityLayer,A=sn(E,Wr);if(!A)return null;var C=j.state,P=C.isTooltipActive,$=C.activeCoordinate,O=C.activePayload,I=C.activeLabel,D=C.offset,L=(N=A.props.active)!==null&&N!==void 0?N:P;return b.cloneElement(A,{viewBox:X(X({},D),{},{x:D.left,y:D.top}),active:L,label:I,payload:L?O:[],coordinate:$,accessibilityLayer:k})}),Se(j,"renderBrush",function(N){var S=j.props,E=S.margin,k=S.data,A=j.state,C=A.offset,P=A.dataStartIndex,$=A.dataEndIndex,O=A.updateId;return b.cloneElement(N,{key:N.key||"_recharts-brush",onChange:zm(j.handleBrushChange,N.props.onChange),data:k,x:re(N.props.x)?N.props.x:C.left,y:re(N.props.y)?N.props.y:C.top+C.height+C.brushBottom-(E.bottom||0),width:re(N.props.width)?N.props.width:C.width,startIndex:P,endIndex:$,updateId:"brush-".concat(O)})}),Se(j,"renderReferenceElement",function(N,S,E){if(!N)return null;var k=j,A=k.clipPathId,C=j.state,P=C.xAxisMap,$=C.yAxisMap,O=C.offset,I=N.type.defaultProps||{},D=N.props,L=D.xAxisId,R=L===void 0?I.xAxisId:L,M=D.yAxisId,B=M===void 0?I.yAxisId:M;return b.cloneElement(N,{key:N.key||"".concat(S,"-").concat(E),xAxis:P[R],yAxis:$[B],viewBox:{x:O.left,y:O.top,width:O.width,height:O.height},clipPathId:A})}),Se(j,"renderActivePoints",function(N){var S=N.item,E=N.activePoint,k=N.basePoint,A=N.childIndex,C=N.isRange,P=[],$=S.props.key,O=S.item.type.defaultProps!==void 0?X(X({},S.item.type.defaultProps),S.item.props):S.item.props,I=O.activeDot,D=O.dataKey,L=X(X({index:A,dataKey:D,cx:E.x,cy:E.y,r:4,fill:X_(S.item),strokeWidth:2,stroke:"#fff",payload:E.payload,value:E.value},we(I,!1)),jg(I));return P.push(g.renderActiveDot(I,L,"".concat($,"-activePoint-").concat(A))),k?P.push(g.renderActiveDot(I,X(X({},L),{},{cx:k.x,cy:k.y}),"".concat($,"-basePoint-").concat(A))):C&&P.push(null),P}),Se(j,"renderGraphicChild",function(N,S,E){var k=j.filterFormatItem(N,S,E);if(!k)return null;var A=j.getTooltipEventType(),C=j.state,P=C.isTooltipActive,$=C.tooltipAxis,O=C.activeTooltipIndex,I=C.activeLabel,D=j.props.children,L=sn(D,Wr),R=k.props,M=R.points,B=R.isRange,U=R.baseLine,W=k.item.type.defaultProps!==void 0?X(X({},k.item.type.defaultProps),k.item.props):k.item.props,Z=W.activeDot,q=W.hide,ee=W.activeBar,le=W.activeShape,ve=!!(!q&&P&&L&&(Z||ee||le)),Ne={};A!=="axis"&&L&&L.props.trigger==="click"?Ne={onClick:zm(j.handleItemMouseEnter,N.props.onClick)}:A!=="axis"&&(Ne={onMouseLeave:zm(j.handleItemMouseLeave,N.props.onMouseLeave),onMouseEnter:zm(j.handleItemMouseEnter,N.props.onMouseEnter)});var J=b.cloneElement(N,X(X({},k.props),Ne));function oe(K){return typeof $.dataKey=="function"?$.dataKey(K.payload):null}if(ve)if(O>=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;S<E;S++){var k=N[S];if(k.item===w||k.props.key===w.key||_===pa(k.item.type)&&j===k.childIndex)return k}return null}},{key:"renderClipPath",value:function(){var w=this.clipPathId,_=this.state.offset,j=_.left,N=_.top,S=_.height,E=_.width;return T.createElement("defs",null,T.createElement("clipPath",{id:w},T.createElement("rect",{x:j,y:N,height:S,width:E})))}},{key:"getXScales",value:function(){var w=this.state.xAxisMap;return w?Object.entries(w).reduce(function(_,j){var N=o5(j,2),S=N[0],E=N[1];return X(X({},_),{},Se({},S,E.scale))},{}):null}},{key:"getYScales",value:function(){var w=this.state.yAxisMap;return w?Object.entries(w).reduce(function(_,j){var N=o5(j,2),S=N[0],E=N[1];return X(X({},_),{},Se({},S,E.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(w){var _;return(_=this.state.xAxisMap)===null||_===void 0||(_=_[w])===null||_===void 0?void 0:_.scale}},{key:"getYScaleByAxisId",value:function(w){var _;return(_=this.state.yAxisMap)===null||_===void 0||(_=_[w])===null||_===void 0?void 0:_.scale}},{key:"getItemByXY",value:function(w){var _=this.state,j=_.formattedGraphicalItems,N=_.activeItem;if(j&&j.length)for(var S=0,E=j.length;S<E;S++){var k=j[S],A=k.props,C=k.item,P=C.type.defaultProps!==void 0?X(X({},C.type.defaultProps),C.props):C.props,$=pa(C.type);if($==="Bar"){var O=(A.data||[]).find(function(R){return pxe(w,R)});if(O)return{graphicalItem:k,payload:O}}else if($==="RadialBar"){var I=(A.data||[]).find(function(R){return $A(w,R)});if(I)return{graphicalItem:k,payload:I}}else if(Y0(k,N)||Z0(k,N)||bh(k,N)){var D=nwe({graphicalItem:k,activeTooltipItem:N,itemData:P.data}),L=P.activeIndex===void 0?D:P.activeIndex;return{graphicalItem:X(X({},k),{},{childIndex:L}),payload:bh(k,N)?P.data[D]:k.props.data[D]}}}return null}},{key:"render",value:function(){var w=this;if(!$E(this))return null;var _=this.props,j=_.children,N=_.className,S=_.width,E=_.height,k=_.style,A=_.compact,C=_.title,P=_.desc,$=l5(_,A_e),O=we($,!1);if(A)return T.createElement(zP,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},T.createElement(Vw,pc({},O,{width:S,height:E,title:C,desc:P}),this.renderClipPath(),RE(j,this.renderMap)));if(this.props.accessibilityLayer){var I,D;O.tabIndex=(I=this.props.tabIndex)!==null&&I!==void 0?I:0,O.role=(D=this.props.role)!==null&&D!==void 0?D:"application",O.onKeyDown=function(R){w.accessibilityManager.keyboardEvent(R)},O.onFocus=function(){w.accessibilityManager.focus()}}var L=this.parseEventsOfWrapper();return T.createElement(zP,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},T.createElement("div",pc({className:$e("recharts-wrapper",N),style:X({position:"relative",cursor:"default",width:S,height:E},k)},L,{ref:function(M){w.container=M}}),T.createElement(Vw,pc({},O,{width:S,height:E,title:C,desc:P,style:q_e}),this.renderClipPath(),RE(j,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(b.Component);Se(y,"displayName",r),Se(y,"defaultProps",X({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Se(y,"getDerivedStateFromProps",function(x,g){var v=x.dataKey,w=x.data,_=x.children,j=x.width,N=x.height,S=x.layout,E=x.stackOffset,k=x.margin,A=g.dataStartIndex,C=g.dataEndIndex;if(g.updateId===void 0){var P=d5(x);return X(X(X({},P),{},{updateId:0},m(X(X({props:x},P),{},{updateId:0}),g)),{},{prevDataKey:v,prevData:w,prevWidth:j,prevHeight:N,prevLayout:S,prevStackOffset:E,prevMargin:k,prevChildren:_})}if(v!==g.prevDataKey||w!==g.prevData||j!==g.prevWidth||N!==g.prevHeight||S!==g.prevLayout||E!==g.prevStackOffset||!Ec(k,g.prevMargin)){var $=d5(x),O={chartX:g.chartX,chartY:g.chartY,isTooltipActive:g.isTooltipActive},I=X(X({},u5(g,w,S)),{},{updateId:g.updateId+1}),D=X(X(X({},$),O),I);return X(X(X({},D),m(X({props:x},D),g)),{},{prevDataKey:v,prevData:w,prevWidth:j,prevHeight:N,prevLayout:S,prevStackOffset:E,prevMargin:k,prevChildren:_})}if(!Uw(_,g.prevChildren)){var L,R,M,B,U=sn(_,hu),W=U&&(L=(R=U.props)===null||R===void 0?void 0:R.startIndex)!==null&&L!==void 0?L:A,Z=U&&(M=(B=U.props)===null||B===void 0?void 0:B.endIndex)!==null&&M!==void 0?M:C,q=W!==A||Z!==C,ee=!Ae(w),le=ee&&!q?g.updateId:g.updateId+1;return X(X({updateId:le},m(X(X({props:x},g),{},{updateId:le,dataStartIndex:W,dataEndIndex:Z}),g)),{},{prevChildren:_,dataStartIndex:W,dataEndIndex:Z})}return null}),Se(y,"renderActiveDot",function(x,g,v){var w;return b.isValidElement(x)?w=b.cloneElement(x,g):ke(x)?w=x(g):w=T.createElement(Jh,g),T.createElement(Be,{className:"recharts-active-dot",key:v},w)});var p=b.forwardRef(function(g,v){return T.createElement(y,pc({},g,{ref:v}))});return p.displayName=y.displayName,p},h5=nv({chartName:"LineChart",GraphicalChild:rl,axisComponents:[{axisType:"xAxis",AxisComp:da},{axisType:"yAxis",AxisComp:fa}],formatAxisMap:J_}),rNe=nv({chartName:"BarChart",GraphicalChild:Rl,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:da},{axisType:"yAxis",AxisComp:fa}],formatAxisMap:J_}),nNe=nv({chartName:"PieChart",GraphicalChild:Da,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:G0},{axisType:"radiusAxis",AxisComp:q0}],formatAxisMap:Aye,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),iNe=nv({chartName:"AreaChart",GraphicalChild:Aa,axisComponents:[{axisType:"xAxis",AxisComp:da},{axisType:"yAxis",AxisComp:fa}],formatAxisMap:J_});function aNe(){const[e,t]=b.useState("24h"),{data:r=[],isLoading:n,error:i}=$r({queryKey:["executions-analytics"],queryFn:()=>Ha.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&&A<S});g.push({timestamp:N.toISOString(),cpu_usage:0,memory_usage:0,active_executions:E.filter(k=>k.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<r.length;++a)if(!t.resolveDisabled(r[a],a,r))return a;return n}case 1:{for(let a=i-1;a>=0;--a)if(!t.resolveDisabled(r[a],a,r))return a;return n}case 2:{for(let a=i+1;a<r.length;++a)if(!t.resolveDisabled(r[a],a,r))return a;return n}case 3:{for(let a=r.length-1;a>=0;--a)if(!t.resolveDisabled(r[a],a,r))return a;return n}case 4:{for(let a=0;a<r.length;++a)if(t.resolveId(r[a],a,r)===e.id)return a;return n}case 5:return null;default:PNe(e)}}var at=(e=>(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 <Menu /> 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 <StableCollection>");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 <Tab.Group /> 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 <Tab.Group /> 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 <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function PSe(){let e=b.useContext(lv);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");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 <Transition /> 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<a;){const l=i[n];let c=r;if(n!==s){const u=e[l];c=It(u)||Array.isArray(u)?u:isNaN(+i[n+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=c,e=e[l]}};const w5={BLUR:"blur",FOCUS_OUT:"focusout"},li={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Xi={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},qSe=T.createContext(null);qSe.displayName="HookFormContext";var KSe=(e,t,r,n=!0)=>{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<r;)e=Ut(e)?n++:e[t[n++]];return e}function QSe(e){for(const t in e)if(e.hasOwnProperty(t)&&!Ut(e[t]))return!1;return!0}function Lt(e,t){const r=Array.isArray(t)?t:uv(t)?[t]:bN(t),n=r.length===1?e:XSe(e,r),i=r.length-1,a=r[i];return n&&delete n[a],i!==0&&(It(n)&&Ur(n)||Array.isArray(n)&&QSe(n))&&Lt(e,r.slice(0,-1)),e}var MD=e=>{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)||($=D<I.value)}else{const D=s.valueAsDate||new Date(v),L=B=>new 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)<L(I.value):M?v<I.value:D<new Date(I.value))}if((P||$)&&(C(!!P,O.message,I.message,Xi.max,Xi.min),!n))return _(j[p].message),j}if((u||d)&&!k&&(Ri(v)||a&&Array.isArray(v))){const P=Kl(u),$=Kl(d),O=!Cr(P.value)&&v.length>+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(;c<s.path.length;){const u=s.path[c];c===s.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(r(s))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return i(this),n}static assert(t){if(!(t instanceof Ca))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ke.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.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.length<a.value&&(i=this._getOrReturnCtx(t,i),de(i,{code:ae.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.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.length<a.value;(s||l)&&(i=this._getOrReturnCtx(t,i),s?de(i,{code:ae.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):l&&de(i,{code:ae.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Nke.test(t.data)||(i=this._getOrReturnCtx(t,i),de(i,{validation:"email",code:ae.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")qx||(qx=new RegExp(Ske,"u")),qx.test(t.data)||(i=this._getOrReturnCtx(t,i),de(i,{validation:"emoji",code:ae.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")bke.test(t.data)||(i=this._getOrReturnCtx(t,i),de(i,{validation:"uuid",code:ae.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")wke.test(t.data)||(i=this._getOrReturnCtx(t,i),de(i,{validation:"nanoid",code:ae.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")yke.test(t.data)||(i=this._getOrReturnCtx(t,i),de(i,{validation:"cuid",code:ae.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")vke.test(t.data)||(i=this._getOrReturnCtx(t,i),de(i,{validation:"cuid2",code:ae.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")xke.test(t.data)||(i=this._getOrReturnCtx(t,i),de(i,{validation:"ulid",code:ae.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),de(i,{validation:"url",code:ae.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),de(i,{validation:"regex",code:ae.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(t,i),de(i,{code:ae.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(i=this._getOrReturnCtx(t,i),de(i,{code:ae.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(i=this._getOrReturnCtx(t,i),de(i,{code:ae.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Mke(a).test(t.data)||(i=this._getOrReturnCtx(t,i),de(i,{code:ae.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?Tke.test(t.data)||(i=this._getOrReturnCtx(t,i),de(i,{code:ae.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?$ke(a).test(t.data)||(i=this._getOrReturnCtx(t,i),de(i,{code:ae.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?_ke.test(t.data)||(i=this._getOrReturnCtx(t,i),de(i,{validation:"duration",code:ae.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Rke(t.data,a.version)||(i=this._getOrReturnCtx(t,i),de(i,{validation:"ip",code:ae.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?Ike(t.data,a.alg)||(i=this._getOrReturnCtx(t,i),de(i,{validation:"jwt",code:ae.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?Dke(t.data,a.version)||(i=this._getOrReturnCtx(t,i),de(i,{validation:"cidr",code:ae.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?Pke.test(t.data)||(i=this._getOrReturnCtx(t,i),de(i,{validation:"base64",code:ae.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?Cke.test(t.data)||(i=this._getOrReturnCtx(t,i),de(i,{validation:"base64url",code:ae.invalid_string,message:a.message}),n.dirty()):Ke.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.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.value<t)&&(t=r.value);return t}}Ss.create=e=>new 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.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),de(n,{code:ae.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.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.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.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.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}Eh.create=e=>new 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.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),de(n,{code:ae.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.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.value<t)&&(t=r.value);return t}}Oh.create=e=>new 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_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?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.value<t)&&(t=r.value);return t!=null?new Date(t):null}}Sy.create=e=>new 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.length<i.exactLength.value;(s||l)&&(de(r,{code:s?ae.too_big:ae.too_small,minimum:l?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(de(r,{code:ae.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.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<e.length;a++){const s=e[a],l=t[a],c=vj(s,l);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===ye.date&&n===ye.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Ey extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=(a,s)=>{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.length<this._def.items.length)return de(n,{code:ae.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&n.data.length>this._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.size<i.minSize.value&&(de(n,{code:ae.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.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"}}}})]})}));
|