flowyml 1.4.0__py3-none-any.whl → 1.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. flowyml/__init__.py +2 -1
  2. flowyml/assets/featureset.py +30 -5
  3. flowyml/assets/metrics.py +47 -4
  4. flowyml/cli/main.py +21 -0
  5. flowyml/cli/models.py +444 -0
  6. flowyml/cli/rich_utils.py +95 -0
  7. flowyml/core/checkpoint.py +6 -1
  8. flowyml/core/conditional.py +104 -0
  9. flowyml/core/display.py +525 -0
  10. flowyml/core/execution_status.py +1 -0
  11. flowyml/core/executor.py +201 -8
  12. flowyml/core/orchestrator.py +500 -7
  13. flowyml/core/pipeline.py +301 -11
  14. flowyml/core/project.py +4 -1
  15. flowyml/core/scheduler.py +225 -81
  16. flowyml/core/versioning.py +13 -4
  17. flowyml/registry/model_registry.py +1 -1
  18. flowyml/storage/sql.py +53 -13
  19. flowyml/ui/backend/main.py +2 -0
  20. flowyml/ui/backend/routers/assets.py +36 -0
  21. flowyml/ui/backend/routers/execution.py +2 -2
  22. flowyml/ui/backend/routers/runs.py +211 -0
  23. flowyml/ui/backend/routers/stats.py +2 -2
  24. flowyml/ui/backend/routers/websocket.py +121 -0
  25. flowyml/ui/frontend/dist/assets/index-By4trVyv.css +1 -0
  26. flowyml/ui/frontend/dist/assets/index-CX5RV2C9.js +630 -0
  27. flowyml/ui/frontend/dist/index.html +2 -2
  28. flowyml/ui/frontend/package-lock.json +289 -0
  29. flowyml/ui/frontend/package.json +1 -0
  30. flowyml/ui/frontend/src/app/compare/page.jsx +213 -0
  31. flowyml/ui/frontend/src/app/experiments/compare/page.jsx +289 -0
  32. flowyml/ui/frontend/src/app/experiments/page.jsx +61 -1
  33. flowyml/ui/frontend/src/app/runs/[runId]/page.jsx +418 -203
  34. flowyml/ui/frontend/src/app/runs/page.jsx +64 -3
  35. flowyml/ui/frontend/src/app/settings/page.jsx +1 -1
  36. flowyml/ui/frontend/src/app/tokens/page.jsx +8 -6
  37. flowyml/ui/frontend/src/components/ArtifactViewer.jsx +159 -0
  38. flowyml/ui/frontend/src/components/NavigationTree.jsx +26 -9
  39. flowyml/ui/frontend/src/components/PipelineGraph.jsx +69 -28
  40. flowyml/ui/frontend/src/components/RunDetailsPanel.jsx +42 -14
  41. flowyml/ui/frontend/src/router/index.jsx +4 -0
  42. flowyml/ui/server_manager.py +181 -0
  43. flowyml/ui/utils.py +63 -1
  44. flowyml/utils/config.py +7 -0
  45. {flowyml-1.4.0.dist-info → flowyml-1.6.0.dist-info}/METADATA +5 -3
  46. {flowyml-1.4.0.dist-info → flowyml-1.6.0.dist-info}/RECORD +49 -41
  47. flowyml/ui/frontend/dist/assets/index-DcYwrn2j.css +0 -1
  48. flowyml/ui/frontend/dist/assets/index-Dlz_ygOL.js +0 -592
  49. {flowyml-1.4.0.dist-info → flowyml-1.6.0.dist-info}/WHEEL +0 -0
  50. {flowyml-1.4.0.dist-info → flowyml-1.6.0.dist-info}/entry_points.txt +0 -0
  51. {flowyml-1.4.0.dist-info → flowyml-1.6.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,592 +0,0 @@
1
- var uq=Object.defineProperty;var dq=(e,t,r)=>t in e?uq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Hg=(e,t,r)=>dq(e,typeof t!="symbol"?t+"":t,r);function M3(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(n,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>n[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Kf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var R3={exports:{}},u0={},$3={exports:{}},$e={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var xf=Symbol.for("react.element"),fq=Symbol.for("react.portal"),hq=Symbol.for("react.fragment"),pq=Symbol.for("react.strict_mode"),mq=Symbol.for("react.profiler"),gq=Symbol.for("react.provider"),yq=Symbol.for("react.context"),vq=Symbol.for("react.forward_ref"),xq=Symbol.for("react.suspense"),bq=Symbol.for("react.memo"),wq=Symbol.for("react.lazy"),$E=Symbol.iterator;function jq(e){return e===null||typeof e!="object"?null:(e=$E&&e[$E]||e["@@iterator"],typeof e=="function"?e:null)}var D3={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I3=Object.assign,L3={};function bc(e,t,r){this.props=e,this.context=t,this.refs=L3,this.updater=r||D3}bc.prototype.isReactComponent={};bc.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")};bc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function z3(){}z3.prototype=bc.prototype;function d2(e,t,r){this.props=e,this.context=t,this.refs=L3,this.updater=r||D3}var f2=d2.prototype=new z3;f2.constructor=d2;I3(f2,bc.prototype);f2.isPureReactComponent=!0;var DE=Array.isArray,F3=Object.prototype.hasOwnProperty,h2={current:null},B3={key:!0,ref:!0,__self:!0,__source:!0};function V3(e,t,r){var n,a={},i=null,s=null;if(t!=null)for(n in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)F3.call(t,n)&&!B3.hasOwnProperty(n)&&(a[n]=t[n]);var o=arguments.length-2;if(o===1)a.children=r;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];a.children=l}if(e&&e.defaultProps)for(n in o=e.defaultProps,o)a[n]===void 0&&(a[n]=o[n]);return{$$typeof:xf,type:e,key:i,ref:s,props:a,_owner:h2.current}}function Sq(e,t){return{$$typeof:xf,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function p2(e){return typeof e=="object"&&e!==null&&e.$$typeof===xf}function kq(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var IE=/\/+/g;function Wg(e,t){return typeof e=="object"&&e!==null&&e.key!=null?kq(""+e.key):t.toString(36)}function Xh(e,t,r,n,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case xf:case fq:s=!0}}if(s)return s=e,a=a(s),e=n===""?"."+Wg(s,0):n,DE(a)?(r="",e!=null&&(r=e.replace(IE,"$&/")+"/"),Xh(a,t,r,"",function(c){return c})):a!=null&&(p2(a)&&(a=Sq(a,r+(!a.key||s&&s.key===a.key?"":(""+a.key).replace(IE,"$&/")+"/")+e)),t.push(a)),1;if(s=0,n=n===""?".":n+":",DE(e))for(var o=0;o<e.length;o++){i=e[o];var l=n+Wg(i,o);s+=Xh(i,t,r,l,a)}else if(l=jq(e),typeof l=="function")for(e=l.call(e),o=0;!(i=e.next()).done;)i=i.value,l=n+Wg(i,o++),s+=Xh(i,t,r,l,a);else if(i==="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 Yf(e,t,r){if(e==null)return e;var n=[],a=0;return Xh(e,n,"","",function(i){return t.call(r,i,a++)}),n}function _q(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 Mr={current:null},Zh={transition:null},Nq={ReactCurrentDispatcher:Mr,ReactCurrentBatchConfig:Zh,ReactCurrentOwner:h2};function q3(){throw Error("act(...) is not supported in production builds of React.")}$e.Children={map:Yf,forEach:function(e,t,r){Yf(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Yf(e,function(){t++}),t},toArray:function(e){return Yf(e,function(t){return t})||[]},only:function(e){if(!p2(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};$e.Component=bc;$e.Fragment=hq;$e.Profiler=mq;$e.PureComponent=d2;$e.StrictMode=pq;$e.Suspense=xq;$e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Nq;$e.act=q3;$e.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=I3({},e.props),a=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=h2.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(l in t)F3.call(t,l)&&!B3.hasOwnProperty(l)&&(n[l]=t[l]===void 0&&o!==void 0?o[l]:t[l])}var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){o=Array(l);for(var c=0;c<l;c++)o[c]=arguments[c+2];n.children=o}return{$$typeof:xf,type:e.type,key:a,ref:i,props:n,_owner:s}};$e.createContext=function(e){return e={$$typeof:yq,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:gq,_context:e},e.Consumer=e};$e.createElement=V3;$e.createFactory=function(e){var t=V3.bind(null,e);return t.type=e,t};$e.createRef=function(){return{current:null}};$e.forwardRef=function(e){return{$$typeof:vq,render:e}};$e.isValidElement=p2;$e.lazy=function(e){return{$$typeof:wq,_payload:{_status:-1,_result:e},_init:_q}};$e.memo=function(e,t){return{$$typeof:bq,type:e,compare:t===void 0?null:t}};$e.startTransition=function(e){var t=Zh.transition;Zh.transition={};try{e()}finally{Zh.transition=t}};$e.unstable_act=q3;$e.useCallback=function(e,t){return Mr.current.useCallback(e,t)};$e.useContext=function(e){return Mr.current.useContext(e)};$e.useDebugValue=function(){};$e.useDeferredValue=function(e){return Mr.current.useDeferredValue(e)};$e.useEffect=function(e,t){return Mr.current.useEffect(e,t)};$e.useId=function(){return Mr.current.useId()};$e.useImperativeHandle=function(e,t,r){return Mr.current.useImperativeHandle(e,t,r)};$e.useInsertionEffect=function(e,t){return Mr.current.useInsertionEffect(e,t)};$e.useLayoutEffect=function(e,t){return Mr.current.useLayoutEffect(e,t)};$e.useMemo=function(e,t){return Mr.current.useMemo(e,t)};$e.useReducer=function(e,t,r){return Mr.current.useReducer(e,t,r)};$e.useRef=function(e){return Mr.current.useRef(e)};$e.useState=function(e){return Mr.current.useState(e)};$e.useSyncExternalStore=function(e,t,r){return Mr.current.useSyncExternalStore(e,t,r)};$e.useTransition=function(){return Mr.current.useTransition()};$e.version="18.3.1";$3.exports=$e;var _=$3.exports;const O=Ke(_),Eq=M3({__proto__:null,default:O},[_]);/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Pq=_,Cq=Symbol.for("react.element"),Aq=Symbol.for("react.fragment"),Tq=Object.prototype.hasOwnProperty,Oq=Pq.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Mq={key:!0,ref:!0,__self:!0,__source:!0};function U3(e,t,r){var n,a={},i=null,s=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(n in t)Tq.call(t,n)&&!Mq.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)a[n]===void 0&&(a[n]=t[n]);return{$$typeof:Cq,type:e,key:i,ref:s,props:a,_owner:Oq.current}}u0.Fragment=Aq;u0.jsx=U3;u0.jsxs=U3;R3.exports=u0;var u=R3.exports,aj={},H3={exports:{}},an={},W3={exports:{}},G3={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(I,R){var z=I.length;I.push(R);e:for(;0<z;){var V=z-1>>>1,B=I[V];if(0<a(B,R))I[V]=R,I[z]=B,z=V;else break e}}function r(I){return I.length===0?null:I[0]}function n(I){if(I.length===0)return null;var R=I[0],z=I.pop();if(z!==R){I[0]=z;e:for(var V=0,B=I.length,W=B>>>1;V<W;){var K=2*(V+1)-1,Q=I[K],ae=K+1,pe=I[ae];if(0>a(Q,z))ae<B&&0>a(pe,Q)?(I[V]=pe,I[ae]=z,V=ae):(I[V]=Q,I[K]=z,V=K);else if(ae<B&&0>a(pe,z))I[V]=pe,I[ae]=z,V=ae;else break e}}return R}function a(I,R){var z=I.sortIndex-R.sortIndex;return z!==0?z:I.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,o=s.now();e.unstable_now=function(){return s.now()-o}}var l=[],c=[],d=1,f=null,h=3,p=!1,g=!1,m=!1,b=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(I){for(var R=r(c);R!==null;){if(R.callback===null)n(c);else if(R.startTime<=I)n(c),R.sortIndex=R.expirationTime,t(l,R);else break;R=r(c)}}function w(I){if(m=!1,v(I),!g)if(r(l)!==null)g=!0,$(j);else{var R=r(c);R!==null&&L(w,R.startTime-I)}}function j(I,R){g=!1,m&&(m=!1,x(N),N=-1),p=!0;var z=h;try{for(v(R),f=r(l);f!==null&&(!(f.expirationTime>R)||I&&!C());){var V=f.callback;if(typeof V=="function"){f.callback=null,h=f.priorityLevel;var B=V(f.expirationTime<=R);R=e.unstable_now(),typeof B=="function"?f.callback=B:f===r(l)&&n(l),v(R)}else n(l);f=r(l)}if(f!==null)var W=!0;else{var K=r(c);K!==null&&L(w,K.startTime-R),W=!1}return W}finally{f=null,h=z,p=!1}}var k=!1,S=null,N=-1,E=5,A=-1;function C(){return!(e.unstable_now()-A<E)}function M(){if(S!==null){var I=e.unstable_now();A=I;var R=!0;try{R=S(!0,I)}finally{R?T():(k=!1,S=null)}}else k=!1}var T;if(typeof y=="function")T=function(){y(M)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,D=P.port2;P.port1.onmessage=M,T=function(){D.postMessage(null)}}else T=function(){b(M,0)};function $(I){S=I,k||(k=!0,T())}function L(I,R){N=b(function(){I(e.unstable_now())},R)}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(I){I.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,$(j))},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(l)},e.unstable_next=function(I){switch(h){case 1:case 2:case 3:var R=3;break;default:R=h}var z=h;h=R;try{return I()}finally{h=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(I,R){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var z=h;h=I;try{return R()}finally{h=z}},e.unstable_scheduleCallback=function(I,R,z){var V=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?V+z:V):z=V,I){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=z+B,I={id:d++,callback:R,priorityLevel:I,startTime:z,expirationTime:B,sortIndex:-1},z>V?(I.sortIndex=z,t(c,I),r(l)===null&&I===r(c)&&(m?(x(N),N=-1):m=!0,L(w,z-V))):(I.sortIndex=B,t(l,I),g||p||(g=!0,$(j))),I},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(I){var R=h;return function(){var z=h;h=R;try{return I.apply(this,arguments)}finally{h=z}}}})(G3);W3.exports=G3;var Rq=W3.exports;/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var $q=_,tn=Rq;function Z(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 K3=new Set,sd={};function So(e,t){$l(e,t),$l(e+"Capture",t)}function $l(e,t){for(sd[e]=t,e=0;e<t.length;e++)K3.add(t[e])}var Ya=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ij=Object.prototype.hasOwnProperty,Dq=/^[: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]*$/,LE={},zE={};function Iq(e){return ij.call(zE,e)?!0:ij.call(LE,e)?!1:Dq.test(e)?zE[e]=!0:(LE[e]=!0,!1)}function Lq(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 zq(e,t,r,n){if(t===null||typeof t>"u"||Lq(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 Rr(e,t,r,n,a,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var mr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){mr[e]=new Rr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];mr[t]=new Rr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){mr[e]=new Rr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){mr[e]=new Rr(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){mr[e]=new Rr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){mr[e]=new Rr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){mr[e]=new Rr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){mr[e]=new Rr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){mr[e]=new Rr(e,5,!1,e.toLowerCase(),null,!1,!1)});var m2=/[\-:]([a-z])/g;function g2(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(m2,g2);mr[t]=new Rr(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(m2,g2);mr[t]=new Rr(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(m2,g2);mr[t]=new Rr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){mr[e]=new Rr(e,1,!1,e.toLowerCase(),null,!1,!1)});mr.xlinkHref=new Rr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){mr[e]=new Rr(e,1,!1,e.toLowerCase(),null,!0,!0)});function y2(e,t,r,n){var a=mr.hasOwnProperty(t)?mr[t]:null;(a!==null?a.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(zq(t,r,a,n)&&(r=null),n||a===null?Iq(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):a.mustUseProperty?e[a.propertyName]=r===null?a.type===3?!1:"":r:(t=a.attributeName,n=a.attributeNamespace,r===null?e.removeAttribute(t):(a=a.type,r=a===3||a===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var ui=$q.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Xf=Symbol.for("react.element"),Qo=Symbol.for("react.portal"),Jo=Symbol.for("react.fragment"),v2=Symbol.for("react.strict_mode"),sj=Symbol.for("react.profiler"),Y3=Symbol.for("react.provider"),X3=Symbol.for("react.context"),x2=Symbol.for("react.forward_ref"),oj=Symbol.for("react.suspense"),lj=Symbol.for("react.suspense_list"),b2=Symbol.for("react.memo"),Ti=Symbol.for("react.lazy"),Z3=Symbol.for("react.offscreen"),FE=Symbol.iterator;function Hc(e){return e===null||typeof e!="object"?null:(e=FE&&e[FE]||e["@@iterator"],typeof e=="function"?e:null)}var Et=Object.assign,Gg;function ku(e){if(Gg===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Gg=t&&t[1]||""}return`
34
- `+Gg+e}var Kg=!1;function Yg(e,t){if(!e||Kg)return"";Kg=!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(c){var n=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){n=c}e.call(t.prototype)}else{try{throw Error()}catch(c){n=c}e()}}catch(c){if(c&&n&&typeof c.stack=="string"){for(var a=c.stack.split(`
35
- `),i=n.stack.split(`
36
- `),s=a.length-1,o=i.length-1;1<=s&&0<=o&&a[s]!==i[o];)o--;for(;1<=s&&0<=o;s--,o--)if(a[s]!==i[o]){if(s!==1||o!==1)do if(s--,o--,0>o||a[s]!==i[o]){var l=`
37
- `+a[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=o);break}}}finally{Kg=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?ku(e):""}function Fq(e){switch(e.tag){case 5:return ku(e.type);case 16:return ku("Lazy");case 13:return ku("Suspense");case 19:return ku("SuspenseList");case 0:case 2:case 15:return e=Yg(e.type,!1),e;case 11:return e=Yg(e.type.render,!1),e;case 1:return e=Yg(e.type,!0),e;default:return""}}function cj(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 Jo:return"Fragment";case Qo:return"Portal";case sj:return"Profiler";case v2:return"StrictMode";case oj:return"Suspense";case lj:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case X3:return(e.displayName||"Context")+".Consumer";case Y3:return(e._context.displayName||"Context")+".Provider";case x2:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case b2:return t=e.displayName||null,t!==null?t:cj(e.type)||"Memo";case Ti:t=e._payload,e=e._init;try{return cj(e(t))}catch{}}return null}function Bq(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 cj(t);case 8:return t===v2?"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 ns(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Q3(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Vq(e){var t=Q3(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 a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(s){n=""+s,i.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 Zf(e){e._valueTracker||(e._valueTracker=Vq(e))}function J3(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Q3(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function yp(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 uj(e,t){var r=t.checked;return Et({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function BE(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=ns(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 e4(e,t){t=t.checked,t!=null&&y2(e,"checked",t,!1)}function dj(e,t){e4(e,t);var r=ns(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")?fj(e,t.type,r):t.hasOwnProperty("defaultValue")&&fj(e,t.type,ns(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function VE(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 fj(e,t,r){(t!=="number"||yp(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var _u=Array.isArray;function xl(e,t,r,n){if(e=e.options,t){t={};for(var a=0;a<r.length;a++)t["$"+r[a]]=!0;for(r=0;r<e.length;r++)a=t.hasOwnProperty("$"+e[r].value),e[r].selected!==a&&(e[r].selected=a),a&&n&&(e[r].defaultSelected=!0)}else{for(r=""+ns(r),t=null,a=0;a<e.length;a++){if(e[a].value===r){e[a].selected=!0,n&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function hj(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Z(91));return Et({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function qE(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(Z(92));if(_u(r)){if(1<r.length)throw Error(Z(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:ns(r)}}function t4(e,t){var r=ns(t.value),n=ns(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 UE(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function r4(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 pj(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?r4(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Qf,n4=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,a){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Qf=Qf||document.createElement("div"),Qf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Qf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function od(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Fu={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},qq=["Webkit","ms","Moz","O"];Object.keys(Fu).forEach(function(e){qq.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Fu[t]=Fu[e]})});function a4(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Fu.hasOwnProperty(e)&&Fu[e]?(""+t).trim():t+"px"}function i4(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=a4(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var Uq=Et({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 mj(e,t){if(t){if(Uq[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Z(62))}}function gj(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 yj=null;function w2(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vj=null,bl=null,wl=null;function HE(e){if(e=jf(e)){if(typeof vj!="function")throw Error(Z(280));var t=e.stateNode;t&&(t=m0(t),vj(e.stateNode,e.type,t))}}function s4(e){bl?wl?wl.push(e):wl=[e]:bl=e}function o4(){if(bl){var e=bl,t=wl;if(wl=bl=null,HE(e),t)for(e=0;e<t.length;e++)HE(t[e])}}function l4(e,t){return e(t)}function c4(){}var Xg=!1;function u4(e,t,r){if(Xg)return e(t,r);Xg=!0;try{return l4(e,t,r)}finally{Xg=!1,(bl!==null||wl!==null)&&(c4(),o4())}}function ld(e,t){var r=e.stateNode;if(r===null)return null;var n=m0(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(Z(231,t,typeof r));return r}var xj=!1;if(Ya)try{var Wc={};Object.defineProperty(Wc,"passive",{get:function(){xj=!0}}),window.addEventListener("test",Wc,Wc),window.removeEventListener("test",Wc,Wc)}catch{xj=!1}function Hq(e,t,r,n,a,i,s,o,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(d){this.onError(d)}}var Bu=!1,vp=null,xp=!1,bj=null,Wq={onError:function(e){Bu=!0,vp=e}};function Gq(e,t,r,n,a,i,s,o,l){Bu=!1,vp=null,Hq.apply(Wq,arguments)}function Kq(e,t,r,n,a,i,s,o,l){if(Gq.apply(this,arguments),Bu){if(Bu){var c=vp;Bu=!1,vp=null}else throw Error(Z(198));xp||(xp=!0,bj=c)}}function ko(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 d4(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 WE(e){if(ko(e)!==e)throw Error(Z(188))}function Yq(e){var t=e.alternate;if(!t){if(t=ko(e),t===null)throw Error(Z(188));return t!==e?null:e}for(var r=e,n=t;;){var a=r.return;if(a===null)break;var i=a.alternate;if(i===null){if(n=a.return,n!==null){r=n;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===r)return WE(a),e;if(i===n)return WE(a),t;i=i.sibling}throw Error(Z(188))}if(r.return!==n.return)r=a,n=i;else{for(var s=!1,o=a.child;o;){if(o===r){s=!0,r=a,n=i;break}if(o===n){s=!0,n=a,r=i;break}o=o.sibling}if(!s){for(o=i.child;o;){if(o===r){s=!0,r=i,n=a;break}if(o===n){s=!0,n=i,r=a;break}o=o.sibling}if(!s)throw Error(Z(189))}}if(r.alternate!==n)throw Error(Z(190))}if(r.tag!==3)throw Error(Z(188));return r.stateNode.current===r?e:t}function f4(e){return e=Yq(e),e!==null?h4(e):null}function h4(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=h4(e);if(t!==null)return t;e=e.sibling}return null}var p4=tn.unstable_scheduleCallback,GE=tn.unstable_cancelCallback,Xq=tn.unstable_shouldYield,Zq=tn.unstable_requestPaint,Dt=tn.unstable_now,Qq=tn.unstable_getCurrentPriorityLevel,j2=tn.unstable_ImmediatePriority,m4=tn.unstable_UserBlockingPriority,bp=tn.unstable_NormalPriority,Jq=tn.unstable_LowPriority,g4=tn.unstable_IdlePriority,d0=null,ma=null;function eU(e){if(ma&&typeof ma.onCommitFiberRoot=="function")try{ma.onCommitFiberRoot(d0,e,void 0,(e.current.flags&128)===128)}catch{}}var Qn=Math.clz32?Math.clz32:nU,tU=Math.log,rU=Math.LN2;function nU(e){return e>>>=0,e===0?32:31-(tU(e)/rU|0)|0}var Jf=64,eh=4194304;function Nu(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 wp(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,i=e.pingedLanes,s=r&268435455;if(s!==0){var o=s&~a;o!==0?n=Nu(o):(i&=s,i!==0&&(n=Nu(i)))}else s=r&~a,s!==0?n=Nu(s):i!==0&&(n=Nu(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&a)&&(a=n&-n,i=t&-t,a>=i||a===16&&(i&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-Qn(t),a=1<<r,n|=e[r],t&=~a;return n}function aU(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 iU(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Qn(i),o=1<<s,l=a[s];l===-1?(!(o&r)||o&n)&&(a[s]=aU(o,t)):l<=t&&(e.expiredLanes|=o),i&=~o}}function wj(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function y4(){var e=Jf;return Jf<<=1,!(Jf&4194240)&&(Jf=64),e}function Zg(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function bf(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Qn(t),e[t]=r}function sU(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 a=31-Qn(r),i=1<<a;t[a]=0,n[a]=-1,e[a]=-1,r&=~i}}function S2(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Qn(r),a=1<<n;a&t|e[n]&t&&(e[n]|=t),r&=~a}}var Ze=0;function v4(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var x4,k2,b4,w4,j4,jj=!1,th=[],Ui=null,Hi=null,Wi=null,cd=new Map,ud=new Map,$i=[],oU="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 KE(e,t){switch(e){case"focusin":case"focusout":Ui=null;break;case"dragenter":case"dragleave":Hi=null;break;case"mouseover":case"mouseout":Wi=null;break;case"pointerover":case"pointerout":cd.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ud.delete(t.pointerId)}}function Gc(e,t,r,n,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[a]},t!==null&&(t=jf(t),t!==null&&k2(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function lU(e,t,r,n,a){switch(t){case"focusin":return Ui=Gc(Ui,e,t,r,n,a),!0;case"dragenter":return Hi=Gc(Hi,e,t,r,n,a),!0;case"mouseover":return Wi=Gc(Wi,e,t,r,n,a),!0;case"pointerover":var i=a.pointerId;return cd.set(i,Gc(cd.get(i)||null,e,t,r,n,a)),!0;case"gotpointercapture":return i=a.pointerId,ud.set(i,Gc(ud.get(i)||null,e,t,r,n,a)),!0}return!1}function S4(e){var t=Ls(e.target);if(t!==null){var r=ko(t);if(r!==null){if(t=r.tag,t===13){if(t=d4(r),t!==null){e.blockedOn=t,j4(e.priority,function(){b4(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 Qh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Sj(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);yj=n,r.target.dispatchEvent(n),yj=null}else return t=jf(r),t!==null&&k2(t),e.blockedOn=r,!1;t.shift()}return!0}function YE(e,t,r){Qh(e)&&r.delete(t)}function cU(){jj=!1,Ui!==null&&Qh(Ui)&&(Ui=null),Hi!==null&&Qh(Hi)&&(Hi=null),Wi!==null&&Qh(Wi)&&(Wi=null),cd.forEach(YE),ud.forEach(YE)}function Kc(e,t){e.blockedOn===t&&(e.blockedOn=null,jj||(jj=!0,tn.unstable_scheduleCallback(tn.unstable_NormalPriority,cU)))}function dd(e){function t(a){return Kc(a,e)}if(0<th.length){Kc(th[0],e);for(var r=1;r<th.length;r++){var n=th[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Ui!==null&&Kc(Ui,e),Hi!==null&&Kc(Hi,e),Wi!==null&&Kc(Wi,e),cd.forEach(t),ud.forEach(t),r=0;r<$i.length;r++)n=$i[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<$i.length&&(r=$i[0],r.blockedOn===null);)S4(r),r.blockedOn===null&&$i.shift()}var jl=ui.ReactCurrentBatchConfig,jp=!0;function uU(e,t,r,n){var a=Ze,i=jl.transition;jl.transition=null;try{Ze=1,_2(e,t,r,n)}finally{Ze=a,jl.transition=i}}function dU(e,t,r,n){var a=Ze,i=jl.transition;jl.transition=null;try{Ze=4,_2(e,t,r,n)}finally{Ze=a,jl.transition=i}}function _2(e,t,r,n){if(jp){var a=Sj(e,t,r,n);if(a===null)oy(e,t,n,Sp,r),KE(e,n);else if(lU(a,e,t,r,n))n.stopPropagation();else if(KE(e,n),t&4&&-1<oU.indexOf(e)){for(;a!==null;){var i=jf(a);if(i!==null&&x4(i),i=Sj(e,t,r,n),i===null&&oy(e,t,n,Sp,r),i===a)break;a=i}a!==null&&n.stopPropagation()}else oy(e,t,n,null,r)}}var Sp=null;function Sj(e,t,r,n){if(Sp=null,e=w2(n),e=Ls(e),e!==null)if(t=ko(e),t===null)e=null;else if(r=t.tag,r===13){if(e=d4(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 Sp=e,null}function k4(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(Qq()){case j2:return 1;case m4:return 4;case bp:case Jq:return 16;case g4:return 536870912;default:return 16}default:return 16}}var Fi=null,N2=null,Jh=null;function _4(){if(Jh)return Jh;var e,t=N2,r=t.length,n,a="value"in Fi?Fi.value:Fi.textContent,i=a.length;for(e=0;e<r&&t[e]===a[e];e++);var s=r-e;for(n=1;n<=s&&t[r-n]===a[i-n];n++);return Jh=a.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 rh(){return!0}function XE(){return!1}function sn(e){function t(r,n,a,i,s){this._reactName=r,this._targetInst=a,this.type=n,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(r=e[o],this[o]=r?r(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?rh:XE,this.isPropagationStopped=XE,this}return Et(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=rh)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=rh)},persist:function(){},isPersistent:rh}),t}var wc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},E2=sn(wc),wf=Et({},wc,{view:0,detail:0}),fU=sn(wf),Qg,Jg,Yc,f0=Et({},wf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:P2,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!==Yc&&(Yc&&e.type==="mousemove"?(Qg=e.screenX-Yc.screenX,Jg=e.screenY-Yc.screenY):Jg=Qg=0,Yc=e),Qg)},movementY:function(e){return"movementY"in e?e.movementY:Jg}}),ZE=sn(f0),hU=Et({},f0,{dataTransfer:0}),pU=sn(hU),mU=Et({},wf,{relatedTarget:0}),ey=sn(mU),gU=Et({},wc,{animationName:0,elapsedTime:0,pseudoElement:0}),yU=sn(gU),vU=Et({},wc,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xU=sn(vU),bU=Et({},wc,{data:0}),QE=sn(bU),wU={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jU={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"},SU={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kU(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=SU[e])?!!t[e]:!1}function P2(){return kU}var _U=Et({},wf,{key:function(e){if(e.key){var t=wU[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"?jU[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:P2,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}}),NU=sn(_U),EU=Et({},f0,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),JE=sn(EU),PU=Et({},wf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:P2}),CU=sn(PU),AU=Et({},wc,{propertyName:0,elapsedTime:0,pseudoElement:0}),TU=sn(AU),OU=Et({},f0,{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}),MU=sn(OU),RU=[9,13,27,32],C2=Ya&&"CompositionEvent"in window,Vu=null;Ya&&"documentMode"in document&&(Vu=document.documentMode);var $U=Ya&&"TextEvent"in window&&!Vu,N4=Ya&&(!C2||Vu&&8<Vu&&11>=Vu),eP=" ",tP=!1;function E4(e,t){switch(e){case"keyup":return RU.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function P4(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var el=!1;function DU(e,t){switch(e){case"compositionend":return P4(t);case"keypress":return t.which!==32?null:(tP=!0,eP);case"textInput":return e=t.data,e===eP&&tP?null:e;default:return null}}function IU(e,t){if(el)return e==="compositionend"||!C2&&E4(e,t)?(e=_4(),Jh=N2=Fi=null,el=!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 N4&&t.locale!=="ko"?null:t.data;default:return null}}var LU={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 rP(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!LU[e.type]:t==="textarea"}function C4(e,t,r,n){s4(n),t=kp(t,"onChange"),0<t.length&&(r=new E2("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var qu=null,fd=null;function zU(e){F4(e,0)}function h0(e){var t=nl(e);if(J3(t))return e}function FU(e,t){if(e==="change")return t}var A4=!1;if(Ya){var ty;if(Ya){var ry="oninput"in document;if(!ry){var nP=document.createElement("div");nP.setAttribute("oninput","return;"),ry=typeof nP.oninput=="function"}ty=ry}else ty=!1;A4=ty&&(!document.documentMode||9<document.documentMode)}function aP(){qu&&(qu.detachEvent("onpropertychange",T4),fd=qu=null)}function T4(e){if(e.propertyName==="value"&&h0(fd)){var t=[];C4(t,fd,e,w2(e)),u4(zU,t)}}function BU(e,t,r){e==="focusin"?(aP(),qu=t,fd=r,qu.attachEvent("onpropertychange",T4)):e==="focusout"&&aP()}function VU(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return h0(fd)}function qU(e,t){if(e==="click")return h0(t)}function UU(e,t){if(e==="input"||e==="change")return h0(t)}function HU(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ra=typeof Object.is=="function"?Object.is:HU;function hd(e,t){if(ra(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 a=r[n];if(!ij.call(t,a)||!ra(e[a],t[a]))return!1}return!0}function iP(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function sP(e,t){var r=iP(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=iP(r)}}function O4(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?O4(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function M4(){for(var e=window,t=yp();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=yp(e.document)}return t}function A2(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 WU(e){var t=M4(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&O4(r.ownerDocument.documentElement,r)){if(n!==null&&A2(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 a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!e.extend&&i>n&&(a=n,n=i,i=a),a=sP(r,i);var s=sP(r,n);a&&s&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>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 GU=Ya&&"documentMode"in document&&11>=document.documentMode,tl=null,kj=null,Uu=null,_j=!1;function oP(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;_j||tl==null||tl!==yp(n)||(n=tl,"selectionStart"in n&&A2(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}),Uu&&hd(Uu,n)||(Uu=n,n=kp(kj,"onSelect"),0<n.length&&(t=new E2("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=tl)))}function nh(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var rl={animationend:nh("Animation","AnimationEnd"),animationiteration:nh("Animation","AnimationIteration"),animationstart:nh("Animation","AnimationStart"),transitionend:nh("Transition","TransitionEnd")},ny={},R4={};Ya&&(R4=document.createElement("div").style,"AnimationEvent"in window||(delete rl.animationend.animation,delete rl.animationiteration.animation,delete rl.animationstart.animation),"TransitionEvent"in window||delete rl.transitionend.transition);function p0(e){if(ny[e])return ny[e];if(!rl[e])return e;var t=rl[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in R4)return ny[e]=t[r];return e}var $4=p0("animationend"),D4=p0("animationiteration"),I4=p0("animationstart"),L4=p0("transitionend"),z4=new Map,lP="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 hs(e,t){z4.set(e,t),So(t,[e])}for(var ay=0;ay<lP.length;ay++){var iy=lP[ay],KU=iy.toLowerCase(),YU=iy[0].toUpperCase()+iy.slice(1);hs(KU,"on"+YU)}hs($4,"onAnimationEnd");hs(D4,"onAnimationIteration");hs(I4,"onAnimationStart");hs("dblclick","onDoubleClick");hs("focusin","onFocus");hs("focusout","onBlur");hs(L4,"onTransitionEnd");$l("onMouseEnter",["mouseout","mouseover"]);$l("onMouseLeave",["mouseout","mouseover"]);$l("onPointerEnter",["pointerout","pointerover"]);$l("onPointerLeave",["pointerout","pointerover"]);So("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));So("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));So("onBeforeInput",["compositionend","keypress","textInput","paste"]);So("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));So("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));So("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Eu="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(" "),XU=new Set("cancel close invalid load scroll toggle".split(" ").concat(Eu));function cP(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,Kq(n,t,void 0,e),e.currentTarget=null}function F4(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],a=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var s=n.length-1;0<=s;s--){var o=n[s],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==i&&a.isPropagationStopped())break e;cP(a,o,c),i=l}else for(s=0;s<n.length;s++){if(o=n[s],l=o.instance,c=o.currentTarget,o=o.listener,l!==i&&a.isPropagationStopped())break e;cP(a,o,c),i=l}}}if(xp)throw e=bj,xp=!1,bj=null,e}function ft(e,t){var r=t[Aj];r===void 0&&(r=t[Aj]=new Set);var n=e+"__bubble";r.has(n)||(B4(t,e,2,!1),r.add(n))}function sy(e,t,r){var n=0;t&&(n|=4),B4(r,e,n,t)}var ah="_reactListening"+Math.random().toString(36).slice(2);function pd(e){if(!e[ah]){e[ah]=!0,K3.forEach(function(r){r!=="selectionchange"&&(XU.has(r)||sy(r,!1,e),sy(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ah]||(t[ah]=!0,sy("selectionchange",!1,t))}}function B4(e,t,r,n){switch(k4(t)){case 1:var a=uU;break;case 4:a=dU;break;default:a=_2}r=a.bind(null,t,r,e),a=void 0,!xj||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),n?a!==void 0?e.addEventListener(t,r,{capture:!0,passive:a}):e.addEventListener(t,r,!0):a!==void 0?e.addEventListener(t,r,{passive:a}):e.addEventListener(t,r,!1)}function oy(e,t,r,n,a){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var s=n.tag;if(s===3||s===4){var o=n.stateNode.containerInfo;if(o===a||o.nodeType===8&&o.parentNode===a)break;if(s===4)for(s=n.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===a||l.nodeType===8&&l.parentNode===a))return;s=s.return}for(;o!==null;){if(s=Ls(o),s===null)return;if(l=s.tag,l===5||l===6){n=i=s;continue e}o=o.parentNode}}n=n.return}u4(function(){var c=i,d=w2(r),f=[];e:{var h=z4.get(e);if(h!==void 0){var p=E2,g=e;switch(e){case"keypress":if(ep(r)===0)break e;case"keydown":case"keyup":p=NU;break;case"focusin":g="focus",p=ey;break;case"focusout":g="blur",p=ey;break;case"beforeblur":case"afterblur":p=ey;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":p=ZE;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=pU;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=CU;break;case $4:case D4:case I4:p=yU;break;case L4:p=TU;break;case"scroll":p=fU;break;case"wheel":p=MU;break;case"copy":case"cut":case"paste":p=xU;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=JE}var m=(t&4)!==0,b=!m&&e==="scroll",x=m?h!==null?h+"Capture":null:h;m=[];for(var y=c,v;y!==null;){v=y;var w=v.stateNode;if(v.tag===5&&w!==null&&(v=w,x!==null&&(w=ld(y,x),w!=null&&m.push(md(y,w,v)))),b)break;y=y.return}0<m.length&&(h=new p(h,g,null,r,d),f.push({event:h,listeners:m}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&r!==yj&&(g=r.relatedTarget||r.fromElement)&&(Ls(g)||g[Xa]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(g=r.relatedTarget||r.toElement,p=c,g=g?Ls(g):null,g!==null&&(b=ko(g),g!==b||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=c),p!==g)){if(m=ZE,w="onMouseLeave",x="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(m=JE,w="onPointerLeave",x="onPointerEnter",y="pointer"),b=p==null?h:nl(p),v=g==null?h:nl(g),h=new m(w,y+"leave",p,r,d),h.target=b,h.relatedTarget=v,w=null,Ls(d)===c&&(m=new m(x,y+"enter",g,r,d),m.target=v,m.relatedTarget=b,w=m),b=w,p&&g)t:{for(m=p,x=g,y=0,v=m;v;v=zo(v))y++;for(v=0,w=x;w;w=zo(w))v++;for(;0<y-v;)m=zo(m),y--;for(;0<v-y;)x=zo(x),v--;for(;y--;){if(m===x||x!==null&&m===x.alternate)break t;m=zo(m),x=zo(x)}m=null}else m=null;p!==null&&uP(f,h,p,m,!1),g!==null&&b!==null&&uP(f,b,g,m,!0)}}e:{if(h=c?nl(c):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var j=FU;else if(rP(h))if(A4)j=UU;else{j=VU;var k=BU}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=qU);if(j&&(j=j(e,c))){C4(f,j,r,d);break e}k&&k(e,h,c),e==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&fj(h,"number",h.value)}switch(k=c?nl(c):window,e){case"focusin":(rP(k)||k.contentEditable==="true")&&(tl=k,kj=c,Uu=null);break;case"focusout":Uu=kj=tl=null;break;case"mousedown":_j=!0;break;case"contextmenu":case"mouseup":case"dragend":_j=!1,oP(f,r,d);break;case"selectionchange":if(GU)break;case"keydown":case"keyup":oP(f,r,d)}var S;if(C2)e:{switch(e){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else el?E4(e,r)&&(N="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(N="onCompositionStart");N&&(N4&&r.locale!=="ko"&&(el||N!=="onCompositionStart"?N==="onCompositionEnd"&&el&&(S=_4()):(Fi=d,N2="value"in Fi?Fi.value:Fi.textContent,el=!0)),k=kp(c,N),0<k.length&&(N=new QE(N,e,null,r,d),f.push({event:N,listeners:k}),S?N.data=S:(S=P4(r),S!==null&&(N.data=S)))),(S=$U?DU(e,r):IU(e,r))&&(c=kp(c,"onBeforeInput"),0<c.length&&(d=new QE("onBeforeInput","beforeinput",null,r,d),f.push({event:d,listeners:c}),d.data=S))}F4(f,t)})}function md(e,t,r){return{instance:e,listener:t,currentTarget:r}}function kp(e,t){for(var r=t+"Capture",n=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=ld(e,r),i!=null&&n.unshift(md(e,i,a)),i=ld(e,t),i!=null&&n.push(md(e,i,a))),e=e.return}return n}function zo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function uP(e,t,r,n,a){for(var i=t._reactName,s=[];r!==null&&r!==n;){var o=r,l=o.alternate,c=o.stateNode;if(l!==null&&l===n)break;o.tag===5&&c!==null&&(o=c,a?(l=ld(r,i),l!=null&&s.unshift(md(r,l,o))):a||(l=ld(r,i),l!=null&&s.push(md(r,l,o)))),r=r.return}s.length!==0&&e.push({event:t,listeners:s})}var ZU=/\r\n?/g,QU=/\u0000|\uFFFD/g;function dP(e){return(typeof e=="string"?e:""+e).replace(ZU,`
38
- `).replace(QU,"")}function ih(e,t,r){if(t=dP(t),dP(e)!==t&&r)throw Error(Z(425))}function _p(){}var Nj=null,Ej=null;function Pj(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 Cj=typeof setTimeout=="function"?setTimeout:void 0,JU=typeof clearTimeout=="function"?clearTimeout:void 0,fP=typeof Promise=="function"?Promise:void 0,eH=typeof queueMicrotask=="function"?queueMicrotask:typeof fP<"u"?function(e){return fP.resolve(null).then(e).catch(tH)}:Cj;function tH(e){setTimeout(function(){throw e})}function ly(e,t){var r=t,n=0;do{var a=r.nextSibling;if(e.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(n===0){e.removeChild(a),dd(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=a}while(r);dd(t)}function Gi(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 hP(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 jc=Math.random().toString(36).slice(2),fa="__reactFiber$"+jc,gd="__reactProps$"+jc,Xa="__reactContainer$"+jc,Aj="__reactEvents$"+jc,rH="__reactListeners$"+jc,nH="__reactHandles$"+jc;function Ls(e){var t=e[fa];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Xa]||r[fa]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=hP(e);e!==null;){if(r=e[fa])return r;e=hP(e)}return t}e=r,r=e.parentNode}return null}function jf(e){return e=e[fa]||e[Xa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function nl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Z(33))}function m0(e){return e[gd]||null}var Tj=[],al=-1;function ps(e){return{current:e}}function pt(e){0>al||(e.current=Tj[al],Tj[al]=null,al--)}function it(e,t){al++,Tj[al]=e.current,e.current=t}var as={},_r=ps(as),Vr=ps(!1),ao=as;function Dl(e,t){var r=e.type.contextTypes;if(!r)return as;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function qr(e){return e=e.childContextTypes,e!=null}function Np(){pt(Vr),pt(_r)}function pP(e,t,r){if(_r.current!==as)throw Error(Z(168));it(_r,t),it(Vr,r)}function V4(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in t))throw Error(Z(108,Bq(e)||"Unknown",a));return Et({},r,n)}function Ep(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||as,ao=_r.current,it(_r,e),it(Vr,Vr.current),!0}function mP(e,t,r){var n=e.stateNode;if(!n)throw Error(Z(169));r?(e=V4(e,t,ao),n.__reactInternalMemoizedMergedChildContext=e,pt(Vr),pt(_r),it(_r,e)):pt(Vr),it(Vr,r)}var Ma=null,g0=!1,cy=!1;function q4(e){Ma===null?Ma=[e]:Ma.push(e)}function aH(e){g0=!0,q4(e)}function ms(){if(!cy&&Ma!==null){cy=!0;var e=0,t=Ze;try{var r=Ma;for(Ze=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Ma=null,g0=!1}catch(a){throw Ma!==null&&(Ma=Ma.slice(e+1)),p4(j2,ms),a}finally{Ze=t,cy=!1}}return null}var il=[],sl=0,Pp=null,Cp=0,gn=[],yn=0,io=null,Ra=1,$a="";function Cs(e,t){il[sl++]=Cp,il[sl++]=Pp,Pp=e,Cp=t}function U4(e,t,r){gn[yn++]=Ra,gn[yn++]=$a,gn[yn++]=io,io=e;var n=Ra;e=$a;var a=32-Qn(n)-1;n&=~(1<<a),r+=1;var i=32-Qn(t)+a;if(30<i){var s=a-a%5;i=(n&(1<<s)-1).toString(32),n>>=s,a-=s,Ra=1<<32-Qn(t)+a|r<<a|n,$a=i+e}else Ra=1<<i|r<<a|n,$a=e}function T2(e){e.return!==null&&(Cs(e,1),U4(e,1,0))}function O2(e){for(;e===Pp;)Pp=il[--sl],il[sl]=null,Cp=il[--sl],il[sl]=null;for(;e===io;)io=gn[--yn],gn[yn]=null,$a=gn[--yn],gn[yn]=null,Ra=gn[--yn],gn[yn]=null}var en=null,Jr=null,vt=!1,Gn=null;function H4(e,t){var r=xn(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 gP(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,en=e,Jr=Gi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,en=e,Jr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=io!==null?{id:Ra,overflow:$a}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=xn(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,en=e,Jr=null,!0):!1;default:return!1}}function Oj(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Mj(e){if(vt){var t=Jr;if(t){var r=t;if(!gP(e,t)){if(Oj(e))throw Error(Z(418));t=Gi(r.nextSibling);var n=en;t&&gP(e,t)?H4(n,r):(e.flags=e.flags&-4097|2,vt=!1,en=e)}}else{if(Oj(e))throw Error(Z(418));e.flags=e.flags&-4097|2,vt=!1,en=e}}}function yP(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;en=e}function sh(e){if(e!==en)return!1;if(!vt)return yP(e),vt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Pj(e.type,e.memoizedProps)),t&&(t=Jr)){if(Oj(e))throw W4(),Error(Z(418));for(;t;)H4(e,t),t=Gi(t.nextSibling)}if(yP(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Z(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Jr=Gi(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Jr=null}}else Jr=en?Gi(e.stateNode.nextSibling):null;return!0}function W4(){for(var e=Jr;e;)e=Gi(e.nextSibling)}function Il(){Jr=en=null,vt=!1}function M2(e){Gn===null?Gn=[e]:Gn.push(e)}var iH=ui.ReactCurrentBatchConfig;function Xc(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(Z(309));var n=r.stateNode}if(!n)throw Error(Z(147,e));var a=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var o=a.refs;s===null?delete o[i]:o[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(Z(284));if(!r._owner)throw Error(Z(290,e))}return e}function oh(e,t){throw e=Object.prototype.toString.call(t),Error(Z(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function vP(e){var t=e._init;return t(e._payload)}function G4(e){function t(x,y){if(e){var v=x.deletions;v===null?(x.deletions=[y],x.flags|=16):v.push(y)}}function r(x,y){if(!e)return null;for(;y!==null;)t(x,y),y=y.sibling;return null}function n(x,y){for(x=new Map;y!==null;)y.key!==null?x.set(y.key,y):x.set(y.index,y),y=y.sibling;return x}function a(x,y){return x=Zi(x,y),x.index=0,x.sibling=null,x}function i(x,y,v){return x.index=v,e?(v=x.alternate,v!==null?(v=v.index,v<y?(x.flags|=2,y):v):(x.flags|=2,y)):(x.flags|=1048576,y)}function s(x){return e&&x.alternate===null&&(x.flags|=2),x}function o(x,y,v,w){return y===null||y.tag!==6?(y=gy(v,x.mode,w),y.return=x,y):(y=a(y,v),y.return=x,y)}function l(x,y,v,w){var j=v.type;return j===Jo?d(x,y,v.props.children,w,v.key):y!==null&&(y.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Ti&&vP(j)===y.type)?(w=a(y,v.props),w.ref=Xc(x,y,v),w.return=x,w):(w=op(v.type,v.key,v.props,null,x.mode,w),w.ref=Xc(x,y,v),w.return=x,w)}function c(x,y,v,w){return y===null||y.tag!==4||y.stateNode.containerInfo!==v.containerInfo||y.stateNode.implementation!==v.implementation?(y=yy(v,x.mode,w),y.return=x,y):(y=a(y,v.children||[]),y.return=x,y)}function d(x,y,v,w,j){return y===null||y.tag!==7?(y=Zs(v,x.mode,w,j),y.return=x,y):(y=a(y,v),y.return=x,y)}function f(x,y,v){if(typeof y=="string"&&y!==""||typeof y=="number")return y=gy(""+y,x.mode,v),y.return=x,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Xf:return v=op(y.type,y.key,y.props,null,x.mode,v),v.ref=Xc(x,null,y),v.return=x,v;case Qo:return y=yy(y,x.mode,v),y.return=x,y;case Ti:var w=y._init;return f(x,w(y._payload),v)}if(_u(y)||Hc(y))return y=Zs(y,x.mode,v,null),y.return=x,y;oh(x,y)}return null}function h(x,y,v,w){var j=y!==null?y.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return j!==null?null:o(x,y,""+v,w);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Xf:return v.key===j?l(x,y,v,w):null;case Qo:return v.key===j?c(x,y,v,w):null;case Ti:return j=v._init,h(x,y,j(v._payload),w)}if(_u(v)||Hc(v))return j!==null?null:d(x,y,v,w,null);oh(x,v)}return null}function p(x,y,v,w,j){if(typeof w=="string"&&w!==""||typeof w=="number")return x=x.get(v)||null,o(y,x,""+w,j);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Xf:return x=x.get(w.key===null?v:w.key)||null,l(y,x,w,j);case Qo:return x=x.get(w.key===null?v:w.key)||null,c(y,x,w,j);case Ti:var k=w._init;return p(x,y,v,k(w._payload),j)}if(_u(w)||Hc(w))return x=x.get(v)||null,d(y,x,w,j,null);oh(y,w)}return null}function g(x,y,v,w){for(var j=null,k=null,S=y,N=y=0,E=null;S!==null&&N<v.length;N++){S.index>N?(E=S,S=null):E=S.sibling;var A=h(x,S,v[N],w);if(A===null){S===null&&(S=E);break}e&&S&&A.alternate===null&&t(x,S),y=i(A,y,N),k===null?j=A:k.sibling=A,k=A,S=E}if(N===v.length)return r(x,S),vt&&Cs(x,N),j;if(S===null){for(;N<v.length;N++)S=f(x,v[N],w),S!==null&&(y=i(S,y,N),k===null?j=S:k.sibling=S,k=S);return vt&&Cs(x,N),j}for(S=n(x,S);N<v.length;N++)E=p(S,x,N,v[N],w),E!==null&&(e&&E.alternate!==null&&S.delete(E.key===null?N:E.key),y=i(E,y,N),k===null?j=E:k.sibling=E,k=E);return e&&S.forEach(function(C){return t(x,C)}),vt&&Cs(x,N),j}function m(x,y,v,w){var j=Hc(v);if(typeof j!="function")throw Error(Z(150));if(v=j.call(v),v==null)throw Error(Z(151));for(var k=j=null,S=y,N=y=0,E=null,A=v.next();S!==null&&!A.done;N++,A=v.next()){S.index>N?(E=S,S=null):E=S.sibling;var C=h(x,S,A.value,w);if(C===null){S===null&&(S=E);break}e&&S&&C.alternate===null&&t(x,S),y=i(C,y,N),k===null?j=C:k.sibling=C,k=C,S=E}if(A.done)return r(x,S),vt&&Cs(x,N),j;if(S===null){for(;!A.done;N++,A=v.next())A=f(x,A.value,w),A!==null&&(y=i(A,y,N),k===null?j=A:k.sibling=A,k=A);return vt&&Cs(x,N),j}for(S=n(x,S);!A.done;N++,A=v.next())A=p(S,x,N,A.value,w),A!==null&&(e&&A.alternate!==null&&S.delete(A.key===null?N:A.key),y=i(A,y,N),k===null?j=A:k.sibling=A,k=A);return e&&S.forEach(function(M){return t(x,M)}),vt&&Cs(x,N),j}function b(x,y,v,w){if(typeof v=="object"&&v!==null&&v.type===Jo&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Xf:e:{for(var j=v.key,k=y;k!==null;){if(k.key===j){if(j=v.type,j===Jo){if(k.tag===7){r(x,k.sibling),y=a(k,v.props.children),y.return=x,x=y;break e}}else if(k.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Ti&&vP(j)===k.type){r(x,k.sibling),y=a(k,v.props),y.ref=Xc(x,k,v),y.return=x,x=y;break e}r(x,k);break}else t(x,k);k=k.sibling}v.type===Jo?(y=Zs(v.props.children,x.mode,w,v.key),y.return=x,x=y):(w=op(v.type,v.key,v.props,null,x.mode,w),w.ref=Xc(x,y,v),w.return=x,x=w)}return s(x);case Qo:e:{for(k=v.key;y!==null;){if(y.key===k)if(y.tag===4&&y.stateNode.containerInfo===v.containerInfo&&y.stateNode.implementation===v.implementation){r(x,y.sibling),y=a(y,v.children||[]),y.return=x,x=y;break e}else{r(x,y);break}else t(x,y);y=y.sibling}y=yy(v,x.mode,w),y.return=x,x=y}return s(x);case Ti:return k=v._init,b(x,y,k(v._payload),w)}if(_u(v))return g(x,y,v,w);if(Hc(v))return m(x,y,v,w);oh(x,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,y!==null&&y.tag===6?(r(x,y.sibling),y=a(y,v),y.return=x,x=y):(r(x,y),y=gy(v,x.mode,w),y.return=x,x=y),s(x)):r(x,y)}return b}var Ll=G4(!0),K4=G4(!1),Ap=ps(null),Tp=null,ol=null,R2=null;function $2(){R2=ol=Tp=null}function D2(e){var t=Ap.current;pt(Ap),e._currentValue=t}function Rj(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 Sl(e,t){Tp=e,R2=ol=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(zr=!0),e.firstContext=null)}function Pn(e){var t=e._currentValue;if(R2!==e)if(e={context:e,memoizedValue:t,next:null},ol===null){if(Tp===null)throw Error(Z(308));ol=e,Tp.dependencies={lanes:0,firstContext:e}}else ol=ol.next=e;return t}var zs=null;function I2(e){zs===null?zs=[e]:zs.push(e)}function Y4(e,t,r,n){var a=t.interleaved;return a===null?(r.next=r,I2(t)):(r.next=a.next,a.next=r),t.interleaved=r,Za(e,n)}function Za(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 Oi=!1;function L2(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function X4(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 Va(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ki(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Ve&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,Za(e,r)}return a=n.interleaved,a===null?(t.next=t,I2(n)):(t.next=a.next,a.next=t),n.interleaved=t,Za(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,S2(e,r)}}function xP(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=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};i===null?a=i=s:i=i.next=s,r=r.next}while(r!==null);i===null?a=i=t:i=i.next=t}else a=i=t;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,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 Op(e,t,r,n){var a=e.updateQueue;Oi=!1;var i=a.firstBaseUpdate,s=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var l=o,c=l.next;l.next=null,s===null?i=c:s.next=c,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==s&&(o===null?d.firstBaseUpdate=c:o.next=c,d.lastBaseUpdate=l))}if(i!==null){var f=a.baseState;s=0,d=c=l=null,o=i;do{var h=o.lane,p=o.eventTime;if((n&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var g=e,m=o;switch(h=t,p=r,m.tag){case 1:if(g=m.payload,typeof g=="function"){f=g.call(p,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,h=typeof g=="function"?g.call(p,f,h):g,h==null)break e;f=Et({},f,h);break e;case 2:Oi=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=a.effects,h===null?a.effects=[o]:h.push(o))}else p={eventTime:p,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(c=d=p,l=f):d=d.next=p,s|=h;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;h=o,o=h.next,h.next=null,a.lastBaseUpdate=h,a.shared.pending=null}}while(!0);if(d===null&&(l=f),a.baseState=l,a.firstBaseUpdate=c,a.lastBaseUpdate=d,t=a.shared.interleaved,t!==null){a=t;do s|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);oo|=s,e.lanes=s,e.memoizedState=f}}function bP(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],a=n.callback;if(a!==null){if(n.callback=null,n=r,typeof a!="function")throw Error(Z(191,a));a.call(n)}}}var Sf={},ga=ps(Sf),yd=ps(Sf),vd=ps(Sf);function Fs(e){if(e===Sf)throw Error(Z(174));return e}function z2(e,t){switch(it(vd,t),it(yd,e),it(ga,Sf),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pj(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=pj(t,e)}pt(ga),it(ga,t)}function zl(){pt(ga),pt(yd),pt(vd)}function Z4(e){Fs(vd.current);var t=Fs(ga.current),r=pj(t,e.type);t!==r&&(it(yd,e),it(ga,r))}function F2(e){yd.current===e&&(pt(ga),pt(yd))}var kt=ps(0);function Mp(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 uy=[];function B2(){for(var e=0;e<uy.length;e++)uy[e]._workInProgressVersionPrimary=null;uy.length=0}var rp=ui.ReactCurrentDispatcher,dy=ui.ReactCurrentBatchConfig,so=0,Nt=null,Zt=null,ir=null,Rp=!1,Hu=!1,xd=0,sH=0;function vr(){throw Error(Z(321))}function V2(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!ra(e[r],t[r]))return!1;return!0}function q2(e,t,r,n,a,i){if(so=i,Nt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,rp.current=e===null||e.memoizedState===null?uH:dH,e=r(n,a),Hu){i=0;do{if(Hu=!1,xd=0,25<=i)throw Error(Z(301));i+=1,ir=Zt=null,t.updateQueue=null,rp.current=fH,e=r(n,a)}while(Hu)}if(rp.current=$p,t=Zt!==null&&Zt.next!==null,so=0,ir=Zt=Nt=null,Rp=!1,t)throw Error(Z(300));return e}function U2(){var e=xd!==0;return xd=0,e}function ua(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ir===null?Nt.memoizedState=ir=e:ir=ir.next=e,ir}function Cn(){if(Zt===null){var e=Nt.alternate;e=e!==null?e.memoizedState:null}else e=Zt.next;var t=ir===null?Nt.memoizedState:ir.next;if(t!==null)ir=t,Zt=e;else{if(e===null)throw Error(Z(310));Zt=e,e={memoizedState:Zt.memoizedState,baseState:Zt.baseState,baseQueue:Zt.baseQueue,queue:Zt.queue,next:null},ir===null?Nt.memoizedState=ir=e:ir=ir.next=e}return ir}function bd(e,t){return typeof t=="function"?t(e):t}function fy(e){var t=Cn(),r=t.queue;if(r===null)throw Error(Z(311));r.lastRenderedReducer=e;var n=Zt,a=n.baseQueue,i=r.pending;if(i!==null){if(a!==null){var s=a.next;a.next=i.next,i.next=s}n.baseQueue=a=i,r.pending=null}if(a!==null){i=a.next,n=n.baseState;var o=s=null,l=null,c=i;do{var d=c.lane;if((so&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),n=c.hasEagerState?c.eagerState:e(n,c.action);else{var f={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(o=l=f,s=n):l=l.next=f,Nt.lanes|=d,oo|=d}c=c.next}while(c!==null&&c!==i);l===null?s=n:l.next=o,ra(n,t.memoizedState)||(zr=!0),t.memoizedState=n,t.baseState=s,t.baseQueue=l,r.lastRenderedState=n}if(e=r.interleaved,e!==null){a=e;do i=a.lane,Nt.lanes|=i,oo|=i,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function hy(e){var t=Cn(),r=t.queue;if(r===null)throw Error(Z(311));r.lastRenderedReducer=e;var n=r.dispatch,a=r.pending,i=t.memoizedState;if(a!==null){r.pending=null;var s=a=a.next;do i=e(i,s.action),s=s.next;while(s!==a);ra(i,t.memoizedState)||(zr=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function Q4(){}function J4(e,t){var r=Nt,n=Cn(),a=t(),i=!ra(n.memoizedState,a);if(i&&(n.memoizedState=a,zr=!0),n=n.queue,H2(rL.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||ir!==null&&ir.memoizedState.tag&1){if(r.flags|=2048,wd(9,tL.bind(null,r,n,a,t),void 0,null),sr===null)throw Error(Z(349));so&30||eL(r,t,a)}return a}function eL(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 tL(e,t,r,n){t.value=r,t.getSnapshot=n,nL(t)&&aL(e)}function rL(e,t,r){return r(function(){nL(t)&&aL(e)})}function nL(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!ra(e,r)}catch{return!0}}function aL(e){var t=Za(e,1);t!==null&&Jn(t,e,1,-1)}function wP(e){var t=ua();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bd,lastRenderedState:e},t.queue=e,e=e.dispatch=cH.bind(null,Nt,e),[t.memoizedState,e]}function wd(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 iL(){return Cn().memoizedState}function np(e,t,r,n){var a=ua();Nt.flags|=e,a.memoizedState=wd(1|t,r,void 0,n===void 0?null:n)}function y0(e,t,r,n){var a=Cn();n=n===void 0?null:n;var i=void 0;if(Zt!==null){var s=Zt.memoizedState;if(i=s.destroy,n!==null&&V2(n,s.deps)){a.memoizedState=wd(t,r,i,n);return}}Nt.flags|=e,a.memoizedState=wd(1|t,r,i,n)}function jP(e,t){return np(8390656,8,e,t)}function H2(e,t){return y0(2048,8,e,t)}function sL(e,t){return y0(4,2,e,t)}function oL(e,t){return y0(4,4,e,t)}function lL(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 cL(e,t,r){return r=r!=null?r.concat([e]):null,y0(4,4,lL.bind(null,t,e),r)}function W2(){}function uL(e,t){var r=Cn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&V2(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function dL(e,t){var r=Cn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&V2(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function fL(e,t,r){return so&21?(ra(r,t)||(r=y4(),Nt.lanes|=r,oo|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,zr=!0),e.memoizedState=r)}function oH(e,t){var r=Ze;Ze=r!==0&&4>r?r:4,e(!0);var n=dy.transition;dy.transition={};try{e(!1),t()}finally{Ze=r,dy.transition=n}}function hL(){return Cn().memoizedState}function lH(e,t,r){var n=Xi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},pL(e))mL(t,r);else if(r=Y4(e,t,r,n),r!==null){var a=Ar();Jn(r,e,n,a),gL(r,t,n)}}function cH(e,t,r){var n=Xi(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(pL(e))mL(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,o=i(s,r);if(a.hasEagerState=!0,a.eagerState=o,ra(o,s)){var l=t.interleaved;l===null?(a.next=a,I2(t)):(a.next=l.next,l.next=a),t.interleaved=a;return}}catch{}finally{}r=Y4(e,t,a,n),r!==null&&(a=Ar(),Jn(r,e,n,a),gL(r,t,n))}}function pL(e){var t=e.alternate;return e===Nt||t!==null&&t===Nt}function mL(e,t){Hu=Rp=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function gL(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,S2(e,r)}}var $p={readContext:Pn,useCallback:vr,useContext:vr,useEffect:vr,useImperativeHandle:vr,useInsertionEffect:vr,useLayoutEffect:vr,useMemo:vr,useReducer:vr,useRef:vr,useState:vr,useDebugValue:vr,useDeferredValue:vr,useTransition:vr,useMutableSource:vr,useSyncExternalStore:vr,useId:vr,unstable_isNewReconciler:!1},uH={readContext:Pn,useCallback:function(e,t){return ua().memoizedState=[e,t===void 0?null:t],e},useContext:Pn,useEffect:jP,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,np(4194308,4,lL.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=ua();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ua();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=lH.bind(null,Nt,e),[n.memoizedState,e]},useRef:function(e){var t=ua();return e={current:e},t.memoizedState=e},useState:wP,useDebugValue:W2,useDeferredValue:function(e){return ua().memoizedState=e},useTransition:function(){var e=wP(!1),t=e[0];return e=oH.bind(null,e[1]),ua().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Nt,a=ua();if(vt){if(r===void 0)throw Error(Z(407));r=r()}else{if(r=t(),sr===null)throw Error(Z(349));so&30||eL(n,t,r)}a.memoizedState=r;var i={value:r,getSnapshot:t};return a.queue=i,jP(rL.bind(null,n,i,e),[e]),n.flags|=2048,wd(9,tL.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=ua(),t=sr.identifierPrefix;if(vt){var r=$a,n=Ra;r=(n&~(1<<32-Qn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=xd++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=sH++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},dH={readContext:Pn,useCallback:uL,useContext:Pn,useEffect:H2,useImperativeHandle:cL,useInsertionEffect:sL,useLayoutEffect:oL,useMemo:dL,useReducer:fy,useRef:iL,useState:function(){return fy(bd)},useDebugValue:W2,useDeferredValue:function(e){var t=Cn();return fL(t,Zt.memoizedState,e)},useTransition:function(){var e=fy(bd)[0],t=Cn().memoizedState;return[e,t]},useMutableSource:Q4,useSyncExternalStore:J4,useId:hL,unstable_isNewReconciler:!1},fH={readContext:Pn,useCallback:uL,useContext:Pn,useEffect:H2,useImperativeHandle:cL,useInsertionEffect:sL,useLayoutEffect:oL,useMemo:dL,useReducer:hy,useRef:iL,useState:function(){return hy(bd)},useDebugValue:W2,useDeferredValue:function(e){var t=Cn();return Zt===null?t.memoizedState=e:fL(t,Zt.memoizedState,e)},useTransition:function(){var e=hy(bd)[0],t=Cn().memoizedState;return[e,t]},useMutableSource:Q4,useSyncExternalStore:J4,useId:hL,unstable_isNewReconciler:!1};function Bn(e,t){if(e&&e.defaultProps){t=Et({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function $j(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:Et({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var v0={isMounted:function(e){return(e=e._reactInternals)?ko(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Ar(),a=Xi(e),i=Va(n,a);i.payload=t,r!=null&&(i.callback=r),t=Ki(e,i,a),t!==null&&(Jn(t,e,a,n),tp(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Ar(),a=Xi(e),i=Va(n,a);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=Ki(e,i,a),t!==null&&(Jn(t,e,a,n),tp(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Ar(),n=Xi(e),a=Va(r,n);a.tag=2,t!=null&&(a.callback=t),t=Ki(e,a,n),t!==null&&(Jn(t,e,n,r),tp(t,e,n))}};function SP(e,t,r,n,a,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,s):t.prototype&&t.prototype.isPureReactComponent?!hd(r,n)||!hd(a,i):!0}function yL(e,t,r){var n=!1,a=as,i=t.contextType;return typeof i=="object"&&i!==null?i=Pn(i):(a=qr(t)?ao:_r.current,n=t.contextTypes,i=(n=n!=null)?Dl(e,a):as),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=v0,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function kP(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&&v0.enqueueReplaceState(t,t.state,null)}function Dj(e,t,r,n){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs={},L2(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=Pn(i):(i=qr(t)?ao:_r.current,a.context=Dl(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&($j(e,t,i,r),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&v0.enqueueReplaceState(a,a.state,null),Op(e,r,a,n),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Fl(e,t){try{var r="",n=t;do r+=Fq(n),n=n.return;while(n);var a=r}catch(i){a=`
39
- Error generating stack: `+i.message+`
40
- `+i.stack}return{value:e,source:t,stack:a,digest:null}}function py(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Ij(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var hH=typeof WeakMap=="function"?WeakMap:Map;function vL(e,t,r){r=Va(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Ip||(Ip=!0,Gj=n),Ij(e,t)},r}function xL(e,t,r){r=Va(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var a=t.value;r.payload=function(){return n(a)},r.callback=function(){Ij(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Ij(e,t),typeof n!="function"&&(Yi===null?Yi=new Set([this]):Yi.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),r}function _P(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new hH;var a=new Set;n.set(t,a)}else a=n.get(t),a===void 0&&(a=new Set,n.set(t,a));a.has(r)||(a.add(r),e=EH.bind(null,e,t,r),t.then(e,e))}function NP(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 EP(e,t,r,n,a){return e.mode&1?(e.flags|=65536,e.lanes=a,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=Va(-1,1),t.tag=2,Ki(r,t,1))),r.lanes|=1),e)}var pH=ui.ReactCurrentOwner,zr=!1;function Er(e,t,r,n){t.child=e===null?K4(t,null,r,n):Ll(t,e.child,r,n)}function PP(e,t,r,n,a){r=r.render;var i=t.ref;return Sl(t,a),n=q2(e,t,r,n,i,a),r=U2(),e!==null&&!zr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Qa(e,t,a)):(vt&&r&&T2(t),t.flags|=1,Er(e,t,n,a),t.child)}function CP(e,t,r,n,a){if(e===null){var i=r.type;return typeof i=="function"&&!e_(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,bL(e,t,i,n,a)):(e=op(r.type,null,n,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var s=i.memoizedProps;if(r=r.compare,r=r!==null?r:hd,r(s,n)&&e.ref===t.ref)return Qa(e,t,a)}return t.flags|=1,e=Zi(i,n),e.ref=t.ref,e.return=t,t.child=e}function bL(e,t,r,n,a){if(e!==null){var i=e.memoizedProps;if(hd(i,n)&&e.ref===t.ref)if(zr=!1,t.pendingProps=n=i,(e.lanes&a)!==0)e.flags&131072&&(zr=!0);else return t.lanes=e.lanes,Qa(e,t,a)}return Lj(e,t,r,n,a)}function wL(e,t,r){var n=t.pendingProps,a=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},it(cl,Kr),Kr|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,it(cl,Kr),Kr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,it(cl,Kr),Kr|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,it(cl,Kr),Kr|=n;return Er(e,t,a,r),t.child}function jL(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Lj(e,t,r,n,a){var i=qr(r)?ao:_r.current;return i=Dl(t,i),Sl(t,a),r=q2(e,t,r,n,i,a),n=U2(),e!==null&&!zr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Qa(e,t,a)):(vt&&n&&T2(t),t.flags|=1,Er(e,t,r,a),t.child)}function AP(e,t,r,n,a){if(qr(r)){var i=!0;Ep(t)}else i=!1;if(Sl(t,a),t.stateNode===null)ap(e,t),yL(t,r,n),Dj(t,r,n,a),n=!0;else if(e===null){var s=t.stateNode,o=t.memoizedProps;s.props=o;var l=s.context,c=r.contextType;typeof c=="object"&&c!==null?c=Pn(c):(c=qr(r)?ao:_r.current,c=Dl(t,c));var d=r.getDerivedStateFromProps,f=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==n||l!==c)&&kP(t,s,n,c),Oi=!1;var h=t.memoizedState;s.state=h,Op(t,n,s,a),l=t.memoizedState,o!==n||h!==l||Vr.current||Oi?(typeof d=="function"&&($j(t,r,d,n),l=t.memoizedState),(o=Oi||SP(t,r,o,n,h,l,c))?(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=l),s.props=n,s.state=l,s.context=c,n=o):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{s=t.stateNode,X4(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:Bn(t.type,o),s.props=c,f=t.pendingProps,h=s.context,l=r.contextType,typeof l=="object"&&l!==null?l=Pn(l):(l=qr(r)?ao:_r.current,l=Dl(t,l));var p=r.getDerivedStateFromProps;(d=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==f||h!==l)&&kP(t,s,n,l),Oi=!1,h=t.memoizedState,s.state=h,Op(t,n,s,a);var g=t.memoizedState;o!==f||h!==g||Vr.current||Oi?(typeof p=="function"&&($j(t,r,p,n),g=t.memoizedState),(c=Oi||SP(t,r,c,n,h,g,l)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,g,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,g,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=g),s.props=n,s.state=g,s.context=l,n=c):(typeof s.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return zj(e,t,r,n,i,a)}function zj(e,t,r,n,a,i){jL(e,t);var s=(t.flags&128)!==0;if(!n&&!s)return a&&mP(t,r,!1),Qa(e,t,i);n=t.stateNode,pH.current=t;var o=s&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&s?(t.child=Ll(t,e.child,null,i),t.child=Ll(t,null,o,i)):Er(e,t,o,i),t.memoizedState=n.state,a&&mP(t,r,!0),t.child}function SL(e){var t=e.stateNode;t.pendingContext?pP(e,t.pendingContext,t.pendingContext!==t.context):t.context&&pP(e,t.context,!1),z2(e,t.containerInfo)}function TP(e,t,r,n,a){return Il(),M2(a),t.flags|=256,Er(e,t,r,n),t.child}var Fj={dehydrated:null,treeContext:null,retryLane:0};function Bj(e){return{baseLanes:e,cachePool:null,transitions:null}}function kL(e,t,r){var n=t.pendingProps,a=kt.current,i=!1,s=(t.flags&128)!==0,o;if((o=s)||(o=e!==null&&e.memoizedState===null?!1:(a&2)!==0),o?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),it(kt,a&1),e===null)return Mj(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,i?(n=t.mode,i=t.child,s={mode:"hidden",children:s},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=w0(s,n,0,null),e=Zs(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Bj(r),t.memoizedState=Fj,e):G2(t,s));if(a=e.memoizedState,a!==null&&(o=a.dehydrated,o!==null))return mH(e,t,s,n,o,a,r);if(i){i=n.fallback,s=t.mode,a=e.child,o=a.sibling;var l={mode:"hidden",children:n.children};return!(s&1)&&t.child!==a?(n=t.child,n.childLanes=0,n.pendingProps=l,t.deletions=null):(n=Zi(a,l),n.subtreeFlags=a.subtreeFlags&14680064),o!==null?i=Zi(o,i):(i=Zs(i,s,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,s=e.child.memoizedState,s=s===null?Bj(r):{baseLanes:s.baseLanes|r,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~r,t.memoizedState=Fj,n}return i=e.child,e=i.sibling,n=Zi(i,{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 G2(e,t){return t=w0({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function lh(e,t,r,n){return n!==null&&M2(n),Ll(t,e.child,null,r),e=G2(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function mH(e,t,r,n,a,i,s){if(r)return t.flags&256?(t.flags&=-257,n=py(Error(Z(422))),lh(e,t,s,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,a=t.mode,n=w0({mode:"visible",children:n.children},a,0,null),i=Zs(i,a,s,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&Ll(t,e.child,null,s),t.child.memoizedState=Bj(s),t.memoizedState=Fj,i);if(!(t.mode&1))return lh(e,t,s,null);if(a.data==="$!"){if(n=a.nextSibling&&a.nextSibling.dataset,n)var o=n.dgst;return n=o,i=Error(Z(419)),n=py(i,n,void 0),lh(e,t,s,n)}if(o=(s&e.childLanes)!==0,zr||o){if(n=sr,n!==null){switch(s&-s){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(n.suspendedLanes|s)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,Za(e,a),Jn(n,e,a,-1))}return J2(),n=py(Error(Z(421))),lh(e,t,s,n)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=PH.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,Jr=Gi(a.nextSibling),en=t,vt=!0,Gn=null,e!==null&&(gn[yn++]=Ra,gn[yn++]=$a,gn[yn++]=io,Ra=e.id,$a=e.overflow,io=t),t=G2(t,n.children),t.flags|=4096,t)}function OP(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Rj(e.return,t,r)}function my(e,t,r,n,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=a)}function _L(e,t,r){var n=t.pendingProps,a=n.revealOrder,i=n.tail;if(Er(e,t,n.children,r),n=kt.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&&OP(e,r,t);else if(e.tag===19)OP(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(it(kt,n),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&Mp(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),my(t,!1,a,r,i);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Mp(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}my(t,!0,r,null,i);break;case"together":my(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ap(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Qa(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),oo|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Z(153));if(t.child!==null){for(e=t.child,r=Zi(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Zi(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function gH(e,t,r){switch(t.tag){case 3:SL(t),Il();break;case 5:Z4(t);break;case 1:qr(t.type)&&Ep(t);break;case 4:z2(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,a=t.memoizedProps.value;it(Ap,n._currentValue),n._currentValue=a;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(it(kt,kt.current&1),t.flags|=128,null):r&t.child.childLanes?kL(e,t,r):(it(kt,kt.current&1),e=Qa(e,t,r),e!==null?e.sibling:null);it(kt,kt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return _L(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),it(kt,kt.current),n)break;return null;case 22:case 23:return t.lanes=0,wL(e,t,r)}return Qa(e,t,r)}var NL,Vj,EL,PL;NL=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}};Vj=function(){};EL=function(e,t,r,n){var a=e.memoizedProps;if(a!==n){e=t.stateNode,Fs(ga.current);var i=null;switch(r){case"input":a=uj(e,a),n=uj(e,n),i=[];break;case"select":a=Et({},a,{value:void 0}),n=Et({},n,{value:void 0}),i=[];break;case"textarea":a=hj(e,a),n=hj(e,n),i=[];break;default:typeof a.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=_p)}mj(r,n);var s;r=null;for(c in a)if(!n.hasOwnProperty(c)&&a.hasOwnProperty(c)&&a[c]!=null)if(c==="style"){var o=a[c];for(s in o)o.hasOwnProperty(s)&&(r||(r={}),r[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(sd.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in n){var l=n[c];if(o=a!=null?a[c]:void 0,n.hasOwnProperty(c)&&l!==o&&(l!=null||o!=null))if(c==="style")if(o){for(s in o)!o.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in l)l.hasOwnProperty(s)&&o[s]!==l[s]&&(r||(r={}),r[s]=l[s])}else r||(i||(i=[]),i.push(c,r)),r=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(sd.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&ft("scroll",e),i||o===l||(i=[])):(i=i||[]).push(c,l))}r&&(i=i||[]).push("style",r);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};PL=function(e,t,r,n){r!==n&&(t.flags|=4)};function Zc(e,t){if(!vt)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 xr(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags&14680064,n|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function yH(e,t,r){var n=t.pendingProps;switch(O2(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xr(t),null;case 1:return qr(t.type)&&Np(),xr(t),null;case 3:return n=t.stateNode,zl(),pt(Vr),pt(_r),B2(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(sh(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Gn!==null&&(Xj(Gn),Gn=null))),Vj(e,t),xr(t),null;case 5:F2(t);var a=Fs(vd.current);if(r=t.type,e!==null&&t.stateNode!=null)EL(e,t,r,n,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(Z(166));return xr(t),null}if(e=Fs(ga.current),sh(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[fa]=t,n[gd]=i,e=(t.mode&1)!==0,r){case"dialog":ft("cancel",n),ft("close",n);break;case"iframe":case"object":case"embed":ft("load",n);break;case"video":case"audio":for(a=0;a<Eu.length;a++)ft(Eu[a],n);break;case"source":ft("error",n);break;case"img":case"image":case"link":ft("error",n),ft("load",n);break;case"details":ft("toggle",n);break;case"input":BE(n,i),ft("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},ft("invalid",n);break;case"textarea":qE(n,i),ft("invalid",n)}mj(r,i),a=null;for(var s in i)if(i.hasOwnProperty(s)){var o=i[s];s==="children"?typeof o=="string"?n.textContent!==o&&(i.suppressHydrationWarning!==!0&&ih(n.textContent,o,e),a=["children",o]):typeof o=="number"&&n.textContent!==""+o&&(i.suppressHydrationWarning!==!0&&ih(n.textContent,o,e),a=["children",""+o]):sd.hasOwnProperty(s)&&o!=null&&s==="onScroll"&&ft("scroll",n)}switch(r){case"input":Zf(n),VE(n,i,!0);break;case"textarea":Zf(n),UE(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=_p)}n=a,t.updateQueue=n,n!==null&&(t.flags|=4)}else{s=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=r4(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[fa]=t,e[gd]=n,NL(e,t,!1,!1),t.stateNode=e;e:{switch(s=gj(r,n),r){case"dialog":ft("cancel",e),ft("close",e),a=n;break;case"iframe":case"object":case"embed":ft("load",e),a=n;break;case"video":case"audio":for(a=0;a<Eu.length;a++)ft(Eu[a],e);a=n;break;case"source":ft("error",e),a=n;break;case"img":case"image":case"link":ft("error",e),ft("load",e),a=n;break;case"details":ft("toggle",e),a=n;break;case"input":BE(e,n),a=uj(e,n),ft("invalid",e);break;case"option":a=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},a=Et({},n,{value:void 0}),ft("invalid",e);break;case"textarea":qE(e,n),a=hj(e,n),ft("invalid",e);break;default:a=n}mj(r,a),o=a;for(i in o)if(o.hasOwnProperty(i)){var l=o[i];i==="style"?i4(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&n4(e,l)):i==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&od(e,l):typeof l=="number"&&od(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(sd.hasOwnProperty(i)?l!=null&&i==="onScroll"&&ft("scroll",e):l!=null&&y2(e,i,l,s))}switch(r){case"input":Zf(e),VE(e,n,!1);break;case"textarea":Zf(e),UE(e);break;case"option":n.value!=null&&e.setAttribute("value",""+ns(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?xl(e,!!n.multiple,i,!1):n.defaultValue!=null&&xl(e,!!n.multiple,n.defaultValue,!0);break;default:typeof a.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 xr(t),null;case 6:if(e&&t.stateNode!=null)PL(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(Z(166));if(r=Fs(vd.current),Fs(ga.current),sh(t)){if(n=t.stateNode,r=t.memoizedProps,n[fa]=t,(i=n.nodeValue!==r)&&(e=en,e!==null))switch(e.tag){case 3:ih(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ih(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[fa]=t,t.stateNode=n}return xr(t),null;case 13:if(pt(kt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(vt&&Jr!==null&&t.mode&1&&!(t.flags&128))W4(),Il(),t.flags|=98560,i=!1;else if(i=sh(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(Z(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Z(317));i[fa]=t}else Il(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;xr(t),i=!1}else Gn!==null&&(Xj(Gn),Gn=null),i=!0;if(!i)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||kt.current&1?Qt===0&&(Qt=3):J2())),t.updateQueue!==null&&(t.flags|=4),xr(t),null);case 4:return zl(),Vj(e,t),e===null&&pd(t.stateNode.containerInfo),xr(t),null;case 10:return D2(t.type._context),xr(t),null;case 17:return qr(t.type)&&Np(),xr(t),null;case 19:if(pt(kt),i=t.memoizedState,i===null)return xr(t),null;if(n=(t.flags&128)!==0,s=i.rendering,s===null)if(n)Zc(i,!1);else{if(Qt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Mp(e),s!==null){for(t.flags|=128,Zc(i,!1),n=s.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return it(kt,kt.current&1|2),t.child}e=e.sibling}i.tail!==null&&Dt()>Bl&&(t.flags|=128,n=!0,Zc(i,!1),t.lanes=4194304)}else{if(!n)if(e=Mp(s),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Zc(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!vt)return xr(t),null}else 2*Dt()-i.renderingStartTime>Bl&&r!==1073741824&&(t.flags|=128,n=!0,Zc(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(r=i.last,r!==null?r.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Dt(),t.sibling=null,r=kt.current,it(kt,n?r&1|2:r&1),t):(xr(t),null);case 22:case 23:return Q2(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Kr&1073741824&&(xr(t),t.subtreeFlags&6&&(t.flags|=8192)):xr(t),null;case 24:return null;case 25:return null}throw Error(Z(156,t.tag))}function vH(e,t){switch(O2(t),t.tag){case 1:return qr(t.type)&&Np(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zl(),pt(Vr),pt(_r),B2(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return F2(t),null;case 13:if(pt(kt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Z(340));Il()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pt(kt),null;case 4:return zl(),null;case 10:return D2(t.type._context),null;case 22:case 23:return Q2(),null;case 24:return null;default:return null}}var ch=!1,wr=!1,xH=typeof WeakSet=="function"?WeakSet:Set,le=null;function ll(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){At(e,t,n)}else r.current=null}function qj(e,t,r){try{r()}catch(n){At(e,t,n)}}var MP=!1;function bH(e,t){if(Nj=jp,e=M4(),A2(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 a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var s=0,o=-1,l=-1,c=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==r||a!==0&&f.nodeType!==3||(o=s+a),f!==i||n!==0&&f.nodeType!==3||(l=s+n),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===r&&++c===a&&(o=s),h===i&&++d===n&&(l=s),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}r=o===-1||l===-1?null:{start:o,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ej={focusedElem:e,selectionRange:r},jp=!1,le=t;le!==null;)if(t=le,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,le=e;else for(;le!==null;){t=le;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,b=g.memoizedState,x=t.stateNode,y=x.getSnapshotBeforeUpdate(t.elementType===t.type?m:Bn(t.type,m),b);x.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Z(163))}}catch(w){At(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,le=e;break}le=t.return}return g=MP,MP=!1,g}function Wu(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&qj(t,r,i)}a=a.next}while(a!==n)}}function x0(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 Uj(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 CL(e){var t=e.alternate;t!==null&&(e.alternate=null,CL(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[fa],delete t[gd],delete t[Aj],delete t[rH],delete t[nH])),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 AL(e){return e.tag===5||e.tag===3||e.tag===4}function RP(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||AL(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 Hj(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(Hj(e,t,r),e=e.sibling;e!==null;)Hj(e,t,r),e=e.sibling}function Wj(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(Wj(e,t,r),e=e.sibling;e!==null;)Wj(e,t,r),e=e.sibling}var ur=null,Vn=!1;function Si(e,t,r){for(r=r.child;r!==null;)TL(e,t,r),r=r.sibling}function TL(e,t,r){if(ma&&typeof ma.onCommitFiberUnmount=="function")try{ma.onCommitFiberUnmount(d0,r)}catch{}switch(r.tag){case 5:wr||ll(r,t);case 6:var n=ur,a=Vn;ur=null,Si(e,t,r),ur=n,Vn=a,ur!==null&&(Vn?(e=ur,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):ur.removeChild(r.stateNode));break;case 18:ur!==null&&(Vn?(e=ur,r=r.stateNode,e.nodeType===8?ly(e.parentNode,r):e.nodeType===1&&ly(e,r),dd(e)):ly(ur,r.stateNode));break;case 4:n=ur,a=Vn,ur=r.stateNode.containerInfo,Vn=!0,Si(e,t,r),ur=n,Vn=a;break;case 0:case 11:case 14:case 15:if(!wr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&qj(r,t,s),a=a.next}while(a!==n)}Si(e,t,r);break;case 1:if(!wr&&(ll(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){At(r,t,o)}Si(e,t,r);break;case 21:Si(e,t,r);break;case 22:r.mode&1?(wr=(n=wr)||r.memoizedState!==null,Si(e,t,r),wr=n):Si(e,t,r);break;default:Si(e,t,r)}}function $P(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new xH),t.forEach(function(n){var a=CH.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function Ln(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var a=r[n];try{var i=e,s=t,o=s;e:for(;o!==null;){switch(o.tag){case 5:ur=o.stateNode,Vn=!1;break e;case 3:ur=o.stateNode.containerInfo,Vn=!0;break e;case 4:ur=o.stateNode.containerInfo,Vn=!0;break e}o=o.return}if(ur===null)throw Error(Z(160));TL(i,s,a),ur=null,Vn=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(c){At(a,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)OL(t,e),t=t.sibling}function OL(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ln(t,e),ca(e),n&4){try{Wu(3,e,e.return),x0(3,e)}catch(m){At(e,e.return,m)}try{Wu(5,e,e.return)}catch(m){At(e,e.return,m)}}break;case 1:Ln(t,e),ca(e),n&512&&r!==null&&ll(r,r.return);break;case 5:if(Ln(t,e),ca(e),n&512&&r!==null&&ll(r,r.return),e.flags&32){var a=e.stateNode;try{od(a,"")}catch(m){At(e,e.return,m)}}if(n&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,s=r!==null?r.memoizedProps:i,o=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{o==="input"&&i.type==="radio"&&i.name!=null&&e4(a,i),gj(o,s);var c=gj(o,i);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d==="style"?i4(a,f):d==="dangerouslySetInnerHTML"?n4(a,f):d==="children"?od(a,f):y2(a,d,f,c)}switch(o){case"input":dj(a,i);break;case"textarea":t4(a,i);break;case"select":var h=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?xl(a,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?xl(a,!!i.multiple,i.defaultValue,!0):xl(a,!!i.multiple,i.multiple?[]:"",!1))}a[gd]=i}catch(m){At(e,e.return,m)}}break;case 6:if(Ln(t,e),ca(e),n&4){if(e.stateNode===null)throw Error(Z(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(m){At(e,e.return,m)}}break;case 3:if(Ln(t,e),ca(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{dd(t.containerInfo)}catch(m){At(e,e.return,m)}break;case 4:Ln(t,e),ca(e);break;case 13:Ln(t,e),ca(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(X2=Dt())),n&4&&$P(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(wr=(c=wr)||d,Ln(t,e),wr=c):Ln(t,e),ca(e),n&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(le=e,d=e.child;d!==null;){for(f=le=d;le!==null;){switch(h=le,p=h.child,h.tag){case 0:case 11:case 14:case 15:Wu(4,h,h.return);break;case 1:ll(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(m){At(n,r,m)}}break;case 5:ll(h,h.return);break;case 22:if(h.memoizedState!==null){IP(f);continue}}p!==null?(p.return=h,le=p):IP(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,c?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(o=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,o.style.display=a4("display",s))}catch(m){At(e,e.return,m)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(m){At(e,e.return,m)}}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:Ln(t,e),ca(e),n&4&&$P(e);break;case 21:break;default:Ln(t,e),ca(e)}}function ca(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(AL(r)){var n=r;break e}r=r.return}throw Error(Z(160))}switch(n.tag){case 5:var a=n.stateNode;n.flags&32&&(od(a,""),n.flags&=-33);var i=RP(e);Wj(e,i,a);break;case 3:case 4:var s=n.stateNode.containerInfo,o=RP(e);Hj(e,o,s);break;default:throw Error(Z(161))}}catch(l){At(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wH(e,t,r){le=e,ML(e)}function ML(e,t,r){for(var n=(e.mode&1)!==0;le!==null;){var a=le,i=a.child;if(a.tag===22&&n){var s=a.memoizedState!==null||ch;if(!s){var o=a.alternate,l=o!==null&&o.memoizedState!==null||wr;o=ch;var c=wr;if(ch=s,(wr=l)&&!c)for(le=a;le!==null;)s=le,l=s.child,s.tag===22&&s.memoizedState!==null?LP(a):l!==null?(l.return=s,le=l):LP(a);for(;i!==null;)le=i,ML(i),i=i.sibling;le=a,ch=o,wr=c}DP(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,le=i):DP(e)}}function DP(e){for(;le!==null;){var t=le;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:wr||x0(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!wr)if(r===null)n.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:Bn(t.type,r.memoizedProps);n.componentDidUpdate(a,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&bP(t,i,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}bP(t,s,r)}break;case 5:var o=t.stateNode;if(r===null&&t.flags&4){r=o;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&dd(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Z(163))}wr||t.flags&512&&Uj(t)}catch(h){At(t,t.return,h)}}if(t===e){le=null;break}if(r=t.sibling,r!==null){r.return=t.return,le=r;break}le=t.return}}function IP(e){for(;le!==null;){var t=le;if(t===e){le=null;break}var r=t.sibling;if(r!==null){r.return=t.return,le=r;break}le=t.return}}function LP(e){for(;le!==null;){var t=le;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{x0(4,t)}catch(l){At(t,r,l)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var a=t.return;try{n.componentDidMount()}catch(l){At(t,a,l)}}var i=t.return;try{Uj(t)}catch(l){At(t,i,l)}break;case 5:var s=t.return;try{Uj(t)}catch(l){At(t,s,l)}}}catch(l){At(t,t.return,l)}if(t===e){le=null;break}var o=t.sibling;if(o!==null){o.return=t.return,le=o;break}le=t.return}}var jH=Math.ceil,Dp=ui.ReactCurrentDispatcher,K2=ui.ReactCurrentOwner,Sn=ui.ReactCurrentBatchConfig,Ve=0,sr=null,Ht=null,hr=0,Kr=0,cl=ps(0),Qt=0,jd=null,oo=0,b0=0,Y2=0,Gu=null,Lr=null,X2=0,Bl=1/0,Oa=null,Ip=!1,Gj=null,Yi=null,uh=!1,Bi=null,Lp=0,Ku=0,Kj=null,ip=-1,sp=0;function Ar(){return Ve&6?Dt():ip!==-1?ip:ip=Dt()}function Xi(e){return e.mode&1?Ve&2&&hr!==0?hr&-hr:iH.transition!==null?(sp===0&&(sp=y4()),sp):(e=Ze,e!==0||(e=window.event,e=e===void 0?16:k4(e.type)),e):1}function Jn(e,t,r,n){if(50<Ku)throw Ku=0,Kj=null,Error(Z(185));bf(e,r,n),(!(Ve&2)||e!==sr)&&(e===sr&&(!(Ve&2)&&(b0|=r),Qt===4&&Di(e,hr)),Ur(e,n),r===1&&Ve===0&&!(t.mode&1)&&(Bl=Dt()+500,g0&&ms()))}function Ur(e,t){var r=e.callbackNode;iU(e,t);var n=wp(e,e===sr?hr:0);if(n===0)r!==null&&GE(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&GE(r),t===1)e.tag===0?aH(zP.bind(null,e)):q4(zP.bind(null,e)),eH(function(){!(Ve&6)&&ms()}),r=null;else{switch(v4(n)){case 1:r=j2;break;case 4:r=m4;break;case 16:r=bp;break;case 536870912:r=g4;break;default:r=bp}r=BL(r,RL.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function RL(e,t){if(ip=-1,sp=0,Ve&6)throw Error(Z(327));var r=e.callbackNode;if(kl()&&e.callbackNode!==r)return null;var n=wp(e,e===sr?hr:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=zp(e,n);else{t=n;var a=Ve;Ve|=2;var i=DL();(sr!==e||hr!==t)&&(Oa=null,Bl=Dt()+500,Xs(e,t));do try{_H();break}catch(o){$L(e,o)}while(!0);$2(),Dp.current=i,Ve=a,Ht!==null?t=0:(sr=null,hr=0,t=Qt)}if(t!==0){if(t===2&&(a=wj(e),a!==0&&(n=a,t=Yj(e,a))),t===1)throw r=jd,Xs(e,0),Di(e,n),Ur(e,Dt()),r;if(t===6)Di(e,n);else{if(a=e.current.alternate,!(n&30)&&!SH(a)&&(t=zp(e,n),t===2&&(i=wj(e),i!==0&&(n=i,t=Yj(e,i))),t===1))throw r=jd,Xs(e,0),Di(e,n),Ur(e,Dt()),r;switch(e.finishedWork=a,e.finishedLanes=n,t){case 0:case 1:throw Error(Z(345));case 2:As(e,Lr,Oa);break;case 3:if(Di(e,n),(n&130023424)===n&&(t=X2+500-Dt(),10<t)){if(wp(e,0)!==0)break;if(a=e.suspendedLanes,(a&n)!==n){Ar(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Cj(As.bind(null,e,Lr,Oa),t);break}As(e,Lr,Oa);break;case 4:if(Di(e,n),(n&4194240)===n)break;for(t=e.eventTimes,a=-1;0<n;){var s=31-Qn(n);i=1<<s,s=t[s],s>a&&(a=s),n&=~i}if(n=a,n=Dt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*jH(n/1960))-n,10<n){e.timeoutHandle=Cj(As.bind(null,e,Lr,Oa),n);break}As(e,Lr,Oa);break;case 5:As(e,Lr,Oa);break;default:throw Error(Z(329))}}}return Ur(e,Dt()),e.callbackNode===r?RL.bind(null,e):null}function Yj(e,t){var r=Gu;return e.current.memoizedState.isDehydrated&&(Xs(e,t).flags|=256),e=zp(e,t),e!==2&&(t=Lr,Lr=r,t!==null&&Xj(t)),e}function Xj(e){Lr===null?Lr=e:Lr.push.apply(Lr,e)}function SH(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 a=r[n],i=a.getSnapshot;a=a.value;try{if(!ra(i(),a))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 Di(e,t){for(t&=~Y2,t&=~b0,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Qn(t),n=1<<r;e[r]=-1,t&=~n}}function zP(e){if(Ve&6)throw Error(Z(327));kl();var t=wp(e,0);if(!(t&1))return Ur(e,Dt()),null;var r=zp(e,t);if(e.tag!==0&&r===2){var n=wj(e);n!==0&&(t=n,r=Yj(e,n))}if(r===1)throw r=jd,Xs(e,0),Di(e,t),Ur(e,Dt()),r;if(r===6)throw Error(Z(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,As(e,Lr,Oa),Ur(e,Dt()),null}function Z2(e,t){var r=Ve;Ve|=1;try{return e(t)}finally{Ve=r,Ve===0&&(Bl=Dt()+500,g0&&ms())}}function lo(e){Bi!==null&&Bi.tag===0&&!(Ve&6)&&kl();var t=Ve;Ve|=1;var r=Sn.transition,n=Ze;try{if(Sn.transition=null,Ze=1,e)return e()}finally{Ze=n,Sn.transition=r,Ve=t,!(Ve&6)&&ms()}}function Q2(){Kr=cl.current,pt(cl)}function Xs(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,JU(r)),Ht!==null)for(r=Ht.return;r!==null;){var n=r;switch(O2(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Np();break;case 3:zl(),pt(Vr),pt(_r),B2();break;case 5:F2(n);break;case 4:zl();break;case 13:pt(kt);break;case 19:pt(kt);break;case 10:D2(n.type._context);break;case 22:case 23:Q2()}r=r.return}if(sr=e,Ht=e=Zi(e.current,null),hr=Kr=t,Qt=0,jd=null,Y2=b0=oo=0,Lr=Gu=null,zs!==null){for(t=0;t<zs.length;t++)if(r=zs[t],n=r.interleaved,n!==null){r.interleaved=null;var a=n.next,i=r.pending;if(i!==null){var s=i.next;i.next=a,n.next=s}r.pending=n}zs=null}return e}function $L(e,t){do{var r=Ht;try{if($2(),rp.current=$p,Rp){for(var n=Nt.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}Rp=!1}if(so=0,ir=Zt=Nt=null,Hu=!1,xd=0,K2.current=null,r===null||r.return===null){Qt=1,jd=t,Ht=null;break}e:{var i=e,s=r.return,o=r,l=t;if(t=hr,o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=o,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 p=NP(s);if(p!==null){p.flags&=-257,EP(p,s,o,i,t),p.mode&1&&_P(i,c,t),t=p,l=c;var g=t.updateQueue;if(g===null){var m=new Set;m.add(l),t.updateQueue=m}else g.add(l);break e}else{if(!(t&1)){_P(i,c,t),J2();break e}l=Error(Z(426))}}else if(vt&&o.mode&1){var b=NP(s);if(b!==null){!(b.flags&65536)&&(b.flags|=256),EP(b,s,o,i,t),M2(Fl(l,o));break e}}i=l=Fl(l,o),Qt!==4&&(Qt=2),Gu===null?Gu=[i]:Gu.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var x=vL(i,l,t);xP(i,x);break e;case 1:o=l;var y=i.type,v=i.stateNode;if(!(i.flags&128)&&(typeof y.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Yi===null||!Yi.has(v)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=xL(i,o,t);xP(i,w);break e}}i=i.return}while(i!==null)}LL(r)}catch(j){t=j,Ht===r&&r!==null&&(Ht=r=r.return);continue}break}while(!0)}function DL(){var e=Dp.current;return Dp.current=$p,e===null?$p:e}function J2(){(Qt===0||Qt===3||Qt===2)&&(Qt=4),sr===null||!(oo&268435455)&&!(b0&268435455)||Di(sr,hr)}function zp(e,t){var r=Ve;Ve|=2;var n=DL();(sr!==e||hr!==t)&&(Oa=null,Xs(e,t));do try{kH();break}catch(a){$L(e,a)}while(!0);if($2(),Ve=r,Dp.current=n,Ht!==null)throw Error(Z(261));return sr=null,hr=0,Qt}function kH(){for(;Ht!==null;)IL(Ht)}function _H(){for(;Ht!==null&&!Xq();)IL(Ht)}function IL(e){var t=FL(e.alternate,e,Kr);e.memoizedProps=e.pendingProps,t===null?LL(e):Ht=t,K2.current=null}function LL(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=vH(r,t),r!==null){r.flags&=32767,Ht=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Qt=6,Ht=null;return}}else if(r=yH(r,t,Kr),r!==null){Ht=r;return}if(t=t.sibling,t!==null){Ht=t;return}Ht=t=e}while(t!==null);Qt===0&&(Qt=5)}function As(e,t,r){var n=Ze,a=Sn.transition;try{Sn.transition=null,Ze=1,NH(e,t,r,n)}finally{Sn.transition=a,Ze=n}return null}function NH(e,t,r,n){do kl();while(Bi!==null);if(Ve&6)throw Error(Z(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(Z(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(sU(e,i),e===sr&&(Ht=sr=null,hr=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||uh||(uh=!0,BL(bp,function(){return kl(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=Sn.transition,Sn.transition=null;var s=Ze;Ze=1;var o=Ve;Ve|=4,K2.current=null,bH(e,r),OL(r,e),WU(Ej),jp=!!Nj,Ej=Nj=null,e.current=r,wH(r),Zq(),Ve=o,Ze=s,Sn.transition=i}else e.current=r;if(uh&&(uh=!1,Bi=e,Lp=a),i=e.pendingLanes,i===0&&(Yi=null),eU(r.stateNode),Ur(e,Dt()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],n(a.value,{componentStack:a.stack,digest:a.digest});if(Ip)throw Ip=!1,e=Gj,Gj=null,e;return Lp&1&&e.tag!==0&&kl(),i=e.pendingLanes,i&1?e===Kj?Ku++:(Ku=0,Kj=e):Ku=0,ms(),null}function kl(){if(Bi!==null){var e=v4(Lp),t=Sn.transition,r=Ze;try{if(Sn.transition=null,Ze=16>e?16:e,Bi===null)var n=!1;else{if(e=Bi,Bi=null,Lp=0,Ve&6)throw Error(Z(331));var a=Ve;for(Ve|=4,le=e.current;le!==null;){var i=le,s=i.child;if(le.flags&16){var o=i.deletions;if(o!==null){for(var l=0;l<o.length;l++){var c=o[l];for(le=c;le!==null;){var d=le;switch(d.tag){case 0:case 11:case 15:Wu(8,d,i)}var f=d.child;if(f!==null)f.return=d,le=f;else for(;le!==null;){d=le;var h=d.sibling,p=d.return;if(CL(d),d===c){le=null;break}if(h!==null){h.return=p,le=h;break}le=p}}}var g=i.alternate;if(g!==null){var m=g.child;if(m!==null){g.child=null;do{var b=m.sibling;m.sibling=null,m=b}while(m!==null)}}le=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,le=s;else e:for(;le!==null;){if(i=le,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Wu(9,i,i.return)}var x=i.sibling;if(x!==null){x.return=i.return,le=x;break e}le=i.return}}var y=e.current;for(le=y;le!==null;){s=le;var v=s.child;if(s.subtreeFlags&2064&&v!==null)v.return=s,le=v;else e:for(s=y;le!==null;){if(o=le,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:x0(9,o)}}catch(j){At(o,o.return,j)}if(o===s){le=null;break e}var w=o.sibling;if(w!==null){w.return=o.return,le=w;break e}le=o.return}}if(Ve=a,ms(),ma&&typeof ma.onPostCommitFiberRoot=="function")try{ma.onPostCommitFiberRoot(d0,e)}catch{}n=!0}return n}finally{Ze=r,Sn.transition=t}}return!1}function FP(e,t,r){t=Fl(r,t),t=vL(e,t,1),e=Ki(e,t,1),t=Ar(),e!==null&&(bf(e,1,t),Ur(e,t))}function At(e,t,r){if(e.tag===3)FP(e,e,r);else for(;t!==null;){if(t.tag===3){FP(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Yi===null||!Yi.has(n))){e=Fl(r,e),e=xL(t,e,1),t=Ki(t,e,1),e=Ar(),t!==null&&(bf(t,1,e),Ur(t,e));break}}t=t.return}}function EH(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Ar(),e.pingedLanes|=e.suspendedLanes&r,sr===e&&(hr&r)===r&&(Qt===4||Qt===3&&(hr&130023424)===hr&&500>Dt()-X2?Xs(e,0):Y2|=r),Ur(e,t)}function zL(e,t){t===0&&(e.mode&1?(t=eh,eh<<=1,!(eh&130023424)&&(eh=4194304)):t=1);var r=Ar();e=Za(e,t),e!==null&&(bf(e,t,r),Ur(e,r))}function PH(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),zL(e,r)}function CH(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Z(314))}n!==null&&n.delete(t),zL(e,r)}var FL;FL=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Vr.current)zr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return zr=!1,gH(e,t,r);zr=!!(e.flags&131072)}else zr=!1,vt&&t.flags&1048576&&U4(t,Cp,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;ap(e,t),e=t.pendingProps;var a=Dl(t,_r.current);Sl(t,r),a=q2(null,t,n,e,a,r);var i=U2();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,qr(n)?(i=!0,Ep(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,L2(t),a.updater=v0,t.stateNode=a,a._reactInternals=t,Dj(t,n,e,r),t=zj(null,t,n,!0,i,r)):(t.tag=0,vt&&i&&T2(t),Er(null,t,a,r),t=t.child),t;case 16:n=t.elementType;e:{switch(ap(e,t),e=t.pendingProps,a=n._init,n=a(n._payload),t.type=n,a=t.tag=TH(n),e=Bn(n,e),a){case 0:t=Lj(null,t,n,e,r);break e;case 1:t=AP(null,t,n,e,r);break e;case 11:t=PP(null,t,n,e,r);break e;case 14:t=CP(null,t,n,Bn(n.type,e),r);break e}throw Error(Z(306,n,""))}return t;case 0:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Bn(n,a),Lj(e,t,n,a,r);case 1:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Bn(n,a),AP(e,t,n,a,r);case 3:e:{if(SL(t),e===null)throw Error(Z(387));n=t.pendingProps,i=t.memoizedState,a=i.element,X4(e,t),Op(t,n,null,r);var s=t.memoizedState;if(n=s.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=Fl(Error(Z(423)),t),t=TP(e,t,n,r,a);break e}else if(n!==a){a=Fl(Error(Z(424)),t),t=TP(e,t,n,r,a);break e}else for(Jr=Gi(t.stateNode.containerInfo.firstChild),en=t,vt=!0,Gn=null,r=K4(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Il(),n===a){t=Qa(e,t,r);break e}Er(e,t,n,r)}t=t.child}return t;case 5:return Z4(t),e===null&&Mj(t),n=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,s=a.children,Pj(n,a)?s=null:i!==null&&Pj(n,i)&&(t.flags|=32),jL(e,t),Er(e,t,s,r),t.child;case 6:return e===null&&Mj(t),null;case 13:return kL(e,t,r);case 4:return z2(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ll(t,null,n,r):Er(e,t,n,r),t.child;case 11:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Bn(n,a),PP(e,t,n,a,r);case 7:return Er(e,t,t.pendingProps,r),t.child;case 8:return Er(e,t,t.pendingProps.children,r),t.child;case 12:return Er(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,a=t.pendingProps,i=t.memoizedProps,s=a.value,it(Ap,n._currentValue),n._currentValue=s,i!==null)if(ra(i.value,s)){if(i.children===a.children&&!Vr.current){t=Qa(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var o=i.dependencies;if(o!==null){s=i.child;for(var l=o.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=Va(-1,r&-r),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),Rj(i.return,r,t),o.lanes|=r;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(Z(341));s.lanes|=r,o=s.alternate,o!==null&&(o.lanes|=r),Rj(s,r,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Er(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,n=t.pendingProps.children,Sl(t,r),a=Pn(a),n=n(a),t.flags|=1,Er(e,t,n,r),t.child;case 14:return n=t.type,a=Bn(n,t.pendingProps),a=Bn(n.type,a),CP(e,t,n,a,r);case 15:return bL(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Bn(n,a),ap(e,t),t.tag=1,qr(n)?(e=!0,Ep(t)):e=!1,Sl(t,r),yL(t,n,a),Dj(t,n,a,r),zj(null,t,n,!0,e,r);case 19:return _L(e,t,r);case 22:return wL(e,t,r)}throw Error(Z(156,t.tag))};function BL(e,t){return p4(e,t)}function AH(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 xn(e,t,r,n){return new AH(e,t,r,n)}function e_(e){return e=e.prototype,!(!e||!e.isReactComponent)}function TH(e){if(typeof e=="function")return e_(e)?1:0;if(e!=null){if(e=e.$$typeof,e===x2)return 11;if(e===b2)return 14}return 2}function Zi(e,t){var r=e.alternate;return r===null?(r=xn(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,a,i){var s=2;if(n=e,typeof e=="function")e_(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Jo:return Zs(r.children,a,i,t);case v2:s=8,a|=8;break;case sj:return e=xn(12,r,t,a|2),e.elementType=sj,e.lanes=i,e;case oj:return e=xn(13,r,t,a),e.elementType=oj,e.lanes=i,e;case lj:return e=xn(19,r,t,a),e.elementType=lj,e.lanes=i,e;case Z3:return w0(r,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y3:s=10;break e;case X3:s=9;break e;case x2:s=11;break e;case b2:s=14;break e;case Ti:s=16,n=null;break e}throw Error(Z(130,e==null?e:typeof e,""))}return t=xn(s,r,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function Zs(e,t,r,n){return e=xn(7,e,n,t),e.lanes=r,e}function w0(e,t,r,n){return e=xn(22,e,n,t),e.elementType=Z3,e.lanes=r,e.stateNode={isHidden:!1},e}function gy(e,t,r){return e=xn(6,e,null,t),e.lanes=r,e}function yy(e,t,r){return t=xn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function OH(e,t,r,n,a){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=Zg(0),this.expirationTimes=Zg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zg(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function t_(e,t,r,n,a,i,s,o,l){return e=new OH(e,t,r,o,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=xn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},L2(i),e}function MH(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Qo,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function VL(e){if(!e)return as;e=e._reactInternals;e:{if(ko(e)!==e||e.tag!==1)throw Error(Z(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(qr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Z(171))}if(e.tag===1){var r=e.type;if(qr(r))return V4(e,r,t)}return t}function qL(e,t,r,n,a,i,s,o,l){return e=t_(r,n,!0,e,a,i,s,o,l),e.context=VL(null),r=e.current,n=Ar(),a=Xi(r),i=Va(n,a),i.callback=t??null,Ki(r,i,a),e.current.lanes=a,bf(e,a,n),Ur(e,n),e}function j0(e,t,r,n){var a=t.current,i=Ar(),s=Xi(a);return r=VL(r),t.context===null?t.context=r:t.pendingContext=r,t=Va(i,s),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Ki(a,t,s),e!==null&&(Jn(e,a,s,i),tp(e,a,s)),s}function Fp(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 BP(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function r_(e,t){BP(e,t),(e=e.alternate)&&BP(e,t)}function RH(){return null}var UL=typeof reportError=="function"?reportError:function(e){console.error(e)};function n_(e){this._internalRoot=e}S0.prototype.render=n_.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Z(409));j0(e,t,null,null)};S0.prototype.unmount=n_.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;lo(function(){j0(null,e,null,null)}),t[Xa]=null}};function S0(e){this._internalRoot=e}S0.prototype.unstable_scheduleHydration=function(e){if(e){var t=w4();e={blockedOn:null,target:e,priority:t};for(var r=0;r<$i.length&&t!==0&&t<$i[r].priority;r++);$i.splice(r,0,e),r===0&&S4(e)}};function a_(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function k0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function VP(){}function $H(e,t,r,n,a){if(a){if(typeof n=="function"){var i=n;n=function(){var c=Fp(s);i.call(c)}}var s=qL(t,n,e,0,null,!1,!1,"",VP);return e._reactRootContainer=s,e[Xa]=s.current,pd(e.nodeType===8?e.parentNode:e),lo(),s}for(;a=e.lastChild;)e.removeChild(a);if(typeof n=="function"){var o=n;n=function(){var c=Fp(l);o.call(c)}}var l=t_(e,0,!1,null,null,!1,!1,"",VP);return e._reactRootContainer=l,e[Xa]=l.current,pd(e.nodeType===8?e.parentNode:e),lo(function(){j0(t,l,r,n)}),l}function _0(e,t,r,n,a){var i=r._reactRootContainer;if(i){var s=i;if(typeof a=="function"){var o=a;a=function(){var l=Fp(s);o.call(l)}}j0(t,s,e,a)}else s=$H(r,t,e,a,n);return Fp(s)}x4=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Nu(t.pendingLanes);r!==0&&(S2(t,r|1),Ur(t,Dt()),!(Ve&6)&&(Bl=Dt()+500,ms()))}break;case 13:lo(function(){var n=Za(e,1);if(n!==null){var a=Ar();Jn(n,e,1,a)}}),r_(e,1)}};k2=function(e){if(e.tag===13){var t=Za(e,134217728);if(t!==null){var r=Ar();Jn(t,e,134217728,r)}r_(e,134217728)}};b4=function(e){if(e.tag===13){var t=Xi(e),r=Za(e,t);if(r!==null){var n=Ar();Jn(r,e,t,n)}r_(e,t)}};w4=function(){return Ze};j4=function(e,t){var r=Ze;try{return Ze=e,t()}finally{Ze=r}};vj=function(e,t,r){switch(t){case"input":if(dj(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 a=m0(n);if(!a)throw Error(Z(90));J3(n),dj(n,a)}}}break;case"textarea":t4(e,r);break;case"select":t=r.value,t!=null&&xl(e,!!r.multiple,t,!1)}};l4=Z2;c4=lo;var DH={usingClientEntryPoint:!1,Events:[jf,nl,m0,s4,o4,Z2]},Qc={findFiberByHostInstance:Ls,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},IH={bundleType:Qc.bundleType,version:Qc.version,rendererPackageName:Qc.rendererPackageName,rendererConfig:Qc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ui.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=f4(e),e===null?null:e.stateNode},findFiberByHostInstance:Qc.findFiberByHostInstance||RH,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 dh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!dh.isDisabled&&dh.supportsFiber)try{d0=dh.inject(IH),ma=dh}catch{}}an.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=DH;an.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!a_(t))throw Error(Z(200));return MH(e,t,null,r)};an.createRoot=function(e,t){if(!a_(e))throw Error(Z(299));var r=!1,n="",a=UL;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=t_(e,1,!1,null,null,r,!1,n,a),e[Xa]=t.current,pd(e.nodeType===8?e.parentNode:e),new n_(t)};an.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(Z(188)):(e=Object.keys(e).join(","),Error(Z(268,e)));return e=f4(t),e=e===null?null:e.stateNode,e};an.flushSync=function(e){return lo(e)};an.hydrate=function(e,t,r){if(!k0(t))throw Error(Z(200));return _0(null,e,t,!0,r)};an.hydrateRoot=function(e,t,r){if(!a_(e))throw Error(Z(405));var n=r!=null&&r.hydratedSources||null,a=!1,i="",s=UL;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(s=r.onRecoverableError)),t=qL(t,null,e,1,r??null,a,!1,i,s),e[Xa]=t.current,pd(e),n)for(e=0;e<n.length;e++)r=n[e],a=r._getVersion,a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new S0(t)};an.render=function(e,t,r){if(!k0(t))throw Error(Z(200));return _0(null,e,t,!1,r)};an.unmountComponentAtNode=function(e){if(!k0(e))throw Error(Z(40));return e._reactRootContainer?(lo(function(){_0(null,null,e,!1,function(){e._reactRootContainer=null,e[Xa]=null})}),!0):!1};an.unstable_batchedUpdates=Z2;an.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!k0(r))throw Error(Z(200));if(e==null||e._reactInternals===void 0)throw Error(Z(38));return _0(e,t,r,!1,n)};an.version="18.3.1-next-f1338f8080-20240426";function HL(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(HL)}catch(e){console.error(e)}}HL(),H3.exports=an;var i_=H3.exports;const LH=Ke(i_),zH=M3({__proto__:null,default:LH},[i_]);var qP=i_;aj.createRoot=qP.createRoot,aj.hydrateRoot=qP.hydrateRoot;/**
41
- * @remix-run/router v1.23.1
42
- *
43
- * Copyright (c) Remix Software Inc.
44
- *
45
- * This source code is licensed under the MIT license found in the
46
- * LICENSE.md file in the root directory of this source tree.
47
- *
48
- * @license MIT
49
- */function yt(){return yt=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},yt.apply(this,arguments)}var qt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(qt||(qt={}));const UP="popstate";function FH(e){e===void 0&&(e={});function t(n,a){let{pathname:i,search:s,hash:o}=n.location;return Sd("",{pathname:i,search:s,hash:o},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:uo(a)}return VH(t,r,null,e)}function Oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function co(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function BH(){return Math.random().toString(36).substr(2,8)}function HP(e,t){return{usr:e.state,key:e.key,idx:t}}function Sd(e,t,r,n){return r===void 0&&(r=null),yt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?gs(t):t,{state:r,key:t&&t.key||n||BH()})}function uo(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 gs(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 VH(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,s=a.history,o=qt.Pop,l=null,c=d();c==null&&(c=0,s.replaceState(yt({},s.state,{idx:c}),""));function d(){return(s.state||{idx:null}).idx}function f(){o=qt.Pop;let b=d(),x=b==null?null:b-c;c=b,l&&l({action:o,location:m.location,delta:x})}function h(b,x){o=qt.Push;let y=Sd(m.location,b,x);c=d()+1;let v=HP(y,c),w=m.createHref(y);try{s.pushState(v,"",w)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;a.location.assign(w)}i&&l&&l({action:o,location:m.location,delta:1})}function p(b,x){o=qt.Replace;let y=Sd(m.location,b,x);c=d();let v=HP(y,c),w=m.createHref(y);s.replaceState(v,"",w),i&&l&&l({action:o,location:m.location,delta:0})}function g(b){let x=a.location.origin!=="null"?a.location.origin:a.location.href,y=typeof b=="string"?b:uo(b);return y=y.replace(/ $/,"%20"),Oe(x,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,x)}let m={get action(){return o},get location(){return e(a,s)},listen(b){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(UP,f),l=b,()=>{a.removeEventListener(UP,f),l=null}},createHref(b){return t(a,b)},createURL:g,encodeLocation(b){let x=g(b);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:h,replace:p,go(b){return s.go(b)}};return m}var Xe;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Xe||(Xe={}));const qH=new Set(["lazy","caseSensitive","path","id","index","children"]);function UH(e){return e.index===!0}function Bp(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,i)=>{let s=[...r,String(i)],o=typeof a.id=="string"?a.id:s.join("-");if(Oe(a.index!==!0||!a.children,"Cannot specify children on an index route"),Oe(!n[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),UH(a)){let l=yt({},a,t(a),{id:o});return n[o]=l,l}else{let l=yt({},a,t(a),{id:o,children:void 0});return n[o]=l,a.children&&(l.children=Bp(a.children,t,s,n)),l}})}function Ds(e,t,r){return r===void 0&&(r="/"),lp(e,t,r,!1)}function lp(e,t,r,n){let a=typeof t=="string"?gs(t):t,i=Ja(a.pathname||"/",r);if(i==null)return null;let s=WL(e);WH(s);let o=null;for(let l=0;o==null&&l<s.length;++l){let c=nW(i);o=tW(s[l],c,n)}return o}function HH(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function WL(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,s,o)=>{let l={relativePath:o===void 0?i.path||"":o,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};l.relativePath.startsWith("/")&&(Oe(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let c=qa([n,l.relativePath]),d=r.concat(l);i.children&&i.children.length>0&&(Oe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),WL(i.children,t,d,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:JH(c,i.index),routesMeta:d})};return e.forEach((i,s)=>{var o;if(i.path===""||!((o=i.path)!=null&&o.includes("?")))a(i,s);else for(let l of GL(i.path))a(i,s,l)}),t}function GL(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let s=GL(n.join("/")),o=[];return o.push(...s.map(l=>l===""?i:[i,l].join("/"))),a&&o.push(...s),o.map(l=>e.startsWith("/")&&l===""?"/":l)}function WH(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:eW(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const GH=/^:[\w-]+$/,KH=3,YH=2,XH=1,ZH=10,QH=-2,WP=e=>e==="*";function JH(e,t){let r=e.split("/"),n=r.length;return r.some(WP)&&(n+=QH),t&&(n+=YH),r.filter(a=>!WP(a)).reduce((a,i)=>a+(GH.test(i)?KH:i===""?XH:ZH),n)}function eW(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function tW(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,a={},i="/",s=[];for(let o=0;o<n.length;++o){let l=n[o],c=o===n.length-1,d=i==="/"?t:t.slice(i.length)||"/",f=Vp({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},d),h=l.route;if(!f&&c&&r&&!n[n.length-1].route.index&&(f=Vp({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!f)return null;Object.assign(a,f.params),s.push({params:a,pathname:qa([i,f.pathname]),pathnameBase:oW(qa([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=qa([i,f.pathnameBase]))}return s}function Vp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=rW(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let i=a[0],s=i.replace(/(.)\/+$/,"$1"),o=a.slice(1);return{params:n.reduce((c,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let m=o[f]||"";s=i.slice(0,i.length-m.length).replace(/(.)\/+$/,"$1")}const g=o[f];return p&&!g?c[h]=void 0:c[h]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:s,pattern:e}}function rW(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),co(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,o,l)=>(n.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function nW(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return co(!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 Ja(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)||"/"}const aW=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,iW=e=>aW.test(e);function sW(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?gs(e):e,i;if(r)if(iW(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),co(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=GP(r.substring(1),"/"):i=GP(r,t)}else i=t;return{pathname:i,search:lW(n),hash:cW(a)}}function GP(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function vy(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 KL(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function s_(e,t){let r=KL(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function o_(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=gs(e):(a=yt({},e),Oe(!a.pathname||!a.pathname.includes("?"),vy("?","pathname","search",a)),Oe(!a.pathname||!a.pathname.includes("#"),vy("#","pathname","hash",a)),Oe(!a.search||!a.search.includes("#"),vy("#","search","hash",a)));let i=e===""||a.pathname==="",s=i?"/":a.pathname,o;if(s==null)o=r;else{let f=t.length-1;if(!n&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;a.pathname=h.join("/")}o=f>=0?t[f]:"/"}let l=sW(a,o),c=s&&s!=="/"&&s.endsWith("/"),d=(i||s===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const qa=e=>e.join("/").replace(/\/\/+/g,"/"),oW=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),lW=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,cW=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class qp{constructor(t,r,n,a){a===void 0&&(a=!1),this.status=t,this.statusText=r||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function kd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const YL=["post","put","patch","delete"],uW=new Set(YL),dW=["get",...YL],fW=new Set(dW),hW=new Set([301,302,303,307,308]),pW=new Set([307,308]),xy={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},mW={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Jc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},l_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gW=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),XL="remix-router-transitions";function yW(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;Oe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let F=e.detectErrorBoundary;a=q=>({hasErrorBoundary:F(q)})}else a=gW;let i={},s=Bp(e.routes,a,void 0,i),o,l=e.basename||"/",c=e.dataStrategy||wW,d=e.patchRoutesOnNavigation,f=yt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,p=new Set,g=null,m=null,b=null,x=e.hydrationData!=null,y=Ds(s,e.history.location,l),v=!1,w=null;if(y==null&&!d){let F=Ir(404,{pathname:e.history.location.pathname}),{matches:q,route:U}=aC(s);y=q,w={[U.id]:F}}y&&!e.hydrationData&&$o(y,s,e.history.location.pathname).active&&(y=null);let j;if(y)if(y.some(F=>F.route.lazy))j=!1;else if(!y.some(F=>F.route.loader))j=!0;else if(f.v7_partialHydration){let F=e.hydrationData?e.hydrationData.loaderData:null,q=e.hydrationData?e.hydrationData.errors:null;if(q){let U=y.findIndex(X=>q[X.route.id]!==void 0);j=y.slice(0,U+1).every(X=>!Qj(X.route,F,q))}else j=y.every(U=>!Qj(U.route,F,q))}else j=e.hydrationData!=null;else if(j=!1,y=[],f.v7_partialHydration){let F=$o(null,s,e.history.location.pathname);F.active&&F.matches&&(v=!0,y=F.matches)}let k,S={historyAction:e.history.action,location:e.history.location,matches:y,initialized:j,navigation:xy,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||w,fetchers:new Map,blockers:new Map},N=qt.Pop,E=!1,A,C=!1,M=new Map,T=null,P=!1,D=!1,$=[],L=new Set,I=new Map,R=0,z=-1,V=new Map,B=new Set,W=new Map,K=new Map,Q=new Set,ae=new Map,pe=new Map,ve;function Y(){if(h=e.history.listen(F=>{let{action:q,location:U,delta:X}=F;if(ve){ve(),ve=void 0;return}co(pe.size===0||X!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let re=xi({currentLocation:S.location,nextLocation:U,historyAction:q});if(re&&X!=null){let ge=new Promise(be=>{ve=be});e.history.go(X*-1),vi(re,{state:"blocked",location:U,proceed(){vi(re,{state:"proceeding",proceed:void 0,reset:void 0,location:U}),ge.then(()=>e.history.go(X))},reset(){let be=new Map(S.blockers);be.set(re,Jc),H({blockers:be})}});return}return ke(q,U)}),r){$W(t,M);let F=()=>DW(t,M);t.addEventListener("pagehide",F),T=()=>t.removeEventListener("pagehide",F)}return S.initialized||ke(qt.Pop,S.location,{initialHydration:!0}),k}function ee(){h&&h(),T&&T(),p.clear(),A&&A.abort(),S.fetchers.forEach((F,q)=>St(q)),S.blockers.forEach((F,q)=>yi(q))}function fe(F){return p.add(F),()=>p.delete(F)}function H(F,q){q===void 0&&(q={}),S=yt({},S,F);let U=[],X=[];f.v7_fetcherPersist&&S.fetchers.forEach((re,ge)=>{re.state==="idle"&&(Q.has(ge)?X.push(ge):U.push(ge))}),Q.forEach(re=>{!S.fetchers.has(re)&&!I.has(re)&&X.push(re)}),[...p].forEach(re=>re(S,{deletedFetchers:X,viewTransitionOpts:q.viewTransitionOpts,flushSync:q.flushSync===!0})),f.v7_fetcherPersist?(U.forEach(re=>S.fetchers.delete(re)),X.forEach(re=>St(re))):X.forEach(re=>Q.delete(re))}function je(F,q,U){var X,re;let{flushSync:ge}=U===void 0?{}:U,be=S.actionData!=null&&S.navigation.formMethod!=null&&qn(S.navigation.formMethod)&&S.navigation.state==="loading"&&((X=F.state)==null?void 0:X._isRedirect)!==!0,ue;q.actionData?Object.keys(q.actionData).length>0?ue=q.actionData:ue=null:be?ue=S.actionData:ue=null;let de=q.loaderData?rC(S.loaderData,q.loaderData,q.matches||[],q.errors):S.loaderData,oe=S.blockers;oe.size>0&&(oe=new Map(oe),oe.forEach((De,Kt)=>oe.set(Kt,Jc)));let he=E===!0||S.navigation.formMethod!=null&&qn(S.navigation.formMethod)&&((re=F.state)==null?void 0:re._isRedirect)!==!0;o&&(s=o,o=void 0),P||N===qt.Pop||(N===qt.Push?e.history.push(F,F.state):N===qt.Replace&&e.history.replace(F,F.state));let Ee;if(N===qt.Pop){let De=M.get(S.location.pathname);De&&De.has(F.pathname)?Ee={currentLocation:S.location,nextLocation:F}:M.has(F.pathname)&&(Ee={currentLocation:F,nextLocation:S.location})}else if(C){let De=M.get(S.location.pathname);De?De.add(F.pathname):(De=new Set([F.pathname]),M.set(S.location.pathname,De)),Ee={currentLocation:S.location,nextLocation:F}}H(yt({},q,{actionData:ue,loaderData:de,historyAction:N,location:F,initialized:!0,navigation:xy,revalidation:"idle",restoreScrollPosition:Gf(F,q.matches||S.matches),preventScrollReset:he,blockers:oe}),{viewTransitionOpts:Ee,flushSync:ge===!0}),N=qt.Pop,E=!1,C=!1,P=!1,D=!1,$=[]}async function ye(F,q){if(typeof F=="number"){e.history.go(F);return}let U=Zj(S.location,S.matches,l,f.v7_prependBasename,F,f.v7_relativeSplatPath,q==null?void 0:q.fromRouteId,q==null?void 0:q.relative),{path:X,submission:re,error:ge}=KP(f.v7_normalizeFormMethod,!1,U,q),be=S.location,ue=Sd(S.location,X,q&&q.state);ue=yt({},ue,e.history.encodeLocation(ue));let de=q&&q.replace!=null?q.replace:void 0,oe=qt.Push;de===!0?oe=qt.Replace:de===!1||re!=null&&qn(re.formMethod)&&re.formAction===S.location.pathname+S.location.search&&(oe=qt.Replace);let he=q&&"preventScrollReset"in q?q.preventScrollReset===!0:void 0,Ee=(q&&q.flushSync)===!0,De=xi({currentLocation:be,nextLocation:ue,historyAction:oe});if(De){vi(De,{state:"blocked",location:ue,proceed(){vi(De,{state:"proceeding",proceed:void 0,reset:void 0,location:ue}),ye(F,q)},reset(){let Kt=new Map(S.blockers);Kt.set(De,Jc),H({blockers:Kt})}});return}return await ke(oe,ue,{submission:re,pendingError:ge,preventScrollReset:he,replace:q&&q.replace,enableViewTransition:q&&q.viewTransition,flushSync:Ee})}function se(){if(Dr(),H({revalidation:"loading"}),S.navigation.state!=="submitting"){if(S.navigation.state==="idle"){ke(S.historyAction,S.location,{startUninterruptedRevalidation:!0});return}ke(N||S.historyAction,S.navigation.location,{overrideNavigation:S.navigation,enableViewTransition:C===!0})}}async function ke(F,q,U){A&&A.abort(),A=null,N=F,P=(U&&U.startUninterruptedRevalidation)===!0,Vg(S.location,S.matches),E=(U&&U.preventScrollReset)===!0,C=(U&&U.enableViewTransition)===!0;let X=o||s,re=U&&U.overrideNavigation,ge=U!=null&&U.initialHydration&&S.matches&&S.matches.length>0&&!v?S.matches:Ds(X,q,l),be=(U&&U.flushSync)===!0;if(ge&&S.initialized&&!D&&EW(S.location,q)&&!(U&&U.submission&&qn(U.submission.formMethod))){je(q,{matches:ge},{flushSync:be});return}let ue=$o(ge,X,q.pathname);if(ue.active&&ue.matches&&(ge=ue.matches),!ge){let{error:Je,notFoundMatches:Be,route:mt}=ks(q.pathname);je(q,{matches:Be,loaderData:{},errors:{[mt.id]:Je}},{flushSync:be});return}A=new AbortController;let de=Fo(e.history,q,A.signal,U&&U.submission),oe;if(U&&U.pendingError)oe=[Is(ge).route.id,{type:Xe.error,error:U.pendingError}];else if(U&&U.submission&&qn(U.submission.formMethod)){let Je=await ne(de,q,U.submission,ge,ue.active,{replace:U.replace,flushSync:be});if(Je.shortCircuited)return;if(Je.pendingActionResult){let[Be,mt]=Je.pendingActionResult;if(Xr(mt)&&kd(mt.error)&&mt.error.status===404){A=null,je(q,{matches:Je.matches,loaderData:{},errors:{[Be]:mt.error}});return}}ge=Je.matches||ge,oe=Je.pendingActionResult,re=by(q,U.submission),be=!1,ue.active=!1,de=Fo(e.history,de.url,de.signal)}let{shortCircuited:he,matches:Ee,loaderData:De,errors:Kt}=await ie(de,q,ge,ue.active,re,U&&U.submission,U&&U.fetcherSubmission,U&&U.replace,U&&U.initialHydration===!0,be,oe);he||(A=null,je(q,yt({matches:Ee||ge},nC(oe),{loaderData:De,errors:Kt})))}async function ne(F,q,U,X,re,ge){ge===void 0&&(ge={}),Dr();let be=MW(q,U);if(H({navigation:be},{flushSync:ge.flushSync===!0}),re){let oe=await Do(X,q.pathname,F.signal);if(oe.type==="aborted")return{shortCircuited:!0};if(oe.type==="error"){let he=Is(oe.partialMatches).route.id;return{matches:oe.partialMatches,pendingActionResult:[he,{type:Xe.error,error:oe.error}]}}else if(oe.matches)X=oe.matches;else{let{notFoundMatches:he,error:Ee,route:De}=ks(q.pathname);return{matches:he,pendingActionResult:[De.id,{type:Xe.error,error:Ee}]}}}let ue,de=Pu(X,q);if(!de.route.action&&!de.route.lazy)ue={type:Xe.error,error:Ir(405,{method:F.method,pathname:q.pathname,routeId:de.route.id})};else if(ue=(await Ft("action",S,F,[de],X,null))[de.route.id],F.signal.aborted)return{shortCircuited:!0};if(Bs(ue)){let oe;return ge&&ge.replace!=null?oe=ge.replace:oe=JP(ue.response.headers.get("Location"),new URL(F.url),l)===S.location.pathname+S.location.search,await ct(F,ue,!0,{submission:U,replace:oe}),{shortCircuited:!0}}if(Vi(ue))throw Ir(400,{type:"defer-action"});if(Xr(ue)){let oe=Is(X,de.route.id);return(ge&&ge.replace)!==!0&&(N=qt.Push),{matches:X,pendingActionResult:[oe.route.id,ue]}}return{matches:X,pendingActionResult:[de.route.id,ue]}}async function ie(F,q,U,X,re,ge,be,ue,de,oe,he){let Ee=re||by(q,ge),De=ge||be||sC(Ee),Kt=!P&&(!f.v7_partialHydration||!de);if(X){if(Kt){let gt=qe(he);H(yt({navigation:Ee},gt!==void 0?{actionData:gt}:{}),{flushSync:oe})}let Le=await Do(U,q.pathname,F.signal);if(Le.type==="aborted")return{shortCircuited:!0};if(Le.type==="error"){let gt=Is(Le.partialMatches).route.id;return{matches:Le.partialMatches,loaderData:{},errors:{[gt]:Le.error}}}else if(Le.matches)U=Le.matches;else{let{error:gt,notFoundMatches:ji,route:Ea}=ks(q.pathname);return{matches:ji,loaderData:{},errors:{[Ea.id]:gt}}}}let Je=o||s,[Be,mt]=XP(e.history,S,U,De,q,f.v7_partialHydration&&de===!0,f.v7_skipActionErrorRevalidation,D,$,L,Q,W,B,Je,l,he);if(Ro(Le=>!(U&&U.some(gt=>gt.route.id===Le))||Be&&Be.some(gt=>gt.route.id===Le)),z=++R,Be.length===0&&mt.length===0){let Le=la();return je(q,yt({matches:U,loaderData:{},errors:he&&Xr(he[1])?{[he[0]]:he[1].error}:null},nC(he),Le?{fetchers:new Map(S.fetchers)}:{}),{flushSync:oe}),{shortCircuited:!0}}if(Kt){let Le={};if(!X){Le.navigation=Ee;let gt=qe(he);gt!==void 0&&(Le.actionData=gt)}mt.length>0&&(Le.fetchers=rr(mt)),H(Le,{flushSync:oe})}mt.forEach(Le=>{ut(Le.key),Le.controller&&I.set(Le.key,Le.controller)});let bi=()=>mt.forEach(Le=>ut(Le.key));A&&A.signal.addEventListener("abort",bi);let{loaderResults:wi,fetcherResults:In}=await on(S,U,Be,mt,F);if(F.signal.aborted)return{shortCircuited:!0};A&&A.signal.removeEventListener("abort",bi),mt.forEach(Le=>I.delete(Le.key));let un=fh(wi);if(un)return await ct(F,un.result,!0,{replace:ue}),{shortCircuited:!0};if(un=fh(In),un)return B.add(un.key),await ct(F,un.result,!0,{replace:ue}),{shortCircuited:!0};let{loaderData:Uc,errors:_s}=tC(S,U,wi,he,mt,In,ae);ae.forEach((Le,gt)=>{Le.subscribe(ji=>{(ji||Le.done)&&ae.delete(gt)})}),f.v7_partialHydration&&de&&S.errors&&(_s=yt({},S.errors,_s));let Na=la(),Io=ln(z),Ns=Na||Io||mt.length>0;return yt({matches:U,loaderData:Uc,errors:_s},Ns?{fetchers:new Map(S.fetchers)}:{})}function qe(F){if(F&&!Xr(F[1]))return{[F[0]]:F[1].data};if(S.actionData)return Object.keys(S.actionData).length===0?null:S.actionData}function rr(F){return F.forEach(q=>{let U=S.fetchers.get(q.key),X=eu(void 0,U?U.data:void 0);S.fetchers.set(q.key,X)}),new Map(S.fetchers)}function zt(F,q,U,X){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");ut(F);let re=(X&&X.flushSync)===!0,ge=o||s,be=Zj(S.location,S.matches,l,f.v7_prependBasename,U,f.v7_relativeSplatPath,q,X==null?void 0:X.relative),ue=Ds(ge,be,l),de=$o(ue,ge,be);if(de.active&&de.matches&&(ue=de.matches),!ue){Gt(F,q,Ir(404,{pathname:be}),{flushSync:re});return}let{path:oe,submission:he,error:Ee}=KP(f.v7_normalizeFormMethod,!0,be,X);if(Ee){Gt(F,q,Ee,{flushSync:re});return}let De=Pu(ue,oe),Kt=(X&&X.preventScrollReset)===!0;if(he&&qn(he.formMethod)){lt(F,q,oe,De,ue,de.active,re,Kt,he);return}W.set(F,{routeId:q,path:oe}),rt(F,q,oe,De,ue,de.active,re,Kt,he)}async function lt(F,q,U,X,re,ge,be,ue,de){Dr(),W.delete(F);function oe(Bt){if(!Bt.route.action&&!Bt.route.lazy){let Lo=Ir(405,{method:de.formMethod,pathname:U,routeId:q});return Gt(F,q,Lo,{flushSync:be}),!0}return!1}if(!ge&&oe(X))return;let he=S.fetchers.get(F);Pt(F,RW(de,he),{flushSync:be});let Ee=new AbortController,De=Fo(e.history,U,Ee.signal,de);if(ge){let Bt=await Do(re,new URL(De.url).pathname,De.signal,F);if(Bt.type==="aborted")return;if(Bt.type==="error"){Gt(F,q,Bt.error,{flushSync:be});return}else if(Bt.matches){if(re=Bt.matches,X=Pu(re,U),oe(X))return}else{Gt(F,q,Ir(404,{pathname:U}),{flushSync:be});return}}I.set(F,Ee);let Kt=R,Be=(await Ft("action",S,De,[X],re,F))[X.route.id];if(De.signal.aborted){I.get(F)===Ee&&I.delete(F);return}if(f.v7_fetcherPersist&&Q.has(F)){if(Bs(Be)||Xr(Be)){Pt(F,Ci(void 0));return}}else{if(Bs(Be))if(I.delete(F),z>Kt){Pt(F,Ci(void 0));return}else return B.add(F),Pt(F,eu(de)),ct(De,Be,!1,{fetcherSubmission:de,preventScrollReset:ue});if(Xr(Be)){Gt(F,q,Be.error);return}}if(Vi(Be))throw Ir(400,{type:"defer-action"});let mt=S.navigation.location||S.location,bi=Fo(e.history,mt,Ee.signal),wi=o||s,In=S.navigation.state!=="idle"?Ds(wi,S.navigation.location,l):S.matches;Oe(In,"Didn't find any matches after fetcher action");let un=++R;V.set(F,un);let Uc=eu(de,Be.data);S.fetchers.set(F,Uc);let[_s,Na]=XP(e.history,S,In,de,mt,!1,f.v7_skipActionErrorRevalidation,D,$,L,Q,W,B,wi,l,[X.route.id,Be]);Na.filter(Bt=>Bt.key!==F).forEach(Bt=>{let Lo=Bt.key,RE=S.fetchers.get(Lo),cq=eu(void 0,RE?RE.data:void 0);S.fetchers.set(Lo,cq),ut(Lo),Bt.controller&&I.set(Lo,Bt.controller)}),H({fetchers:new Map(S.fetchers)});let Io=()=>Na.forEach(Bt=>ut(Bt.key));Ee.signal.addEventListener("abort",Io);let{loaderResults:Ns,fetcherResults:Le}=await on(S,In,_s,Na,bi);if(Ee.signal.aborted)return;Ee.signal.removeEventListener("abort",Io),V.delete(F),I.delete(F),Na.forEach(Bt=>I.delete(Bt.key));let gt=fh(Ns);if(gt)return ct(bi,gt.result,!1,{preventScrollReset:ue});if(gt=fh(Le),gt)return B.add(gt.key),ct(bi,gt.result,!1,{preventScrollReset:ue});let{loaderData:ji,errors:Ea}=tC(S,In,Ns,void 0,Na,Le,ae);if(S.fetchers.has(F)){let Bt=Ci(Be.data);S.fetchers.set(F,Bt)}ln(un),S.navigation.state==="loading"&&un>z?(Oe(N,"Expected pending action"),A&&A.abort(),je(S.navigation.location,{matches:In,loaderData:ji,errors:Ea,fetchers:new Map(S.fetchers)})):(H({errors:Ea,loaderData:rC(S.loaderData,ji,In,Ea),fetchers:new Map(S.fetchers)}),D=!1)}async function rt(F,q,U,X,re,ge,be,ue,de){let oe=S.fetchers.get(F);Pt(F,eu(de,oe?oe.data:void 0),{flushSync:be});let he=new AbortController,Ee=Fo(e.history,U,he.signal);if(ge){let Be=await Do(re,new URL(Ee.url).pathname,Ee.signal,F);if(Be.type==="aborted")return;if(Be.type==="error"){Gt(F,q,Be.error,{flushSync:be});return}else if(Be.matches)re=Be.matches,X=Pu(re,U);else{Gt(F,q,Ir(404,{pathname:U}),{flushSync:be});return}}I.set(F,he);let De=R,Je=(await Ft("loader",S,Ee,[X],re,F))[X.route.id];if(Vi(Je)&&(Je=await c_(Je,Ee.signal,!0)||Je),I.get(F)===he&&I.delete(F),!Ee.signal.aborted){if(Q.has(F)){Pt(F,Ci(void 0));return}if(Bs(Je))if(z>De){Pt(F,Ci(void 0));return}else{B.add(F),await ct(Ee,Je,!1,{preventScrollReset:ue});return}if(Xr(Je)){Gt(F,q,Je.error);return}Oe(!Vi(Je),"Unhandled fetcher deferred data"),Pt(F,Ci(Je.data))}}async function ct(F,q,U,X){let{submission:re,fetcherSubmission:ge,preventScrollReset:be,replace:ue}=X===void 0?{}:X;q.response.headers.has("X-Remix-Revalidate")&&(D=!0);let de=q.response.headers.get("Location");Oe(de,"Expected a Location header on the redirect Response"),de=JP(de,new URL(F.url),l);let oe=Sd(S.location,de,{_isRedirect:!0});if(r){let Be=!1;if(q.response.headers.has("X-Remix-Reload-Document"))Be=!0;else if(l_.test(de)){const mt=e.history.createURL(de);Be=mt.origin!==t.location.origin||Ja(mt.pathname,l)==null}if(Be){ue?t.location.replace(de):t.location.assign(de);return}}A=null;let he=ue===!0||q.response.headers.has("X-Remix-Replace")?qt.Replace:qt.Push,{formMethod:Ee,formAction:De,formEncType:Kt}=S.navigation;!re&&!ge&&Ee&&De&&Kt&&(re=sC(S.navigation));let Je=re||ge;if(pW.has(q.response.status)&&Je&&qn(Je.formMethod))await ke(he,oe,{submission:yt({},Je,{formAction:de}),preventScrollReset:be||E,enableViewTransition:U?C:void 0});else{let Be=by(oe,re);await ke(he,oe,{overrideNavigation:Be,fetcherSubmission:ge,preventScrollReset:be||E,enableViewTransition:U?C:void 0})}}async function Ft(F,q,U,X,re,ge){let be,ue={};try{be=await jW(c,F,q,U,X,re,ge,i,a)}catch(de){return X.forEach(oe=>{ue[oe.route.id]={type:Xe.error,error:de}}),ue}for(let[de,oe]of Object.entries(be))if(PW(oe)){let he=oe.result;ue[de]={type:Xe.redirect,response:_W(he,U,de,re,l,f.v7_relativeSplatPath)}}else ue[de]=await kW(oe);return ue}async function on(F,q,U,X,re){let ge=F.matches,be=Ft("loader",F,re,U,q,null),ue=Promise.all(X.map(async he=>{if(he.matches&&he.match&&he.controller){let De=(await Ft("loader",F,Fo(e.history,he.path,he.controller.signal),[he.match],he.matches,he.key))[he.match.route.id];return{[he.key]:De}}else return Promise.resolve({[he.key]:{type:Xe.error,error:Ir(404,{pathname:he.path})}})})),de=await be,oe=(await ue).reduce((he,Ee)=>Object.assign(he,Ee),{});return await Promise.all([TW(q,de,re.signal,ge,F.loaderData),OW(q,oe,X)]),{loaderResults:de,fetcherResults:oe}}function Dr(){D=!0,$.push(...Ro()),W.forEach((F,q)=>{I.has(q)&&L.add(q),ut(q)})}function Pt(F,q,U){U===void 0&&(U={}),S.fetchers.set(F,q),H({fetchers:new Map(S.fetchers)},{flushSync:(U&&U.flushSync)===!0})}function Gt(F,q,U,X){X===void 0&&(X={});let re=Is(S.matches,q);St(F),H({errors:{[re.route.id]:U},fetchers:new Map(S.fetchers)},{flushSync:(X&&X.flushSync)===!0})}function Dn(F){return K.set(F,(K.get(F)||0)+1),Q.has(F)&&Q.delete(F),S.fetchers.get(F)||mW}function St(F){let q=S.fetchers.get(F);I.has(F)&&!(q&&q.state==="loading"&&V.has(F))&&ut(F),W.delete(F),V.delete(F),B.delete(F),f.v7_fetcherPersist&&Q.delete(F),L.delete(F),S.fetchers.delete(F)}function yr(F){let q=(K.get(F)||0)-1;q<=0?(K.delete(F),Q.add(F),f.v7_fetcherPersist||St(F)):K.set(F,q),H({fetchers:new Map(S.fetchers)})}function ut(F){let q=I.get(F);q&&(q.abort(),I.delete(F))}function nr(F){for(let q of F){let U=Dn(q),X=Ci(U.data);S.fetchers.set(q,X)}}function la(){let F=[],q=!1;for(let U of B){let X=S.fetchers.get(U);Oe(X,"Expected fetcher: "+U),X.state==="loading"&&(B.delete(U),F.push(U),q=!0)}return nr(F),q}function ln(F){let q=[];for(let[U,X]of V)if(X<F){let re=S.fetchers.get(U);Oe(re,"Expected fetcher: "+U),re.state==="loading"&&(ut(U),V.delete(U),q.push(U))}return nr(q),q.length>0}function cn(F,q){let U=S.blockers.get(F)||Jc;return pe.get(F)!==q&&pe.set(F,q),U}function yi(F){S.blockers.delete(F),pe.delete(F)}function vi(F,q){let U=S.blockers.get(F)||Jc;Oe(U.state==="unblocked"&&q.state==="blocked"||U.state==="blocked"&&q.state==="blocked"||U.state==="blocked"&&q.state==="proceeding"||U.state==="blocked"&&q.state==="unblocked"||U.state==="proceeding"&&q.state==="unblocked","Invalid blocker state transition: "+U.state+" -> "+q.state);let X=new Map(S.blockers);X.set(F,q),H({blockers:X})}function xi(F){let{currentLocation:q,nextLocation:U,historyAction:X}=F;if(pe.size===0)return;pe.size>1&&co(!1,"A router only supports one blocker at a time");let re=Array.from(pe.entries()),[ge,be]=re[re.length-1],ue=S.blockers.get(ge);if(!(ue&&ue.state==="proceeding")&&be({currentLocation:q,nextLocation:U,historyAction:X}))return ge}function ks(F){let q=Ir(404,{pathname:F}),U=o||s,{matches:X,route:re}=aC(U);return Ro(),{notFoundMatches:X,route:re,error:q}}function Ro(F){let q=[];return ae.forEach((U,X)=>{(!F||F(X))&&(U.cancel(),q.push(X),ae.delete(X))}),q}function _a(F,q,U){if(g=F,b=q,m=U||null,!x&&S.navigation===xy){x=!0;let X=Gf(S.location,S.matches);X!=null&&H({restoreScrollPosition:X})}return()=>{g=null,b=null,m=null}}function Wf(F,q){return m&&m(F,q.map(X=>HH(X,S.loaderData)))||F.key}function Vg(F,q){if(g&&b){let U=Wf(F,q);g[U]=b()}}function Gf(F,q){if(g){let U=Wf(F,q),X=g[U];if(typeof X=="number")return X}return null}function $o(F,q,U){if(d)if(F){if(Object.keys(F[0].params).length>0)return{active:!0,matches:lp(q,U,l,!0)}}else return{active:!0,matches:lp(q,U,l,!0)||[]};return{active:!1,matches:null}}async function Do(F,q,U,X){if(!d)return{type:"success",matches:F};let re=F;for(;;){let ge=o==null,be=o||s,ue=i;try{await d({signal:U,path:q,matches:re,fetcherKey:X,patch:(he,Ee)=>{U.aborted||QP(he,Ee,be,ue,a)}})}catch(he){return{type:"error",error:he,partialMatches:re}}finally{ge&&!U.aborted&&(s=[...s])}if(U.aborted)return{type:"aborted"};let de=Ds(be,q,l);if(de)return{type:"success",matches:de};let oe=lp(be,q,l,!0);if(!oe||re.length===oe.length&&re.every((he,Ee)=>he.route.id===oe[Ee].route.id))return{type:"success",matches:null};re=oe}}function qg(F){i={},o=Bp(F,a,void 0,i)}function Ug(F,q){let U=o==null;QP(F,q,o||s,i,a),U&&(s=[...s],H({}))}return k={get basename(){return l},get future(){return f},get state(){return S},get routes(){return s},get window(){return t},initialize:Y,subscribe:fe,enableScrollRestoration:_a,navigate:ye,fetch:zt,revalidate:se,createHref:F=>e.history.createHref(F),encodeLocation:F=>e.history.encodeLocation(F),getFetcher:Dn,deleteFetcher:yr,dispose:ee,getBlocker:cn,deleteBlocker:yi,patchRoutes:Ug,_internalFetchControllers:I,_internalActiveDeferreds:ae,_internalSetRoutes:qg},k}function vW(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Zj(e,t,r,n,a,i,s,o){let l,c;if(s){l=[];for(let f of t)if(l.push(f),f.route.id===s){c=f;break}}else l=t,c=t[t.length-1];let d=o_(a||".",s_(l,i),Ja(e.pathname,r)||e.pathname,o==="path");if(a==null&&(d.search=e.search,d.hash=e.hash),(a==null||a===""||a===".")&&c){let f=u_(d.search);if(c.route.index&&!f)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&f){let h=new URLSearchParams(d.search),p=h.getAll("index");h.delete("index"),p.filter(m=>m).forEach(m=>h.append("index",m));let g=h.toString();d.search=g?"?"+g:""}}return n&&r!=="/"&&(d.pathname=d.pathname==="/"?r:qa([r,d.pathname])),uo(d)}function KP(e,t,r,n){if(!n||!vW(n))return{path:r};if(n.formMethod&&!AW(n.formMethod))return{path:r,error:Ir(405,{method:n.formMethod})};let a=()=>({path:r,error:Ir(400,{type:"invalid-body"})}),i=n.formMethod||"get",s=e?i.toUpperCase():i.toLowerCase(),o=JL(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!qn(s))return a();let h=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((p,g)=>{let[m,b]=g;return""+p+m+"="+b+`
50
- `},""):String(n.body);return{path:r,submission:{formMethod:s,formAction:o,formEncType:n.formEncType,formData:void 0,json:void 0,text:h}}}else if(n.formEncType==="application/json"){if(!qn(s))return a();try{let h=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:s,formAction:o,formEncType:n.formEncType,formData:void 0,json:h,text:void 0}}}catch{return a()}}}Oe(typeof FormData=="function","FormData is not available in this environment");let l,c;if(n.formData)l=Jj(n.formData),c=n.formData;else if(n.body instanceof FormData)l=Jj(n.body),c=n.body;else if(n.body instanceof URLSearchParams)l=n.body,c=eC(l);else if(n.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(n.body),c=eC(l)}catch{return a()}let d={formMethod:s,formAction:o,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(qn(d.formMethod))return{path:r,submission:d};let f=gs(r);return t&&f.search&&u_(f.search)&&l.append("index",""),f.search="?"+l,{path:uo(f),submission:d}}function YP(e,t,r){r===void 0&&(r=!1);let n=e.findIndex(a=>a.route.id===t);return n>=0?e.slice(0,r?n+1:n):e}function XP(e,t,r,n,a,i,s,o,l,c,d,f,h,p,g,m){let b=m?Xr(m[1])?m[1].error:m[1].data:void 0,x=e.createURL(t.location),y=e.createURL(a),v=r;i&&t.errors?v=YP(r,Object.keys(t.errors)[0],!0):m&&Xr(m[1])&&(v=YP(r,m[0]));let w=m?m[1].statusCode:void 0,j=s&&w&&w>=400,k=v.filter((N,E)=>{let{route:A}=N;if(A.lazy)return!0;if(A.loader==null)return!1;if(i)return Qj(A,t.loaderData,t.errors);if(xW(t.loaderData,t.matches[E],N)||l.some(T=>T===N.route.id))return!0;let C=t.matches[E],M=N;return ZP(N,yt({currentUrl:x,currentParams:C.params,nextUrl:y,nextParams:M.params},n,{actionResult:b,actionStatus:w,defaultShouldRevalidate:j?!1:o||x.pathname+x.search===y.pathname+y.search||x.search!==y.search||ZL(C,M)}))}),S=[];return f.forEach((N,E)=>{if(i||!r.some(P=>P.route.id===N.routeId)||d.has(E))return;let A=Ds(p,N.path,g);if(!A){S.push({key:E,routeId:N.routeId,path:N.path,matches:null,match:null,controller:null});return}let C=t.fetchers.get(E),M=Pu(A,N.path),T=!1;h.has(E)?T=!1:c.has(E)?(c.delete(E),T=!0):C&&C.state!=="idle"&&C.data===void 0?T=o:T=ZP(M,yt({currentUrl:x,currentParams:t.matches[t.matches.length-1].params,nextUrl:y,nextParams:r[r.length-1].params},n,{actionResult:b,actionStatus:w,defaultShouldRevalidate:j?!1:o})),T&&S.push({key:E,routeId:N.routeId,path:N.path,matches:A,match:M,controller:new AbortController})}),[k,S]}function Qj(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=t!=null&&t[e.id]!==void 0,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function xW(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function ZL(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function ZP(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function QP(e,t,r,n,a){var i;let s;if(e){let c=n[e];Oe(c,"No route found to patch children into: routeId = "+e),c.children||(c.children=[]),s=c.children}else s=r;let o=t.filter(c=>!s.some(d=>QL(c,d))),l=Bp(o,a,[e||"_","patch",String(((i=s)==null?void 0:i.length)||"0")],n);s.push(...l)}function QL(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,n)=>{var a;return(a=t.children)==null?void 0:a.some(i=>QL(r,i))}):!1}async function bW(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];Oe(a,"No route found in manifest");let i={};for(let s in n){let l=a[s]!==void 0&&s!=="hasErrorBoundary";co(!l,'Route "'+a.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!l&&!qH.has(s)&&(i[s]=n[s])}Object.assign(a,i),Object.assign(a,yt({},t(a),{lazy:void 0}))}async function wW(e){let{matches:t}=e,r=t.filter(a=>a.shouldLoad);return(await Promise.all(r.map(a=>a.resolve()))).reduce((a,i,s)=>Object.assign(a,{[r[s].route.id]:i}),{})}async function jW(e,t,r,n,a,i,s,o,l,c){let d=i.map(p=>p.route.lazy?bW(p.route,l,o):void 0),f=i.map((p,g)=>{let m=d[g],b=a.some(y=>y.route.id===p.route.id);return yt({},p,{shouldLoad:b,resolve:async y=>(y&&n.method==="GET"&&(p.route.lazy||p.route.loader)&&(b=!0),b?SW(t,n,p,m,y,c):Promise.resolve({type:Xe.data,result:void 0}))})}),h=await e({matches:f,request:n,params:i[0].params,fetcherKey:s,context:c});try{await Promise.all(d)}catch{}return h}async function SW(e,t,r,n,a,i){let s,o,l=c=>{let d,f=new Promise((g,m)=>d=m);o=()=>d(),t.signal.addEventListener("abort",o);let h=g=>typeof c!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):c({request:t,params:r.params,context:i},...g!==void 0?[g]:[]),p=(async()=>{try{return{type:"data",result:await(a?a(m=>h(m)):h())}}catch(g){return{type:"error",result:g}}})();return Promise.race([p,f])};try{let c=r.route[e];if(n)if(c){let d,[f]=await Promise.all([l(c).catch(h=>{d=h}),n]);if(d!==void 0)throw d;s=f}else if(await n,c=r.route[e],c)s=await l(c);else if(e==="action"){let d=new URL(t.url),f=d.pathname+d.search;throw Ir(405,{method:t.method,pathname:f,routeId:r.route.id})}else return{type:Xe.data,result:void 0};else if(c)s=await l(c);else{let d=new URL(t.url),f=d.pathname+d.search;throw Ir(404,{pathname:f})}Oe(s.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(c){return{type:Xe.error,result:c}}finally{o&&t.signal.removeEventListener("abort",o)}return s}async function kW(e){let{result:t,type:r}=e;if(e6(t)){let f;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?f=null:f=await t.json():f=await t.text()}catch(h){return{type:Xe.error,error:h}}return r===Xe.error?{type:Xe.error,error:new qp(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:Xe.data,data:f,statusCode:t.status,headers:t.headers}}if(r===Xe.error){if(iC(t)){var n,a;if(t.data instanceof Error){var i,s;return{type:Xe.error,error:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}}return{type:Xe.error,error:new qp(((n=t.init)==null?void 0:n.status)||500,void 0,t.data),statusCode:kd(t)?t.status:void 0,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:Xe.error,error:t,statusCode:kd(t)?t.status:void 0}}if(CW(t)){var o,l;return{type:Xe.deferred,deferredData:t,statusCode:(o=t.init)==null?void 0:o.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}if(iC(t)){var c,d;return{type:Xe.data,data:t.data,statusCode:(c=t.init)==null?void 0:c.status,headers:(d=t.init)!=null&&d.headers?new Headers(t.init.headers):void 0}}return{type:Xe.data,data:t}}function _W(e,t,r,n,a,i){let s=e.headers.get("Location");if(Oe(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!l_.test(s)){let o=n.slice(0,n.findIndex(l=>l.route.id===r)+1);s=Zj(new URL(t.url),o,a,!0,s,i),e.headers.set("Location",s)}return e}function JP(e,t,r){if(l_.test(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),i=Ja(a.pathname,r)!=null;if(a.origin===t.origin&&i)return a.pathname+a.search+a.hash}return e}function Fo(e,t,r,n){let a=e.createURL(JL(t)).toString(),i={signal:r};if(n&&qn(n.formMethod)){let{formMethod:s,formEncType:o}=n;i.method=s.toUpperCase(),o==="application/json"?(i.headers=new Headers({"Content-Type":o}),i.body=JSON.stringify(n.json)):o==="text/plain"?i.body=n.text:o==="application/x-www-form-urlencoded"&&n.formData?i.body=Jj(n.formData):i.body=n.formData}return new Request(a,i)}function Jj(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function eC(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function NW(e,t,r,n,a){let i={},s=null,o,l=!1,c={},d=r&&Xr(r[1])?r[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let h=f.route.id,p=t[h];if(Oe(!Bs(p),"Cannot handle redirect results in processLoaderData"),Xr(p)){let g=p.error;d!==void 0&&(g=d,d=void 0),s=s||{};{let m=Is(e,h);s[m.route.id]==null&&(s[m.route.id]=g)}i[h]=void 0,l||(l=!0,o=kd(p.error)?p.error.status:500),p.headers&&(c[h]=p.headers)}else Vi(p)?(n.set(h,p.deferredData),i[h]=p.deferredData.data,p.statusCode!=null&&p.statusCode!==200&&!l&&(o=p.statusCode),p.headers&&(c[h]=p.headers)):(i[h]=p.data,p.statusCode&&p.statusCode!==200&&!l&&(o=p.statusCode),p.headers&&(c[h]=p.headers))}),d!==void 0&&r&&(s={[r[0]]:d},i[r[0]]=void 0),{loaderData:i,errors:s,statusCode:o||200,loaderHeaders:c}}function tC(e,t,r,n,a,i,s){let{loaderData:o,errors:l}=NW(t,r,n,s);return a.forEach(c=>{let{key:d,match:f,controller:h}=c,p=i[d];if(Oe(p,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(Xr(p)){let g=Is(e.matches,f==null?void 0:f.route.id);l&&l[g.route.id]||(l=yt({},l,{[g.route.id]:p.error})),e.fetchers.delete(d)}else if(Bs(p))Oe(!1,"Unhandled fetcher revalidation redirect");else if(Vi(p))Oe(!1,"Unhandled fetcher deferred data");else{let g=Ci(p.data);e.fetchers.set(d,g)}}),{loaderData:o,errors:l}}function rC(e,t,r,n){let a=yt({},t);for(let i of r){let s=i.route.id;if(t.hasOwnProperty(s)?t[s]!==void 0&&(a[s]=t[s]):e[s]!==void 0&&i.route.loader&&(a[s]=e[s]),n&&n.hasOwnProperty(s))break}return a}function nC(e){return e?Xr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Is(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function aC(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ir(e,t){let{pathname:r,routeId:n,method:a,type:i,message:s}=t===void 0?{}:t,o="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(o="Bad Request",a&&r&&n?l="You made a "+a+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":i==="defer-action"?l="defer() is not supported in actions":i==="invalid-body"&&(l="Unable to encode submission body")):e===403?(o="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):e===404?(o="Not Found",l='No route matches URL "'+r+'"'):e===405&&(o="Method Not Allowed",a&&r&&n?l="You made a "+a.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":a&&(l='Invalid request method "'+a.toUpperCase()+'"')),new qp(e||500,o,new Error(l),!0)}function fh(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(Bs(a))return{key:n,result:a}}}function JL(e){let t=typeof e=="string"?gs(e):e;return uo(yt({},t,{hash:""}))}function EW(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function PW(e){return e6(e.result)&&hW.has(e.result.status)}function Vi(e){return e.type===Xe.deferred}function Xr(e){return e.type===Xe.error}function Bs(e){return(e&&e.type)===Xe.redirect}function iC(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function CW(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function e6(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function AW(e){return fW.has(e.toLowerCase())}function qn(e){return uW.has(e.toLowerCase())}async function TW(e,t,r,n,a){let i=Object.entries(t);for(let s=0;s<i.length;s++){let[o,l]=i[s],c=e.find(h=>(h==null?void 0:h.route.id)===o);if(!c)continue;let d=n.find(h=>h.route.id===c.route.id),f=d!=null&&!ZL(d,c)&&(a&&a[c.route.id])!==void 0;Vi(l)&&f&&await c_(l,r,!1).then(h=>{h&&(t[o]=h)})}}async function OW(e,t,r){for(let n=0;n<r.length;n++){let{key:a,routeId:i,controller:s}=r[n],o=t[a];e.find(c=>(c==null?void 0:c.route.id)===i)&&Vi(o)&&(Oe(s,"Expected an AbortController for revalidating fetcher deferred result"),await c_(o,s.signal,!0).then(c=>{c&&(t[a]=c)}))}}async function c_(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:Xe.data,data:e.deferredData.unwrappedData}}catch(a){return{type:Xe.error,error:a}}return{type:Xe.data,data:e.deferredData.data}}}function u_(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Pu(e,t){let r=typeof t=="string"?gs(t).search:t.search;if(e[e.length-1].route.index&&u_(r||""))return e[e.length-1];let n=KL(e);return n[n.length-1]}function sC(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:i,json:s}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(i!=null)return{formMethod:t,formAction:r,formEncType:n,formData:i,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:s,text:void 0}}}function by(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function MW(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function eu(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function RW(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Ci(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function $W(e,t){try{let r=e.sessionStorage.getItem(XL);if(r){let n=JSON.parse(r);for(let[a,i]of Object.entries(n||{}))i&&Array.isArray(i)&&t.set(a,new Set(i||[]))}}catch{}}function DW(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(XL,JSON.stringify(r))}catch(n){co(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/**
51
- * React Router v6.30.2
52
- *
53
- * Copyright (c) Remix Software Inc.
54
- *
55
- * This source code is licensed under the MIT license found in the
56
- * LICENSE.md file in the root directory of this source tree.
57
- *
58
- * @license MIT
59
- */function Up(){return Up=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},Up.apply(this,arguments)}const kf=_.createContext(null),d_=_.createContext(null),ys=_.createContext(null),f_=_.createContext(null),di=_.createContext({outlet:null,matches:[],isDataRoute:!1}),t6=_.createContext(null);function IW(e,t){let{relative:r}=t===void 0?{}:t;_f()||Oe(!1);let{basename:n,navigator:a}=_.useContext(ys),{hash:i,pathname:s,search:o}=N0(e,{relative:r}),l=s;return n!=="/"&&(l=s==="/"?n:qa([n,s])),a.createHref({pathname:l,search:o,hash:i})}function _f(){return _.useContext(f_)!=null}function vs(){return _f()||Oe(!1),_.useContext(f_).location}function r6(e){_.useContext(ys).static||_.useLayoutEffect(e)}function h_(){let{isDataRoute:e}=_.useContext(di);return e?ZW():LW()}function LW(){_f()||Oe(!1);let e=_.useContext(kf),{basename:t,future:r,navigator:n}=_.useContext(ys),{matches:a}=_.useContext(di),{pathname:i}=vs(),s=JSON.stringify(s_(a,r.v7_relativeSplatPath)),o=_.useRef(!1);return r6(()=>{o.current=!0}),_.useCallback(function(c,d){if(d===void 0&&(d={}),!o.current)return;if(typeof c=="number"){n.go(c);return}let f=o_(c,JSON.parse(s),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:qa([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,s,i,e])}const zW=_.createContext(null);function FW(e){let t=_.useContext(di).outlet;return t&&_.createElement(zW.Provider,{value:e},t)}function p_(){let{matches:e}=_.useContext(di),t=e[e.length-1];return t?t.params:{}}function N0(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=_.useContext(ys),{matches:a}=_.useContext(di),{pathname:i}=vs(),s=JSON.stringify(s_(a,n.v7_relativeSplatPath));return _.useMemo(()=>o_(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}function BW(e,t,r,n){_f()||Oe(!1);let{navigator:a}=_.useContext(ys),{matches:i}=_.useContext(di),s=i[i.length-1],o=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let c=vs(),d;d=c;let f=d.pathname||"/",h=f;if(l!=="/"){let m=l.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(m.length).join("/")}let p=Ds(e,{pathname:h});return WW(p&&p.map(m=>Object.assign({},m,{params:Object.assign({},o,m.params),pathname:qa([l,a.encodeLocation?a.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?l:qa([l,a.encodeLocation?a.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),i,r,n)}function VW(){let e=XW(),t=kd(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return _.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},t),r?_.createElement("pre",{style:a},r):null,null)}const qW=_.createElement(VW,null);class UW extends _.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?_.createElement(di.Provider,{value:this.props.routeContext},_.createElement(t6.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function HW(e){let{routeContext:t,match:r,children:n}=e,a=_.useContext(kf);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),_.createElement(di.Provider,{value:t},n)}function WW(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,o=(a=r)==null?void 0:a.errors;if(o!=null){let d=s.findIndex(f=>f.route.id&&(o==null?void 0:o[f.route.id])!==void 0);d>=0||Oe(!1),s=s.slice(0,Math.min(s.length,d+1))}let l=!1,c=-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)&&(c=d),f.route.id){let{loaderData:h,errors:p}=r,g=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||g){l=!0,c>=0?s=s.slice(0,c+1):s=[s[0]];break}}}return s.reduceRight((d,f,h)=>{let p,g=!1,m=null,b=null;r&&(p=o&&f.route.id?o[f.route.id]:void 0,m=f.route.errorElement||qW,l&&(c<0&&h===0?(QW("route-fallback"),g=!0,b=null):c===h&&(g=!0,b=f.route.hydrateFallbackElement||null)));let x=t.concat(s.slice(0,h+1)),y=()=>{let v;return p?v=m:g?v=b:f.route.Component?v=_.createElement(f.route.Component,null):f.route.element?v=f.route.element:v=d,_.createElement(HW,{match:f,routeContext:{outlet:d,matches:x,isDataRoute:r!=null},children:v})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?_.createElement(UW,{location:r.location,revalidation:r.revalidation,component:m,error:p,children:y(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):y()},null)}var n6=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(n6||{}),a6=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}(a6||{});function GW(e){let t=_.useContext(kf);return t||Oe(!1),t}function KW(e){let t=_.useContext(d_);return t||Oe(!1),t}function YW(e){let t=_.useContext(di);return t||Oe(!1),t}function i6(e){let t=YW(),r=t.matches[t.matches.length-1];return r.route.id||Oe(!1),r.route.id}function XW(){var e;let t=_.useContext(t6),r=KW(a6.UseRouteError),n=i6();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function ZW(){let{router:e}=GW(n6.UseNavigateStable),t=i6(),r=_.useRef(!1);return r6(()=>{r.current=!0}),_.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Up({fromRouteId:t},i)))},[e,t])}const oC={};function QW(e,t,r){oC[e]||(oC[e]=!0)}function JW(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function eG(e){return FW(e.context)}function tG(e){let{basename:t="/",children:r=null,location:n,navigationType:a=qt.Pop,navigator:i,static:s=!1,future:o}=e;_f()&&Oe(!1);let l=t.replace(/^\/*/,"/"),c=_.useMemo(()=>({basename:l,navigator:i,static:s,future:Up({v7_relativeSplatPath:!1},o)}),[l,o,i,s]);typeof n=="string"&&(n=gs(n));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=n,m=_.useMemo(()=>{let b=Ja(d,l);return b==null?null:{location:{pathname:b,search:f,hash:h,state:p,key:g},navigationType:a}},[l,d,f,h,p,g,a]);return m==null?null:_.createElement(ys.Provider,{value:c},_.createElement(f_.Provider,{children:r,value:m}))}new Promise(()=>{});function rG(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:_.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:_.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:_.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
60
- * React Router DOM v6.30.2
61
- *
62
- * Copyright (c) Remix Software Inc.
63
- *
64
- * This source code is licensed under the MIT license found in the
65
- * LICENSE.md file in the root directory of this source tree.
66
- *
67
- * @license MIT
68
- */function Vl(){return Vl=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},Vl.apply(this,arguments)}function s6(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function nG(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function aG(e,t){return e.button===0&&(!t||t==="_self")&&!nG(e)}function eS(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function iG(e,t){let r=eS(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(i=>{r.append(a,i)})}),r}const sG=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],oG=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],lG="6";try{window.__reactRouterVersion=lG}catch{}function cG(e,t){return yW({basename:void 0,future:Vl({},void 0,{v7_prependBasename:!0}),history:FH({window:void 0}),hydrationData:uG(),routes:e,mapRouteProperties:rG,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function uG(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Vl({},t,{errors:dG(t.errors)})),t}function dG(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&a.__type==="RouteErrorResponse")r[n]=new qp(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let i=window[a.__subType];if(typeof i=="function")try{let s=new i(a.message);s.stack="",r[n]=s}catch{}}if(r[n]==null){let i=new Error(a.message);i.stack="",r[n]=i}}else r[n]=a;return r}const o6=_.createContext({isTransitioning:!1}),fG=_.createContext(new Map),hG="startTransition",lC=Eq[hG],pG="flushSync",cC=zH[pG];function mG(e){lC?lC(e):e()}function tu(e){cC?cC(e):e()}class gG{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function yG(e){let{fallbackElement:t,router:r,future:n}=e,[a,i]=_.useState(r.state),[s,o]=_.useState(),[l,c]=_.useState({isTransitioning:!1}),[d,f]=_.useState(),[h,p]=_.useState(),[g,m]=_.useState(),b=_.useRef(new Map),{v7_startTransition:x}=n||{},y=_.useCallback(N=>{x?mG(N):N()},[x]),v=_.useCallback((N,E)=>{let{deletedFetchers:A,flushSync:C,viewTransitionOpts:M}=E;N.fetchers.forEach((P,D)=>{P.data!==void 0&&b.current.set(D,P.data)}),A.forEach(P=>b.current.delete(P));let T=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!M||T){C?tu(()=>i(N)):y(()=>i(N));return}if(C){tu(()=>{h&&(d&&d.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:M.currentLocation,nextLocation:M.nextLocation})});let P=r.window.document.startViewTransition(()=>{tu(()=>i(N))});P.finished.finally(()=>{tu(()=>{f(void 0),p(void 0),o(void 0),c({isTransitioning:!1})})}),tu(()=>p(P));return}h?(d&&d.resolve(),h.skipTransition(),m({state:N,currentLocation:M.currentLocation,nextLocation:M.nextLocation})):(o(N),c({isTransitioning:!0,flushSync:!1,currentLocation:M.currentLocation,nextLocation:M.nextLocation}))},[r.window,h,d,b,y]);_.useLayoutEffect(()=>r.subscribe(v),[r,v]),_.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new gG)},[l]),_.useEffect(()=>{if(d&&s&&r.window){let N=s,E=d.promise,A=r.window.document.startViewTransition(async()=>{y(()=>i(N)),await E});A.finished.finally(()=>{f(void 0),p(void 0),o(void 0),c({isTransitioning:!1})}),p(A)}},[y,s,d,r.window]),_.useEffect(()=>{d&&s&&a.location.key===s.location.key&&d.resolve()},[d,h,a.location,s]),_.useEffect(()=>{!l.isTransitioning&&g&&(o(g.state),c({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),m(void 0))},[l.isTransitioning,g]),_.useEffect(()=>{},[]);let w=_.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:N=>r.navigate(N),push:(N,E,A)=>r.navigate(N,{state:E,preventScrollReset:A==null?void 0:A.preventScrollReset}),replace:(N,E,A)=>r.navigate(N,{replace:!0,state:E,preventScrollReset:A==null?void 0:A.preventScrollReset})}),[r]),j=r.basename||"/",k=_.useMemo(()=>({router:r,navigator:w,static:!1,basename:j}),[r,w,j]),S=_.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return _.useEffect(()=>JW(n,r.future),[n,r.future]),_.createElement(_.Fragment,null,_.createElement(kf.Provider,{value:k},_.createElement(d_.Provider,{value:a},_.createElement(fG.Provider,{value:b.current},_.createElement(o6.Provider,{value:l},_.createElement(tG,{basename:j,location:a.location,navigationType:a.historyAction,navigator:w,future:S},a.initialized||r.future.v7_partialHydration?_.createElement(vG,{routes:r.routes,future:r.future,state:a}):t))))),null)}const vG=_.memo(xG);function xG(e){let{routes:t,future:r,state:n}=e;return BW(t,void 0,n,r)}const bG=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wG=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,st=_.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:i,replace:s,state:o,target:l,to:c,preventScrollReset:d,viewTransition:f}=t,h=s6(t,sG),{basename:p}=_.useContext(ys),g,m=!1;if(typeof c=="string"&&wG.test(c)&&(g=c,bG))try{let v=new URL(window.location.href),w=c.startsWith("//")?new URL(v.protocol+c):new URL(c),j=Ja(w.pathname,p);w.origin===v.origin&&j!=null?c=j+w.search+w.hash:m=!0}catch{}let b=IW(c,{relative:a}),x=kG(c,{replace:s,state:o,target:l,preventScrollReset:d,relative:a,viewTransition:f});function y(v){n&&n(v),v.defaultPrevented||x(v)}return _.createElement("a",Vl({},h,{href:g||b,onClick:m||i?n:y,ref:r,target:l}))}),jG=_.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:a=!1,className:i="",end:s=!1,style:o,to:l,viewTransition:c,children:d}=t,f=s6(t,oG),h=N0(l,{relative:f.relative}),p=vs(),g=_.useContext(d_),{navigator:m,basename:b}=_.useContext(ys),x=g!=null&&NG(h)&&c===!0,y=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,v=p.pathname,w=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;a||(v=v.toLowerCase(),w=w?w.toLowerCase():null,y=y.toLowerCase()),w&&b&&(w=Ja(w,b)||w);const j=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let k=v===y||!s&&v.startsWith(y)&&v.charAt(j)==="/",S=w!=null&&(w===y||!s&&w.startsWith(y)&&w.charAt(y.length)==="/"),N={isActive:k,isPending:S,isTransitioning:x},E=k?n:void 0,A;typeof i=="function"?A=i(N):A=[i,k?"active":null,S?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let C=typeof o=="function"?o(N):o;return _.createElement(st,Vl({},f,{"aria-current":E,className:A,ref:r,style:C,to:l,viewTransition:c}),typeof d=="function"?d(N):d)});var tS;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(tS||(tS={}));var uC;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(uC||(uC={}));function SG(e){let t=_.useContext(kf);return t||Oe(!1),t}function kG(e,t){let{target:r,replace:n,state:a,preventScrollReset:i,relative:s,viewTransition:o}=t===void 0?{}:t,l=h_(),c=vs(),d=N0(e,{relative:s});return _.useCallback(f=>{if(aG(f,r)){f.preventDefault();let h=n!==void 0?n:uo(c)===uo(d);l(e,{replace:h,state:a,preventScrollReset:i,relative:s,viewTransition:o})}},[c,l,d,n,a,r,e,i,s,o])}function _G(e){let t=_.useRef(eS(e)),r=_.useRef(!1),n=vs(),a=_.useMemo(()=>iG(n.search,r.current?null:t.current),[n.search]),i=h_(),s=_.useCallback((o,l)=>{const c=eS(typeof o=="function"?o(a):o);r.current=!0,i("?"+c,l)},[i,a]);return[a,s]}function NG(e,t){t===void 0&&(t={});let r=_.useContext(o6);r==null&&Oe(!1);let{basename:n}=SG(tS.useViewTransitionState),a=N0(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=Ja(r.currentLocation.pathname,n)||r.currentLocation.pathname,s=Ja(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Vp(a.pathname,s)!=null||Vp(a.pathname,i)!=null}const l6=_.createContext();function EG({children:e}){const[t,r]=_.useState(()=>{const a=localStorage.getItem("flowyml-theme");return a?(document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(a),a):window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?(document.documentElement.classList.remove("light"),document.documentElement.classList.add("dark"),"dark"):(document.documentElement.classList.remove("dark"),document.documentElement.classList.add("light"),"light")});_.useEffect(()=>{document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(t),localStorage.setItem("flowyml-theme",t)},[t]);const n=()=>{r(a=>a==="light"?"dark":"light")};return u.jsx(l6.Provider,{value:{theme:t,setTheme:r,toggleTheme:n},children:e})}function PG(){const e=_.useContext(l6);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const c6=_.createContext();function CG({children:e}){const[t,r]=_.useState(()=>localStorage.getItem("flowyml-selected-project")||null),[n,a]=_.useState([]),[i,s]=_.useState(!0);_.useEffect(()=>{fetch("/api/projects/").then(d=>d.json()).then(d=>{a(d.projects||[]),s(!1)}).catch(d=>{console.error("Failed to fetch projects:",d),s(!1)})},[]),_.useEffect(()=>{t?localStorage.setItem("flowyml-selected-project",t):localStorage.removeItem("flowyml-selected-project")},[t]);const o=d=>{r(d)},l=()=>{r(null)},c=async()=>{s(!0);try{const f=await(await fetch("/api/projects/")).json();a(f.projects||[])}catch(d){console.error("Failed to refresh projects:",d)}finally{s(!1)}};return u.jsx(c6.Provider,{value:{selectedProject:t,projects:n,loading:i,selectProject:o,clearProject:l,refreshProjects:c},children:e})}function fi(){const e=_.useContext(c6);if(!e)throw new Error("useProject must be used within ProjectProvider");return e}/**
69
- * @license lucide-react v0.344.0 - ISC
70
- *
71
- * This source code is licensed under the ISC license.
72
- * See the LICENSE file in the root directory of this source tree.
73
- */var AG={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"};/**
74
- * @license lucide-react v0.344.0 - ISC
75
- *
76
- * This source code is licensed under the ISC license.
77
- * See the LICENSE file in the root directory of this source tree.
78
- */const TG=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),te=(e,t)=>{const r=_.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:s,className:o="",children:l,...c},d)=>_.createElement("svg",{ref:d,...AG,width:a,height:a,stroke:n,strokeWidth:s?Number(i)*24/Number(a):i,className:["lucide",`lucide-${TG(e)}`,o].join(" "),...c},[...t.map(([f,h])=>_.createElement(f,h)),...Array.isArray(l)?l:[l]]));return r.displayName=`${e}`,r};/**
79
- * @license lucide-react v0.344.0 - ISC
80
- *
81
- * This source code is licensed under the ISC license.
82
- * See the LICENSE file in the root directory of this source tree.
83
- */const Ge=te("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/**
84
- * @license lucide-react v0.344.0 - ISC
85
- *
86
- * This source code is licensed under the ISC license.
87
- * See the LICENSE file in the root directory of this source tree.
88
- */const Sc=te("AlertCircle",[["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"}]]);/**
89
- * @license lucide-react v0.344.0 - ISC
90
- *
91
- * This source code is licensed under the ISC license.
92
- * See the LICENSE file in the root directory of this source tree.
93
- */const OG=te("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
94
- * @license lucide-react v0.344.0 - ISC
95
- *
96
- * This source code is licensed under the ISC license.
97
- * See the LICENSE file in the root directory of this source tree.
98
- */const MG=te("ArrowDownCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"m8 12 4 4 4-4",key:"k98ssh"}]]);/**
99
- * @license lucide-react v0.344.0 - ISC
100
- *
101
- * This source code is licensed under the ISC license.
102
- * See the LICENSE file in the root directory of this source tree.
103
- */const is=te("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
104
- * @license lucide-react v0.344.0 - ISC
105
- *
106
- * This source code is licensed under the ISC license.
107
- * See the LICENSE file in the root directory of this source tree.
108
- */const RG=te("ArrowUpCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
109
- * @license lucide-react v0.344.0 - ISC
110
- *
111
- * This source code is licensed under the ISC license.
112
- * See the LICENSE file in the root directory of this source tree.
113
- */const $G=te("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
114
- * @license lucide-react v0.344.0 - ISC
115
- *
116
- * This source code is licensed under the ISC license.
117
- * See the LICENSE file in the root directory of this source tree.
118
- */const wa=te("BarChart2",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
119
- * @license lucide-react v0.344.0 - ISC
120
- *
121
- * This source code is licensed under the ISC license.
122
- * See the LICENSE file in the root directory of this source tree.
123
- */const DG=te("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
124
- * @license lucide-react v0.344.0 - ISC
125
- *
126
- * This source code is licensed under the ISC license.
127
- * See the LICENSE file in the root directory of this source tree.
128
- */const Nr=te("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
129
- * @license lucide-react v0.344.0 - ISC
130
- *
131
- * This source code is licensed under the ISC license.
132
- * See the LICENSE file in the root directory of this source tree.
133
- */const IG=te("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
134
- * @license lucide-react v0.344.0 - ISC
135
- *
136
- * This source code is licensed under the ISC license.
137
- * See the LICENSE file in the root directory of this source tree.
138
- */const kn=te("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
139
- * @license lucide-react v0.344.0 - ISC
140
- *
141
- * This source code is licensed under the ISC license.
142
- * See the LICENSE file in the root directory of this source tree.
143
- */const LG=te("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
144
- * @license lucide-react v0.344.0 - ISC
145
- *
146
- * This source code is licensed under the ISC license.
147
- * See the LICENSE file in the root directory of this source tree.
148
- */const Lt=te("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
149
- * @license lucide-react v0.344.0 - ISC
150
- *
151
- * This source code is licensed under the ISC license.
152
- * See the LICENSE file in the root directory of this source tree.
153
- */const m_=te("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
154
- * @license lucide-react v0.344.0 - ISC
155
- *
156
- * This source code is licensed under the ISC license.
157
- * See the LICENSE file in the root directory of this source tree.
158
- */const u6=te("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
159
- * @license lucide-react v0.344.0 - ISC
160
- *
161
- * This source code is licensed under the ISC license.
162
- * See the LICENSE file in the root directory of this source tree.
163
- */const zG=te("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
164
- * @license lucide-react v0.344.0 - ISC
165
- *
166
- * This source code is licensed under the ISC license.
167
- * See the LICENSE file in the root directory of this source tree.
168
- */const fo=te("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
169
- * @license lucide-react v0.344.0 - ISC
170
- *
171
- * This source code is licensed under the ISC license.
172
- * See the LICENSE file in the root directory of this source tree.
173
- */const tt=te("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
174
- * @license lucide-react v0.344.0 - ISC
175
- *
176
- * This source code is licensed under the ISC license.
177
- * See the LICENSE file in the root directory of this source tree.
178
- */const FG=te("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
179
- * @license lucide-react v0.344.0 - ISC
180
- *
181
- * This source code is licensed under the ISC license.
182
- * See the LICENSE file in the root directory of this source tree.
183
- */const BG=te("Code2",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
184
- * @license lucide-react v0.344.0 - ISC
185
- *
186
- * This source code is licensed under the ISC license.
187
- * See the LICENSE file in the root directory of this source tree.
188
- */const Hp=te("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
189
- * @license lucide-react v0.344.0 - ISC
190
- *
191
- * This source code is licensed under the ISC license.
192
- * See the LICENSE file in the root directory of this source tree.
193
- */const Tr=te("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
194
- * @license lucide-react v0.344.0 - ISC
195
- *
196
- * This source code is licensed under the ISC license.
197
- * See the LICENSE file in the root directory of this source tree.
198
- */const VG=te("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
199
- * @license lucide-react v0.344.0 - ISC
200
- *
201
- * This source code is licensed under the ISC license.
202
- * See the LICENSE file in the root directory of this source tree.
203
- */const _o=te("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
204
- * @license lucide-react v0.344.0 - ISC
205
- *
206
- * This source code is licensed under the ISC license.
207
- * See the LICENSE file in the root directory of this source tree.
208
- */const Yu=te("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
209
- * @license lucide-react v0.344.0 - ISC
210
- *
211
- * This source code is licensed under the ISC license.
212
- * See the LICENSE file in the root directory of this source tree.
213
- */const qG=te("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
214
- * @license lucide-react v0.344.0 - ISC
215
- *
216
- * This source code is licensed under the ISC license.
217
- * See the LICENSE file in the root directory of this source tree.
218
- */const E0=te("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
219
- * @license lucide-react v0.344.0 - ISC
220
- *
221
- * This source code is licensed under the ISC license.
222
- * See the LICENSE file in the root directory of this source tree.
223
- */const _l=te("FileBox",[["path",{d:"M14.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"16lz6z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 13.1a2 2 0 0 0-1 1.76v3.24a2 2 0 0 0 .97 1.78L6 21.7a2 2 0 0 0 2.03.01L11 19.9a2 2 0 0 0 1-1.76V14.9a2 2 0 0 0-.97-1.78L8 11.3a2 2 0 0 0-2.03-.01Z",key:"99pj1s"}],["path",{d:"M7 17v5",key:"1yj1jh"}],["path",{d:"M11.7 14.2 7 17l-4.7-2.8",key:"1yk8tc"}]]);/**
224
- * @license lucide-react v0.344.0 - ISC
225
- *
226
- * This source code is licensed under the ISC license.
227
- * See the LICENSE file in the root directory of this source tree.
228
- */const ql=te("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
229
- * @license lucide-react v0.344.0 - ISC
230
- *
231
- * This source code is licensed under the ISC license.
232
- * See the LICENSE file in the root directory of this source tree.
233
- */const d6=te("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
234
- * @license lucide-react v0.344.0 - ISC
235
- *
236
- * This source code is licensed under the ISC license.
237
- * See the LICENSE file in the root directory of this source tree.
238
- */const ea=te("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
239
- * @license lucide-react v0.344.0 - ISC
240
- *
241
- * This source code is licensed under the ISC license.
242
- * See the LICENSE file in the root directory of this source tree.
243
- */const UG=te("FolderKanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);/**
244
- * @license lucide-react v0.344.0 - ISC
245
- *
246
- * This source code is licensed under the ISC license.
247
- * See the LICENSE file in the root directory of this source tree.
248
- */const dC=te("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"}]]);/**
249
- * @license lucide-react v0.344.0 - ISC
250
- *
251
- * This source code is licensed under the ISC license.
252
- * See the LICENSE file in the root directory of this source tree.
253
- */const HG=te("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
254
- * @license lucide-react v0.344.0 - ISC
255
- *
256
- * This source code is licensed under the ISC license.
257
- * See the LICENSE file in the root directory of this source tree.
258
- */const Ua=te("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
259
- * @license lucide-react v0.344.0 - ISC
260
- *
261
- * This source code is licensed under the ISC license.
262
- * See the LICENSE file in the root directory of this source tree.
263
- */const _d=te("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"}]]);/**
264
- * @license lucide-react v0.344.0 - ISC
265
- *
266
- * This source code is licensed under the ISC license.
267
- * See the LICENSE file in the root directory of this source tree.
268
- */const Wp=te("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
269
- * @license lucide-react v0.344.0 - ISC
270
- *
271
- * This source code is licensed under the ISC license.
272
- * See the LICENSE file in the root directory of this source tree.
273
- */const WG=te("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
274
- * @license lucide-react v0.344.0 - ISC
275
- *
276
- * This source code is licensed under the ISC license.
277
- * See the LICENSE file in the root directory of this source tree.
278
- */const g_=te("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
279
- * @license lucide-react v0.344.0 - ISC
280
- *
281
- * This source code is licensed under the ISC license.
282
- * See the LICENSE file in the root directory of this source tree.
283
- */const wy=te("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
284
- * @license lucide-react v0.344.0 - ISC
285
- *
286
- * This source code is licensed under the ISC license.
287
- * See the LICENSE file in the root directory of this source tree.
288
- */const GG=te("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);/**
289
- * @license lucide-react v0.344.0 - ISC
290
- *
291
- * This source code is licensed under the ISC license.
292
- * See the LICENSE file in the root directory of this source tree.
293
- */const Gp=te("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
294
- * @license lucide-react v0.344.0 - ISC
295
- *
296
- * This source code is licensed under the ISC license.
297
- * See the LICENSE file in the root directory of this source tree.
298
- */const Nl=te("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/**
299
- * @license lucide-react v0.344.0 - ISC
300
- *
301
- * This source code is licensed under the ISC license.
302
- * See the LICENSE file in the root directory of this source tree.
303
- */const ja=te("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
304
- * @license lucide-react v0.344.0 - ISC
305
- *
306
- * This source code is licensed under the ISC license.
307
- * See the LICENSE file in the root directory of this source tree.
308
- */const f6=te("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
309
- * @license lucide-react v0.344.0 - ISC
310
- *
311
- * This source code is licensed under the ISC license.
312
- * See the LICENSE file in the root directory of this source tree.
313
- */const KG=te("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
314
- * @license lucide-react v0.344.0 - ISC
315
- *
316
- * This source code is licensed under the ISC license.
317
- * See the LICENSE file in the root directory of this source tree.
318
- */const YG=te("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
319
- * @license lucide-react v0.344.0 - ISC
320
- *
321
- * This source code is licensed under the ISC license.
322
- * See the LICENSE file in the root directory of this source tree.
323
- */const h6=te("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/**
324
- * @license lucide-react v0.344.0 - ISC
325
- *
326
- * This source code is licensed under the ISC license.
327
- * See the LICENSE file in the root directory of this source tree.
328
- */const Ul=te("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
329
- * @license lucide-react v0.344.0 - ISC
330
- *
331
- * This source code is licensed under the ISC license.
332
- * See the LICENSE file in the root directory of this source tree.
333
- */const p6=te("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]]);/**
334
- * @license lucide-react v0.344.0 - ISC
335
- *
336
- * This source code is licensed under the ISC license.
337
- * See the LICENSE file in the root directory of this source tree.
338
- */const XG=te("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
339
- * @license lucide-react v0.344.0 - ISC
340
- *
341
- * This source code is licensed under the ISC license.
342
- * See the LICENSE file in the root directory of this source tree.
343
- */const m6=te("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"}]]);/**
344
- * @license lucide-react v0.344.0 - ISC
345
- *
346
- * This source code is licensed under the ISC license.
347
- * See the LICENSE file in the root directory of this source tree.
348
- */const ZG=te("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
349
- * @license lucide-react v0.344.0 - ISC
350
- *
351
- * This source code is licensed under the ISC license.
352
- * See the LICENSE file in the root directory of this source tree.
353
- */const ss=te("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
354
- * @license lucide-react v0.344.0 - ISC
355
- *
356
- * This source code is licensed under the ISC license.
357
- * See the LICENSE file in the root directory of this source tree.
358
- */const fC=te("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/**
359
- * @license lucide-react v0.344.0 - ISC
360
- *
361
- * This source code is licensed under the ISC license.
362
- * See the LICENSE file in the root directory of this source tree.
363
- */const QG=te("PenTool",[["path",{d:"m12 19 7-7 3 3-7 7-3-3z",key:"rklqx2"}],["path",{d:"m18 13-1.5-7.5L2 2l3.5 14.5L13 18l5-5z",key:"1et58u"}],["path",{d:"m2 2 7.586 7.586",key:"etlp93"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]]);/**
364
- * @license lucide-react v0.344.0 - ISC
365
- *
366
- * This source code is licensed under the ISC license.
367
- * See the LICENSE file in the root directory of this source tree.
368
- */const Or=te("PlayCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
369
- * @license lucide-react v0.344.0 - ISC
370
- *
371
- * This source code is licensed under the ISC license.
372
- * See the LICENSE file in the root directory of this source tree.
373
- */const hC=te("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/**
374
- * @license lucide-react v0.344.0 - ISC
375
- *
376
- * This source code is licensed under the ISC license.
377
- * See the LICENSE file in the root directory of this source tree.
378
- */const Qi=te("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
379
- * @license lucide-react v0.344.0 - ISC
380
- *
381
- * This source code is licensed under the ISC license.
382
- * See the LICENSE file in the root directory of this source tree.
383
- */const P0=te("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
384
- * @license lucide-react v0.344.0 - ISC
385
- *
386
- * This source code is licensed under the ISC license.
387
- * See the LICENSE file in the root directory of this source tree.
388
- */const Kp=te("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
389
- * @license lucide-react v0.344.0 - ISC
390
- *
391
- * This source code is licensed under the ISC license.
392
- * See the LICENSE file in the root directory of this source tree.
393
- */const y_=te("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
394
- * @license lucide-react v0.344.0 - ISC
395
- *
396
- * This source code is licensed under the ISC license.
397
- * See the LICENSE file in the root directory of this source tree.
398
- */const g6=te("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
399
- * @license lucide-react v0.344.0 - ISC
400
- *
401
- * This source code is licensed under the ISC license.
402
- * See the LICENSE file in the root directory of this source tree.
403
- */const JG=te("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
404
- * @license lucide-react v0.344.0 - ISC
405
- *
406
- * This source code is licensed under the ISC license.
407
- * See the LICENSE file in the root directory of this source tree.
408
- */const Yp=te("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
409
- * @license lucide-react v0.344.0 - ISC
410
- *
411
- * This source code is licensed under the ISC license.
412
- * See the LICENSE file in the root directory of this source tree.
413
- */const eK=te("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
414
- * @license lucide-react v0.344.0 - ISC
415
- *
416
- * This source code is licensed under the ISC license.
417
- * See the LICENSE file in the root directory of this source tree.
418
- */const tK=te("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
419
- * @license lucide-react v0.344.0 - ISC
420
- *
421
- * This source code is licensed under the ISC license.
422
- * See the LICENSE file in the root directory of this source tree.
423
- */const rK=te("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
424
- * @license lucide-react v0.344.0 - ISC
425
- *
426
- * This source code is licensed under the ISC license.
427
- * See the LICENSE file in the root directory of this source tree.
428
- */const Xp=te("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
429
- * @license lucide-react v0.344.0 - ISC
430
- *
431
- * This source code is licensed under the ISC license.
432
- * See the LICENSE file in the root directory of this source tree.
433
- */const nK=te("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
434
- * @license lucide-react v0.344.0 - ISC
435
- *
436
- * This source code is licensed under the ISC license.
437
- * See the LICENSE file in the root directory of this source tree.
438
- */const ho=te("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
439
- * @license lucide-react v0.344.0 - ISC
440
- *
441
- * This source code is licensed under the ISC license.
442
- * See the LICENSE file in the root directory of this source tree.
443
- */const aK=te("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
444
- * @license lucide-react v0.344.0 - ISC
445
- *
446
- * This source code is licensed under the ISC license.
447
- * See the LICENSE file in the root directory of this source tree.
448
- */const os=te("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
449
- * @license lucide-react v0.344.0 - ISC
450
- *
451
- * This source code is licensed under the ISC license.
452
- * See the LICENSE file in the root directory of this source tree.
453
- */const Zo=te("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
454
- * @license lucide-react v0.344.0 - ISC
455
- *
456
- * This source code is licensed under the ISC license.
457
- * See the LICENSE file in the root directory of this source tree.
458
- */const pr=te("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
459
- * @license lucide-react v0.344.0 - ISC
460
- *
461
- * This source code is licensed under the ISC license.
462
- * See the LICENSE file in the root directory of this source tree.
463
- */const No=te("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
464
- * @license lucide-react v0.344.0 - ISC
465
- *
466
- * This source code is licensed under the ISC license.
467
- * See the LICENSE file in the root directory of this source tree.
468
- */const po=te("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),v_=_.createContext({});function x_(e){const t=_.useRef(null);return t.current===null&&(t.current=e()),t.current}const b_=typeof window<"u",y6=b_?_.useLayoutEffect:_.useEffect,C0=_.createContext(null);function w_(e,t){e.indexOf(t)===-1&&e.push(t)}function j_(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}const ei=(e,t,r)=>r>t?t:r<e?e:r;let S_=()=>{};const ti={},v6=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function x6(e){return typeof e=="object"&&e!==null}const b6=e=>/^0[^.\s]+$/u.test(e);function k_(e){let t;return()=>(t===void 0&&(t=e()),t)}const _n=e=>e,iK=(e,t)=>r=>t(e(r)),Nf=(...e)=>e.reduce(iK),Nd=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n};class __{constructor(){this.subscriptions=[]}add(t){return w_(this.subscriptions,t),()=>j_(this.subscriptions,t)}notify(t,r,n){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](t,r,n);else for(let i=0;i<a;i++){const s=this.subscriptions[i];s&&s(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ya=e=>e*1e3,bn=e=>e/1e3;function w6(e,t){return t?e*(1e3/t):0}const j6=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,sK=1e-7,oK=12;function lK(e,t,r,n,a){let i,s,o=0;do s=t+(r-t)/2,i=j6(s,n,a)-e,i>0?r=s:t=s;while(Math.abs(i)>sK&&++o<oK);return s}function Ef(e,t,r,n){if(e===t&&r===n)return _n;const a=i=>lK(i,0,1,e,r);return i=>i===0||i===1?i:j6(a(i),t,n)}const S6=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,k6=e=>t=>1-e(1-t),_6=Ef(.33,1.53,.69,.99),N_=k6(_6),N6=S6(N_),E6=e=>(e*=2)<1?.5*N_(e):.5*(2-Math.pow(2,-10*(e-1))),E_=e=>1-Math.sin(Math.acos(e)),P6=k6(E_),C6=S6(E_),cK=Ef(.42,0,1,1),uK=Ef(0,0,.58,1),A6=Ef(.42,0,.58,1),dK=e=>Array.isArray(e)&&typeof e[0]!="number",T6=e=>Array.isArray(e)&&typeof e[0]=="number",fK={linear:_n,easeIn:cK,easeInOut:A6,easeOut:uK,circIn:E_,circInOut:C6,circOut:P6,backIn:N_,backInOut:N6,backOut:_6,anticipate:E6},hK=e=>typeof e=="string",pC=e=>{if(T6(e)){S_(e.length===4);const[t,r,n,a]=e;return Ef(t,r,n,a)}else if(hK(e))return fK[e];return e},hh=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function pK(e,t){let r=new Set,n=new Set,a=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(d){s.has(d)&&(c.schedule(d),e()),d(o)}const c={schedule:(d,f=!1,h=!1)=>{const g=h&&a?r:n;return f&&s.add(d),g.has(d)||g.add(d),d},cancel:d=>{n.delete(d),s.delete(d)},process:d=>{if(o=d,a){i=!0;return}a=!0,[r,n]=[n,r],r.forEach(l),r.clear(),a=!1,i&&(i=!1,c.process(d))}};return c}const mK=40;function O6(e,t){let r=!1,n=!0;const a={delta:0,timestamp:0,isProcessing:!1},i=()=>r=!0,s=hh.reduce((v,w)=>(v[w]=pK(i),v),{}),{setup:o,read:l,resolveKeyframes:c,preUpdate:d,update:f,preRender:h,render:p,postRender:g}=s,m=()=>{const v=ti.useManualTiming?a.timestamp:performance.now();r=!1,ti.useManualTiming||(a.delta=n?1e3/60:Math.max(Math.min(v-a.timestamp,mK),1)),a.timestamp=v,a.isProcessing=!0,o.process(a),l.process(a),c.process(a),d.process(a),f.process(a),h.process(a),p.process(a),g.process(a),a.isProcessing=!1,r&&t&&(n=!1,e(m))},b=()=>{r=!0,n=!0,a.isProcessing||e(m)};return{schedule:hh.reduce((v,w)=>{const j=s[w];return v[w]=(k,S=!1,N=!1)=>(r||b(),j.schedule(k,S,N)),v},{}),cancel:v=>{for(let w=0;w<hh.length;w++)s[hh[w]].cancel(v)},state:a,steps:s}}const{schedule:xt,cancel:ls,state:dr,steps:jy}=O6(typeof requestAnimationFrame<"u"?requestAnimationFrame:_n,!0);let cp;function gK(){cp=void 0}const Fr={now:()=>(cp===void 0&&Fr.set(dr.isProcessing||ti.useManualTiming?dr.timestamp:performance.now()),cp),set:e=>{cp=e,queueMicrotask(gK)}},M6=e=>t=>typeof t=="string"&&t.startsWith(e),P_=M6("--"),yK=M6("var(--"),C_=e=>yK(e)?vK.test(e.split("/*")[0].trim()):!1,vK=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,kc={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ed={...kc,transform:e=>ei(0,1,e)},ph={...kc,default:1},Xu=e=>Math.round(e*1e5)/1e5,A_=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function xK(e){return e==null}const bK=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,T_=(e,t)=>r=>!!(typeof r=="string"&&bK.test(r)&&r.startsWith(e)||t&&!xK(r)&&Object.prototype.hasOwnProperty.call(r,t)),R6=(e,t,r)=>n=>{if(typeof n!="string")return n;const[a,i,s,o]=n.match(A_);return{[e]:parseFloat(a),[t]:parseFloat(i),[r]:parseFloat(s),alpha:o!==void 0?parseFloat(o):1}},wK=e=>ei(0,255,e),Sy={...kc,transform:e=>Math.round(wK(e))},Vs={test:T_("rgb","red"),parse:R6("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+Sy.transform(e)+", "+Sy.transform(t)+", "+Sy.transform(r)+", "+Xu(Ed.transform(n))+")"};function jK(e){let t="",r="",n="",a="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),a=e.substring(4,5),t+=t,r+=r,n+=n,a+=a),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:a?parseInt(a,16)/255:1}}const rS={test:T_("#"),parse:jK,transform:Vs.transform},Pf=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ai=Pf("deg"),va=Pf("%"),we=Pf("px"),SK=Pf("vh"),kK=Pf("vw"),mC={...va,parse:e=>va.parse(e)/100,transform:e=>va.transform(e*100)},ul={test:T_("hsl","hue"),parse:R6("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+va.transform(Xu(t))+", "+va.transform(Xu(r))+", "+Xu(Ed.transform(n))+")"},Ut={test:e=>Vs.test(e)||rS.test(e)||ul.test(e),parse:e=>Vs.test(e)?Vs.parse(e):ul.test(e)?ul.parse(e):rS.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Vs.transform(e):ul.transform(e),getAnimatableNone:e=>{const t=Ut.parse(e);return t.alpha=0,Ut.transform(t)}},_K=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function NK(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(A_))==null?void 0:t.length)||0)+(((r=e.match(_K))==null?void 0:r.length)||0)>0}const $6="number",D6="color",EK="var",PK="var(",gC="${}",CK=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Pd(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},a=[];let i=0;const o=t.replace(CK,l=>(Ut.test(l)?(n.color.push(i),a.push(D6),r.push(Ut.parse(l))):l.startsWith(PK)?(n.var.push(i),a.push(EK),r.push(l)):(n.number.push(i),a.push($6),r.push(parseFloat(l))),++i,gC)).split(gC);return{values:r,split:o,indexes:n,types:a}}function I6(e){return Pd(e).values}function L6(e){const{split:t,types:r}=Pd(e),n=t.length;return a=>{let i="";for(let s=0;s<n;s++)if(i+=t[s],a[s]!==void 0){const o=r[s];o===$6?i+=Xu(a[s]):o===D6?i+=Ut.transform(a[s]):i+=a[s]}return i}}const AK=e=>typeof e=="number"?0:Ut.test(e)?Ut.getAnimatableNone(e):e;function TK(e){const t=I6(e);return L6(e)(t.map(AK))}const cs={test:NK,parse:I6,createTransformer:L6,getAnimatableNone:TK};function ky(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function OK({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let a=0,i=0,s=0;if(!t)a=i=s=r;else{const o=r<.5?r*(1+t):r+t-r*t,l=2*r-o;a=ky(l,o,e+1/3),i=ky(l,o,e),s=ky(l,o,e-1/3)}return{red:Math.round(a*255),green:Math.round(i*255),blue:Math.round(s*255),alpha:n}}function Zp(e,t){return r=>r>0?t:e}const _t=(e,t,r)=>e+(t-e)*r,_y=(e,t,r)=>{const n=e*e,a=r*(t*t-n)+n;return a<0?0:Math.sqrt(a)},MK=[rS,Vs,ul],RK=e=>MK.find(t=>t.test(e));function yC(e){const t=RK(e);if(!t)return!1;let r=t.parse(e);return t===ul&&(r=OK(r)),r}const vC=(e,t)=>{const r=yC(e),n=yC(t);if(!r||!n)return Zp(e,t);const a={...r};return i=>(a.red=_y(r.red,n.red,i),a.green=_y(r.green,n.green,i),a.blue=_y(r.blue,n.blue,i),a.alpha=_t(r.alpha,n.alpha,i),Vs.transform(a))},nS=new Set(["none","hidden"]);function $K(e,t){return nS.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function DK(e,t){return r=>_t(e,t,r)}function O_(e){return typeof e=="number"?DK:typeof e=="string"?C_(e)?Zp:Ut.test(e)?vC:zK:Array.isArray(e)?z6:typeof e=="object"?Ut.test(e)?vC:IK:Zp}function z6(e,t){const r=[...e],n=r.length,a=e.map((i,s)=>O_(i)(i,t[s]));return i=>{for(let s=0;s<n;s++)r[s]=a[s](i);return r}}function IK(e,t){const r={...e,...t},n={};for(const a in r)e[a]!==void 0&&t[a]!==void 0&&(n[a]=O_(e[a])(e[a],t[a]));return a=>{for(const i in n)r[i]=n[i](a);return r}}function LK(e,t){const r=[],n={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const i=t.types[a],s=e.indexes[i][n[i]],o=e.values[s]??0;r[a]=o,n[i]++}return r}const zK=(e,t)=>{const r=cs.createTransformer(t),n=Pd(e),a=Pd(t);return n.indexes.var.length===a.indexes.var.length&&n.indexes.color.length===a.indexes.color.length&&n.indexes.number.length>=a.indexes.number.length?nS.has(e)&&!a.values.length||nS.has(t)&&!n.values.length?$K(e,t):Nf(z6(LK(n,a),a.values),r):Zp(e,t)};function F6(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?_t(e,t,r):O_(e)(e,t)}const FK=e=>{const t=({timestamp:r})=>e(r);return{start:(r=!0)=>xt.update(t,r),stop:()=>ls(t),now:()=>dr.isProcessing?dr.timestamp:Fr.now()}},B6=(e,t,r=10)=>{let n="";const a=Math.max(Math.round(t/r),2);for(let i=0;i<a;i++)n+=Math.round(e(i/(a-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},Qp=2e4;function M_(e){let t=0;const r=50;let n=e.next(t);for(;!n.done&&t<Qp;)t+=r,n=e.next(t);return t>=Qp?1/0:t}function BK(e,t=100,r){const n=r({...e,keyframes:[0,t]}),a=Math.min(M_(n),Qp);return{type:"keyframes",ease:i=>n.next(a*i).value/t,duration:bn(a)}}const VK=5;function V6(e,t,r){const n=Math.max(t-VK,0);return w6(r-e(n),t-n)}const Ct={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ny=.001;function qK({duration:e=Ct.duration,bounce:t=Ct.bounce,velocity:r=Ct.velocity,mass:n=Ct.mass}){let a,i,s=1-t;s=ei(Ct.minDamping,Ct.maxDamping,s),e=ei(Ct.minDuration,Ct.maxDuration,bn(e)),s<1?(a=c=>{const d=c*s,f=d*e,h=d-r,p=aS(c,s),g=Math.exp(-f);return Ny-h/p*g},i=c=>{const f=c*s*e,h=f*r+r,p=Math.pow(s,2)*Math.pow(c,2)*e,g=Math.exp(-f),m=aS(Math.pow(c,2),s);return(-a(c)+Ny>0?-1:1)*((h-p)*g)/m}):(a=c=>{const d=Math.exp(-c*e),f=(c-r)*e+1;return-Ny+d*f},i=c=>{const d=Math.exp(-c*e),f=(r-c)*(e*e);return d*f});const o=5/e,l=HK(a,i,o);if(e=ya(e),isNaN(l))return{stiffness:Ct.stiffness,damping:Ct.damping,duration:e};{const c=Math.pow(l,2)*n;return{stiffness:c,damping:s*2*Math.sqrt(n*c),duration:e}}}const UK=12;function HK(e,t,r){let n=r;for(let a=1;a<UK;a++)n=n-e(n)/t(n);return n}function aS(e,t){return e*Math.sqrt(1-t*t)}const WK=["duration","bounce"],GK=["stiffness","damping","mass"];function xC(e,t){return t.some(r=>e[r]!==void 0)}function KK(e){let t={velocity:Ct.velocity,stiffness:Ct.stiffness,damping:Ct.damping,mass:Ct.mass,isResolvedFromDuration:!1,...e};if(!xC(e,GK)&&xC(e,WK))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(r*1.2),a=n*n,i=2*ei(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:Ct.mass,stiffness:a,damping:i}}else{const r=qK(e);t={...t,...r,mass:Ct.mass},t.isResolvedFromDuration=!0}return t}function Jp(e=Ct.visualDuration,t=Ct.bounce){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:a}=r;const i=r.keyframes[0],s=r.keyframes[r.keyframes.length-1],o={done:!1,value:i},{stiffness:l,damping:c,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=KK({...r,velocity:-bn(r.velocity||0)}),g=h||0,m=c/(2*Math.sqrt(l*d)),b=s-i,x=bn(Math.sqrt(l/d)),y=Math.abs(b)<5;n||(n=y?Ct.restSpeed.granular:Ct.restSpeed.default),a||(a=y?Ct.restDelta.granular:Ct.restDelta.default);let v;if(m<1){const j=aS(x,m);v=k=>{const S=Math.exp(-m*x*k);return s-S*((g+m*x*b)/j*Math.sin(j*k)+b*Math.cos(j*k))}}else if(m===1)v=j=>s-Math.exp(-x*j)*(b+(g+x*b)*j);else{const j=x*Math.sqrt(m*m-1);v=k=>{const S=Math.exp(-m*x*k),N=Math.min(j*k,300);return s-S*((g+m*x*b)*Math.sinh(N)+j*b*Math.cosh(N))/j}}const w={calculatedDuration:p&&f||null,next:j=>{const k=v(j);if(p)o.done=j>=f;else{let S=j===0?g:0;m<1&&(S=j===0?ya(g):V6(v,j,k));const N=Math.abs(S)<=n,E=Math.abs(s-k)<=a;o.done=N&&E}return o.value=o.done?s:k,o},toString:()=>{const j=Math.min(M_(w),Qp),k=B6(S=>w.next(j*S).value,j,30);return j+"ms "+k},toTransition:()=>{}};return w}Jp.applyToOptions=e=>{const t=BK(e,100,Jp);return e.ease=t.ease,e.duration=ya(t.duration),e.type="keyframes",e};function iS({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:a=10,bounceStiffness:i=500,modifyTarget:s,min:o,max:l,restDelta:c=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=N=>o!==void 0&&N<o||l!==void 0&&N>l,g=N=>o===void 0?l:l===void 0||Math.abs(o-N)<Math.abs(l-N)?o:l;let m=r*t;const b=f+m,x=s===void 0?b:s(b);x!==b&&(m=x-f);const y=N=>-m*Math.exp(-N/n),v=N=>x+y(N),w=N=>{const E=y(N),A=v(N);h.done=Math.abs(E)<=c,h.value=h.done?x:A};let j,k;const S=N=>{p(h.value)&&(j=N,k=Jp({keyframes:[h.value,g(h.value)],velocity:V6(v,N,h.value),damping:a,stiffness:i,restDelta:c,restSpeed:d}))};return S(0),{calculatedDuration:null,next:N=>{let E=!1;return!k&&j===void 0&&(E=!0,w(N),S(N)),j!==void 0&&N>=j?k.next(N-j):(!E&&w(N),h)}}}function YK(e,t,r){const n=[],a=r||ti.mix||F6,i=e.length-1;for(let s=0;s<i;s++){let o=a(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]||_n:t;o=Nf(l,o)}n.push(o)}return n}function XK(e,t,{clamp:r=!0,ease:n,mixer:a}={}){const i=e.length;if(S_(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=YK(t,n,a),l=o.length,c=d=>{if(s&&d<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const h=Nd(e[f],e[f+1],d);return o[f](h)};return r?d=>c(ei(e[0],e[i-1],d)):c}function ZK(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const a=Nd(0,t,n);e.push(_t(r,1,a))}}function QK(e){const t=[0];return ZK(t,e.length-1),t}function JK(e,t){return e.map(r=>r*t)}function eY(e,t){return e.map(()=>t||A6).splice(0,e.length-1)}function Zu({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const a=dK(n)?n.map(pC):pC(n),i={done:!1,value:t[0]},s=JK(r&&r.length===t.length?r:QK(t),e),o=XK(s,t,{ease:Array.isArray(a)?a:eY(t,a)});return{calculatedDuration:e,next:l=>(i.value=o(l),i.done=l>=e,i)}}const tY=e=>e!==null;function R_(e,{repeat:t,repeatType:r="loop"},n,a=1){const i=e.filter(tY),o=a<0||t&&r!=="loop"&&t%2===1?0:i.length-1;return!o||n===void 0?i[o]:n}const rY={decay:iS,inertia:iS,tween:Zu,keyframes:Zu,spring:Jp};function q6(e){typeof e.type=="string"&&(e.type=rY[e.type])}class $_{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}}const nY=e=>e/100;class D_ extends $_{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,a;const{motionValue:r}=this.options;r&&r.updatedAt!==Fr.now()&&this.tick(Fr.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(a=(n=this.options).onStop)==null||a.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;q6(t);const{type:r=Zu,repeat:n=0,repeatDelay:a=0,repeatType:i,velocity:s=0}=t;let{keyframes:o}=t;const l=r||Zu;l!==Zu&&typeof o[0]!="number"&&(this.mixKeyframes=Nf(nY,F6(o[0],o[1])),o=[0,100]);const c=l({...t,keyframes:o});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...o].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=M_(c));const{calculatedDuration:d}=c;this.calculatedDuration=d,this.resolvedDuration=d+a,this.totalDuration=this.resolvedDuration*(n+1)-a,this.generator=c}updateTime(t){const r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){const{generator:n,totalDuration:a,mixKeyframes:i,mirroredGenerator:s,resolvedDuration:o,calculatedDuration:l}=this;if(this.startTime===null)return n.next(0);const{delay:c=0,keyframes:d,repeat:f,repeatType:h,repeatDelay:p,type:g,onUpdate:m,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-a/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);const x=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?x<0:x>a;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let v=this.currentTime,w=n;if(f){const N=Math.min(this.currentTime,a)/o;let E=Math.floor(N),A=N%1;!A&&N>=1&&(A=1),A===1&&E--,E=Math.min(E,f+1),!!(E%2)&&(h==="reverse"?(A=1-A,p&&(A-=p/o)):h==="mirror"&&(w=s)),v=ei(0,1,A)*o}const j=y?{done:!1,value:d[0]}:w.next(v);i&&(j.value=i(j.value));let{done:k}=j;!y&&l!==null&&(k=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return S&&g!==iS&&(j.value=R_(d,this.options,b,this.speed)),m&&m(j.value),S&&this.finish(),j}then(t,r){return this.finished.then(t,r)}get duration(){return bn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+bn(t)}get time(){return bn(this.currentTime)}set time(t){var r;t=ya(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(r=this.driver)==null||r.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Fr.now());const r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=bn(this.currentTime))}play(){var a,i;if(this.isStopped)return;const{driver:t=FK,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),(i=(a=this.options).onPlay)==null||i.call(a);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Fr.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}}function aY(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const qs=e=>e*180/Math.PI,sS=e=>{const t=qs(Math.atan2(e[1],e[0]));return oS(t)},iY={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:sS,rotateZ:sS,skewX:e=>qs(Math.atan(e[1])),skewY:e=>qs(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},oS=e=>(e=e%360,e<0&&(e+=360),e),bC=sS,wC=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),jC=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),sY={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:wC,scaleY:jC,scale:e=>(wC(e)+jC(e))/2,rotateX:e=>oS(qs(Math.atan2(e[6],e[5]))),rotateY:e=>oS(qs(Math.atan2(-e[2],e[0]))),rotateZ:bC,rotate:bC,skewX:e=>qs(Math.atan(e[4])),skewY:e=>qs(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function lS(e){return e.includes("scale")?1:0}function cS(e,t){if(!e||e==="none")return lS(t);const r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,a;if(r)n=sY,a=r;else{const o=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=iY,a=o}if(!a)return lS(t);const i=n[t],s=a[1].split(",").map(lY);return typeof i=="function"?i(s):s[i]}const oY=(e,t)=>{const{transform:r="none"}=getComputedStyle(e);return cS(r,t)};function lY(e){return parseFloat(e.trim())}const _c=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Nc=new Set(_c),SC=e=>e===kc||e===we,cY=new Set(["x","y","z"]),uY=_c.filter(e=>!cY.has(e));function dY(e){const t=[];return uY.forEach(r=>{const n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}const Qs={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>cS(t,"x"),y:(e,{transform:t})=>cS(t,"y")};Qs.translateX=Qs.x;Qs.translateY=Qs.y;const Js=new Set;let uS=!1,dS=!1,fS=!1;function U6(){if(dS){const e=Array.from(Js).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{const a=dY(n);a.length&&(r.set(n,a),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const a=r.get(n);a&&a.forEach(([i,s])=>{var o;(o=n.getValue(i))==null||o.set(s)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}dS=!1,uS=!1,Js.forEach(e=>e.complete(fS)),Js.clear()}function H6(){Js.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(dS=!0)})}function fY(){fS=!0,H6(),U6(),fS=!1}class I_{constructor(t,r,n,a,i,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=a,this.element=i,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(Js.add(this),uS||(uS=!0,xt.read(H6),xt.resolveKeyframes(U6))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:n,motionValue:a}=this;if(t[0]===null){const i=a==null?void 0:a.get(),s=t[t.length-1];if(i!==void 0)t[0]=i;else if(n&&r){const o=n.readValue(r,s);o!=null&&(t[0]=o)}t[0]===void 0&&(t[0]=s),a&&i===void 0&&a.set(t[0])}aY(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Js.delete(this)}cancel(){this.state==="scheduled"&&(Js.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const hY=e=>e.startsWith("--");function pY(e,t,r){hY(t)?e.style.setProperty(t,r):e.style[t]=r}const mY=k_(()=>window.ScrollTimeline!==void 0),gY={};function yY(e,t){const r=k_(e);return()=>gY[t]??r()}const W6=yY(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Cu=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,kC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Cu([0,.65,.55,1]),circOut:Cu([.55,0,1,.45]),backIn:Cu([.31,.01,.66,-.59]),backOut:Cu([.33,1.53,.69,.99])};function G6(e,t){if(e)return typeof e=="function"?W6()?B6(e,t):"ease-out":T6(e)?Cu(e):Array.isArray(e)?e.map(r=>G6(r,t)||kC.easeOut):kC[e]}function vY(e,t,r,{delay:n=0,duration:a=300,repeat:i=0,repeatType:s="loop",ease:o="easeOut",times:l}={},c=void 0){const d={[t]:r};l&&(d.offset=l);const f=G6(o,a);Array.isArray(f)&&(d.easing=f);const h={delay:n,duration:a,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:s==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),e.animate(d,h)}function K6(e){return typeof e=="function"&&"applyToOptions"in e}function xY({type:e,...t}){return K6(e)&&W6()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class bY extends $_{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:r,name:n,keyframes:a,pseudoElement:i,allowFlatten:s=!1,finalKeyframe:o,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=s,this.options=t,S_(typeof t.type!="string");const c=xY(t);this.animation=vY(r,n,a,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=R_(a,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(d):pY(r,n,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,r;(r=(t=this.animation).finish)==null||r.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,r;this.isPseudoElement||(r=(t=this.animation).commitStyles)==null||r.call(t)}get duration(){var r,n;const t=((n=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:n.call(r).duration)||0;return bn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+bn(t)}get time(){return bn(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=ya(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:r}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&mY()?(this.animation.timeline=t,_n):r(this)}}const Y6={anticipate:E6,backInOut:N6,circInOut:C6};function wY(e){return e in Y6}function jY(e){typeof e.ease=="string"&&wY(e.ease)&&(e.ease=Y6[e.ease])}const _C=10;class SY extends bY{constructor(t){jY(t),q6(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:r,onUpdate:n,onComplete:a,element:i,...s}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}const o=new D_({...s,autoplay:!1}),l=ya(this.finishedTime??this.time);r.setWithVelocity(o.sample(l-_C).value,o.sample(l).value,_C),o.stop()}}const NC=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(cs.test(e)||e==="0")&&!e.startsWith("url("));function kY(e){const t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function _Y(e,t,r,n){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],s=NC(a,t),o=NC(i,t);return!s||!o?!1:kY(e)||(r==="spring"||K6(r))&&n}function hS(e){e.duration=0,e.type="keyframes"}const NY=new Set(["opacity","clipPath","filter","transform"]),EY=k_(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function PY(e){var d;const{motionValue:t,name:r,repeatDelay:n,repeatType:a,damping:i,type:s}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return EY()&&r&&NY.has(r)&&(r!=="transform"||!c)&&!l&&!n&&a!=="mirror"&&i!==0&&s!=="inertia"}const CY=40;class AY extends $_{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:a=0,repeatDelay:i=0,repeatType:s="loop",keyframes:o,name:l,motionValue:c,element:d,...f}){var g;super(),this.stop=()=>{var m,b;this._animation&&(this._animation.stop(),(m=this.stopTimeline)==null||m.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=Fr.now();const h={autoplay:t,delay:r,type:n,repeat:a,repeatDelay:i,repeatType:s,name:l,motionValue:c,element:d,...f},p=(d==null?void 0:d.KeyframeResolver)||I_;this.keyframeResolver=new p(o,(m,b,x)=>this.onKeyframesResolved(m,b,h,!x),l,c,d),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,r,n,a){this.keyframeResolver=void 0;const{name:i,type:s,velocity:o,delay:l,isHandoff:c,onUpdate:d}=n;this.resolvedAt=Fr.now(),_Y(t,i,s,o)||((ti.instantAnimations||!l)&&(d==null||d(R_(t,n,r))),t[0]=t[t.length-1],hS(n),n.repeat=0);const h={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>CY?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},p=!c&&PY(h)?new SY({...h,element:h.motionValue.owner.current}):new D_(h);p.finished.then(()=>this.notifyFinished()).catch(_n),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),fY()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const TY=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function OY(e){const t=TY.exec(e);if(!t)return[,];const[,r,n,a]=t;return[`--${r??n}`,a]}function X6(e,t,r=1){const[n,a]=OY(e);if(!n)return;const i=window.getComputedStyle(t).getPropertyValue(n);if(i){const s=i.trim();return v6(s)?parseFloat(s):s}return C_(a)?X6(a,t,r+1):a}function L_(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Z6=new Set(["width","height","top","left","right","bottom",..._c]),MY={test:e=>e==="auto",parse:e=>e},Q6=e=>t=>t.test(e),J6=[kc,we,va,Ai,kK,SK,MY],EC=e=>J6.find(Q6(e));function RY(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||b6(e):!0}const $Y=new Set(["brightness","contrast","saturate","opacity"]);function DY(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(A_)||[];if(!n)return e;const a=r.replace(n,"");let i=$Y.has(t)?1:0;return n!==r&&(i*=100),t+"("+i+a+")"}const IY=/\b([a-z-]*)\(.*?\)/gu,pS={...cs,getAnimatableNone:e=>{const t=e.match(IY);return t?t.map(DY).join(" "):e}},PC={...kc,transform:Math.round},LY={rotate:Ai,rotateX:Ai,rotateY:Ai,rotateZ:Ai,scale:ph,scaleX:ph,scaleY:ph,scaleZ:ph,skew:Ai,skewX:Ai,skewY:Ai,distance:we,translateX:we,translateY:we,translateZ:we,x:we,y:we,z:we,perspective:we,transformPerspective:we,opacity:Ed,originX:mC,originY:mC,originZ:we},z_={borderWidth:we,borderTopWidth:we,borderRightWidth:we,borderBottomWidth:we,borderLeftWidth:we,borderRadius:we,radius:we,borderTopLeftRadius:we,borderTopRightRadius:we,borderBottomRightRadius:we,borderBottomLeftRadius:we,width:we,maxWidth:we,height:we,maxHeight:we,top:we,right:we,bottom:we,left:we,padding:we,paddingTop:we,paddingRight:we,paddingBottom:we,paddingLeft:we,margin:we,marginTop:we,marginRight:we,marginBottom:we,marginLeft:we,backgroundPositionX:we,backgroundPositionY:we,...LY,zIndex:PC,fillOpacity:Ed,strokeOpacity:Ed,numOctaves:PC},zY={...z_,color:Ut,backgroundColor:Ut,outlineColor:Ut,fill:Ut,stroke:Ut,borderColor:Ut,borderTopColor:Ut,borderRightColor:Ut,borderBottomColor:Ut,borderLeftColor:Ut,filter:pS,WebkitFilter:pS},ez=e=>zY[e];function tz(e,t){let r=ez(e);return r!==pS&&(r=cs),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const FY=new Set(["auto","none","0"]);function BY(e,t,r){let n=0,a;for(;n<e.length&&!a;){const i=e[n];typeof i=="string"&&!FY.has(i)&&Pd(i).values.length&&(a=e[n]),n++}if(a&&r)for(const i of t)e[i]=tz(r,a)}class VY extends I_{constructor(t,r,n,a,i){super(t,r,n,a,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),C_(c))){const d=X6(c,r.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Z6.has(n)||t.length!==2)return;const[a,i]=t,s=EC(a),o=EC(i);if(s!==o)if(SC(s)&&SC(o))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else Qs[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:r}=this,n=[];for(let a=0;a<t.length;a++)(t[a]===null||RY(t[a]))&&n.push(a);n.length&&BY(t,n,r)}measureInitialState(){const{element:t,unresolvedKeyframes:r,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Qs[n](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;const a=r[r.length-1];a!==void 0&&t.getValue(n,a).jump(a,!1)}measureEndState(){var o;const{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const a=t.getValue(r);a&&a.jump(this.measuredOrigin,!1);const i=n.length-1,s=n[i];n[i]=Qs[r](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),(o=this.removedTransforms)!=null&&o.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function qY(e,t,r){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;const a=(r==null?void 0:r[e])??n.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}const rz=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function nz(e){return x6(e)&&"offsetHeight"in e}const CC=30,UY=e=>!isNaN(parseFloat(e));class HY{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var i;const a=Fr.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=Fr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=UY(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new __);const n=this.events[t].add(r);return t==="change"?()=>{n(),xt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Fr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>CC)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,CC);return w6(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Hl(e,t){return new HY(e,t)}const{schedule:F_}=O6(queueMicrotask,!1),Fn={x:!1,y:!1};function az(){return Fn.x||Fn.y}function WY(e){return e==="x"||e==="y"?Fn[e]?null:(Fn[e]=!0,()=>{Fn[e]=!1}):Fn.x||Fn.y?null:(Fn.x=Fn.y=!0,()=>{Fn.x=Fn.y=!1})}function iz(e,t){const r=qY(e),n=new AbortController,a={passive:!0,...t,signal:n.signal};return[r,a,()=>n.abort()]}function AC(e){return!(e.pointerType==="touch"||az())}function GY(e,t,r={}){const[n,a,i]=iz(e,r),s=o=>{if(!AC(o))return;const{target:l}=o,c=t(l,o);if(typeof c!="function"||!l)return;const d=f=>{AC(f)&&(c(f),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,a)};return n.forEach(o=>{o.addEventListener("pointerenter",s,a)}),i}const sz=(e,t)=>t?e===t?!0:sz(e,t.parentElement):!1,B_=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,KY=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function YY(e){return KY.has(e.tagName)||e.tabIndex!==-1}const up=new WeakSet;function TC(e){return t=>{t.key==="Enter"&&e(t)}}function Ey(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const XY=(e,t)=>{const r=e.currentTarget;if(!r)return;const n=TC(()=>{if(up.has(r))return;Ey(r,"down");const a=TC(()=>{Ey(r,"up")}),i=()=>Ey(r,"cancel");r.addEventListener("keyup",a,t),r.addEventListener("blur",i,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function OC(e){return B_(e)&&!az()}function ZY(e,t,r={}){const[n,a,i]=iz(e,r),s=o=>{const l=o.currentTarget;if(!OC(o))return;up.add(l);const c=t(l,o),d=(p,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),up.has(l)&&up.delete(l),OC(p)&&typeof c=="function"&&c(p,{success:g})},f=p=>{d(p,l===window||l===document||r.useGlobalTarget||sz(l,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,a),window.addEventListener("pointercancel",h,a)};return n.forEach(o=>{(r.useGlobalTarget?window:o).addEventListener("pointerdown",s,a),nz(o)&&(o.addEventListener("focus",c=>XY(c,a)),!YY(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),i}function oz(e){return x6(e)&&"ownerSVGElement"in e}function QY(e){return oz(e)&&e.tagName==="svg"}const kr=e=>!!(e&&e.getVelocity),JY=[...J6,Ut,cs],eX=e=>JY.find(Q6(e)),V_=_.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function MC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function tX(...e){return t=>{let r=!1;const n=e.map(a=>{const i=MC(a,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a<n.length;a++){const i=n[a];typeof i=="function"?i():MC(e[a],null)}}}}function rX(...e){return _.useCallback(tX(...e),e)}class nX extends _.Component{getSnapshotBeforeUpdate(t){const r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){const n=r.offsetParent,a=nz(n)&&n.offsetWidth||0,i=this.props.sizeRef.current;i.height=r.offsetHeight||0,i.width=r.offsetWidth||0,i.top=r.offsetTop,i.left=r.offsetLeft,i.right=a-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function aX({children:e,isPresent:t,anchorX:r,root:n}){const a=_.useId(),i=_.useRef(null),s=_.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=_.useContext(V_),l=rX(i,e==null?void 0:e.ref);return _.useInsertionEffect(()=>{const{width:c,height:d,top:f,left:h,right:p}=s.current;if(t||!i.current||!c||!d)return;const g=r==="left"?`left: ${h}`:`right: ${p}`;i.current.dataset.motionPopId=a;const m=document.createElement("style");o&&(m.nonce=o);const b=n??document.head;return b.appendChild(m),m.sheet&&m.sheet.insertRule(`
469
- [data-motion-pop-id="${a}"] {
470
- position: absolute !important;
471
- width: ${c}px !important;
472
- height: ${d}px !important;
473
- ${g}px !important;
474
- top: ${f}px !important;
475
- }
476
- `),()=>{b.contains(m)&&b.removeChild(m)}},[t]),u.jsx(nX,{isPresent:t,childRef:i,sizeRef:s,children:_.cloneElement(e,{ref:l})})}const iX=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:a,presenceAffectsLayout:i,mode:s,anchorX:o,root:l})=>{const c=x_(sX),d=_.useId();let f=!0,h=_.useMemo(()=>(f=!1,{id:d,initial:t,isPresent:r,custom:a,onExitComplete:p=>{c.set(p,!0);for(const g of c.values())if(!g)return;n&&n()},register:p=>(c.set(p,!1),()=>c.delete(p))}),[r,c,n]);return i&&f&&(h={...h}),_.useMemo(()=>{c.forEach((p,g)=>c.set(g,!1))},[r]),_.useEffect(()=>{!r&&!c.size&&n&&n()},[r]),s==="popLayout"&&(e=u.jsx(aX,{isPresent:r,anchorX:o,root:l,children:e})),u.jsx(C0.Provider,{value:h,children:e})};function sX(){return new Map}function lz(e=!0){const t=_.useContext(C0);if(t===null)return[!0,null];const{isPresent:r,onExitComplete:n,register:a}=t,i=_.useId();_.useEffect(()=>{if(e)return a(i)},[e]);const s=_.useCallback(()=>e&&n&&n(i),[i,n,e]);return!r&&n?[!1,s]:[!0]}const mh=e=>e.key||"";function RC(e){const t=[];return _.Children.forEach(e,r=>{_.isValidElement(r)&&t.push(r)}),t}const hi=({children:e,custom:t,initial:r=!0,onExitComplete:n,presenceAffectsLayout:a=!0,mode:i="sync",propagate:s=!1,anchorX:o="left",root:l})=>{const[c,d]=lz(s),f=_.useMemo(()=>RC(e),[e]),h=s&&!c?[]:f.map(mh),p=_.useRef(!0),g=_.useRef(f),m=x_(()=>new Map),[b,x]=_.useState(f),[y,v]=_.useState(f);y6(()=>{p.current=!1,g.current=f;for(let k=0;k<y.length;k++){const S=mh(y[k]);h.includes(S)?m.delete(S):m.get(S)!==!0&&m.set(S,!1)}},[y,h.length,h.join("-")]);const w=[];if(f!==b){let k=[...f];for(let S=0;S<y.length;S++){const N=y[S],E=mh(N);h.includes(E)||(k.splice(S,0,N),w.push(N))}return i==="wait"&&w.length&&(k=w),v(RC(k)),x(f),null}const{forceRender:j}=_.useContext(v_);return u.jsx(u.Fragment,{children:y.map(k=>{const S=mh(k),N=s&&!c?!1:f===y||h.includes(S),E=()=>{if(m.has(S))m.set(S,!0);else return;let A=!0;m.forEach(C=>{C||(A=!1)}),A&&(j==null||j(),v(g.current),s&&(d==null||d()),n&&n())};return u.jsx(iX,{isPresent:N,initial:!p.current||r?void 0:!1,custom:t,presenceAffectsLayout:a,mode:i,root:l,onExitComplete:N?void 0:E,anchorX:o,children:k},S)})})},cz=_.createContext({strict:!1}),$C={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Wl={};for(const e in $C)Wl[e]={isEnabled:t=>$C[e].some(r=>!!t[r])};function oX(e){for(const t in e)Wl[t]={...Wl[t],...e[t]}}const lX=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function em(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||lX.has(e)}let uz=e=>!em(e);function cX(e){typeof e=="function"&&(uz=t=>t.startsWith("on")?!em(t):e(t))}try{cX(require("@emotion/is-prop-valid").default)}catch{}function uX(e,t,r){const n={};for(const a in e)a==="values"&&typeof e.values=="object"||(uz(a)||r===!0&&em(a)||!t&&!em(a)||e.draggable&&a.startsWith("onDrag"))&&(n[a]=e[a]);return n}const A0=_.createContext({});function T0(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Cd(e){return typeof e=="string"||Array.isArray(e)}const q_=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],U_=["initial",...q_];function O0(e){return T0(e.animate)||U_.some(t=>Cd(e[t]))}function dz(e){return!!(O0(e)||e.variants)}function dX(e,t){if(O0(e)){const{initial:r,animate:n}=e;return{initial:r===!1||Cd(r)?r:void 0,animate:Cd(n)?n:void 0}}return e.inherit!==!1?t:{}}function fX(e){const{initial:t,animate:r}=dX(e,_.useContext(A0));return _.useMemo(()=>({initial:t,animate:r}),[DC(t),DC(r)])}function DC(e){return Array.isArray(e)?e.join(" "):e}const Ad={};function hX(e){for(const t in e)Ad[t]=e[t],P_(t)&&(Ad[t].isCSSVariable=!0)}function fz(e,{layout:t,layoutId:r}){return Nc.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Ad[e]||e==="opacity")}const pX={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},mX=_c.length;function gX(e,t,r){let n="",a=!0;for(let i=0;i<mX;i++){const s=_c[i],o=e[s];if(o===void 0)continue;let l=!0;if(typeof o=="number"?l=o===(s.startsWith("scale")?1:0):l=parseFloat(o)===0,!l||r){const c=rz(o,z_[s]);if(!l){a=!1;const d=pX[s]||s;n+=`${d}(${c}) `}r&&(t[s]=c)}}return n=n.trim(),r?n=r(t,a?"":n):a&&(n="none"),n}function H_(e,t,r){const{style:n,vars:a,transformOrigin:i}=e;let s=!1,o=!1;for(const l in t){const c=t[l];if(Nc.has(l)){s=!0;continue}else if(P_(l)){a[l]=c;continue}else{const d=rz(c,z_[l]);l.startsWith("origin")?(o=!0,i[l]=d):n[l]=d}}if(t.transform||(s||r?n.transform=gX(t,e.transform,r):n.transform&&(n.transform="none")),o){const{originX:l="50%",originY:c="50%",originZ:d=0}=i;n.transformOrigin=`${l} ${c} ${d}`}}const W_=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function hz(e,t,r){for(const n in t)!kr(t[n])&&!fz(n,r)&&(e[n]=t[n])}function yX({transformTemplate:e},t){return _.useMemo(()=>{const r=W_();return H_(r,t,e),Object.assign({},r.vars,r.style)},[t])}function vX(e,t){const r=e.style||{},n={};return hz(n,r,e),Object.assign(n,yX(e,t)),n}function xX(e,t){const r={},n=vX(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}const bX={offset:"stroke-dashoffset",array:"stroke-dasharray"},wX={offset:"strokeDashoffset",array:"strokeDasharray"};function jX(e,t,r=1,n=0,a=!0){e.pathLength=1;const i=a?bX:wX;e[i.offset]=we.transform(-n);const s=we.transform(t),o=we.transform(r);e[i.array]=`${s} ${o}`}function pz(e,{attrX:t,attrY:r,attrScale:n,pathLength:a,pathSpacing:i=1,pathOffset:s=0,...o},l,c,d){if(H_(e,o,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),r!==void 0&&(f.y=r),n!==void 0&&(f.scale=n),a!==void 0&&jX(f,a,i,s,!1)}const mz=()=>({...W_(),attrs:{}}),gz=e=>typeof e=="string"&&e.toLowerCase()==="svg";function SX(e,t,r,n){const a=_.useMemo(()=>{const i=mz();return pz(i,t,gz(n),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};hz(i,e.style,e),a.style={...i,...a.style}}return a}const kX=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function G_(e){return typeof e!="string"||e.includes("-")?!1:!!(kX.indexOf(e)>-1||/[A-Z]/u.test(e))}function _X(e,t,r,{latestValues:n},a,i=!1){const o=(G_(e)?SX:xX)(t,n,a,e),l=uX(t,typeof e=="string",i),c=e!==_.Fragment?{...l,...o,ref:r}:{},{children:d}=t,f=_.useMemo(()=>kr(d)?d.get():d,[d]);return _.createElement(e,{...c,children:f})}function IC(e){const t=[{},{}];return e==null||e.values.forEach((r,n)=>{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function K_(e,t,r,n){if(typeof t=="function"){const[a,i]=IC(n);t=t(r!==void 0?r:e.custom,a,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,i]=IC(n);t=t(r!==void 0?r:e.custom,a,i)}return t}function dp(e){return kr(e)?e.get():e}function NX({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,a){return{latestValues:EX(r,n,a,e),renderState:t()}}function EX(e,t,r,n){const a={},i=n(e,{});for(const h in i)a[h]=dp(i[h]);let{initial:s,animate:o}=e;const l=O0(e),c=dz(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),o===void 0&&(o=t.animate));let d=r?r.initial===!1:!1;d=d||s===!1;const f=d?o:s;if(f&&typeof f!="boolean"&&!T0(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const g=K_(e,h[p]);if(g){const{transitionEnd:m,transition:b,...x}=g;for(const y in x){let v=x[y];if(Array.isArray(v)){const w=d?v.length-1:0;v=v[w]}v!==null&&(a[y]=v)}for(const y in m)a[y]=m[y]}}}return a}const yz=e=>(t,r)=>{const n=_.useContext(A0),a=_.useContext(C0),i=()=>NX(e,t,n,a);return r?i():x_(i)};function Y_(e,t,r){var i;const{style:n}=e,a={};for(const s in n)(kr(n[s])||t.style&&kr(t.style[s])||fz(s,e)||((i=r==null?void 0:r.getValue(s))==null?void 0:i.liveStyle)!==void 0)&&(a[s]=n[s]);return a}const PX=yz({scrapeMotionValuesFromProps:Y_,createRenderState:W_});function vz(e,t,r){const n=Y_(e,t,r);for(const a in e)if(kr(e[a])||kr(t[a])){const i=_c.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;n[i]=e[a]}return n}const CX=yz({scrapeMotionValuesFromProps:vz,createRenderState:mz}),AX=Symbol.for("motionComponentSymbol");function dl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function TX(e,t,r){return _.useCallback(n=>{n&&e.onMount&&e.onMount(n),t&&(n?t.mount(n):t.unmount()),r&&(typeof r=="function"?r(n):dl(r)&&(r.current=n))},[t])}const X_=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),OX="framerAppearId",xz="data-"+X_(OX),bz=_.createContext({});function MX(e,t,r,n,a){var m,b;const{visualElement:i}=_.useContext(A0),s=_.useContext(cz),o=_.useContext(C0),l=_.useContext(V_).reducedMotion,c=_.useRef(null);n=n||s.renderer,!c.current&&n&&(c.current=n(e,{visualState:t,parent:i,props:r,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:l}));const d=c.current,f=_.useContext(bz);d&&!d.projection&&a&&(d.type==="html"||d.type==="svg")&&RX(c.current,r,a,f);const h=_.useRef(!1);_.useInsertionEffect(()=>{d&&h.current&&d.update(r,o)});const p=r[xz],g=_.useRef(!!p&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,p))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,p)));return y6(()=>{d&&(h.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),g.current&&d.animationState&&d.animationState.animateChanges())}),_.useEffect(()=>{d&&(!g.current&&d.animationState&&d.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)==null||x.call(window,p)}),g.current=!1),d.enteringChildren=void 0)}),d}function RX(e,t,r,n){const{layoutId:a,layout:i,drag:s,dragConstraints:o,layoutScroll:l,layoutRoot:c,layoutCrossfade:d}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:wz(e.parent)),e.projection.setOptions({layoutId:a,layout:i,alwaysMeasureLayout:!!s||o&&dl(o),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:n,crossfade:d,layoutScroll:l,layoutRoot:c})}function wz(e){if(e)return e.options.allowProjection!==!1?e.projection:wz(e.parent)}function Py(e,{forwardMotionProps:t=!1}={},r,n){r&&oX(r);const a=G_(e)?CX:PX;function i(o,l){let c;const d={..._.useContext(V_),...o,layoutId:$X(o)},{isStatic:f}=d,h=fX(o),p=a(o,f);if(!f&&b_){DX();const g=IX(d);c=g.MeasureLayout,h.visualElement=MX(e,p,d,n,g.ProjectionNode)}return u.jsxs(A0.Provider,{value:h,children:[c&&h.visualElement?u.jsx(c,{visualElement:h.visualElement,...d}):null,_X(e,o,TX(p,h.visualElement,l),p,f,t)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=_.forwardRef(i);return s[AX]=e,s}function $X({layoutId:e}){const t=_.useContext(v_).id;return t&&e!==void 0?t+"-"+e:e}function DX(e,t){_.useContext(cz).strict}function IX(e){const{drag:t,layout:r}=Wl;if(!t&&!r)return{};const n={...t,...r};return{MeasureLayout:t!=null&&t.isEnabled(e)||r!=null&&r.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}function LX(e,t){if(typeof Proxy>"u")return Py;const r=new Map,n=(i,s)=>Py(i,s,e,t),a=(i,s)=>n(i,s);return new Proxy(a,{get:(i,s)=>s==="create"?n:(r.has(s)||r.set(s,Py(s,void 0,e,t)),r.get(s))})}function jz({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function zX({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function FX(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function Cy(e){return e===void 0||e===1}function mS({scale:e,scaleX:t,scaleY:r}){return!Cy(e)||!Cy(t)||!Cy(r)}function Ts(e){return mS(e)||Sz(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Sz(e){return LC(e.x)||LC(e.y)}function LC(e){return e&&e!=="0%"}function tm(e,t,r){const n=e-r,a=t*n;return r+a}function zC(e,t,r,n,a){return a!==void 0&&(e=tm(e,a,n)),tm(e,r,n)+t}function gS(e,t=0,r=1,n,a){e.min=zC(e.min,t,r,n,a),e.max=zC(e.max,t,r,n,a)}function kz(e,{x:t,y:r}){gS(e.x,t.translate,t.scale,t.originPoint),gS(e.y,r.translate,r.scale,r.originPoint)}const FC=.999999999999,BC=1.0000000000001;function BX(e,t,r,n=!1){const a=r.length;if(!a)return;t.x=t.y=1;let i,s;for(let o=0;o<a;o++){i=r[o],s=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(n&&i.options.layoutScroll&&i.scroll&&i!==i.root&&hl(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,kz(e,s)),n&&Ts(i.latestValues)&&hl(e,i.latestValues))}t.x<BC&&t.x>FC&&(t.x=1),t.y<BC&&t.y>FC&&(t.y=1)}function fl(e,t){e.min=e.min+t,e.max=e.max+t}function VC(e,t,r,n,a=.5){const i=_t(e.min,e.max,a);gS(e,t,r,i,n)}function hl(e,t){VC(e.x,t.x,t.scaleX,t.scale,t.originX),VC(e.y,t.y,t.scaleY,t.scale,t.originY)}function _z(e,t){return jz(FX(e.getBoundingClientRect(),t))}function VX(e,t,r){const n=_z(e,r),{scroll:a}=t;return a&&(fl(n.x,a.offset.x),fl(n.y,a.offset.y)),n}const qC=()=>({translate:0,scale:1,origin:0,originPoint:0}),pl=()=>({x:qC(),y:qC()}),UC=()=>({min:0,max:0}),$t=()=>({x:UC(),y:UC()}),yS={current:null},Nz={current:!1};function qX(){if(Nz.current=!0,!!b_)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>yS.current=e.matches;e.addEventListener("change",t),t()}else yS.current=!1}const UX=new WeakMap;function HX(e,t,r){for(const n in t){const a=t[n],i=r[n];if(kr(a))e.addValue(n,a);else if(kr(i))e.addValue(n,Hl(a,{owner:e}));else if(i!==a)if(e.hasValue(n)){const s=e.getValue(n);s.liveStyle===!0?s.jump(a):s.hasAnimated||s.set(a)}else{const s=e.getStaticValue(n);e.addValue(n,Hl(s!==void 0?s:a,{owner:e}))}}for(const n in r)t[n]===void 0&&e.removeValue(n);return t}const HC=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class WX{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:a,blockInitialAnimation:i,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=I_,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=Fr.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,xt.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=r.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=r,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=a,this.options=o,this.blockInitialAnimation=!!i,this.isControllingVariants=O0(r),this.isVariantNode=dz(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(r,{},this);for(const h in f){const p=f[h];l[h]!==void 0&&kr(p)&&p.set(l[h])}}mount(t){var r;this.current=t,UX.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,a)=>this.bindToMotionValue(a,n)),Nz.current||qX(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:yS.current,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),ls(this.notifyUpdate),ls(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const r in this.events)this.events[r].clear();for(const r in this.features){const n=this.features[r];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,r){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Nc.has(t);n&&this.onBindTransform&&this.onBindTransform();const a=r.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&xt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{a(),i&&i(),r.owner&&r.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Wl){const r=Wl[t];if(!r)continue;const{isEnabled:n,Feature:a}=r;if(!this.features[t]&&a&&n(this.props)&&(this.features[t]=new a(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):$t()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;n<HC.length;n++){const a=HC[n];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const i="on"+a,s=t[i];s&&(this.propEventSubscriptions[a]=this.on(a,s))}this.prevMotionValues=HX(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){const n=this.values.get(t);r!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);const r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=Hl(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(v6(n)||b6(n))?n=parseFloat(n):!eX(n)&&cs.test(r)&&(n=tz(t,r)),this.setBaseTarget(t,kr(n)?n.get():n)),kr(n)?n.get():n}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var i;const{initial:r}=this.props;let n;if(typeof r=="string"||typeof r=="object"){const s=K_(this.props,r,(i=this.presenceContext)==null?void 0:i.custom);s&&(n=s[t])}if(r&&n!==void 0)return n;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!kr(a)?a:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new __),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){F_.render(this.render)}}class Ez extends WX{constructor(){super(...arguments),this.KeyframeResolver=VY}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){return t.style?t.style[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;kr(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function Pz(e,{style:t,vars:r},n,a){const i=e.style;let s;for(s in t)i[s]=t[s];a==null||a.applyProjectionStyles(i,n);for(s in r)i.setProperty(s,r[s])}function GX(e){return window.getComputedStyle(e)}class KX extends Ez{constructor(){super(...arguments),this.type="html",this.renderInstance=Pz}readValueFromInstance(t,r){var n;if(Nc.has(r))return(n=this.projection)!=null&&n.isProjecting?lS(r):oY(t,r);{const a=GX(t),i=(P_(r)?a.getPropertyValue(r):a[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:r}){return _z(t,r)}build(t,r,n){H_(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return Y_(t,r,n)}}const Cz=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function YX(e,t,r,n){Pz(e,t,void 0,n);for(const a in t.attrs)e.setAttribute(Cz.has(a)?a:X_(a),t.attrs[a])}class XX extends Ez{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=$t}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(Nc.has(r)){const n=ez(r);return n&&n.default||0}return r=Cz.has(r)?r:X_(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return vz(t,r,n)}build(t,r,n){pz(t,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,r,n,a){YX(t,r,n,a)}mount(t){this.isSVGTag=gz(t.tagName),super.mount(t)}}const ZX=(e,t)=>G_(e)?new XX(t):new KX(t,{allowProjection:e!==_.Fragment});function El(e,t,r){const n=e.getProps();return K_(n,t,r!==void 0?r:n.custom,e)}const vS=e=>Array.isArray(e);function QX(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Hl(r))}function JX(e){return vS(e)?e[e.length-1]||0:e}function eZ(e,t){const r=El(e,t);let{transitionEnd:n={},transition:a={},...i}=r||{};i={...i,...n};for(const s in i){const o=JX(i[s]);QX(e,s,o)}}function tZ(e){return!!(kr(e)&&e.add)}function xS(e,t){const r=e.getValue("willChange");if(tZ(r))return r.add(t);if(!r&&ti.WillChange){const n=new ti.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function Az(e){return e.props[xz]}const rZ=e=>e!==null;function nZ(e,{repeat:t,repeatType:r="loop"},n){const a=e.filter(rZ),i=t&&r!=="loop"&&t%2===1?0:a.length-1;return a[i]}const aZ={type:"spring",stiffness:500,damping:25,restSpeed:10},iZ=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),sZ={type:"keyframes",duration:.8},oZ={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},lZ=(e,{keyframes:t})=>t.length>2?sZ:Nc.has(e)?e.startsWith("scale")?iZ(t[1]):aZ:oZ;function cZ({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:a,repeat:i,repeatType:s,repeatDelay:o,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const Z_=(e,t,r,n={},a,i)=>s=>{const o=L_(n,e)||{},l=o.delay||n.delay||0;let{elapsed:c=0}=n;c=c-ya(l);const d={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-c,onUpdate:h=>{t.set(h),o.onUpdate&&o.onUpdate(h)},onComplete:()=>{s(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:i?void 0:a};cZ(o)||Object.assign(d,lZ(e,d)),d.duration&&(d.duration=ya(d.duration)),d.repeatDelay&&(d.repeatDelay=ya(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(hS(d),d.delay===0&&(f=!0)),(ti.instantAnimations||ti.skipAnimations)&&(f=!0,hS(d),d.delay=0),d.allowFlatten=!o.type&&!o.ease,f&&!i&&t.get()!==void 0){const h=nZ(d.keyframes,o);if(h!==void 0){xt.update(()=>{d.onUpdate(h),d.onComplete()});return}}return o.isSync?new D_(d):new AY(d)};function uZ({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function Tz(e,t,{delay:r=0,transitionOverride:n,type:a}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:s,...o}=t;n&&(i=n);const l=[],c=a&&e.animationState&&e.animationState.getState()[a];for(const d in o){const f=e.getValue(d,e.latestValues[d]??null),h=o[d];if(h===void 0||c&&uZ(c,d))continue;const p={delay:r,...L_(i||{},d)},g=f.get();if(g!==void 0&&!f.isAnimating&&!Array.isArray(h)&&h===g&&!p.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const x=Az(e);if(x){const y=window.MotionHandoffAnimation(x,d,xt);y!==null&&(p.startTime=y,m=!0)}}xS(e,d),f.start(Z_(d,f,h,e.shouldReduceMotion&&Z6.has(d)?{type:!1}:p,e,m));const b=f.animation;b&&l.push(b)}return s&&Promise.all(l).then(()=>{xt.update(()=>{s&&eZ(e,s)})}),l}function Oz(e,t,r,n=0,a=1){const i=Array.from(e).sort((c,d)=>c.sortNodePosition(d)).indexOf(t),s=e.size,o=(s-1)*n;return typeof r=="function"?r(i,s):a===1?i*n:o-i*n}function bS(e,t,r={}){var l;const n=El(e,t,r.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(a=r.transitionOverride);const i=n?()=>Promise.all(Tz(e,n,r)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=a;return dZ(e,t,c,d,f,h,r)}:()=>Promise.resolve(),{when:o}=a;if(o){const[c,d]=o==="beforeChildren"?[i,s]:[s,i];return c().then(()=>d())}else return Promise.all([i(),s(r.delay)])}function dZ(e,t,r=0,n=0,a=0,i=1,s){const o=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),o.push(bS(l,t,{...s,delay:r+(typeof n=="function"?0:n)+Oz(e.variantChildren,l,n,a,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(o)}function fZ(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const a=t.map(i=>bS(e,i,r));n=Promise.all(a)}else if(typeof t=="string")n=bS(e,t,r);else{const a=typeof t=="function"?El(e,t,r.custom):t;n=Promise.all(Tz(e,a,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}function Mz(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}const hZ=U_.length;function Rz(e){if(!e)return;if(!e.isControllingVariants){const r=e.parent?Rz(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}const t={};for(let r=0;r<hZ;r++){const n=U_[r],a=e.props[n];(Cd(a)||a===!1)&&(t[n]=a)}return t}const pZ=[...q_].reverse(),mZ=q_.length;function gZ(e){return t=>Promise.all(t.map(({animation:r,options:n})=>fZ(e,r,n)))}function yZ(e){let t=gZ(e),r=WC(),n=!0;const a=l=>(c,d)=>{var h;const f=El(e,d,l==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(f){const{transition:p,transitionEnd:g,...m}=f;c={...c,...m,...g}}return c};function i(l){t=l(e)}function s(l){const{props:c}=e,d=Rz(e.parent)||{},f=[],h=new Set;let p={},g=1/0;for(let b=0;b<mZ;b++){const x=pZ[b],y=r[x],v=c[x]!==void 0?c[x]:d[x],w=Cd(v),j=x===l?y.isActive:null;j===!1&&(g=b);let k=v===d[x]&&v!==c[x]&&w;if(k&&n&&e.manuallyAnimateOnMount&&(k=!1),y.protectedKeys={...p},!y.isActive&&j===null||!v&&!y.prevProp||T0(v)||typeof v=="boolean")continue;const S=vZ(y.prevProp,v);let N=S||x===l&&y.isActive&&!k&&w||b>g&&w,E=!1;const A=Array.isArray(v)?v:[v];let C=A.reduce(a(x),{});j===!1&&(C={});const{prevResolvedValues:M={}}=y,T={...M,...C},P=L=>{N=!0,h.has(L)&&(E=!0,h.delete(L)),y.needsAnimating[L]=!0;const I=e.getValue(L);I&&(I.liveStyle=!1)};for(const L in T){const I=C[L],R=M[L];if(p.hasOwnProperty(L))continue;let z=!1;vS(I)&&vS(R)?z=!Mz(I,R):z=I!==R,z?I!=null?P(L):h.add(L):I!==void 0&&h.has(L)?P(L):y.protectedKeys[L]=!0}y.prevProp=v,y.prevResolvedValues=C,y.isActive&&(p={...p,...C}),n&&e.blockInitialAnimation&&(N=!1);const D=k&&S;N&&(!D||E)&&f.push(...A.map(L=>{const I={type:x};if(typeof L=="string"&&n&&!D&&e.manuallyAnimateOnMount&&e.parent){const{parent:R}=e,z=El(R,L);if(R.enteringChildren&&z){const{delayChildren:V}=z.transition||{};I.delay=Oz(R.enteringChildren,e,V)}}return{animation:L,options:I}}))}if(h.size){const b={};if(typeof c.initial!="boolean"){const x=El(e,Array.isArray(c.initial)?c.initial[0]:c.initial);x&&x.transition&&(b.transition=x.transition)}h.forEach(x=>{const y=e.getBaseTarget(x),v=e.getValue(x);v&&(v.liveStyle=!0),b[x]=y??null}),f.push({animation:b})}let m=!!f.length;return n&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(m=!1),n=!1,m?t(f):Promise.resolve()}function o(l,c){var f;if(r[l].isActive===c)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(h=>{var p;return(p=h.animationState)==null?void 0:p.setActive(l,c)}),r[l].isActive=c;const d=s(l);for(const h in r)r[h].protectedKeys={};return d}return{animateChanges:s,setActive:o,setAnimateFunction:i,getState:()=>r,reset:()=>{r=WC()}}}function vZ(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Mz(t,e):!1}function Es(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function WC(){return{animate:Es(!0),whileInView:Es(),whileHover:Es(),whileTap:Es(),whileDrag:Es(),whileFocus:Es(),exit:Es()}}class xs{constructor(t){this.isMounted=!1,this.node=t}update(){}}class xZ extends xs{constructor(t){super(t),t.animationState||(t.animationState=yZ(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();T0(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let bZ=0;class wZ extends xs{constructor(){super(...arguments),this.id=bZ++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const a=this.node.animationState.setActive("exit",!t);r&&!t&&a.then(()=>{r(this.id)})}mount(){const{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const jZ={animation:{Feature:xZ},exit:{Feature:wZ}};function Td(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function Cf(e){return{point:{x:e.pageX,y:e.pageY}}}const SZ=e=>t=>B_(t)&&e(t,Cf(t));function Qu(e,t,r,n){return Td(e,t,SZ(r),n)}const $z=1e-4,kZ=1-$z,_Z=1+$z,Dz=.01,NZ=0-Dz,EZ=0+Dz;function Pr(e){return e.max-e.min}function PZ(e,t,r){return Math.abs(e-t)<=r}function GC(e,t,r,n=.5){e.origin=n,e.originPoint=_t(t.min,t.max,e.origin),e.scale=Pr(r)/Pr(t),e.translate=_t(r.min,r.max,e.origin)-e.originPoint,(e.scale>=kZ&&e.scale<=_Z||isNaN(e.scale))&&(e.scale=1),(e.translate>=NZ&&e.translate<=EZ||isNaN(e.translate))&&(e.translate=0)}function Ju(e,t,r,n){GC(e.x,t.x,r.x,n?n.originX:void 0),GC(e.y,t.y,r.y,n?n.originY:void 0)}function KC(e,t,r){e.min=r.min+t.min,e.max=e.min+Pr(t)}function CZ(e,t,r){KC(e.x,t.x,r.x),KC(e.y,t.y,r.y)}function YC(e,t,r){e.min=t.min-r.min,e.max=e.min+Pr(t)}function ed(e,t,r){YC(e.x,t.x,r.x),YC(e.y,t.y,r.y)}function mn(e){return[e("x"),e("y")]}const Iz=({current:e})=>e?e.ownerDocument.defaultView:null,XC=(e,t)=>Math.abs(e-t);function AZ(e,t){const r=XC(e.x,t.x),n=XC(e.y,t.y);return Math.sqrt(r**2+n**2)}class Lz{constructor(t,r,{transformPagePoint:n,contextWindow:a=window,dragSnapToOrigin:i=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=Ty(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=AZ(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!g)return;const{point:m}=h,{timestamp:b}=dr;this.history.push({...m,timestamp:b});const{onStart:x,onMove:y}=this.handlers;p||(x&&x(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,h)},this.handlePointerMove=(h,p)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=Ay(p,this.transformPagePoint),xt.update(this.updatePoint,!0)},this.handlePointerUp=(h,p)=>{this.end();const{onEnd:g,onSessionEnd:m,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Ty(h.type==="pointercancel"?this.lastMoveEventInfo:Ay(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(h,x),m&&m(h,x)},!B_(t))return;this.dragSnapToOrigin=i,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=s,this.contextWindow=a||window;const o=Cf(t),l=Ay(o,this.transformPagePoint),{point:c}=l,{timestamp:d}=dr;this.history=[{...c,timestamp:d}];const{onSessionStart:f}=r;f&&f(t,Ty(l,this.history)),this.removeListeners=Nf(Qu(this.contextWindow,"pointermove",this.handlePointerMove),Qu(this.contextWindow,"pointerup",this.handlePointerUp),Qu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ls(this.updatePoint)}}function Ay(e,t){return t?{point:t(e.point)}:e}function ZC(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ty({point:e},t){return{point:e,delta:ZC(e,zz(t)),offset:ZC(e,TZ(t)),velocity:OZ(t,.1)}}function TZ(e){return e[0]}function zz(e){return e[e.length-1]}function OZ(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const a=zz(e);for(;r>=0&&(n=e[r],!(a.timestamp-n.timestamp>ya(t)));)r--;if(!n)return{x:0,y:0};const i=bn(a.timestamp-n.timestamp);if(i===0)return{x:0,y:0};const s={x:(a.x-n.x)/i,y:(a.y-n.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function MZ(e,{min:t,max:r},n){return t!==void 0&&e<t?e=n?_t(t,e,n.min):Math.max(e,t):r!==void 0&&e>r&&(e=n?_t(r,e,n.max):Math.min(e,r)),e}function QC(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function RZ(e,{top:t,left:r,bottom:n,right:a}){return{x:QC(e.x,r,a),y:QC(e.y,t,n)}}function JC(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function $Z(e,t){return{x:JC(e.x,t.x),y:JC(e.y,t.y)}}function DZ(e,t){let r=.5;const n=Pr(e),a=Pr(t);return a>n?r=Nd(t.min,t.max-n,e.min):n>a&&(r=Nd(e.min,e.max-a,t.min)),ei(0,1,r)}function IZ(e,t){const r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}const wS=.35;function LZ(e=wS){return e===!1?e=0:e===!0&&(e=wS),{x:eA(e,"left","right"),y:eA(e,"top","bottom")}}function eA(e,t,r){return{min:tA(e,t),max:tA(e,r)}}function tA(e,t){return typeof e=="number"?e:e[t]||0}const zZ=new WeakMap;class FZ{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=$t(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:n}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(Cf(f).point)},s=(f,h)=>{const{drag:p,dragPropagation:g,onDragStart:m}=this.getProps();if(p&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=WY(p),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),mn(x=>{let y=this.getAxisMotionValue(x).get()||0;if(va.test(y)){const{projection:v}=this.visualElement;if(v&&v.layout){const w=v.layout.layoutBox[x];w&&(y=Pr(w)*(parseFloat(y)/100))}}this.originPoint[x]=y}),m&&xt.postRender(()=>m(f,h)),xS(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:m,onDrag:b}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:x}=h;if(g&&this.currentDirection===null){this.currentDirection=BZ(x),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",h.point,x),this.updateAxis("y",h.point,x),this.visualElement.render(),b&&b(f,h)},l=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>mn(f=>{var h;return this.getAnimationState(f)==="paused"&&((h=this.getAxisMotionValue(f).animation)==null?void 0:h.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new Lz(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:n,contextWindow:Iz(this.visualElement)})}stop(t,r){const n=t||this.latestPointerEvent,a=r||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!a||!n)return;const{velocity:s}=a;this.startAnimation(s);const{onDragEnd:o}=this.getProps();o&&xt.postRender(()=>o(n,a))}cancel(){this.isDragging=!1;const{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,n){const{drag:a}=this.getProps();if(!n||!gh(t,a,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=MZ(s,this.constraints[t],this.elastic[t])),i.set(s)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,a=this.constraints;t&&dl(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=RZ(n.layoutBox,t):this.constraints=!1,this.elastic=LZ(r),a!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&mn(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=IZ(n.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!dl(t))return!1;const n=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const i=VX(n,a.root,this.visualElement.getTransformPagePoint());let s=$Z(a.layout.layoutBox,i);if(r){const o=r(zX(s));this.hasMutatedConstraints=!!o,o&&(s=jz(o))}return s}startAnimation(t){const{drag:r,dragMomentum:n,dragElastic:a,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},c=mn(d=>{if(!gh(d,r,this.currentDirection))return;let f=l&&l[d]||{};s&&(f={min:0,max:0});const h=a?200:1e6,p=a?40:1e7,g={type:"inertia",velocity:n?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(c).then(o)}startAxisValueAnimation(t,r){const n=this.getAxisMotionValue(t);return xS(this.visualElement,t),n.start(Z_(t,n,0,r,this.visualElement,!1))}stopAnimation(){mn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){mn(t=>{var r;return(r=this.getAxisMotionValue(t).animation)==null?void 0:r.pause()})}getAnimationState(t){var r;return(r=this.getAxisMotionValue(t).animation)==null?void 0:r.state}getAxisMotionValue(t){const r=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),a=n[r];return a||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){mn(r=>{const{drag:n}=this.getProps();if(!gh(r,n,this.currentDirection))return;const{projection:a}=this.visualElement,i=this.getAxisMotionValue(r);if(a&&a.layout){const{min:s,max:o}=a.layout.layoutBox[r];i.set(t[r]-_t(s,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!dl(r)||!n||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};mn(s=>{const o=this.getAxisMotionValue(s);if(o&&this.constraints!==!1){const l=o.get();a[s]=DZ({min:l,max:l},this.constraints[s])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),mn(s=>{if(!gh(s,t,null))return;const o=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];o.set(_t(l,c,a[s]))})}addListeners(){if(!this.visualElement.current)return;zZ.set(this.visualElement,this);const t=this.visualElement.current,r=Qu(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),n=()=>{const{dragConstraints:l}=this.getProps();dl(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:a}=this.visualElement,i=a.addEventListener("measure",n);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),xt.read(n);const s=Td(window,"resize",()=>this.scalePositionWithinConstraints()),o=a.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(mn(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=l[d].translate,f.set(f.get()+l[d].translate))}),this.visualElement.render())});return()=>{s(),r(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:a=!1,dragConstraints:i=!1,dragElastic:s=wS,dragMomentum:o=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:a,dragConstraints:i,dragElastic:s,dragMomentum:o}}}function gh(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function BZ(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}class VZ extends xs{constructor(t){super(t),this.removeGroupControls=_n,this.removeListeners=_n,this.controls=new FZ(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_n}unmount(){this.removeGroupControls(),this.removeListeners()}}const rA=e=>(t,r)=>{e&&xt.postRender(()=>e(t,r))};class qZ extends xs{constructor(){super(...arguments),this.removePointerDownListener=_n}onPointerDown(t){this.session=new Lz(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Iz(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:a}=this.node.getProps();return{onSessionStart:rA(t),onStart:rA(r),onMove:n,onEnd:(i,s)=>{delete this.session,a&&xt.postRender(()=>a(i,s))}}}mount(){this.removePointerDownListener=Qu(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const fp={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function nA(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ru={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(we.test(e))e=parseFloat(e);else return e;const r=nA(e,t.target.x),n=nA(e,t.target.y);return`${r}% ${n}%`}},UZ={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,a=cs.parse(e);if(a.length>5)return n;const i=cs.createTransformer(e),s=typeof a[0]!="number"?1:0,o=r.x.scale*t.x,l=r.y.scale*t.y;a[0+s]/=o,a[1+s]/=l;const c=_t(o,l,.5);return typeof a[2+s]=="number"&&(a[2+s]/=c),typeof a[3+s]=="number"&&(a[3+s]/=c),i(a)}};let Oy=!1;class HZ extends _.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:a}=this.props,{projection:i}=t;hX(WZ),i&&(r.group&&r.group.add(i),n&&n.register&&a&&n.register(i),Oy&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),fp.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:r,visualElement:n,drag:a,isPresent:i}=this.props,{projection:s}=n;return s&&(s.isPresent=i,Oy=!0,a||t.layoutDependency!==r||r===void 0||t.isPresent!==i?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||xt.postRender(()=>{const o=s.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),F_.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:a}=t;Oy=!0,a&&(a.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(a),n&&n.deregister&&n.deregister(a))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Fz(e){const[t,r]=lz(),n=_.useContext(v_);return u.jsx(HZ,{...e,layoutGroup:n,switchLayoutGroup:_.useContext(bz),isPresent:t,safeToRemove:r})}const WZ={borderRadius:{...ru,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ru,borderTopRightRadius:ru,borderBottomLeftRadius:ru,borderBottomRightRadius:ru,boxShadow:UZ};function GZ(e,t,r){const n=kr(e)?e:Hl(e);return n.start(Z_("",n,t,r)),n.animation}const KZ=(e,t)=>e.depth-t.depth;class YZ{constructor(){this.children=[],this.isDirty=!1}add(t){w_(this.children,t),this.isDirty=!0}remove(t){j_(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(KZ),this.isDirty=!1,this.children.forEach(t)}}function XZ(e,t){const r=Fr.now(),n=({timestamp:a})=>{const i=a-r;i>=t&&(ls(n),e(i-t))};return xt.setup(n,!0),()=>ls(n)}const Bz=["TopLeft","TopRight","BottomLeft","BottomRight"],ZZ=Bz.length,aA=e=>typeof e=="string"?parseFloat(e):e,iA=e=>typeof e=="number"||we.test(e);function QZ(e,t,r,n,a,i){a?(e.opacity=_t(0,r.opacity??1,JZ(n)),e.opacityExit=_t(t.opacity??1,0,eQ(n))):i&&(e.opacity=_t(t.opacity??1,r.opacity??1,n));for(let s=0;s<ZZ;s++){const o=`border${Bz[s]}Radius`;let l=sA(t,o),c=sA(r,o);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||iA(l)===iA(c)?(e[o]=Math.max(_t(aA(l),aA(c),n),0),(va.test(c)||va.test(l))&&(e[o]+="%")):e[o]=c}(t.rotate||r.rotate)&&(e.rotate=_t(t.rotate||0,r.rotate||0,n))}function sA(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const JZ=Vz(0,.5,P6),eQ=Vz(.5,.95,_n);function Vz(e,t,r){return n=>n<e?0:n>t?1:r(Nd(e,t,n))}function oA(e,t){e.min=t.min,e.max=t.max}function dn(e,t){oA(e.x,t.x),oA(e.y,t.y)}function lA(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function cA(e,t,r,n,a){return e-=t,e=tm(e,1/r,n),a!==void 0&&(e=tm(e,1/a,n)),e}function tQ(e,t=0,r=1,n=.5,a,i=e,s=e){if(va.test(t)&&(t=parseFloat(t),t=_t(s.min,s.max,t/100)-s.min),typeof t!="number")return;let o=_t(i.min,i.max,n);e===i&&(o-=t),e.min=cA(e.min,t,r,o,a),e.max=cA(e.max,t,r,o,a)}function uA(e,t,[r,n,a],i,s){tQ(e,t[r],t[n],t[a],t.scale,i,s)}const rQ=["x","scaleX","originX"],nQ=["y","scaleY","originY"];function dA(e,t,r,n){uA(e.x,t,rQ,r?r.x:void 0,n?n.x:void 0),uA(e.y,t,nQ,r?r.y:void 0,n?n.y:void 0)}function fA(e){return e.translate===0&&e.scale===1}function qz(e){return fA(e.x)&&fA(e.y)}function hA(e,t){return e.min===t.min&&e.max===t.max}function aQ(e,t){return hA(e.x,t.x)&&hA(e.y,t.y)}function pA(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Uz(e,t){return pA(e.x,t.x)&&pA(e.y,t.y)}function mA(e){return Pr(e.x)/Pr(e.y)}function gA(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class iQ{constructor(){this.members=[]}add(t){w_(this.members,t),t.scheduleRender()}remove(t){if(j_(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){const r=this.members.findIndex(a=>t===a);if(r===0)return!1;let n;for(let a=r;a>=0;a--){const i=this.members[a];if(i.isPresent!==!1){n=i;break}}return n?(this.promote(n),!0):!1}promote(t,r){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,r&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:a}=t.options;a===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:r,resumingFrom:n}=t;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function sQ(e,t,r){let n="";const a=e.x.translate/t.x,i=e.y.translate/t.y,s=(r==null?void 0:r.z)||0;if((a||i||s)&&(n=`translate3d(${a}px, ${i}px, ${s}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:c,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:g}=r;c&&(n=`perspective(${c}px) ${n}`),d&&(n+=`rotate(${d}deg) `),f&&(n+=`rotateX(${f}deg) `),h&&(n+=`rotateY(${h}deg) `),p&&(n+=`skewX(${p}deg) `),g&&(n+=`skewY(${g}deg) `)}const o=e.x.scale*t.x,l=e.y.scale*t.y;return(o!==1||l!==1)&&(n+=`scale(${o}, ${l})`),n||"none"}const My=["","X","Y","Z"],oQ=1e3;let lQ=0;function Ry(e,t,r,n){const{latestValues:a}=t;a[e]&&(r[e]=a[e],t.setStaticValue(e,0),n&&(n[e]=0))}function Hz(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=Az(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:a,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",xt,!(a||i))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&Hz(n)}function Wz({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:a}){return class{constructor(s={},o=t==null?void 0:t()){this.id=lQ++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(dQ),this.nodes.forEach(mQ),this.nodes.forEach(gQ),this.nodes.forEach(fQ)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new YZ)}addEventListener(s,o){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new __),this.eventHandlers.get(s).add(o)}notifyListeners(s,...o){const l=this.eventHandlers.get(s);l&&l.notify(...o)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=oz(s)&&!QY(s),this.instance=s;const{layoutId:o,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||o)&&(this.isLayoutDirty=!0),e){let d,f=0;const h=()=>this.root.updateBlockedByResize=!1;xt.read(()=>{f=window.innerWidth}),e(s,()=>{const p=window.innerWidth;p!==f&&(f=p,this.root.updateBlockedByResize=!0,d&&d(),d=XZ(h,250),fp.hasAnimatedSinceResize&&(fp.hasAnimatedSinceResize=!1,this.nodes.forEach(xA)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&c&&(o||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||wQ,{onLayoutAnimationStart:m,onLayoutAnimationComplete:b}=c.getProps(),x=!this.targetLayout||!Uz(this.targetLayout,p),y=!f&&h;if(this.options.layoutRoot||this.resumeFrom||y||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...L_(g,"layout"),onPlay:m,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(d,y)}else f||xA(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ls(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(yQ),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Hz(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:o,layout:l}=this.options;if(o===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(yA);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(vA);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(pQ),this.nodes.forEach(cQ),this.nodes.forEach(uQ)):this.nodes.forEach(vA),this.clearAllSnapshots();const o=Fr.now();dr.delta=ei(0,1e3/60,o-dr.timestamp),dr.timestamp=o,dr.isProcessing=!0,jy.update.process(dr),jy.preRender.process(dr),jy.render.process(dr),dr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,F_.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(hQ),this.sharedNodes.forEach(vQ)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,xt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){xt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Pr(this.snapshot.measuredBox.x)&&!Pr(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=$t(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(o=!1),o&&this.instance){const l=n(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!a)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!qz(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;s&&this.instance&&(o||Ts(this.latestValues)||d)&&(a(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const o=this.measurePageBox();let l=this.removeElementScroll(o);return s&&(l=this.removeTransform(l)),jQ(l),{animationId:this.root.animationId,measuredBox:o,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:s}=this.options;if(!s)return $t();const o=s.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(SQ))){const{scroll:d}=this.root;d&&(fl(o.x,d.offset.x),fl(o.y,d.offset.y))}return o}removeElementScroll(s){var l;const o=$t();if(dn(o,s),(l=this.scroll)!=null&&l.wasRoot)return o;for(let c=0;c<this.path.length;c++){const d=this.path[c],{scroll:f,options:h}=d;d!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&dn(o,s),fl(o.x,f.offset.x),fl(o.y,f.offset.y))}return o}applyTransform(s,o=!1){const l=$t();dn(l,s);for(let c=0;c<this.path.length;c++){const d=this.path[c];!o&&d.options.layoutScroll&&d.scroll&&d!==d.root&&hl(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Ts(d.latestValues)&&hl(l,d.latestValues)}return Ts(this.latestValues)&&hl(l,this.latestValues),l}removeTransform(s){const o=$t();dn(o,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Ts(c.latestValues))continue;mS(c.latestValues)&&c.updateSnapshot();const d=$t(),f=c.measurePageBox();dn(d,f),dA(o,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return Ts(this.latestValues)&&dA(o,this.latestValues),o}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==dr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var h;const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==o;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=dr.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=$t(),this.relativeTargetOrigin=$t(),ed(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),dn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=$t(),this.targetWithTransforms=$t()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),CZ(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):dn(this.target,this.layout.layoutBox),kz(this.target,this.targetDelta)):dn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=$t(),this.relativeTargetOrigin=$t(),ed(this.relativeTargetOrigin,this.target,p.target),dn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||mS(this.parent.latestValues)||Sz(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var g;const s=this.getLead(),o=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(l=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===dr.timestamp&&(l=!1),l)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;dn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;BX(this.layoutCorrected,this.treeScale,this.path,o),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=$t());const{target:p}=s;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(lA(this.prevProjectionDelta.x,this.projectionDelta.x),lA(this.prevProjectionDelta.y,this.projectionDelta.y)),Ju(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!gA(this.projectionDelta.x,this.prevProjectionDelta.x)||!gA(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var o;if((o=this.options.visualElement)==null||o.scheduleRender(),s){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=pl(),this.projectionDelta=pl(),this.projectionDeltaWithTransform=pl()}setAnimationOrigin(s,o=!1){const l=this.snapshot,c=l?l.latestValues:{},d={...this.latestValues},f=pl();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const h=$t(),p=l?l.source:void 0,g=this.layout?this.layout.source:void 0,m=p!==g,b=this.getStack(),x=!b||b.members.length<=1,y=!!(m&&!x&&this.options.crossfade===!0&&!this.path.some(bQ));this.animationProgress=0;let v;this.mixTargetDelta=w=>{const j=w/1e3;bA(f.x,s.x,j),bA(f.y,s.y,j),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ed(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),xQ(this.relativeTarget,this.relativeTargetOrigin,h,j),v&&aQ(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=$t()),dn(v,this.relativeTarget)),m&&(this.animationValues=d,QZ(d,c,this.latestValues,j,y,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){var o,l,c;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(ls(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=xt.update(()=>{fp.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Hl(0)),this.currentAnimation=GZ(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),s.onUpdate&&s.onUpdate(d)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(oQ),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:o,target:l,layout:c,latestValues:d}=s;if(!(!o||!l||!c)){if(this!==s&&this.layout&&c&&Gz(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||$t();const f=Pr(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+f;const h=Pr(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+h}dn(o,l),hl(o,d),Ju(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(s,o){this.sharedNodes.has(s)||this.sharedNodes.set(s,new iQ),this.sharedNodes.get(s).add(o);const c=o.options.initialPromotionConfig;o.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(o):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var o;const{layoutId:s}=this.options;return s?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:s}=this.options;return s?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:o,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let o=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const c={};l.z&&Ry("z",s,c,this.animationValues);for(let d=0;d<My.length;d++)Ry(`rotate${My[d]}`,s,c,this.animationValues),Ry(`skew${My[d]}`,s,c,this.animationValues);s.render();for(const d in c)s.setStaticValue(d,c[d]),this.animationValues&&(this.animationValues[d]=c[d]);s.scheduleRender()}applyProjectionStyles(s,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=dp(o==null?void 0:o.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=dp(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Ts(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const d=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=sQ(this.projectionDeltaWithTransform,this.treeScale,d);l&&(f=l(d,f)),s.transform=f;const{x:h,y:p}=this.projectionDelta;s.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,c.animationValues?s.opacity=c===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:s.opacity=c===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const g in Ad){if(d[g]===void 0)continue;const{correct:m,applyTo:b,isCSSVariable:x}=Ad[g],y=f==="none"?d[g]:m(d[g],c);if(b){const v=b.length;for(let w=0;w<v;w++)s[b[w]]=y}else x?this.options.visualElement.renderState.vars[g]=y:s[g]=y}this.options.layoutId&&(s.pointerEvents=c===this?dp(o==null?void 0:o.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var o;return(o=s.currentAnimation)==null?void 0:o.stop()}),this.root.nodes.forEach(yA),this.root.sharedNodes.clear()}}}function cQ(e){e.updateLayout()}function uQ(e){var r;const t=((r=e.resumeFrom)==null?void 0:r.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:a}=e.layout,{animationType:i}=e.options,s=t.source!==e.layout.source;i==="size"?mn(f=>{const h=s?t.measuredBox[f]:t.layoutBox[f],p=Pr(h);h.min=n[f].min,h.max=h.min+p}):Gz(i,t.layoutBox,n)&&mn(f=>{const h=s?t.measuredBox[f]:t.layoutBox[f],p=Pr(n[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const o=pl();Ju(o,n,t.layoutBox);const l=pl();s?Ju(l,e.applyTransform(a,!0),t.measuredBox):Ju(l,n,t.layoutBox);const c=!qz(o);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const g=$t();ed(g,t.layoutBox,h.layoutBox);const m=$t();ed(m,n,p.layoutBox),Uz(g,m)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:l,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function dQ(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function fQ(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function hQ(e){e.clearSnapshot()}function yA(e){e.clearMeasurements()}function vA(e){e.isLayoutDirty=!1}function pQ(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function xA(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function mQ(e){e.resolveTargetDelta()}function gQ(e){e.calcProjection()}function yQ(e){e.resetSkewAndRotation()}function vQ(e){e.removeLeadSnapshot()}function bA(e,t,r){e.translate=_t(t.translate,0,r),e.scale=_t(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function wA(e,t,r,n){e.min=_t(t.min,r.min,n),e.max=_t(t.max,r.max,n)}function xQ(e,t,r,n){wA(e.x,t.x,r.x,n),wA(e.y,t.y,r.y,n)}function bQ(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const wQ={duration:.45,ease:[.4,0,.1,1]},jA=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),SA=jA("applewebkit/")&&!jA("chrome/")?Math.round:_n;function kA(e){e.min=SA(e.min),e.max=SA(e.max)}function jQ(e){kA(e.x),kA(e.y)}function Gz(e,t,r){return e==="position"||e==="preserve-aspect"&&!PZ(mA(t),mA(r),.2)}function SQ(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const kQ=Wz({attachResizeListener:(e,t)=>Td(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),$y={current:void 0},Kz=Wz({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!$y.current){const e=new kQ({});e.mount(window),e.setOptions({layoutScroll:!0}),$y.current=e}return $y.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),_Q={pan:{Feature:qZ},drag:{Feature:VZ,ProjectionNode:Kz,MeasureLayout:Fz}};function _A(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");const a="onHover"+r,i=n[a];i&&xt.postRender(()=>i(t,Cf(t)))}class NQ extends xs{mount(){const{current:t}=this.node;t&&(this.unmount=GY(t,(r,n)=>(_A(this.node,n,"Start"),a=>_A(this.node,a,"End"))))}unmount(){}}class EQ extends xs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Nf(Td(this.node.current,"focus",()=>this.onFocus()),Td(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function NA(e,t,r){const{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");const a="onTap"+(r==="End"?"":r),i=n[a];i&&xt.postRender(()=>i(t,Cf(t)))}class PQ extends xs{mount(){const{current:t}=this.node;t&&(this.unmount=ZY(t,(r,n)=>(NA(this.node,n,"Start"),(a,{success:i})=>NA(this.node,a,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const jS=new WeakMap,Dy=new WeakMap,CQ=e=>{const t=jS.get(e.target);t&&t(e)},AQ=e=>{e.forEach(CQ)};function TQ({root:e,...t}){const r=e||document;Dy.has(r)||Dy.set(r,{});const n=Dy.get(r),a=JSON.stringify(t);return n[a]||(n[a]=new IntersectionObserver(AQ,{root:e,...t})),n[a]}function OQ(e,t,r){const n=TQ(t);return jS.set(e,r),n.observe(e),()=>{jS.delete(e),n.unobserve(e)}}const MQ={some:0,all:1};class RQ extends xs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:a="some",once:i}=t,s={root:r?r.current:void 0,rootMargin:n,threshold:typeof a=="number"?a:MQ[a]},o=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=c?d:f;h&&h(l)};return OQ(this.node.current,s,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:r}=this.node;["amount","margin","root"].some($Q(t,r))&&this.startObserver()}unmount(){}}function $Q({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}const DQ={inView:{Feature:RQ},tap:{Feature:PQ},focus:{Feature:EQ},hover:{Feature:NQ}},IQ={layout:{ProjectionNode:Kz,MeasureLayout:Fz}},LQ={...jZ,...DQ,..._Q,...IQ},Me=LX(LQ,ZX),Yz=_.createContext();function zQ({children:e}){const[t,r]=_.useState([]),n=_.useCallback((c,d="info",f=5e3)=>{const h=Date.now()+Math.random();r(p=>[...p,{id:h,message:c,type:d,duration:f}]),f>0&&setTimeout(()=>{a(h)},f)},[]),a=_.useCallback(c=>{r(d=>d.filter(f=>f.id!==c))},[]),i=_.useCallback((c,d)=>n(c,"success",d),[n]),s=_.useCallback((c,d)=>n(c,"error",d),[n]),o=_.useCallback((c,d)=>n(c,"warning",d),[n]),l=_.useCallback((c,d)=>n(c,"info",d),[n]);return u.jsxs(Yz.Provider,{value:{success:i,error:s,warning:o,info:l,addToast:n},children:[e,u.jsx(FQ,{toasts:t,onRemove:a})]})}function Xz(){const e=_.useContext(Yz);if(!e)throw new Error("useToast must be used within ToastProvider");return e}function FQ({toasts:e,onRemove:t}){return u.jsx("div",{className:"fixed top-4 right-4 z-50 flex flex-col gap-2 pointer-events-none",children:u.jsx(hi,{children:e.map(r=>u.jsx(BQ,{toast:r,onRemove:()=>t(r.id)},r.id))})})}function BQ({toast:e,onRemove:t}){const{message:r,type:n}=e,a={success:{icon:Lt,bgClass:"bg-emerald-50 dark:bg-emerald-900/20 border-emerald-200 dark:border-emerald-800",iconClass:"text-emerald-600 dark:text-emerald-400",textClass:"text-emerald-900 dark:text-emerald-100"},error:{icon:Sc,bgClass:"bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800",iconClass:"text-red-600 dark:text-red-400",textClass:"text-red-900 dark:text-red-100"},warning:{icon:OG,bgClass:"bg-amber-50 dark:bg-amber-900/20 border-amber-200 dark:border-amber-800",iconClass:"text-amber-600 dark:text-amber-400",textClass:"text-amber-900 dark:text-amber-100"},info:{icon:Gp,bgClass:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800",iconClass:"text-blue-600 dark:text-blue-400",textClass:"text-blue-900 dark:text-blue-100"}},{icon:i,bgClass:s,iconClass:o,textClass:l}=a[n]||a.info;return u.jsxs(Me.div,{initial:{opacity:0,y:-20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,x:100,scale:.95},transition:{duration:.2},className:`pointer-events-auto ${s} border rounded-lg shadow-lg p-4 pr-12 max-w-md relative`,children:[u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx(i,{className:`${o} shrink-0 mt-0.5`,size:20}),u.jsx("p",{className:`${l} text-sm font-medium leading-relaxed`,children:r})]}),u.jsx("button",{onClick:t,className:`absolute top-3 right-3 ${o} hover:opacity-70 transition-opacity`,children:u.jsx(No,{size:16})})]})}const VQ=[{title:"Workspace",items:[{icon:f6,label:"Dashboard",path:"/"},{icon:UG,label:"Projects",path:"/projects"}]},{title:"Automation",items:[{icon:Or,label:"Pipelines",path:"/pipelines"},{icon:kn,label:"Schedules",path:"/schedules"},{icon:Or,label:"Runs",path:"/runs"}]},{title:"Insights",items:[{icon:Zo,label:"Leaderboard",path:"/leaderboard"},{icon:ea,label:"Experiments",path:"/experiments"}]},{title:"Data & Observability",items:[{icon:Tr,label:"Assets",path:"/assets"},{icon:m6,label:"Traces",path:"/traces"},{icon:Ge,label:"Observability",path:"/observability"}]}],qQ=[{icon:ss,label:"Plugins",path:"/plugins"},{icon:Nl,label:"API Tokens",path:"/tokens"},{icon:g6,label:"Settings",path:"/settings"}];function UQ({collapsed:e,setCollapsed:t}){const r=vs();return u.jsxs(Me.aside,{initial:!1,animate:{width:e?80:256},className:"h-screen bg-white dark:bg-slate-800 border-r border-slate-200 dark:border-slate-700 flex flex-col shadow-sm z-20 relative",children:[u.jsxs("div",{className:"p-6 border-b border-slate-100 dark:border-slate-700 flex items-center gap-3 h-[73px]",children:[u.jsx("div",{className:"w-8 h-8 min-w-[32px] bg-primary-600 rounded-lg flex items-center justify-center shadow-lg shadow-primary-500/30",children:u.jsx(Or,{className:"text-white w-5 h-5"})}),u.jsx(hi,{children:!e&&u.jsx(Me.h1,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},exit:{opacity:0,x:-10},className:"text-xl font-bold text-slate-900 dark:text-white tracking-tight whitespace-nowrap overflow-hidden",children:"flowyml"})})]}),u.jsxs("nav",{className:"flex-1 p-4 space-y-4 overflow-y-auto overflow-x-hidden scrollbar-thin scrollbar-thumb-slate-200 dark:scrollbar-thumb-slate-700",children:[VQ.map(n=>u.jsxs("div",{className:"space-y-1",children:[u.jsx("div",{className:`px-4 text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wider transition-opacity duration-200 ${e?"opacity-0 h-0":"opacity-100"}`,children:n.title}),n.items.map(a=>u.jsx(EA,{to:a.path,icon:a.icon,label:a.label,collapsed:e,isActive:r.pathname===a.path},a.path))]},n.title)),u.jsx("div",{className:`px-4 py-2 text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wider mt-2 transition-opacity duration-200 ${e?"opacity-0 h-0":"opacity-100"}`,children:"Settings"}),qQ.map(n=>u.jsx(EA,{to:n.path,icon:n.icon,label:n.label,collapsed:e,isActive:r.pathname===n.path},n.path))]}),u.jsx("div",{className:"p-4 border-t border-slate-100 dark:border-slate-700",children:u.jsx("div",{className:`bg-slate-50 dark:bg-slate-900 rounded-lg p-4 border border-slate-100 dark:border-slate-700 transition-all duration-200 ${e?"p-2 flex justify-center":""}`,children:e?u.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-500",title:"Online"}):u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-xs font-medium text-slate-500 dark:text-slate-400 whitespace-nowrap",children:"flowyml v1.3.0"}),u.jsx("p",{className:"text-xs text-slate-400 dark:text-slate-500 mt-1 whitespace-nowrap",children:"Local Environment"})]})})}),u.jsx("button",{onClick:()=>t(!e),className:"absolute -right-3 top-20 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-full p-1 shadow-md text-slate-500 hover:text-primary-600 dark:hover:text-primary-400 transition-colors",children:e?u.jsx(fo,{size:14}):u.jsx(zG,{size:14})})]})}function EA({to:e,icon:t,label:r,collapsed:n,isActive:a}){return u.jsxs(jG,{to:e,className:`flex items-center gap-3 px-4 py-2.5 rounded-lg transition-all duration-200 group relative ${a?"bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-400 font-medium shadow-sm":"text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-700 hover:text-slate-900 dark:hover:text-white"}`,title:n?r:void 0,children:[u.jsx("span",{className:`transition-colors flex-shrink-0 ${a?"text-primary-600 dark:text-primary-400":"text-slate-400 group-hover:text-slate-600 dark:group-hover:text-slate-300"}`,children:u.jsx(t,{size:20})}),!n&&u.jsx("span",{className:"text-sm whitespace-nowrap overflow-hidden text-ellipsis",children:r}),n&&a&&u.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-1 h-8 bg-primary-600 rounded-r-full"})]})}function HQ(){const{selectedProject:e,projects:t,loading:r,selectProject:n,clearProject:a}=fi(),[i,s]=O.useState(!1),o=t.find(l=>l.name===e);return u.jsxs("div",{className:"relative",children:[u.jsxs("button",{onClick:()=>s(!i),className:"flex items-center gap-2 px-4 py-2 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors min-w-[200px]",children:[e?u.jsxs(u.Fragment,{children:[u.jsx(dC,{size:18,className:"text-primary-600 dark:text-primary-400"}),u.jsxs("div",{className:"flex-1 text-left",children:[u.jsx("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:(o==null?void 0:o.name)||e}),(o==null?void 0:o.description)&&u.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400 truncate max-w-[150px]",children:o.description})]})]}):u.jsxs(u.Fragment,{children:[u.jsx(Wp,{size:18,className:"text-slate-400"}),u.jsx("span",{className:"flex-1 text-left text-sm font-medium text-slate-700 dark:text-slate-300",children:"All Projects"})]}),u.jsx(u6,{size:16,className:`text-slate-400 transition-transform ${i?"rotate-180":""}`})]}),u.jsx(hi,{children:i&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>s(!1)}),u.jsxs(Me.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.15},className:"absolute top-full mt-2 left-0 w-full min-w-[280px] bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg shadow-xl z-20 max-h-[400px] overflow-y-auto",children:[u.jsxs("button",{onClick:()=>{a(),s(!1)},className:`w-full flex items-center gap-3 px-4 py-3 hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors ${e?"":"bg-primary-50 dark:bg-primary-900/20"}`,children:[u.jsx(Wp,{size:18,className:"text-slate-400"}),u.jsxs("div",{className:"flex-1 text-left",children:[u.jsx("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:"All Projects"}),u.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400",children:"View data from all projects"})]}),!e&&u.jsx("div",{className:"w-2 h-2 rounded-full bg-primary-600"})]}),u.jsx("div",{className:"border-t border-slate-200 dark:border-slate-700"}),r?u.jsx("div",{className:"px-4 py-8 text-center text-slate-500 dark:text-slate-400 text-sm",children:"Loading projects..."}):t.length===0?u.jsx("div",{className:"px-4 py-8 text-center text-slate-500 dark:text-slate-400 text-sm",children:"No projects yet"}):t.map(l=>u.jsxs("button",{onClick:()=>{n(l.name),s(!1)},className:`w-full flex items-center gap-3 px-4 py-3 hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors ${e===l.name?"bg-primary-50 dark:bg-primary-900/20":""}`,children:[u.jsx(dC,{size:18,className:e===l.name?"text-primary-600 dark:text-primary-400":"text-slate-400"}),u.jsxs("div",{className:"flex-1 text-left",children:[u.jsx("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:l.name}),l.description&&u.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400",children:l.description})]}),e===l.name&&u.jsx("div",{className:"w-2 h-2 rounded-full bg-primary-600"})]},l.name))]})]})})]})}let yh=null;const Zz=async()=>{if(yh)return yh;try{return yh=await(await fetch("/api/config")).json(),yh}catch(e){return console.error("Failed to fetch config:",e),{execution_mode:"local"}}},Qz=async()=>{const e=await Zz();return e.execution_mode==="remote"&&e.remote_server_url?e.remote_server_url:""},_e=async(e,t={})=>{const r=await Qz(),n=e.startsWith("/")?e:`/${e}`,a=`${r}${n}`;return fetch(a,t)},WQ=()=>{const[e,t]=_.useState(null),[r,n]=_.useState(!0);return _.useEffect(()=>{Zz().then(a=>{t(a),n(!1)})},[]),{config:e,loading:r}};function GQ(){const{theme:e,toggleTheme:t}=PG(),r=vs(),{config:n,loading:a}=WQ(),i=r.pathname.split("/").filter(l=>l),s=!a&&(n==null?void 0:n.execution_mode)==="remote",o=s&&Array.isArray(n==null?void 0:n.remote_services)?n.remote_services:[];return u.jsxs("header",{className:"bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 px-6 py-4 flex items-center justify-between shadow-sm z-10",children:[u.jsx("div",{className:"flex items-center gap-4 flex-1",children:u.jsxs("nav",{className:"flex items-center text-sm text-slate-500 dark:text-slate-400",children:[u.jsx(st,{to:"/",className:"hover:text-primary-600 dark:hover:text-primary-400 transition-colors",children:u.jsx(GG,{size:16})}),i.length>0&&u.jsx(fo,{size:14,className:"mx-2 text-slate-300 dark:text-slate-600"}),i.map((l,c)=>{const d=`/${i.slice(0,c+1).join("/")}`,f=c===i.length-1,h=l.charAt(0).toUpperCase()+l.slice(1).replace(/-/g," ");return u.jsxs(O.Fragment,{children:[f?u.jsx("span",{className:"font-medium text-slate-900 dark:text-white",children:h}):u.jsx(st,{to:d,className:"hover:text-primary-600 dark:hover:text-primary-400 transition-colors",children:h}),!f&&u.jsx(fo,{size:14,className:"mx-2 text-slate-300 dark:text-slate-600"})]},l)})]})}),u.jsxs("div",{className:"flex items-center gap-4",children:[s&&u.jsxs("div",{className:"flex flex-col gap-2 px-4 py-2 rounded-xl bg-primary-50 text-primary-800 border border-primary-100 dark:bg-primary-900/20 dark:text-primary-200 dark:border-primary-900/40",children:[u.jsxs("div",{className:"flex items-center gap-2 text-xs uppercase tracking-wide font-semibold",children:[u.jsx(y_,{size:14})," Remote Stack"]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[(n==null?void 0:n.remote_ui_url)&&u.jsxs("a",{href:n.remote_ui_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs font-medium bg-white/70 dark:bg-slate-800/40 px-2 py-1 rounded-lg hover:underline",children:["UI ",u.jsx(Yu,{size:12})]}),(n==null?void 0:n.remote_server_url)&&u.jsxs("a",{href:n.remote_server_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs font-medium bg-white/70 dark:bg-slate-800/40 px-2 py-1 rounded-lg hover:underline",children:["API ",u.jsx(Yu,{size:12})]}),o.map((l,c)=>u.jsxs("a",{href:(l==null?void 0:l.url)||(l==null?void 0:l.link),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs font-medium bg-white/70 dark:bg-slate-800/40 px-2 py-1 rounded-lg hover:underline",children:[(l==null?void 0:l.label)||(l==null?void 0:l.name)||"Service"," ",u.jsx(Yu,{size:12})]},`${(l==null?void 0:l.name)||(l==null?void 0:l.label)||"service"}-${c}`))]})]}),u.jsx(HQ,{}),u.jsx("div",{className:"h-6 w-px bg-slate-200 dark:bg-slate-700 mx-2"}),u.jsx("button",{onClick:t,className:"p-2 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-700 transition-colors text-slate-500 hover:text-primary-600 dark:text-slate-400 dark:hover:text-primary-400","aria-label":"Toggle theme",children:e==="dark"?u.jsx(tK,{size:20}):u.jsx(ZG,{size:20})})]})]})}function Jz(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=Jz(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Fe(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=Jz(e))&&(n&&(n+=" "),n+=t);return n}const Q_="-",KQ=e=>{const t=XQ(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{const o=s.split(Q_);return o[0]===""&&o.length!==1&&o.shift(),eF(o,t)||YQ(s)},getConflictingClassGroupIds:(s,o)=>{const l=r[s]||[];return o&&n[s]?[...l,...n[s]]:l}}},eF=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?eF(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(Q_);return(s=t.validators.find(({validator:o})=>o(i)))==null?void 0:s.classGroupId},PA=/^\[(.+)\]$/,YQ=e=>{if(PA.test(e)){const t=PA.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},XQ=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return QQ(Object.entries(e.classGroups),r).forEach(([i,s])=>{SS(s,n,i,t)}),n},SS=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:CA(t,a);i.classGroupId=r;return}if(typeof a=="function"){if(ZQ(a)){SS(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,s])=>{SS(s,CA(t,i),r,n)})})},CA=(e,t)=>{let r=e;return t.split(Q_).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},ZQ=e=>e.isThemeGetter,QQ=(e,t)=>t?e.map(([r,n])=>{const a=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,o])=>[t+s,o])):i);return[r,a]}):e,JQ=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(i,s)=>{r.set(i,s),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let s=r.get(i);if(s!==void 0)return s;if((s=n.get(i))!==void 0)return a(i,s),s},set(i,s){r.has(i)?r.set(i,s):a(i,s)}}},tF="!",eJ=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,a=t[0],i=t.length,s=o=>{const l=[];let c=0,d=0,f;for(let b=0;b<o.length;b++){let x=o[b];if(c===0){if(x===a&&(n||o.slice(b,b+i)===t)){l.push(o.slice(d,b)),d=b+i;continue}if(x==="/"){f=b;continue}}x==="["?c++:x==="]"&&c--}const h=l.length===0?o:o.substring(d),p=h.startsWith(tF),g=p?h.substring(1):h,m=f&&f>d?f-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:m}};return r?o=>r({className:o,parseClassName:s}):s},tJ=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},rJ=e=>({cache:JQ(e.cacheSize),parseClassName:eJ(e),...KQ(e)}),nJ=/\s+/,aJ=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a}=t,i=[],s=e.trim().split(nJ);let o="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=r(c);let g=!!p,m=n(g?h.substring(0,p):h);if(!m){if(!g){o=c+(o.length>0?" "+o:o);continue}if(m=n(h),!m){o=c+(o.length>0?" "+o:o);continue}g=!1}const b=tJ(d).join(":"),x=f?b+tF:b,y=x+m;if(i.includes(y))continue;i.push(y);const v=a(m,g);for(let w=0;w<v.length;++w){const j=v[w];i.push(x+j)}o=c+(o.length>0?" "+o:o)}return o};function iJ(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=rF(t))&&(n&&(n+=" "),n+=r);return n}const rF=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=rF(e[n]))&&(r&&(r+=" "),r+=t);return r};function sJ(e,...t){let r,n,a,i=s;function s(l){const c=t.reduce((d,f)=>f(d),e());return r=rJ(c),n=r.cache.get,a=r.cache.set,i=o,o(l)}function o(l){const c=n(l);if(c)return c;const d=aJ(l,r);return a(l,d),d}return function(){return i(iJ.apply(null,arguments))}}const dt=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},nF=/^\[(?:([a-z-]+):)?(.+)\]$/i,oJ=/^\d+\/\d+$/,lJ=new Set(["px","full","screen"]),cJ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uJ=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,dJ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,fJ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hJ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pa=e=>Pl(e)||lJ.has(e)||oJ.test(e),ki=e=>Ec(e,"length",wJ),Pl=e=>!!e&&!Number.isNaN(Number(e)),Iy=e=>Ec(e,"number",Pl),nu=e=>!!e&&Number.isInteger(Number(e)),pJ=e=>e.endsWith("%")&&Pl(e.slice(0,-1)),Pe=e=>nF.test(e),_i=e=>cJ.test(e),mJ=new Set(["length","size","percentage"]),gJ=e=>Ec(e,mJ,aF),yJ=e=>Ec(e,"position",aF),vJ=new Set(["image","url"]),xJ=e=>Ec(e,vJ,SJ),bJ=e=>Ec(e,"",jJ),au=()=>!0,Ec=(e,t,r)=>{const n=nF.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},wJ=e=>uJ.test(e)&&!dJ.test(e),aF=()=>!1,jJ=e=>fJ.test(e),SJ=e=>hJ.test(e),kJ=()=>{const e=dt("colors"),t=dt("spacing"),r=dt("blur"),n=dt("brightness"),a=dt("borderColor"),i=dt("borderRadius"),s=dt("borderSpacing"),o=dt("borderWidth"),l=dt("contrast"),c=dt("grayscale"),d=dt("hueRotate"),f=dt("invert"),h=dt("gap"),p=dt("gradientColorStops"),g=dt("gradientColorStopPositions"),m=dt("inset"),b=dt("margin"),x=dt("opacity"),y=dt("padding"),v=dt("saturate"),w=dt("scale"),j=dt("sepia"),k=dt("skew"),S=dt("space"),N=dt("translate"),E=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto",Pe,t],M=()=>[Pe,t],T=()=>["",Pa,ki],P=()=>["auto",Pl,Pe],D=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],R=()=>["","0",Pe],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[Pl,Pe];return{cacheSize:500,separator:":",theme:{colors:[au],spacing:[Pa,ki],blur:["none","",_i,Pe],brightness:V(),borderColor:[e],borderRadius:["none","","full",_i,Pe],borderSpacing:M(),borderWidth:T(),contrast:V(),grayscale:R(),hueRotate:V(),invert:R(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[pJ,ki],inset:C(),margin:C(),opacity:V(),padding:M(),saturate:V(),scale:V(),sepia:R(),skew:V(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",Pe]}],container:["container"],columns:[{columns:[_i]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...D(),Pe]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",nu,Pe]}],basis:[{basis:C()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Pe]}],grow:[{grow:R()}],shrink:[{shrink:R()}],order:[{order:["first","last","none",nu,Pe]}],"grid-cols":[{"grid-cols":[au]}],"col-start-end":[{col:["auto",{span:["full",nu,Pe]},Pe]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[au]}],"row-start-end":[{row:["auto",{span:[nu,Pe]},Pe]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Pe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Pe]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Pe,t]}],"min-w":[{"min-w":[Pe,t,"min","max","fit"]}],"max-w":[{"max-w":[Pe,t,"none","full","min","max","fit","prose",{screen:[_i]},_i]}],h:[{h:[Pe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Pe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Pe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Pe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",_i,ki]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Iy]}],"font-family":[{font:[au]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Pe]}],"line-clamp":[{"line-clamp":["none",Pl,Iy]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Pa,Pe]}],"list-image":[{"list-image":["none",Pe]}],"list-style-type":[{list:["none","disc","decimal",Pe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Pa,ki]}],"underline-offset":[{"underline-offset":["auto",Pa,Pe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...D(),yJ]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",gJ]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},xJ]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:$()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[Pa,Pe]}],"outline-w":[{outline:[Pa,ki]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Pa,ki]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",_i,bJ]}],"shadow-color":[{shadow:[au]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...L(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":L()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",_i,Pe]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[v]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Pe]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",Pe]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",Pe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[nu,Pe]}],"translate-x":[{"translate-x":[N]}],"translate-y":[{"translate-y":[N]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Pe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Pe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Pe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Pa,ki,Iy]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},_J=sJ(kJ);function Pc(...e){return _J(Fe(e))}const NJ={primary:"bg-primary-600 text-white hover:bg-primary-700 shadow-md shadow-primary-500/20",secondary:"bg-white text-slate-900 border border-slate-200 hover:bg-slate-50",ghost:"bg-transparent text-slate-600 hover:bg-slate-100",danger:"bg-rose-600 text-white hover:bg-rose-700 shadow-md shadow-rose-500/20"},EJ={sm:"h-8 px-3 text-xs",md:"h-10 px-4 py-2",lg:"h-12 px-8 text-lg",icon:"h-10 w-10"};function Se({className:e,variant:t="primary",size:r="md",children:n,...a}){return u.jsx(Me.button,{whileTap:{scale:.98},className:Pc("inline-flex items-center justify-center rounded-lg font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:pointer-events-none disabled:opacity-50",NJ[t],EJ[r],e),...a,children:n})}class iF extends O.Component{constructor(r){super(r);Hg(this,"reportError",async(r,n)=>{if(!this.state.reported)try{await fetch("/api/client/errors",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:r.message||"Unknown error",stack:r.stack,component_stack:n==null?void 0:n.componentStack,url:window.location.href,user_agent:navigator.userAgent})}),this.setState({reported:!0})}catch(a){console.error("Failed to report error:",a)}});Hg(this,"handleReset",()=>{this.setState({hasError:!1,error:null,errorInfo:null,reported:!1}),this.props.onReset&&this.props.onReset()});this.state={hasError:!1,error:null,errorInfo:null,reported:!1}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){console.error("Uncaught error:",r,n),this.setState({errorInfo:n}),this.reportError(r,n)}render(){var r;return this.state.hasError?this.props.fallback?this.props.fallback:u.jsx("div",{className:"min-h-[400px] flex items-center justify-center p-6 w-full",children:u.jsxs("div",{className:"max-w-lg w-full bg-white dark:bg-gray-900 rounded-2xl shadow-xl overflow-hidden border border-gray-200 dark:border-gray-800",children:[u.jsx("div",{className:"bg-gradient-to-r from-pink-500 via-red-500 to-yellow-500 h-2"}),u.jsxs("div",{className:"p-8",children:[u.jsx("div",{className:"flex justify-center mb-6",children:u.jsxs("div",{className:"relative",children:[u.jsx("div",{className:"absolute inset-0 bg-red-100 dark:bg-red-900/30 rounded-full animate-ping opacity-75"}),u.jsx("div",{className:"relative p-4 bg-red-50 dark:bg-red-900/20 rounded-full",children:u.jsx(IG,{className:"w-12 h-12 text-red-500 dark:text-red-400"})})]})}),u.jsx("h2",{className:"text-2xl font-bold text-center text-gray-900 dark:text-white mb-2",children:"Well, this is awkward..."}),u.jsx("p",{className:"text-center text-gray-600 dark:text-gray-400 mb-6",children:"The hamsters powering this component decided to take an unscheduled nap. We've dispatched a team of digital veterinarians (aka developers) to wake them up."}),u.jsxs("div",{className:"bg-gray-50 dark:bg-gray-800 rounded-lg p-4 mb-6 font-mono text-xs text-left overflow-auto max-h-32 border border-gray-200 dark:border-gray-700",children:[u.jsxs("div",{className:"flex items-center text-red-500 mb-2",children:[u.jsx(nK,{className:"w-3 h-3 mr-2"}),u.jsx("span",{className:"font-semibold",children:"Error Log"})]}),u.jsx("code",{className:"text-gray-700 dark:text-gray-300 break-all whitespace-pre-wrap",children:((r=this.state.error)==null?void 0:r.message)||"Unknown error"})]}),u.jsxs("div",{className:"flex justify-center gap-4",children:[u.jsx(Se,{onClick:()=>window.location.reload(),variant:"outline",className:"border-gray-300 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800",children:"Reload Page"}),u.jsxs(Se,{onClick:this.handleReset,className:"bg-gradient-to-r from-red-500 to-pink-600 hover:from-red-600 hover:to-pink-700 text-white border-0",children:[u.jsx(P0,{className:"w-4 h-4 mr-2"}),"Try Again"]})]})]})]})}):this.props.children}}function PJ(){const[e,t]=_.useState(!1);return u.jsxs("div",{className:"flex h-screen bg-slate-50 dark:bg-slate-900 overflow-hidden",children:[u.jsx(UQ,{collapsed:e,setCollapsed:t}),u.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[u.jsx(GQ,{}),u.jsx("main",{className:"flex-1 overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-slate-200 dark:scrollbar-thumb-slate-700",children:u.jsx("div",{className:"max-w-7xl mx-auto w-full",children:u.jsx(iF,{children:u.jsx(eG,{})})})})]})]})}function ze({className:e,children:t,hover:r=!0,...n}){return u.jsx(Me.div,{whileHover:r?{y:-2,boxShadow:"0 10px 30px -10px rgba(0,0,0,0.1)"}:{},transition:{duration:.2},className:Pc("bg-white dark:bg-slate-800 rounded-xl border border-slate-100 dark:border-slate-700 shadow-sm p-6","transition-colors duration-200",e),...n,children:t})}function sF({className:e,children:t,...r}){return u.jsx("div",{className:Pc("flex flex-col space-y-1.5 mb-4",e),...r,children:t})}function oF({className:e,children:t,...r}){return u.jsx("h3",{className:Pc("font-semibold leading-none tracking-tight text-slate-900 dark:text-white",e),...r,children:t})}function kS({className:e,children:t,...r}){return u.jsx("div",{className:Pc("",e),...r,children:t})}const CJ={default:"bg-slate-100 text-slate-800",primary:"bg-primary-50 text-primary-700 border border-primary-100",success:"bg-emerald-50 text-emerald-700 border border-emerald-100",warning:"bg-amber-50 text-amber-700 border border-amber-100",danger:"bg-rose-50 text-rose-700 border border-rose-100",outline:"bg-transparent border border-slate-200 text-slate-600"};function Ot({className:e,variant:t="default",children:r,...n}){return u.jsx("span",{className:Pc("inline-flex items-center rounded-md px-2 py-1 text-xs font-medium ring-1 ring-inset ring-black/5",CJ[t],e),...n,children:r})}const AA={completed:{icon:Lt,label:"Completed",color:"text-emerald-600 dark:text-emerald-400",bg:"bg-emerald-50 dark:bg-emerald-900/20",border:"border-emerald-200 dark:border-emerald-800"},success:{icon:Lt,label:"Success",color:"text-emerald-600 dark:text-emerald-400",bg:"bg-emerald-50 dark:bg-emerald-900/20",border:"border-emerald-200 dark:border-emerald-800"},failed:{icon:pr,label:"Failed",color:"text-rose-600 dark:text-rose-400",bg:"bg-rose-50 dark:bg-rose-900/20",border:"border-rose-200 dark:border-rose-800"},running:{icon:p6,label:"Running",color:"text-blue-600 dark:text-blue-400",bg:"bg-blue-50 dark:bg-blue-900/20",border:"border-blue-200 dark:border-blue-800",animate:!0},pending:{icon:tt,label:"Pending",color:"text-amber-600 dark:text-amber-400",bg:"bg-amber-50 dark:bg-amber-900/20",border:"border-amber-200 dark:border-amber-800"},queued:{icon:tt,label:"Queued",color:"text-slate-600 dark:text-slate-400",bg:"bg-slate-50 dark:bg-slate-900/20",border:"border-slate-200 dark:border-slate-700"},initializing:{icon:Or,label:"Initializing",color:"text-blue-600 dark:text-blue-400",bg:"bg-blue-50 dark:bg-blue-900/20",border:"border-blue-200 dark:border-blue-800"},cached:{icon:Lt,label:"Cached",color:"text-cyan-600 dark:text-cyan-400",bg:"bg-cyan-50 dark:bg-cyan-900/20",border:"border-cyan-200 dark:border-cyan-800"}};function AJ({status:e,size:t="md",showLabel:r=!0,className:n="",iconOnly:a=!1}){const i=AA[e==null?void 0:e.toLowerCase()]||AA.pending,s=i.icon,o={sm:{icon:14,text:"text-xs",padding:"px-2 py-0.5"},md:{icon:16,text:"text-sm",padding:"px-2.5 py-1"},lg:{icon:20,text:"text-base",padding:"px-3 py-1.5"}},{icon:l,text:c,padding:d}=o[t];return a?u.jsx(s,{size:l,className:`${i.color} ${i.animate?"animate-spin":""} ${n}`}):u.jsxs("div",{className:`inline-flex items-center gap-1.5 ${d} rounded-full border ${i.bg} ${i.border} ${n}`,children:[u.jsx(s,{size:l,className:`${i.color} ${i.animate?"animate-spin":""}`}),r&&u.jsx("span",{className:`font-medium ${i.color} ${c}`,children:i.label})]})}function rm({status:e,className:t=""}){return u.jsx(AJ,{status:e,size:"sm",className:t})}const lF=6048e5,TJ=864e5,TA=Symbol.for("constructDateFrom");function us(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&TA in e?e[TA](t):e instanceof Date?new e.constructor(t):new Date(t)}function na(e,t){return us(t||e,e)}let OJ={};function M0(){return OJ}function Od(e,t){var o,l,c,d;const r=M0(),n=(t==null?void 0:t.weekStartsOn)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??r.weekStartsOn??((d=(c=r.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,a=na(e,t==null?void 0:t.in),i=a.getDay(),s=(i<n?7:0)+i-n;return a.setDate(a.getDate()-s),a.setHours(0,0,0,0),a}function nm(e,t){return Od(e,{...t,weekStartsOn:1})}function cF(e,t){const r=na(e,t==null?void 0:t.in),n=r.getFullYear(),a=us(r,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);const i=nm(a),s=us(r,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const o=nm(s);return r.getTime()>=i.getTime()?n+1:r.getTime()>=o.getTime()?n:n-1}function OA(e){const t=na(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function MJ(e,...t){const r=us.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function MA(e,t){const r=na(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function RJ(e,t,r){const[n,a]=MJ(r==null?void 0:r.in,e,t),i=MA(n),s=MA(a),o=+i-OA(i),l=+s-OA(s);return Math.round((o-l)/TJ)}function $J(e,t){const r=cF(e,t),n=us(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),nm(n)}function DJ(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function uF(e){return!(!DJ(e)&&typeof e!="number"||isNaN(+na(e)))}function IJ(e,t){const r=na(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const LJ={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"}},zJ=(e,t,r)=>{let n;const a=LJ[e];return typeof a=="string"?n=a:t===1?n=a.one:n=a.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Ly(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const FJ={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},BJ={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},VJ={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},qJ={date:Ly({formats:FJ,defaultWidth:"full"}),time:Ly({formats:BJ,defaultWidth:"full"}),dateTime:Ly({formats:VJ,defaultWidth:"full"})},UJ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},HJ=(e,t,r,n)=>UJ[e];function iu(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let a;if(n==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,o=r!=null&&r.width?String(r.width):s;a=e.formattingValues[o]||e.formattingValues[s]}else{const s=e.defaultWidth,o=r!=null&&r.width?String(r.width):e.defaultWidth;a=e.values[o]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const WJ={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},GJ={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},KJ={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"]},YJ={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"]},XJ={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"}},ZJ={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"}},QJ=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},JJ={ordinalNumber:QJ,era:iu({values:WJ,defaultWidth:"wide"}),quarter:iu({values:GJ,defaultWidth:"wide",argumentCallback:e=>e-1}),month:iu({values:KJ,defaultWidth:"wide"}),day:iu({values:YJ,defaultWidth:"wide"}),dayPeriod:iu({values:XJ,defaultWidth:"wide",formattingValues:ZJ,defaultFormattingWidth:"wide"})};function su(e){return(t,r={})=>{const n=r.width,a=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const s=i[0],o=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?tee(o,f=>f.test(s)):eee(o,f=>f.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=r.valueCallback?r.valueCallback(c):c;const d=t.slice(s.length);return{value:c,rest:d}}}function eee(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function tee(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function ree(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const a=n[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=r.valueCallback?r.valueCallback(s):s;const o=t.slice(a.length);return{value:s,rest:o}}}const nee=/^(\d+)(th|st|nd|rd)?/i,aee=/\d+/i,iee={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},see={any:[/^b/i,/^(a|c)/i]},oee={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},lee={any:[/1/i,/2/i,/3/i,/4/i]},cee={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},uee={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]},dee={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},fee={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]},hee={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},pee={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}},mee={ordinalNumber:ree({matchPattern:nee,parsePattern:aee,valueCallback:e=>parseInt(e,10)}),era:su({matchPatterns:iee,defaultMatchWidth:"wide",parsePatterns:see,defaultParseWidth:"any"}),quarter:su({matchPatterns:oee,defaultMatchWidth:"wide",parsePatterns:lee,defaultParseWidth:"any",valueCallback:e=>e+1}),month:su({matchPatterns:cee,defaultMatchWidth:"wide",parsePatterns:uee,defaultParseWidth:"any"}),day:su({matchPatterns:dee,defaultMatchWidth:"wide",parsePatterns:fee,defaultParseWidth:"any"}),dayPeriod:su({matchPatterns:hee,defaultMatchWidth:"any",parsePatterns:pee,defaultParseWidth:"any"})},gee={code:"en-US",formatDistance:zJ,formatLong:qJ,formatRelative:HJ,localize:JJ,match:mee,options:{weekStartsOn:0,firstWeekContainsDate:1}};function yee(e,t){const r=na(e,t==null?void 0:t.in);return RJ(r,IJ(r))+1}function vee(e,t){const r=na(e,t==null?void 0:t.in),n=+nm(r)-+$J(r);return Math.round(n/lF)+1}function dF(e,t){var d,f,h,p;const r=na(e,t==null?void 0:t.in),n=r.getFullYear(),a=M0(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??a.firstWeekContainsDate??((p=(h=a.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=us((t==null?void 0:t.in)||e,0);s.setFullYear(n+1,0,i),s.setHours(0,0,0,0);const o=Od(s,t),l=us((t==null?void 0:t.in)||e,0);l.setFullYear(n,0,i),l.setHours(0,0,0,0);const c=Od(l,t);return+r>=+o?n+1:+r>=+c?n:n-1}function xee(e,t){var o,l,c,d;const r=M0(),n=(t==null?void 0:t.firstWeekContainsDate)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)??r.firstWeekContainsDate??((d=(c=r.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,a=dF(e,t),i=us((t==null?void 0:t.in)||e,0);return i.setFullYear(a,0,n),i.setHours(0,0,0,0),Od(i,t)}function bee(e,t){const r=na(e,t==null?void 0:t.in),n=+Od(r,t)-+xee(r,t);return Math.round(n/lF)+1}function Ye(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const Ni={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Ye(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Ye(r+1,2)},d(e,t){return Ye(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return Ye(e.getHours()%12||12,t.length)},H(e,t){return Ye(e.getHours(),t.length)},m(e,t){return Ye(e.getMinutes(),t.length)},s(e,t){return Ye(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),a=Math.trunc(n*Math.pow(10,r-3));return Ye(a,t.length)}},Bo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},RA={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),a=n>0?n:1-n;return r.ordinalNumber(a,{unit:"year"})}return Ni.y(e,t)},Y:function(e,t,r,n){const a=dF(e,n),i=a>0?a:1-a;if(t==="YY"){const s=i%100;return Ye(s,2)}return t==="Yo"?r.ordinalNumber(i,{unit:"year"}):Ye(i,t.length)},R:function(e,t){const r=cF(e);return Ye(r,t.length)},u:function(e,t){const r=e.getFullYear();return Ye(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Ye(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Ye(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return Ni.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return Ye(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const a=bee(e,n);return t==="wo"?r.ordinalNumber(a,{unit:"week"}):Ye(a,t.length)},I:function(e,t,r){const n=vee(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):Ye(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Ni.d(e,t)},D:function(e,t,r){const n=yee(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Ye(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Ye(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Ye(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),a=n===0?7:n;switch(t){case"i":return String(a);case"ii":return Ye(a,t.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let a;switch(n===12?a=Bo.noon:n===0?a=Bo.midnight:a=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let a;switch(n>=17?a=Bo.evening:n>=12?a=Bo.afternoon:n>=4?a=Bo.morning:a=Bo.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return Ni.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Ni.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Ye(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):Ye(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ni.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Ni.s(e,t)},S:function(e,t){return Ni.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return DA(n);case"XXXX":case"XX":return Os(n);case"XXXXX":case"XXX":default:return Os(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return DA(n);case"xxxx":case"xx":return Os(n);case"xxxxx":case"xxx":default:return Os(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+$A(n,":");case"OOOO":default:return"GMT"+Os(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+$A(n,":");case"zzzz":default:return"GMT"+Os(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return Ye(n,t.length)},T:function(e,t,r){return Ye(+e,t.length)}};function $A(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=Math.trunc(n/60),i=n%60;return i===0?r+String(a):r+String(a)+t+Ye(i,2)}function DA(e,t){return e%60===0?(e>0?"-":"+")+Ye(Math.abs(e)/60,2):Os(e,t)}function Os(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=Ye(Math.trunc(n/60),2),i=Ye(n%60,2);return r+a+t+i}const IA=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},fF=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},wee=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return IA(e,t);let i;switch(n){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",IA(n,t)).replace("{{time}}",fF(a,t))},jee={p:fF,P:wee},See=/^D+$/,kee=/^Y+$/,_ee=["D","DD","YY","YYYY"];function Nee(e){return See.test(e)}function Eee(e){return kee.test(e)}function Pee(e,t,r){const n=Cee(e,t,r);if(console.warn(n),_ee.includes(e))throw new RangeError(n)}function Cee(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Aee=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Tee=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Oee=/^'([^]*?)'?$/,Mee=/''/g,Ree=/[a-zA-Z]/;function wt(e,t,r){var d,f,h,p;const n=M0(),a=n.locale??gee,i=n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,s=n.weekStartsOn??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.weekStartsOn)??0,o=na(e,r==null?void 0:r.in);if(!uF(o))throw new RangeError("Invalid time value");let l=t.match(Tee).map(g=>{const m=g[0];if(m==="p"||m==="P"){const b=jee[m];return b(g,a.formatLong)}return g}).join("").match(Aee).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const m=g[0];if(m==="'")return{isToken:!1,value:$ee(g)};if(RA[m])return{isToken:!0,value:g};if(m.match(Ree))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:g}});a.localize.preprocessor&&(l=a.localize.preprocessor(o,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:a};return l.map(g=>{if(!g.isToken)return g.value;const m=g.value;(Eee(m)||Nee(m))&&Pee(m,t,String(e));const b=RA[m[0]];return b(o,m,a.localize,c)}).join("")}function $ee(e){const t=e.match(Oee);return t?t[1].replace(Mee,"'"):e}function Dee(){const[e,t]=_.useState(null),[r,n]=_.useState([]),[a,i]=_.useState(!0),[s,o]=_.useState(null),{selectedProject:l}=fi(),c=Xz();if(_.useEffect(()=>{(async()=>{i(!0),o(null);try{const p=l?`/api/stats?project=${encodeURIComponent(l)}`:"/api/stats",g=l?`/api/runs/?limit=5&project=${encodeURIComponent(l)}`:"/api/runs/?limit=5",[m,b]=await Promise.all([_e(p),_e(g)]);if(!m.ok)throw new Error(`Failed to fetch stats: ${m.statusText}`);if(!b.ok)throw new Error(`Failed to fetch runs: ${b.statusText}`);const x=await m.json(),y=await b.json();t(x),n(y.runs||[])}catch(p){console.error(p),o(p.message),c.error(`Failed to load dashboard: ${p.message}`)}finally{i(!1)}})()},[l]),a)return u.jsx("div",{className:"flex items-center justify-center h-96",children:u.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600"})});if(s)return u.jsx("div",{className:"flex items-center justify-center h-96",children:u.jsxs("div",{className:"text-center p-8 bg-red-50 dark:bg-red-900/20 rounded-2xl border border-red-100 dark:border-red-800 max-w-md",children:[u.jsx(pr,{className:"w-12 h-12 text-red-500 mx-auto mb-4"}),u.jsx("h3",{className:"text-lg font-bold text-red-700 dark:text-red-300 mb-2",children:"Failed to load dashboard"}),u.jsx("p",{className:"text-red-600 dark:text-red-400 mb-6",children:s}),u.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg shadow-sm hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors text-slate-700 dark:text-slate-300 font-medium",children:"Retry Connection"})]})});const d={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},f={hidden:{opacity:0,y:20},show:{opacity:1,y:0}};return u.jsxs(Me.div,{initial:"hidden",animate:"show",variants:d,className:"space-y-8",children:[u.jsxs(Me.div,{variants:f,className:"relative overflow-hidden bg-gradient-to-br from-primary-500 via-primary-600 to-purple-600 rounded-2xl p-8 text-white shadow-xl",children:[u.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-white/10 rounded-full -mr-32 -mt-32"}),u.jsx("div",{className:"absolute bottom-0 left-0 w-48 h-48 bg-white/10 rounded-full -ml-24 -mb-24"}),u.jsxs("div",{className:"relative z-10",children:[u.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[u.jsx(po,{size:32,className:"text-yellow-300"}),u.jsx("h1",{className:"text-4xl font-bold",children:"Welcome to flowyml"})]}),u.jsx("p",{className:"text-primary-100 text-lg max-w-2xl",children:"Your lightweight, artifact-centric ML orchestration platform. Build, run, and track your ML pipelines with ease."}),u.jsxs("div",{className:"mt-6 flex gap-3",children:[u.jsx(st,{to:"/pipelines",children:u.jsx("button",{className:"px-6 py-2.5 bg-white text-primary-600 rounded-lg font-semibold hover:bg-primary-50 transition-colors shadow-lg",children:"View Pipelines"})}),u.jsx(st,{to:"/runs",children:u.jsx("button",{className:"px-6 py-2.5 bg-primary-700/50 backdrop-blur-sm text-white rounded-lg font-semibold hover:bg-primary-700/70 transition-colors border border-white/20",children:"Recent Runs"})})]})]})]}),u.jsxs(Me.div,{variants:f,className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[u.jsx(vh,{icon:u.jsx(ja,{size:24}),label:"Total Pipelines",value:(e==null?void 0:e.pipelines)||0,trend:"+12%",color:"blue"}),u.jsx(vh,{icon:u.jsx(Ge,{size:24}),label:"Pipeline Runs",value:(e==null?void 0:e.runs)||0,trend:"+23%",color:"purple"}),u.jsx(vh,{icon:u.jsx(Tr,{size:24}),label:"Artifacts",value:(e==null?void 0:e.artifacts)||0,trend:"+8%",color:"emerald"}),u.jsx(vh,{icon:u.jsx(Lt,{size:24}),label:"Success Rate",value:(e==null?void 0:e.runs)>0?`${Math.round(e.completed_runs/e.runs*100)}%`:"0%",trend:"+5%",color:"cyan"})]}),u.jsxs(Me.div,{variants:f,className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[u.jsxs("div",{className:"lg:col-span-2",children:[u.jsxs("div",{className:"flex items-center justify-between mb-6",children:[u.jsxs("h3",{className:"text-xl font-bold text-slate-900 flex items-center gap-2",children:[u.jsx(tt,{className:"text-primary-500",size:24}),"Recent Runs"]}),u.jsxs(st,{to:"/runs",className:"text-sm font-semibold text-primary-600 hover:text-primary-700 flex items-center gap-1",children:["View All ",u.jsx(is,{size:16})]})]}),u.jsx("div",{className:"space-y-3",children:r.length>0?r.map((h,p)=>u.jsx(Iee,{run:h,index:p},h.run_id)):u.jsxs(ze,{className:"p-12 text-center border-dashed",children:[u.jsx(Ge,{className:"mx-auto text-slate-300 mb-3",size:32}),u.jsx("p",{className:"text-slate-500",children:"No recent runs"})]})})]}),u.jsxs("div",{children:[u.jsxs("h3",{className:"text-xl font-bold text-slate-900 mb-6 flex items-center gap-2",children:[u.jsx(os,{className:"text-primary-500",size:24}),"Quick Stats"]}),u.jsxs("div",{className:"space-y-3",children:[u.jsx(xh,{label:"Completed Today",value:(e==null?void 0:e.completed_runs)||0,icon:u.jsx(Lt,{size:18}),color:"emerald"}),u.jsx(xh,{label:"Failed Runs",value:(e==null?void 0:e.failed_runs)||0,icon:u.jsx(pr,{size:18}),color:"rose"}),u.jsx(xh,{label:"Avg Duration",value:e!=null&&e.avg_duration?`${e.avg_duration.toFixed(1)}s`:"0s",icon:u.jsx(tt,{size:18}),color:"blue"}),u.jsx(xh,{label:"Cache Hit Rate",value:"87%",icon:u.jsx(po,{size:18}),color:"amber"})]})]})]})]})}function vh({icon:e,label:t,value:r,trend:n,color:a}){const i={blue:"from-blue-500 to-cyan-500",purple:"from-purple-500 to-pink-500",emerald:"from-emerald-500 to-teal-500",cyan:"from-cyan-500 to-blue-500"};return u.jsxs(ze,{className:"relative overflow-hidden group hover:shadow-lg transition-all duration-200",children:[u.jsx("div",{className:`absolute inset-0 bg-gradient-to-br ${i[a]} opacity-0 group-hover:opacity-5 transition-opacity`}),u.jsxs("div",{className:"relative",children:[u.jsxs("div",{className:"flex items-start justify-between mb-4",children:[u.jsx("div",{className:`p-3 rounded-xl bg-gradient-to-br ${i[a]} text-white shadow-lg`,children:e}),u.jsx("span",{className:"text-xs font-semibold text-emerald-600 bg-emerald-50 px-2 py-1 rounded-full",children:n})]}),u.jsx("p",{className:"text-sm text-slate-500 font-medium mb-1",children:t}),u.jsx("p",{className:"text-3xl font-bold text-slate-900",children:r})]})]})}function Iee({run:e,index:t}){const r={completed:{icon:u.jsx(Lt,{size:16}),color:"text-emerald-500",bg:"bg-emerald-50"},failed:{icon:u.jsx(pr,{size:16}),color:"text-rose-500",bg:"bg-rose-50"},running:{icon:u.jsx(Ge,{size:16,className:"animate-pulse"}),color:"text-amber-500",bg:"bg-amber-50"}},n=r[e.status]||r.completed;return u.jsx(Me.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:t*.1},children:u.jsx(st,{to:`/runs/${e.run_id}`,children:u.jsx(ze,{className:"group hover:shadow-md hover:border-primary-200 transition-all duration-200",children:u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:`p-2 rounded-lg ${n.bg} ${n.color}`,children:n.icon}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("h4",{className:"font-semibold text-slate-900 truncate group-hover:text-primary-600 transition-colors",children:e.pipeline_name}),u.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-500 mt-0.5",children:[u.jsx("span",{className:"font-mono",children:e.run_id.substring(0,8)}),e.start_time&&u.jsxs(u.Fragment,{children:[u.jsx("span",{children:"•"}),u.jsx("span",{children:wt(new Date(e.start_time),"MMM d, HH:mm")})]})]})]}),u.jsx(Ot,{variant:e.status==="completed"?"success":e.status==="failed"?"danger":"warning",className:"text-xs",children:e.status})]})})})})}function xh({label:e,value:t,icon:r,color:n}){const a={emerald:"bg-emerald-50 text-emerald-600",rose:"bg-rose-50 text-rose-600",blue:"bg-blue-50 text-blue-600",amber:"bg-amber-50 text-amber-600"};return u.jsx(ze,{className:"hover:shadow-md transition-shadow duration-200",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-sm text-slate-500 font-medium mb-1",children:e}),u.jsx("p",{className:"text-2xl font-bold text-slate-900",children:t})]}),u.jsx("div",{className:`p-2.5 rounded-lg ${a[n]}`,children:r})]})})}const Lee=({item:e,columns:t})=>u.jsx("tr",{className:"bg-white dark:bg-slate-800 hover:bg-slate-50 dark:hover:bg-slate-700/50 transition-colors",children:t.map((r,n)=>u.jsx("td",{className:"px-6 py-4",children:r.render?r.render(e):e[r.key]},n))});function Cc({title:e,subtitle:t,actions:r,items:n=[],columns:a=[],renderGrid:i,renderList:s,searchPlaceholder:o="Search...",initialView:l="table",emptyState:c,loading:d=!1}){const[f,h]=_.useState(l),[p,g]=_.useState(""),[m,b]=_.useState({key:null,direction:"asc"}),x=Array.isArray(n)?n:[],y=Array.isArray(a)?a:[],w=i||(E=>u.jsx("div",{className:"p-4 bg-white dark:bg-slate-800 rounded-lg border border-slate-200 dark:border-slate-700",children:u.jsx("pre",{className:"text-xs overflow-auto",children:JSON.stringify(E,null,2)})})),j=s||w,S=[...x.filter(E=>{if(!p)return!0;const A=p.toLowerCase();return Object.values(E).some(C=>String(C).toLowerCase().includes(A))})].sort((E,A)=>{if(!m.key)return 0;const C=E[m.key],M=A[m.key];return C<M?m.direction==="asc"?-1:1:C>M?m.direction==="asc"?1:-1:0}),N=E=>{b(A=>({key:E,direction:A.key===E&&A.direction==="asc"?"desc":"asc"}))};return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-bold text-slate-900 dark:text-white",children:e}),t&&u.jsx("p",{className:"text-slate-500 dark:text-slate-400 mt-1",children:t})]}),r&&u.jsx("div",{className:"flex gap-2",children:r})]}),u.jsxs("div",{className:"flex flex-col md:flex-row gap-4 items-center justify-between bg-white dark:bg-slate-800 p-4 rounded-xl border border-slate-200 dark:border-slate-700 shadow-sm",children:[u.jsxs("div",{className:"relative w-full md:w-96",children:[u.jsx(Kp,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400 w-4 h-4"}),u.jsx("input",{type:"text",placeholder:o,value:p,onChange:E=>g(E.target.value),className:"w-full pl-10 pr-4 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 text-sm text-slate-900 dark:text-white"})]}),u.jsx("div",{className:"flex items-center gap-2 w-full md:w-auto justify-end",children:u.jsxs("div",{className:"flex bg-slate-100 dark:bg-slate-900 p-1 rounded-lg border border-slate-200 dark:border-slate-700",children:[u.jsx("button",{onClick:()=>h("grid"),className:`p-2 rounded-md transition-all ${f==="grid"?"bg-white dark:bg-slate-800 shadow-sm text-primary-600":"text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"}`,title:"Grid View",children:u.jsx(KG,{size:18})}),u.jsx("button",{onClick:()=>h("list"),className:`p-2 rounded-md transition-all ${f==="list"?"bg-white dark:bg-slate-800 shadow-sm text-primary-600":"text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"}`,title:"List View",children:u.jsx(h6,{size:18})}),u.jsx("button",{onClick:()=>h("table"),className:`p-2 rounded-md transition-all ${f==="table"?"bg-white dark:bg-slate-800 shadow-sm text-primary-600":"text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"}`,title:"Table View",children:u.jsx(rK,{size:18})})]})})]}),d?u.jsx("div",{className:"flex justify-center py-12",children:u.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-500"})}):S.length===0?c||u.jsxs("div",{className:"text-center py-12 bg-slate-50 dark:bg-slate-800/50 rounded-xl border-2 border-dashed border-slate-200 dark:border-slate-700",children:[u.jsx("div",{className:"flex justify-center mb-4",children:u.jsx(Kp,{className:"w-12 h-12 text-slate-300 dark:text-slate-600"})}),u.jsx("h3",{className:"text-lg font-medium text-slate-900 dark:text-white",children:"No items found"}),u.jsx("p",{className:"text-slate-500 dark:text-slate-400 mt-1",children:p?`No results matching "${p}"`:"Get started by creating a new item."})]}):u.jsxs("div",{className:"animate-in fade-in duration-300",children:[f==="grid"&&u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:S.map((E,A)=>u.jsx("div",{children:w(E)},A))}),f==="list"&&u.jsx("div",{className:"space-y-4",children:S.map((E,A)=>u.jsx("div",{children:j(E)},A))}),f==="table"&&u.jsx("div",{className:"bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden shadow-sm",children:u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-sm text-left",children:[u.jsx("thead",{className:"text-xs text-slate-500 uppercase bg-slate-50 dark:bg-slate-900/50 border-b border-slate-200 dark:border-slate-700",children:u.jsx("tr",{children:y.map((E,A)=>u.jsx("th",{className:"px-6 py-3 font-medium cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors",onClick:()=>E.sortable&&N(E.key),children:u.jsxs("div",{className:"flex items-center gap-2",children:[E.header,E.sortable&&u.jsx($G,{size:14,className:"text-slate-400"})]})},A))})}),u.jsx("tbody",{className:"divide-y divide-slate-200 dark:divide-slate-700",children:S.map((E,A)=>u.jsx(Lee,{item:E,columns:y},A))})]})})})]})]})}function ri(e,t="MMM d, yyyy"){if(!e)return"-";const r=new Date(e);return uF(r)?wt(r,t):"-"}const zee=({status:e})=>{switch(e==null?void 0:e.toLowerCase()){case"completed":case"success":return u.jsx(Lt,{className:"w-3.5 h-3.5 text-emerald-500"});case"failed":return u.jsx(pr,{className:"w-3.5 h-3.5 text-rose-500"});case"running":return u.jsx(Ge,{className:"w-3.5 h-3.5 text-amber-500 animate-spin"});default:return u.jsx(tt,{className:"w-3.5 h-3.5 text-slate-400"})}},Vo=({label:e,icon:t,children:r,defaultExpanded:n=!1,actions:a,status:i,level:s=0,badge:o,onClick:l,isActive:c=!1,subLabel:d})=>{const[f,h]=_.useState(n),p=r&&r.length>0;return u.jsxs("div",{className:"select-none",children:[u.jsxs(Me.div,{initial:!1,animate:{backgroundColor:c?"rgba(59, 130, 246, 0.1)":"transparent"},className:`
477
- group flex items-center gap-2 px-2 py-1.5 rounded-lg cursor-pointer transition-all
478
- hover:bg-slate-100 dark:hover:bg-slate-800
479
- ${c?"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400":"text-slate-700 dark:text-slate-300"}
480
- ${s===0?"mb-0.5":""}
481
- `,style:{paddingLeft:`${s*1.25+.5}rem`},onClick:g=>{g.stopPropagation(),p&&h(!f),l==null||l()},children:[u.jsx("div",{className:"flex items-center gap-1 text-slate-400 shrink-0",children:p?u.jsx(Me.div,{animate:{rotate:f?90:0},transition:{duration:.2},children:u.jsx(fo,{className:"w-3.5 h-3.5"})}):u.jsx("div",{className:"w-3.5"})}),t&&u.jsx(t,{className:`w-4 h-4 shrink-0 ${c?"text-blue-500":"text-slate-400 group-hover:text-slate-500 dark:text-slate-500 dark:group-hover:text-slate-400"}`}),u.jsxs("div",{className:"flex-1 flex items-center justify-between gap-2 min-w-0 overflow-hidden",children:[u.jsxs("div",{className:"flex flex-col min-w-0",children:[u.jsx("span",{className:`text-sm truncate ${c?"font-medium":""}`,children:e}),d&&u.jsx("span",{className:"text-[10px] text-slate-400 truncate",children:d})]}),u.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[o,i&&u.jsx(zee,{status:i}),a]})]})]}),u.jsx(hi,{initial:!1,children:f&&p&&u.jsx(Me.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2},children:r})})]})};function J_({projectId:e,onSelect:t,selectedId:r,mode:n="experiments",className:a=""}){const[i,s]=_.useState({projects:[],items:[]}),[o,l]=_.useState(!0),[c,d]=_.useState(null),[f,h]=_.useState("");if(_.useEffect(()=>{(async()=>{l(!0),d(null);try{let y="",v="";switch(n){case"experiments":y=e?`/api/experiments/?project=${encodeURIComponent(e)}`:"/api/experiments/",v="experiments";break;case"pipelines":y=e?`/api/pipelines/?project=${encodeURIComponent(e)}`:"/api/pipelines/",v="pipelines";break;case"runs":y=e?`/api/runs/?project=${encodeURIComponent(e)}&limit=100`:"/api/runs/?limit=100",v="runs";break;default:break}const w=await _e(y);if(!w.ok)throw new Error(`Failed to fetch ${n}: ${w.statusText}`);const j=await w.json();let k=[];if(!e){const S=j[v]||[];k=[...new Set(S.map(E=>E.project).filter(Boolean))].map(E=>({name:E}))}s({projects:k,items:j[v]||[]})}catch(y){console.error("Failed to fetch navigation data:",y),d(y.message)}finally{l(!1)}})()},[e,n]),o)return u.jsx("div",{className:`p-4 ${a}`,children:u.jsx("div",{className:"animate-pulse space-y-3",children:[1,2,3,4,5].map(x=>u.jsx("div",{className:"h-8 bg-slate-100 dark:bg-slate-800 rounded-lg"},x))})});if(c)return u.jsx("div",{className:`p-4 text-center ${a}`,children:u.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-4 rounded-lg border border-red-100 dark:border-red-800",children:[u.jsx(pr,{className:"w-8 h-8 text-red-500 mx-auto mb-2"}),u.jsx("p",{className:"text-sm text-red-600 dark:text-red-400 font-medium",children:"Failed to load data"}),u.jsx("p",{className:"text-xs text-red-500 dark:text-red-500/80 mt-1",children:c}),u.jsx("button",{onClick:()=>window.location.reload(),className:"mt-3 text-xs bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 px-3 py-1.5 rounded-md hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors",children:"Retry"})]})});const p=i.items.filter(x=>(x.name||x.run_id||"").toLowerCase().includes(f.toLowerCase())),g=()=>{const x=(y,v)=>u.jsx(Vo,{label:y.name,icon:ea,level:v,isActive:r===y.experiment_id,onClick:()=>t==null?void 0:t(y),badge:u.jsx("span",{className:"text-[10px] bg-slate-100 dark:bg-slate-800 text-slate-500 px-1.5 py-0.5 rounded-full",children:y.run_count||0})},y.experiment_id);return e||i.projects.length===0?p.map(y=>x(y,0)):i.projects.map(y=>{const v=p.filter(w=>w.project===y.name);return v.length===0?null:u.jsx(Vo,{label:y.name,icon:Ua,level:0,defaultExpanded:!0,badge:u.jsx("span",{className:"text-xs text-slate-400",children:v.length}),children:v.map(w=>x(w,1))},y.name)})},m=()=>{const x=(y,v)=>u.jsx(Vo,{label:y.name,icon:ja,level:v,isActive:r===y.name,onClick:()=>t==null?void 0:t(y),badge:u.jsxs("span",{className:"text-[10px] bg-slate-100 dark:bg-slate-800 text-slate-500 px-1.5 py-0.5 rounded-full",children:["v",y.version||"1"]})},y.name);return e||i.projects.length===0?p.map(y=>x(y,0)):i.projects.map(y=>{const v=p.filter(w=>w.project===y.name);return v.length===0?null:u.jsx(Vo,{label:y.name,icon:Ua,level:0,defaultExpanded:!0,children:v.map(w=>x(w,1))},y.name)})},b=()=>{const x=(v,w)=>u.jsx(Vo,{label:v.name||v.run_id.slice(0,8),subLabel:ri(v.created||v.start_time),icon:Or,level:w,status:v.status,isActive:r===v.run_id,onClick:()=>t==null?void 0:t(v)},v.run_id);return[...new Set(p.map(v=>v.pipeline_name).filter(Boolean))].map(v=>{const w=p.filter(j=>j.pipeline_name===v);return u.jsx(Vo,{label:v,icon:Ge,level:0,defaultExpanded:!0,badge:u.jsx("span",{className:"text-xs text-slate-400",children:w.length}),children:w.map(j=>x(j,1))},v)})};return u.jsxs("div",{className:`flex flex-col h-full bg-slate-50/50 dark:bg-slate-900/50 ${a}`,children:[u.jsx("div",{className:"p-2 sticky top-0 bg-inherit z-10",children:u.jsxs("div",{className:"relative",children:[u.jsx(Kp,{className:"absolute left-2.5 top-2.5 w-4 h-4 text-slate-400"}),u.jsx("input",{type:"text",placeholder:`Search ${n}...`,value:f,onChange:x=>h(x.target.value),className:"w-full pl-9 pr-3 py-2 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]})}),u.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:p.length===0?u.jsxs("div",{className:"text-center py-8 text-slate-400 text-sm",children:["No ",n," found"]}):u.jsxs(u.Fragment,{children:[n==="experiments"&&g(),n==="pipelines"&&m(),n==="runs"&&b()]})})]})}function eN({currentProject:e,onUpdate:t,type:r="default"}){const[n,a]=_.useState([]),[i,s]=_.useState(!1),[o,l]=_.useState(!1);_.useEffect(()=>{i&&n.length===0&&c()},[i]);const c=async()=>{l(!0);try{const h=await(await _e("/api/projects/")).json();a(h.projects||[])}catch(f){console.error("Failed to fetch projects:",f)}finally{l(!1)}},d=async f=>{if(f===e){s(!1);return}await t(f),s(!1)};return u.jsxs("div",{className:"relative",children:[u.jsxs("button",{onClick:()=>s(!i),className:`
482
- flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-all
483
- ${e?"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 hover:bg-blue-100 dark:hover:bg-blue-900/30":"bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-400 hover:bg-slate-200 dark:hover:bg-slate-700"}
484
- `,children:[u.jsx(Ua,{size:14}),u.jsx("span",{children:e||"Assign Project"}),u.jsx(u6,{size:12,className:`transition-transform ${i?"rotate-180":""}`})]}),u.jsx(hi,{children:i&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>s(!1)}),u.jsxs(Me.div,{initial:{opacity:0,y:5,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:5,scale:.95},transition:{duration:.1},className:"absolute top-full left-0 mt-2 w-56 bg-white dark:bg-slate-800 rounded-xl shadow-xl border border-slate-200 dark:border-slate-700 z-50 overflow-hidden",children:[u.jsx("div",{className:"p-2 border-b border-slate-100 dark:border-slate-700 bg-slate-50 dark:bg-slate-800/50",children:u.jsx("span",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider px-2",children:"Select Project"})}),u.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:o?u.jsx("div",{className:"p-4 text-center text-slate-400 text-xs",children:"Loading..."}):u.jsxs(u.Fragment,{children:[n.map(f=>u.jsxs("button",{onClick:()=>d(f.name),className:`
485
- w-full flex items-center justify-between px-3 py-2 rounded-lg text-sm transition-colors
486
- ${e===f.name?"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300":"text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-700"}
487
- `,children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ua,{size:14}),u.jsx("span",{className:"truncate max-w-[140px]",children:f.name})]}),e===f.name&&u.jsx(m_,{size:14})]},f.name)),n.length===0&&u.jsx("div",{className:"p-3 text-center text-slate-400 text-xs",children:"No projects found"})]})})]})]})})]})}function Fee({pipeline:e,onClose:t,onProjectUpdate:r}){const[n,a]=_.useState([]),[i,s]=_.useState(!1),[o,l]=_.useState(e==null?void 0:e.project),c=Xz();_.useEffect(()=>{e&&(d(),l(e.project))},[e]);const d=async()=>{s(!0);try{const g=`/api/runs?pipeline=${encodeURIComponent(e.name)}&limit=50`,b=await(await _e(g)).json();a(b.runs||[])}catch(g){console.error("Failed to fetch runs:",g),c.error(`Failed to load pipeline runs: ${g.message}`)}finally{s(!1)}},f=async g=>{try{await _e(`/api/pipelines/${e.name}/project`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_name:g})}),l(g),c.success(`Pipeline assigned to project: ${g}`),r&&r()}catch(m){console.error("Failed to update project:",m),c.error(`Failed to update project: ${m.message}`)}};if(!e)return null;const h={total:n.length,success:n.filter(g=>g.status==="completed").length,failed:n.filter(g=>g.status==="failed").length,avgDuration:n.length>0?n.reduce((g,m)=>g+(m.duration||0),0)/n.length:0},p=h.total>0?h.success/h.total*100:0;return u.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-slate-900",children:[u.jsxs("div",{className:"p-6 border-b border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-800/50",children:[u.jsxs("div",{className:"flex items-start justify-between mb-4",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("div",{className:"p-3 bg-gradient-to-br from-primary-500 to-purple-500 rounded-xl text-white shadow-lg",children:u.jsx(ja,{size:24})}),u.jsxs("div",{children:[u.jsx("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white",children:e.name}),u.jsxs("div",{className:"flex items-center gap-2 mt-1 text-sm text-slate-500",children:[u.jsx(eN,{currentProject:o,onUpdate:f}),e.version&&u.jsxs(u.Fragment,{children:[u.jsx("span",{children:"•"}),u.jsxs(Ot,{variant:"secondary",className:"text-xs",children:["v",e.version]})]})]})]})]}),u.jsx("div",{className:"flex items-center gap-2",children:u.jsx(Se,{variant:"ghost",size:"sm",onClick:t,children:u.jsx(No,{size:20,className:"text-slate-400"})})})]}),u.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[u.jsx(bh,{label:"Total Runs",value:h.total,icon:Ge,color:"blue"}),u.jsx(bh,{label:"Success Rate",value:`${Math.round(p)}%`,icon:Lt,color:p>=80?"emerald":p>=50?"amber":"rose"}),u.jsx(bh,{label:"Avg Duration",value:`${h.avgDuration.toFixed(1)}s`,icon:tt,color:"purple"}),u.jsx(bh,{label:"Failed",value:h.failed,icon:pr,color:"rose"})]})]}),u.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[u.jsxs("div",{className:"p-4 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between bg-white dark:bg-slate-900",children:[u.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-white flex items-center gap-2",children:[u.jsx(Or,{size:18,className:"text-slate-400"}),"Recent Executions"]}),u.jsx(st,{to:`/runs?pipeline=${encodeURIComponent(e.name)}`,children:u.jsxs(Se,{variant:"ghost",size:"sm",className:"text-primary-600",children:["View All Runs ",u.jsx(is,{size:16,className:"ml-1"})]})})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-slate-50 dark:bg-slate-900/50",children:i?u.jsx("div",{className:"flex justify-center py-8",children:u.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):n.length===0?u.jsx("div",{className:"text-center py-12 text-slate-500",children:"No runs found for this pipeline"}):n.map(g=>u.jsx(st,{to:`/runs/${g.run_id}`,children:u.jsx(Me.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"bg-white dark:bg-slate-800 p-4 rounded-xl border border-slate-200 dark:border-slate-700 hover:shadow-md hover:border-primary-300 dark:hover:border-primary-700 transition-all group",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx(rm,{status:g.status}),u.jsxs("div",{children:[u.jsxs("div",{className:"font-medium text-slate-900 dark:text-white flex items-center gap-2",children:[g.name||`Run ${g.run_id.slice(0,8)}`,u.jsxs("span",{className:"text-xs font-mono text-slate-400",children:["#",g.run_id.slice(0,6)]})]}),u.jsxs("div",{className:"flex items-center gap-3 text-xs text-slate-500 mt-1",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(kn,{size:12}),wt(new Date(g.created||g.start_time),"MMM d, HH:mm")]}),u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(tt,{size:12}),g.duration?`${g.duration.toFixed(1)}s`:"-"]})]})]})]}),u.jsx(is,{size:16,className:"text-slate-300 group-hover:text-primary-500 transition-colors"})]})})},g.run_id))})]})]})}function bh({label:e,value:t,icon:r,color:n}){const a={blue:"text-blue-600 bg-blue-50 dark:bg-blue-900/20",emerald:"text-emerald-600 bg-emerald-50 dark:bg-emerald-900/20",purple:"text-purple-600 bg-purple-50 dark:bg-purple-900/20",rose:"text-rose-600 bg-rose-50 dark:bg-rose-900/20",amber:"text-amber-600 bg-amber-50 dark:bg-amber-900/20"};return u.jsxs("div",{className:"bg-white dark:bg-slate-800 p-3 rounded-xl border border-slate-200 dark:border-slate-700",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[u.jsx("div",{className:`p-1 rounded-lg ${a[n]||a.blue}`,children:u.jsx(r,{size:14})}),u.jsx("span",{className:"text-xs text-slate-500 font-medium",children:e})]}),u.jsx("div",{className:"text-lg font-bold text-slate-900 dark:text-white pl-1",children:t})]})}function Bee(){const[e,t]=_.useState([]),[r,n]=_.useState(!0),[a,i]=_.useState(null),[s,o]=_.useState(null),{selectedProject:l}=fi(),c=async()=>{n(!0),i(null);try{const f=l?`/api/pipelines/?project=${encodeURIComponent(l)}`:"/api/pipelines/",h=await _e(f);if(!h.ok)throw new Error(`Failed to fetch pipelines: ${h.statusText}`);const p=await h.json();t(p.pipelines||[])}catch(f){console.error(f),i(f.message)}finally{n(!1)}};_.useEffect(()=>{c()},[l]);const d=f=>{o(f)};return a?u.jsx("div",{className:"flex items-center justify-center h-screen bg-slate-50 dark:bg-slate-900",children:u.jsxs("div",{className:"text-center p-8 bg-red-50 dark:bg-red-900/20 rounded-2xl border border-red-100 dark:border-red-800 max-w-md",children:[u.jsx(pr,{className:"w-12 h-12 text-red-500 mx-auto mb-4"}),u.jsx("h3",{className:"text-lg font-bold text-red-700 dark:text-red-300 mb-2",children:"Failed to load pipelines"}),u.jsx("p",{className:"text-red-600 dark:text-red-400 mb-6",children:a}),u.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg shadow-sm hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors text-slate-700 dark:text-slate-300 font-medium",children:"Retry Connection"})]})}):u.jsxs("div",{className:"h-screen flex flex-col overflow-hidden bg-slate-50 dark:bg-slate-900",children:[u.jsx("div",{className:"bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 px-6 py-4 shrink-0",children:u.jsx("div",{className:"flex items-center justify-between max-w-[1800px] mx-auto",children:u.jsxs("div",{children:[u.jsxs("h1",{className:"text-xl font-bold text-slate-900 dark:text-white flex items-center gap-2",children:[u.jsx(ja,{className:"text-primary-500"}),"Pipelines"]}),u.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:"View and manage your ML pipelines"})]})})}),u.jsx("div",{className:"flex-1 overflow-hidden",children:u.jsx("div",{className:"h-full max-w-[1800px] mx-auto px-6 py-6",children:u.jsxs("div",{className:"h-full flex gap-6",children:[u.jsxs("div",{className:"w-[320px] shrink-0 flex flex-col bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden shadow-sm",children:[u.jsx("div",{className:"p-3 border-b border-slate-200 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-800/50",children:u.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Explorer"})}),u.jsx("div",{className:"flex-1 min-h-0",children:u.jsx(J_,{mode:"pipelines",projectId:l,onSelect:d,selectedId:s==null?void 0:s.name})})]}),u.jsx("div",{className:"flex-1 min-w-0 bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden shadow-sm",children:s?u.jsx(Fee,{pipeline:s,onClose:()=>o(null),onProjectUpdate:c}):u.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center p-8 bg-slate-50/50 dark:bg-slate-900/50",children:[u.jsx("div",{className:"w-20 h-20 bg-primary-100 dark:bg-primary-900/30 rounded-full flex items-center justify-center mb-6 animate-pulse",children:u.jsx(ja,{size:40,className:"text-primary-500"})}),u.jsx("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white mb-2",children:"Select a Pipeline"}),u.jsx("p",{className:"text-slate-500 max-w-md",children:"Choose a pipeline from the sidebar to view execution history and statistics."})]})})]})})})]})}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 hF={exports:{}},pF={},mF={exports:{}},gF={};/**
488
- * @license React
489
- * use-sync-external-store-shim.production.js
490
- *
491
- * Copyright (c) Meta Platforms, Inc. and affiliates.
492
- *
493
- * This source code is licensed under the MIT license found in the
494
- * LICENSE file in the root directory of this source tree.
495
- */var Gl=_;function Vee(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qee=typeof Object.is=="function"?Object.is:Vee,Uee=Gl.useState,Hee=Gl.useEffect,Wee=Gl.useLayoutEffect,Gee=Gl.useDebugValue;function Kee(e,t){var r=t(),n=Uee({inst:{value:r,getSnapshot:t}}),a=n[0].inst,i=n[1];return Wee(function(){a.value=r,a.getSnapshot=t,zy(a)&&i({inst:a})},[e,r,t]),Hee(function(){return zy(a)&&i({inst:a}),e(function(){zy(a)&&i({inst:a})})},[e]),Gee(r),r}function zy(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!qee(e,r)}catch{return!0}}function Yee(e,t){return t()}var Xee=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Yee:Kee;gF.useSyncExternalStore=Gl.useSyncExternalStore!==void 0?Gl.useSyncExternalStore:Xee;mF.exports=gF;var Zee=mF.exports;/**
496
- * @license React
497
- * use-sync-external-store-shim/with-selector.production.js
498
- *
499
- * Copyright (c) Meta Platforms, Inc. and affiliates.
500
- *
501
- * This source code is licensed under the MIT license found in the
502
- * LICENSE file in the root directory of this source tree.
503
- */var R0=_,Qee=Zee;function Jee(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ete=typeof Object.is=="function"?Object.is:Jee,tte=Qee.useSyncExternalStore,rte=R0.useRef,nte=R0.useEffect,ate=R0.useMemo,ite=R0.useDebugValue;pF.useSyncExternalStoreWithSelector=function(e,t,r,n,a){var i=rte(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=ate(function(){function l(p){if(!c){if(c=!0,d=p,p=n(p),a!==void 0&&s.hasValue){var g=s.value;if(a(g,p))return f=g}return f=p}if(g=f,ete(d,p))return g;var m=n(p);return a!==void 0&&a(g,m)?(d=p,g):(d=p,f=m)}var c=!1,d,f,h=r===void 0?null:r;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,r,n,a]);var o=tte(e,i[0],i[1]);return nte(function(){s.hasValue=!0,s.value=o},[o]),ite(o),o};hF.exports=pF;var ste=hF.exports;const ote=Ke(ste),lte={},LA=e=>{let t;const r=new Set,n=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const p=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),r.forEach(g=>g(t,p))}},a=()=>t,l={setState:n,getState:a,getInitialState:()=>c,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(lte?"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()}},c=t=e(n,a,l);return l},cte=e=>e?LA(e):LA,{useDebugValue:ute}=O,{useSyncExternalStoreWithSelector:dte}=ote,fte=e=>e;function yF(e,t=fte,r){const n=dte(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return ute(n),n}const zA=(e,t)=>{const r=cte(e),n=(a,i=t)=>yF(r,a,i);return Object.assign(n,r),n},hte=(e,t)=>e?zA(e,t):zA;function or(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,a]of e)if(!Object.is(a,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 pte={value:()=>{}};function $0(){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 hp(r)}function hp(e){this._=e}function mte(e,t){return e.trim().split(/^|\s+/).map(function(r){var n="",a=r.indexOf(".");if(a>=0&&(n=r.slice(a+1),r=r.slice(0,a)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}hp.prototype=$0.prototype={constructor:hp,on:function(e,t){var r=this._,n=mte(e+"",r),a,i=-1,s=n.length;if(arguments.length<2){for(;++i<s;)if((a=(e=n[i]).type)&&(a=gte(r[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(a=(e=n[i]).type)r[a]=FA(r[a],e.name,t);else if(t==null)for(a in r)r[a]=FA(r[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new hp(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var r=new Array(a),n=0,a,i;n<a;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],n=0,a=i.length;n<a;++n)i[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],a=0,i=n.length;a<i;++a)n[a].value.apply(t,r)}};function gte(e,t){for(var r=0,n=e.length,a;r<n;++r)if((a=e[r]).name===t)return a.value}function FA(e,t,r){for(var n=0,a=e.length;n<a;++n)if(e[n].name===t){e[n]=pte,e=e.slice(0,n).concat(e.slice(n+1));break}return r!=null&&e.push({name:t,value:r}),e}var _S="http://www.w3.org/1999/xhtml";const BA={svg:"http://www.w3.org/2000/svg",xhtml:_S,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function D0(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),BA.hasOwnProperty(t)?{space:BA[t],local:e}:e}function yte(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===_S&&t.documentElement.namespaceURI===_S?t.createElement(e):t.createElementNS(r,e)}}function vte(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function vF(e){var t=D0(e);return(t.local?vte:yte)(t)}function xte(){}function tN(e){return e==null?xte:function(){return this.querySelector(e)}}function bte(e){typeof e!="function"&&(e=tN(e));for(var t=this._groups,r=t.length,n=new Array(r),a=0;a<r;++a)for(var i=t[a],s=i.length,o=n[a]=new Array(s),l,c,d=0;d<s;++d)(l=i[d])&&(c=e.call(l,l.__data__,d,i))&&("__data__"in l&&(c.__data__=l.__data__),o[d]=c);return new rn(n,this._parents)}function wte(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function jte(){return[]}function xF(e){return e==null?jte:function(){return this.querySelectorAll(e)}}function Ste(e){return function(){return wte(e.apply(this,arguments))}}function kte(e){typeof e=="function"?e=Ste(e):e=xF(e);for(var t=this._groups,r=t.length,n=[],a=[],i=0;i<r;++i)for(var s=t[i],o=s.length,l,c=0;c<o;++c)(l=s[c])&&(n.push(e.call(l,l.__data__,c,s)),a.push(l));return new rn(n,a)}function bF(e){return function(){return this.matches(e)}}function wF(e){return function(t){return t.matches(e)}}var _te=Array.prototype.find;function Nte(e){return function(){return _te.call(this.children,e)}}function Ete(){return this.firstElementChild}function Pte(e){return this.select(e==null?Ete:Nte(typeof e=="function"?e:wF(e)))}var Cte=Array.prototype.filter;function Ate(){return Array.from(this.children)}function Tte(e){return function(){return Cte.call(this.children,e)}}function Ote(e){return this.selectAll(e==null?Ate:Tte(typeof e=="function"?e:wF(e)))}function Mte(e){typeof e!="function"&&(e=bF(e));for(var t=this._groups,r=t.length,n=new Array(r),a=0;a<r;++a)for(var i=t[a],s=i.length,o=n[a]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&o.push(l);return new rn(n,this._parents)}function jF(e){return new Array(e.length)}function Rte(){return new rn(this._enter||this._groups.map(jF),this._parents)}function am(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}am.prototype={constructor:am,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 $te(e){return function(){return e}}function Dte(e,t,r,n,a,i){for(var s=0,o,l=t.length,c=i.length;s<c;++s)(o=t[s])?(o.__data__=i[s],n[s]=o):r[s]=new am(e,i[s]);for(;s<l;++s)(o=t[s])&&(a[s]=o)}function Ite(e,t,r,n,a,i,s){var o,l,c=new Map,d=t.length,f=i.length,h=new Array(d),p;for(o=0;o<d;++o)(l=t[o])&&(h[o]=p=s.call(l,l.__data__,o,t)+"",c.has(p)?a[o]=l:c.set(p,l));for(o=0;o<f;++o)p=s.call(e,i[o],o,i)+"",(l=c.get(p))?(n[o]=l,l.__data__=i[o],c.delete(p)):r[o]=new am(e,i[o]);for(o=0;o<d;++o)(l=t[o])&&c.get(h[o])===l&&(a[o]=l)}function Lte(e){return e.__data__}function zte(e,t){if(!arguments.length)return Array.from(this,Lte);var r=t?Ite:Dte,n=this._parents,a=this._groups;typeof e!="function"&&(e=$te(e));for(var i=a.length,s=new Array(i),o=new Array(i),l=new Array(i),c=0;c<i;++c){var d=n[c],f=a[c],h=f.length,p=Fte(e.call(d,d&&d.__data__,c,n)),g=p.length,m=o[c]=new Array(g),b=s[c]=new Array(g),x=l[c]=new Array(h);r(d,f,m,b,x,p,t);for(var y=0,v=0,w,j;y<g;++y)if(w=m[y]){for(y>=v&&(v=y+1);!(j=b[v])&&++v<g;);w._next=j||null}}return s=new rn(s,n),s._enter=o,s._exit=l,s}function Fte(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Bte(){return new rn(this._exit||this._groups.map(jF),this._parents)}function Vte(e,t,r){var n=this.enter(),a=this,i=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),r==null?i.remove():r(i),n&&a?n.merge(a).order():a}function qte(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,a=r.length,i=n.length,s=Math.min(a,i),o=new Array(a),l=0;l<s;++l)for(var c=r[l],d=n[l],f=c.length,h=o[l]=new Array(f),p,g=0;g<f;++g)(p=c[g]||d[g])&&(h[g]=p);for(;l<a;++l)o[l]=r[l];return new rn(o,this._parents)}function Ute(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n=e[t],a=n.length-1,i=n[a],s;--a>=0;)(s=n[a])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Hte(e){e||(e=Wte);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var r=this._groups,n=r.length,a=new Array(n),i=0;i<n;++i){for(var s=r[i],o=s.length,l=a[i]=new Array(o),c,d=0;d<o;++d)(c=s[d])&&(l[d]=c);l.sort(t)}return new rn(a,this._parents).order()}function Wte(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Gte(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Kte(){return Array.from(this)}function Yte(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],a=0,i=n.length;a<i;++a){var s=n[a];if(s)return s}return null}function Xte(){let e=0;for(const t of this)++e;return e}function Zte(){return!this.node()}function Qte(e){for(var t=this._groups,r=0,n=t.length;r<n;++r)for(var a=t[r],i=0,s=a.length,o;i<s;++i)(o=a[i])&&e.call(o,o.__data__,i,a);return this}function Jte(e){return function(){this.removeAttribute(e)}}function ere(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tre(e,t){return function(){this.setAttribute(e,t)}}function rre(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function nre(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function are(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 ire(e,t){var r=D0(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?ere:Jte:typeof t=="function"?r.local?are:nre:r.local?rre:tre)(r,t))}function SF(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function sre(e){return function(){this.style.removeProperty(e)}}function ore(e,t,r){return function(){this.style.setProperty(e,t,r)}}function lre(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function cre(e,t,r){return arguments.length>1?this.each((t==null?sre:typeof t=="function"?lre:ore)(e,t,r??"")):Kl(this.node(),e)}function Kl(e,t){return e.style.getPropertyValue(t)||SF(e).getComputedStyle(e,null).getPropertyValue(t)}function ure(e){return function(){delete this[e]}}function dre(e,t){return function(){this[e]=t}}function fre(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function hre(e,t){return arguments.length>1?this.each((t==null?ure:typeof t=="function"?fre:dre)(e,t)):this.node()[e]}function kF(e){return e.trim().split(/^|\s+/)}function rN(e){return e.classList||new _F(e)}function _F(e){this._node=e,this._names=kF(e.getAttribute("class")||"")}_F.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 NF(e,t){for(var r=rN(e),n=-1,a=t.length;++n<a;)r.add(t[n])}function EF(e,t){for(var r=rN(e),n=-1,a=t.length;++n<a;)r.remove(t[n])}function pre(e){return function(){NF(this,e)}}function mre(e){return function(){EF(this,e)}}function gre(e,t){return function(){(t.apply(this,arguments)?NF:EF)(this,e)}}function yre(e,t){var r=kF(e+"");if(arguments.length<2){for(var n=rN(this.node()),a=-1,i=r.length;++a<i;)if(!n.contains(r[a]))return!1;return!0}return this.each((typeof t=="function"?gre:t?pre:mre)(r,t))}function vre(){this.textContent=""}function xre(e){return function(){this.textContent=e}}function bre(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function wre(e){return arguments.length?this.each(e==null?vre:(typeof e=="function"?bre:xre)(e)):this.node().textContent}function jre(){this.innerHTML=""}function Sre(e){return function(){this.innerHTML=e}}function kre(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function _re(e){return arguments.length?this.each(e==null?jre:(typeof e=="function"?kre:Sre)(e)):this.node().innerHTML}function Nre(){this.nextSibling&&this.parentNode.appendChild(this)}function Ere(){return this.each(Nre)}function Pre(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Cre(){return this.each(Pre)}function Are(e){var t=typeof e=="function"?e:vF(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Tre(){return null}function Ore(e,t){var r=typeof e=="function"?e:vF(e),n=t==null?Tre:typeof t=="function"?t:tN(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function Mre(){var e=this.parentNode;e&&e.removeChild(this)}function Rre(){return this.each(Mre)}function $re(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Dre(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ire(e){return this.select(e?Dre:$re)}function Lre(e){return arguments.length?this.property("__data__",e):this.node().__data__}function zre(e){return function(t){e.call(this,t,this.__data__)}}function Fre(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 Bre(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,a=t.length,i;r<a;++r)i=t[r],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++n]=i;++n?t.length=n:delete this.__on}}}function Vre(e,t,r){return function(){var n=this.__on,a,i=zre(t);if(n){for(var s=0,o=n.length;s<o;++s)if((a=n[s]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=i,a.options=r),a.value=t;return}}this.addEventListener(e.type,i,r),a={type:e.type,name:e.name,value:t,listener:i,options:r},n?n.push(a):this.__on=[a]}}function qre(e,t,r){var n=Fre(e+""),a,i=n.length,s;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,d;l<c;++l)for(a=0,d=o[l];a<i;++a)if((s=n[a]).type===d.type&&s.name===d.name)return d.value}return}for(o=t?Vre:Bre,a=0;a<i;++a)this.each(o(n[a],t,r));return this}function PF(e,t,r){var n=SF(e),a=n.CustomEvent;typeof a=="function"?a=new a(t,r):(a=n.document.createEvent("Event"),r?(a.initEvent(t,r.bubbles,r.cancelable),a.detail=r.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function Ure(e,t){return function(){return PF(this,e,t)}}function Hre(e,t){return function(){return PF(this,e,t.apply(this,arguments))}}function Wre(e,t){return this.each((typeof t=="function"?Hre:Ure)(e,t))}function*Gre(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],a=0,i=n.length,s;a<i;++a)(s=n[a])&&(yield s)}var CF=[null];function rn(e,t){this._groups=e,this._parents=t}function Af(){return new rn([[document.documentElement]],CF)}function Kre(){return this}rn.prototype=Af.prototype={constructor:rn,select:bte,selectAll:kte,selectChild:Pte,selectChildren:Ote,filter:Mte,data:zte,enter:Rte,exit:Bte,join:Vte,merge:qte,selection:Kre,order:Ute,sort:Hte,call:Gte,nodes:Kte,node:Yte,size:Xte,empty:Zte,each:Qte,attr:ire,style:cre,property:hre,classed:yre,text:wre,html:_re,raise:Ere,lower:Cre,append:Are,insert:Ore,remove:Rre,clone:Ire,datum:Lre,on:qre,dispatch:Wre,[Symbol.iterator]:Gre};function vn(e){return typeof e=="string"?new rn([[document.querySelector(e)]],[document.documentElement]):new rn([[e]],CF)}function Yre(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Un(e,t){if(e=Yre(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 a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const Xre={passive:!1},Md={capture:!0,passive:!1};function Fy(e){e.stopImmediatePropagation()}function Cl(e){e.preventDefault(),e.stopImmediatePropagation()}function AF(e){var t=e.document.documentElement,r=vn(e).on("dragstart.drag",Cl,Md);"onselectstart"in t?r.on("selectstart.drag",Cl,Md):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function TF(e,t){var r=e.document.documentElement,n=vn(e).on("dragstart.drag",null);t&&(n.on("click.drag",Cl,Md),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 wh=e=>()=>e;function NS(e,{sourceEvent:t,subject:r,target:n,identifier:a,active:i,x:s,y:o,dx:l,dy:c,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:a,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}NS.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Zre(e){return!e.ctrlKey&&!e.button}function Qre(){return this.parentNode}function Jre(e,t){return t??{x:e.x,y:e.y}}function ene(){return navigator.maxTouchPoints||"ontouchstart"in this}function tne(){var e=Zre,t=Qre,r=Jre,n=ene,a={},i=$0("start","drag","end"),s=0,o,l,c,d,f=0;function h(w){w.on("mousedown.drag",p).filter(n).on("touchstart.drag",b).on("touchmove.drag",x,Xre).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(w,j){if(!(d||!e.call(this,w,j))){var k=v(this,t.call(this,w,j),w,j,"mouse");k&&(vn(w.view).on("mousemove.drag",g,Md).on("mouseup.drag",m,Md),AF(w.view),Fy(w),c=!1,o=w.clientX,l=w.clientY,k("start",w))}}function g(w){if(Cl(w),!c){var j=w.clientX-o,k=w.clientY-l;c=j*j+k*k>f}a.mouse("drag",w)}function m(w){vn(w.view).on("mousemove.drag mouseup.drag",null),TF(w.view,c),Cl(w),a.mouse("end",w)}function b(w,j){if(e.call(this,w,j)){var k=w.changedTouches,S=t.call(this,w,j),N=k.length,E,A;for(E=0;E<N;++E)(A=v(this,S,w,j,k[E].identifier,k[E]))&&(Fy(w),A("start",w,k[E]))}}function x(w){var j=w.changedTouches,k=j.length,S,N;for(S=0;S<k;++S)(N=a[j[S].identifier])&&(Cl(w),N("drag",w,j[S]))}function y(w){var j=w.changedTouches,k=j.length,S,N;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),S=0;S<k;++S)(N=a[j[S].identifier])&&(Fy(w),N("end",w,j[S]))}function v(w,j,k,S,N,E){var A=i.copy(),C=Un(E||k,j),M,T,P;if((P=r.call(w,new NS("beforestart",{sourceEvent:k,target:h,identifier:N,active:s,x:C[0],y:C[1],dx:0,dy:0,dispatch:A}),S))!=null)return M=P.x-C[0]||0,T=P.y-C[1]||0,function D($,L,I){var R=C,z;switch($){case"start":a[N]=D,z=s++;break;case"end":delete a[N],--s;case"drag":C=Un(I||L,j),z=s;break}A.call($,w,new NS($,{sourceEvent:L,subject:P,target:h,identifier:N,active:z,x:C[0]+M,y:C[1]+T,dx:C[0]-R[0],dy:C[1]-R[1],dispatch:A}),S)}}return h.filter=function(w){return arguments.length?(e=typeof w=="function"?w:wh(!!w),h):e},h.container=function(w){return arguments.length?(t=typeof w=="function"?w:wh(w),h):t},h.subject=function(w){return arguments.length?(r=typeof w=="function"?w:wh(w),h):r},h.touchable=function(w){return arguments.length?(n=typeof w=="function"?w:wh(!!w),h):n},h.on=function(){var w=i.on.apply(i,arguments);return w===i?h:w},h.clickDistance=function(w){return arguments.length?(f=(w=+w)*w,h):Math.sqrt(f)},h}function nN(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function OF(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Tf(){}var Rd=.7,im=1/Rd,Al="\\s*([+-]?\\d+)\\s*",$d="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",xa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rne=/^#([0-9a-f]{3,8})$/,nne=new RegExp(`^rgb\\(${Al},${Al},${Al}\\)$`),ane=new RegExp(`^rgb\\(${xa},${xa},${xa}\\)$`),ine=new RegExp(`^rgba\\(${Al},${Al},${Al},${$d}\\)$`),sne=new RegExp(`^rgba\\(${xa},${xa},${xa},${$d}\\)$`),one=new RegExp(`^hsl\\(${$d},${xa},${xa}\\)$`),lne=new RegExp(`^hsla\\(${$d},${xa},${xa},${$d}\\)$`),VA={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};nN(Tf,mo,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qA,formatHex:qA,formatHex8:cne,formatHsl:une,formatRgb:UA,toString:UA});function qA(){return this.rgb().formatHex()}function cne(){return this.rgb().formatHex8()}function une(){return MF(this).formatHsl()}function UA(){return this.rgb().formatRgb()}function mo(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=rne.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?HA(t):r===3?new Br(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?jh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?jh(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=nne.exec(e))?new Br(t[1],t[2],t[3],1):(t=ane.exec(e))?new Br(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ine.exec(e))?jh(t[1],t[2],t[3],t[4]):(t=sne.exec(e))?jh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=one.exec(e))?KA(t[1],t[2]/100,t[3]/100,1):(t=lne.exec(e))?KA(t[1],t[2]/100,t[3]/100,t[4]):VA.hasOwnProperty(e)?HA(VA[e]):e==="transparent"?new Br(NaN,NaN,NaN,0):null}function HA(e){return new Br(e>>16&255,e>>8&255,e&255,1)}function jh(e,t,r,n){return n<=0&&(e=t=r=NaN),new Br(e,t,r,n)}function dne(e){return e instanceof Tf||(e=mo(e)),e?(e=e.rgb(),new Br(e.r,e.g,e.b,e.opacity)):new Br}function ES(e,t,r,n){return arguments.length===1?dne(e):new Br(e,t,r,n??1)}function Br(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}nN(Br,ES,OF(Tf,{brighter(e){return e=e==null?im:Math.pow(im,e),new Br(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Rd:Math.pow(Rd,e),new Br(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Br(eo(this.r),eo(this.g),eo(this.b),sm(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:WA,formatHex:WA,formatHex8:fne,formatRgb:GA,toString:GA}));function WA(){return`#${Us(this.r)}${Us(this.g)}${Us(this.b)}`}function fne(){return`#${Us(this.r)}${Us(this.g)}${Us(this.b)}${Us((isNaN(this.opacity)?1:this.opacity)*255)}`}function GA(){const e=sm(this.opacity);return`${e===1?"rgb(":"rgba("}${eo(this.r)}, ${eo(this.g)}, ${eo(this.b)}${e===1?")":`, ${e})`}`}function sm(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function eo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Us(e){return e=eo(e),(e<16?"0":"")+e.toString(16)}function KA(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Xn(e,t,r,n)}function MF(e){if(e instanceof Xn)return new Xn(e.h,e.s,e.l,e.opacity);if(e instanceof Tf||(e=mo(e)),!e)return new Xn;if(e instanceof Xn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),s=NaN,o=i-a,l=(i+a)/2;return o?(t===i?s=(r-n)/o+(r<n)*6:r===i?s=(n-t)/o+2:s=(t-r)/o+4,o/=l<.5?i+a:2-i-a,s*=60):o=l>0&&l<1?0:s,new Xn(s,o,l,e.opacity)}function hne(e,t,r,n){return arguments.length===1?MF(e):new Xn(e,t,r,n??1)}function Xn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}nN(Xn,hne,OF(Tf,{brighter(e){return e=e==null?im:Math.pow(im,e),new Xn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Rd:Math.pow(Rd,e),new Xn(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,a=2*r-n;return new Br(By(e>=240?e-240:e+120,a,n),By(e,a,n),By(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new Xn(YA(this.h),Sh(this.s),Sh(this.l),sm(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=sm(this.opacity);return`${e===1?"hsl(":"hsla("}${YA(this.h)}, ${Sh(this.s)*100}%, ${Sh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function YA(e){return e=(e||0)%360,e<0?e+360:e}function Sh(e){return Math.max(0,Math.min(1,e||0))}function By(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 aN=e=>()=>e;function pne(e,t){return function(r){return e+r*t}}function mne(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 gne(e){return(e=+e)==1?RF:function(t,r){return r-t?mne(t,r,e):aN(isNaN(t)?r:t)}}function RF(e,t){var r=t-e;return r?pne(e,r):aN(isNaN(e)?t:e)}const om=function e(t){var r=gne(t);function n(a,i){var s=r((a=ES(a)).r,(i=ES(i)).r),o=r(a.g,i.g),l=r(a.b,i.b),c=RF(a.opacity,i.opacity);return function(d){return a.r=s(d),a.g=o(d),a.b=l(d),a.opacity=c(d),a+""}}return n.gamma=e,n}(1);function yne(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;a<r;++a)n[a]=e[a]*(1-i)+t[a]*i;return n}}function vne(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function xne(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,a=new Array(n),i=new Array(r),s;for(s=0;s<n;++s)a[s]=Ac(e[s],t[s]);for(;s<r;++s)i[s]=t[s];return function(o){for(s=0;s<n;++s)i[s]=a[s](o);return i}}function bne(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Kn(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function wne(e,t){var r={},n={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?r[a]=Ac(e[a],t[a]):n[a]=t[a];return function(i){for(a in r)n[a]=r[a](i);return n}}var PS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Vy=new RegExp(PS.source,"g");function jne(e){return function(){return e}}function Sne(e){return function(t){return e(t)+""}}function $F(e,t){var r=PS.lastIndex=Vy.lastIndex=0,n,a,i,s=-1,o=[],l=[];for(e=e+"",t=t+"";(n=PS.exec(e))&&(a=Vy.exec(t));)(i=a.index)>r&&(i=t.slice(r,i),o[s]?o[s]+=i:o[++s]=i),(n=n[0])===(a=a[0])?o[s]?o[s]+=a:o[++s]=a:(o[++s]=null,l.push({i:s,x:Kn(n,a)})),r=Vy.lastIndex;return r<t.length&&(i=t.slice(r),o[s]?o[s]+=i:o[++s]=i),o.length<2?l[0]?Sne(l[0].x):jne(t):(t=l.length,function(c){for(var d=0,f;d<t;++d)o[(f=l[d]).i]=f.x(c);return o.join("")})}function Ac(e,t){var r=typeof t,n;return t==null||r==="boolean"?aN(t):(r==="number"?Kn:r==="string"?(n=mo(t))?(t=n,om):$F:t instanceof mo?om:t instanceof Date?bne:vne(t)?yne:Array.isArray(t)?xne:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?wne:Kn)(e,t)}function iN(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var XA=180/Math.PI,CS={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function DF(e,t,r,n,a,i){var s,o,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*r+t*n)&&(r-=e*l,n-=t*l),(o=Math.sqrt(r*r+n*n))&&(r/=o,n/=o,l/=o),e*n<t*r&&(e=-e,t=-t,l=-l,s=-s),{translateX:a,translateY:i,rotate:Math.atan2(t,e)*XA,skewX:Math.atan(l)*XA,scaleX:s,scaleY:o}}var kh;function kne(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?CS:DF(t.a,t.b,t.c,t.d,t.e,t.f)}function _ne(e){return e==null||(kh||(kh=document.createElementNS("http://www.w3.org/2000/svg","g")),kh.setAttribute("transform",e),!(e=kh.transform.baseVal.consolidate()))?CS:(e=e.matrix,DF(e.a,e.b,e.c,e.d,e.e,e.f))}function IF(e,t,r,n){function a(c){return c.length?c.pop()+" ":""}function i(c,d,f,h,p,g){if(c!==f||d!==h){var m=p.push("translate(",null,t,null,r);g.push({i:m-4,x:Kn(c,f)},{i:m-2,x:Kn(d,h)})}else(f||h)&&p.push("translate("+f+t+h+r)}function s(c,d,f,h){c!==d?(c-d>180?d+=360:d-c>180&&(c+=360),h.push({i:f.push(a(f)+"rotate(",null,n)-2,x:Kn(c,d)})):d&&f.push(a(f)+"rotate("+d+n)}function o(c,d,f,h){c!==d?h.push({i:f.push(a(f)+"skewX(",null,n)-2,x:Kn(c,d)}):d&&f.push(a(f)+"skewX("+d+n)}function l(c,d,f,h,p,g){if(c!==f||d!==h){var m=p.push(a(p)+"scale(",null,",",null,")");g.push({i:m-4,x:Kn(c,f)},{i:m-2,x:Kn(d,h)})}else(f!==1||h!==1)&&p.push(a(p)+"scale("+f+","+h+")")}return function(c,d){var f=[],h=[];return c=e(c),d=e(d),i(c.translateX,c.translateY,d.translateX,d.translateY,f,h),s(c.rotate,d.rotate,f,h),o(c.skewX,d.skewX,f,h),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,f,h),c=d=null,function(p){for(var g=-1,m=h.length,b;++g<m;)f[(b=h[g]).i]=b.x(p);return f.join("")}}}var Nne=IF(kne,"px, ","px)","deg)"),Ene=IF(_ne,", ",")",")"),Pne=1e-12;function ZA(e){return((e=Math.exp(e))+1/e)/2}function Cne(e){return((e=Math.exp(e))-1/e)/2}function Ane(e){return((e=Math.exp(2*e))-1)/(e+1)}const Tne=function e(t,r,n){function a(i,s){var o=i[0],l=i[1],c=i[2],d=s[0],f=s[1],h=s[2],p=d-o,g=f-l,m=p*p+g*g,b,x;if(m<Pne)x=Math.log(h/c)/t,b=function(S){return[o+S*p,l+S*g,c*Math.exp(t*S*x)]};else{var y=Math.sqrt(m),v=(h*h-c*c+n*m)/(2*c*r*y),w=(h*h-c*c-n*m)/(2*h*r*y),j=Math.log(Math.sqrt(v*v+1)-v),k=Math.log(Math.sqrt(w*w+1)-w);x=(k-j)/t,b=function(S){var N=S*x,E=ZA(j),A=c/(r*y)*(E*Ane(t*N+j)-Cne(j));return[o+A*p,l+A*g,c*E/ZA(t*N+j)]}}return b.duration=x*1e3*t/Math.SQRT2,b}return a.rho=function(i){var s=Math.max(.001,+i),o=s*s,l=o*o;return e(s,o,l)},a}(Math.SQRT2,2,4);function One(e,t){t===void 0&&(t=e,e=Ac);for(var r=0,n=t.length-1,a=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(a,a=t[++r]);return function(s){var o=Math.max(0,Math.min(n-1,Math.floor(s*=n)));return i[o](s-o)}}var Yl=0,Au=0,ou=0,LF=1e3,lm,Tu,cm=0,go=0,I0=0,Dd=typeof performance=="object"&&performance.now?performance:Date,zF=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function sN(){return go||(zF(Mne),go=Dd.now()+I0)}function Mne(){go=0}function um(){this._call=this._time=this._next=null}um.prototype=FF.prototype={constructor:um,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?sN():+r)+(t==null?0:+t),!this._next&&Tu!==this&&(Tu?Tu._next=this:lm=this,Tu=this),this._call=e,this._time=r,AS()},stop:function(){this._call&&(this._call=null,this._time=1/0,AS())}};function FF(e,t,r){var n=new um;return n.restart(e,t,r),n}function Rne(){sN(),++Yl;for(var e=lm,t;e;)(t=go-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Yl}function QA(){go=(cm=Dd.now())+I0,Yl=Au=0;try{Rne()}finally{Yl=0,Dne(),go=0}}function $ne(){var e=Dd.now(),t=e-cm;t>LF&&(I0-=t,cm=e)}function Dne(){for(var e,t=lm,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:lm=r);Tu=e,AS(n)}function AS(e){if(!Yl){Au&&(Au=clearTimeout(Au));var t=e-go;t>24?(e<1/0&&(Au=setTimeout(QA,e-Dd.now()-I0)),ou&&(ou=clearInterval(ou))):(ou||(cm=Dd.now(),ou=setInterval($ne,LF)),Yl=1,zF(QA))}}function JA(e,t,r){var n=new um;return t=t==null?0:+t,n.restart(a=>{n.stop(),e(a+t)},t,r),n}var Ine=$0("start","end","cancel","interrupt"),Lne=[],BF=0,eT=1,TS=2,pp=3,tT=4,OS=5,mp=6;function L0(e,t,r,n,a,i){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;zne(e,r,{name:t,index:n,group:a,on:Ine,tween:Lne,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:BF})}function oN(e,t){var r=aa(e,t);if(r.state>BF)throw new Error("too late; already scheduled");return r}function ka(e,t){var r=aa(e,t);if(r.state>pp)throw new Error("too late; already running");return r}function aa(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function zne(e,t,r){var n=e.__transition,a;n[t]=r,r.timer=FF(i,0,r.time);function i(c){r.state=eT,r.timer.restart(s,r.delay,r.time),r.delay<=c&&s(c-r.delay)}function s(c){var d,f,h,p;if(r.state!==eT)return l();for(d in n)if(p=n[d],p.name===r.name){if(p.state===pp)return JA(s);p.state===tT?(p.state=mp,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete n[d]):+d<t&&(p.state=mp,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete n[d])}if(JA(function(){r.state===pp&&(r.state=tT,r.timer.restart(o,r.delay,r.time),o(c))}),r.state=TS,r.on.call("start",e,e.__data__,r.index,r.group),r.state===TS){for(r.state=pp,a=new Array(h=r.tween.length),d=0,f=-1;d<h;++d)(p=r.tween[d].value.call(e,e.__data__,r.index,r.group))&&(a[++f]=p);a.length=f+1}}function o(c){for(var d=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(l),r.state=OS,1),f=-1,h=a.length;++f<h;)a[f].call(e,d);r.state===OS&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=mp,r.timer.stop(),delete n[t];for(var c in n)return;delete e.__transition}}function gp(e,t){var r=e.__transition,n,a,i=!0,s;if(r){t=t==null?null:t+"";for(s in r){if((n=r[s]).name!==t){i=!1;continue}a=n.state>TS&&n.state<OS,n.state=mp,n.timer.stop(),n.on.call(a?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete r[s]}i&&delete e.__transition}}function Fne(e){return this.each(function(){gp(this,e)})}function Bne(e,t){var r,n;return function(){var a=ka(this,e),i=a.tween;if(i!==r){n=r=i;for(var s=0,o=n.length;s<o;++s)if(n[s].name===t){n=n.slice(),n.splice(s,1);break}}a.tween=n}}function Vne(e,t,r){var n,a;if(typeof r!="function")throw new Error;return function(){var i=ka(this,e),s=i.tween;if(s!==n){a=(n=s).slice();for(var o={name:t,value:r},l=0,c=a.length;l<c;++l)if(a[l].name===t){a[l]=o;break}l===c&&a.push(o)}i.tween=a}}function qne(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n=aa(this.node(),r).tween,a=0,i=n.length,s;a<i;++a)if((s=n[a]).name===e)return s.value;return null}return this.each((t==null?Bne:Vne)(r,e,t))}function lN(e,t,r){var n=e._id;return e.each(function(){var a=ka(this,n);(a.value||(a.value={}))[t]=r.apply(this,arguments)}),function(a){return aa(a,n).value[t]}}function VF(e,t){var r;return(typeof t=="number"?Kn:t instanceof mo?om:(r=mo(t))?(t=r,om):$F)(e,t)}function Une(e){return function(){this.removeAttribute(e)}}function Hne(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Wne(e,t,r){var n,a=r+"",i;return function(){var s=this.getAttribute(e);return s===a?null:s===n?i:i=t(n=s,r)}}function Gne(e,t,r){var n,a=r+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===a?null:s===n?i:i=t(n=s,r)}}function Kne(e,t,r){var n,a,i;return function(){var s,o=r(this),l;return o==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=o+"",s===l?null:s===n&&l===a?i:(a=l,i=t(n=s,o)))}}function Yne(e,t,r){var n,a,i;return function(){var s,o=r(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=o+"",s===l?null:s===n&&l===a?i:(a=l,i=t(n=s,o)))}}function Xne(e,t){var r=D0(e),n=r==="transform"?Ene:VF;return this.attrTween(e,typeof t=="function"?(r.local?Yne:Kne)(r,n,lN(this,"attr."+e,t)):t==null?(r.local?Hne:Une)(r):(r.local?Gne:Wne)(r,n,t))}function Zne(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Qne(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Jne(e,t){var r,n;function a(){var i=t.apply(this,arguments);return i!==n&&(r=(n=i)&&Qne(e,i)),r}return a._value=t,a}function eae(e,t){var r,n;function a(){var i=t.apply(this,arguments);return i!==n&&(r=(n=i)&&Zne(e,i)),r}return a._value=t,a}function tae(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=D0(e);return this.tween(r,(n.local?Jne:eae)(n,t))}function rae(e,t){return function(){oN(this,e).delay=+t.apply(this,arguments)}}function nae(e,t){return t=+t,function(){oN(this,e).delay=t}}function aae(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?rae:nae)(t,e)):aa(this.node(),t).delay}function iae(e,t){return function(){ka(this,e).duration=+t.apply(this,arguments)}}function sae(e,t){return t=+t,function(){ka(this,e).duration=t}}function oae(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?iae:sae)(t,e)):aa(this.node(),t).duration}function lae(e,t){if(typeof t!="function")throw new Error;return function(){ka(this,e).ease=t}}function cae(e){var t=this._id;return arguments.length?this.each(lae(t,e)):aa(this.node(),t).ease}function uae(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;ka(this,e).ease=r}}function dae(e){if(typeof e!="function")throw new Error;return this.each(uae(this._id,e))}function fae(e){typeof e!="function"&&(e=bF(e));for(var t=this._groups,r=t.length,n=new Array(r),a=0;a<r;++a)for(var i=t[a],s=i.length,o=n[a]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&o.push(l);return new ni(n,this._parents,this._name,this._id)}function hae(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,a=r.length,i=Math.min(n,a),s=new Array(n),o=0;o<i;++o)for(var l=t[o],c=r[o],d=l.length,f=s[o]=new Array(d),h,p=0;p<d;++p)(h=l[p]||c[p])&&(f[p]=h);for(;o<n;++o)s[o]=t[o];return new ni(s,this._parents,this._name,this._id)}function pae(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 mae(e,t,r){var n,a,i=pae(t)?oN:ka;return function(){var s=i(this,e),o=s.on;o!==n&&(a=(n=o).copy()).on(t,r),s.on=a}}function gae(e,t){var r=this._id;return arguments.length<2?aa(this.node(),r).on.on(e):this.each(mae(r,e,t))}function yae(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function vae(){return this.on("end.remove",yae(this._id))}function xae(e){var t=this._name,r=this._id;typeof e!="function"&&(e=tN(e));for(var n=this._groups,a=n.length,i=new Array(a),s=0;s<a;++s)for(var o=n[s],l=o.length,c=i[s]=new Array(l),d,f,h=0;h<l;++h)(d=o[h])&&(f=e.call(d,d.__data__,h,o))&&("__data__"in d&&(f.__data__=d.__data__),c[h]=f,L0(c[h],t,r,h,c,aa(d,r)));return new ni(i,this._parents,t,r)}function bae(e){var t=this._name,r=this._id;typeof e!="function"&&(e=xF(e));for(var n=this._groups,a=n.length,i=[],s=[],o=0;o<a;++o)for(var l=n[o],c=l.length,d,f=0;f<c;++f)if(d=l[f]){for(var h=e.call(d,d.__data__,f,l),p,g=aa(d,r),m=0,b=h.length;m<b;++m)(p=h[m])&&L0(p,t,r,m,h,g);i.push(h),s.push(d)}return new ni(i,s,t,r)}var wae=Af.prototype.constructor;function jae(){return new wae(this._groups,this._parents)}function Sae(e,t){var r,n,a;return function(){var i=Kl(this,e),s=(this.style.removeProperty(e),Kl(this,e));return i===s?null:i===r&&s===n?a:a=t(r=i,n=s)}}function qF(e){return function(){this.style.removeProperty(e)}}function kae(e,t,r){var n,a=r+"",i;return function(){var s=Kl(this,e);return s===a?null:s===n?i:i=t(n=s,r)}}function _ae(e,t,r){var n,a,i;return function(){var s=Kl(this,e),o=r(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Kl(this,e))),s===l?null:s===n&&l===a?i:(a=l,i=t(n=s,o))}}function Nae(e,t){var r,n,a,i="style."+t,s="end."+i,o;return function(){var l=ka(this,e),c=l.on,d=l.value[i]==null?o||(o=qF(t)):void 0;(c!==r||a!==d)&&(n=(r=c).copy()).on(s,a=d),l.on=n}}function Eae(e,t,r){var n=(e+="")=="transform"?Nne:VF;return t==null?this.styleTween(e,Sae(e,n)).on("end.style."+e,qF(e)):typeof t=="function"?this.styleTween(e,_ae(e,n,lN(this,"style."+e,t))).each(Nae(this._id,e)):this.styleTween(e,kae(e,n,t),r).on("end.style."+e,null)}function Pae(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function Cae(e,t,r){var n,a;function i(){var s=t.apply(this,arguments);return s!==a&&(n=(a=s)&&Pae(e,s,r)),n}return i._value=t,i}function Aae(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,Cae(e,t,r??""))}function Tae(e){return function(){this.textContent=e}}function Oae(e){return function(){var t=e(this);this.textContent=t??""}}function Mae(e){return this.tween("text",typeof e=="function"?Oae(lN(this,"text",e)):Tae(e==null?"":e+""))}function Rae(e){return function(t){this.textContent=e.call(this,t)}}function $ae(e){var t,r;function n(){var a=e.apply(this,arguments);return a!==r&&(t=(r=a)&&Rae(a)),t}return n._value=e,n}function Dae(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,$ae(e))}function Iae(){for(var e=this._name,t=this._id,r=UF(),n=this._groups,a=n.length,i=0;i<a;++i)for(var s=n[i],o=s.length,l,c=0;c<o;++c)if(l=s[c]){var d=aa(l,t);L0(l,e,r,c,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new ni(n,this._parents,e,r)}function Lae(){var e,t,r=this,n=r._id,a=r.size();return new Promise(function(i,s){var o={value:s},l={value:function(){--a===0&&i()}};r.each(function(){var c=ka(this,n),d=c.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),a===0&&i()})}var zae=0;function ni(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function UF(){return++zae}var Ca=Af.prototype;ni.prototype={constructor:ni,select:xae,selectAll:bae,selectChild:Ca.selectChild,selectChildren:Ca.selectChildren,filter:fae,merge:hae,selection:jae,transition:Iae,call:Ca.call,nodes:Ca.nodes,node:Ca.node,size:Ca.size,empty:Ca.empty,each:Ca.each,on:gae,attr:Xne,attrTween:tae,style:Eae,styleTween:Aae,text:Mae,textTween:Dae,remove:vae,tween:qne,delay:aae,duration:oae,ease:cae,easeVarying:dae,end:Lae,[Symbol.iterator]:Ca[Symbol.iterator]};function Fae(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Bae={time:null,delay:0,duration:250,ease:Fae};function Vae(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 qae(e){var t,r;e instanceof ni?(t=e._id,e=e._name):(t=UF(),(r=Bae).time=sN(),e=e==null?null:e+"");for(var n=this._groups,a=n.length,i=0;i<a;++i)for(var s=n[i],o=s.length,l,c=0;c<o;++c)(l=s[c])&&L0(l,e,t,c,s,r||Vae(l,t));return new ni(n,this._parents,e,t)}Af.prototype.interrupt=Fne;Af.prototype.transition=qae;const _h=e=>()=>e;function Uae(e,{sourceEvent:t,target:r,transform:n,dispatch:a}){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:a}})}function Da(e,t,r){this.k=e,this.x=t,this.y=r}Da.prototype={constructor:Da,scale:function(e){return e===1?this:new Da(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Da(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 Ha=new Da(1,0,0);Da.prototype;function qy(e){e.stopImmediatePropagation()}function lu(e){e.preventDefault(),e.stopImmediatePropagation()}function Hae(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Wae(){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 rT(){return this.__zoom||Ha}function Gae(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Kae(){return navigator.maxTouchPoints||"ontouchstart"in this}function Yae(e,t,r){var n=e.invertX(t[0][0])-r[0][0],a=e.invertX(t[1][0])-r[1][0],i=e.invertY(t[0][1])-r[0][1],s=e.invertY(t[1][1])-r[1][1];return e.translate(a>n?(n+a)/2:Math.min(0,n)||Math.max(0,a),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function HF(){var e=Hae,t=Wae,r=Yae,n=Gae,a=Kae,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],o=250,l=Tne,c=$0("start","zoom","end"),d,f,h,p=500,g=150,m=0,b=10;function x(P){P.property("__zoom",rT).on("wheel.zoom",N,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",A).filter(a).on("touchstart.zoom",C).on("touchmove.zoom",M).on("touchend.zoom touchcancel.zoom",T).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(P,D,$,L){var I=P.selection?P.selection():P;I.property("__zoom",rT),P!==I?j(P,D,$,L):I.interrupt().each(function(){k(this,arguments).event(L).start().zoom(null,typeof D=="function"?D.apply(this,arguments):D).end()})},x.scaleBy=function(P,D,$,L){x.scaleTo(P,function(){var I=this.__zoom.k,R=typeof D=="function"?D.apply(this,arguments):D;return I*R},$,L)},x.scaleTo=function(P,D,$,L){x.transform(P,function(){var I=t.apply(this,arguments),R=this.__zoom,z=$==null?w(I):typeof $=="function"?$.apply(this,arguments):$,V=R.invert(z),B=typeof D=="function"?D.apply(this,arguments):D;return r(v(y(R,B),z,V),I,s)},$,L)},x.translateBy=function(P,D,$,L){x.transform(P,function(){return r(this.__zoom.translate(typeof D=="function"?D.apply(this,arguments):D,typeof $=="function"?$.apply(this,arguments):$),t.apply(this,arguments),s)},null,L)},x.translateTo=function(P,D,$,L,I){x.transform(P,function(){var R=t.apply(this,arguments),z=this.__zoom,V=L==null?w(R):typeof L=="function"?L.apply(this,arguments):L;return r(Ha.translate(V[0],V[1]).scale(z.k).translate(typeof D=="function"?-D.apply(this,arguments):-D,typeof $=="function"?-$.apply(this,arguments):-$),R,s)},L,I)};function y(P,D){return D=Math.max(i[0],Math.min(i[1],D)),D===P.k?P:new Da(D,P.x,P.y)}function v(P,D,$){var L=D[0]-$[0]*P.k,I=D[1]-$[1]*P.k;return L===P.x&&I===P.y?P:new Da(P.k,L,I)}function w(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function j(P,D,$,L){P.on("start.zoom",function(){k(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(L).end()}).tween("zoom",function(){var I=this,R=arguments,z=k(I,R).event(L),V=t.apply(I,R),B=$==null?w(V):typeof $=="function"?$.apply(I,R):$,W=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),K=I.__zoom,Q=typeof D=="function"?D.apply(I,R):D,ae=l(K.invert(B).concat(W/K.k),Q.invert(B).concat(W/Q.k));return function(pe){if(pe===1)pe=Q;else{var ve=ae(pe),Y=W/ve[2];pe=new Da(Y,B[0]-ve[0]*Y,B[1]-ve[1]*Y)}z.zoom(null,pe)}})}function k(P,D,$){return!$&&P.__zooming||new S(P,D)}function S(P,D){this.that=P,this.args=D,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,D),this.taps=0}S.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,D){return this.mouse&&P!=="mouse"&&(this.mouse[1]=D.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=D.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=D.invert(this.touch1[0])),this.that.__zoom=D,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var D=vn(this.that).datum();c.call(P,this.that,new Uae(P,{sourceEvent:this.sourceEvent,target:x,transform:this.that.__zoom,dispatch:c}),D)}};function N(P,...D){if(!e.apply(this,arguments))return;var $=k(this,D).event(P),L=this.__zoom,I=Math.max(i[0],Math.min(i[1],L.k*Math.pow(2,n.apply(this,arguments)))),R=Un(P);if($.wheel)($.mouse[0][0]!==R[0]||$.mouse[0][1]!==R[1])&&($.mouse[1]=L.invert($.mouse[0]=R)),clearTimeout($.wheel);else{if(L.k===I)return;$.mouse=[R,L.invert(R)],gp(this),$.start()}lu(P),$.wheel=setTimeout(z,g),$.zoom("mouse",r(v(y(L,I),$.mouse[0],$.mouse[1]),$.extent,s));function z(){$.wheel=null,$.end()}}function E(P,...D){if(h||!e.apply(this,arguments))return;var $=P.currentTarget,L=k(this,D,!0).event(P),I=vn(P.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",W,!0),R=Un(P,$),z=P.clientX,V=P.clientY;AF(P.view),qy(P),L.mouse=[R,this.__zoom.invert(R)],gp(this),L.start();function B(K){if(lu(K),!L.moved){var Q=K.clientX-z,ae=K.clientY-V;L.moved=Q*Q+ae*ae>m}L.event(K).zoom("mouse",r(v(L.that.__zoom,L.mouse[0]=Un(K,$),L.mouse[1]),L.extent,s))}function W(K){I.on("mousemove.zoom mouseup.zoom",null),TF(K.view,L.moved),lu(K),L.event(K).end()}}function A(P,...D){if(e.apply(this,arguments)){var $=this.__zoom,L=Un(P.changedTouches?P.changedTouches[0]:P,this),I=$.invert(L),R=$.k*(P.shiftKey?.5:2),z=r(v(y($,R),L,I),t.apply(this,D),s);lu(P),o>0?vn(this).transition().duration(o).call(j,z,L,P):vn(this).call(x.transform,z,L,P)}}function C(P,...D){if(e.apply(this,arguments)){var $=P.touches,L=$.length,I=k(this,D,P.changedTouches.length===L).event(P),R,z,V,B;for(qy(P),z=0;z<L;++z)V=$[z],B=Un(V,this),B=[B,this.__zoom.invert(B),V.identifier],I.touch0?!I.touch1&&I.touch0[2]!==B[2]&&(I.touch1=B,I.taps=0):(I.touch0=B,R=!0,I.taps=1+!!d);d&&(d=clearTimeout(d)),R&&(I.taps<2&&(f=B[0],d=setTimeout(function(){d=null},p)),gp(this),I.start())}}function M(P,...D){if(this.__zooming){var $=k(this,D).event(P),L=P.changedTouches,I=L.length,R,z,V,B;for(lu(P),R=0;R<I;++R)z=L[R],V=Un(z,this),$.touch0&&$.touch0[2]===z.identifier?$.touch0[0]=V:$.touch1&&$.touch1[2]===z.identifier&&($.touch1[0]=V);if(z=$.that.__zoom,$.touch1){var W=$.touch0[0],K=$.touch0[1],Q=$.touch1[0],ae=$.touch1[1],pe=(pe=Q[0]-W[0])*pe+(pe=Q[1]-W[1])*pe,ve=(ve=ae[0]-K[0])*ve+(ve=ae[1]-K[1])*ve;z=y(z,Math.sqrt(pe/ve)),V=[(W[0]+Q[0])/2,(W[1]+Q[1])/2],B=[(K[0]+ae[0])/2,(K[1]+ae[1])/2]}else if($.touch0)V=$.touch0[0],B=$.touch0[1];else return;$.zoom("touch",r(v(z,V,B),$.extent,s))}}function T(P,...D){if(this.__zooming){var $=k(this,D).event(P),L=P.changedTouches,I=L.length,R,z;for(qy(P),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),R=0;R<I;++R)z=L[R],$.touch0&&$.touch0[2]===z.identifier?delete $.touch0:$.touch1&&$.touch1[2]===z.identifier&&delete $.touch1;if($.touch1&&!$.touch0&&($.touch0=$.touch1,delete $.touch1),$.touch0)$.touch0[1]=this.__zoom.invert($.touch0[0]);else if($.end(),$.taps===2&&(z=Un(z,this),Math.hypot(f[0]-z[0],f[1]-z[1])<b)){var V=vn(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return x.wheelDelta=function(P){return arguments.length?(n=typeof P=="function"?P:_h(+P),x):n},x.filter=function(P){return arguments.length?(e=typeof P=="function"?P:_h(!!P),x):e},x.touchable=function(P){return arguments.length?(a=typeof P=="function"?P:_h(!!P),x):a},x.extent=function(P){return arguments.length?(t=typeof P=="function"?P:_h([[+P[0][0],+P[0][1]],[+P[1][0],+P[1][1]]]),x):t},x.scaleExtent=function(P){return arguments.length?(i[0]=+P[0],i[1]=+P[1],x):[i[0],i[1]]},x.translateExtent=function(P){return arguments.length?(s[0][0]=+P[0][0],s[1][0]=+P[1][0],s[0][1]=+P[0][1],s[1][1]=+P[1][1],x):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},x.constrain=function(P){return arguments.length?(r=P,x):r},x.duration=function(P){return arguments.length?(o=+P,x):o},x.interpolate=function(P){return arguments.length?(l=P,x):l},x.on=function(){var P=c.on.apply(c,arguments);return P===c?x:P},x.clickDistance=function(P){return arguments.length?(m=(P=+P)*P,x):Math.sqrt(m)},x.tapDistance=function(P){return arguments.length?(b=+P,x):b},x}const z0=_.createContext(null),Xae=z0.Provider,ai={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.`},WF=ai.error001();function ot(e,t){const r=_.useContext(z0);if(r===null)throw new Error(WF);return yF(r,e,t)}const er=()=>{const e=_.useContext(z0);if(e===null)throw new Error(WF);return _.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},Zae=e=>e.userSelectionActive?"none":"all";function cN({position:e,children:t,className:r,style:n,...a}){const i=ot(Zae),s=`${e}`.split("-");return O.createElement("div",{className:gr(["react-flow__panel",r,...s]),style:{...n,pointerEvents:i},...a},t)}function Qae({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:O.createElement(cN,{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"},O.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const Jae=({x:e,y:t,label:r,labelStyle:n={},labelShowBg:a=!0,labelBgStyle:i={},labelBgPadding:s=[2,4],labelBgBorderRadius:o=2,children:l,className:c,...d})=>{const f=_.useRef(null),[h,p]=_.useState({x:0,y:0,width:0,height:0}),g=gr(["react-flow__edge-textwrapper",c]);return _.useEffect(()=>{if(f.current){const m=f.current.getBBox();p({x:m.x,y:m.y,width:m.width,height:m.height})}},[r]),typeof r>"u"||!r?null:O.createElement("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",...d},a&&O.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:i,rx:o,ry:o}),O.createElement("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:f,style:n},r),l)};var eie=_.memo(Jae);const uN=e=>({width:e.offsetWidth,height:e.offsetHeight}),Xl=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),dN=(e={x:0,y:0},t)=>({x:Xl(e.x,t[0][0],t[1][0]),y:Xl(e.y,t[0][1],t[1][1])}),nT=(e,t,r)=>e<t?Xl(Math.abs(e-t),1,50)/50:e>r?-Xl(Math.abs(e-r),1,50)/50:0,GF=(e,t)=>{const r=nT(e.x,35,t.width-35)*20,n=nT(e.y,35,t.height-35)*20;return[r,n]},KF=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},YF=(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)}),Id=({x:e,y:t,width:r,height:n})=>({x:e,y:t,x2:e+r,y2:t+n}),XF=({x:e,y:t,x2:r,y2:n})=>({x:e,y:t,width:r-e,height:n-t}),aT=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),tie=(e,t)=>XF(YF(Id(e),Id(t))),MS=(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)},rie=e=>wn(e.width)&&wn(e.height)&&wn(e.x)&&wn(e.y),wn=e=>!isNaN(e)&&isFinite(e),Mt=Symbol.for("internals"),ZF=["Enter"," ","Escape"],nie=(e,t)=>{},aie=e=>"nativeEvent"in e;function RS(e){var a,i;const t=aie(e)?e.nativeEvent:e,r=((i=(a=t.composedPath)==null?void 0:a.call(t))==null?void 0:i[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 QF=e=>"clientX"in e,Ji=(e,t)=>{var i,s;const r=QF(e),n=r?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,a=r?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:n-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},dm=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Of=({id:e,path:t,labelX:r,labelY:n,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:f,markerStart:h,interactionWidth:p=20})=>O.createElement(O.Fragment,null,O.createElement("path",{id:e,style:d,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:h}),p&&O.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}),a&&wn(r)&&wn(n)?O.createElement(eie,{x:r,y:n,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null);Of.displayName="BaseEdge";function cu(e,t,r){return r===void 0?r:n=>{const a=t().edges.find(i=>i.id===e);a&&r(n,{...a})}}function JF({sourceX:e,sourceY:t,targetX:r,targetY:n}){const a=Math.abs(r-e)/2,i=r<e?r+a:r-a,s=Math.abs(n-t)/2,o=n<t?n+s:n-s;return[i,o,a,s]}function e8({sourceX:e,sourceY:t,targetX:r,targetY:n,sourceControlX:a,sourceControlY:i,targetControlX:s,targetControlY:o}){const l=e*.125+a*.375+s*.375+r*.125,c=t*.125+i*.375+o*.375+n*.125,d=Math.abs(l-e),f=Math.abs(c-t);return[l,c,d,f]}var yo;(function(e){e.Strict="strict",e.Loose="loose"})(yo||(yo={}));var Hs;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Hs||(Hs={}));var Ld;(function(e){e.Partial="partial",e.Full="full"})(Ld||(Ld={}));var Ii;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ii||(Ii={}));var Zl;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Zl||(Zl={}));var me;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(me||(me={}));function iT({pos:e,x1:t,y1:r,x2:n,y2:a}){return e===me.Left||e===me.Right?[.5*(t+n),r]:[t,.5*(r+a)]}function t8({sourceX:e,sourceY:t,sourcePosition:r=me.Bottom,targetX:n,targetY:a,targetPosition:i=me.Top}){const[s,o]=iT({pos:r,x1:e,y1:t,x2:n,y2:a}),[l,c]=iT({pos:i,x1:n,y1:a,x2:e,y2:t}),[d,f,h,p]=e8({sourceX:e,sourceY:t,targetX:n,targetY:a,sourceControlX:s,sourceControlY:o,targetControlX:l,targetControlY:c});return[`M${e},${t} C${s},${o} ${l},${c} ${n},${a}`,d,f,h,p]}const fN=_.memo(({sourceX:e,sourceY:t,targetX:r,targetY:n,sourcePosition:a=me.Bottom,targetPosition:i=me.Top,label:s,labelStyle:o,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:g,interactionWidth:m})=>{const[b,x,y]=t8({sourceX:e,sourceY:t,sourcePosition:a,targetX:r,targetY:n,targetPosition:i});return O.createElement(Of,{path:b,labelX:x,labelY:y,label:s,labelStyle:o,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:g,interactionWidth:m})});fN.displayName="SimpleBezierEdge";const sT={[me.Left]:{x:-1,y:0},[me.Right]:{x:1,y:0},[me.Top]:{x:0,y:-1},[me.Bottom]:{x:0,y:1}},iie=({source:e,sourcePosition:t=me.Bottom,target:r})=>t===me.Left||t===me.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},oT=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function sie({source:e,sourcePosition:t=me.Bottom,target:r,targetPosition:n=me.Top,center:a,offset:i}){const s=sT[t],o=sT[n],l={x:e.x+s.x*i,y:e.y+s.y*i},c={x:r.x+o.x*i,y:r.y+o.y*i},d=iie({source:l,sourcePosition:t,target:c}),f=d.x!==0?"x":"y",h=d[f];let p=[],g,m;const b={x:0,y:0},x={x:0,y:0},[y,v,w,j]=JF({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(s[f]*o[f]===-1){g=a.x??y,m=a.y??v;const S=[{x:g,y:l.y},{x:g,y:c.y}],N=[{x:l.x,y:m},{x:c.x,y:m}];s[f]===h?p=f==="x"?S:N:p=f==="x"?N:S}else{const S=[{x:l.x,y:c.y}],N=[{x:c.x,y:l.y}];if(f==="x"?p=s.x===h?N:S:p=s.y===h?S:N,t===n){const T=Math.abs(e[f]-r[f]);if(T<=i){const P=Math.min(i-1,i-T);s[f]===h?b[f]=(l[f]>e[f]?-1:1)*P:x[f]=(c[f]>r[f]?-1:1)*P}}if(t!==n){const T=f==="x"?"y":"x",P=s[f]===o[T],D=l[T]>c[T],$=l[T]<c[T];(s[f]===1&&(!P&&D||P&&$)||s[f]!==1&&(!P&&$||P&&D))&&(p=f==="x"?S:N)}const E={x:l.x+b.x,y:l.y+b.y},A={x:c.x+x.x,y:c.y+x.y},C=Math.max(Math.abs(E.x-p[0].x),Math.abs(A.x-p[0].x)),M=Math.max(Math.abs(E.y-p[0].y),Math.abs(A.y-p[0].y));C>=M?(g=(E.x+A.x)/2,m=p[0].y):(g=p[0].x,m=(E.y+A.y)/2)}return[[e,{x:l.x+b.x,y:l.y+b.y},...p,{x:c.x+x.x,y:c.y+x.y},r],g,m,w,j]}function oie(e,t,r,n){const a=Math.min(oT(e,t)/2,oT(t,r)/2,n),{x:i,y:s}=t;if(e.x===i&&i===r.x||e.y===s&&s===r.y)return`L${i} ${s}`;if(e.y===s){const c=e.x<r.x?-1:1,d=e.y<r.y?1:-1;return`L ${i+a*c},${s}Q ${i},${s} ${i},${s+a*d}`}const o=e.x<r.x?1:-1,l=e.y<r.y?-1:1;return`L ${i},${s+a*l}Q ${i},${s} ${i+a*o},${s}`}function $S({sourceX:e,sourceY:t,sourcePosition:r=me.Bottom,targetX:n,targetY:a,targetPosition:i=me.Top,borderRadius:s=5,centerX:o,centerY:l,offset:c=20}){const[d,f,h,p,g]=sie({source:{x:e,y:t},sourcePosition:r,target:{x:n,y:a},targetPosition:i,center:{x:o,y:l},offset:c});return[d.reduce((b,x,y)=>{let v="";return y>0&&y<d.length-1?v=oie(d[y-1],x,d[y+1],s):v=`${y===0?"M":"L"}${x.x} ${x.y}`,b+=v,b},""),f,h,p,g]}const F0=_.memo(({sourceX:e,sourceY:t,targetX:r,targetY:n,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,style:d,sourcePosition:f=me.Bottom,targetPosition:h=me.Top,markerEnd:p,markerStart:g,pathOptions:m,interactionWidth:b})=>{const[x,y,v]=$S({sourceX:e,sourceY:t,sourcePosition:f,targetX:r,targetY:n,targetPosition:h,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset});return O.createElement(Of,{path:x,labelX:y,labelY:v,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:p,markerStart:g,interactionWidth:b})});F0.displayName="SmoothStepEdge";const hN=_.memo(e=>{var t;return O.createElement(F0,{...e,pathOptions:_.useMemo(()=>{var r;return{borderRadius:0,offset:(r=e.pathOptions)==null?void 0:r.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});hN.displayName="StepEdge";function lie({sourceX:e,sourceY:t,targetX:r,targetY:n}){const[a,i,s,o]=JF({sourceX:e,sourceY:t,targetX:r,targetY:n});return[`M ${e},${t}L ${r},${n}`,a,i,s,o]}const pN=_.memo(({sourceX:e,sourceY:t,targetX:r,targetY:n,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:f,markerStart:h,interactionWidth:p})=>{const[g,m,b]=lie({sourceX:e,sourceY:t,targetX:r,targetY:n});return O.createElement(Of,{path:g,labelX:m,labelY:b,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:f,markerStart:h,interactionWidth:p})});pN.displayName="StraightEdge";function Nh(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function lT({pos:e,x1:t,y1:r,x2:n,y2:a,c:i}){switch(e){case me.Left:return[t-Nh(t-n,i),r];case me.Right:return[t+Nh(n-t,i),r];case me.Top:return[t,r-Nh(r-a,i)];case me.Bottom:return[t,r+Nh(a-r,i)]}}function r8({sourceX:e,sourceY:t,sourcePosition:r=me.Bottom,targetX:n,targetY:a,targetPosition:i=me.Top,curvature:s=.25}){const[o,l]=lT({pos:r,x1:e,y1:t,x2:n,y2:a,c:s}),[c,d]=lT({pos:i,x1:n,y1:a,x2:e,y2:t,c:s}),[f,h,p,g]=e8({sourceX:e,sourceY:t,targetX:n,targetY:a,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${e},${t} C${o},${l} ${c},${d} ${n},${a}`,f,h,p,g]}const fm=_.memo(({sourceX:e,sourceY:t,targetX:r,targetY:n,sourcePosition:a=me.Bottom,targetPosition:i=me.Top,label:s,labelStyle:o,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:g,pathOptions:m,interactionWidth:b})=>{const[x,y,v]=r8({sourceX:e,sourceY:t,sourcePosition:a,targetX:r,targetY:n,targetPosition:i,curvature:m==null?void 0:m.curvature});return O.createElement(Of,{path:x,labelX:y,labelY:v,label:s,labelStyle:o,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:g,interactionWidth:b})});fm.displayName="BezierEdge";const mN=_.createContext(null),cie=mN.Provider;mN.Consumer;const uie=()=>_.useContext(mN),die=e=>"id"in e&&"source"in e&&"target"in e,fie=({source:e,sourceHandle:t,target:r,targetHandle:n})=>`reactflow__edge-${e}${t||""}-${r}${n||""}`,DS=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(n=>`${n}=${e[n]}`).join("&")}`,hie=(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)),pie=(e,t)=>{if(!e.source||!e.target)return t;let r;return die(e)?r={...e}:r={...e,id:fie(e)},hie(r,t)?t:t.concat(r)},IS=({x:e,y:t},[r,n,a],i,[s,o])=>{const l={x:(e-r)/a,y:(t-n)/a};return i?{x:s*Math.round(l.x/s),y:o*Math.round(l.y/o)}:l},n8=({x:e,y:t},[r,n,a])=>({x:e*a+r,y:t*a+n}),to=(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],a={x:e.position.x-r,y:e.position.y-n};return{...a,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-r,y:e.positionAbsolute.y-n}:a}},B0=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((n,a)=>{const{x:i,y:s}=to(a,t).positionAbsolute;return YF(n,Id({x:i,y:s,width:a.width||0,height:a.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return XF(r)},a8=(e,t,[r,n,a]=[0,0,1],i=!1,s=!1,o=[0,0])=>{const l={x:(t.x-r)/a,y:(t.y-n)/a,width:t.width/a,height:t.height/a},c=[];return e.forEach(d=>{const{width:f,height:h,selectable:p=!0,hidden:g=!1}=d;if(s&&!p||g)return!1;const{positionAbsolute:m}=to(d,o),b={x:m.x,y:m.y,width:f||0,height:h||0},x=MS(l,b),y=typeof f>"u"||typeof h>"u"||f===null||h===null,v=i&&x>0,w=(f||0)*(h||0);(y||v||x>=w||d.dragging)&&c.push(d)}),c},i8=(e,t)=>{const r=e.map(n=>n.id);return t.filter(n=>r.includes(n.source)||r.includes(n.target))},s8=(e,t,r,n,a,i=.1)=>{const s=t/(e.width*(1+i)),o=r/(e.height*(1+i)),l=Math.min(s,o),c=Xl(l,n,a),d=e.x+e.width/2,f=e.y+e.height/2,h=t/2-d*c,p=r/2-f*c;return{x:h,y:p,zoom:c}},Ms=(e,t=0)=>e.transition().duration(t);function cT(e,t,r,n){return(t[r]||[]).reduce((a,i)=>{var s,o;return`${e.id}-${i.id}-${r}`!==n&&a.push({id:i.id||null,type:r,nodeId:e.id,x:(((s=e.positionAbsolute)==null?void 0:s.x)??0)+i.x+i.width/2,y:(((o=e.positionAbsolute)==null?void 0:o.y)??0)+i.y+i.height/2}),a},[])}function mie(e,t,r,n,a,i){const{x:s,y:o}=Ji(e),c=t.elementsFromPoint(s,o).find(g=>g.classList.contains("react-flow__handle"));if(c){const g=c.getAttribute("data-nodeid");if(g){const m=gN(void 0,c),b=c.getAttribute("data-handleid"),x=i({nodeId:g,id:b,type:m});if(x){const y=a.find(v=>v.nodeId===g&&v.type===m&&v.id===b);return{handle:{id:b,type:m,nodeId:g,x:(y==null?void 0:y.x)||r.x,y:(y==null?void 0:y.y)||r.y},validHandleResult:x}}}}let d=[],f=1/0;if(a.forEach(g=>{const m=Math.sqrt((g.x-r.x)**2+(g.y-r.y)**2);if(m<=n){const b=i(g);m<=f&&(m<f?d=[{handle:g,validHandleResult:b}]:m===f&&d.push({handle:g,validHandleResult:b}),f=m)}}),!d.length)return{handle:null,validHandleResult:o8()};if(d.length===1)return d[0];const h=d.some(({validHandleResult:g})=>g.isValid),p=d.some(({handle:g})=>g.type==="target");return d.find(({handle:g,validHandleResult:m})=>p?g.type==="target":h?m.isValid:!0)||d[0]}const gie={source:null,target:null,sourceHandle:null,targetHandle:null},o8=()=>({handleDomNode:null,isValid:!1,connection:gie,endHandle:null});function l8(e,t,r,n,a,i,s){const o=a==="target",l=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}"]`),c={...o8(),handleDomNode:l};if(l){const d=gN(void 0,l),f=l.getAttribute("data-nodeid"),h=l.getAttribute("data-handleid"),p=l.classList.contains("connectable"),g=l.classList.contains("connectableend"),m={source:o?f:r,sourceHandle:o?h:n,target:o?r:f,targetHandle:o?n:h};c.connection=m,p&&g&&(t===yo.Strict?o&&d==="source"||!o&&d==="target":f!==r||h!==n)&&(c.endHandle={nodeId:f,handleId:h,type:d},c.isValid=i(m))}return c}function yie({nodes:e,nodeId:t,handleId:r,handleType:n}){return e.reduce((a,i)=>{if(i[Mt]){const{handleBounds:s}=i[Mt];let o=[],l=[];s&&(o=cT(i,s,"source",`${t}-${r}-${n}`),l=cT(i,s,"target",`${t}-${r}-${n}`)),a.push(...o,...l)}return a},[])}function gN(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Uy(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function vie(e,t){let r=null;return t?r="valid":e&&!t&&(r="invalid"),r}function c8({event:e,handleId:t,nodeId:r,onConnect:n,isTarget:a,getState:i,setState:s,isValidConnection:o,edgeUpdaterType:l,onReconnectEnd:c}){const d=KF(e.target),{connectionMode:f,domNode:h,autoPanOnConnect:p,connectionRadius:g,onConnectStart:m,panBy:b,getNodes:x,cancelConnection:y}=i();let v=0,w;const{x:j,y:k}=Ji(e),S=d==null?void 0:d.elementFromPoint(j,k),N=gN(l,S),E=h==null?void 0:h.getBoundingClientRect();if(!E||!N)return;let A,C=Ji(e,E),M=!1,T=null,P=!1,D=null;const $=yie({nodes:x(),nodeId:r,handleId:t,handleType:N}),L=()=>{if(!p)return;const[z,V]=GF(C,E);b({x:z,y:V}),v=requestAnimationFrame(L)};s({connectionPosition:C,connectionStatus:null,connectionNodeId:r,connectionHandleId:t,connectionHandleType:N,connectionStartHandle:{nodeId:r,handleId:t,type:N},connectionEndHandle:null}),m==null||m(e,{nodeId:r,handleId:t,handleType:N});function I(z){const{transform:V}=i();C=Ji(z,E);const{handle:B,validHandleResult:W}=mie(z,d,IS(C,V,!1,[1,1]),g,$,K=>l8(K,f,r,t,a?"target":"source",o,d));if(w=B,M||(L(),M=!0),D=W.handleDomNode,T=W.connection,P=W.isValid,s({connectionPosition:w&&P?n8({x:w.x,y:w.y},V):C,connectionStatus:vie(!!w,P),connectionEndHandle:W.endHandle}),!w&&!P&&!D)return Uy(A);T.source!==T.target&&D&&(Uy(A),A=D,D.classList.add("connecting","react-flow__handle-connecting"),D.classList.toggle("valid",P),D.classList.toggle("react-flow__handle-valid",P))}function R(z){var V,B;(w||D)&&T&&P&&(n==null||n(T)),(B=(V=i()).onConnectEnd)==null||B.call(V,z),l&&(c==null||c(z)),Uy(A),y(),cancelAnimationFrame(v),M=!1,P=!1,T=null,D=null,d.removeEventListener("mousemove",I),d.removeEventListener("mouseup",R),d.removeEventListener("touchmove",I),d.removeEventListener("touchend",R)}d.addEventListener("mousemove",I),d.addEventListener("mouseup",R),d.addEventListener("touchmove",I),d.addEventListener("touchend",R)}const uT=()=>!0,xie=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),bie=(e,t,r)=>n=>{const{connectionStartHandle:a,connectionEndHandle:i,connectionClickStartHandle:s}=n;return{connecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.handleId)===t&&(a==null?void 0:a.type)===r||(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===r,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===r}},u8=_.forwardRef(({type:e="source",position:t=me.Top,isValidConnection:r,isConnectable:n=!0,isConnectableStart:a=!0,isConnectableEnd:i=!0,id:s,onConnect:o,children:l,className:c,onMouseDown:d,onTouchStart:f,...h},p)=>{var E,A;const g=s||null,m=e==="target",b=er(),x=uie(),{connectOnClick:y,noPanClassName:v}=ot(xie,or),{connecting:w,clickConnecting:j}=ot(bie(x,g,e),or);x||(A=(E=b.getState()).onError)==null||A.call(E,"010",ai.error010());const k=C=>{const{defaultEdgeOptions:M,onConnect:T,hasDefaultEdges:P}=b.getState(),D={...M,...C};if(P){const{edges:$,setEdges:L}=b.getState();L(pie(D,$))}T==null||T(D),o==null||o(D)},S=C=>{if(!x)return;const M=QF(C);a&&(M&&C.button===0||!M)&&c8({event:C,handleId:g,nodeId:x,onConnect:k,isTarget:m,getState:b.getState,setState:b.setState,isValidConnection:r||b.getState().isValidConnection||uT}),M?d==null||d(C):f==null||f(C)},N=C=>{const{onClickConnectStart:M,onClickConnectEnd:T,connectionClickStartHandle:P,connectionMode:D,isValidConnection:$}=b.getState();if(!x||!P&&!a)return;if(!P){M==null||M(C,{nodeId:x,handleId:g,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:x,type:e,handleId:g}});return}const L=KF(C.target),I=r||$||uT,{connection:R,isValid:z}=l8({nodeId:x,id:g,type:e},D,P.nodeId,P.handleId||null,P.type,I,L);z&&k(R),T==null||T(C),b.setState({connectionClickStartHandle:null})};return O.createElement("div",{"data-handleid":g,"data-nodeid":x,"data-handlepos":t,"data-id":`${x}-${g}-${e}`,className:gr(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",v,c,{source:!m,target:m,connectable:n,connectablestart:a,connectableend:i,connecting:j,connectionindicator:n&&(a&&!w||i&&w)}]),onMouseDown:S,onTouchStart:S,onClick:y?N:void 0,ref:p,...h},l)});u8.displayName="Handle";var ds=_.memo(u8);const d8=({data:e,isConnectable:t,targetPosition:r=me.Top,sourcePosition:n=me.Bottom})=>O.createElement(O.Fragment,null,O.createElement(ds,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label,O.createElement(ds,{type:"source",position:n,isConnectable:t}));d8.displayName="DefaultNode";var LS=_.memo(d8);const f8=({data:e,isConnectable:t,sourcePosition:r=me.Bottom})=>O.createElement(O.Fragment,null,e==null?void 0:e.label,O.createElement(ds,{type:"source",position:r,isConnectable:t}));f8.displayName="InputNode";var h8=_.memo(f8);const p8=({data:e,isConnectable:t,targetPosition:r=me.Top})=>O.createElement(O.Fragment,null,O.createElement(ds,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label);p8.displayName="OutputNode";var m8=_.memo(p8);const yN=()=>null;yN.displayName="GroupNode";const wie=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),Eh=e=>e.id;function jie(e,t){return or(e.selectedNodes.map(Eh),t.selectedNodes.map(Eh))&&or(e.selectedEdges.map(Eh),t.selectedEdges.map(Eh))}const g8=_.memo(({onSelectionChange:e})=>{const t=er(),{selectedNodes:r,selectedEdges:n}=ot(wie,jie);return _.useEffect(()=>{const a={nodes:r,edges:n};e==null||e(a),t.getState().onSelectionChange.forEach(i=>i(a))},[r,n,e]),null});g8.displayName="SelectionListener";const Sie=e=>!!e.onSelectionChange;function kie({onSelectionChange:e}){const t=ot(Sie);return e||t?O.createElement(g8,{onSelectionChange:e}):null}const _ie=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 qo(e,t){_.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Te(e,t,r){_.useEffect(()=>{typeof t<"u"&&r({[e]:t})},[t])}const Nie=({nodes:e,edges:t,defaultNodes:r,defaultEdges:n,onConnect:a,onConnectStart:i,onConnectEnd:s,onClickConnectStart:o,onClickConnectEnd:l,nodesDraggable:c,nodesConnectable:d,nodesFocusable:f,edgesFocusable:h,edgesUpdatable:p,elevateNodesOnSelect:g,minZoom:m,maxZoom:b,nodeExtent:x,onNodesChange:y,onEdgesChange:v,elementsSelectable:w,connectionMode:j,snapGrid:k,snapToGrid:S,translateExtent:N,connectOnClick:E,defaultEdgeOptions:A,fitView:C,fitViewOptions:M,onNodesDelete:T,onEdgesDelete:P,onNodeDrag:D,onNodeDragStart:$,onNodeDragStop:L,onSelectionDrag:I,onSelectionDragStart:R,onSelectionDragStop:z,noPanClassName:V,nodeOrigin:B,rfId:W,autoPanOnConnect:K,autoPanOnNodeDrag:Q,onError:ae,connectionRadius:pe,isValidConnection:ve,nodeDragThreshold:Y})=>{const{setNodes:ee,setEdges:fe,setDefaultNodesAndEdges:H,setMinZoom:je,setMaxZoom:ye,setTranslateExtent:se,setNodeExtent:ke,reset:ne}=ot(_ie,or),ie=er();return _.useEffect(()=>{const qe=n==null?void 0:n.map(rr=>({...rr,...A}));return H(r,qe),()=>{ne()}},[]),Te("defaultEdgeOptions",A,ie.setState),Te("connectionMode",j,ie.setState),Te("onConnect",a,ie.setState),Te("onConnectStart",i,ie.setState),Te("onConnectEnd",s,ie.setState),Te("onClickConnectStart",o,ie.setState),Te("onClickConnectEnd",l,ie.setState),Te("nodesDraggable",c,ie.setState),Te("nodesConnectable",d,ie.setState),Te("nodesFocusable",f,ie.setState),Te("edgesFocusable",h,ie.setState),Te("edgesUpdatable",p,ie.setState),Te("elementsSelectable",w,ie.setState),Te("elevateNodesOnSelect",g,ie.setState),Te("snapToGrid",S,ie.setState),Te("snapGrid",k,ie.setState),Te("onNodesChange",y,ie.setState),Te("onEdgesChange",v,ie.setState),Te("connectOnClick",E,ie.setState),Te("fitViewOnInit",C,ie.setState),Te("fitViewOnInitOptions",M,ie.setState),Te("onNodesDelete",T,ie.setState),Te("onEdgesDelete",P,ie.setState),Te("onNodeDrag",D,ie.setState),Te("onNodeDragStart",$,ie.setState),Te("onNodeDragStop",L,ie.setState),Te("onSelectionDrag",I,ie.setState),Te("onSelectionDragStart",R,ie.setState),Te("onSelectionDragStop",z,ie.setState),Te("noPanClassName",V,ie.setState),Te("nodeOrigin",B,ie.setState),Te("rfId",W,ie.setState),Te("autoPanOnConnect",K,ie.setState),Te("autoPanOnNodeDrag",Q,ie.setState),Te("onError",ae,ie.setState),Te("connectionRadius",pe,ie.setState),Te("isValidConnection",ve,ie.setState),Te("nodeDragThreshold",Y,ie.setState),qo(e,ee),qo(t,fe),qo(m,je),qo(b,ye),qo(N,se),qo(x,ke),null},dT={display:"none"},Eie={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},y8="react-flow__node-desc",v8="react-flow__edge-desc",Pie="react-flow__aria-live",Cie=e=>e.ariaLiveMessage;function Aie({rfId:e}){const t=ot(Cie);return O.createElement("div",{id:`${Pie}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Eie},t)}function Tie({rfId:e,disableKeyboardA11y:t}){return O.createElement(O.Fragment,null,O.createElement("div",{id:`${y8}-${e}`,style:dT},"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."," "),O.createElement("div",{id:`${v8}-${e}`,style:dT},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&O.createElement(Aie,{rfId:e}))}var zd=(e=null,t={actInsideInputWithModifier:!0})=>{const[r,n]=_.useState(!1),a=_.useRef(!1),i=_.useRef(new Set([])),[s,o]=_.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.split("+")),d=c.reduce((f,h)=>f.concat(...h),[]);return[c,d]}return[[],[]]},[e]);return _.useEffect(()=>{const l=typeof document<"u"?document:null,c=(t==null?void 0:t.target)||l;if(e!==null){const d=p=>{if(a.current=p.ctrlKey||p.metaKey||p.shiftKey,(!a.current||a.current&&!t.actInsideInputWithModifier)&&RS(p))return!1;const m=hT(p.code,o);i.current.add(p[m]),fT(s,i.current,!1)&&(p.preventDefault(),n(!0))},f=p=>{if((!a.current||a.current&&!t.actInsideInputWithModifier)&&RS(p))return!1;const m=hT(p.code,o);fT(s,i.current,!0)?(n(!1),i.current.clear()):i.current.delete(p[m]),p.key==="Meta"&&i.current.clear(),a.current=!1},h=()=>{i.current.clear(),n(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",h)}}},[e,n]),r};function fT(e,t,r){return e.filter(n=>r||n.length===t.size).some(n=>n.every(a=>t.has(a)))}function hT(e,t){return t.includes(e)?"code":"key"}function x8(e,t,r,n){var o,l;const a=e.parentNode||e.parentId;if(!a)return r;const i=t.get(a),s=to(i,n);return x8(i,t,{x:(r.x??0)+s.x,y:(r.y??0)+s.y,z:(((o=i[Mt])==null?void 0:o.z)??0)>(r.z??0)?((l=i[Mt])==null?void 0:l.z)??0:r.z??0},n)}function b8(e,t,r){e.forEach(n=>{var i;const a=n.parentNode||n.parentId;if(a&&!e.has(a))throw new Error(`Parent node ${a} not found`);if(a||r!=null&&r[n.id]){const{x:s,y:o,z:l}=x8(n,e,{...n.position,z:((i=n[Mt])==null?void 0:i.z)??0},t);n.positionAbsolute={x:s,y:o},n[Mt].z=l,r!=null&&r[n.id]&&(n[Mt].isParent=!0)}})}function Hy(e,t,r,n){const a=new Map,i={},s=n?1e3:0;return e.forEach(o=>{var p;const l=(wn(o.zIndex)?o.zIndex:0)+(o.selected?s:0),c=t.get(o.id),d={...o,positionAbsolute:{x:o.position.x,y:o.position.y}},f=o.parentNode||o.parentId;f&&(i[f]=!0);const h=(c==null?void 0:c.type)&&(c==null?void 0:c.type)!==o.type;Object.defineProperty(d,Mt,{enumerable:!1,value:{handleBounds:h||(p=c==null?void 0:c[Mt])==null?void 0:p.handleBounds,z:l}}),a.set(o.id,d)}),b8(a,r,i),a}function w8(e,t={}){const{getNodes:r,width:n,height:a,minZoom:i,maxZoom:s,d3Zoom:o,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:d,nodeOrigin:f}=e(),h=t.initial&&!c&&d;if(o&&l&&(h||!t.initial)){const g=r().filter(b=>{var y;const x=t.includeHiddenNodes?b.width&&b.height:!b.hidden;return(y=t.nodes)!=null&&y.length?x&&t.nodes.some(v=>v.id===b.id):x}),m=g.every(b=>b.width&&b.height);if(g.length>0&&m){const b=B0(g,f),{x,y,zoom:v}=s8(b,n,a,t.minZoom??i,t.maxZoom??s,t.padding??.1),w=Ha.translate(x,y).scale(v);return typeof t.duration=="number"&&t.duration>0?o.transform(Ms(l,t.duration),w):o.transform(l,w),!0}}return!1}function Oie(e,t){return e.forEach(r=>{const n=t.get(r.id);n&&t.set(n.id,{...n,[Mt]:n[Mt],selected:r.selected})}),new Map(t)}function Mie(e,t){return t.map(r=>{const n=e.find(a=>a.id===r.id);return n&&(r.selected=n.selected),r})}function Ph({changedNodes:e,changedEdges:t,get:r,set:n}){const{nodeInternals:a,edges:i,onNodesChange:s,onEdgesChange:o,hasDefaultNodes:l,hasDefaultEdges:c}=r();e!=null&&e.length&&(l&&n({nodeInternals:Oie(e,a)}),s==null||s(e)),t!=null&&t.length&&(c&&n({edges:Mie(t,i)}),o==null||o(t))}const Uo=()=>{},Rie={zoomIn:Uo,zoomOut:Uo,zoomTo:Uo,getZoom:()=>1,setViewport:Uo,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Uo,fitBounds:Uo,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},$ie=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),Die=()=>{const e=er(),{d3Zoom:t,d3Selection:r}=ot($ie,or);return _.useMemo(()=>r&&t?{zoomIn:a=>t.scaleBy(Ms(r,a==null?void 0:a.duration),1.2),zoomOut:a=>t.scaleBy(Ms(r,a==null?void 0:a.duration),1/1.2),zoomTo:(a,i)=>t.scaleTo(Ms(r,i==null?void 0:i.duration),a),getZoom:()=>e.getState().transform[2],setViewport:(a,i)=>{const[s,o,l]=e.getState().transform,c=Ha.translate(a.x??s,a.y??o).scale(a.zoom??l);t.transform(Ms(r,i==null?void 0:i.duration),c)},getViewport:()=>{const[a,i,s]=e.getState().transform;return{x:a,y:i,zoom:s}},fitView:a=>w8(e.getState,a),setCenter:(a,i,s)=>{const{width:o,height:l,maxZoom:c}=e.getState(),d=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:c,f=o/2-a*d,h=l/2-i*d,p=Ha.translate(f,h).scale(d);t.transform(Ms(r,s==null?void 0:s.duration),p)},fitBounds:(a,i)=>{const{width:s,height:o,minZoom:l,maxZoom:c}=e.getState(),{x:d,y:f,zoom:h}=s8(a,s,o,l,c,(i==null?void 0:i.padding)??.1),p=Ha.translate(d,f).scale(h);t.transform(Ms(r,i==null?void 0:i.duration),p)},project:a=>{const{transform:i,snapToGrid:s,snapGrid:o}=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"),IS(a,i,s,o)},screenToFlowPosition:a=>{const{transform:i,snapToGrid:s,snapGrid:o,domNode:l}=e.getState();if(!l)return a;const{x:c,y:d}=l.getBoundingClientRect(),f={x:a.x-c,y:a.y-d};return IS(f,i,s,o)},flowToScreenPosition:a=>{const{transform:i,domNode:s}=e.getState();if(!s)return a;const{x:o,y:l}=s.getBoundingClientRect(),c=n8(a,i);return{x:c.x+o,y:c.y+l}},viewportInitialized:!0}:Rie,[t,r])};function vN(){const e=Die(),t=er(),r=_.useCallback(()=>t.getState().getNodes().map(m=>({...m})),[]),n=_.useCallback(m=>t.getState().nodeInternals.get(m),[]),a=_.useCallback(()=>{const{edges:m=[]}=t.getState();return m.map(b=>({...b}))},[]),i=_.useCallback(m=>{const{edges:b=[]}=t.getState();return b.find(x=>x.id===m)},[]),s=_.useCallback(m=>{const{getNodes:b,setNodes:x,hasDefaultNodes:y,onNodesChange:v}=t.getState(),w=b(),j=typeof m=="function"?m(w):m;if(y)x(j);else if(v){const k=j.length===0?w.map(S=>({type:"remove",id:S.id})):j.map(S=>({item:S,type:"reset"}));v(k)}},[]),o=_.useCallback(m=>{const{edges:b=[],setEdges:x,hasDefaultEdges:y,onEdgesChange:v}=t.getState(),w=typeof m=="function"?m(b):m;if(y)x(w);else if(v){const j=w.length===0?b.map(k=>({type:"remove",id:k.id})):w.map(k=>({item:k,type:"reset"}));v(j)}},[]),l=_.useCallback(m=>{const b=Array.isArray(m)?m:[m],{getNodes:x,setNodes:y,hasDefaultNodes:v,onNodesChange:w}=t.getState();if(v){const k=[...x(),...b];y(k)}else if(w){const j=b.map(k=>({item:k,type:"add"}));w(j)}},[]),c=_.useCallback(m=>{const b=Array.isArray(m)?m:[m],{edges:x=[],setEdges:y,hasDefaultEdges:v,onEdgesChange:w}=t.getState();if(v)y([...x,...b]);else if(w){const j=b.map(k=>({item:k,type:"add"}));w(j)}},[]),d=_.useCallback(()=>{const{getNodes:m,edges:b=[],transform:x}=t.getState(),[y,v,w]=x;return{nodes:m().map(j=>({...j})),edges:b.map(j=>({...j})),viewport:{x:y,y:v,zoom:w}}},[]),f=_.useCallback(({nodes:m,edges:b})=>{const{nodeInternals:x,getNodes:y,edges:v,hasDefaultNodes:w,hasDefaultEdges:j,onNodesDelete:k,onEdgesDelete:S,onNodesChange:N,onEdgesChange:E}=t.getState(),A=(m||[]).map(D=>D.id),C=(b||[]).map(D=>D.id),M=y().reduce((D,$)=>{const L=$.parentNode||$.parentId,I=!A.includes($.id)&&L&&D.find(z=>z.id===L);return(typeof $.deletable=="boolean"?$.deletable:!0)&&(A.includes($.id)||I)&&D.push($),D},[]),T=v.filter(D=>typeof D.deletable=="boolean"?D.deletable:!0),P=T.filter(D=>C.includes(D.id));if(M||P){const D=i8(M,T),$=[...P,...D],L=$.reduce((I,R)=>(I.includes(R.id)||I.push(R.id),I),[]);if((j||w)&&(j&&t.setState({edges:v.filter(I=>!L.includes(I.id))}),w&&(M.forEach(I=>{x.delete(I.id)}),t.setState({nodeInternals:new Map(x)}))),L.length>0&&(S==null||S($),E&&E(L.map(I=>({id:I,type:"remove"})))),M.length>0&&(k==null||k(M),N)){const I=M.map(R=>({id:R.id,type:"remove"}));N(I)}}},[]),h=_.useCallback(m=>{const b=rie(m),x=b?null:t.getState().nodeInternals.get(m.id);return!b&&!x?[null,null,b]:[b?m:aT(x),x,b]},[]),p=_.useCallback((m,b=!0,x)=>{const[y,v,w]=h(m);return y?(x||t.getState().getNodes()).filter(j=>{if(!w&&(j.id===v.id||!j.positionAbsolute))return!1;const k=aT(j),S=MS(k,y);return b&&S>0||S>=y.width*y.height}):[]},[]),g=_.useCallback((m,b,x=!0)=>{const[y]=h(m);if(!y)return!1;const v=MS(y,b);return x&&v>0||v>=y.width*y.height},[]);return _.useMemo(()=>({...e,getNodes:r,getNode:n,getEdges:a,getEdge:i,setNodes:s,setEdges:o,addNodes:l,addEdges:c,toObject:d,deleteElements:f,getIntersectingNodes:p,isNodeIntersecting:g}),[e,r,n,a,i,s,o,l,c,d,f,p,g])}const Iie={actInsideInputWithModifier:!1};var Lie=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const r=er(),{deleteElements:n}=vN(),a=zd(e,Iie),i=zd(t);_.useEffect(()=>{if(a){const{edges:s,getNodes:o}=r.getState(),l=o().filter(d=>d.selected),c=s.filter(d=>d.selected);n({nodes:l,edges:c}),r.setState({nodesSelectionActive:!1})}},[a]),_.useEffect(()=>{r.setState({multiSelectionActive:i})},[i])};function zie(e){const t=er();_.useEffect(()=>{let r;const n=()=>{var i,s;if(!e.current)return;const a=uN(e.current);(a.height===0||a.width===0)&&((s=(i=t.getState()).onError)==null||s.call(i,"004",ai.error004())),t.setState({width:a.width||500,height:a.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 xN={position:"absolute",width:"100%",height:"100%",top:0,left:0},Fie=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Ch=e=>({x:e.x,y:e.y,zoom:e.k}),Ho=(e,t)=>e.target.closest(`.${t}`),pT=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),mT=e=>{const t=e.ctrlKey&&dm()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},Bie=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Vie=({onMove:e,onMoveStart:t,onMoveEnd:r,onPaneContextMenu:n,zoomOnScroll:a=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:o=.5,panOnScrollMode:l=Hs.Free,zoomOnDoubleClick:c=!0,elementsSelectable:d,panOnDrag:f=!0,defaultViewport:h,translateExtent:p,minZoom:g,maxZoom:m,zoomActivationKeyCode:b,preventScrolling:x=!0,children:y,noWheelClassName:v,noPanClassName:w})=>{const j=_.useRef(),k=er(),S=_.useRef(!1),N=_.useRef(!1),E=_.useRef(null),A=_.useRef({x:0,y:0,zoom:0}),{d3Zoom:C,d3Selection:M,d3ZoomHandler:T,userSelectionActive:P}=ot(Bie,or),D=zd(b),$=_.useRef(0),L=_.useRef(!1),I=_.useRef();return zie(E),_.useEffect(()=>{if(E.current){const R=E.current.getBoundingClientRect(),z=HF().scaleExtent([g,m]).translateExtent(p),V=vn(E.current).call(z),B=Ha.translate(h.x,h.y).scale(Xl(h.zoom,g,m)),W=[[0,0],[R.width,R.height]],K=z.constrain()(B,W,p);z.transform(V,K),z.wheelDelta(mT),k.setState({d3Zoom:z,d3Selection:V,d3ZoomHandler:V.on("wheel.zoom"),transform:[K.x,K.y,K.k],domNode:E.current.closest(".react-flow")})}},[]),_.useEffect(()=>{M&&C&&(s&&!D&&!P?M.on("wheel.zoom",R=>{if(Ho(R,v))return!1;R.preventDefault(),R.stopImmediatePropagation();const z=M.property("__zoom").k||1;if(R.ctrlKey&&i){const ve=Un(R),Y=mT(R),ee=z*Math.pow(2,Y);C.scaleTo(M,ee,ve,R);return}const V=R.deltaMode===1?20:1;let B=l===Hs.Vertical?0:R.deltaX*V,W=l===Hs.Horizontal?0:R.deltaY*V;!dm()&&R.shiftKey&&l!==Hs.Vertical&&(B=R.deltaY*V,W=0),C.translateBy(M,-(B/z)*o,-(W/z)*o,{internal:!0});const K=Ch(M.property("__zoom")),{onViewportChangeStart:Q,onViewportChange:ae,onViewportChangeEnd:pe}=k.getState();clearTimeout(I.current),L.current||(L.current=!0,t==null||t(R,K),Q==null||Q(K)),L.current&&(e==null||e(R,K),ae==null||ae(K),I.current=setTimeout(()=>{r==null||r(R,K),pe==null||pe(K),L.current=!1},150))},{passive:!1}):typeof T<"u"&&M.on("wheel.zoom",function(R,z){if(!x&&R.type==="wheel"&&!R.ctrlKey||Ho(R,v))return null;R.preventDefault(),T.call(this,R,z)},{passive:!1}))},[P,s,l,M,C,T,D,i,x,v,t,e,r]),_.useEffect(()=>{C&&C.on("start",R=>{var B,W;if(!R.sourceEvent||R.sourceEvent.internal)return null;$.current=(B=R.sourceEvent)==null?void 0:B.button;const{onViewportChangeStart:z}=k.getState(),V=Ch(R.transform);S.current=!0,A.current=V,((W=R.sourceEvent)==null?void 0:W.type)==="mousedown"&&k.setState({paneDragging:!0}),z==null||z(V),t==null||t(R.sourceEvent,V)})},[C,t]),_.useEffect(()=>{C&&(P&&!S.current?C.on("zoom",null):P||C.on("zoom",R=>{var V;const{onViewportChange:z}=k.getState();if(k.setState({transform:[R.transform.x,R.transform.y,R.transform.k]}),N.current=!!(n&&pT(f,$.current??0)),(e||z)&&!((V=R.sourceEvent)!=null&&V.internal)){const B=Ch(R.transform);z==null||z(B),e==null||e(R.sourceEvent,B)}}))},[P,C,e,f,n]),_.useEffect(()=>{C&&C.on("end",R=>{if(!R.sourceEvent||R.sourceEvent.internal)return null;const{onViewportChangeEnd:z}=k.getState();if(S.current=!1,k.setState({paneDragging:!1}),n&&pT(f,$.current??0)&&!N.current&&n(R.sourceEvent),N.current=!1,(r||z)&&Fie(A.current,R.transform)){const V=Ch(R.transform);A.current=V,clearTimeout(j.current),j.current=setTimeout(()=>{z==null||z(V),r==null||r(R.sourceEvent,V)},s?150:0)}})},[C,s,f,r,n]),_.useEffect(()=>{C&&C.filter(R=>{const z=D||a,V=i&&R.ctrlKey;if((f===!0||Array.isArray(f)&&f.includes(1))&&R.button===1&&R.type==="mousedown"&&(Ho(R,"react-flow__node")||Ho(R,"react-flow__edge")))return!0;if(!f&&!z&&!s&&!c&&!i||P||!c&&R.type==="dblclick"||Ho(R,v)&&R.type==="wheel"||Ho(R,w)&&(R.type!=="wheel"||s&&R.type==="wheel"&&!D)||!i&&R.ctrlKey&&R.type==="wheel"||!z&&!s&&!V&&R.type==="wheel"||!f&&(R.type==="mousedown"||R.type==="touchstart")||Array.isArray(f)&&!f.includes(R.button)&&R.type==="mousedown")return!1;const B=Array.isArray(f)&&f.includes(R.button)||!R.button||R.button<=1;return(!R.ctrlKey||R.type==="wheel")&&B})},[P,C,a,i,s,c,f,d,D]),O.createElement("div",{className:"react-flow__renderer",ref:E,style:xN},y)},qie=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Uie(){const{userSelectionActive:e,userSelectionRect:t}=ot(qie,or);return e&&t?O.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 gT(e,t){const r=t.parentNode||t.parentId,n=e.find(a=>a.id===r);if(n){const a=t.position.x+t.width-n.width,i=t.position.y+t.height-n.height;if(a>0||i>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,a>0&&(n.style.width+=a),i>0&&(n.style.height+=i),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 j8(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,a)=>{const i=e.filter(o=>o.id===a.id);if(i.length===0)return n.push(a),n;const s={...a};for(const o of i)if(o)switch(o.type){case"select":{s.selected=o.selected;break}case"position":{typeof o.position<"u"&&(s.position=o.position),typeof o.positionAbsolute<"u"&&(s.positionAbsolute=o.positionAbsolute),typeof o.dragging<"u"&&(s.dragging=o.dragging),s.expandParent&&gT(n,s);break}case"dimensions":{typeof o.dimensions<"u"&&(s.width=o.dimensions.width,s.height=o.dimensions.height),typeof o.updateStyle<"u"&&(s.style={...s.style||{},...o.dimensions}),typeof o.resizing=="boolean"&&(s.resizing=o.resizing),s.expandParent&&gT(n,s);break}case"remove":return n}return n.push(s),n},r)}function S8(e,t){return j8(e,t)}function Hie(e,t){return j8(e,t)}const Mi=(e,t)=>({id:e,type:"select",selected:t});function ml(e,t){return e.reduce((r,n)=>{const a=t.includes(n.id);return!n.selected&&a?(n.selected=!0,r.push(Mi(n.id,!0))):n.selected&&!a&&(n.selected=!1,r.push(Mi(n.id,!1))),r},[])}const Wy=(e,t)=>r=>{r.target===t.current&&(e==null||e(r))},Wie=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),k8=_.memo(({isSelecting:e,selectionMode:t=Ld.Full,panOnDrag:r,onSelectionStart:n,onSelectionEnd:a,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:o,onPaneMouseEnter:l,onPaneMouseMove:c,onPaneMouseLeave:d,children:f})=>{const h=_.useRef(null),p=er(),g=_.useRef(0),m=_.useRef(0),b=_.useRef(),{userSelectionActive:x,elementsSelectable:y,dragging:v}=ot(Wie,or),w=()=>{p.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,m.current=0},j=T=>{i==null||i(T),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},k=T=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){T.preventDefault();return}s==null||s(T)},S=o?T=>o(T):void 0,N=T=>{const{resetSelectedElements:P,domNode:D}=p.getState();if(b.current=D==null?void 0:D.getBoundingClientRect(),!y||!e||T.button!==0||T.target!==h.current||!b.current)return;const{x:$,y:L}=Ji(T,b.current);P(),p.setState({userSelectionRect:{width:0,height:0,startX:$,startY:L,x:$,y:L}}),n==null||n(T)},E=T=>{const{userSelectionRect:P,nodeInternals:D,edges:$,transform:L,onNodesChange:I,onEdgesChange:R,nodeOrigin:z,getNodes:V}=p.getState();if(!e||!b.current||!P)return;p.setState({userSelectionActive:!0,nodesSelectionActive:!1});const B=Ji(T,b.current),W=P.startX??0,K=P.startY??0,Q={...P,x:B.x<W?B.x:W,y:B.y<K?B.y:K,width:Math.abs(B.x-W),height:Math.abs(B.y-K)},ae=V(),pe=a8(D,Q,L,t===Ld.Partial,!0,z),ve=i8(pe,$).map(ee=>ee.id),Y=pe.map(ee=>ee.id);if(g.current!==Y.length){g.current=Y.length;const ee=ml(ae,Y);ee.length&&(I==null||I(ee))}if(m.current!==ve.length){m.current=ve.length;const ee=ml($,ve);ee.length&&(R==null||R(ee))}p.setState({userSelectionRect:Q})},A=T=>{if(T.button!==0)return;const{userSelectionRect:P}=p.getState();!x&&P&&T.target===h.current&&(j==null||j(T)),p.setState({nodesSelectionActive:g.current>0}),w(),a==null||a(T)},C=T=>{x&&(p.setState({nodesSelectionActive:g.current>0}),a==null||a(T)),w()},M=y&&(e||x);return O.createElement("div",{className:gr(["react-flow__pane",{dragging:v,selection:e}]),onClick:M?void 0:Wy(j,h),onContextMenu:Wy(k,h),onWheel:Wy(S,h),onMouseEnter:M?void 0:l,onMouseDown:M?N:void 0,onMouseMove:M?E:c,onMouseUp:M?A:void 0,onMouseLeave:M?C:d,ref:h,style:xN},f,O.createElement(Uie,null))});k8.displayName="Pane";function _8(e,t){const r=e.parentNode||e.parentId;if(!r)return!1;const n=t.get(r);return n?n.selected?!0:_8(n,t):!1}function yT(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 Gie(e,t,r,n){return Array.from(e.values()).filter(a=>(a.selected||a.id===n)&&(!a.parentNode||a.parentId||!_8(a,e))&&(a.draggable||t&&typeof a.draggable>"u")).map(a=>{var i,s;return{id:a.id,position:a.position||{x:0,y:0},positionAbsolute:a.positionAbsolute||{x:0,y:0},distance:{x:r.x-(((i=a.positionAbsolute)==null?void 0:i.x)??0),y:r.y-(((s=a.positionAbsolute)==null?void 0:s.y)??0)},delta:{x:0,y:0},extent:a.extent,parentNode:a.parentNode||a.parentId,parentId:a.parentNode||a.parentId,width:a.width,height:a.height,expandParent:a.expandParent}})}function Kie(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function N8(e,t,r,n,a=[0,0],i){const s=Kie(e,e.extent||n);let o=s;const l=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(l&&e.width&&e.height){const f=r.get(l),{x:h,y:p}=to(f,a).positionAbsolute;o=f&&wn(h)&&wn(p)&&wn(f.width)&&wn(f.height)?[[h+e.width*a[0],p+e.height*a[1]],[h+f.width-e.width+e.width*a[0],p+f.height-e.height+e.height*a[1]]]:o}else i==null||i("005",ai.error005()),o=s;else if(e.extent&&l&&e.extent!=="parent"){const f=r.get(l),{x:h,y:p}=to(f,a).positionAbsolute;o=[[e.extent[0][0]+h,e.extent[0][1]+p],[e.extent[1][0]+h,e.extent[1][1]+p]]}let c={x:0,y:0};if(l){const f=r.get(l);c=to(f,a).positionAbsolute}const d=o&&o!=="parent"?dN(t,o):t;return{position:{x:d.x-c.x,y:d.y-c.y},positionAbsolute:d}}function Gy({nodeId:e,dragItems:t,nodeInternals:r}){const n=t.map(a=>({...r.get(a.id),position:a.position,positionAbsolute:a.positionAbsolute}));return[e?n.find(a=>a.id===e):n[0],n]}const vT=(e,t,r,n)=>{const a=t.querySelectorAll(e);if(!a||!a.length)return null;const i=Array.from(a),s=t.getBoundingClientRect(),o={x:s.width*n[0],y:s.height*n[1]};return i.map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(c.left-s.left-o.x)/r,y:(c.top-s.top-o.y)/r,...uN(l)}})};function uu(e,t,r){return r===void 0?r:n=>{const a=t().nodeInternals.get(e);a&&r(n,{...a})}}function zS({id:e,store:t,unselect:r=!1,nodeRef:n}){const{addSelectedNodes:a,unselectNodesAndEdges:i,multiSelectionActive:s,nodeInternals:o,onError:l}=t.getState(),c=o.get(e);if(!c){l==null||l("012",ai.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(r||c.selected&&s)&&(i({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var d;return(d=n==null?void 0:n.current)==null?void 0:d.blur()})):a([e])}function Yie(){const e=er();return _.useCallback(({sourceEvent:r})=>{const{transform:n,snapGrid:a,snapToGrid:i}=e.getState(),s=r.touches?r.touches[0].clientX:r.clientX,o=r.touches?r.touches[0].clientY:r.clientY,l={x:(s-n[0])/n[2],y:(o-n[1])/n[2]};return{xSnapped:i?a[0]*Math.round(l.x/a[0]):l.x,ySnapped:i?a[1]*Math.round(l.y/a[1]):l.y,...l}},[])}function Ky(e){return(t,r,n)=>e==null?void 0:e(t,n)}function E8({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:n,nodeId:a,isSelectable:i,selectNodesOnDrag:s}){const o=er(),[l,c]=_.useState(!1),d=_.useRef([]),f=_.useRef({x:null,y:null}),h=_.useRef(0),p=_.useRef(null),g=_.useRef({x:0,y:0}),m=_.useRef(null),b=_.useRef(!1),x=_.useRef(!1),y=_.useRef(!1),v=Yie();return _.useEffect(()=>{if(e!=null&&e.current){const w=vn(e.current),j=({x:N,y:E})=>{const{nodeInternals:A,onNodeDrag:C,onSelectionDrag:M,updateNodePositions:T,nodeExtent:P,snapGrid:D,snapToGrid:$,nodeOrigin:L,onError:I}=o.getState();f.current={x:N,y:E};let R=!1,z={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&P){const B=B0(d.current,L);z=Id(B)}if(d.current=d.current.map(B=>{const W={x:N-B.distance.x,y:E-B.distance.y};$&&(W.x=D[0]*Math.round(W.x/D[0]),W.y=D[1]*Math.round(W.y/D[1]));const K=[[P[0][0],P[0][1]],[P[1][0],P[1][1]]];d.current.length>1&&P&&!B.extent&&(K[0][0]=B.positionAbsolute.x-z.x+P[0][0],K[1][0]=B.positionAbsolute.x+(B.width??0)-z.x2+P[1][0],K[0][1]=B.positionAbsolute.y-z.y+P[0][1],K[1][1]=B.positionAbsolute.y+(B.height??0)-z.y2+P[1][1]);const Q=N8(B,W,A,K,L,I);return R=R||B.position.x!==Q.position.x||B.position.y!==Q.position.y,B.position=Q.position,B.positionAbsolute=Q.positionAbsolute,B}),!R)return;T(d.current,!0,!0),c(!0);const V=a?C:Ky(M);if(V&&m.current){const[B,W]=Gy({nodeId:a,dragItems:d.current,nodeInternals:A});V(m.current,B,W)}},k=()=>{if(!p.current)return;const[N,E]=GF(g.current,p.current);if(N!==0||E!==0){const{transform:A,panBy:C}=o.getState();f.current.x=(f.current.x??0)-N/A[2],f.current.y=(f.current.y??0)-E/A[2],C({x:N,y:E})&&j(f.current)}h.current=requestAnimationFrame(k)},S=N=>{var L;const{nodeInternals:E,multiSelectionActive:A,nodesDraggable:C,unselectNodesAndEdges:M,onNodeDragStart:T,onSelectionDragStart:P}=o.getState();x.current=!0;const D=a?T:Ky(P);(!s||!i)&&!A&&a&&((L=E.get(a))!=null&&L.selected||M()),a&&i&&s&&zS({id:a,store:o,nodeRef:e});const $=v(N);if(f.current=$,d.current=Gie(E,C,$,a),D&&d.current){const[I,R]=Gy({nodeId:a,dragItems:d.current,nodeInternals:E});D(N.sourceEvent,I,R)}};if(t)w.on(".drag",null);else{const N=tne().on("start",E=>{const{domNode:A,nodeDragThreshold:C}=o.getState();C===0&&S(E),y.current=!1;const M=v(E);f.current=M,p.current=(A==null?void 0:A.getBoundingClientRect())||null,g.current=Ji(E.sourceEvent,p.current)}).on("drag",E=>{var T,P;const A=v(E),{autoPanOnNodeDrag:C,nodeDragThreshold:M}=o.getState();if(E.sourceEvent.type==="touchmove"&&E.sourceEvent.touches.length>1&&(y.current=!0),!y.current){if(!b.current&&x.current&&C&&(b.current=!0,k()),!x.current){const D=A.xSnapped-(((T=f==null?void 0:f.current)==null?void 0:T.x)??0),$=A.ySnapped-(((P=f==null?void 0:f.current)==null?void 0:P.y)??0);Math.sqrt(D*D+$*$)>M&&S(E)}(f.current.x!==A.xSnapped||f.current.y!==A.ySnapped)&&d.current&&x.current&&(m.current=E.sourceEvent,g.current=Ji(E.sourceEvent,p.current),j(A))}}).on("end",E=>{if(!(!x.current||y.current)&&(c(!1),b.current=!1,x.current=!1,cancelAnimationFrame(h.current),d.current)){const{updateNodePositions:A,nodeInternals:C,onNodeDragStop:M,onSelectionDragStop:T}=o.getState(),P=a?M:Ky(T);if(A(d.current,!1,!1),P){const[D,$]=Gy({nodeId:a,dragItems:d.current,nodeInternals:C});P(E.sourceEvent,D,$)}}}).filter(E=>{const A=E.target;return!E.button&&(!r||!yT(A,`.${r}`,e))&&(!n||yT(A,n,e))});return w.call(N),()=>{w.on(".drag",null)}}}},[e,t,r,n,i,o,a,s,v]),l}function P8(){const e=er();return _.useCallback(r=>{const{nodeInternals:n,nodeExtent:a,updateNodePositions:i,getNodes:s,snapToGrid:o,snapGrid:l,onError:c,nodesDraggable:d}=e.getState(),f=s().filter(y=>y.selected&&(y.draggable||d&&typeof y.draggable>"u")),h=o?l[0]:5,p=o?l[1]:5,g=r.isShiftPressed?4:1,m=r.x*h*g,b=r.y*p*g,x=f.map(y=>{if(y.positionAbsolute){const v={x:y.positionAbsolute.x+m,y:y.positionAbsolute.y+b};o&&(v.x=l[0]*Math.round(v.x/l[0]),v.y=l[1]*Math.round(v.y/l[1]));const{positionAbsolute:w,position:j}=N8(y,v,n,a,void 0,c);y.position=j,y.positionAbsolute=w}return y});i(x,!0,!1)},[])}const Tl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var du=e=>{const t=({id:r,type:n,data:a,xPos:i,yPos:s,xPosOrigin:o,yPosOrigin:l,selected:c,onClick:d,onMouseEnter:f,onMouseMove:h,onMouseLeave:p,onContextMenu:g,onDoubleClick:m,style:b,className:x,isDraggable:y,isSelectable:v,isConnectable:w,isFocusable:j,selectNodesOnDrag:k,sourcePosition:S,targetPosition:N,hidden:E,resizeObserver:A,dragHandle:C,zIndex:M,isParent:T,noDragClassName:P,noPanClassName:D,initialized:$,disableKeyboardA11y:L,ariaLabel:I,rfId:R,hasHandleBounds:z})=>{const V=er(),B=_.useRef(null),W=_.useRef(null),K=_.useRef(S),Q=_.useRef(N),ae=_.useRef(n),pe=v||y||d||f||h||p,ve=P8(),Y=uu(r,V.getState,f),ee=uu(r,V.getState,h),fe=uu(r,V.getState,p),H=uu(r,V.getState,g),je=uu(r,V.getState,m),ye=ne=>{const{nodeDragThreshold:ie}=V.getState();if(v&&(!k||!y||ie>0)&&zS({id:r,store:V,nodeRef:B}),d){const qe=V.getState().nodeInternals.get(r);qe&&d(ne,{...qe})}},se=ne=>{if(!RS(ne)&&!L)if(ZF.includes(ne.key)&&v){const ie=ne.key==="Escape";zS({id:r,store:V,unselect:ie,nodeRef:B})}else y&&c&&Object.prototype.hasOwnProperty.call(Tl,ne.key)&&(V.setState({ariaLiveMessage:`Moved selected node ${ne.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~s}`}),ve({x:Tl[ne.key].x,y:Tl[ne.key].y,isShiftPressed:ne.shiftKey}))};_.useEffect(()=>()=>{W.current&&(A==null||A.unobserve(W.current),W.current=null)},[]),_.useEffect(()=>{if(B.current&&!E){const ne=B.current;(!$||!z||W.current!==ne)&&(W.current&&(A==null||A.unobserve(W.current)),A==null||A.observe(ne),W.current=ne)}},[E,$,z]),_.useEffect(()=>{const ne=ae.current!==n,ie=K.current!==S,qe=Q.current!==N;B.current&&(ne||ie||qe)&&(ne&&(ae.current=n),ie&&(K.current=S),qe&&(Q.current=N),V.getState().updateNodeDimensions([{id:r,nodeElement:B.current,forceUpdate:!0}]))},[r,n,S,N]);const ke=E8({nodeRef:B,disabled:E||!y,noDragClassName:P,handleSelector:C,nodeId:r,isSelectable:v,selectNodesOnDrag:k});return E?null:O.createElement("div",{className:gr(["react-flow__node",`react-flow__node-${n}`,{[D]:y},x,{selected:c,selectable:v,parent:T,dragging:ke}]),ref:B,style:{zIndex:M,transform:`translate(${o}px,${l}px)`,pointerEvents:pe?"all":"none",visibility:$?"visible":"hidden",...b},"data-id":r,"data-testid":`rf__node-${r}`,onMouseEnter:Y,onMouseMove:ee,onMouseLeave:fe,onContextMenu:H,onClick:ye,onDoubleClick:je,onKeyDown:j?se:void 0,tabIndex:j?0:void 0,role:j?"button":void 0,"aria-describedby":L?void 0:`${y8}-${R}`,"aria-label":I},O.createElement(cie,{value:r},O.createElement(e,{id:r,data:a,type:n,xPos:i,yPos:s,selected:c,isConnectable:w,sourcePosition:S,targetPosition:N,dragging:ke,dragHandle:C,zIndex:M})))};return t.displayName="NodeWrapper",_.memo(t)};const Xie=e=>{const t=e.getNodes().filter(r=>r.selected);return{...B0(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function Zie({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const n=er(),{width:a,height:i,x:s,y:o,transformString:l,userSelectionActive:c}=ot(Xie,or),d=P8(),f=_.useRef(null);if(_.useEffect(()=>{var g;r||(g=f.current)==null||g.focus({preventScroll:!0})},[r]),E8({nodeRef:f}),c||!a||!i)return null;const h=e?g=>{const m=n.getState().getNodes().filter(b=>b.selected);e(g,m)}:void 0,p=g=>{Object.prototype.hasOwnProperty.call(Tl,g.key)&&d({x:Tl[g.key].x,y:Tl[g.key].y,isShiftPressed:g.shiftKey})};return O.createElement("div",{className:gr(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l}},O.createElement("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:r?void 0:-1,onKeyDown:r?void 0:p,style:{width:a,height:i,top:o,left:s}}))}var Qie=_.memo(Zie);const Jie=e=>e.nodesSelectionActive,C8=({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:n,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:o,onMove:l,onMoveStart:c,onMoveEnd:d,selectionKeyCode:f,selectionOnDrag:h,selectionMode:p,onSelectionStart:g,onSelectionEnd:m,multiSelectionKeyCode:b,panActivationKeyCode:x,zoomActivationKeyCode:y,elementsSelectable:v,zoomOnScroll:w,zoomOnPinch:j,panOnScroll:k,panOnScrollSpeed:S,panOnScrollMode:N,zoomOnDoubleClick:E,panOnDrag:A,defaultViewport:C,translateExtent:M,minZoom:T,maxZoom:P,preventScrolling:D,onSelectionContextMenu:$,noWheelClassName:L,noPanClassName:I,disableKeyboardA11y:R})=>{const z=ot(Jie),V=zd(f),B=zd(x),W=B||A,K=B||k,Q=V||h&&W!==!0;return Lie({deleteKeyCode:o,multiSelectionKeyCode:b}),O.createElement(Vie,{onMove:l,onMoveStart:c,onMoveEnd:d,onPaneContextMenu:i,elementsSelectable:v,zoomOnScroll:w,zoomOnPinch:j,panOnScroll:K,panOnScrollSpeed:S,panOnScrollMode:N,zoomOnDoubleClick:E,panOnDrag:!V&&W,defaultViewport:C,translateExtent:M,minZoom:T,maxZoom:P,zoomActivationKeyCode:y,preventScrolling:D,noWheelClassName:L,noPanClassName:I},O.createElement(k8,{onSelectionStart:g,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:n,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:W,isSelecting:!!Q,selectionMode:p},e,z&&O.createElement(Qie,{onSelectionContextMenu:$,noPanClassName:I,disableKeyboardA11y:R})))};C8.displayName="FlowRenderer";var ese=_.memo(C8);function tse(e){return ot(_.useCallback(r=>e?a8(r.nodeInternals,{x:0,y:0,width:r.width,height:r.height},r.transform,!0):r.getNodes(),[e]))}function rse(e){const t={input:du(e.input||h8),default:du(e.default||LS),output:du(e.output||m8),group:du(e.group||yN)},r={},n=Object.keys(e).filter(a=>!["input","default","output","group"].includes(a)).reduce((a,i)=>(a[i]=du(e[i]||LS),a),r);return{...t,...n}}const nse=({x:e,y:t,width:r,height:n,origin:a})=>!r||!n?{x:e,y:t}:a[0]<0||a[1]<0||a[0]>1||a[1]>1?{x:e,y:t}:{x:e-r*a[0],y:t-n*a[1]},ase=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),A8=e=>{const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:n,elementsSelectable:a,updateNodeDimensions:i,onError:s}=ot(ase,or),o=tse(e.onlyRenderVisibleElements),l=_.useRef(),c=_.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const d=new ResizeObserver(f=>{const h=f.map(p=>({id:p.target.getAttribute("data-id"),nodeElement:p.target,forceUpdate:!0}));i(h)});return l.current=d,d},[]);return _.useEffect(()=>()=>{var d;(d=l==null?void 0:l.current)==null||d.disconnect()},[]),O.createElement("div",{className:"react-flow__nodes",style:xN},o.map(d=>{var j,k,S;let f=d.type||"default";e.nodeTypes[f]||(s==null||s("003",ai.error003(f)),f="default");const h=e.nodeTypes[f]||e.nodeTypes.default,p=!!(d.draggable||t&&typeof d.draggable>"u"),g=!!(d.selectable||a&&typeof d.selectable>"u"),m=!!(d.connectable||r&&typeof d.connectable>"u"),b=!!(d.focusable||n&&typeof d.focusable>"u"),x=e.nodeExtent?dN(d.positionAbsolute,e.nodeExtent):d.positionAbsolute,y=(x==null?void 0:x.x)??0,v=(x==null?void 0:x.y)??0,w=nse({x:y,y:v,width:d.width??0,height:d.height??0,origin:e.nodeOrigin});return O.createElement(h,{key:d.id,id:d.id,className:d.className,style:d.style,type:f,data:d.data,sourcePosition:d.sourcePosition||me.Bottom,targetPosition:d.targetPosition||me.Top,hidden:d.hidden,xPos:y,yPos:v,xPosOrigin:w.x,yPosOrigin:w.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:p,isSelectable:g,isConnectable:m,isFocusable:b,resizeObserver:c,dragHandle:d.dragHandle,zIndex:((j=d[Mt])==null?void 0:j.z)??0,isParent:!!((k=d[Mt])!=null&&k.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!d.width&&!!d.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:d.ariaLabel,hasHandleBounds:!!((S=d[Mt])!=null&&S.handleBounds)})}))};A8.displayName="NodeRenderer";var ise=_.memo(A8);const sse=(e,t,r)=>r===me.Left?e-t:r===me.Right?e+t:e,ose=(e,t,r)=>r===me.Top?e-t:r===me.Bottom?e+t:e,xT="react-flow__edgeupdater",bT=({position:e,centerX:t,centerY:r,radius:n=10,onMouseDown:a,onMouseEnter:i,onMouseOut:s,type:o})=>O.createElement("circle",{onMouseDown:a,onMouseEnter:i,onMouseOut:s,className:gr([xT,`${xT}-${o}`]),cx:sse(t,n,e),cy:ose(r,n,e),r:n,stroke:"transparent",fill:"transparent"}),lse=()=>!0;var Wo=e=>{const t=({id:r,className:n,type:a,data:i,onClick:s,onEdgeDoubleClick:o,selected:l,animated:c,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:m,style:b,source:x,target:y,sourceX:v,sourceY:w,targetX:j,targetY:k,sourcePosition:S,targetPosition:N,elementsSelectable:E,hidden:A,sourceHandleId:C,targetHandleId:M,onContextMenu:T,onMouseEnter:P,onMouseMove:D,onMouseLeave:$,reconnectRadius:L,onReconnect:I,onReconnectStart:R,onReconnectEnd:z,markerEnd:V,markerStart:B,rfId:W,ariaLabel:K,isFocusable:Q,isReconnectable:ae,pathOptions:pe,interactionWidth:ve,disableKeyboardA11y:Y})=>{const ee=_.useRef(null),[fe,H]=_.useState(!1),[je,ye]=_.useState(!1),se=er(),ke=_.useMemo(()=>`url('#${DS(B,W)}')`,[B,W]),ne=_.useMemo(()=>`url('#${DS(V,W)}')`,[V,W]);if(A)return null;const ie=St=>{var cn;const{edges:yr,addSelectedEdges:ut,unselectNodesAndEdges:nr,multiSelectionActive:la}=se.getState(),ln=yr.find(yi=>yi.id===r);ln&&(E&&(se.setState({nodesSelectionActive:!1}),ln.selected&&la?(nr({nodes:[],edges:[ln]}),(cn=ee.current)==null||cn.blur()):ut([r])),s&&s(St,ln))},qe=cu(r,se.getState,o),rr=cu(r,se.getState,T),zt=cu(r,se.getState,P),lt=cu(r,se.getState,D),rt=cu(r,se.getState,$),ct=(St,yr)=>{if(St.button!==0)return;const{edges:ut,isValidConnection:nr}=se.getState(),la=yr?y:x,ln=(yr?M:C)||null,cn=yr?"target":"source",yi=nr||lse,vi=yr,xi=ut.find(_a=>_a.id===r);ye(!0),R==null||R(St,xi,cn);const ks=_a=>{ye(!1),z==null||z(_a,xi,cn)};c8({event:St,handleId:ln,nodeId:la,onConnect:_a=>I==null?void 0:I(xi,_a),isTarget:vi,getState:se.getState,setState:se.setState,isValidConnection:yi,edgeUpdaterType:cn,onReconnectEnd:ks})},Ft=St=>ct(St,!0),on=St=>ct(St,!1),Dr=()=>H(!0),Pt=()=>H(!1),Gt=!E&&!s,Dn=St=>{var yr;if(!Y&&ZF.includes(St.key)&&E){const{unselectNodesAndEdges:ut,addSelectedEdges:nr,edges:la}=se.getState();St.key==="Escape"?((yr=ee.current)==null||yr.blur(),ut({edges:[la.find(cn=>cn.id===r)]})):nr([r])}};return O.createElement("g",{className:gr(["react-flow__edge",`react-flow__edge-${a}`,n,{selected:l,animated:c,inactive:Gt,updating:fe}]),onClick:ie,onDoubleClick:qe,onContextMenu:rr,onMouseEnter:zt,onMouseMove:lt,onMouseLeave:rt,onKeyDown:Q?Dn:void 0,tabIndex:Q?0:void 0,role:Q?"button":"img","data-testid":`rf__edge-${r}`,"aria-label":K===null?void 0:K||`Edge from ${x} to ${y}`,"aria-describedby":Q?`${v8}-${W}`:void 0,ref:ee},!je&&O.createElement(e,{id:r,source:x,target:y,selected:l,animated:c,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:m,data:i,style:b,sourceX:v,sourceY:w,targetX:j,targetY:k,sourcePosition:S,targetPosition:N,sourceHandleId:C,targetHandleId:M,markerStart:ke,markerEnd:ne,pathOptions:pe,interactionWidth:ve}),ae&&O.createElement(O.Fragment,null,(ae==="source"||ae===!0)&&O.createElement(bT,{position:S,centerX:v,centerY:w,radius:L,onMouseDown:Ft,onMouseEnter:Dr,onMouseOut:Pt,type:"source"}),(ae==="target"||ae===!0)&&O.createElement(bT,{position:N,centerX:j,centerY:k,radius:L,onMouseDown:on,onMouseEnter:Dr,onMouseOut:Pt,type:"target"})))};return t.displayName="EdgeWrapper",_.memo(t)};function cse(e){const t={default:Wo(e.default||fm),straight:Wo(e.bezier||pN),step:Wo(e.step||hN),smoothstep:Wo(e.step||F0),simplebezier:Wo(e.simplebezier||fN)},r={},n=Object.keys(e).filter(a=>!["default","bezier"].includes(a)).reduce((a,i)=>(a[i]=Wo(e[i]||fm),a),r);return{...t,...n}}function wT(e,t,r=null){const n=((r==null?void 0:r.x)||0)+t.x,a=((r==null?void 0:r.y)||0)+t.y,i=(r==null?void 0:r.width)||t.width,s=(r==null?void 0:r.height)||t.height;switch(e){case me.Top:return{x:n+i/2,y:a};case me.Right:return{x:n+i,y:a+s/2};case me.Bottom:return{x:n+i/2,y:a+s};case me.Left:return{x:n,y:a+s/2}}}function jT(e,t){return e?e.length===1||!t?e[0]:t&&e.find(r=>r.id===t)||null:null}const use=(e,t,r,n,a,i)=>{const s=wT(r,e,t),o=wT(i,n,a);return{sourceX:s.x,sourceY:s.y,targetX:o.x,targetY:o.y}};function dse({sourcePos:e,targetPos:t,sourceWidth:r,sourceHeight:n,targetWidth:a,targetHeight:i,width:s,height:o,transform:l}){const c={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+r,t.x+a),y2:Math.max(e.y+n,t.y+i)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d=Id({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:s/l[2],height:o/l[2]}),f=Math.max(0,Math.min(d.x2,c.x2)-Math.max(d.x,c.x)),h=Math.max(0,Math.min(d.y2,c.y2)-Math.max(d.y,c.y));return Math.ceil(f*h)>0}function ST(e){var n,a,i,s,o;const t=((n=e==null?void 0:e[Mt])==null?void 0:n.handleBounds)||null,r=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.x)<"u"&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.y)<"u";return[{x:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)||0,y:((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!r]}const fse=[{level:0,isMaxLevel:!0,edges:[]}];function hse(e,t,r=!1){let n=-1;const a=e.reduce((s,o)=>{var d,f;const l=wn(o.zIndex);let c=l?o.zIndex:0;if(r){const h=t.get(o.target),p=t.get(o.source),g=o.selected||(h==null?void 0:h.selected)||(p==null?void 0:p.selected),m=Math.max(((d=p==null?void 0:p[Mt])==null?void 0:d.z)||0,((f=h==null?void 0:h[Mt])==null?void 0:f.z)||0,1e3);c=(l?o.zIndex:0)+(g?m:0)}return s[c]?s[c].push(o):s[c]=[o],n=c>n?c:n,s},{}),i=Object.entries(a).map(([s,o])=>{const l=+s;return{edges:o,level:l,isMaxLevel:l===n}});return i.length===0?fse:i}function pse(e,t,r){const n=ot(_.useCallback(a=>e?a.edges.filter(i=>{const s=t.get(i.source),o=t.get(i.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(o==null?void 0:o.width)&&(o==null?void 0:o.height)&&dse({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:o.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:o.width,targetHeight:o.height,width:a.width,height:a.height,transform:a.transform})}):a.edges,[e,t]));return hse(n,t,r)}const mse=({color:e="none",strokeWidth:t=1})=>O.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),gse=({color:e="none",strokeWidth:t=1})=>O.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),kT={[Zl.Arrow]:mse,[Zl.ArrowClosed]:gse};function yse(e){const t=er();return _.useMemo(()=>{var a,i;return Object.prototype.hasOwnProperty.call(kT,e)?kT[e]:((i=(a=t.getState()).onError)==null||i.call(a,"009",ai.error009(e)),null)},[e])}const vse=({id:e,type:t,color:r,width:n=12.5,height:a=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:o="auto-start-reverse"})=>{const l=yse(t);return l?O.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${n}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0"},O.createElement(l,{color:r,strokeWidth:s})):null},xse=({defaultColor:e,rfId:t})=>r=>{const n=[];return r.edges.reduce((a,i)=>([i.markerStart,i.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const o=DS(s,t);n.includes(o)||(a.push({id:o,color:s.color||e,...s}),n.push(o))}}),a),[]).sort((a,i)=>a.id.localeCompare(i.id))},T8=({defaultColor:e,rfId:t})=>{const r=ot(_.useCallback(xse({defaultColor:e,rfId:t}),[e,t]),(n,a)=>!(n.length!==a.length||n.some((i,s)=>i.id!==a[s].id)));return O.createElement("defs",null,r.map(n=>O.createElement(vse,{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})))};T8.displayName="MarkerDefinitions";var bse=_.memo(T8);const wse=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}),O8=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:r,rfId:n,edgeTypes:a,noPanClassName:i,onEdgeContextMenu:s,onEdgeMouseEnter:o,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:d,onEdgeDoubleClick:f,onReconnect:h,onReconnectStart:p,onReconnectEnd:g,reconnectRadius:m,children:b,disableKeyboardA11y:x})=>{const{edgesFocusable:y,edgesUpdatable:v,elementsSelectable:w,width:j,height:k,connectionMode:S,nodeInternals:N,onError:E}=ot(wse,or),A=pse(t,N,r);return j?O.createElement(O.Fragment,null,A.map(({level:C,edges:M,isMaxLevel:T})=>O.createElement("svg",{key:C,style:{zIndex:C},width:j,height:k,className:"react-flow__edges react-flow__container"},T&&O.createElement(bse,{defaultColor:e,rfId:n}),O.createElement("g",null,M.map(P=>{const[D,$,L]=ST(N.get(P.source)),[I,R,z]=ST(N.get(P.target));if(!L||!z)return null;let V=P.type||"default";a[V]||(E==null||E("011",ai.error011(V)),V="default");const B=a[V]||a.default,W=S===yo.Strict?R.target:(R.target??[]).concat(R.source??[]),K=jT($.source,P.sourceHandle),Q=jT(W,P.targetHandle),ae=(K==null?void 0:K.position)||me.Bottom,pe=(Q==null?void 0:Q.position)||me.Top,ve=!!(P.focusable||y&&typeof P.focusable>"u"),Y=P.reconnectable||P.updatable,ee=typeof h<"u"&&(Y||v&&typeof Y>"u");if(!K||!Q)return E==null||E("008",ai.error008(K,P)),null;const{sourceX:fe,sourceY:H,targetX:je,targetY:ye}=use(D,K,ae,I,Q,pe);return O.createElement(B,{key:P.id,id:P.id,className:gr([P.className,i]),type:V,data:P.data,selected:!!P.selected,animated:!!P.animated,hidden:!!P.hidden,label:P.label,labelStyle:P.labelStyle,labelShowBg:P.labelShowBg,labelBgStyle:P.labelBgStyle,labelBgPadding:P.labelBgPadding,labelBgBorderRadius:P.labelBgBorderRadius,style:P.style,source:P.source,target:P.target,sourceHandleId:P.sourceHandle,targetHandleId:P.targetHandle,markerEnd:P.markerEnd,markerStart:P.markerStart,sourceX:fe,sourceY:H,targetX:je,targetY:ye,sourcePosition:ae,targetPosition:pe,elementsSelectable:w,onContextMenu:s,onMouseEnter:o,onMouseMove:l,onMouseLeave:c,onClick:d,onEdgeDoubleClick:f,onReconnect:h,onReconnectStart:p,onReconnectEnd:g,reconnectRadius:m,rfId:n,ariaLabel:P.ariaLabel,isFocusable:ve,isReconnectable:ee,pathOptions:"pathOptions"in P?P.pathOptions:void 0,interactionWidth:P.interactionWidth,disableKeyboardA11y:x})})))),b):null};O8.displayName="EdgeRenderer";var jse=_.memo(O8);const Sse=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function kse({children:e}){const t=ot(Sse);return O.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function _se(e){const t=vN(),r=_.useRef(!1);_.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const Nse={[me.Left]:me.Right,[me.Right]:me.Left,[me.Top]:me.Bottom,[me.Bottom]:me.Top},M8=({nodeId:e,handleType:t,style:r,type:n=Ii.Bezier,CustomComponent:a,connectionStatus:i})=>{var k,S,N;const{fromNode:s,handleId:o,toX:l,toY:c,connectionMode:d}=ot(_.useCallback(E=>({fromNode:E.nodeInternals.get(e),handleId:E.connectionHandleId,toX:(E.connectionPosition.x-E.transform[0])/E.transform[2],toY:(E.connectionPosition.y-E.transform[1])/E.transform[2],connectionMode:E.connectionMode}),[e]),or),f=(k=s==null?void 0:s[Mt])==null?void 0:k.handleBounds;let h=f==null?void 0:f[t];if(d===yo.Loose&&(h=h||(f==null?void 0:f[t==="source"?"target":"source"])),!s||!h)return null;const p=o?h.find(E=>E.id===o):h[0],g=p?p.x+p.width/2:(s.width??0)/2,m=p?p.y+p.height/2:s.height??0,b=(((S=s.positionAbsolute)==null?void 0:S.x)??0)+g,x=(((N=s.positionAbsolute)==null?void 0:N.y)??0)+m,y=p==null?void 0:p.position,v=y?Nse[y]:null;if(!y||!v)return null;if(a)return O.createElement(a,{connectionLineType:n,connectionLineStyle:r,fromNode:s,fromHandle:p,fromX:b,fromY:x,toX:l,toY:c,fromPosition:y,toPosition:v,connectionStatus:i});let w="";const j={sourceX:b,sourceY:x,sourcePosition:y,targetX:l,targetY:c,targetPosition:v};return n===Ii.Bezier?[w]=r8(j):n===Ii.Step?[w]=$S({...j,borderRadius:0}):n===Ii.SmoothStep?[w]=$S(j):n===Ii.SimpleBezier?[w]=t8(j):w=`M${b},${x} ${l},${c}`,O.createElement("path",{d:w,fill:"none",className:"react-flow__connection-path",style:r})};M8.displayName="ConnectionLine";const Ese=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Pse({containerStyle:e,style:t,type:r,component:n}){const{nodeId:a,handleType:i,nodesConnectable:s,width:o,height:l,connectionStatus:c}=ot(Ese,or);return!(a&&i&&o&&s)?null:O.createElement("svg",{style:e,width:o,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container"},O.createElement("g",{className:gr(["react-flow__connection",c])},O.createElement(M8,{nodeId:a,handleType:i,style:t,type:r,CustomComponent:n,connectionStatus:c})))}function _T(e,t){return _.useRef(null),er(),_.useMemo(()=>t(e),[e])}const R8=({nodeTypes:e,edgeTypes:t,onMove:r,onMoveStart:n,onMoveEnd:a,onInit:i,onNodeClick:s,onEdgeClick:o,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:p,onSelectionContextMenu:g,onSelectionStart:m,onSelectionEnd:b,connectionLineType:x,connectionLineStyle:y,connectionLineComponent:v,connectionLineContainerStyle:w,selectionKeyCode:j,selectionOnDrag:k,selectionMode:S,multiSelectionKeyCode:N,panActivationKeyCode:E,zoomActivationKeyCode:A,deleteKeyCode:C,onlyRenderVisibleElements:M,elementsSelectable:T,selectNodesOnDrag:P,defaultViewport:D,translateExtent:$,minZoom:L,maxZoom:I,preventScrolling:R,defaultMarkerColor:z,zoomOnScroll:V,zoomOnPinch:B,panOnScroll:W,panOnScrollSpeed:K,panOnScrollMode:Q,zoomOnDoubleClick:ae,panOnDrag:pe,onPaneClick:ve,onPaneMouseEnter:Y,onPaneMouseMove:ee,onPaneMouseLeave:fe,onPaneScroll:H,onPaneContextMenu:je,onEdgeContextMenu:ye,onEdgeMouseEnter:se,onEdgeMouseMove:ke,onEdgeMouseLeave:ne,onReconnect:ie,onReconnectStart:qe,onReconnectEnd:rr,reconnectRadius:zt,noDragClassName:lt,noWheelClassName:rt,noPanClassName:ct,elevateEdgesOnSelect:Ft,disableKeyboardA11y:on,nodeOrigin:Dr,nodeExtent:Pt,rfId:Gt})=>{const Dn=_T(e,rse),St=_T(t,cse);return _se(i),O.createElement(ese,{onPaneClick:ve,onPaneMouseEnter:Y,onPaneMouseMove:ee,onPaneMouseLeave:fe,onPaneContextMenu:je,onPaneScroll:H,deleteKeyCode:C,selectionKeyCode:j,selectionOnDrag:k,selectionMode:S,onSelectionStart:m,onSelectionEnd:b,multiSelectionKeyCode:N,panActivationKeyCode:E,zoomActivationKeyCode:A,elementsSelectable:T,onMove:r,onMoveStart:n,onMoveEnd:a,zoomOnScroll:V,zoomOnPinch:B,zoomOnDoubleClick:ae,panOnScroll:W,panOnScrollSpeed:K,panOnScrollMode:Q,panOnDrag:pe,defaultViewport:D,translateExtent:$,minZoom:L,maxZoom:I,onSelectionContextMenu:g,preventScrolling:R,noDragClassName:lt,noWheelClassName:rt,noPanClassName:ct,disableKeyboardA11y:on},O.createElement(kse,null,O.createElement(jse,{edgeTypes:St,onEdgeClick:o,onEdgeDoubleClick:c,onlyRenderVisibleElements:M,onEdgeContextMenu:ye,onEdgeMouseEnter:se,onEdgeMouseMove:ke,onEdgeMouseLeave:ne,onReconnect:ie,onReconnectStart:qe,onReconnectEnd:rr,reconnectRadius:zt,defaultMarkerColor:z,noPanClassName:ct,elevateEdgesOnSelect:!!Ft,disableKeyboardA11y:on,rfId:Gt},O.createElement(Pse,{style:y,type:x,component:v,containerStyle:w})),O.createElement("div",{className:"react-flow__edgelabel-renderer"}),O.createElement(ise,{nodeTypes:Dn,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:p,selectNodesOnDrag:P,onlyRenderVisibleElements:M,noPanClassName:ct,noDragClassName:lt,disableKeyboardA11y:on,nodeOrigin:Dr,nodeExtent:Pt,rfId:Gt})))};R8.displayName="GraphView";var Cse=_.memo(R8);const FS=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ei={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:FS,nodeExtent:FS,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:yo.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:nie,isValidConnection:void 0},Ase=()=>hte((e,t)=>({...Ei,setNodes:r=>{const{nodeInternals:n,nodeOrigin:a,elevateNodesOnSelect:i}=t();e({nodeInternals:Hy(r,n,a,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:r=>{const{defaultEdgeOptions:n={}}=t();e({edges:r.map(a=>({...n,...a}))})},setDefaultNodesAndEdges:(r,n)=>{const a=typeof r<"u",i=typeof n<"u",s=a?Hy(r,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:i?n:[],hasDefaultNodes:a,hasDefaultEdges:i})},updateNodeDimensions:r=>{const{onNodesChange:n,nodeInternals:a,fitViewOnInit:i,fitViewOnInitDone:s,fitViewOnInitOptions:o,domNode:l,nodeOrigin:c}=t(),d=l==null?void 0:l.querySelector(".react-flow__viewport");if(!d)return;const f=window.getComputedStyle(d),{m22:h}=new window.DOMMatrixReadOnly(f.transform),p=r.reduce((m,b)=>{const x=a.get(b.id);if(x!=null&&x.hidden)a.set(x.id,{...x,[Mt]:{...x[Mt],handleBounds:void 0}});else if(x){const y=uN(b.nodeElement);!!(y.width&&y.height&&(x.width!==y.width||x.height!==y.height||b.forceUpdate))&&(a.set(x.id,{...x,[Mt]:{...x[Mt],handleBounds:{source:vT(".source",b.nodeElement,h,c),target:vT(".target",b.nodeElement,h,c)}},...y}),m.push({id:x.id,type:"dimensions",dimensions:y}))}return m},[]);b8(a,c);const g=s||i&&!s&&w8(t,{initial:!0,...o});e({nodeInternals:new Map(a),fitViewOnInitDone:g}),(p==null?void 0:p.length)>0&&(n==null||n(p))},updateNodePositions:(r,n=!0,a=!1)=>{const{triggerNodeChanges:i}=t(),s=r.map(o=>{const l={id:o.id,type:"position",dragging:a};return n&&(l.positionAbsolute=o.positionAbsolute,l.position=o.position),l});i(s)},triggerNodeChanges:r=>{const{onNodesChange:n,nodeInternals:a,hasDefaultNodes:i,nodeOrigin:s,getNodes:o,elevateNodesOnSelect:l}=t();if(r!=null&&r.length){if(i){const c=S8(r,o()),d=Hy(c,a,s,l);e({nodeInternals:d})}n==null||n(r)}},addSelectedNodes:r=>{const{multiSelectionActive:n,edges:a,getNodes:i}=t();let s,o=null;n?s=r.map(l=>Mi(l,!0)):(s=ml(i(),r),o=ml(a,[])),Ph({changedNodes:s,changedEdges:o,get:t,set:e})},addSelectedEdges:r=>{const{multiSelectionActive:n,edges:a,getNodes:i}=t();let s,o=null;n?s=r.map(l=>Mi(l,!0)):(s=ml(a,r),o=ml(i(),[])),Ph({changedNodes:o,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:r,edges:n}={})=>{const{edges:a,getNodes:i}=t(),s=r||i(),o=n||a,l=s.map(d=>(d.selected=!1,Mi(d.id,!1))),c=o.map(d=>Mi(d.id,!1));Ph({changedNodes:l,changedEdges:c,get:t,set:e})},setMinZoom:r=>{const{d3Zoom:n,maxZoom:a}=t();n==null||n.scaleExtent([r,a]),e({minZoom:r})},setMaxZoom:r=>{const{d3Zoom:n,minZoom:a}=t();n==null||n.scaleExtent([a,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(),i=n().filter(o=>o.selected).map(o=>Mi(o.id,!1)),s=r.filter(o=>o.selected).map(o=>Mi(o.id,!1));Ph({changedNodes:i,changedEdges:s,get:t,set:e})},setNodeExtent:r=>{const{nodeInternals:n}=t();n.forEach(a=>{a.positionAbsolute=dN(a.position,r)}),e({nodeExtent:r,nodeInternals:new Map(n)})},panBy:r=>{const{transform:n,width:a,height:i,d3Zoom:s,d3Selection:o,translateExtent:l}=t();if(!s||!o||!r.x&&!r.y)return!1;const c=Ha.translate(n[0]+r.x,n[1]+r.y).scale(n[2]),d=[[0,0],[a,i]],f=s==null?void 0:s.constrain()(c,d,l);return s.transform(o,f),n[0]!==f.x||n[1]!==f.y||n[2]!==f.k},cancelConnection:()=>e({connectionNodeId:Ei.connectionNodeId,connectionHandleId:Ei.connectionHandleId,connectionHandleType:Ei.connectionHandleType,connectionStatus:Ei.connectionStatus,connectionStartHandle:Ei.connectionStartHandle,connectionEndHandle:Ei.connectionEndHandle}),reset:()=>e({...Ei})}),Object.is),$8=({children:e})=>{const t=_.useRef(null);return t.current||(t.current=Ase()),O.createElement(Xae,{value:t.current},e)};$8.displayName="ReactFlowProvider";const D8=({children:e})=>_.useContext(z0)?O.createElement(O.Fragment,null,e):O.createElement($8,null,e);D8.displayName="ReactFlowWrapper";const Tse={input:h8,default:LS,output:m8,group:yN},Ose={default:fm,straight:pN,step:hN,smoothstep:F0,simplebezier:fN},Mse=[0,0],Rse=[15,15],$se={x:0,y:0,zoom:1},Dse={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},I8=_.forwardRef(({nodes:e,edges:t,defaultNodes:r,defaultEdges:n,className:a,nodeTypes:i=Tse,edgeTypes:s=Ose,onNodeClick:o,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:g,onConnectEnd:m,onClickConnectStart:b,onClickConnectEnd:x,onNodeMouseEnter:y,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:j,onNodeDoubleClick:k,onNodeDragStart:S,onNodeDrag:N,onNodeDragStop:E,onNodesDelete:A,onEdgesDelete:C,onSelectionChange:M,onSelectionDragStart:T,onSelectionDrag:P,onSelectionDragStop:D,onSelectionContextMenu:$,onSelectionStart:L,onSelectionEnd:I,connectionMode:R=yo.Strict,connectionLineType:z=Ii.Bezier,connectionLineStyle:V,connectionLineComponent:B,connectionLineContainerStyle:W,deleteKeyCode:K="Backspace",selectionKeyCode:Q="Shift",selectionOnDrag:ae=!1,selectionMode:pe=Ld.Full,panActivationKeyCode:ve="Space",multiSelectionKeyCode:Y=dm()?"Meta":"Control",zoomActivationKeyCode:ee=dm()?"Meta":"Control",snapToGrid:fe=!1,snapGrid:H=Rse,onlyRenderVisibleElements:je=!1,selectNodesOnDrag:ye=!0,nodesDraggable:se,nodesConnectable:ke,nodesFocusable:ne,nodeOrigin:ie=Mse,edgesFocusable:qe,edgesUpdatable:rr,elementsSelectable:zt,defaultViewport:lt=$se,minZoom:rt=.5,maxZoom:ct=2,translateExtent:Ft=FS,preventScrolling:on=!0,nodeExtent:Dr,defaultMarkerColor:Pt="#b1b1b7",zoomOnScroll:Gt=!0,zoomOnPinch:Dn=!0,panOnScroll:St=!1,panOnScrollSpeed:yr=.5,panOnScrollMode:ut=Hs.Free,zoomOnDoubleClick:nr=!0,panOnDrag:la=!0,onPaneClick:ln,onPaneMouseEnter:cn,onPaneMouseMove:yi,onPaneMouseLeave:vi,onPaneScroll:xi,onPaneContextMenu:ks,children:Ro,onEdgeContextMenu:_a,onEdgeDoubleClick:Wf,onEdgeMouseEnter:Vg,onEdgeMouseMove:Gf,onEdgeMouseLeave:$o,onEdgeUpdate:Do,onEdgeUpdateStart:qg,onEdgeUpdateEnd:Ug,onReconnect:F,onReconnectStart:q,onReconnectEnd:U,reconnectRadius:X=10,edgeUpdaterRadius:re=10,onNodesChange:ge,onEdgesChange:be,noDragClassName:ue="nodrag",noWheelClassName:de="nowheel",noPanClassName:oe="nopan",fitView:he=!1,fitViewOptions:Ee,connectOnClick:De=!0,attributionPosition:Kt,proOptions:Je,defaultEdgeOptions:Be,elevateNodesOnSelect:mt=!0,elevateEdgesOnSelect:bi=!1,disableKeyboardA11y:wi=!1,autoPanOnConnect:In=!0,autoPanOnNodeDrag:un=!0,connectionRadius:Uc=20,isValidConnection:_s,onError:Na,style:Io,id:Ns,nodeDragThreshold:Le,...gt},ji)=>{const Ea=Ns||"1";return O.createElement("div",{...gt,style:{...Io,...Dse},ref:ji,className:gr(["react-flow",a]),"data-testid":"rf__wrapper",id:Ns},O.createElement(D8,null,O.createElement(Cse,{onInit:c,onMove:d,onMoveStart:f,onMoveEnd:h,onNodeClick:o,onEdgeClick:l,onNodeMouseEnter:y,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:j,onNodeDoubleClick:k,nodeTypes:i,edgeTypes:s,connectionLineType:z,connectionLineStyle:V,connectionLineComponent:B,connectionLineContainerStyle:W,selectionKeyCode:Q,selectionOnDrag:ae,selectionMode:pe,deleteKeyCode:K,multiSelectionKeyCode:Y,panActivationKeyCode:ve,zoomActivationKeyCode:ee,onlyRenderVisibleElements:je,selectNodesOnDrag:ye,defaultViewport:lt,translateExtent:Ft,minZoom:rt,maxZoom:ct,preventScrolling:on,zoomOnScroll:Gt,zoomOnPinch:Dn,zoomOnDoubleClick:nr,panOnScroll:St,panOnScrollSpeed:yr,panOnScrollMode:ut,panOnDrag:la,onPaneClick:ln,onPaneMouseEnter:cn,onPaneMouseMove:yi,onPaneMouseLeave:vi,onPaneScroll:xi,onPaneContextMenu:ks,onSelectionContextMenu:$,onSelectionStart:L,onSelectionEnd:I,onEdgeContextMenu:_a,onEdgeDoubleClick:Wf,onEdgeMouseEnter:Vg,onEdgeMouseMove:Gf,onEdgeMouseLeave:$o,onReconnect:F??Do,onReconnectStart:q??qg,onReconnectEnd:U??Ug,reconnectRadius:X??re,defaultMarkerColor:Pt,noDragClassName:ue,noWheelClassName:de,noPanClassName:oe,elevateEdgesOnSelect:bi,rfId:Ea,disableKeyboardA11y:wi,nodeOrigin:ie,nodeExtent:Dr}),O.createElement(Nie,{nodes:e,edges:t,defaultNodes:r,defaultEdges:n,onConnect:p,onConnectStart:g,onConnectEnd:m,onClickConnectStart:b,onClickConnectEnd:x,nodesDraggable:se,nodesConnectable:ke,nodesFocusable:ne,edgesFocusable:qe,edgesUpdatable:rr,elementsSelectable:zt,elevateNodesOnSelect:mt,minZoom:rt,maxZoom:ct,nodeExtent:Dr,onNodesChange:ge,onEdgesChange:be,snapToGrid:fe,snapGrid:H,connectionMode:R,translateExtent:Ft,connectOnClick:De,defaultEdgeOptions:Be,fitView:he,fitViewOptions:Ee,onNodesDelete:A,onEdgesDelete:C,onNodeDragStart:S,onNodeDrag:N,onNodeDragStop:E,onSelectionDrag:P,onSelectionDragStart:T,onSelectionDragStop:D,noPanClassName:oe,nodeOrigin:ie,rfId:Ea,autoPanOnConnect:In,autoPanOnNodeDrag:un,onError:Na,connectionRadius:Uc,isValidConnection:_s,nodeDragThreshold:Le}),O.createElement(kie,{onSelectionChange:M}),Ro,O.createElement(Qae,{proOptions:Je,position:Kt}),O.createElement(Tie,{rfId:Ea,disableKeyboardA11y:wi})))});I8.displayName="ReactFlow";function L8(e){return t=>{const[r,n]=_.useState(t),a=_.useCallback(i=>n(s=>e(i,s)),[]);return[r,n,a]}}const Ise=L8(S8),Lse=L8(Hie),z8=({id:e,x:t,y:r,width:n,height:a,style:i,color:s,strokeColor:o,strokeWidth:l,className:c,borderRadius:d,shapeRendering:f,onClick:h,selected:p})=>{const{background:g,backgroundColor:m}=i||{},b=s||g||m;return O.createElement("rect",{className:gr(["react-flow__minimap-node",{selected:p},c]),x:t,y:r,rx:d,ry:d,width:n,height:a,fill:b,stroke:o,strokeWidth:l,shapeRendering:f,onClick:h?x=>h(x,e):void 0})};z8.displayName="MiniMapNode";var zse=_.memo(z8);const Fse=e=>e.nodeOrigin,Bse=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),Yy=e=>e instanceof Function?e:()=>e;function Vse({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:r="",nodeBorderRadius:n=5,nodeStrokeWidth:a=2,nodeComponent:i=zse,onClick:s}){const o=ot(Bse,or),l=ot(Fse),c=Yy(t),d=Yy(e),f=Yy(r),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return O.createElement(O.Fragment,null,o.map(p=>{const{x:g,y:m}=to(p,l).positionAbsolute;return O.createElement(i,{key:p.id,x:g,y:m,width:p.width,height:p.height,style:p.style,selected:p.selected,className:f(p),color:c(p),borderRadius:n,strokeColor:d(p),strokeWidth:a,shapeRendering:h,onClick:s,id:p.id})}))}var qse=_.memo(Vse);const Use=200,Hse=150,Wse=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?tie(B0(t,e.nodeOrigin),r):r,rfId:e.rfId}},Gse="react-flow__minimap-desc";function F8({style:e,className:t,nodeStrokeColor:r="transparent",nodeColor:n="#e2e2e2",nodeClassName:a="",nodeBorderRadius:i=5,nodeStrokeWidth:s=2,nodeComponent:o,maskColor:l="rgb(240, 240, 240, 0.6)",maskStrokeColor:c="none",maskStrokeWidth:d=1,position:f="bottom-right",onClick:h,onNodeClick:p,pannable:g=!1,zoomable:m=!1,ariaLabel:b="React Flow mini map",inversePan:x=!1,zoomStep:y=10,offsetScale:v=5}){const w=er(),j=_.useRef(null),{boundingRect:k,viewBB:S,rfId:N}=ot(Wse,or),E=(e==null?void 0:e.width)??Use,A=(e==null?void 0:e.height)??Hse,C=k.width/E,M=k.height/A,T=Math.max(C,M),P=T*E,D=T*A,$=v*T,L=k.x-(P-k.width)/2-$,I=k.y-(D-k.height)/2-$,R=P+$*2,z=D+$*2,V=`${Gse}-${N}`,B=_.useRef(0);B.current=T,_.useEffect(()=>{if(j.current){const Q=vn(j.current),ae=Y=>{const{transform:ee,d3Selection:fe,d3Zoom:H}=w.getState();if(Y.sourceEvent.type!=="wheel"||!fe||!H)return;const je=-Y.sourceEvent.deltaY*(Y.sourceEvent.deltaMode===1?.05:Y.sourceEvent.deltaMode?1:.002)*y,ye=ee[2]*Math.pow(2,je);H.scaleTo(fe,ye)},pe=Y=>{const{transform:ee,d3Selection:fe,d3Zoom:H,translateExtent:je,width:ye,height:se}=w.getState();if(Y.sourceEvent.type!=="mousemove"||!fe||!H)return;const ke=B.current*Math.max(1,ee[2])*(x?-1:1),ne={x:ee[0]-Y.sourceEvent.movementX*ke,y:ee[1]-Y.sourceEvent.movementY*ke},ie=[[0,0],[ye,se]],qe=Ha.translate(ne.x,ne.y).scale(ee[2]),rr=H.constrain()(qe,ie,je);H.transform(fe,rr)},ve=HF().on("zoom",g?pe:null).on("zoom.wheel",m?ae:null);return Q.call(ve),()=>{Q.on("zoom",null)}}},[g,m,x,y]);const W=h?Q=>{const ae=Un(Q);h(Q,{x:ae[0],y:ae[1]})}:void 0,K=p?(Q,ae)=>{const pe=w.getState().nodeInternals.get(ae);p(Q,pe)}:void 0;return O.createElement(cN,{position:f,style:e,className:gr(["react-flow__minimap",t]),"data-testid":"rf__minimap"},O.createElement("svg",{width:E,height:A,viewBox:`${L} ${I} ${R} ${z}`,role:"img","aria-labelledby":V,ref:j,onClick:W},b&&O.createElement("title",{id:V},b),O.createElement(qse,{onClick:K,nodeColor:n,nodeStrokeColor:r,nodeBorderRadius:i,nodeClassName:a,nodeStrokeWidth:s,nodeComponent:o}),O.createElement("path",{className:"react-flow__minimap-mask",d:`M${L-$},${I-$}h${R+$*2}v${z+$*2}h${-R-$*2}z
504
- M${S.x},${S.y}h${S.width}v${S.height}h${-S.width}z`,fill:l,fillRule:"evenodd",stroke:c,strokeWidth:d,pointerEvents:"none"})))}F8.displayName="MiniMap";var Kse=_.memo(F8);function Yse(){return O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},O.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function Xse(){return O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},O.createElement("path",{d:"M0 0h32v4.2H0z"}))}function Zse(){return O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},O.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 Qse(){return O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},O.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 Jse(){return O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},O.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 Ou=({children:e,className:t,...r})=>O.createElement("button",{type:"button",className:gr(["react-flow__controls-button",t]),...r},e);Ou.displayName="ControlButton";const eoe=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),B8=({style:e,showZoom:t=!0,showFitView:r=!0,showInteractive:n=!0,fitViewOptions:a,onZoomIn:i,onZoomOut:s,onFitView:o,onInteractiveChange:l,className:c,children:d,position:f="bottom-left"})=>{const h=er(),[p,g]=_.useState(!1),{isInteractive:m,minZoomReached:b,maxZoomReached:x}=ot(eoe,or),{zoomIn:y,zoomOut:v,fitView:w}=vN();if(_.useEffect(()=>{g(!0)},[]),!p)return null;const j=()=>{y(),i==null||i()},k=()=>{v(),s==null||s()},S=()=>{w(a),o==null||o()},N=()=>{h.setState({nodesDraggable:!m,nodesConnectable:!m,elementsSelectable:!m}),l==null||l(!m)};return O.createElement(cN,{className:gr(["react-flow__controls",c]),position:f,style:e,"data-testid":"rf__controls"},t&&O.createElement(O.Fragment,null,O.createElement(Ou,{onClick:j,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:x},O.createElement(Yse,null)),O.createElement(Ou,{onClick:k,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:b},O.createElement(Xse,null))),r&&O.createElement(Ou,{className:"react-flow__controls-fitview",onClick:S,title:"fit view","aria-label":"fit view"},O.createElement(Zse,null)),n&&O.createElement(Ou,{className:"react-flow__controls-interactive",onClick:N,title:"toggle interactivity","aria-label":"toggle interactivity"},m?O.createElement(Jse,null):O.createElement(Qse,null)),d)};B8.displayName="Controls";var toe=_.memo(B8),ta;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ta||(ta={}));function roe({color:e,dimensions:t,lineWidth:r}){return O.createElement("path",{stroke:e,strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function noe({color:e,radius:t}){return O.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const aoe={[ta.Dots]:"#91919a",[ta.Lines]:"#eee",[ta.Cross]:"#e2e2e2"},ioe={[ta.Dots]:1,[ta.Lines]:1,[ta.Cross]:6},soe=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function V8({id:e,variant:t=ta.Dots,gap:r=20,size:n,lineWidth:a=1,offset:i=2,color:s,style:o,className:l}){const c=_.useRef(null),{transform:d,patternId:f}=ot(soe,or),h=s||aoe[t],p=n||ioe[t],g=t===ta.Dots,m=t===ta.Cross,b=Array.isArray(r)?r:[r,r],x=[b[0]*d[2]||1,b[1]*d[2]||1],y=p*d[2],v=m?[y,y]:x,w=g?[y/i,y/i]:[v[0]/i,v[1]/i];return O.createElement("svg",{className:gr(["react-flow__background",l]),style:{...o,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background"},O.createElement("pattern",{id:f+e,x:d[0]%x[0],y:d[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${w[0]},-${w[1]})`},g?O.createElement(noe,{color:h,radius:y/i}):O.createElement(roe,{dimensions:v,color:h,lineWidth:a})),O.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}V8.displayName="Background";var ooe=_.memo(V8);function bN(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xy,NT;function loe(){if(NT)return Xy;NT=1;function e(){this.__data__=[],this.size=0}return Xy=e,Xy}var Zy,ET;function Tc(){if(ET)return Zy;ET=1;function e(t,r){return t===r||t!==t&&r!==r}return Zy=e,Zy}var Qy,PT;function V0(){if(PT)return Qy;PT=1;var e=Tc();function t(r,n){for(var a=r.length;a--;)if(e(r[a][0],n))return a;return-1}return Qy=t,Qy}var Jy,CT;function coe(){if(CT)return Jy;CT=1;var e=V0(),t=Array.prototype,r=t.splice;function n(a){var i=this.__data__,s=e(i,a);if(s<0)return!1;var o=i.length-1;return s==o?i.pop():r.call(i,s,1),--this.size,!0}return Jy=n,Jy}var ev,AT;function uoe(){if(AT)return ev;AT=1;var e=V0();function t(r){var n=this.__data__,a=e(n,r);return a<0?void 0:n[a][1]}return ev=t,ev}var tv,TT;function doe(){if(TT)return tv;TT=1;var e=V0();function t(r){return e(this.__data__,r)>-1}return tv=t,tv}var rv,OT;function foe(){if(OT)return rv;OT=1;var e=V0();function t(r,n){var a=this.__data__,i=e(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return rv=t,rv}var nv,MT;function q0(){if(MT)return nv;MT=1;var e=loe(),t=coe(),r=uoe(),n=doe(),a=foe();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var c=s[o];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,nv=i,nv}var av,RT;function hoe(){if(RT)return av;RT=1;var e=q0();function t(){this.__data__=new e,this.size=0}return av=t,av}var iv,$T;function poe(){if($T)return iv;$T=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return iv=e,iv}var sv,DT;function moe(){if(DT)return sv;DT=1;function e(t){return this.__data__.get(t)}return sv=e,sv}var ov,IT;function goe(){if(IT)return ov;IT=1;function e(t){return this.__data__.has(t)}return ov=e,ov}var lv,LT;function q8(){if(LT)return lv;LT=1;var e=typeof Kf=="object"&&Kf&&Kf.Object===Object&&Kf;return lv=e,lv}var cv,zT;function ia(){if(zT)return cv;zT=1;var e=q8(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return cv=r,cv}var yoe=ia(),voe=yoe.Symbol,Oc=voe,FT=Oc,U8=Object.prototype,xoe=U8.hasOwnProperty,boe=U8.toString,fu=FT?FT.toStringTag:void 0;function woe(e){var t=xoe.call(e,fu),r=e[fu];try{e[fu]=void 0;var n=!0}catch{}var a=boe.call(e);return n&&(t?e[fu]=r:delete e[fu]),a}var joe=woe,Soe=Object.prototype,koe=Soe.toString;function _oe(e){return koe.call(e)}var Noe=_oe,BT=Oc,Eoe=joe,Poe=Noe,Coe="[object Null]",Aoe="[object Undefined]",VT=BT?BT.toStringTag:void 0;function Toe(e){return e==null?e===void 0?Aoe:Coe:VT&&VT in Object(e)?Eoe(e):Poe(e)}var pi=Toe,uv,qT;function $r(){if(qT)return uv;qT=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return uv=e,uv}var dv,UT;function Mc(){if(UT)return dv;UT=1;var e=pi,t=$r(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function s(o){if(!t(o))return!1;var l=e(o);return l==n||l==a||l==r||l==i}return dv=s,dv}var fv,HT;function Ooe(){if(HT)return fv;HT=1;var e=ia(),t=e["__core-js_shared__"];return fv=t,fv}var hv,WT;function Moe(){if(WT)return hv;WT=1;var e=Ooe(),t=function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!t&&t in n}return hv=r,hv}var pv,GT;function H8(){if(GT)return pv;GT=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return pv=r,pv}var mv,KT;function Roe(){if(KT)return mv;KT=1;var e=Mc(),t=Moe(),r=$r(),n=H8(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,l=s.toString,c=o.hasOwnProperty,d=RegExp("^"+l.call(c).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(h){if(!r(h)||t(h))return!1;var p=e(h)?d:i;return p.test(n(h))}return mv=f,mv}var gv,YT;function $oe(){if(YT)return gv;YT=1;function e(t,r){return t==null?void 0:t[r]}return gv=e,gv}var yv,XT;function Eo(){if(XT)return yv;XT=1;var e=Roe(),t=$oe();function r(n,a){var i=t(n,a);return e(i)?i:void 0}return yv=r,yv}var vv,ZT;function wN(){if(ZT)return vv;ZT=1;var e=Eo(),t=ia(),r=e(t,"Map");return vv=r,vv}var xv,QT;function U0(){if(QT)return xv;QT=1;var e=Eo(),t=e(Object,"create");return xv=t,xv}var bv,JT;function Doe(){if(JT)return bv;JT=1;var e=U0();function t(){this.__data__=e?e(null):{},this.size=0}return bv=t,bv}var wv,eO;function Ioe(){if(eO)return wv;eO=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return wv=e,wv}var jv,tO;function Loe(){if(tO)return jv;tO=1;var e=U0(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(i){var s=this.__data__;if(e){var o=s[i];return o===t?void 0:o}return n.call(s,i)?s[i]:void 0}return jv=a,jv}var Sv,rO;function zoe(){if(rO)return Sv;rO=1;var e=U0(),t=Object.prototype,r=t.hasOwnProperty;function n(a){var i=this.__data__;return e?i[a]!==void 0:r.call(i,a)}return Sv=n,Sv}var kv,nO;function Foe(){if(nO)return kv;nO=1;var e=U0(),t="__lodash_hash_undefined__";function r(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=e&&a===void 0?t:a,this}return kv=r,kv}var _v,aO;function Boe(){if(aO)return _v;aO=1;var e=Doe(),t=Ioe(),r=Loe(),n=zoe(),a=Foe();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var c=s[o];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,_v=i,_v}var Nv,iO;function Voe(){if(iO)return Nv;iO=1;var e=Boe(),t=q0(),r=wN();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return Nv=n,Nv}var Ev,sO;function qoe(){if(sO)return Ev;sO=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return Ev=e,Ev}var Pv,oO;function H0(){if(oO)return Pv;oO=1;var e=qoe();function t(r,n){var a=r.__data__;return e(n)?a[typeof n=="string"?"string":"hash"]:a.map}return Pv=t,Pv}var Cv,lO;function Uoe(){if(lO)return Cv;lO=1;var e=H0();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return Cv=t,Cv}var Av,cO;function Hoe(){if(cO)return Av;cO=1;var e=H0();function t(r){return e(this,r).get(r)}return Av=t,Av}var Tv,uO;function Woe(){if(uO)return Tv;uO=1;var e=H0();function t(r){return e(this,r).has(r)}return Tv=t,Tv}var Ov,dO;function Goe(){if(dO)return Ov;dO=1;var e=H0();function t(r,n){var a=e(this,r),i=a.size;return a.set(r,n),this.size+=a.size==i?0:1,this}return Ov=t,Ov}var Mv,fO;function jN(){if(fO)return Mv;fO=1;var e=Voe(),t=Uoe(),r=Hoe(),n=Woe(),a=Goe();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var c=s[o];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Mv=i,Mv}var Rv,hO;function Koe(){if(hO)return Rv;hO=1;var e=q0(),t=wN(),r=jN(),n=200;function a(i,s){var o=this.__data__;if(o instanceof e){var l=o.__data__;if(!t||l.length<n-1)return l.push([i,s]),this.size=++o.size,this;o=this.__data__=new r(l)}return o.set(i,s),this.size=o.size,this}return Rv=a,Rv}var $v,pO;function W0(){if(pO)return $v;pO=1;var e=q0(),t=hoe(),r=poe(),n=moe(),a=goe(),i=Koe();function s(o){var l=this.__data__=new e(o);this.size=l.size}return s.prototype.clear=t,s.prototype.delete=r,s.prototype.get=n,s.prototype.has=a,s.prototype.set=i,$v=s,$v}var Dv,mO;function SN(){if(mO)return Dv;mO=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n<a&&r(t[n],n,t)!==!1;);return t}return Dv=e,Dv}var Iv,gO;function W8(){if(gO)return Iv;gO=1;var e=Eo(),t=function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}}();return Iv=t,Iv}var Lv,yO;function G0(){if(yO)return Lv;yO=1;var e=W8();function t(r,n,a){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return Lv=t,Lv}var zv,vO;function K0(){if(vO)return zv;vO=1;var e=G0(),t=Tc(),r=Object.prototype,n=r.hasOwnProperty;function a(i,s,o){var l=i[s];(!(n.call(i,s)&&t(l,o))||o===void 0&&!(s in i))&&e(i,s,o)}return zv=a,zv}var Yoe=K0(),Xoe=G0();function Zoe(e,t,r,n){var a=!r;r||(r={});for(var i=-1,s=t.length;++i<s;){var o=t[i],l=n?n(r[o],e[o],o,r,e):void 0;l===void 0&&(l=e[o]),a?Xoe(r,o,l):Yoe(r,o,l)}return r}var Mf=Zoe,Fv,xO;function Qoe(){if(xO)return Fv;xO=1;function e(t,r){for(var n=-1,a=Array(t);++n<t;)a[n]=r(n);return a}return Fv=e,Fv}function Joe(e){return e!=null&&typeof e=="object"}var Tn=Joe,Bv,bO;function ele(){if(bO)return Bv;bO=1;var e=pi,t=Tn,r="[object Arguments]";function n(a){return t(a)&&e(a)==r}return Bv=n,Bv}var Vv,wO;function Rf(){if(wO)return Vv;wO=1;var e=ele(),t=Tn,r=Object.prototype,n=r.hasOwnProperty,a=r.propertyIsEnumerable,i=e(function(){return arguments}())?e:function(s){return t(s)&&n.call(s,"callee")&&!a.call(s,"callee")};return Vv=i,Vv}var qv,jO;function Rt(){if(jO)return qv;jO=1;var e=Array.isArray;return qv=e,qv}var Mu={exports:{}},Uv,SO;function tle(){if(SO)return Uv;SO=1;function e(){return!1}return Uv=e,Uv}Mu.exports;var kO;function Rc(){return kO||(kO=1,function(e,t){var r=ia(),n=tle(),a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===a,o=s?r.Buffer:void 0,l=o?o.isBuffer:void 0,c=l||n;e.exports=c}(Mu,Mu.exports)),Mu.exports}var Hv,_O;function Y0(){if(_O)return Hv;_O=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(n,a){var i=typeof n;return a=a??e,!!a&&(i=="number"||i!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<a}return Hv=r,Hv}var Wv,NO;function kN(){if(NO)return Wv;NO=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return Wv=t,Wv}var Gv,EO;function rle(){if(EO)return Gv;EO=1;var e=pi,t=kN(),r=Tn,n="[object Arguments]",a="[object Array]",i="[object Boolean]",s="[object Date]",o="[object Error]",l="[object Function]",c="[object Map]",d="[object Number]",f="[object Object]",h="[object RegExp]",p="[object Set]",g="[object String]",m="[object WeakMap]",b="[object ArrayBuffer]",x="[object DataView]",y="[object Float32Array]",v="[object Float64Array]",w="[object Int8Array]",j="[object Int16Array]",k="[object Int32Array]",S="[object Uint8Array]",N="[object Uint8ClampedArray]",E="[object Uint16Array]",A="[object Uint32Array]",C={};C[y]=C[v]=C[w]=C[j]=C[k]=C[S]=C[N]=C[E]=C[A]=!0,C[n]=C[a]=C[b]=C[i]=C[x]=C[s]=C[o]=C[l]=C[c]=C[d]=C[f]=C[h]=C[p]=C[g]=C[m]=!1;function M(T){return r(T)&&t(T.length)&&!!C[e(T)]}return Gv=M,Gv}var Kv,PO;function X0(){if(PO)return Kv;PO=1;function e(t){return function(r){return t(r)}}return Kv=e,Kv}var Ru={exports:{}};Ru.exports;var CO;function _N(){return CO||(CO=1,function(e,t){var r=q8(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i&&r.process,o=function(){try{var l=a&&a.require&&a.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();e.exports=o}(Ru,Ru.exports)),Ru.exports}var Yv,AO;function $f(){if(AO)return Yv;AO=1;var e=rle(),t=X0(),r=_N(),n=r&&r.isTypedArray,a=n?t(n):e;return Yv=a,Yv}var Xv,TO;function G8(){if(TO)return Xv;TO=1;var e=Qoe(),t=Rf(),r=Rt(),n=Rc(),a=Y0(),i=$f(),s=Object.prototype,o=s.hasOwnProperty;function l(c,d){var f=r(c),h=!f&&t(c),p=!f&&!h&&n(c),g=!f&&!h&&!p&&i(c),m=f||h||p||g,b=m?e(c.length,String):[],x=b.length;for(var y in c)(d||o.call(c,y))&&!(m&&(y=="length"||p&&(y=="offset"||y=="parent")||g&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||a(y,x)))&&b.push(y);return b}return Xv=l,Xv}var Zv,OO;function Z0(){if(OO)return Zv;OO=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||e;return r===a}return Zv=t,Zv}var Qv,MO;function K8(){if(MO)return Qv;MO=1;function e(t,r){return function(n){return t(r(n))}}return Qv=e,Qv}var Jv,RO;function nle(){if(RO)return Jv;RO=1;var e=K8(),t=e(Object.keys,Object);return Jv=t,Jv}var ex,$O;function NN(){if($O)return ex;$O=1;var e=Z0(),t=nle(),r=Object.prototype,n=r.hasOwnProperty;function a(i){if(!e(i))return t(i);var s=[];for(var o in Object(i))n.call(i,o)&&o!="constructor"&&s.push(o);return s}return ex=a,ex}var tx,DO;function mi(){if(DO)return tx;DO=1;var e=Mc(),t=kN();function r(n){return n!=null&&t(n.length)&&!e(n)}return tx=r,tx}var rx,IO;function bs(){if(IO)return rx;IO=1;var e=G8(),t=NN(),r=mi();function n(a){return r(a)?e(a):t(a)}return rx=n,rx}var nx,LO;function ale(){if(LO)return nx;LO=1;var e=Mf,t=bs();function r(n,a){return n&&e(a,t(a),n)}return nx=r,nx}var ax,zO;function ile(){if(zO)return ax;zO=1;function e(t){var r=[];if(t!=null)for(var n in Object(t))r.push(n);return r}return ax=e,ax}var ix,FO;function sle(){if(FO)return ix;FO=1;var e=$r(),t=Z0(),r=ile(),n=Object.prototype,a=n.hasOwnProperty;function i(s){if(!e(s))return r(s);var o=t(s),l=[];for(var c in s)c=="constructor"&&(o||!a.call(s,c))||l.push(c);return l}return ix=i,ix}var sx,BO;function Po(){if(BO)return sx;BO=1;var e=G8(),t=sle(),r=mi();function n(a){return r(a)?e(a,!0):t(a)}return sx=n,sx}var ox,VO;function ole(){if(VO)return ox;VO=1;var e=Mf,t=Po();function r(n,a){return n&&e(a,t(a),n)}return ox=r,ox}var $u={exports:{}};$u.exports;var qO;function Y8(){return qO||(qO=1,function(e,t){var r=ia(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i?r.Buffer:void 0,o=s?s.allocUnsafe:void 0;function l(c,d){if(d)return c.slice();var f=c.length,h=o?o(f):new c.constructor(f);return c.copy(h),h}e.exports=l}($u,$u.exports)),$u.exports}var lx,UO;function X8(){if(UO)return lx;UO=1;function e(t,r){var n=-1,a=t.length;for(r||(r=Array(a));++n<a;)r[n]=t[n];return r}return lx=e,lx}var cx,HO;function Z8(){if(HO)return cx;HO=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,i=0,s=[];++n<a;){var o=t[n];r(o,n,t)&&(s[i++]=o)}return s}return cx=e,cx}var ux,WO;function Q8(){if(WO)return ux;WO=1;function e(){return[]}return ux=e,ux}var dx,GO;function EN(){if(GO)return dx;GO=1;var e=Z8(),t=Q8(),r=Object.prototype,n=r.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(s){return s==null?[]:(s=Object(s),e(a(s),function(o){return n.call(s,o)}))}:t;return dx=i,dx}var fx,KO;function lle(){if(KO)return fx;KO=1;var e=Mf,t=EN();function r(n,a){return e(n,t(n),a)}return fx=r,fx}var hx,YO;function PN(){if(YO)return hx;YO=1;function e(t,r){for(var n=-1,a=r.length,i=t.length;++n<a;)t[i+n]=r[n];return t}return hx=e,hx}var px,XO;function Q0(){if(XO)return px;XO=1;var e=K8(),t=e(Object.getPrototypeOf,Object);return px=t,px}var mx,ZO;function J8(){if(ZO)return mx;ZO=1;var e=PN(),t=Q0(),r=EN(),n=Q8(),a=Object.getOwnPropertySymbols,i=a?function(s){for(var o=[];s;)e(o,r(s)),s=t(s);return o}:n;return mx=i,mx}var gx,QO;function cle(){if(QO)return gx;QO=1;var e=Mf,t=J8();function r(n,a){return e(n,t(n),a)}return gx=r,gx}var yx,JO;function eB(){if(JO)return yx;JO=1;var e=PN(),t=Rt();function r(n,a,i){var s=a(n);return t(n)?s:e(s,i(n))}return yx=r,yx}var vx,eM;function tB(){if(eM)return vx;eM=1;var e=eB(),t=EN(),r=bs();function n(a){return e(a,r,t)}return vx=n,vx}var xx,tM;function ule(){if(tM)return xx;tM=1;var e=eB(),t=J8(),r=Po();function n(a){return e(a,r,t)}return xx=n,xx}var bx,rM;function dle(){if(rM)return bx;rM=1;var e=Eo(),t=ia(),r=e(t,"DataView");return bx=r,bx}var wx,nM;function fle(){if(nM)return wx;nM=1;var e=Eo(),t=ia(),r=e(t,"Promise");return wx=r,wx}var jx,aM;function rB(){if(aM)return jx;aM=1;var e=Eo(),t=ia(),r=e(t,"Set");return jx=r,jx}var Sx,iM;function hle(){if(iM)return Sx;iM=1;var e=Eo(),t=ia(),r=e(t,"WeakMap");return Sx=r,Sx}var kx,sM;function $c(){if(sM)return kx;sM=1;var e=dle(),t=wN(),r=fle(),n=rB(),a=hle(),i=pi,s=H8(),o="[object Map]",l="[object Object]",c="[object Promise]",d="[object Set]",f="[object WeakMap]",h="[object DataView]",p=s(e),g=s(t),m=s(r),b=s(n),x=s(a),y=i;return(e&&y(new e(new ArrayBuffer(1)))!=h||t&&y(new t)!=o||r&&y(r.resolve())!=c||n&&y(new n)!=d||a&&y(new a)!=f)&&(y=function(v){var w=i(v),j=w==l?v.constructor:void 0,k=j?s(j):"";if(k)switch(k){case p:return h;case g:return o;case m:return c;case b:return d;case x:return f}return w}),kx=y,kx}var _x,oM;function ple(){if(oM)return _x;oM=1;var e=Object.prototype,t=e.hasOwnProperty;function r(n){var a=n.length,i=new n.constructor(a);return a&&typeof n[0]=="string"&&t.call(n,"index")&&(i.index=n.index,i.input=n.input),i}return _x=r,_x}var Nx,lM;function nB(){if(lM)return Nx;lM=1;var e=ia(),t=e.Uint8Array;return Nx=t,Nx}var Ex,cM;function CN(){if(cM)return Ex;cM=1;var e=nB();function t(r){var n=new r.constructor(r.byteLength);return new e(n).set(new e(r)),n}return Ex=t,Ex}var Px,uM;function mle(){if(uM)return Px;uM=1;var e=CN();function t(r,n){var a=n?e(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}return Px=t,Px}var Cx,dM;function gle(){if(dM)return Cx;dM=1;var e=/\w*$/;function t(r){var n=new r.constructor(r.source,e.exec(r));return n.lastIndex=r.lastIndex,n}return Cx=t,Cx}var Ax,fM;function yle(){if(fM)return Ax;fM=1;var e=Oc,t=e?e.prototype:void 0,r=t?t.valueOf:void 0;function n(a){return r?Object(r.call(a)):{}}return Ax=n,Ax}var Tx,hM;function aB(){if(hM)return Tx;hM=1;var e=CN();function t(r,n){var a=n?e(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}return Tx=t,Tx}var Ox,pM;function vle(){if(pM)return Ox;pM=1;var e=CN(),t=mle(),r=gle(),n=yle(),a=aB(),i="[object Boolean]",s="[object Date]",o="[object Map]",l="[object Number]",c="[object RegExp]",d="[object Set]",f="[object String]",h="[object Symbol]",p="[object ArrayBuffer]",g="[object DataView]",m="[object Float32Array]",b="[object Float64Array]",x="[object Int8Array]",y="[object Int16Array]",v="[object Int32Array]",w="[object Uint8Array]",j="[object Uint8ClampedArray]",k="[object Uint16Array]",S="[object Uint32Array]";function N(E,A,C){var M=E.constructor;switch(A){case p:return e(E);case i:case s:return new M(+E);case g:return t(E,C);case m:case b:case x:case y:case v:case w:case j:case k:case S:return a(E,C);case o:return new M;case l:case f:return new M(E);case c:return r(E);case d:return new M;case h:return n(E)}}return Ox=N,Ox}var Mx,mM;function iB(){if(mM)return Mx;mM=1;var e=$r(),t=Object.create,r=function(){function n(){}return function(a){if(!e(a))return{};if(t)return t(a);n.prototype=a;var i=new n;return n.prototype=void 0,i}}();return Mx=r,Mx}var Rx,gM;function sB(){if(gM)return Rx;gM=1;var e=iB(),t=Q0(),r=Z0();function n(a){return typeof a.constructor=="function"&&!r(a)?e(t(a)):{}}return Rx=n,Rx}var $x,yM;function xle(){if(yM)return $x;yM=1;var e=$c(),t=Tn,r="[object Map]";function n(a){return t(a)&&e(a)==r}return $x=n,$x}var Dx,vM;function ble(){if(vM)return Dx;vM=1;var e=xle(),t=X0(),r=_N(),n=r&&r.isMap,a=n?t(n):e;return Dx=a,Dx}var Ix,xM;function wle(){if(xM)return Ix;xM=1;var e=$c(),t=Tn,r="[object Set]";function n(a){return t(a)&&e(a)==r}return Ix=n,Ix}var Lx,bM;function jle(){if(bM)return Lx;bM=1;var e=wle(),t=X0(),r=_N(),n=r&&r.isSet,a=n?t(n):e;return Lx=a,Lx}var zx,wM;function oB(){if(wM)return zx;wM=1;var e=W0(),t=SN(),r=K0(),n=ale(),a=ole(),i=Y8(),s=X8(),o=lle(),l=cle(),c=tB(),d=ule(),f=$c(),h=ple(),p=vle(),g=sB(),m=Rt(),b=Rc(),x=ble(),y=$r(),v=jle(),w=bs(),j=Po(),k=1,S=2,N=4,E="[object Arguments]",A="[object Array]",C="[object Boolean]",M="[object Date]",T="[object Error]",P="[object Function]",D="[object GeneratorFunction]",$="[object Map]",L="[object Number]",I="[object Object]",R="[object RegExp]",z="[object Set]",V="[object String]",B="[object Symbol]",W="[object WeakMap]",K="[object ArrayBuffer]",Q="[object DataView]",ae="[object Float32Array]",pe="[object Float64Array]",ve="[object Int8Array]",Y="[object Int16Array]",ee="[object Int32Array]",fe="[object Uint8Array]",H="[object Uint8ClampedArray]",je="[object Uint16Array]",ye="[object Uint32Array]",se={};se[E]=se[A]=se[K]=se[Q]=se[C]=se[M]=se[ae]=se[pe]=se[ve]=se[Y]=se[ee]=se[$]=se[L]=se[I]=se[R]=se[z]=se[V]=se[B]=se[fe]=se[H]=se[je]=se[ye]=!0,se[T]=se[P]=se[W]=!1;function ke(ne,ie,qe,rr,zt,lt){var rt,ct=ie&k,Ft=ie&S,on=ie&N;if(qe&&(rt=zt?qe(ne,rr,zt,lt):qe(ne)),rt!==void 0)return rt;if(!y(ne))return ne;var Dr=m(ne);if(Dr){if(rt=h(ne),!ct)return s(ne,rt)}else{var Pt=f(ne),Gt=Pt==P||Pt==D;if(b(ne))return i(ne,ct);if(Pt==I||Pt==E||Gt&&!zt){if(rt=Ft||Gt?{}:g(ne),!ct)return Ft?l(ne,a(rt,ne)):o(ne,n(rt,ne))}else{if(!se[Pt])return zt?ne:{};rt=p(ne,Pt,ct)}}lt||(lt=new e);var Dn=lt.get(ne);if(Dn)return Dn;lt.set(ne,rt),v(ne)?ne.forEach(function(ut){rt.add(ke(ut,ie,qe,ut,ne,lt))}):x(ne)&&ne.forEach(function(ut,nr){rt.set(nr,ke(ut,ie,qe,nr,ne,lt))});var St=on?Ft?d:c:Ft?j:w,yr=Dr?void 0:St(ne);return t(yr||ne,function(ut,nr){yr&&(nr=ut,ut=ne[nr]),r(rt,nr,ke(ut,ie,qe,nr,ne,lt))}),rt}return zx=ke,zx}var Fx,jM;function Sle(){if(jM)return Fx;jM=1;var e=oB(),t=4;function r(n){return e(n,t)}return Fx=r,Fx}var Bx,SM;function AN(){if(SM)return Bx;SM=1;function e(t){return function(){return t}}return Bx=e,Bx}var Vx,kM;function kle(){if(kM)return Vx;kM=1;function e(t){return function(r,n,a){for(var i=-1,s=Object(r),o=a(r),l=o.length;l--;){var c=o[t?l:++i];if(n(s[c],c,s)===!1)break}return r}}return Vx=e,Vx}var qx,_M;function TN(){if(_M)return qx;_M=1;var e=kle(),t=e();return qx=t,qx}var Ux,NM;function ON(){if(NM)return Ux;NM=1;var e=TN(),t=bs();function r(n,a){return n&&e(n,a,t)}return Ux=r,Ux}var Hx,EM;function _le(){if(EM)return Hx;EM=1;var e=mi();function t(r,n){return function(a,i){if(a==null)return a;if(!e(a))return r(a,i);for(var s=a.length,o=n?s:-1,l=Object(a);(n?o--:++o<s)&&i(l[o],o,l)!==!1;);return a}}return Hx=t,Hx}var Wx,PM;function Dc(){if(PM)return Wx;PM=1;var e=ON(),t=_le(),r=t(e);return Wx=r,Wx}var Gx,CM;function Co(){if(CM)return Gx;CM=1;function e(t){return t}return Gx=e,Gx}var Kx,AM;function lB(){if(AM)return Kx;AM=1;var e=Co();function t(r){return typeof r=="function"?r:e}return Kx=t,Kx}var Yx,TM;function cB(){if(TM)return Yx;TM=1;var e=SN(),t=Dc(),r=lB(),n=Rt();function a(i,s){var o=n(i)?e:t;return o(i,r(s))}return Yx=a,Yx}var Xx,OM;function uB(){return OM||(OM=1,Xx=cB()),Xx}var Zx,MM;function Nle(){if(MM)return Zx;MM=1;var e=Dc();function t(r,n){var a=[];return e(r,function(i,s,o){n(i,s,o)&&a.push(i)}),a}return Zx=t,Zx}var Qx,RM;function Ele(){if(RM)return Qx;RM=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return Qx=t,Qx}var Jx,$M;function Ple(){if($M)return Jx;$M=1;function e(t){return this.__data__.has(t)}return Jx=e,Jx}var eb,DM;function dB(){if(DM)return eb;DM=1;var e=jN(),t=Ele(),r=Ple();function n(a){var i=-1,s=a==null?0:a.length;for(this.__data__=new e;++i<s;)this.add(a[i])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,eb=n,eb}function Cle(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 fB=Cle,tb,IM;function hB(){if(IM)return tb;IM=1;function e(t,r){return t.has(r)}return tb=e,tb}var Ale=dB(),Tle=fB,Ole=hB(),Mle=1,Rle=2;function $le(e,t,r,n,a,i){var s=r&Mle,o=e.length,l=t.length;if(o!=l&&!(s&&l>o))return!1;var c=i.get(e),d=i.get(t);if(c&&d)return c==t&&d==e;var f=-1,h=!0,p=r&Rle?new Ale:void 0;for(i.set(e,t),i.set(t,e);++f<o;){var g=e[f],m=t[f];if(n)var b=s?n(m,g,f,t,e,i):n(g,m,f,e,t,i);if(b!==void 0){if(b)continue;h=!1;break}if(p){if(!Tle(t,function(x,y){if(!Ole(p,y)&&(g===x||a(g,x,r,n,i)))return p.push(y)})){h=!1;break}}else if(!(g===m||a(g,m,r,n,i))){h=!1;break}}return i.delete(e),i.delete(t),h}var pB=$le;function Dle(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}var Ile=Dle,rb,LM;function MN(){if(LM)return rb;LM=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(a){n[++r]=a}),n}return rb=e,rb}var zM=Oc,FM=nB(),Lle=Tc(),zle=pB,Fle=Ile,Ble=MN(),Vle=1,qle=2,Ule="[object Boolean]",Hle="[object Date]",Wle="[object Error]",Gle="[object Map]",Kle="[object Number]",Yle="[object RegExp]",Xle="[object Set]",Zle="[object String]",Qle="[object Symbol]",Jle="[object ArrayBuffer]",ece="[object DataView]",BM=zM?zM.prototype:void 0,nb=BM?BM.valueOf:void 0;function tce(e,t,r,n,a,i,s){switch(r){case ece:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Jle:return!(e.byteLength!=t.byteLength||!i(new FM(e),new FM(t)));case Ule:case Hle:case Kle:return Lle(+e,+t);case Wle:return e.name==t.name&&e.message==t.message;case Yle:case Zle:return e==t+"";case Gle:var o=Fle;case Xle:var l=n&Vle;if(o||(o=Ble),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;n|=qle,s.set(e,t);var d=zle(o(e),o(t),n,a,i,s);return s.delete(e),d;case Qle:if(nb)return nb.call(e)==nb.call(t)}return!1}var rce=tce,VM=tB(),nce=1,ace=Object.prototype,ice=ace.hasOwnProperty;function sce(e,t,r,n,a,i){var s=r&nce,o=VM(e),l=o.length,c=VM(t),d=c.length;if(l!=d&&!s)return!1;for(var f=l;f--;){var h=o[f];if(!(s?h in t:ice.call(t,h)))return!1}var p=i.get(e),g=i.get(t);if(p&&g)return p==t&&g==e;var m=!0;i.set(e,t),i.set(t,e);for(var b=s;++f<l;){h=o[f];var x=e[h],y=t[h];if(n)var v=s?n(y,x,h,t,e,i):n(x,y,h,e,t,i);if(!(v===void 0?x===y||a(x,y,r,n,i):v)){m=!1;break}b||(b=h=="constructor")}if(m&&!b){var w=e.constructor,j=t.constructor;w!=j&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof j=="function"&&j instanceof j)&&(m=!1)}return i.delete(e),i.delete(t),m}var oce=sce,ab=W0(),lce=pB,cce=rce,uce=oce,qM=$c(),UM=Rt(),HM=Rc(),dce=$f(),fce=1,WM="[object Arguments]",GM="[object Array]",Ah="[object Object]",hce=Object.prototype,KM=hce.hasOwnProperty;function pce(e,t,r,n,a,i){var s=UM(e),o=UM(t),l=s?GM:qM(e),c=o?GM:qM(t);l=l==WM?Ah:l,c=c==WM?Ah:c;var d=l==Ah,f=c==Ah,h=l==c;if(h&&HM(e)){if(!HM(t))return!1;s=!0,d=!1}if(h&&!d)return i||(i=new ab),s||dce(e)?lce(e,t,r,n,a,i):cce(e,t,l,r,n,a,i);if(!(r&fce)){var p=d&&KM.call(e,"__wrapped__"),g=f&&KM.call(t,"__wrapped__");if(p||g){var m=p?e.value():e,b=g?t.value():t;return i||(i=new ab),a(m,b,r,n,i)}}return h?(i||(i=new ab),uce(e,t,r,n,a,i)):!1}var mce=pce,gce=mce,YM=Tn;function mB(e,t,r,n,a){return e===t?!0:e==null||t==null||!YM(e)&&!YM(t)?e!==e&&t!==t:gce(e,t,r,n,mB,a)}var RN=mB,ib,XM;function yce(){if(XM)return ib;XM=1;var e=W0(),t=RN,r=1,n=2;function a(i,s,o,l){var c=o.length,d=c,f=!l;if(i==null)return!d;for(i=Object(i);c--;){var h=o[c];if(f&&h[2]?h[1]!==i[h[0]]:!(h[0]in i))return!1}for(;++c<d;){h=o[c];var p=h[0],g=i[p],m=h[1];if(f&&h[2]){if(g===void 0&&!(p in i))return!1}else{var b=new e;if(l)var x=l(g,m,p,i,s,b);if(!(x===void 0?t(m,g,r|n,l,b):x))return!1}}return!0}return ib=a,ib}var sb,ZM;function gB(){if(ZM)return sb;ZM=1;var e=$r();function t(r){return r===r&&!e(r)}return sb=t,sb}var ob,QM;function vce(){if(QM)return ob;QM=1;var e=gB(),t=bs();function r(n){for(var a=t(n),i=a.length;i--;){var s=a[i],o=n[s];a[i]=[s,o,e(o)]}return a}return ob=r,ob}var lb,JM;function yB(){if(JM)return lb;JM=1;function e(t,r){return function(n){return n==null?!1:n[t]===r&&(r!==void 0||t in Object(n))}}return lb=e,lb}var cb,eR;function xce(){if(eR)return cb;eR=1;var e=yce(),t=vce(),r=yB();function n(a){var i=t(a);return i.length==1&&i[0][2]?r(i[0][0],i[0][1]):function(s){return s===a||e(s,a,i)}}return cb=n,cb}var ub,tR;function Ic(){if(tR)return ub;tR=1;var e=pi,t=Tn,r="[object Symbol]";function n(a){return typeof a=="symbol"||t(a)&&e(a)==r}return ub=n,ub}var db,rR;function $N(){if(rR)return db;rR=1;var e=Rt(),t=Ic(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,s){if(e(i))return!1;var o=typeof i;return o=="number"||o=="symbol"||o=="boolean"||i==null||t(i)?!0:n.test(i)||!r.test(i)||s!=null&&i in Object(s)}return db=a,db}var fb,nR;function vB(){if(nR)return fb;nR=1;var e=jN(),t="Expected a function";function r(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var i=function(){var s=arguments,o=a?a.apply(this,s):s[0],l=i.cache;if(l.has(o))return l.get(o);var c=n.apply(this,s);return i.cache=l.set(o,c)||l,c};return i.cache=new(r.Cache||e),i}return r.Cache=e,fb=r,fb}var hb,aR;function bce(){if(aR)return hb;aR=1;var e=vB(),t=500;function r(n){var a=e(n,function(s){return i.size===t&&i.clear(),s}),i=a.cache;return a}return hb=r,hb}var pb,iR;function wce(){if(iR)return pb;iR=1;var e=bce(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(t,function(s,o,l,c){i.push(l?c.replace(r,"$1"):o||s)}),i});return pb=n,pb}var mb,sR;function J0(){if(sR)return mb;sR=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,i=Array(a);++n<a;)i[n]=r(t[n],n,t);return i}return mb=e,mb}var gb,oR;function jce(){if(oR)return gb;oR=1;var e=Oc,t=J0(),r=Rt(),n=Ic(),a=e?e.prototype:void 0,i=a?a.toString:void 0;function s(o){if(typeof o=="string")return o;if(r(o))return t(o,s)+"";if(n(o))return i?i.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}return gb=s,gb}var yb,lR;function DN(){if(lR)return yb;lR=1;var e=jce();function t(r){return r==null?"":e(r)}return yb=t,yb}var vb,cR;function eg(){if(cR)return vb;cR=1;var e=Rt(),t=$N(),r=wce(),n=DN();function a(i,s){return e(i)?i:t(i,s)?[i]:r(n(i))}return vb=a,vb}var xb,uR;function Df(){if(uR)return xb;uR=1;var e=Ic();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return xb=t,xb}var bb,dR;function tg(){if(dR)return bb;dR=1;var e=eg(),t=Df();function r(n,a){a=e(a,n);for(var i=0,s=a.length;n!=null&&i<s;)n=n[t(a[i++])];return i&&i==s?n:void 0}return bb=r,bb}var wb,fR;function xB(){if(fR)return wb;fR=1;var e=tg();function t(r,n,a){var i=r==null?void 0:e(r,n);return i===void 0?a:i}return wb=t,wb}var jb,hR;function Sce(){if(hR)return jb;hR=1;function e(t,r){return t!=null&&r in Object(t)}return jb=e,jb}var Sb,pR;function bB(){if(pR)return Sb;pR=1;var e=eg(),t=Rf(),r=Rt(),n=Y0(),a=kN(),i=Df();function s(o,l,c){l=e(l,o);for(var d=-1,f=l.length,h=!1;++d<f;){var p=i(l[d]);if(!(h=o!=null&&c(o,p)))break;o=o[p]}return h||++d!=f?h:(f=o==null?0:o.length,!!f&&a(f)&&n(p,f)&&(r(o)||t(o)))}return Sb=s,Sb}var kb,mR;function wB(){if(mR)return kb;mR=1;var e=Sce(),t=bB();function r(n,a){return n!=null&&t(n,a,e)}return kb=r,kb}var _b,gR;function kce(){if(gR)return _b;gR=1;var e=RN,t=xB(),r=wB(),n=$N(),a=gB(),i=yB(),s=Df(),o=1,l=2;function c(d,f){return n(d)&&a(f)?i(s(d),f):function(h){var p=t(h,d);return p===void 0&&p===f?r(h,d):e(f,p,o|l)}}return _b=c,_b}var Nb,yR;function jB(){if(yR)return Nb;yR=1;function e(t){return function(r){return r==null?void 0:r[t]}}return Nb=e,Nb}var Eb,vR;function _ce(){if(vR)return Eb;vR=1;var e=tg();function t(r){return function(n){return e(n,r)}}return Eb=t,Eb}var Pb,xR;function Nce(){if(xR)return Pb;xR=1;var e=jB(),t=_ce(),r=$N(),n=Df();function a(i){return r(i)?e(n(i)):t(i)}return Pb=a,Pb}var Cb,bR;function On(){if(bR)return Cb;bR=1;var e=xce(),t=kce(),r=Co(),n=Rt(),a=Nce();function i(s){return typeof s=="function"?s:s==null?r:typeof s=="object"?n(s)?t(s[0],s[1]):e(s):a(s)}return Cb=i,Cb}var Ab,wR;function SB(){if(wR)return Ab;wR=1;var e=Z8(),t=Nle(),r=On(),n=Rt();function a(i,s){var o=n(i)?e:t;return o(i,r(s,3))}return Ab=a,Ab}var Tb,jR;function Ece(){if(jR)return Tb;jR=1;var e=Object.prototype,t=e.hasOwnProperty;function r(n,a){return n!=null&&t.call(n,a)}return Tb=r,Tb}var Ob,SR;function kB(){if(SR)return Ob;SR=1;var e=Ece(),t=bB();function r(n,a){return n!=null&&t(n,a,e)}return Ob=r,Ob}var Mb,kR;function Pce(){if(kR)return Mb;kR=1;var e=NN(),t=$c(),r=Rf(),n=Rt(),a=mi(),i=Rc(),s=Z0(),o=$f(),l="[object Map]",c="[object Set]",d=Object.prototype,f=d.hasOwnProperty;function h(p){if(p==null)return!0;if(a(p)&&(n(p)||typeof p=="string"||typeof p.splice=="function"||i(p)||o(p)||r(p)))return!p.length;var g=t(p);if(g==l||g==c)return!p.size;if(s(p))return!e(p).length;for(var m in p)if(f.call(p,m))return!1;return!0}return Mb=h,Mb}var Rb,_R;function _B(){if(_R)return Rb;_R=1;function e(t){return t===void 0}return Rb=e,Rb}var $b,NR;function NB(){if(NR)return $b;NR=1;var e=Dc(),t=mi();function r(n,a){var i=-1,s=t(n)?Array(n.length):[];return e(n,function(o,l,c){s[++i]=a(o,l,c)}),s}return $b=r,$b}var Db,ER;function IN(){if(ER)return Db;ER=1;var e=J0(),t=On(),r=NB(),n=Rt();function a(i,s){var o=n(i)?e:r;return o(i,t(s,3))}return Db=a,Db}var Ib,PR;function Cce(){if(PR)return Ib;PR=1;function e(t,r,n,a){var i=-1,s=t==null?0:t.length;for(a&&s&&(n=t[++i]);++i<s;)n=r(n,t[i],i,t);return n}return Ib=e,Ib}var Lb,CR;function Ace(){if(CR)return Lb;CR=1;function e(t,r,n,a,i){return i(t,function(s,o,l){n=a?(a=!1,s):r(n,s,o,l)}),n}return Lb=e,Lb}var zb,AR;function EB(){if(AR)return zb;AR=1;var e=Cce(),t=Dc(),r=On(),n=Ace(),a=Rt();function i(s,o,l){var c=a(s)?e:n,d=arguments.length<3;return c(s,r(o,4),l,d,t)}return zb=i,zb}var Fb,TR;function PB(){if(TR)return Fb;TR=1;var e=pi,t=Rt(),r=Tn,n="[object String]";function a(i){return typeof i=="string"||!t(i)&&r(i)&&e(i)==n}return Fb=a,Fb}var Bb,OR;function Tce(){if(OR)return Bb;OR=1;var e=jB(),t=e("length");return Bb=t,Bb}var Oce="\\ud800-\\udfff",Mce="\\u0300-\\u036f",Rce="\\ufe20-\\ufe2f",$ce="\\u20d0-\\u20ff",Dce=Mce+Rce+$ce,Ice="\\ufe0e\\ufe0f",Lce="\\u200d",zce=RegExp("["+Lce+Oce+Dce+Ice+"]");function Fce(e){return zce.test(e)}var LN=Fce,Vb,MR;function Bce(){if(MR)return Vb;MR=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=t+r+n,i="\\ufe0e\\ufe0f",s="["+e+"]",o="["+a+"]",l="\\ud83c[\\udffb-\\udfff]",c="(?:"+o+"|"+l+")",d="[^"+e+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",p="\\u200d",g=c+"?",m="["+i+"]?",b="(?:"+p+"(?:"+[d,f,h].join("|")+")"+m+g+")*",x=m+g+b,y="(?:"+[d+o+"?",o,f,h,s].join("|")+")",v=RegExp(l+"(?="+l+")|"+y+x,"g");function w(j){for(var k=v.lastIndex=0;v.test(j);)++k;return k}return Vb=w,Vb}var qb,RR;function Vce(){if(RR)return qb;RR=1;var e=Tce(),t=LN,r=Bce();function n(a){return t(a)?r(a):e(a)}return qb=n,qb}var Ub,$R;function qce(){if($R)return Ub;$R=1;var e=NN(),t=$c(),r=mi(),n=PB(),a=Vce(),i="[object Map]",s="[object Set]";function o(l){if(l==null)return 0;if(r(l))return n(l)?a(l):l.length;var c=t(l);return c==i||c==s?l.size:e(l).length}return Ub=o,Ub}var Hb,DR;function Uce(){if(DR)return Hb;DR=1;var e=SN(),t=iB(),r=ON(),n=On(),a=Q0(),i=Rt(),s=Rc(),o=Mc(),l=$r(),c=$f();function d(f,h,p){var g=i(f),m=g||s(f)||c(f);if(h=n(h,4),p==null){var b=f&&f.constructor;m?p=g?new b:[]:l(f)?p=o(b)?t(a(f)):{}:p={}}return(m?e:r)(f,function(x,y,v){return h(p,x,y,v)}),p}return Hb=d,Hb}var Wb,IR;function Hce(){if(IR)return Wb;IR=1;var e=Oc,t=Rf(),r=Rt(),n=e?e.isConcatSpreadable:void 0;function a(i){return r(i)||t(i)||!!(n&&i&&i[n])}return Wb=a,Wb}var Gb,LR;function rg(){if(LR)return Gb;LR=1;var e=PN(),t=Hce();function r(n,a,i,s,o){var l=-1,c=n.length;for(i||(i=t),o||(o=[]);++l<c;){var d=n[l];a>0&&i(d)?a>1?r(d,a-1,i,s,o):e(o,d):s||(o[o.length]=d)}return o}return Gb=r,Gb}var Kb,zR;function Wce(){if(zR)return Kb;zR=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return Kb=e,Kb}var Yb,FR;function CB(){if(FR)return Yb;FR=1;var e=Wce(),t=Math.max;function r(n,a,i){return a=t(a===void 0?n.length-1:a,0),function(){for(var s=arguments,o=-1,l=t(s.length-a,0),c=Array(l);++o<l;)c[o]=s[a+o];o=-1;for(var d=Array(a+1);++o<a;)d[o]=s[o];return d[a]=i(c),e(n,this,d)}}return Yb=r,Yb}var Xb,BR;function Gce(){if(BR)return Xb;BR=1;var e=AN(),t=W8(),r=Co(),n=t?function(a,i){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:r;return Xb=n,Xb}var Zb,VR;function Kce(){if(VR)return Zb;VR=1;var e=800,t=16,r=Date.now;function n(a){var i=0,s=0;return function(){var o=r(),l=t-(o-s);if(s=o,l>0){if(++i>=e)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return Zb=n,Zb}var Qb,qR;function AB(){if(qR)return Qb;qR=1;var e=Gce(),t=Kce(),r=t(e);return Qb=r,Qb}var Jb,UR;function ng(){if(UR)return Jb;UR=1;var e=Co(),t=CB(),r=AB();function n(a,i){return r(t(a,i,e),a+"")}return Jb=n,Jb}var ew,HR;function TB(){if(HR)return ew;HR=1;function e(t,r,n,a){for(var i=t.length,s=n+(a?1:-1);a?s--:++s<i;)if(r(t[s],s,t))return s;return-1}return ew=e,ew}var tw,WR;function Yce(){if(WR)return tw;WR=1;function e(t){return t!==t}return tw=e,tw}var rw,GR;function Xce(){if(GR)return rw;GR=1;function e(t,r,n){for(var a=n-1,i=t.length;++a<i;)if(t[a]===r)return a;return-1}return rw=e,rw}var nw,KR;function Zce(){if(KR)return nw;KR=1;var e=TB(),t=Yce(),r=Xce();function n(a,i,s){return i===i?r(a,i,s):e(a,t,s)}return nw=n,nw}var aw,YR;function Qce(){if(YR)return aw;YR=1;var e=Zce();function t(r,n){var a=r==null?0:r.length;return!!a&&e(r,n,0)>-1}return aw=t,aw}var iw,XR;function Jce(){if(XR)return iw;XR=1;function e(t,r,n){for(var a=-1,i=t==null?0:t.length;++a<i;)if(n(r,t[a]))return!0;return!1}return iw=e,iw}var sw,ZR;function eue(){if(ZR)return sw;ZR=1;function e(){}return sw=e,sw}var ow,QR;function tue(){if(QR)return ow;QR=1;var e=rB(),t=eue(),r=MN(),n=1/0,a=e&&1/r(new e([,-0]))[1]==n?function(i){return new e(i)}:t;return ow=a,ow}var lw,JR;function OB(){if(JR)return lw;JR=1;var e=dB(),t=Qce(),r=Jce(),n=hB(),a=tue(),i=MN(),s=200;function o(l,c,d){var f=-1,h=t,p=l.length,g=!0,m=[],b=m;if(d)g=!1,h=r;else if(p>=s){var x=c?null:a(l);if(x)return i(x);g=!1,h=n,b=new e}else b=c?[]:m;e:for(;++f<p;){var y=l[f],v=c?c(y):y;if(y=d||y!==0?y:0,g&&v===v){for(var w=b.length;w--;)if(b[w]===v)continue e;c&&b.push(v),m.push(y)}else h(b,v,d)||(b!==m&&b.push(v),m.push(y))}return m}return lw=o,lw}var cw,e$;function MB(){if(e$)return cw;e$=1;var e=mi(),t=Tn;function r(n){return t(n)&&e(n)}return cw=r,cw}var uw,t$;function rue(){if(t$)return uw;t$=1;var e=rg(),t=ng(),r=OB(),n=MB(),a=t(function(i){return r(e(i,1,n,!0))});return uw=a,uw}var dw,r$;function nue(){if(r$)return dw;r$=1;var e=J0();function t(r,n){return e(n,function(a){return r[a]})}return dw=t,dw}var fw,n$;function RB(){if(n$)return fw;n$=1;var e=nue(),t=bs();function r(n){return n==null?[]:e(n,t(n))}return fw=r,fw}var hw,a$;function Mn(){if(a$)return hw;a$=1;var e;if(typeof bN=="function")try{e={clone:Sle(),constant:AN(),each:uB(),filter:SB(),has:kB(),isArray:Rt(),isEmpty:Pce(),isFunction:Mc(),isUndefined:_B(),keys:bs(),map:IN(),reduce:EB(),size:qce(),transform:Uce(),union:rue(),values:RB()}}catch{}return e||(e=window._),hw=e,hw}var pw,i$;function zN(){if(i$)return pw;i$=1;var e=Mn();pw=a;var t="\0",r="\0",n="";function a(d){this._isDirected=e.has(d,"directed")?d.directed:!0,this._isMultigraph=e.has(d,"multigraph")?d.multigraph:!1,this._isCompound=e.has(d,"compound")?d.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[r]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(d){return this._label=d,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(d){return e.isFunction(d)||(d=e.constant(d)),this._defaultNodeLabelFn=d,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return e.keys(this._nodes)},a.prototype.sources=function(){var d=this;return e.filter(this.nodes(),function(f){return e.isEmpty(d._in[f])})},a.prototype.sinks=function(){var d=this;return e.filter(this.nodes(),function(f){return e.isEmpty(d._out[f])})},a.prototype.setNodes=function(d,f){var h=arguments,p=this;return e.each(d,function(g){h.length>1?p.setNode(g,f):p.setNode(g)}),this},a.prototype.setNode=function(d,f){return e.has(this._nodes,d)?(arguments.length>1&&(this._nodes[d]=f),this):(this._nodes[d]=arguments.length>1?f:this._defaultNodeLabelFn(d),this._isCompound&&(this._parent[d]=r,this._children[d]={},this._children[r][d]=!0),this._in[d]={},this._preds[d]={},this._out[d]={},this._sucs[d]={},++this._nodeCount,this)},a.prototype.node=function(d){return this._nodes[d]},a.prototype.hasNode=function(d){return e.has(this._nodes,d)},a.prototype.removeNode=function(d){var f=this;if(e.has(this._nodes,d)){var h=function(p){f.removeEdge(f._edgeObjs[p])};delete this._nodes[d],this._isCompound&&(this._removeFromParentsChildList(d),delete this._parent[d],e.each(this.children(d),function(p){f.setParent(p)}),delete this._children[d]),e.each(e.keys(this._in[d]),h),delete this._in[d],delete this._preds[d],e.each(e.keys(this._out[d]),h),delete this._out[d],delete this._sucs[d],--this._nodeCount}return this},a.prototype.setParent=function(d,f){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(f))f=r;else{f+="";for(var h=f;!e.isUndefined(h);h=this.parent(h))if(h===d)throw new Error("Setting "+f+" as parent of "+d+" would create a cycle");this.setNode(f)}return this.setNode(d),this._removeFromParentsChildList(d),this._parent[d]=f,this._children[f][d]=!0,this},a.prototype._removeFromParentsChildList=function(d){delete this._children[this._parent[d]][d]},a.prototype.parent=function(d){if(this._isCompound){var f=this._parent[d];if(f!==r)return f}},a.prototype.children=function(d){if(e.isUndefined(d)&&(d=r),this._isCompound){var f=this._children[d];if(f)return e.keys(f)}else{if(d===r)return this.nodes();if(this.hasNode(d))return[]}},a.prototype.predecessors=function(d){var f=this._preds[d];if(f)return e.keys(f)},a.prototype.successors=function(d){var f=this._sucs[d];if(f)return e.keys(f)},a.prototype.neighbors=function(d){var f=this.predecessors(d);if(f)return e.union(f,this.successors(d))},a.prototype.isLeaf=function(d){var f;return this.isDirected()?f=this.successors(d):f=this.neighbors(d),f.length===0},a.prototype.filterNodes=function(d){var f=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});f.setGraph(this.graph());var h=this;e.each(this._nodes,function(m,b){d(b)&&f.setNode(b,m)}),e.each(this._edgeObjs,function(m){f.hasNode(m.v)&&f.hasNode(m.w)&&f.setEdge(m,h.edge(m))});var p={};function g(m){var b=h.parent(m);return b===void 0||f.hasNode(b)?(p[m]=b,b):b in p?p[b]:g(b)}return this._isCompound&&e.each(f.nodes(),function(m){f.setParent(m,g(m))}),f},a.prototype.setDefaultEdgeLabel=function(d){return e.isFunction(d)||(d=e.constant(d)),this._defaultEdgeLabelFn=d,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return e.values(this._edgeObjs)},a.prototype.setPath=function(d,f){var h=this,p=arguments;return e.reduce(d,function(g,m){return p.length>1?h.setEdge(g,m,f):h.setEdge(g,m),m}),this},a.prototype.setEdge=function(){var d,f,h,p,g=!1,m=arguments[0];typeof m=="object"&&m!==null&&"v"in m?(d=m.v,f=m.w,h=m.name,arguments.length===2&&(p=arguments[1],g=!0)):(d=m,f=arguments[1],h=arguments[3],arguments.length>2&&(p=arguments[2],g=!0)),d=""+d,f=""+f,e.isUndefined(h)||(h=""+h);var b=o(this._isDirected,d,f,h);if(e.has(this._edgeLabels,b))return g&&(this._edgeLabels[b]=p),this;if(!e.isUndefined(h)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(d),this.setNode(f),this._edgeLabels[b]=g?p:this._defaultEdgeLabelFn(d,f,h);var x=l(this._isDirected,d,f,h);return d=x.v,f=x.w,Object.freeze(x),this._edgeObjs[b]=x,i(this._preds[f],d),i(this._sucs[d],f),this._in[f][b]=x,this._out[d][b]=x,this._edgeCount++,this},a.prototype.edge=function(d,f,h){var p=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,d,f,h);return this._edgeLabels[p]},a.prototype.hasEdge=function(d,f,h){var p=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,d,f,h);return e.has(this._edgeLabels,p)},a.prototype.removeEdge=function(d,f,h){var p=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,d,f,h),g=this._edgeObjs[p];return g&&(d=g.v,f=g.w,delete this._edgeLabels[p],delete this._edgeObjs[p],s(this._preds[f],d),s(this._sucs[d],f),delete this._in[f][p],delete this._out[d][p],this._edgeCount--),this},a.prototype.inEdges=function(d,f){var h=this._in[d];if(h){var p=e.values(h);return f?e.filter(p,function(g){return g.v===f}):p}},a.prototype.outEdges=function(d,f){var h=this._out[d];if(h){var p=e.values(h);return f?e.filter(p,function(g){return g.w===f}):p}},a.prototype.nodeEdges=function(d,f){var h=this.inEdges(d,f);if(h)return h.concat(this.outEdges(d,f))};function i(d,f){d[f]?d[f]++:d[f]=1}function s(d,f){--d[f]||delete d[f]}function o(d,f,h,p){var g=""+f,m=""+h;if(!d&&g>m){var b=g;g=m,m=b}return g+n+m+n+(e.isUndefined(p)?t:p)}function l(d,f,h,p){var g=""+f,m=""+h;if(!d&&g>m){var b=g;g=m,m=b}var x={v:g,w:m};return p&&(x.name=p),x}function c(d,f){return o(d,f.v,f.w,f.name)}return pw}var mw,s$;function aue(){return s$||(s$=1,mw="2.1.8"),mw}var gw,o$;function iue(){return o$||(o$=1,gw={Graph:zN(),version:aue()}),gw}var yw,l$;function sue(){if(l$)return yw;l$=1;var e=Mn(),t=zN();yw={write:r,read:i};function r(s){var o={options:{directed:s.isDirected(),multigraph:s.isMultigraph(),compound:s.isCompound()},nodes:n(s),edges:a(s)};return e.isUndefined(s.graph())||(o.value=e.clone(s.graph())),o}function n(s){return e.map(s.nodes(),function(o){var l=s.node(o),c=s.parent(o),d={v:o};return e.isUndefined(l)||(d.value=l),e.isUndefined(c)||(d.parent=c),d})}function a(s){return e.map(s.edges(),function(o){var l=s.edge(o),c={v:o.v,w:o.w};return e.isUndefined(o.name)||(c.name=o.name),e.isUndefined(l)||(c.value=l),c})}function i(s){var o=new t(s.options).setGraph(s.value);return e.each(s.nodes,function(l){o.setNode(l.v,l.value),l.parent&&o.setParent(l.v,l.parent)}),e.each(s.edges,function(l){o.setEdge({v:l.v,w:l.w,name:l.name},l.value)}),o}return yw}var vw,c$;function oue(){if(c$)return vw;c$=1;var e=Mn();vw=t;function t(r){var n={},a=[],i;function s(o){e.has(n,o)||(n[o]=!0,i.push(o),e.each(r.successors(o),s),e.each(r.predecessors(o),s))}return e.each(r.nodes(),function(o){i=[],s(o),i.length&&a.push(i)}),a}return vw}var xw,u$;function $B(){if(u$)return xw;u$=1;var e=Mn();xw=t;function t(){this._arr=[],this._keyIndices={}}return t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(r){return r.key})},t.prototype.has=function(r){return e.has(this._keyIndices,r)},t.prototype.priority=function(r){var n=this._keyIndices[r];if(n!==void 0)return this._arr[n].priority},t.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(r,n){var a=this._keyIndices;if(r=String(r),!e.has(a,r)){var i=this._arr,s=i.length;return a[r]=s,i.push({key:r,priority:n}),this._decrease(s),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},t.prototype.decrease=function(r,n){var a=this._keyIndices[r];if(n>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[a].priority+" New: "+n);this._arr[a].priority=n,this._decrease(a)},t.prototype._heapify=function(r){var n=this._arr,a=2*r,i=a+1,s=r;a<n.length&&(s=n[a].priority<n[s].priority?a:s,i<n.length&&(s=n[i].priority<n[s].priority?i:s),s!==r&&(this._swap(r,s),this._heapify(s)))},t.prototype._decrease=function(r){for(var n=this._arr,a=n[r].priority,i;r!==0&&(i=r>>1,!(n[i].priority<a));)this._swap(r,i),r=i},t.prototype._swap=function(r,n){var a=this._arr,i=this._keyIndices,s=a[r],o=a[n];a[r]=o,a[n]=s,i[o.key]=r,i[s.key]=n},xw}var bw,d$;function DB(){if(d$)return bw;d$=1;var e=Mn(),t=$B();bw=n;var r=e.constant(1);function n(i,s,o,l){return a(i,String(s),o||r,l||function(c){return i.outEdges(c)})}function a(i,s,o,l){var c={},d=new t,f,h,p=function(g){var m=g.v!==f?g.v:g.w,b=c[m],x=o(g),y=h.distance+x;if(x<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+g+" Weight: "+x);y<b.distance&&(b.distance=y,b.predecessor=f,d.decrease(m,y))};for(i.nodes().forEach(function(g){var m=g===s?0:Number.POSITIVE_INFINITY;c[g]={distance:m},d.add(g,m)});d.size()>0&&(f=d.removeMin(),h=c[f],h.distance!==Number.POSITIVE_INFINITY);)l(f).forEach(p);return c}return bw}var ww,f$;function lue(){if(f$)return ww;f$=1;var e=DB(),t=Mn();ww=r;function r(n,a,i){return t.transform(n.nodes(),function(s,o){s[o]=e(n,o,a,i)},{})}return ww}var jw,h$;function IB(){if(h$)return jw;h$=1;var e=Mn();jw=t;function t(r){var n=0,a=[],i={},s=[];function o(l){var c=i[l]={onStack:!0,lowlink:n,index:n++};if(a.push(l),r.successors(l).forEach(function(h){e.has(i,h)?i[h].onStack&&(c.lowlink=Math.min(c.lowlink,i[h].index)):(o(h),c.lowlink=Math.min(c.lowlink,i[h].lowlink))}),c.lowlink===c.index){var d=[],f;do f=a.pop(),i[f].onStack=!1,d.push(f);while(l!==f);s.push(d)}}return r.nodes().forEach(function(l){e.has(i,l)||o(l)}),s}return jw}var Sw,p$;function cue(){if(p$)return Sw;p$=1;var e=Mn(),t=IB();Sw=r;function r(n){return e.filter(t(n),function(a){return a.length>1||a.length===1&&n.hasEdge(a[0],a[0])})}return Sw}var kw,m$;function uue(){if(m$)return kw;m$=1;var e=Mn();kw=r;var t=e.constant(1);function r(a,i,s){return n(a,i||t,s||function(o){return a.outEdges(o)})}function n(a,i,s){var o={},l=a.nodes();return l.forEach(function(c){o[c]={},o[c][c]={distance:0},l.forEach(function(d){c!==d&&(o[c][d]={distance:Number.POSITIVE_INFINITY})}),s(c).forEach(function(d){var f=d.v===c?d.w:d.v,h=i(d);o[c][f]={distance:h,predecessor:c}})}),l.forEach(function(c){var d=o[c];l.forEach(function(f){var h=o[f];l.forEach(function(p){var g=h[c],m=d[p],b=h[p],x=g.distance+m.distance;x<b.distance&&(b.distance=x,b.predecessor=m.predecessor)})})}),o}return kw}var _w,g$;function LB(){if(g$)return _w;g$=1;var e=Mn();_w=t,t.CycleException=r;function t(n){var a={},i={},s=[];function o(l){if(e.has(i,l))throw new r;e.has(a,l)||(i[l]=!0,a[l]=!0,e.each(n.predecessors(l),o),delete i[l],s.push(l))}if(e.each(n.sinks(),o),e.size(a)!==n.nodeCount())throw new r;return s}function r(){}return r.prototype=new Error,_w}var Nw,y$;function due(){if(y$)return Nw;y$=1;var e=LB();Nw=t;function t(r){try{e(r)}catch(n){if(n instanceof e.CycleException)return!1;throw n}return!0}return Nw}var Ew,v$;function zB(){if(v$)return Ew;v$=1;var e=Mn();Ew=t;function t(n,a,i){e.isArray(a)||(a=[a]);var s=(n.isDirected()?n.successors:n.neighbors).bind(n),o=[],l={};return e.each(a,function(c){if(!n.hasNode(c))throw new Error("Graph does not have node: "+c);r(n,c,i==="post",l,s,o)}),o}function r(n,a,i,s,o,l){e.has(s,a)||(s[a]=!0,i||l.push(a),e.each(o(a),function(c){r(n,c,i,s,o,l)}),i&&l.push(a))}return Ew}var Pw,x$;function fue(){if(x$)return Pw;x$=1;var e=zB();Pw=t;function t(r,n){return e(r,n,"post")}return Pw}var Cw,b$;function hue(){if(b$)return Cw;b$=1;var e=zB();Cw=t;function t(r,n){return e(r,n,"pre")}return Cw}var Aw,w$;function pue(){if(w$)return Aw;w$=1;var e=Mn(),t=zN(),r=$B();Aw=n;function n(a,i){var s=new t,o={},l=new r,c;function d(h){var p=h.v===c?h.w:h.v,g=l.priority(p);if(g!==void 0){var m=i(h);m<g&&(o[p]=c,l.decrease(p,m))}}if(a.nodeCount()===0)return s;e.each(a.nodes(),function(h){l.add(h,Number.POSITIVE_INFINITY),s.setNode(h)}),l.decrease(a.nodes()[0],0);for(var f=!1;l.size()>0;){if(c=l.removeMin(),e.has(o,c))s.setEdge(c,o[c]);else{if(f)throw new Error("Input graph is not connected: "+a);f=!0}a.nodeEdges(c).forEach(d)}return s}return Aw}var Tw,j$;function mue(){return j$||(j$=1,Tw={components:oue(),dijkstra:DB(),dijkstraAll:lue(),findCycles:cue(),floydWarshall:uue(),isAcyclic:due(),postorder:fue(),preorder:hue(),prim:pue(),tarjan:IB(),topsort:LB()}),Tw}var Ow,S$;function gue(){if(S$)return Ow;S$=1;var e=iue();return Ow={Graph:e.Graph,json:sue(),alg:mue(),version:e.version},Ow}var hm;if(typeof bN=="function")try{hm=gue()}catch{}hm||(hm=window.graphlib);var sa=hm,Mw,k$;function yue(){if(k$)return Mw;k$=1;var e=oB(),t=1,r=4;function n(a){return e(a,t|r)}return Mw=n,Mw}var Rw,_$;function Lc(){if(_$)return Rw;_$=1;var e=Tc(),t=mi(),r=Y0(),n=$r();function a(i,s,o){if(!n(o))return!1;var l=typeof s;return(l=="number"?t(o)&&r(s,o.length):l=="string"&&s in o)?e(o[s],i):!1}return Rw=a,Rw}var $w,N$;function vue(){if(N$)return $w;N$=1;var e=ng(),t=Tc(),r=Lc(),n=Po(),a=Object.prototype,i=a.hasOwnProperty,s=e(function(o,l){o=Object(o);var c=-1,d=l.length,f=d>2?l[2]:void 0;for(f&&r(l[0],l[1],f)&&(d=1);++c<d;)for(var h=l[c],p=n(h),g=-1,m=p.length;++g<m;){var b=p[g],x=o[b];(x===void 0||t(x,a[b])&&!i.call(o,b))&&(o[b]=h[b])}return o});return $w=s,$w}var Dw,E$;function xue(){if(E$)return Dw;E$=1;var e=On(),t=mi(),r=bs();function n(a){return function(i,s,o){var l=Object(i);if(!t(i)){var c=e(s,3);i=r(i),s=function(f){return c(l[f],f,l)}}var d=a(i,s,o);return d>-1?l[c?i[d]:d]:void 0}}return Dw=n,Dw}var Iw,P$;function bue(){if(P$)return Iw;P$=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Iw=t,Iw}var Lw,C$;function wue(){if(C$)return Lw;C$=1;var e=bue(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Lw=r,Lw}var zw,A$;function FB(){if(A$)return zw;A$=1;var e=wue(),t=$r(),r=Ic(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function l(c){if(typeof c=="number")return c;if(r(c))return n;if(t(c)){var d=typeof c.valueOf=="function"?c.valueOf():c;c=t(d)?d+"":d}if(typeof c!="string")return c===0?c:+c;c=e(c);var f=i.test(c);return f||s.test(c)?o(c.slice(2),f?2:8):a.test(c)?n:+c}return zw=l,zw}var Fw,T$;function BB(){if(T$)return Fw;T$=1;var e=FB(),t=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var i=a<0?-1:1;return i*r}return a===a?a:0}return Fw=n,Fw}var Bw,O$;function jue(){if(O$)return Bw;O$=1;var e=BB();function t(r){var n=e(r),a=n%1;return n===n?a?n-a:n:0}return Bw=t,Bw}var Vw,M$;function Sue(){if(M$)return Vw;M$=1;var e=TB(),t=On(),r=jue(),n=Math.max;function a(i,s,o){var l=i==null?0:i.length;if(!l)return-1;var c=o==null?0:r(o);return c<0&&(c=n(l+c,0)),e(i,t(s,3),c)}return Vw=a,Vw}var qw,R$;function VB(){if(R$)return qw;R$=1;var e=xue(),t=Sue(),r=e(t);return qw=r,qw}var Uw,$$;function qB(){if($$)return Uw;$$=1;var e=rg();function t(r){var n=r==null?0:r.length;return n?e(r,1):[]}return Uw=t,Uw}var Hw,D$;function kue(){if(D$)return Hw;D$=1;var e=TN(),t=lB(),r=Po();function n(a,i){return a==null?a:e(a,t(i),r)}return Hw=n,Hw}var Ww,I$;function UB(){if(I$)return Ww;I$=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Ww=e,Ww}var Gw,L$;function HB(){if(L$)return Gw;L$=1;var e=G0(),t=ON(),r=On();function n(a,i){var s={};return i=r(i,3),t(a,function(o,l,c){e(s,l,i(o,l,c))}),s}return Gw=n,Gw}var Kw,z$;function FN(){if(z$)return Kw;z$=1;var e=Ic();function t(r,n,a){for(var i=-1,s=r.length;++i<s;){var o=r[i],l=n(o);if(l!=null&&(c===void 0?l===l&&!e(l):a(l,c)))var c=l,d=o}return d}return Kw=t,Kw}var Yw,F$;function _ue(){if(F$)return Yw;F$=1;function e(t,r){return t>r}return Yw=e,Yw}var Xw,B$;function WB(){if(B$)return Xw;B$=1;var e=FN(),t=_ue(),r=Co();function n(a){return a&&a.length?e(a,r,t):void 0}return Xw=n,Xw}var Zw,V$;function GB(){if(V$)return Zw;V$=1;var e=G0(),t=Tc();function r(n,a,i){(i!==void 0&&!t(n[a],i)||i===void 0&&!(a in n))&&e(n,a,i)}return Zw=r,Zw}var Qw,q$;function KB(){if(q$)return Qw;q$=1;var e=pi,t=Q0(),r=Tn,n="[object Object]",a=Function.prototype,i=Object.prototype,s=a.toString,o=i.hasOwnProperty,l=s.call(Object);function c(d){if(!r(d)||e(d)!=n)return!1;var f=t(d);if(f===null)return!0;var h=o.call(f,"constructor")&&f.constructor;return typeof h=="function"&&h instanceof h&&s.call(h)==l}return Qw=c,Qw}var Jw,U$;function YB(){if(U$)return Jw;U$=1;function e(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}return Jw=e,Jw}var e1,H$;function Nue(){if(H$)return e1;H$=1;var e=Mf,t=Po();function r(n){return e(n,t(n))}return e1=r,e1}var t1,W$;function Eue(){if(W$)return t1;W$=1;var e=GB(),t=Y8(),r=aB(),n=X8(),a=sB(),i=Rf(),s=Rt(),o=MB(),l=Rc(),c=Mc(),d=$r(),f=KB(),h=$f(),p=YB(),g=Nue();function m(b,x,y,v,w,j,k){var S=p(b,y),N=p(x,y),E=k.get(N);if(E){e(b,y,E);return}var A=j?j(S,N,y+"",b,x,k):void 0,C=A===void 0;if(C){var M=s(N),T=!M&&l(N),P=!M&&!T&&h(N);A=N,M||T||P?s(S)?A=S:o(S)?A=n(S):T?(C=!1,A=t(N,!0)):P?(C=!1,A=r(N,!0)):A=[]:f(N)||i(N)?(A=S,i(S)?A=g(S):(!d(S)||c(S))&&(A=a(N))):C=!1}C&&(k.set(N,A),w(A,N,v,j,k),k.delete(N)),e(b,y,A)}return t1=m,t1}var r1,G$;function Pue(){if(G$)return r1;G$=1;var e=W0(),t=GB(),r=TN(),n=Eue(),a=$r(),i=Po(),s=YB();function o(l,c,d,f,h){l!==c&&r(c,function(p,g){if(h||(h=new e),a(p))n(l,c,g,d,o,f,h);else{var m=f?f(s(l,g),p,g+"",l,c,h):void 0;m===void 0&&(m=p),t(l,g,m)}},i)}return r1=o,r1}var n1,K$;function Cue(){if(K$)return n1;K$=1;var e=ng(),t=Lc();function r(n){return e(function(a,i){var s=-1,o=i.length,l=o>1?i[o-1]:void 0,c=o>2?i[2]:void 0;for(l=n.length>3&&typeof l=="function"?(o--,l):void 0,c&&t(i[0],i[1],c)&&(l=o<3?void 0:l,o=1),a=Object(a);++s<o;){var d=i[s];d&&n(a,d,s,l)}return a})}return n1=r,n1}var a1,Y$;function Aue(){if(Y$)return a1;Y$=1;var e=Pue(),t=Cue(),r=t(function(n,a,i){e(n,a,i)});return a1=r,a1}var i1,X$;function XB(){if(X$)return i1;X$=1;function e(t,r){return t<r}return i1=e,i1}var s1,Z$;function ZB(){if(Z$)return s1;Z$=1;var e=FN(),t=XB(),r=Co();function n(a){return a&&a.length?e(a,r,t):void 0}return s1=n,s1}var o1,Q$;function Tue(){if(Q$)return o1;Q$=1;var e=FN(),t=On(),r=XB();function n(a,i){return a&&a.length?e(a,t(i,2),r):void 0}return o1=n,o1}var l1,J$;function QB(){if(J$)return l1;J$=1;var e=ia(),t=function(){return e.Date.now()};return l1=t,l1}var c1,eD;function Oue(){if(eD)return c1;eD=1;var e=K0(),t=eg(),r=Y0(),n=$r(),a=Df();function i(s,o,l,c){if(!n(s))return s;o=t(o,s);for(var d=-1,f=o.length,h=f-1,p=s;p!=null&&++d<f;){var g=a(o[d]),m=l;if(g==="__proto__"||g==="constructor"||g==="prototype")return s;if(d!=h){var b=p[g];m=c?c(b,g,p):void 0,m===void 0&&(m=n(b)?b:r(o[d+1])?[]:{})}e(p,g,m),p=p[g]}return s}return c1=i,c1}var u1,tD;function Mue(){if(tD)return u1;tD=1;var e=tg(),t=Oue(),r=eg();function n(a,i,s){for(var o=-1,l=i.length,c={};++o<l;){var d=i[o],f=e(a,d);s(f,d)&&t(c,r(d,a),f)}return c}return u1=n,u1}var d1,rD;function Rue(){if(rD)return d1;rD=1;var e=Mue(),t=wB();function r(n,a){return e(n,a,function(i,s){return t(n,s)})}return d1=r,d1}var f1,nD;function $ue(){if(nD)return f1;nD=1;var e=qB(),t=CB(),r=AB();function n(a){return r(t(a,void 0,e),a+"")}return f1=n,f1}var h1,aD;function Due(){if(aD)return h1;aD=1;var e=Rue(),t=$ue(),r=t(function(n,a){return n==null?{}:e(n,a)});return h1=r,h1}var p1,iD;function Iue(){if(iD)return p1;iD=1;var e=Math.ceil,t=Math.max;function r(n,a,i,s){for(var o=-1,l=t(e((a-n)/(i||1)),0),c=Array(l);l--;)c[s?l:++o]=n,n+=i;return c}return p1=r,p1}var m1,sD;function Lue(){if(sD)return m1;sD=1;var e=Iue(),t=Lc(),r=BB();function n(a){return function(i,s,o){return o&&typeof o!="number"&&t(i,s,o)&&(s=o=void 0),i=r(i),s===void 0?(s=i,i=0):s=r(s),o=o===void 0?i<s?1:-1:r(o),e(i,s,o,a)}}return m1=n,m1}var g1,oD;function JB(){if(oD)return g1;oD=1;var e=Lue(),t=e();return g1=t,g1}var y1,lD;function zue(){if(lD)return y1;lD=1;function e(t,r){var n=t.length;for(t.sort(r);n--;)t[n]=t[n].value;return t}return y1=e,y1}var v1,cD;function Fue(){if(cD)return v1;cD=1;var e=Ic();function t(r,n){if(r!==n){var a=r!==void 0,i=r===null,s=r===r,o=e(r),l=n!==void 0,c=n===null,d=n===n,f=e(n);if(!c&&!f&&!o&&r>n||o&&l&&d&&!c&&!f||i&&l&&d||!a&&d||!s)return 1;if(!i&&!o&&!f&&r<n||f&&a&&s&&!i&&!o||c&&a&&s||!l&&s||!d)return-1}return 0}return v1=t,v1}var x1,uD;function Bue(){if(uD)return x1;uD=1;var e=Fue();function t(r,n,a){for(var i=-1,s=r.criteria,o=n.criteria,l=s.length,c=a.length;++i<l;){var d=e(s[i],o[i]);if(d){if(i>=c)return d;var f=a[i];return d*(f=="desc"?-1:1)}}return r.index-n.index}return x1=t,x1}var b1,dD;function Vue(){if(dD)return b1;dD=1;var e=J0(),t=tg(),r=On(),n=NB(),a=zue(),i=X0(),s=Bue(),o=Co(),l=Rt();function c(d,f,h){f.length?f=e(f,function(m){return l(m)?function(b){return t(b,m.length===1?m[0]:m)}:m}):f=[o];var p=-1;f=e(f,i(r));var g=n(d,function(m,b,x){var y=e(f,function(v){return v(m)});return{criteria:y,index:++p,value:m}});return a(g,function(m,b){return s(m,b,h)})}return b1=c,b1}var w1,fD;function e7(){if(fD)return w1;fD=1;var e=rg(),t=Vue(),r=ng(),n=Lc(),a=r(function(i,s){if(i==null)return[];var o=s.length;return o>1&&n(i,s[0],s[1])?s=[]:o>2&&n(s[0],s[1],s[2])&&(s=[s[0]]),t(i,e(s,1),[])});return w1=a,w1}var j1,hD;function que(){if(hD)return j1;hD=1;var e=DN(),t=0;function r(n){var a=++t;return e(n)+a}return j1=r,j1}var S1,pD;function Uue(){if(pD)return S1;pD=1;function e(t,r,n){for(var a=-1,i=t.length,s=r.length,o={};++a<i;){var l=a<s?r[a]:void 0;n(o,t[a],l)}return o}return S1=e,S1}var k1,mD;function Hue(){if(mD)return k1;mD=1;var e=K0(),t=Uue();function r(n,a){return t(n||[],a||[],e)}return k1=r,k1}var pm;if(typeof bN=="function")try{pm={cloneDeep:yue(),constant:AN(),defaults:vue(),each:uB(),filter:SB(),find:VB(),flatten:qB(),forEach:cB(),forIn:kue(),has:kB(),isUndefined:_B(),last:UB(),map:IN(),mapValues:HB(),max:WB(),merge:Aue(),min:ZB(),minBy:Tue(),now:QB(),pick:Due(),range:JB(),reduce:EB(),sortBy:e7(),uniqueId:que(),values:RB(),zipObject:Hue()}}catch{}pm||(pm=window._);var jt=pm,Wue=ag;function ag(){var e={};e._next=e._prev=e,this._sentinel=e}ag.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return t7(t),t};ag.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&t7(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t};ag.prototype.toString=function(){for(var e=[],t=this._sentinel,r=t._prev;r!==t;)e.push(JSON.stringify(r,Gue)),r=r._prev;return"["+e.join(", ")+"]"};function t7(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Gue(e,t){if(e!=="_next"&&e!=="_prev")return t}var Ia=jt,Kue=sa.Graph,Yue=Wue,Xue=Que,Zue=Ia.constant(1);function Que(e,t){if(e.nodeCount()<=1)return[];var r=ede(e,t||Zue),n=Jue(r.graph,r.buckets,r.zeroIdx);return Ia.flatten(Ia.map(n,function(a){return e.outEdges(a.v,a.w)}),!0)}function Jue(e,t,r){for(var n=[],a=t[t.length-1],i=t[0],s;e.nodeCount();){for(;s=i.dequeue();)_1(e,t,r,s);for(;s=a.dequeue();)_1(e,t,r,s);if(e.nodeCount()){for(var o=t.length-2;o>0;--o)if(s=t[o].dequeue(),s){n=n.concat(_1(e,t,r,s,!0));break}}}return n}function _1(e,t,r,n,a){var i=a?[]:void 0;return Ia.forEach(e.inEdges(n.v),function(s){var o=e.edge(s),l=e.node(s.v);a&&i.push({v:s.v,w:s.w}),l.out-=o,BS(t,r,l)}),Ia.forEach(e.outEdges(n.v),function(s){var o=e.edge(s),l=s.w,c=e.node(l);c.in-=o,BS(t,r,c)}),e.removeNode(n.v),i}function ede(e,t){var r=new Kue,n=0,a=0;Ia.forEach(e.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),Ia.forEach(e.edges(),function(o){var l=r.edge(o.v,o.w)||0,c=t(o),d=l+c;r.setEdge(o.v,o.w,d),a=Math.max(a,r.node(o.v).out+=c),n=Math.max(n,r.node(o.w).in+=c)});var i=Ia.range(a+n+3).map(function(){return new Yue}),s=n+1;return Ia.forEach(r.nodes(),function(o){BS(i,s,r.node(o))}),{graph:r,buckets:i,zeroIdx:s}}function BS(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}var Ws=jt,tde=Xue,rde={run:nde,undo:ide};function nde(e){var t=e.graph().acyclicer==="greedy"?tde(e,r(e)):ade(e);Ws.forEach(t,function(n){var a=e.edge(n);e.removeEdge(n),a.forwardName=n.name,a.reversed=!0,e.setEdge(n.w,n.v,a,Ws.uniqueId("rev"))});function r(n){return function(a){return n.edge(a).weight}}}function ade(e){var t=[],r={},n={};function a(i){Ws.has(n,i)||(n[i]=!0,r[i]=!0,Ws.forEach(e.outEdges(i),function(s){Ws.has(r,s.w)?t.push(s):a(s.w)}),delete r[i])}return Ws.forEach(e.nodes(),a),t}function ide(e){Ws.forEach(e.edges(),function(t){var r=e.edge(t);if(r.reversed){e.removeEdge(t);var n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}var He=jt,r7=sa.Graph,Hr={addDummyNode:n7,simplify:sde,asNonCompoundGraph:ode,successorWeights:lde,predecessorWeights:cde,intersectRect:ude,buildLayerMatrix:dde,normalizeRanks:fde,removeEmptyRanks:hde,addBorderNode:pde,maxRank:a7,partition:mde,time:gde,notime:yde};function n7(e,t,r,n){var a;do a=He.uniqueId(n);while(e.hasNode(a));return r.dummy=t,e.setNode(a,r),a}function sde(e){var t=new r7().setGraph(e.graph());return He.forEach(e.nodes(),function(r){t.setNode(r,e.node(r))}),He.forEach(e.edges(),function(r){var n=t.edge(r.v,r.w)||{weight:0,minlen:1},a=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+a.weight,minlen:Math.max(n.minlen,a.minlen)})}),t}function ode(e){var t=new r7({multigraph:e.isMultigraph()}).setGraph(e.graph());return He.forEach(e.nodes(),function(r){e.children(r).length||t.setNode(r,e.node(r))}),He.forEach(e.edges(),function(r){t.setEdge(r,e.edge(r))}),t}function lde(e){var t=He.map(e.nodes(),function(r){var n={};return He.forEach(e.outEdges(r),function(a){n[a.w]=(n[a.w]||0)+e.edge(a).weight}),n});return He.zipObject(e.nodes(),t)}function cde(e){var t=He.map(e.nodes(),function(r){var n={};return He.forEach(e.inEdges(r),function(a){n[a.v]=(n[a.v]||0)+e.edge(a).weight}),n});return He.zipObject(e.nodes(),t)}function ude(e,t){var r=e.x,n=e.y,a=t.x-r,i=t.y-n,s=e.width/2,o=e.height/2;if(!a&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var l,c;return Math.abs(i)*s>Math.abs(a)*o?(i<0&&(o=-o),l=o*a/i,c=o):(a<0&&(s=-s),l=s,c=s*i/a),{x:r+l,y:n+c}}function dde(e){var t=He.map(He.range(a7(e)+1),function(){return[]});return He.forEach(e.nodes(),function(r){var n=e.node(r),a=n.rank;He.isUndefined(a)||(t[a][n.order]=r)}),t}function fde(e){var t=He.min(He.map(e.nodes(),function(r){return e.node(r).rank}));He.forEach(e.nodes(),function(r){var n=e.node(r);He.has(n,"rank")&&(n.rank-=t)})}function hde(e){var t=He.min(He.map(e.nodes(),function(i){return e.node(i).rank})),r=[];He.forEach(e.nodes(),function(i){var s=e.node(i).rank-t;r[s]||(r[s]=[]),r[s].push(i)});var n=0,a=e.graph().nodeRankFactor;He.forEach(r,function(i,s){He.isUndefined(i)&&s%a!==0?--n:n&&He.forEach(i,function(o){e.node(o).rank+=n})})}function pde(e,t,r,n){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=n),n7(e,"border",a,t)}function a7(e){return He.max(He.map(e.nodes(),function(t){var r=e.node(t).rank;if(!He.isUndefined(r))return r}))}function mde(e,t){var r={lhs:[],rhs:[]};return He.forEach(e,function(n){t(n)?r.lhs.push(n):r.rhs.push(n)}),r}function gde(e,t){var r=He.now();try{return t()}finally{console.log(e+" time: "+(He.now()-r)+"ms")}}function yde(e,t){return t()}var i7=jt,vde=Hr,xde={run:bde,undo:jde};function bde(e){e.graph().dummyChains=[],i7.forEach(e.edges(),function(t){wde(e,t)})}function wde(e,t){var r=t.v,n=e.node(r).rank,a=t.w,i=e.node(a).rank,s=t.name,o=e.edge(t),l=o.labelRank;if(i!==n+1){e.removeEdge(t);var c,d,f;for(f=0,++n;n<i;++f,++n)o.points=[],d={width:0,height:0,edgeLabel:o,edgeObj:t,rank:n},c=vde.addDummyNode(e,"edge",d,"_d"),n===l&&(d.width=o.width,d.height=o.height,d.dummy="edge-label",d.labelpos=o.labelpos),e.setEdge(r,c,{weight:o.weight},s),f===0&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,a,{weight:o.weight},s)}}function jde(e){i7.forEach(e.graph().dummyChains,function(t){var r=e.node(t),n=r.edgeLabel,a;for(e.setEdge(r.edgeObj,n);r.dummy;)a=e.successors(t)[0],e.removeNode(t),n.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),t=a,r=e.node(t)})}var Th=jt,ig={longestPath:Sde,slack:kde};function Sde(e){var t={};function r(n){var a=e.node(n);if(Th.has(t,n))return a.rank;t[n]=!0;var i=Th.min(Th.map(e.outEdges(n),function(s){return r(s.w)-e.edge(s).minlen}));return(i===Number.POSITIVE_INFINITY||i===void 0||i===null)&&(i=0),a.rank=i}Th.forEach(e.sources(),r)}function kde(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var mm=jt,_de=sa.Graph,gm=ig.slack,s7=Nde;function Nde(e){var t=new _de({directed:!1}),r=e.nodes()[0],n=e.nodeCount();t.setNode(r,{});for(var a,i;Ede(t,e)<n;)a=Pde(t,e),i=t.hasNode(a.v)?gm(e,a):-gm(e,a),Cde(t,e,i);return t}function Ede(e,t){function r(n){mm.forEach(t.nodeEdges(n),function(a){var i=a.v,s=n===i?a.w:i;!e.hasNode(s)&&!gm(t,a)&&(e.setNode(s,{}),e.setEdge(n,s,{}),r(s))})}return mm.forEach(e.nodes(),r),e.nodeCount()}function Pde(e,t){return mm.minBy(t.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return gm(t,r)})}function Cde(e,t,r){mm.forEach(e.nodes(),function(n){t.node(n).rank+=r})}var ii=jt,Ade=s7,Tde=ig.slack,Ode=ig.longestPath,Mde=sa.alg.preorder,Rde=sa.alg.postorder,$de=Hr.simplify,Dde=Ao;Ao.initLowLimValues=VN;Ao.initCutValues=BN;Ao.calcCutValue=o7;Ao.leaveEdge=c7;Ao.enterEdge=u7;Ao.exchangeEdges=d7;function Ao(e){e=$de(e),Ode(e);var t=Ade(e);VN(t),BN(t,e);for(var r,n;r=c7(t);)n=u7(t,e,r),d7(t,e,r,n)}function BN(e,t){var r=Rde(e,e.nodes());r=r.slice(0,r.length-1),ii.forEach(r,function(n){Ide(e,t,n)})}function Ide(e,t,r){var n=e.node(r),a=n.parent;e.edge(r,a).cutvalue=o7(e,t,r)}function o7(e,t,r){var n=e.node(r),a=n.parent,i=!0,s=t.edge(r,a),o=0;return s||(i=!1,s=t.edge(a,r)),o=s.weight,ii.forEach(t.nodeEdges(r),function(l){var c=l.v===r,d=c?l.w:l.v;if(d!==a){var f=c===i,h=t.edge(l).weight;if(o+=f?h:-h,zde(e,r,d)){var p=e.edge(r,d).cutvalue;o+=f?-p:p}}}),o}function VN(e,t){arguments.length<2&&(t=e.nodes()[0]),l7(e,{},1,t)}function l7(e,t,r,n,a){var i=r,s=e.node(n);return t[n]=!0,ii.forEach(e.neighbors(n),function(o){ii.has(t,o)||(r=l7(e,t,r,o,n))}),s.low=i,s.lim=r++,a?s.parent=a:delete s.parent,r}function c7(e){return ii.find(e.edges(),function(t){return e.edge(t).cutvalue<0})}function u7(e,t,r){var n=r.v,a=r.w;t.hasEdge(n,a)||(n=r.w,a=r.v);var i=e.node(n),s=e.node(a),o=i,l=!1;i.lim>s.lim&&(o=s,l=!0);var c=ii.filter(t.edges(),function(d){return l===gD(e,e.node(d.v),o)&&l!==gD(e,e.node(d.w),o)});return ii.minBy(c,function(d){return Tde(t,d)})}function d7(e,t,r,n){var a=r.v,i=r.w;e.removeEdge(a,i),e.setEdge(n.v,n.w,{}),VN(e),BN(e,t),Lde(e,t)}function Lde(e,t){var r=ii.find(e.nodes(),function(a){return!t.node(a).parent}),n=Mde(e,r);n=n.slice(1),ii.forEach(n,function(a){var i=e.node(a).parent,s=t.edge(a,i),o=!1;s||(s=t.edge(i,a),o=!0),t.node(a).rank=t.node(i).rank+(o?s.minlen:-s.minlen)})}function zde(e,t,r){return e.hasEdge(t,r)}function gD(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}var Fde=ig,f7=Fde.longestPath,Bde=s7,Vde=Dde,qde=Ude;function Ude(e){switch(e.graph().ranker){case"network-simplex":yD(e);break;case"tight-tree":Wde(e);break;case"longest-path":Hde(e);break;default:yD(e)}}var Hde=f7;function Wde(e){f7(e),Bde(e)}function yD(e){Vde(e)}var VS=jt,Gde=Kde;function Kde(e){var t=Xde(e);VS.forEach(e.graph().dummyChains,function(r){for(var n=e.node(r),a=n.edgeObj,i=Yde(e,t,a.v,a.w),s=i.path,o=i.lca,l=0,c=s[l],d=!0;r!==a.w;){if(n=e.node(r),d){for(;(c=s[l])!==o&&e.node(c).maxRank<n.rank;)l++;c===o&&(d=!1)}if(!d){for(;l<s.length-1&&e.node(c=s[l+1]).minRank<=n.rank;)l++;c=s[l]}e.setParent(r,c),r=e.successors(r)[0]}})}function Yde(e,t,r,n){var a=[],i=[],s=Math.min(t[r].low,t[n].low),o=Math.max(t[r].lim,t[n].lim),l,c;l=r;do l=e.parent(l),a.push(l);while(l&&(t[l].low>s||o>t[l].lim));for(c=l,l=n;(l=e.parent(l))!==c;)i.push(l);return{path:a.concat(i.reverse()),lca:c}}function Xde(e){var t={},r=0;function n(a){var i=r;VS.forEach(e.children(a),n),t[a]={low:i,lim:r++}}return VS.forEach(e.children(),n),t}var La=jt,qS=Hr,Zde={run:Qde,cleanup:tfe};function Qde(e){var t=qS.addDummyNode(e,"root",{},"_root"),r=Jde(e),n=La.max(La.values(r))-1,a=2*n+1;e.graph().nestingRoot=t,La.forEach(e.edges(),function(s){e.edge(s).minlen*=a});var i=efe(e)+1;La.forEach(e.children(),function(s){h7(e,t,a,i,n,r,s)}),e.graph().nodeRankFactor=a}function h7(e,t,r,n,a,i,s){var o=e.children(s);if(!o.length){s!==t&&e.setEdge(t,s,{weight:0,minlen:r});return}var l=qS.addBorderNode(e,"_bt"),c=qS.addBorderNode(e,"_bb"),d=e.node(s);e.setParent(l,s),d.borderTop=l,e.setParent(c,s),d.borderBottom=c,La.forEach(o,function(f){h7(e,t,r,n,a,i,f);var h=e.node(f),p=h.borderTop?h.borderTop:f,g=h.borderBottom?h.borderBottom:f,m=h.borderTop?n:2*n,b=p!==g?1:a-i[s]+1;e.setEdge(l,p,{weight:m,minlen:b,nestingEdge:!0}),e.setEdge(g,c,{weight:m,minlen:b,nestingEdge:!0})}),e.parent(s)||e.setEdge(t,l,{weight:0,minlen:a+i[s]})}function Jde(e){var t={};function r(n,a){var i=e.children(n);i&&i.length&&La.forEach(i,function(s){r(s,a+1)}),t[n]=a}return La.forEach(e.children(),function(n){r(n,1)}),t}function efe(e){return La.reduce(e.edges(),function(t,r){return t+e.edge(r).weight},0)}function tfe(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,La.forEach(e.edges(),function(r){var n=e.edge(r);n.nestingEdge&&e.removeEdge(r)})}var N1=jt,rfe=Hr,nfe=afe;function afe(e){function t(r){var n=e.children(r),a=e.node(r);if(n.length&&N1.forEach(n,t),N1.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var i=a.minRank,s=a.maxRank+1;i<s;++i)vD(e,"borderLeft","_bl",r,a,i),vD(e,"borderRight","_br",r,a,i)}}N1.forEach(e.children(),t)}function vD(e,t,r,n,a,i){var s={width:0,height:0,rank:i,borderType:t},o=a[t][i-1],l=rfe.addDummyNode(e,"border",s,r);a[t][i]=l,e.setParent(l,n),o&&e.setEdge(o,l,{weight:1})}var ha=jt,ife={adjust:sfe,undo:ofe};function sfe(e){var t=e.graph().rankdir.toLowerCase();(t==="lr"||t==="rl")&&p7(e)}function ofe(e){var t=e.graph().rankdir.toLowerCase();(t==="bt"||t==="rl")&&lfe(e),(t==="lr"||t==="rl")&&(cfe(e),p7(e))}function p7(e){ha.forEach(e.nodes(),function(t){xD(e.node(t))}),ha.forEach(e.edges(),function(t){xD(e.edge(t))})}function xD(e){var t=e.width;e.width=e.height,e.height=t}function lfe(e){ha.forEach(e.nodes(),function(t){E1(e.node(t))}),ha.forEach(e.edges(),function(t){var r=e.edge(t);ha.forEach(r.points,E1),ha.has(r,"y")&&E1(r)})}function E1(e){e.y=-e.y}function cfe(e){ha.forEach(e.nodes(),function(t){P1(e.node(t))}),ha.forEach(e.edges(),function(t){var r=e.edge(t);ha.forEach(r.points,P1),ha.has(r,"x")&&P1(r)})}function P1(e){var t=e.x;e.x=e.y,e.y=t}var Aa=jt,ufe=dfe;function dfe(e){var t={},r=Aa.filter(e.nodes(),function(o){return!e.children(o).length}),n=Aa.max(Aa.map(r,function(o){return e.node(o).rank})),a=Aa.map(Aa.range(n+1),function(){return[]});function i(o){if(!Aa.has(t,o)){t[o]=!0;var l=e.node(o);a[l.rank].push(o),Aa.forEach(e.successors(o),i)}}var s=Aa.sortBy(r,function(o){return e.node(o).rank});return Aa.forEach(s,i),a}var Pi=jt,ffe=hfe;function hfe(e,t){for(var r=0,n=1;n<t.length;++n)r+=pfe(e,t[n-1],t[n]);return r}function pfe(e,t,r){for(var n=Pi.zipObject(r,Pi.map(r,function(c,d){return d})),a=Pi.flatten(Pi.map(t,function(c){return Pi.sortBy(Pi.map(e.outEdges(c),function(d){return{pos:n[d.w],weight:e.edge(d).weight}}),"pos")}),!0),i=1;i<r.length;)i<<=1;var s=2*i-1;i-=1;var o=Pi.map(new Array(s),function(){return 0}),l=0;return Pi.forEach(a.forEach(function(c){var d=c.pos+i;o[d]+=c.weight;for(var f=0;d>0;)d%2&&(f+=o[d+1]),d=d-1>>1,o[d]+=c.weight;l+=c.weight*f})),l}var bD=jt,mfe=gfe;function gfe(e,t){return bD.map(t,function(r){var n=e.inEdges(r);if(n.length){var a=bD.reduce(n,function(i,s){var o=e.edge(s),l=e.node(s.v);return{sum:i.sum+o.weight*l.order,weight:i.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:r}})}var Zr=jt,yfe=vfe;function vfe(e,t){var r={};Zr.forEach(e,function(a,i){var s=r[a.v]={indegree:0,in:[],out:[],vs:[a.v],i};Zr.isUndefined(a.barycenter)||(s.barycenter=a.barycenter,s.weight=a.weight)}),Zr.forEach(t.edges(),function(a){var i=r[a.v],s=r[a.w];!Zr.isUndefined(i)&&!Zr.isUndefined(s)&&(s.indegree++,i.out.push(r[a.w]))});var n=Zr.filter(r,function(a){return!a.indegree});return xfe(n)}function xfe(e){var t=[];function r(i){return function(s){s.merged||(Zr.isUndefined(s.barycenter)||Zr.isUndefined(i.barycenter)||s.barycenter>=i.barycenter)&&bfe(i,s)}}function n(i){return function(s){s.in.push(i),--s.indegree===0&&e.push(s)}}for(;e.length;){var a=e.pop();t.push(a),Zr.forEach(a.in.reverse(),r(a)),Zr.forEach(a.out,n(a))}return Zr.map(Zr.filter(t,function(i){return!i.merged}),function(i){return Zr.pick(i,["vs","i","barycenter","weight"])})}function bfe(e,t){var r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}var Du=jt,wfe=Hr,jfe=Sfe;function Sfe(e,t){var r=wfe.partition(e,function(d){return Du.has(d,"barycenter")}),n=r.lhs,a=Du.sortBy(r.rhs,function(d){return-d.i}),i=[],s=0,o=0,l=0;n.sort(kfe(!!t)),l=wD(i,a,l),Du.forEach(n,function(d){l+=d.vs.length,i.push(d.vs),s+=d.barycenter*d.weight,o+=d.weight,l=wD(i,a,l)});var c={vs:Du.flatten(i,!0)};return o&&(c.barycenter=s/o,c.weight=o),c}function wD(e,t,r){for(var n;t.length&&(n=Du.last(t)).i<=r;)t.pop(),e.push(n.vs),r++;return r}function kfe(e){return function(t,r){return t.barycenter<r.barycenter?-1:t.barycenter>r.barycenter?1:e?r.i-t.i:t.i-r.i}}var Li=jt,_fe=mfe,Nfe=yfe,Efe=jfe,Pfe=m7;function m7(e,t,r,n){var a=e.children(t),i=e.node(t),s=i?i.borderLeft:void 0,o=i?i.borderRight:void 0,l={};s&&(a=Li.filter(a,function(g){return g!==s&&g!==o}));var c=_fe(e,a);Li.forEach(c,function(g){if(e.children(g.v).length){var m=m7(e,g.v,r,n);l[g.v]=m,Li.has(m,"barycenter")&&Afe(g,m)}});var d=Nfe(c,r);Cfe(d,l);var f=Efe(d,n);if(s&&(f.vs=Li.flatten([s,f.vs,o],!0),e.predecessors(s).length)){var h=e.node(e.predecessors(s)[0]),p=e.node(e.predecessors(o)[0]);Li.has(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+h.order+p.order)/(f.weight+2),f.weight+=2}return f}function Cfe(e,t){Li.forEach(e,function(r){r.vs=Li.flatten(r.vs.map(function(n){return t[n]?t[n].vs:n}),!0)})}function Afe(e,t){Li.isUndefined(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}var Iu=jt,Tfe=sa.Graph,Ofe=Mfe;function Mfe(e,t,r){var n=Rfe(e),a=new Tfe({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(i){return e.node(i)});return Iu.forEach(e.nodes(),function(i){var s=e.node(i),o=e.parent(i);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(a.setNode(i),a.setParent(i,o||n),Iu.forEach(e[r](i),function(l){var c=l.v===i?l.w:l.v,d=a.edge(c,i),f=Iu.isUndefined(d)?0:d.weight;a.setEdge(c,i,{weight:e.edge(l).weight+f})}),Iu.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))}),a}function Rfe(e){for(var t;e.hasNode(t=Iu.uniqueId("_root")););return t}var $fe=jt,Dfe=Ife;function Ife(e,t,r){var n={},a;$fe.forEach(r,function(i){for(var s=e.parent(i),o,l;s;){if(o=e.parent(s),o?(l=n[o],n[o]=s):(l=a,a=s),l&&l!==s){t.setEdge(l,s);return}s=o}})}var es=jt,Lfe=ufe,zfe=ffe,Ffe=Pfe,Bfe=Ofe,Vfe=Dfe,qfe=sa.Graph,jD=Hr,Ufe=Hfe;function Hfe(e){var t=jD.maxRank(e),r=SD(e,es.range(1,t+1),"inEdges"),n=SD(e,es.range(t-1,-1,-1),"outEdges"),a=Lfe(e);kD(e,a);for(var i=Number.POSITIVE_INFINITY,s,o=0,l=0;l<4;++o,++l){Wfe(o%2?r:n,o%4>=2),a=jD.buildLayerMatrix(e);var c=zfe(e,a);c<i&&(l=0,s=es.cloneDeep(a),i=c)}kD(e,s)}function SD(e,t,r){return es.map(t,function(n){return Bfe(e,n,r)})}function Wfe(e,t){var r=new qfe;es.forEach(e,function(n){var a=n.graph().root,i=Ffe(n,a,r,t);es.forEach(i.vs,function(s,o){n.node(s).order=o}),Vfe(n,r,i.vs)})}function kD(e,t){es.forEach(t,function(r){es.forEach(r,function(n,a){e.node(n).order=a})})}var Ne=jt,Gfe=sa.Graph,Kfe=Hr,Yfe={positionX:she};function Xfe(e,t){var r={};function n(a,i){var s=0,o=0,l=a.length,c=Ne.last(i);return Ne.forEach(i,function(d,f){var h=Qfe(e,d),p=h?e.node(h).order:l;(h||d===c)&&(Ne.forEach(i.slice(o,f+1),function(g){Ne.forEach(e.predecessors(g),function(m){var b=e.node(m),x=b.order;(x<s||p<x)&&!(b.dummy&&e.node(g).dummy)&&g7(r,m,g)})}),o=f+1,s=p)}),i}return Ne.reduce(t,n),r}function Zfe(e,t){var r={};function n(i,s,o,l,c){var d;Ne.forEach(Ne.range(s,o),function(f){d=i[f],e.node(d).dummy&&Ne.forEach(e.predecessors(d),function(h){var p=e.node(h);p.dummy&&(p.order<l||p.order>c)&&g7(r,h,d)})})}function a(i,s){var o=-1,l,c=0;return Ne.forEach(s,function(d,f){if(e.node(d).dummy==="border"){var h=e.predecessors(d);h.length&&(l=e.node(h[0]).order,n(s,c,f,o,l),c=f,o=l)}n(s,c,s.length,l,i.length)}),s}return Ne.reduce(t,a),r}function Qfe(e,t){if(e.node(t).dummy)return Ne.find(e.predecessors(t),function(r){return e.node(r).dummy})}function g7(e,t,r){if(t>r){var n=t;t=r,r=n}var a=e[t];a||(e[t]=a={}),a[r]=!0}function Jfe(e,t,r){if(t>r){var n=t;t=r,r=n}return Ne.has(e[t],r)}function ehe(e,t,r,n){var a={},i={},s={};return Ne.forEach(t,function(o){Ne.forEach(o,function(l,c){a[l]=l,i[l]=l,s[l]=c})}),Ne.forEach(t,function(o){var l=-1;Ne.forEach(o,function(c){var d=n(c);if(d.length){d=Ne.sortBy(d,function(m){return s[m]});for(var f=(d.length-1)/2,h=Math.floor(f),p=Math.ceil(f);h<=p;++h){var g=d[h];i[c]===c&&l<s[g]&&!Jfe(r,c,g)&&(i[g]=c,i[c]=a[c]=a[g],l=s[g])}}})}),{root:a,align:i}}function the(e,t,r,n,a){var i={},s=rhe(e,t,r,a),o=a?"borderLeft":"borderRight";function l(f,h){for(var p=s.nodes(),g=p.pop(),m={};g;)m[g]?f(g):(m[g]=!0,p.push(g),p=p.concat(h(g))),g=p.pop()}function c(f){i[f]=s.inEdges(f).reduce(function(h,p){return Math.max(h,i[p.v]+s.edge(p))},0)}function d(f){var h=s.outEdges(f).reduce(function(g,m){return Math.min(g,i[m.w]-s.edge(m))},Number.POSITIVE_INFINITY),p=e.node(f);h!==Number.POSITIVE_INFINITY&&p.borderType!==o&&(i[f]=Math.max(i[f],h))}return l(c,s.predecessors.bind(s)),l(d,s.successors.bind(s)),Ne.forEach(n,function(f){i[f]=i[r[f]]}),i}function rhe(e,t,r,n){var a=new Gfe,i=e.graph(),s=ohe(i.nodesep,i.edgesep,n);return Ne.forEach(t,function(o){var l;Ne.forEach(o,function(c){var d=r[c];if(a.setNode(d),l){var f=r[l],h=a.edge(f,d);a.setEdge(f,d,Math.max(s(e,c,l),h||0))}l=c})}),a}function nhe(e,t){return Ne.minBy(Ne.values(t),function(r){var n=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return Ne.forIn(r,function(i,s){var o=lhe(e,s)/2;n=Math.max(i+o,n),a=Math.min(i-o,a)}),n-a})}function ahe(e,t){var r=Ne.values(t),n=Ne.min(r),a=Ne.max(r);Ne.forEach(["u","d"],function(i){Ne.forEach(["l","r"],function(s){var o=i+s,l=e[o],c;if(l!==t){var d=Ne.values(l);c=s==="l"?n-Ne.min(d):a-Ne.max(d),c&&(e[o]=Ne.mapValues(l,function(f){return f+c}))}})})}function ihe(e,t){return Ne.mapValues(e.ul,function(r,n){if(t)return e[t.toLowerCase()][n];var a=Ne.sortBy(Ne.map(e,n));return(a[1]+a[2])/2})}function she(e){var t=Kfe.buildLayerMatrix(e),r=Ne.merge(Xfe(e,t),Zfe(e,t)),n={},a;Ne.forEach(["u","d"],function(s){a=s==="u"?t:Ne.values(t).reverse(),Ne.forEach(["l","r"],function(o){o==="r"&&(a=Ne.map(a,function(f){return Ne.values(f).reverse()}));var l=(s==="u"?e.predecessors:e.successors).bind(e),c=ehe(e,a,r,l),d=the(e,a,c.root,c.align,o==="r");o==="r"&&(d=Ne.mapValues(d,function(f){return-f})),n[s+o]=d})});var i=nhe(e,n);return ahe(n,i),ihe(n,e.graph().align)}function ohe(e,t,r){return function(n,a,i){var s=n.node(a),o=n.node(i),l=0,c;if(l+=s.width/2,Ne.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":c=-s.width/2;break;case"r":c=s.width/2;break}if(c&&(l+=r?c:-c),c=0,l+=(s.dummy?t:e)/2,l+=(o.dummy?t:e)/2,l+=o.width/2,Ne.has(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":c=o.width/2;break;case"r":c=-o.width/2;break}return c&&(l+=r?c:-c),c=0,l}}function lhe(e,t){return e.node(t).width}var Lu=jt,y7=Hr,che=Yfe.positionX,uhe=dhe;function dhe(e){e=y7.asNonCompoundGraph(e),fhe(e),Lu.forEach(che(e),function(t,r){e.node(r).x=t})}function fhe(e){var t=y7.buildLayerMatrix(e),r=e.graph().ranksep,n=0;Lu.forEach(t,function(a){var i=Lu.max(Lu.map(a,function(s){return e.node(s).height}));Lu.forEach(a,function(s){e.node(s).y=n+i/2}),n+=i+r})}var Ae=jt,_D=rde,ND=xde,hhe=qde,phe=Hr.normalizeRanks,mhe=Gde,ghe=Hr.removeEmptyRanks,ED=Zde,yhe=nfe,PD=ife,vhe=Ufe,xhe=uhe,fs=Hr,bhe=sa.Graph,whe=jhe;function jhe(e,t){var r=t&&t.debugTiming?fs.time:fs.notime;r("layout",function(){var n=r(" buildLayoutGraph",function(){return Mhe(e)});r(" runLayout",function(){She(n,r)}),r(" updateInputGraph",function(){khe(e,n)})})}function She(e,t){t(" makeSpaceForEdgeLabels",function(){Rhe(e)}),t(" removeSelfEdges",function(){qhe(e)}),t(" acyclic",function(){_D.run(e)}),t(" nestingGraph.run",function(){ED.run(e)}),t(" rank",function(){hhe(fs.asNonCompoundGraph(e))}),t(" injectEdgeLabelProxies",function(){$he(e)}),t(" removeEmptyRanks",function(){ghe(e)}),t(" nestingGraph.cleanup",function(){ED.cleanup(e)}),t(" normalizeRanks",function(){phe(e)}),t(" assignRankMinMax",function(){Dhe(e)}),t(" removeEdgeLabelProxies",function(){Ihe(e)}),t(" normalize.run",function(){ND.run(e)}),t(" parentDummyChains",function(){mhe(e)}),t(" addBorderSegments",function(){yhe(e)}),t(" order",function(){vhe(e)}),t(" insertSelfEdges",function(){Uhe(e)}),t(" adjustCoordinateSystem",function(){PD.adjust(e)}),t(" position",function(){xhe(e)}),t(" positionSelfEdges",function(){Hhe(e)}),t(" removeBorderNodes",function(){Vhe(e)}),t(" normalize.undo",function(){ND.undo(e)}),t(" fixupEdgeLabelCoords",function(){Fhe(e)}),t(" undoCoordinateSystem",function(){PD.undo(e)}),t(" translateGraph",function(){Lhe(e)}),t(" assignNodeIntersects",function(){zhe(e)}),t(" reversePoints",function(){Bhe(e)}),t(" acyclic.undo",function(){_D.undo(e)})}function khe(e,t){Ae.forEach(e.nodes(),function(r){var n=e.node(r),a=t.node(r);n&&(n.x=a.x,n.y=a.y,t.children(r).length&&(n.width=a.width,n.height=a.height))}),Ae.forEach(e.edges(),function(r){var n=e.edge(r),a=t.edge(r);n.points=a.points,Ae.has(a,"x")&&(n.x=a.x,n.y=a.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var _he=["nodesep","edgesep","ranksep","marginx","marginy"],Nhe={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Ehe=["acyclicer","ranker","rankdir","align"],Phe=["width","height"],Che={width:0,height:0},Ahe=["minlen","weight","width","height","labeloffset"],The={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ohe=["labelpos"];function Mhe(e){var t=new bhe({multigraph:!0,compound:!0}),r=A1(e.graph());return t.setGraph(Ae.merge({},Nhe,C1(r,_he),Ae.pick(r,Ehe))),Ae.forEach(e.nodes(),function(n){var a=A1(e.node(n));t.setNode(n,Ae.defaults(C1(a,Phe),Che)),t.setParent(n,e.parent(n))}),Ae.forEach(e.edges(),function(n){var a=A1(e.edge(n));t.setEdge(n,Ae.merge({},The,C1(a,Ahe),Ae.pick(a,Ohe)))}),t}function Rhe(e){var t=e.graph();t.ranksep/=2,Ae.forEach(e.edges(),function(r){var n=e.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function $he(e){Ae.forEach(e.edges(),function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v),a=e.node(t.w),i={rank:(a.rank-n.rank)/2+n.rank,e:t};fs.addDummyNode(e,"edge-proxy",i,"_ep")}})}function Dhe(e){var t=0;Ae.forEach(e.nodes(),function(r){var n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=Ae.max(t,n.maxRank))}),e.graph().maxRank=t}function Ihe(e){Ae.forEach(e.nodes(),function(t){var r=e.node(t);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}function Lhe(e){var t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,a=0,i=e.graph(),s=i.marginx||0,o=i.marginy||0;function l(c){var d=c.x,f=c.y,h=c.width,p=c.height;t=Math.min(t,d-h/2),r=Math.max(r,d+h/2),n=Math.min(n,f-p/2),a=Math.max(a,f+p/2)}Ae.forEach(e.nodes(),function(c){l(e.node(c))}),Ae.forEach(e.edges(),function(c){var d=e.edge(c);Ae.has(d,"x")&&l(d)}),t-=s,n-=o,Ae.forEach(e.nodes(),function(c){var d=e.node(c);d.x-=t,d.y-=n}),Ae.forEach(e.edges(),function(c){var d=e.edge(c);Ae.forEach(d.points,function(f){f.x-=t,f.y-=n}),Ae.has(d,"x")&&(d.x-=t),Ae.has(d,"y")&&(d.y-=n)}),i.width=r-t+s,i.height=a-n+o}function zhe(e){Ae.forEach(e.edges(),function(t){var r=e.edge(t),n=e.node(t.v),a=e.node(t.w),i,s;r.points?(i=r.points[0],s=r.points[r.points.length-1]):(r.points=[],i=a,s=n),r.points.unshift(fs.intersectRect(n,i)),r.points.push(fs.intersectRect(a,s))})}function Fhe(e){Ae.forEach(e.edges(),function(t){var r=e.edge(t);if(Ae.has(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Bhe(e){Ae.forEach(e.edges(),function(t){var r=e.edge(t);r.reversed&&r.points.reverse()})}function Vhe(e){Ae.forEach(e.nodes(),function(t){if(e.children(t).length){var r=e.node(t),n=e.node(r.borderTop),a=e.node(r.borderBottom),i=e.node(Ae.last(r.borderLeft)),s=e.node(Ae.last(r.borderRight));r.width=Math.abs(s.x-i.x),r.height=Math.abs(a.y-n.y),r.x=i.x+r.width/2,r.y=n.y+r.height/2}}),Ae.forEach(e.nodes(),function(t){e.node(t).dummy==="border"&&e.removeNode(t)})}function qhe(e){Ae.forEach(e.edges(),function(t){if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Uhe(e){var t=fs.buildLayerMatrix(e);Ae.forEach(t,function(r){var n=0;Ae.forEach(r,function(a,i){var s=e.node(a);s.order=i+n,Ae.forEach(s.selfEdges,function(o){fs.addDummyNode(e,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:i+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function Hhe(e){Ae.forEach(e.nodes(),function(t){var r=e.node(t);if(r.dummy==="selfedge"){var n=e.node(r.e.v),a=n.x+n.width/2,i=n.y,s=r.x-a,o=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:a+2*s/3,y:i-o},{x:a+5*s/6,y:i-o},{x:a+s,y:i},{x:a+5*s/6,y:i+o},{x:a+2*s/3,y:i+o}],r.label.x=r.x,r.label.y=r.y}})}function C1(e,t){return Ae.mapValues(Ae.pick(e,t),Number)}function A1(e){var t={};return Ae.forEach(e,function(r,n){t[n.toLowerCase()]=r}),t}var Oh=jt,Whe=Hr,Ghe=sa.Graph,Khe={debugOrdering:Yhe};function Yhe(e){var t=Whe.buildLayerMatrix(e),r=new Ghe({compound:!0,multigraph:!0}).setGraph({});return Oh.forEach(e.nodes(),function(n){r.setNode(n,{label:n}),r.setParent(n,"layer"+e.node(n).rank)}),Oh.forEach(e.edges(),function(n){r.setEdge(n.v,n.w,{},n.name)}),Oh.forEach(t,function(n,a){var i="layer"+a;r.setNode(i,{rank:"same"}),Oh.reduce(n,function(s,o){return r.setEdge(s,o,{style:"invis"}),o})}),r}var Xhe="0.8.5",Zhe={graphlib:sa,layout:whe,debug:Khe,util:{time:Hr.time,notime:Hr.notime},version:Xhe};const CD=Ke(Zhe),US=240,HS=100,AD=180,WS=50,Qhe=(e,t,r="TB")=>{const n=new CD.graphlib.Graph;n.setDefaultEdgeLabel(()=>({}));const a=r==="LR";return n.setGraph({rankdir:r,nodesep:80,ranksep:100}),e.forEach(i=>{const s=i.type==="artifact"?AD:US,o=i.type==="artifact"?WS:HS;n.setNode(i.id,{width:s,height:o})}),t.forEach(i=>{n.setEdge(i.source,i.target)}),CD.layout(n),e.forEach(i=>{const s=n.node(i.id);i.targetPosition=a?"left":"top",i.sourcePosition=a?"right":"bottom";const o=i.type==="artifact"?AD:US,l=i.type==="artifact"?WS:HS;return i.position={x:s.x-o/2,y:s.y-l/2},i}),{nodes:e,edges:t}};function v7({dag:e,steps:t,selectedStep:r,onStepSelect:n}){const{nodes:a,edges:i}=_.useMemo(()=>{if(!e||!e.nodes)return{nodes:[],edges:[]};const b=[],x=[],y=new Set,v=new Map,w=j=>{if(v.has(j))return v.get(j);const k=`artifact-${j}`;return y.has(k)||(b.push({id:k,type:"artifact",data:{label:j}}),y.add(k),v.set(j,k)),k};return e.nodes.forEach(j=>{var N,E;const k=(t==null?void 0:t[j.id])||{},S=k.success?"success":k.error?"failed":k.running?"running":"pending";b.push({id:j.id,type:"step",data:{label:j.name,status:S,duration:k.duration,cached:k.cached,selected:r===j.id}}),(N=j.inputs)==null||N.forEach(A=>{const C=w(A);x.push({id:`e-${C}-${j.id}`,source:C,target:j.id,type:"smoothstep",animated:!0,style:{stroke:"#94a3b8",strokeWidth:2},markerEnd:{type:Zl.ArrowClosed,color:"#94a3b8"}})}),(E=j.outputs)==null||E.forEach(A=>{const C=w(A);x.push({id:`e-${j.id}-${C}`,source:j.id,target:C,type:"smoothstep",animated:!0,style:{stroke:"#94a3b8",strokeWidth:2},markerEnd:{type:Zl.ArrowClosed,color:"#94a3b8"}})})}),{nodes:b,edges:x}},[e,t,r]),{nodes:s,edges:o}=_.useMemo(()=>Qhe(a,i,"TB"),[a,i]),[l,c,d]=Ise(s),[f,h,p]=Lse(o);_.useEffect(()=>{c(s.map(b=>b.type==="step"?{...b,data:{...b.data,selected:r===b.id}}:b)),h(o)},[s,o,r,c,h]);const g=_.useCallback((b,x)=>{x.type==="step"&&n&&n(x.id)},[n]),m=_.useMemo(()=>({step:Jhe,artifact:epe}),[]);return u.jsx("div",{className:"w-full h-full bg-slate-50/50 rounded-xl border border-slate-200 overflow-hidden",children:u.jsxs(I8,{nodes:l,edges:f,onNodesChange:d,onEdgesChange:p,onNodeClick:g,nodeTypes:m,fitView:!0,attributionPosition:"bottom-left",minZoom:.2,maxZoom:1.5,defaultViewport:{x:0,y:0,zoom:.8},fitViewOptions:{padding:.2},children:[u.jsx(ooe,{color:"#e2e8f0",gap:20,size:1}),u.jsx(toe,{className:"bg-white border border-slate-200 shadow-sm rounded-lg"}),u.jsx(Kse,{nodeColor:b=>b.type==="step"?"#3b82f6":"#cbd5e1",maskColor:"rgba(241, 245, 249, 0.7)",className:"bg-white border border-slate-200 shadow-sm rounded-lg"})]})})}function Jhe({data:e}){const t={success:{icon:u.jsx(Lt,{size:18}),color:"text-emerald-600",bg:"bg-white",border:"border-emerald-500",ring:"ring-emerald-200",shadow:"shadow-emerald-100"},failed:{icon:u.jsx(pr,{size:18}),color:"text-rose-600",bg:"bg-white",border:"border-rose-500",ring:"ring-rose-200",shadow:"shadow-rose-100"},running:{icon:u.jsx(p6,{size:18,className:"animate-spin"}),color:"text-amber-600",bg:"bg-white",border:"border-amber-500",ring:"ring-amber-200",shadow:"shadow-amber-100"},pending:{icon:u.jsx(tt,{size:18}),color:"text-slate-400",bg:"bg-slate-50",border:"border-slate-300",ring:"ring-slate-200",shadow:"shadow-slate-100"}},r=t[e.status]||t.pending;return u.jsxs("div",{className:`
505
- relative px-4 py-3 rounded-lg border-2 transition-all duration-200
506
- ${r.bg} ${r.border}
507
- ${e.selected?`ring-4 ${r.ring} shadow-lg`:`hover:shadow-md ${r.shadow}`}
508
- `,style:{width:US,height:HS},children:[u.jsx(ds,{type:"target",position:me.Top,className:"!bg-slate-400 !w-2 !h-2"}),u.jsxs("div",{className:"flex flex-col h-full justify-between",children:[u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("div",{className:`p-1.5 rounded-md bg-slate-50 border border-slate-100 ${r.color}`,children:r.icon}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("h3",{className:"font-bold text-slate-900 text-sm truncate",title:e.label,children:e.label}),u.jsx("p",{className:"text-xs text-slate-500 capitalize",children:e.status})]})]}),e.duration!==void 0&&u.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-slate-100 mt-1",children:[u.jsxs("span",{className:"text-xs text-slate-400 font-mono",children:[e.duration.toFixed(2),"s"]}),e.cached&&u.jsx("span",{className:"text-[10px] font-bold text-blue-600 bg-blue-50 px-1.5 py-0.5 rounded uppercase tracking-wider",children:"Cached"})]})]}),u.jsx(ds,{type:"source",position:me.Bottom,className:"!bg-slate-400 !w-2 !h-2"})]})}function epe({data:e}){const r=(a=>{const i=a.toLowerCase();return i.includes("model")||i.includes("weights")?{icon:Nr,bgColor:"bg-purple-100 dark:bg-purple-900/30",borderColor:"border-purple-400 dark:border-purple-600",iconColor:"text-purple-600 dark:text-purple-400",textColor:"text-purple-900 dark:text-purple-100"}:i.includes("feature")||i.includes("train_set")||i.includes("test_set")?{icon:ja,bgColor:"bg-emerald-100 dark:bg-emerald-900/30",borderColor:"border-emerald-400 dark:border-emerald-600",iconColor:"text-emerald-600 dark:text-emerald-400",textColor:"text-emerald-900 dark:text-emerald-100"}:i.includes("data")||i.includes("batch")||i.includes("set")?{icon:Tr,bgColor:"bg-blue-100 dark:bg-blue-900/30",borderColor:"border-blue-400 dark:border-blue-600",iconColor:"text-blue-600 dark:text-blue-400",textColor:"text-blue-900 dark:text-blue-100"}:i.includes("metrics")||i.includes("report")||i.includes("status")?{icon:wa,bgColor:"bg-orange-100 dark:bg-orange-900/30",borderColor:"border-orange-400 dark:border-orange-600",iconColor:"text-orange-600 dark:text-orange-400",textColor:"text-orange-900 dark:text-orange-100"}:i.includes("image")||i.includes("docker")?{icon:Nr,bgColor:"bg-cyan-100 dark:bg-cyan-900/30",borderColor:"border-cyan-400 dark:border-cyan-600",iconColor:"text-cyan-600 dark:text-cyan-400",textColor:"text-cyan-900 dark:text-cyan-100"}:{icon:ql,bgColor:"bg-slate-100 dark:bg-slate-800",borderColor:"border-slate-300 dark:border-slate-600",iconColor:"text-slate-500 dark:text-slate-400",textColor:"text-slate-700 dark:text-slate-300"}})(e.label),n=r.icon;return u.jsxs("div",{className:`px-3 py-2 rounded-lg ${r.bgColor} border-2 ${r.borderColor} flex items-center justify-center gap-2 shadow-md hover:shadow-lg transition-all min-w-[140px]`,style:{height:WS},children:[u.jsx(ds,{type:"target",position:me.Top,className:"!bg-slate-400 !w-2 !h-2"}),u.jsx(n,{size:14,className:r.iconColor}),u.jsx("span",{className:`text-xs font-semibold ${r.textColor} truncate max-w-[100px]`,title:e.label,children:e.label}),u.jsx(ds,{type:"source",position:me.Bottom,className:"!bg-slate-400 !w-2 !h-2"})]})}function tpe({run:e,onClose:t}){var p;const[r,n]=_.useState(null),[a,i]=_.useState(!1),[s,o]=_.useState("overview"),[l,c]=_.useState(e==null?void 0:e.project);_.useEffect(()=>{e&&(d(),c(e.project))},[e]);const d=async()=>{i(!0);try{const m=await(await _e(`/api/runs/${e.run_id}`)).json();n(m),m.project&&c(m.project)}catch(g){console.error("Failed to fetch run details:",g)}finally{i(!1)}},f=async g=>{try{await _e(`/api/runs/${e.run_id}/project`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_name:g})}),c(g)}catch(m){console.error("Failed to update project:",m)}};if(!e)return null;const h=r||e;return u.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-slate-900",children:[u.jsxs("div",{className:"p-6 border-b border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-800/50",children:[u.jsxs("div",{className:"flex items-start justify-between mb-4",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("div",{className:"p-3 bg-blue-100 dark:bg-blue-900/30 rounded-xl text-blue-600 dark:text-blue-400",children:u.jsx(Or,{size:24})}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white",children:h.name||`Run ${(p=h.run_id)==null?void 0:p.slice(0,8)}`}),u.jsx(rm,{status:h.status})]}),u.jsxs("div",{className:"flex items-center gap-2 mt-1 text-sm text-slate-500",children:[u.jsx("span",{className:"font-mono text-xs bg-slate-100 dark:bg-slate-800 px-1.5 py-0.5 rounded",children:h.run_id}),u.jsx("span",{children:"•"}),u.jsx(eN,{currentProject:l,onUpdate:f}),h.pipeline_name&&u.jsxs(u.Fragment,{children:[u.jsx("span",{children:"•"}),u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(ja,{size:12}),h.pipeline_name]})]})]})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(st,{to:`/runs/${h.run_id}`,children:u.jsxs(Se,{variant:"outline",size:"sm",children:["Full View ",u.jsx(is,{size:16,className:"ml-1"})]})}),u.jsx(Se,{variant:"ghost",size:"sm",onClick:t,children:u.jsx(No,{size:20,className:"text-slate-400"})})]})]}),u.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[u.jsx(T1,{label:"Duration",value:h.duration?`${h.duration.toFixed(2)}s`:"-",icon:tt,color:"blue"}),u.jsx(T1,{label:"Started",value:h.start_time?wt(new Date(h.start_time),"MMM d, HH:mm"):"-",icon:kn,color:"purple"}),u.jsx(T1,{label:"Steps",value:h.steps?Object.keys(h.steps).length:0,icon:Ge,color:"emerald"})]})]}),u.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[u.jsxs("div",{className:"flex items-center gap-1 p-2 border-b border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900",children:[u.jsx(O1,{active:s==="overview",onClick:()=>o("overview"),icon:Ge,label:"Overview"}),u.jsx(O1,{active:s==="steps",onClick:()=>o("steps"),icon:ja,label:"Steps"}),u.jsx(O1,{active:s==="artifacts",onClick:()=>o("artifacts"),icon:Nr,label:"Artifacts"})]}),u.jsx("div",{className:"flex-1 overflow-y-auto bg-slate-50 dark:bg-slate-900/50 p-4",children:a?u.jsx("div",{className:"flex justify-center py-12",children:u.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):u.jsxs(u.Fragment,{children:[s==="overview"&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs(ze,{className:"p-0 overflow-hidden h-64 border-slate-200 dark:border-slate-700",children:[u.jsx("div",{className:"p-3 border-b border-slate-100 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-800/50 flex justify-between items-center",children:u.jsx("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300",children:"Pipeline Graph"})}),u.jsx("div",{className:"h-full bg-slate-50/50",children:h.dag?u.jsx(v7,{dag:h.dag,steps:h.steps}):u.jsx("div",{className:"h-full flex items-center justify-center text-slate-400 text-sm",children:"No graph data available"})})]}),h.status==="failed"&&h.error&&u.jsxs("div",{className:"bg-rose-50 dark:bg-rose-900/20 border border-rose-200 dark:border-rose-800 rounded-xl p-4",children:[u.jsxs("h3",{className:"text-rose-700 dark:text-rose-400 font-semibold flex items-center gap-2 mb-2",children:[u.jsx(pr,{size:18}),"Execution Failed"]}),u.jsx("pre",{className:"text-xs font-mono text-rose-600 dark:text-rose-300 whitespace-pre-wrap overflow-x-auto",children:h.error})]})]}),s==="steps"&&u.jsxs("div",{className:"space-y-3",children:[h.steps&&Object.entries(h.steps).map(([g,m])=>u.jsxs("div",{className:"bg-white dark:bg-slate-800 p-3 rounded-xl border border-slate-200 dark:border-slate-700",children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(rm,{status:m.success?"completed":m.error?"failed":"running",size:"sm"}),u.jsx("span",{className:"font-medium text-slate-900 dark:text-white",children:g})]}),u.jsx("span",{className:"text-xs text-slate-500 font-mono",children:m.duration?`${m.duration.toFixed(2)}s`:"-"})]}),m.error&&u.jsx("div",{className:"text-xs text-rose-600 bg-rose-50 dark:bg-rose-900/20 p-2 rounded mt-2 font-mono",children:m.error})]},g)),(!h.steps||Object.keys(h.steps).length===0)&&u.jsx("div",{className:"text-center py-8 text-slate-500",children:"No steps recorded"})]}),s==="artifacts"&&u.jsx("div",{className:"space-y-3",children:u.jsxs("div",{className:"text-center py-8 text-slate-500",children:[u.jsx(Nr,{size:32,className:"mx-auto mb-2 opacity-50"}),u.jsx("p",{children:"Artifacts view not fully implemented in preview"}),u.jsx(st,{to:`/runs/${h.run_id}`,className:"text-primary-600 hover:underline text-sm mt-2 inline-block",children:"View in full details page"})]})})]})})]})]})}function T1({label:e,value:t,icon:r,color:n}){const a={blue:"text-blue-600 bg-blue-50 dark:bg-blue-900/20",emerald:"text-emerald-600 bg-emerald-50 dark:bg-emerald-900/20",purple:"text-purple-600 bg-purple-50 dark:bg-purple-900/20",rose:"text-rose-600 bg-rose-50 dark:bg-rose-900/20"};return u.jsxs("div",{className:"bg-white dark:bg-slate-800 p-3 rounded-xl border border-slate-200 dark:border-slate-700",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[u.jsx("div",{className:`p-1 rounded-lg ${a[n]}`,children:u.jsx(r,{size:14})}),u.jsx("span",{className:"text-xs text-slate-500 font-medium",children:e})]}),u.jsx("div",{className:"text-sm font-bold text-slate-900 dark:text-white pl-1 truncate",title:t,children:t})]})}function O1({active:e,onClick:t,icon:r,label:n}){return u.jsxs("button",{onClick:t,className:`
509
- flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all
510
- ${e?"bg-slate-100 dark:bg-slate-800 text-slate-900 dark:text-white":"text-slate-500 hover:bg-slate-50 dark:hover:bg-slate-800/50 hover:text-slate-700 dark:hover:text-slate-300"}
511
- `,children:[u.jsx(r,{size:16}),n]})}function rpe(){const[e,t]=_.useState([]),[r,n]=_.useState(!0),[a,i]=_.useState(null),[s]=_G(),{selectedProject:o}=fi(),[l,c]=_.useState("all"),d=s.get("pipeline"),f=async()=>{n(!0);try{let p="/api/runs/?limit=100";o&&(p+=`&project=${encodeURIComponent(o)}`),d&&(p+=`&pipeline=${encodeURIComponent(d)}`);const m=await(await _e(p)).json();t(m.runs||[])}catch(p){console.error(p)}finally{n(!1)}};_.useEffect(()=>{f()},[o,d]);const h=p=>{i(p)};return u.jsxs("div",{className:"h-screen flex flex-col overflow-hidden bg-slate-50 dark:bg-slate-900",children:[u.jsx("div",{className:"bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 px-6 py-4 shrink-0",children:u.jsxs("div",{className:"flex items-center justify-between max-w-[1800px] mx-auto",children:[u.jsxs("div",{children:[u.jsxs("h1",{className:"text-xl font-bold text-slate-900 dark:text-white flex items-center gap-2",children:[u.jsx(Or,{className:"text-blue-500"}),"Pipeline Runs"]}),u.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:"Monitor and track all your pipeline executions"})]}),u.jsx("div",{className:"flex items-center gap-3",children:u.jsxs(Se,{variant:"outline",size:"sm",onClick:f,disabled:r,children:[u.jsx(P0,{size:16,className:`mr-2 ${r?"animate-spin":""}`}),"Refresh"]})})]})}),u.jsx("div",{className:"flex-1 overflow-hidden",children:u.jsx("div",{className:"h-full max-w-[1800px] mx-auto px-6 py-6",children:u.jsxs("div",{className:"h-full flex gap-6",children:[u.jsxs("div",{className:"w-[320px] shrink-0 flex flex-col bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden shadow-sm",children:[u.jsxs("div",{className:"p-3 border-b border-slate-200 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-800/50 flex justify-between items-center",children:[u.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Explorer"}),d&&u.jsxs(Ot,{variant:"secondary",className:"text-[10px]",children:["Filtered: ",d]})]}),u.jsx("div",{className:"flex-1 min-h-0",children:u.jsx(J_,{mode:"runs",projectId:o,onSelect:h,selectedId:a==null?void 0:a.run_id})})]}),u.jsx("div",{className:"flex-1 min-w-0 bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden shadow-sm",children:a?u.jsx(tpe,{run:a,onClose:()=>i(null)}):u.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center p-8 bg-slate-50/50 dark:bg-slate-900/50",children:[u.jsx("div",{className:"w-20 h-20 bg-blue-100 dark:bg-blue-900/30 rounded-full flex items-center justify-center mb-6 animate-pulse",children:u.jsx(Or,{size:40,className:"text-blue-500"})}),u.jsx("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white mb-2",children:"Select a Run"}),u.jsx("p",{className:"text-slate-500 max-w-md",children:"Choose a run from the sidebar to view execution details, logs, and artifacts."})]})})]})})})]})}const If=async e=>{if(!e)return;const r=`${await Qz()}/api/assets/${e}/download`;window.open(r,"_blank","noopener,noreferrer")};function npe({code:e,language:t="python",title:r,className:n=""}){const[a,i]=_.useState(!1),s=()=>{navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3)};return u.jsxs("div",{className:`relative group ${n}`,children:[r&&u.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-slate-800 dark:bg-slate-900 border-b border-slate-700 rounded-t-lg",children:[u.jsx("span",{className:"text-sm font-medium text-slate-300",children:r}),u.jsx("span",{className:"text-xs text-slate-500 uppercase font-mono",children:t})]}),u.jsxs("div",{className:"relative",children:[u.jsx("pre",{className:`p-4 bg-slate-900 dark:bg-slate-950 text-slate-100 text-sm font-mono overflow-x-auto leading-relaxed ${r?"":"rounded-t-lg"} rounded-b-lg`,children:u.jsx("code",{className:`language-${t}`,children:e})}),u.jsx("button",{onClick:s,className:"absolute top-3 right-3 p-2 bg-slate-800 hover:bg-slate-700 text-slate-400 hover:text-slate-200 rounded-md transition-all opacity-0 group-hover:opacity-100",title:"Copy to clipboard",children:a?u.jsx(m_,{size:14}):u.jsx(Hp,{size:14})})]})]})}function ape(){var S,N,E;const{runId:e}=p_(),[t,r]=_.useState(null),[n,a]=_.useState([]),[i,s]=_.useState([]),[o,l]=_.useState(!0),[c,d]=_.useState(null),[f,h]=_.useState("overview"),[p,g]=_.useState(null),[m,b]=_.useState(null),[x,y]=_.useState(!1);if(_.useEffect(()=>{if(!t)return;const A=async()=>{try{const T=await(await _e(`/api/runs/${e}/cloud-status`)).json();b(T),T.is_remote&&T.cloud_status&&!T.cloud_status.is_finished?y(!0):y(!1)}catch(M){console.error("Failed to fetch cloud status:",M),y(!1)}};A();let C;return x&&(C=setInterval(A,5e3)),()=>{C&&clearInterval(C)}},[e,t,x]),_.useEffect(()=>{(async()=>{try{const[C,M]=await Promise.all([_e(`/api/runs/${e}`),_e(`/api/assets?run_id=${e}`)]),T=await C.json(),P=await M.json();let D=[];try{const $=await _e(`/api/runs/${e}/metrics`);$.ok&&(D=(await $.json()).metrics||[])}catch($){console.warn("Failed to fetch metrics",$)}r(T),a(P.assets||[]),s(D),T.steps&&Object.keys(T.steps).length>0&&d(Object.keys(T.steps)[0]),l(!1)}catch(C){console.error(C),l(!1)}})()},[e]),o)return u.jsx("div",{className:"flex items-center justify-center h-96",children:u.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600"})});if(!t)return u.jsx("div",{className:"p-8 text-center text-slate-500",children:"Run not found"});const v=t.status==="completed"?"success":t.status==="failed"?"danger":"warning",w=c?(S=t.steps)==null?void 0:S[c]:null,j=n.filter(A=>A.step===c),k=i.filter(A=>A.step===c||A.name.startsWith(c));return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between bg-white p-6 rounded-xl border border-slate-100 shadow-sm",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[u.jsx(st,{to:"/runs",className:"text-sm text-slate-500 hover:text-slate-700 transition-colors",children:"Runs"}),u.jsx(fo,{size:14,className:"text-slate-300"}),u.jsx("span",{className:"text-sm text-slate-900 font-medium",children:t.run_id})]}),u.jsxs("h2",{className:"text-2xl font-bold text-slate-900 flex items-center gap-3",children:[u.jsx("div",{className:`w-3 h-3 rounded-full ${t.status==="completed"?"bg-emerald-500":t.status==="failed"?"bg-rose-500":"bg-amber-500"}`}),"Run: ",u.jsx("span",{className:"font-mono text-slate-500",children:t.run_id.substring(0,8)})]}),u.jsxs("p",{className:"text-slate-500 mt-1 flex items-center gap-2",children:[u.jsx(ja,{size:16}),"Pipeline: ",u.jsx("span",{className:"font-medium text-slate-700",children:t.pipeline_name}),(m==null?void 0:m.is_remote)&&u.jsxs(Ot,{variant:"secondary",className:"text-xs bg-blue-50 text-blue-600 flex items-center gap-1",children:[u.jsx(FG,{size:12}),m.orchestrator_type]}),(m==null?void 0:m.is_remote)&&x&&u.jsxs("span",{className:"text-xs text-amber-600 flex items-center gap-1 animate-pulse",children:[u.jsx(Ge,{size:12}),"Live"]})]})]}),u.jsxs("div",{className:"flex flex-col items-end gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(upe,{runId:t.run_id,currentProject:t.project}),u.jsx(Ot,{variant:v,className:"text-sm px-4 py-1.5 uppercase tracking-wide shadow-sm",children:((N=m==null?void 0:m.cloud_status)==null?void 0:N.status)||t.status})]}),u.jsxs("span",{className:"text-xs text-slate-400 font-mono",children:["ID: ",t.run_id]})]})]}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[u.jsx(M1,{icon:u.jsx(tt,{size:24}),label:"Duration",value:t.duration?`${t.duration.toFixed(2)}s`:"-",color:"blue"}),u.jsx(M1,{icon:u.jsx(kn,{size:24}),label:"Started At",value:t.start_time?wt(new Date(t.start_time),"MMM d, HH:mm:ss"):"-",color:"purple"}),u.jsx(M1,{icon:u.jsx(Lt,{size:24}),label:"Steps Completed",value:`${t.steps?Object.values(t.steps).filter(A=>A.success).length:0} / ${t.steps?Object.keys(t.steps).length:0}`,color:"emerald"})]}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[u.jsxs("div",{className:"lg:col-span-2",children:[u.jsxs("h3",{className:"text-xl font-bold text-slate-900 mb-4 flex items-center gap-2",children:[u.jsx(Ge,{className:"text-primary-500"})," Pipeline Execution Graph"]}),u.jsx("div",{className:"h-[600px]",children:t.dag?u.jsx(v7,{dag:t.dag,steps:t.steps,selectedStep:c,onStepSelect:d}):u.jsx(ze,{className:"h-full flex items-center justify-center",children:u.jsx("p",{className:"text-slate-500",children:"DAG visualization not available"})})})]}),u.jsxs("div",{children:[u.jsxs("h3",{className:"text-xl font-bold text-slate-900 mb-4 flex items-center gap-2",children:[u.jsx(Gp,{className:"text-primary-500"})," Step Details"]}),w?u.jsxs(ze,{className:"overflow-hidden",children:[u.jsxs("div",{className:"pb-4 border-b border-slate-100",children:[u.jsx("h4",{className:"text-lg font-bold text-slate-900 mb-2",children:c}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ot,{variant:w.success?"success":"danger",className:"text-xs",children:w.success?"Success":"Failed"}),w.cached&&u.jsx(Ot,{variant:"secondary",className:"text-xs bg-blue-50 text-blue-700",children:"Cached"}),u.jsxs("span",{className:"text-xs font-mono text-slate-500 bg-slate-100 px-2 py-0.5 rounded",children:[(E=w.duration)==null?void 0:E.toFixed(2),"s"]})]})]}),u.jsxs("div",{className:"flex gap-2 border-b border-slate-100 mt-4",children:[u.jsxs(R1,{active:f==="overview",onClick:()=>h("overview"),children:[u.jsx(Gp,{size:16})," Overview"]}),u.jsxs(R1,{active:f==="code",onClick:()=>h("code"),children:[u.jsx(BG,{size:16})," Code"]}),u.jsxs(R1,{active:f==="artifacts",onClick:()=>h("artifacts"),children:[u.jsx(ss,{size:16})," Artifacts"]})]}),u.jsxs("div",{className:"mt-4 max-h-[450px] overflow-y-auto",children:[f==="overview"&&u.jsx(ipe,{stepData:w,metrics:k}),f==="code"&&u.jsx(ope,{sourceCode:w.source_code}),f==="artifacts"&&u.jsx(lpe,{artifacts:j,onArtifactClick:g})]})]}):u.jsx(ze,{className:"p-12 text-center",children:u.jsx("p",{className:"text-slate-500",children:"Select a step to view details"})})]})]}),u.jsx(cpe,{artifact:p,onClose:()=>g(null)})]})}function M1({icon:e,label:t,value:r,color:n}){const a={blue:"bg-blue-50 text-blue-600",purple:"bg-purple-50 text-purple-600",emerald:"bg-emerald-50 text-emerald-600"};return u.jsx(ze,{className:"hover:shadow-md transition-shadow duration-200",children:u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("div",{className:`p-3 rounded-xl ${a[n]}`,children:e}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm text-slate-500 font-medium",children:t}),u.jsx("p",{className:"text-xl font-bold text-slate-900",children:r})]})]})})}function R1({active:e,onClick:t,children:r}){return u.jsx("button",{onClick:t,className:`
512
- flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors
513
- ${e?"text-primary-600 border-b-2 border-primary-600":"text-slate-500 hover:text-slate-700"}
514
- `,children:r})}function ipe({stepData:e,metrics:t}){var n,a,i,s;const r=o=>{if(!o)return"N/A";if(o<1)return`${(o*1e3).toFixed(0)}ms`;if(o<60)return`${o.toFixed(2)}s`;const l=Math.floor(o/60),c=(o%60).toFixed(0);return`${l}m ${c}s`};return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[u.jsxs("div",{className:"p-4 bg-gradient-to-br from-slate-50 to-white rounded-xl border border-slate-200",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[u.jsx(tt,{size:14,className:"text-slate-400"}),u.jsx("span",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide",children:"Duration"})]}),u.jsx("p",{className:"text-2xl font-bold text-slate-900",children:r(e.duration)})]}),u.jsxs("div",{className:"p-4 bg-gradient-to-br from-slate-50 to-white rounded-xl border border-slate-200",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[u.jsx(Ge,{size:14,className:"text-slate-400"}),u.jsx("span",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide",children:"Status"})]}),u.jsx("div",{className:"flex items-center gap-2",children:e.success?u.jsxs(u.Fragment,{children:[u.jsx(Lt,{size:20,className:"text-emerald-500"}),u.jsx("span",{className:"text-lg font-bold text-emerald-700",children:"Success"})]}):e.error?u.jsxs(u.Fragment,{children:[u.jsx(pr,{size:20,className:"text-rose-500"}),u.jsx("span",{className:"text-lg font-bold text-rose-700",children:"Failed"})]}):u.jsxs(u.Fragment,{children:[u.jsx(tt,{size:20,className:"text-amber-500"}),u.jsx("span",{className:"text-lg font-bold text-amber-700",children:"Pending"})]})})]})]}),(((n=e.inputs)==null?void 0:n.length)>0||((a=e.outputs)==null?void 0:a.length)>0)&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("h5",{className:"text-sm font-bold text-slate-700 uppercase tracking-wide flex items-center gap-2",children:[u.jsx(Tr,{size:16}),"Data Flow"]}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[((i=e.inputs)==null?void 0:i.length)>0&&u.jsxs("div",{className:"p-4 bg-blue-50/50 dark:bg-blue-900/10 rounded-xl border border-blue-100 dark:border-blue-800",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[u.jsx(MG,{size:16,className:"text-blue-600"}),u.jsx("span",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100",children:"Inputs"}),u.jsx(Ot,{variant:"secondary",className:"ml-auto text-xs",children:e.inputs.length})]}),u.jsx("div",{className:"space-y-1.5",children:e.inputs.map((o,l)=>u.jsxs("div",{className:"flex items-center gap-2 p-2 bg-white dark:bg-slate-800 rounded-lg border border-blue-100 dark:border-blue-800/50",children:[u.jsx(Tr,{size:12,className:"text-blue-500 flex-shrink-0"}),u.jsx("span",{className:"text-sm font-mono text-slate-700 dark:text-slate-200 truncate",children:o})]},l))})]}),((s=e.outputs)==null?void 0:s.length)>0&&u.jsxs("div",{className:"p-4 bg-purple-50/50 dark:bg-purple-900/10 rounded-xl border border-purple-100 dark:border-purple-800",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[u.jsx(RG,{size:16,className:"text-purple-600"}),u.jsx("span",{className:"text-sm font-semibold text-purple-900 dark:text-purple-100",children:"Outputs"}),u.jsx(Ot,{variant:"secondary",className:"ml-auto text-xs",children:e.outputs.length})]}),u.jsx("div",{className:"space-y-1.5",children:e.outputs.map((o,l)=>u.jsxs("div",{className:"flex items-center gap-2 p-2 bg-white dark:bg-slate-800 rounded-lg border border-purple-100 dark:border-purple-800/50",children:[u.jsx(Nr,{size:12,className:"text-purple-500 flex-shrink-0"}),u.jsx("span",{className:"text-sm font-mono text-slate-700 dark:text-slate-200 truncate",children:o})]},l))})]})]})]}),e.tags&&Object.keys(e.tags).length>0&&u.jsxs("div",{children:[u.jsxs("h5",{className:"text-sm font-bold text-slate-700 uppercase tracking-wide mb-3 flex items-center gap-2",children:[u.jsx(Xp,{size:16}),"Metadata"]}),u.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(e.tags).map(([o,l])=>u.jsxs("div",{className:"p-3 bg-slate-50 dark:bg-slate-800 rounded-lg border border-slate-200 dark:border-slate-700",children:[u.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400 mb-1",children:o}),u.jsx("div",{className:"text-sm font-mono font-medium text-slate-900 dark:text-white truncate",children:String(l)})]},o))})]}),e.cached&&u.jsx("div",{className:"p-4 bg-gradient-to-r from-blue-50 to-cyan-50 dark:from-blue-900/20 dark:to-cyan-900/20 rounded-xl border-2 border-blue-200 dark:border-blue-800",children:u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(po,{size:24,className:"text-blue-600"}),u.jsxs("div",{children:[u.jsx("h6",{className:"font-bold text-blue-900 dark:text-blue-100",children:"Cached Result"}),u.jsx("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:"This step used cached results from a previous run"})]})]})}),e.error&&u.jsxs("div",{children:[u.jsxs("h5",{className:"text-sm font-bold text-rose-700 uppercase tracking-wide mb-3 flex items-center gap-2",children:[u.jsx(Sc,{size:16}),"Error Details"]}),u.jsx("div",{className:"p-4 bg-rose-50 dark:bg-rose-900/20 rounded-xl border-2 border-rose-200 dark:border-rose-800",children:u.jsx("pre",{className:"text-sm font-mono text-rose-700 dark:text-rose-300 whitespace-pre-wrap overflow-x-auto",children:e.error})})]}),(t==null?void 0:t.length)>0&&u.jsxs("div",{children:[u.jsxs("h5",{className:"text-sm font-bold text-slate-700 uppercase tracking-wide mb-3 flex items-center gap-2",children:[u.jsx(os,{size:16}),"Performance Metrics"]}),u.jsx("div",{className:"grid grid-cols-2 gap-3",children:t.map((o,l)=>u.jsx(spe,{metric:o},l))})]})]})}function spe({metric:e}){const t=typeof e.value=="number",r=t?e.value.toFixed(4):e.value;return u.jsxs("div",{className:"p-3 bg-gradient-to-br from-slate-50 to-white rounded-lg border border-slate-200 hover:border-primary-300 transition-all group",children:[u.jsx("span",{className:"text-xs text-slate-500 block truncate mb-1",title:e.name,children:e.name}),u.jsxs("div",{className:"flex items-baseline gap-2",children:[u.jsx("span",{className:"text-xl font-mono font-bold text-slate-900 group-hover:text-primary-600 transition-colors",children:r}),t&&e.value>0&&u.jsx(os,{size:14,className:"text-emerald-500"})]})]})}function ope({sourceCode:e}){return u.jsx(npe,{code:e||"# Source code not available",language:"python",title:"Step Source Code"})}function lpe({artifacts:e,onArtifactClick:t}){return u.jsxs("div",{children:[u.jsx("h5",{className:"text-sm font-semibold text-slate-700 mb-3",children:"Produced Artifacts"}),(e==null?void 0:e.length)>0?u.jsx("div",{className:"space-y-2",children:e.map(r=>u.jsxs(Me.div,{whileHover:{scale:1.02},whileTap:{scale:.98},onClick:()=>t(r),className:"group flex items-center gap-3 p-3 bg-slate-50 hover:bg-white rounded-lg border border-slate-100 hover:border-primary-300 hover:shadow-md transition-all cursor-pointer",children:[u.jsx("div",{className:"p-2 bg-white rounded-md text-slate-500 shadow-sm group-hover:text-primary-600 group-hover:scale-110 transition-all",children:r.type==="Dataset"?u.jsx(Tr,{size:18}):r.type==="Model"?u.jsx(Nr,{size:18}):r.type==="Metrics"?u.jsx(wa,{size:18}):u.jsx(ql,{size:18})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:"text-sm font-semibold text-slate-900 truncate group-hover:text-primary-600 transition-colors",children:r.name}),u.jsx("p",{className:"text-xs text-slate-500 truncate",children:r.type})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{className:"p-2 rounded-lg hover:bg-white transition-colors text-slate-400 hover:text-primary-600 disabled:opacity-40",onClick:n=>{n.stopPropagation(),If(r.artifact_id)},disabled:!r.artifact_id,children:u.jsx(_o,{size:14})}),u.jsx(XG,{size:14,className:"text-slate-300 group-hover:text-primary-400 transition-colors"}),u.jsx(is,{size:14,className:"text-slate-300 group-hover:text-primary-400 opacity-0 group-hover:opacity-100 transition-all"})]})]},r.artifact_id))}):u.jsx("p",{className:"text-sm text-slate-500 italic",children:"No artifacts produced by this step"})]})}function cpe({artifact:e,onClose:t}){return e?u.jsx(hi,{children:u.jsx(Me.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",onClick:t,children:u.jsxs(Me.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},onClick:r=>r.stopPropagation(),className:"bg-white rounded-2xl shadow-2xl max-w-3xl w-full max-h-[80vh] overflow-hidden",children:[u.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-slate-100 bg-gradient-to-r from-primary-50 to-purple-50",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"p-3 bg-white rounded-xl shadow-sm",children:e.type==="Dataset"?u.jsx(Tr,{size:24,className:"text-blue-600"}):e.type==="Model"?u.jsx(Nr,{size:24,className:"text-purple-600"}):e.type==="Metrics"?u.jsx(wa,{size:24,className:"text-emerald-600"}):u.jsx(ql,{size:24,className:"text-slate-600"})}),u.jsxs("div",{children:[u.jsx("h3",{className:"text-xl font-bold text-slate-900",children:e.name}),u.jsx("p",{className:"text-sm text-slate-500",children:e.type})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("button",{onClick:()=>If(e.artifact_id),className:"inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-primary-600 text-white text-sm font-semibold hover:bg-primary-500 transition-colors disabled:opacity-50",disabled:!e.artifact_id,children:[u.jsx(_o,{size:16})," Download"]}),u.jsx("button",{onClick:t,className:"p-2 hover:bg-white rounded-lg transition-colors",children:u.jsx(No,{size:20,className:"text-slate-400"})})]})]}),u.jsx("div",{className:"p-6 overflow-y-auto max-h-[60vh]",children:u.jsxs("div",{className:"space-y-4",children:[e.properties&&Object.keys(e.properties).length>0&&u.jsxs("div",{children:[u.jsx("h4",{className:"text-sm font-semibold text-slate-700 mb-3",children:"Properties"}),u.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(e.properties).map(([r,n])=>u.jsxs("div",{className:"p-3 bg-slate-50 rounded-lg border border-slate-100",children:[u.jsx("span",{className:"text-xs text-slate-500 block mb-1",children:r}),u.jsx("span",{className:"text-sm font-mono font-semibold text-slate-900",children:typeof n=="object"?JSON.stringify(n):String(n)})]},r))})]}),e.value&&u.jsxs("div",{children:[u.jsx("h4",{className:"text-sm font-semibold text-slate-700 mb-3",children:"Value Preview"}),u.jsx("pre",{className:"p-4 bg-slate-900 text-slate-100 rounded-lg text-xs font-mono overflow-x-auto",children:e.value})]}),u.jsxs("div",{children:[u.jsx("h4",{className:"text-sm font-semibold text-slate-700 mb-3",children:"Metadata"}),u.jsxs("div",{className:"space-y-2 text-sm",children:[u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-slate-500",children:"Artifact ID:"}),u.jsx("span",{className:"font-mono text-xs text-slate-700",children:e.artifact_id})]}),u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-slate-500",children:"Step:"}),u.jsx("span",{className:"font-medium text-slate-700",children:e.step})]}),e.created_at&&u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-slate-500",children:"Created:"}),u.jsx("span",{className:"text-slate-700",children:wt(new Date(e.created_at),"MMM d, yyyy HH:mm:ss")})]})]})]})]})}),u.jsxs("div",{className:"p-4 border-t border-slate-100 bg-slate-50 flex justify-end gap-2",children:[u.jsx(Se,{variant:"ghost",onClick:t,children:"Close"}),u.jsx(Se,{variant:"primary",children:"Download"})]})]})})}):null}function upe({runId:e,currentProject:t}){const[r,n]=_.useState(!1),[a,i]=_.useState([]),[s,o]=_.useState(!1);_.useEffect(()=>{r&&fetch("/api/projects/").then(c=>c.json()).then(c=>i(c)).catch(c=>console.error("Failed to load projects:",c))},[r]);const l=async c=>{o(!0);try{await fetch(`/api/runs/${e}/project`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_name:c})});const d=document.createElement("div");d.className="fixed top-4 right-4 px-4 py-3 rounded-lg shadow-lg z-50 bg-green-500 text-white",d.textContent=`Run added to project ${c}`,document.body.appendChild(d),setTimeout(()=>document.body.removeChild(d),3e3),n(!1),setTimeout(()=>window.location.reload(),500)}catch(d){console.error("Failed to update project:",d)}finally{o(!1)}};return u.jsxs("div",{className:"relative",children:[u.jsxs("button",{onClick:()=>n(!r),disabled:s,className:"flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-slate-600 dark:text-slate-300 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors disabled:opacity-50",title:t?`Current project: ${t}`:"Add to project",children:[u.jsx(HG,{size:16}),t||"Add to Project"]}),r&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>n(!1)}),u.jsxs("div",{className:"absolute right-0 mt-2 w-56 bg-white dark:bg-slate-800 rounded-xl shadow-xl border border-slate-200 dark:border-slate-700 z-20",children:[u.jsx("div",{className:"p-2 border-b border-slate-100 dark:border-slate-700",children:u.jsx("span",{className:"text-xs font-semibold text-slate-500 px-2",children:"Select Project"})}),u.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:a.length>0?a.map(c=>u.jsxs("button",{onClick:()=>l(c.name),disabled:s,className:`w-full text-left px-3 py-2 text-sm rounded-lg transition-colors ${c.name===t?"bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-300 font-medium":"text-slate-700 dark:text-slate-200 hover:bg-slate-50 dark:hover:bg-slate-700"}`,children:[c.name," ",c.name===t&&"✓"]},c.name)):u.jsx("div",{className:"px-3 py-2 text-sm text-slate-400",children:"No projects found"})})]})]})]})}function qN({icon:e,title:t,description:r,action:n,actionLabel:a,onAction:i,className:s=""}){return u.jsxs("div",{className:`flex flex-col items-center justify-center py-16 px-4 text-center ${s}`,children:[u.jsx("div",{className:"w-20 h-20 bg-gradient-to-br from-slate-100 to-slate-200 dark:from-slate-800 dark:to-slate-700 rounded-2xl flex items-center justify-center mb-6 shadow-inner",children:e&&u.jsx(e,{className:"text-slate-400 dark:text-slate-500",size:40})}),u.jsx("h3",{className:"text-xl font-bold text-slate-900 dark:text-white mb-2",children:t}),r&&u.jsx("p",{className:"text-slate-500 dark:text-slate-400 max-w-md mb-6",children:r}),(n||a&&i)&&u.jsx("div",{children:n||u.jsx(Se,{onClick:i,children:a})})]})}const dpe=({status:e})=>{switch(e==null?void 0:e.toLowerCase()){case"completed":case"success":return u.jsx(Lt,{className:"w-4 h-4 text-green-500"});case"failed":return u.jsx(pr,{className:"w-4 h-4 text-red-500"});case"running":return u.jsx(Ge,{className:"w-4 h-4 text-blue-500 animate-spin"});default:return u.jsx(tt,{className:"w-4 h-4 text-slate-400"})}},fpe=({type:e})=>{const t={className:"w-4 h-4"};switch(e==null?void 0:e.toLowerCase()){case"model":return u.jsx(Nr,{...t,className:"w-4 h-4 text-purple-500"});case"dataset":case"data":return u.jsx(Tr,{...t,className:"w-4 h-4 text-blue-500"});case"metrics":return u.jsx(wa,{...t,className:"w-4 h-4 text-emerald-500"});default:return u.jsx(_l,{...t,className:"w-4 h-4 text-slate-400"})}},Mh=({label:e,icon:t,children:r,defaultExpanded:n=!1,actions:a,status:i,level:s=0,badge:o,onClick:l})=>{const[c,d]=_.useState(n),f=r&&r.length>0;return u.jsxs("div",{className:"select-none",children:[u.jsxs(Me.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{duration:.2},className:`
515
- flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-all
516
- hover:bg-slate-100 dark:hover:bg-slate-800
517
- ${s===0?"bg-slate-50 dark:bg-slate-800/50 mb-1 font-semibold":""}
518
- `,style:{paddingLeft:`${s*1.5+.5}rem`},onClick:()=>{f&&d(!c),l==null||l()},children:[u.jsx("div",{className:"flex items-center gap-1 text-slate-400",children:f?u.jsx(Me.div,{animate:{rotate:c?90:0},transition:{duration:.2},children:u.jsx(fo,{className:"w-4 h-4"})}):u.jsx("div",{className:"w-4"})}),t&&u.jsx(t,{className:`w-4 h-4 ${s===0?"text-blue-500":"text-slate-500 dark:text-slate-400"}`}),u.jsxs("div",{className:"flex-1 flex items-center justify-between gap-3",children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u.jsx("span",{className:`text-sm truncate ${s===0?"font-semibold text-slate-900 dark:text-white":"text-slate-700 dark:text-slate-300"}`,children:e}),o]}),u.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[i&&u.jsx(dpe,{status:i}),a]})]})]}),u.jsx(hi,{children:c&&f&&u.jsx(Me.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2},children:r})})]})};function x7({projectId:e,onAssetSelect:t,compact:r=!1}){const[n,a]=_.useState({projects:[],pipelines:[],runs:[],artifacts:[]}),[i,s]=_.useState(!0),[o,l]=_.useState(""),[c,d]=_.useState("all");if(_.useEffect(()=>{(async()=>{s(!0);try{const v=e?[_e(`/api/pipelines?project=${e}`),_e(`/api/runs?project=${e}&limit=200`),_e(`/api/assets?project=${e}&limit=500`)]:[_e("/api/pipelines?limit=100"),_e("/api/runs?limit=200"),_e("/api/assets?limit=500")],[w,j,k]=await Promise.all(v),S=await w.json(),N=await j.json(),E=await k.json();let A=[];if(!e){const C=new Set(((E==null?void 0:E.assets)||[]).map(T=>T.project).filter(Boolean)),M=new Set(((N==null?void 0:N.runs)||[]).map(T=>T.project).filter(Boolean));A=[...new Set([...C,...M])].map(T=>({name:T}))}a({projects:A,pipelines:Array.isArray(S==null?void 0:S.pipelines)?S.pipelines:[],runs:Array.isArray(N==null?void 0:N.runs)?N.runs:[],artifacts:Array.isArray(E==null?void 0:E.assets)?E.assets:[]})}catch(v){console.error("Failed to fetch hierarchy data:",v)}finally{s(!1)}})()},[e]),i)return u.jsx("div",{className:`w-full bg-slate-50 dark:bg-slate-800/50 animate-pulse flex items-center justify-center ${r?"h-full min-h-[200px]":"h-[600px] rounded-xl"}`,children:u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600 mx-auto mb-3"}),u.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:"Loading..."})]})});const f=(y,v=null)=>n.runs.filter(w=>w.pipeline_name===y&&(!v||w.project===v)),h=y=>{let v=n.artifacts.filter(w=>w.run_id===y);return c!=="all"&&(v=v.filter(w=>{var j;return((j=w.type)==null?void 0:j.toLowerCase())===c})),v},p=y=>{const v=n.runs.filter(j=>j.project===y),w=[...new Set(v.map(j=>j.pipeline_name))];return n.pipelines.filter(j=>w.includes(j.name))},g=()=>e||n.projects.length===0?n.pipelines.map((y,v)=>{const w=f(y.name,e);return m(y,w,0,v<3)}):n.projects.map((y,v)=>{const w=p(y.name);return u.jsx(Mh,{label:y.name,icon:Ua,level:0,defaultExpanded:v===0,badge:u.jsxs("span",{className:"text-xs text-slate-400",children:[w.length," pipeline",w.length!==1?"s":""]}),children:w.map((j,k)=>{const S=f(j.name,y.name);return m(j,S,1,v===0&&k<2)})},y.name)}),m=(y,v,w,j=!1)=>{const k=v.reduce((S,N)=>S+h(N.run_id).length,0);return u.jsxs(Mh,{label:y.name,icon:Ge,level:w,defaultExpanded:j,badge:u.jsx("div",{className:"flex gap-1",children:k>0&&u.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] bg-blue-100 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400 px-1.5 py-0.5 rounded-full",children:[u.jsx(_l,{className:"w-3 h-3"})," ",k]})}),actions:u.jsx(st,{to:`/pipelines/${y.name}`,className:"text-xs text-blue-500 hover:underline px-2 py-1 rounded hover:bg-blue-50 dark:hover:bg-blue-900/20",onClick:S=>S.stopPropagation(),children:"View"}),children:[v.length===0&&u.jsx("div",{className:"pl-12 py-2 text-xs text-slate-400 italic",children:"No runs yet"}),v.map(S=>b(S,w+1))]},y.name)},b=(y,v)=>{const w=h(y.run_id),j=w.filter(k=>{var S;return((S=k.type)==null?void 0:S.toLowerCase())==="model"}).length;return u.jsxs(Mh,{label:y.name||`Run ${y.run_id.slice(0,8)}`,icon:Or,level:v,status:y.status,defaultExpanded:w.length>0&&w.length<=5,badge:w.length>0&&u.jsxs("div",{className:"flex gap-1",children:[j>0&&u.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] bg-purple-100 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400 px-1.5 py-0.5 rounded-full",children:[u.jsx(Nr,{className:"w-3 h-3"})," ",j]}),u.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400 px-1.5 py-0.5 rounded-full",children:[u.jsx(_l,{className:"w-3 h-3"})," ",w.length]})]}),actions:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-xs text-slate-400",children:ri(y.created)}),u.jsx(st,{to:`/runs/${y.run_id}`,className:"text-xs text-blue-500 hover:underline",onClick:k=>k.stopPropagation(),children:"Details"})]}),children:[w.length===0&&u.jsx("div",{className:"pl-16 py-1 text-xs text-slate-400 italic",children:"No artifacts"}),w.map(k=>x(k,v+1))]},y.run_id)},x=(y,v)=>{var k;const w={model:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-300",dataset:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300",metrics:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-300",default:"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400"},j=w[(k=y.type)==null?void 0:k.toLowerCase()]||w.default;return u.jsx(Mh,{label:y.name,icon:()=>u.jsx(fpe,{type:y.type}),level:v,onClick:()=>t==null?void 0:t(y),badge:u.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${j}`,children:y.type}),actions:u.jsxs("div",{className:"flex items-center gap-2",children:[y.properties&&Object.keys(y.properties).length>0&&u.jsxs("span",{className:"text-xs text-slate-400",children:[Object.keys(y.properties).length," props"]}),u.jsx("button",{onClick:S=>{S.stopPropagation(),t==null||t(y)},className:"p-1 rounded hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors",children:u.jsx(E0,{className:"w-3 h-3 text-slate-400"})}),u.jsx("button",{onClick:S=>{S.stopPropagation(),If(y.artifact_id)},className:"p-1 rounded hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors disabled:opacity-40",disabled:!y.artifact_id,children:u.jsx(_o,{className:"w-3 h-3 text-slate-400"})})]})},y.artifact_id)};return u.jsxs("div",{className:r?"h-full flex flex-col":"bg-white dark:bg-slate-900 rounded-xl border border-slate-200 dark:border-slate-800 overflow-hidden",children:[!r&&u.jsx("div",{className:"p-4 border-b border-slate-200 dark:border-slate-800 bg-gradient-to-r from-blue-50 to-purple-50 dark:from-slate-800 dark:to-slate-800",children:u.jsxs("div",{className:"flex items-center justify-between mb-3",children:[u.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-white flex items-center gap-2",children:[u.jsx(_d,{className:"w-4 h-4 text-blue-500"}),"Asset Hierarchy"]}),u.jsxs("span",{className:"text-xs text-slate-500",children:[n.artifacts.length," asset",n.artifacts.length!==1?"s":""]})]})}),u.jsx("div",{className:`${r?"p-2 border-b border-slate-100 dark:border-slate-700":"p-4 border-b border-slate-200 dark:border-slate-800 bg-gradient-to-r from-blue-50 to-purple-50 dark:from-slate-800 dark:to-slate-800"}`,children:u.jsxs("div",{className:`flex ${r?"justify-between":"gap-2"}`,children:[u.jsxs("button",{onClick:()=>d("all"),title:"All Assets",className:`flex items-center justify-center gap-1.5 ${r?"p-1.5 rounded-md":"px-3 py-1.5 rounded-lg"} text-sm font-medium transition-all ${c==="all"?"bg-primary-500 text-white shadow-md":"bg-white dark:bg-slate-700 text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-600"}`,children:[u.jsx(_l,{className:"w-3.5 h-3.5"}),!r&&u.jsxs(u.Fragment,{children:["All Assets ",u.jsxs("span",{className:"text-xs opacity-75",children:["(",n.artifacts.length,")"]})]})]}),u.jsxs("button",{onClick:()=>d("model"),title:"Models",className:`flex items-center justify-center gap-1.5 ${r?"p-1.5 rounded-md":"px-3 py-1.5 rounded-lg"} text-sm font-medium transition-all ${c==="model"?"bg-gradient-to-r from-purple-500 to-pink-500 text-white shadow-md":"bg-white dark:bg-slate-700 text-purple-600 dark:text-purple-400 hover:bg-purple-50 dark:hover:bg-purple-900/20"}`,children:[u.jsx(Nr,{className:"w-3.5 h-3.5"}),!r&&u.jsxs(u.Fragment,{children:["Models ",u.jsxs("span",{className:"text-xs opacity-75",children:["(",n.artifacts.filter(y=>{var v;return((v=y.type)==null?void 0:v.toLowerCase())==="model"}).length,")"]})]})]}),u.jsxs("button",{onClick:()=>d("dataset"),title:"Datasets",className:`flex items-center justify-center gap-1.5 ${r?"p-1.5 rounded-md":"px-3 py-1.5 rounded-lg"} text-sm font-medium transition-all ${c==="dataset"?"bg-gradient-to-r from-blue-500 to-cyan-500 text-white shadow-md":"bg-white dark:bg-slate-700 text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20"}`,children:[u.jsx(Tr,{className:"w-3.5 h-3.5"}),!r&&u.jsxs(u.Fragment,{children:["Datasets ",u.jsxs("span",{className:"text-xs opacity-75",children:["(",n.artifacts.filter(y=>{var v;return((v=y.type)==null?void 0:v.toLowerCase())==="dataset"}).length,")"]})]})]})]})}),u.jsx("div",{className:r?"flex-1 overflow-y-auto p-2":"p-3 max-h-[700px] overflow-y-auto",children:n.pipelines.length===0&&n.projects.length===0?u.jsxs("div",{className:"p-8 text-center",children:[u.jsx(Tr,{className:"h-12 w-12 text-slate-300 dark:text-slate-600 mx-auto mb-3"}),u.jsx("p",{className:"text-slate-600 dark:text-slate-400 font-medium mb-1",children:"No assets found"}),u.jsx("p",{className:"text-slate-500 text-sm",children:"Run a pipeline to generate artifacts"})]}):g()})]})}function b7({asset:e,onClose:t}){var f;const[r,n]=_.useState("overview"),[a,i]=_.useState(e==null?void 0:e.project);if(!e)return null;const s=async h=>{try{await _e(`/api/assets/${e.artifact_id}/project`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_name:h})}),i(h)}catch(p){console.error("Failed to update project:",p)}},o={model:{icon:Nr,color:"from-purple-500 to-pink-500",bgColor:"bg-purple-50 dark:bg-purple-900/20",textColor:"text-purple-600 dark:text-purple-400",borderColor:"border-purple-200 dark:border-purple-800"},dataset:{icon:Tr,color:"from-blue-500 to-cyan-500",bgColor:"bg-blue-50 dark:bg-blue-900/20",textColor:"text-blue-600 dark:text-blue-400",borderColor:"border-blue-200 dark:border-blue-800"},metrics:{icon:wa,color:"from-emerald-500 to-teal-500",bgColor:"bg-emerald-50 dark:bg-emerald-900/20",textColor:"text-emerald-600 dark:text-emerald-400",borderColor:"border-emerald-200 dark:border-emerald-800"},default:{icon:ql,color:"from-slate-500 to-slate-600",bgColor:"bg-slate-50 dark:bg-slate-900/20",textColor:"text-slate-600 dark:text-slate-400",borderColor:"border-slate-200 dark:border-slate-800"}},l=o[(f=e.type)==null?void 0:f.toLowerCase()]||o.default,c=l.icon,d=h=>{if(!h||h===0)return"N/A";const p=1024,g=["Bytes","KB","MB","GB","TB"],m=Math.floor(Math.log(h)/Math.log(p));return parseFloat((h/Math.pow(p,m)).toFixed(2))+" "+g[m]};return u.jsx(Me.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{duration:.2},className:"h-full flex flex-col",children:u.jsxs(ze,{className:"flex-1 flex flex-col overflow-hidden",children:[u.jsxs("div",{className:`p-6 ${l.bgColor} border-b ${l.borderColor}`,children:[u.jsxs("div",{className:"flex items-start justify-between mb-4",children:[u.jsx("div",{className:`p-3 rounded-xl bg-gradient-to-br ${l.color} text-white shadow-lg`,children:u.jsx(c,{size:32})}),u.jsx("button",{onClick:t,className:"p-2 hover:bg-white/50 dark:hover:bg-slate-800/50 rounded-lg transition-colors",children:u.jsx(No,{size:20,className:"text-slate-400"})})]}),u.jsx("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white mb-2",children:e.name}),u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx(Ot,{className:`bg-gradient-to-r ${l.color} text-white border-0`,children:e.type}),u.jsx(eN,{currentProject:a,onUpdate:s})]})]}),u.jsxs("div",{className:"flex items-center gap-1 p-2 border-b border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900",children:[u.jsx(D1,{active:r==="overview",onClick:()=>n("overview"),icon:Gp,label:"Overview"}),u.jsx(D1,{active:r==="properties",onClick:()=>n("properties"),icon:Xp,label:"Properties"}),u.jsx(D1,{active:r==="metadata",onClick:()=>n("metadata"),icon:_l,label:"Metadata"})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[r==="overview"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsxs("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 uppercase tracking-wider mb-3 flex items-center gap-2",children:[u.jsx(_l,{size:16}),"Asset Information"]}),u.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[u.jsx(Rh,{icon:kn,label:"Created",value:e.created_at?wt(new Date(e.created_at),"MMM d, yyyy HH:mm"):"N/A"}),u.jsx(Rh,{icon:g_,label:"Size",value:d(e.size||e.storage_bytes)}),u.jsx(Rh,{icon:ja,label:"Step",value:e.step||"N/A"}),u.jsx(Rh,{icon:_d,label:"Version",value:e.version||"N/A"})]})]}),(e.run_id||e.pipeline_name||a)&&u.jsxs("div",{children:[u.jsxs("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 uppercase tracking-wider mb-3 flex items-center gap-2",children:[u.jsx(_d,{size:16}),"Context"]}),u.jsxs("div",{className:"space-y-2",children:[a&&u.jsx($1,{icon:Nr,label:"Project",value:a,to:`/assets?project=${encodeURIComponent(a)}`}),e.pipeline_name&&u.jsx($1,{icon:Ge,label:"Pipeline",value:e.pipeline_name,to:`/pipelines?project=${encodeURIComponent(a||"")}`}),e.run_id&&u.jsx($1,{icon:Ge,label:"Run",value:e.run_id.slice(0,12)+"...",to:`/runs/${e.run_id}`})]})]})]}),r==="properties"&&u.jsxs("div",{children:[u.jsxs("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 uppercase tracking-wider mb-3 flex items-center gap-2",children:[u.jsx(Xp,{size:16}),"Properties (",e.properties?Object.keys(e.properties).length:0,")"]}),e.properties&&Object.keys(e.properties).length>0?u.jsx("div",{className:"bg-slate-50 dark:bg-slate-800/50 rounded-lg p-4 space-y-2",children:Object.entries(e.properties).map(([h,p])=>u.jsx(hpe,{name:h,value:p},h))}):u.jsx("div",{className:"text-center py-8 text-slate-500 italic",children:"No properties available"})]}),r==="metadata"&&u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 uppercase tracking-wider mb-2",children:"Artifact ID"}),u.jsx("div",{className:"bg-slate-50 dark:bg-slate-800/50 rounded-lg p-3",children:u.jsx("code",{className:"text-xs text-slate-600 dark:text-slate-400 font-mono break-all",children:e.artifact_id})})]}),e.uri&&u.jsxs("div",{children:[u.jsx("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 uppercase tracking-wider mb-2",children:"Location"}),u.jsx("div",{className:"bg-slate-50 dark:bg-slate-800/50 rounded-lg p-3",children:u.jsx("code",{className:"text-xs text-slate-600 dark:text-slate-400 break-all",children:e.uri})})]})]})]}),u.jsx("div",{className:"p-4 border-t border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-800/50",children:u.jsxs("div",{className:"flex gap-2",children:[u.jsxs(Se,{onClick:()=>If(e.artifact_id),disabled:!e.artifact_id,className:"flex-1",children:[u.jsx(_o,{size:16,className:"mr-2"}),"Download Asset"]}),e.run_id&&u.jsx(st,{to:`/runs/${e.run_id}`,children:u.jsxs(Se,{variant:"outline",children:[u.jsx(Yu,{size:16,className:"mr-2"}),"View in Run"]})})]})})]})})}function Rh({icon:e,label:t,value:r,mono:n=!1}){return u.jsxs("div",{className:"bg-white dark:bg-slate-800 rounded-lg p-3 border border-slate-200 dark:border-slate-700",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[u.jsx(e,{size:14,className:"text-slate-400"}),u.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:t})]}),u.jsx("p",{className:`text-sm font-semibold text-slate-900 dark:text-white ${n?"font-mono":""}`,children:r})]})}function $1({icon:e,label:t,value:r,to:n}){return u.jsxs(st,{to:n,className:"flex items-center gap-3 p-3 bg-white dark:bg-slate-800 rounded-lg border border-slate-200 dark:border-slate-700 hover:border-primary-300 dark:hover:border-primary-700 hover:shadow-md transition-all group",children:[u.jsx("div",{className:"p-2 bg-slate-100 dark:bg-slate-700 rounded-lg group-hover:bg-primary-100 dark:group-hover:bg-primary-900/30 transition-colors",children:u.jsx(e,{size:16,className:"text-slate-600 dark:text-slate-400 group-hover:text-primary-600 dark:group-hover:text-primary-400"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:t}),u.jsx("p",{className:"text-sm font-medium text-slate-900 dark:text-white truncate",children:r})]}),u.jsx(Yu,{size:14,className:"text-slate-400 opacity-0 group-hover:opacity-100 transition-opacity"})]})}function hpe({name:e,value:t}){const r=()=>typeof t=="object"?JSON.stringify(t,null,2):typeof t=="boolean"?t?"true":"false":typeof t=="number"?t.toLocaleString():String(t);return u.jsxs("div",{className:"flex items-start justify-between gap-4 py-2 border-b border-slate-200 dark:border-slate-700 last:border-0",children:[u.jsx("span",{className:"text-sm font-medium text-slate-700 dark:text-slate-300 shrink-0",children:e}),u.jsx("span",{className:"text-sm text-slate-600 dark:text-slate-400 text-right font-mono break-all",children:r()})]})}function D1({active:e,onClick:t,icon:r,label:n}){return u.jsxs("button",{onClick:t,className:`
519
- flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all
520
- ${e?"bg-slate-100 dark:bg-slate-800 text-slate-900 dark:text-white":"text-slate-500 hover:bg-slate-50 dark:hover:bg-slate-800/50 hover:text-slate-700 dark:hover:text-slate-300"}
521
- `,children:[u.jsx(r,{size:16}),n]})}function ppe(){const[e,t]=_.useState([]),[r,n]=_.useState(!0),[a,i]=_.useState(null),[s,o]=_.useState("all"),[l,c]=_.useState(null),[d,f]=_.useState("table"),[h,p]=_.useState(null),{selectedProject:g}=fi();_.useEffect(()=>{(async()=>{n(!0),i(null);try{const w=g?`/api/assets/?limit=50&project=${encodeURIComponent(g)}`:"/api/assets/?limit=50",j=await _e(w);if(!j.ok)throw new Error(`Failed to fetch assets: ${j.statusText}`);const k=await j.json();t(k.assets||[])}catch(w){console.error(w),i(w.message)}finally{n(!1)}})()},[g]),_.useEffect(()=>{(async()=>{try{const w=g?`/api/assets/stats?project=${encodeURIComponent(g)}`:"/api/assets/stats",j=await _e(w);if(j.ok){const k=await j.json();p(k)}}catch(w){console.error("Failed to fetch stats:",w)}})()},[g]);const m=["all",...new Set(e.map(v=>v.type))],b=e.filter(v=>s==="all"||v.type===s),x=[{header:"Type",key:"type",sortable:!0,render:v=>{const w={Dataset:{icon:u.jsx(Tr,{size:14}),color:"text-blue-600",bg:"bg-blue-50 dark:bg-blue-900/20"},Model:{icon:u.jsx(Nr,{size:14}),color:"text-purple-600",bg:"bg-purple-50 dark:bg-purple-900/20"},Metrics:{icon:u.jsx(wa,{size:14}),color:"text-emerald-600",bg:"bg-emerald-50 dark:bg-emerald-900/20"},default:{icon:u.jsx(ql,{size:14}),color:"text-slate-600",bg:"bg-slate-50 dark:bg-slate-800"}},j=w[v.type]||w.default;return u.jsxs("div",{className:`flex items-center gap-2 px-2 py-1 rounded-md w-fit ${j.bg} ${j.color}`,children:[j.icon,u.jsx("span",{className:"text-xs font-medium",children:v.type})]})}},{header:"Name",key:"name",sortable:!0,render:v=>u.jsx("span",{className:"font-medium text-slate-900 dark:text-white",children:v.name})},{header:"Step",key:"step",sortable:!0,render:v=>u.jsx("span",{className:"font-mono text-xs text-slate-500",children:v.step})},{header:"Pipeline",key:"pipeline",sortable:!0,render:v=>u.jsx("span",{className:"text-sm text-slate-600 dark:text-slate-400",children:v.pipeline_name||"-"})},{header:"Project",key:"project",sortable:!0,render:v=>u.jsx("span",{className:"text-sm text-slate-600 dark:text-slate-400",children:v.project||"-"})},{header:"Run ID",key:"run_id",render:v=>v.run_id?u.jsx(st,{to:`/runs/${v.run_id}`,className:"font-mono text-xs text-primary-600 hover:underline",onClick:w=>w.stopPropagation(),children:v.run_id.substring(0,8)}):u.jsx("span",{className:"font-mono text-xs text-slate-400",children:"-"})},{header:"Created",key:"created_at",sortable:!0,render:v=>u.jsx("span",{className:"text-sm text-slate-500",children:v.created_at?wt(new Date(v.created_at),"MMM d, HH:mm"):"-"})},{header:"",key:"actions",render:v=>u.jsxs("div",{className:"flex items-center justify-end gap-2 opacity-0 group-hover:opacity-100 transition-opacity",children:[u.jsx("button",{onClick:()=>c(v),className:"p-1 hover:bg-slate-100 dark:hover:bg-slate-800 rounded text-slate-500 hover:text-primary-600",title:"View Details",children:u.jsx(E0,{size:16})}),u.jsx("button",{onClick:w=>{w.stopPropagation(),If(v.artifact_id)},className:"p-1 hover:bg-slate-100 dark:hover:bg-slate-800 rounded text-slate-500 hover:text-primary-600",disabled:!v.artifact_id,title:"Download",children:u.jsx(_o,{size:16})})]})}],y=v=>{const w={Dataset:{icon:u.jsx(Tr,{size:18}),color:"text-blue-600",bg:"bg-blue-50 dark:bg-blue-900/20"},Model:{icon:u.jsx(Nr,{size:18}),color:"text-purple-600",bg:"bg-purple-50 dark:bg-purple-900/20"},Metrics:{icon:u.jsx(wa,{size:18}),color:"text-emerald-600",bg:"bg-emerald-50 dark:bg-emerald-900/20"},default:{icon:u.jsx(ql,{size:18}),color:"text-slate-600",bg:"bg-slate-50 dark:bg-slate-800"}},j=w[v.type]||w.default;return u.jsx(Me.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},whileHover:{y:-2},transition:{duration:.2},children:u.jsx(ze,{className:"group cursor-pointer hover:shadow-md hover:border-primary-200 dark:hover:border-primary-800 transition-all duration-200 h-full border border-slate-200 dark:border-slate-800",onClick:()=>c(v),children:u.jsxs("div",{className:"p-4",children:[u.jsxs("div",{className:"flex items-start justify-between mb-3",children:[u.jsx("div",{className:`p-2 rounded-lg ${j.bg} ${j.color}`,children:j.icon}),u.jsx(Ot,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 border-slate-200 dark:border-slate-700 text-slate-500",children:v.type})]}),u.jsx("h4",{className:"font-medium text-slate-900 dark:text-white mb-1 truncate group-hover:text-primary-600 transition-colors",children:v.name}),u.jsxs("div",{className:"flex items-center gap-2 mb-4 text-xs text-slate-500",children:[u.jsx("span",{className:"truncate max-w-[120px]",children:v.step}),v.project&&u.jsxs(u.Fragment,{children:[u.jsx("span",{children:"•"}),u.jsx("span",{className:"truncate max-w-[80px]",children:v.project})]})]}),u.jsxs("div",{className:"pt-3 border-t border-slate-100 dark:border-slate-800 flex items-center justify-between text-xs text-slate-400",children:[u.jsx("span",{children:v.created_at?wt(new Date(v.created_at),"MMM d"):"-"}),v.run_id&&u.jsx("span",{className:"font-mono bg-slate-50 dark:bg-slate-800 px-1.5 py-0.5 rounded",children:v.run_id.slice(0,6)})]})]})})})};return r?u.jsx("div",{className:"flex items-center justify-center h-screen bg-slate-50 dark:bg-slate-900",children:u.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):a?u.jsx("div",{className:"flex items-center justify-center h-screen bg-slate-50 dark:bg-slate-900",children:u.jsxs("div",{className:"text-center p-8 bg-red-50 dark:bg-red-900/20 rounded-2xl border border-red-100 dark:border-red-800 max-w-md",children:[u.jsx(XCircle,{className:"w-12 h-12 text-red-500 mx-auto mb-4"}),u.jsx("h3",{className:"text-lg font-bold text-red-700 dark:text-red-300 mb-2",children:"Failed to load assets"}),u.jsx("p",{className:"text-red-600 dark:text-red-400 mb-6",children:a}),u.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg shadow-sm hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors text-slate-700 dark:text-slate-300 font-medium",children:"Retry Connection"})]})}):u.jsxs("div",{className:"h-screen flex flex-col overflow-hidden bg-slate-50 dark:bg-slate-900",children:[u.jsx("div",{className:"bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 px-6 py-4",children:u.jsxs("div",{className:"flex items-center justify-between max-w-[1800px] mx-auto",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-slate-900 dark:text-white",children:"Assets"}),u.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 mt-0.5",children:"Manage and track your pipeline artifacts"})]}),!l&&u.jsxs("div",{className:"flex items-center gap-2 bg-slate-100 dark:bg-slate-700 p-1 rounded-lg",children:[u.jsx("button",{onClick:()=>f("grid"),className:`p-1.5 rounded transition-all ${d==="grid"?"bg-white dark:bg-slate-600 text-slate-900 dark:text-white shadow-sm":"text-slate-500 dark:text-slate-400 hover:text-slate-900 dark:hover:text-white"}`,title:"Grid View",children:u.jsx(WG,{size:16})}),u.jsx("button",{onClick:()=>f("table"),className:`p-1.5 rounded transition-all ${d==="table"?"bg-white dark:bg-slate-600 text-slate-900 dark:text-white shadow-sm":"text-slate-500 dark:text-slate-400 hover:text-slate-900 dark:hover:text-white"}`,title:"Table View",children:u.jsx(h6,{size:16})})]})]})}),u.jsx("div",{className:"flex-1 overflow-hidden",children:u.jsx("div",{className:"h-full max-w-[1800px] mx-auto px-6 py-6",children:u.jsxs("div",{className:"h-full flex gap-6",children:[u.jsxs("div",{className:"w-[380px] shrink-0 flex flex-col gap-4 overflow-y-auto pb-6",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsx(TD,{icon:ss,label:"Total",value:(h==null?void 0:h.total_assets)||0}),u.jsx(TD,{icon:g_,label:"Size",value:mpe((h==null?void 0:h.total_storage_bytes)||0)})]}),u.jsxs("div",{className:"flex-1 min-h-0 bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden flex flex-col",children:[u.jsx("div",{className:"p-3 border-b border-slate-100 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-800/50",children:u.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Explorer"})}),u.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:u.jsx(x7,{projectId:g,onAssetSelect:v=>c(v),compact:!0})})]})]}),u.jsx("div",{className:"flex-1 min-w-0 bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden flex flex-col shadow-sm",children:l?u.jsx(b7,{asset:l,onClose:()=>c(null)}):u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsxs("div",{className:"p-4 border-b border-slate-100 dark:border-slate-700 flex items-center gap-4 overflow-x-auto",children:[u.jsx(d6,{size:16,className:"text-slate-400 shrink-0"}),u.jsx("div",{className:"flex gap-2",children:m.map(v=>u.jsx("button",{onClick:()=>o(v),className:`px-3 py-1.5 rounded-full text-xs font-medium transition-all whitespace-nowrap border ${s===v?"bg-slate-900 text-white border-slate-900 dark:bg-white dark:text-slate-900 dark:border-white":"bg-white text-slate-600 border-slate-200 hover:border-slate-300 dark:bg-slate-800 dark:text-slate-300 dark:border-slate-700 dark:hover:border-slate-600"}`,children:v==="all"?"All":v},v))})]}),u.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:u.jsx(Cc,{items:b,loading:r,columns:x,renderGrid:y,initialView:d,emptyState:u.jsx(qN,{icon:ss,title:"No artifacts found",description:"Try adjusting your filters or run a pipeline to generate artifacts."})})})]})})]})})})]})}function TD({icon:e,label:t,value:r}){return u.jsxs("div",{className:"bg-white dark:bg-slate-800 rounded-xl p-3 border border-slate-200 dark:border-slate-700 shadow-sm",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[u.jsx(e,{size:14,className:"text-slate-400"}),u.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:t})]}),u.jsx("p",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:typeof r=="number"?r.toLocaleString():r})]})}function mpe(e){if(!e||e===0)return"0 B";const t=1024,r=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,n)).toFixed(1))+" "+r[n]}function gpe({experiment:e,onClose:t}){const[r,n]=_.useState([]),[a,i]=_.useState(!1);_.useEffect(()=>{e&&s()},[e]);const s=async()=>{i(!0);try{const l=e.pipeline_name?`/api/runs?pipeline=${encodeURIComponent(e.pipeline_name)}&limit=50`:"/api/runs?limit=50",f=(await(await _e(l)).json()).runs.filter(h=>h.pipeline_name===e.pipeline_name||e.runs&&e.runs.includes(h.run_id));n(f)}catch(l){console.error("Failed to fetch runs:",l)}finally{i(!1)}};if(!e)return null;const o={total:r.length,success:r.filter(l=>l.status==="completed").length,failed:r.filter(l=>l.status==="failed").length,avgDuration:r.length>0?r.reduce((l,c)=>l+(c.duration||0),0)/r.length:0};return u.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-slate-900",children:[u.jsxs("div",{className:"p-6 border-b border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-800/50",children:[u.jsxs("div",{className:"flex items-start justify-between mb-4",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("div",{className:"p-3 bg-purple-100 dark:bg-purple-900/30 rounded-xl text-purple-600 dark:text-purple-400",children:u.jsx(ea,{size:24})}),u.jsxs("div",{children:[u.jsx("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white",children:e.name}),u.jsxs("div",{className:"flex items-center gap-2 mt-1 text-sm text-slate-500",children:[e.project&&u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("span",{className:"opacity-50",children:"Project:"}),u.jsx("span",{className:"font-medium text-slate-700 dark:text-slate-300",children:e.project})]}),u.jsx("span",{children:"•"}),u.jsx("span",{children:wt(new Date(e.created_at||Date.now()),"MMM d, yyyy")})]})]})]}),u.jsx("div",{className:"flex items-center gap-2",children:u.jsx(Se,{variant:"ghost",size:"sm",onClick:t,children:u.jsx(No,{size:20,className:"text-slate-400"})})})]}),e.description&&u.jsx("p",{className:"text-slate-600 dark:text-slate-400 text-sm mb-6 max-w-3xl",children:e.description}),u.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[u.jsx($h,{label:"Total Runs",value:o.total,icon:Ge,color:"blue"}),u.jsx($h,{label:"Success Rate",value:`${o.total>0?Math.round(o.success/o.total*100):0}%`,icon:Lt,color:"emerald"}),u.jsx($h,{label:"Avg Duration",value:`${o.avgDuration.toFixed(1)}s`,icon:tt,color:"purple"}),u.jsx($h,{label:"Failed",value:o.failed,icon:pr,color:"rose"})]})]}),u.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[u.jsxs("div",{className:"p-4 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between bg-white dark:bg-slate-900",children:[u.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-white flex items-center gap-2",children:[u.jsx(Or,{size:18,className:"text-slate-400"}),"Recent Runs"]}),u.jsx(st,{to:`/runs?pipeline=${encodeURIComponent(e.pipeline_name||"")}`,children:u.jsxs(Se,{variant:"ghost",size:"sm",className:"text-primary-600",children:["View All Runs ",u.jsx(is,{size:16,className:"ml-1"})]})})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-slate-50 dark:bg-slate-900/50",children:a?u.jsx("div",{className:"flex justify-center py-8",children:u.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):r.length===0?u.jsx("div",{className:"text-center py-12 text-slate-500",children:"No runs found for this experiment"}):r.map(l=>u.jsx(st,{to:`/runs/${l.run_id}`,children:u.jsx(Me.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"bg-white dark:bg-slate-800 p-4 rounded-xl border border-slate-200 dark:border-slate-700 hover:shadow-md hover:border-primary-300 dark:hover:border-primary-700 transition-all group",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx(rm,{status:l.status}),u.jsxs("div",{children:[u.jsxs("div",{className:"font-medium text-slate-900 dark:text-white flex items-center gap-2",children:[l.name||`Run ${l.run_id.slice(0,8)}`,u.jsxs("span",{className:"text-xs font-mono text-slate-400",children:["#",l.run_id.slice(0,6)]})]}),u.jsxs("div",{className:"flex items-center gap-3 text-xs text-slate-500 mt-1",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(kn,{size:12}),wt(new Date(l.created||l.start_time),"MMM d, HH:mm")]}),u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(tt,{size:12}),l.duration?`${l.duration.toFixed(1)}s`:"-"]})]})]})]}),u.jsx(is,{size:16,className:"text-slate-300 group-hover:text-primary-500 transition-colors"})]})})},l.run_id))})]})]})}function $h({label:e,value:t,icon:r,color:n}){const a={blue:"text-blue-600 bg-blue-50 dark:bg-blue-900/20",emerald:"text-emerald-600 bg-emerald-50 dark:bg-emerald-900/20",purple:"text-purple-600 bg-purple-50 dark:bg-purple-900/20",rose:"text-rose-600 bg-rose-50 dark:bg-rose-900/20"};return u.jsxs("div",{className:"bg-white dark:bg-slate-800 p-3 rounded-xl border border-slate-200 dark:border-slate-700",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[u.jsx("div",{className:`p-1 rounded-lg ${a[n]}`,children:u.jsx(r,{size:14})}),u.jsx("span",{className:"text-xs text-slate-500 font-medium",children:e})]}),u.jsx("div",{className:"text-lg font-bold text-slate-900 dark:text-white pl-1",children:t})]})}function ype(){const[e,t]=_.useState([]),[r,n]=_.useState(!0),[a,i]=_.useState(null),{selectedProject:s}=fi();h_(),_.useEffect(()=>{(async()=>{n(!0);try{const c=s?`/api/experiments/?project=${encodeURIComponent(s)}`:"/api/experiments/",f=await(await fetch(c)).json();t(f.experiments||[])}catch(c){console.error(c)}finally{n(!1)}})()},[s]);const o=l=>{i(l)};return u.jsxs("div",{className:"h-screen flex flex-col overflow-hidden bg-slate-50 dark:bg-slate-900",children:[u.jsx("div",{className:"bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 px-6 py-4 shrink-0",children:u.jsx("div",{className:"flex items-center justify-between max-w-[1800px] mx-auto",children:u.jsxs("div",{children:[u.jsxs("h1",{className:"text-xl font-bold text-slate-900 dark:text-white flex items-center gap-2",children:[u.jsx(ea,{className:"text-purple-500"}),"Experiments"]}),u.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:"Manage and track your ML experiments"})]})})}),u.jsx("div",{className:"flex-1 overflow-hidden",children:u.jsx("div",{className:"h-full max-w-[1800px] mx-auto px-6 py-6",children:u.jsxs("div",{className:"h-full flex gap-6",children:[u.jsxs("div",{className:"w-[320px] shrink-0 flex flex-col bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden shadow-sm",children:[u.jsx("div",{className:"p-3 border-b border-slate-200 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-800/50",children:u.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Explorer"})}),u.jsx("div",{className:"flex-1 min-h-0",children:u.jsx(J_,{mode:"experiments",projectId:s,onSelect:o,selectedId:a==null?void 0:a.experiment_id})})]}),u.jsx("div",{className:"flex-1 min-w-0 bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden shadow-sm",children:a?u.jsx(gpe,{experiment:a,onClose:()=>i(null)}):u.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center p-8 bg-slate-50/50 dark:bg-slate-900/50",children:[u.jsx("div",{className:"w-20 h-20 bg-purple-100 dark:bg-purple-900/30 rounded-full flex items-center justify-center mb-6 animate-pulse",children:u.jsx(ea,{size:40,className:"text-purple-500"})}),u.jsx("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white mb-2",children:"Select an Experiment"}),u.jsx("p",{className:"text-slate-500 max-w-md",children:"Choose an experiment from the sidebar to view detailed metrics, runs, and analysis."})]})})]})})})]})}function vpe(){var o;const{experimentId:e}=p_(),[t,r]=_.useState(null),[n,a]=_.useState(!0);if(_.useEffect(()=>{_e(`/api/experiments/${e}`).then(l=>l.json()).then(l=>{r(l),a(!1)}).catch(l=>{console.error(l),a(!1)})},[e]),n)return u.jsx("div",{className:"flex items-center justify-center h-96",children:u.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600"})});if(!t)return u.jsx("div",{className:"p-8 text-center",children:u.jsx("p",{className:"text-slate-500",children:"Experiment not found"})});const i={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},s={hidden:{opacity:0,y:20},show:{opacity:1,y:0}};return u.jsxs(Me.div,{initial:"hidden",animate:"show",variants:i,className:"space-y-8",children:[u.jsxs(Me.div,{variants:s,className:"bg-white p-6 rounded-xl border border-slate-100 shadow-sm",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[u.jsx(st,{to:"/experiments",className:"text-sm text-slate-500 hover:text-slate-700 transition-colors",children:"Experiments"}),u.jsx(fo,{size:14,className:"text-slate-300"}),u.jsx("span",{className:"text-sm text-slate-900 font-medium",children:t.name})]}),u.jsx("div",{className:"flex items-start justify-between",children:u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("div",{className:"p-3 bg-gradient-to-br from-purple-500 to-pink-500 rounded-xl shadow-lg",children:u.jsx(ea,{className:"text-white",size:28})}),u.jsxs("div",{children:[u.jsx("h2",{className:"text-3xl font-bold text-slate-900 tracking-tight",children:t.name}),u.jsx("p",{className:"text-slate-500 mt-1",children:t.description||"No description"})]})]})})]}),u.jsxs(Me.div,{variants:s,className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[u.jsx(I1,{icon:u.jsx(Ge,{size:24}),label:"Total Runs",value:((o=t.runs)==null?void 0:o.length)||0,color:"blue"}),u.jsx(I1,{icon:u.jsx(os,{size:24}),label:"Best Performance",value:xpe(t.runs),color:"emerald"}),u.jsx(I1,{icon:u.jsx(kn,{size:24}),label:"Last Run",value:bpe(t.runs),color:"purple"})]}),u.jsxs(Me.div,{variants:s,children:[u.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[u.jsx(DG,{className:"text-primary-500",size:24}),u.jsx("h3",{className:"text-xl font-bold text-slate-900",children:"Runs Comparison"})]}),t.runs&&t.runs.length>0?u.jsx(ze,{className:"p-0 overflow-hidden",children:u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-left",children:[u.jsx("thead",{className:"bg-gradient-to-r from-slate-50 to-slate-100/50 border-b border-slate-200",children:u.jsxs("tr",{children:[u.jsx("th",{className:"px-6 py-4 font-semibold text-xs text-slate-600 uppercase tracking-wider",children:"Run ID"}),u.jsx("th",{className:"px-6 py-4 font-semibold text-xs text-slate-600 uppercase tracking-wider",children:"Date"}),u.jsx("th",{className:"px-6 py-4 font-semibold text-xs text-slate-600 uppercase tracking-wider",children:"Metrics"}),u.jsx("th",{className:"px-6 py-4 font-semibold text-xs text-slate-600 uppercase tracking-wider",children:"Parameters"}),u.jsx("th",{className:"px-6 py-4 font-semibold text-xs text-slate-600 uppercase tracking-wider"})]})}),u.jsx("tbody",{className:"divide-y divide-slate-100",children:t.runs.map((l,c)=>u.jsxs(Me.tr,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:c*.05},className:"hover:bg-slate-50/70 transition-colors group",children:[u.jsx("td",{className:"px-6 py-4 font-mono text-sm text-slate-700 font-medium",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"w-2 h-2 rounded-full bg-primary-400 opacity-0 group-hover:opacity-100 transition-opacity"}),l.run_id.substring(0,12)]})}),u.jsx("td",{className:"px-6 py-4 text-sm text-slate-500",children:l.timestamp?wt(new Date(l.timestamp),"MMM d, HH:mm:ss"):"-"}),u.jsx("td",{className:"px-6 py-4",children:u.jsxs("div",{className:"flex flex-wrap gap-2",children:[Object.entries(l.metrics||{}).map(([d,f])=>u.jsxs(Ot,{variant:"outline",className:"font-mono text-xs bg-blue-50 text-blue-700 border-blue-200",children:[d,": ",typeof f=="number"?f.toFixed(4):f]},d)),Object.keys(l.metrics||{}).length===0&&u.jsx("span",{className:"text-xs text-slate-400 italic",children:"No metrics"})]})}),u.jsx("td",{className:"px-6 py-4",children:u.jsxs("div",{className:"flex flex-wrap gap-2",children:[Object.entries(l.parameters||{}).map(([d,f])=>u.jsxs("span",{className:"text-xs text-slate-600 bg-slate-100 px-2.5 py-1 rounded-md font-medium",children:[d,"=",String(f)]},d)),Object.keys(l.parameters||{}).length===0&&u.jsx("span",{className:"text-xs text-slate-400 italic",children:"No params"})]})}),u.jsx("td",{className:"px-6 py-4 text-right",children:u.jsx(st,{to:`/runs/${l.run_id}`,children:u.jsx(Se,{variant:"ghost",size:"sm",className:"opacity-0 group-hover:opacity-100 transition-opacity",children:"View Run"})})})]},l.run_id))})]})})}):u.jsx(ze,{className:"p-12 text-center border-dashed",children:u.jsx("p",{className:"text-slate-500",children:"No runs recorded for this experiment yet."})})]})]})}function I1({icon:e,label:t,value:r,color:n}){const a={blue:"bg-blue-50 text-blue-600",purple:"bg-purple-50 text-purple-600",emerald:"bg-emerald-50 text-emerald-600"};return u.jsx(ze,{className:"hover:shadow-md transition-shadow duration-200",children:u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("div",{className:`p-3 rounded-xl ${a[n]}`,children:e}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm text-slate-500 font-medium",children:t}),u.jsx("p",{className:"text-2xl font-bold text-slate-900",children:r})]})]})})}function xpe(e){if(!e||e.length===0)return"-";const t=["accuracy","f1_score","precision","recall"];for(const r of t){const n=e.map(a=>{var i;return(i=a.metrics)==null?void 0:i[r]}).filter(a=>typeof a=="number");if(n.length>0)return`${Math.max(...n).toFixed(4)} (${r})`}return"N/A"}function bpe(e){var r;if(!e||e.length===0)return"-";const t=[...e].sort((n,a)=>{const i=n.timestamp?new Date(n.timestamp):new Date(0);return(a.timestamp?new Date(a.timestamp):new Date(0))-i});return(r=t[0])!=null&&r.timestamp?wt(new Date(t[0].timestamp),"MMM d, HH:mm"):"-"}function wpe(){const[e,t]=_.useState([]),[r,n]=_.useState(null),[a,i]=_.useState(!0),[s,o]=_.useState("all"),{selectedProject:l}=fi();_.useEffect(()=>{c()},[s,l]);const c=async()=>{i(!0);try{const m=new URLSearchParams;s!=="all"&&m.append("event_type",s),l&&m.append("project",l);const x=await(await _e(`/api/traces?${m}`)).json();t(x)}catch(m){console.error("Failed to fetch traces:",m)}finally{i(!1)}},d=async m=>{try{const x=await(await _e(`/api/traces/${m}`)).json();n(x)}catch(b){console.error("Failed to fetch trace details:",b)}},f=m=>m?`${(m*1e3).toFixed(0)}ms`:"N/A",h=m=>{switch(m){case"success":return"text-green-400";case"error":return"text-red-400";case"running":return"text-yellow-400";default:return"text-gray-400"}},p=m=>{switch(m){case"llm":return u.jsx(m6,{className:"w-4 h-4"});case"tool":return u.jsx(po,{className:"w-4 h-4"});default:return u.jsx(Ge,{className:"w-4 h-4"})}},g=({events:m,level:b=0})=>m?u.jsx("div",{className:`pl-${b*4}`,children:m.map((x,y)=>u.jsxs("div",{className:"mb-2",children:[u.jsxs("div",{className:"flex items-center gap-2 p-2 bg-gray-800/50 rounded border border-gray-700/50 hover:border-blue-500/50 transition-colors",children:[u.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[p(x.event_type),u.jsx("span",{className:"font-medium",children:x.name}),u.jsx("span",{className:`text-sm ${h(x.status)}`,children:x.status})]}),u.jsxs("div",{className:"flex items-center gap-4 text-sm text-gray-400",children:[x.duration&&u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(tt,{className:"w-3 h-3"}),f(x.duration)]}),x.total_tokens>0&&u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(Ge,{className:"w-3 h-3"}),x.total_tokens," tokens"]}),x.cost>0&&u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(VG,{className:"w-3 h-3"}),"$",x.cost.toFixed(4)]})]})]}),x.children&&x.children.length>0&&u.jsx("div",{className:"ml-6 mt-2 border-l-2 border-gray-700/50 pl-2",children:u.jsx(g,{events:x.children,level:b+1})})]},y))}):null;return u.jsxs("div",{className:"p-6",children:[u.jsxs("div",{className:"flex justify-between items-center mb-6",children:[u.jsx("h1",{className:"text-2xl font-bold",children:"🔍 LLM Traces"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsxs("select",{value:s,onChange:m=>o(m.target.value),className:"px-4 py-2 bg-gray-800 border border-gray-700 rounded-lg",children:[u.jsx("option",{value:"all",children:"All Types"}),u.jsx("option",{value:"llm",children:"LLM Calls"}),u.jsx("option",{value:"tool",children:"Tool Calls"}),u.jsx("option",{value:"chain",children:"Chains"}),u.jsx("option",{value:"agent",children:"Agents"})]}),u.jsx("button",{onClick:c,className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors",children:"Refresh"})]})]}),a?u.jsxs("div",{className:"text-center py-12",children:[u.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500"}),u.jsx("p",{className:"mt-4 text-gray-400",children:"Loading traces..."})]}):e.length===0?u.jsxs("div",{className:"text-center py-12 bg-gray-800/30 rounded-lg border-2 border-dashed border-gray-700",children:[u.jsx(Ge,{className:"w-12 h-12 mx-auto text-gray-600 mb-4"}),u.jsx("p",{className:"text-gray-400",children:"No traces found"}),u.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"Use @trace_llm decorator to track LLM calls"})]}):u.jsx("div",{className:"grid gap-4",children:e.map(m=>{const b=m.trace_id;return u.jsxs("div",{className:"bg-gray-800/50 rounded-lg border border-gray-700/50 p-4 hover:border-blue-500/50 transition-all cursor-pointer",onClick:()=>d(b),children:[u.jsxs("div",{className:"flex items-start justify-between mb-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[p(m.event_type),u.jsxs("div",{children:[u.jsx("h3",{className:"font-semibold text-lg",children:m.name}),u.jsxs("p",{className:"text-sm text-gray-400",children:["Trace ID: ",b.slice(0,8),"..."]})]})]}),u.jsx("span",{className:`px-3 py-1 rounded-full text-sm ${h(m.status)}`,children:m.status})]}),u.jsxs("div",{className:"grid grid-cols-4 gap-4 text-sm",children:[u.jsxs("div",{children:[u.jsx("span",{className:"text-gray-500",children:"Duration:"}),u.jsx("span",{className:"ml-2 text-gray-300",children:f(m.duration)})]}),m.model&&u.jsxs("div",{children:[u.jsx("span",{className:"text-gray-500",children:"Model:"}),u.jsx("span",{className:"ml-2 text-gray-300",children:m.model})]}),m.total_tokens>0&&u.jsxs("div",{children:[u.jsx("span",{className:"text-gray-500",children:"Tokens:"}),u.jsxs("span",{className:"ml-2 text-gray-300",children:[m.total_tokens," (",m.prompt_tokens,"/",m.completion_tokens,")"]})]}),m.cost>0&&u.jsxs("div",{children:[u.jsx("span",{className:"text-gray-500",children:"Cost:"}),u.jsxs("span",{className:"ml-2 text-gray-300",children:["$",m.cost.toFixed(4)]})]})]})]},m.event_id)})}),r&&u.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center p-6 z-50",children:u.jsxs("div",{className:"bg-gray-900 rounded-lg max-w-4xl w-full max-h-[80vh] overflow-auto border border-gray-700",children:[u.jsxs("div",{className:"sticky top-0 bg-gray-900 border-b border-gray-700 p-4 flex justify-between items-center",children:[u.jsx("h2",{className:"text-xl font-bold",children:"Trace Details"}),u.jsx("button",{onClick:()=>n(null),className:"px-4 py-2 bg-gray-800 hover:bg-gray-700 rounded-lg",children:"Close"})]}),u.jsx("div",{className:"p-6",children:u.jsx(g,{events:r})})]})})]})}function jpe(){const[e,t]=_.useState([]),[r,n]=_.useState(!0),[a,i]=_.useState(!1),[s,o]=_.useState(""),[l,c]=_.useState(""),[d,f]=_.useState({}),{setSelectedProject:h}=fi();_.useEffect(()=>{p()},[]);const p=async()=>{try{const v=await(await _e("/api/projects/")).json(),w=Array.isArray(v)?v:v.projects||[],j=await Promise.all(w.map(async k=>{try{const N=await(await fetch(`/api/runs?project=${encodeURIComponent(k.name)}`)).json(),E=new Set((N.runs||[]).map(M=>M.pipeline_name)),C=await(await fetch(`/api/assets?project=${encodeURIComponent(k.name)}`)).json();return{...k,runs:(N.runs||[]).length,pipelines:E.size,artifacts:(C.artifacts||[]).length}}catch(S){return console.error(`Failed to fetch stats for project ${k.name}:`,S),{...k,runs:0,pipelines:0,artifacts:0}}}));t(j)}catch(y){console.error("Failed to fetch projects:",y)}finally{n(!1)}},g=async y=>{y.preventDefault();try{(await _e("/api/projects/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s,description:l})})).ok&&(i(!1),o(""),c(""),p())}catch(v){console.error("Failed to create project:",v)}},m=async y=>{if(confirm(`Are you sure you want to delete project "${y}"?`))try{(await _e(`/api/projects/${y}`,{method:"DELETE"})).ok&&p()}catch(v){console.error("Failed to delete project:",v)}},b=[{header:"Project Name",key:"name",sortable:!0,render:y=>u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"p-2 bg-blue-500/10 rounded-lg",children:u.jsx(Ua,{className:"w-5 h-5 text-blue-500"})}),u.jsxs("div",{children:[u.jsx("div",{className:"font-medium text-slate-900 dark:text-white",children:y.name}),u.jsxs("div",{className:"text-xs text-slate-500",children:["Created ",wt(new Date(y.created_at),"MMM d, yyyy")]})]})]})},{header:"Description",key:"description",render:y=>u.jsx("span",{className:"text-slate-500 dark:text-slate-400 truncate max-w-xs block",children:y.description||"No description"})},{header:"Stats",key:"stats",render:y=>{const v={runs:y.runs||0,pipelines:y.pipelines||0,artifacts:y.artifacts||0};return u.jsxs("div",{className:"flex gap-4 text-sm text-slate-500",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(Ge,{size:14})," ",v.pipelines||0]}),u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(tt,{size:14})," ",v.runs||0]}),u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(Tr,{size:14})," ",v.artifacts||0]})]})}},{header:"Actions",key:"actions",render:y=>u.jsx("button",{onClick:v=>{v.stopPropagation(),m(y.name)},className:"p-2 text-slate-400 hover:text-red-500 transition-colors",children:u.jsx(ho,{size:16})})}],x=y=>{const v={runs:y.runs||0,pipelines:y.pipelines||0,artifacts:y.artifacts||0};return u.jsx(st,{to:`/projects/${encodeURIComponent(y.name)}`,onClick:()=>h(y.name),className:"block",children:u.jsxs("div",{className:"bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 p-6 hover:border-blue-500/50 hover:shadow-md transition-all group cursor-pointer",children:[u.jsxs("div",{className:"flex justify-between items-start mb-4",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"p-3 bg-blue-500/10 rounded-xl group-hover:bg-blue-500/20 transition-colors",children:u.jsx(Ua,{className:"w-6 h-6 text-blue-600 dark:text-blue-400"})}),u.jsxs("div",{children:[u.jsx("h3",{className:"font-bold text-lg text-slate-900 dark:text-white",children:y.name}),u.jsxs("p",{className:"text-xs text-slate-500",children:["Created ",wt(new Date(y.created_at),"MMM d, yyyy")]})]})]}),u.jsx("button",{onClick:w=>{w.preventDefault(),w.stopPropagation(),m(y.name)},className:"text-slate-400 hover:text-red-500 transition-colors opacity-0 group-hover:opacity-100",children:u.jsx(ho,{className:"w-4 h-4"})})]}),u.jsx("p",{className:"text-slate-500 dark:text-slate-400 mb-6 h-10 overflow-hidden text-sm line-clamp-2",children:y.description||"No description provided."}),u.jsxs("div",{className:"grid grid-cols-3 gap-4 border-t border-slate-100 dark:border-slate-700 pt-4",children:[u.jsxs("div",{className:"text-center",children:[u.jsxs("div",{className:"flex items-center justify-center gap-1 text-slate-400 text-xs mb-1",children:[u.jsx(Ge,{className:"w-3 h-3"})," Pipelines"]}),u.jsx("span",{className:"font-bold text-slate-700 dark:text-slate-200",children:v.pipelines||0})]}),u.jsxs("div",{className:"text-center",children:[u.jsxs("div",{className:"flex items-center justify-center gap-1 text-slate-400 text-xs mb-1",children:[u.jsx(tt,{className:"w-3 h-3"})," Runs"]}),u.jsx("span",{className:"font-bold text-slate-700 dark:text-slate-200",children:v.runs||0})]}),u.jsxs("div",{className:"text-center",children:[u.jsxs("div",{className:"flex items-center justify-center gap-1 text-slate-400 text-xs mb-1",children:[u.jsx(Tr,{className:"w-3 h-3"})," Artifacts"]}),u.jsx("span",{className:"font-bold text-slate-700 dark:text-slate-200",children:v.artifacts||0})]})]})]})})};return u.jsxs("div",{className:"p-6 max-w-7xl mx-auto",children:[u.jsx(Cc,{title:"Projects",subtitle:"Manage your ML projects and workspaces",items:e,loading:r,columns:b,initialView:"grid",renderGrid:x,actions:u.jsxs(Se,{onClick:()=>i(!0),className:"flex items-center gap-2",children:[u.jsx(Qi,{size:18}),"New Project"]}),emptyState:u.jsxs("div",{className:"text-center py-12 bg-slate-50 dark:bg-slate-800/30 rounded-xl border-2 border-dashed border-slate-200 dark:border-slate-700",children:[u.jsx(Ua,{className:"w-12 h-12 mx-auto text-slate-400 mb-4"}),u.jsx("h3",{className:"text-lg font-medium text-slate-900 dark:text-white",children:"No projects found"}),u.jsx("p",{className:"text-slate-500 mb-6",children:"Get started by creating your first project."}),u.jsx(Se,{onClick:()=>i(!0),children:"Create Project"})]})}),a&&u.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 animate-in fade-in duration-200",children:u.jsxs("div",{className:"bg-white dark:bg-slate-800 p-6 rounded-xl w-full max-w-md border border-slate-200 dark:border-slate-700 shadow-xl",children:[u.jsx("h2",{className:"text-xl font-bold mb-4 text-slate-900 dark:text-white",children:"Create New Project"}),u.jsxs("form",{onSubmit:g,children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Project Name"}),u.jsx("input",{type:"text",value:s,onChange:y=>o(y.target.value),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-700 rounded-lg border border-slate-200 dark:border-slate-600 focus:border-blue-500 outline-none text-slate-900 dark:text-white",required:!0,placeholder:"e.g., recommendation-system"})]}),u.jsxs("div",{className:"mb-6",children:[u.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Description"}),u.jsx("textarea",{value:l,onChange:y=>c(y.target.value),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-700 rounded-lg border border-slate-200 dark:border-slate-600 focus:border-blue-500 outline-none text-slate-900 dark:text-white",rows:"3",placeholder:"Brief description of the project..."})]}),u.jsxs("div",{className:"flex justify-end gap-3",children:[u.jsx("button",{type:"button",onClick:()=>i(!1),className:"px-4 py-2 text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-700 rounded-lg transition-colors",children:"Cancel"}),u.jsx(Se,{type:"submit",children:"Create Project"})]})]})]})})]})}function Spe({project:e,stats:t,loading:r}){var n,a,i;return r||!e?u.jsxs("div",{className:"animate-pulse space-y-4",children:[u.jsx("div",{className:"h-8 bg-slate-200 dark:bg-slate-700 rounded w-1/3"}),u.jsx("div",{className:"h-4 bg-slate-200 dark:bg-slate-700 rounded w-1/2"}),u.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[u.jsx("div",{className:"h-24 bg-slate-200 dark:bg-slate-700 rounded-xl"}),u.jsx("div",{className:"h-24 bg-slate-200 dark:bg-slate-700 rounded-xl"}),u.jsx("div",{className:"h-24 bg-slate-200 dark:bg-slate-700 rounded-xl"}),u.jsx("div",{className:"h-24 bg-slate-200 dark:bg-slate-700 rounded-xl"})]})]}):u.jsxs("div",{className:"flex items-start justify-between",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("div",{className:"p-3 bg-blue-600 rounded-xl shadow-lg shadow-blue-500/20",children:u.jsx(Ua,{className:"w-6 h-6 text-white"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-bold text-slate-900 dark:text-white mb-1",children:e.name}),u.jsxs("div",{className:"flex items-center gap-4 text-sm text-slate-500 dark:text-slate-400",children:[u.jsxs("span",{children:["Created ",ri(((n=e.metadata)==null?void 0:n.created_at)||e.created_at)]}),(((a=e.metadata)==null?void 0:a.description)||e.description)&&u.jsxs(u.Fragment,{children:[u.jsx("span",{children:"•"}),u.jsx("span",{children:((i=e.metadata)==null?void 0:i.description)||e.description})]})]})]})]}),u.jsx("div",{className:"flex gap-2"})]})}var kpe=xB();const Nn=Ke(kpe);function _pe(e){return e==null}var Npe=_pe;const Re=Ke(Npe);var Epe=PB();const vo=Ke(Epe);var Ppe=Mc();const Ce=Ke(Ppe);var Cpe=$r();const zc=Ke(Cpe);var w7={exports:{}},Qe={};/**
522
- * @license React
523
- * react-is.production.min.js
524
- *
525
- * Copyright (c) Facebook, Inc. and its affiliates.
526
- *
527
- * This source code is licensed under the MIT license found in the
528
- * LICENSE file in the root directory of this source tree.
529
- */var UN=Symbol.for("react.element"),HN=Symbol.for("react.portal"),sg=Symbol.for("react.fragment"),og=Symbol.for("react.strict_mode"),lg=Symbol.for("react.profiler"),cg=Symbol.for("react.provider"),ug=Symbol.for("react.context"),Ape=Symbol.for("react.server_context"),dg=Symbol.for("react.forward_ref"),fg=Symbol.for("react.suspense"),hg=Symbol.for("react.suspense_list"),pg=Symbol.for("react.memo"),mg=Symbol.for("react.lazy"),Tpe=Symbol.for("react.offscreen"),j7;j7=Symbol.for("react.module.reference");function Rn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case UN:switch(e=e.type,e){case sg:case lg:case og:case fg:case hg:return e;default:switch(e=e&&e.$$typeof,e){case Ape:case ug:case dg:case mg:case pg:case cg:return e;default:return t}}case HN:return t}}}Qe.ContextConsumer=ug;Qe.ContextProvider=cg;Qe.Element=UN;Qe.ForwardRef=dg;Qe.Fragment=sg;Qe.Lazy=mg;Qe.Memo=pg;Qe.Portal=HN;Qe.Profiler=lg;Qe.StrictMode=og;Qe.Suspense=fg;Qe.SuspenseList=hg;Qe.isAsyncMode=function(){return!1};Qe.isConcurrentMode=function(){return!1};Qe.isContextConsumer=function(e){return Rn(e)===ug};Qe.isContextProvider=function(e){return Rn(e)===cg};Qe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===UN};Qe.isForwardRef=function(e){return Rn(e)===dg};Qe.isFragment=function(e){return Rn(e)===sg};Qe.isLazy=function(e){return Rn(e)===mg};Qe.isMemo=function(e){return Rn(e)===pg};Qe.isPortal=function(e){return Rn(e)===HN};Qe.isProfiler=function(e){return Rn(e)===lg};Qe.isStrictMode=function(e){return Rn(e)===og};Qe.isSuspense=function(e){return Rn(e)===fg};Qe.isSuspenseList=function(e){return Rn(e)===hg};Qe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===sg||e===lg||e===og||e===fg||e===hg||e===Tpe||typeof e=="object"&&e!==null&&(e.$$typeof===mg||e.$$typeof===pg||e.$$typeof===cg||e.$$typeof===ug||e.$$typeof===dg||e.$$typeof===j7||e.getModuleId!==void 0)};Qe.typeOf=Rn;w7.exports=Qe;var Ope=w7.exports,Mpe=pi,Rpe=Tn,$pe="[object Number]";function Dpe(e){return typeof e=="number"||Rpe(e)&&Mpe(e)==$pe}var S7=Dpe;const Ipe=Ke(S7);var Lpe=S7;function zpe(e){return Lpe(e)&&e!=+e}var Fpe=zpe;const Lf=Ke(Fpe);var Zn=function(t){return t===0?0:t>0?1:-1},Gs=function(t){return vo(t)&&t.indexOf("%")===t.length-1},J=function(t){return Ipe(t)&&!Lf(t)},Bpe=function(t){return Re(t)},Jt=function(t){return J(t)||vo(t)},Vpe=0,zf=function(t){var r=++Vpe;return"".concat(t||"").concat(r)},xo=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!J(t)&&!vo(t))return n;var i;if(Gs(t)){var s=t.indexOf("%");i=r*parseFloat(t.slice(0,s))/100}else i=+t;return Lf(i)&&(i=n),a&&i>r&&(i=r),i},zi=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},qpe=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a<r;a++)if(!n[t[a]])n[t[a]]=!0;else return!0;return!1},Yn=function(t,r){return J(t)&&J(r)?function(n){return t+n*(r-t)}:function(){return r}};function ym(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):Nn(n,t))===r})}var Upe=function(t,r){return J(t)&&J(r)?t-r:vo(t)&&vo(r)?t.localeCompare(r):t instanceof Date&&r instanceof Date?t.getTime()-r.getTime():String(t).localeCompare(String(r))};function Ol(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 GS(e){"@babel/helpers - typeof";return GS=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},GS(e)}var Hpe=["viewBox","children"],Wpe=["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"],OD=["points","pathLength"],L1={svg:Hpe,polygon:OD,polyline:OD},WN=["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"],vm=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(_.isValidElement(t)&&(n=t.props),!zc(n))return null;var a={};return Object.keys(n).forEach(function(i){WN.includes(i)&&(a[i]=r||function(s){return n[i](n,s)})}),a},Gpe=function(t,r,n){return function(a){return t(r,n,a),null}},xm=function(t,r,n){if(!zc(t)||GS(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var s=t[i];WN.includes(i)&&typeof s=="function"&&(a||(a={}),a[i]=Gpe(s,r,n))}),a},Kpe=["children"],Ype=["children"];function MD(e,t){if(e==null)return{};var r=Xpe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Xpe(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 KS(e){"@babel/helpers - typeof";return KS=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},KS(e)}var RD={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"},Wa=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},$D=null,z1=null,GN=function e(t){if(t===$D&&Array.isArray(z1))return z1;var r=[];return _.Children.forEach(t,function(n){Re(n)||(Ope.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),z1=r,$D=t,r};function En(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return Wa(a)}):n=[Wa(t)],GN(e).forEach(function(a){var i=Nn(a,"type.displayName")||Nn(a,"type.name");n.indexOf(i)!==-1&&r.push(a)}),r}function Yr(e,t){var r=En(e,t);return r&&r[0]}var DD=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!J(n)||n<=0||!J(a)||a<=0)},Zpe=["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"],Qpe=function(t){return t&&t.type&&vo(t.type)&&Zpe.indexOf(t.type)>=0},Jpe=function(t){return t&&KS(t)==="object"&&"clipDot"in t},eme=function(t,r,n,a){var i,s=(i=L1==null?void 0:L1[a])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!Ce(t)&&(a&&s.includes(r)||Wpe.includes(r))||n&&WN.includes(r)},Ie=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(_.isValidElement(t)&&(a=t.props),!zc(a))return null;var i={};return Object.keys(a).forEach(function(s){var o;eme((o=a)===null||o===void 0?void 0:o[s],s,r,n)&&(i[s]=a[s])}),i},YS=function e(t,r){if(t===r)return!0;var n=_.Children.count(t);if(n!==_.Children.count(r))return!1;if(n===0)return!0;if(n===1)return ID(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a<n;a++){var i=t[a],s=r[a];if(Array.isArray(i)||Array.isArray(s)){if(!e(i,s))return!1}else if(!ID(i,s))return!1}return!0},ID=function(t,r){if(Re(t)&&Re(r))return!0;if(!Re(t)&&!Re(r)){var n=t.props||{},a=n.children,i=MD(n,Kpe),s=r.props||{},o=s.children,l=MD(s,Ype);return a&&o?Ol(i,l)&&YS(a,o):!a&&!o?Ol(i,l):!1}return!1},LD=function(t,r){var n=[],a={};return GN(t).forEach(function(i,s){if(Qpe(i))n.push(i);else if(i){var o=Wa(i.type),l=r[o]||{},c=l.handler,d=l.once;if(c&&(!d||!a[o])){var f=c(i,o,s);n.push(f),a[o]=!0}}}),n},tme=function(t){var r=t&&t.type;return r&&RD[r]?RD[r]:null},rme=function(t,r){return GN(r).indexOf(t)},nme=["children","width","height","viewBox","className","style","title","desc"];function XS(){return XS=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},XS.apply(this,arguments)}function ame(e,t){if(e==null)return{};var r=ime(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ime(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 ZS(e){var t=e.children,r=e.width,n=e.height,a=e.viewBox,i=e.className,s=e.style,o=e.title,l=e.desc,c=ame(e,nme),d=a||{width:r,height:n,x:0,y:0},f=Fe("recharts-surface",i);return O.createElement("svg",XS({},Ie(c,!0,"svg"),{className:f,width:r,height:n,style:s,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),O.createElement("title",null,o),O.createElement("desc",null,l),t)}var sme=["children","className"];function QS(){return QS=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},QS.apply(this,arguments)}function ome(e,t){if(e==null)return{};var r=lme(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lme(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 It=O.forwardRef(function(e,t){var r=e.children,n=e.className,a=ome(e,sme),i=Fe("recharts-layer",n);return O.createElement("g",QS({className:i},Ie(a,!0),{ref:t}),r)}),Ga=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i]};function cme(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n<a;)i[n]=e[n+t];return i}var ume=cme,dme=ume;function fme(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:dme(e,t,r)}var hme=fme;function pme(e){return e.split("")}var mme=pme,k7="\\ud800-\\udfff",gme="\\u0300-\\u036f",yme="\\ufe20-\\ufe2f",vme="\\u20d0-\\u20ff",xme=gme+yme+vme,bme="\\ufe0e\\ufe0f",wme="["+k7+"]",JS="["+xme+"]",ek="\\ud83c[\\udffb-\\udfff]",jme="(?:"+JS+"|"+ek+")",_7="[^"+k7+"]",N7="(?:\\ud83c[\\udde6-\\uddff]){2}",E7="[\\ud800-\\udbff][\\udc00-\\udfff]",Sme="\\u200d",P7=jme+"?",C7="["+bme+"]?",kme="(?:"+Sme+"(?:"+[_7,N7,E7].join("|")+")"+C7+P7+")*",_me=C7+P7+kme,Nme="(?:"+[_7+JS+"?",JS,N7,E7,wme].join("|")+")",Eme=RegExp(ek+"(?="+ek+")|"+Nme+_me,"g");function Pme(e){return e.match(Eme)||[]}var Cme=Pme,Ame=mme,Tme=LN,Ome=Cme;function Mme(e){return Tme(e)?Ome(e):Ame(e)}var Rme=Mme,$me=hme,Dme=LN,Ime=Rme,Lme=DN();function zme(e){return function(t){t=Lme(t);var r=Dme(t)?Ime(t):void 0,n=r?r[0]:t.charAt(0),a=r?$me(r,1).join(""):t.slice(1);return n[e]()+a}}var Fme=zme,Bme=Fme,Vme=Bme("toUpperCase"),qme=Vme;const gg=Ke(qme);function at(e){return function(){return e}}const A7=Math.cos,bm=Math.sin,oa=Math.sqrt,wm=Math.PI,yg=2*wm,tk=Math.PI,rk=2*tk,Rs=1e-6,Ume=rk-Rs;function T7(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Hme(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return T7;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;a<i;++a)this._+=Math.round(arguments[a]*r)/r+n[a]}}class Wme{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?T7:Hme(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,a){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+a}`}bezierCurveTo(t,r,n,a,i,s){this._append`C${+t},${+r},${+n},${+a},${this._x1=+i},${this._y1=+s}`}arcTo(t,r,n,a,i){if(t=+t,r=+r,n=+n,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let s=this._x1,o=this._y1,l=n-t,c=a-r,d=s-t,f=o-r,h=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>Rs)if(!(Math.abs(f*l-c*d)>Rs)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-s,g=a-o,m=l*l+c*c,b=p*p+g*g,x=Math.sqrt(m),y=Math.sqrt(h),v=i*Math.tan((tk-Math.acos((m+h-b)/(2*x*y)))/2),w=v/y,j=v/x;Math.abs(w-1)>Rs&&this._append`L${t+w*d},${r+w*f}`,this._append`A${i},${i},0,0,${+(f*p>d*g)},${this._x1=t+j*l},${this._y1=r+j*c}`}}arc(t,r,n,a,i,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(a),l=n*Math.sin(a),c=t+o,d=r+l,f=1^s,h=s?a-i:i-a;this._x1===null?this._append`M${c},${d}`:(Math.abs(this._x1-c)>Rs||Math.abs(this._y1-d)>Rs)&&this._append`L${c},${d}`,n&&(h<0&&(h=h%rk+rk),h>Ume?this._append`A${n},${n},0,1,${f},${t-o},${r-l}A${n},${n},0,1,${f},${this._x1=c},${this._y1=d}`:h>Rs&&this._append`A${n},${n},0,${+(h>=tk)},${f},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function KN(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 Wme(t)}function YN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function O7(e){this._context=e}O7.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 vg(e){return new O7(e)}function M7(e){return e[0]}function R7(e){return e[1]}function $7(e,t){var r=at(!0),n=null,a=vg,i=null,s=KN(o);e=typeof e=="function"?e:e===void 0?M7:at(e),t=typeof t=="function"?t:t===void 0?R7:at(t);function o(l){var c,d=(l=YN(l)).length,f,h=!1,p;for(n==null&&(i=a(p=s())),c=0;c<=d;++c)!(c<d&&r(f=l[c],c,l))===h&&((h=!h)?i.lineStart():i.lineEnd()),h&&i.point(+e(f,c,l),+t(f,c,l));if(p)return i=null,p+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:at(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:at(+l),o):t},o.defined=function(l){return arguments.length?(r=typeof l=="function"?l:at(!!l),o):r},o.curve=function(l){return arguments.length?(a=l,n!=null&&(i=a(n)),o):a},o.context=function(l){return arguments.length?(l==null?n=i=null:i=a(n=l),o):n},o}function Dh(e,t,r){var n=null,a=at(!0),i=null,s=vg,o=null,l=KN(c);e=typeof e=="function"?e:e===void 0?M7:at(+e),t=typeof t=="function"?t:at(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?R7:at(+r);function c(f){var h,p,g,m=(f=YN(f)).length,b,x=!1,y,v=new Array(m),w=new Array(m);for(i==null&&(o=s(y=l())),h=0;h<=m;++h){if(!(h<m&&a(b=f[h],h,f))===x)if(x=!x)p=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),g=h-1;g>=p;--g)o.point(v[g],w[g]);o.lineEnd(),o.areaEnd()}x&&(v[h]=+e(b,h,f),w[h]=+t(b,h,f),o.point(n?+n(b,h,f):v[h],r?+r(b,h,f):w[h]))}if(y)return o=null,y+""||null}function d(){return $7().defined(a).curve(s).context(i)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:at(+f),n=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:at(+f),c):e},c.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:at(+f),c):n},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:at(+f),r=null,c):t},c.y0=function(f){return arguments.length?(t=typeof f=="function"?f:at(+f),c):t},c.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:at(+f),c):r},c.lineX0=c.lineY0=function(){return d().x(e).y(t)},c.lineY1=function(){return d().x(e).y(r)},c.lineX1=function(){return d().x(n).y(t)},c.defined=function(f){return arguments.length?(a=typeof f=="function"?f:at(!!f),c):a},c.curve=function(f){return arguments.length?(s=f,i!=null&&(o=s(i)),c):s},c.context=function(f){return arguments.length?(f==null?i=o=null:o=s(i=f),c):i},c}class D7{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 Gme(e){return new D7(e,!0)}function Kme(e){return new D7(e,!1)}const XN={draw(e,t){const r=oa(t/wm);e.moveTo(r,0),e.arc(0,0,r,0,yg)}},Yme={draw(e,t){const r=oa(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()}},I7=oa(1/3),Xme=I7*2,Zme={draw(e,t){const r=oa(t/Xme),n=r*I7;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Qme={draw(e,t){const r=oa(t),n=-r/2;e.rect(n,n,r,r)}},Jme=.8908130915292852,L7=bm(wm/10)/bm(7*wm/10),e0e=bm(yg/10)*L7,t0e=-A7(yg/10)*L7,r0e={draw(e,t){const r=oa(t*Jme),n=e0e*r,a=t0e*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const s=yg*i/5,o=A7(s),l=bm(s);e.lineTo(l*r,-o*r),e.lineTo(o*n-l*a,l*n+o*a)}e.closePath()}},F1=oa(3),n0e={draw(e,t){const r=-oa(t/(F1*3));e.moveTo(0,r*2),e.lineTo(-F1*r,-r),e.lineTo(F1*r,-r),e.closePath()}},fn=-.5,hn=oa(3)/2,nk=1/oa(12),a0e=(nk/2+1)*3,i0e={draw(e,t){const r=oa(t/a0e),n=r/2,a=r*nk,i=n,s=r*nk+r,o=-i,l=s;e.moveTo(n,a),e.lineTo(i,s),e.lineTo(o,l),e.lineTo(fn*n-hn*a,hn*n+fn*a),e.lineTo(fn*i-hn*s,hn*i+fn*s),e.lineTo(fn*o-hn*l,hn*o+fn*l),e.lineTo(fn*n+hn*a,fn*a-hn*n),e.lineTo(fn*i+hn*s,fn*s-hn*i),e.lineTo(fn*o+hn*l,fn*l-hn*o),e.closePath()}};function s0e(e,t){let r=null,n=KN(a);e=typeof e=="function"?e:at(e||XN),t=typeof t=="function"?t:at(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:at(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:at(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function jm(){}function Sm(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 z7(e){this._context=e}z7.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:Sm(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:Sm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function o0e(e){return new z7(e)}function F7(e){this._context=e}F7.prototype={areaStart:jm,areaEnd:jm,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:Sm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function l0e(e){return new F7(e)}function B7(e){this._context=e}B7.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:Sm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function c0e(e){return new B7(e)}function V7(e){this._context=e}V7.prototype={areaStart:jm,areaEnd:jm,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 u0e(e){return new V7(e)}function zD(e){return e<0?-1:1}function FD(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),s=(r-e._y1)/(a||n<0&&-0),o=(i*a+s*n)/(n+a);return(zD(i)+zD(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(o))||0}function BD(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function B1(e,t,r){var n=e._x0,a=e._y0,i=e._x1,s=e._y1,o=(i-n)/3;e._context.bezierCurveTo(n+o,a+o*t,i-o,s-o*r,i,s)}function km(e){this._context=e}km.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:B1(this,this._t0,BD(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,B1(this,BD(this,r=FD(this,e,t)),r);break;default:B1(this,this._t0,r=FD(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function q7(e){this._context=new U7(e)}(q7.prototype=Object.create(km.prototype)).point=function(e,t){km.prototype.point.call(this,t,e)};function U7(e){this._context=e}U7.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,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function d0e(e){return new km(e)}function f0e(e){return new q7(e)}function H7(e){this._context=e}H7.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=VD(e),a=VD(t),i=0,s=1;s<r;++i,++s)this._context.bezierCurveTo(n[0][i],a[0][i],n[1][i],a[1][i],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 VD(e){var t,r=e.length-1,n,a=new Array(r),i=new Array(r),s=new Array(r);for(a[0]=0,i[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)a[t]=1,i[t]=4,s[t]=4*e[t]+2*e[t+1];for(a[r-1]=2,i[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=a[t]/i[t-1],i[t]-=n,s[t]-=n*s[t-1];for(a[r-1]=s[r-1]/i[r-1],t=r-2;t>=0;--t)a[t]=(s[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function h0e(e){return new H7(e)}function xg(e,t){this._context=e,this._t=t}xg.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 p0e(e){return new xg(e,.5)}function m0e(e){return new xg(e,0)}function g0e(e){return new xg(e,1)}function Ql(e,t){if((s=e.length)>1)for(var r=1,n,a,i=e[t[0]],s,o=i.length;r<s;++r)for(a=i,i=e[t[r]],n=0;n<o;++n)i[n][1]+=i[n][0]=isNaN(a[n][1])?a[n][0]:a[n][1]}function ak(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function y0e(e,t){return e[t]}function v0e(e){const t=[];return t.key=e,t}function x0e(){var e=at([]),t=ak,r=Ql,n=y0e;function a(i){var s=Array.from(e.apply(this,arguments),v0e),o,l=s.length,c=-1,d;for(const f of i)for(o=0,++c;o<l;++o)(s[o][c]=[0,+n(f,s[o].key,c,i)]).data=f;for(o=0,d=YN(t(s));o<l;++o)s[d[o]].index=o;return r(s,d),s}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:at(Array.from(i)),a):e},a.value=function(i){return arguments.length?(n=typeof i=="function"?i:at(+i),a):n},a.order=function(i){return arguments.length?(t=i==null?ak:typeof i=="function"?i:at(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(r=i??Ql,a):r},a}function b0e(e,t){if((n=e.length)>0){for(var r,n,a=0,i=e[0].length,s;a<i;++a){for(s=r=0;r<n;++r)s+=e[r][a][1]||0;if(s)for(r=0;r<n;++r)e[r][a][1]/=s}Ql(e,t)}}function w0e(e,t){if((a=e.length)>0){for(var r=0,n=e[t[0]],a,i=n.length;r<i;++r){for(var s=0,o=0;s<a;++s)o+=e[s][r][1]||0;n[r][1]+=n[r][0]=-o/2}Ql(e,t)}}function j0e(e,t){if(!(!((s=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,i,s;n<i;++n){for(var o=0,l=0,c=0;o<s;++o){for(var d=e[t[o]],f=d[n][1]||0,h=d[n-1][1]||0,p=(f-h)/2,g=0;g<o;++g){var m=e[t[g]],b=m[n][1]||0,x=m[n-1][1]||0;p+=b-x}l+=f,c+=p*f}a[n-1][1]+=a[n-1][0]=r,l&&(r-=c/l)}a[n-1][1]+=a[n-1][0]=r,Ql(e,t)}}function Fd(e){"@babel/helpers - typeof";return Fd=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},Fd(e)}var S0e=["type","size","sizeType"];function ik(){return ik=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},ik.apply(this,arguments)}function qD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function UD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qD(Object(r),!0).forEach(function(n){k0e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function k0e(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 Fd(t)=="symbol"?t:t+""}function N0e(e,t){if(Fd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Fd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function E0e(e,t){if(e==null)return{};var r=P0e(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function P0e(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 W7={symbolCircle:XN,symbolCross:Yme,symbolDiamond:Zme,symbolSquare:Qme,symbolStar:r0e,symbolTriangle:n0e,symbolWye:i0e},C0e=Math.PI/180,A0e=function(t){var r="symbol".concat(gg(t));return W7[r]||XN},T0e=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 a=18*C0e;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),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}},O0e=function(t,r){W7["symbol".concat(gg(t))]=r},ZN=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,i=a===void 0?64:a,s=t.sizeType,o=s===void 0?"area":s,l=E0e(t,S0e),c=UD(UD({},l),{},{type:n,size:i,sizeType:o}),d=function(){var b=A0e(n),x=s0e().type(b).size(T0e(i,o,n));return x()},f=c.className,h=c.cx,p=c.cy,g=Ie(c,!0);return h===+h&&p===+p&&i===+i?O.createElement("path",ik({},g,{className:Fe("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};ZN.registerSymbol=O0e;function Jl(e){"@babel/helpers - typeof";return Jl=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},Jl(e)}function sk(){return sk=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},sk.apply(this,arguments)}function HD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function M0e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?HD(Object(r),!0).forEach(function(n){Bd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function R0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $0e(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,K7(n.key),n)}}function D0e(e,t,r){return t&&$0e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function I0e(e,t,r){return t=_m(t),L0e(e,G7()?Reflect.construct(t,r||[],_m(e).constructor):t.apply(e,r))}function L0e(e,t){if(t&&(Jl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return z0e(e)}function z0e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(G7=function(){return!!e})()}function _m(e){return _m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_m(e)}function F0e(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&&ok(e,t)}function ok(e,t){return ok=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},ok(e,t)}function Bd(e,t,r){return t=K7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function K7(e){var t=B0e(e,"string");return Jl(t)=="symbol"?t:t+""}function B0e(e,t){if(Jl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Jl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var pn=32,QN=function(e){function t(){return R0e(this,t),I0e(this,t,arguments)}return F0e(t,e),D0e(t,[{key:"renderIcon",value:function(n){var a=this.props.inactiveColor,i=pn/2,s=pn/6,o=pn/3,l=n.inactive?a:n.color;if(n.type==="plainline")return O.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:i,x2:pn,y2:i,className:"recharts-legend-icon"});if(n.type==="line")return O.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(i,"h").concat(o,`
530
- A`).concat(s,",").concat(s,",0,1,1,").concat(2*o,",").concat(i,`
531
- H`).concat(pn,"M").concat(2*o,",").concat(i,`
532
- A`).concat(s,",").concat(s,",0,1,1,").concat(o,",").concat(i),className:"recharts-legend-icon"});if(n.type==="rect")return O.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(pn/8,"h").concat(pn,"v").concat(pn*3/4,"h").concat(-pn,"z"),className:"recharts-legend-icon"});if(O.isValidElement(n.legendIcon)){var c=M0e({},n);return delete c.legendIcon,O.cloneElement(n.legendIcon,c)}return O.createElement(ZN,{fill:l,cx:i,cy:i,size:pn,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,a=this.props,i=a.payload,s=a.iconSize,o=a.layout,l=a.formatter,c=a.inactiveColor,d={x:0,y:0,width:pn,height:pn},f={display:o==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(p,g){var m=p.formatter||l,b=Fe(Bd(Bd({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",p.inactive));if(p.type==="none")return null;var x=Ce(p.value)?null:p.value;Ga(!Ce(p.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 y=p.inactive?c:p.color;return O.createElement("li",sk({className:b,style:f,key:"legend-item-".concat(g)},xm(n.props,p,g)),O.createElement(ZS,{width:s,height:s,viewBox:d,style:h},n.renderIcon(p)),O.createElement("span",{className:"recharts-legend-item-text",style:{color:y}},m?m(x,p,g):x))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,s=n.align;if(!a||!a.length)return null;var o={padding:0,margin:0,textAlign:i==="horizontal"?s:"left"};return O.createElement("ul",{className:"recharts-default-legend",style:o},this.renderItems())}}])}(_.PureComponent);Bd(QN,"displayName","Legend");Bd(QN,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var V0e=On(),q0e=OB();function U0e(e,t){return e&&e.length?q0e(e,V0e(t,2)):[]}var H0e=U0e;const WD=Ke(H0e);function Y7(e,t,r){return t===!0?WD(e,r):Ce(t)?WD(e,t):e}function ec(e){"@babel/helpers - typeof";return ec=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},ec(e)}var W0e=["ref"];function GD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).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?GD(Object(r),!0).forEach(function(n){bg(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):GD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function G0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KD(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,Z7(n.key),n)}}function K0e(e,t,r){return t&&KD(e.prototype,t),r&&KD(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Y0e(e,t,r){return t=Nm(t),X0e(e,X7()?Reflect.construct(t,r||[],Nm(e).constructor):t.apply(e,r))}function X0e(e,t){if(t&&(ec(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Z0e(e)}function Z0e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function X7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(X7=function(){return!!e})()}function Nm(e){return Nm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Nm(e)}function Q0e(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&&lk(e,t)}function lk(e,t){return lk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},lk(e,t)}function bg(e,t,r){return t=Z7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Z7(e){var t=J0e(e,"string");return ec(t)=="symbol"?t:t+""}function J0e(e,t){if(ec(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ec(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ege(e,t){if(e==null)return{};var r=tge(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function tge(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 rge(e){return e.value}function nge(e,t){if(O.isValidElement(e))return O.cloneElement(e,t);if(typeof e=="function")return O.createElement(e,t);t.ref;var r=ege(t,W0e);return O.createElement(QN,r)}var YD=1,ro=function(e){function t(){var r;G0e(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=Y0e(this,t,[].concat(a)),bg(r,"lastBoundingBox",{width:-1,height:-1}),r}return Q0e(t,e),K0e(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,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>YD||Math.abs(a.height-this.lastBoundingBox.height)>YD)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(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?Ta({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,s=a.align,o=a.verticalAlign,l=a.margin,c=a.chartWidth,d=a.chartHeight,f,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(s==="center"&&i==="vertical"){var p=this.getBBoxSnapshot();f={left:((c||0)-p.width)/2}}else f=s==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(o==="middle"){var g=this.getBBoxSnapshot();h={top:((d||0)-g.height)/2}}else h=o==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Ta(Ta({},f),h)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,s=a.width,o=a.height,l=a.wrapperStyle,c=a.payloadUniqBy,d=a.payload,f=Ta(Ta({position:"absolute",width:s||"auto",height:o||"auto"},this.getDefaultPosition(l)),l);return O.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){n.wrapperNode=p}},nge(i,Ta(Ta({},this.props),{},{payload:Y7(d,c,rge)})))}}],[{key:"getWithHeight",value:function(n,a){var i=Ta(Ta({},this.defaultProps),n.props),s=i.layout;return s==="vertical"&&J(n.props.height)?{height:n.props.height}:s==="horizontal"?{width:n.props.width||a}:null}}])}(_.PureComponent);bg(ro,"displayName","Legend");bg(ro,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var age=e7();const JN=Ke(age);function Vd(e){"@babel/helpers - typeof";return Vd=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},Vd(e)}function ck(){return ck=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},ck.apply(this,arguments)}function ige(e,t){return cge(e)||lge(e,t)||oge(e,t)||sge()}function sge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
533
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oge(e,t){if(e){if(typeof e=="string")return XD(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 XD(e,t)}}function XD(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,a,i,s,o=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(l=(n=i.call(r)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(d){c=!0,a=d}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return o}}function cge(e){if(Array.isArray(e))return e}function ZD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function V1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZD(Object(r),!0).forEach(function(n){uge(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uge(e,t,r){return t=dge(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dge(e){var t=fge(e,"string");return Vd(t)=="symbol"?t:t+""}function fge(e,t){if(Vd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Vd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hge(e){return Array.isArray(e)&&Jt(e[0])&&Jt(e[1])?e.join(" ~ "):e}var pge=function(t){var r=t.separator,n=r===void 0?" : ":r,a=t.contentStyle,i=a===void 0?{}:a,s=t.itemStyle,o=s===void 0?{}:s,l=t.labelStyle,c=l===void 0?{}:l,d=t.payload,f=t.formatter,h=t.itemSorter,p=t.wrapperClassName,g=t.labelClassName,m=t.label,b=t.labelFormatter,x=t.accessibilityLayer,y=x===void 0?!1:x,v=function(){if(d&&d.length){var M={padding:0,margin:0},T=(h?JN(d,h):d).map(function(P,D){if(P.type==="none")return null;var $=V1({display:"block",paddingTop:4,paddingBottom:4,color:P.color||"#000"},o),L=P.formatter||f||hge,I=P.value,R=P.name,z=I,V=R;if(L&&z!=null&&V!=null){var B=L(I,R,P,D,d);if(Array.isArray(B)){var W=ige(B,2);z=W[0],V=W[1]}else z=B}return O.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(D),style:$},Jt(V)?O.createElement("span",{className:"recharts-tooltip-item-name"},V):null,Jt(V)?O.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,O.createElement("span",{className:"recharts-tooltip-item-value"},z),O.createElement("span",{className:"recharts-tooltip-item-unit"},P.unit||""))});return O.createElement("ul",{className:"recharts-tooltip-item-list",style:M},T)}return null},w=V1({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),j=V1({margin:0},c),k=!Re(m),S=k?m:"",N=Fe("recharts-default-tooltip",p),E=Fe("recharts-tooltip-label",g);k&&b&&d!==void 0&&d!==null&&(S=b(m,d));var A=y?{role:"status","aria-live":"assertive"}:{};return O.createElement("div",ck({className:N,style:w},A),O.createElement("p",{className:E,style:j},O.isValidElement(S)?S:"".concat(S)),v())};function qd(e){"@babel/helpers - typeof";return qd=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},qd(e)}function Ih(e,t,r){return t=mge(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mge(e){var t=gge(e,"string");return qd(t)=="symbol"?t:t+""}function gge(e,t){if(qd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(qd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hu="recharts-tooltip-wrapper",yge={visibility:"hidden"};function vge(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return Fe(hu,Ih(Ih(Ih(Ih({},"".concat(hu,"-right"),J(r)&&t&&J(t.x)&&r>=t.x),"".concat(hu,"-left"),J(r)&&t&&J(t.x)&&r<t.x),"".concat(hu,"-bottom"),J(n)&&t&&J(t.y)&&n>=t.y),"".concat(hu,"-top"),J(n)&&t&&J(t.y)&&n<t.y))}function QD(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,a=e.offsetTopLeft,i=e.position,s=e.reverseDirection,o=e.tooltipDimension,l=e.viewBox,c=e.viewBoxDimension;if(i&&J(i[n]))return i[n];var d=r[n]-o-a,f=r[n]+a;if(t[n])return s[n]?d:f;if(s[n]){var h=d,p=l[n];return h<p?Math.max(f,l[n]):Math.max(d,l[n])}var g=f+o,m=l[n]+c;return g>m?Math.max(d,l[n]):Math.max(f,l[n])}function xge(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 bge(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,i=e.reverseDirection,s=e.tooltipBox,o=e.useTranslate3d,l=e.viewBox,c,d,f;return s.height>0&&s.width>0&&r?(d=QD({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=QD({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),c=xge({translateX:d,translateY:f,useTranslate3d:o})):c=yge,{cssProperties:c,cssClasses:vge({translateX:d,translateY:f,coordinate:r})}}function tc(e){"@babel/helpers - typeof";return tc=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},tc(e)}function JD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function eI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?JD(Object(r),!0).forEach(function(n){dk(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):JD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jge(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,J7(n.key),n)}}function Sge(e,t,r){return t&&jge(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function kge(e,t,r){return t=Em(t),_ge(e,Q7()?Reflect.construct(t,r||[],Em(e).constructor):t.apply(e,r))}function _ge(e,t){if(t&&(tc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nge(e)}function Nge(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Q7=function(){return!!e})()}function Em(e){return Em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Em(e)}function Ege(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&&uk(e,t)}function uk(e,t){return uk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},uk(e,t)}function dk(e,t,r){return t=J7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function J7(e){var t=Pge(e,"string");return tc(t)=="symbol"?t:t+""}function Pge(e,t){if(tc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(tc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var tI=1,Cge=function(e){function t(){var r;wge(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=kge(this,t,[].concat(a)),dk(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),dk(r,"handleKeyDown",function(s){if(s.key==="Escape"){var o,l,c,d;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(o=(l=r.props.coordinate)===null||l===void 0?void 0:l.x)!==null&&o!==void 0?o:0,y:(c=(d=r.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&c!==void 0?c:0}})}}),r}return Ege(t,e),Sge(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>tI||Math.abs(n.height-this.state.lastBoundingBox.height)>tI)&&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,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,a=this.props,i=a.active,s=a.allowEscapeViewBox,o=a.animationDuration,l=a.animationEasing,c=a.children,d=a.coordinate,f=a.hasPayload,h=a.isAnimationActive,p=a.offset,g=a.position,m=a.reverseDirection,b=a.useTranslate3d,x=a.viewBox,y=a.wrapperStyle,v=bge({allowEscapeViewBox:s,coordinate:d,offsetTopLeft:p,position:g,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:x}),w=v.cssClasses,j=v.cssProperties,k=eI(eI({transition:h&&i?"transform ".concat(o,"ms ").concat(l):void 0},j),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&f?"visible":"hidden",position:"absolute",top:0,left:0},y);return O.createElement("div",{tabIndex:-1,className:w,style:k,ref:function(N){n.wrapperNode=N}},c)}}])}(_.PureComponent),Age=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Fc={isSsr:Age()};function rc(e){"@babel/helpers - typeof";return rc=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},rc(e)}function rI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function nI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rI(Object(r),!0).forEach(function(n){eE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oge(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,t9(n.key),n)}}function Mge(e,t,r){return t&&Oge(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rge(e,t,r){return t=Pm(t),$ge(e,e9()?Reflect.construct(t,r||[],Pm(e).constructor):t.apply(e,r))}function $ge(e,t){if(t&&(rc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Dge(e)}function Dge(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function e9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(e9=function(){return!!e})()}function Pm(e){return Pm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Pm(e)}function Ige(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&&fk(e,t)}function fk(e,t){return fk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},fk(e,t)}function eE(e,t,r){return t=t9(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t9(e){var t=Lge(e,"string");return rc(t)=="symbol"?t:t+""}function Lge(e,t){if(rc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(rc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function zge(e){return e.dataKey}function Fge(e,t){return O.isValidElement(e)?O.cloneElement(e,t):typeof e=="function"?O.createElement(e,t):O.createElement(pge,t)}var da=function(e){function t(){return Tge(this,t),Rge(this,t,arguments)}return Ige(t,e),Mge(t,[{key:"render",value:function(){var n=this,a=this.props,i=a.active,s=a.allowEscapeViewBox,o=a.animationDuration,l=a.animationEasing,c=a.content,d=a.coordinate,f=a.filterNull,h=a.isAnimationActive,p=a.offset,g=a.payload,m=a.payloadUniqBy,b=a.position,x=a.reverseDirection,y=a.useTranslate3d,v=a.viewBox,w=a.wrapperStyle,j=g??[];f&&j.length&&(j=Y7(g.filter(function(S){return S.value!=null&&(S.hide!==!0||n.props.includeHidden)}),m,zge));var k=j.length>0;return O.createElement(Cge,{allowEscapeViewBox:s,animationDuration:o,animationEasing:l,isAnimationActive:h,active:i,coordinate:d,hasPayload:k,offset:p,position:b,reverseDirection:x,useTranslate3d:y,viewBox:v,wrapperStyle:w},Fge(c,nI(nI({},this.props),{},{payload:j})))}}])}(_.PureComponent);eE(da,"displayName","Tooltip");eE(da,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Fc.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 Bge=$r(),q1=QB(),aI=FB(),Vge="Expected a function",qge=Math.max,Uge=Math.min;function Hge(e,t,r){var n,a,i,s,o,l,c=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(Vge);t=aI(t)||0,Bge(r)&&(d=!!r.leading,f="maxWait"in r,i=f?qge(aI(r.maxWait)||0,t):i,h="trailing"in r?!!r.trailing:h);function p(k){var S=n,N=a;return n=a=void 0,c=k,s=e.apply(N,S),s}function g(k){return c=k,o=setTimeout(x,t),d?p(k):s}function m(k){var S=k-l,N=k-c,E=t-S;return f?Uge(E,i-N):E}function b(k){var S=k-l,N=k-c;return l===void 0||S>=t||S<0||f&&N>=i}function x(){var k=q1();if(b(k))return y(k);o=setTimeout(x,m(k))}function y(k){return o=void 0,h&&n?p(k):(n=a=void 0,s)}function v(){o!==void 0&&clearTimeout(o),c=0,n=l=a=o=void 0}function w(){return o===void 0?s:y(q1())}function j(){var k=q1(),S=b(k);if(n=arguments,a=this,l=k,S){if(o===void 0)return g(l);if(f)return clearTimeout(o),o=setTimeout(x,t),p(l)}return o===void 0&&(o=setTimeout(x,t)),s}return j.cancel=v,j.flush=w,j}var Wge=Hge,Gge=Wge,Kge=$r(),Yge="Expected a function";function Xge(e,t,r){var n=!0,a=!0;if(typeof e!="function")throw new TypeError(Yge);return Kge(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),Gge(e,t,{leading:n,maxWait:t,trailing:a})}var Zge=Xge;const r9=Ke(Zge);function Ud(e){"@babel/helpers - typeof";return Ud=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},Ud(e)}function iI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Lh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iI(Object(r),!0).forEach(function(n){Qge(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qge(e,t,r){return t=Jge(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jge(e){var t=eye(e,"string");return Ud(t)=="symbol"?t:t+""}function eye(e,t){if(Ud(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ud(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tye(e,t){return iye(e)||aye(e,t)||nye(e,t)||rye()}function rye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
534
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nye(e,t){if(e){if(typeof e=="string")return sI(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 sI(e,t)}}function sI(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 aye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,o=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(l=(n=i.call(r)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(d){c=!0,a=d}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return o}}function iye(e){if(Array.isArray(e))return e}var sye=_.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,a=n===void 0?{width:-1,height:-1}:n,i=e.width,s=i===void 0?"100%":i,o=e.height,l=o===void 0?"100%":o,c=e.minWidth,d=c===void 0?0:c,f=e.minHeight,h=e.maxHeight,p=e.children,g=e.debounce,m=g===void 0?0:g,b=e.id,x=e.className,y=e.onResize,v=e.style,w=v===void 0?{}:v,j=_.useRef(null),k=_.useRef();k.current=y,_.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=_.useState({containerWidth:a.width,containerHeight:a.height}),N=tye(S,2),E=N[0],A=N[1],C=_.useCallback(function(T,P){A(function(D){var $=Math.round(T),L=Math.round(P);return D.containerWidth===$&&D.containerHeight===L?D:{containerWidth:$,containerHeight:L}})},[]);_.useEffect(function(){var T=function(R){var z,V=R[0].contentRect,B=V.width,W=V.height;C(B,W),(z=k.current)===null||z===void 0||z.call(k,B,W)};m>0&&(T=r9(T,m,{trailing:!0,leading:!1}));var P=new ResizeObserver(T),D=j.current.getBoundingClientRect(),$=D.width,L=D.height;return C($,L),P.observe(j.current),function(){P.disconnect()}},[C,m]);var M=_.useMemo(function(){var T=E.containerWidth,P=E.containerHeight;if(T<0||P<0)return null;Ga(Gs(s)||Gs(l),`The width(%s) and height(%s) are both fixed numbers,
535
- maybe you don't need to use a ResponsiveContainer.`,s,l),Ga(!r||r>0,"The aspect(%s) must be greater than zero.",r);var D=Gs(s)?T:s,$=Gs(l)?P:l;r&&r>0&&(D?$=D/r:$&&(D=$*r),h&&$>h&&($=h)),Ga(D>0||$>0,`The width(%s) and height(%s) of chart should be greater than 0,
536
- please check the style of container, or the props width(%s) and height(%s),
537
- or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
538
- height and width.`,D,$,s,l,d,f,r);var L=!Array.isArray(p)&&Wa(p.type).endsWith("Chart");return O.Children.map(p,function(I){return O.isValidElement(I)?_.cloneElement(I,Lh({width:D,height:$},L?{style:Lh({height:"100%",width:"100%",maxHeight:$,maxWidth:D},I.props.style)}:{})):I})},[r,p,l,h,f,d,E,s]);return O.createElement("div",{id:b?"".concat(b):void 0,className:Fe("recharts-responsive-container",x),style:Lh(Lh({},w),{},{width:s,height:l,minWidth:d,minHeight:f,maxHeight:h}),ref:j},M)}),n9=function(t){return null};n9.displayName="Cell";function Hd(e){"@babel/helpers - typeof";return Hd=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},Hd(e)}function oI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function hk(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oI(Object(r),!0).forEach(function(n){oye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oye(e,t,r){return t=lye(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lye(e){var t=cye(e,"string");return Hd(t)=="symbol"?t:t+""}function cye(e,t){if(Hd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Hd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Go={widthCache:{},cacheCount:0},uye=2e3,dye={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},lI="recharts_measurement_span";function fye(e){var t=hk({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var td=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Fc.isSsr)return{width:0,height:0};var n=fye(r),a=JSON.stringify({text:t,copyStyle:n});if(Go.widthCache[a])return Go.widthCache[a];try{var i=document.getElementById(lI);i||(i=document.createElement("span"),i.setAttribute("id",lI),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var s=hk(hk({},dye),n);Object.assign(i.style,s),i.textContent="".concat(t);var o=i.getBoundingClientRect(),l={width:o.width,height:o.height};return Go.widthCache[a]=l,++Go.cacheCount>uye&&(Go.cacheCount=0,Go.widthCache={}),l}catch{return{width:0,height:0}}},hye=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Wd(e){"@babel/helpers - typeof";return Wd=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},Wd(e)}function Cm(e,t){return yye(e)||gye(e,t)||mye(e,t)||pye()}function pye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
539
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mye(e,t){if(e){if(typeof e=="string")return cI(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 cI(e,t)}}function cI(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 gye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,o=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(d){c=!0,a=d}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return o}}function yye(e){if(Array.isArray(e))return e}function vye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uI(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,bye(n.key),n)}}function xye(e,t,r){return t&&uI(e.prototype,t),r&&uI(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function bye(e){var t=wye(e,"string");return Wd(t)=="symbol"?t:t+""}function wye(e,t){if(Wd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Wd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var dI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,fI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,jye=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Sye=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,a9={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},kye=Object.keys(a9),gl="NaN";function _ye(e,t){return e*a9[t]}var zh=function(){function e(t,r){vye(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!jye.test(r)&&(this.num=NaN,this.unit=""),kye.includes(r)&&(this.num=_ye(t,r),this.unit="px")}return xye(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,a=(n=Sye.exec(r))!==null&&n!==void 0?n:[],i=Cm(a,3),s=i[1],o=i[2];return new e(parseFloat(s),o??"")}}])}();function i9(e){if(e.includes(gl))return gl;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=dI.exec(t))!==null&&r!==void 0?r:[],a=Cm(n,4),i=a[1],s=a[2],o=a[3],l=zh.parse(i??""),c=zh.parse(o??""),d=s==="*"?l.multiply(c):l.divide(c);if(d.isNaN())return gl;t=t.replace(dI,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=fI.exec(t))!==null&&f!==void 0?f:[],p=Cm(h,4),g=p[1],m=p[2],b=p[3],x=zh.parse(g??""),y=zh.parse(b??""),v=m==="+"?x.add(y):x.subtract(y);if(v.isNaN())return gl;t=t.replace(fI,v.toString())}return t}var hI=/\(([^()]*)\)/;function Nye(e){for(var t=e;t.includes("(");){var r=hI.exec(t),n=Cm(r,2),a=n[1];t=t.replace(hI,i9(a))}return t}function Eye(e){var t=e.replace(/\s+/g,"");return t=Nye(t),t=i9(t),t}function Pye(e){try{return Eye(e)}catch{return gl}}function U1(e){var t=Pye(e.slice(5,-1));return t===gl?"":t}var Cye=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],Aye=["dx","dy","angle","className","breakAll"];function pk(){return pk=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},pk.apply(this,arguments)}function pI(e,t){if(e==null)return{};var r=Tye(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Tye(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 mI(e,t){return $ye(e)||Rye(e,t)||Mye(e,t)||Oye()}function Oye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
540
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mye(e,t){if(e){if(typeof e=="string")return gI(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 gI(e,t)}}function gI(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 Rye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,o=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(d){c=!0,a=d}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return o}}function $ye(e){if(Array.isArray(e))return e}var s9=/[ \f\n\r\t\v\u2028\u2029]+/,o9=function(t){var r=t.children,n=t.breakAll,a=t.style;try{var i=[];Re(r)||(n?i=r.toString().split(""):i=r.toString().split(s9));var s=i.map(function(l){return{word:l,width:td(l,a).width}}),o=n?0:td(" ",a).width;return{wordsWithComputedWidth:s,spaceWidth:o}}catch{return null}},Dye=function(t,r,n,a,i){var s=t.maxLines,o=t.children,l=t.style,c=t.breakAll,d=J(s),f=o,h=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return D.reduce(function($,L){var I=L.word,R=L.width,z=$[$.length-1];if(z&&(a==null||i||z.width+R+n<Number(a)))z.words.push(I),z.width+=R+n;else{var V={words:[I],width:R};$.push(V)}return $},[])},p=h(r),g=function(D){return D.reduce(function($,L){return $.width>L.width?$:L})};if(!d)return p;for(var m="…",b=function(D){var $=f.slice(0,D),L=o9({breakAll:c,style:l,children:$+m}).wordsWithComputedWidth,I=h(L),R=I.length>s||g(I).width>Number(a);return[R,I]},x=0,y=f.length-1,v=0,w;x<=y&&v<=f.length-1;){var j=Math.floor((x+y)/2),k=j-1,S=b(k),N=mI(S,2),E=N[0],A=N[1],C=b(j),M=mI(C,1),T=M[0];if(!E&&!T&&(x=j+1),E&&T&&(y=j-1),!E&&T){w=A;break}v++}return w||p},yI=function(t){var r=Re(t)?[]:t.toString().split(s9);return[{words:r}]},Iye=function(t){var r=t.width,n=t.scaleToFit,a=t.children,i=t.style,s=t.breakAll,o=t.maxLines;if((r||n)&&!Fc.isSsr){var l,c,d=o9({breakAll:s,children:a,style:i});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;l=f,c=h}else return yI(a);return Dye({breakAll:s,children:a,maxLines:o,style:i},l,c,r,n)}return yI(a)},vI="#808080",Am=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,s=t.lineHeight,o=s===void 0?"1em":s,l=t.capHeight,c=l===void 0?"0.71em":l,d=t.scaleToFit,f=d===void 0?!1:d,h=t.textAnchor,p=h===void 0?"start":h,g=t.verticalAnchor,m=g===void 0?"end":g,b=t.fill,x=b===void 0?vI:b,y=pI(t,Cye),v=_.useMemo(function(){return Iye({breakAll:y.breakAll,children:y.children,maxLines:y.maxLines,scaleToFit:f,style:y.style,width:y.width})},[y.breakAll,y.children,y.maxLines,f,y.style,y.width]),w=y.dx,j=y.dy,k=y.angle,S=y.className,N=y.breakAll,E=pI(y,Aye);if(!Jt(n)||!Jt(i))return null;var A=n+(J(w)?w:0),C=i+(J(j)?j:0),M;switch(m){case"start":M=U1("calc(".concat(c,")"));break;case"middle":M=U1("calc(".concat((v.length-1)/2," * -").concat(o," + (").concat(c," / 2))"));break;default:M=U1("calc(".concat(v.length-1," * -").concat(o,")"));break}var T=[];if(f){var P=v[0].width,D=y.width;T.push("scale(".concat((J(D)?D/P:1)/P,")"))}return k&&T.push("rotate(".concat(k,", ").concat(A,", ").concat(C,")")),T.length&&(E.transform=T.join(" ")),O.createElement("text",pk({},Ie(E,!0),{x:A,y:C,className:Fe("recharts-text",S),textAnchor:p,fill:x.includes("url")?vI:x}),v.map(function($,L){var I=$.words.join(N?"":" ");return O.createElement("tspan",{x:A,dy:L===0?M:o,key:"".concat(I,"-").concat(L)},I)}))};function ts(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Lye(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function tE(e){let t,r,n;e.length!==2?(t=ts,r=(o,l)=>ts(e(o),l),n=(o,l)=>e(o)-l):(t=e===ts||e===Lye?e:zye,r=e,n=e);function a(o,l,c=0,d=o.length){if(c<d){if(t(l,l)!==0)return d;do{const f=c+d>>>1;r(o[f],l)<0?c=f+1:d=f}while(c<d)}return c}function i(o,l,c=0,d=o.length){if(c<d){if(t(l,l)!==0)return d;do{const f=c+d>>>1;r(o[f],l)<=0?c=f+1:d=f}while(c<d)}return c}function s(o,l,c=0,d=o.length){const f=a(o,l,c,d-1);return f>c&&n(o[f-1],l)>-n(o[f],l)?f-1:f}return{left:a,center:s,right:i}}function zye(){return 0}function l9(e){return e===null?NaN:+e}function*Fye(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const Bye=tE(ts),Ff=Bye.right;tE(l9).center;class xI extends Map{constructor(t,r=Uye){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(bI(this,t))}has(t){return super.has(bI(this,t))}set(t,r){return super.set(Vye(this,t),r)}delete(t){return super.delete(qye(this,t))}}function bI({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function Vye({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function qye({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function Uye(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Hye(e=ts){if(e===ts)return c9;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 c9(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Wye=Math.sqrt(50),Gye=Math.sqrt(10),Kye=Math.sqrt(2);function Tm(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),s=i>=Wye?10:i>=Gye?5:i>=Kye?2:1;let o,l,c;return a<0?(c=Math.pow(10,-a)/s,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,a)*s,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=r&&r<2?Tm(e,t,r*2):[o,l,c]}function mk(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[a,i,s]=n?Tm(t,e,r):Tm(e,t,r);if(!(i>=a))return[];const o=i-a+1,l=new Array(o);if(n)if(s<0)for(let c=0;c<o;++c)l[c]=(i-c)/-s;else for(let c=0;c<o;++c)l[c]=(i-c)*s;else if(s<0)for(let c=0;c<o;++c)l[c]=(a+c)/-s;else for(let c=0;c<o;++c)l[c]=(a+c)*s;return l}function gk(e,t,r){return t=+t,e=+e,r=+r,Tm(e,t,r)[2]}function yk(e,t,r){t=+t,e=+e,r=+r;const n=t<e,a=n?gk(t,e,r):gk(e,t,r);return(n?-1:1)*(a<0?1/-a:a)}function wI(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function jI(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function u9(e,t,r=0,n=1/0,a){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(a=a===void 0?c9:Hye(a);n>r;){if(n-r>600){const l=n-r+1,c=t-r+1,d=Math.log(l),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(l-f)/l)*(c-l/2<0?-1:1),p=Math.max(r,Math.floor(t-c*f/l+h)),g=Math.min(n,Math.floor(t+(l-c)*f/l+h));u9(e,t,p,g,a)}const i=e[t];let s=r,o=n;for(pu(e,r,t),a(e[n],i)>0&&pu(e,r,n);s<o;){for(pu(e,s,o),++s,--o;a(e[s],i)<0;)++s;for(;a(e[o],i)>0;)--o}a(e[r],i)===0?pu(e,r,o):(++o,pu(e,o,n)),o<=t&&(r=o+1),t<=o&&(n=o-1)}return e}function pu(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function Yye(e,t,r){if(e=Float64Array.from(Fye(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return jI(e);if(t>=1)return wI(e);var n,a=(n-1)*t,i=Math.floor(a),s=wI(u9(e,i).subarray(0,i+1)),o=jI(e.subarray(i+1));return s+(o-s)*(a-i)}}function Xye(e,t,r=l9){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,a=(n-1)*t,i=Math.floor(a),s=+r(e[i],i,e),o=+r(e[i+1],i+1,e);return s+(o-s)*(a-i)}}function Zye(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n<a;)i[n]=e+n*r;return i}function $n(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function gi(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 vk=Symbol("implicit");function rE(){var e=new xI,t=[],r=[],n=vk;function a(i){let s=e.get(i);if(s===void 0){if(n!==vk)return n;e.set(i,s=t.push(i)-1)}return r[s%r.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new xI;for(const s of i)e.has(s)||e.set(s,t.push(s)-1);return a},a.range=function(i){return arguments.length?(r=Array.from(i),a):r.slice()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return rE(t,r).unknown(n)},$n.apply(a,arguments),a}function Gd(){var e=rE().unknown(void 0),t=e.domain,r=e.range,n=0,a=1,i,s,o=!1,l=0,c=0,d=.5;delete e.unknown;function f(){var h=t().length,p=a<n,g=p?a:n,m=p?n:a;i=(m-g)/Math.max(1,h-l+c*2),o&&(i=Math.floor(i)),g+=(m-g-i*(h-l))*d,s=i*(1-l),o&&(g=Math.round(g),s=Math.round(s));var b=Zye(h).map(function(x){return g+i*x});return r(p?b.reverse():b)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([n,a]=h,n=+n,a=+a,f()):[n,a]},e.rangeRound=function(h){return[n,a]=h,n=+n,a=+a,o=!0,f()},e.bandwidth=function(){return s},e.step=function(){return i},e.round=function(h){return arguments.length?(o=!!h,f()):o},e.padding=function(h){return arguments.length?(l=Math.min(1,c=+h),f()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),f()):l},e.paddingOuter=function(h){return arguments.length?(c=+h,f()):c},e.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),f()):d},e.copy=function(){return Gd(t(),[n,a]).round(o).paddingInner(l).paddingOuter(c).align(d)},$n.apply(f(),arguments)}function d9(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return d9(t())},e}function rd(){return d9(Gd.apply(null,arguments).paddingInner(1))}function Qye(e){return function(){return e}}function Om(e){return+e}var SI=[0,1];function Cr(e){return e}function xk(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:Qye(isNaN(t)?NaN:.5)}function Jye(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function eve(e,t,r){var n=e[0],a=e[1],i=t[0],s=t[1];return a<n?(n=xk(a,n),i=r(s,i)):(n=xk(n,a),i=r(i,s)),function(o){return i(n(o))}}function tve(e,t,r){var n=Math.min(e.length,t.length)-1,a=new Array(n),i=new Array(n),s=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<n;)a[s]=xk(e[s],e[s+1]),i[s]=r(t[s],t[s+1]);return function(o){var l=Ff(e,o,1,n)-1;return i[l](a[l](o))}}function Bf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function wg(){var e=SI,t=SI,r=Ac,n,a,i,s=Cr,o,l,c;function d(){var h=Math.min(e.length,t.length);return s!==Cr&&(s=Jye(e[0],e[h-1])),o=h>2?tve:eve,l=c=null,f}function f(h){return h==null||isNaN(h=+h)?i:(l||(l=o(e.map(n),t,r)))(n(s(h)))}return f.invert=function(h){return s(a((c||(c=o(t,e.map(n),Kn)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Om),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=iN,d()},f.clamp=function(h){return arguments.length?(s=h?!0:Cr,d()):s!==Cr},f.interpolate=function(h){return arguments.length?(r=h,d()):r},f.unknown=function(h){return arguments.length?(i=h,f):i},function(h,p){return n=h,a=p,d()}}function nE(){return wg()(Cr,Cr)}function rve(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Mm(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 nc(e){return e=Mm(Math.abs(e)),e?e[1]:NaN}function nve(e,t){return function(r,n){for(var a=r.length,i=[],s=0,o=e[0],l=0;a>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),i.push(r.substring(a-=o,a+o)),!((l+=o+1)>n));)o=e[s=(s+1)%e.length];return i.reverse().join(t)}}function ave(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var ive=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Kd(e){if(!(t=ive.exec(e)))throw new Error("invalid format: "+e);var t;return new aE({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]})}Kd.prototype=aE.prototype;function aE(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+""}aE.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 sve(e){e:for(var t=e.length,r=1,n=-1,a;r<t;++r)switch(e[r]){case".":n=a=r;break;case"0":n===0&&(n=r),a=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var f9;function ove(e,t){var r=Mm(e,t);if(!r)return e+"";var n=r[0],a=r[1],i=a-(f9=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,s=n.length;return i===s?n:i>s?n+new Array(i-s+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Mm(e,Math.max(0,t+i-1))[0]}function kI(e,t){var r=Mm(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const _I={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:rve,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)=>kI(e*100,t),r:kI,s:ove,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function NI(e){return e}var EI=Array.prototype.map,PI=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function lve(e){var t=e.grouping===void 0||e.thousands===void 0?NI:nve(EI.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?NI:ave(EI.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(f){f=Kd(f);var h=f.fill,p=f.align,g=f.sign,m=f.symbol,b=f.zero,x=f.width,y=f.comma,v=f.precision,w=f.trim,j=f.type;j==="n"?(y=!0,j="g"):_I[j]||(v===void 0&&(v=12),w=!0,j="g"),(b||h==="0"&&p==="=")&&(b=!0,h="0",p="=");var k=m==="$"?r:m==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():"",S=m==="$"?n:/[%p]/.test(j)?s:"",N=_I[j],E=/[defgprs%]/.test(j);v=v===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function A(C){var M=k,T=S,P,D,$;if(j==="c")T=N(C)+T,C="";else{C=+C;var L=C<0||1/C<0;if(C=isNaN(C)?l:N(Math.abs(C),v),w&&(C=sve(C)),L&&+C==0&&g!=="+"&&(L=!1),M=(L?g==="("?g:o:g==="-"||g==="("?"":g)+M,T=(j==="s"?PI[8+f9/3]:"")+T+(L&&g==="("?")":""),E){for(P=-1,D=C.length;++P<D;)if($=C.charCodeAt(P),48>$||$>57){T=($===46?a+C.slice(P+1):C.slice(P))+T,C=C.slice(0,P);break}}}y&&!b&&(C=t(C,1/0));var I=M.length+C.length+T.length,R=I<x?new Array(x-I+1).join(h):"";switch(y&&b&&(C=t(R+C,R.length?x-T.length:1/0),R=""),p){case"<":C=M+C+T+R;break;case"=":C=M+R+C+T;break;case"^":C=R.slice(0,I=R.length>>1)+M+C+T+R.slice(I);break;default:C=R+M+C+T;break}return i(C)}return A.toString=function(){return f+""},A}function d(f,h){var p=c((f=Kd(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(nc(h)/3)))*3,m=Math.pow(10,-g),b=PI[8+g/3];return function(x){return p(m*x)+b}}return{format:c,formatPrefix:d}}var Fh,iE,h9;cve({thousands:",",grouping:[3],currency:["$",""]});function cve(e){return Fh=lve(e),iE=Fh.format,h9=Fh.formatPrefix,Fh}function uve(e){return Math.max(0,-nc(Math.abs(e)))}function dve(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(nc(t)/3)))*3-nc(Math.abs(e)))}function fve(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,nc(t)-nc(e))+1}function p9(e,t,r,n){var a=yk(e,t,r),i;switch(n=Kd(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=dve(a,s))&&(n.precision=i),h9(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=fve(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=uve(a))&&(n.precision=i-(n.type==="%")*2);break}}return iE(n)}function ws(e){var t=e.domain;return e.ticks=function(r){var n=t();return mk(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return p9(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,s=n[a],o=n[i],l,c,d=10;for(o<s&&(c=s,s=o,o=c,c=a,a=i,i=c);d-- >0;){if(c=gk(s,o,r),c===l)return n[a]=s,n[i]=o,t(n);if(c>0)s=Math.floor(s/c)*c,o=Math.ceil(o/c)*c;else if(c<0)s=Math.ceil(s*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function Rm(){var e=nE();return e.copy=function(){return Bf(e,Rm())},$n.apply(e,arguments),ws(e)}function m9(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,Om),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return m9(e).unknown(t)},e=arguments.length?Array.from(e,Om):[0,1],ws(r)}function g9(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],s;return i<a&&(s=r,r=n,n=s,s=a,a=i,i=s),e[r]=t.floor(a),e[n]=t.ceil(i),e}function CI(e){return Math.log(e)}function AI(e){return Math.exp(e)}function hve(e){return-Math.log(-e)}function pve(e){return-Math.exp(-e)}function mve(e){return isFinite(e)?+("1e"+e):e<0?0:e}function gve(e){return e===10?mve:e===Math.E?Math.exp:t=>Math.pow(e,t)}function yve(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 TI(e){return(t,r)=>-e(-t,r)}function sE(e){const t=e(CI,AI),r=t.domain;let n=10,a,i;function s(){return a=yve(n),i=gve(n),r()[0]<0?(a=TI(a),i=TI(i),e(hve,pve)):e(CI,AI),t}return t.base=function(o){return arguments.length?(n=+o,s()):n},t.domain=function(o){return arguments.length?(r(o),s()):r()},t.ticks=o=>{const l=r();let c=l[0],d=l[l.length-1];const f=d<c;f&&([c,d]=[d,c]);let h=a(c),p=a(d),g,m;const b=o==null?10:+o;let x=[];if(!(n%1)&&p-h<b){if(h=Math.floor(h),p=Math.ceil(p),c>0){for(;h<=p;++h)for(g=1;g<n;++g)if(m=h<0?g/i(-h):g*i(h),!(m<c)){if(m>d)break;x.push(m)}}else for(;h<=p;++h)for(g=n-1;g>=1;--g)if(m=h>0?g/i(-h):g*i(h),!(m<c)){if(m>d)break;x.push(m)}x.length*2<b&&(x=mk(c,d,b))}else x=mk(h,p,Math.min(p-h,b)).map(i);return f?x.reverse():x},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Kd(l)).precision==null&&(l.trim=!0),l=iE(l)),o===1/0)return l;const c=Math.max(1,n*o/t.ticks().length);return d=>{let f=d/i(Math.round(a(d)));return f*n<n-.5&&(f*=n),f<=c?l(d):""}},t.nice=()=>r(g9(r(),{floor:o=>i(Math.floor(a(o))),ceil:o=>i(Math.ceil(a(o)))})),t}function y9(){const e=sE(wg()).domain([1,10]);return e.copy=()=>Bf(e,y9()).base(e.base()),$n.apply(e,arguments),e}function OI(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function MI(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function oE(e){var t=1,r=e(OI(t),MI(t));return r.constant=function(n){return arguments.length?e(OI(t=+n),MI(t)):t},ws(r)}function v9(){var e=oE(wg());return e.copy=function(){return Bf(e,v9()).constant(e.constant())},$n.apply(e,arguments)}function RI(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function vve(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function xve(e){return e<0?-e*e:e*e}function lE(e){var t=e(Cr,Cr),r=1;function n(){return r===1?e(Cr,Cr):r===.5?e(vve,xve):e(RI(r),RI(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},ws(t)}function cE(){var e=lE(wg());return e.copy=function(){return Bf(e,cE()).exponent(e.exponent())},$n.apply(e,arguments),e}function bve(){return cE.apply(null,arguments).exponent(.5)}function $I(e){return Math.sign(e)*e*e}function wve(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function x9(){var e=nE(),t=[0,1],r=!1,n;function a(i){var s=wve(e(i));return isNaN(s)?n:r?Math.round(s):s}return a.invert=function(i){return e.invert($I(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,Om)).map($I)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return x9(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},$n.apply(a,arguments),ws(a)}function b9(){var e=[],t=[],r=[],n;function a(){var s=0,o=Math.max(1,t.length);for(r=new Array(o-1);++s<o;)r[s-1]=Xye(e,s/o);return i}function i(s){return s==null||isNaN(s=+s)?n:t[Ff(r,s)]}return i.invertExtent=function(s){var o=t.indexOf(s);return o<0?[NaN,NaN]:[o>0?r[o-1]:e[0],o<r.length?r[o]:e[e.length-1]]},i.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let o of s)o!=null&&!isNaN(o=+o)&&e.push(o);return e.sort(ts),a()},i.range=function(s){return arguments.length?(t=Array.from(s),a()):t.slice()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.quantiles=function(){return r.slice()},i.copy=function(){return b9().domain(e).range(t).unknown(n)},$n.apply(i,arguments)}function w9(){var e=0,t=1,r=1,n=[.5],a=[0,1],i;function s(l){return l!=null&&l<=l?a[Ff(n,l,0,r)]:i}function o(){var l=-1;for(n=new Array(r);++l<r;)n[l]=((l+1)*t-(l-r)*e)/(r+1);return s}return s.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,o()):[e,t]},s.range=function(l){return arguments.length?(r=(a=Array.from(l)).length-1,o()):a.slice()},s.invertExtent=function(l){var c=a.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,n[0]]:c>=r?[n[r-1],t]:[n[c-1],n[c]]},s.unknown=function(l){return arguments.length&&(i=l),s},s.thresholds=function(){return n.slice()},s.copy=function(){return w9().domain([e,t]).range(a).unknown(i)},$n.apply(ws(s),arguments)}function j9(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[Ff(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var s=t.indexOf(i);return[e[s-1],e[s]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return j9().domain(e).range(t).unknown(r)},$n.apply(a,arguments)}const H1=new Date,W1=new Date;function tr(e,t,r,n){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const s=a(i),o=a.ceil(i);return i-s<o-i?s:o},a.offset=(i,s)=>(t(i=new Date(+i),s==null?1:Math.floor(s)),i),a.range=(i,s,o)=>{const l=[];if(i=a.ceil(i),o=o==null?1:Math.floor(o),!(i<s)||!(o>0))return l;let c;do l.push(c=new Date(+i)),t(i,o),e(i);while(c<i&&i<s);return l},a.filter=i=>tr(s=>{if(s>=s)for(;e(s),!i(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;t(s,-1),!i(s););else for(;--o>=0;)for(;t(s,1),!i(s););}),r&&(a.count=(i,s)=>(H1.setTime(+i),W1.setTime(+s),e(H1),e(W1),Math.floor(r(H1,W1))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?s=>n(s)%i===0:s=>a.count(0,s)%i===0):a)),a}const $m=tr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);$m.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):$m);$m.range;const za=1e3,jn=za*60,Fa=jn*60,si=Fa*24,uE=si*7,DI=si*30,G1=si*365,Ks=tr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*za)},(e,t)=>(t-e)/za,e=>e.getUTCSeconds());Ks.range;const dE=tr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*za)},(e,t)=>{e.setTime(+e+t*jn)},(e,t)=>(t-e)/jn,e=>e.getMinutes());dE.range;const fE=tr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*jn)},(e,t)=>(t-e)/jn,e=>e.getUTCMinutes());fE.range;const hE=tr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*za-e.getMinutes()*jn)},(e,t)=>{e.setTime(+e+t*Fa)},(e,t)=>(t-e)/Fa,e=>e.getHours());hE.range;const pE=tr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Fa)},(e,t)=>(t-e)/Fa,e=>e.getUTCHours());pE.range;const Vf=tr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*jn)/si,e=>e.getDate()-1);Vf.range;const jg=tr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/si,e=>e.getUTCDate()-1);jg.range;const S9=tr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/si,e=>Math.floor(e/si));S9.range;function To(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())*jn)/uE)}const Sg=To(0),Dm=To(1),jve=To(2),Sve=To(3),ac=To(4),kve=To(5),_ve=To(6);Sg.range;Dm.range;jve.range;Sve.range;ac.range;kve.range;_ve.range;function Oo(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)/uE)}const kg=Oo(0),Im=Oo(1),Nve=Oo(2),Eve=Oo(3),ic=Oo(4),Pve=Oo(5),Cve=Oo(6);kg.range;Im.range;Nve.range;Eve.range;ic.range;Pve.range;Cve.range;const mE=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());mE.range;const gE=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());gE.range;const oi=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());oi.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)});oi.range;const li=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());li.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)});li.range;function k9(e,t,r,n,a,i){const s=[[Ks,1,za],[Ks,5,5*za],[Ks,15,15*za],[Ks,30,30*za],[i,1,jn],[i,5,5*jn],[i,15,15*jn],[i,30,30*jn],[a,1,Fa],[a,3,3*Fa],[a,6,6*Fa],[a,12,12*Fa],[n,1,si],[n,2,2*si],[r,1,uE],[t,1,DI],[t,3,3*DI],[e,1,G1]];function o(c,d,f){const h=d<c;h&&([c,d]=[d,c]);const p=f&&typeof f.range=="function"?f:l(c,d,f),g=p?p.range(c,+d+1):[];return h?g.reverse():g}function l(c,d,f){const h=Math.abs(d-c)/f,p=tE(([,,b])=>b).right(s,h);if(p===s.length)return e.every(yk(c/G1,d/G1,f));if(p===0)return $m.every(Math.max(yk(c,d,f),1));const[g,m]=s[h/s[p-1][2]<s[p][2]/h?p-1:p];return g.every(m)}return[o,l]}const[Ave,Tve]=k9(li,gE,kg,S9,pE,fE),[Ove,Mve]=k9(oi,mE,Sg,Vf,hE,dE);function K1(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 Y1(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 mu(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function Rve(e){var t=e.dateTime,r=e.date,n=e.time,a=e.periods,i=e.days,s=e.shortDays,o=e.months,l=e.shortMonths,c=gu(a),d=yu(a),f=gu(i),h=yu(i),p=gu(s),g=yu(s),m=gu(o),b=yu(o),x=gu(l),y=yu(l),v={a:L,A:I,b:R,B:z,c:null,d:VI,e:VI,f:nxe,g:hxe,G:mxe,H:exe,I:txe,j:rxe,L:_9,m:axe,M:ixe,p:V,q:B,Q:HI,s:WI,S:sxe,u:oxe,U:lxe,V:cxe,w:uxe,W:dxe,x:null,X:null,y:fxe,Y:pxe,Z:gxe,"%":UI},w={a:W,A:K,b:Q,B:ae,c:null,d:qI,e:qI,f:bxe,g:Axe,G:Oxe,H:yxe,I:vxe,j:xxe,L:E9,m:wxe,M:jxe,p:pe,q:ve,Q:HI,s:WI,S:Sxe,u:kxe,U:_xe,V:Nxe,w:Exe,W:Pxe,x:null,X:null,y:Cxe,Y:Txe,Z:Mxe,"%":UI},j={a:A,A:C,b:M,B:T,c:P,d:FI,e:FI,f:Xve,g:zI,G:LI,H:BI,I:BI,j:Wve,L:Yve,m:Hve,M:Gve,p:E,q:Uve,Q:Qve,s:Jve,S:Kve,u:zve,U:Fve,V:Bve,w:Lve,W:Vve,x:D,X:$,y:zI,Y:LI,Z:qve,"%":Zve};v.x=k(r,v),v.X=k(n,v),v.c=k(t,v),w.x=k(r,w),w.X=k(n,w),w.c=k(t,w);function k(Y,ee){return function(fe){var H=[],je=-1,ye=0,se=Y.length,ke,ne,ie;for(fe instanceof Date||(fe=new Date(+fe));++je<se;)Y.charCodeAt(je)===37&&(H.push(Y.slice(ye,je)),(ne=II[ke=Y.charAt(++je)])!=null?ke=Y.charAt(++je):ne=ke==="e"?" ":"0",(ie=ee[ke])&&(ke=ie(fe,ne)),H.push(ke),ye=je+1);return H.push(Y.slice(ye,je)),H.join("")}}function S(Y,ee){return function(fe){var H=mu(1900,void 0,1),je=N(H,Y,fe+="",0),ye,se;if(je!=fe.length)return null;if("Q"in H)return new Date(H.Q);if("s"in H)return new Date(H.s*1e3+("L"in H?H.L:0));if(ee&&!("Z"in H)&&(H.Z=0),"p"in H&&(H.H=H.H%12+H.p*12),H.m===void 0&&(H.m="q"in H?H.q:0),"V"in H){if(H.V<1||H.V>53)return null;"w"in H||(H.w=1),"Z"in H?(ye=Y1(mu(H.y,0,1)),se=ye.getUTCDay(),ye=se>4||se===0?Im.ceil(ye):Im(ye),ye=jg.offset(ye,(H.V-1)*7),H.y=ye.getUTCFullYear(),H.m=ye.getUTCMonth(),H.d=ye.getUTCDate()+(H.w+6)%7):(ye=K1(mu(H.y,0,1)),se=ye.getDay(),ye=se>4||se===0?Dm.ceil(ye):Dm(ye),ye=Vf.offset(ye,(H.V-1)*7),H.y=ye.getFullYear(),H.m=ye.getMonth(),H.d=ye.getDate()+(H.w+6)%7)}else("W"in H||"U"in H)&&("w"in H||(H.w="u"in H?H.u%7:"W"in H?1:0),se="Z"in H?Y1(mu(H.y,0,1)).getUTCDay():K1(mu(H.y,0,1)).getDay(),H.m=0,H.d="W"in H?(H.w+6)%7+H.W*7-(se+5)%7:H.w+H.U*7-(se+6)%7);return"Z"in H?(H.H+=H.Z/100|0,H.M+=H.Z%100,Y1(H)):K1(H)}}function N(Y,ee,fe,H){for(var je=0,ye=ee.length,se=fe.length,ke,ne;je<ye;){if(H>=se)return-1;if(ke=ee.charCodeAt(je++),ke===37){if(ke=ee.charAt(je++),ne=j[ke in II?ee.charAt(je++):ke],!ne||(H=ne(Y,fe,H))<0)return-1}else if(ke!=fe.charCodeAt(H++))return-1}return H}function E(Y,ee,fe){var H=c.exec(ee.slice(fe));return H?(Y.p=d.get(H[0].toLowerCase()),fe+H[0].length):-1}function A(Y,ee,fe){var H=p.exec(ee.slice(fe));return H?(Y.w=g.get(H[0].toLowerCase()),fe+H[0].length):-1}function C(Y,ee,fe){var H=f.exec(ee.slice(fe));return H?(Y.w=h.get(H[0].toLowerCase()),fe+H[0].length):-1}function M(Y,ee,fe){var H=x.exec(ee.slice(fe));return H?(Y.m=y.get(H[0].toLowerCase()),fe+H[0].length):-1}function T(Y,ee,fe){var H=m.exec(ee.slice(fe));return H?(Y.m=b.get(H[0].toLowerCase()),fe+H[0].length):-1}function P(Y,ee,fe){return N(Y,t,ee,fe)}function D(Y,ee,fe){return N(Y,r,ee,fe)}function $(Y,ee,fe){return N(Y,n,ee,fe)}function L(Y){return s[Y.getDay()]}function I(Y){return i[Y.getDay()]}function R(Y){return l[Y.getMonth()]}function z(Y){return o[Y.getMonth()]}function V(Y){return a[+(Y.getHours()>=12)]}function B(Y){return 1+~~(Y.getMonth()/3)}function W(Y){return s[Y.getUTCDay()]}function K(Y){return i[Y.getUTCDay()]}function Q(Y){return l[Y.getUTCMonth()]}function ae(Y){return o[Y.getUTCMonth()]}function pe(Y){return a[+(Y.getUTCHours()>=12)]}function ve(Y){return 1+~~(Y.getUTCMonth()/3)}return{format:function(Y){var ee=k(Y+="",v);return ee.toString=function(){return Y},ee},parse:function(Y){var ee=S(Y+="",!1);return ee.toString=function(){return Y},ee},utcFormat:function(Y){var ee=k(Y+="",w);return ee.toString=function(){return Y},ee},utcParse:function(Y){var ee=S(Y+="",!0);return ee.toString=function(){return Y},ee}}}var II={"-":"",_:" ",0:"0"},lr=/^\s*\d+/,$ve=/^%/,Dve=/[\\^$*+?|[\]().{}]/g;function Ue(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(t)+a:a)}function Ive(e){return e.replace(Dve,"\\$&")}function gu(e){return new RegExp("^(?:"+e.map(Ive).join("|")+")","i")}function yu(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function Lve(e,t,r){var n=lr.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function zve(e,t,r){var n=lr.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Fve(e,t,r){var n=lr.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Bve(e,t,r){var n=lr.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function Vve(e,t,r){var n=lr.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function LI(e,t,r){var n=lr.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function zI(e,t,r){var n=lr.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function qve(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 Uve(e,t,r){var n=lr.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Hve(e,t,r){var n=lr.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function FI(e,t,r){var n=lr.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Wve(e,t,r){var n=lr.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function BI(e,t,r){var n=lr.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Gve(e,t,r){var n=lr.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Kve(e,t,r){var n=lr.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Yve(e,t,r){var n=lr.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Xve(e,t,r){var n=lr.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Zve(e,t,r){var n=$ve.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Qve(e,t,r){var n=lr.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Jve(e,t,r){var n=lr.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function VI(e,t){return Ue(e.getDate(),t,2)}function exe(e,t){return Ue(e.getHours(),t,2)}function txe(e,t){return Ue(e.getHours()%12||12,t,2)}function rxe(e,t){return Ue(1+Vf.count(oi(e),e),t,3)}function _9(e,t){return Ue(e.getMilliseconds(),t,3)}function nxe(e,t){return _9(e,t)+"000"}function axe(e,t){return Ue(e.getMonth()+1,t,2)}function ixe(e,t){return Ue(e.getMinutes(),t,2)}function sxe(e,t){return Ue(e.getSeconds(),t,2)}function oxe(e){var t=e.getDay();return t===0?7:t}function lxe(e,t){return Ue(Sg.count(oi(e)-1,e),t,2)}function N9(e){var t=e.getDay();return t>=4||t===0?ac(e):ac.ceil(e)}function cxe(e,t){return e=N9(e),Ue(ac.count(oi(e),e)+(oi(e).getDay()===4),t,2)}function uxe(e){return e.getDay()}function dxe(e,t){return Ue(Dm.count(oi(e)-1,e),t,2)}function fxe(e,t){return Ue(e.getFullYear()%100,t,2)}function hxe(e,t){return e=N9(e),Ue(e.getFullYear()%100,t,2)}function pxe(e,t){return Ue(e.getFullYear()%1e4,t,4)}function mxe(e,t){var r=e.getDay();return e=r>=4||r===0?ac(e):ac.ceil(e),Ue(e.getFullYear()%1e4,t,4)}function gxe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ue(t/60|0,"0",2)+Ue(t%60,"0",2)}function qI(e,t){return Ue(e.getUTCDate(),t,2)}function yxe(e,t){return Ue(e.getUTCHours(),t,2)}function vxe(e,t){return Ue(e.getUTCHours()%12||12,t,2)}function xxe(e,t){return Ue(1+jg.count(li(e),e),t,3)}function E9(e,t){return Ue(e.getUTCMilliseconds(),t,3)}function bxe(e,t){return E9(e,t)+"000"}function wxe(e,t){return Ue(e.getUTCMonth()+1,t,2)}function jxe(e,t){return Ue(e.getUTCMinutes(),t,2)}function Sxe(e,t){return Ue(e.getUTCSeconds(),t,2)}function kxe(e){var t=e.getUTCDay();return t===0?7:t}function _xe(e,t){return Ue(kg.count(li(e)-1,e),t,2)}function P9(e){var t=e.getUTCDay();return t>=4||t===0?ic(e):ic.ceil(e)}function Nxe(e,t){return e=P9(e),Ue(ic.count(li(e),e)+(li(e).getUTCDay()===4),t,2)}function Exe(e){return e.getUTCDay()}function Pxe(e,t){return Ue(Im.count(li(e)-1,e),t,2)}function Cxe(e,t){return Ue(e.getUTCFullYear()%100,t,2)}function Axe(e,t){return e=P9(e),Ue(e.getUTCFullYear()%100,t,2)}function Txe(e,t){return Ue(e.getUTCFullYear()%1e4,t,4)}function Oxe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?ic(e):ic.ceil(e),Ue(e.getUTCFullYear()%1e4,t,4)}function Mxe(){return"+0000"}function UI(){return"%"}function HI(e){return+e}function WI(e){return Math.floor(+e/1e3)}var Ko,C9,A9;Rxe({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 Rxe(e){return Ko=Rve(e),C9=Ko.format,Ko.parse,A9=Ko.utcFormat,Ko.utcParse,Ko}function $xe(e){return new Date(e)}function Dxe(e){return e instanceof Date?+e:+new Date(+e)}function yE(e,t,r,n,a,i,s,o,l,c){var d=nE(),f=d.invert,h=d.domain,p=c(".%L"),g=c(":%S"),m=c("%I:%M"),b=c("%I %p"),x=c("%a %d"),y=c("%b %d"),v=c("%B"),w=c("%Y");function j(k){return(l(k)<k?p:o(k)<k?g:s(k)<k?m:i(k)<k?b:n(k)<k?a(k)<k?x:y:r(k)<k?v:w)(k)}return d.invert=function(k){return new Date(f(k))},d.domain=function(k){return arguments.length?h(Array.from(k,Dxe)):h().map($xe)},d.ticks=function(k){var S=h();return e(S[0],S[S.length-1],k??10)},d.tickFormat=function(k,S){return S==null?j:c(S)},d.nice=function(k){var S=h();return(!k||typeof k.range!="function")&&(k=t(S[0],S[S.length-1],k??10)),k?h(g9(S,k)):d},d.copy=function(){return Bf(d,yE(e,t,r,n,a,i,s,o,l,c))},d}function Ixe(){return $n.apply(yE(Ove,Mve,oi,mE,Sg,Vf,hE,dE,Ks,C9).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Lxe(){return $n.apply(yE(Ave,Tve,li,gE,kg,jg,pE,fE,Ks,A9).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function _g(){var e=0,t=1,r,n,a,i,s=Cr,o=!1,l;function c(f){return f==null||isNaN(f=+f)?l:s(a===0?.5:(f=(i(f)-r)*a,o?Math.max(0,Math.min(1,f)):f))}c.domain=function(f){return arguments.length?([e,t]=f,r=i(e=+e),n=i(t=+t),a=r===n?0:1/(n-r),c):[e,t]},c.clamp=function(f){return arguments.length?(o=!!f,c):o},c.interpolator=function(f){return arguments.length?(s=f,c):s};function d(f){return function(h){var p,g;return arguments.length?([p,g]=h,s=f(p,g),c):[s(0),s(1)]}}return c.range=d(Ac),c.rangeRound=d(iN),c.unknown=function(f){return arguments.length?(l=f,c):l},function(f){return i=f,r=f(e),n=f(t),a=r===n?0:1/(n-r),c}}function js(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function T9(){var e=ws(_g()(Cr));return e.copy=function(){return js(e,T9())},gi.apply(e,arguments)}function O9(){var e=sE(_g()).domain([1,10]);return e.copy=function(){return js(e,O9()).base(e.base())},gi.apply(e,arguments)}function M9(){var e=oE(_g());return e.copy=function(){return js(e,M9()).constant(e.constant())},gi.apply(e,arguments)}function vE(){var e=lE(_g());return e.copy=function(){return js(e,vE()).exponent(e.exponent())},gi.apply(e,arguments)}function zxe(){return vE.apply(null,arguments).exponent(.5)}function R9(){var e=[],t=Cr;function r(n){if(n!=null&&!isNaN(n=+n))return t((Ff(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let a of n)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(ts),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,a)=>t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>Yye(e,i/n))},r.copy=function(){return R9(t).domain(e)},gi.apply(r,arguments)}function Ng(){var e=0,t=.5,r=1,n=1,a,i,s,o,l,c=Cr,d,f=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+d(m))-i)*(n*m<n*i?o:l),c(f?Math.max(0,Math.min(1,m)):m))}p.domain=function(m){return arguments.length?([e,t,r]=m,a=d(e=+e),i=d(t=+t),s=d(r=+r),o=a===i?0:.5/(i-a),l=i===s?0:.5/(s-i),n=i<a?-1:1,p):[e,t,r]},p.clamp=function(m){return arguments.length?(f=!!m,p):f},p.interpolator=function(m){return arguments.length?(c=m,p):c};function g(m){return function(b){var x,y,v;return arguments.length?([x,y,v]=b,c=One(m,[x,y,v]),p):[c(0),c(.5),c(1)]}}return p.range=g(Ac),p.rangeRound=g(iN),p.unknown=function(m){return arguments.length?(h=m,p):h},function(m){return d=m,a=m(e),i=m(t),s=m(r),o=a===i?0:.5/(i-a),l=i===s?0:.5/(s-i),n=i<a?-1:1,p}}function $9(){var e=ws(Ng()(Cr));return e.copy=function(){return js(e,$9())},gi.apply(e,arguments)}function D9(){var e=sE(Ng()).domain([.1,1,10]);return e.copy=function(){return js(e,D9()).base(e.base())},gi.apply(e,arguments)}function I9(){var e=oE(Ng());return e.copy=function(){return js(e,I9()).constant(e.constant())},gi.apply(e,arguments)}function xE(){var e=lE(Ng());return e.copy=function(){return js(e,xE()).exponent(e.exponent())},gi.apply(e,arguments)}function Fxe(){return xE.apply(null,arguments).exponent(.5)}const GI=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Gd,scaleDiverging:$9,scaleDivergingLog:D9,scaleDivergingPow:xE,scaleDivergingSqrt:Fxe,scaleDivergingSymlog:I9,scaleIdentity:m9,scaleImplicit:vk,scaleLinear:Rm,scaleLog:y9,scaleOrdinal:rE,scalePoint:rd,scalePow:cE,scaleQuantile:b9,scaleQuantize:w9,scaleRadial:x9,scaleSequential:T9,scaleSequentialLog:O9,scaleSequentialPow:vE,scaleSequentialQuantile:R9,scaleSequentialSqrt:zxe,scaleSequentialSymlog:M9,scaleSqrt:bve,scaleSymlog:v9,scaleThreshold:j9,scaleTime:Ixe,scaleUtc:Lxe,tickFormat:p9},Symbol.toStringTag,{value:"Module"}));var Bxe=WB();const Eg=Ke(Bxe);var Vxe=ZB();const Pg=Ke(Vxe);var qxe=rg(),Uxe=IN();function Hxe(e,t){return qxe(Uxe(e,t),1)}var Wxe=Hxe;const Gxe=Ke(Wxe);var Kxe=RN;function Yxe(e,t){return Kxe(e,t)}var Xxe=Yxe;const Cg=Ke(Xxe);var Bc=1e9,Zxe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},wE,bt=!0,An="[DecimalError] ",no=An+"Invalid argument: ",bE=An+"Exponent out of range: ",Vc=Math.floor,$s=Math.pow,Qxe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Qr,ar=1e7,ht=7,L9=9007199254740991,Lm=Vc(L9/ht),ce={};ce.absoluteValue=ce.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ce.comparedTo=ce.cmp=function(e){var t,r,n,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,a=e.d.length,t=0,r=n<a?n:a;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};ce.decimalPlaces=ce.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ht;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};ce.dividedBy=ce.div=function(e){return Ka(this,new this.constructor(e))};ce.dividedToIntegerBy=ce.idiv=function(e){var t=this,r=t.constructor;return nt(Ka(t,new r(e),0,1),r.precision)};ce.equals=ce.eq=function(e){return!this.cmp(e)};ce.exponent=function(){return Wt(this)};ce.greaterThan=ce.gt=function(e){return this.cmp(e)>0};ce.greaterThanOrEqualTo=ce.gte=function(e){return this.cmp(e)>=0};ce.isInteger=ce.isint=function(){return this.e>this.d.length-2};ce.isNegative=ce.isneg=function(){return this.s<0};ce.isPositive=ce.ispos=function(){return this.s>0};ce.isZero=function(){return this.s===0};ce.lessThan=ce.lt=function(e){return this.cmp(e)<0};ce.lessThanOrEqualTo=ce.lte=function(e){return this.cmp(e)<1};ce.logarithm=ce.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Qr))throw Error(An+"NaN");if(r.s<1)throw Error(An+(r.s?"NaN":"-Infinity"));return r.eq(Qr)?new n(0):(bt=!1,t=Ka(Yd(r,i),Yd(e,i),i),bt=!0,nt(t,a))};ce.minus=ce.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?B9(t,e):z9(t,(e.s=-e.s,e))};ce.modulo=ce.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(An+"NaN");return r.s?(bt=!1,t=Ka(r,e,0,1).times(e),bt=!0,r.minus(t)):nt(new n(r),a)};ce.naturalExponential=ce.exp=function(){return F9(this)};ce.naturalLogarithm=ce.ln=function(){return Yd(this)};ce.negated=ce.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ce.plus=ce.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?z9(t,e):B9(t,(e.s=-e.s,e))};ce.precision=ce.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(no+e);if(t=Wt(a)+1,n=a.d.length-1,r=n*ht+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};ce.squareRoot=ce.sqrt=function(){var e,t,r,n,a,i,s,o=this,l=o.constructor;if(o.s<1){if(!o.s)return new l(0);throw Error(An+"NaN")}for(e=Wt(o),bt=!1,a=Math.sqrt(+o),a==0||a==1/0?(t=pa(o.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Vc((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(a.toString()),r=l.precision,a=s=r+3;;)if(i=n,n=i.plus(Ka(o,i,s+2)).times(.5),pa(i.d).slice(0,s)===(t=pa(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),a==s&&t=="4999"){if(nt(i,r+1,0),i.times(i).eq(o)){n=i;break}}else if(t!="9999")break;s+=4}return bt=!0,nt(n,r)};ce.times=ce.mul=function(e){var t,r,n,a,i,s,o,l,c,d=this,f=d.constructor,h=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,r=d.e+e.e,l=h.length,c=p.length,l<c&&(i=h,h=p,p=i,s=l,l=c,c=s),i=[],s=l+c,n=s;n--;)i.push(0);for(n=c;--n>=0;){for(t=0,a=l+n;a>n;)o=i[a]+p[n]*h[a-n-1]+t,i[a--]=o%ar|0,t=o/ar|0;i[a]=(i[a]+t)%ar|0}for(;!i[--s];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,bt?nt(e,f.precision):e};ce.toDecimalPlaces=ce.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Sa(e,0,Bc),t===void 0?t=n.rounding:Sa(t,0,8),nt(r,e+Wt(r)+1,t))};ce.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=bo(n,!0):(Sa(e,0,Bc),t===void 0?t=a.rounding:Sa(t,0,8),n=nt(new a(n),e+1,t),r=bo(n,!0,e+1)),r};ce.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?bo(a):(Sa(e,0,Bc),t===void 0?t=i.rounding:Sa(t,0,8),n=nt(new i(a),e+Wt(a)+1,t),r=bo(n.abs(),!1,e+Wt(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};ce.toInteger=ce.toint=function(){var e=this,t=e.constructor;return nt(new t(e),Wt(e)+1,t.rounding)};ce.toNumber=function(){return+this};ce.toPower=ce.pow=function(e){var t,r,n,a,i,s,o=this,l=o.constructor,c=12,d=+(e=new l(e));if(!e.s)return new l(Qr);if(o=new l(o),!o.s){if(e.s<1)throw Error(An+"Infinity");return o}if(o.eq(Qr))return o;if(n=l.precision,e.eq(Qr))return nt(o,n);if(t=e.e,r=e.d.length-1,s=t>=r,i=o.s,s){if((r=d<0?-d:d)<=L9){for(a=new l(Qr),t=Math.ceil(n/ht+4),bt=!1;r%2&&(a=a.times(o),YI(a.d,t)),r=Vc(r/2),r!==0;)o=o.times(o),YI(o.d,t);return bt=!0,e.s<0?new l(Qr).div(a):nt(a,n)}}else if(i<0)throw Error(An+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,o.s=1,bt=!1,a=e.times(Yd(o,n+c)),bt=!0,a=F9(a),a.s=i,a};ce.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=Wt(a),n=bo(a,r<=i.toExpNeg||r>=i.toExpPos)):(Sa(e,1,Bc),t===void 0?t=i.rounding:Sa(t,0,8),a=nt(new i(a),e,t),r=Wt(a),n=bo(a,e<=r||r<=i.toExpNeg,e)),n};ce.toSignificantDigits=ce.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Sa(e,1,Bc),t===void 0?t=n.rounding:Sa(t,0,8)),nt(new n(r),e,t)};ce.toString=ce.valueOf=ce.val=ce.toJSON=ce[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Wt(e),r=e.constructor;return bo(e,t<=r.toExpNeg||t>=r.toExpPos)};function z9(e,t){var r,n,a,i,s,o,l,c,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),bt?nt(t,f):t;if(l=e.d,c=t.d,s=e.e,a=t.e,l=l.slice(),i=s-a,i){for(i<0?(n=l,i=-i,o=c.length):(n=c,a=s,o=l.length),s=Math.ceil(f/ht),o=s>o?s+1:o+1,i>o&&(i=o,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(o=l.length,i=c.length,o-i<0&&(i=o,n=c,c=l,l=n),r=0;i;)r=(l[--i]=l[i]+c[i]+r)/ar|0,l[i]%=ar;for(r&&(l.unshift(r),++a),o=l.length;l[--o]==0;)l.pop();return t.d=l,t.e=a,bt?nt(t,f):t}function Sa(e,t,r){if(e!==~~e||e<t||e>r)throw Error(no+e)}function pa(e){var t,r,n,a=e.length-1,i="",s=e[0];if(a>0){for(i+=s,t=1;t<a;t++)n=e[t]+"",r=ht-n.length,r&&(i+=Ri(r)),i+=n;s=e[t],n=s+"",r=ht-n.length,r&&(i+=Ri(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return i+s}var Ka=function(){function e(n,a){var i,s=0,o=n.length;for(n=n.slice();o--;)i=n[o]*a+s,n[o]=i%ar|0,s=i/ar|0;return s&&n.unshift(s),n}function t(n,a,i,s){var o,l;if(i!=s)l=i>s?1:-1;else for(o=l=0;o<i;o++)if(n[o]!=a[o]){l=n[o]>a[o]?1:-1;break}return l}function r(n,a,i){for(var s=0;i--;)n[i]-=s,s=n[i]<a[i]?1:0,n[i]=s*ar+n[i]-a[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,a,i,s){var o,l,c,d,f,h,p,g,m,b,x,y,v,w,j,k,S,N,E=n.constructor,A=n.s==a.s?1:-1,C=n.d,M=a.d;if(!n.s)return new E(n);if(!a.s)throw Error(An+"Division by zero");for(l=n.e-a.e,S=M.length,j=C.length,p=new E(A),g=p.d=[],c=0;M[c]==(C[c]||0);)++c;if(M[c]>(C[c]||0)&&--l,i==null?y=i=E.precision:s?y=i+(Wt(n)-Wt(a))+1:y=i,y<0)return new E(0);if(y=y/ht+2|0,c=0,S==1)for(d=0,M=M[0],y++;(c<j||d)&&y--;c++)v=d*ar+(C[c]||0),g[c]=v/M|0,d=v%M|0;else{for(d=ar/(M[0]+1)|0,d>1&&(M=e(M,d),C=e(C,d),S=M.length,j=C.length),w=S,m=C.slice(0,S),b=m.length;b<S;)m[b++]=0;N=M.slice(),N.unshift(0),k=M[0],M[1]>=ar/2&&++k;do d=0,o=t(M,m,S,b),o<0?(x=m[0],S!=b&&(x=x*ar+(m[1]||0)),d=x/k|0,d>1?(d>=ar&&(d=ar-1),f=e(M,d),h=f.length,b=m.length,o=t(f,m,h,b),o==1&&(d--,r(f,S<h?N:M,h))):(d==0&&(o=d=1),f=M.slice()),h=f.length,h<b&&f.unshift(0),r(m,f,b),o==-1&&(b=m.length,o=t(M,m,S,b),o<1&&(d++,r(m,S<b?N:M,b))),b=m.length):o===0&&(d++,m=[0]),g[c++]=d,o&&m[0]?m[b++]=C[w]||0:(m=[C[w]],b=1);while((w++<j||m[0]!==void 0)&&y--)}return g[0]||g.shift(),p.e=l,nt(p,s?i+Wt(p)+1:i)}}();function F9(e,t){var r,n,a,i,s,o,l=0,c=0,d=e.constructor,f=d.precision;if(Wt(e)>16)throw Error(bE+Wt(e));if(!e.s)return new d(Qr);for(bt=!1,o=f,s=new d(.03125);e.abs().gte(.1);)e=e.times(s),c+=5;for(n=Math.log($s(2,c))/Math.LN10*2+5|0,o+=n,r=a=i=new d(Qr),d.precision=o;;){if(a=nt(a.times(e),o),r=r.times(++l),s=i.plus(Ka(a,r,o)),pa(s.d).slice(0,o)===pa(i.d).slice(0,o)){for(;c--;)i=nt(i.times(i),o);return d.precision=f,t==null?(bt=!0,nt(i,f)):i}i=s}}function Wt(e){for(var t=e.e*ht,r=e.d[0];r>=10;r/=10)t++;return t}function X1(e,t,r){if(t>e.LN10.sd())throw bt=!0,r&&(e.precision=r),Error(An+"LN10 precision limit exceeded");return nt(new e(e.LN10),t)}function Ri(e){for(var t="";e--;)t+="0";return t}function Yd(e,t){var r,n,a,i,s,o,l,c,d,f=1,h=10,p=e,g=p.d,m=p.constructor,b=m.precision;if(p.s<1)throw Error(An+(p.s?"NaN":"-Infinity"));if(p.eq(Qr))return new m(0);if(t==null?(bt=!1,c=b):c=t,p.eq(10))return t==null&&(bt=!0),X1(m,c);if(c+=h,m.precision=c,r=pa(g),n=r.charAt(0),i=Wt(p),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=pa(p.d),n=r.charAt(0),f++;i=Wt(p),n>1?(p=new m("0."+r),i++):p=new m(n+"."+r.slice(1))}else return l=X1(m,c+2,b).times(i+""),p=Yd(new m(n+"."+r.slice(1)),c-h).plus(l),m.precision=b,t==null?(bt=!0,nt(p,b)):p;for(o=s=p=Ka(p.minus(Qr),p.plus(Qr),c),d=nt(p.times(p),c),a=3;;){if(s=nt(s.times(d),c),l=o.plus(Ka(s,new m(a),c)),pa(l.d).slice(0,c)===pa(o.d).slice(0,c))return o=o.times(2),i!==0&&(o=o.plus(X1(m,c+2,b).times(i+""))),o=Ka(o,new m(f),c),m.precision=b,t==null?(bt=!0,nt(o,b)):o;o=l,a+=2}}function KI(e,t){var r,n,a;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(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=Vc(r/ht),e.d=[],n=(r+1)%ht,r<0&&(n+=ht),n<a){for(n&&e.d.push(+t.slice(0,n)),a-=ht;n<a;)e.d.push(+t.slice(n,n+=ht));t=t.slice(n),n=ht-t.length}else n-=a;for(;n--;)t+="0";if(e.d.push(+t),bt&&(e.e>Lm||e.e<-Lm))throw Error(bE+r)}else e.s=0,e.e=0,e.d=[0];return e}function nt(e,t,r){var n,a,i,s,o,l,c,d,f=e.d;for(s=1,i=f[0];i>=10;i/=10)s++;if(n=t-s,n<0)n+=ht,a=t,c=f[d=0];else{if(d=Math.ceil((n+1)/ht),i=f.length,d>=i)return e;for(c=i=f[d],s=1;i>=10;i/=10)s++;n%=ht,a=n-ht+s}if(r!==void 0&&(i=$s(10,s-a-1),o=c/i%10|0,l=t<0||f[d+1]!==void 0||c%i,l=r<4?(o||l)&&(r==0||r==(e.s<0?3:2)):o>5||o==5&&(r==4||l||r==6&&(n>0?a>0?c/$s(10,s-a):0:f[d-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return l?(i=Wt(e),f.length=1,t=t-i-1,f[0]=$s(10,(ht-t%ht)%ht),e.e=Vc(-t/ht)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=d,i=1,d--):(f.length=d+1,i=$s(10,ht-n),f[d]=a>0?(c/$s(10,s-a)%$s(10,a)|0)*i:0),l)for(;;)if(d==0){(f[0]+=i)==ar&&(f[0]=1,++e.e);break}else{if(f[d]+=i,f[d]!=ar)break;f[d--]=0,i=1}for(n=f.length;f[--n]===0;)f.pop();if(bt&&(e.e>Lm||e.e<-Lm))throw Error(bE+Wt(e));return e}function B9(e,t){var r,n,a,i,s,o,l,c,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),bt?nt(t,p):t;if(l=e.d,f=t.d,n=t.e,c=e.e,l=l.slice(),s=c-n,s){for(d=s<0,d?(r=l,s=-s,o=f.length):(r=f,n=c,o=l.length),a=Math.max(Math.ceil(p/ht),o)+2,s>a&&(s=a,r.length=1),r.reverse(),a=s;a--;)r.push(0);r.reverse()}else{for(a=l.length,o=f.length,d=a<o,d&&(o=a),a=0;a<o;a++)if(l[a]!=f[a]){d=l[a]<f[a];break}s=0}for(d&&(r=l,l=f,f=r,t.s=-t.s),o=l.length,a=f.length-o;a>0;--a)l[o++]=0;for(a=f.length;a>s;){if(l[--a]<f[a]){for(i=a;i&&l[--i]===0;)l[i]=ar-1;--l[i],l[a]+=ar}l[a]-=f[a]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--n;return l[0]?(t.d=l,t.e=n,bt?nt(t,p):t):new h(0)}function bo(e,t,r){var n,a=Wt(e),i=pa(e.d),s=i.length;return t?(r&&(n=r-s)>0?i=i.charAt(0)+"."+i.slice(1)+Ri(n):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Ri(-a-1)+i,r&&(n=r-s)>0&&(i+=Ri(n))):a>=s?(i+=Ri(a+1-s),r&&(n=r-a-1)>0&&(i=i+"."+Ri(n))):((n=a+1)<s&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-s)>0&&(a+1===s&&(i+="."),i+=Ri(n))),e.s<0?"-"+i:i}function YI(e,t){if(e.length>t)return e.length=t,!0}function V9(e){var t,r,n;function a(i){var s=this;if(!(s instanceof a))return new a(i);if(s.constructor=a,i instanceof a){s.s=i.s,s.e=i.e,s.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(no+i);if(i>0)s.s=1;else if(i<0)i=-i,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(i===~~i&&i<1e7){s.e=0,s.d=[i];return}return KI(s,i.toString())}else if(typeof i!="string")throw Error(no+i);if(i.charCodeAt(0)===45?(i=i.slice(1),s.s=-1):s.s=1,Qxe.test(i))KI(s,i);else throw Error(no+i)}if(a.prototype=ce,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=V9,a.config=a.set=Jxe,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 a.config(e),a}function Jxe(e){if(!e||typeof e!="object")throw Error(An+"Object expected");var t,r,n,a=["precision",1,Bc,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((n=e[r=a[t]])!==void 0)if(Vc(n)===n&&n>=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(no+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(no+r+": "+n);return this}var wE=V9(Zxe);Qr=new wE(1);const et=wE;function ebe(e){return abe(e)||nbe(e)||rbe(e)||tbe()}function tbe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
541
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rbe(e,t){if(e){if(typeof e=="string")return bk(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 bk(e,t)}}function nbe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function abe(e){if(Array.isArray(e))return bk(e)}function bk(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 ibe=function(t){return t},q9={},U9=function(t){return t===q9},XI=function(t){return function r(){return arguments.length===0||arguments.length===1&&U9(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},sbe=function e(t,r){return t===1?r:XI(function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var s=a.filter(function(o){return o!==q9}).length;return s>=t?r.apply(void 0,a):e(t-s,XI(function(){for(var o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];var d=a.map(function(f){return U9(f)?l.shift():f});return r.apply(void 0,ebe(d).concat(l))}))})},Ag=function(t){return sbe(t.length,t)},wk=function(t,r){for(var n=[],a=t;a<r;++a)n[a-t]=a;return n},obe=Ag(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),lbe=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return ibe;var a=r.reverse(),i=a[0],s=a.slice(1);return function(){return s.reduce(function(o,l){return l(o)},i.apply(void 0,arguments))}},jk=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},H9=function(t){var r=null,n=null;return function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return r&&i.every(function(o,l){return o===r[l]})||(r=i,n=t.apply(void 0,i)),n}};function cbe(e){var t;return e===0?t=1:t=Math.floor(new et(e).abs().log(10).toNumber())+1,t}function ube(e,t,r){for(var n=new et(e),a=0,i=[];n.lt(t)&&a<1e5;)i.push(n.toNumber()),n=n.add(r),a++;return i}var dbe=Ag(function(e,t,r){var n=+e,a=+t;return n+r*(a-n)}),fbe=Ag(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),hbe=Ag(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const Tg={rangeStep:ube,getDigitCount:cbe,interpolateNumber:dbe,uninterpolateNumber:fbe,uninterpolateTruncation:hbe};function Sk(e){return gbe(e)||mbe(e)||W9(e)||pbe()}function pbe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
542
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mbe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function gbe(e){if(Array.isArray(e))return kk(e)}function Xd(e,t){return xbe(e)||vbe(e,t)||W9(e,t)||ybe()}function ybe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
543
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W9(e,t){if(e){if(typeof e=="string")return kk(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 kk(e,t)}}function kk(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 vbe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var s=e[Symbol.iterator](),o;!(n=(o=s.next()).done)&&(r.push(o.value),!(t&&r.length===t));n=!0);}catch(l){a=!0,i=l}finally{try{!n&&s.return!=null&&s.return()}finally{if(a)throw i}}return r}}function xbe(e){if(Array.isArray(e))return e}function G9(e){var t=Xd(e,2),r=t[0],n=t[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function K9(e,t,r){if(e.lte(0))return new et(0);var n=Tg.getDigitCount(e.toNumber()),a=new et(10).pow(n),i=e.div(a),s=n!==1?.05:.1,o=new et(Math.ceil(i.div(s).toNumber())).add(r).mul(s),l=o.mul(a);return t?l:new et(Math.ceil(l))}function bbe(e,t,r){var n=1,a=new et(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new et(10).pow(Tg.getDigitCount(e)-1),a=new et(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new et(Math.floor(e)))}else e===0?a=new et(Math.floor((t-1)/2)):r||(a=new et(Math.floor(e)));var s=Math.floor((t-1)/2),o=lbe(obe(function(l){return a.add(new et(l-s).mul(n)).toNumber()}),wk);return o(0,t)}function Y9(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new et(0),tickMin:new et(0),tickMax:new et(0)};var i=K9(new et(t).sub(e).div(r-1),n,a),s;e<=0&&t>=0?s=new et(0):(s=new et(e).add(t).div(2),s=s.sub(new et(s).mod(i)));var o=Math.ceil(s.sub(e).div(i).toNumber()),l=Math.ceil(new et(t).sub(s).div(i).toNumber()),c=o+l+1;return c>r?Y9(e,t,r,n,a+1):(c<r&&(l=t>0?l+(r-c):l,o=t>0?o:o+(r-c)),{step:i,tickMin:s.sub(new et(o).mul(i)),tickMax:s.add(new et(l).mul(i))})}function wbe(e){var t=Xd(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(a,2),o=G9([r,n]),l=Xd(o,2),c=l[0],d=l[1];if(c===-1/0||d===1/0){var f=d===1/0?[c].concat(Sk(wk(0,a-1).map(function(){return 1/0}))):[].concat(Sk(wk(0,a-1).map(function(){return-1/0})),[d]);return r>n?jk(f):f}if(c===d)return bbe(c,a,i);var h=Y9(c,d,s,i),p=h.step,g=h.tickMin,m=h.tickMax,b=Tg.rangeStep(g,m.add(new et(.1).mul(p)),p);return r>n?jk(b):b}function jbe(e,t){var r=Xd(e,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=G9([n,a]),o=Xd(s,2),l=o[0],c=o[1];if(l===-1/0||c===1/0)return[n,a];if(l===c)return[l];var d=Math.max(t,2),f=K9(new et(c).sub(l).div(d-1),i,0),h=[].concat(Sk(Tg.rangeStep(new et(l),new et(c).sub(new et(.99).mul(f)),f)),[c]);return n>a?jk(h):h}var Sbe=H9(wbe),kbe=H9(jbe),_be="Invariant failed";function wo(e,t){throw new Error(_be)}var Nbe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function sc(e){"@babel/helpers - typeof";return sc=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},sc(e)}function zm(){return zm=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},zm.apply(this,arguments)}function Ebe(e,t){return Tbe(e)||Abe(e,t)||Cbe(e,t)||Pbe()}function Pbe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
544
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cbe(e,t){if(e){if(typeof e=="string")return ZI(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 ZI(e,t)}}function ZI(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 Abe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,o=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(l=(n=i.call(r)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(d){c=!0,a=d}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return o}}function Tbe(e){if(Array.isArray(e))return e}function Obe(e,t){if(e==null)return{};var r=Mbe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Mbe(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 Rbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $be(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,Q9(n.key),n)}}function Dbe(e,t,r){return t&&$be(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ibe(e,t,r){return t=Fm(t),Lbe(e,X9()?Reflect.construct(t,r||[],Fm(e).constructor):t.apply(e,r))}function Lbe(e,t){if(t&&(sc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zbe(e)}function zbe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function X9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(X9=function(){return!!e})()}function Fm(e){return Fm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Fm(e)}function Fbe(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&&_k(e,t)}function _k(e,t){return _k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},_k(e,t)}function Z9(e,t,r){return t=Q9(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Q9(e){var t=Bbe(e,"string");return sc(t)=="symbol"?t:t+""}function Bbe(e,t){if(sc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(sc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var qf=function(e){function t(){return Rbe(this,t),Ibe(this,t,arguments)}return Fbe(t,e),Dbe(t,[{key:"render",value:function(){var n=this.props,a=n.offset,i=n.layout,s=n.width,o=n.dataKey,l=n.data,c=n.dataPointFormatter,d=n.xAxis,f=n.yAxis,h=Obe(n,Nbe),p=Ie(h,!1);this.props.direction==="x"&&d.type!=="number"&&wo();var g=l.map(function(m){var b=c(m,o),x=b.x,y=b.y,v=b.value,w=b.errorVal;if(!w)return null;var j=[],k,S;if(Array.isArray(w)){var N=Ebe(w,2);k=N[0],S=N[1]}else k=S=w;if(i==="vertical"){var E=d.scale,A=y+a,C=A+s,M=A-s,T=E(v-k),P=E(v+S);j.push({x1:P,y1:C,x2:P,y2:M}),j.push({x1:T,y1:A,x2:P,y2:A}),j.push({x1:T,y1:C,x2:T,y2:M})}else if(i==="horizontal"){var D=f.scale,$=x+a,L=$-s,I=$+s,R=D(v-k),z=D(v+S);j.push({x1:L,y1:z,x2:I,y2:z}),j.push({x1:$,y1:R,x2:$,y2:z}),j.push({x1:L,y1:R,x2:I,y2:R})}return O.createElement(It,zm({className:"recharts-errorBar",key:"bar-".concat(j.map(function(V){return"".concat(V.x1,"-").concat(V.x2,"-").concat(V.y1,"-").concat(V.y2)}))},p),j.map(function(V){return O.createElement("line",zm({},V,{key:"line-".concat(V.x1,"-").concat(V.x2,"-").concat(V.y1,"-").concat(V.y2)}))}))});return O.createElement(It,{className:"recharts-errorBars"},g)}}])}(O.Component);Z9(qf,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});Z9(qf,"displayName","ErrorBar");function Zd(e){"@babel/helpers - typeof";return Zd=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},Zd(e)}function QI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ps(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QI(Object(r),!0).forEach(function(n){Vbe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vbe(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=Ube(e,"string");return Zd(t)=="symbol"?t:t+""}function Ube(e,t){if(Zd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Zd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var J9=function(t){var r=t.children,n=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,s=Yr(r,ro);if(!s)return null;var o=ro.defaultProps,l=o!==void 0?Ps(Ps({},o),s.props):{},c;return s.props&&s.props.payload?c=s.props&&s.props.payload:i==="children"?c=(n||[]).reduce(function(d,f){var h=f.item,p=f.props,g=p.sectors||p.data||[];return d.concat(g.map(function(m){return{type:s.props.iconType||h.props.legendType,value:m.name,color:m.fill,payload:m}}))},[]):c=(n||[]).map(function(d){var f=d.item,h=f.type.defaultProps,p=h!==void 0?Ps(Ps({},h),f.props):{},g=p.dataKey,m=p.name,b=p.legendType,x=p.hide;return{inactive:x,dataKey:g,type:l.iconType||b||"square",color:jE(f),value:m||g,payload:p}}),Ps(Ps(Ps({},l),ro.getWithHeight(s,a)),{},{payload:c,item:s})};function Qd(e){"@babel/helpers - typeof";return Qd=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},Qd(e)}function JI(e){return Kbe(e)||Gbe(e)||Wbe(e)||Hbe()}function Hbe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
545
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wbe(e,t){if(e){if(typeof e=="string")return Nk(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 Nk(e,t)}}function Gbe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Kbe(e){if(Array.isArray(e))return Nk(e)}function Nk(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 e5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Tt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?e5(Object(r),!0).forEach(function(n){Ml(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):e5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ml(e,t,r){return t=Ybe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ybe(e){var t=Xbe(e,"string");return Qd(t)=="symbol"?t:t+""}function Xbe(e,t){if(Qd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Qd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nn(e,t,r){return Re(e)||Re(t)?r:Jt(t)?Nn(e,t,r):Ce(t)?t(e):r}function nd(e,t,r,n){var a=Gxe(e,function(o){return nn(o,t)});if(r==="number"){var i=a.filter(function(o){return J(o)||parseFloat(o)});return i.length?[Pg(i),Eg(i)]:[1/0,-1/0]}var s=n?a.filter(function(o){return!Re(o)}):a;return s.map(function(o){return Jt(o)||o instanceof Date?o:""})}var Zbe=function(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,s=-1,o=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(o<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var l=i.range,c=0;c<o;c++){var d=c>0?a[c-1].coordinate:a[o-1].coordinate,f=a[c].coordinate,h=c>=o-1?a[0].coordinate:a[c+1].coordinate,p=void 0;if(Zn(f-d)!==Zn(h-f)){var g=[];if(Zn(h-f)===Zn(l[1]-l[0])){p=h;var m=f+l[1]-l[0];g[0]=Math.min(m,(m+d)/2),g[1]=Math.max(m,(m+d)/2)}else{p=d;var b=h+l[1]-l[0];g[0]=Math.min(f,(b+f)/2),g[1]=Math.max(f,(b+f)/2)}var x=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>x[0]&&t<=x[1]||t>=g[0]&&t<=g[1]){s=a[c].index;break}}else{var y=Math.min(d,h),v=Math.max(d,h);if(t>(y+f)/2&&t<=(v+f)/2){s=a[c].index;break}}}else for(var w=0;w<o;w++)if(w===0&&t<=(n[w].coordinate+n[w+1].coordinate)/2||w>0&&w<o-1&&t>(n[w].coordinate+n[w-1].coordinate)/2&&t<=(n[w].coordinate+n[w+1].coordinate)/2||w===o-1&&t>(n[w].coordinate+n[w-1].coordinate)/2){s=n[w].index;break}return s},jE=function(t){var r,n=t,a=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Tt(Tt({},t.type.defaultProps),t.props):t.props,s=i.stroke,o=i.fill,l;switch(a){case"Line":l=s;break;case"Area":case"Radar":l=s&&s!=="none"?s:o;break;default:l=o;break}return l},Qbe=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var s={},o=Object.keys(i),l=0,c=o.length;l<c;l++)for(var d=i[o[l]].stackGroups,f=Object.keys(d),h=0,p=f.length;h<p;h++){var g=d[f[h]],m=g.items,b=g.cateAxisId,x=m.filter(function(S){return Wa(S.type).indexOf("Bar")>=0});if(x&&x.length){var y=x[0].type.defaultProps,v=y!==void 0?Tt(Tt({},y),x[0].props):x[0].props,w=v.barSize,j=v[b];s[j]||(s[j]=[]);var k=Re(w)?r:w;s[j].push({item:x[0],stackList:x.slice(1),barSize:Re(k)?void 0:xo(k,n,0)})}}return s},Jbe=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,i=t.sizeList,s=i===void 0?[]:i,o=t.maxBarSize,l=s.length;if(l<1)return null;var c=xo(r,a,0,!0),d,f=[];if(s[0].barSize===+s[0].barSize){var h=!1,p=a/l,g=s.reduce(function(w,j){return w+j.barSize||0},0);g+=(l-1)*c,g>=a&&(g-=(l-1)*c,c=0),g>=a&&p>0&&(h=!0,p*=.9,g=l*p);var m=(a-g)/2>>0,b={offset:m-c,size:0};d=s.reduce(function(w,j){var k={item:j.item,position:{offset:b.offset+b.size+c,size:h?p:j.barSize}},S=[].concat(JI(w),[k]);return b=S[S.length-1].position,j.stackList&&j.stackList.length&&j.stackList.forEach(function(N){S.push({item:N,position:b})}),S},f)}else{var x=xo(n,a,0,!0);a-2*x-(l-1)*c<=0&&(c=0);var y=(a-2*x-(l-1)*c)/l;y>1&&(y>>=0);var v=o===+o?Math.min(y,o):y;d=s.reduce(function(w,j,k){var S=[].concat(JI(w),[{item:j.item,position:{offset:x+(y+c)*k+(y-v)/2,size:v}}]);return j.stackList&&j.stackList.length&&j.stackList.forEach(function(N){S.push({item:N,position:S[S.length-1].position})}),S},f)}return d},ewe=function(t,r,n,a){var i=n.children,s=n.width,o=n.margin,l=s-(o.left||0)-(o.right||0),c=J9({children:i,legendWidth:l});if(c){var d=a||{},f=d.width,h=d.height,p=c.align,g=c.verticalAlign,m=c.layout;if((m==="vertical"||m==="horizontal"&&g==="middle")&&p!=="center"&&J(t[p]))return Tt(Tt({},t),{},Ml({},p,t[p]+(f||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&g!=="middle"&&J(t[g]))return Tt(Tt({},t),{},Ml({},g,t[g]+(h||0)))}return t},twe=function(t,r,n){return Re(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},eV=function(t,r,n,a,i){var s=r.props.children,o=En(s,qf).filter(function(c){return twe(a,i,c.props.direction)});if(o&&o.length){var l=o.map(function(c){return c.props.dataKey});return t.reduce(function(c,d){var f=nn(d,n);if(Re(f))return c;var h=Array.isArray(f)?[Pg(f),Eg(f)]:[f,f],p=l.reduce(function(g,m){var b=nn(d,m,0),x=h[0]-Math.abs(Array.isArray(b)?b[0]:b),y=h[1]+Math.abs(Array.isArray(b)?b[1]:b);return[Math.min(x,g[0]),Math.max(y,g[1])]},[1/0,-1/0]);return[Math.min(p[0],c[0]),Math.max(p[1],c[1])]},[1/0,-1/0])}return null},rwe=function(t,r,n,a,i){var s=r.map(function(o){return eV(t,o,n,i,a)}).filter(function(o){return!Re(o)});return s&&s.length?s.reduce(function(o,l){return[Math.min(o[0],l[0]),Math.max(o[1],l[1])]},[1/0,-1/0]):null},tV=function(t,r,n,a,i){var s=r.map(function(l){var c=l.props.dataKey;return n==="number"&&c&&eV(t,l,c,a)||nd(t,c,n,i)});if(n==="number")return s.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var o={};return s.reduce(function(l,c){for(var d=0,f=c.length;d<f;d++)o[c[d]]||(o[c[d]]=!0,l.push(c[d]));return l},[])},rV=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},nV=function(t,r,n,a){if(a)return t.map(function(l){return l.coordinate});var i,s,o=t.map(function(l){return l.coordinate===r&&(i=!0),l.coordinate===n&&(s=!0),l.coordinate});return i||o.push(r),s||o.push(n),o},Ba=function(t,r,n){if(!t)return null;var a=t.scale,i=t.duplicateDomain,s=t.type,o=t.range,l=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,c=(r||n)&&s==="category"&&a.bandwidth?a.bandwidth()/l:0;if(c=t.axisType==="angleAxis"&&(o==null?void 0:o.length)>=2?Zn(o[0]-o[1])*2*c:c,r&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=i?i.indexOf(f):f;return{coordinate:a(h)+c,value:f,offset:c}});return d.filter(function(f){return!Lf(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:a(f)+c,value:f,index:h,offset:c}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(f){return{coordinate:a(f)+c,value:f,offset:c}}):a.domain().map(function(f,h){return{coordinate:a(f)+c,value:i?i[f]:f,index:h,offset:c}})},Z1=new WeakMap,Bh=function(t,r){if(typeof r!="function")return t;Z1.has(t)||Z1.set(t,new WeakMap);var n=Z1.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},nwe=function(t,r,n){var a=t.scale,i=t.type,s=t.layout,o=t.axisType;if(a==="auto")return s==="radial"&&o==="radiusAxis"?{scale:Gd(),realScaleType:"band"}:s==="radial"&&o==="angleAxis"?{scale:Rm(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:rd(),realScaleType:"point"}:i==="category"?{scale:Gd(),realScaleType:"band"}:{scale:Rm(),realScaleType:"linear"};if(vo(a)){var l="scale".concat(gg(a));return{scale:(GI[l]||rd)(),realScaleType:GI[l]?l:"point"}}return Ce(a)?{scale:a}:{scale:rd(),realScaleType:"point"}},t5=1e-4,awe=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),i=Math.min(a[0],a[1])-t5,s=Math.max(a[0],a[1])+t5,o=t(r[0]),l=t(r[n-1]);(o<i||o>s||l<i||l>s)&&t.domain([r[0],r[n-1]])}},iwe=function(t,r){if(!t)return null;for(var n=0,a=t.length;n<a;n++)if(t[n].item===r)return t[n].position;return null},swe=function(t,r){if(!r||r.length!==2||!J(r[0])||!J(r[1]))return t;var n=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]),i=[t[0],t[1]];return(!J(t[0])||t[0]<n)&&(i[0]=n),(!J(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<n&&(i[1]=n),i},owe=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,s=0,o=0;o<r;++o){var l=Lf(t[o][n][1])?t[o][n][0]:t[o][n][1];l>=0?(t[o][n][0]=i,t[o][n][1]=i+l,i=t[o][n][1]):(t[o][n][0]=s,t[o][n][1]=s+l,s=t[o][n][1])}},lwe=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,s=0;s<r;++s){var o=Lf(t[s][n][1])?t[s][n][0]:t[s][n][1];o>=0?(t[s][n][0]=i,t[s][n][1]=i+o,i=t[s][n][1]):(t[s][n][0]=0,t[s][n][1]=0)}},cwe={sign:owe,expand:b0e,none:Ql,silhouette:w0e,wiggle:j0e,positive:lwe},uwe=function(t,r,n){var a=r.map(function(o){return o.props.dataKey}),i=cwe[n],s=x0e().keys(a).value(function(o,l){return+nn(o,l,0)}).order(ak).offset(i);return s(t)},dwe=function(t,r,n,a,i,s){if(!t)return null;var o=s?r.reverse():r,l={},c=o.reduce(function(f,h){var p,g=(p=h.type)!==null&&p!==void 0&&p.defaultProps?Tt(Tt({},h.type.defaultProps),h.props):h.props,m=g.stackId,b=g.hide;if(b)return f;var x=g[n],y=f[x]||{hasStack:!1,stackGroups:{}};if(Jt(m)){var v=y.stackGroups[m]||{numericAxisId:n,cateAxisId:a,items:[]};v.items.push(h),y.hasStack=!0,y.stackGroups[m]=v}else y.stackGroups[zf("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[h]};return Tt(Tt({},f),{},Ml({},x,y))},l),d={};return Object.keys(c).reduce(function(f,h){var p=c[h];if(p.hasStack){var g={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(m,b){var x=p.stackGroups[b];return Tt(Tt({},m),{},Ml({},b,{numericAxisId:n,cateAxisId:a,items:x.items,stackedData:uwe(t,x.items,i)}))},g)}return Tt(Tt({},f),{},Ml({},h,p))},d)},fwe=function(t,r){var n=r.realScaleType,a=r.type,i=r.tickCount,s=r.originalDomain,o=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(i&&a==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var c=t.domain();if(!c.length)return null;var d=Sbe(c,i,o);return t.domain([Pg(d),Eg(d)]),{niceTicks:d}}if(i&&a==="number"){var f=t.domain(),h=kbe(f,i,o);return{niceTicks:h}}return null};function r5(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,i=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Re(a[t.dataKey])){var o=ym(r,"value",a[t.dataKey]);if(o)return o.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var l=nn(a,Re(s)?t.dataKey:s);return Re(l)?null:t.scale(l)}var n5=function(t){var r=t.axis,n=t.ticks,a=t.offset,i=t.bandSize,s=t.entry,o=t.index;if(r.type==="category")return n[o]?n[o].coordinate+a:null;var l=nn(s,r.dataKey,r.domain[o]);return Re(l)?null:r.scale(l)-i/2+a},hwe=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return a<=0&&i>=0?0:i<0?i:a}return n[0]},pwe=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Tt(Tt({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(Jt(i)){var s=r[i];if(s){var o=s.items.indexOf(t);return o>=0?s.stackedData[o]:null}}return null},mwe=function(t){return t.reduce(function(r,n){return[Pg(n.concat([r[0]]).filter(J)),Eg(n.concat([r[1]]).filter(J))]},[1/0,-1/0])},aV=function(t,r,n){return Object.keys(t).reduce(function(a,i){var s=t[i],o=s.stackedData,l=o.reduce(function(c,d){var f=mwe(d.slice(r,n+1));return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],a[0]),Math.max(l[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},a5=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,i5=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ek=function(t,r,n){if(Ce(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(J(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(a5.test(t[0])){var i=+a5.exec(t[0])[1];a[0]=r[0]-i}else Ce(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(J(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(i5.test(t[1])){var s=+i5.exec(t[1])[1];a[1]=r[1]+s}else Ce(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},Bm=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var i=JN(r,function(f){return f.coordinate}),s=1/0,o=1,l=i.length;o<l;o++){var c=i[o],d=i[o-1];s=Math.min((c.coordinate||0)-(d.coordinate||0),s)}return s===1/0?0:s}return n?void 0:0},s5=function(t,r,n){return!t||!t.length||Cg(t,Nn(n,"type.defaultProps.domain"))?r:t},iV=function(t,r){var n=t.type.defaultProps?Tt(Tt({},t.type.defaultProps),t.props):t.props,a=n.dataKey,i=n.name,s=n.unit,o=n.formatter,l=n.tooltipType,c=n.chartType,d=n.hide;return Tt(Tt({},Ie(t,!1)),{},{dataKey:a,unit:s,formatter:o,name:i||a,color:jE(t),value:nn(r,a),type:l,payload:r,chartType:c,hide:d})};function Jd(e){"@babel/helpers - typeof";return Jd=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},Jd(e)}function o5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function l5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?o5(Object(r),!0).forEach(function(n){gwe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gwe(e,t,r){return t=ywe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ywe(e){var t=vwe(e,"string");return Jd(t)=="symbol"?t:t+""}function vwe(e,t){if(Jd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Jd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Vm=Math.PI/180,xwe=function(t){return t*180/Math.PI},fr=function(t,r,n,a){return{x:t+Math.cos(-Vm*a)*n,y:r+Math.sin(-Vm*a)*n}},bwe=function(t,r){var n=t.x,a=t.y,i=r.x,s=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-s,2))},wwe=function(t,r){var n=t.x,a=t.y,i=r.cx,s=r.cy,o=bwe({x:n,y:a},{x:i,y:s});if(o<=0)return{radius:o};var l=(n-i)/o,c=Math.acos(l);return a>s&&(c=2*Math.PI-c),{radius:o,angle:xwe(c),angleInRadian:c}},jwe=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),s=Math.min(a,i);return{startAngle:r-s*360,endAngle:n-s*360}},Swe=function(t,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),s=Math.floor(a/360),o=Math.min(i,s);return t+o*360},c5=function(t,r){var n=t.x,a=t.y,i=wwe({x:n,y:a},r),s=i.radius,o=i.angle,l=r.innerRadius,c=r.outerRadius;if(s<l||s>c)return!1;if(s===0)return!0;var d=jwe(r),f=d.startAngle,h=d.endAngle,p=o,g;if(f<=h){for(;p>h;)p-=360;for(;p<f;)p+=360;g=p>=f&&p<=h}else{for(;p>f;)p-=360;for(;p<h;)p+=360;g=p>=h&&p<=f}return g?l5(l5({},r),{},{radius:s,angle:Swe(p,r)}):null};function ef(e){"@babel/helpers - typeof";return ef=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},ef(e)}var kwe=["offset"];function _we(e){return Cwe(e)||Pwe(e)||Ewe(e)||Nwe()}function Nwe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
546
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ewe(e,t){if(e){if(typeof e=="string")return Pk(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 Pk(e,t)}}function Pwe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Cwe(e){if(Array.isArray(e))return Pk(e)}function Pk(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 Awe(e,t){if(e==null)return{};var r=Twe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Twe(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 u5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Xt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?u5(Object(r),!0).forEach(function(n){Owe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Owe(e,t,r){return t=Mwe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mwe(e){var t=Rwe(e,"string");return ef(t)=="symbol"?t:t+""}function Rwe(e,t){if(ef(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ef(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tf(){return tf=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},tf.apply(this,arguments)}var $we=function(t){var r=t.value,n=t.formatter,a=Re(t.children)?r:t.children;return Ce(n)?n(a):a},Dwe=function(t,r){var n=Zn(r-t),a=Math.min(Math.abs(r-t),360);return n*a},Iwe=function(t,r,n){var a=t.position,i=t.viewBox,s=t.offset,o=t.className,l=i,c=l.cx,d=l.cy,f=l.innerRadius,h=l.outerRadius,p=l.startAngle,g=l.endAngle,m=l.clockWise,b=(f+h)/2,x=Dwe(p,g),y=x>=0?1:-1,v,w;a==="insideStart"?(v=p+y*s,w=m):a==="insideEnd"?(v=g-y*s,w=!m):a==="end"&&(v=g+y*s,w=m),w=x<=0?w:!w;var j=fr(c,d,b,v),k=fr(c,d,b,v+(w?1:-1)*359),S="M".concat(j.x,",").concat(j.y,`
547
- A`).concat(b,",").concat(b,",0,1,").concat(w?0:1,`,
548
- `).concat(k.x,",").concat(k.y),N=Re(t.id)?zf("recharts-radial-line-"):t.id;return O.createElement("text",tf({},n,{dominantBaseline:"central",className:Fe("recharts-radial-bar-label",o)}),O.createElement("defs",null,O.createElement("path",{id:N,d:S})),O.createElement("textPath",{xlinkHref:"#".concat(N)},r))},Lwe=function(t){var r=t.viewBox,n=t.offset,a=t.position,i=r,s=i.cx,o=i.cy,l=i.innerRadius,c=i.outerRadius,d=i.startAngle,f=i.endAngle,h=(d+f)/2;if(a==="outside"){var p=fr(s,o,c+n,h),g=p.x,m=p.y;return{x:g,y:m,textAnchor:g>=s?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:s,y:o,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:s,y:o,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:s,y:o,textAnchor:"middle",verticalAnchor:"end"};var b=(l+c)/2,x=fr(s,o,b,h),y=x.x,v=x.y;return{x:y,y:v,textAnchor:"middle",verticalAnchor:"middle"}},zwe=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,i=t.position,s=r,o=s.x,l=s.y,c=s.width,d=s.height,f=d>=0?1:-1,h=f*a,p=f>0?"end":"start",g=f>0?"start":"end",m=c>=0?1:-1,b=m*a,x=m>0?"end":"start",y=m>0?"start":"end";if(i==="top"){var v={x:o+c/2,y:l-f*a,textAnchor:"middle",verticalAnchor:p};return Xt(Xt({},v),n?{height:Math.max(l-n.y,0),width:c}:{})}if(i==="bottom"){var w={x:o+c/2,y:l+d+h,textAnchor:"middle",verticalAnchor:g};return Xt(Xt({},w),n?{height:Math.max(n.y+n.height-(l+d),0),width:c}:{})}if(i==="left"){var j={x:o-b,y:l+d/2,textAnchor:x,verticalAnchor:"middle"};return Xt(Xt({},j),n?{width:Math.max(j.x-n.x,0),height:d}:{})}if(i==="right"){var k={x:o+c+b,y:l+d/2,textAnchor:y,verticalAnchor:"middle"};return Xt(Xt({},k),n?{width:Math.max(n.x+n.width-k.x,0),height:d}:{})}var S=n?{width:c,height:d}:{};return i==="insideLeft"?Xt({x:o+b,y:l+d/2,textAnchor:y,verticalAnchor:"middle"},S):i==="insideRight"?Xt({x:o+c-b,y:l+d/2,textAnchor:x,verticalAnchor:"middle"},S):i==="insideTop"?Xt({x:o+c/2,y:l+h,textAnchor:"middle",verticalAnchor:g},S):i==="insideBottom"?Xt({x:o+c/2,y:l+d-h,textAnchor:"middle",verticalAnchor:p},S):i==="insideTopLeft"?Xt({x:o+b,y:l+h,textAnchor:y,verticalAnchor:g},S):i==="insideTopRight"?Xt({x:o+c-b,y:l+h,textAnchor:x,verticalAnchor:g},S):i==="insideBottomLeft"?Xt({x:o+b,y:l+d-h,textAnchor:y,verticalAnchor:p},S):i==="insideBottomRight"?Xt({x:o+c-b,y:l+d-h,textAnchor:x,verticalAnchor:p},S):zc(i)&&(J(i.x)||Gs(i.x))&&(J(i.y)||Gs(i.y))?Xt({x:o+xo(i.x,c),y:l+xo(i.y,d),textAnchor:"end",verticalAnchor:"end"},S):Xt({x:o+c/2,y:l+d/2,textAnchor:"middle",verticalAnchor:"middle"},S)},Fwe=function(t){return"cx"in t&&J(t.cx)};function jr(e){var t=e.offset,r=t===void 0?5:t,n=Awe(e,kwe),a=Xt({offset:r},n),i=a.viewBox,s=a.position,o=a.value,l=a.children,c=a.content,d=a.className,f=d===void 0?"":d,h=a.textBreakAll;if(!i||Re(o)&&Re(l)&&!_.isValidElement(c)&&!Ce(c))return null;if(_.isValidElement(c))return _.cloneElement(c,a);var p;if(Ce(c)){if(p=_.createElement(c,a),_.isValidElement(p))return p}else p=$we(a);var g=Fwe(i),m=Ie(a,!0);if(g&&(s==="insideStart"||s==="insideEnd"||s==="end"))return Iwe(a,p,m);var b=g?Lwe(a):zwe(a);return O.createElement(Am,tf({className:Fe("recharts-label",f)},m,b,{breakAll:h}),p)}jr.displayName="Label";var sV=function(t){var r=t.cx,n=t.cy,a=t.angle,i=t.startAngle,s=t.endAngle,o=t.r,l=t.radius,c=t.innerRadius,d=t.outerRadius,f=t.x,h=t.y,p=t.top,g=t.left,m=t.width,b=t.height,x=t.clockWise,y=t.labelViewBox;if(y)return y;if(J(m)&&J(b)){if(J(f)&&J(h))return{x:f,y:h,width:m,height:b};if(J(p)&&J(g))return{x:p,y:g,width:m,height:b}}return J(f)&&J(h)?{x:f,y:h,width:0,height:0}:J(r)&&J(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:s||a||0,innerRadius:c||0,outerRadius:d||l||o||0,clockWise:x}:t.viewBox?t.viewBox:{}},Bwe=function(t,r){return t?t===!0?O.createElement(jr,{key:"label-implicit",viewBox:r}):Jt(t)?O.createElement(jr,{key:"label-implicit",viewBox:r,value:t}):_.isValidElement(t)?t.type===jr?_.cloneElement(t,{key:"label-implicit",viewBox:r}):O.createElement(jr,{key:"label-implicit",content:t,viewBox:r}):Ce(t)?O.createElement(jr,{key:"label-implicit",content:t,viewBox:r}):zc(t)?O.createElement(jr,tf({viewBox:r},t,{key:"label-implicit"})):null:null},Vwe=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 a=t.children,i=sV(t),s=En(a,jr).map(function(l,c){return _.cloneElement(l,{viewBox:r||i,key:"label-".concat(c)})});if(!n)return s;var o=Bwe(t.label,r||i);return[o].concat(_we(s))};jr.parseViewBox=sV;jr.renderCallByParent=Vwe;var qwe=UB();const Uwe=Ke(qwe);function rf(e){"@babel/helpers - typeof";return rf=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},rf(e)}var Hwe=["valueAccessor"],Wwe=["data","dataKey","clockWise","id","textBreakAll"];function Gwe(e){return Zwe(e)||Xwe(e)||Ywe(e)||Kwe()}function Kwe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
549
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ywe(e,t){if(e){if(typeof e=="string")return Ck(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 Ck(e,t)}}function Xwe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Zwe(e){if(Array.isArray(e))return Ck(e)}function Ck(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 qm(){return qm=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},qm.apply(this,arguments)}function d5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function f5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?d5(Object(r),!0).forEach(function(n){Qwe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qwe(e,t,r){return t=Jwe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jwe(e){var t=e1e(e,"string");return rf(t)=="symbol"?t:t+""}function e1e(e,t){if(rf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(rf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function h5(e,t){if(e==null)return{};var r=t1e(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function t1e(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 r1e=function(t){return Array.isArray(t.value)?Uwe(t.value):t.value};function rs(e){var t=e.valueAccessor,r=t===void 0?r1e:t,n=h5(e,Hwe),a=n.data,i=n.dataKey,s=n.clockWise,o=n.id,l=n.textBreakAll,c=h5(n,Wwe);return!a||!a.length?null:O.createElement(It,{className:"recharts-label-list"},a.map(function(d,f){var h=Re(i)?r(d,f):nn(d&&d.payload,i),p=Re(o)?{}:{id:"".concat(o,"-").concat(f)};return O.createElement(jr,qm({},Ie(d,!0),c,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:l,viewBox:jr.parseViewBox(Re(s)?d:f5(f5({},d),{},{clockWise:s})),key:"label-".concat(f),index:f}))}))}rs.displayName="LabelList";function n1e(e,t){return e?e===!0?O.createElement(rs,{key:"labelList-implicit",data:t}):O.isValidElement(e)||Ce(e)?O.createElement(rs,{key:"labelList-implicit",data:t,content:e}):zc(e)?O.createElement(rs,qm({data:t},e,{key:"labelList-implicit"})):null:null}function a1e(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,a=En(n,rs).map(function(s,o){return _.cloneElement(s,{data:t,key:"labelList-".concat(o)})});if(!r)return a;var i=n1e(e.label,t);return[i].concat(Gwe(a))}rs.renderCallByParent=a1e;function nf(e){"@babel/helpers - typeof";return nf=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},nf(e)}function Ak(){return Ak=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},Ak.apply(this,arguments)}function p5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function m5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?p5(Object(r),!0).forEach(function(n){i1e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function i1e(e,t,r){return t=s1e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s1e(e){var t=o1e(e,"string");return nf(t)=="symbol"?t:t+""}function o1e(e,t){if(nf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(nf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var l1e=function(t,r){var n=Zn(r-t),a=Math.min(Math.abs(r-t),359.999);return n*a},Vh=function(t){var r=t.cx,n=t.cy,a=t.radius,i=t.angle,s=t.sign,o=t.isExternal,l=t.cornerRadius,c=t.cornerIsExternal,d=l*(o?1:-1)+a,f=Math.asin(l/d)/Vm,h=c?i:i+s*f,p=fr(r,n,d,h),g=fr(r,n,a,h),m=c?i-s*f:i,b=fr(r,n,d*Math.cos(f*Vm),m);return{center:p,circleTangency:g,lineTangency:b,theta:f}},oV=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,s=t.startAngle,o=t.endAngle,l=l1e(s,o),c=s+l,d=fr(r,n,i,s),f=fr(r,n,i,c),h="M ".concat(d.x,",").concat(d.y,`
550
- A `).concat(i,",").concat(i,`,0,
551
- `).concat(+(Math.abs(l)>180),",").concat(+(s>c),`,
552
- `).concat(f.x,",").concat(f.y,`
553
- `);if(a>0){var p=fr(r,n,a,s),g=fr(r,n,a,c);h+="L ".concat(g.x,",").concat(g.y,`
554
- A `).concat(a,",").concat(a,`,0,
555
- `).concat(+(Math.abs(l)>180),",").concat(+(s<=c),`,
556
- `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},c1e=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,s=t.cornerRadius,o=t.forceCornerRadius,l=t.cornerIsExternal,c=t.startAngle,d=t.endAngle,f=Zn(d-c),h=Vh({cx:r,cy:n,radius:i,angle:c,sign:f,cornerRadius:s,cornerIsExternal:l}),p=h.circleTangency,g=h.lineTangency,m=h.theta,b=Vh({cx:r,cy:n,radius:i,angle:d,sign:-f,cornerRadius:s,cornerIsExternal:l}),x=b.circleTangency,y=b.lineTangency,v=b.theta,w=l?Math.abs(c-d):Math.abs(c-d)-m-v;if(w<0)return o?"M ".concat(g.x,",").concat(g.y,`
557
- a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0
558
- a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0
559
- `):oV({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:c,endAngle:d});var j="M ".concat(g.x,",").concat(g.y,`
560
- A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(p.x,",").concat(p.y,`
561
- A`).concat(i,",").concat(i,",0,").concat(+(w>180),",").concat(+(f<0),",").concat(x.x,",").concat(x.y,`
562
- A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(y.x,",").concat(y.y,`
563
- `);if(a>0){var k=Vh({cx:r,cy:n,radius:a,angle:c,sign:f,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),S=k.circleTangency,N=k.lineTangency,E=k.theta,A=Vh({cx:r,cy:n,radius:a,angle:d,sign:-f,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),C=A.circleTangency,M=A.lineTangency,T=A.theta,P=l?Math.abs(c-d):Math.abs(c-d)-E-T;if(P<0&&s===0)return"".concat(j,"L").concat(r,",").concat(n,"Z");j+="L".concat(M.x,",").concat(M.y,`
564
- A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(C.x,",").concat(C.y,`
565
- A`).concat(a,",").concat(a,",0,").concat(+(P>180),",").concat(+(f>0),",").concat(S.x,",").concat(S.y,`
566
- A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(N.x,",").concat(N.y,"Z")}else j+="L".concat(r,",").concat(n,"Z");return j},u1e={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},lV=function(t){var r=m5(m5({},u1e),t),n=r.cx,a=r.cy,i=r.innerRadius,s=r.outerRadius,o=r.cornerRadius,l=r.forceCornerRadius,c=r.cornerIsExternal,d=r.startAngle,f=r.endAngle,h=r.className;if(s<i||d===f)return null;var p=Fe("recharts-sector",h),g=s-i,m=xo(o,g,0,!0),b;return m>0&&Math.abs(d-f)<360?b=c1e({cx:n,cy:a,innerRadius:i,outerRadius:s,cornerRadius:Math.min(m,g/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:f}):b=oV({cx:n,cy:a,innerRadius:i,outerRadius:s,startAngle:d,endAngle:f}),O.createElement("path",Ak({},Ie(r,!0),{className:p,d:b,role:"img"}))};function af(e){"@babel/helpers - typeof";return af=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},af(e)}function Tk(){return Tk=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},Tk.apply(this,arguments)}function g5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function y5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?g5(Object(r),!0).forEach(function(n){d1e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function d1e(e,t,r){return t=f1e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f1e(e){var t=h1e(e,"string");return af(t)=="symbol"?t:t+""}function h1e(e,t){if(af(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(af(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var v5={curveBasisClosed:l0e,curveBasisOpen:c0e,curveBasis:o0e,curveBumpX:Gme,curveBumpY:Kme,curveLinearClosed:u0e,curveLinear:vg,curveMonotoneX:d0e,curveMonotoneY:f0e,curveNatural:h0e,curveStep:p0e,curveStepAfter:g0e,curveStepBefore:m0e},qh=function(t){return t.x===+t.x&&t.y===+t.y},vu=function(t){return t.x},xu=function(t){return t.y},p1e=function(t,r){if(Ce(t))return t;var n="curve".concat(gg(t));return(n==="curveMonotone"||n==="curveBump")&&r?v5["".concat(n).concat(r==="vertical"?"Y":"X")]:v5[n]||vg},m1e=function(t){var r=t.type,n=r===void 0?"linear":r,a=t.points,i=a===void 0?[]:a,s=t.baseLine,o=t.layout,l=t.connectNulls,c=l===void 0?!1:l,d=p1e(n,o),f=c?i.filter(function(m){return qh(m)}):i,h;if(Array.isArray(s)){var p=c?s.filter(function(m){return qh(m)}):s,g=f.map(function(m,b){return y5(y5({},m),{},{base:p[b]})});return o==="vertical"?h=Dh().y(xu).x1(vu).x0(function(m){return m.base.x}):h=Dh().x(vu).y1(xu).y0(function(m){return m.base.y}),h.defined(qh).curve(d),h(g)}return o==="vertical"&&J(s)?h=Dh().y(xu).x1(vu).x0(s):J(s)?h=Dh().x(vu).y1(xu).y0(s):h=$7().x(vu).y(xu),h.defined(qh).curve(d),h(f)},Ok=function(t){var r=t.className,n=t.points,a=t.path,i=t.pathRef;if((!n||!n.length)&&!a)return null;var s=n&&n.length?m1e(t):a;return _.createElement("path",Tk({},Ie(t,!1),vm(t),{className:Fe("recharts-curve",r),d:s,ref:i}))},cV={exports:{}},g1e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",y1e=g1e,v1e=y1e;function uV(){}function dV(){}dV.resetWarningCache=uV;var x1e=function(){function e(n,a,i,s,o,l){if(l!==v1e){var c=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 c.name="Invariant Violation",c}}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:dV,resetWarningCache:uV};return r.PropTypes=r,r};cV.exports=x1e();var b1e=cV.exports;const We=Ke(b1e);var w1e=Object.getOwnPropertyNames,j1e=Object.getOwnPropertySymbols,S1e=Object.prototype.hasOwnProperty;function x5(e,t){return function(n,a,i){return e(n,a,i)&&t(n,a,i)}}function Uh(e){return function(r,n,a){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,a);var i=a.cache,s=i.get(r),o=i.get(n);if(s&&o)return s===n&&o===r;i.set(r,n),i.set(n,r);var l=e(r,n,a);return i.delete(r),i.delete(n),l}}function k1e(e){return e!=null?e[Symbol.toStringTag]:void 0}function b5(e){return w1e(e).concat(j1e(e))}var _1e=Object.hasOwn||function(e,t){return S1e.call(e,t)};function Mo(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var N1e="__v",E1e="__o",P1e="_owner",w5=Object.getOwnPropertyDescriptor,j5=Object.keys;function C1e(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 A1e(e,t){return Mo(e.getTime(),t.getTime())}function T1e(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function O1e(e,t){return e===t}function S5(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var a=new Array(n),i=e.entries(),s,o,l=0;(s=i.next())&&!s.done;){for(var c=t.entries(),d=!1,f=0;(o=c.next())&&!o.done;){if(a[f]){f++;continue}var h=s.value,p=o.value;if(r.equals(h[0],p[0],l,f,e,t,r)&&r.equals(h[1],p[1],h[0],p[0],e,t,r)){d=a[f]=!0;break}f++}if(!d)return!1;l++}return!0}var M1e=Mo;function R1e(e,t,r){var n=j5(e),a=n.length;if(j5(t).length!==a)return!1;for(;a-- >0;)if(!fV(e,t,r,n[a]))return!1;return!0}function bu(e,t,r){var n=b5(e),a=n.length;if(b5(t).length!==a)return!1;for(var i,s,o;a-- >0;)if(i=n[a],!fV(e,t,r,i)||(s=w5(e,i),o=w5(t,i),(s||o)&&(!s||!o||s.configurable!==o.configurable||s.enumerable!==o.enumerable||s.writable!==o.writable)))return!1;return!0}function $1e(e,t){return Mo(e.valueOf(),t.valueOf())}function D1e(e,t){return e.source===t.source&&e.flags===t.flags}function k5(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var a=new Array(n),i=e.values(),s,o;(s=i.next())&&!s.done;){for(var l=t.values(),c=!1,d=0;(o=l.next())&&!o.done;){if(!a[d]&&r.equals(s.value,o.value,s.value,o.value,e,t,r)){c=a[d]=!0;break}d++}if(!c)return!1}return!0}function I1e(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 L1e(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 fV(e,t,r,n){return(n===P1e||n===E1e||n===N1e)&&(e.$$typeof||t.$$typeof)?!0:_1e(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var z1e="[object Arguments]",F1e="[object Boolean]",B1e="[object Date]",V1e="[object Error]",q1e="[object Map]",U1e="[object Number]",H1e="[object Object]",W1e="[object RegExp]",G1e="[object Set]",K1e="[object String]",Y1e="[object URL]",X1e=Array.isArray,_5=typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView:null,N5=Object.assign,Z1e=Object.prototype.toString.call.bind(Object.prototype.toString);function Q1e(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,a=e.areFunctionsEqual,i=e.areMapsEqual,s=e.areNumbersEqual,o=e.areObjectsEqual,l=e.arePrimitiveWrappersEqual,c=e.areRegExpsEqual,d=e.areSetsEqual,f=e.areTypedArraysEqual,h=e.areUrlsEqual,p=e.unknownTagComparators;return function(m,b,x){if(m===b)return!0;if(m==null||b==null)return!1;var y=typeof m;if(y!==typeof b)return!1;if(y!=="object")return y==="number"?s(m,b,x):y==="function"?a(m,b,x):!1;var v=m.constructor;if(v!==b.constructor)return!1;if(v===Object)return o(m,b,x);if(X1e(m))return t(m,b,x);if(_5!=null&&_5(m))return f(m,b,x);if(v===Date)return r(m,b,x);if(v===RegExp)return c(m,b,x);if(v===Map)return i(m,b,x);if(v===Set)return d(m,b,x);var w=Z1e(m);if(w===B1e)return r(m,b,x);if(w===W1e)return c(m,b,x);if(w===q1e)return i(m,b,x);if(w===G1e)return d(m,b,x);if(w===H1e)return typeof m.then!="function"&&typeof b.then!="function"&&o(m,b,x);if(w===Y1e)return h(m,b,x);if(w===V1e)return n(m,b,x);if(w===z1e)return o(m,b,x);if(w===F1e||w===U1e||w===K1e)return l(m,b,x);if(p){var j=p[w];if(!j){var k=k1e(m);k&&(j=p[k])}if(j)return j(m,b,x)}return!1}}function J1e(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,a={areArraysEqual:n?bu:C1e,areDatesEqual:A1e,areErrorsEqual:T1e,areFunctionsEqual:O1e,areMapsEqual:n?x5(S5,bu):S5,areNumbersEqual:M1e,areObjectsEqual:n?bu:R1e,arePrimitiveWrappersEqual:$1e,areRegExpsEqual:D1e,areSetsEqual:n?x5(k5,bu):k5,areTypedArraysEqual:n?bu:I1e,areUrlsEqual:L1e,unknownTagComparators:void 0};if(r&&(a=N5({},a,r(a))),t){var i=Uh(a.areArraysEqual),s=Uh(a.areMapsEqual),o=Uh(a.areObjectsEqual),l=Uh(a.areSetsEqual);a=N5({},a,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:o,areSetsEqual:l})}return a}function eje(e){return function(t,r,n,a,i,s,o){return e(t,r,o)}}function tje(e){var t=e.circular,r=e.comparator,n=e.createState,a=e.equals,i=e.strict;if(n)return function(l,c){var d=n(),f=d.cache,h=f===void 0?t?new WeakMap:void 0:f,p=d.meta;return r(l,c,{cache:h,equals:a,meta:p,strict:i})};if(t)return function(l,c){return r(l,c,{cache:new WeakMap,equals:a,meta:void 0,strict:i})};var s={cache:void 0,equals:a,meta:void 0,strict:i};return function(l,c){return r(l,c,s)}}var rje=Ss();Ss({strict:!0});Ss({circular:!0});Ss({circular:!0,strict:!0});Ss({createInternalComparator:function(){return Mo}});Ss({strict:!0,createInternalComparator:function(){return Mo}});Ss({circular:!0,createInternalComparator:function(){return Mo}});Ss({circular:!0,createInternalComparator:function(){return Mo},strict:!0});function Ss(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,a=e.createState,i=e.strict,s=i===void 0?!1:i,o=J1e(e),l=Q1e(o),c=n?n(l):eje(l);return tje({circular:r,comparator:l,createState:a,equals:c,strict:s})}function nje(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function E5(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>t?(e(i),r=-1):nje(a)};requestAnimationFrame(n)}function Mk(e){"@babel/helpers - typeof";return Mk=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},Mk(e)}function aje(e){return lje(e)||oje(e)||sje(e)||ije()}function ije(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
567
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sje(e,t){if(e){if(typeof e=="string")return P5(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 P5(e,t)}}function P5(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 oje(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lje(e){if(Array.isArray(e))return e}function cje(){var e={},t=function(){return null},r=!1,n=function a(i){if(!r){if(Array.isArray(i)){if(!i.length)return;var s=i,o=aje(s),l=o[0],c=o.slice(1);if(typeof l=="number"){E5(a.bind(null,c),l);return}a(l),E5(a.bind(null,c));return}Mk(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){r=!0},start:function(i){r=!1,n(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function sf(e){"@babel/helpers - typeof";return sf=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},sf(e)}function C5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function A5(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){hV(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 hV(e,t,r){return t=uje(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uje(e){var t=dje(e,"string");return sf(t)==="symbol"?t:String(t)}function dje(e,t){if(sf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(sf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fje=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(n,a){return n.filter(function(i){return a.includes(i)})})},hje=function(t){return t},pje=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},ad=function(t,r){return Object.keys(r).reduce(function(n,a){return A5(A5({},n),{},hV({},a,t(a,r[a])))},{})},T5=function(t,r,n){return t.map(function(a){return"".concat(pje(a)," ").concat(r,"ms ").concat(n)}).join(",")};function mje(e,t){return vje(e)||yje(e,t)||pV(e,t)||gje()}function gje(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
568
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yje(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,o=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(l=(n=i.call(r)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(d){c=!0,a=d}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return o}}function vje(e){if(Array.isArray(e))return e}function xje(e){return jje(e)||wje(e)||pV(e)||bje()}function bje(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
569
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pV(e,t){if(e){if(typeof e=="string")return Rk(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 Rk(e,t)}}function wje(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jje(e){if(Array.isArray(e))return Rk(e)}function Rk(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 Um=1e-4,mV=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},gV=function(t,r){return t.map(function(n,a){return n*Math.pow(r,a)}).reduce(function(n,a){return n+a})},O5=function(t,r){return function(n){var a=mV(t,r);return gV(a,n)}},Sje=function(t,r){return function(n){var a=mV(t,r),i=[].concat(xje(a.map(function(s,o){return s*o}).slice(1)),[0]);return gV(i,n)}},M5=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0],i=r[1],s=r[2],o=r[3];if(r.length===1)switch(r[0]){case"linear":a=0,i=0,s=1,o=1;break;case"ease":a=.25,i=.1,s=.25,o=1;break;case"ease-in":a=.42,i=0,s=1,o=1;break;case"ease-out":a=.42,i=0,s=.58,o=1;break;case"ease-in-out":a=0,i=0,s=.58,o=1;break;default:{var l=r[0].split("(");if(l[0]==="cubic-bezier"&&l[1].split(")")[0].split(",").length===4){var c=l[1].split(")")[0].split(",").map(function(b){return parseFloat(b)}),d=mje(c,4);a=d[0],i=d[1],s=d[2],o=d[3]}}}var f=O5(a,s),h=O5(i,o),p=Sje(a,s),g=function(x){return x>1?1:x<0?0:x},m=function(x){for(var y=x>1?1:x,v=y,w=0;w<8;++w){var j=f(v)-y,k=p(v);if(Math.abs(j-y)<Um||k<Um)return h(v);v=g(v-j/k)}return h(v)};return m.isStepper=!1,m},kje=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,i=a===void 0?8:a,s=t.dt,o=s===void 0?17:s,l=function(d,f,h){var p=-(d-f)*n,g=h*i,m=h+(p-g)*o/1e3,b=h*o/1e3+d;return Math.abs(b-f)<Um&&Math.abs(m)<Um?[f,0]:[b,m]};return l.isStepper=!0,l.dt=o,l},_je=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return M5(a);case"spring":return kje();default:if(a.split("(")[0]==="cubic-bezier")return M5(a)}return typeof a=="function"?a:null};function of(e){"@babel/helpers - typeof";return of=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},of(e)}function R5(e){return Pje(e)||Eje(e)||yV(e)||Nje()}function Nje(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
570
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Eje(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pje(e){if(Array.isArray(e))return Dk(e)}function $5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function cr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$5(Object(r),!0).forEach(function(n){$k(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $k(e,t,r){return t=Cje(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cje(e){var t=Aje(e,"string");return of(t)==="symbol"?t:String(t)}function Aje(e,t){if(of(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(of(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tje(e,t){return Rje(e)||Mje(e,t)||yV(e,t)||Oje()}function Oje(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
571
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yV(e,t){if(e){if(typeof e=="string")return Dk(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 Dk(e,t)}}function Dk(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 Mje(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,o=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(l=(n=i.call(r)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(d){c=!0,a=d}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return o}}function Rje(e){if(Array.isArray(e))return e}var Hm=function(t,r,n){return t+(r-t)*n},Ik=function(t){var r=t.from,n=t.to;return r!==n},$je=function e(t,r,n){var a=ad(function(i,s){if(Ik(s)){var o=t(s.from,s.to,s.velocity),l=Tje(o,2),c=l[0],d=l[1];return cr(cr({},s),{},{from:c,velocity:d})}return s},r);return n<1?ad(function(i,s){return Ik(s)?cr(cr({},s),{},{velocity:Hm(s.velocity,a[i].velocity,n),from:Hm(s.from,a[i].from,n)}):s},r):e(t,a,n-1)};const Dje=function(e,t,r,n,a){var i=fje(e,t),s=i.reduce(function(b,x){return cr(cr({},b),{},$k({},x,[e[x],t[x]]))},{}),o=i.reduce(function(b,x){return cr(cr({},b),{},$k({},x,{from:e[x],velocity:0,to:t[x]}))},{}),l=-1,c,d,f=function(){return null},h=function(){return ad(function(x,y){return y.from},o)},p=function(){return!Object.values(o).filter(Ik).length},g=function(x){c||(c=x);var y=x-c,v=y/r.dt;o=$je(r,o,v),a(cr(cr(cr({},e),t),h())),c=x,p()||(l=requestAnimationFrame(f))},m=function(x){d||(d=x);var y=(x-d)/n,v=ad(function(j,k){return Hm.apply(void 0,R5(k).concat([r(y)]))},s);if(a(cr(cr(cr({},e),t),v)),y<1)l=requestAnimationFrame(f);else{var w=ad(function(j,k){return Hm.apply(void 0,R5(k).concat([r(1)]))},s);a(cr(cr(cr({},e),t),w))}};return f=r.isStepper?g:m,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(l)}}};function oc(e){"@babel/helpers - typeof";return oc=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},oc(e)}var Ije=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Lje(e,t){if(e==null)return{};var r=zje(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zje(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function Q1(e){return qje(e)||Vje(e)||Bje(e)||Fje()}function Fje(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
572
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bje(e,t){if(e){if(typeof e=="string")return Lk(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 Lk(e,t)}}function Vje(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qje(e){if(Array.isArray(e))return Lk(e)}function Lk(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 D5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function zn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?D5(Object(r),!0).forEach(function(n){zu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zu(e,t,r){return t=vV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Uje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hje(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,vV(n.key),n)}}function Wje(e,t,r){return t&&Hje(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vV(e){var t=Gje(e,"string");return oc(t)==="symbol"?t:String(t)}function Gje(e,t){if(oc(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(oc(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kje(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&&zk(e,t)}function zk(e,t){return zk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},zk(e,t)}function Yje(e){var t=Xje();return function(){var n=Wm(e),a;if(t){var i=Wm(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return Fk(this,a)}}function Fk(e,t){if(t&&(oc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bk(e)}function Bk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xje(){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 Wm(e){return Wm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wm(e)}var ci=function(e){Kje(r,e);var t=Yje(r);function r(n,a){var i;Uje(this,r),i=t.call(this,n,a);var s=i.props,o=s.isActive,l=s.attributeName,c=s.from,d=s.to,f=s.steps,h=s.children,p=s.duration;if(i.handleStyleChange=i.handleStyleChange.bind(Bk(i)),i.changeStyle=i.changeStyle.bind(Bk(i)),!o||p<=0)return i.state={style:{}},typeof h=="function"&&(i.state={style:d}),Fk(i);if(f&&f.length)i.state={style:f[0].style};else if(c){if(typeof h=="function")return i.state={style:c},Fk(i);i.state={style:l?zu({},l,c):c}}else i.state={style:{}};return i}return Wje(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,s=a.canBegin;this.mounted=!0,!(!i||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,s=i.isActive,o=i.canBegin,l=i.attributeName,c=i.shouldReAnimate,d=i.to,f=i.from,h=this.state.style;if(o){if(!s){var p={style:l?zu({},l,d):d};this.state&&h&&(l&&h[l]!==d||!l&&h!==d)&&this.setState(p);return}if(!(rje(a.to,d)&&a.canBegin&&a.isActive)){var g=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=g||c?f:a.to;if(this.state&&h){var b={style:l?zu({},l,m):m};(l&&h[l]!==m||!l&&h!==m)&&this.setState(b)}this.runAnimation(zn(zn({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,s=a.from,o=a.to,l=a.duration,c=a.easing,d=a.begin,f=a.onAnimationEnd,h=a.onAnimationStart,p=Dje(s,o,_je(c),l,this.changeStyle),g=function(){i.stopJSAnimation=p()};this.manager.start([h,d,g,l,f])}},{key:"runStepAnimation",value:function(a){var i=this,s=a.steps,o=a.begin,l=a.onAnimationStart,c=s[0],d=c.style,f=c.duration,h=f===void 0?0:f,p=function(m,b,x){if(x===0)return m;var y=b.duration,v=b.easing,w=v===void 0?"ease":v,j=b.style,k=b.properties,S=b.onAnimationEnd,N=x>0?s[x-1]:b,E=k||Object.keys(j);if(typeof w=="function"||w==="spring")return[].concat(Q1(m),[i.runJSAnimation.bind(i,{from:N.style,to:j,duration:y,easing:w}),y]);var A=T5(E,y,w),C=zn(zn(zn({},N.style),j),{},{transition:A});return[].concat(Q1(m),[C,y,S]).filter(hje)};return this.manager.start([l].concat(Q1(s.reduce(p,[d,Math.max(h,o)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=cje());var i=a.begin,s=a.duration,o=a.attributeName,l=a.to,c=a.easing,d=a.onAnimationStart,f=a.onAnimationEnd,h=a.steps,p=a.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof c=="function"||typeof p=="function"||c==="spring"){this.runJSAnimation(a);return}if(h.length>1){this.runStepAnimation(a);return}var m=o?zu({},o,l):l,b=T5(Object.keys(m),s,c);g.start([d,i,zn(zn({},m),{},{transition:b}),s,f])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var s=a.duration;a.attributeName,a.easing;var o=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var l=Lje(a,Ije),c=_.Children.count(i),d=this.state.style;if(typeof i=="function")return i(d);if(!o||c===0||s<=0)return i;var f=function(p){var g=p.props,m=g.style,b=m===void 0?{}:m,x=g.className,y=_.cloneElement(p,zn(zn({},l),{},{style:zn(zn({},b),d),className:x}));return y};return c===1?f(_.Children.only(i)):O.createElement("div",null,_.Children.map(i,function(h){return f(h)}))}}]),r}(_.PureComponent);ci.displayName="Animate";ci.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ci.propTypes={from:We.oneOfType([We.object,We.string]),to:We.oneOfType([We.object,We.string]),attributeName:We.string,duration:We.number,begin:We.number,easing:We.oneOfType([We.string,We.func]),steps:We.arrayOf(We.shape({duration:We.number.isRequired,style:We.object.isRequired,easing:We.oneOfType([We.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),We.func]),properties:We.arrayOf("string"),onAnimationEnd:We.func})),children:We.oneOfType([We.node,We.func]),isActive:We.bool,canBegin:We.bool,onAnimationEnd:We.func,shouldReAnimate:We.bool,onAnimationStart:We.func,onAnimationReStart:We.func};function lf(e){"@babel/helpers - typeof";return lf=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},lf(e)}function Gm(){return Gm=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},Gm.apply(this,arguments)}function Zje(e,t){return tSe(e)||eSe(e,t)||Jje(e,t)||Qje()}function Qje(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
573
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jje(e,t){if(e){if(typeof e=="string")return I5(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 I5(e,t)}}function I5(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 eSe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,o=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(l=(n=i.call(r)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(d){c=!0,a=d}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return o}}function tSe(e){if(Array.isArray(e))return e}function L5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function z5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?L5(Object(r),!0).forEach(function(n){rSe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rSe(e,t,r){return t=nSe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nSe(e){var t=aSe(e,"string");return lf(t)=="symbol"?t:t+""}function aSe(e,t){if(lf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(lf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var F5=function(t,r,n,a,i){var s=Math.min(Math.abs(n)/2,Math.abs(a)/2),o=a>=0?1:-1,l=n>=0?1:-1,c=a>=0&&n>=0||a<0&&n<0?1:0,d;if(s>0&&i instanceof Array){for(var f=[0,0,0,0],h=0,p=4;h<p;h++)f[h]=i[h]>s?s:i[h];d="M".concat(t,",").concat(r+o*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(c,",").concat(t+l*f[0],",").concat(r)),d+="L ".concat(t+n-l*f[1],",").concat(r),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(c,`,
574
- `).concat(t+n,",").concat(r+o*f[1])),d+="L ".concat(t+n,",").concat(r+a-o*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(c,`,
575
- `).concat(t+n-l*f[2],",").concat(r+a)),d+="L ".concat(t+l*f[3],",").concat(r+a),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(c,`,
576
- `).concat(t,",").concat(r+a-o*f[3])),d+="Z"}else if(s>0&&i===+i&&i>0){var g=Math.min(s,i);d="M ".concat(t,",").concat(r+o*g,`
577
- A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(t+l*g,",").concat(r,`
578
- L `).concat(t+n-l*g,",").concat(r,`
579
- A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(t+n,",").concat(r+o*g,`
580
- L `).concat(t+n,",").concat(r+a-o*g,`
581
- A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(t+n-l*g,",").concat(r+a,`
582
- L `).concat(t+l*g,",").concat(r+a,`
583
- A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(t,",").concat(r+a-o*g," Z")}else d="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return d},iSe=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,i=r.x,s=r.y,o=r.width,l=r.height;if(Math.abs(o)>0&&Math.abs(l)>0){var c=Math.min(i,i+o),d=Math.max(i,i+o),f=Math.min(s,s+l),h=Math.max(s,s+l);return n>=c&&n<=d&&a>=f&&a<=h}return!1},sSe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},SE=function(t){var r=z5(z5({},sSe),t),n=_.useRef(),a=_.useState(-1),i=Zje(a,2),s=i[0],o=i[1];_.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var w=n.current.getTotalLength();w&&o(w)}catch{}},[]);var l=r.x,c=r.y,d=r.width,f=r.height,h=r.radius,p=r.className,g=r.animationEasing,m=r.animationDuration,b=r.animationBegin,x=r.isAnimationActive,y=r.isUpdateAnimationActive;if(l!==+l||c!==+c||d!==+d||f!==+f||d===0||f===0)return null;var v=Fe("recharts-rectangle",p);return y?O.createElement(ci,{canBegin:s>0,from:{width:d,height:f,x:l,y:c},to:{width:d,height:f,x:l,y:c},duration:m,animationEasing:g,isActive:y},function(w){var j=w.width,k=w.height,S=w.x,N=w.y;return O.createElement(ci,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:m,isActive:x,easing:g},O.createElement("path",Gm({},Ie(r,!0),{className:v,d:F5(S,N,j,k,h),ref:n})))}):O.createElement("path",Gm({},Ie(r,!0),{className:v,d:F5(l,c,d,f,h)}))};function Vk(){return Vk=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},Vk.apply(this,arguments)}var kE=function(t){var r=t.cx,n=t.cy,a=t.r,i=t.className,s=Fe("recharts-dot",i);return r===+r&&n===+n&&a===+a?_.createElement("circle",Vk({},Ie(t,!1),vm(t),{className:s,cx:r,cy:n,r:a})):null};function cf(e){"@babel/helpers - typeof";return cf=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},cf(e)}var oSe=["x","y","top","left","width","height","className"];function qk(){return qk=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},qk.apply(this,arguments)}function B5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function lSe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?B5(Object(r),!0).forEach(function(n){cSe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cSe(e,t,r){return t=uSe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uSe(e){var t=dSe(e,"string");return cf(t)=="symbol"?t:t+""}function dSe(e,t){if(cf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(cf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fSe(e,t){if(e==null)return{};var r=hSe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hSe(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 pSe=function(t,r,n,a,i,s){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(s,",").concat(r,"h").concat(n)},mSe=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,s=t.top,o=s===void 0?0:s,l=t.left,c=l===void 0?0:l,d=t.width,f=d===void 0?0:d,h=t.height,p=h===void 0?0:h,g=t.className,m=fSe(t,oSe),b=lSe({x:n,y:i,top:o,left:c,width:f,height:p},m);return!J(n)||!J(i)||!J(f)||!J(p)||!J(o)||!J(c)?null:O.createElement("path",qk({},Ie(b,!0),{className:Fe("recharts-cross",g),d:pSe(n,i,f,p,o,c)}))},gSe=KB();const ySe=Ke(gSe);var vSe=pi,xSe=Tn,bSe="[object Boolean]";function wSe(e){return e===!0||e===!1||xSe(e)&&vSe(e)==bSe}var jSe=wSe;const SSe=Ke(jSe);function uf(e){"@babel/helpers - typeof";return uf=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},uf(e)}function Km(){return Km=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},Km.apply(this,arguments)}function kSe(e,t){return PSe(e)||ESe(e,t)||NSe(e,t)||_Se()}function _Se(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
584
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NSe(e,t){if(e){if(typeof e=="string")return V5(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 V5(e,t)}}function V5(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 ESe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,o=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(l=(n=i.call(r)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(d){c=!0,a=d}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return o}}function PSe(e){if(Array.isArray(e))return e}function q5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function U5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?q5(Object(r),!0).forEach(function(n){CSe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function CSe(e,t,r){return t=ASe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ASe(e){var t=TSe(e,"string");return uf(t)=="symbol"?t:t+""}function TSe(e,t){if(uf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(uf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var H5=function(t,r,n,a,i){var s=n-a,o;return o="M ".concat(t,",").concat(r),o+="L ".concat(t+n,",").concat(r),o+="L ".concat(t+n-s/2,",").concat(r+i),o+="L ".concat(t+n-s/2-a,",").concat(r+i),o+="L ".concat(t,",").concat(r," Z"),o},OSe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},MSe=function(t){var r=U5(U5({},OSe),t),n=_.useRef(),a=_.useState(-1),i=kSe(a,2),s=i[0],o=i[1];_.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var v=n.current.getTotalLength();v&&o(v)}catch{}},[]);var l=r.x,c=r.y,d=r.upperWidth,f=r.lowerWidth,h=r.height,p=r.className,g=r.animationEasing,m=r.animationDuration,b=r.animationBegin,x=r.isUpdateAnimationActive;if(l!==+l||c!==+c||d!==+d||f!==+f||h!==+h||d===0&&f===0||h===0)return null;var y=Fe("recharts-trapezoid",p);return x?O.createElement(ci,{canBegin:s>0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:c},to:{upperWidth:d,lowerWidth:f,height:h,x:l,y:c},duration:m,animationEasing:g,isActive:x},function(v){var w=v.upperWidth,j=v.lowerWidth,k=v.height,S=v.x,N=v.y;return O.createElement(ci,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:m,easing:g},O.createElement("path",Km({},Ie(r,!0),{className:y,d:H5(S,N,w,j,k),ref:n})))}):O.createElement("g",null,O.createElement("path",Km({},Ie(r,!0),{className:y,d:H5(l,c,d,f,h)})))},RSe=["option","shapeType","propTransformer","activeClassName","isActive"];function df(e){"@babel/helpers - typeof";return df=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},df(e)}function $Se(e,t){if(e==null)return{};var r=DSe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function DSe(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 W5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ym(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?W5(Object(r),!0).forEach(function(n){ISe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ISe(e,t,r){return t=LSe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LSe(e){var t=zSe(e,"string");return df(t)=="symbol"?t:t+""}function zSe(e,t){if(df(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(df(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FSe(e,t){return Ym(Ym({},t),e)}function BSe(e,t){return e==="symbols"}function G5(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return O.createElement(SE,r);case"trapezoid":return O.createElement(MSe,r);case"sector":return O.createElement(lV,r);case"symbols":if(BSe(t))return O.createElement(ZN,r);break;default:return null}}function VSe(e){return _.isValidElement(e)?e.props:e}function qSe(e){var t=e.option,r=e.shapeType,n=e.propTransformer,a=n===void 0?FSe:n,i=e.activeClassName,s=i===void 0?"recharts-active-shape":i,o=e.isActive,l=$Se(e,RSe),c;if(_.isValidElement(t))c=_.cloneElement(t,Ym(Ym({},l),VSe(t)));else if(Ce(t))c=t(l);else if(ySe(t)&&!SSe(t)){var d=a(t,l);c=O.createElement(G5,{shapeType:r,elementProps:d})}else{var f=l;c=O.createElement(G5,{shapeType:r,elementProps:f})}return o?O.createElement(It,{className:s},c):c}function Og(e,t){return t!=null&&"trapezoids"in e.props}function Mg(e,t){return t!=null&&"sectors"in e.props}function ff(e,t){return t!=null&&"points"in e.props}function USe(e,t){var r,n,a=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,i=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return a&&i}function HSe(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function WSe(e,t){var r=e.x===t.x,n=e.y===t.y,a=e.z===t.z;return r&&n&&a}function GSe(e,t){var r;return Og(e,t)?r=USe:Mg(e,t)?r=HSe:ff(e,t)&&(r=WSe),r}function KSe(e,t){var r;return Og(e,t)?r="trapezoids":Mg(e,t)?r="sectors":ff(e,t)&&(r="points"),r}function YSe(e,t){if(Og(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(Mg(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 ff(e,t)?t.payload:{}}function XSe(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,a=KSe(r,t),i=YSe(r,t),s=n.filter(function(l,c){var d=Cg(i,l),f=r.props[a].filter(function(g){var m=GSe(r,t);return m(g,t)}),h=r.props[a].indexOf(f[f.length-1]),p=c===h;return d&&p}),o=n.indexOf(s[s.length-1]);return o}var ZSe=JB();const Xm=Ke(ZSe);function hf(e){"@babel/helpers - typeof";return hf=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},hf(e)}function K5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Y5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?K5(Object(r),!0).forEach(function(n){xV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xV(e,t,r){return t=QSe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function QSe(e){var t=JSe(e,"string");return hf(t)=="symbol"?t:t+""}function JSe(e,t){if(hf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(hf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var eke=["Webkit","Moz","O","ms"],tke=function(t,r){var n=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=eke.reduce(function(i,s){return Y5(Y5({},i),{},xV({},s+n,r))},{});return a[t]=r,a};function lc(e){"@babel/helpers - typeof";return lc=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},lc(e)}function Zm(){return Zm=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},Zm.apply(this,arguments)}function X5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function J1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?X5(Object(r),!0).forEach(function(n){Gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z5(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,wV(n.key),n)}}function nke(e,t,r){return t&&Z5(e.prototype,t),r&&Z5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ake(e,t,r){return t=Qm(t),ike(e,bV()?Reflect.construct(t,r||[],Qm(e).constructor):t.apply(e,r))}function ike(e,t){if(t&&(lc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ske(e)}function ske(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bV=function(){return!!e})()}function Qm(e){return Qm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Qm(e)}function oke(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&&Uk(e,t)}function Uk(e,t){return Uk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Uk(e,t)}function Gr(e,t,r){return t=wV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wV(e){var t=lke(e,"string");return lc(t)=="symbol"?t:t+""}function lke(e,t){if(lc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(lc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var cke=function(t){var r=t.data,n=t.startIndex,a=t.endIndex,i=t.x,s=t.width,o=t.travellerWidth;if(!r||!r.length)return{};var l=r.length,c=rd().domain(Xm(0,l)).range([i,i+s-o]),d=c.domain().map(function(f){return c(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:c(n),endX:c(a),scale:c,scaleValues:d}},Q5=function(t){return t.changedTouches&&!!t.changedTouches.length},cc=function(e){function t(r){var n;return rke(this,t),n=ake(this,t,[r]),Gr(n,"handleDrag",function(a){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(a):n.state.isSlideMoving&&n.handleSlideDrag(a)}),Gr(n,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&n.handleDrag(a.changedTouches[0])}),Gr(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,s=a.onDragEnd,o=a.startIndex;s==null||s({endIndex:i,startIndex:o})}),n.detachDragEndListener()}),Gr(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Gr(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Gr(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Gr(n,"handleSlideDragStart",function(a){var i=Q5(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return oke(t,e),nke(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,s=this.state.scaleValues,o=this.props,l=o.gap,c=o.data,d=c.length-1,f=Math.min(a,i),h=Math.max(a,i),p=t.getIndexInRange(s,f),g=t.getIndexInRange(s,h);return{startIndex:p-p%l,endIndex:g===d?d:g-g%l}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,s=a.tickFormatter,o=a.dataKey,l=nn(i[n],o,n);return Ce(s)?s(l,n):l}},{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 a=this.state,i=a.slideMoveStartX,s=a.startX,o=a.endX,l=this.props,c=l.x,d=l.width,f=l.travellerWidth,h=l.startIndex,p=l.endIndex,g=l.onChange,m=n.pageX-i;m>0?m=Math.min(m,c+d-f-o,c+d-f-s):m<0&&(m=Math.max(m,c-s,c-o));var b=this.getIndex({startX:s+m,endX:o+m});(b.startIndex!==h||b.endIndex!==p)&&g&&g(b),this.setState({startX:s+m,endX:o+m,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=Q5(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,s=a.movingTravellerId,o=a.endX,l=a.startX,c=this.state[s],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,g=d.onChange,m=d.gap,b=d.data,x={startX:this.state.startX,endX:this.state.endX},y=n.pageX-i;y>0?y=Math.min(y,f+h-p-c):y<0&&(y=Math.max(y,f-c)),x[s]=c+y;var v=this.getIndex(x),w=v.startIndex,j=v.endIndex,k=function(){var N=b.length-1;return s==="startX"&&(o>l?w%m===0:j%m===0)||o<l&&j===N||s==="endX"&&(o>l?j%m===0:w%m===0)||o>l&&j===N};this.setState(Gr(Gr({},s,c+y),"brushMoveStartX",n.pageX),function(){g&&k()&&g(v)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,s=this.state,o=s.scaleValues,l=s.startX,c=s.endX,d=this.state[a],f=o.indexOf(d);if(f!==-1){var h=f+n;if(!(h===-1||h>=o.length)){var p=o[h];a==="startX"&&p>=c||a==="endX"&&p<=l||this.setState(Gr({},a,p),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,s=n.width,o=n.height,l=n.fill,c=n.stroke;return O.createElement("rect",{stroke:c,fill:l,x:a,y:i,width:s,height:o})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,s=n.width,o=n.height,l=n.data,c=n.children,d=n.padding,f=_.Children.only(c);return f?O.cloneElement(f,{x:a,y:i,width:s,height:o,margin:d,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,s,o=this,l=this.props,c=l.y,d=l.travellerWidth,f=l.height,h=l.traveller,p=l.ariaLabel,g=l.data,m=l.startIndex,b=l.endIndex,x=Math.max(n,this.props.x),y=J1(J1({},Ie(this.props,!1)),{},{x,y:c,width:d,height:f}),v=p||"Min value: ".concat((i=g[m])===null||i===void 0?void 0:i.name,", Max value: ").concat((s=g[b])===null||s===void 0?void 0:s.name);return O.createElement(It,{tabIndex:0,role:"slider","aria-label":v,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(j){["ArrowLeft","ArrowRight"].includes(j.key)&&(j.preventDefault(),j.stopPropagation(),o.handleTravellerMoveKeyboard(j.key==="ArrowRight"?1:-1,a))},onFocus:function(){o.setState({isTravellerFocused:!0})},onBlur:function(){o.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,y))}},{key:"renderSlide",value:function(n,a){var i=this.props,s=i.y,o=i.height,l=i.stroke,c=i.travellerWidth,d=Math.min(n,a)+c,f=Math.max(Math.abs(a-n)-c,0);return O.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:d,y:s,width:f,height:o})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,s=n.y,o=n.height,l=n.travellerWidth,c=n.stroke,d=this.state,f=d.startX,h=d.endX,p=5,g={pointerEvents:"none",fill:c};return O.createElement(It,{className:"recharts-brush-texts"},O.createElement(Am,Zm({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:s+o/2},g),this.getTextOfTick(a)),O.createElement(Am,Zm({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+l+p,y:s+o/2},g),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,s=n.children,o=n.x,l=n.y,c=n.width,d=n.height,f=n.alwaysShowText,h=this.state,p=h.startX,g=h.endX,m=h.isTextActive,b=h.isSlideMoving,x=h.isTravellerMoving,y=h.isTravellerFocused;if(!a||!a.length||!J(o)||!J(l)||!J(c)||!J(d)||c<=0||d<=0)return null;var v=Fe("recharts-brush",i),w=O.Children.count(s)===1,j=tke("userSelect","none");return O.createElement(It,{className:v,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:j},this.renderBackground(),w&&this.renderPanorama(),this.renderSlide(p,g),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(g,"endX"),(m||b||x||y||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,s=n.width,o=n.height,l=n.stroke,c=Math.floor(i+o/2)-1;return O.createElement(O.Fragment,null,O.createElement("rect",{x:a,y:i,width:s,height:o,fill:l,stroke:"none"}),O.createElement("line",{x1:a+1,y1:c,x2:a+s-1,y2:c,fill:"none",stroke:"#fff"}),O.createElement("line",{x1:a+1,y1:c+2,x2:a+s-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return O.isValidElement(n)?i=O.cloneElement(n,a):Ce(n)?i=n(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,s=n.width,o=n.x,l=n.travellerWidth,c=n.updateId,d=n.startIndex,f=n.endIndex;if(i!==a.prevData||c!==a.prevUpdateId)return J1({prevData:i,prevTravellerWidth:l,prevUpdateId:c,prevX:o,prevWidth:s},i&&i.length?cke({data:i,width:s,x:o,travellerWidth:l,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(a.scale&&(s!==a.prevWidth||o!==a.prevX||l!==a.prevTravellerWidth)){a.scale.range([o,o+s-l]);var h=a.scale.domain().map(function(p){return a.scale(p)});return{prevData:i,prevTravellerWidth:l,prevUpdateId:c,prevX:o,prevWidth:s,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,s=0,o=i-1;o-s>1;){var l=Math.floor((s+o)/2);n[l]>a?o=l:s=l}return a>=n[o]?o:s}}])}(_.PureComponent);Gr(cc,"displayName","Brush");Gr(cc,"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 uke=Dc();function dke(e,t){var r;return uke(e,function(n,a,i){return r=t(n,a,i),!r}),!!r}var fke=dke,hke=fB,pke=On(),mke=fke,gke=Rt(),yke=Lc();function vke(e,t,r){var n=gke(e)?hke:mke;return r&&yke(e,t,r)&&(t=void 0),n(e,pke(t,3))}var xke=vke;const bke=Ke(xke);var ba=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},wke=HB();const jke=Ke(wke);function Ske(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 kke=Ske,_ke=Dc();function Nke(e,t){var r=!0;return _ke(e,function(n,a,i){return r=!!t(n,a,i),r}),r}var Eke=Nke,Pke=kke,Cke=Eke,Ake=On(),Tke=Rt(),Oke=Lc();function Mke(e,t,r){var n=Tke(e)?Pke:Cke;return r&&Oke(e,t,r)&&(t=void 0),n(e,Ake(t,3))}var Rke=Mke;const jV=Ke(Rke);var $ke=["x","y"];function pf(e){"@babel/helpers - typeof";return pf=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},pf(e)}function Hk(){return Hk=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},Hk.apply(this,arguments)}function J5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function wu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?J5(Object(r),!0).forEach(function(n){Dke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Dke(e,t,r){return t=Ike(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ike(e){var t=Lke(e,"string");return pf(t)=="symbol"?t:t+""}function Lke(e,t){if(pf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(pf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zke(e,t){if(e==null)return{};var r=Fke(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Fke(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 Bke(e,t){var r=e.x,n=e.y,a=zke(e,$ke),i="".concat(r),s=parseInt(i,10),o="".concat(n),l=parseInt(o,10),c="".concat(t.height||a.height),d=parseInt(c,10),f="".concat(t.width||a.width),h=parseInt(f,10);return wu(wu(wu(wu(wu({},t),a),s?{x:s}:{}),l?{y:l}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function e3(e){return O.createElement(qSe,Hk({shapeType:"rectangle",propTransformer:Bke,activeClassName:"recharts-active-bar"},e))}var Vke=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var i=J(n)||Bpe(n);return i?t(n,a):(i||wo(),r)}},qke=["value","background"],SV;function uc(e){"@babel/helpers - typeof";return uc=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},uc(e)}function Uke(e,t){if(e==null)return{};var r=Hke(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Hke(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 Jm(){return Jm=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},Jm.apply(this,arguments)}function t3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Vt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?t3(Object(r),!0).forEach(function(n){qi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r3(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,_V(n.key),n)}}function Gke(e,t,r){return t&&r3(e.prototype,t),r&&r3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kke(e,t,r){return t=e0(t),Yke(e,kV()?Reflect.construct(t,r||[],e0(e).constructor):t.apply(e,r))}function Yke(e,t){if(t&&(uc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xke(e)}function Xke(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kV=function(){return!!e})()}function e0(e){return e0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},e0(e)}function Zke(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&&Wk(e,t)}function Wk(e,t){return Wk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Wk(e,t)}function qi(e,t,r){return t=_V(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _V(e){var t=Qke(e,"string");return uc(t)=="symbol"?t:t+""}function Qke(e,t){if(uc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(uc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Uf=function(e){function t(){var r;Wke(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=Kke(this,t,[].concat(a)),qi(r,"state",{isAnimationFinished:!1}),qi(r,"id",zf("recharts-bar-")),qi(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),s&&s()}),qi(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),s&&s()}),r}return Zke(t,e),Gke(t,[{key:"renderRectanglesStatically",value:function(n){var a=this,i=this.props,s=i.shape,o=i.dataKey,l=i.activeIndex,c=i.activeBar,d=Ie(this.props,!1);return n&&n.map(function(f,h){var p=h===l,g=p?c:s,m=Vt(Vt(Vt({},d),f),{},{isActive:p,option:g,index:h,dataKey:o,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return O.createElement(It,Jm({className:"recharts-bar-rectangle"},xm(a.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)}),O.createElement(e3,m))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,a=this.props,i=a.data,s=a.layout,o=a.isAnimationActive,l=a.animationBegin,c=a.animationDuration,d=a.animationEasing,f=a.animationId,h=this.state.prevData;return O.createElement(ci,{begin:l,duration:c,isActive:o,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(p){var g=p.t,m=i.map(function(b,x){var y=h&&h[x];if(y){var v=Yn(y.x,b.x),w=Yn(y.y,b.y),j=Yn(y.width,b.width),k=Yn(y.height,b.height);return Vt(Vt({},b),{},{x:v(g),y:w(g),width:j(g),height:k(g)})}if(s==="horizontal"){var S=Yn(0,b.height),N=S(g);return Vt(Vt({},b),{},{y:b.y+b.height-N,height:N})}var E=Yn(0,b.width),A=E(g);return Vt(Vt({},b),{},{width:A})});return O.createElement(It,null,n.renderRectanglesStatically(m))})}},{key:"renderRectangles",value:function(){var n=this.props,a=n.data,i=n.isAnimationActive,s=this.state.prevData;return i&&a&&a.length&&(!s||!Cg(s,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var n=this,a=this.props,i=a.data,s=a.dataKey,o=a.activeIndex,l=Ie(this.props.background,!1);return i.map(function(c,d){c.value;var f=c.background,h=Uke(c,qke);if(!f)return null;var p=Vt(Vt(Vt(Vt(Vt({},h),{},{fill:"#eee"},f),l),xm(n.props,c,d)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:s,index:d,className:"recharts-bar-background-rectangle"});return O.createElement(e3,Jm({key:"background-bar-".concat(d),option:n.props.background,isActive:d===o},p))})}},{key:"renderErrorBar",value:function(n,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,s=i.data,o=i.xAxis,l=i.yAxis,c=i.layout,d=i.children,f=En(d,qf);if(!f)return null;var h=c==="vertical"?s[0].height/2:s[0].width/2,p=function(b,x){var y=Array.isArray(b.value)?b.value[1]:b.value;return{x:b.x,y:b.y,value:y,errorVal:nn(b,x)}},g={clipPath:n?"url(#clipPath-".concat(a,")"):null};return O.createElement(It,g,f.map(function(m){return O.cloneElement(m,{key:"error-bar-".concat(a,"-").concat(m.props.dataKey),data:s,xAxis:o,yAxis:l,layout:c,offset:h,dataPointFormatter:p})}))}},{key:"render",value:function(){var n=this.props,a=n.hide,i=n.data,s=n.className,o=n.xAxis,l=n.yAxis,c=n.left,d=n.top,f=n.width,h=n.height,p=n.isAnimationActive,g=n.background,m=n.id;if(a||!i||!i.length)return null;var b=this.state.isAnimationFinished,x=Fe("recharts-bar",s),y=o&&o.allowDataOverflow,v=l&&l.allowDataOverflow,w=y||v,j=Re(m)?this.id:m;return O.createElement(It,{className:x},y||v?O.createElement("defs",null,O.createElement("clipPath",{id:"clipPath-".concat(j)},O.createElement("rect",{x:y?c:c-f/2,y:v?d:d-h/2,width:y?f:f*2,height:v?h:h*2}))):null,O.createElement(It,{className:"recharts-bar-rectangles",clipPath:w?"url(#clipPath-".concat(j,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(w,j),(!p||b)&&rs.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:a.curData}:n.data!==a.curData?{curData:n.data}:null}}])}(_.PureComponent);SV=Uf;qi(Uf,"displayName","Bar");qi(Uf,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Fc.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});qi(Uf,"getComposedData",function(e){var t=e.props,r=e.item,n=e.barPosition,a=e.bandSize,i=e.xAxis,s=e.yAxis,o=e.xAxisTicks,l=e.yAxisTicks,c=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,p=iwe(n,r);if(!p)return null;var g=t.layout,m=r.type.defaultProps,b=m!==void 0?Vt(Vt({},m),r.props):r.props,x=b.dataKey,y=b.children,v=b.minPointSize,w=g==="horizontal"?s:i,j=c?w.scale.domain():null,k=hwe({numericAxis:w}),S=En(y,n9),N=f.map(function(E,A){var C,M,T,P,D,$;c?C=swe(c[d+A],j):(C=nn(E,x),Array.isArray(C)||(C=[k,C]));var L=Vke(v,SV.defaultProps.minPointSize)(C[1],A);if(g==="horizontal"){var I,R=[s.scale(C[0]),s.scale(C[1])],z=R[0],V=R[1];M=n5({axis:i,ticks:o,bandSize:a,offset:p.offset,entry:E,index:A}),T=(I=V??z)!==null&&I!==void 0?I:void 0,P=p.size;var B=z-V;if(D=Number.isNaN(B)?0:B,$={x:M,y:s.y,width:P,height:s.height},Math.abs(L)>0&&Math.abs(D)<Math.abs(L)){var W=Zn(D||L)*(Math.abs(L)-Math.abs(D));T-=W,D+=W}}else{var K=[i.scale(C[0]),i.scale(C[1])],Q=K[0],ae=K[1];if(M=Q,T=n5({axis:s,ticks:l,bandSize:a,offset:p.offset,entry:E,index:A}),P=ae-Q,D=p.size,$={x:i.x,y:T,width:i.width,height:D},Math.abs(L)>0&&Math.abs(P)<Math.abs(L)){var pe=Zn(P||L)*(Math.abs(L)-Math.abs(P));P+=pe}}return Vt(Vt(Vt({},E),{},{x:M,y:T,width:P,height:D,value:c?C:C[1],payload:E,background:$},S&&S[A]&&S[A].props),{},{tooltipPayload:[iV(r,E)],tooltipPosition:{x:M+P/2,y:T+D/2}})});return Vt({data:N,layout:g},h)});function mf(e){"@babel/helpers - typeof";return mf=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},mf(e)}function Jke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n3(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,NV(n.key),n)}}function e2e(e,t,r){return t&&n3(e.prototype,t),r&&n3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Hn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?a3(Object(r),!0).forEach(function(n){Rg(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rg(e,t,r){return t=NV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function NV(e){var t=t2e(e,"string");return mf(t)=="symbol"?t:t+""}function t2e(e,t){if(mf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(mf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var r2e=function(t,r,n,a,i){var s=t.width,o=t.height,l=t.layout,c=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:o-n.bottom,bottomMirror:o-n.bottom},h=!!Yr(c,Uf);return d.reduce(function(p,g){var m=r[g],b=m.orientation,x=m.domain,y=m.padding,v=y===void 0?{}:y,w=m.mirror,j=m.reversed,k="".concat(b).concat(w?"Mirror":""),S,N,E,A,C;if(m.type==="number"&&(m.padding==="gap"||m.padding==="no-gap")){var M=x[1]-x[0],T=1/0,P=m.categoricalDomain.sort(Upe);if(P.forEach(function(K,Q){Q>0&&(T=Math.min((K||0)-(P[Q-1]||0),T))}),Number.isFinite(T)){var D=T/M,$=m.layout==="vertical"?n.height:n.width;if(m.padding==="gap"&&(S=D*$/2),m.padding==="no-gap"){var L=xo(t.barCategoryGap,D*$),I=D*$/2;S=I-L-(I-L)/$*L}}}a==="xAxis"?N=[n.left+(v.left||0)+(S||0),n.left+n.width-(v.right||0)-(S||0)]:a==="yAxis"?N=l==="horizontal"?[n.top+n.height-(v.bottom||0),n.top+(v.top||0)]:[n.top+(v.top||0)+(S||0),n.top+n.height-(v.bottom||0)-(S||0)]:N=m.range,j&&(N=[N[1],N[0]]);var R=nwe(m,i,h),z=R.scale,V=R.realScaleType;z.domain(x).range(N),awe(z);var B=fwe(z,Hn(Hn({},m),{},{realScaleType:V}));a==="xAxis"?(C=b==="top"&&!w||b==="bottom"&&w,E=n.left,A=f[k]-C*m.height):a==="yAxis"&&(C=b==="left"&&!w||b==="right"&&w,E=f[k]-C*m.width,A=n.top);var W=Hn(Hn(Hn({},m),B),{},{realScaleType:V,x:E,y:A,scale:z,width:a==="xAxis"?n.width:m.width,height:a==="yAxis"?n.height:m.height});return W.bandSize=Bm(W,B),!m.hide&&a==="xAxis"?f[k]+=(C?-1:1)*W.height:m.hide||(f[k]+=(C?-1:1)*W.width),Hn(Hn({},p),{},Rg({},g,W))},{})},EV=function(t,r){var n=t.x,a=t.y,i=r.x,s=r.y;return{x:Math.min(n,i),y:Math.min(a,s),width:Math.abs(i-n),height:Math.abs(s-a)}},n2e=function(t){var r=t.x1,n=t.y1,a=t.x2,i=t.y2;return EV({x:r,y:n},{x:a,y:i})},PV=function(){function e(t){Jke(this,e),this.scale=t}return e2e(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]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+s}case"end":{var o=this.bandwidth?this.bandwidth():0;return this.scale(r)+o}default:return this.scale(r)}if(a){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])}();Rg(PV,"EPS",1e-4);var _E=function(t){var r=Object.keys(t).reduce(function(n,a){return Hn(Hn({},n),{},Rg({},a,PV.create(t[a])))},{});return Hn(Hn({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.bandAware,o=i.position;return jke(a,function(l,c){return r[c].apply(l,{bandAware:s,position:o})})},isInRange:function(a){return jV(a,function(i,s){return r[s].isInRange(i)})}})};function a2e(e){return(e%180+180)%180}var i2e=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=a2e(a),s=i*Math.PI/180,o=Math.atan(n/r),l=s>o&&s<Math.PI-o?n/Math.sin(s):r/Math.cos(s);return Math.abs(l)},s2e=VB();const o2e=Ke(s2e);var l2e=vB();const c2e=Ke(l2e);var u2e=c2e(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("")}),NE=_.createContext(void 0),EE=_.createContext(void 0),CV=_.createContext(void 0),AV=_.createContext({}),TV=_.createContext(void 0),OV=_.createContext(0),MV=_.createContext(0),i3=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,s=t.clipPathId,o=t.children,l=t.width,c=t.height,d=u2e(i);return O.createElement(NE.Provider,{value:n},O.createElement(EE.Provider,{value:a},O.createElement(AV.Provider,{value:i},O.createElement(CV.Provider,{value:d},O.createElement(TV.Provider,{value:s},O.createElement(OV.Provider,{value:c},O.createElement(MV.Provider,{value:l},o)))))))},d2e=function(){return _.useContext(TV)},RV=function(t){var r=_.useContext(NE);r==null&&wo();var n=r[t];return n==null&&wo(),n},f2e=function(){var t=_.useContext(NE);return zi(t)},h2e=function(){var t=_.useContext(EE),r=o2e(t,function(n){return jV(n.domain,Number.isFinite)});return r||zi(t)},$V=function(t){var r=_.useContext(EE);r==null&&wo();var n=r[t];return n==null&&wo(),n},p2e=function(){var t=_.useContext(CV);return t},m2e=function(){return _.useContext(AV)},PE=function(){return _.useContext(MV)},CE=function(){return _.useContext(OV)};function dc(e){"@babel/helpers - typeof";return dc=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},dc(e)}function g2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y2e(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,IV(n.key),n)}}function v2e(e,t,r){return t&&y2e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function x2e(e,t,r){return t=t0(t),b2e(e,DV()?Reflect.construct(t,r||[],t0(e).constructor):t.apply(e,r))}function b2e(e,t){if(t&&(dc(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 DV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(DV=function(){return!!e})()}function t0(e){return t0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},t0(e)}function j2e(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&&Gk(e,t)}function Gk(e,t){return Gk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Gk(e,t)}function s3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function o3(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?s3(Object(r),!0).forEach(function(n){AE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function AE(e,t,r){return t=IV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IV(e){var t=S2e(e,"string");return dc(t)=="symbol"?t:t+""}function S2e(e,t){if(dc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(dc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function k2e(e,t){return P2e(e)||E2e(e,t)||N2e(e,t)||_2e()}function _2e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
585
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N2e(e,t){if(e){if(typeof e=="string")return l3(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 l3(e,t)}}function l3(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 E2e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,o=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(l=(n=i.call(r)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(d){c=!0,a=d}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return o}}function P2e(e){if(Array.isArray(e))return e}function Kk(){return Kk=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},Kk.apply(this,arguments)}var C2e=function(t,r){var n;return O.isValidElement(t)?n=O.cloneElement(t,r):Ce(t)?n=t(r):n=O.createElement("line",Kk({},r,{className:"recharts-reference-line-line"})),n},A2e=function(t,r,n,a,i,s,o,l,c){var d=i.x,f=i.y,h=i.width,p=i.height;if(n){var g=c.y,m=t.y.apply(g,{position:s});if(ba(c,"discard")&&!t.y.isInRange(m))return null;var b=[{x:d+h,y:m},{x:d,y:m}];return l==="left"?b.reverse():b}if(r){var x=c.x,y=t.x.apply(x,{position:s});if(ba(c,"discard")&&!t.x.isInRange(y))return null;var v=[{x:y,y:f+p},{x:y,y:f}];return o==="top"?v.reverse():v}if(a){var w=c.segment,j=w.map(function(k){return t.apply(k,{position:s})});return ba(c,"discard")&&bke(j,function(k){return!t.isInRange(k)})?null:j}return null};function T2e(e){var t=e.x,r=e.y,n=e.segment,a=e.xAxisId,i=e.yAxisId,s=e.shape,o=e.className,l=e.alwaysShow,c=d2e(),d=RV(a),f=$V(i),h=p2e();if(!c||!h)return null;Ga(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=_E({x:d.scale,y:f.scale}),g=Jt(t),m=Jt(r),b=n&&n.length===2,x=A2e(p,g,m,b,h,e.position,d.orientation,f.orientation,e);if(!x)return null;var y=k2e(x,2),v=y[0],w=v.x,j=v.y,k=y[1],S=k.x,N=k.y,E=ba(e,"hidden")?"url(#".concat(c,")"):void 0,A=o3(o3({clipPath:E},Ie(e,!0)),{},{x1:w,y1:j,x2:S,y2:N});return O.createElement(It,{className:Fe("recharts-reference-line",o)},C2e(s,A),jr.renderCallByParent(e,n2e({x1:w,y1:j,x2:S,y2:N})))}var TE=function(e){function t(){return g2e(this,t),x2e(this,t,arguments)}return j2e(t,e),v2e(t,[{key:"render",value:function(){return O.createElement(T2e,this.props)}}])}(O.Component);AE(TE,"displayName","ReferenceLine");AE(TE,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Yk(){return Yk=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},Yk.apply(this,arguments)}function fc(e){"@babel/helpers - typeof";return fc=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},fc(e)}function c3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function u3(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?c3(Object(r),!0).forEach(function(n){$g(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function O2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M2e(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,zV(n.key),n)}}function R2e(e,t,r){return t&&M2e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $2e(e,t,r){return t=r0(t),D2e(e,LV()?Reflect.construct(t,r||[],r0(e).constructor):t.apply(e,r))}function D2e(e,t){if(t&&(fc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return I2e(e)}function I2e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function LV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(LV=function(){return!!e})()}function r0(e){return r0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},r0(e)}function L2e(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&&Xk(e,t)}function Xk(e,t){return Xk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Xk(e,t)}function $g(e,t,r){return t=zV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zV(e){var t=z2e(e,"string");return fc(t)=="symbol"?t:t+""}function z2e(e,t){if(fc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(fc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var F2e=function(t){var r=t.x,n=t.y,a=t.xAxis,i=t.yAxis,s=_E({x:a.scale,y:i.scale}),o=s.apply({x:r,y:n},{bandAware:!0});return ba(t,"discard")&&!s.isInRange(o)?null:o},Dg=function(e){function t(){return O2e(this,t),$2e(this,t,arguments)}return L2e(t,e),R2e(t,[{key:"render",value:function(){var n=this.props,a=n.x,i=n.y,s=n.r,o=n.alwaysShow,l=n.clipPathId,c=Jt(a),d=Jt(i);if(Ga(o===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!c||!d)return null;var f=F2e(this.props);if(!f)return null;var h=f.x,p=f.y,g=this.props,m=g.shape,b=g.className,x=ba(this.props,"hidden")?"url(#".concat(l,")"):void 0,y=u3(u3({clipPath:x},Ie(this.props,!0)),{},{cx:h,cy:p});return O.createElement(It,{className:Fe("recharts-reference-dot",b)},t.renderDot(m,y),jr.renderCallByParent(this.props,{x:h-s,y:p-s,width:2*s,height:2*s}))}}])}(O.Component);$g(Dg,"displayName","ReferenceDot");$g(Dg,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});$g(Dg,"renderDot",function(e,t){var r;return O.isValidElement(e)?r=O.cloneElement(e,t):Ce(e)?r=e(t):r=O.createElement(kE,Yk({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function Zk(){return Zk=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},Zk.apply(this,arguments)}function hc(e){"@babel/helpers - typeof";return hc=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},hc(e)}function d3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function f3(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?d3(Object(r),!0).forEach(function(n){Ig(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function B2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V2e(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,BV(n.key),n)}}function q2e(e,t,r){return t&&V2e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function U2e(e,t,r){return t=n0(t),H2e(e,FV()?Reflect.construct(t,r||[],n0(e).constructor):t.apply(e,r))}function H2e(e,t){if(t&&(hc(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 FV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FV=function(){return!!e})()}function n0(e){return n0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},n0(e)}function G2e(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&&Qk(e,t)}function Qk(e,t){return Qk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Qk(e,t)}function Ig(e,t,r){return t=BV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function BV(e){var t=K2e(e,"string");return hc(t)=="symbol"?t:t+""}function K2e(e,t){if(hc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(hc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Y2e=function(t,r,n,a,i){var s=i.x1,o=i.x2,l=i.y1,c=i.y2,d=i.xAxis,f=i.yAxis;if(!d||!f)return null;var h=_E({x:d.scale,y:f.scale}),p={x:t?h.x.apply(s,{position:"start"}):h.x.rangeMin,y:n?h.y.apply(l,{position:"start"}):h.y.rangeMin},g={x:r?h.x.apply(o,{position:"end"}):h.x.rangeMax,y:a?h.y.apply(c,{position:"end"}):h.y.rangeMax};return ba(i,"discard")&&(!h.isInRange(p)||!h.isInRange(g))?null:EV(p,g)},Lg=function(e){function t(){return B2e(this,t),U2e(this,t,arguments)}return G2e(t,e),q2e(t,[{key:"render",value:function(){var n=this.props,a=n.x1,i=n.x2,s=n.y1,o=n.y2,l=n.className,c=n.alwaysShow,d=n.clipPathId;Ga(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Jt(a),h=Jt(i),p=Jt(s),g=Jt(o),m=this.props.shape;if(!f&&!h&&!p&&!g&&!m)return null;var b=Y2e(f,h,p,g,this.props);if(!b&&!m)return null;var x=ba(this.props,"hidden")?"url(#".concat(d,")"):void 0;return O.createElement(It,{className:Fe("recharts-reference-area",l)},t.renderRect(m,f3(f3({clipPath:x},Ie(this.props,!0)),b)),jr.renderCallByParent(this.props,b))}}])}(O.Component);Ig(Lg,"displayName","ReferenceArea");Ig(Lg,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Ig(Lg,"renderRect",function(e,t){var r;return O.isValidElement(e)?r=O.cloneElement(e,t):Ce(e)?r=e(t):r=O.createElement(SE,Zk({},t,{className:"recharts-reference-area-rect"})),r});function VV(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],a=0;a<e.length;a+=t)n.push(e[a]);return n}function X2e(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return i2e(n,r)}function Z2e(e,t,r){var n=r==="width",a=e.x,i=e.y,s=e.width,o=e.height;return t===1?{start:n?a:i,end:n?a+s:i+o}:{start:n?a+s:i+o,end:n?a:i}}function a0(e,t,r,n,a){if(e*t<e*n||e*t>e*a)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-a)<=0}function Q2e(e,t){return VV(e,t+1)}function J2e(e,t,r,n,a){for(var i=(n||[]).slice(),s=t.start,o=t.end,l=0,c=1,d=s,f=function(){var g=n==null?void 0:n[l];if(g===void 0)return{v:VV(n,c)};var m=l,b,x=function(){return b===void 0&&(b=r(g,m)),b},y=g.coordinate,v=l===0||a0(e,y,x,d,o);v||(l=0,d=s,c+=1),v&&(d=y+e*(x()/2+a),l+=c)},h;c<=i.length;)if(h=f(),h)return h.v;return[]}function gf(e){"@babel/helpers - typeof";return gf=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},gf(e)}function h3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).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?h3(Object(r),!0).forEach(function(n){e_e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function e_e(e,t,r){return t=t_e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t_e(e){var t=r_e(e,"string");return gf(t)=="symbol"?t:t+""}function r_e(e,t){if(gf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(gf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function n_e(e,t,r,n,a){for(var i=(n||[]).slice(),s=i.length,o=t.start,l=t.end,c=function(h){var p=i[h],g,m=function(){return g===void 0&&(g=r(p,h)),g};if(h===s-1){var b=e*(p.coordinate+e*m()/2-l);i[h]=p=br(br({},p),{},{tickCoord:b>0?p.coordinate-b*e:p.coordinate})}else i[h]=p=br(br({},p),{},{tickCoord:p.coordinate});var x=a0(e,p.tickCoord,m,o,l);x&&(l=p.tickCoord-e*(m()/2+a),i[h]=br(br({},p),{},{isShow:!0}))},d=s-1;d>=0;d--)c(d);return i}function a_e(e,t,r,n,a,i){var s=(n||[]).slice(),o=s.length,l=t.start,c=t.end;if(i){var d=n[o-1],f=r(d,o-1),h=e*(d.coordinate+e*f/2-c);s[o-1]=d=br(br({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=a0(e,d.tickCoord,function(){return f},l,c);p&&(c=d.tickCoord-e*(f/2+a),s[o-1]=br(br({},d),{},{isShow:!0}))}for(var g=i?o-1:o,m=function(y){var v=s[y],w,j=function(){return w===void 0&&(w=r(v,y)),w};if(y===0){var k=e*(v.coordinate-e*j()/2-l);s[y]=v=br(br({},v),{},{tickCoord:k<0?v.coordinate-k*e:v.coordinate})}else s[y]=v=br(br({},v),{},{tickCoord:v.coordinate});var S=a0(e,v.tickCoord,j,l,c);S&&(l=v.tickCoord+e*(j()/2+a),s[y]=br(br({},v),{},{isShow:!0}))},b=0;b<g;b++)m(b);return s}function OE(e,t,r){var n=e.tick,a=e.ticks,i=e.viewBox,s=e.minTickGap,o=e.orientation,l=e.interval,c=e.tickFormatter,d=e.unit,f=e.angle;if(!a||!a.length||!n)return[];if(J(l)||Fc.isSsr)return Q2e(a,typeof l=="number"&&J(l)?l:0);var h=[],p=o==="top"||o==="bottom"?"width":"height",g=d&&p==="width"?td(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},m=function(v,w){var j=Ce(c)?c(v.value,w):v.value;return p==="width"?X2e(td(j,{fontSize:t,letterSpacing:r}),g,f):td(j,{fontSize:t,letterSpacing:r})[p]},b=a.length>=2?Zn(a[1].coordinate-a[0].coordinate):1,x=Z2e(i,b,p);return l==="equidistantPreserveStart"?J2e(b,x,m,a,s):(l==="preserveStart"||l==="preserveStartEnd"?h=a_e(b,x,m,a,s,l==="preserveStartEnd"):h=n_e(b,x,m,a,s),h.filter(function(y){return y.isShow}))}var i_e=["viewBox"],s_e=["viewBox"],o_e=["ticks"];function pc(e){"@babel/helpers - typeof";return pc=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},pc(e)}function yl(){return yl=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},yl.apply(this,arguments)}function p3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Yt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?p3(Object(r),!0).forEach(function(n){ME(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ej(e,t){if(e==null)return{};var r=l_e(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function l_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 c_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m3(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,UV(n.key),n)}}function u_e(e,t,r){return t&&m3(e.prototype,t),r&&m3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function d_e(e,t,r){return t=i0(t),f_e(e,qV()?Reflect.construct(t,r||[],i0(e).constructor):t.apply(e,r))}function f_e(e,t){if(t&&(pc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return h_e(e)}function h_e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qV=function(){return!!e})()}function i0(e){return i0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},i0(e)}function p_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&&Jk(e,t)}function Jk(e,t){return Jk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Jk(e,t)}function ME(e,t,r){return t=UV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UV(e){var t=m_e(e,"string");return pc(t)=="symbol"?t:t+""}function m_e(e,t){if(pc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(pc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var qc=function(e){function t(r){var n;return c_e(this,t),n=d_e(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return p_e(t,e),u_e(t,[{key:"shouldComponentUpdate",value:function(n,a){var i=n.viewBox,s=ej(n,i_e),o=this.props,l=o.viewBox,c=ej(o,s_e);return!Ol(i,l)||!Ol(s,c)||!Ol(a,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var a=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var a=this.props,i=a.x,s=a.y,o=a.width,l=a.height,c=a.orientation,d=a.tickSize,f=a.mirror,h=a.tickMargin,p,g,m,b,x,y,v=f?-1:1,w=n.tickSize||d,j=J(n.tickCoord)?n.tickCoord:n.coordinate;switch(c){case"top":p=g=n.coordinate,b=s+ +!f*l,m=b-v*w,y=m-v*h,x=j;break;case"left":m=b=n.coordinate,g=i+ +!f*o,p=g-v*w,x=p-v*h,y=j;break;case"right":m=b=n.coordinate,g=i+ +f*o,p=g+v*w,x=p+v*h,y=j;break;default:p=g=n.coordinate,b=s+ +f*l,m=b+v*w,y=m+v*h,x=j;break}return{line:{x1:p,y1:m,x2:g,y2:b},tick:{x,y}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,s;switch(a){case"left":s=i?"start":"end";break;case"right":s=i?"end":"start";break;default:s="middle";break}return s}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,s="end";switch(a){case"left":case"right":s="middle";break;case"top":s=i?"start":"end";break;default:s=i?"end":"start";break}return s}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.x,i=n.y,s=n.width,o=n.height,l=n.orientation,c=n.mirror,d=n.axisLine,f=Yt(Yt(Yt({},Ie(this.props,!1)),Ie(d,!1)),{},{fill:"none"});if(l==="top"||l==="bottom"){var h=+(l==="top"&&!c||l==="bottom"&&c);f=Yt(Yt({},f),{},{x1:a,y1:i+h*o,x2:a+s,y2:i+h*o})}else{var p=+(l==="left"&&!c||l==="right"&&c);f=Yt(Yt({},f),{},{x1:a+p*s,y1:i,x2:a+p*s,y2:i+o})}return O.createElement("line",yl({},f,{className:Fe("recharts-cartesian-axis-line",Nn(d,"className"))}))}},{key:"renderTicks",value:function(n,a,i){var s=this,o=this.props,l=o.tickLine,c=o.stroke,d=o.tick,f=o.tickFormatter,h=o.unit,p=OE(Yt(Yt({},this.props),{},{ticks:n}),a,i),g=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),b=Ie(this.props,!1),x=Ie(d,!1),y=Yt(Yt({},b),{},{fill:"none"},Ie(l,!1)),v=p.map(function(w,j){var k=s.getTickLineCoord(w),S=k.line,N=k.tick,E=Yt(Yt(Yt(Yt({textAnchor:g,verticalAnchor:m},b),{},{stroke:"none",fill:c},x),N),{},{index:j,payload:w,visibleTicksCount:p.length,tickFormatter:f});return O.createElement(It,yl({className:"recharts-cartesian-axis-tick",key:"tick-".concat(w.value,"-").concat(w.coordinate,"-").concat(w.tickCoord)},xm(s.props,w,j)),l&&O.createElement("line",yl({},y,S,{className:Fe("recharts-cartesian-axis-tick-line",Nn(l,"className"))})),d&&t.renderTickItem(d,E,"".concat(Ce(f)?f(w.value,j):w.value).concat(h||"")))});return O.createElement("g",{className:"recharts-cartesian-axis-ticks"},v)}},{key:"render",value:function(){var n=this,a=this.props,i=a.axisLine,s=a.width,o=a.height,l=a.ticksGenerator,c=a.className,d=a.hide;if(d)return null;var f=this.props,h=f.ticks,p=ej(f,o_e),g=h;return Ce(l)&&(g=h&&h.length>0?l(this.props):l(p)),s<=0||o<=0||!g||!g.length?null:O.createElement(It,{className:Fe("recharts-cartesian-axis",c),ref:function(b){n.layerReference=b}},i&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),jr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,i){var s,o=Fe(a.className,"recharts-cartesian-axis-tick-value");return O.isValidElement(n)?s=O.cloneElement(n,Yt(Yt({},a),{},{className:o})):Ce(n)?s=n(Yt(Yt({},a),{},{className:o})):s=O.createElement(Am,yl({},a,{className:"recharts-cartesian-axis-tick-value"}),i),s}}])}(_.Component);ME(qc,"displayName","CartesianAxis");ME(qc,"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 g_e=["x1","y1","x2","y2","key"],y_e=["offset"];function jo(e){"@babel/helpers - typeof";return jo=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},jo(e)}function g3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Sr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?g3(Object(r),!0).forEach(function(n){v_e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function v_e(e,t,r){return t=x_e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function x_e(e){var t=b_e(e,"string");return jo(t)=="symbol"?t:t+""}function b_e(e,t){if(jo(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(jo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ys(){return Ys=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},Ys.apply(this,arguments)}function y3(e,t){if(e==null)return{};var r=w_e(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function w_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}var j_e=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,i=t.y,s=t.width,o=t.height,l=t.ry;return O.createElement("rect",{x:a,y:i,ry:l,width:s,height:o,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function HV(e,t){var r;if(O.isValidElement(e))r=O.cloneElement(e,t);else if(Ce(e))r=e(t);else{var n=t.x1,a=t.y1,i=t.x2,s=t.y2,o=t.key,l=y3(t,g_e),c=Ie(l,!1);c.offset;var d=y3(c,y_e);r=O.createElement("line",Ys({},d,{x1:n,y1:a,x2:i,y2:s,fill:"none",key:o}))}return r}function S_e(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var s=i.map(function(o,l){var c=Sr(Sr({},e),{},{x1:t,y1:o,x2:t+r,y2:o,key:"line-".concat(l),index:l});return HV(a,c)});return O.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function k_e(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,i=e.verticalPoints;if(!a||!i||!i.length)return null;var s=i.map(function(o,l){var c=Sr(Sr({},e),{},{x1:o,y1:t,x2:o,y2:t+r,key:"line-".concat(l),index:l});return HV(a,c)});return O.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function __e(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,i=e.width,s=e.height,o=e.horizontalPoints,l=e.horizontal,c=l===void 0?!0:l;if(!c||!t||!t.length)return null;var d=o.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?a+s-h:d[p+1]-h;if(m<=0)return null;var b=p%t.length;return O.createElement("rect",{key:"react-".concat(p),y:h,x:n,height:m,width:i,stroke:"none",fill:t[b],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return O.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function N_e(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,i=e.x,s=e.y,o=e.width,l=e.height,c=e.verticalPoints;if(!r||!n||!n.length)return null;var d=c.map(function(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?i+o-h:d[p+1]-h;if(m<=0)return null;var b=p%n.length;return O.createElement("rect",{key:"react-".concat(p),x:h,y:s,width:m,height:l,stroke:"none",fill:n[b],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return O.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var E_e=function(t,r){var n=t.xAxis,a=t.width,i=t.height,s=t.offset;return nV(OE(Sr(Sr(Sr({},qc.defaultProps),n),{},{ticks:Ba(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),s.left,s.left+s.width,r)},P_e=function(t,r){var n=t.yAxis,a=t.width,i=t.height,s=t.offset;return nV(OE(Sr(Sr(Sr({},qc.defaultProps),n),{},{ticks:Ba(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),s.top,s.top+s.height,r)},Yo={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function WV(e){var t,r,n,a,i,s,o=PE(),l=CE(),c=m2e(),d=Sr(Sr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Yo.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Yo.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Yo.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:Yo.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:Yo.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:Yo.verticalFill,x:J(e.x)?e.x:c.left,y:J(e.y)?e.y:c.top,width:J(e.width)?e.width:c.width,height:J(e.height)?e.height:c.height}),f=d.x,h=d.y,p=d.width,g=d.height,m=d.syncWithTicks,b=d.horizontalValues,x=d.verticalValues,y=f2e(),v=h2e();if(!J(p)||p<=0||!J(g)||g<=0||!J(f)||f!==+f||!J(h)||h!==+h)return null;var w=d.verticalCoordinatesGenerator||E_e,j=d.horizontalCoordinatesGenerator||P_e,k=d.horizontalPoints,S=d.verticalPoints;if((!k||!k.length)&&Ce(j)){var N=b&&b.length,E=j({yAxis:v?Sr(Sr({},v),{},{ticks:N?b:v.ticks}):void 0,width:o,height:l,offset:c},N?!0:m);Ga(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(jo(E),"]")),Array.isArray(E)&&(k=E)}if((!S||!S.length)&&Ce(w)){var A=x&&x.length,C=w({xAxis:y?Sr(Sr({},y),{},{ticks:A?x:y.ticks}):void 0,width:o,height:l,offset:c},A?!0:m);Ga(Array.isArray(C),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(jo(C),"]")),Array.isArray(C)&&(S=C)}return O.createElement("g",{className:"recharts-cartesian-grid"},O.createElement(j_e,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),O.createElement(S_e,Ys({},d,{offset:c,horizontalPoints:k,xAxis:y,yAxis:v})),O.createElement(k_e,Ys({},d,{offset:c,verticalPoints:S,xAxis:y,yAxis:v})),O.createElement(__e,Ys({},d,{horizontalPoints:k})),O.createElement(N_e,Ys({},d,{verticalPoints:S})))}WV.displayName="CartesianGrid";var C_e=["type","layout","connectNulls","ref"],A_e=["key"];function mc(e){"@babel/helpers - typeof";return mc=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},mc(e)}function v3(e,t){if(e==null)return{};var r=T_e(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function T_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 id(){return id=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},id.apply(this,arguments)}function x3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Wr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x3(Object(r),!0).forEach(function(n){Wn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xo(e){return $_e(e)||R_e(e)||M_e(e)||O_e()}function O_e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
586
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M_e(e,t){if(e){if(typeof e=="string")return e2(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 e2(e,t)}}function R_e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $_e(e){if(Array.isArray(e))return e2(e)}function e2(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 D_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b3(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,KV(n.key),n)}}function I_e(e,t,r){return t&&b3(e.prototype,t),r&&b3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function L_e(e,t,r){return t=s0(t),z_e(e,GV()?Reflect.construct(t,r||[],s0(e).constructor):t.apply(e,r))}function z_e(e,t){if(t&&(mc(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 GV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GV=function(){return!!e})()}function s0(e){return s0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},s0(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&&t2(e,t)}function t2(e,t){return t2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},t2(e,t)}function Wn(e,t,r){return t=KV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KV(e){var t=V_e(e,"string");return mc(t)=="symbol"?t:t+""}function V_e(e,t){if(mc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(mc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Hf=function(e){function t(){var r;D_e(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=L_e(this,t,[].concat(a)),Wn(r,"state",{isAnimationFinished:!0,totalLength:0}),Wn(r,"generateSimpleStrokeDasharray",function(s,o){return"".concat(o,"px ").concat(s-o,"px")}),Wn(r,"getStrokeDasharray",function(s,o,l){var c=l.reduce(function(x,y){return x+y});if(!c)return r.generateSimpleStrokeDasharray(o,s);for(var d=Math.floor(s/c),f=s%c,h=o-s,p=[],g=0,m=0;g<l.length;m+=l[g],++g)if(m+l[g]>f){p=[].concat(Xo(l.slice(0,g)),[f-m]);break}var b=p.length%2===0?[0,h]:[h];return[].concat(Xo(t.repeat(l,d)),Xo(p),b).map(function(x){return"".concat(x,"px")}).join(", ")}),Wn(r,"id",zf("recharts-line-")),Wn(r,"pathRef",function(s){r.mainCurve=s}),Wn(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Wn(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return B_e(t,e),I_e(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,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,s=i.points,o=i.xAxis,l=i.yAxis,c=i.layout,d=i.children,f=En(d,qf);if(!f)return null;var h=function(m,b){return{x:m.x,y:m.y,value:m.value,errorVal:nn(m.payload,b)}},p={clipPath:n?"url(#clipPath-".concat(a,")"):null};return O.createElement(It,p,f.map(function(g){return O.cloneElement(g,{key:"bar-".concat(g.props.dataKey),data:s,xAxis:o,yAxis:l,layout:c,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,a,i){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var o=this.props,l=o.dot,c=o.points,d=o.dataKey,f=Ie(this.props,!1),h=Ie(l,!0),p=c.map(function(m,b){var x=Wr(Wr(Wr({key:"dot-".concat(b),r:3},f),h),{},{index:b,cx:m.x,cy:m.y,value:m.value,dataKey:d,payload:m.payload,points:c});return t.renderDotItem(l,x)}),g={clipPath:n?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return O.createElement(It,id({className:"recharts-line-dots",key:"dots"},g),p)}},{key:"renderCurveStatically",value:function(n,a,i,s){var o=this.props,l=o.type,c=o.layout,d=o.connectNulls;o.ref;var f=v3(o,C_e),h=Wr(Wr(Wr({},Ie(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:n},s),{},{type:l,layout:c,connectNulls:d});return O.createElement(Ok,id({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,a){var i=this,s=this.props,o=s.points,l=s.strokeDasharray,c=s.isAnimationActive,d=s.animationBegin,f=s.animationDuration,h=s.animationEasing,p=s.animationId,g=s.animateNewValues,m=s.width,b=s.height,x=this.state,y=x.prevPoints,v=x.totalLength;return O.createElement(ci,{begin:d,duration:f,isActive:c,easing:h,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(w){var j=w.t;if(y){var k=y.length/o.length,S=o.map(function(M,T){var P=Math.floor(T*k);if(y[P]){var D=y[P],$=Yn(D.x,M.x),L=Yn(D.y,M.y);return Wr(Wr({},M),{},{x:$(j),y:L(j)})}if(g){var I=Yn(m*2,M.x),R=Yn(b/2,M.y);return Wr(Wr({},M),{},{x:I(j),y:R(j)})}return Wr(Wr({},M),{},{x:M.x,y:M.y})});return i.renderCurveStatically(S,n,a)}var N=Yn(0,v),E=N(j),A;if(l){var C="".concat(l).split(/[,\s]+/gim).map(function(M){return parseFloat(M)});A=i.getStrokeDasharray(E,v,C)}else A=i.generateSimpleStrokeDasharray(v,E);return i.renderCurveStatically(o,n,a,{strokeDasharray:A})})}},{key:"renderCurve",value:function(n,a){var i=this.props,s=i.points,o=i.isAnimationActive,l=this.state,c=l.prevPoints,d=l.totalLength;return o&&s&&s.length&&(!c&&d>0||!Cg(c,s))?this.renderCurveWithAnimation(n,a):this.renderCurveStatically(s,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,s=a.dot,o=a.points,l=a.className,c=a.xAxis,d=a.yAxis,f=a.top,h=a.left,p=a.width,g=a.height,m=a.isAnimationActive,b=a.id;if(i||!o||!o.length)return null;var x=this.state.isAnimationFinished,y=o.length===1,v=Fe("recharts-line",l),w=c&&c.allowDataOverflow,j=d&&d.allowDataOverflow,k=w||j,S=Re(b)?this.id:b,N=(n=Ie(s,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},E=N.r,A=E===void 0?3:E,C=N.strokeWidth,M=C===void 0?2:C,T=Jpe(s)?s:{},P=T.clipDot,D=P===void 0?!0:P,$=A*2+M;return O.createElement(It,{className:v},w||j?O.createElement("defs",null,O.createElement("clipPath",{id:"clipPath-".concat(S)},O.createElement("rect",{x:w?h:h-p/2,y:j?f:f-g/2,width:w?p:p*2,height:j?g:g*2})),!D&&O.createElement("clipPath",{id:"clipPath-dots-".concat(S)},O.createElement("rect",{x:h-$/2,y:f-$/2,width:p+$,height:g+$}))):null,!y&&this.renderCurve(k,S),this.renderErrorBar(k,S),(y||s)&&this.renderDots(k,D,S),(!m||x)&&rs.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:a.curPoints}:n.points!==a.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,a){for(var i=n.length%2!==0?[].concat(Xo(n),[0]):n,s=[],o=0;o<a;++o)s=[].concat(Xo(s),Xo(i));return s}},{key:"renderDotItem",value:function(n,a){var i;if(O.isValidElement(n))i=O.cloneElement(n,a);else if(Ce(n))i=n(a);else{var s=a.key,o=v3(a,A_e),l=Fe("recharts-line-dot",typeof n!="boolean"?n.className:"");i=O.createElement(kE,id({key:s},o,{className:l}))}return i}}])}(_.PureComponent);Wn(Hf,"displayName","Line");Wn(Hf,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Fc.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Wn(Hf,"getComposedData",function(e){var t=e.props,r=e.xAxis,n=e.yAxis,a=e.xAxisTicks,i=e.yAxisTicks,s=e.dataKey,o=e.bandSize,l=e.displayedData,c=e.offset,d=t.layout,f=l.map(function(h,p){var g=nn(h,s);return d==="horizontal"?{x:r5({axis:r,ticks:a,bandSize:o,entry:h,index:p}),y:Re(g)?null:n.scale(g),value:g,payload:h}:{x:Re(g)?null:r.scale(g),y:r5({axis:n,ticks:i,bandSize:o,entry:h,index:p}),value:g,payload:h}});return Wr({points:f,layout:d},c)});function gc(e){"@babel/helpers - typeof";return gc=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},gc(e)}function q_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function U_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,ZV(n.key),n)}}function H_e(e,t,r){return t&&U_e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function W_e(e,t,r){return t=o0(t),G_e(e,YV()?Reflect.construct(t,r||[],o0(e).constructor):t.apply(e,r))}function G_e(e,t){if(t&&(gc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return K_e(e)}function K_e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function YV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(YV=function(){return!!e})()}function o0(e){return o0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},o0(e)}function Y_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&&r2(e,t)}function r2(e,t){return r2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},r2(e,t)}function XV(e,t,r){return t=ZV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZV(e){var t=X_e(e,"string");return gc(t)=="symbol"?t:t+""}function X_e(e,t){if(gc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(gc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function n2(){return n2=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},n2.apply(this,arguments)}function Z_e(e){var t=e.xAxisId,r=PE(),n=CE(),a=RV(t);return a==null?null:_.createElement(qc,n2({},a,{className:Fe("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(s){return Ba(s,!0)}}))}var zg=function(e){function t(){return q_e(this,t),W_e(this,t,arguments)}return Y_e(t,e),H_e(t,[{key:"render",value:function(){return _.createElement(Z_e,this.props)}}])}(_.Component);XV(zg,"displayName","XAxis");XV(zg,"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 yc(e){"@babel/helpers - typeof";return yc=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},yc(e)}function Q_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J_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,eq(n.key),n)}}function eNe(e,t,r){return t&&J_e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function tNe(e,t,r){return t=l0(t),rNe(e,QV()?Reflect.construct(t,r||[],l0(e).constructor):t.apply(e,r))}function rNe(e,t){if(t&&(yc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nNe(e)}function nNe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function QV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(QV=function(){return!!e})()}function l0(e){return l0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},l0(e)}function aNe(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&&a2(e,t)}function a2(e,t){return a2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},a2(e,t)}function JV(e,t,r){return t=eq(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eq(e){var t=iNe(e,"string");return yc(t)=="symbol"?t:t+""}function iNe(e,t){if(yc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(yc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function i2(){return i2=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},i2.apply(this,arguments)}var sNe=function(t){var r=t.yAxisId,n=PE(),a=CE(),i=$V(r);return i==null?null:_.createElement(qc,i2({},i,{className:Fe("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:a},ticksGenerator:function(o){return Ba(o,!0)}}))},Fg=function(e){function t(){return Q_e(this,t),tNe(this,t,arguments)}return aNe(t,e),eNe(t,[{key:"render",value:function(){return _.createElement(sNe,this.props)}}])}(_.Component);JV(Fg,"displayName","YAxis");JV(Fg,"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 w3(e){return uNe(e)||cNe(e)||lNe(e)||oNe()}function oNe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
587
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lNe(e,t){if(e){if(typeof e=="string")return s2(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 s2(e,t)}}function cNe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uNe(e){if(Array.isArray(e))return s2(e)}function s2(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 o2=function(t,r,n,a,i){var s=En(t,TE),o=En(t,Dg),l=[].concat(w3(s),w3(o)),c=En(t,Lg),d="".concat(a,"Id"),f=a[0],h=r;if(l.length&&(h=l.reduce(function(m,b){if(b.props[d]===n&&ba(b.props,"extendDomain")&&J(b.props[f])){var x=b.props[f];return[Math.min(m[0],x),Math.max(m[1],x)]}return m},h)),c.length){var p="".concat(f,"1"),g="".concat(f,"2");h=c.reduce(function(m,b){if(b.props[d]===n&&ba(b.props,"extendDomain")&&J(b.props[p])&&J(b.props[g])){var x=b.props[p],y=b.props[g];return[Math.min(m[0],x,y),Math.max(m[1],x,y)]}return m},h)}return i&&i.length&&(h=i.reduce(function(m,b){return J(b)?[Math.min(m[0],b),Math.max(m[1],b)]:m},h)),h},tq={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function a(l,c,d){this.fn=l,this.context=c,this.once=d||!1}function i(l,c,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new a(d,f||l,h),g=r?r+c:c;return l._events[g]?l._events[g].fn?l._events[g]=[l._events[g],p]:l._events[g].push(p):(l._events[g]=p,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],d,f;if(this._eventsCount===0)return c;for(f in d=this._events)t.call(d,f)&&c.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},o.prototype.listeners=function(c){var d=r?r+c:c,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,p=f.length,g=new Array(p);h<p;h++)g[h]=f[h].fn;return g},o.prototype.listenerCount=function(c){var d=r?r+c:c,f=this._events[d];return f?f.fn?1:f.length:0},o.prototype.emit=function(c,d,f,h,p,g){var m=r?r+c:c;if(!this._events[m])return!1;var b=this._events[m],x=arguments.length,y,v;if(b.fn){switch(b.once&&this.removeListener(c,b.fn,void 0,!0),x){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,d),!0;case 3:return b.fn.call(b.context,d,f),!0;case 4:return b.fn.call(b.context,d,f,h),!0;case 5:return b.fn.call(b.context,d,f,h,p),!0;case 6:return b.fn.call(b.context,d,f,h,p,g),!0}for(v=1,y=new Array(x-1);v<x;v++)y[v-1]=arguments[v];b.fn.apply(b.context,y)}else{var w=b.length,j;for(v=0;v<w;v++)switch(b[v].once&&this.removeListener(c,b[v].fn,void 0,!0),x){case 1:b[v].fn.call(b[v].context);break;case 2:b[v].fn.call(b[v].context,d);break;case 3:b[v].fn.call(b[v].context,d,f);break;case 4:b[v].fn.call(b[v].context,d,f,h);break;default:if(!y)for(j=1,y=new Array(x-1);j<x;j++)y[j-1]=arguments[j];b[v].fn.apply(b[v].context,y)}}return!0},o.prototype.on=function(c,d,f){return i(this,c,d,f,!1)},o.prototype.once=function(c,d,f){return i(this,c,d,f,!0)},o.prototype.removeListener=function(c,d,f,h){var p=r?r+c:c;if(!this._events[p])return this;if(!d)return s(this,p),this;var g=this._events[p];if(g.fn)g.fn===d&&(!h||g.once)&&(!f||g.context===f)&&s(this,p);else{for(var m=0,b=[],x=g.length;m<x;m++)(g[m].fn!==d||h&&!g[m].once||f&&g[m].context!==f)&&b.push(g[m]);b.length?this._events[p]=b.length===1?b[0]:b:s(this,p)}return this},o.prototype.removeAllListeners=function(c){var d;return c?(d=r?r+c:c,this._events[d]&&s(this,d)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o})(tq);var dNe=tq.exports;const fNe=Ke(dNe);var tj=new fNe,rj="recharts.syncMouseEvents";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)}function hNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pNe(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,rq(n.key),n)}}function mNe(e,t,r){return t&&pNe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function nj(e,t,r){return t=rq(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rq(e){var t=gNe(e,"string");return yf(t)=="symbol"?t:t+""}function gNe(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 String(e)}var yNe=function(){function e(){hNe(this,e),nj(this,"activeIndex",0),nj(this,"coordinateList",[]),nj(this,"layout","horizontal")}return mNe(e,[{key:"setDetails",value:function(r){var n,a=r.coordinateList,i=a===void 0?null:a,s=r.container,o=s===void 0?null:s,l=r.layout,c=l===void 0?null:l,d=r.offset,f=d===void 0?null:d,h=r.mouseHandlerCallback,p=h===void 0?null:h;this.coordinateList=(n=i??this.coordinateList)!==null&&n!==void 0?n:[],this.container=o??this.container,this.layout=c??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=p??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 a=this.container.getBoundingClientRect(),i=a.x,s=a.y,o=a.height,l=this.coordinateList[this.activeIndex].coordinate,c=((r=window)===null||r===void 0?void 0:r.scrollX)||0,d=((n=window)===null||n===void 0?void 0:n.scrollY)||0,f=i+l+c,h=s+this.offset.top+o/2+d;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])}();function vNe(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e==null?void 0:e[0],a=e==null?void 0:e[1];if(n&&a&&J(n)&&J(a))return!0}return!1}function xNe(e,t,r,n){var a=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-a,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function nq(e){var t=e.cx,r=e.cy,n=e.radius,a=e.startAngle,i=e.endAngle,s=fr(t,r,n,a),o=fr(t,r,n,i);return{points:[s,o],cx:t,cy:r,radius:n,startAngle:a,endAngle:i}}function bNe(e,t,r){var n,a,i,s;if(e==="horizontal")n=t.x,i=n,a=r.top,s=r.top+r.height;else if(e==="vertical")a=t.y,s=a,n=r.left,i=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var o=t.cx,l=t.cy,c=t.innerRadius,d=t.outerRadius,f=t.angle,h=fr(o,l,c,f),p=fr(o,l,d,f);n=h.x,a=h.y,i=p.x,s=p.y}else return nq(t);return[{x:n,y:a},{x:i,y:s}]}function vf(e){"@babel/helpers - typeof";return vf=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},vf(e)}function j3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Hh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?j3(Object(r),!0).forEach(function(n){wNe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wNe(e,t,r){return t=jNe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jNe(e){var t=SNe(e,"string");return vf(t)=="symbol"?t:t+""}function SNe(e,t){if(vf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(vf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kNe(e){var t,r,n=e.element,a=e.tooltipEventType,i=e.isActive,s=e.activeCoordinate,o=e.activePayload,l=e.offset,c=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,h=e.chartName,p=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!p||!i||!s||h!=="ScatterChart"&&a!=="axis")return null;var g,m=Ok;if(h==="ScatterChart")g=s,m=mSe;else if(h==="BarChart")g=xNe(f,s,l,d),m=SE;else if(f==="radial"){var b=nq(s),x=b.cx,y=b.cy,v=b.radius,w=b.startAngle,j=b.endAngle;g={cx:x,cy:y,startAngle:w,endAngle:j,innerRadius:v,outerRadius:v},m=lV}else g={points:bNe(f,s,l)},m=Ok;var k=Hh(Hh(Hh(Hh({stroke:"#ccc",pointerEvents:"none"},l),g),Ie(p,!1)),{},{payload:o,payloadIndex:c,className:Fe("recharts-tooltip-cursor",p.className)});return _.isValidElement(p)?_.cloneElement(p,k):_.createElement(m,k)}var _Ne=["item"],NNe=["children","className","width","height","style","compact","title","desc"];function vc(e){"@babel/helpers - typeof";return vc=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},vc(e)}function vl(){return vl=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},vl.apply(this,arguments)}function S3(e,t){return CNe(e)||PNe(e,t)||iq(e,t)||ENe()}function ENe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
588
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PNe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,o=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(l=(n=i.call(r)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(d){c=!0,a=d}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return o}}function CNe(e){if(Array.isArray(e))return e}function k3(e,t){if(e==null)return{};var r=ANe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ANe(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 TNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ONe(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,sq(n.key),n)}}function MNe(e,t,r){return t&&ONe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function RNe(e,t,r){return t=c0(t),$Ne(e,aq()?Reflect.construct(t,r||[],c0(e).constructor):t.apply(e,r))}function $Ne(e,t){if(t&&(vc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return DNe(e)}function DNe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aq=function(){return!!e})()}function c0(e){return c0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},c0(e)}function INe(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&&l2(e,t)}function l2(e,t){return l2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},l2(e,t)}function xc(e){return FNe(e)||zNe(e)||iq(e)||LNe()}function LNe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
589
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iq(e,t){if(e){if(typeof e=="string")return c2(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 c2(e,t)}}function zNe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function FNe(e){if(Array.isArray(e))return c2(e)}function c2(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 _3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function G(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_3(Object(r),!0).forEach(function(n){xe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xe(e,t,r){return t=sq(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sq(e){var t=BNe(e,"string");return vc(t)=="symbol"?t:t+""}function BNe(e,t){if(vc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(vc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var VNe={xAxis:["bottom","top"],yAxis:["left","right"]},qNe={width:"100%",height:"100%"},oq={x:0,y:0};function Wh(e){return e}var UNe=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},HNe=function(t,r,n,a){var i=r.find(function(d){return d&&d.index===n});if(i){if(t==="horizontal")return{x:i.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:i.coordinate};if(t==="centric"){var s=i.coordinate,o=a.radius;return G(G(G({},a),fr(a.cx,a.cy,o,s)),{},{angle:s,radius:o})}var l=i.coordinate,c=a.angle;return G(G(G({},a),fr(a.cx,a.cy,l,c)),{},{angle:c,radius:l})}return oq},Bg=function(t,r){var n=r.graphicalItems,a=r.dataStartIndex,i=r.dataEndIndex,s=(n??[]).reduce(function(o,l){var c=l.props.data;return c&&c.length?[].concat(xc(o),xc(c)):o},[]);return s.length>0?s:t&&t.length&&J(a)&&J(i)?t.slice(a,i+1):[]};function lq(e){return e==="number"?[0,"auto"]:void 0}var u2=function(t,r,n,a){var i=t.graphicalItems,s=t.tooltipAxis,o=Bg(r,t);return n<0||!i||!i.length||n>=o.length?null:i.reduce(function(l,c){var d,f=(d=c.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 p=f===void 0?o:f;h=ym(p,s.dataKey,a)}else h=f&&f[n]||o[n];return h?[].concat(xc(l),[iV(c,h)]):l},[])},N3=function(t,r,n,a){var i=a||{x:t.chartX,y:t.chartY},s=UNe(i,n),o=t.orderedTooltipTicks,l=t.tooltipAxis,c=t.tooltipTicks,d=Zbe(s,o,c,l);if(d>=0&&c){var f=c[d]&&c[d].value,h=u2(t,r,d,f),p=HNe(n,o,d,i);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},WNe=function(t,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,s=r.axisIdKey,o=r.stackGroups,l=r.dataStartIndex,c=r.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,p=rV(d,i);return n.reduce(function(g,m){var b,x=m.type.defaultProps!==void 0?G(G({},m.type.defaultProps),m.props):m.props,y=x.type,v=x.dataKey,w=x.allowDataOverflow,j=x.allowDuplicatedCategory,k=x.scale,S=x.ticks,N=x.includeHidden,E=x[s];if(g[E])return g;var A=Bg(t.data,{graphicalItems:a.filter(function(B){var W,K=s in B.props?B.props[s]:(W=B.type.defaultProps)===null||W===void 0?void 0:W[s];return K===E}),dataStartIndex:l,dataEndIndex:c}),C=A.length,M,T,P;vNe(x.domain,w,y)&&(M=Ek(x.domain,null,w),p&&(y==="number"||k!=="auto")&&(P=nd(A,v,"category")));var D=lq(y);if(!M||M.length===0){var $,L=($=x.domain)!==null&&$!==void 0?$:D;if(v){if(M=nd(A,v,y),y==="category"&&p){var I=qpe(M);j&&I?(T=M,M=Xm(0,C)):j||(M=s5(L,M,m).reduce(function(B,W){return B.indexOf(W)>=0?B:[].concat(xc(B),[W])},[]))}else if(y==="category")j?M=M.filter(function(B){return B!==""&&!Re(B)}):M=s5(L,M,m).reduce(function(B,W){return B.indexOf(W)>=0||W===""||Re(W)?B:[].concat(xc(B),[W])},[]);else if(y==="number"){var R=rwe(A,a.filter(function(B){var W,K,Q=s in B.props?B.props[s]:(W=B.type.defaultProps)===null||W===void 0?void 0:W[s],ae="hide"in B.props?B.props.hide:(K=B.type.defaultProps)===null||K===void 0?void 0:K.hide;return Q===E&&(N||!ae)}),v,i,d);R&&(M=R)}p&&(y==="number"||k!=="auto")&&(P=nd(A,v,"category"))}else p?M=Xm(0,C):o&&o[E]&&o[E].hasStack&&y==="number"?M=h==="expand"?[0,1]:aV(o[E].stackGroups,l,c):M=tV(A,a.filter(function(B){var W=s in B.props?B.props[s]:B.type.defaultProps[s],K="hide"in B.props?B.props.hide:B.type.defaultProps.hide;return W===E&&(N||!K)}),y,d,!0);if(y==="number")M=o2(f,M,E,i,S),L&&(M=Ek(L,M,w));else if(y==="category"&&L){var z=L,V=M.every(function(B){return z.indexOf(B)>=0});V&&(M=z)}}return G(G({},g),{},xe({},E,G(G({},x),{},{axisType:i,domain:M,categoricalDomain:P,duplicateDomain:T,originalDomain:(b=x.domain)!==null&&b!==void 0?b:D,isCategorical:p,layout:d})))},{})},GNe=function(t,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,s=r.axisIdKey,o=r.stackGroups,l=r.dataStartIndex,c=r.dataEndIndex,d=t.layout,f=t.children,h=Bg(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:c}),p=h.length,g=rV(d,i),m=-1;return n.reduce(function(b,x){var y=x.type.defaultProps!==void 0?G(G({},x.type.defaultProps),x.props):x.props,v=y[s],w=lq("number");if(!b[v]){m++;var j;return g?j=Xm(0,p):o&&o[v]&&o[v].hasStack?(j=aV(o[v].stackGroups,l,c),j=o2(f,j,v,i)):(j=Ek(w,tV(h,n.filter(function(k){var S,N,E=s in k.props?k.props[s]:(S=k.type.defaultProps)===null||S===void 0?void 0:S[s],A="hide"in k.props?k.props.hide:(N=k.type.defaultProps)===null||N===void 0?void 0:N.hide;return E===v&&!A}),"number",d),a.defaultProps.allowDataOverflow),j=o2(f,j,v,i)),G(G({},b),{},xe({},v,G(G({axisType:i},a.defaultProps),{},{hide:!0,orientation:Nn(VNe,"".concat(i,".").concat(m%2),null),domain:j,originalDomain:w,isCategorical:g,layout:d})))}return b},{})},KNe=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,s=r.graphicalItems,o=r.stackGroups,l=r.dataStartIndex,c=r.dataEndIndex,d=t.children,f="".concat(a,"Id"),h=En(d,i),p={};return h&&h.length?p=WNe(t,{axes:h,graphicalItems:s,axisType:a,axisIdKey:f,stackGroups:o,dataStartIndex:l,dataEndIndex:c}):s&&s.length&&(p=GNe(t,{Axis:i,graphicalItems:s,axisType:a,axisIdKey:f,stackGroups:o,dataStartIndex:l,dataEndIndex:c})),p},YNe=function(t){var r=zi(t),n=Ba(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:JN(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Bm(r,n)}},E3=function(t){var r=t.children,n=t.defaultShowTooltip,a=Yr(r,cc),i=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(s=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!n}},XNe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Wa(r&&r.type);return n&&n.indexOf("Bar")>=0})},P3=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"}},ZNe=function(t,r){var n=t.props,a=t.graphicalItems,i=t.xAxisMap,s=i===void 0?{}:i,o=t.yAxisMap,l=o===void 0?{}:o,c=n.width,d=n.height,f=n.children,h=n.margin||{},p=Yr(f,cc),g=Yr(f,ro),m=Object.keys(l).reduce(function(j,k){var S=l[k],N=S.orientation;return!S.mirror&&!S.hide?G(G({},j),{},xe({},N,j[N]+S.width)):j},{left:h.left||0,right:h.right||0}),b=Object.keys(s).reduce(function(j,k){var S=s[k],N=S.orientation;return!S.mirror&&!S.hide?G(G({},j),{},xe({},N,Nn(j,"".concat(N))+S.height)):j},{top:h.top||0,bottom:h.bottom||0}),x=G(G({},b),m),y=x.bottom;p&&(x.bottom+=p.props.height||cc.defaultProps.height),g&&r&&(x=ewe(x,a,n,r));var v=c-x.left-x.right,w=d-x.top-x.bottom;return G(G({brushBottom:y},x),{},{width:Math.max(v,0),height:Math.max(w,0)})},QNe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},JNe=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,s=t.validateTooltipEventTypes,o=s===void 0?["axis"]:s,l=t.axisComponents,c=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(x,y){var v=y.graphicalItems,w=y.stackGroups,j=y.offset,k=y.updateId,S=y.dataStartIndex,N=y.dataEndIndex,E=x.barSize,A=x.layout,C=x.barGap,M=x.barCategoryGap,T=x.maxBarSize,P=P3(A),D=P.numericAxisName,$=P.cateAxisName,L=XNe(v),I=[];return v.forEach(function(R,z){var V=Bg(x.data,{graphicalItems:[R],dataStartIndex:S,dataEndIndex:N}),B=R.type.defaultProps!==void 0?G(G({},R.type.defaultProps),R.props):R.props,W=B.dataKey,K=B.maxBarSize,Q=B["".concat(D,"Id")],ae=B["".concat($,"Id")],pe={},ve=l.reduce(function(zt,lt){var rt=y["".concat(lt.axisType,"Map")],ct=B["".concat(lt.axisType,"Id")];rt&&rt[ct]||lt.axisType==="zAxis"||wo();var Ft=rt[ct];return G(G({},zt),{},xe(xe({},lt.axisType,Ft),"".concat(lt.axisType,"Ticks"),Ba(Ft)))},pe),Y=ve[$],ee=ve["".concat($,"Ticks")],fe=w&&w[Q]&&w[Q].hasStack&&pwe(R,w[Q].stackGroups),H=Wa(R.type).indexOf("Bar")>=0,je=Bm(Y,ee),ye=[],se=L&&Qbe({barSize:E,stackGroups:w,totalSize:QNe(ve,$)});if(H){var ke,ne,ie=Re(K)?T:K,qe=(ke=(ne=Bm(Y,ee,!0))!==null&&ne!==void 0?ne:ie)!==null&&ke!==void 0?ke:0;ye=Jbe({barGap:C,barCategoryGap:M,bandSize:qe!==je?qe:je,sizeList:se[ae],maxBarSize:ie}),qe!==je&&(ye=ye.map(function(zt){return G(G({},zt),{},{position:G(G({},zt.position),{},{offset:zt.position.offset-qe/2})})}))}var rr=R&&R.type&&R.type.getComposedData;rr&&I.push({props:G(G({},rr(G(G({},ve),{},{displayedData:V,props:x,dataKey:W,item:R,bandSize:je,barPosition:ye,offset:j,stackedData:fe,layout:A,dataStartIndex:S,dataEndIndex:N}))),{},xe(xe(xe({key:R.key||"item-".concat(z)},D,ve[D]),$,ve[$]),"animationId",k)),childIndex:rme(R,x.children),item:R})}),I},p=function(x,y){var v=x.props,w=x.dataStartIndex,j=x.dataEndIndex,k=x.updateId;if(!DD({props:v}))return null;var S=v.children,N=v.layout,E=v.stackOffset,A=v.data,C=v.reverseStackOrder,M=P3(N),T=M.numericAxisName,P=M.cateAxisName,D=En(S,n),$=dwe(A,D,"".concat(T,"Id"),"".concat(P,"Id"),E,C),L=l.reduce(function(B,W){var K="".concat(W.axisType,"Map");return G(G({},B),{},xe({},K,KNe(v,G(G({},W),{},{graphicalItems:D,stackGroups:W.axisType===T&&$,dataStartIndex:w,dataEndIndex:j}))))},{}),I=ZNe(G(G({},L),{},{props:v,graphicalItems:D}),y==null?void 0:y.legendBBox);Object.keys(L).forEach(function(B){L[B]=d(v,L[B],I,B.replace("Map",""),r)});var R=L["".concat(P,"Map")],z=YNe(R),V=h(v,G(G({},L),{},{dataStartIndex:w,dataEndIndex:j,updateId:k,graphicalItems:D,stackGroups:$,offset:I}));return G(G({formattedGraphicalItems:V,graphicalItems:D,offset:I,stackGroups:$},z),L)},g=function(b){function x(y){var v,w,j;return TNe(this,x),j=RNe(this,x,[y]),xe(j,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),xe(j,"accessibilityManager",new yNe),xe(j,"handleLegendBBoxUpdate",function(k){if(k){var S=j.state,N=S.dataStartIndex,E=S.dataEndIndex,A=S.updateId;j.setState(G({legendBBox:k},p({props:j.props,dataStartIndex:N,dataEndIndex:E,updateId:A},G(G({},j.state),{},{legendBBox:k}))))}}),xe(j,"handleReceiveSyncEvent",function(k,S,N){if(j.props.syncId===k){if(N===j.eventEmitterSymbol&&typeof j.props.syncMethod!="function")return;j.applySyncEvent(S)}}),xe(j,"handleBrushChange",function(k){var S=k.startIndex,N=k.endIndex;if(S!==j.state.dataStartIndex||N!==j.state.dataEndIndex){var E=j.state.updateId;j.setState(function(){return G({dataStartIndex:S,dataEndIndex:N},p({props:j.props,dataStartIndex:S,dataEndIndex:N,updateId:E},j.state))}),j.triggerSyncEvent({dataStartIndex:S,dataEndIndex:N})}}),xe(j,"handleMouseEnter",function(k){var S=j.getMouseInfo(k);if(S){var N=G(G({},S),{},{isTooltipActive:!0});j.setState(N),j.triggerSyncEvent(N);var E=j.props.onMouseEnter;Ce(E)&&E(N,k)}}),xe(j,"triggeredAfterMouseMove",function(k){var S=j.getMouseInfo(k),N=S?G(G({},S),{},{isTooltipActive:!0}):{isTooltipActive:!1};j.setState(N),j.triggerSyncEvent(N);var E=j.props.onMouseMove;Ce(E)&&E(N,k)}),xe(j,"handleItemMouseEnter",function(k){j.setState(function(){return{isTooltipActive:!0,activeItem:k,activePayload:k.tooltipPayload,activeCoordinate:k.tooltipPosition||{x:k.cx,y:k.cy}}})}),xe(j,"handleItemMouseLeave",function(){j.setState(function(){return{isTooltipActive:!1}})}),xe(j,"handleMouseMove",function(k){k.persist(),j.throttleTriggeredAfterMouseMove(k)}),xe(j,"handleMouseLeave",function(k){j.throttleTriggeredAfterMouseMove.cancel();var S={isTooltipActive:!1};j.setState(S),j.triggerSyncEvent(S);var N=j.props.onMouseLeave;Ce(N)&&N(S,k)}),xe(j,"handleOuterEvent",function(k){var S=tme(k),N=Nn(j.props,"".concat(S));if(S&&Ce(N)){var E,A;/.*touch.*/i.test(S)?A=j.getMouseInfo(k.changedTouches[0]):A=j.getMouseInfo(k),N((E=A)!==null&&E!==void 0?E:{},k)}}),xe(j,"handleClick",function(k){var S=j.getMouseInfo(k);if(S){var N=G(G({},S),{},{isTooltipActive:!0});j.setState(N),j.triggerSyncEvent(N);var E=j.props.onClick;Ce(E)&&E(N,k)}}),xe(j,"handleMouseDown",function(k){var S=j.props.onMouseDown;if(Ce(S)){var N=j.getMouseInfo(k);S(N,k)}}),xe(j,"handleMouseUp",function(k){var S=j.props.onMouseUp;if(Ce(S)){var N=j.getMouseInfo(k);S(N,k)}}),xe(j,"handleTouchMove",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&j.throttleTriggeredAfterMouseMove(k.changedTouches[0])}),xe(j,"handleTouchStart",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&j.handleMouseDown(k.changedTouches[0])}),xe(j,"handleTouchEnd",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&j.handleMouseUp(k.changedTouches[0])}),xe(j,"handleDoubleClick",function(k){var S=j.props.onDoubleClick;if(Ce(S)){var N=j.getMouseInfo(k);S(N,k)}}),xe(j,"handleContextMenu",function(k){var S=j.props.onContextMenu;if(Ce(S)){var N=j.getMouseInfo(k);S(N,k)}}),xe(j,"triggerSyncEvent",function(k){j.props.syncId!==void 0&&tj.emit(rj,j.props.syncId,k,j.eventEmitterSymbol)}),xe(j,"applySyncEvent",function(k){var S=j.props,N=S.layout,E=S.syncMethod,A=j.state.updateId,C=k.dataStartIndex,M=k.dataEndIndex;if(k.dataStartIndex!==void 0||k.dataEndIndex!==void 0)j.setState(G({dataStartIndex:C,dataEndIndex:M},p({props:j.props,dataStartIndex:C,dataEndIndex:M,updateId:A},j.state)));else if(k.activeTooltipIndex!==void 0){var T=k.chartX,P=k.chartY,D=k.activeTooltipIndex,$=j.state,L=$.offset,I=$.tooltipTicks;if(!L)return;if(typeof E=="function")D=E(I,k);else if(E==="value"){D=-1;for(var R=0;R<I.length;R++)if(I[R].value===k.activeLabel){D=R;break}}var z=G(G({},L),{},{x:L.left,y:L.top}),V=Math.min(T,z.x+z.width),B=Math.min(P,z.y+z.height),W=I[D]&&I[D].value,K=u2(j.state,j.props.data,D),Q=I[D]?{x:N==="horizontal"?I[D].coordinate:V,y:N==="horizontal"?B:I[D].coordinate}:oq;j.setState(G(G({},k),{},{activeLabel:W,activeCoordinate:Q,activePayload:K,activeTooltipIndex:D}))}else j.setState(k)}),xe(j,"renderCursor",function(k){var S,N=j.state,E=N.isTooltipActive,A=N.activeCoordinate,C=N.activePayload,M=N.offset,T=N.activeTooltipIndex,P=N.tooltipAxisBandSize,D=j.getTooltipEventType(),$=(S=k.props.active)!==null&&S!==void 0?S:E,L=j.props.layout,I=k.key||"_recharts-cursor";return O.createElement(kNe,{key:I,activeCoordinate:A,activePayload:C,activeTooltipIndex:T,chartName:r,element:k,isActive:$,layout:L,offset:M,tooltipAxisBandSize:P,tooltipEventType:D})}),xe(j,"renderPolarAxis",function(k,S,N){var E=Nn(k,"type.axisType"),A=Nn(j.state,"".concat(E,"Map")),C=k.type.defaultProps,M=C!==void 0?G(G({},C),k.props):k.props,T=A&&A[M["".concat(E,"Id")]];return _.cloneElement(k,G(G({},T),{},{className:Fe(E,T.className),key:k.key||"".concat(S,"-").concat(N),ticks:Ba(T,!0)}))}),xe(j,"renderPolarGrid",function(k){var S=k.props,N=S.radialLines,E=S.polarAngles,A=S.polarRadius,C=j.state,M=C.radiusAxisMap,T=C.angleAxisMap,P=zi(M),D=zi(T),$=D.cx,L=D.cy,I=D.innerRadius,R=D.outerRadius;return _.cloneElement(k,{polarAngles:Array.isArray(E)?E:Ba(D,!0).map(function(z){return z.coordinate}),polarRadius:Array.isArray(A)?A:Ba(P,!0).map(function(z){return z.coordinate}),cx:$,cy:L,innerRadius:I,outerRadius:R,key:k.key||"polar-grid",radialLines:N})}),xe(j,"renderLegend",function(){var k=j.state.formattedGraphicalItems,S=j.props,N=S.children,E=S.width,A=S.height,C=j.props.margin||{},M=E-(C.left||0)-(C.right||0),T=J9({children:N,formattedGraphicalItems:k,legendWidth:M,legendContent:c});if(!T)return null;var P=T.item,D=k3(T,_Ne);return _.cloneElement(P,G(G({},D),{},{chartWidth:E,chartHeight:A,margin:C,onBBoxUpdate:j.handleLegendBBoxUpdate}))}),xe(j,"renderTooltip",function(){var k,S=j.props,N=S.children,E=S.accessibilityLayer,A=Yr(N,da);if(!A)return null;var C=j.state,M=C.isTooltipActive,T=C.activeCoordinate,P=C.activePayload,D=C.activeLabel,$=C.offset,L=(k=A.props.active)!==null&&k!==void 0?k:M;return _.cloneElement(A,{viewBox:G(G({},$),{},{x:$.left,y:$.top}),active:L,label:D,payload:L?P:[],coordinate:T,accessibilityLayer:E})}),xe(j,"renderBrush",function(k){var S=j.props,N=S.margin,E=S.data,A=j.state,C=A.offset,M=A.dataStartIndex,T=A.dataEndIndex,P=A.updateId;return _.cloneElement(k,{key:k.key||"_recharts-brush",onChange:Bh(j.handleBrushChange,k.props.onChange),data:E,x:J(k.props.x)?k.props.x:C.left,y:J(k.props.y)?k.props.y:C.top+C.height+C.brushBottom-(N.bottom||0),width:J(k.props.width)?k.props.width:C.width,startIndex:M,endIndex:T,updateId:"brush-".concat(P)})}),xe(j,"renderReferenceElement",function(k,S,N){if(!k)return null;var E=j,A=E.clipPathId,C=j.state,M=C.xAxisMap,T=C.yAxisMap,P=C.offset,D=k.type.defaultProps||{},$=k.props,L=$.xAxisId,I=L===void 0?D.xAxisId:L,R=$.yAxisId,z=R===void 0?D.yAxisId:R;return _.cloneElement(k,{key:k.key||"".concat(S,"-").concat(N),xAxis:M[I],yAxis:T[z],viewBox:{x:P.left,y:P.top,width:P.width,height:P.height},clipPathId:A})}),xe(j,"renderActivePoints",function(k){var S=k.item,N=k.activePoint,E=k.basePoint,A=k.childIndex,C=k.isRange,M=[],T=S.props.key,P=S.item.type.defaultProps!==void 0?G(G({},S.item.type.defaultProps),S.item.props):S.item.props,D=P.activeDot,$=P.dataKey,L=G(G({index:A,dataKey:$,cx:N.x,cy:N.y,r:4,fill:jE(S.item),strokeWidth:2,stroke:"#fff",payload:N.payload,value:N.value},Ie(D,!1)),vm(D));return M.push(x.renderActiveDot(D,L,"".concat(T,"-activePoint-").concat(A))),E?M.push(x.renderActiveDot(D,G(G({},L),{},{cx:E.x,cy:E.y}),"".concat(T,"-basePoint-").concat(A))):C&&M.push(null),M}),xe(j,"renderGraphicChild",function(k,S,N){var E=j.filterFormatItem(k,S,N);if(!E)return null;var A=j.getTooltipEventType(),C=j.state,M=C.isTooltipActive,T=C.tooltipAxis,P=C.activeTooltipIndex,D=C.activeLabel,$=j.props.children,L=Yr($,da),I=E.props,R=I.points,z=I.isRange,V=I.baseLine,B=E.item.type.defaultProps!==void 0?G(G({},E.item.type.defaultProps),E.item.props):E.item.props,W=B.activeDot,K=B.hide,Q=B.activeBar,ae=B.activeShape,pe=!!(!K&&M&&L&&(W||Q||ae)),ve={};A!=="axis"&&L&&L.props.trigger==="click"?ve={onClick:Bh(j.handleItemMouseEnter,k.props.onClick)}:A!=="axis"&&(ve={onMouseLeave:Bh(j.handleItemMouseLeave,k.props.onMouseLeave),onMouseEnter:Bh(j.handleItemMouseEnter,k.props.onMouseEnter)});var Y=_.cloneElement(k,G(G({},E.props),ve));function ee(lt){return typeof T.dataKey=="function"?T.dataKey(lt.payload):null}if(pe)if(P>=0){var fe,H;if(T.dataKey&&!T.allowDuplicatedCategory){var je=typeof T.dataKey=="function"?ee:"payload.".concat(T.dataKey.toString());fe=ym(R,je,D),H=z&&V&&ym(V,je,D)}else fe=R==null?void 0:R[P],H=z&&V&&V[P];if(ae||Q){var ye=k.props.activeIndex!==void 0?k.props.activeIndex:P;return[_.cloneElement(k,G(G(G({},E.props),ve),{},{activeIndex:ye})),null,null]}if(!Re(fe))return[Y].concat(xc(j.renderActivePoints({item:E,activePoint:fe,basePoint:H,childIndex:P,isRange:z})))}else{var se,ke=(se=j.getItemByXY(j.state.activeCoordinate))!==null&&se!==void 0?se:{graphicalItem:Y},ne=ke.graphicalItem,ie=ne.item,qe=ie===void 0?k:ie,rr=ne.childIndex,zt=G(G(G({},E.props),ve),{},{activeIndex:rr});return[_.cloneElement(qe,zt),null,null]}return z?[Y,null,null]:[Y,null]}),xe(j,"renderCustomized",function(k,S,N){return _.cloneElement(k,G(G({key:"recharts-customized-".concat(N)},j.props),j.state))}),xe(j,"renderMap",{CartesianGrid:{handler:Wh,once:!0},ReferenceArea:{handler:j.renderReferenceElement},ReferenceLine:{handler:Wh},ReferenceDot:{handler:j.renderReferenceElement},XAxis:{handler:Wh},YAxis:{handler:Wh},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((v=y.id)!==null&&v!==void 0?v:zf("recharts"),"-clip"),j.throttleTriggeredAfterMouseMove=r9(j.triggeredAfterMouseMove,(w=y.throttleDelay)!==null&&w!==void 0?w:1e3/60),j.state={},j}return INe(x,b),MNe(x,[{key:"componentDidMount",value:function(){var v,w;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(v=this.props.margin.left)!==null&&v!==void 0?v:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var v=this.props,w=v.children,j=v.data,k=v.height,S=v.layout,N=Yr(w,da);if(N){var E=N.props.defaultIndex;if(!(typeof E!="number"||E<0||E>this.state.tooltipTicks.length-1)){var A=this.state.tooltipTicks[E]&&this.state.tooltipTicks[E].value,C=u2(this.state,j,E,A),M=this.state.tooltipTicks[E].coordinate,T=(this.state.offset.top+k)/2,P=S==="horizontal",D=P?{x:M,y:T}:{y:M,x:T},$=this.state.formattedGraphicalItems.find(function(I){var R=I.item;return R.type.name==="Scatter"});$&&(D=G(G({},D),$.props.points[E].tooltipPosition),C=$.props.points[E].tooltipPayload);var L={activeTooltipIndex:E,isTooltipActive:!0,activeLabel:A,activePayload:C,activeCoordinate:D};this.setState(L),this.renderCursor(N),this.accessibilityManager.setIndex(E)}}}},{key:"getSnapshotBeforeUpdate",value:function(v,w){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==w.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==v.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==v.margin){var j,k;this.accessibilityManager.setDetails({offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0}})}return null}},{key:"componentDidUpdate",value:function(v){YS([Yr(v.children,da)],[Yr(this.props.children,da)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var v=Yr(this.props.children,da);if(v&&typeof v.props.shared=="boolean"){var w=v.props.shared?"axis":"item";return o.indexOf(w)>=0?w:i}return i}},{key:"getMouseInfo",value:function(v){if(!this.container)return null;var w=this.container,j=w.getBoundingClientRect(),k=hye(j),S={chartX:Math.round(v.pageX-k.left),chartY:Math.round(v.pageY-k.top)},N=j.width/w.offsetWidth||1,E=this.inRange(S.chartX,S.chartY,N);if(!E)return null;var A=this.state,C=A.xAxisMap,M=A.yAxisMap,T=this.getTooltipEventType(),P=N3(this.state,this.props.data,this.props.layout,E);if(T!=="axis"&&C&&M){var D=zi(C).scale,$=zi(M).scale,L=D&&D.invert?D.invert(S.chartX):null,I=$&&$.invert?$.invert(S.chartY):null;return G(G({},S),{},{xValue:L,yValue:I},P)}return P?G(G({},S),P):null}},{key:"inRange",value:function(v,w){var j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=this.props.layout,S=v/j,N=w/j;if(k==="horizontal"||k==="vertical"){var E=this.state.offset,A=S>=E.left&&S<=E.left+E.width&&N>=E.top&&N<=E.top+E.height;return A?{x:S,y:N}:null}var C=this.state,M=C.angleAxisMap,T=C.radiusAxisMap;if(M&&T){var P=zi(M);return c5({x:S,y:N},P)}return null}},{key:"parseEventsOfWrapper",value:function(){var v=this.props.children,w=this.getTooltipEventType(),j=Yr(v,da),k={};j&&w==="axis"&&(j.props.trigger==="click"?k={onClick:this.handleClick}:k={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=vm(this.props,this.handleOuterEvent);return G(G({},S),k)}},{key:"addListener",value:function(){tj.on(rj,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){tj.removeListener(rj,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(v,w,j){for(var k=this.state.formattedGraphicalItems,S=0,N=k.length;S<N;S++){var E=k[S];if(E.item===v||E.props.key===v.key||w===Wa(E.item.type)&&j===E.childIndex)return E}return null}},{key:"renderClipPath",value:function(){var v=this.clipPathId,w=this.state.offset,j=w.left,k=w.top,S=w.height,N=w.width;return O.createElement("defs",null,O.createElement("clipPath",{id:v},O.createElement("rect",{x:j,y:k,height:S,width:N})))}},{key:"getXScales",value:function(){var v=this.state.xAxisMap;return v?Object.entries(v).reduce(function(w,j){var k=S3(j,2),S=k[0],N=k[1];return G(G({},w),{},xe({},S,N.scale))},{}):null}},{key:"getYScales",value:function(){var v=this.state.yAxisMap;return v?Object.entries(v).reduce(function(w,j){var k=S3(j,2),S=k[0],N=k[1];return G(G({},w),{},xe({},S,N.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(v){var w;return(w=this.state.xAxisMap)===null||w===void 0||(w=w[v])===null||w===void 0?void 0:w.scale}},{key:"getYScaleByAxisId",value:function(v){var w;return(w=this.state.yAxisMap)===null||w===void 0||(w=w[v])===null||w===void 0?void 0:w.scale}},{key:"getItemByXY",value:function(v){var w=this.state,j=w.formattedGraphicalItems,k=w.activeItem;if(j&&j.length)for(var S=0,N=j.length;S<N;S++){var E=j[S],A=E.props,C=E.item,M=C.type.defaultProps!==void 0?G(G({},C.type.defaultProps),C.props):C.props,T=Wa(C.type);if(T==="Bar"){var P=(A.data||[]).find(function(I){return iSe(v,I)});if(P)return{graphicalItem:E,payload:P}}else if(T==="RadialBar"){var D=(A.data||[]).find(function(I){return c5(v,I)});if(D)return{graphicalItem:E,payload:D}}else if(Og(E,k)||Mg(E,k)||ff(E,k)){var $=XSe({graphicalItem:E,activeTooltipItem:k,itemData:M.data}),L=M.activeIndex===void 0?$:M.activeIndex;return{graphicalItem:G(G({},E),{},{childIndex:L}),payload:ff(E,k)?M.data[$]:E.props.data[$]}}}return null}},{key:"render",value:function(){var v=this;if(!DD(this))return null;var w=this.props,j=w.children,k=w.className,S=w.width,N=w.height,E=w.style,A=w.compact,C=w.title,M=w.desc,T=k3(w,NNe),P=Ie(T,!1);if(A)return O.createElement(i3,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},O.createElement(ZS,vl({},P,{width:S,height:N,title:C,desc:M}),this.renderClipPath(),LD(j,this.renderMap)));if(this.props.accessibilityLayer){var D,$;P.tabIndex=(D=this.props.tabIndex)!==null&&D!==void 0?D:0,P.role=($=this.props.role)!==null&&$!==void 0?$:"application",P.onKeyDown=function(I){v.accessibilityManager.keyboardEvent(I)},P.onFocus=function(){v.accessibilityManager.focus()}}var L=this.parseEventsOfWrapper();return O.createElement(i3,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},O.createElement("div",vl({className:Fe("recharts-wrapper",k),style:G({position:"relative",cursor:"default",width:S,height:N},E)},L,{ref:function(R){v.container=R}}),O.createElement(ZS,vl({},P,{width:S,height:N,title:C,desc:M,style:qNe}),this.renderClipPath(),LD(j,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(_.Component);xe(g,"displayName",r),xe(g,"defaultProps",G({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),xe(g,"getDerivedStateFromProps",function(b,x){var y=b.dataKey,v=b.data,w=b.children,j=b.width,k=b.height,S=b.layout,N=b.stackOffset,E=b.margin,A=x.dataStartIndex,C=x.dataEndIndex;if(x.updateId===void 0){var M=E3(b);return G(G(G({},M),{},{updateId:0},p(G(G({props:b},M),{},{updateId:0}),x)),{},{prevDataKey:y,prevData:v,prevWidth:j,prevHeight:k,prevLayout:S,prevStackOffset:N,prevMargin:E,prevChildren:w})}if(y!==x.prevDataKey||v!==x.prevData||j!==x.prevWidth||k!==x.prevHeight||S!==x.prevLayout||N!==x.prevStackOffset||!Ol(E,x.prevMargin)){var T=E3(b),P={chartX:x.chartX,chartY:x.chartY,isTooltipActive:x.isTooltipActive},D=G(G({},N3(x,v,S)),{},{updateId:x.updateId+1}),$=G(G(G({},T),P),D);return G(G(G({},$),p(G({props:b},$),x)),{},{prevDataKey:y,prevData:v,prevWidth:j,prevHeight:k,prevLayout:S,prevStackOffset:N,prevMargin:E,prevChildren:w})}if(!YS(w,x.prevChildren)){var L,I,R,z,V=Yr(w,cc),B=V&&(L=(I=V.props)===null||I===void 0?void 0:I.startIndex)!==null&&L!==void 0?L:A,W=V&&(R=(z=V.props)===null||z===void 0?void 0:z.endIndex)!==null&&R!==void 0?R:C,K=B!==A||W!==C,Q=!Re(v),ae=Q&&!K?x.updateId:x.updateId+1;return G(G({updateId:ae},p(G(G({props:b},x),{},{updateId:ae,dataStartIndex:B,dataEndIndex:W}),x)),{},{prevChildren:w,dataStartIndex:B,dataEndIndex:W})}return null}),xe(g,"renderActiveDot",function(b,x,y){var v;return _.isValidElement(b)?v=_.cloneElement(b,x):Ce(b)?v=b(x):v=O.createElement(kE,x),O.createElement(It,{className:"recharts-active-dot",key:y},v)});var m=_.forwardRef(function(x,y){return O.createElement(g,vl({},x,{ref:y}))});return m.displayName=g.displayName,m},eEe=JNe({chartName:"LineChart",GraphicalChild:Hf,axisComponents:[{axisType:"xAxis",AxisComp:zg},{axisType:"yAxis",AxisComp:Fg}],formatAxisMap:r2e});function C3({projectId:e}){const[t,r]=_.useState([]),[n,a]=_.useState(!0),[i,s]=_.useState(null);if(_.useEffect(()=>{e&&(async()=>{a(!0);try{const d=await(await _e(`/api/projects/${e}/metrics?limit=500`)).json();r(Array.isArray(d==null?void 0:d.metrics)?d.metrics:[])}catch(c){console.error("Failed to load project metrics",c),s("Unable to load metrics")}finally{a(!1)}})()},[e]),n)return u.jsx(rEe,{});if(i)return u.jsx(nEe,{error:i});if(!t.length)return u.jsx(aEe,{});const o=t.reduce((l,c)=>(l[c.model_name]||(l[c.model_name]=[]),l[c.model_name].push(c),l),{});return u.jsx("div",{className:"space-y-8",children:Object.entries(o).map(([l,c])=>u.jsx(tEe,{modelName:l,metrics:c},l))})}function tEe({modelName:e,metrics:t}){const r=[...t].sort((d,f)=>new Date(d.created_at)-new Date(f.created_at)),n=r[r.length-1],a=r.reduce((d,f)=>{const h=f.created_at;return d[h]||(d[h]={timestamp:h,displayDate:wt(new Date(h),"MMM d HH:mm"),tags:f.tags,run_id:f.run_id,environment:f.environment}),d[h][f.metric_name]=typeof f.metric_value=="number"?parseFloat(f.metric_value.toFixed(4)):f.metric_value,d},{}),i=Object.values(a),o=[...new Set(t.map(d=>d.metric_name))].filter(d=>i.some(f=>typeof f[d]=="number")),l=o.filter(d=>!d.includes("latency")&&!d.includes("loss")),c=o.filter(d=>d.includes("latency"));return u.jsxs(ze,{className:"overflow-hidden border-slate-200 dark:border-slate-800",children:[u.jsxs("div",{className:"p-4 border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-800/50 flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"p-2 bg-purple-100 dark:bg-purple-900/30 rounded-lg",children:u.jsx(Nr,{className:"w-5 h-5 text-purple-600 dark:text-purple-400"})}),u.jsxs("div",{children:[u.jsx("h3",{className:"font-semibold text-slate-900 dark:text-white",children:e}),u.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-500",children:[u.jsx(tt,{size:12}),"Last updated: ",wt(new Date(n.created_at),"MMM d, yyyy HH:mm")]})]})]}),u.jsxs("div",{className:"flex gap-2",children:[n.environment&&u.jsx(Ot,{variant:"outline",className:"bg-white dark:bg-slate-800",children:n.environment}),u.jsxs(Ot,{className:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-300 border-0",children:[i.length," logs"]})]})]}),u.jsxs("div",{className:"p-6 grid grid-cols-1 lg:grid-cols-3 gap-6",children:[u.jsxs("div",{className:"space-y-4",children:[u.jsx("h4",{className:"text-sm font-medium text-slate-500 uppercase tracking-wider",children:"Latest Performance"}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.map(d=>u.jsxs("div",{className:"p-3 bg-slate-50 dark:bg-slate-800/50 rounded-lg border border-slate-100 dark:border-slate-800",children:[u.jsx("p",{className:"text-xs text-slate-500 mb-1 capitalize",children:d.replace(/_/g," ")}),u.jsx("p",{className:"text-lg font-bold text-slate-900 dark:text-white",children:i[i.length-1][d]})]},d)),c.map(d=>u.jsxs("div",{className:"p-3 bg-slate-50 dark:bg-slate-800/50 rounded-lg border border-slate-100 dark:border-slate-800",children:[u.jsx("p",{className:"text-xs text-slate-500 mb-1 capitalize",children:d.replace(/_/g," ")}),u.jsxs("p",{className:"text-lg font-bold text-slate-900 dark:text-white",children:[i[i.length-1][d]," ",u.jsx("span",{className:"text-xs font-normal text-slate-400",children:"ms"})]})]},d))]})]}),u.jsx("div",{className:"lg:col-span-2 space-y-6",children:l.length>0&&u.jsxs("div",{className:"h-[250px] w-full",children:[u.jsx("h4",{className:"text-sm font-medium text-slate-500 uppercase tracking-wider mb-4",children:"Score Trends"}),u.jsx(sye,{width:"100%",height:"100%",children:u.jsxs(eEe,{data:i,children:[u.jsx(WV,{strokeDasharray:"3 3",stroke:"#e2e8f0",vertical:!1}),u.jsx(zg,{dataKey:"displayDate",stroke:"#94a3b8",fontSize:12,tickLine:!1,axisLine:!1}),u.jsx(Fg,{domain:[0,1],stroke:"#94a3b8",fontSize:12,tickLine:!1,axisLine:!1}),u.jsx(da,{contentStyle:{backgroundColor:"#fff",borderRadius:"8px",border:"1px solid #e2e8f0",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)"},itemStyle:{fontSize:"12px"}}),u.jsx(ro,{}),l.map((d,f)=>u.jsx(Hf,{type:"monotone",dataKey:d,stroke:Gh[f%Gh.length],strokeWidth:2,dot:{r:3,fill:Gh[f%Gh.length]},activeDot:{r:5}},d))]})})]})})]})]})}const Gh=["#8b5cf6","#3b82f6","#10b981","#f59e0b","#ef4444","#ec4899"];function rEe(){return u.jsx("div",{className:"h-64 flex items-center justify-center border border-dashed border-slate-200 dark:border-slate-700 rounded-xl",children:u.jsxs("div",{className:"flex flex-col items-center gap-3",children:[u.jsx(Ge,{className:"w-8 h-8 text-primary-500 animate-spin"}),u.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:"Loading metrics..."})]})})}function nEe({error:e}){return u.jsx("div",{className:"h-64 flex items-center justify-center border border-rose-200 dark:border-rose-900 bg-rose-50 dark:bg-rose-900/10 rounded-xl",children:u.jsx("p",{className:"text-rose-600 dark:text-rose-400",children:e})})}function aEe(){return u.jsx("div",{className:"h-64 flex items-center justify-center border border-dashed border-slate-200 dark:border-slate-700 rounded-xl",children:u.jsxs("div",{className:"text-center",children:[u.jsx(BarChart2,{className:"w-12 h-12 text-slate-300 mx-auto mb-3"}),u.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:"No metrics logged yet"}),u.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"Run a pipeline with model evaluation to see metrics here"})]})})}function iEe({projectId:e}){const[t,r]=_.useState([]),[n,a]=_.useState(!0);_.useEffect(()=>{e&&(async()=>{try{const l=await(await _e(`/api/experiments?project=${e}`)).json();l.experiments&&Array.isArray(l.experiments)?r(l.experiments):r([])}catch(o){console.error("Failed to fetch experiments:",o)}finally{a(!1)}})()},[e]);const i=[{key:"name",label:"Name",sortable:!0,render:s=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ea,{className:"w-4 h-4 text-purple-500"}),u.jsxs("div",{children:[u.jsx("div",{className:"font-medium text-slate-900 dark:text-white",children:s.name}),s.description&&u.jsx("div",{className:"text-xs text-slate-500 truncate max-w-[200px]",children:s.description})]})]})},{key:"run_count",label:"Runs",sortable:!0,render:s=>u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(Or,{className:"w-3 h-3 text-slate-400"}),u.jsx("span",{children:s.run_count||0})]})},{key:"created_at",label:"Created",sortable:!0,render:s=>u.jsxs("div",{className:"flex items-center gap-1 text-slate-500",children:[u.jsx(tt,{className:"w-3 h-3"}),u.jsx("span",{children:ri(s.created_at)})]})},{key:"tags",label:"Tags",render:s=>u.jsx("div",{className:"flex flex-wrap gap-1",children:Object.entries(s.tags||{}).map(([o,l])=>u.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400",children:[u.jsx(Xp,{className:"w-3 h-3 mr-1"}),o,": ",l]},o))})}];return u.jsx(Cc,{items:t,loading:n,columns:i,initialView:"table",searchKeys:["name","description"],renderGrid:s=>u.jsxs("div",{className:"p-4 bg-white dark:bg-slate-800 rounded-lg border border-slate-200 dark:border-slate-700 hover:shadow-md transition-shadow",children:[u.jsxs("div",{className:"flex items-start justify-between mb-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"p-2 bg-purple-50 dark:bg-purple-900/20 rounded-lg",children:u.jsx(ea,{className:"w-5 h-5 text-purple-500"})}),u.jsxs("div",{children:[u.jsx("h3",{className:"font-medium text-slate-900 dark:text-white",children:s.name}),u.jsxs("div",{className:"text-xs text-slate-500 flex items-center gap-1",children:[u.jsx(tt,{className:"w-3 h-3"}),ri(s.created_at)]})]})]}),u.jsxs("div",{className:"flex items-center gap-1 text-xs font-medium bg-slate-100 dark:bg-slate-800 px-2 py-1 rounded-full",children:[u.jsx(Or,{className:"w-3 h-3"}),s.run_count||0," runs"]})]}),s.description&&u.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400 mb-3 line-clamp-2",children:s.description}),u.jsx("div",{className:"flex flex-wrap gap-1",children:Object.entries(s.tags||{}).map(([o,l])=>u.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400",children:[o,": ",l]},o))})]}),emptyState:u.jsxs("div",{className:"text-center py-12",children:[u.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-slate-100 dark:bg-slate-800 mb-4",children:u.jsx(ea,{className:"w-6 h-6 text-slate-400"})}),u.jsx("h3",{className:"text-lg font-medium text-slate-900 dark:text-white mb-1",children:"No experiments found"}),u.jsx("p",{className:"text-slate-500",children:"Create an experiment to track your model development."})]})})}const A3=({status:e})=>{switch(e==null?void 0:e.toLowerCase()){case"completed":case"success":return u.jsx(Lt,{className:"w-4 h-4 text-green-500"});case"failed":return u.jsx(pr,{className:"w-4 h-4 text-red-500"});case"running":return u.jsx(Ul,{className:"w-4 h-4 text-blue-500 animate-spin"});default:return u.jsx(Sc,{className:"w-4 h-4 text-slate-400"})}};function T3({projectId:e}){const[t,r]=_.useState([]),[n,a]=_.useState(!0);_.useEffect(()=>{e&&(async()=>{try{const l=await(await _e(`/api/runs?project=${e}`)).json();r(Array.isArray(l==null?void 0:l.runs)?l.runs:[])}catch(o){console.error("Failed to fetch runs:",o)}finally{a(!1)}})()},[e]);const i=[{header:"Run Name",key:"name",render:s=>u.jsxs(st,{to:`/runs/${s.run_id}`,className:"flex items-center gap-3 group",children:[u.jsx("div",{className:"p-2 bg-slate-100 dark:bg-slate-700 rounded-lg group-hover:bg-slate-200 dark:group-hover:bg-slate-600 transition-colors",children:u.jsx(tt,{className:"w-4 h-4 text-slate-500"})}),u.jsxs("div",{children:[u.jsx("div",{className:"font-medium text-slate-900 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors",children:s.name||s.run_id.substring(0,8)}),u.jsx("div",{className:"text-xs text-slate-500",children:s.pipeline_name})]})]})},{header:"Status",key:"status",render:s=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(A3,{status:s.status}),u.jsx("span",{className:"capitalize text-sm",children:s.status})]})},{header:"Created",key:"created",render:s=>u.jsx("span",{className:"text-slate-500 text-sm",children:ri(s.created,"MMM d, yyyy HH:mm")})}];return u.jsx(Cc,{items:t,loading:n,columns:i,initialView:"table",renderGrid:s=>u.jsx(st,{to:`/runs/${s.run_id}`,className:"block",children:u.jsxs("div",{className:"group p-5 bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 hover:border-blue-500/50 hover:shadow-md transition-all duration-300",children:[u.jsxs("div",{className:"flex items-start justify-between mb-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(A3,{status:s.status}),u.jsx("span",{className:`text-sm font-medium capitalize ${s.status==="completed"?"text-green-600 dark:text-green-400":s.status==="failed"?"text-red-600 dark:text-red-400":"text-slate-600 dark:text-slate-400"}`,children:s.status})]}),u.jsx("span",{className:"text-xs font-mono text-slate-400 bg-slate-50 dark:bg-slate-900 px-2 py-1 rounded",children:s.run_id.substring(0,8)})]}),u.jsx("h3",{className:"font-semibold text-slate-900 dark:text-white mb-1 truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors",children:s.name||`Run ${s.run_id.substring(0,8)}`}),u.jsxs("p",{className:"text-sm text-slate-500 dark:text-slate-400 mb-4 flex items-center gap-1",children:[u.jsx("span",{className:"opacity-75",children:"Pipeline:"}),u.jsx("span",{className:"font-medium text-slate-700 dark:text-slate-300",children:s.pipeline_name})]}),u.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-500 dark:text-slate-400 pt-3 border-t border-slate-100 dark:border-slate-700/50",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(tt,{className:"w-3.5 h-3.5"}),u.jsx("span",{children:ri(s.created,"MMM d, HH:mm")})]}),s.duration&&u.jsxs("span",{children:[s.duration.toFixed(2),"s"]})]})]})}),emptyState:u.jsxs("div",{className:"text-center py-8",children:[u.jsx(tt,{className:"w-10 h-10 mx-auto text-slate-300 mb-2"}),u.jsx("p",{className:"text-slate-500",children:"No runs found for this project"})]})})}function O3({projectId:e}){const[t,r]=_.useState([]),[n,a]=_.useState(!0);_.useEffect(()=>{e&&(async()=>{try{const l=await(await _e(`/api/pipelines?project=${e}`)).json();r(Array.isArray(l==null?void 0:l.pipelines)?l.pipelines:[])}catch(o){console.error("Failed to fetch pipelines:",o)}finally{a(!1)}})()},[e]);const i=[{header:"Pipeline Name",key:"name",render:s=>u.jsxs(st,{to:`/pipelines/${s.id||s.name}`,className:"flex items-center gap-3 group",children:[u.jsx("div",{className:"p-2 bg-blue-500/10 rounded-lg group-hover:bg-blue-500/20 transition-colors",children:u.jsx(Ge,{className:"w-4 h-4 text-blue-500"})}),u.jsx("span",{className:"font-medium text-slate-900 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors",children:s.name})]})},{header:"Version",key:"version",render:s=>u.jsxs("span",{className:"px-2 py-1 bg-slate-100 dark:bg-slate-700 rounded text-xs font-medium",children:["v",s.version||"1.0"]})},{header:"Created",key:"created",render:s=>u.jsx("span",{className:"text-slate-500 text-sm",children:ri(s.created)})}];return u.jsx(Cc,{items:t,loading:n,columns:i,initialView:"table",renderGrid:s=>u.jsx(st,{to:`/pipelines/${s.id||s.name}`,className:"block",children:u.jsxs("div",{className:"group p-5 bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 hover:border-blue-500/50 hover:shadow-md transition-all duration-300",children:[u.jsxs("div",{className:"flex items-start justify-between mb-4",children:[u.jsx("div",{className:"p-2.5 bg-blue-50 dark:bg-blue-900/20 rounded-lg group-hover:bg-blue-100 dark:group-hover:bg-blue-900/40 transition-colors",children:u.jsx(Ge,{className:"w-6 h-6 text-blue-600 dark:text-blue-400"})}),u.jsxs("span",{className:"px-2.5 py-1 bg-slate-100 dark:bg-slate-700 rounded-full text-xs font-medium text-slate-600 dark:text-slate-300",children:["v",s.version||"1.0"]})]}),u.jsx("h3",{className:"font-semibold text-lg text-slate-900 dark:text-white mb-1 truncate",title:s.name,children:s.name}),u.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-slate-400 mt-4 pt-4 border-t border-slate-100 dark:border-slate-700/50",children:[u.jsx(tt,{className:"w-4 h-4"}),u.jsxs("span",{children:["Created ",ri(s.created)]})]})]})}),emptyState:u.jsxs("div",{className:"text-center py-8",children:[u.jsx(Ge,{className:"w-10 h-10 mx-auto text-slate-300 mb-2"}),u.jsx("p",{className:"text-slate-500",children:"No pipelines found for this project"})]})})}function sEe(){const{projectId:e}=p_(),[t,r]=_.useState(null),[n,a]=_.useState(null),[i,s]=_.useState(!0),[o,l]=_.useState("overview"),[c,d]=_.useState(null);_.useEffect(()=>{e&&(async()=>{try{const m=await(await _e(`/api/projects/${e}`)).json();m.pipelines&&!Array.isArray(m.pipelines)&&(m.pipelines=[]),r(m);const[b,x,y]=await Promise.all([_e(`/api/runs?project=${e}&limit=1000`),_e(`/api/assets?project=${e}&limit=1000`),_e(`/api/experiments?project=${e}`)]),v=await b.json(),w=await x.json(),j=await y.json(),k=Array.isArray(v==null?void 0:v.runs)?v.runs:[],S=Array.isArray(w==null?void 0:w.assets)?w.assets:[],N=Array.isArray(j==null?void 0:j.experiments)?j.experiments:[],E=new Set(k.map(C=>C.pipeline_name).filter(Boolean)),A=S.filter(C=>C.type==="Model");a({runs:k.length,pipelines:E.size,artifacts:S.length,models:A.length,experiments:N.length,total_storage_bytes:S.reduce((C,M)=>C+(M.size_bytes||0),0)})}catch(g){console.error("Failed to fetch project details:",g)}finally{s(!1)}})()},[e]);const f=p=>{d(p)},h=()=>{if(c)return u.jsx(b7,{asset:c,onClose:()=>d(null)});switch(o){case"overview":return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[u.jsx(Kh,{icon:Ge,label:"Total Runs",value:(n==null?void 0:n.runs)||0,color:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-900/20"}),u.jsx(Kh,{icon:Nr,label:"Models",value:(n==null?void 0:n.models)||0,color:"text-purple-500",bg:"bg-purple-50 dark:bg-purple-900/20"}),u.jsx(Kh,{icon:ea,label:"Experiments",value:(n==null?void 0:n.experiments)||0,color:"text-pink-500",bg:"bg-pink-50 dark:bg-pink-900/20"}),u.jsx(Kh,{icon:g_,label:"Storage",value:oEe((n==null?void 0:n.total_storage_bytes)||0),color:"text-slate-500",bg:"bg-slate-50 dark:bg-slate-800"})]}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[u.jsxs(ze,{className:"p-0 overflow-hidden border-slate-200 dark:border-slate-800",children:[u.jsxs("div",{className:"p-4 border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-800/50 flex items-center justify-between",children:[u.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-white flex items-center gap-2",children:[u.jsx(_d,{size:16,className:"text-slate-400"}),"Recent Pipelines"]}),u.jsx("button",{onClick:()=>l("pipelines"),className:"text-xs text-primary-600 hover:text-primary-700 font-medium",children:"View All"})]}),u.jsx("div",{className:"p-4",children:u.jsx(O3,{projectId:e,limit:5,compact:!0})})]}),u.jsxs(ze,{className:"p-0 overflow-hidden border-slate-200 dark:border-slate-800",children:[u.jsxs("div",{className:"p-4 border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-800/50 flex items-center justify-between",children:[u.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-white flex items-center gap-2",children:[u.jsx(Or,{size:16,className:"text-slate-400"}),"Recent Runs"]}),u.jsx("button",{onClick:()=>l("runs"),className:"text-xs text-primary-600 hover:text-primary-700 font-medium",children:"View All"})]}),u.jsx("div",{className:"p-4",children:u.jsx(T3,{projectId:e,limit:5,compact:!0})})]})]}),u.jsxs(ze,{className:"p-0 overflow-hidden border-slate-200 dark:border-slate-800",children:[u.jsx("div",{className:"p-4 border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-800/50",children:u.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-white flex items-center gap-2",children:[u.jsx(wa,{size:16,className:"text-slate-400"}),"Production Metrics"]})}),u.jsx("div",{className:"p-4",children:u.jsx(C3,{projectId:e})})]})]});case"pipelines":return u.jsx(O3,{projectId:e});case"runs":return u.jsx(T3,{projectId:e});case"experiments":return u.jsx(iEe,{projectId:e});case"metrics":return u.jsx(C3,{projectId:e});default:return null}};return u.jsxs("div",{className:"h-screen flex flex-col overflow-hidden bg-slate-50 dark:bg-slate-900",children:[u.jsx("div",{className:"bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 px-6 py-4 shrink-0",children:u.jsx(Spe,{project:t,stats:n,loading:i})}),u.jsx("div",{className:"flex-1 overflow-hidden",children:u.jsx("div",{className:"h-full max-w-[1800px] mx-auto px-6 py-6",children:u.jsxs("div",{className:"h-full flex gap-6",children:[u.jsxs("div",{className:"w-[380px] shrink-0 flex flex-col gap-4 overflow-y-auto pb-6",children:[u.jsxs("nav",{className:"space-y-1",children:[u.jsx(ju,{active:o==="overview"&&!c,onClick:()=>{l("overview"),d(null)},icon:f6,label:"Overview"}),u.jsx(ju,{active:o==="pipelines"&&!c,onClick:()=>{l("pipelines"),d(null)},icon:_d,label:"Pipelines"}),u.jsx(ju,{active:o==="runs"&&!c,onClick:()=>{l("runs"),d(null)},icon:Or,label:"Runs"}),u.jsx(ju,{active:o==="experiments"&&!c,onClick:()=>{l("experiments"),d(null)},icon:ea,label:"Experiments"}),u.jsx(ju,{active:o==="metrics"&&!c,onClick:()=>{l("metrics"),d(null)},icon:wa,label:"Metrics"})]}),u.jsxs("div",{className:"flex-1 min-h-0 bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden flex flex-col shadow-sm",children:[u.jsx("div",{className:"p-3 border-b border-slate-100 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-800/50",children:u.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Project Assets"})}),u.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:u.jsx(x7,{projectId:e,onAssetSelect:f,compact:!0})})]})]}),u.jsx("div",{className:"flex-1 min-w-0 bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden flex flex-col shadow-sm",children:u.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:u.jsx(iF,{children:u.jsx(hi,{mode:"wait",children:u.jsx(Me.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:"h-full",children:h()},c?"asset":o)})})})})]})})})]})}function ju({active:e,onClick:t,icon:r,label:n}){return u.jsxs("button",{onClick:t,className:`w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-all duration-200 ${e?"bg-primary-50 text-primary-700 dark:bg-primary-900/20 dark:text-primary-400 shadow-sm":"text-slate-600 dark:text-slate-400 hover:bg-slate-100 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-white"}`,children:[u.jsx(r,{size:18,className:e?"text-primary-600 dark:text-primary-400":"text-slate-400"}),n]})}function Kh({icon:e,label:t,value:r,color:n,bg:a}){return u.jsxs("div",{className:"bg-white dark:bg-slate-800 rounded-xl p-4 border border-slate-200 dark:border-slate-700 shadow-sm flex items-center gap-4",children:[u.jsx("div",{className:`p-3 rounded-lg ${a}`,children:u.jsx(e,{size:20,className:n})}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:t}),u.jsx("p",{className:"text-xl font-bold text-slate-900 dark:text-white",children:typeof r=="number"?r.toLocaleString():r})]})]})}function oEe(e){if(!e||e===0)return"0 B";const t=1024,r=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,n)).toFixed(1))+" "+r[n]}function lEe(){const{selectedProject:e}=fi(),[t,r]=_.useState([]),[n,a]=_.useState({registered:[],templates:[],metadata:[]}),[i,s]=_.useState(null),[o,l]=_.useState(!0),[c,d]=_.useState(!1),[f,h]=_.useState(!1),[p,g]=_.useState(null),[m,b]=_.useState([]),[x,y]=_.useState(!1),[v,w]=_.useState({name:"",pipeline_name:"",schedule_type:"daily",hour:0,minute:0,interval_seconds:3600,cron_expression:"* * * * *",timezone:"UTC",project_name:e||null});_.useEffect(()=>{j();const T=setInterval(j,1e4);return()=>clearInterval(T)},[e]);const j=async()=>{try{const T=e?`?project=${e}`:"",[P,D,$]=await Promise.all([fetch(`/api/schedules/${T}`),fetch(`/api/schedules/registered-pipelines${T}`),fetch("/api/schedules/health")]),L=await P.json(),I=await D.json();let R=null;$.ok&&(R=await $.json()),r(L),a(I),s(R)}catch(T){console.error("Failed to fetch data:",T)}finally{l(!1)}},k=async T=>{y(!0);try{const D=await(await fetch(`/api/schedules/${T}/history`)).json();b(D)}catch(P){console.error("Failed to fetch history:",P)}finally{y(!1)}},S=T=>{g(T),h(!0),k(T.pipeline_name)},N=async T=>{T.preventDefault();try{const P=await fetch("/api/schedules",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...v,project_name:e||null})});if(P.ok)d(!1),w({name:"",pipeline_name:"",schedule_type:"daily",hour:0,minute:0,interval_seconds:3600,cron_expression:"* * * * *",timezone:"UTC"}),j();else{const D=await P.json();alert(`Failed to create schedule: ${D.detail}`)}}catch(P){console.error("Failed to create schedule:",P)}},E=async(T,P)=>{try{await fetch(`/api/schedules/${T}/${P?"disable":"enable"}`,{method:"POST"}),j()}catch(D){console.error("Failed to toggle schedule:",D)}},A=async T=>{if(confirm(`Delete schedule "${T}"?`))try{await fetch(`/api/schedules/${T}`,{method:"DELETE"}),j()}catch(P){console.error("Failed to delete schedule:",P)}},C=[{header:"Pipeline",key:"pipeline_name",sortable:!0,render:T=>u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:`p-2 rounded-lg ${T.enabled?"bg-emerald-50 text-emerald-600":"bg-slate-100 text-slate-400"}`,children:u.jsx(tt,{size:16})}),u.jsxs("div",{children:[u.jsx("div",{className:"font-medium text-slate-900 dark:text-white",children:T.pipeline_name}),u.jsxs("div",{className:"text-xs text-slate-500 flex items-center gap-1",children:[u.jsx(Wp,{size:10})," ",T.timezone]})]})]})},{header:"Type",key:"schedule_type",sortable:!0,render:T=>u.jsxs("div",{className:"flex flex-col",children:[u.jsx(Ot,{variant:"secondary",className:"capitalize w-fit mb-1",children:T.schedule_type}),u.jsx("span",{className:"text-xs font-mono text-slate-500",children:T.schedule_value})]})},{header:"Next Run",key:"next_run",sortable:!0,render:T=>u.jsxs("div",{className:"flex items-center gap-2 text-slate-500",children:[u.jsx(kn,{size:14}),T.next_run?wt(new Date(T.next_run),"MMM d, HH:mm:ss"):"N/A"]})},{header:"Status",key:"enabled",sortable:!0,render:T=>u.jsxs("div",{className:`flex items-center gap-2 text-sm ${T.enabled?"text-emerald-600":"text-slate-400"}`,children:[T.enabled?u.jsx(Lt,{size:14}):u.jsx(pr,{size:14}),u.jsx("span",{className:"font-medium",children:T.enabled?"Active":"Paused"})]})},{header:"Actions",key:"actions",render:T=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{onClick:()=>S(T),className:"p-1.5 rounded-lg bg-blue-50 text-blue-600 hover:bg-blue-100 transition-colors",title:"History",children:u.jsx(wy,{size:16})}),u.jsx("button",{onClick:()=>E(T.pipeline_name,T.enabled),className:`p-1.5 rounded-lg transition-colors ${T.enabled?"bg-amber-50 text-amber-600 hover:bg-amber-100":"bg-emerald-50 text-emerald-600 hover:bg-emerald-100"}`,title:T.enabled?"Pause":"Resume",children:T.enabled?u.jsx(fC,{size:16}):u.jsx(hC,{size:16})}),u.jsx("button",{onClick:()=>A(T.pipeline_name),className:"p-1.5 rounded-lg bg-rose-50 text-rose-600 hover:bg-rose-100 transition-colors",title:"Delete",children:u.jsx(ho,{size:16})})]})}],M=T=>u.jsxs(ze,{className:"group hover:shadow-lg transition-all duration-200 border-l-4 border-l-transparent hover:border-l-primary-500 h-full",children:[u.jsxs("div",{className:"flex items-start justify-between mb-4",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:`p-3 rounded-xl ${T.enabled?"bg-emerald-50 text-emerald-600":"bg-slate-100 text-slate-400"}`,children:u.jsx(tt,{size:24})}),u.jsxs("div",{children:[u.jsx("h3",{className:"font-bold text-slate-900 dark:text-white truncate max-w-[150px]",title:T.pipeline_name,children:T.pipeline_name}),u.jsxs("div",{className:`text-xs font-medium flex items-center gap-1 ${T.enabled?"text-emerald-600":"text-slate-400"}`,children:[T.enabled?u.jsx(Lt,{size:12}):u.jsx(pr,{size:12}),T.enabled?"Active":"Paused"]})]})]}),u.jsx(Ot,{variant:"secondary",className:"capitalize",children:T.schedule_type})]}),u.jsxs("div",{className:"space-y-3 mb-4",children:[u.jsxs("div",{className:"flex items-center justify-between text-sm",children:[u.jsxs("span",{className:"text-slate-500 flex items-center gap-2",children:[u.jsx(kn,{size:14})," Next Run"]}),u.jsx("span",{className:"font-mono text-slate-700 dark:text-slate-300",children:T.next_run?wt(new Date(T.next_run),"MMM d, HH:mm"):"N/A"})]}),u.jsxs("div",{className:"flex items-center justify-between text-sm",children:[u.jsxs("span",{className:"text-slate-500 flex items-center gap-2",children:[u.jsx(Wp,{size:14})," Timezone"]}),u.jsx("span",{className:"text-slate-700 dark:text-slate-300",children:T.timezone})]})]}),u.jsxs("div",{className:"flex items-center gap-2 pt-4 border-t border-slate-100 dark:border-slate-700",children:[u.jsx(Se,{variant:"ghost",className:"text-blue-600 hover:bg-blue-50 hover:text-blue-700",onClick:()=>S(T),title:"History",children:u.jsx(wy,{size:16})}),u.jsx(Se,{variant:"outline",className:`flex-1 flex items-center justify-center gap-2 ${T.enabled?"text-amber-600 border-amber-200 hover:bg-amber-50":"text-emerald-600 border-emerald-200 hover:bg-emerald-50"}`,onClick:()=>E(T.pipeline_name,T.enabled),children:T.enabled?u.jsxs(u.Fragment,{children:[u.jsx(fC,{size:14})," Pause"]}):u.jsxs(u.Fragment,{children:[u.jsx(hC,{size:14})," Resume"]})}),u.jsx(Se,{variant:"ghost",className:"text-rose-600 hover:bg-rose-50 hover:text-rose-700",onClick:()=>A(T.pipeline_name),children:u.jsx(ho,{size:16})})]})]});return u.jsxs("div",{className:"p-6 max-w-7xl mx-auto",children:[i&&i.metrics&&u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4 mb-8",children:[u.jsxs(ze,{className:"p-4 flex items-center gap-4",children:[u.jsx("div",{className:`p-3 rounded-full ${i.status==="running"?"bg-emerald-100 text-emerald-600":"bg-rose-100 text-rose-600"}`,children:u.jsx(Ge,{size:24})}),u.jsxs("div",{children:[u.jsx("div",{className:"text-sm text-slate-500",children:"Scheduler Status"}),u.jsx("div",{className:"text-lg font-bold capitalize",children:i.status})]})]}),u.jsxs(ze,{className:"p-4",children:[u.jsx("div",{className:"text-sm text-slate-500 mb-1",children:"Total Runs"}),u.jsx("div",{className:"text-2xl font-bold",children:i.metrics.total_runs})]}),u.jsxs(ze,{className:"p-4",children:[u.jsx("div",{className:"text-sm text-slate-500 mb-1",children:"Success Rate"}),u.jsxs("div",{className:"text-2xl font-bold text-emerald-600",children:[(i.metrics.success_rate*100).toFixed(1),"%"]})]}),u.jsxs(ze,{className:"p-4",children:[u.jsx("div",{className:"text-sm text-slate-500 mb-1",children:"Active Schedules"}),u.jsxs("div",{className:"text-2xl font-bold",children:[i.enabled_schedules," / ",i.num_schedules]})]})]}),u.jsx(Cc,{title:"Schedules",subtitle:"Manage automated pipeline executions",items:t,loading:o,columns:C,renderGrid:M,actions:u.jsxs(Se,{onClick:()=>d(!0),className:"flex items-center gap-2",children:[u.jsx(Qi,{size:18}),"New Schedule"]}),emptyState:u.jsx(qN,{icon:kn,title:"No active schedules",description:"Automate your pipelines by creating a schedule.",action:u.jsx(Se,{onClick:()=>d(!0),children:"Create your first schedule"})})}),c&&u.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:u.jsxs("div",{className:"bg-white dark:bg-slate-800 p-6 rounded-2xl w-full max-w-md border border-slate-200 dark:border-slate-700 shadow-2xl animate-in fade-in zoom-in duration-200 max-h-[90vh] overflow-y-auto",children:[u.jsx("h2",{className:"text-xl font-bold mb-4 text-slate-900 dark:text-white",children:"Create Schedule"}),u.jsxs("form",{onSubmit:N,children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Schedule Name"}),u.jsx("input",{type:"text",value:v.name,onChange:T=>w({...v,name:T.target.value}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all",required:!0,placeholder:"e.g., daily_etl_job"})]}),u.jsxs("div",{className:"mb-4",children:[u.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Pipeline"}),u.jsxs("select",{value:v.pipeline_name,onChange:T=>w({...v,pipeline_name:T.target.value}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all",required:!0,children:[u.jsx("option",{value:"",children:"Select a pipeline..."}),n.registered.length>0&&u.jsx("optgroup",{label:`Registered Pipelines (${n.registered.length})`,children:n.registered.map(T=>u.jsx("option",{value:T,children:T},T))}),n.templates.length>0&&u.jsx("optgroup",{label:`Templates (${n.templates.length})`,children:n.templates.map(T=>u.jsx("option",{value:T,children:T},T))}),n.metadata.length>0&&u.jsx("optgroup",{label:`Historical Pipelines (${n.metadata.length})`,children:n.metadata.map(T=>u.jsx("option",{value:T,children:T},`meta-${T}`))})]}),n.registered.length===0&&n.templates.length===0&&n.metadata.length===0&&u.jsx("p",{className:"text-xs text-amber-600 mt-1",children:"No pipelines available. Run a pipeline first or register one using @register_pipeline."})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Type"}),u.jsxs("select",{value:v.schedule_type,onChange:T=>w({...v,schedule_type:T.target.value}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all",children:[u.jsx("option",{value:"daily",children:"Daily"}),u.jsx("option",{value:"hourly",children:"Hourly"}),u.jsx("option",{value:"interval",children:"Interval"}),u.jsx("option",{value:"cron",children:"Cron"})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Timezone"}),u.jsxs("select",{value:v.timezone,onChange:T=>w({...v,timezone:T.target.value}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all",children:[u.jsx("option",{value:"UTC",children:"UTC"}),u.jsx("option",{value:"America/New_York",children:"New York (EST/EDT)"}),u.jsx("option",{value:"America/Los_Angeles",children:"Los Angeles (PST/PDT)"}),u.jsx("option",{value:"Europe/London",children:"London (GMT/BST)"}),u.jsx("option",{value:"Europe/Paris",children:"Paris (CET/CEST)"}),u.jsx("option",{value:"Asia/Tokyo",children:"Tokyo (JST)"}),u.jsx("option",{value:"Asia/Shanghai",children:"Shanghai (CST)"})]})]})]}),v.schedule_type==="daily"&&u.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Hour (0-23)"}),u.jsx("input",{type:"number",min:"0",max:"23",value:v.hour,onChange:T=>w({...v,hour:parseInt(T.target.value)}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Minute (0-59)"}),u.jsx("input",{type:"number",min:"0",max:"59",value:v.minute,onChange:T=>w({...v,minute:parseInt(T.target.value)}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all"})]})]}),v.schedule_type==="hourly"&&u.jsxs("div",{className:"mb-4",children:[u.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Minute (0-59)"}),u.jsx("input",{type:"number",min:"0",max:"59",value:v.minute,onChange:T=>w({...v,minute:parseInt(T.target.value)}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all"})]}),v.schedule_type==="interval"&&u.jsxs("div",{className:"mb-4",children:[u.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Interval (seconds)"}),u.jsx("input",{type:"number",min:"1",value:v.interval_seconds,onChange:T=>w({...v,interval_seconds:parseInt(T.target.value)}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all"})]}),v.schedule_type==="cron"&&u.jsxs("div",{className:"mb-4",children:[u.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Cron Expression"}),u.jsx("input",{type:"text",value:v.cron_expression,onChange:T=>w({...v,cron_expression:T.target.value}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all font-mono",placeholder:"* * * * *"}),u.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Format: minute hour day month day-of-week"})]}),u.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[u.jsx(Se,{variant:"ghost",type:"button",onClick:()=>d(!1),children:"Cancel"}),u.jsx(Se,{type:"submit",variant:"primary",children:"Create Schedule"})]})]})]})}),f&&p&&u.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:u.jsxs("div",{className:"bg-white dark:bg-slate-800 p-6 rounded-2xl w-full max-w-2xl border border-slate-200 dark:border-slate-700 shadow-2xl animate-in fade-in zoom-in duration-200 max-h-[90vh] overflow-y-auto",children:[u.jsxs("div",{className:"flex items-center justify-between mb-6",children:[u.jsxs("div",{children:[u.jsxs("h2",{className:"text-xl font-bold text-slate-900 dark:text-white flex items-center gap-2",children:[u.jsx(wy,{size:20}),"Execution History"]}),u.jsx("p",{className:"text-slate-500 text-sm",children:p.pipeline_name})]}),u.jsx(Se,{variant:"ghost",onClick:()=>h(!1),children:u.jsx(pr,{size:20})})]}),x?u.jsx("div",{className:"flex justify-center py-8",children:u.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-500"})}):m.length>0?u.jsx("div",{className:"space-y-4",children:m.map((T,P)=>u.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 dark:bg-slate-900 rounded-xl border border-slate-100 dark:border-slate-700",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("div",{className:`p-2 rounded-full ${T.success?"bg-emerald-100 text-emerald-600":"bg-rose-100 text-rose-600"}`,children:T.success?u.jsx(Lt,{size:16}):u.jsx(Sc,{size:16})}),u.jsxs("div",{children:[u.jsx("div",{className:"font-medium text-slate-900 dark:text-white",children:wt(new Date(T.started_at),"MMM d, yyyy HH:mm:ss")}),u.jsxs("div",{className:"text-xs text-slate-500",children:["Duration: ",T.duration_seconds?`${T.duration_seconds.toFixed(2)}s`:"N/A"]})]})]}),!T.success&&u.jsx("div",{className:"text-sm text-rose-600 max-w-xs truncate",title:T.error,children:T.error})]},P))}):u.jsx("div",{className:"text-center py-8 text-slate-500",children:"No execution history found."})]})})]})}function cEe(){const[e,t]=_.useState(null),[r,n]=_.useState(null),[a,i]=_.useState(!0);if(_.useEffect(()=>{const l=async()=>{try{const[d,f]=await Promise.all([_e("/api/metrics/observability/orchestrator"),_e("/api/metrics/observability/cache")]),h=await d.json(),p=await f.json();t(h),n(p)}catch(d){console.error("Failed to fetch metrics:",d)}finally{i(!1)}};l();const c=setInterval(l,3e4);return()=>clearInterval(c)},[]),a)return u.jsx("div",{className:"flex items-center justify-center h-96",children:u.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600"})});const s=(e==null?void 0:e.success_rate)||0,o=(r==null?void 0:r.cache_hit_rate)||0;return u.jsxs("div",{className:"p-6 space-y-6 max-w-7xl mx-auto",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsxs("h1",{className:"text-3xl font-bold text-slate-900 dark:text-white flex items-center gap-3",children:[u.jsx(Ge,{className:"text-primary-500",size:32}),"Observability Dashboard"]}),u.jsx("p",{className:"text-slate-500 mt-1",children:"System performance and metrics (Last 30 days)"})]}),u.jsx(Ot,{variant:"secondary",className:"text-xs",children:"Auto-refresh: 30s"})]}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[u.jsx(Yh,{icon:u.jsx(wa,{size:24}),label:"Total Runs",value:(e==null?void 0:e.total_runs)||0,color:"blue"}),u.jsx(Yh,{icon:u.jsx(Lt,{size:24}),label:"Success Rate",value:`${(s*100).toFixed(1)}%`,color:"emerald",trend:s>=.9?"positive":s>=.7?"neutral":"negative"}),u.jsx(Yh,{icon:u.jsx(tt,{size:24}),label:"Avg Duration",value:`${((e==null?void 0:e.avg_duration_seconds)||0).toFixed(2)}s`,color:"purple"}),u.jsx(Yh,{icon:u.jsx(po,{size:24}),label:"Cache Hit Rate",value:`${(o*100).toFixed(1)}%`,color:"amber",trend:o>=.5?"positive":o>=.2?"neutral":"negative"})]}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[u.jsxs(ze,{className:"p-6",children:[u.jsxs("h3",{className:"text-lg font-bold text-slate-900 dark:text-white mb-4 flex items-center gap-2",children:[u.jsx(os,{className:"text-primary-500",size:20}),"Orchestrator Performance"]}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("h4",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 mb-3",children:"Status Distribution"}),u.jsx("div",{className:"space-y-2",children:(e==null?void 0:e.status_distribution)&&Object.entries(e.status_distribution).map(([l,c])=>u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:`w-3 h-3 rounded-full ${l==="completed"?"bg-emerald-500":l==="failed"?"bg-rose-500":"bg-amber-500"}`}),u.jsx("span",{className:"text-sm text-slate-600 dark:text-slate-400 capitalize",children:l})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"text-sm font-mono font-semibold text-slate-900 dark:text-white",children:c}),u.jsx("div",{className:"w-24 bg-slate-200 dark:bg-slate-700 rounded-full h-2",children:u.jsx("div",{className:`h-2 rounded-full ${l==="completed"?"bg-emerald-500":l==="failed"?"bg-rose-500":"bg-amber-500"}`,style:{width:`${c/e.total_runs*100}%`}})})]})]},l))})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-3 pt-4 border-t border-slate-200 dark:border-slate-700",children:[u.jsxs("div",{className:"p-3 bg-emerald-50 dark:bg-emerald-900/20 rounded-lg",children:[u.jsx("div",{className:"text-xs text-emerald-600 dark:text-emerald-400 mb-1",children:"Success Rate"}),u.jsxs("div",{className:"text-2xl font-bold text-emerald-700 dark:text-emerald-300",children:[(s*100).toFixed(1),"%"]})]}),u.jsxs("div",{className:"p-3 bg-blue-50 dark:bg-blue-900/20 rounded-lg",children:[u.jsx("div",{className:"text-xs text-blue-600 dark:text-blue-400 mb-1",children:"Avg Duration"}),u.jsxs("div",{className:"text-2xl font-bold text-blue-700 dark:text-blue-300",children:[((e==null?void 0:e.avg_duration_seconds)||0).toFixed(1),"s"]})]})]})]})]}),u.jsxs(ze,{className:"p-6",children:[u.jsxs("h3",{className:"text-lg font-bold text-slate-900 dark:text-white mb-4 flex items-center gap-2",children:[u.jsx(po,{className:"text-amber-500",size:20}),"Cache Performance"]}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[u.jsxs("div",{className:"p-4 bg-gradient-to-br from-amber-50 to-orange-50 dark:from-amber-900/20 dark:to-orange-900/20 rounded-xl border border-amber-100 dark:border-amber-800",children:[u.jsx("div",{className:"text-xs text-amber-600 dark:text-amber-400 mb-1",children:"Total Steps"}),u.jsx("div",{className:"text-3xl font-bold text-amber-700 dark:text-amber-300",children:(r==null?void 0:r.total_steps)||0})]}),u.jsxs("div",{className:"p-4 bg-gradient-to-br from-emerald-50 to-teal-50 dark:from-emerald-900/20 dark:to-teal-900/20 rounded-xl border border-emerald-100 dark:border-emerald-800",children:[u.jsx("div",{className:"text-xs text-emerald-600 dark:text-emerald-400 mb-1",children:"Cached Steps"}),u.jsx("div",{className:"text-3xl font-bold text-emerald-700 dark:text-emerald-300",children:(r==null?void 0:r.cached_steps)||0})]})]}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsx("span",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300",children:"Cache Hit Rate"}),u.jsxs("span",{className:"text-lg font-bold text-slate-900 dark:text-white",children:[(o*100).toFixed(1),"%"]})]}),u.jsx("div",{className:"relative h-8 bg-slate-200 dark:bg-slate-700 rounded-full overflow-hidden",children:u.jsx("div",{className:"absolute inset-y-0 left-0 bg-gradient-to-r from-emerald-500 to-teal-500 flex items-center justify-end px-3 transition-all duration-500",style:{width:`${o*100}%`},children:o>.1&&u.jsxs("span",{className:"text-xs font-bold text-white",children:[(o*100).toFixed(0),"%"]})})})]}),u.jsxs("div",{className:"p-4 bg-blue-50 dark:bg-blue-900/20 rounded-xl border border-blue-100 dark:border-blue-800",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[u.jsx(os,{size:16,className:"text-blue-600"}),u.jsx("span",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100",children:"Performance Impact"})]}),u.jsxs("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:["Cache saved approximately"," ",u.jsx("strong",{children:(r==null?void 0:r.cached_steps)||0})," step executions, improving pipeline efficiency."]})]})]})]})]})]})}function Yh({icon:e,label:t,value:r,color:n,trend:a}){const i={blue:"bg-blue-50 text-blue-600 dark:bg-blue-900/20 dark:text-blue-400",emerald:"bg-emerald-50 text-emerald-600 dark:bg-emerald-900/20 dark:text-emerald-400",purple:"bg-purple-50 text-purple-600 dark:bg-purple-900/20 dark:text-purple-400",amber:"bg-amber-50 text-amber-600 dark:bg-amber-900/20 dark:text-amber-400"},s={positive:"text-emerald-600 dark:text-emerald-400",neutral:"text-amber-600 dark:text-amber-400",negative:"text-rose-600 dark:text-rose-400"};return u.jsx(ze,{className:"hover:shadow-lg transition-shadow duration-200",children:u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("div",{className:`p-3 rounded-xl ${i[n]}`,children:e}),u.jsxs("div",{className:"flex-1",children:[u.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 font-medium",children:t}),u.jsxs("div",{className:"flex items-baseline gap-2",children:[u.jsx("p",{className:"text-2xl font-bold text-slate-900 dark:text-white",children:r}),a&&u.jsx(os,{size:16,className:`${s[a]} ${a==="negative"?"rotate-180":""}`})]})]})]})})}function uEe(){const[e,t]=_.useState("accuracy"),[r,n]=_.useState(null),[a,i]=_.useState(!0);_.useEffect(()=>{s()},[e]);const s=async()=>{i(!0);try{const l=await(await _e(`/api/leaderboard/${e}`)).json();n(l)}catch(o){console.error("Failed to fetch leaderboard:",o)}finally{i(!1)}};return u.jsxs("div",{className:"p-6",children:[u.jsxs("div",{className:"flex justify-between items-center mb-6",children:[u.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2 text-slate-900 dark:text-white",children:[u.jsx(Zo,{className:"text-yellow-500"}),"Model Leaderboard"]}),u.jsxs("div",{className:"flex items-center gap-2 bg-white dark:bg-slate-800 rounded-lg p-1 border border-slate-200 dark:border-slate-700",children:[u.jsx(d6,{className:"w-4 h-4 ml-2 text-slate-400 dark:text-slate-500"}),u.jsxs("select",{value:e,onChange:o=>t(o.target.value),className:"bg-transparent border-none outline-none text-sm px-2 py-1 text-slate-700 dark:text-slate-200",children:[u.jsx("option",{value:"accuracy",children:"Accuracy"}),u.jsx("option",{value:"loss",children:"Loss"}),u.jsx("option",{value:"f1_score",children:"F1 Score"}),u.jsx("option",{value:"latency",children:"Latency"})]})]})]}),a?u.jsx("div",{className:"text-center py-12",children:u.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-yellow-500"})}):!r||r.models.length===0?u.jsx(qN,{icon:Zo,title:`No models found for metric: ${e}`,description:"Generate sample data to populate the leaderboard.",action:u.jsxs(Se,{onClick:async()=>{i(!0);try{await _e("/api/leaderboard/generate_sample_data",{method:"POST"}),s()}catch(o){console.error("Failed to generate sample data:",o),i(!1)}},className:"flex items-center gap-2",children:[u.jsx(P0,{size:16}),"Generate Sample Data"]})}):u.jsx("div",{className:"bg-white dark:bg-slate-800/50 rounded-lg border border-slate-200 dark:border-slate-700 overflow-hidden",children:u.jsxs("table",{className:"w-full",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"bg-slate-50 dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700",children:[u.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wider",children:"Rank"}),u.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wider",children:"Model"}),u.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wider",children:"Score"}),u.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wider",children:"Run ID"}),u.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wider",children:"Date"})]})}),u.jsx("tbody",{className:"divide-y divide-slate-100 dark:divide-slate-700",children:r.models.map((o,l)=>u.jsxs("tr",{className:"hover:bg-slate-50 dark:hover:bg-slate-700/50 transition-colors",children:[u.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:u.jsxs("div",{className:"flex items-center gap-2",children:[l===0&&u.jsx(Zo,{className:"w-4 h-4 text-yellow-500"}),l===1&&u.jsx(Zo,{className:"w-4 h-4 text-slate-400"}),l===2&&u.jsx(Zo,{className:"w-4 h-4 text-amber-600"}),u.jsxs("span",{className:`font-bold ${l<3?"text-slate-900 dark:text-white":"text-slate-500 dark:text-slate-400"}`,children:["#",o.rank]})]})}),u.jsx("td",{className:"px-6 py-4 whitespace-nowrap font-medium text-slate-900 dark:text-white",children:o.model_name}),u.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-lg font-bold text-blue-600 dark:text-blue-400",children:o.score.toFixed(4)}),r.higher_is_better?u.jsx(os,{className:"w-4 h-4 text-green-500"}):u.jsx(aK,{className:"w-4 h-4 text-green-500"})]})}),u.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-slate-500 dark:text-slate-400 font-mono",children:o.run_id.substring(0,8)}),u.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-slate-500 dark:text-slate-400",children:o.timestamp?wt(new Date(o.timestamp),"MMM d, HH:mm"):"-"})]},o.run_id))})]})})]})}const Su="/api";class dEe{async getAvailablePlugins(){try{const t=await fetch(`${Su}/plugins/available`);if(!t.ok)throw new Error("Failed to fetch available plugins");return await t.json()}catch(t){return console.error("Error fetching available plugins:",t),[]}}async getInstalledPlugins(){try{const t=await fetch(`${Su}/plugins/installed`);if(!t.ok)throw new Error("Failed to fetch installed plugins");return await t.json()}catch(t){return console.error("Error fetching installed plugins:",t),[]}}async installPlugin(t){try{const r=await fetch(`${Su}/plugins/install`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t})});if(!r.ok){const n=await r.json();throw new Error(n.detail||"Installation failed")}return await r.json()}catch(r){throw console.error("Error installing plugin:",r),r}}async uninstallPlugin(t){try{const r=await fetch(`${Su}/plugins/uninstall/${t}`,{method:"POST"});if(!r.ok){const n=await r.json();throw new Error(n.detail||"Uninstall failed")}return await r.json()}catch(r){throw console.error("Error uninstalling plugin:",r),r}}async importZenMLStack(t){try{const r=await fetch(`${Su}/plugins/import-stack`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({stack_name:t})});if(!r.ok){const n=await r.json();throw new Error(n.detail||"Import failed")}return await r.json()}catch(r){throw console.error("Error importing stack:",r),r}}}const Rl=new dEe;function fEe({isOpen:e,onClose:t,onAdd:r}){const[n,a]=_.useState("package"),[i,s]=_.useState(""),[o,l]=_.useState(""),c=()=>{n==="package"&&i?(r({type:"package",value:i}),s(""),t()):n==="url"&&o&&(r({type:"url",value:o}),l(""),t())};return e?u.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:t,children:u.jsxs("div",{className:"bg-white dark:bg-slate-800 rounded-xl p-6 max-w-md w-full mx-4 shadow-2xl",onClick:d=>d.stopPropagation(),children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("h3",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:"Add Plugin"}),u.jsx("button",{onClick:t,className:"p-1 hover:bg-slate-100 dark:hover:bg-slate-700 rounded-lg transition-colors",children:u.jsx(No,{size:20,className:"text-slate-500"})})]}),u.jsxs("div",{className:"flex gap-2 mb-4 bg-slate-100 dark:bg-slate-900 p-1 rounded-lg",children:[u.jsx("button",{onClick:()=>a("package"),className:`flex-1 px-4 py-2 rounded-md text-sm font-medium transition-all ${n==="package"?"bg-white dark:bg-slate-700 text-slate-900 dark:text-white shadow-sm":"text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-300"}`,children:u.jsxs("div",{className:"flex items-center justify-center gap-2",children:[u.jsx(ss,{size:16}),"Package Name"]})}),u.jsx("button",{onClick:()=>a("url"),className:`flex-1 px-4 py-2 rounded-md text-sm font-medium transition-all ${n==="url"?"bg-white dark:bg-slate-700 text-slate-900 dark:text-white shadow-sm":"text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-300"}`,children:u.jsxs("div",{className:"flex items-center justify-center gap-2",children:[u.jsx(YG,{size:16}),"URL/Git"]})})]}),u.jsx("div",{className:"mb-4",children:n==="package"?u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2",children:"Package Name"}),u.jsx("input",{type:"text",placeholder:"e.g., zenml-kubernetes",value:i,onChange:d=>s(d.target.value),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"}),u.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1",children:"Install from PyPI by package name"})]}):u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2",children:"URL"}),u.jsx("input",{type:"text",placeholder:"e.g., git+https://github.com/...",value:o,onChange:d=>l(d.target.value),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"}),u.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1",children:"Install from Git repository or URL"})]})}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Se,{variant:"outline",onClick:t,className:"flex-1",children:"Cancel"}),u.jsx(Se,{onClick:c,disabled:n==="package"?!i:!o,className:"flex-1",children:"Install"})]})]})}):null}function hEe(){const[e,t]=_.useState(""),[r,n]=_.useState([]),[a,i]=_.useState(!0),[s,o]=_.useState(null),[l,c]=_.useState(!1);_.useEffect(()=>{d()},[]);const d=async()=>{try{i(!0);const g=await Rl.getAvailablePlugins();n(g)}catch(g){console.error("Failed to load plugins:",g)}finally{i(!1)}},f=r.filter(g=>g.name.toLowerCase().includes(e.toLowerCase())||g.description.toLowerCase().includes(e.toLowerCase())),h=async g=>{o(g);try{await Rl.installPlugin(g),n(m=>m.map(b=>b.id===g?{...b,installed:!0}:b))}catch(m){console.error("Install failed:",m),alert(`Installation failed: ${m.message}`)}finally{o(null)}},p=async({type:g,value:m})=>{o("manual");try{await Rl.installPlugin(m),await d(),alert(`Successfully installed ${m}`)}catch(b){console.error("Install failed:",b),alert(`Installation failed: ${b.message}`)}finally{o(null)}};return a?u.jsx("div",{className:"flex justify-center items-center py-12",children:u.jsx(Ul,{className:"animate-spin text-primary-500",size:32})}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex gap-4",children:[u.jsxs("div",{className:"relative flex-1",children:[u.jsx(Kp,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400",size:18}),u.jsx("input",{type:"text",placeholder:"Search plugins...",value:e,onChange:g=>t(g.target.value),className:"w-full pl-10 pr-4 py-2 bg-slate-50 dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),u.jsxs(Se,{onClick:()=>c(!0),className:"flex items-center gap-2",children:[u.jsx(Qi,{size:18}),"Add Plugin"]})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:f.map(g=>u.jsxs("div",{className:"p-4 border border-slate-200 dark:border-slate-700 rounded-xl hover:border-primary-500/50 dark:hover:border-primary-500/50 transition-colors bg-white dark:bg-slate-800/50",children:[u.jsxs("div",{className:"flex justify-between items-start mb-2",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"font-semibold text-slate-900 dark:text-white",children:g.name}),u.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-500 dark:text-slate-400 mt-1",children:[u.jsxs("span",{children:["v",g.version]}),u.jsx("span",{children:"•"}),u.jsxs("span",{children:["by ",g.author]})]})]}),g.installed?u.jsxs(Ot,{variant:"success",className:"flex items-center gap-1",children:[u.jsx(Lt,{size:12})," Installed"]}):u.jsx(Se,{size:"sm",variant:"outline",onClick:()=>h(g.id),disabled:s===g.id||s==="manual",children:s===g.id?u.jsxs(u.Fragment,{children:[u.jsx(Ul,{size:12,className:"animate-spin mr-1"}),"Installing..."]}):"Install"})]}),u.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-300 mb-4 line-clamp-2",children:g.description}),u.jsxs("div",{className:"flex items-center justify-between mt-auto",children:[u.jsx("div",{className:"flex gap-2",children:g.tags.map(m=>u.jsx("span",{className:"px-2 py-0.5 bg-slate-100 dark:bg-slate-700 text-slate-600 dark:text-slate-300 text-xs rounded-full",children:m},m))}),u.jsxs("div",{className:"flex items-center gap-3 text-xs text-slate-400",children:[u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(_o,{size:12})," ",g.downloads]}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(eK,{size:12})," ",g.stars]})]})]})]},g.id))})]}),u.jsx(fEe,{isOpen:l,onClose:()=>c(!1),onAdd:p})]})}function pEe(){const[e,t]=_.useState([]),[r,n]=_.useState(!0),[a,i]=_.useState(null),[s,o]=_.useState(!1);_.useEffect(()=>{l()},[]);const l=async()=>{try{n(!0);const f=await Rl.getInstalledPlugins();t(f)}catch(f){console.error("Failed to load installed plugins:",f)}finally{n(!1),o(!1)}},c=async()=>{o(!0),await l()},d=async f=>{if(confirm("Are you sure you want to uninstall this plugin?")){i(f);try{await Rl.uninstallPlugin(f),t(h=>h.filter(p=>p.id!==f))}catch(h){console.error("Uninstall failed:",h),alert(`Uninstall failed: ${h.message}`)}finally{i(null)}}};return r?u.jsx("div",{className:"flex justify-center items-center py-12",children:u.jsx(Ul,{className:"animate-spin text-primary-500",size:32})}):e.length===0?u.jsxs("div",{className:"text-center py-12 text-slate-500 dark:text-slate-400",children:[u.jsx("p",{children:"No plugins installed yet."}),u.jsx("p",{className:"text-sm mt-2",children:"Install plugins from the Browser tab"})]}):u.jsxs("div",{className:"space-y-4",children:[u.jsx("div",{className:"flex justify-end",children:u.jsxs(Se,{variant:"outline",size:"sm",onClick:c,disabled:s,className:"flex items-center gap-2",children:[u.jsx(P0,{size:14,className:s?"animate-spin":""}),"Refresh"]})}),e.map(f=>u.jsxs("div",{className:"flex items-center justify-between p-4 bg-white dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-xl",children:[u.jsxs("div",{className:"flex items-start gap-4",children:[u.jsx("div",{className:"p-2 bg-primary-50 dark:bg-primary-900/20 rounded-lg",children:u.jsx(g6,{className:"text-primary-500",size:24})}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("h3",{className:"font-semibold text-slate-900 dark:text-white",children:f.name}),u.jsxs(Ot,{variant:"outline",className:"text-xs",children:["v",f.version]}),u.jsx(Ot,{variant:"success",className:"text-xs",children:"Active"})]}),u.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 mt-1",children:f.description})]})]}),u.jsx("div",{className:"flex items-center gap-2",children:u.jsx(Se,{variant:"ghost",size:"sm",className:"text-red-500 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20",title:"Uninstall",onClick:()=>d(f.id),disabled:a===f.id,children:a===f.id?u.jsx(Ul,{size:16,className:"animate-spin"}):u.jsx(ho,{size:16})})})]},f.id))]})}function mEe(){const[e,t]=_.useState(""),[r,n]=_.useState("idle"),[a,i]=_.useState([]),s=async()=>{if(e){n("importing"),i(["Connecting to ZenML client...","Fetching stack details..."]);try{const o=await Rl.importZenMLStack(e);i(l=>[...l,`Found stack '${e}' with ${o.components.length} components.`]),await new Promise(l=>setTimeout(l,800)),i(l=>[...l,"Generating flowyml configuration...","Import successful!"]),n("success")}catch(o){console.error("Import failed:",o),i(l=>[...l,`Error: ${o.message}`]),n("error")}}};return u.jsxs("div",{className:"space-y-6",children:[u.jsx("div",{className:"bg-slate-50 dark:bg-slate-800/50 p-4 rounded-xl border border-slate-200 dark:border-slate-700",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx(y_,{className:"text-primary-500 mt-1",size:20}),u.jsxs("div",{children:[u.jsx("h3",{className:"font-medium text-slate-900 dark:text-white",children:"Import ZenML Stack"}),u.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 mt-1",children:"Migrate your existing ZenML infrastructure to flowyml. We'll automatically detect your components and generate the necessary configuration."})]})]})}),u.jsxs("div",{className:"flex gap-4 items-end",children:[u.jsxs("div",{className:"flex-1 space-y-2",children:[u.jsx("label",{className:"text-sm font-medium text-slate-700 dark:text-slate-300",children:"ZenML Stack Name"}),u.jsx("input",{type:"text",placeholder:"e.g., production-stack",value:e,onChange:o=>t(o.target.value),className:"w-full px-3 py-2 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),u.jsx(Se,{onClick:s,disabled:r==="importing"||!e,className:"flex items-center gap-2",children:r==="importing"?u.jsxs(u.Fragment,{children:[u.jsx(Ul,{size:16,className:"animate-spin"}),"Importing..."]}):u.jsxs(u.Fragment,{children:["Start Import",u.jsx(is,{size:16})]})})]}),r!=="idle"&&u.jsxs("div",{className:"bg-slate-900 rounded-xl p-4 font-mono text-sm overflow-hidden",children:[u.jsx("div",{className:"space-y-1",children:a.map((o,l)=>u.jsxs("div",{className:"flex items-center gap-2 text-slate-300",children:[u.jsx("span",{className:"text-slate-600",children:"➜"}),o]},l))}),r==="success"&&u.jsxs("div",{className:"mt-4 pt-4 border-t border-slate-800 flex items-center gap-2 text-green-400",children:[u.jsx(Lt,{size:16}),u.jsx("span",{children:"Stack imported successfully! You can now use it in your pipelines."})]}),r==="error"&&u.jsxs("div",{className:"mt-4 pt-4 border-t border-slate-800 flex items-center gap-2 text-red-400",children:[u.jsx(Sc,{size:16}),u.jsx("span",{children:"Failed to import stack. Please check the name and try again."})]})]})]})}function gEe(){const[e,t]=_.useState("browser"),r=[{id:"browser",label:"Plugin Browser",icon:ss},{id:"installed",label:"Installed",icon:_o},{id:"zenml",label:"ZenML Integration",icon:y_}];return u.jsxs(ze,{className:"overflow-hidden",children:[u.jsxs(sF,{className:"border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/50 pb-0",children:[u.jsx("div",{className:"flex items-center justify-between mb-4",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ss,{size:20,className:"text-primary-500"}),u.jsx(oF,{children:"Plugins & Integrations"})]})}),u.jsx("div",{className:"flex gap-6",children:r.map(n=>{const a=n.icon,i=e===n.id;return u.jsxs("button",{onClick:()=>t(n.id),className:`
590
- flex items-center gap-2 pb-3 text-sm font-medium transition-all relative
591
- ${i?"text-primary-600 dark:text-primary-400":"text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"}
592
- `,children:[u.jsx(a,{size:16}),n.label,i&&u.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary-500 rounded-t-full"})]},n.id)})})]}),u.jsxs(kS,{className:"p-6",children:[e==="browser"&&u.jsx(hEe,{}),e==="installed"&&u.jsx(pEe,{}),e==="zenml"&&u.jsx(mEe,{})]})]})}function yEe(){const e={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},t={hidden:{opacity:0,y:20},show:{opacity:1,y:0}};return u.jsxs(Me.div,{initial:"hidden",animate:"show",variants:e,className:"space-y-6",children:[u.jsxs(Me.div,{variants:t,children:[u.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[u.jsx("div",{className:"p-2 bg-gradient-to-br from-purple-600 to-purple-800 rounded-lg",children:u.jsx(ss,{className:"text-white",size:24})}),u.jsx("h2",{className:"text-3xl font-bold text-slate-900 dark:text-white tracking-tight",children:"Plugins & Integrations"})]}),u.jsx("p",{className:"text-slate-500 dark:text-slate-400 mt-2",children:"Extend flowyml with plugins from ZenML, Airflow, and other ecosystems. Browse, install, and manage integrations seamlessly."})]}),u.jsx(Me.div,{variants:t,children:u.jsx(gEe,{})})]})}function vEe(){const[e,t]=_.useState([]),[r,n]=_.useState(!0),[a,i]=_.useState(!1),[s,o]=_.useState(""),[l,c]=_.useState(null),[d,f]=_.useState(new Set);_.useEffect(()=>{h()},[]);const h=async()=>{try{const v=await(await fetch("/api/execution/tokens")).json();t(v.tokens||[])}catch(y){console.error("Failed to fetch tokens:",y)}finally{n(!1)}},p=async y=>{y.preventDefault();try{const w=await(await fetch("/api/execution/tokens",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s})})).json();c(w.token),o(""),h()}catch(v){console.error("Failed to create token:",v)}},g=async y=>{if(confirm("Are you sure you want to delete this token? This action cannot be undone."))try{await fetch(`/api/execution/tokens/${y}`,{method:"DELETE"}),h()}catch(v){console.error("Failed to delete token:",v)}},m=y=>{navigator.clipboard.writeText(y)},b=y=>{f(v=>{const w=new Set(v);return w.has(y)?w.delete(y):w.add(y),w})},x=y=>!y||typeof y!="string"?"••••••••••••••••••••••••••••••••••••••••••••••••":`${y.substring(0,8)}${"•".repeat(32)}${y.substring(y.length-8)}`;return r?u.jsx("div",{className:"flex items-center justify-center min-h-screen",children:u.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600"})}):u.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsxs("h1",{className:"text-3xl font-bold text-slate-900 dark:text-white flex items-center gap-3",children:[u.jsx("div",{className:"p-3 bg-gradient-to-br from-primary-500 to-purple-500 rounded-xl text-white",children:u.jsx(Nl,{size:28})}),"API Tokens"]}),u.jsx("p",{className:"text-slate-500 dark:text-slate-400 mt-2",children:"Manage API tokens for programmatic access to flowyml"})]}),u.jsxs(Se,{onClick:()=>i(!0),className:"flex items-center gap-2 bg-gradient-to-r from-primary-600 to-purple-600 hover:from-primary-700 hover:to-purple-700",children:[u.jsx(Qi,{size:16}),"Create Token"]})]}),u.jsx(ze,{className:"border-l-4 border-l-amber-500 bg-amber-50 dark:bg-amber-900/10",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx(Yp,{className:"text-amber-600 dark:text-amber-400 flex-shrink-0 mt-0.5",size:20}),u.jsxs("div",{children:[u.jsx("h3",{className:"font-semibold text-amber-900 dark:text-amber-200",children:"Security Notice"}),u.jsx("p",{className:"text-sm text-amber-800 dark:text-amber-300 mt-1",children:"Treat your API tokens like passwords. Never share them publicly or commit them to version control."})]})]})}),u.jsx("div",{className:"grid gap-4",children:e.length===0?u.jsxs(ze,{className:"text-center py-16 bg-slate-50 dark:bg-slate-800/30",children:[u.jsx("div",{className:"mx-auto w-20 h-20 bg-slate-100 dark:bg-slate-700 rounded-2xl flex items-center justify-center mb-6",children:u.jsx(Nl,{className:"text-slate-400",size:32})}),u.jsx("h3",{className:"text-xl font-bold text-slate-900 dark:text-white mb-2",children:"No API tokens yet"}),u.jsx("p",{className:"text-slate-500 max-w-md mx-auto mb-6",children:"Create your first API token to start making programmatic requests to flowyml"}),u.jsxs(Se,{onClick:()=>i(!0),className:"bg-primary-600 hover:bg-primary-700",children:[u.jsx(Qi,{size:16,className:"mr-2"}),"Create Your First Token"]})]}):e.map(y=>u.jsx(ze,{className:"hover:shadow-lg transition-all duration-200",children:u.jsxs("div",{className:"flex items-center justify-between gap-4",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[u.jsx("div",{className:"p-2 bg-primary-50 dark:bg-primary-900/20 rounded-lg",children:u.jsx(Nl,{className:"text-primary-600 dark:text-primary-400",size:20})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("h3",{className:"text-lg font-semibold text-slate-900 dark:text-white truncate",children:y.name}),u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsxs("span",{className:"text-xs text-slate-500 dark:text-slate-400 flex items-center gap-1",children:[u.jsx(kn,{size:12}),"Created ",wt(new Date(y.created_at),"MMM d, yyyy")]}),u.jsx(Ot,{variant:"secondary",className:"text-xs",children:y.id})]})]})]}),u.jsx("div",{className:"bg-slate-50 dark:bg-slate-800 rounded-lg p-3 font-mono text-sm border border-slate-200 dark:border-slate-700",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("code",{className:"flex-1 truncate text-slate-700 dark:text-slate-300",children:d.has(y.id)?y.token:x(y.token)}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{onClick:()=>b(y.id),className:"p-1.5 hover:bg-slate-200 dark:hover:bg-slate-700 rounded transition-colors",title:d.has(y.id)?"Hide token":"Show token",children:d.has(y.id)?u.jsx(qG,{size:16,className:"text-slate-500"}):u.jsx(E0,{size:16,className:"text-slate-500"})}),u.jsx("button",{onClick:()=>m(y.token),className:"p-1.5 hover:bg-slate-200 dark:hover:bg-slate-700 rounded transition-colors",title:"Copy to clipboard",children:u.jsx(Hp,{size:16,className:"text-slate-500"})})]})]})})]}),u.jsx(Se,{onClick:()=>g(y.id),variant:"ghost",className:"text-rose-600 hover:text-rose-700 hover:bg-rose-50 dark:hover:bg-rose-900/20 flex-shrink-0",children:u.jsx(ho,{size:18})})]})},y.id))}),a&&u.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:u.jsxs(ze,{className:"max-w-lg w-full",children:[u.jsxs("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white mb-4 flex items-center gap-2",children:[u.jsx(Qi,{className:"text-primary-600",size:24}),"Create New Token"]}),u.jsxs("form",{onSubmit:p,className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2",children:"Token Name"}),u.jsx("input",{type:"text",value:s,onChange:y=>o(y.target.value),placeholder:"e.g., Production API, CI/CD Pipeline",className:"w-full px-4 py-2 border border-slate-300 dark:border-slate-600 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-slate-800 text-slate-900 dark:text-white",required:!0}),u.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1",children:"Choose a descriptive name to identify this token's purpose"})]}),u.jsxs("div",{className:"flex gap-3 justify-end pt-4",children:[u.jsx(Se,{type:"button",variant:"ghost",onClick:()=>i(!1),children:"Cancel"}),u.jsx(Se,{type:"submit",className:"bg-primary-600 hover:bg-primary-700",children:"Create Token"})]})]})]})}),l&&u.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:u.jsxs(ze,{className:"max-w-2xl w-full",children:[u.jsxs("div",{className:"text-center mb-6",children:[u.jsx("div",{className:"mx-auto w-16 h-16 bg-green-100 dark:bg-green-900/20 rounded-full flex items-center justify-center mb-4",children:u.jsx(LG,{className:"text-green-600 dark:text-green-400",size:32})}),u.jsx("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white",children:"Token Created Successfully!"}),u.jsx("p",{className:"text-slate-500 dark:text-slate-400 mt-2",children:"Copy this token now. You won't be able to see it again."})]}),u.jsx("div",{className:"bg-slate-50 dark:bg-slate-800 rounded-lg p-4 mb-6 border-2 border-primary-200 dark:border-primary-800",children:u.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[u.jsx("code",{className:"flex-1 font-mono text-sm break-all text-slate-900 dark:text-white",children:l}),u.jsx("button",{onClick:()=>m(l),className:"p-2 bg-primary-600 hover:bg-primary-700 text-white rounded-lg transition-colors flex-shrink-0",title:"Copy to clipboard",children:u.jsx(Hp,{size:18})})]})}),u.jsx("div",{className:"bg-amber-50 dark:bg-amber-900/10 border border-amber-200 dark:border-amber-800 rounded-lg p-4 mb-6",children:u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Yp,{className:"text-amber-600 dark:text-amber-400 flex-shrink-0",size:20}),u.jsxs("div",{className:"text-sm text-amber-800 dark:text-amber-200",children:[u.jsx("strong",{children:"Important:"})," Store this token securely. It won't be displayed again."]})]})}),u.jsx(Se,{onClick:()=>{c(null),i(!1)},className:"w-full bg-primary-600 hover:bg-primary-700",children:"I've Saved My Token"})]})})]})}function xEe(){const[e,t]=_.useState([]),[r,n]=_.useState(!0),[a,i]=_.useState(!1),[s,o]=_.useState(null),[l,c]=_.useState(null);_.useEffect(()=>{d()},[]);const d=async()=>{try{const h=await _e("/api/execution/tokens");if(h.status===401){t([]),n(!1);return}const p=await h.json();t(p.tokens||[])}catch(h){console.error("Failed to fetch tokens:",h),c("Failed to load tokens")}finally{n(!1)}},f=async()=>{try{const h=await _e("/api/execution/tokens/init",{method:"POST"}),p=await h.json();h.ok?(o(p.token),await d()):c(p.detail)}catch{c("Failed to create initial token")}};return r?u.jsx("div",{className:"flex items-center justify-center h-96",children:u.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600"})}):u.jsxs("div",{className:"space-y-6 max-w-6xl mx-auto",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[u.jsx("div",{className:"p-2 bg-gradient-to-br from-amber-600 to-orange-800 rounded-lg",children:u.jsx(Nl,{className:"text-white",size:24})}),u.jsx("h2",{className:"text-3xl font-bold text-slate-900 dark:text-white tracking-tight",children:"API Tokens"})]}),u.jsx("p",{className:"text-slate-500 dark:text-slate-400 mt-2",children:"Manage API tokens for authenticating CLI and SDK requests"})]}),l&&u.jsxs("div",{className:"bg-rose-50 dark:bg-rose-900/20 border border-rose-200 dark:border-rose-800 rounded-lg p-4 flex items-start gap-3",children:[u.jsx(Sc,{className:"text-rose-600 shrink-0",size:20}),u.jsxs("div",{children:[u.jsx("h4",{className:"font-medium text-rose-900 dark:text-rose-200",children:"Error"}),u.jsx("p",{className:"text-sm text-rose-700 dark:text-rose-300 mt-1",children:l})]})]}),s&&u.jsx(SEe,{token:s,onClose:()=>o(null)}),e.length===0&&!s&&u.jsx(ze,{children:u.jsxs(kS,{className:"py-16 text-center",children:[u.jsx("div",{className:"mx-auto w-20 h-20 bg-amber-100 dark:bg-amber-900/30 rounded-2xl flex items-center justify-center mb-6",children:u.jsx(Nl,{className:"text-amber-600",size:32})}),u.jsx("h3",{className:"text-xl font-bold text-slate-900 dark:text-white mb-2",children:"No API Tokens Yet"}),u.jsx("p",{className:"text-slate-500 dark:text-slate-400 max-w-md mx-auto mb-6",children:"Create your first admin token to start using the flowyml API"}),u.jsxs(Se,{onClick:f,className:"flex items-center gap-2 mx-auto",children:[u.jsx(Qi,{size:18}),"Create Initial Token"]})]})}),e.length>0&&u.jsxs(ze,{children:[u.jsx(sF,{children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(oF,{children:"Active Tokens"}),u.jsxs(Se,{onClick:()=>i(!0),variant:"primary",className:"flex items-center gap-2",children:[u.jsx(Qi,{size:18}),"Create Token"]})]})}),u.jsx(kS,{children:u.jsx("div",{className:"space-y-3",children:e.map((h,p)=>u.jsx(jEe,{token:h,onRevoke:d},p))})})]}),a&&u.jsx(kEe,{onClose:()=>i(!1),onCreate:h=>{o(h),i(!1),d()}})]})}const bEe={read:{label:"Read",icon:E0,className:"bg-blue-50 text-blue-700 border-blue-200 dark:bg-blue-900/30 dark:text-blue-200 dark:border-blue-800"},write:{label:"Write",icon:QG,className:"bg-emerald-50 text-emerald-700 border-emerald-200 dark:bg-emerald-900/30 dark:text-emerald-200 dark:border-emerald-800"},execute:{label:"Execute",icon:po,className:"bg-purple-50 text-purple-700 border-purple-200 dark:bg-purple-900/30 dark:text-purple-200 dark:border-purple-800"},admin:{label:"Admin",icon:JG,className:"bg-rose-50 text-rose-700 border-rose-200 dark:bg-rose-900/30 dark:text-rose-200 dark:border-rose-800"}};function wEe({perm:e}){const t=bEe[e]||{label:e,icon:Yp,className:"bg-slate-100 text-slate-700 border-slate-200 dark:bg-slate-800/60 dark:text-slate-100 dark:border-slate-700"},r=t.icon;return u.jsxs("span",{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-semibold border ${t.className}`,children:[u.jsx(r,{size:12}),t.label]})}function jEe({token:e,onRevoke:t}){var i;const[r,n]=_.useState(!1),a=async()=>{try{await fetch(`/ api / execution / tokens / ${e.name} `,{method:"DELETE"}),t()}catch(s){console.error("Failed to revoke token:",s)}};return u.jsxs("div",{className:"p-4 bg-slate-50 dark:bg-slate-800/50 rounded-lg border border-slate-200 dark:border-slate-700 hover:border-primary-300 dark:hover:border-primary-700 transition-colors",children:[u.jsxs("div",{className:"flex items-start justify-between",children:[u.jsxs("div",{className:"flex-1",children:[u.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[u.jsx("h4",{className:"font-semibold text-slate-900 dark:text-white",children:e.name}),e.project&&u.jsx(Ot,{variant:"secondary",className:"text-xs",children:e.project})]}),u.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:(i=e.permissions)!=null&&i.length?e.permissions.map(s=>u.jsx(wEe,{perm:s},s)):u.jsx("span",{className:"text-xs text-slate-400",children:"No permissions assigned"})}),u.jsxs("div",{className:"flex items-center gap-4 text-xs text-slate-500 dark:text-slate-400",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(kn,{size:12}),"Created: ",wt(new Date(e.created_at),"MMM d, yyyy")]}),e.last_used&&u.jsxs("span",{children:["Last used: ",wt(new Date(e.last_used),"MMM d, yyyy")]})]})]}),u.jsx("button",{onClick:()=>n(!0),className:"p-2 hover:bg-rose-100 dark:hover:bg-rose-900/30 text-slate-400 hover:text-rose-600 rounded-lg transition-colors",children:u.jsx(ho,{size:16})})]}),r&&u.jsxs("div",{className:"mt-3 pt-3 border-t border-slate-200 dark:border-slate-700",children:[u.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400 mb-3",children:"Are you sure you want to revoke this token? This action cannot be undone."}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Se,{variant:"danger",size:"sm",onClick:a,children:"Yes, Revoke"}),u.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>n(!1),children:"Cancel"})]})]})]})}function SEe({token:e,onClose:t}){const[r,n]=_.useState(!1),a=()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)};return u.jsxs(Me.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"bg-gradient-to-br from-emerald-50 to-teal-50 dark:from-emerald-900/20 dark:to-teal-900/20 border-2 border-emerald-300 dark:border-emerald-700 rounded-lg p-6",children:[u.jsx("div",{className:"flex items-start justify-between mb-4",children:u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"p-2 bg-emerald-500 rounded-lg",children:u.jsx(Yp,{className:"text-white",size:20})}),u.jsxs("div",{children:[u.jsx("h3",{className:"font-bold text-emerald-900 dark:text-emerald-200",children:"Token Created Successfully!"}),u.jsx("p",{className:"text-sm text-emerald-700 dark:text-emerald-300 mt-1",children:"Save this token now - it won't be shown again"})]})]})}),u.jsx("div",{className:"bg-white dark:bg-slate-800 rounded-lg p-4 border border-emerald-200 dark:border-emerald-800",children:u.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[u.jsx("code",{className:"flex-1 font-mono text-sm text-slate-900 dark:text-white break-all",children:e}),u.jsx("button",{onClick:a,className:"p-2 hover:bg-slate-100 dark:hover:bg-slate-700 rounded transition-colors shrink-0",children:r?u.jsx(m_,{className:"text-emerald-600",size:18}):u.jsx(Hp,{className:"text-slate-400",size:18})})]})}),u.jsx(Se,{variant:"ghost",onClick:t,className:"mt-4 w-full",children:"I've saved my token"})]})}function kEe({onClose:e,onCreate:t}){const[r,n]=_.useState(""),[a,i]=_.useState(""),[s,o]=_.useState(["read","write","execute"]),[l,c]=_.useState(!1),[d,f]=_.useState(null),[h,p]=_.useState([]),[g,m]=_.useState(!0);_.useEffect(()=>{b()},[]);const b=async()=>{try{const w=await(await _e("/api/projects/")).json();p(w||[])}catch(v){console.error("Failed to fetch projects:",v)}finally{m(!1)}},x=async()=>{if(!r){f("Token name is required");return}c(!0),f(null);try{const v=await fetch("/api/execution/tokens",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:r,project:a||null,permissions:s})}),w=await v.json();v.ok?t(w.token):f(w.detail)}catch{f("Failed to create token")}finally{c(!1)}},y=v=>{o(w=>w.includes(v)?w.filter(j=>j!==v):[...w,v])};return u.jsx(hi,{children:u.jsx(Me.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",onClick:e,children:u.jsxs(Me.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},onClick:v=>v.stopPropagation(),className:"bg-white dark:bg-slate-800 rounded-2xl shadow-2xl max-w-lg w-full border border-slate-200 dark:border-slate-700",children:[u.jsxs("div",{className:"p-6 border-b border-slate-100 dark:border-slate-700",children:[u.jsx("h3",{className:"text-2xl font-bold text-slate-900 dark:text-white",children:"Create New Token"}),u.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 mt-1",children:"Generate a new API token for authentication"})]}),u.jsxs("div",{className:"p-6 space-y-4",children:[d&&u.jsx("div",{className:"bg-rose-50 dark:bg-rose-900/20 border border-rose-200 dark:border-rose-800 rounded-lg p-3 text-sm text-rose-700 dark:text-rose-300",children:d}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-1",children:"Token Name *"}),u.jsx("input",{type:"text",value:r,onChange:v=>n(v.target.value),placeholder:"e.g., Production CLI Token",className:"w-full px-3 py-2 border border-slate-200 dark:border-slate-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 bg-white dark:bg-slate-900 text-slate-900 dark:text-white"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-1",children:"Project Scope"}),u.jsxs("select",{value:a,onChange:v=>i(v.target.value),disabled:g,className:"w-full px-3 py-2 border border-slate-200 dark:border-slate-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 bg-white dark:bg-slate-900 text-slate-900 dark:text-white",children:[u.jsx("option",{value:"",children:"All Projects"}),h.map(v=>u.jsx("option",{value:v.name,children:v.name},v.name))]}),u.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1",children:"Restrict this token to a specific project or allow access to all"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2",children:"Permissions"}),u.jsx("div",{className:"space-y-2",children:["read","write","execute","admin"].map(v=>u.jsxs("label",{className:"flex items-center gap-3 p-3 bg-slate-50 dark:bg-slate-900/50 rounded-lg cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-700/50",children:[u.jsx("input",{type:"checkbox",checked:s.includes(v),onChange:()=>y(v),className:"w-4 h-4 text-primary-600 border-slate-300 rounded focus:ring-primary-500"}),u.jsxs("div",{className:"flex-1",children:[u.jsx("span",{className:"font-medium text-slate-900 dark:text-white capitalize",children:v}),u.jsxs("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-0.5",children:[v==="read"&&"View pipelines, runs, and artifacts",v==="write"&&"Modify configurations and metadata",v==="execute"&&"Run pipelines and workflows",v==="admin"&&"Full access including token management"]})]})]},v))})]})]}),u.jsxs("div",{className:"p-6 border-t border-slate-100 dark:border-slate-700 flex gap-3",children:[u.jsx(Se,{variant:"ghost",onClick:e,className:"flex-1",children:"Cancel"}),u.jsx(Se,{onClick:x,disabled:l,className:"flex-1",children:l?"Creating...":"Create Token"})]})]})})})}const _Ee=cG([{path:"/",element:u.jsx(PJ,{}),children:[{index:!0,element:u.jsx(Dee,{})},{path:"pipelines",element:u.jsx(Bee,{})},{path:"runs",element:u.jsx(rpe,{})},{path:"runs/:runId",element:u.jsx(ape,{})},{path:"assets",element:u.jsx(ppe,{})},{path:"experiments",element:u.jsx(ype,{})},{path:"experiments/:experimentId",element:u.jsx(vpe,{})},{path:"traces",element:u.jsx(wpe,{})},{path:"projects",element:u.jsx(jpe,{})},{path:"projects/:projectId",element:u.jsx(sEe,{})},{path:"schedules",element:u.jsx(lEe,{})},{path:"observability",element:u.jsx(cEe,{})},{path:"leaderboard",element:u.jsx(uEe,{})},{path:"plugins",element:u.jsx(yEe,{})},{path:"settings",element:u.jsx(vEe,{})},{path:"tokens",element:u.jsx(xEe,{})}]}]);function NEe(){return u.jsx(EG,{children:u.jsx(CG,{children:u.jsx(zQ,{children:u.jsx(yG,{router:_Ee})})})})}aj.createRoot(document.getElementById("root")).render(u.jsx(O.StrictMode,{children:u.jsx(NEe,{})}));