dbnexus 0.1.0
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.
- package/LICENSE +1 -0
- package/README.md +166 -0
- package/dist/api.js +86067 -0
- package/dist/cli.js +31634 -0
- package/dist/index.js +114 -0
- package/dist/web/assets/index-2M0S9O7L.js +379 -0
- package/dist/web/assets/index-irX5x4FY.css +1 -0
- package/dist/web/favicon.svg +18 -0
- package/dist/web/index.html +20 -0
- package/dist/web/logo-dark.svg +26 -0
- package/dist/web/logo-light.svg +26 -0
- package/dist/web/logo-option1.svg +24 -0
- package/dist/web/logo-option2.svg +32 -0
- package/dist/web/logo-option3.svg +29 -0
- package/dist/web/logo-option4.svg +26 -0
- package/dist/web/logo-option5.svg +30 -0
- package/dist/web/logo-option6.svg +30 -0
- package/package.json +43 -0
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
var VD=Object.defineProperty;var Jj=e=>{throw TypeError(e)};var GD=(e,t,n)=>t in e?VD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Df=(e,t,n)=>GD(e,typeof t!="symbol"?t+"":t,n),nv=(e,t,n)=>t.has(e)||Jj("Cannot "+n);var ue=(e,t,n)=>(nv(e,t,"read from private field"),n?n.call(e):t.get(e)),Mt=(e,t,n)=>t.has(e)?Jj("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),dt=(e,t,n,r)=>(nv(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Xt=(e,t,n)=>(nv(e,t,"access private method"),n);var Nm=(e,t,n,r)=>({set _(o){dt(e,t,o,n)},get _(){return ue(e,t,r)}});function UD(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function Ld(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rv={exports:{}},Af={},ov={exports:{}},tn={};/**
|
|
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 e2;function qD(){if(e2)return tn;e2=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function g(_){return _===null||typeof _!="object"?null:(_=p&&_[p]||_["@@iterator"],typeof _=="function"?_:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,v={};function C(_,U,Z){this.props=_,this.context=U,this.refs=v,this.updater=Z||y}C.prototype.isReactComponent={},C.prototype.setState=function(_,U){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,U,"setState")},C.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function S(){}S.prototype=C.prototype;function j(_,U,Z){this.props=_,this.context=U,this.refs=v,this.updater=Z||y}var w=j.prototype=new S;w.constructor=j,b(w,C.prototype),w.isPureReactComponent=!0;var k=Array.isArray,P=Object.prototype.hasOwnProperty,T={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function M(_,U,Z){var Q,ee={},ne=null,re=null;if(U!=null)for(Q in U.ref!==void 0&&(re=U.ref),U.key!==void 0&&(ne=""+U.key),U)P.call(U,Q)&&!$.hasOwnProperty(Q)&&(ee[Q]=U[Q]);var Y=arguments.length-2;if(Y===1)ee.children=Z;else if(1<Y){for(var ie=Array(Y),ce=0;ce<Y;ce++)ie[ce]=arguments[ce+2];ee.children=ie}if(_&&_.defaultProps)for(Q in Y=_.defaultProps,Y)ee[Q]===void 0&&(ee[Q]=Y[Q]);return{$$typeof:e,type:_,key:ne,ref:re,props:ee,_owner:T.current}}function R(_,U){return{$$typeof:e,type:_.type,key:U,ref:_.ref,props:_.props,_owner:_._owner}}function E(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function O(_){var U={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(Z){return U[Z]})}var A=/\/+/g;function N(_,U){return typeof _=="object"&&_!==null&&_.key!=null?O(""+_.key):U.toString(36)}function F(_,U,Z,Q,ee){var ne=typeof _;(ne==="undefined"||ne==="boolean")&&(_=null);var re=!1;if(_===null)re=!0;else switch(ne){case"string":case"number":re=!0;break;case"object":switch(_.$$typeof){case e:case t:re=!0}}if(re)return re=_,ee=ee(re),_=Q===""?"."+N(re,0):Q,k(ee)?(Z="",_!=null&&(Z=_.replace(A,"$&/")+"/"),F(ee,U,Z,"",function(ce){return ce})):ee!=null&&(E(ee)&&(ee=R(ee,Z+(!ee.key||re&&re.key===ee.key?"":(""+ee.key).replace(A,"$&/")+"/")+_)),U.push(ee)),1;if(re=0,Q=Q===""?".":Q+":",k(_))for(var Y=0;Y<_.length;Y++){ne=_[Y];var ie=Q+N(ne,Y);re+=F(ne,U,Z,ie,ee)}else if(ie=g(_),typeof ie=="function")for(_=ie.call(_),Y=0;!(ne=_.next()).done;)ne=ne.value,ie=Q+N(ne,Y++),re+=F(ne,U,Z,ie,ee);else if(ne==="object")throw U=String(_),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.");return re}function L(_,U,Z){if(_==null)return _;var Q=[],ee=0;return F(_,Q,"","",function(ne){return U.call(Z,ne,ee++)}),Q}function D(_){if(_._status===-1){var U=_._result;U=U(),U.then(function(Z){(_._status===0||_._status===-1)&&(_._status=1,_._result=Z)},function(Z){(_._status===0||_._status===-1)&&(_._status=2,_._result=Z)}),_._status===-1&&(_._status=0,_._result=U)}if(_._status===1)return _._result.default;throw _._result}var H={current:null},B={transition:null},V={ReactCurrentDispatcher:H,ReactCurrentBatchConfig:B,ReactCurrentOwner:T};function G(){throw Error("act(...) is not supported in production builds of React.")}return tn.Children={map:L,forEach:function(_,U,Z){L(_,function(){U.apply(this,arguments)},Z)},count:function(_){var U=0;return L(_,function(){U++}),U},toArray:function(_){return L(_,function(U){return U})||[]},only:function(_){if(!E(_))throw Error("React.Children.only expected to receive a single React element child.");return _}},tn.Component=C,tn.Fragment=n,tn.Profiler=o,tn.PureComponent=j,tn.StrictMode=r,tn.Suspense=u,tn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V,tn.act=G,tn.cloneElement=function(_,U,Z){if(_==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+_+".");var Q=b({},_.props),ee=_.key,ne=_.ref,re=_._owner;if(U!=null){if(U.ref!==void 0&&(ne=U.ref,re=T.current),U.key!==void 0&&(ee=""+U.key),_.type&&_.type.defaultProps)var Y=_.type.defaultProps;for(ie in U)P.call(U,ie)&&!$.hasOwnProperty(ie)&&(Q[ie]=U[ie]===void 0&&Y!==void 0?Y[ie]:U[ie])}var ie=arguments.length-2;if(ie===1)Q.children=Z;else if(1<ie){Y=Array(ie);for(var ce=0;ce<ie;ce++)Y[ce]=arguments[ce+2];Q.children=Y}return{$$typeof:e,type:_.type,key:ee,ref:ne,props:Q,_owner:re}},tn.createContext=function(_){return _={$$typeof:l,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},_.Provider={$$typeof:i,_context:_},_.Consumer=_},tn.createElement=M,tn.createFactory=function(_){var U=M.bind(null,_);return U.type=_,U},tn.createRef=function(){return{current:null}},tn.forwardRef=function(_){return{$$typeof:c,render:_}},tn.isValidElement=E,tn.lazy=function(_){return{$$typeof:h,_payload:{_status:-1,_result:_},_init:D}},tn.memo=function(_,U){return{$$typeof:f,type:_,compare:U===void 0?null:U}},tn.startTransition=function(_){var U=B.transition;B.transition={};try{_()}finally{B.transition=U}},tn.unstable_act=G,tn.useCallback=function(_,U){return H.current.useCallback(_,U)},tn.useContext=function(_){return H.current.useContext(_)},tn.useDebugValue=function(){},tn.useDeferredValue=function(_){return H.current.useDeferredValue(_)},tn.useEffect=function(_,U){return H.current.useEffect(_,U)},tn.useId=function(){return H.current.useId()},tn.useImperativeHandle=function(_,U,Z){return H.current.useImperativeHandle(_,U,Z)},tn.useInsertionEffect=function(_,U){return H.current.useInsertionEffect(_,U)},tn.useLayoutEffect=function(_,U){return H.current.useLayoutEffect(_,U)},tn.useMemo=function(_,U){return H.current.useMemo(_,U)},tn.useReducer=function(_,U,Z){return H.current.useReducer(_,U,Z)},tn.useRef=function(_){return H.current.useRef(_)},tn.useState=function(_){return H.current.useState(_)},tn.useSyncExternalStore=function(_,U,Z){return H.current.useSyncExternalStore(_,U,Z)},tn.useTransition=function(){return H.current.useTransition()},tn.version="18.3.1",tn}var t2;function Dd(){return t2||(t2=1,ov.exports=qD()),ov.exports}/**
|
|
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 n2;function KD(){if(n2)return Af;n2=1;var e=Dd(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(c,u,f){var h,p={},g=null,y=null;f!==void 0&&(g=""+f),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(y=u.ref);for(h in u)r.call(u,h)&&!i.hasOwnProperty(h)&&(p[h]=u[h]);if(c&&c.defaultProps)for(h in u=c.defaultProps,u)p[h]===void 0&&(p[h]=u[h]);return{$$typeof:t,type:c,key:g,ref:y,props:p,_owner:o.current}}return Af.Fragment=n,Af.jsx=l,Af.jsxs=l,Af}var r2;function QD(){return r2||(r2=1,rv.exports=KD()),rv.exports}var s=QD(),m=Dd();const br=Ld(m),p0=UD({__proto__:null,default:br},[m]);var _m={},sv={exports:{}},Ao={},iv={exports:{}},lv={};/**
|
|
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
|
+
*/var o2;function YD(){return o2||(o2=1,(function(e){function t(B,V){var G=B.length;B.push(V);e:for(;0<G;){var _=G-1>>>1,U=B[_];if(0<o(U,V))B[_]=V,B[G]=U,G=_;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var V=B[0],G=B.pop();if(G!==V){B[0]=G;e:for(var _=0,U=B.length,Z=U>>>1;_<Z;){var Q=2*(_+1)-1,ee=B[Q],ne=Q+1,re=B[ne];if(0>o(ee,G))ne<U&&0>o(re,ee)?(B[_]=re,B[ne]=G,_=ne):(B[_]=ee,B[Q]=G,_=Q);else if(ne<U&&0>o(re,G))B[_]=re,B[ne]=G,_=ne;else break e}}return V}function o(B,V){var G=B.sortIndex-V.sortIndex;return G!==0?G:B.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var u=[],f=[],h=1,p=null,g=3,y=!1,b=!1,v=!1,C=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(B){for(var V=n(f);V!==null;){if(V.callback===null)r(f);else if(V.startTime<=B)r(f),V.sortIndex=V.expirationTime,t(u,V);else break;V=n(f)}}function k(B){if(v=!1,w(B),!b)if(n(u)!==null)b=!0,D(P);else{var V=n(f);V!==null&&H(k,V.startTime-B)}}function P(B,V){b=!1,v&&(v=!1,S(M),M=-1),y=!0;var G=g;try{for(w(V),p=n(u);p!==null&&(!(p.expirationTime>V)||B&&!O());){var _=p.callback;if(typeof _=="function"){p.callback=null,g=p.priorityLevel;var U=_(p.expirationTime<=V);V=e.unstable_now(),typeof U=="function"?p.callback=U:p===n(u)&&r(u),w(V)}else r(u);p=n(u)}if(p!==null)var Z=!0;else{var Q=n(f);Q!==null&&H(k,Q.startTime-V),Z=!1}return Z}finally{p=null,g=G,y=!1}}var T=!1,$=null,M=-1,R=5,E=-1;function O(){return!(e.unstable_now()-E<R)}function A(){if($!==null){var B=e.unstable_now();E=B;var V=!0;try{V=$(!0,B)}finally{V?N():(T=!1,$=null)}}else T=!1}var N;if(typeof j=="function")N=function(){j(A)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,L=F.port2;F.port1.onmessage=A,N=function(){L.postMessage(null)}}else N=function(){C(A,0)};function D(B){$=B,T||(T=!0,N())}function H(B,V){M=C(function(){B(e.unstable_now())},V)}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(B){B.callback=null},e.unstable_continueExecution=function(){b||y||(b=!0,D(P))},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(B){switch(g){case 1:case 2:case 3:var V=3;break;default:V=g}var G=g;g=V;try{return B()}finally{g=G}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,V){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var G=g;g=B;try{return V()}finally{g=G}},e.unstable_scheduleCallback=function(B,V,G){var _=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?_+G:_):G=_,B){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=G+U,B={id:h++,callback:V,priorityLevel:B,startTime:G,expirationTime:U,sortIndex:-1},G>_?(B.sortIndex=G,t(f,B),n(u)===null&&B===n(f)&&(v?(S(M),M=-1):v=!0,H(k,G-_))):(B.sortIndex=U,t(u,B),b||y||(b=!0,D(P))),B},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(B){var V=g;return function(){var G=g;g=V;try{return B.apply(this,arguments)}finally{g=G}}}})(lv)),lv}var s2;function XD(){return s2||(s2=1,iv.exports=YD()),iv.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 i2;function ZD(){if(i2)return Ao;i2=1;var e=Dd(),t=XD();function n(a){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+a,x=1;x<arguments.length;x++)d+="&args[]="+encodeURIComponent(arguments[x]);return"Minified React error #"+a+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,o={};function i(a,d){l(a,d),l(a+"Capture",d)}function l(a,d){for(o[a]=d,a=0;a<d.length;a++)r.add(d[a])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,f=/^[: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]*$/,h={},p={};function g(a){return u.call(p,a)?!0:u.call(h,a)?!1:f.test(a)?p[a]=!0:(h[a]=!0,!1)}function y(a,d,x,I){if(x!==null&&x.type===0)return!1;switch(typeof d){case"function":case"symbol":return!0;case"boolean":return I?!1:x!==null?!x.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function b(a,d,x,I){if(d===null||typeof d>"u"||y(a,d,x,I))return!0;if(I)return!1;if(x!==null)switch(x.type){case 3:return!d;case 4:return d===!1;case 5:return isNaN(d);case 6:return isNaN(d)||1>d}return!1}function v(a,d,x,I,z,W,X){this.acceptsBooleans=d===2||d===3||d===4,this.attributeName=I,this.attributeNamespace=z,this.mustUseProperty=x,this.propertyName=a,this.type=d,this.sanitizeURL=W,this.removeEmptyString=X}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){C[a]=new v(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var d=a[0];C[d]=new v(d,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){C[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){C[a]=new v(a,2,!1,a,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(a){C[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){C[a]=new v(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){C[a]=new v(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){C[a]=new v(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){C[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function j(a){return a[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(a){var d=a.replace(S,j);C[d]=new v(d,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var d=a.replace(S,j);C[d]=new v(d,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var d=a.replace(S,j);C[d]=new v(d,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){C[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)}),C.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){C[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});function w(a,d,x,I){var z=C.hasOwnProperty(d)?C[d]:null;(z!==null?z.type!==0:I||!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(b(d,x,z,I)&&(x=null),I||z===null?g(d)&&(x===null?a.removeAttribute(d):a.setAttribute(d,""+x)):z.mustUseProperty?a[z.propertyName]=x===null?z.type===3?!1:"":x:(d=z.attributeName,I=z.attributeNamespace,x===null?a.removeAttribute(d):(z=z.type,x=z===3||z===4&&x===!0?"":""+x,I?a.setAttributeNS(I,d,x):a.setAttribute(d,x))))}var k=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),T=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),O=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),H=Symbol.for("react.offscreen"),B=Symbol.iterator;function V(a){return a===null||typeof a!="object"?null:(a=B&&a[B]||a["@@iterator"],typeof a=="function"?a:null)}var G=Object.assign,_;function U(a){if(_===void 0)try{throw Error()}catch(x){var d=x.stack.trim().match(/\n( *(at )?)/);_=d&&d[1]||""}return`
|
|
34
|
+
`+_+a}var Z=!1;function Q(a,d){if(!a||Z)return"";Z=!0;var x=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(d)if(d=function(){throw Error()},Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(Te){var I=Te}Reflect.construct(a,[],d)}else{try{d.call()}catch(Te){I=Te}a.call(d.prototype)}else{try{throw Error()}catch(Te){I=Te}a()}}catch(Te){if(Te&&I&&typeof Te.stack=="string"){for(var z=Te.stack.split(`
|
|
35
|
+
`),W=I.stack.split(`
|
|
36
|
+
`),X=z.length-1,ae=W.length-1;1<=X&&0<=ae&&z[X]!==W[ae];)ae--;for(;1<=X&&0<=ae;X--,ae--)if(z[X]!==W[ae]){if(X!==1||ae!==1)do if(X--,ae--,0>ae||z[X]!==W[ae]){var pe=`
|
|
37
|
+
`+z[X].replace(" at new "," at ");return a.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",a.displayName)),pe}while(1<=X&&0<=ae);break}}}finally{Z=!1,Error.prepareStackTrace=x}return(a=a?a.displayName||a.name:"")?U(a):""}function ee(a){switch(a.tag){case 5:return U(a.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return a=Q(a.type,!1),a;case 11:return a=Q(a.type.render,!1),a;case 1:return a=Q(a.type,!0),a;default:return""}}function ne(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case $:return"Fragment";case T:return"Portal";case R:return"Profiler";case M:return"StrictMode";case N:return"Suspense";case F:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case O:return(a.displayName||"Context")+".Consumer";case E:return(a._context.displayName||"Context")+".Provider";case A:var d=a.render;return a=a.displayName,a||(a=d.displayName||d.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case L:return d=a.displayName||null,d!==null?d:ne(a.type)||"Memo";case D:d=a._payload,a=a._init;try{return ne(a(d))}catch{}}return null}function re(a){var d=a.type;switch(a.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=d.render,a=a.displayName||a.name||"",d.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ne(d);case 8:return d===M?"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 d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function Y(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function ie(a){var d=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function ce(a){var d=ie(a)?"checked":"value",x=Object.getOwnPropertyDescriptor(a.constructor.prototype,d),I=""+a[d];if(!a.hasOwnProperty(d)&&typeof x<"u"&&typeof x.get=="function"&&typeof x.set=="function"){var z=x.get,W=x.set;return Object.defineProperty(a,d,{configurable:!0,get:function(){return z.call(this)},set:function(X){I=""+X,W.call(this,X)}}),Object.defineProperty(a,d,{enumerable:x.enumerable}),{getValue:function(){return I},setValue:function(X){I=""+X},stopTracking:function(){a._valueTracker=null,delete a[d]}}}}function he(a){a._valueTracker||(a._valueTracker=ce(a))}function de(a){if(!a)return!1;var d=a._valueTracker;if(!d)return!0;var x=d.getValue(),I="";return a&&(I=ie(a)?a.checked?"true":"false":a.value),a=I,a!==x?(d.setValue(a),!0):!1}function le(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function ge(a,d){var x=d.checked;return G({},d,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:x??a._wrapperState.initialChecked})}function Se(a,d){var x=d.defaultValue==null?"":d.defaultValue,I=d.checked!=null?d.checked:d.defaultChecked;x=Y(d.value!=null?d.value:x),a._wrapperState={initialChecked:I,initialValue:x,controlled:d.type==="checkbox"||d.type==="radio"?d.checked!=null:d.value!=null}}function ke(a,d){d=d.checked,d!=null&&w(a,"checked",d,!1)}function we(a,d){ke(a,d);var x=Y(d.value),I=d.type;if(x!=null)I==="number"?(x===0&&a.value===""||a.value!=x)&&(a.value=""+x):a.value!==""+x&&(a.value=""+x);else if(I==="submit"||I==="reset"){a.removeAttribute("value");return}d.hasOwnProperty("value")?be(a,d.type,x):d.hasOwnProperty("defaultValue")&&be(a,d.type,Y(d.defaultValue)),d.checked==null&&d.defaultChecked!=null&&(a.defaultChecked=!!d.defaultChecked)}function Oe(a,d,x){if(d.hasOwnProperty("value")||d.hasOwnProperty("defaultValue")){var I=d.type;if(!(I!=="submit"&&I!=="reset"||d.value!==void 0&&d.value!==null))return;d=""+a._wrapperState.initialValue,x||d===a.value||(a.value=d),a.defaultValue=d}x=a.name,x!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,x!==""&&(a.name=x)}function be(a,d,x){(d!=="number"||le(a.ownerDocument)!==a)&&(x==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+x&&(a.defaultValue=""+x))}var Fe=Array.isArray;function Ve(a,d,x,I){if(a=a.options,d){d={};for(var z=0;z<x.length;z++)d["$"+x[z]]=!0;for(x=0;x<a.length;x++)z=d.hasOwnProperty("$"+a[x].value),a[x].selected!==z&&(a[x].selected=z),z&&I&&(a[x].defaultSelected=!0)}else{for(x=""+Y(x),d=null,z=0;z<a.length;z++){if(a[z].value===x){a[z].selected=!0,I&&(a[z].defaultSelected=!0);return}d!==null||a[z].disabled||(d=a[z])}d!==null&&(d.selected=!0)}}function De(a,d){if(d.dangerouslySetInnerHTML!=null)throw Error(n(91));return G({},d,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Ze(a,d){var x=d.value;if(x==null){if(x=d.children,d=d.defaultValue,x!=null){if(d!=null)throw Error(n(92));if(Fe(x)){if(1<x.length)throw Error(n(93));x=x[0]}d=x}d==null&&(d=""),x=d}a._wrapperState={initialValue:Y(x)}}function Ae(a,d){var x=Y(d.value),I=Y(d.defaultValue);x!=null&&(x=""+x,x!==a.value&&(a.value=x),d.defaultValue==null&&a.defaultValue!==x&&(a.defaultValue=x)),I!=null&&(a.defaultValue=""+I)}function st(a){var d=a.textContent;d===a._wrapperState.initialValue&&d!==""&&d!==null&&(a.value=d)}function qe(a){switch(a){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 et(a,d){return a==null||a==="http://www.w3.org/1999/xhtml"?qe(d):a==="http://www.w3.org/2000/svg"&&d==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var oe,fe=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(d,x,I,z){MSApp.execUnsafeLocalFunction(function(){return a(d,x,I,z)})}:a})(function(a,d){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=d;else{for(oe=oe||document.createElement("div"),oe.innerHTML="<svg>"+d.valueOf().toString()+"</svg>",d=oe.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;d.firstChild;)a.appendChild(d.firstChild)}});function Ie(a,d){if(d){var x=a.firstChild;if(x&&x===a.lastChild&&x.nodeType===3){x.nodeValue=d;return}}a.textContent=d}var $e={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},pt=["Webkit","ms","Moz","O"];Object.keys($e).forEach(function(a){pt.forEach(function(d){d=d+a.charAt(0).toUpperCase()+a.substring(1),$e[d]=$e[a]})});function vt(a,d,x){return d==null||typeof d=="boolean"||d===""?"":x||typeof d!="number"||d===0||$e.hasOwnProperty(a)&&$e[a]?(""+d).trim():d+"px"}function Je(a,d){a=a.style;for(var x in d)if(d.hasOwnProperty(x)){var I=x.indexOf("--")===0,z=vt(x,d[x],I);x==="float"&&(x="cssFloat"),I?a.setProperty(x,z):a[x]=z}}var me=G({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 Ne(a,d){if(d){if(me[a]&&(d.children!=null||d.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(d.dangerouslySetInnerHTML!=null){if(d.children!=null)throw Error(n(60));if(typeof d.dangerouslySetInnerHTML!="object"||!("__html"in d.dangerouslySetInnerHTML))throw Error(n(61))}if(d.style!=null&&typeof d.style!="object")throw Error(n(62))}}function xt(a,d){if(a.indexOf("-")===-1)return typeof d.is=="string";switch(a){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 Bt=null;function pn(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var yn=null,hn=null,ln=null;function An(a){if(a=Cf(a)){if(typeof yn!="function")throw Error(n(280));var d=a.stateNode;d&&(d=em(d),yn(a.stateNode,a.type,d))}}function kt(a){hn?ln?ln.push(a):ln=[a]:hn=a}function un(){if(hn){var a=hn,d=ln;if(ln=hn=null,An(a),d)for(a=0;a<d.length;a++)An(d[a])}}function er(a,d){return a(d)}function yt(){}var Ht=!1;function Ke(a,d,x){if(Ht)return a(d,x);Ht=!0;try{return er(a,d,x)}finally{Ht=!1,(hn!==null||ln!==null)&&(yt(),un())}}function rt(a,d){var x=a.stateNode;if(x===null)return null;var I=em(x);if(I===null)return null;x=I[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(I=!I.disabled)||(a=a.type,I=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!I;break e;default:a=!1}if(a)return null;if(x&&typeof x!="function")throw Error(n(231,d,typeof x));return x}var It=!1;if(c)try{var Lt={};Object.defineProperty(Lt,"passive",{get:function(){It=!0}}),window.addEventListener("test",Lt,Lt),window.removeEventListener("test",Lt,Lt)}catch{It=!1}function Jt(a,d,x,I,z,W,X,ae,pe){var Te=Array.prototype.slice.call(arguments,3);try{d.apply(x,Te)}catch(Ue){this.onError(Ue)}}var tr=!1,kr=null,pr=!1,so=null,Kn={onError:function(a){tr=!0,kr=a}};function nr(a,d,x,I,z,W,X,ae,pe){tr=!1,kr=null,Jt.apply(Kn,arguments)}function io(a,d,x,I,z,W,X,ae,pe){if(nr.apply(this,arguments),tr){if(tr){var Te=kr;tr=!1,kr=null}else throw Error(n(198));pr||(pr=!0,so=Te)}}function Zr(a){var d=a,x=a;if(a.alternate)for(;d.return;)d=d.return;else{a=d;do d=a,(d.flags&4098)!==0&&(x=d.return),a=d.return;while(a)}return d.tag===3?x:null}function se(a){if(a.tag===13){var d=a.memoizedState;if(d===null&&(a=a.alternate,a!==null&&(d=a.memoizedState)),d!==null)return d.dehydrated}return null}function xe(a){if(Zr(a)!==a)throw Error(n(188))}function Re(a){var d=a.alternate;if(!d){if(d=Zr(a),d===null)throw Error(n(188));return d!==a?null:a}for(var x=a,I=d;;){var z=x.return;if(z===null)break;var W=z.alternate;if(W===null){if(I=z.return,I!==null){x=I;continue}break}if(z.child===W.child){for(W=z.child;W;){if(W===x)return xe(z),a;if(W===I)return xe(z),d;W=W.sibling}throw Error(n(188))}if(x.return!==I.return)x=z,I=W;else{for(var X=!1,ae=z.child;ae;){if(ae===x){X=!0,x=z,I=W;break}if(ae===I){X=!0,I=z,x=W;break}ae=ae.sibling}if(!X){for(ae=W.child;ae;){if(ae===x){X=!0,x=W,I=z;break}if(ae===I){X=!0,I=W,x=z;break}ae=ae.sibling}if(!X)throw Error(n(189))}}if(x.alternate!==I)throw Error(n(190))}if(x.tag!==3)throw Error(n(188));return x.stateNode.current===x?a:d}function nt(a){return a=Re(a),a!==null?wt(a):null}function wt(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var d=wt(a);if(d!==null)return d;a=a.sibling}return null}var Dt=t.unstable_scheduleCallback,Yt=t.unstable_cancelCallback,qt=t.unstable_shouldYield,on=t.unstable_requestPaint,nn=t.unstable_now,bo=t.unstable_getCurrentPriorityLevel,To=t.unstable_ImmediatePriority,Mo=t.unstable_UserBlockingPriority,Kt=t.unstable_NormalPriority,Nr=t.unstable_LowPriority,Qo=t.unstable_IdlePriority,Yo=null,Ro=null;function vy(a){if(Ro&&typeof Ro.onCommitFiberRoot=="function")try{Ro.onCommitFiberRoot(Yo,a,void 0,(a.current.flags&128)===128)}catch{}}var Xo=Math.clz32?Math.clz32:Sy,Cy=Math.log,wy=Math.LN2;function Sy(a){return a>>>=0,a===0?32:31-(Cy(a)/wy|0)|0}var Qc=64,Yc=4194304;function mi(a){switch(a&-a){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 a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Xc(a,d){var x=a.pendingLanes;if(x===0)return 0;var I=0,z=a.suspendedLanes,W=a.pingedLanes,X=x&268435455;if(X!==0){var ae=X&~z;ae!==0?I=mi(ae):(W&=X,W!==0&&(I=mi(W)))}else X=x&~z,X!==0?I=mi(X):W!==0&&(I=mi(W));if(I===0)return 0;if(d!==0&&d!==I&&(d&z)===0&&(z=I&-I,W=d&-d,z>=W||z===16&&(W&4194240)!==0))return d;if((I&4)!==0&&(I|=x&16),d=a.entangledLanes,d!==0)for(a=a.entanglements,d&=I;0<d;)x=31-Xo(d),z=1<<x,I|=a[x],d&=~z;return I}function Ah(a,d){switch(a){case 1:case 2:case 4:return d+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 d+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 jy(a,d){for(var x=a.suspendedLanes,I=a.pingedLanes,z=a.expirationTimes,W=a.pendingLanes;0<W;){var X=31-Xo(W),ae=1<<X,pe=z[X];pe===-1?((ae&x)===0||(ae&I)!==0)&&(z[X]=Ah(ae,d)):pe<=d&&(a.expiredLanes|=ae),W&=~ae}}function nf(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function Zc(){var a=Qc;return Qc<<=1,(Qc&4194240)===0&&(Qc=64),a}function rf(a){for(var d=[],x=0;31>x;x++)d.push(a);return d}function Ba(a,d,x){a.pendingLanes|=d,d!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,d=31-Xo(d),a[d]=x}function Fh(a,d){var x=a.pendingLanes&~d;a.pendingLanes=d,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=d,a.mutableReadLanes&=d,a.entangledLanes&=d,d=a.entanglements;var I=a.eventTimes;for(a=a.expirationTimes;0<x;){var z=31-Xo(x),W=1<<z;d[z]=0,I[z]=-1,a[z]=-1,x&=~W}}function ky(a,d){var x=a.entangledLanes|=d;for(a=a.entanglements;x;){var I=31-Xo(x),z=1<<I;z&d|a[I]&d&&(a[I]|=d),x&=~z}}var Fn=0;function RS(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var $S,Iy,OS,zS,LS,Ey=!1,Nh=[],Rl=null,$l=null,Ol=null,of=new Map,sf=new Map,zl=[],fL="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 DS(a,d){switch(a){case"focusin":case"focusout":Rl=null;break;case"dragenter":case"dragleave":$l=null;break;case"mouseover":case"mouseout":Ol=null;break;case"pointerover":case"pointerout":of.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":sf.delete(d.pointerId)}}function lf(a,d,x,I,z,W){return a===null||a.nativeEvent!==W?(a={blockedOn:d,domEventName:x,eventSystemFlags:I,nativeEvent:W,targetContainers:[z]},d!==null&&(d=Cf(d),d!==null&&Iy(d)),a):(a.eventSystemFlags|=I,d=a.targetContainers,z!==null&&d.indexOf(z)===-1&&d.push(z),a)}function pL(a,d,x,I,z){switch(d){case"focusin":return Rl=lf(Rl,a,d,x,I,z),!0;case"dragenter":return $l=lf($l,a,d,x,I,z),!0;case"mouseover":return Ol=lf(Ol,a,d,x,I,z),!0;case"pointerover":var W=z.pointerId;return of.set(W,lf(of.get(W)||null,a,d,x,I,z)),!0;case"gotpointercapture":return W=z.pointerId,sf.set(W,lf(sf.get(W)||null,a,d,x,I,z)),!0}return!1}function AS(a){var d=Wa(a.target);if(d!==null){var x=Zr(d);if(x!==null){if(d=x.tag,d===13){if(d=se(x),d!==null){a.blockedOn=d,LS(a.priority,function(){OS(x)});return}}else if(d===3&&x.stateNode.current.memoizedState.isDehydrated){a.blockedOn=x.tag===3?x.stateNode.containerInfo:null;return}}}a.blockedOn=null}function _h(a){if(a.blockedOn!==null)return!1;for(var d=a.targetContainers;0<d.length;){var x=Ty(a.domEventName,a.eventSystemFlags,d[0],a.nativeEvent);if(x===null){x=a.nativeEvent;var I=new x.constructor(x.type,x);Bt=I,x.target.dispatchEvent(I),Bt=null}else return d=Cf(x),d!==null&&Iy(d),a.blockedOn=x,!1;d.shift()}return!0}function FS(a,d,x){_h(a)&&x.delete(d)}function hL(){Ey=!1,Rl!==null&&_h(Rl)&&(Rl=null),$l!==null&&_h($l)&&($l=null),Ol!==null&&_h(Ol)&&(Ol=null),of.forEach(FS),sf.forEach(FS)}function af(a,d){a.blockedOn===d&&(a.blockedOn=null,Ey||(Ey=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,hL)))}function cf(a){function d(z){return af(z,a)}if(0<Nh.length){af(Nh[0],a);for(var x=1;x<Nh.length;x++){var I=Nh[x];I.blockedOn===a&&(I.blockedOn=null)}}for(Rl!==null&&af(Rl,a),$l!==null&&af($l,a),Ol!==null&&af(Ol,a),of.forEach(d),sf.forEach(d),x=0;x<zl.length;x++)I=zl[x],I.blockedOn===a&&(I.blockedOn=null);for(;0<zl.length&&(x=zl[0],x.blockedOn===null);)AS(x),x.blockedOn===null&&zl.shift()}var Jc=k.ReactCurrentBatchConfig,Hh=!0;function mL(a,d,x,I){var z=Fn,W=Jc.transition;Jc.transition=null;try{Fn=1,Py(a,d,x,I)}finally{Fn=z,Jc.transition=W}}function gL(a,d,x,I){var z=Fn,W=Jc.transition;Jc.transition=null;try{Fn=4,Py(a,d,x,I)}finally{Fn=z,Jc.transition=W}}function Py(a,d,x,I){if(Hh){var z=Ty(a,d,x,I);if(z===null)Uy(a,d,I,Bh,x),DS(a,I);else if(pL(z,a,d,x,I))I.stopPropagation();else if(DS(a,I),d&4&&-1<fL.indexOf(a)){for(;z!==null;){var W=Cf(z);if(W!==null&&$S(W),W=Ty(a,d,x,I),W===null&&Uy(a,d,I,Bh,x),W===z)break;z=W}z!==null&&I.stopPropagation()}else Uy(a,d,I,null,x)}}var Bh=null;function Ty(a,d,x,I){if(Bh=null,a=pn(I),a=Wa(a),a!==null)if(d=Zr(a),d===null)a=null;else if(x=d.tag,x===13){if(a=se(d),a!==null)return a;a=null}else if(x===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;a=null}else d!==a&&(a=null);return Bh=a,null}function NS(a){switch(a){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(bo()){case To:return 1;case Mo:return 4;case Kt:case Nr:return 16;case Qo:return 536870912;default:return 16}default:return 16}}var Ll=null,My=null,Wh=null;function _S(){if(Wh)return Wh;var a,d=My,x=d.length,I,z="value"in Ll?Ll.value:Ll.textContent,W=z.length;for(a=0;a<x&&d[a]===z[a];a++);var X=x-a;for(I=1;I<=X&&d[x-I]===z[W-I];I++);return Wh=z.slice(a,1<I?1-I:void 0)}function Vh(a){var d=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&d===13&&(a=13)):a=d,a===10&&(a=13),32<=a||a===13?a:0}function Gh(){return!0}function HS(){return!1}function Zo(a){function d(x,I,z,W,X){this._reactName=x,this._targetInst=z,this.type=I,this.nativeEvent=W,this.target=X,this.currentTarget=null;for(var ae in a)a.hasOwnProperty(ae)&&(x=a[ae],this[ae]=x?x(W):W[ae]);return this.isDefaultPrevented=(W.defaultPrevented!=null?W.defaultPrevented:W.returnValue===!1)?Gh:HS,this.isPropagationStopped=HS,this}return G(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var x=this.nativeEvent;x&&(x.preventDefault?x.preventDefault():typeof x.returnValue!="unknown"&&(x.returnValue=!1),this.isDefaultPrevented=Gh)},stopPropagation:function(){var x=this.nativeEvent;x&&(x.stopPropagation?x.stopPropagation():typeof x.cancelBubble!="unknown"&&(x.cancelBubble=!0),this.isPropagationStopped=Gh)},persist:function(){},isPersistent:Gh}),d}var eu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ry=Zo(eu),uf=G({},eu,{view:0,detail:0}),xL=Zo(uf),$y,Oy,df,Uh=G({},uf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ly,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==df&&(df&&a.type==="mousemove"?($y=a.screenX-df.screenX,Oy=a.screenY-df.screenY):Oy=$y=0,df=a),$y)},movementY:function(a){return"movementY"in a?a.movementY:Oy}}),BS=Zo(Uh),yL=G({},Uh,{dataTransfer:0}),bL=Zo(yL),vL=G({},uf,{relatedTarget:0}),zy=Zo(vL),CL=G({},eu,{animationName:0,elapsedTime:0,pseudoElement:0}),wL=Zo(CL),SL=G({},eu,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),jL=Zo(SL),kL=G({},eu,{data:0}),WS=Zo(kL),IL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},EL={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"},PL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function TL(a){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(a):(a=PL[a])?!!d[a]:!1}function Ly(){return TL}var ML=G({},uf,{key:function(a){if(a.key){var d=IL[a.key]||a.key;if(d!=="Unidentified")return d}return a.type==="keypress"?(a=Vh(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?EL[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ly,charCode:function(a){return a.type==="keypress"?Vh(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Vh(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),RL=Zo(ML),$L=G({},Uh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),VS=Zo($L),OL=G({},uf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ly}),zL=Zo(OL),LL=G({},eu,{propertyName:0,elapsedTime:0,pseudoElement:0}),DL=Zo(LL),AL=G({},Uh,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),FL=Zo(AL),NL=[9,13,27,32],Dy=c&&"CompositionEvent"in window,ff=null;c&&"documentMode"in document&&(ff=document.documentMode);var _L=c&&"TextEvent"in window&&!ff,GS=c&&(!Dy||ff&&8<ff&&11>=ff),US=" ",qS=!1;function KS(a,d){switch(a){case"keyup":return NL.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function QS(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var tu=!1;function HL(a,d){switch(a){case"compositionend":return QS(d);case"keypress":return d.which!==32?null:(qS=!0,US);case"textInput":return a=d.data,a===US&&qS?null:a;default:return null}}function BL(a,d){if(tu)return a==="compositionend"||!Dy&&KS(a,d)?(a=_S(),Wh=My=Ll=null,tu=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return GS&&d.locale!=="ko"?null:d.data;default:return null}}var WL={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 YS(a){var d=a&&a.nodeName&&a.nodeName.toLowerCase();return d==="input"?!!WL[a.type]:d==="textarea"}function XS(a,d,x,I){kt(I),d=Xh(d,"onChange"),0<d.length&&(x=new Ry("onChange","change",null,x,I),a.push({event:x,listeners:d}))}var pf=null,hf=null;function VL(a){m1(a,0)}function qh(a){var d=iu(a);if(de(d))return a}function GL(a,d){if(a==="change")return d}var ZS=!1;if(c){var Ay;if(c){var Fy="oninput"in document;if(!Fy){var JS=document.createElement("div");JS.setAttribute("oninput","return;"),Fy=typeof JS.oninput=="function"}Ay=Fy}else Ay=!1;ZS=Ay&&(!document.documentMode||9<document.documentMode)}function e1(){pf&&(pf.detachEvent("onpropertychange",t1),hf=pf=null)}function t1(a){if(a.propertyName==="value"&&qh(hf)){var d=[];XS(d,hf,a,pn(a)),Ke(VL,d)}}function UL(a,d,x){a==="focusin"?(e1(),pf=d,hf=x,pf.attachEvent("onpropertychange",t1)):a==="focusout"&&e1()}function qL(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return qh(hf)}function KL(a,d){if(a==="click")return qh(d)}function QL(a,d){if(a==="input"||a==="change")return qh(d)}function YL(a,d){return a===d&&(a!==0||1/a===1/d)||a!==a&&d!==d}var Gs=typeof Object.is=="function"?Object.is:YL;function mf(a,d){if(Gs(a,d))return!0;if(typeof a!="object"||a===null||typeof d!="object"||d===null)return!1;var x=Object.keys(a),I=Object.keys(d);if(x.length!==I.length)return!1;for(I=0;I<x.length;I++){var z=x[I];if(!u.call(d,z)||!Gs(a[z],d[z]))return!1}return!0}function n1(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function r1(a,d){var x=n1(a);a=0;for(var I;x;){if(x.nodeType===3){if(I=a+x.textContent.length,a<=d&&I>=d)return{node:x,offset:d-a};a=I}e:{for(;x;){if(x.nextSibling){x=x.nextSibling;break e}x=x.parentNode}x=void 0}x=n1(x)}}function o1(a,d){return a&&d?a===d?!0:a&&a.nodeType===3?!1:d&&d.nodeType===3?o1(a,d.parentNode):"contains"in a?a.contains(d):a.compareDocumentPosition?!!(a.compareDocumentPosition(d)&16):!1:!1}function s1(){for(var a=window,d=le();d instanceof a.HTMLIFrameElement;){try{var x=typeof d.contentWindow.location.href=="string"}catch{x=!1}if(x)a=d.contentWindow;else break;d=le(a.document)}return d}function Ny(a){var d=a&&a.nodeName&&a.nodeName.toLowerCase();return d&&(d==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||d==="textarea"||a.contentEditable==="true")}function XL(a){var d=s1(),x=a.focusedElem,I=a.selectionRange;if(d!==x&&x&&x.ownerDocument&&o1(x.ownerDocument.documentElement,x)){if(I!==null&&Ny(x)){if(d=I.start,a=I.end,a===void 0&&(a=d),"selectionStart"in x)x.selectionStart=d,x.selectionEnd=Math.min(a,x.value.length);else if(a=(d=x.ownerDocument||document)&&d.defaultView||window,a.getSelection){a=a.getSelection();var z=x.textContent.length,W=Math.min(I.start,z);I=I.end===void 0?W:Math.min(I.end,z),!a.extend&&W>I&&(z=I,I=W,W=z),z=r1(x,W);var X=r1(x,I);z&&X&&(a.rangeCount!==1||a.anchorNode!==z.node||a.anchorOffset!==z.offset||a.focusNode!==X.node||a.focusOffset!==X.offset)&&(d=d.createRange(),d.setStart(z.node,z.offset),a.removeAllRanges(),W>I?(a.addRange(d),a.extend(X.node,X.offset)):(d.setEnd(X.node,X.offset),a.addRange(d)))}}for(d=[],a=x;a=a.parentNode;)a.nodeType===1&&d.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<d.length;x++)a=d[x],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var ZL=c&&"documentMode"in document&&11>=document.documentMode,nu=null,_y=null,gf=null,Hy=!1;function i1(a,d,x){var I=x.window===x?x.document:x.nodeType===9?x:x.ownerDocument;Hy||nu==null||nu!==le(I)||(I=nu,"selectionStart"in I&&Ny(I)?I={start:I.selectionStart,end:I.selectionEnd}:(I=(I.ownerDocument&&I.ownerDocument.defaultView||window).getSelection(),I={anchorNode:I.anchorNode,anchorOffset:I.anchorOffset,focusNode:I.focusNode,focusOffset:I.focusOffset}),gf&&mf(gf,I)||(gf=I,I=Xh(_y,"onSelect"),0<I.length&&(d=new Ry("onSelect","select",null,d,x),a.push({event:d,listeners:I}),d.target=nu)))}function Kh(a,d){var x={};return x[a.toLowerCase()]=d.toLowerCase(),x["Webkit"+a]="webkit"+d,x["Moz"+a]="moz"+d,x}var ru={animationend:Kh("Animation","AnimationEnd"),animationiteration:Kh("Animation","AnimationIteration"),animationstart:Kh("Animation","AnimationStart"),transitionend:Kh("Transition","TransitionEnd")},By={},l1={};c&&(l1=document.createElement("div").style,"AnimationEvent"in window||(delete ru.animationend.animation,delete ru.animationiteration.animation,delete ru.animationstart.animation),"TransitionEvent"in window||delete ru.transitionend.transition);function Qh(a){if(By[a])return By[a];if(!ru[a])return a;var d=ru[a],x;for(x in d)if(d.hasOwnProperty(x)&&x in l1)return By[a]=d[x];return a}var a1=Qh("animationend"),c1=Qh("animationiteration"),u1=Qh("animationstart"),d1=Qh("transitionend"),f1=new Map,p1="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 Dl(a,d){f1.set(a,d),i(d,[a])}for(var Wy=0;Wy<p1.length;Wy++){var Vy=p1[Wy],JL=Vy.toLowerCase(),eD=Vy[0].toUpperCase()+Vy.slice(1);Dl(JL,"on"+eD)}Dl(a1,"onAnimationEnd"),Dl(c1,"onAnimationIteration"),Dl(u1,"onAnimationStart"),Dl("dblclick","onDoubleClick"),Dl("focusin","onFocus"),Dl("focusout","onBlur"),Dl(d1,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xf="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(" "),tD=new Set("cancel close invalid load scroll toggle".split(" ").concat(xf));function h1(a,d,x){var I=a.type||"unknown-event";a.currentTarget=x,io(I,d,void 0,a),a.currentTarget=null}function m1(a,d){d=(d&4)!==0;for(var x=0;x<a.length;x++){var I=a[x],z=I.event;I=I.listeners;e:{var W=void 0;if(d)for(var X=I.length-1;0<=X;X--){var ae=I[X],pe=ae.instance,Te=ae.currentTarget;if(ae=ae.listener,pe!==W&&z.isPropagationStopped())break e;h1(z,ae,Te),W=pe}else for(X=0;X<I.length;X++){if(ae=I[X],pe=ae.instance,Te=ae.currentTarget,ae=ae.listener,pe!==W&&z.isPropagationStopped())break e;h1(z,ae,Te),W=pe}}}if(pr)throw a=so,pr=!1,so=null,a}function Yn(a,d){var x=d[Zy];x===void 0&&(x=d[Zy]=new Set);var I=a+"__bubble";x.has(I)||(g1(d,a,2,!1),x.add(I))}function Gy(a,d,x){var I=0;d&&(I|=4),g1(x,a,I,d)}var Yh="_reactListening"+Math.random().toString(36).slice(2);function yf(a){if(!a[Yh]){a[Yh]=!0,r.forEach(function(x){x!=="selectionchange"&&(tD.has(x)||Gy(x,!1,a),Gy(x,!0,a))});var d=a.nodeType===9?a:a.ownerDocument;d===null||d[Yh]||(d[Yh]=!0,Gy("selectionchange",!1,d))}}function g1(a,d,x,I){switch(NS(d)){case 1:var z=mL;break;case 4:z=gL;break;default:z=Py}x=z.bind(null,d,x,a),z=void 0,!It||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(z=!0),I?z!==void 0?a.addEventListener(d,x,{capture:!0,passive:z}):a.addEventListener(d,x,!0):z!==void 0?a.addEventListener(d,x,{passive:z}):a.addEventListener(d,x,!1)}function Uy(a,d,x,I,z){var W=I;if((d&1)===0&&(d&2)===0&&I!==null)e:for(;;){if(I===null)return;var X=I.tag;if(X===3||X===4){var ae=I.stateNode.containerInfo;if(ae===z||ae.nodeType===8&&ae.parentNode===z)break;if(X===4)for(X=I.return;X!==null;){var pe=X.tag;if((pe===3||pe===4)&&(pe=X.stateNode.containerInfo,pe===z||pe.nodeType===8&&pe.parentNode===z))return;X=X.return}for(;ae!==null;){if(X=Wa(ae),X===null)return;if(pe=X.tag,pe===5||pe===6){I=W=X;continue e}ae=ae.parentNode}}I=I.return}Ke(function(){var Te=W,Ue=pn(x),Qe=[];e:{var We=f1.get(a);if(We!==void 0){var ht=Ry,Ct=a;switch(a){case"keypress":if(Vh(x)===0)break e;case"keydown":case"keyup":ht=RL;break;case"focusin":Ct="focus",ht=zy;break;case"focusout":Ct="blur",ht=zy;break;case"beforeblur":case"afterblur":ht=zy;break;case"click":if(x.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ht=BS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ht=bL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ht=zL;break;case a1:case c1:case u1:ht=wL;break;case d1:ht=DL;break;case"scroll":ht=xL;break;case"wheel":ht=FL;break;case"copy":case"cut":case"paste":ht=jL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ht=VS}var jt=(d&4)!==0,wr=!jt&&a==="scroll",je=jt?We!==null?We+"Capture":null:We;jt=[];for(var ye=Te,Ee;ye!==null;){Ee=ye;var Xe=Ee.stateNode;if(Ee.tag===5&&Xe!==null&&(Ee=Xe,je!==null&&(Xe=rt(ye,je),Xe!=null&&jt.push(bf(ye,Xe,Ee)))),wr)break;ye=ye.return}0<jt.length&&(We=new ht(We,Ct,null,x,Ue),Qe.push({event:We,listeners:jt}))}}if((d&7)===0){e:{if(We=a==="mouseover"||a==="pointerover",ht=a==="mouseout"||a==="pointerout",We&&x!==Bt&&(Ct=x.relatedTarget||x.fromElement)&&(Wa(Ct)||Ct[Wi]))break e;if((ht||We)&&(We=Ue.window===Ue?Ue:(We=Ue.ownerDocument)?We.defaultView||We.parentWindow:window,ht?(Ct=x.relatedTarget||x.toElement,ht=Te,Ct=Ct?Wa(Ct):null,Ct!==null&&(wr=Zr(Ct),Ct!==wr||Ct.tag!==5&&Ct.tag!==6)&&(Ct=null)):(ht=null,Ct=Te),ht!==Ct)){if(jt=BS,Xe="onMouseLeave",je="onMouseEnter",ye="mouse",(a==="pointerout"||a==="pointerover")&&(jt=VS,Xe="onPointerLeave",je="onPointerEnter",ye="pointer"),wr=ht==null?We:iu(ht),Ee=Ct==null?We:iu(Ct),We=new jt(Xe,ye+"leave",ht,x,Ue),We.target=wr,We.relatedTarget=Ee,Xe=null,Wa(Ue)===Te&&(jt=new jt(je,ye+"enter",Ct,x,Ue),jt.target=Ee,jt.relatedTarget=wr,Xe=jt),wr=Xe,ht&&Ct)t:{for(jt=ht,je=Ct,ye=0,Ee=jt;Ee;Ee=ou(Ee))ye++;for(Ee=0,Xe=je;Xe;Xe=ou(Xe))Ee++;for(;0<ye-Ee;)jt=ou(jt),ye--;for(;0<Ee-ye;)je=ou(je),Ee--;for(;ye--;){if(jt===je||je!==null&&jt===je.alternate)break t;jt=ou(jt),je=ou(je)}jt=null}else jt=null;ht!==null&&x1(Qe,We,ht,jt,!1),Ct!==null&&wr!==null&&x1(Qe,wr,Ct,jt,!0)}}e:{if(We=Te?iu(Te):window,ht=We.nodeName&&We.nodeName.toLowerCase(),ht==="select"||ht==="input"&&We.type==="file")var Et=GL;else if(YS(We))if(ZS)Et=QL;else{Et=qL;var Ot=UL}else(ht=We.nodeName)&&ht.toLowerCase()==="input"&&(We.type==="checkbox"||We.type==="radio")&&(Et=KL);if(Et&&(Et=Et(a,Te))){XS(Qe,Et,x,Ue);break e}Ot&&Ot(a,We,Te),a==="focusout"&&(Ot=We._wrapperState)&&Ot.controlled&&We.type==="number"&&be(We,"number",We.value)}switch(Ot=Te?iu(Te):window,a){case"focusin":(YS(Ot)||Ot.contentEditable==="true")&&(nu=Ot,_y=Te,gf=null);break;case"focusout":gf=_y=nu=null;break;case"mousedown":Hy=!0;break;case"contextmenu":case"mouseup":case"dragend":Hy=!1,i1(Qe,x,Ue);break;case"selectionchange":if(ZL)break;case"keydown":case"keyup":i1(Qe,x,Ue)}var zt;if(Dy)e:{switch(a){case"compositionstart":var _t="onCompositionStart";break e;case"compositionend":_t="onCompositionEnd";break e;case"compositionupdate":_t="onCompositionUpdate";break e}_t=void 0}else tu?KS(a,x)&&(_t="onCompositionEnd"):a==="keydown"&&x.keyCode===229&&(_t="onCompositionStart");_t&&(GS&&x.locale!=="ko"&&(tu||_t!=="onCompositionStart"?_t==="onCompositionEnd"&&tu&&(zt=_S()):(Ll=Ue,My="value"in Ll?Ll.value:Ll.textContent,tu=!0)),Ot=Xh(Te,_t),0<Ot.length&&(_t=new WS(_t,a,null,x,Ue),Qe.push({event:_t,listeners:Ot}),zt?_t.data=zt:(zt=QS(x),zt!==null&&(_t.data=zt)))),(zt=_L?HL(a,x):BL(a,x))&&(Te=Xh(Te,"onBeforeInput"),0<Te.length&&(Ue=new WS("onBeforeInput","beforeinput",null,x,Ue),Qe.push({event:Ue,listeners:Te}),Ue.data=zt))}m1(Qe,d)})}function bf(a,d,x){return{instance:a,listener:d,currentTarget:x}}function Xh(a,d){for(var x=d+"Capture",I=[];a!==null;){var z=a,W=z.stateNode;z.tag===5&&W!==null&&(z=W,W=rt(a,x),W!=null&&I.unshift(bf(a,W,z)),W=rt(a,d),W!=null&&I.push(bf(a,W,z))),a=a.return}return I}function ou(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function x1(a,d,x,I,z){for(var W=d._reactName,X=[];x!==null&&x!==I;){var ae=x,pe=ae.alternate,Te=ae.stateNode;if(pe!==null&&pe===I)break;ae.tag===5&&Te!==null&&(ae=Te,z?(pe=rt(x,W),pe!=null&&X.unshift(bf(x,pe,ae))):z||(pe=rt(x,W),pe!=null&&X.push(bf(x,pe,ae)))),x=x.return}X.length!==0&&a.push({event:d,listeners:X})}var nD=/\r\n?/g,rD=/\u0000|\uFFFD/g;function y1(a){return(typeof a=="string"?a:""+a).replace(nD,`
|
|
38
|
+
`).replace(rD,"")}function Zh(a,d,x){if(d=y1(d),y1(a)!==d&&x)throw Error(n(425))}function Jh(){}var qy=null,Ky=null;function Qy(a,d){return a==="textarea"||a==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var Yy=typeof setTimeout=="function"?setTimeout:void 0,oD=typeof clearTimeout=="function"?clearTimeout:void 0,b1=typeof Promise=="function"?Promise:void 0,sD=typeof queueMicrotask=="function"?queueMicrotask:typeof b1<"u"?function(a){return b1.resolve(null).then(a).catch(iD)}:Yy;function iD(a){setTimeout(function(){throw a})}function Xy(a,d){var x=d,I=0;do{var z=x.nextSibling;if(a.removeChild(x),z&&z.nodeType===8)if(x=z.data,x==="/$"){if(I===0){a.removeChild(z),cf(d);return}I--}else x!=="$"&&x!=="$?"&&x!=="$!"||I++;x=z}while(x);cf(d)}function Al(a){for(;a!=null;a=a.nextSibling){var d=a.nodeType;if(d===1||d===3)break;if(d===8){if(d=a.data,d==="$"||d==="$!"||d==="$?")break;if(d==="/$")return null}}return a}function v1(a){a=a.previousSibling;for(var d=0;a;){if(a.nodeType===8){var x=a.data;if(x==="$"||x==="$!"||x==="$?"){if(d===0)return a;d--}else x==="/$"&&d++}a=a.previousSibling}return null}var su=Math.random().toString(36).slice(2),gi="__reactFiber$"+su,vf="__reactProps$"+su,Wi="__reactContainer$"+su,Zy="__reactEvents$"+su,lD="__reactListeners$"+su,aD="__reactHandles$"+su;function Wa(a){var d=a[gi];if(d)return d;for(var x=a.parentNode;x;){if(d=x[Wi]||x[gi]){if(x=d.alternate,d.child!==null||x!==null&&x.child!==null)for(a=v1(a);a!==null;){if(x=a[gi])return x;a=v1(a)}return d}a=x,x=a.parentNode}return null}function Cf(a){return a=a[gi]||a[Wi],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function iu(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function em(a){return a[vf]||null}var Jy=[],lu=-1;function Fl(a){return{current:a}}function Xn(a){0>lu||(a.current=Jy[lu],Jy[lu]=null,lu--)}function Qn(a,d){lu++,Jy[lu]=a.current,a.current=d}var Nl={},lo=Fl(Nl),$o=Fl(!1),Va=Nl;function au(a,d){var x=a.type.contextTypes;if(!x)return Nl;var I=a.stateNode;if(I&&I.__reactInternalMemoizedUnmaskedChildContext===d)return I.__reactInternalMemoizedMaskedChildContext;var z={},W;for(W in x)z[W]=d[W];return I&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=d,a.__reactInternalMemoizedMaskedChildContext=z),z}function Oo(a){return a=a.childContextTypes,a!=null}function tm(){Xn($o),Xn(lo)}function C1(a,d,x){if(lo.current!==Nl)throw Error(n(168));Qn(lo,d),Qn($o,x)}function w1(a,d,x){var I=a.stateNode;if(d=d.childContextTypes,typeof I.getChildContext!="function")return x;I=I.getChildContext();for(var z in I)if(!(z in d))throw Error(n(108,re(a)||"Unknown",z));return G({},x,I)}function nm(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Nl,Va=lo.current,Qn(lo,a),Qn($o,$o.current),!0}function S1(a,d,x){var I=a.stateNode;if(!I)throw Error(n(169));x?(a=w1(a,d,Va),I.__reactInternalMemoizedMergedChildContext=a,Xn($o),Xn(lo),Qn(lo,a)):Xn($o),Qn($o,x)}var Vi=null,rm=!1,eb=!1;function j1(a){Vi===null?Vi=[a]:Vi.push(a)}function cD(a){rm=!0,j1(a)}function _l(){if(!eb&&Vi!==null){eb=!0;var a=0,d=Fn;try{var x=Vi;for(Fn=1;a<x.length;a++){var I=x[a];do I=I(!0);while(I!==null)}Vi=null,rm=!1}catch(z){throw Vi!==null&&(Vi=Vi.slice(a+1)),Dt(To,_l),z}finally{Fn=d,eb=!1}}return null}var cu=[],uu=0,om=null,sm=0,ms=[],gs=0,Ga=null,Gi=1,Ui="";function Ua(a,d){cu[uu++]=sm,cu[uu++]=om,om=a,sm=d}function k1(a,d,x){ms[gs++]=Gi,ms[gs++]=Ui,ms[gs++]=Ga,Ga=a;var I=Gi;a=Ui;var z=32-Xo(I)-1;I&=~(1<<z),x+=1;var W=32-Xo(d)+z;if(30<W){var X=z-z%5;W=(I&(1<<X)-1).toString(32),I>>=X,z-=X,Gi=1<<32-Xo(d)+z|x<<z|I,Ui=W+a}else Gi=1<<W|x<<z|I,Ui=a}function tb(a){a.return!==null&&(Ua(a,1),k1(a,1,0))}function nb(a){for(;a===om;)om=cu[--uu],cu[uu]=null,sm=cu[--uu],cu[uu]=null;for(;a===Ga;)Ga=ms[--gs],ms[gs]=null,Ui=ms[--gs],ms[gs]=null,Gi=ms[--gs],ms[gs]=null}var Jo=null,es=null,rr=!1,Us=null;function I1(a,d){var x=vs(5,null,null,0);x.elementType="DELETED",x.stateNode=d,x.return=a,d=a.deletions,d===null?(a.deletions=[x],a.flags|=16):d.push(x)}function E1(a,d){switch(a.tag){case 5:var x=a.type;return d=d.nodeType!==1||x.toLowerCase()!==d.nodeName.toLowerCase()?null:d,d!==null?(a.stateNode=d,Jo=a,es=Al(d.firstChild),!0):!1;case 6:return d=a.pendingProps===""||d.nodeType!==3?null:d,d!==null?(a.stateNode=d,Jo=a,es=null,!0):!1;case 13:return d=d.nodeType!==8?null:d,d!==null?(x=Ga!==null?{id:Gi,overflow:Ui}:null,a.memoizedState={dehydrated:d,treeContext:x,retryLane:1073741824},x=vs(18,null,null,0),x.stateNode=d,x.return=a,a.child=x,Jo=a,es=null,!0):!1;default:return!1}}function rb(a){return(a.mode&1)!==0&&(a.flags&128)===0}function ob(a){if(rr){var d=es;if(d){var x=d;if(!E1(a,d)){if(rb(a))throw Error(n(418));d=Al(x.nextSibling);var I=Jo;d&&E1(a,d)?I1(I,x):(a.flags=a.flags&-4097|2,rr=!1,Jo=a)}}else{if(rb(a))throw Error(n(418));a.flags=a.flags&-4097|2,rr=!1,Jo=a}}}function P1(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;Jo=a}function im(a){if(a!==Jo)return!1;if(!rr)return P1(a),rr=!0,!1;var d;if((d=a.tag!==3)&&!(d=a.tag!==5)&&(d=a.type,d=d!=="head"&&d!=="body"&&!Qy(a.type,a.memoizedProps)),d&&(d=es)){if(rb(a))throw T1(),Error(n(418));for(;d;)I1(a,d),d=Al(d.nextSibling)}if(P1(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,d=0;a;){if(a.nodeType===8){var x=a.data;if(x==="/$"){if(d===0){es=Al(a.nextSibling);break e}d--}else x!=="$"&&x!=="$!"&&x!=="$?"||d++}a=a.nextSibling}es=null}}else es=Jo?Al(a.stateNode.nextSibling):null;return!0}function T1(){for(var a=es;a;)a=Al(a.nextSibling)}function du(){es=Jo=null,rr=!1}function sb(a){Us===null?Us=[a]:Us.push(a)}var uD=k.ReactCurrentBatchConfig;function wf(a,d,x){if(a=x.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(x._owner){if(x=x._owner,x){if(x.tag!==1)throw Error(n(309));var I=x.stateNode}if(!I)throw Error(n(147,a));var z=I,W=""+a;return d!==null&&d.ref!==null&&typeof d.ref=="function"&&d.ref._stringRef===W?d.ref:(d=function(X){var ae=z.refs;X===null?delete ae[W]:ae[W]=X},d._stringRef=W,d)}if(typeof a!="string")throw Error(n(284));if(!x._owner)throw Error(n(290,a))}return a}function lm(a,d){throw a=Object.prototype.toString.call(d),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":a))}function M1(a){var d=a._init;return d(a._payload)}function R1(a){function d(je,ye){if(a){var Ee=je.deletions;Ee===null?(je.deletions=[ye],je.flags|=16):Ee.push(ye)}}function x(je,ye){if(!a)return null;for(;ye!==null;)d(je,ye),ye=ye.sibling;return null}function I(je,ye){for(je=new Map;ye!==null;)ye.key!==null?je.set(ye.key,ye):je.set(ye.index,ye),ye=ye.sibling;return je}function z(je,ye){return je=Kl(je,ye),je.index=0,je.sibling=null,je}function W(je,ye,Ee){return je.index=Ee,a?(Ee=je.alternate,Ee!==null?(Ee=Ee.index,Ee<ye?(je.flags|=2,ye):Ee):(je.flags|=2,ye)):(je.flags|=1048576,ye)}function X(je){return a&&je.alternate===null&&(je.flags|=2),je}function ae(je,ye,Ee,Xe){return ye===null||ye.tag!==6?(ye=Yb(Ee,je.mode,Xe),ye.return=je,ye):(ye=z(ye,Ee),ye.return=je,ye)}function pe(je,ye,Ee,Xe){var Et=Ee.type;return Et===$?Ue(je,ye,Ee.props.children,Xe,Ee.key):ye!==null&&(ye.elementType===Et||typeof Et=="object"&&Et!==null&&Et.$$typeof===D&&M1(Et)===ye.type)?(Xe=z(ye,Ee.props),Xe.ref=wf(je,ye,Ee),Xe.return=je,Xe):(Xe=Rm(Ee.type,Ee.key,Ee.props,null,je.mode,Xe),Xe.ref=wf(je,ye,Ee),Xe.return=je,Xe)}function Te(je,ye,Ee,Xe){return ye===null||ye.tag!==4||ye.stateNode.containerInfo!==Ee.containerInfo||ye.stateNode.implementation!==Ee.implementation?(ye=Xb(Ee,je.mode,Xe),ye.return=je,ye):(ye=z(ye,Ee.children||[]),ye.return=je,ye)}function Ue(je,ye,Ee,Xe,Et){return ye===null||ye.tag!==7?(ye=ec(Ee,je.mode,Xe,Et),ye.return=je,ye):(ye=z(ye,Ee),ye.return=je,ye)}function Qe(je,ye,Ee){if(typeof ye=="string"&&ye!==""||typeof ye=="number")return ye=Yb(""+ye,je.mode,Ee),ye.return=je,ye;if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case P:return Ee=Rm(ye.type,ye.key,ye.props,null,je.mode,Ee),Ee.ref=wf(je,null,ye),Ee.return=je,Ee;case T:return ye=Xb(ye,je.mode,Ee),ye.return=je,ye;case D:var Xe=ye._init;return Qe(je,Xe(ye._payload),Ee)}if(Fe(ye)||V(ye))return ye=ec(ye,je.mode,Ee,null),ye.return=je,ye;lm(je,ye)}return null}function We(je,ye,Ee,Xe){var Et=ye!==null?ye.key:null;if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number")return Et!==null?null:ae(je,ye,""+Ee,Xe);if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case P:return Ee.key===Et?pe(je,ye,Ee,Xe):null;case T:return Ee.key===Et?Te(je,ye,Ee,Xe):null;case D:return Et=Ee._init,We(je,ye,Et(Ee._payload),Xe)}if(Fe(Ee)||V(Ee))return Et!==null?null:Ue(je,ye,Ee,Xe,null);lm(je,Ee)}return null}function ht(je,ye,Ee,Xe,Et){if(typeof Xe=="string"&&Xe!==""||typeof Xe=="number")return je=je.get(Ee)||null,ae(ye,je,""+Xe,Et);if(typeof Xe=="object"&&Xe!==null){switch(Xe.$$typeof){case P:return je=je.get(Xe.key===null?Ee:Xe.key)||null,pe(ye,je,Xe,Et);case T:return je=je.get(Xe.key===null?Ee:Xe.key)||null,Te(ye,je,Xe,Et);case D:var Ot=Xe._init;return ht(je,ye,Ee,Ot(Xe._payload),Et)}if(Fe(Xe)||V(Xe))return je=je.get(Ee)||null,Ue(ye,je,Xe,Et,null);lm(ye,Xe)}return null}function Ct(je,ye,Ee,Xe){for(var Et=null,Ot=null,zt=ye,_t=ye=0,Br=null;zt!==null&&_t<Ee.length;_t++){zt.index>_t?(Br=zt,zt=null):Br=zt.sibling;var bn=We(je,zt,Ee[_t],Xe);if(bn===null){zt===null&&(zt=Br);break}a&&zt&&bn.alternate===null&&d(je,zt),ye=W(bn,ye,_t),Ot===null?Et=bn:Ot.sibling=bn,Ot=bn,zt=Br}if(_t===Ee.length)return x(je,zt),rr&&Ua(je,_t),Et;if(zt===null){for(;_t<Ee.length;_t++)zt=Qe(je,Ee[_t],Xe),zt!==null&&(ye=W(zt,ye,_t),Ot===null?Et=zt:Ot.sibling=zt,Ot=zt);return rr&&Ua(je,_t),Et}for(zt=I(je,zt);_t<Ee.length;_t++)Br=ht(zt,je,_t,Ee[_t],Xe),Br!==null&&(a&&Br.alternate!==null&&zt.delete(Br.key===null?_t:Br.key),ye=W(Br,ye,_t),Ot===null?Et=Br:Ot.sibling=Br,Ot=Br);return a&&zt.forEach(function(Ql){return d(je,Ql)}),rr&&Ua(je,_t),Et}function jt(je,ye,Ee,Xe){var Et=V(Ee);if(typeof Et!="function")throw Error(n(150));if(Ee=Et.call(Ee),Ee==null)throw Error(n(151));for(var Ot=Et=null,zt=ye,_t=ye=0,Br=null,bn=Ee.next();zt!==null&&!bn.done;_t++,bn=Ee.next()){zt.index>_t?(Br=zt,zt=null):Br=zt.sibling;var Ql=We(je,zt,bn.value,Xe);if(Ql===null){zt===null&&(zt=Br);break}a&&zt&&Ql.alternate===null&&d(je,zt),ye=W(Ql,ye,_t),Ot===null?Et=Ql:Ot.sibling=Ql,Ot=Ql,zt=Br}if(bn.done)return x(je,zt),rr&&Ua(je,_t),Et;if(zt===null){for(;!bn.done;_t++,bn=Ee.next())bn=Qe(je,bn.value,Xe),bn!==null&&(ye=W(bn,ye,_t),Ot===null?Et=bn:Ot.sibling=bn,Ot=bn);return rr&&Ua(je,_t),Et}for(zt=I(je,zt);!bn.done;_t++,bn=Ee.next())bn=ht(zt,je,_t,bn.value,Xe),bn!==null&&(a&&bn.alternate!==null&&zt.delete(bn.key===null?_t:bn.key),ye=W(bn,ye,_t),Ot===null?Et=bn:Ot.sibling=bn,Ot=bn);return a&&zt.forEach(function(WD){return d(je,WD)}),rr&&Ua(je,_t),Et}function wr(je,ye,Ee,Xe){if(typeof Ee=="object"&&Ee!==null&&Ee.type===$&&Ee.key===null&&(Ee=Ee.props.children),typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case P:e:{for(var Et=Ee.key,Ot=ye;Ot!==null;){if(Ot.key===Et){if(Et=Ee.type,Et===$){if(Ot.tag===7){x(je,Ot.sibling),ye=z(Ot,Ee.props.children),ye.return=je,je=ye;break e}}else if(Ot.elementType===Et||typeof Et=="object"&&Et!==null&&Et.$$typeof===D&&M1(Et)===Ot.type){x(je,Ot.sibling),ye=z(Ot,Ee.props),ye.ref=wf(je,Ot,Ee),ye.return=je,je=ye;break e}x(je,Ot);break}else d(je,Ot);Ot=Ot.sibling}Ee.type===$?(ye=ec(Ee.props.children,je.mode,Xe,Ee.key),ye.return=je,je=ye):(Xe=Rm(Ee.type,Ee.key,Ee.props,null,je.mode,Xe),Xe.ref=wf(je,ye,Ee),Xe.return=je,je=Xe)}return X(je);case T:e:{for(Ot=Ee.key;ye!==null;){if(ye.key===Ot)if(ye.tag===4&&ye.stateNode.containerInfo===Ee.containerInfo&&ye.stateNode.implementation===Ee.implementation){x(je,ye.sibling),ye=z(ye,Ee.children||[]),ye.return=je,je=ye;break e}else{x(je,ye);break}else d(je,ye);ye=ye.sibling}ye=Xb(Ee,je.mode,Xe),ye.return=je,je=ye}return X(je);case D:return Ot=Ee._init,wr(je,ye,Ot(Ee._payload),Xe)}if(Fe(Ee))return Ct(je,ye,Ee,Xe);if(V(Ee))return jt(je,ye,Ee,Xe);lm(je,Ee)}return typeof Ee=="string"&&Ee!==""||typeof Ee=="number"?(Ee=""+Ee,ye!==null&&ye.tag===6?(x(je,ye.sibling),ye=z(ye,Ee),ye.return=je,je=ye):(x(je,ye),ye=Yb(Ee,je.mode,Xe),ye.return=je,je=ye),X(je)):x(je,ye)}return wr}var fu=R1(!0),$1=R1(!1),am=Fl(null),cm=null,pu=null,ib=null;function lb(){ib=pu=cm=null}function ab(a){var d=am.current;Xn(am),a._currentValue=d}function cb(a,d,x){for(;a!==null;){var I=a.alternate;if((a.childLanes&d)!==d?(a.childLanes|=d,I!==null&&(I.childLanes|=d)):I!==null&&(I.childLanes&d)!==d&&(I.childLanes|=d),a===x)break;a=a.return}}function hu(a,d){cm=a,ib=pu=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&d)!==0&&(zo=!0),a.firstContext=null)}function xs(a){var d=a._currentValue;if(ib!==a)if(a={context:a,memoizedValue:d,next:null},pu===null){if(cm===null)throw Error(n(308));pu=a,cm.dependencies={lanes:0,firstContext:a}}else pu=pu.next=a;return d}var qa=null;function ub(a){qa===null?qa=[a]:qa.push(a)}function O1(a,d,x,I){var z=d.interleaved;return z===null?(x.next=x,ub(d)):(x.next=z.next,z.next=x),d.interleaved=x,qi(a,I)}function qi(a,d){a.lanes|=d;var x=a.alternate;for(x!==null&&(x.lanes|=d),x=a,a=a.return;a!==null;)a.childLanes|=d,x=a.alternate,x!==null&&(x.childLanes|=d),x=a,a=a.return;return x.tag===3?x.stateNode:null}var Hl=!1;function db(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function z1(a,d){a=a.updateQueue,d.updateQueue===a&&(d.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Ki(a,d){return{eventTime:a,lane:d,tag:0,payload:null,callback:null,next:null}}function Bl(a,d,x){var I=a.updateQueue;if(I===null)return null;if(I=I.shared,(mn&2)!==0){var z=I.pending;return z===null?d.next=d:(d.next=z.next,z.next=d),I.pending=d,qi(a,x)}return z=I.interleaved,z===null?(d.next=d,ub(I)):(d.next=z.next,z.next=d),I.interleaved=d,qi(a,x)}function um(a,d,x){if(d=d.updateQueue,d!==null&&(d=d.shared,(x&4194240)!==0)){var I=d.lanes;I&=a.pendingLanes,x|=I,d.lanes=x,ky(a,x)}}function L1(a,d){var x=a.updateQueue,I=a.alternate;if(I!==null&&(I=I.updateQueue,x===I)){var z=null,W=null;if(x=x.firstBaseUpdate,x!==null){do{var X={eventTime:x.eventTime,lane:x.lane,tag:x.tag,payload:x.payload,callback:x.callback,next:null};W===null?z=W=X:W=W.next=X,x=x.next}while(x!==null);W===null?z=W=d:W=W.next=d}else z=W=d;x={baseState:I.baseState,firstBaseUpdate:z,lastBaseUpdate:W,shared:I.shared,effects:I.effects},a.updateQueue=x;return}a=x.lastBaseUpdate,a===null?x.firstBaseUpdate=d:a.next=d,x.lastBaseUpdate=d}function dm(a,d,x,I){var z=a.updateQueue;Hl=!1;var W=z.firstBaseUpdate,X=z.lastBaseUpdate,ae=z.shared.pending;if(ae!==null){z.shared.pending=null;var pe=ae,Te=pe.next;pe.next=null,X===null?W=Te:X.next=Te,X=pe;var Ue=a.alternate;Ue!==null&&(Ue=Ue.updateQueue,ae=Ue.lastBaseUpdate,ae!==X&&(ae===null?Ue.firstBaseUpdate=Te:ae.next=Te,Ue.lastBaseUpdate=pe))}if(W!==null){var Qe=z.baseState;X=0,Ue=Te=pe=null,ae=W;do{var We=ae.lane,ht=ae.eventTime;if((I&We)===We){Ue!==null&&(Ue=Ue.next={eventTime:ht,lane:0,tag:ae.tag,payload:ae.payload,callback:ae.callback,next:null});e:{var Ct=a,jt=ae;switch(We=d,ht=x,jt.tag){case 1:if(Ct=jt.payload,typeof Ct=="function"){Qe=Ct.call(ht,Qe,We);break e}Qe=Ct;break e;case 3:Ct.flags=Ct.flags&-65537|128;case 0:if(Ct=jt.payload,We=typeof Ct=="function"?Ct.call(ht,Qe,We):Ct,We==null)break e;Qe=G({},Qe,We);break e;case 2:Hl=!0}}ae.callback!==null&&ae.lane!==0&&(a.flags|=64,We=z.effects,We===null?z.effects=[ae]:We.push(ae))}else ht={eventTime:ht,lane:We,tag:ae.tag,payload:ae.payload,callback:ae.callback,next:null},Ue===null?(Te=Ue=ht,pe=Qe):Ue=Ue.next=ht,X|=We;if(ae=ae.next,ae===null){if(ae=z.shared.pending,ae===null)break;We=ae,ae=We.next,We.next=null,z.lastBaseUpdate=We,z.shared.pending=null}}while(!0);if(Ue===null&&(pe=Qe),z.baseState=pe,z.firstBaseUpdate=Te,z.lastBaseUpdate=Ue,d=z.shared.interleaved,d!==null){z=d;do X|=z.lane,z=z.next;while(z!==d)}else W===null&&(z.shared.lanes=0);Ya|=X,a.lanes=X,a.memoizedState=Qe}}function D1(a,d,x){if(a=d.effects,d.effects=null,a!==null)for(d=0;d<a.length;d++){var I=a[d],z=I.callback;if(z!==null){if(I.callback=null,I=x,typeof z!="function")throw Error(n(191,z));z.call(I)}}}var Sf={},xi=Fl(Sf),jf=Fl(Sf),kf=Fl(Sf);function Ka(a){if(a===Sf)throw Error(n(174));return a}function fb(a,d){switch(Qn(kf,d),Qn(jf,a),Qn(xi,Sf),a=d.nodeType,a){case 9:case 11:d=(d=d.documentElement)?d.namespaceURI:et(null,"");break;default:a=a===8?d.parentNode:d,d=a.namespaceURI||null,a=a.tagName,d=et(d,a)}Xn(xi),Qn(xi,d)}function mu(){Xn(xi),Xn(jf),Xn(kf)}function A1(a){Ka(kf.current);var d=Ka(xi.current),x=et(d,a.type);d!==x&&(Qn(jf,a),Qn(xi,x))}function pb(a){jf.current===a&&(Xn(xi),Xn(jf))}var cr=Fl(0);function fm(a){for(var d=a;d!==null;){if(d.tag===13){var x=d.memoizedState;if(x!==null&&(x=x.dehydrated,x===null||x.data==="$?"||x.data==="$!"))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===a)break;for(;d.sibling===null;){if(d.return===null||d.return===a)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var hb=[];function mb(){for(var a=0;a<hb.length;a++)hb[a]._workInProgressVersionPrimary=null;hb.length=0}var pm=k.ReactCurrentDispatcher,gb=k.ReactCurrentBatchConfig,Qa=0,ur=null,Rr=null,_r=null,hm=!1,If=!1,Ef=0,dD=0;function ao(){throw Error(n(321))}function xb(a,d){if(d===null)return!1;for(var x=0;x<d.length&&x<a.length;x++)if(!Gs(a[x],d[x]))return!1;return!0}function yb(a,d,x,I,z,W){if(Qa=W,ur=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,pm.current=a===null||a.memoizedState===null?mD:gD,a=x(I,z),If){W=0;do{if(If=!1,Ef=0,25<=W)throw Error(n(301));W+=1,_r=Rr=null,d.updateQueue=null,pm.current=xD,a=x(I,z)}while(If)}if(pm.current=xm,d=Rr!==null&&Rr.next!==null,Qa=0,_r=Rr=ur=null,hm=!1,d)throw Error(n(300));return a}function bb(){var a=Ef!==0;return Ef=0,a}function yi(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _r===null?ur.memoizedState=_r=a:_r=_r.next=a,_r}function ys(){if(Rr===null){var a=ur.alternate;a=a!==null?a.memoizedState:null}else a=Rr.next;var d=_r===null?ur.memoizedState:_r.next;if(d!==null)_r=d,Rr=a;else{if(a===null)throw Error(n(310));Rr=a,a={memoizedState:Rr.memoizedState,baseState:Rr.baseState,baseQueue:Rr.baseQueue,queue:Rr.queue,next:null},_r===null?ur.memoizedState=_r=a:_r=_r.next=a}return _r}function Pf(a,d){return typeof d=="function"?d(a):d}function vb(a){var d=ys(),x=d.queue;if(x===null)throw Error(n(311));x.lastRenderedReducer=a;var I=Rr,z=I.baseQueue,W=x.pending;if(W!==null){if(z!==null){var X=z.next;z.next=W.next,W.next=X}I.baseQueue=z=W,x.pending=null}if(z!==null){W=z.next,I=I.baseState;var ae=X=null,pe=null,Te=W;do{var Ue=Te.lane;if((Qa&Ue)===Ue)pe!==null&&(pe=pe.next={lane:0,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null}),I=Te.hasEagerState?Te.eagerState:a(I,Te.action);else{var Qe={lane:Ue,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null};pe===null?(ae=pe=Qe,X=I):pe=pe.next=Qe,ur.lanes|=Ue,Ya|=Ue}Te=Te.next}while(Te!==null&&Te!==W);pe===null?X=I:pe.next=ae,Gs(I,d.memoizedState)||(zo=!0),d.memoizedState=I,d.baseState=X,d.baseQueue=pe,x.lastRenderedState=I}if(a=x.interleaved,a!==null){z=a;do W=z.lane,ur.lanes|=W,Ya|=W,z=z.next;while(z!==a)}else z===null&&(x.lanes=0);return[d.memoizedState,x.dispatch]}function Cb(a){var d=ys(),x=d.queue;if(x===null)throw Error(n(311));x.lastRenderedReducer=a;var I=x.dispatch,z=x.pending,W=d.memoizedState;if(z!==null){x.pending=null;var X=z=z.next;do W=a(W,X.action),X=X.next;while(X!==z);Gs(W,d.memoizedState)||(zo=!0),d.memoizedState=W,d.baseQueue===null&&(d.baseState=W),x.lastRenderedState=W}return[W,I]}function F1(){}function N1(a,d){var x=ur,I=ys(),z=d(),W=!Gs(I.memoizedState,z);if(W&&(I.memoizedState=z,zo=!0),I=I.queue,wb(B1.bind(null,x,I,a),[a]),I.getSnapshot!==d||W||_r!==null&&_r.memoizedState.tag&1){if(x.flags|=2048,Tf(9,H1.bind(null,x,I,z,d),void 0,null),Hr===null)throw Error(n(349));(Qa&30)!==0||_1(x,d,z)}return z}function _1(a,d,x){a.flags|=16384,a={getSnapshot:d,value:x},d=ur.updateQueue,d===null?(d={lastEffect:null,stores:null},ur.updateQueue=d,d.stores=[a]):(x=d.stores,x===null?d.stores=[a]:x.push(a))}function H1(a,d,x,I){d.value=x,d.getSnapshot=I,W1(d)&&V1(a)}function B1(a,d,x){return x(function(){W1(d)&&V1(a)})}function W1(a){var d=a.getSnapshot;a=a.value;try{var x=d();return!Gs(a,x)}catch{return!0}}function V1(a){var d=qi(a,1);d!==null&&Ys(d,a,1,-1)}function G1(a){var d=yi();return typeof a=="function"&&(a=a()),d.memoizedState=d.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Pf,lastRenderedState:a},d.queue=a,a=a.dispatch=hD.bind(null,ur,a),[d.memoizedState,a]}function Tf(a,d,x,I){return a={tag:a,create:d,destroy:x,deps:I,next:null},d=ur.updateQueue,d===null?(d={lastEffect:null,stores:null},ur.updateQueue=d,d.lastEffect=a.next=a):(x=d.lastEffect,x===null?d.lastEffect=a.next=a:(I=x.next,x.next=a,a.next=I,d.lastEffect=a)),a}function U1(){return ys().memoizedState}function mm(a,d,x,I){var z=yi();ur.flags|=a,z.memoizedState=Tf(1|d,x,void 0,I===void 0?null:I)}function gm(a,d,x,I){var z=ys();I=I===void 0?null:I;var W=void 0;if(Rr!==null){var X=Rr.memoizedState;if(W=X.destroy,I!==null&&xb(I,X.deps)){z.memoizedState=Tf(d,x,W,I);return}}ur.flags|=a,z.memoizedState=Tf(1|d,x,W,I)}function q1(a,d){return mm(8390656,8,a,d)}function wb(a,d){return gm(2048,8,a,d)}function K1(a,d){return gm(4,2,a,d)}function Q1(a,d){return gm(4,4,a,d)}function Y1(a,d){if(typeof d=="function")return a=a(),d(a),function(){d(null)};if(d!=null)return a=a(),d.current=a,function(){d.current=null}}function X1(a,d,x){return x=x!=null?x.concat([a]):null,gm(4,4,Y1.bind(null,d,a),x)}function Sb(){}function Z1(a,d){var x=ys();d=d===void 0?null:d;var I=x.memoizedState;return I!==null&&d!==null&&xb(d,I[1])?I[0]:(x.memoizedState=[a,d],a)}function J1(a,d){var x=ys();d=d===void 0?null:d;var I=x.memoizedState;return I!==null&&d!==null&&xb(d,I[1])?I[0]:(a=a(),x.memoizedState=[a,d],a)}function ej(a,d,x){return(Qa&21)===0?(a.baseState&&(a.baseState=!1,zo=!0),a.memoizedState=x):(Gs(x,d)||(x=Zc(),ur.lanes|=x,Ya|=x,a.baseState=!0),d)}function fD(a,d){var x=Fn;Fn=x!==0&&4>x?x:4,a(!0);var I=gb.transition;gb.transition={};try{a(!1),d()}finally{Fn=x,gb.transition=I}}function tj(){return ys().memoizedState}function pD(a,d,x){var I=Ul(a);if(x={lane:I,action:x,hasEagerState:!1,eagerState:null,next:null},nj(a))rj(d,x);else if(x=O1(a,d,x,I),x!==null){var z=Co();Ys(x,a,I,z),oj(x,d,I)}}function hD(a,d,x){var I=Ul(a),z={lane:I,action:x,hasEagerState:!1,eagerState:null,next:null};if(nj(a))rj(d,z);else{var W=a.alternate;if(a.lanes===0&&(W===null||W.lanes===0)&&(W=d.lastRenderedReducer,W!==null))try{var X=d.lastRenderedState,ae=W(X,x);if(z.hasEagerState=!0,z.eagerState=ae,Gs(ae,X)){var pe=d.interleaved;pe===null?(z.next=z,ub(d)):(z.next=pe.next,pe.next=z),d.interleaved=z;return}}catch{}finally{}x=O1(a,d,z,I),x!==null&&(z=Co(),Ys(x,a,I,z),oj(x,d,I))}}function nj(a){var d=a.alternate;return a===ur||d!==null&&d===ur}function rj(a,d){If=hm=!0;var x=a.pending;x===null?d.next=d:(d.next=x.next,x.next=d),a.pending=d}function oj(a,d,x){if((x&4194240)!==0){var I=d.lanes;I&=a.pendingLanes,x|=I,d.lanes=x,ky(a,x)}}var xm={readContext:xs,useCallback:ao,useContext:ao,useEffect:ao,useImperativeHandle:ao,useInsertionEffect:ao,useLayoutEffect:ao,useMemo:ao,useReducer:ao,useRef:ao,useState:ao,useDebugValue:ao,useDeferredValue:ao,useTransition:ao,useMutableSource:ao,useSyncExternalStore:ao,useId:ao,unstable_isNewReconciler:!1},mD={readContext:xs,useCallback:function(a,d){return yi().memoizedState=[a,d===void 0?null:d],a},useContext:xs,useEffect:q1,useImperativeHandle:function(a,d,x){return x=x!=null?x.concat([a]):null,mm(4194308,4,Y1.bind(null,d,a),x)},useLayoutEffect:function(a,d){return mm(4194308,4,a,d)},useInsertionEffect:function(a,d){return mm(4,2,a,d)},useMemo:function(a,d){var x=yi();return d=d===void 0?null:d,a=a(),x.memoizedState=[a,d],a},useReducer:function(a,d,x){var I=yi();return d=x!==void 0?x(d):d,I.memoizedState=I.baseState=d,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:d},I.queue=a,a=a.dispatch=pD.bind(null,ur,a),[I.memoizedState,a]},useRef:function(a){var d=yi();return a={current:a},d.memoizedState=a},useState:G1,useDebugValue:Sb,useDeferredValue:function(a){return yi().memoizedState=a},useTransition:function(){var a=G1(!1),d=a[0];return a=fD.bind(null,a[1]),yi().memoizedState=a,[d,a]},useMutableSource:function(){},useSyncExternalStore:function(a,d,x){var I=ur,z=yi();if(rr){if(x===void 0)throw Error(n(407));x=x()}else{if(x=d(),Hr===null)throw Error(n(349));(Qa&30)!==0||_1(I,d,x)}z.memoizedState=x;var W={value:x,getSnapshot:d};return z.queue=W,q1(B1.bind(null,I,W,a),[a]),I.flags|=2048,Tf(9,H1.bind(null,I,W,x,d),void 0,null),x},useId:function(){var a=yi(),d=Hr.identifierPrefix;if(rr){var x=Ui,I=Gi;x=(I&~(1<<32-Xo(I)-1)).toString(32)+x,d=":"+d+"R"+x,x=Ef++,0<x&&(d+="H"+x.toString(32)),d+=":"}else x=dD++,d=":"+d+"r"+x.toString(32)+":";return a.memoizedState=d},unstable_isNewReconciler:!1},gD={readContext:xs,useCallback:Z1,useContext:xs,useEffect:wb,useImperativeHandle:X1,useInsertionEffect:K1,useLayoutEffect:Q1,useMemo:J1,useReducer:vb,useRef:U1,useState:function(){return vb(Pf)},useDebugValue:Sb,useDeferredValue:function(a){var d=ys();return ej(d,Rr.memoizedState,a)},useTransition:function(){var a=vb(Pf)[0],d=ys().memoizedState;return[a,d]},useMutableSource:F1,useSyncExternalStore:N1,useId:tj,unstable_isNewReconciler:!1},xD={readContext:xs,useCallback:Z1,useContext:xs,useEffect:wb,useImperativeHandle:X1,useInsertionEffect:K1,useLayoutEffect:Q1,useMemo:J1,useReducer:Cb,useRef:U1,useState:function(){return Cb(Pf)},useDebugValue:Sb,useDeferredValue:function(a){var d=ys();return Rr===null?d.memoizedState=a:ej(d,Rr.memoizedState,a)},useTransition:function(){var a=Cb(Pf)[0],d=ys().memoizedState;return[a,d]},useMutableSource:F1,useSyncExternalStore:N1,useId:tj,unstable_isNewReconciler:!1};function qs(a,d){if(a&&a.defaultProps){d=G({},d),a=a.defaultProps;for(var x in a)d[x]===void 0&&(d[x]=a[x]);return d}return d}function jb(a,d,x,I){d=a.memoizedState,x=x(I,d),x=x==null?d:G({},d,x),a.memoizedState=x,a.lanes===0&&(a.updateQueue.baseState=x)}var ym={isMounted:function(a){return(a=a._reactInternals)?Zr(a)===a:!1},enqueueSetState:function(a,d,x){a=a._reactInternals;var I=Co(),z=Ul(a),W=Ki(I,z);W.payload=d,x!=null&&(W.callback=x),d=Bl(a,W,z),d!==null&&(Ys(d,a,z,I),um(d,a,z))},enqueueReplaceState:function(a,d,x){a=a._reactInternals;var I=Co(),z=Ul(a),W=Ki(I,z);W.tag=1,W.payload=d,x!=null&&(W.callback=x),d=Bl(a,W,z),d!==null&&(Ys(d,a,z,I),um(d,a,z))},enqueueForceUpdate:function(a,d){a=a._reactInternals;var x=Co(),I=Ul(a),z=Ki(x,I);z.tag=2,d!=null&&(z.callback=d),d=Bl(a,z,I),d!==null&&(Ys(d,a,I,x),um(d,a,I))}};function sj(a,d,x,I,z,W,X){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(I,W,X):d.prototype&&d.prototype.isPureReactComponent?!mf(x,I)||!mf(z,W):!0}function ij(a,d,x){var I=!1,z=Nl,W=d.contextType;return typeof W=="object"&&W!==null?W=xs(W):(z=Oo(d)?Va:lo.current,I=d.contextTypes,W=(I=I!=null)?au(a,z):Nl),d=new d(x,W),a.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=ym,a.stateNode=d,d._reactInternals=a,I&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=z,a.__reactInternalMemoizedMaskedChildContext=W),d}function lj(a,d,x,I){a=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(x,I),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(x,I),d.state!==a&&ym.enqueueReplaceState(d,d.state,null)}function kb(a,d,x,I){var z=a.stateNode;z.props=x,z.state=a.memoizedState,z.refs={},db(a);var W=d.contextType;typeof W=="object"&&W!==null?z.context=xs(W):(W=Oo(d)?Va:lo.current,z.context=au(a,W)),z.state=a.memoizedState,W=d.getDerivedStateFromProps,typeof W=="function"&&(jb(a,d,W,x),z.state=a.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof z.getSnapshotBeforeUpdate=="function"||typeof z.UNSAFE_componentWillMount!="function"&&typeof z.componentWillMount!="function"||(d=z.state,typeof z.componentWillMount=="function"&&z.componentWillMount(),typeof z.UNSAFE_componentWillMount=="function"&&z.UNSAFE_componentWillMount(),d!==z.state&&ym.enqueueReplaceState(z,z.state,null),dm(a,x,z,I),z.state=a.memoizedState),typeof z.componentDidMount=="function"&&(a.flags|=4194308)}function gu(a,d){try{var x="",I=d;do x+=ee(I),I=I.return;while(I);var z=x}catch(W){z=`
|
|
39
|
+
Error generating stack: `+W.message+`
|
|
40
|
+
`+W.stack}return{value:a,source:d,stack:z,digest:null}}function Ib(a,d,x){return{value:a,source:null,stack:x??null,digest:d??null}}function Eb(a,d){try{console.error(d.value)}catch(x){setTimeout(function(){throw x})}}var yD=typeof WeakMap=="function"?WeakMap:Map;function aj(a,d,x){x=Ki(-1,x),x.tag=3,x.payload={element:null};var I=d.value;return x.callback=function(){km||(km=!0,Bb=I),Eb(a,d)},x}function cj(a,d,x){x=Ki(-1,x),x.tag=3;var I=a.type.getDerivedStateFromError;if(typeof I=="function"){var z=d.value;x.payload=function(){return I(z)},x.callback=function(){Eb(a,d)}}var W=a.stateNode;return W!==null&&typeof W.componentDidCatch=="function"&&(x.callback=function(){Eb(a,d),typeof I!="function"&&(Vl===null?Vl=new Set([this]):Vl.add(this));var X=d.stack;this.componentDidCatch(d.value,{componentStack:X!==null?X:""})}),x}function uj(a,d,x){var I=a.pingCache;if(I===null){I=a.pingCache=new yD;var z=new Set;I.set(d,z)}else z=I.get(d),z===void 0&&(z=new Set,I.set(d,z));z.has(x)||(z.add(x),a=$D.bind(null,a,d,x),d.then(a,a))}function dj(a){do{var d;if((d=a.tag===13)&&(d=a.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return a;a=a.return}while(a!==null);return null}function fj(a,d,x,I,z){return(a.mode&1)===0?(a===d?a.flags|=65536:(a.flags|=128,x.flags|=131072,x.flags&=-52805,x.tag===1&&(x.alternate===null?x.tag=17:(d=Ki(-1,1),d.tag=2,Bl(x,d,1))),x.lanes|=1),a):(a.flags|=65536,a.lanes=z,a)}var bD=k.ReactCurrentOwner,zo=!1;function vo(a,d,x,I){d.child=a===null?$1(d,null,x,I):fu(d,a.child,x,I)}function pj(a,d,x,I,z){x=x.render;var W=d.ref;return hu(d,z),I=yb(a,d,x,I,W,z),x=bb(),a!==null&&!zo?(d.updateQueue=a.updateQueue,d.flags&=-2053,a.lanes&=~z,Qi(a,d,z)):(rr&&x&&tb(d),d.flags|=1,vo(a,d,I,z),d.child)}function hj(a,d,x,I,z){if(a===null){var W=x.type;return typeof W=="function"&&!Qb(W)&&W.defaultProps===void 0&&x.compare===null&&x.defaultProps===void 0?(d.tag=15,d.type=W,mj(a,d,W,I,z)):(a=Rm(x.type,null,I,d,d.mode,z),a.ref=d.ref,a.return=d,d.child=a)}if(W=a.child,(a.lanes&z)===0){var X=W.memoizedProps;if(x=x.compare,x=x!==null?x:mf,x(X,I)&&a.ref===d.ref)return Qi(a,d,z)}return d.flags|=1,a=Kl(W,I),a.ref=d.ref,a.return=d,d.child=a}function mj(a,d,x,I,z){if(a!==null){var W=a.memoizedProps;if(mf(W,I)&&a.ref===d.ref)if(zo=!1,d.pendingProps=I=W,(a.lanes&z)!==0)(a.flags&131072)!==0&&(zo=!0);else return d.lanes=a.lanes,Qi(a,d,z)}return Pb(a,d,x,I,z)}function gj(a,d,x){var I=d.pendingProps,z=I.children,W=a!==null?a.memoizedState:null;if(I.mode==="hidden")if((d.mode&1)===0)d.memoizedState={baseLanes:0,cachePool:null,transitions:null},Qn(yu,ts),ts|=x;else{if((x&1073741824)===0)return a=W!==null?W.baseLanes|x:x,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:a,cachePool:null,transitions:null},d.updateQueue=null,Qn(yu,ts),ts|=a,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},I=W!==null?W.baseLanes:x,Qn(yu,ts),ts|=I}else W!==null?(I=W.baseLanes|x,d.memoizedState=null):I=x,Qn(yu,ts),ts|=I;return vo(a,d,z,x),d.child}function xj(a,d){var x=d.ref;(a===null&&x!==null||a!==null&&a.ref!==x)&&(d.flags|=512,d.flags|=2097152)}function Pb(a,d,x,I,z){var W=Oo(x)?Va:lo.current;return W=au(d,W),hu(d,z),x=yb(a,d,x,I,W,z),I=bb(),a!==null&&!zo?(d.updateQueue=a.updateQueue,d.flags&=-2053,a.lanes&=~z,Qi(a,d,z)):(rr&&I&&tb(d),d.flags|=1,vo(a,d,x,z),d.child)}function yj(a,d,x,I,z){if(Oo(x)){var W=!0;nm(d)}else W=!1;if(hu(d,z),d.stateNode===null)vm(a,d),ij(d,x,I),kb(d,x,I,z),I=!0;else if(a===null){var X=d.stateNode,ae=d.memoizedProps;X.props=ae;var pe=X.context,Te=x.contextType;typeof Te=="object"&&Te!==null?Te=xs(Te):(Te=Oo(x)?Va:lo.current,Te=au(d,Te));var Ue=x.getDerivedStateFromProps,Qe=typeof Ue=="function"||typeof X.getSnapshotBeforeUpdate=="function";Qe||typeof X.UNSAFE_componentWillReceiveProps!="function"&&typeof X.componentWillReceiveProps!="function"||(ae!==I||pe!==Te)&&lj(d,X,I,Te),Hl=!1;var We=d.memoizedState;X.state=We,dm(d,I,X,z),pe=d.memoizedState,ae!==I||We!==pe||$o.current||Hl?(typeof Ue=="function"&&(jb(d,x,Ue,I),pe=d.memoizedState),(ae=Hl||sj(d,x,ae,I,We,pe,Te))?(Qe||typeof X.UNSAFE_componentWillMount!="function"&&typeof X.componentWillMount!="function"||(typeof X.componentWillMount=="function"&&X.componentWillMount(),typeof X.UNSAFE_componentWillMount=="function"&&X.UNSAFE_componentWillMount()),typeof X.componentDidMount=="function"&&(d.flags|=4194308)):(typeof X.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=I,d.memoizedState=pe),X.props=I,X.state=pe,X.context=Te,I=ae):(typeof X.componentDidMount=="function"&&(d.flags|=4194308),I=!1)}else{X=d.stateNode,z1(a,d),ae=d.memoizedProps,Te=d.type===d.elementType?ae:qs(d.type,ae),X.props=Te,Qe=d.pendingProps,We=X.context,pe=x.contextType,typeof pe=="object"&&pe!==null?pe=xs(pe):(pe=Oo(x)?Va:lo.current,pe=au(d,pe));var ht=x.getDerivedStateFromProps;(Ue=typeof ht=="function"||typeof X.getSnapshotBeforeUpdate=="function")||typeof X.UNSAFE_componentWillReceiveProps!="function"&&typeof X.componentWillReceiveProps!="function"||(ae!==Qe||We!==pe)&&lj(d,X,I,pe),Hl=!1,We=d.memoizedState,X.state=We,dm(d,I,X,z);var Ct=d.memoizedState;ae!==Qe||We!==Ct||$o.current||Hl?(typeof ht=="function"&&(jb(d,x,ht,I),Ct=d.memoizedState),(Te=Hl||sj(d,x,Te,I,We,Ct,pe)||!1)?(Ue||typeof X.UNSAFE_componentWillUpdate!="function"&&typeof X.componentWillUpdate!="function"||(typeof X.componentWillUpdate=="function"&&X.componentWillUpdate(I,Ct,pe),typeof X.UNSAFE_componentWillUpdate=="function"&&X.UNSAFE_componentWillUpdate(I,Ct,pe)),typeof X.componentDidUpdate=="function"&&(d.flags|=4),typeof X.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof X.componentDidUpdate!="function"||ae===a.memoizedProps&&We===a.memoizedState||(d.flags|=4),typeof X.getSnapshotBeforeUpdate!="function"||ae===a.memoizedProps&&We===a.memoizedState||(d.flags|=1024),d.memoizedProps=I,d.memoizedState=Ct),X.props=I,X.state=Ct,X.context=pe,I=Te):(typeof X.componentDidUpdate!="function"||ae===a.memoizedProps&&We===a.memoizedState||(d.flags|=4),typeof X.getSnapshotBeforeUpdate!="function"||ae===a.memoizedProps&&We===a.memoizedState||(d.flags|=1024),I=!1)}return Tb(a,d,x,I,W,z)}function Tb(a,d,x,I,z,W){xj(a,d);var X=(d.flags&128)!==0;if(!I&&!X)return z&&S1(d,x,!1),Qi(a,d,W);I=d.stateNode,bD.current=d;var ae=X&&typeof x.getDerivedStateFromError!="function"?null:I.render();return d.flags|=1,a!==null&&X?(d.child=fu(d,a.child,null,W),d.child=fu(d,null,ae,W)):vo(a,d,ae,W),d.memoizedState=I.state,z&&S1(d,x,!0),d.child}function bj(a){var d=a.stateNode;d.pendingContext?C1(a,d.pendingContext,d.pendingContext!==d.context):d.context&&C1(a,d.context,!1),fb(a,d.containerInfo)}function vj(a,d,x,I,z){return du(),sb(z),d.flags|=256,vo(a,d,x,I),d.child}var Mb={dehydrated:null,treeContext:null,retryLane:0};function Rb(a){return{baseLanes:a,cachePool:null,transitions:null}}function Cj(a,d,x){var I=d.pendingProps,z=cr.current,W=!1,X=(d.flags&128)!==0,ae;if((ae=X)||(ae=a!==null&&a.memoizedState===null?!1:(z&2)!==0),ae?(W=!0,d.flags&=-129):(a===null||a.memoizedState!==null)&&(z|=1),Qn(cr,z&1),a===null)return ob(d),a=d.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((d.mode&1)===0?d.lanes=1:a.data==="$!"?d.lanes=8:d.lanes=1073741824,null):(X=I.children,a=I.fallback,W?(I=d.mode,W=d.child,X={mode:"hidden",children:X},(I&1)===0&&W!==null?(W.childLanes=0,W.pendingProps=X):W=$m(X,I,0,null),a=ec(a,I,x,null),W.return=d,a.return=d,W.sibling=a,d.child=W,d.child.memoizedState=Rb(x),d.memoizedState=Mb,a):$b(d,X));if(z=a.memoizedState,z!==null&&(ae=z.dehydrated,ae!==null))return vD(a,d,X,I,ae,z,x);if(W){W=I.fallback,X=d.mode,z=a.child,ae=z.sibling;var pe={mode:"hidden",children:I.children};return(X&1)===0&&d.child!==z?(I=d.child,I.childLanes=0,I.pendingProps=pe,d.deletions=null):(I=Kl(z,pe),I.subtreeFlags=z.subtreeFlags&14680064),ae!==null?W=Kl(ae,W):(W=ec(W,X,x,null),W.flags|=2),W.return=d,I.return=d,I.sibling=W,d.child=I,I=W,W=d.child,X=a.child.memoizedState,X=X===null?Rb(x):{baseLanes:X.baseLanes|x,cachePool:null,transitions:X.transitions},W.memoizedState=X,W.childLanes=a.childLanes&~x,d.memoizedState=Mb,I}return W=a.child,a=W.sibling,I=Kl(W,{mode:"visible",children:I.children}),(d.mode&1)===0&&(I.lanes=x),I.return=d,I.sibling=null,a!==null&&(x=d.deletions,x===null?(d.deletions=[a],d.flags|=16):x.push(a)),d.child=I,d.memoizedState=null,I}function $b(a,d){return d=$m({mode:"visible",children:d},a.mode,0,null),d.return=a,a.child=d}function bm(a,d,x,I){return I!==null&&sb(I),fu(d,a.child,null,x),a=$b(d,d.pendingProps.children),a.flags|=2,d.memoizedState=null,a}function vD(a,d,x,I,z,W,X){if(x)return d.flags&256?(d.flags&=-257,I=Ib(Error(n(422))),bm(a,d,X,I)):d.memoizedState!==null?(d.child=a.child,d.flags|=128,null):(W=I.fallback,z=d.mode,I=$m({mode:"visible",children:I.children},z,0,null),W=ec(W,z,X,null),W.flags|=2,I.return=d,W.return=d,I.sibling=W,d.child=I,(d.mode&1)!==0&&fu(d,a.child,null,X),d.child.memoizedState=Rb(X),d.memoizedState=Mb,W);if((d.mode&1)===0)return bm(a,d,X,null);if(z.data==="$!"){if(I=z.nextSibling&&z.nextSibling.dataset,I)var ae=I.dgst;return I=ae,W=Error(n(419)),I=Ib(W,I,void 0),bm(a,d,X,I)}if(ae=(X&a.childLanes)!==0,zo||ae){if(I=Hr,I!==null){switch(X&-X){case 4:z=2;break;case 16:z=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:z=32;break;case 536870912:z=268435456;break;default:z=0}z=(z&(I.suspendedLanes|X))!==0?0:z,z!==0&&z!==W.retryLane&&(W.retryLane=z,qi(a,z),Ys(I,a,z,-1))}return Kb(),I=Ib(Error(n(421))),bm(a,d,X,I)}return z.data==="$?"?(d.flags|=128,d.child=a.child,d=OD.bind(null,a),z._reactRetry=d,null):(a=W.treeContext,es=Al(z.nextSibling),Jo=d,rr=!0,Us=null,a!==null&&(ms[gs++]=Gi,ms[gs++]=Ui,ms[gs++]=Ga,Gi=a.id,Ui=a.overflow,Ga=d),d=$b(d,I.children),d.flags|=4096,d)}function wj(a,d,x){a.lanes|=d;var I=a.alternate;I!==null&&(I.lanes|=d),cb(a.return,d,x)}function Ob(a,d,x,I,z){var W=a.memoizedState;W===null?a.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:I,tail:x,tailMode:z}:(W.isBackwards=d,W.rendering=null,W.renderingStartTime=0,W.last=I,W.tail=x,W.tailMode=z)}function Sj(a,d,x){var I=d.pendingProps,z=I.revealOrder,W=I.tail;if(vo(a,d,I.children,x),I=cr.current,(I&2)!==0)I=I&1|2,d.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=d.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&wj(a,x,d);else if(a.tag===19)wj(a,x,d);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===d)break e;for(;a.sibling===null;){if(a.return===null||a.return===d)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}I&=1}if(Qn(cr,I),(d.mode&1)===0)d.memoizedState=null;else switch(z){case"forwards":for(x=d.child,z=null;x!==null;)a=x.alternate,a!==null&&fm(a)===null&&(z=x),x=x.sibling;x=z,x===null?(z=d.child,d.child=null):(z=x.sibling,x.sibling=null),Ob(d,!1,z,x,W);break;case"backwards":for(x=null,z=d.child,d.child=null;z!==null;){if(a=z.alternate,a!==null&&fm(a)===null){d.child=z;break}a=z.sibling,z.sibling=x,x=z,z=a}Ob(d,!0,x,null,W);break;case"together":Ob(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function vm(a,d){(d.mode&1)===0&&a!==null&&(a.alternate=null,d.alternate=null,d.flags|=2)}function Qi(a,d,x){if(a!==null&&(d.dependencies=a.dependencies),Ya|=d.lanes,(x&d.childLanes)===0)return null;if(a!==null&&d.child!==a.child)throw Error(n(153));if(d.child!==null){for(a=d.child,x=Kl(a,a.pendingProps),d.child=x,x.return=d;a.sibling!==null;)a=a.sibling,x=x.sibling=Kl(a,a.pendingProps),x.return=d;x.sibling=null}return d.child}function CD(a,d,x){switch(d.tag){case 3:bj(d),du();break;case 5:A1(d);break;case 1:Oo(d.type)&&nm(d);break;case 4:fb(d,d.stateNode.containerInfo);break;case 10:var I=d.type._context,z=d.memoizedProps.value;Qn(am,I._currentValue),I._currentValue=z;break;case 13:if(I=d.memoizedState,I!==null)return I.dehydrated!==null?(Qn(cr,cr.current&1),d.flags|=128,null):(x&d.child.childLanes)!==0?Cj(a,d,x):(Qn(cr,cr.current&1),a=Qi(a,d,x),a!==null?a.sibling:null);Qn(cr,cr.current&1);break;case 19:if(I=(x&d.childLanes)!==0,(a.flags&128)!==0){if(I)return Sj(a,d,x);d.flags|=128}if(z=d.memoizedState,z!==null&&(z.rendering=null,z.tail=null,z.lastEffect=null),Qn(cr,cr.current),I)break;return null;case 22:case 23:return d.lanes=0,gj(a,d,x)}return Qi(a,d,x)}var jj,zb,kj,Ij;jj=function(a,d){for(var x=d.child;x!==null;){if(x.tag===5||x.tag===6)a.appendChild(x.stateNode);else if(x.tag!==4&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===d)break;for(;x.sibling===null;){if(x.return===null||x.return===d)return;x=x.return}x.sibling.return=x.return,x=x.sibling}},zb=function(){},kj=function(a,d,x,I){var z=a.memoizedProps;if(z!==I){a=d.stateNode,Ka(xi.current);var W=null;switch(x){case"input":z=ge(a,z),I=ge(a,I),W=[];break;case"select":z=G({},z,{value:void 0}),I=G({},I,{value:void 0}),W=[];break;case"textarea":z=De(a,z),I=De(a,I),W=[];break;default:typeof z.onClick!="function"&&typeof I.onClick=="function"&&(a.onclick=Jh)}Ne(x,I);var X;x=null;for(Te in z)if(!I.hasOwnProperty(Te)&&z.hasOwnProperty(Te)&&z[Te]!=null)if(Te==="style"){var ae=z[Te];for(X in ae)ae.hasOwnProperty(X)&&(x||(x={}),x[X]="")}else Te!=="dangerouslySetInnerHTML"&&Te!=="children"&&Te!=="suppressContentEditableWarning"&&Te!=="suppressHydrationWarning"&&Te!=="autoFocus"&&(o.hasOwnProperty(Te)?W||(W=[]):(W=W||[]).push(Te,null));for(Te in I){var pe=I[Te];if(ae=z!=null?z[Te]:void 0,I.hasOwnProperty(Te)&&pe!==ae&&(pe!=null||ae!=null))if(Te==="style")if(ae){for(X in ae)!ae.hasOwnProperty(X)||pe&&pe.hasOwnProperty(X)||(x||(x={}),x[X]="");for(X in pe)pe.hasOwnProperty(X)&&ae[X]!==pe[X]&&(x||(x={}),x[X]=pe[X])}else x||(W||(W=[]),W.push(Te,x)),x=pe;else Te==="dangerouslySetInnerHTML"?(pe=pe?pe.__html:void 0,ae=ae?ae.__html:void 0,pe!=null&&ae!==pe&&(W=W||[]).push(Te,pe)):Te==="children"?typeof pe!="string"&&typeof pe!="number"||(W=W||[]).push(Te,""+pe):Te!=="suppressContentEditableWarning"&&Te!=="suppressHydrationWarning"&&(o.hasOwnProperty(Te)?(pe!=null&&Te==="onScroll"&&Yn("scroll",a),W||ae===pe||(W=[])):(W=W||[]).push(Te,pe))}x&&(W=W||[]).push("style",x);var Te=W;(d.updateQueue=Te)&&(d.flags|=4)}},Ij=function(a,d,x,I){x!==I&&(d.flags|=4)};function Mf(a,d){if(!rr)switch(a.tailMode){case"hidden":d=a.tail;for(var x=null;d!==null;)d.alternate!==null&&(x=d),d=d.sibling;x===null?a.tail=null:x.sibling=null;break;case"collapsed":x=a.tail;for(var I=null;x!==null;)x.alternate!==null&&(I=x),x=x.sibling;I===null?d||a.tail===null?a.tail=null:a.tail.sibling=null:I.sibling=null}}function co(a){var d=a.alternate!==null&&a.alternate.child===a.child,x=0,I=0;if(d)for(var z=a.child;z!==null;)x|=z.lanes|z.childLanes,I|=z.subtreeFlags&14680064,I|=z.flags&14680064,z.return=a,z=z.sibling;else for(z=a.child;z!==null;)x|=z.lanes|z.childLanes,I|=z.subtreeFlags,I|=z.flags,z.return=a,z=z.sibling;return a.subtreeFlags|=I,a.childLanes=x,d}function wD(a,d,x){var I=d.pendingProps;switch(nb(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return co(d),null;case 1:return Oo(d.type)&&tm(),co(d),null;case 3:return I=d.stateNode,mu(),Xn($o),Xn(lo),mb(),I.pendingContext&&(I.context=I.pendingContext,I.pendingContext=null),(a===null||a.child===null)&&(im(d)?d.flags|=4:a===null||a.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,Us!==null&&(Gb(Us),Us=null))),zb(a,d),co(d),null;case 5:pb(d);var z=Ka(kf.current);if(x=d.type,a!==null&&d.stateNode!=null)kj(a,d,x,I,z),a.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!I){if(d.stateNode===null)throw Error(n(166));return co(d),null}if(a=Ka(xi.current),im(d)){I=d.stateNode,x=d.type;var W=d.memoizedProps;switch(I[gi]=d,I[vf]=W,a=(d.mode&1)!==0,x){case"dialog":Yn("cancel",I),Yn("close",I);break;case"iframe":case"object":case"embed":Yn("load",I);break;case"video":case"audio":for(z=0;z<xf.length;z++)Yn(xf[z],I);break;case"source":Yn("error",I);break;case"img":case"image":case"link":Yn("error",I),Yn("load",I);break;case"details":Yn("toggle",I);break;case"input":Se(I,W),Yn("invalid",I);break;case"select":I._wrapperState={wasMultiple:!!W.multiple},Yn("invalid",I);break;case"textarea":Ze(I,W),Yn("invalid",I)}Ne(x,W),z=null;for(var X in W)if(W.hasOwnProperty(X)){var ae=W[X];X==="children"?typeof ae=="string"?I.textContent!==ae&&(W.suppressHydrationWarning!==!0&&Zh(I.textContent,ae,a),z=["children",ae]):typeof ae=="number"&&I.textContent!==""+ae&&(W.suppressHydrationWarning!==!0&&Zh(I.textContent,ae,a),z=["children",""+ae]):o.hasOwnProperty(X)&&ae!=null&&X==="onScroll"&&Yn("scroll",I)}switch(x){case"input":he(I),Oe(I,W,!0);break;case"textarea":he(I),st(I);break;case"select":case"option":break;default:typeof W.onClick=="function"&&(I.onclick=Jh)}I=z,d.updateQueue=I,I!==null&&(d.flags|=4)}else{X=z.nodeType===9?z:z.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=qe(x)),a==="http://www.w3.org/1999/xhtml"?x==="script"?(a=X.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof I.is=="string"?a=X.createElement(x,{is:I.is}):(a=X.createElement(x),x==="select"&&(X=a,I.multiple?X.multiple=!0:I.size&&(X.size=I.size))):a=X.createElementNS(a,x),a[gi]=d,a[vf]=I,jj(a,d,!1,!1),d.stateNode=a;e:{switch(X=xt(x,I),x){case"dialog":Yn("cancel",a),Yn("close",a),z=I;break;case"iframe":case"object":case"embed":Yn("load",a),z=I;break;case"video":case"audio":for(z=0;z<xf.length;z++)Yn(xf[z],a);z=I;break;case"source":Yn("error",a),z=I;break;case"img":case"image":case"link":Yn("error",a),Yn("load",a),z=I;break;case"details":Yn("toggle",a),z=I;break;case"input":Se(a,I),z=ge(a,I),Yn("invalid",a);break;case"option":z=I;break;case"select":a._wrapperState={wasMultiple:!!I.multiple},z=G({},I,{value:void 0}),Yn("invalid",a);break;case"textarea":Ze(a,I),z=De(a,I),Yn("invalid",a);break;default:z=I}Ne(x,z),ae=z;for(W in ae)if(ae.hasOwnProperty(W)){var pe=ae[W];W==="style"?Je(a,pe):W==="dangerouslySetInnerHTML"?(pe=pe?pe.__html:void 0,pe!=null&&fe(a,pe)):W==="children"?typeof pe=="string"?(x!=="textarea"||pe!=="")&&Ie(a,pe):typeof pe=="number"&&Ie(a,""+pe):W!=="suppressContentEditableWarning"&&W!=="suppressHydrationWarning"&&W!=="autoFocus"&&(o.hasOwnProperty(W)?pe!=null&&W==="onScroll"&&Yn("scroll",a):pe!=null&&w(a,W,pe,X))}switch(x){case"input":he(a),Oe(a,I,!1);break;case"textarea":he(a),st(a);break;case"option":I.value!=null&&a.setAttribute("value",""+Y(I.value));break;case"select":a.multiple=!!I.multiple,W=I.value,W!=null?Ve(a,!!I.multiple,W,!1):I.defaultValue!=null&&Ve(a,!!I.multiple,I.defaultValue,!0);break;default:typeof z.onClick=="function"&&(a.onclick=Jh)}switch(x){case"button":case"input":case"select":case"textarea":I=!!I.autoFocus;break e;case"img":I=!0;break e;default:I=!1}}I&&(d.flags|=4)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return co(d),null;case 6:if(a&&d.stateNode!=null)Ij(a,d,a.memoizedProps,I);else{if(typeof I!="string"&&d.stateNode===null)throw Error(n(166));if(x=Ka(kf.current),Ka(xi.current),im(d)){if(I=d.stateNode,x=d.memoizedProps,I[gi]=d,(W=I.nodeValue!==x)&&(a=Jo,a!==null))switch(a.tag){case 3:Zh(I.nodeValue,x,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Zh(I.nodeValue,x,(a.mode&1)!==0)}W&&(d.flags|=4)}else I=(x.nodeType===9?x:x.ownerDocument).createTextNode(I),I[gi]=d,d.stateNode=I}return co(d),null;case 13:if(Xn(cr),I=d.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(rr&&es!==null&&(d.mode&1)!==0&&(d.flags&128)===0)T1(),du(),d.flags|=98560,W=!1;else if(W=im(d),I!==null&&I.dehydrated!==null){if(a===null){if(!W)throw Error(n(318));if(W=d.memoizedState,W=W!==null?W.dehydrated:null,!W)throw Error(n(317));W[gi]=d}else du(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;co(d),W=!1}else Us!==null&&(Gb(Us),Us=null),W=!0;if(!W)return d.flags&65536?d:null}return(d.flags&128)!==0?(d.lanes=x,d):(I=I!==null,I!==(a!==null&&a.memoizedState!==null)&&I&&(d.child.flags|=8192,(d.mode&1)!==0&&(a===null||(cr.current&1)!==0?$r===0&&($r=3):Kb())),d.updateQueue!==null&&(d.flags|=4),co(d),null);case 4:return mu(),zb(a,d),a===null&&yf(d.stateNode.containerInfo),co(d),null;case 10:return ab(d.type._context),co(d),null;case 17:return Oo(d.type)&&tm(),co(d),null;case 19:if(Xn(cr),W=d.memoizedState,W===null)return co(d),null;if(I=(d.flags&128)!==0,X=W.rendering,X===null)if(I)Mf(W,!1);else{if($r!==0||a!==null&&(a.flags&128)!==0)for(a=d.child;a!==null;){if(X=fm(a),X!==null){for(d.flags|=128,Mf(W,!1),I=X.updateQueue,I!==null&&(d.updateQueue=I,d.flags|=4),d.subtreeFlags=0,I=x,x=d.child;x!==null;)W=x,a=I,W.flags&=14680066,X=W.alternate,X===null?(W.childLanes=0,W.lanes=a,W.child=null,W.subtreeFlags=0,W.memoizedProps=null,W.memoizedState=null,W.updateQueue=null,W.dependencies=null,W.stateNode=null):(W.childLanes=X.childLanes,W.lanes=X.lanes,W.child=X.child,W.subtreeFlags=0,W.deletions=null,W.memoizedProps=X.memoizedProps,W.memoizedState=X.memoizedState,W.updateQueue=X.updateQueue,W.type=X.type,a=X.dependencies,W.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),x=x.sibling;return Qn(cr,cr.current&1|2),d.child}a=a.sibling}W.tail!==null&&nn()>bu&&(d.flags|=128,I=!0,Mf(W,!1),d.lanes=4194304)}else{if(!I)if(a=fm(X),a!==null){if(d.flags|=128,I=!0,x=a.updateQueue,x!==null&&(d.updateQueue=x,d.flags|=4),Mf(W,!0),W.tail===null&&W.tailMode==="hidden"&&!X.alternate&&!rr)return co(d),null}else 2*nn()-W.renderingStartTime>bu&&x!==1073741824&&(d.flags|=128,I=!0,Mf(W,!1),d.lanes=4194304);W.isBackwards?(X.sibling=d.child,d.child=X):(x=W.last,x!==null?x.sibling=X:d.child=X,W.last=X)}return W.tail!==null?(d=W.tail,W.rendering=d,W.tail=d.sibling,W.renderingStartTime=nn(),d.sibling=null,x=cr.current,Qn(cr,I?x&1|2:x&1),d):(co(d),null);case 22:case 23:return qb(),I=d.memoizedState!==null,a!==null&&a.memoizedState!==null!==I&&(d.flags|=8192),I&&(d.mode&1)!==0?(ts&1073741824)!==0&&(co(d),d.subtreeFlags&6&&(d.flags|=8192)):co(d),null;case 24:return null;case 25:return null}throw Error(n(156,d.tag))}function SD(a,d){switch(nb(d),d.tag){case 1:return Oo(d.type)&&tm(),a=d.flags,a&65536?(d.flags=a&-65537|128,d):null;case 3:return mu(),Xn($o),Xn(lo),mb(),a=d.flags,(a&65536)!==0&&(a&128)===0?(d.flags=a&-65537|128,d):null;case 5:return pb(d),null;case 13:if(Xn(cr),a=d.memoizedState,a!==null&&a.dehydrated!==null){if(d.alternate===null)throw Error(n(340));du()}return a=d.flags,a&65536?(d.flags=a&-65537|128,d):null;case 19:return Xn(cr),null;case 4:return mu(),null;case 10:return ab(d.type._context),null;case 22:case 23:return qb(),null;case 24:return null;default:return null}}var Cm=!1,uo=!1,jD=typeof WeakSet=="function"?WeakSet:Set,bt=null;function xu(a,d){var x=a.ref;if(x!==null)if(typeof x=="function")try{x(null)}catch(I){hr(a,d,I)}else x.current=null}function Lb(a,d,x){try{x()}catch(I){hr(a,d,I)}}var Ej=!1;function kD(a,d){if(qy=Hh,a=s1(),Ny(a)){if("selectionStart"in a)var x={start:a.selectionStart,end:a.selectionEnd};else e:{x=(x=a.ownerDocument)&&x.defaultView||window;var I=x.getSelection&&x.getSelection();if(I&&I.rangeCount!==0){x=I.anchorNode;var z=I.anchorOffset,W=I.focusNode;I=I.focusOffset;try{x.nodeType,W.nodeType}catch{x=null;break e}var X=0,ae=-1,pe=-1,Te=0,Ue=0,Qe=a,We=null;t:for(;;){for(var ht;Qe!==x||z!==0&&Qe.nodeType!==3||(ae=X+z),Qe!==W||I!==0&&Qe.nodeType!==3||(pe=X+I),Qe.nodeType===3&&(X+=Qe.nodeValue.length),(ht=Qe.firstChild)!==null;)We=Qe,Qe=ht;for(;;){if(Qe===a)break t;if(We===x&&++Te===z&&(ae=X),We===W&&++Ue===I&&(pe=X),(ht=Qe.nextSibling)!==null)break;Qe=We,We=Qe.parentNode}Qe=ht}x=ae===-1||pe===-1?null:{start:ae,end:pe}}else x=null}x=x||{start:0,end:0}}else x=null;for(Ky={focusedElem:a,selectionRange:x},Hh=!1,bt=d;bt!==null;)if(d=bt,a=d.child,(d.subtreeFlags&1028)!==0&&a!==null)a.return=d,bt=a;else for(;bt!==null;){d=bt;try{var Ct=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(Ct!==null){var jt=Ct.memoizedProps,wr=Ct.memoizedState,je=d.stateNode,ye=je.getSnapshotBeforeUpdate(d.elementType===d.type?jt:qs(d.type,jt),wr);je.__reactInternalSnapshotBeforeUpdate=ye}break;case 3:var Ee=d.stateNode.containerInfo;Ee.nodeType===1?Ee.textContent="":Ee.nodeType===9&&Ee.documentElement&&Ee.removeChild(Ee.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Xe){hr(d,d.return,Xe)}if(a=d.sibling,a!==null){a.return=d.return,bt=a;break}bt=d.return}return Ct=Ej,Ej=!1,Ct}function Rf(a,d,x){var I=d.updateQueue;if(I=I!==null?I.lastEffect:null,I!==null){var z=I=I.next;do{if((z.tag&a)===a){var W=z.destroy;z.destroy=void 0,W!==void 0&&Lb(d,x,W)}z=z.next}while(z!==I)}}function wm(a,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var x=d=d.next;do{if((x.tag&a)===a){var I=x.create;x.destroy=I()}x=x.next}while(x!==d)}}function Db(a){var d=a.ref;if(d!==null){var x=a.stateNode;switch(a.tag){case 5:a=x;break;default:a=x}typeof d=="function"?d(a):d.current=a}}function Pj(a){var d=a.alternate;d!==null&&(a.alternate=null,Pj(d)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(d=a.stateNode,d!==null&&(delete d[gi],delete d[vf],delete d[Zy],delete d[lD],delete d[aD])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function Tj(a){return a.tag===5||a.tag===3||a.tag===4}function Mj(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Tj(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Ab(a,d,x){var I=a.tag;if(I===5||I===6)a=a.stateNode,d?x.nodeType===8?x.parentNode.insertBefore(a,d):x.insertBefore(a,d):(x.nodeType===8?(d=x.parentNode,d.insertBefore(a,x)):(d=x,d.appendChild(a)),x=x._reactRootContainer,x!=null||d.onclick!==null||(d.onclick=Jh));else if(I!==4&&(a=a.child,a!==null))for(Ab(a,d,x),a=a.sibling;a!==null;)Ab(a,d,x),a=a.sibling}function Fb(a,d,x){var I=a.tag;if(I===5||I===6)a=a.stateNode,d?x.insertBefore(a,d):x.appendChild(a);else if(I!==4&&(a=a.child,a!==null))for(Fb(a,d,x),a=a.sibling;a!==null;)Fb(a,d,x),a=a.sibling}var Jr=null,Ks=!1;function Wl(a,d,x){for(x=x.child;x!==null;)Rj(a,d,x),x=x.sibling}function Rj(a,d,x){if(Ro&&typeof Ro.onCommitFiberUnmount=="function")try{Ro.onCommitFiberUnmount(Yo,x)}catch{}switch(x.tag){case 5:uo||xu(x,d);case 6:var I=Jr,z=Ks;Jr=null,Wl(a,d,x),Jr=I,Ks=z,Jr!==null&&(Ks?(a=Jr,x=x.stateNode,a.nodeType===8?a.parentNode.removeChild(x):a.removeChild(x)):Jr.removeChild(x.stateNode));break;case 18:Jr!==null&&(Ks?(a=Jr,x=x.stateNode,a.nodeType===8?Xy(a.parentNode,x):a.nodeType===1&&Xy(a,x),cf(a)):Xy(Jr,x.stateNode));break;case 4:I=Jr,z=Ks,Jr=x.stateNode.containerInfo,Ks=!0,Wl(a,d,x),Jr=I,Ks=z;break;case 0:case 11:case 14:case 15:if(!uo&&(I=x.updateQueue,I!==null&&(I=I.lastEffect,I!==null))){z=I=I.next;do{var W=z,X=W.destroy;W=W.tag,X!==void 0&&((W&2)!==0||(W&4)!==0)&&Lb(x,d,X),z=z.next}while(z!==I)}Wl(a,d,x);break;case 1:if(!uo&&(xu(x,d),I=x.stateNode,typeof I.componentWillUnmount=="function"))try{I.props=x.memoizedProps,I.state=x.memoizedState,I.componentWillUnmount()}catch(ae){hr(x,d,ae)}Wl(a,d,x);break;case 21:Wl(a,d,x);break;case 22:x.mode&1?(uo=(I=uo)||x.memoizedState!==null,Wl(a,d,x),uo=I):Wl(a,d,x);break;default:Wl(a,d,x)}}function $j(a){var d=a.updateQueue;if(d!==null){a.updateQueue=null;var x=a.stateNode;x===null&&(x=a.stateNode=new jD),d.forEach(function(I){var z=zD.bind(null,a,I);x.has(I)||(x.add(I),I.then(z,z))})}}function Qs(a,d){var x=d.deletions;if(x!==null)for(var I=0;I<x.length;I++){var z=x[I];try{var W=a,X=d,ae=X;e:for(;ae!==null;){switch(ae.tag){case 5:Jr=ae.stateNode,Ks=!1;break e;case 3:Jr=ae.stateNode.containerInfo,Ks=!0;break e;case 4:Jr=ae.stateNode.containerInfo,Ks=!0;break e}ae=ae.return}if(Jr===null)throw Error(n(160));Rj(W,X,z),Jr=null,Ks=!1;var pe=z.alternate;pe!==null&&(pe.return=null),z.return=null}catch(Te){hr(z,d,Te)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)Oj(d,a),d=d.sibling}function Oj(a,d){var x=a.alternate,I=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Qs(d,a),bi(a),I&4){try{Rf(3,a,a.return),wm(3,a)}catch(jt){hr(a,a.return,jt)}try{Rf(5,a,a.return)}catch(jt){hr(a,a.return,jt)}}break;case 1:Qs(d,a),bi(a),I&512&&x!==null&&xu(x,x.return);break;case 5:if(Qs(d,a),bi(a),I&512&&x!==null&&xu(x,x.return),a.flags&32){var z=a.stateNode;try{Ie(z,"")}catch(jt){hr(a,a.return,jt)}}if(I&4&&(z=a.stateNode,z!=null)){var W=a.memoizedProps,X=x!==null?x.memoizedProps:W,ae=a.type,pe=a.updateQueue;if(a.updateQueue=null,pe!==null)try{ae==="input"&&W.type==="radio"&&W.name!=null&&ke(z,W),xt(ae,X);var Te=xt(ae,W);for(X=0;X<pe.length;X+=2){var Ue=pe[X],Qe=pe[X+1];Ue==="style"?Je(z,Qe):Ue==="dangerouslySetInnerHTML"?fe(z,Qe):Ue==="children"?Ie(z,Qe):w(z,Ue,Qe,Te)}switch(ae){case"input":we(z,W);break;case"textarea":Ae(z,W);break;case"select":var We=z._wrapperState.wasMultiple;z._wrapperState.wasMultiple=!!W.multiple;var ht=W.value;ht!=null?Ve(z,!!W.multiple,ht,!1):We!==!!W.multiple&&(W.defaultValue!=null?Ve(z,!!W.multiple,W.defaultValue,!0):Ve(z,!!W.multiple,W.multiple?[]:"",!1))}z[vf]=W}catch(jt){hr(a,a.return,jt)}}break;case 6:if(Qs(d,a),bi(a),I&4){if(a.stateNode===null)throw Error(n(162));z=a.stateNode,W=a.memoizedProps;try{z.nodeValue=W}catch(jt){hr(a,a.return,jt)}}break;case 3:if(Qs(d,a),bi(a),I&4&&x!==null&&x.memoizedState.isDehydrated)try{cf(d.containerInfo)}catch(jt){hr(a,a.return,jt)}break;case 4:Qs(d,a),bi(a);break;case 13:Qs(d,a),bi(a),z=a.child,z.flags&8192&&(W=z.memoizedState!==null,z.stateNode.isHidden=W,!W||z.alternate!==null&&z.alternate.memoizedState!==null||(Hb=nn())),I&4&&$j(a);break;case 22:if(Ue=x!==null&&x.memoizedState!==null,a.mode&1?(uo=(Te=uo)||Ue,Qs(d,a),uo=Te):Qs(d,a),bi(a),I&8192){if(Te=a.memoizedState!==null,(a.stateNode.isHidden=Te)&&!Ue&&(a.mode&1)!==0)for(bt=a,Ue=a.child;Ue!==null;){for(Qe=bt=Ue;bt!==null;){switch(We=bt,ht=We.child,We.tag){case 0:case 11:case 14:case 15:Rf(4,We,We.return);break;case 1:xu(We,We.return);var Ct=We.stateNode;if(typeof Ct.componentWillUnmount=="function"){I=We,x=We.return;try{d=I,Ct.props=d.memoizedProps,Ct.state=d.memoizedState,Ct.componentWillUnmount()}catch(jt){hr(I,x,jt)}}break;case 5:xu(We,We.return);break;case 22:if(We.memoizedState!==null){Dj(Qe);continue}}ht!==null?(ht.return=We,bt=ht):Dj(Qe)}Ue=Ue.sibling}e:for(Ue=null,Qe=a;;){if(Qe.tag===5){if(Ue===null){Ue=Qe;try{z=Qe.stateNode,Te?(W=z.style,typeof W.setProperty=="function"?W.setProperty("display","none","important"):W.display="none"):(ae=Qe.stateNode,pe=Qe.memoizedProps.style,X=pe!=null&&pe.hasOwnProperty("display")?pe.display:null,ae.style.display=vt("display",X))}catch(jt){hr(a,a.return,jt)}}}else if(Qe.tag===6){if(Ue===null)try{Qe.stateNode.nodeValue=Te?"":Qe.memoizedProps}catch(jt){hr(a,a.return,jt)}}else if((Qe.tag!==22&&Qe.tag!==23||Qe.memoizedState===null||Qe===a)&&Qe.child!==null){Qe.child.return=Qe,Qe=Qe.child;continue}if(Qe===a)break e;for(;Qe.sibling===null;){if(Qe.return===null||Qe.return===a)break e;Ue===Qe&&(Ue=null),Qe=Qe.return}Ue===Qe&&(Ue=null),Qe.sibling.return=Qe.return,Qe=Qe.sibling}}break;case 19:Qs(d,a),bi(a),I&4&&$j(a);break;case 21:break;default:Qs(d,a),bi(a)}}function bi(a){var d=a.flags;if(d&2){try{e:{for(var x=a.return;x!==null;){if(Tj(x)){var I=x;break e}x=x.return}throw Error(n(160))}switch(I.tag){case 5:var z=I.stateNode;I.flags&32&&(Ie(z,""),I.flags&=-33);var W=Mj(a);Fb(a,W,z);break;case 3:case 4:var X=I.stateNode.containerInfo,ae=Mj(a);Ab(a,ae,X);break;default:throw Error(n(161))}}catch(pe){hr(a,a.return,pe)}a.flags&=-3}d&4096&&(a.flags&=-4097)}function ID(a,d,x){bt=a,zj(a)}function zj(a,d,x){for(var I=(a.mode&1)!==0;bt!==null;){var z=bt,W=z.child;if(z.tag===22&&I){var X=z.memoizedState!==null||Cm;if(!X){var ae=z.alternate,pe=ae!==null&&ae.memoizedState!==null||uo;ae=Cm;var Te=uo;if(Cm=X,(uo=pe)&&!Te)for(bt=z;bt!==null;)X=bt,pe=X.child,X.tag===22&&X.memoizedState!==null?Aj(z):pe!==null?(pe.return=X,bt=pe):Aj(z);for(;W!==null;)bt=W,zj(W),W=W.sibling;bt=z,Cm=ae,uo=Te}Lj(a)}else(z.subtreeFlags&8772)!==0&&W!==null?(W.return=z,bt=W):Lj(a)}}function Lj(a){for(;bt!==null;){var d=bt;if((d.flags&8772)!==0){var x=d.alternate;try{if((d.flags&8772)!==0)switch(d.tag){case 0:case 11:case 15:uo||wm(5,d);break;case 1:var I=d.stateNode;if(d.flags&4&&!uo)if(x===null)I.componentDidMount();else{var z=d.elementType===d.type?x.memoizedProps:qs(d.type,x.memoizedProps);I.componentDidUpdate(z,x.memoizedState,I.__reactInternalSnapshotBeforeUpdate)}var W=d.updateQueue;W!==null&&D1(d,W,I);break;case 3:var X=d.updateQueue;if(X!==null){if(x=null,d.child!==null)switch(d.child.tag){case 5:x=d.child.stateNode;break;case 1:x=d.child.stateNode}D1(d,X,x)}break;case 5:var ae=d.stateNode;if(x===null&&d.flags&4){x=ae;var pe=d.memoizedProps;switch(d.type){case"button":case"input":case"select":case"textarea":pe.autoFocus&&x.focus();break;case"img":pe.src&&(x.src=pe.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(d.memoizedState===null){var Te=d.alternate;if(Te!==null){var Ue=Te.memoizedState;if(Ue!==null){var Qe=Ue.dehydrated;Qe!==null&&cf(Qe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}uo||d.flags&512&&Db(d)}catch(We){hr(d,d.return,We)}}if(d===a){bt=null;break}if(x=d.sibling,x!==null){x.return=d.return,bt=x;break}bt=d.return}}function Dj(a){for(;bt!==null;){var d=bt;if(d===a){bt=null;break}var x=d.sibling;if(x!==null){x.return=d.return,bt=x;break}bt=d.return}}function Aj(a){for(;bt!==null;){var d=bt;try{switch(d.tag){case 0:case 11:case 15:var x=d.return;try{wm(4,d)}catch(pe){hr(d,x,pe)}break;case 1:var I=d.stateNode;if(typeof I.componentDidMount=="function"){var z=d.return;try{I.componentDidMount()}catch(pe){hr(d,z,pe)}}var W=d.return;try{Db(d)}catch(pe){hr(d,W,pe)}break;case 5:var X=d.return;try{Db(d)}catch(pe){hr(d,X,pe)}}}catch(pe){hr(d,d.return,pe)}if(d===a){bt=null;break}var ae=d.sibling;if(ae!==null){ae.return=d.return,bt=ae;break}bt=d.return}}var ED=Math.ceil,Sm=k.ReactCurrentDispatcher,Nb=k.ReactCurrentOwner,bs=k.ReactCurrentBatchConfig,mn=0,Hr=null,Ir=null,eo=0,ts=0,yu=Fl(0),$r=0,$f=null,Ya=0,jm=0,_b=0,Of=null,Lo=null,Hb=0,bu=1/0,Yi=null,km=!1,Bb=null,Vl=null,Im=!1,Gl=null,Em=0,zf=0,Wb=null,Pm=-1,Tm=0;function Co(){return(mn&6)!==0?nn():Pm!==-1?Pm:Pm=nn()}function Ul(a){return(a.mode&1)===0?1:(mn&2)!==0&&eo!==0?eo&-eo:uD.transition!==null?(Tm===0&&(Tm=Zc()),Tm):(a=Fn,a!==0||(a=window.event,a=a===void 0?16:NS(a.type)),a)}function Ys(a,d,x,I){if(50<zf)throw zf=0,Wb=null,Error(n(185));Ba(a,x,I),((mn&2)===0||a!==Hr)&&(a===Hr&&((mn&2)===0&&(jm|=x),$r===4&&ql(a,eo)),Do(a,I),x===1&&mn===0&&(d.mode&1)===0&&(bu=nn()+500,rm&&_l()))}function Do(a,d){var x=a.callbackNode;jy(a,d);var I=Xc(a,a===Hr?eo:0);if(I===0)x!==null&&Yt(x),a.callbackNode=null,a.callbackPriority=0;else if(d=I&-I,a.callbackPriority!==d){if(x!=null&&Yt(x),d===1)a.tag===0?cD(Nj.bind(null,a)):j1(Nj.bind(null,a)),sD(function(){(mn&6)===0&&_l()}),x=null;else{switch(RS(I)){case 1:x=To;break;case 4:x=Mo;break;case 16:x=Kt;break;case 536870912:x=Qo;break;default:x=Kt}x=qj(x,Fj.bind(null,a))}a.callbackPriority=d,a.callbackNode=x}}function Fj(a,d){if(Pm=-1,Tm=0,(mn&6)!==0)throw Error(n(327));var x=a.callbackNode;if(vu()&&a.callbackNode!==x)return null;var I=Xc(a,a===Hr?eo:0);if(I===0)return null;if((I&30)!==0||(I&a.expiredLanes)!==0||d)d=Mm(a,I);else{d=I;var z=mn;mn|=2;var W=Hj();(Hr!==a||eo!==d)&&(Yi=null,bu=nn()+500,Za(a,d));do try{MD();break}catch(ae){_j(a,ae)}while(!0);lb(),Sm.current=W,mn=z,Ir!==null?d=0:(Hr=null,eo=0,d=$r)}if(d!==0){if(d===2&&(z=nf(a),z!==0&&(I=z,d=Vb(a,z))),d===1)throw x=$f,Za(a,0),ql(a,I),Do(a,nn()),x;if(d===6)ql(a,I);else{if(z=a.current.alternate,(I&30)===0&&!PD(z)&&(d=Mm(a,I),d===2&&(W=nf(a),W!==0&&(I=W,d=Vb(a,W))),d===1))throw x=$f,Za(a,0),ql(a,I),Do(a,nn()),x;switch(a.finishedWork=z,a.finishedLanes=I,d){case 0:case 1:throw Error(n(345));case 2:Ja(a,Lo,Yi);break;case 3:if(ql(a,I),(I&130023424)===I&&(d=Hb+500-nn(),10<d)){if(Xc(a,0)!==0)break;if(z=a.suspendedLanes,(z&I)!==I){Co(),a.pingedLanes|=a.suspendedLanes&z;break}a.timeoutHandle=Yy(Ja.bind(null,a,Lo,Yi),d);break}Ja(a,Lo,Yi);break;case 4:if(ql(a,I),(I&4194240)===I)break;for(d=a.eventTimes,z=-1;0<I;){var X=31-Xo(I);W=1<<X,X=d[X],X>z&&(z=X),I&=~W}if(I=z,I=nn()-I,I=(120>I?120:480>I?480:1080>I?1080:1920>I?1920:3e3>I?3e3:4320>I?4320:1960*ED(I/1960))-I,10<I){a.timeoutHandle=Yy(Ja.bind(null,a,Lo,Yi),I);break}Ja(a,Lo,Yi);break;case 5:Ja(a,Lo,Yi);break;default:throw Error(n(329))}}}return Do(a,nn()),a.callbackNode===x?Fj.bind(null,a):null}function Vb(a,d){var x=Of;return a.current.memoizedState.isDehydrated&&(Za(a,d).flags|=256),a=Mm(a,d),a!==2&&(d=Lo,Lo=x,d!==null&&Gb(d)),a}function Gb(a){Lo===null?Lo=a:Lo.push.apply(Lo,a)}function PD(a){for(var d=a;;){if(d.flags&16384){var x=d.updateQueue;if(x!==null&&(x=x.stores,x!==null))for(var I=0;I<x.length;I++){var z=x[I],W=z.getSnapshot;z=z.value;try{if(!Gs(W(),z))return!1}catch{return!1}}}if(x=d.child,d.subtreeFlags&16384&&x!==null)x.return=d,d=x;else{if(d===a)break;for(;d.sibling===null;){if(d.return===null||d.return===a)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function ql(a,d){for(d&=~_b,d&=~jm,a.suspendedLanes|=d,a.pingedLanes&=~d,a=a.expirationTimes;0<d;){var x=31-Xo(d),I=1<<x;a[x]=-1,d&=~I}}function Nj(a){if((mn&6)!==0)throw Error(n(327));vu();var d=Xc(a,0);if((d&1)===0)return Do(a,nn()),null;var x=Mm(a,d);if(a.tag!==0&&x===2){var I=nf(a);I!==0&&(d=I,x=Vb(a,I))}if(x===1)throw x=$f,Za(a,0),ql(a,d),Do(a,nn()),x;if(x===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=d,Ja(a,Lo,Yi),Do(a,nn()),null}function Ub(a,d){var x=mn;mn|=1;try{return a(d)}finally{mn=x,mn===0&&(bu=nn()+500,rm&&_l())}}function Xa(a){Gl!==null&&Gl.tag===0&&(mn&6)===0&&vu();var d=mn;mn|=1;var x=bs.transition,I=Fn;try{if(bs.transition=null,Fn=1,a)return a()}finally{Fn=I,bs.transition=x,mn=d,(mn&6)===0&&_l()}}function qb(){ts=yu.current,Xn(yu)}function Za(a,d){a.finishedWork=null,a.finishedLanes=0;var x=a.timeoutHandle;if(x!==-1&&(a.timeoutHandle=-1,oD(x)),Ir!==null)for(x=Ir.return;x!==null;){var I=x;switch(nb(I),I.tag){case 1:I=I.type.childContextTypes,I!=null&&tm();break;case 3:mu(),Xn($o),Xn(lo),mb();break;case 5:pb(I);break;case 4:mu();break;case 13:Xn(cr);break;case 19:Xn(cr);break;case 10:ab(I.type._context);break;case 22:case 23:qb()}x=x.return}if(Hr=a,Ir=a=Kl(a.current,null),eo=ts=d,$r=0,$f=null,_b=jm=Ya=0,Lo=Of=null,qa!==null){for(d=0;d<qa.length;d++)if(x=qa[d],I=x.interleaved,I!==null){x.interleaved=null;var z=I.next,W=x.pending;if(W!==null){var X=W.next;W.next=z,I.next=X}x.pending=I}qa=null}return a}function _j(a,d){do{var x=Ir;try{if(lb(),pm.current=xm,hm){for(var I=ur.memoizedState;I!==null;){var z=I.queue;z!==null&&(z.pending=null),I=I.next}hm=!1}if(Qa=0,_r=Rr=ur=null,If=!1,Ef=0,Nb.current=null,x===null||x.return===null){$r=1,$f=d,Ir=null;break}e:{var W=a,X=x.return,ae=x,pe=d;if(d=eo,ae.flags|=32768,pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var Te=pe,Ue=ae,Qe=Ue.tag;if((Ue.mode&1)===0&&(Qe===0||Qe===11||Qe===15)){var We=Ue.alternate;We?(Ue.updateQueue=We.updateQueue,Ue.memoizedState=We.memoizedState,Ue.lanes=We.lanes):(Ue.updateQueue=null,Ue.memoizedState=null)}var ht=dj(X);if(ht!==null){ht.flags&=-257,fj(ht,X,ae,W,d),ht.mode&1&&uj(W,Te,d),d=ht,pe=Te;var Ct=d.updateQueue;if(Ct===null){var jt=new Set;jt.add(pe),d.updateQueue=jt}else Ct.add(pe);break e}else{if((d&1)===0){uj(W,Te,d),Kb();break e}pe=Error(n(426))}}else if(rr&&ae.mode&1){var wr=dj(X);if(wr!==null){(wr.flags&65536)===0&&(wr.flags|=256),fj(wr,X,ae,W,d),sb(gu(pe,ae));break e}}W=pe=gu(pe,ae),$r!==4&&($r=2),Of===null?Of=[W]:Of.push(W),W=X;do{switch(W.tag){case 3:W.flags|=65536,d&=-d,W.lanes|=d;var je=aj(W,pe,d);L1(W,je);break e;case 1:ae=pe;var ye=W.type,Ee=W.stateNode;if((W.flags&128)===0&&(typeof ye.getDerivedStateFromError=="function"||Ee!==null&&typeof Ee.componentDidCatch=="function"&&(Vl===null||!Vl.has(Ee)))){W.flags|=65536,d&=-d,W.lanes|=d;var Xe=cj(W,ae,d);L1(W,Xe);break e}}W=W.return}while(W!==null)}Wj(x)}catch(Et){d=Et,Ir===x&&x!==null&&(Ir=x=x.return);continue}break}while(!0)}function Hj(){var a=Sm.current;return Sm.current=xm,a===null?xm:a}function Kb(){($r===0||$r===3||$r===2)&&($r=4),Hr===null||(Ya&268435455)===0&&(jm&268435455)===0||ql(Hr,eo)}function Mm(a,d){var x=mn;mn|=2;var I=Hj();(Hr!==a||eo!==d)&&(Yi=null,Za(a,d));do try{TD();break}catch(z){_j(a,z)}while(!0);if(lb(),mn=x,Sm.current=I,Ir!==null)throw Error(n(261));return Hr=null,eo=0,$r}function TD(){for(;Ir!==null;)Bj(Ir)}function MD(){for(;Ir!==null&&!qt();)Bj(Ir)}function Bj(a){var d=Uj(a.alternate,a,ts);a.memoizedProps=a.pendingProps,d===null?Wj(a):Ir=d,Nb.current=null}function Wj(a){var d=a;do{var x=d.alternate;if(a=d.return,(d.flags&32768)===0){if(x=wD(x,d,ts),x!==null){Ir=x;return}}else{if(x=SD(x,d),x!==null){x.flags&=32767,Ir=x;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{$r=6,Ir=null;return}}if(d=d.sibling,d!==null){Ir=d;return}Ir=d=a}while(d!==null);$r===0&&($r=5)}function Ja(a,d,x){var I=Fn,z=bs.transition;try{bs.transition=null,Fn=1,RD(a,d,x,I)}finally{bs.transition=z,Fn=I}return null}function RD(a,d,x,I){do vu();while(Gl!==null);if((mn&6)!==0)throw Error(n(327));x=a.finishedWork;var z=a.finishedLanes;if(x===null)return null;if(a.finishedWork=null,a.finishedLanes=0,x===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var W=x.lanes|x.childLanes;if(Fh(a,W),a===Hr&&(Ir=Hr=null,eo=0),(x.subtreeFlags&2064)===0&&(x.flags&2064)===0||Im||(Im=!0,qj(Kt,function(){return vu(),null})),W=(x.flags&15990)!==0,(x.subtreeFlags&15990)!==0||W){W=bs.transition,bs.transition=null;var X=Fn;Fn=1;var ae=mn;mn|=4,Nb.current=null,kD(a,x),Oj(x,a),XL(Ky),Hh=!!qy,Ky=qy=null,a.current=x,ID(x),on(),mn=ae,Fn=X,bs.transition=W}else a.current=x;if(Im&&(Im=!1,Gl=a,Em=z),W=a.pendingLanes,W===0&&(Vl=null),vy(x.stateNode),Do(a,nn()),d!==null)for(I=a.onRecoverableError,x=0;x<d.length;x++)z=d[x],I(z.value,{componentStack:z.stack,digest:z.digest});if(km)throw km=!1,a=Bb,Bb=null,a;return(Em&1)!==0&&a.tag!==0&&vu(),W=a.pendingLanes,(W&1)!==0?a===Wb?zf++:(zf=0,Wb=a):zf=0,_l(),null}function vu(){if(Gl!==null){var a=RS(Em),d=bs.transition,x=Fn;try{if(bs.transition=null,Fn=16>a?16:a,Gl===null)var I=!1;else{if(a=Gl,Gl=null,Em=0,(mn&6)!==0)throw Error(n(331));var z=mn;for(mn|=4,bt=a.current;bt!==null;){var W=bt,X=W.child;if((bt.flags&16)!==0){var ae=W.deletions;if(ae!==null){for(var pe=0;pe<ae.length;pe++){var Te=ae[pe];for(bt=Te;bt!==null;){var Ue=bt;switch(Ue.tag){case 0:case 11:case 15:Rf(8,Ue,W)}var Qe=Ue.child;if(Qe!==null)Qe.return=Ue,bt=Qe;else for(;bt!==null;){Ue=bt;var We=Ue.sibling,ht=Ue.return;if(Pj(Ue),Ue===Te){bt=null;break}if(We!==null){We.return=ht,bt=We;break}bt=ht}}}var Ct=W.alternate;if(Ct!==null){var jt=Ct.child;if(jt!==null){Ct.child=null;do{var wr=jt.sibling;jt.sibling=null,jt=wr}while(jt!==null)}}bt=W}}if((W.subtreeFlags&2064)!==0&&X!==null)X.return=W,bt=X;else e:for(;bt!==null;){if(W=bt,(W.flags&2048)!==0)switch(W.tag){case 0:case 11:case 15:Rf(9,W,W.return)}var je=W.sibling;if(je!==null){je.return=W.return,bt=je;break e}bt=W.return}}var ye=a.current;for(bt=ye;bt!==null;){X=bt;var Ee=X.child;if((X.subtreeFlags&2064)!==0&&Ee!==null)Ee.return=X,bt=Ee;else e:for(X=ye;bt!==null;){if(ae=bt,(ae.flags&2048)!==0)try{switch(ae.tag){case 0:case 11:case 15:wm(9,ae)}}catch(Et){hr(ae,ae.return,Et)}if(ae===X){bt=null;break e}var Xe=ae.sibling;if(Xe!==null){Xe.return=ae.return,bt=Xe;break e}bt=ae.return}}if(mn=z,_l(),Ro&&typeof Ro.onPostCommitFiberRoot=="function")try{Ro.onPostCommitFiberRoot(Yo,a)}catch{}I=!0}return I}finally{Fn=x,bs.transition=d}}return!1}function Vj(a,d,x){d=gu(x,d),d=aj(a,d,1),a=Bl(a,d,1),d=Co(),a!==null&&(Ba(a,1,d),Do(a,d))}function hr(a,d,x){if(a.tag===3)Vj(a,a,x);else for(;d!==null;){if(d.tag===3){Vj(d,a,x);break}else if(d.tag===1){var I=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof I.componentDidCatch=="function"&&(Vl===null||!Vl.has(I))){a=gu(x,a),a=cj(d,a,1),d=Bl(d,a,1),a=Co(),d!==null&&(Ba(d,1,a),Do(d,a));break}}d=d.return}}function $D(a,d,x){var I=a.pingCache;I!==null&&I.delete(d),d=Co(),a.pingedLanes|=a.suspendedLanes&x,Hr===a&&(eo&x)===x&&($r===4||$r===3&&(eo&130023424)===eo&&500>nn()-Hb?Za(a,0):_b|=x),Do(a,d)}function Gj(a,d){d===0&&((a.mode&1)===0?d=1:(d=Yc,Yc<<=1,(Yc&130023424)===0&&(Yc=4194304)));var x=Co();a=qi(a,d),a!==null&&(Ba(a,d,x),Do(a,x))}function OD(a){var d=a.memoizedState,x=0;d!==null&&(x=d.retryLane),Gj(a,x)}function zD(a,d){var x=0;switch(a.tag){case 13:var I=a.stateNode,z=a.memoizedState;z!==null&&(x=z.retryLane);break;case 19:I=a.stateNode;break;default:throw Error(n(314))}I!==null&&I.delete(d),Gj(a,x)}var Uj;Uj=function(a,d,x){if(a!==null)if(a.memoizedProps!==d.pendingProps||$o.current)zo=!0;else{if((a.lanes&x)===0&&(d.flags&128)===0)return zo=!1,CD(a,d,x);zo=(a.flags&131072)!==0}else zo=!1,rr&&(d.flags&1048576)!==0&&k1(d,sm,d.index);switch(d.lanes=0,d.tag){case 2:var I=d.type;vm(a,d),a=d.pendingProps;var z=au(d,lo.current);hu(d,x),z=yb(null,d,I,a,z,x);var W=bb();return d.flags|=1,typeof z=="object"&&z!==null&&typeof z.render=="function"&&z.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,Oo(I)?(W=!0,nm(d)):W=!1,d.memoizedState=z.state!==null&&z.state!==void 0?z.state:null,db(d),z.updater=ym,d.stateNode=z,z._reactInternals=d,kb(d,I,a,x),d=Tb(null,d,I,!0,W,x)):(d.tag=0,rr&&W&&tb(d),vo(null,d,z,x),d=d.child),d;case 16:I=d.elementType;e:{switch(vm(a,d),a=d.pendingProps,z=I._init,I=z(I._payload),d.type=I,z=d.tag=DD(I),a=qs(I,a),z){case 0:d=Pb(null,d,I,a,x);break e;case 1:d=yj(null,d,I,a,x);break e;case 11:d=pj(null,d,I,a,x);break e;case 14:d=hj(null,d,I,qs(I.type,a),x);break e}throw Error(n(306,I,""))}return d;case 0:return I=d.type,z=d.pendingProps,z=d.elementType===I?z:qs(I,z),Pb(a,d,I,z,x);case 1:return I=d.type,z=d.pendingProps,z=d.elementType===I?z:qs(I,z),yj(a,d,I,z,x);case 3:e:{if(bj(d),a===null)throw Error(n(387));I=d.pendingProps,W=d.memoizedState,z=W.element,z1(a,d),dm(d,I,null,x);var X=d.memoizedState;if(I=X.element,W.isDehydrated)if(W={element:I,isDehydrated:!1,cache:X.cache,pendingSuspenseBoundaries:X.pendingSuspenseBoundaries,transitions:X.transitions},d.updateQueue.baseState=W,d.memoizedState=W,d.flags&256){z=gu(Error(n(423)),d),d=vj(a,d,I,x,z);break e}else if(I!==z){z=gu(Error(n(424)),d),d=vj(a,d,I,x,z);break e}else for(es=Al(d.stateNode.containerInfo.firstChild),Jo=d,rr=!0,Us=null,x=$1(d,null,I,x),d.child=x;x;)x.flags=x.flags&-3|4096,x=x.sibling;else{if(du(),I===z){d=Qi(a,d,x);break e}vo(a,d,I,x)}d=d.child}return d;case 5:return A1(d),a===null&&ob(d),I=d.type,z=d.pendingProps,W=a!==null?a.memoizedProps:null,X=z.children,Qy(I,z)?X=null:W!==null&&Qy(I,W)&&(d.flags|=32),xj(a,d),vo(a,d,X,x),d.child;case 6:return a===null&&ob(d),null;case 13:return Cj(a,d,x);case 4:return fb(d,d.stateNode.containerInfo),I=d.pendingProps,a===null?d.child=fu(d,null,I,x):vo(a,d,I,x),d.child;case 11:return I=d.type,z=d.pendingProps,z=d.elementType===I?z:qs(I,z),pj(a,d,I,z,x);case 7:return vo(a,d,d.pendingProps,x),d.child;case 8:return vo(a,d,d.pendingProps.children,x),d.child;case 12:return vo(a,d,d.pendingProps.children,x),d.child;case 10:e:{if(I=d.type._context,z=d.pendingProps,W=d.memoizedProps,X=z.value,Qn(am,I._currentValue),I._currentValue=X,W!==null)if(Gs(W.value,X)){if(W.children===z.children&&!$o.current){d=Qi(a,d,x);break e}}else for(W=d.child,W!==null&&(W.return=d);W!==null;){var ae=W.dependencies;if(ae!==null){X=W.child;for(var pe=ae.firstContext;pe!==null;){if(pe.context===I){if(W.tag===1){pe=Ki(-1,x&-x),pe.tag=2;var Te=W.updateQueue;if(Te!==null){Te=Te.shared;var Ue=Te.pending;Ue===null?pe.next=pe:(pe.next=Ue.next,Ue.next=pe),Te.pending=pe}}W.lanes|=x,pe=W.alternate,pe!==null&&(pe.lanes|=x),cb(W.return,x,d),ae.lanes|=x;break}pe=pe.next}}else if(W.tag===10)X=W.type===d.type?null:W.child;else if(W.tag===18){if(X=W.return,X===null)throw Error(n(341));X.lanes|=x,ae=X.alternate,ae!==null&&(ae.lanes|=x),cb(X,x,d),X=W.sibling}else X=W.child;if(X!==null)X.return=W;else for(X=W;X!==null;){if(X===d){X=null;break}if(W=X.sibling,W!==null){W.return=X.return,X=W;break}X=X.return}W=X}vo(a,d,z.children,x),d=d.child}return d;case 9:return z=d.type,I=d.pendingProps.children,hu(d,x),z=xs(z),I=I(z),d.flags|=1,vo(a,d,I,x),d.child;case 14:return I=d.type,z=qs(I,d.pendingProps),z=qs(I.type,z),hj(a,d,I,z,x);case 15:return mj(a,d,d.type,d.pendingProps,x);case 17:return I=d.type,z=d.pendingProps,z=d.elementType===I?z:qs(I,z),vm(a,d),d.tag=1,Oo(I)?(a=!0,nm(d)):a=!1,hu(d,x),ij(d,I,z),kb(d,I,z,x),Tb(null,d,I,!0,a,x);case 19:return Sj(a,d,x);case 22:return gj(a,d,x)}throw Error(n(156,d.tag))};function qj(a,d){return Dt(a,d)}function LD(a,d,x,I){this.tag=a,this.key=x,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=I,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vs(a,d,x,I){return new LD(a,d,x,I)}function Qb(a){return a=a.prototype,!(!a||!a.isReactComponent)}function DD(a){if(typeof a=="function")return Qb(a)?1:0;if(a!=null){if(a=a.$$typeof,a===A)return 11;if(a===L)return 14}return 2}function Kl(a,d){var x=a.alternate;return x===null?(x=vs(a.tag,d,a.key,a.mode),x.elementType=a.elementType,x.type=a.type,x.stateNode=a.stateNode,x.alternate=a,a.alternate=x):(x.pendingProps=d,x.type=a.type,x.flags=0,x.subtreeFlags=0,x.deletions=null),x.flags=a.flags&14680064,x.childLanes=a.childLanes,x.lanes=a.lanes,x.child=a.child,x.memoizedProps=a.memoizedProps,x.memoizedState=a.memoizedState,x.updateQueue=a.updateQueue,d=a.dependencies,x.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},x.sibling=a.sibling,x.index=a.index,x.ref=a.ref,x}function Rm(a,d,x,I,z,W){var X=2;if(I=a,typeof a=="function")Qb(a)&&(X=1);else if(typeof a=="string")X=5;else e:switch(a){case $:return ec(x.children,z,W,d);case M:X=8,z|=8;break;case R:return a=vs(12,x,d,z|2),a.elementType=R,a.lanes=W,a;case N:return a=vs(13,x,d,z),a.elementType=N,a.lanes=W,a;case F:return a=vs(19,x,d,z),a.elementType=F,a.lanes=W,a;case H:return $m(x,z,W,d);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case E:X=10;break e;case O:X=9;break e;case A:X=11;break e;case L:X=14;break e;case D:X=16,I=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return d=vs(X,x,d,z),d.elementType=a,d.type=I,d.lanes=W,d}function ec(a,d,x,I){return a=vs(7,a,I,d),a.lanes=x,a}function $m(a,d,x,I){return a=vs(22,a,I,d),a.elementType=H,a.lanes=x,a.stateNode={isHidden:!1},a}function Yb(a,d,x){return a=vs(6,a,null,d),a.lanes=x,a}function Xb(a,d,x){return d=vs(4,a.children!==null?a.children:[],a.key,d),d.lanes=x,d.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},d}function AD(a,d,x,I,z){this.tag=d,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=rf(0),this.expirationTimes=rf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rf(0),this.identifierPrefix=I,this.onRecoverableError=z,this.mutableSourceEagerHydrationData=null}function Zb(a,d,x,I,z,W,X,ae,pe){return a=new AD(a,d,x,ae,pe),d===1?(d=1,W===!0&&(d|=8)):d=0,W=vs(3,null,null,d),a.current=W,W.stateNode=a,W.memoizedState={element:I,isDehydrated:x,cache:null,transitions:null,pendingSuspenseBoundaries:null},db(W),a}function FD(a,d,x){var I=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:I==null?null:""+I,children:a,containerInfo:d,implementation:x}}function Kj(a){if(!a)return Nl;a=a._reactInternals;e:{if(Zr(a)!==a||a.tag!==1)throw Error(n(170));var d=a;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(Oo(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(n(171))}if(a.tag===1){var x=a.type;if(Oo(x))return w1(a,x,d)}return d}function Qj(a,d,x,I,z,W,X,ae,pe){return a=Zb(x,I,!0,a,z,W,X,ae,pe),a.context=Kj(null),x=a.current,I=Co(),z=Ul(x),W=Ki(I,z),W.callback=d??null,Bl(x,W,z),a.current.lanes=z,Ba(a,z,I),Do(a,I),a}function Om(a,d,x,I){var z=d.current,W=Co(),X=Ul(z);return x=Kj(x),d.context===null?d.context=x:d.pendingContext=x,d=Ki(W,X),d.payload={element:a},I=I===void 0?null:I,I!==null&&(d.callback=I),a=Bl(z,d,X),a!==null&&(Ys(a,z,X,W),um(a,z,X)),X}function zm(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function Yj(a,d){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var x=a.retryLane;a.retryLane=x!==0&&x<d?x:d}}function Jb(a,d){Yj(a,d),(a=a.alternate)&&Yj(a,d)}function ND(){return null}var Xj=typeof reportError=="function"?reportError:function(a){console.error(a)};function ev(a){this._internalRoot=a}Lm.prototype.render=ev.prototype.render=function(a){var d=this._internalRoot;if(d===null)throw Error(n(409));Om(a,d,null,null)},Lm.prototype.unmount=ev.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var d=a.containerInfo;Xa(function(){Om(null,a,null,null)}),d[Wi]=null}};function Lm(a){this._internalRoot=a}Lm.prototype.unstable_scheduleHydration=function(a){if(a){var d=zS();a={blockedOn:null,target:a,priority:d};for(var x=0;x<zl.length&&d!==0&&d<zl[x].priority;x++);zl.splice(x,0,a),x===0&&AS(a)}};function tv(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function Dm(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function Zj(){}function _D(a,d,x,I,z){if(z){if(typeof I=="function"){var W=I;I=function(){var Te=zm(X);W.call(Te)}}var X=Qj(d,I,a,0,null,!1,!1,"",Zj);return a._reactRootContainer=X,a[Wi]=X.current,yf(a.nodeType===8?a.parentNode:a),Xa(),X}for(;z=a.lastChild;)a.removeChild(z);if(typeof I=="function"){var ae=I;I=function(){var Te=zm(pe);ae.call(Te)}}var pe=Zb(a,0,!1,null,null,!1,!1,"",Zj);return a._reactRootContainer=pe,a[Wi]=pe.current,yf(a.nodeType===8?a.parentNode:a),Xa(function(){Om(d,pe,x,I)}),pe}function Am(a,d,x,I,z){var W=x._reactRootContainer;if(W){var X=W;if(typeof z=="function"){var ae=z;z=function(){var pe=zm(X);ae.call(pe)}}Om(d,X,a,z)}else X=_D(x,d,a,z,I);return zm(X)}$S=function(a){switch(a.tag){case 3:var d=a.stateNode;if(d.current.memoizedState.isDehydrated){var x=mi(d.pendingLanes);x!==0&&(ky(d,x|1),Do(d,nn()),(mn&6)===0&&(bu=nn()+500,_l()))}break;case 13:Xa(function(){var I=qi(a,1);if(I!==null){var z=Co();Ys(I,a,1,z)}}),Jb(a,1)}},Iy=function(a){if(a.tag===13){var d=qi(a,134217728);if(d!==null){var x=Co();Ys(d,a,134217728,x)}Jb(a,134217728)}},OS=function(a){if(a.tag===13){var d=Ul(a),x=qi(a,d);if(x!==null){var I=Co();Ys(x,a,d,I)}Jb(a,d)}},zS=function(){return Fn},LS=function(a,d){var x=Fn;try{return Fn=a,d()}finally{Fn=x}},yn=function(a,d,x){switch(d){case"input":if(we(a,x),d=x.name,x.type==="radio"&&d!=null){for(x=a;x.parentNode;)x=x.parentNode;for(x=x.querySelectorAll("input[name="+JSON.stringify(""+d)+'][type="radio"]'),d=0;d<x.length;d++){var I=x[d];if(I!==a&&I.form===a.form){var z=em(I);if(!z)throw Error(n(90));de(I),we(I,z)}}}break;case"textarea":Ae(a,x);break;case"select":d=x.value,d!=null&&Ve(a,!!x.multiple,d,!1)}},er=Ub,yt=Xa;var HD={usingClientEntryPoint:!1,Events:[Cf,iu,em,kt,un,Ub]},Lf={findFiberByHostInstance:Wa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},BD={bundleType:Lf.bundleType,version:Lf.version,rendererPackageName:Lf.rendererPackageName,rendererConfig:Lf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=nt(a),a===null?null:a.stateNode},findFiberByHostInstance:Lf.findFiberByHostInstance||ND,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 Fm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fm.isDisabled&&Fm.supportsFiber)try{Yo=Fm.inject(BD),Ro=Fm}catch{}}return Ao.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=HD,Ao.createPortal=function(a,d){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!tv(d))throw Error(n(200));return FD(a,d,null,x)},Ao.createRoot=function(a,d){if(!tv(a))throw Error(n(299));var x=!1,I="",z=Xj;return d!=null&&(d.unstable_strictMode===!0&&(x=!0),d.identifierPrefix!==void 0&&(I=d.identifierPrefix),d.onRecoverableError!==void 0&&(z=d.onRecoverableError)),d=Zb(a,1,!1,null,null,x,!1,I,z),a[Wi]=d.current,yf(a.nodeType===8?a.parentNode:a),new ev(d)},Ao.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var d=a._reactInternals;if(d===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=nt(d),a=a===null?null:a.stateNode,a},Ao.flushSync=function(a){return Xa(a)},Ao.hydrate=function(a,d,x){if(!Dm(d))throw Error(n(200));return Am(null,a,d,!0,x)},Ao.hydrateRoot=function(a,d,x){if(!tv(a))throw Error(n(405));var I=x!=null&&x.hydratedSources||null,z=!1,W="",X=Xj;if(x!=null&&(x.unstable_strictMode===!0&&(z=!0),x.identifierPrefix!==void 0&&(W=x.identifierPrefix),x.onRecoverableError!==void 0&&(X=x.onRecoverableError)),d=Qj(d,null,a,1,x??null,z,!1,W,X),a[Wi]=d.current,yf(a),I)for(a=0;a<I.length;a++)x=I[a],z=x._getVersion,z=z(x._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[x,z]:d.mutableSourceEagerHydrationData.push(x,z);return new Lm(d)},Ao.render=function(a,d,x){if(!Dm(d))throw Error(n(200));return Am(null,a,d,!1,x)},Ao.unmountComponentAtNode=function(a){if(!Dm(a))throw Error(n(40));return a._reactRootContainer?(Xa(function(){Am(null,null,a,!1,function(){a._reactRootContainer=null,a[Wi]=null})}),!0):!1},Ao.unstable_batchedUpdates=Ub,Ao.unstable_renderSubtreeIntoContainer=function(a,d,x,I){if(!Dm(x))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return Am(a,d,x,!1,I)},Ao.version="18.3.1-next-f1338f8080-20240426",Ao}var l2;function xT(){if(l2)return sv.exports;l2=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),sv.exports=ZD(),sv.exports}var a2;function JD(){if(a2)return _m;a2=1;var e=xT();return _m.createRoot=e.createRoot,_m.hydrateRoot=e.hydrateRoot,_m}var eA=JD();const tA=Ld(eA);var Ad=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},nA={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},aa,zC,iT,rA=(iT=class{constructor(){Mt(this,aa,nA);Mt(this,zC,!1)}setTimeoutProvider(e){dt(this,aa,e)}setTimeout(e,t){return ue(this,aa).setTimeout(e,t)}clearTimeout(e){ue(this,aa).clearTimeout(e)}setInterval(e,t){return ue(this,aa).setInterval(e,t)}clearInterval(e){ue(this,aa).clearInterval(e)}},aa=new WeakMap,zC=new WeakMap,iT),dc=new rA;function oA(e){setTimeout(e,0)}var Mc=typeof window>"u"||"Deno"in globalThis;function ko(){}function sA(e,t){return typeof e=="function"?e(t):e}function h0(e){return typeof e=="number"&&e>=0&&e!==1/0}function yT(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ya(e,t){return typeof e=="function"?e(t):e}function ks(e,t){return typeof e=="function"?e(t):e}function c2(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==LC(l,t.options))return!1}else if(!Pp(t.queryKey,l))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||o&&o!==t.state.fetchStatus||i&&!i(t))}function u2(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Rc(t.options.mutationKey)!==Rc(i))return!1}else if(!Pp(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function LC(e,t){return((t==null?void 0:t.queryKeyHashFn)||Rc)(e)}function Rc(e){return JSON.stringify(e,(t,n)=>m0(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Pp(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Pp(e[n],t[n])):!1}var iA=Object.prototype.hasOwnProperty;function bT(e,t){if(e===t)return e;const n=d2(e)&&d2(t);if(!n&&!(m0(e)&&m0(t)))return t;const o=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),l=i.length,c=n?new Array(l):{};let u=0;for(let f=0;f<l;f++){const h=n?f:i[f],p=e[h],g=t[h];if(p===g){c[h]=p,(n?f<o:iA.call(e,h))&&u++;continue}if(p===null||g===null||typeof p!="object"||typeof g!="object"){c[h]=g;continue}const y=bT(p,g);c[h]=y,y===p&&u++}return o===l&&u===o?e:c}function Ng(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function d2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function m0(e){if(!f2(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!f2(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function f2(e){return Object.prototype.toString.call(e)==="[object Object]"}function lA(e){return new Promise(t=>{dc.setTimeout(t,e)})}function g0(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?bT(e,t):t}function aA(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function cA(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var DC=Symbol();function vT(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===DC?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function AC(e,t){return typeof e=="function"?e(...t):!!e}function uA(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var gc,ca,ed,lT,dA=(lT=class extends Ad{constructor(){super();Mt(this,gc);Mt(this,ca);Mt(this,ed);dt(this,ed,t=>{if(!Mc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ue(this,ca)||this.setEventListener(ue(this,ed))}onUnsubscribe(){var t;this.hasListeners()||((t=ue(this,ca))==null||t.call(this),dt(this,ca,void 0))}setEventListener(t){var n;dt(this,ed,t),(n=ue(this,ca))==null||n.call(this),dt(this,ca,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ue(this,gc)!==t&&(dt(this,gc,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof ue(this,gc)=="boolean"?ue(this,gc):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},gc=new WeakMap,ca=new WeakMap,ed=new WeakMap,lT),FC=new dA;function x0(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var fA=oA;function pA(){let e=[],t=0,n=c=>{c()},r=c=>{c()},o=fA;const i=c=>{t?e.push(c):o(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&o(()=>{r(()=>{c.forEach(u=>{n(u)})})})};return{batch:c=>{let u;t++;try{u=c()}finally{t--,t||l()}return u},batchCalls:c=>(...u)=>{i(()=>{c(...u)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{o=c}}}var Lr=pA(),td,ua,nd,aT,hA=(aT=class extends Ad{constructor(){super();Mt(this,td,!0);Mt(this,ua);Mt(this,nd);dt(this,nd,t=>{if(!Mc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){ue(this,ua)||this.setEventListener(ue(this,nd))}onUnsubscribe(){var t;this.hasListeners()||((t=ue(this,ua))==null||t.call(this),dt(this,ua,void 0))}setEventListener(t){var n;dt(this,nd,t),(n=ue(this,ua))==null||n.call(this),dt(this,ua,t(this.setOnline.bind(this)))}setOnline(t){ue(this,td)!==t&&(dt(this,td,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ue(this,td)}},td=new WeakMap,ua=new WeakMap,nd=new WeakMap,aT),_g=new hA;function mA(e){return Math.min(1e3*2**e,3e4)}function CT(e){return(e??"online")==="online"?_g.isOnline():!0}var y0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function wT(e){let t=!1,n=0,r;const o=x0(),i=()=>o.status!=="pending",l=v=>{var C;if(!i()){const S=new y0(v);g(S),(C=e.onCancel)==null||C.call(e,S)}},c=()=>{t=!0},u=()=>{t=!1},f=()=>FC.isFocused()&&(e.networkMode==="always"||_g.isOnline())&&e.canRun(),h=()=>CT(e.networkMode)&&e.canRun(),p=v=>{i()||(r==null||r(),o.resolve(v))},g=v=>{i()||(r==null||r(),o.reject(v))},y=()=>new Promise(v=>{var C;r=S=>{(i()||f())&&v(S)},(C=e.onPause)==null||C.call(e)}).then(()=>{var v;r=void 0,i()||(v=e.onContinue)==null||v.call(e)}),b=()=>{if(i())return;let v;const C=n===0?e.initialPromise:void 0;try{v=C??e.fn()}catch(S){v=Promise.reject(S)}Promise.resolve(v).then(p).catch(S=>{var T;if(i())return;const j=e.retry??(Mc?0:3),w=e.retryDelay??mA,k=typeof w=="function"?w(n,S):w,P=j===!0||typeof j=="number"&&n<j||typeof j=="function"&&j(n,S);if(t||!P){g(S);return}n++,(T=e.onFail)==null||T.call(e,n,S),lA(k).then(()=>f()?void 0:y()).then(()=>{t?g(S):b()})})};return{promise:o,status:()=>o.status,cancel:l,continue:()=>(r==null||r(),o),cancelRetry:c,continueRetry:u,canStart:h,start:()=>(h()?b():y().then(b),o)}}var xc,cT,ST=(cT=class{constructor(){Mt(this,xc)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),h0(this.gcTime)&&dt(this,xc,dc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Mc?1/0:300*1e3))}clearGcTimeout(){ue(this,xc)&&(dc.clearTimeout(ue(this,xc)),dt(this,xc,void 0))}},xc=new WeakMap,cT),yc,rd,js,bc,Wr,nh,vc,ei,el,uT,gA=(uT=class extends ST{constructor(t){super();Mt(this,ei);Mt(this,yc);Mt(this,rd);Mt(this,js);Mt(this,bc);Mt(this,Wr);Mt(this,nh);Mt(this,vc);dt(this,vc,!1),dt(this,nh,t.defaultOptions),this.setOptions(t.options),this.observers=[],dt(this,bc,t.client),dt(this,js,ue(this,bc).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,dt(this,yc,h2(this.options)),this.state=t.state??ue(this,yc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=ue(this,Wr))==null?void 0:t.promise}setOptions(t){if(this.options={...ue(this,nh),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=h2(this.options);n.data!==void 0&&(this.setState(p2(n.data,n.dataUpdatedAt)),dt(this,yc,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ue(this,js).remove(this)}setData(t,n){const r=g0(this.state.data,t,this.options);return Xt(this,ei,el).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Xt(this,ei,el).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=ue(this,Wr))==null?void 0:r.promise;return(o=ue(this,Wr))==null||o.cancel(t),n?n.then(ko).catch(ko):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ue(this,yc))}isActive(){return this.observers.some(t=>ks(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===DC||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ya(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!yT(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ue(this,Wr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ue(this,Wr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ue(this,js).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(ue(this,Wr)&&(ue(this,vc)?ue(this,Wr).cancel({revert:!0}):ue(this,Wr).cancelRetry()),this.scheduleGc()),ue(this,js).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Xt(this,ei,el).call(this,{type:"invalidate"})}async fetch(t,n){var u,f,h,p,g,y,b,v,C,S,j,w;if(this.state.fetchStatus!=="idle"&&((u=ue(this,Wr))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ue(this,Wr))return ue(this,Wr).continueRetry(),ue(this,Wr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(P=>P.options.queryFn);k&&this.setOptions(k.options)}const r=new AbortController,o=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(dt(this,vc,!0),r.signal)})},i=()=>{const k=vT(this.options,n),T=(()=>{const $={client:ue(this,bc),queryKey:this.queryKey,meta:this.meta};return o($),$})();return dt(this,vc,!1),this.options.persister?this.options.persister(k,T,this):k(T)},c=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:ue(this,bc),state:this.state,fetchFn:i};return o(k),k})();(f=this.options.behavior)==null||f.onFetch(c,this),dt(this,rd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=c.fetchOptions)==null?void 0:h.meta))&&Xt(this,ei,el).call(this,{type:"fetch",meta:(p=c.fetchOptions)==null?void 0:p.meta}),dt(this,Wr,wT({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:k=>{k instanceof y0&&k.revert&&this.setState({...ue(this,rd),fetchStatus:"idle"}),r.abort()},onFail:(k,P)=>{Xt(this,ei,el).call(this,{type:"failed",failureCount:k,error:P})},onPause:()=>{Xt(this,ei,el).call(this,{type:"pause"})},onContinue:()=>{Xt(this,ei,el).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const k=await ue(this,Wr).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(y=(g=ue(this,js).config).onSuccess)==null||y.call(g,k,this),(v=(b=ue(this,js).config).onSettled)==null||v.call(b,k,this.state.error,this),k}catch(k){if(k instanceof y0){if(k.silent)return ue(this,Wr).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw Xt(this,ei,el).call(this,{type:"error",error:k}),(S=(C=ue(this,js).config).onError)==null||S.call(C,k,this),(w=(j=ue(this,js).config).onSettled)==null||w.call(j,this.state.data,k,this),k}finally{this.scheduleGc()}}},yc=new WeakMap,rd=new WeakMap,js=new WeakMap,bc=new WeakMap,Wr=new WeakMap,nh=new WeakMap,vc=new WeakMap,ei=new WeakSet,el=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...jT(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...p2(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return dt(this,rd,t.manual?o:void 0),o;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Lr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),ue(this,js).notify({query:this,type:"updated",action:t})})},uT);function jT(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:CT(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function p2(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function h2(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Fo,an,rh,So,Cc,od,rl,da,oh,sd,id,wc,Sc,fa,ld,zn,rp,b0,v0,C0,w0,S0,j0,k0,kT,dT,xA=(dT=class extends Ad{constructor(t,n){super();Mt(this,zn);Mt(this,Fo);Mt(this,an);Mt(this,rh);Mt(this,So);Mt(this,Cc);Mt(this,od);Mt(this,rl);Mt(this,da);Mt(this,oh);Mt(this,sd);Mt(this,id);Mt(this,wc);Mt(this,Sc);Mt(this,fa);Mt(this,ld,new Set);this.options=n,dt(this,Fo,t),dt(this,da,null),dt(this,rl,x0()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ue(this,an).addObserver(this),m2(ue(this,an),this.options)?Xt(this,zn,rp).call(this):this.updateResult(),Xt(this,zn,w0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return I0(ue(this,an),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return I0(ue(this,an),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Xt(this,zn,S0).call(this),Xt(this,zn,j0).call(this),ue(this,an).removeObserver(this)}setOptions(t){const n=this.options,r=ue(this,an);if(this.options=ue(this,Fo).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ks(this.options.enabled,ue(this,an))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Xt(this,zn,k0).call(this),ue(this,an).setOptions(this.options),n._defaulted&&!Ng(this.options,n)&&ue(this,Fo).getQueryCache().notify({type:"observerOptionsUpdated",query:ue(this,an),observer:this});const o=this.hasListeners();o&&g2(ue(this,an),r,this.options,n)&&Xt(this,zn,rp).call(this),this.updateResult(),o&&(ue(this,an)!==r||ks(this.options.enabled,ue(this,an))!==ks(n.enabled,ue(this,an))||ya(this.options.staleTime,ue(this,an))!==ya(n.staleTime,ue(this,an)))&&Xt(this,zn,b0).call(this);const i=Xt(this,zn,v0).call(this);o&&(ue(this,an)!==r||ks(this.options.enabled,ue(this,an))!==ks(n.enabled,ue(this,an))||i!==ue(this,fa))&&Xt(this,zn,C0).call(this,i)}getOptimisticResult(t){const n=ue(this,Fo).getQueryCache().build(ue(this,Fo),t),r=this.createResult(n,t);return bA(this,r)&&(dt(this,So,r),dt(this,od,this.options),dt(this,Cc,ue(this,an).state)),r}getCurrentResult(){return ue(this,So)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&ue(this,rl).status==="pending"&&ue(this,rl).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,o))})}trackProp(t){ue(this,ld).add(t)}getCurrentQuery(){return ue(this,an)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ue(this,Fo).defaultQueryOptions(t),r=ue(this,Fo).getQueryCache().build(ue(this,Fo),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Xt(this,zn,rp).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ue(this,So)))}createResult(t,n){var R;const r=ue(this,an),o=this.options,i=ue(this,So),l=ue(this,Cc),c=ue(this,od),f=t!==r?t.state:ue(this,rh),{state:h}=t;let p={...h},g=!1,y;if(n._optimisticResults){const E=this.hasListeners(),O=!E&&m2(t,n),A=E&&g2(t,r,n,o);(O||A)&&(p={...p,...jT(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:b,errorUpdatedAt:v,status:C}=p;y=p.data;let S=!1;if(n.placeholderData!==void 0&&y===void 0&&C==="pending"){let E;i!=null&&i.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(E=i.data,S=!0):E=typeof n.placeholderData=="function"?n.placeholderData((R=ue(this,id))==null?void 0:R.state.data,ue(this,id)):n.placeholderData,E!==void 0&&(C="success",y=g0(i==null?void 0:i.data,E,n),g=!0)}if(n.select&&y!==void 0&&!S)if(i&&y===(l==null?void 0:l.data)&&n.select===ue(this,oh))y=ue(this,sd);else try{dt(this,oh,n.select),y=n.select(y),y=g0(i==null?void 0:i.data,y,n),dt(this,sd,y),dt(this,da,null)}catch(E){dt(this,da,E)}ue(this,da)&&(b=ue(this,da),y=ue(this,sd),v=Date.now(),C="error");const j=p.fetchStatus==="fetching",w=C==="pending",k=C==="error",P=w&&j,T=y!==void 0,M={status:C,fetchStatus:p.fetchStatus,isPending:w,isSuccess:C==="success",isError:k,isInitialLoading:P,isLoading:P,data:y,dataUpdatedAt:p.dataUpdatedAt,error:b,errorUpdatedAt:v,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:j,isRefetching:j&&!w,isLoadingError:k&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:k&&T,isStale:NC(t,n),refetch:this.refetch,promise:ue(this,rl),isEnabled:ks(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const E=N=>{M.status==="error"?N.reject(M.error):M.data!==void 0&&N.resolve(M.data)},O=()=>{const N=dt(this,rl,M.promise=x0());E(N)},A=ue(this,rl);switch(A.status){case"pending":t.queryHash===r.queryHash&&E(A);break;case"fulfilled":(M.status==="error"||M.data!==A.value)&&O();break;case"rejected":(M.status!=="error"||M.error!==A.reason)&&O();break}}return M}updateResult(){const t=ue(this,So),n=this.createResult(ue(this,an),this.options);if(dt(this,Cc,ue(this,an).state),dt(this,od,this.options),ue(this,Cc).data!==void 0&&dt(this,id,ue(this,an)),Ng(n,t))return;dt(this,So,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,i=typeof o=="function"?o():o;if(i==="all"||!i&&!ue(this,ld).size)return!0;const l=new Set(i??ue(this,ld));return this.options.throwOnError&&l.add("error"),Object.keys(ue(this,So)).some(c=>{const u=c;return ue(this,So)[u]!==t[u]&&l.has(u)})};Xt(this,zn,kT).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Xt(this,zn,w0).call(this)}},Fo=new WeakMap,an=new WeakMap,rh=new WeakMap,So=new WeakMap,Cc=new WeakMap,od=new WeakMap,rl=new WeakMap,da=new WeakMap,oh=new WeakMap,sd=new WeakMap,id=new WeakMap,wc=new WeakMap,Sc=new WeakMap,fa=new WeakMap,ld=new WeakMap,zn=new WeakSet,rp=function(t){Xt(this,zn,k0).call(this);let n=ue(this,an).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ko)),n},b0=function(){Xt(this,zn,S0).call(this);const t=ya(this.options.staleTime,ue(this,an));if(Mc||ue(this,So).isStale||!h0(t))return;const r=yT(ue(this,So).dataUpdatedAt,t)+1;dt(this,wc,dc.setTimeout(()=>{ue(this,So).isStale||this.updateResult()},r))},v0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ue(this,an)):this.options.refetchInterval)??!1},C0=function(t){Xt(this,zn,j0).call(this),dt(this,fa,t),!(Mc||ks(this.options.enabled,ue(this,an))===!1||!h0(ue(this,fa))||ue(this,fa)===0)&&dt(this,Sc,dc.setInterval(()=>{(this.options.refetchIntervalInBackground||FC.isFocused())&&Xt(this,zn,rp).call(this)},ue(this,fa)))},w0=function(){Xt(this,zn,b0).call(this),Xt(this,zn,C0).call(this,Xt(this,zn,v0).call(this))},S0=function(){ue(this,wc)&&(dc.clearTimeout(ue(this,wc)),dt(this,wc,void 0))},j0=function(){ue(this,Sc)&&(dc.clearInterval(ue(this,Sc)),dt(this,Sc,void 0))},k0=function(){const t=ue(this,Fo).getQueryCache().build(ue(this,Fo),this.options);if(t===ue(this,an))return;const n=ue(this,an);dt(this,an,t),dt(this,rh,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},kT=function(t){Lr.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ue(this,So))}),ue(this,Fo).getQueryCache().notify({query:ue(this,an),type:"observerResultsUpdated"})})},dT);function yA(e,t){return ks(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function m2(e,t){return yA(e,t)||e.state.data!==void 0&&I0(e,t,t.refetchOnMount)}function I0(e,t,n){if(ks(t.enabled,e)!==!1&&ya(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&NC(e,t)}return!1}function g2(e,t,n,r){return(e!==t||ks(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&NC(e,n)}function NC(e,t){return ks(t.enabled,e)!==!1&&e.isStaleByTime(ya(t.staleTime,e))}function bA(e,t){return!Ng(e.getCurrentResult(),t)}function x2(e){return{onFetch:(t,n)=>{var h,p,g,y,b;const r=t.options,o=(g=(p=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:g.direction,i=((y=t.state.data)==null?void 0:y.pages)||[],l=((b=t.state.data)==null?void 0:b.pageParams)||[];let c={pages:[],pageParams:[]},u=0;const f=async()=>{let v=!1;const C=w=>{uA(w,()=>t.signal,()=>v=!0)},S=vT(t.options,t.fetchOptions),j=async(w,k,P)=>{if(v)return Promise.reject();if(k==null&&w.pages.length)return Promise.resolve(w);const $=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:k,direction:P?"backward":"forward",meta:t.options.meta};return C(O),O})(),M=await S($),{maxPages:R}=t.options,E=P?cA:aA;return{pages:E(w.pages,M,R),pageParams:E(w.pageParams,k,R)}};if(o&&i.length){const w=o==="backward",k=w?vA:y2,P={pages:i,pageParams:l},T=k(r,P);c=await j(P,T,w)}else{const w=e??i.length;do{const k=u===0?l[0]??r.initialPageParam:y2(r,c);if(u>0&&k==null)break;c=await j(c,k),u++}while(u<w)}return c};t.options.persister?t.fetchFn=()=>{var v,C;return(C=(v=t.options).persister)==null?void 0:C.call(v,f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=f}}}function y2(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function vA(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var sh,wi,jo,jc,Si,ea,fT,CA=(fT=class extends ST{constructor(t){super();Mt(this,Si);Mt(this,sh);Mt(this,wi);Mt(this,jo);Mt(this,jc);dt(this,sh,t.client),this.mutationId=t.mutationId,dt(this,jo,t.mutationCache),dt(this,wi,[]),this.state=t.state||IT(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ue(this,wi).includes(t)||(ue(this,wi).push(t),this.clearGcTimeout(),ue(this,jo).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){dt(this,wi,ue(this,wi).filter(n=>n!==t)),this.scheduleGc(),ue(this,jo).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ue(this,wi).length||(this.state.status==="pending"?this.scheduleGc():ue(this,jo).remove(this))}continue(){var t;return((t=ue(this,jc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,c,u,f,h,p,g,y,b,v,C,S,j,w,k,P,T,$,M,R;const n=()=>{Xt(this,Si,ea).call(this,{type:"continue"})},r={client:ue(this,sh),meta:this.options.meta,mutationKey:this.options.mutationKey};dt(this,jc,wT({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(E,O)=>{Xt(this,Si,ea).call(this,{type:"failed",failureCount:E,error:O})},onPause:()=>{Xt(this,Si,ea).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ue(this,jo).canRun(this)}));const o=this.state.status==="pending",i=!ue(this,jc).canStart();try{if(o)n();else{Xt(this,Si,ea).call(this,{type:"pending",variables:t,isPaused:i}),await((c=(l=ue(this,jo).config).onMutate)==null?void 0:c.call(l,t,this,r));const O=await((f=(u=this.options).onMutate)==null?void 0:f.call(u,t,r));O!==this.state.context&&Xt(this,Si,ea).call(this,{type:"pending",context:O,variables:t,isPaused:i})}const E=await ue(this,jc).start();return await((p=(h=ue(this,jo).config).onSuccess)==null?void 0:p.call(h,E,t,this.state.context,this,r)),await((y=(g=this.options).onSuccess)==null?void 0:y.call(g,E,t,this.state.context,r)),await((v=(b=ue(this,jo).config).onSettled)==null?void 0:v.call(b,E,null,this.state.variables,this.state.context,this,r)),await((S=(C=this.options).onSettled)==null?void 0:S.call(C,E,null,t,this.state.context,r)),Xt(this,Si,ea).call(this,{type:"success",data:E}),E}catch(E){try{await((w=(j=ue(this,jo).config).onError)==null?void 0:w.call(j,E,t,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((P=(k=this.options).onError)==null?void 0:P.call(k,E,t,this.state.context,r))}catch(O){Promise.reject(O)}try{await(($=(T=ue(this,jo).config).onSettled)==null?void 0:$.call(T,void 0,E,this.state.variables,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((R=(M=this.options).onSettled)==null?void 0:R.call(M,void 0,E,t,this.state.context,r))}catch(O){Promise.reject(O)}throw Xt(this,Si,ea).call(this,{type:"error",error:E}),E}finally{ue(this,jo).runNext(this)}}},sh=new WeakMap,wi=new WeakMap,jo=new WeakMap,jc=new WeakMap,Si=new WeakSet,ea=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Lr.batch(()=>{ue(this,wi).forEach(r=>{r.onMutationUpdate(t)}),ue(this,jo).notify({mutation:this,type:"updated",action:t})})},fT);function IT(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ol,ti,ih,pT,wA=(pT=class extends Ad{constructor(t={}){super();Mt(this,ol);Mt(this,ti);Mt(this,ih);this.config=t,dt(this,ol,new Set),dt(this,ti,new Map),dt(this,ih,0)}build(t,n,r){const o=new CA({client:t,mutationCache:this,mutationId:++Nm(this,ih)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){ue(this,ol).add(t);const n=Hm(t);if(typeof n=="string"){const r=ue(this,ti).get(n);r?r.push(t):ue(this,ti).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(ue(this,ol).delete(t)){const n=Hm(t);if(typeof n=="string"){const r=ue(this,ti).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&ue(this,ti).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Hm(t);if(typeof n=="string"){const r=ue(this,ti).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Hm(t);if(typeof n=="string"){const o=(r=ue(this,ti).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Lr.batch(()=>{ue(this,ol).forEach(t=>{this.notify({type:"removed",mutation:t})}),ue(this,ol).clear(),ue(this,ti).clear()})}getAll(){return Array.from(ue(this,ol))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>u2(n,r))}findAll(t={}){return this.getAll().filter(n=>u2(t,n))}notify(t){Lr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Lr.batch(()=>Promise.all(t.map(n=>n.continue().catch(ko))))}},ol=new WeakMap,ti=new WeakMap,ih=new WeakMap,pT);function Hm(e){var t;return(t=e.options.scope)==null?void 0:t.id}var sl,pa,No,il,fl,vg,E0,hT,SA=(hT=class extends Ad{constructor(n,r){super();Mt(this,fl);Mt(this,sl);Mt(this,pa);Mt(this,No);Mt(this,il);dt(this,sl,n),this.setOptions(r),this.bindMethods(),Xt(this,fl,vg).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=ue(this,sl).defaultMutationOptions(n),Ng(this.options,r)||ue(this,sl).getMutationCache().notify({type:"observerOptionsUpdated",mutation:ue(this,No),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Rc(r.mutationKey)!==Rc(this.options.mutationKey)?this.reset():((o=ue(this,No))==null?void 0:o.state.status)==="pending"&&ue(this,No).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=ue(this,No))==null||n.removeObserver(this)}onMutationUpdate(n){Xt(this,fl,vg).call(this),Xt(this,fl,E0).call(this,n)}getCurrentResult(){return ue(this,pa)}reset(){var n;(n=ue(this,No))==null||n.removeObserver(this),dt(this,No,void 0),Xt(this,fl,vg).call(this),Xt(this,fl,E0).call(this)}mutate(n,r){var o;return dt(this,il,r),(o=ue(this,No))==null||o.removeObserver(this),dt(this,No,ue(this,sl).getMutationCache().build(ue(this,sl),this.options)),ue(this,No).addObserver(this),ue(this,No).execute(n)}},sl=new WeakMap,pa=new WeakMap,No=new WeakMap,il=new WeakMap,fl=new WeakSet,vg=function(){var r;const n=((r=ue(this,No))==null?void 0:r.state)??IT();dt(this,pa,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},E0=function(n){Lr.batch(()=>{var r,o,i,l,c,u,f,h;if(ue(this,il)&&this.hasListeners()){const p=ue(this,pa).variables,g=ue(this,pa).context,y={client:ue(this,sl),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(o=(r=ue(this,il)).onSuccess)==null||o.call(r,n.data,p,g,y)}catch(b){Promise.reject(b)}try{(l=(i=ue(this,il)).onSettled)==null||l.call(i,n.data,null,p,g,y)}catch(b){Promise.reject(b)}}else if((n==null?void 0:n.type)==="error"){try{(u=(c=ue(this,il)).onError)==null||u.call(c,n.error,p,g,y)}catch(b){Promise.reject(b)}try{(h=(f=ue(this,il)).onSettled)==null||h.call(f,void 0,n.error,p,g,y)}catch(b){Promise.reject(b)}}}this.listeners.forEach(p=>{p(ue(this,pa))})})},hT),ji,mT,jA=(mT=class extends Ad{constructor(t={}){super();Mt(this,ji);this.config=t,dt(this,ji,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??LC(o,n);let l=this.get(i);return l||(l=new gA({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(l)),l}add(t){ue(this,ji).has(t.queryHash)||(ue(this,ji).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ue(this,ji).get(t.queryHash);n&&(t.destroy(),n===t&&ue(this,ji).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Lr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ue(this,ji).get(t)}getAll(){return[...ue(this,ji).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>c2(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>c2(t,r)):n}notify(t){Lr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Lr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Lr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ji=new WeakMap,mT),xr,ha,ma,ad,cd,ga,ud,dd,gT,kA=(gT=class{constructor(e={}){Mt(this,xr);Mt(this,ha);Mt(this,ma);Mt(this,ad);Mt(this,cd);Mt(this,ga);Mt(this,ud);Mt(this,dd);dt(this,xr,e.queryCache||new jA),dt(this,ha,e.mutationCache||new wA),dt(this,ma,e.defaultOptions||{}),dt(this,ad,new Map),dt(this,cd,new Map),dt(this,ga,0)}mount(){Nm(this,ga)._++,ue(this,ga)===1&&(dt(this,ud,FC.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,xr).onFocus())})),dt(this,dd,_g.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,xr).onOnline())})))}unmount(){var e,t;Nm(this,ga)._--,ue(this,ga)===0&&((e=ue(this,ud))==null||e.call(this),dt(this,ud,void 0),(t=ue(this,dd))==null||t.call(this),dt(this,dd,void 0))}isFetching(e){return ue(this,xr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ue(this,ha).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ue(this,xr).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=ue(this,xr).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ya(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return ue(this,xr).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=ue(this,xr).get(r.queryHash),i=o==null?void 0:o.state.data,l=sA(t,i);if(l!==void 0)return ue(this,xr).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Lr.batch(()=>ue(this,xr).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ue(this,xr).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=ue(this,xr);Lr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ue(this,xr);return Lr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Lr.batch(()=>ue(this,xr).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(ko).catch(ko)}invalidateQueries(e,t={}){return Lr.batch(()=>(ue(this,xr).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Lr.batch(()=>ue(this,xr).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(ko)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(ko)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=ue(this,xr).build(this,t);return n.isStaleByTime(ya(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ko).catch(ko)}fetchInfiniteQuery(e){return e.behavior=x2(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ko).catch(ko)}ensureInfiniteQueryData(e){return e.behavior=x2(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return _g.isOnline()?ue(this,ha).resumePausedMutations():Promise.resolve()}getQueryCache(){return ue(this,xr)}getMutationCache(){return ue(this,ha)}getDefaultOptions(){return ue(this,ma)}setDefaultOptions(e){dt(this,ma,e)}setQueryDefaults(e,t){ue(this,ad).set(Rc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ue(this,ad).values()],n={};return t.forEach(r=>{Pp(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){ue(this,cd).set(Rc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ue(this,cd).values()],n={};return t.forEach(r=>{Pp(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ue(this,ma).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=LC(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===DC&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ue(this,ma).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ue(this,xr).clear(),ue(this,ha).clear()}},xr=new WeakMap,ha=new WeakMap,ma=new WeakMap,ad=new WeakMap,cd=new WeakMap,ga=new WeakMap,ud=new WeakMap,dd=new WeakMap,gT),ET=m.createContext(void 0),Tr=e=>{const t=m.useContext(ET);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},IA=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(ET.Provider,{value:e,children:t})),PT=m.createContext(!1),EA=()=>m.useContext(PT);PT.Provider;function PA(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var TA=m.createContext(PA()),MA=()=>m.useContext(TA),RA=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?AC(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},$A=e=>{m.useEffect(()=>{e.clearReset()},[e])},OA=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||AC(n,[e.error,r])),zA=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},LA=(e,t)=>e.isLoading&&e.isFetching&&!t,DA=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,b2=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function AA(e,t,n){var g,y,b,v;const r=EA(),o=MA(),i=Tr(),l=i.defaultQueryOptions(e);(y=(g=i.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||y.call(g,l);const c=i.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",zA(l),RA(l,o,c),$A(o);const u=!i.getQueryCache().get(l.queryHash),[f]=m.useState(()=>new t(i,l)),h=f.getOptimisticResult(l),p=!r&&e.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(C=>{const S=p?f.subscribe(Lr.batchCalls(C)):ko;return f.updateResult(),S},[f,p]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),m.useEffect(()=>{f.setOptions(l)},[l,f]),DA(l,h))throw b2(l,f,o);if(OA({result:h,errorResetBoundary:o,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw h.error;if((v=(b=i.getDefaultOptions().queries)==null?void 0:b._experimental_afterQuery)==null||v.call(b,l,h),l.experimental_prefetchInRender&&!Mc&&LA(h,r)){const C=u?b2(l,f,o):c==null?void 0:c.promise;C==null||C.catch(ko).finally(()=>{f.updateResult()})}return l.notifyOnChangeProps?h:f.trackResult(h)}function Ft(e,t){return AA(e,xA)}function vr(e,t){const n=Tr(),[r]=m.useState(()=>new SA(n,e));m.useEffect(()=>{r.setOptions(e)},[r,e]);const o=m.useSyncExternalStore(m.useCallback(l=>r.subscribe(Lr.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=m.useCallback((l,c)=>{r.mutate(l,c).catch(ko)},[r]);if(o.error&&AC(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}/**
|
|
41
|
+
* react-router v7.12.0
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/var v2="popstate";function FA(e={}){function t(r,o){let{pathname:i,search:l,hash:c}=r.location;return P0("",{pathname:i,search:l,hash:c},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Tp(o)}return _A(t,n,null,e)}function sr(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function cs(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function NA(){return Math.random().toString(36).substring(2,10)}function C2(e,t){return{usr:e.state,key:e.key,idx:t}}function P0(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Fd(t):t,state:n,key:t&&t.key||r||NA()}}function Tp({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Fd(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function _A(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:i=!1}=r,l=o.history,c="POP",u=null,f=h();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function h(){return(l.state||{idx:null}).idx}function p(){c="POP";let C=h(),S=C==null?null:C-f;f=C,u&&u({action:c,location:v.location,delta:S})}function g(C,S){c="PUSH";let j=P0(v.location,C,S);f=h()+1;let w=C2(j,f),k=v.createHref(j);try{l.pushState(w,"",k)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;o.location.assign(k)}i&&u&&u({action:c,location:v.location,delta:1})}function y(C,S){c="REPLACE";let j=P0(v.location,C,S);f=h();let w=C2(j,f),k=v.createHref(j);l.replaceState(w,"",k),i&&u&&u({action:c,location:v.location,delta:0})}function b(C){return HA(C)}let v={get action(){return c},get location(){return e(o,l)},listen(C){if(u)throw new Error("A history only accepts one active listener");return o.addEventListener(v2,p),u=C,()=>{o.removeEventListener(v2,p),u=null}},createHref(C){return t(o,C)},createURL:b,encodeLocation(C){let S=b(C);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:g,replace:y,go(C){return l.go(C)}};return v}function HA(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),sr(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Tp(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function TT(e,t,n="/"){return BA(e,t,n,!1)}function BA(e,t,n,r){let o=typeof t=="string"?Fd(t):t,i=pl(o.pathname||"/",n);if(i==null)return null;let l=MT(e);WA(l);let c=null;for(let u=0;c==null&&u<l.length;++u){let f=eF(i);c=ZA(l[u],f,r)}return c}function MT(e,t=[],n=[],r="",o=!1){let i=(l,c,u=o,f)=>{let h={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(r)&&u)return;sr(h.relativePath.startsWith(r),`Absolute route path "${h.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(r.length)}let p=cl([r,h.relativePath]),g=n.concat(h);l.children&&l.children.length>0&&(sr(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),MT(l.children,t,g,p,u)),!(l.path==null&&!l.index)&&t.push({path:p,score:YA(p,l.index),routesMeta:g})};return e.forEach((l,c)=>{var u;if(l.path===""||!((u=l.path)!=null&&u.includes("?")))i(l,c);else for(let f of RT(l.path))i(l,c,!0,f)}),t}function RT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let l=RT(r.join("/")),c=[];return c.push(...l.map(u=>u===""?i:[i,u].join("/"))),o&&c.push(...l),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function WA(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:XA(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var VA=/^:[\w-]+$/,GA=3,UA=2,qA=1,KA=10,QA=-2,w2=e=>e==="*";function YA(e,t){let n=e.split("/"),r=n.length;return n.some(w2)&&(r+=QA),t&&(r+=UA),n.filter(o=>!w2(o)).reduce((o,i)=>o+(VA.test(i)?GA:i===""?qA:KA),r)}function XA(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function ZA(e,t,n=!1){let{routesMeta:r}=e,o={},i="/",l=[];for(let c=0;c<r.length;++c){let u=r[c],f=c===r.length-1,h=i==="/"?t:t.slice(i.length)||"/",p=Hg({path:u.relativePath,caseSensitive:u.caseSensitive,end:f},h),g=u.route;if(!p&&f&&n&&!r[r.length-1].route.index&&(p=Hg({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!p)return null;Object.assign(o,p.params),l.push({params:o,pathname:cl([i,p.pathname]),pathnameBase:oF(cl([i,p.pathnameBase])),route:g}),p.pathnameBase!=="/"&&(i=cl([i,p.pathnameBase]))}return l}function Hg(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=JA(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],l=i.replace(/(.)\/+$/,"$1"),c=o.slice(1);return{params:r.reduce((f,{paramName:h,isOptional:p},g)=>{if(h==="*"){let b=c[g]||"";l=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const y=c[g];return p&&!y?f[h]=void 0:f[h]=(y||"").replace(/%2F/g,"/"),f},{}),pathname:i,pathnameBase:l,pattern:e}}function JA(e,t=!1,n=!0){cs(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,u)=>(r.push({paramName:c,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function eF(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return cs(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function pl(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var $T=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tF=e=>$T.test(e);function nF(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Fd(e):e,i;if(n)if(tF(n))i=n;else{if(n.includes("//")){let l=n;n=n.replace(/\/\/+/g,"/"),cs(!1,`Pathnames cannot have embedded double slashes - normalizing ${l} -> ${n}`)}n.startsWith("/")?i=S2(n.substring(1),"/"):i=S2(n,t)}else i=t;return{pathname:i,search:sF(r),hash:iF(o)}}function S2(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function av(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function rF(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function _C(e){let t=rF(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function HC(e,t,n,r=!1){let o;typeof e=="string"?o=Fd(e):(o={...e},sr(!o.pathname||!o.pathname.includes("?"),av("?","pathname","search",o)),sr(!o.pathname||!o.pathname.includes("#"),av("#","pathname","hash",o)),sr(!o.search||!o.search.includes("#"),av("#","search","hash",o)));let i=e===""||o.pathname==="",l=i?"/":o.pathname,c;if(l==null)c=n;else{let p=t.length-1;if(!r&&l.startsWith("..")){let g=l.split("/");for(;g[0]==="..";)g.shift(),p-=1;o.pathname=g.join("/")}c=p>=0?t[p]:"/"}let u=nF(o,c),f=l&&l!=="/"&&l.endsWith("/"),h=(i||l===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(f||h)&&(u.pathname+="/"),u}var cl=e=>e.join("/").replace(/\/\/+/g,"/"),oF=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),sF=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,iF=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,lF=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function aF(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function cF(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var OT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function zT(e,t){let n=e;if(typeof n!="string"||!$T.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,o=!1;if(OT)try{let i=new URL(window.location.href),l=n.startsWith("//")?new URL(i.protocol+n):new URL(n),c=pl(l.pathname,t);l.origin===i.origin&&c!=null?n=c+l.search+l.hash:o=!0}catch{cs(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:o,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var LT=["POST","PUT","PATCH","DELETE"];new Set(LT);var uF=["GET",...LT];new Set(uF);var Nd=m.createContext(null);Nd.displayName="DataRouter";var wx=m.createContext(null);wx.displayName="DataRouterState";var dF=m.createContext(!1),DT=m.createContext({isTransitioning:!1});DT.displayName="ViewTransition";var fF=m.createContext(new Map);fF.displayName="Fetchers";var pF=m.createContext(null);pF.displayName="Await";var hs=m.createContext(null);hs.displayName="Navigation";var lh=m.createContext(null);lh.displayName="Location";var Ns=m.createContext({outlet:null,matches:[],isDataRoute:!1});Ns.displayName="Route";var BC=m.createContext(null);BC.displayName="RouteError";var AT="REACT_ROUTER_ERROR",hF="REDIRECT",mF="ROUTE_ERROR_RESPONSE";function gF(e){if(e.startsWith(`${AT}:${hF}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function xF(e){if(e.startsWith(`${AT}:${mF}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new lF(t.status,t.statusText,t.data)}catch{}}function yF(e,{relative:t}={}){sr(_d(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=m.useContext(hs),{hash:o,pathname:i,search:l}=ah(e,{relative:t}),c=i;return n!=="/"&&(c=i==="/"?n:cl([n,i])),r.createHref({pathname:c,search:l,hash:o})}function _d(){return m.useContext(lh)!=null}function _i(){return sr(_d(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(lh).location}var FT="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function NT(e){m.useContext(hs).static||m.useLayoutEffect(e)}function Ko(){let{isDataRoute:e}=m.useContext(Ns);return e?OF():bF()}function bF(){sr(_d(),"useNavigate() may be used only in the context of a <Router> component.");let e=m.useContext(Nd),{basename:t,navigator:n}=m.useContext(hs),{matches:r}=m.useContext(Ns),{pathname:o}=_i(),i=JSON.stringify(_C(r)),l=m.useRef(!1);return NT(()=>{l.current=!0}),m.useCallback((u,f={})=>{if(cs(l.current,FT),!l.current)return;if(typeof u=="number"){n.go(u);return}let h=HC(u,JSON.parse(i),o,f.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:cl([t,h.pathname])),(f.replace?n.replace:n.push)(h,f.state,f)},[t,n,i,o,e])}var vF=m.createContext(null);function CF(e){let t=m.useContext(Ns).outlet;return m.useMemo(()=>t&&m.createElement(vF.Provider,{value:e},t),[t,e])}function Sx(){let{matches:e}=m.useContext(Ns),t=e[e.length-1];return t?t.params:{}}function ah(e,{relative:t}={}){let{matches:n}=m.useContext(Ns),{pathname:r}=_i(),o=JSON.stringify(_C(n));return m.useMemo(()=>HC(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function wF(e,t){return _T(e,t)}function _T(e,t,n,r,o){var j;sr(_d(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=m.useContext(hs),{matches:l}=m.useContext(Ns),c=l[l.length-1],u=c?c.params:{},f=c?c.pathname:"/",h=c?c.pathnameBase:"/",p=c&&c.route;{let w=p&&p.path||"";BT(f,!p||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
50
|
+
|
|
51
|
+
Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let g=_i(),y;if(t){let w=typeof t=="string"?Fd(t):t;sr(h==="/"||((j=w.pathname)==null?void 0:j.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${w.pathname}" was given in the \`location\` prop.`),y=w}else y=g;let b=y.pathname||"/",v=b;if(h!=="/"){let w=h.replace(/^\//,"").split("/");v="/"+b.replace(/^\//,"").split("/").slice(w.length).join("/")}let C=TT(e,{pathname:v});cs(p||C!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),cs(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=EF(C&&C.map(w=>Object.assign({},w,{params:Object.assign({},u,w.params),pathname:cl([h,i.encodeLocation?i.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?h:cl([h,i.encodeLocation?i.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),l,n,r,o);return t&&S?m.createElement(lh.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...y},navigationType:"POP"}},S):S}function SF(){let e=$F(),t=aF(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:i},"ErrorBoundary")," or"," ",m.createElement("code",{style:i},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:o},n):null,l)}var jF=m.createElement(SF,null),HT=class extends m.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=xF(e.digest);n&&(e=n)}let t=e!==void 0?m.createElement(Ns.Provider,{value:this.props.routeContext},m.createElement(BC.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?m.createElement(kF,{error:e},t):t}};HT.contextType=dF;var cv=new WeakMap;function kF({children:e,error:t}){let{basename:n}=m.useContext(hs);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=gF(t.digest);if(r){let o=cv.get(t);if(o)throw o;let i=zT(r.location,n);if(OT&&!cv.get(t))if(i.isExternal||r.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:r.replace}));throw cv.set(t,l),l}return m.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function IF({routeContext:e,match:t,children:n}){let r=m.useContext(Nd);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(Ns.Provider,{value:e},n)}function EF(e,t=[],n=null,r=null,o=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,l=n==null?void 0:n.errors;if(l!=null){let h=i.findIndex(p=>p.route.id&&(l==null?void 0:l[p.route.id])!==void 0);sr(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,h+1))}let c=!1,u=-1;if(n)for(let h=0;h<i.length;h++){let p=i[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=h),p.route.id){let{loaderData:g,errors:y}=n,b=p.route.loader&&!g.hasOwnProperty(p.route.id)&&(!y||y[p.route.id]===void 0);if(p.route.lazy||b){c=!0,u>=0?i=i.slice(0,u+1):i=[i[0]];break}}}let f=n&&r?(h,p)=>{var g,y;r(h,{location:n.location,params:((y=(g=n.matches)==null?void 0:g[0])==null?void 0:y.params)??{},unstable_pattern:cF(n.matches),errorInfo:p})}:void 0;return i.reduceRight((h,p,g)=>{let y,b=!1,v=null,C=null;n&&(y=l&&p.route.id?l[p.route.id]:void 0,v=p.route.errorElement||jF,c&&(u<0&&g===0?(BT("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,C=null):u===g&&(b=!0,C=p.route.hydrateFallbackElement||null)));let S=t.concat(i.slice(0,g+1)),j=()=>{let w;return y?w=v:b?w=C:p.route.Component?w=m.createElement(p.route.Component,null):p.route.element?w=p.route.element:w=h,m.createElement(IF,{match:p,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:w})};return n&&(p.route.ErrorBoundary||p.route.errorElement||g===0)?m.createElement(HT,{location:n.location,revalidation:n.revalidation,component:v,error:y,children:j(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:f}):j()},null)}function WC(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function PF(e){let t=m.useContext(Nd);return sr(t,WC(e)),t}function TF(e){let t=m.useContext(wx);return sr(t,WC(e)),t}function MF(e){let t=m.useContext(Ns);return sr(t,WC(e)),t}function VC(e){let t=MF(e),n=t.matches[t.matches.length-1];return sr(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function RF(){return VC("useRouteId")}function $F(){var r;let e=m.useContext(BC),t=TF("useRouteError"),n=VC("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function OF(){let{router:e}=PF("useNavigate"),t=VC("useNavigate"),n=m.useRef(!1);return NT(()=>{n.current=!0}),m.useCallback(async(o,i={})=>{cs(n.current,FT),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...i}))},[e,t])}var j2={};function BT(e,t,n){!t&&!j2[e]&&(j2[e]=!0,cs(!1,n))}m.memo(zF);function zF({routes:e,future:t,state:n,onError:r}){return _T(e,void 0,n,r,t)}function k2({to:e,replace:t,state:n,relative:r}){sr(_d(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=m.useContext(hs);cs(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=m.useContext(Ns),{pathname:l}=_i(),c=Ko(),u=HC(e,_C(i),l,r==="path"),f=JSON.stringify(u);return m.useEffect(()=>{c(JSON.parse(f),{replace:t,state:n,relative:r})},[c,f,r,t,n]),null}function LF(e){return CF(e.context)}function fo(e){sr(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function DF({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:i=!1,unstable_useTransitions:l}){sr(!_d(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:c,navigator:o,static:i,unstable_useTransitions:l,future:{}}),[c,o,i,l]);typeof n=="string"&&(n=Fd(n));let{pathname:f="/",search:h="",hash:p="",state:g=null,key:y="default"}=n,b=m.useMemo(()=>{let v=pl(f,c);return v==null?null:{location:{pathname:v,search:h,hash:p,state:g,key:y},navigationType:r}},[c,f,h,p,g,y,r]);return cs(b!=null,`<Router basename="${c}"> is not able to match the URL "${f}${h}${p}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:m.createElement(hs.Provider,{value:u},m.createElement(lh.Provider,{children:t,value:b}))}function AF({children:e,location:t}){return wF(T0(e),t)}function T0(e,t=[]){let n=[];return m.Children.forEach(e,(r,o)=>{if(!m.isValidElement(r))return;let i=[...t,o];if(r.type===m.Fragment){n.push.apply(n,T0(r.props.children,i));return}sr(r.type===fo,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),sr(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=T0(r.props.children,i)),n.push(l)}),n}var Cg="get",wg="application/x-www-form-urlencoded";function jx(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function FF(e){return jx(e)&&e.tagName.toLowerCase()==="button"}function NF(e){return jx(e)&&e.tagName.toLowerCase()==="form"}function _F(e){return jx(e)&&e.tagName.toLowerCase()==="input"}function HF(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function BF(e,t){return e.button===0&&(!t||t==="_self")&&!HF(e)}function M0(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function WF(e,t){let n=M0(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}var Bm=null;function VF(){if(Bm===null)try{new FormData(document.createElement("form"),0),Bm=!1}catch{Bm=!0}return Bm}var GF=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function uv(e){return e!=null&&!GF.has(e)?(cs(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${wg}"`),null):e}function UF(e,t){let n,r,o,i,l;if(NF(e)){let c=e.getAttribute("action");r=c?pl(c,t):null,n=e.getAttribute("method")||Cg,o=uv(e.getAttribute("enctype"))||wg,i=new FormData(e)}else if(FF(e)||_F(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||c.getAttribute("action");if(r=u?pl(u,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||Cg,o=uv(e.getAttribute("formenctype"))||uv(c.getAttribute("enctype"))||wg,i=new FormData(c,e),!VF()){let{name:f,type:h,value:p}=e;if(h==="image"){let g=f?`${f}.`:"";i.append(`${g}x`,"0"),i.append(`${g}y`,"0")}else f&&i.append(f,p)}}else{if(jx(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Cg,r=null,o=wg,l=e}return i&&o==="text/plain"&&(l=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function GC(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function qF(e,t,n,r){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${r}`:o.pathname=`${o.pathname}.${r}`:o.pathname==="/"?o.pathname=`_root.${r}`:t&&pl(o.pathname,t)==="/"?o.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${r}`,o}async function KF(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function QF(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function YF(e,t,n){let r=await Promise.all(e.map(async o=>{let i=t.routes[o.route.id];if(i){let l=await KF(i,n);return l.links?l.links():[]}return[]}));return e5(r.flat(1).filter(QF).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function I2(e,t,n,r,o,i){let l=(u,f)=>n[f]?u.route.id!==n[f].route.id:!0,c=(u,f)=>{var h;return n[f].pathname!==u.pathname||((h=n[f].route.path)==null?void 0:h.endsWith("*"))&&n[f].params["*"]!==u.params["*"]};return i==="assets"?t.filter((u,f)=>l(u,f)||c(u,f)):i==="data"?t.filter((u,f)=>{var p;let h=r.routes[u.route.id];if(!h||!h.hasLoader)return!1;if(l(u,f)||c(u,f))return!0;if(u.route.shouldRevalidate){let g=u.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function XF(e,t,{includeHydrateFallback:n}={}){return ZF(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let i=[o.module];return o.clientActionModule&&(i=i.concat(o.clientActionModule)),o.clientLoaderModule&&(i=i.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(i=i.concat(o.hydrateFallbackModule)),o.imports&&(i=i.concat(o.imports)),i}).flat(1))}function ZF(e){return[...new Set(e)]}function JF(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function e5(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let i=JSON.stringify(JF(o));return n.has(i)||(n.add(i),r.push({key:i,link:o})),r},[])}function WT(){let e=m.useContext(Nd);return GC(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function t5(){let e=m.useContext(wx);return GC(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var UC=m.createContext(void 0);UC.displayName="FrameworkContext";function VT(){let e=m.useContext(UC);return GC(e,"You must render this element inside a <HydratedRouter> element"),e}function n5(e,t){let n=m.useContext(UC),[r,o]=m.useState(!1),[i,l]=m.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:f,onMouseLeave:h,onTouchStart:p}=t,g=m.useRef(null);m.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let v=S=>{S.forEach(j=>{l(j.isIntersecting)})},C=new IntersectionObserver(v,{threshold:.5});return g.current&&C.observe(g.current),()=>{C.disconnect()}}},[e]),m.useEffect(()=>{if(r){let v=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(v)}}},[r]);let y=()=>{o(!0)},b=()=>{o(!1),l(!1)};return n?e!=="intent"?[i,g,{}]:[i,g,{onFocus:Ff(c,y),onBlur:Ff(u,b),onMouseEnter:Ff(f,y),onMouseLeave:Ff(h,b),onTouchStart:Ff(p,y)}]:[!1,g,{}]}function Ff(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function r5({page:e,...t}){let{router:n}=WT(),r=m.useMemo(()=>TT(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?m.createElement(s5,{page:e,matches:r,...t}):null}function o5(e){let{manifest:t,routeModules:n}=VT(),[r,o]=m.useState([]);return m.useEffect(()=>{let i=!1;return YF(e,t,n).then(l=>{i||o(l)}),()=>{i=!0}},[e,t,n]),r}function s5({page:e,matches:t,...n}){let r=_i(),{future:o,manifest:i,routeModules:l}=VT(),{basename:c}=WT(),{loaderData:u,matches:f}=t5(),h=m.useMemo(()=>I2(e,t,f,i,r,"data"),[e,t,f,i,r]),p=m.useMemo(()=>I2(e,t,f,i,r,"assets"),[e,t,f,i,r]),g=m.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let v=new Set,C=!1;if(t.forEach(j=>{var k;let w=i.routes[j.route.id];!w||!w.hasLoader||(!h.some(P=>P.route.id===j.route.id)&&j.route.id in u&&((k=l[j.route.id])!=null&&k.shouldRevalidate)||w.hasClientLoader?C=!0:v.add(j.route.id))}),v.size===0)return[];let S=qF(e,c,o.unstable_trailingSlashAwareDataRequests,"data");return C&&v.size>0&&S.searchParams.set("_routes",t.filter(j=>v.has(j.route.id)).map(j=>j.route.id).join(",")),[S.pathname+S.search]},[c,o.unstable_trailingSlashAwareDataRequests,u,r,i,h,t,e,l]),y=m.useMemo(()=>XF(p,i),[p,i]),b=o5(p);return m.createElement(m.Fragment,null,g.map(v=>m.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...n})),y.map(v=>m.createElement("link",{key:v,rel:"modulepreload",href:v,...n})),b.map(({key:v,link:C})=>m.createElement("link",{key:v,nonce:n.nonce,...C})))}function i5(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var l5=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{l5&&(window.__reactRouterVersion="7.12.0")}catch{}function a5({basename:e,children:t,unstable_useTransitions:n,window:r}){let o=m.useRef();o.current==null&&(o.current=FA({window:r,v5Compat:!0}));let i=o.current,[l,c]=m.useState({action:i.action,location:i.location}),u=m.useCallback(f=>{n===!1?c(f):m.startTransition(()=>c(f))},[n]);return m.useLayoutEffect(()=>i.listen(u),[i,u]),m.createElement(DF,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,unstable_useTransitions:n})}var GT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,UT=m.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:i,replace:l,state:c,target:u,to:f,preventScrollReset:h,viewTransition:p,unstable_defaultShouldRevalidate:g,...y},b){let{basename:v,unstable_useTransitions:C}=m.useContext(hs),S=typeof f=="string"&>.test(f),j=zT(f,v);f=j.to;let w=yF(f,{relative:o}),[k,P,T]=n5(r,y),$=d5(f,{replace:l,state:c,target:u,preventScrollReset:h,relative:o,viewTransition:p,unstable_defaultShouldRevalidate:g,unstable_useTransitions:C});function M(E){t&&t(E),E.defaultPrevented||$(E)}let R=m.createElement("a",{...y,...T,href:j.absoluteURL||w,onClick:j.isExternal||i?t:M,ref:i5(b,P),target:u,"data-discover":!S&&n==="render"?"true":void 0});return k&&!S?m.createElement(m.Fragment,null,R,m.createElement(r5,{page:w})):R});UT.displayName="Link";var R0=m.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:i,to:l,viewTransition:c,children:u,...f},h){let p=ah(l,{relative:f.relative}),g=_i(),y=m.useContext(wx),{navigator:b,basename:v}=m.useContext(hs),C=y!=null&&g5(p)&&c===!0,S=b.encodeLocation?b.encodeLocation(p).pathname:p.pathname,j=g.pathname,w=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(j=j.toLowerCase(),w=w?w.toLowerCase():null,S=S.toLowerCase()),w&&v&&(w=pl(w,v)||w);const k=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let P=j===S||!o&&j.startsWith(S)&&j.charAt(k)==="/",T=w!=null&&(w===S||!o&&w.startsWith(S)&&w.charAt(S.length)==="/"),$={isActive:P,isPending:T,isTransitioning:C},M=P?t:void 0,R;typeof r=="function"?R=r($):R=[r,P?"active":null,T?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let E=typeof i=="function"?i($):i;return m.createElement(UT,{...f,"aria-current":M,className:R,ref:h,style:E,to:l,viewTransition:c},typeof u=="function"?u($):u)});R0.displayName="NavLink";var c5=m.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:i,method:l=Cg,action:c,onSubmit:u,relative:f,preventScrollReset:h,viewTransition:p,unstable_defaultShouldRevalidate:g,...y},b)=>{let{unstable_useTransitions:v}=m.useContext(hs),C=h5(),S=m5(c,{relative:f}),j=l.toLowerCase()==="get"?"get":"post",w=typeof c=="string"&>.test(c),k=P=>{if(u&&u(P),P.defaultPrevented)return;P.preventDefault();let T=P.nativeEvent.submitter,$=(T==null?void 0:T.getAttribute("formmethod"))||l,M=()=>C(T||P.currentTarget,{fetcherKey:t,method:$,navigate:n,replace:o,state:i,relative:f,preventScrollReset:h,viewTransition:p,unstable_defaultShouldRevalidate:g});v&&n!==!1?m.startTransition(()=>M()):M()};return m.createElement("form",{ref:b,method:j,action:S,onSubmit:r?u:k,...y,"data-discover":!w&&e==="render"?"true":void 0})});c5.displayName="Form";function u5(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qT(e){let t=m.useContext(Nd);return sr(t,u5(e)),t}function d5(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:i,viewTransition:l,unstable_defaultShouldRevalidate:c,unstable_useTransitions:u}={}){let f=Ko(),h=_i(),p=ah(e,{relative:i});return m.useCallback(g=>{if(BF(g,t)){g.preventDefault();let y=n!==void 0?n:Tp(h)===Tp(p),b=()=>f(e,{replace:y,state:r,preventScrollReset:o,relative:i,viewTransition:l,unstable_defaultShouldRevalidate:c});u?m.startTransition(()=>b()):b()}},[h,f,p,n,r,t,e,o,i,l,c,u])}function kx(e){cs(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=m.useRef(M0(e)),n=m.useRef(!1),r=_i(),o=m.useMemo(()=>WF(r.search,n.current?null:t.current),[r.search]),i=Ko(),l=m.useCallback((c,u)=>{const f=M0(typeof c=="function"?c(new URLSearchParams(o)):c);n.current=!0,i("?"+f,u)},[i,o]);return[o,l]}var f5=0,p5=()=>`__${String(++f5)}__`;function h5(){let{router:e}=qT("useSubmit"),{basename:t}=m.useContext(hs),n=RF(),r=e.fetch,o=e.navigate;return m.useCallback(async(i,l={})=>{let{action:c,method:u,encType:f,formData:h,body:p}=UF(i,t);if(l.navigate===!1){let g=l.fetcherKey||p5();await r(g,n,l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:h,body:p,formMethod:l.method||u,formEncType:l.encType||f,flushSync:l.flushSync})}else await o(l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:h,body:p,formMethod:l.method||u,formEncType:l.encType||f,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,o,t,n])}function m5(e,{relative:t}={}){let{basename:n}=m.useContext(hs),r=m.useContext(Ns);sr(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),i={...ah(e||".",{relative:t})},l=_i();if(e==null){i.search=l.search;let c=new URLSearchParams(i.search),u=c.getAll("index");if(u.some(h=>h==="")){c.delete("index"),u.filter(p=>p).forEach(p=>c.append("index",p));let h=c.toString();i.search=h?`?${h}`:""}}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:cl([n,i.pathname])),Tp(i)}function g5(e,{relative:t}={}){let n=m.useContext(DT);sr(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=qT("useViewTransitionState"),o=ah(e,{relative:t});if(!n.isTransitioning)return!1;let i=pl(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=pl(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Hg(o.pathname,l)!=null||Hg(o.pathname,i)!=null}var qC=xT();const Wm=Ld(qC);function hl(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}const Ti="$$material";function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},q.apply(null,arguments)}function x5(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function y5(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var b5=(function(){function e(n){var r=this;this._insertTag=function(o){var i;r.tags.length===0?r.insertionPoint?i=r.insertionPoint.nextSibling:r.prepend?i=r.container.firstChild:i=r.before:i=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(o,i),r.tags.push(o)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(y5(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var i=x5(o);try{i.insertRule(r,i.cssRules.length)}catch{}}else o.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var o;return(o=r.parentNode)==null?void 0:o.removeChild(r)}),this.tags=[],this.ctr=0},e})(),po="-ms-",Bg="-moz-",jn="-webkit-",KT="comm",KC="rule",QC="decl",v5="@import",QT="@keyframes",C5="@layer",w5=Math.abs,Ix=String.fromCharCode,S5=Object.assign;function j5(e,t){return no(e,0)^45?(((t<<2^no(e,0))<<2^no(e,1))<<2^no(e,2))<<2^no(e,3):0}function YT(e){return e.trim()}function k5(e,t){return(e=t.exec(e))?e[0]:e}function In(e,t,n){return e.replace(t,n)}function $0(e,t){return e.indexOf(t)}function no(e,t){return e.charCodeAt(t)|0}function Mp(e,t,n){return e.slice(t,n)}function ki(e){return e.length}function YC(e){return e.length}function Vm(e,t){return t.push(e),e}function I5(e,t){return e.map(t).join("")}var Ex=1,fd=1,XT=0,Go=0,Er=0,Hd="";function Px(e,t,n,r,o,i,l){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:Ex,column:fd,length:l,return:""}}function Nf(e,t){return S5(Px("",null,null,"",null,null,0),e,{length:-e.length},t)}function E5(){return Er}function P5(){return Er=Go>0?no(Hd,--Go):0,fd--,Er===10&&(fd=1,Ex--),Er}function ls(){return Er=Go<XT?no(Hd,Go++):0,fd++,Er===10&&(fd=1,Ex++),Er}function Mi(){return no(Hd,Go)}function Sg(){return Go}function ch(e,t){return Mp(Hd,e,t)}function Rp(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ZT(e){return Ex=fd=1,XT=ki(Hd=e),Go=0,[]}function JT(e){return Hd="",e}function jg(e){return YT(ch(Go-1,O0(e===91?e+2:e===40?e+1:e)))}function T5(e){for(;(Er=Mi())&&Er<33;)ls();return Rp(e)>2||Rp(Er)>3?"":" "}function M5(e,t){for(;--t&&ls()&&!(Er<48||Er>102||Er>57&&Er<65||Er>70&&Er<97););return ch(e,Sg()+(t<6&&Mi()==32&&ls()==32))}function O0(e){for(;ls();)switch(Er){case e:return Go;case 34:case 39:e!==34&&e!==39&&O0(Er);break;case 40:e===41&&O0(e);break;case 92:ls();break}return Go}function R5(e,t){for(;ls()&&e+Er!==57;)if(e+Er===84&&Mi()===47)break;return"/*"+ch(t,Go-1)+"*"+Ix(e===47?e:ls())}function $5(e){for(;!Rp(Mi());)ls();return ch(e,Go)}function O5(e){return JT(kg("",null,null,null,[""],e=ZT(e),0,[0],e))}function kg(e,t,n,r,o,i,l,c,u){for(var f=0,h=0,p=l,g=0,y=0,b=0,v=1,C=1,S=1,j=0,w="",k=o,P=i,T=r,$=w;C;)switch(b=j,j=ls()){case 40:if(b!=108&&no($,p-1)==58){$0($+=In(jg(j),"&","&\f"),"&\f")!=-1&&(S=-1);break}case 34:case 39:case 91:$+=jg(j);break;case 9:case 10:case 13:case 32:$+=T5(b);break;case 92:$+=M5(Sg()-1,7);continue;case 47:switch(Mi()){case 42:case 47:Vm(z5(R5(ls(),Sg()),t,n),u);break;default:$+="/"}break;case 123*v:c[f++]=ki($)*S;case 125*v:case 59:case 0:switch(j){case 0:case 125:C=0;case 59+h:S==-1&&($=In($,/\f/g,"")),y>0&&ki($)-p&&Vm(y>32?P2($+";",r,n,p-1):P2(In($," ","")+";",r,n,p-2),u);break;case 59:$+=";";default:if(Vm(T=E2($,t,n,f,h,o,c,w,k=[],P=[],p),i),j===123)if(h===0)kg($,t,T,T,k,i,p,c,P);else switch(g===99&&no($,3)===110?100:g){case 100:case 108:case 109:case 115:kg(e,T,T,r&&Vm(E2(e,T,T,0,0,o,c,w,o,k=[],p),P),o,P,p,c,r?k:P);break;default:kg($,T,T,T,[""],P,0,c,P)}}f=h=y=0,v=S=1,w=$="",p=l;break;case 58:p=1+ki($),y=b;default:if(v<1){if(j==123)--v;else if(j==125&&v++==0&&P5()==125)continue}switch($+=Ix(j),j*v){case 38:S=h>0?1:($+="\f",-1);break;case 44:c[f++]=(ki($)-1)*S,S=1;break;case 64:Mi()===45&&($+=jg(ls())),g=Mi(),h=p=ki(w=$+=$5(Sg())),j++;break;case 45:b===45&&ki($)==2&&(v=0)}}return i}function E2(e,t,n,r,o,i,l,c,u,f,h){for(var p=o-1,g=o===0?i:[""],y=YC(g),b=0,v=0,C=0;b<r;++b)for(var S=0,j=Mp(e,p+1,p=w5(v=l[b])),w=e;S<y;++S)(w=YT(v>0?g[S]+" "+j:In(j,/&\f/g,g[S])))&&(u[C++]=w);return Px(e,t,n,o===0?KC:c,u,f,h)}function z5(e,t,n){return Px(e,t,n,KT,Ix(E5()),Mp(e,2,-2),0)}function P2(e,t,n,r){return Px(e,t,n,QC,Mp(e,0,r),Mp(e,r+1,-1),r)}function Qu(e,t){for(var n="",r=YC(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function L5(e,t,n,r){switch(e.type){case C5:if(e.children.length)break;case v5:case QC:return e.return=e.return||e.value;case KT:return"";case QT:return e.return=e.value+"{"+Qu(e.children,r)+"}";case KC:e.value=e.props.join(",")}return ki(n=Qu(e.children,r))?e.return=e.value+"{"+n+"}":""}function D5(e){var t=YC(e);return function(n,r,o,i){for(var l="",c=0;c<t;c++)l+=e[c](n,r,o,i)||"";return l}}function A5(e){return function(t){t.root||(t=t.return)&&e(t)}}function eM(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var F5=function(t,n,r){for(var o=0,i=0;o=i,i=Mi(),o===38&&i===12&&(n[r]=1),!Rp(i);)ls();return ch(t,Go)},N5=function(t,n){var r=-1,o=44;do switch(Rp(o)){case 0:o===38&&Mi()===12&&(n[r]=1),t[r]+=F5(Go-1,n,r);break;case 2:t[r]+=jg(o);break;case 4:if(o===44){t[++r]=Mi()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Ix(o)}while(o=ls());return t},_5=function(t,n){return JT(N5(ZT(t),n))},T2=new WeakMap,H5=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,o=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!T2.get(r))&&!o){T2.set(t,!0);for(var i=[],l=_5(n,i),c=r.props,u=0,f=0;u<l.length;u++)for(var h=0;h<c.length;h++,f++)t.props[f]=i[u]?l[u].replace(/&\f/g,c[h]):c[h]+" "+l[u]}}},B5=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function tM(e,t){switch(j5(e,t)){case 5103:return jn+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return jn+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return jn+e+Bg+e+po+e+e;case 6828:case 4268:return jn+e+po+e+e;case 6165:return jn+e+po+"flex-"+e+e;case 5187:return jn+e+In(e,/(\w+).+(:[^]+)/,jn+"box-$1$2"+po+"flex-$1$2")+e;case 5443:return jn+e+po+"flex-item-"+In(e,/flex-|-self/,"")+e;case 4675:return jn+e+po+"flex-line-pack"+In(e,/align-content|flex-|-self/,"")+e;case 5548:return jn+e+po+In(e,"shrink","negative")+e;case 5292:return jn+e+po+In(e,"basis","preferred-size")+e;case 6060:return jn+"box-"+In(e,"-grow","")+jn+e+po+In(e,"grow","positive")+e;case 4554:return jn+In(e,/([^-])(transform)/g,"$1"+jn+"$2")+e;case 6187:return In(In(In(e,/(zoom-|grab)/,jn+"$1"),/(image-set)/,jn+"$1"),e,"")+e;case 5495:case 3959:return In(e,/(image-set\([^]*)/,jn+"$1$`$1");case 4968:return In(In(e,/(.+:)(flex-)?(.*)/,jn+"box-pack:$3"+po+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+jn+e+e;case 4095:case 3583:case 4068:case 2532:return In(e,/(.+)-inline(.+)/,jn+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ki(e)-1-t>6)switch(no(e,t+1)){case 109:if(no(e,t+4)!==45)break;case 102:return In(e,/(.+:)(.+)-([^]+)/,"$1"+jn+"$2-$3$1"+Bg+(no(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~$0(e,"stretch")?tM(In(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(no(e,t+1)!==115)break;case 6444:switch(no(e,ki(e)-3-(~$0(e,"!important")&&10))){case 107:return In(e,":",":"+jn)+e;case 101:return In(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+jn+(no(e,14)===45?"inline-":"")+"box$3$1"+jn+"$2$3$1"+po+"$2box$3")+e}break;case 5936:switch(no(e,t+11)){case 114:return jn+e+po+In(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return jn+e+po+In(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return jn+e+po+In(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return jn+e+po+e+e}return e}var W5=function(t,n,r,o){if(t.length>-1&&!t.return)switch(t.type){case QC:t.return=tM(t.value,t.length);break;case QT:return Qu([Nf(t,{value:In(t.value,"@","@"+jn)})],o);case KC:if(t.length)return I5(t.props,function(i){switch(k5(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Qu([Nf(t,{props:[In(i,/:(read-\w+)/,":"+Bg+"$1")]})],o);case"::placeholder":return Qu([Nf(t,{props:[In(i,/:(plac\w+)/,":"+jn+"input-$1")]}),Nf(t,{props:[In(i,/:(plac\w+)/,":"+Bg+"$1")]}),Nf(t,{props:[In(i,/:(plac\w+)/,po+"input-$1")]})],o)}return""})}},V5=[W5],G5=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(v){var C=v.getAttribute("data-emotion");C.indexOf(" ")!==-1&&(document.head.appendChild(v),v.setAttribute("data-s",""))})}var o=t.stylisPlugins||V5,i={},l,c=[];l=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(v){for(var C=v.getAttribute("data-emotion").split(" "),S=1;S<C.length;S++)i[C[S]]=!0;c.push(v)});var u,f=[H5,B5];{var h,p=[L5,A5(function(v){h.insert(v)})],g=D5(f.concat(o,p)),y=function(C){return Qu(O5(C),g)};u=function(C,S,j,w){h=j,y(C?C+"{"+S.styles+"}":S.styles),w&&(b.inserted[S.name]=!0)}}var b={key:n,sheet:new b5({key:n,container:l,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:u};return b.sheet.hydrate(c),b},dv={exports:{}},Tn={};/** @license React v16.13.1
|
|
52
|
+
* react-is.production.min.js
|
|
53
|
+
*
|
|
54
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
55
|
+
*
|
|
56
|
+
* This source code is licensed under the MIT license found in the
|
|
57
|
+
* LICENSE file in the root directory of this source tree.
|
|
58
|
+
*/var M2;function U5(){if(M2)return Tn;M2=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,g=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,C=e?Symbol.for("react.fundamental"):60117,S=e?Symbol.for("react.responder"):60118,j=e?Symbol.for("react.scope"):60119;function w(P){if(typeof P=="object"&&P!==null){var T=P.$$typeof;switch(T){case t:switch(P=P.type,P){case u:case f:case r:case i:case o:case p:return P;default:switch(P=P&&P.$$typeof,P){case c:case h:case b:case y:case l:return P;default:return T}}case n:return T}}}function k(P){return w(P)===f}return Tn.AsyncMode=u,Tn.ConcurrentMode=f,Tn.ContextConsumer=c,Tn.ContextProvider=l,Tn.Element=t,Tn.ForwardRef=h,Tn.Fragment=r,Tn.Lazy=b,Tn.Memo=y,Tn.Portal=n,Tn.Profiler=i,Tn.StrictMode=o,Tn.Suspense=p,Tn.isAsyncMode=function(P){return k(P)||w(P)===u},Tn.isConcurrentMode=k,Tn.isContextConsumer=function(P){return w(P)===c},Tn.isContextProvider=function(P){return w(P)===l},Tn.isElement=function(P){return typeof P=="object"&&P!==null&&P.$$typeof===t},Tn.isForwardRef=function(P){return w(P)===h},Tn.isFragment=function(P){return w(P)===r},Tn.isLazy=function(P){return w(P)===b},Tn.isMemo=function(P){return w(P)===y},Tn.isPortal=function(P){return w(P)===n},Tn.isProfiler=function(P){return w(P)===i},Tn.isStrictMode=function(P){return w(P)===o},Tn.isSuspense=function(P){return w(P)===p},Tn.isValidElementType=function(P){return typeof P=="string"||typeof P=="function"||P===r||P===f||P===i||P===o||P===p||P===g||typeof P=="object"&&P!==null&&(P.$$typeof===b||P.$$typeof===y||P.$$typeof===l||P.$$typeof===c||P.$$typeof===h||P.$$typeof===C||P.$$typeof===S||P.$$typeof===j||P.$$typeof===v)},Tn.typeOf=w,Tn}var R2;function q5(){return R2||(R2=1,dv.exports=U5()),dv.exports}var fv,$2;function K5(){if($2)return fv;$2=1;var e=q5(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};i[e.ForwardRef]=r,i[e.Memo]=o;function l(b){return e.isMemo(b)?o:i[b.$$typeof]||t}var c=Object.defineProperty,u=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,g=Object.prototype;function y(b,v,C){if(typeof v!="string"){if(g){var S=p(v);S&&S!==g&&y(b,S,C)}var j=u(v);f&&(j=j.concat(f(v)));for(var w=l(b),k=l(v),P=0;P<j.length;++P){var T=j[P];if(!n[T]&&!(C&&C[T])&&!(k&&k[T])&&!(w&&w[T])){var $=h(v,T);try{c(b,T,$)}catch{}}}}return b}return fv=y,fv}K5();var Q5=!0;function nM(e,t,n){var r="";return n.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):o&&(r+=o+" ")}),r}var XC=function(t,n,r){var o=t.key+"-"+n.name;(r===!1||Q5===!1)&&t.registered[o]===void 0&&(t.registered[o]=n.styles)},ZC=function(t,n,r){XC(t,n,r);var o=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var i=n;do t.insert(n===i?"."+o:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function Y5(e){for(var t=0,n,r=0,o=e.length;o>=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var X5={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Z5=/[A-Z]|^ms/g,J5=/_EMO_([^_]+?)_([^]*?)_EMO_/g,rM=function(t){return t.charCodeAt(1)===45},O2=function(t){return t!=null&&typeof t!="boolean"},pv=eM(function(e){return rM(e)?e:e.replace(Z5,"-$&").toLowerCase()}),z2=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(J5,function(r,o,i){return Ii={name:o,styles:i,next:Ii},o})}return X5[t]!==1&&!rM(t)&&typeof n=="number"&&n!==0?n+"px":n};function $p(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var o=n;if(o.anim===1)return Ii={name:o.name,styles:o.styles,next:Ii},o.name;var i=n;if(i.styles!==void 0){var l=i.next;if(l!==void 0)for(;l!==void 0;)Ii={name:l.name,styles:l.styles,next:Ii},l=l.next;var c=i.styles+";";return c}return eN(e,t,n)}case"function":{if(e!==void 0){var u=Ii,f=n(e);return Ii=u,$p(e,t,f)}break}}var h=n;if(t==null)return h;var p=t[h];return p!==void 0?p:h}function eN(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=$p(e,t,n[o])+";";else for(var i in n){var l=n[i];if(typeof l!="object"){var c=l;t!=null&&t[c]!==void 0?r+=i+"{"+t[c]+"}":O2(c)&&(r+=pv(i)+":"+z2(i,c)+";")}else if(Array.isArray(l)&&typeof l[0]=="string"&&(t==null||t[l[0]]===void 0))for(var u=0;u<l.length;u++)O2(l[u])&&(r+=pv(i)+":"+z2(i,l[u])+";");else{var f=$p(e,t,l);switch(i){case"animation":case"animationName":{r+=pv(i)+":"+f+";";break}default:r+=i+"{"+f+"}"}}}return r}var L2=/label:\s*([^\s;{]+)\s*(;|$)/g,Ii;function uh(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,o="";Ii=void 0;var i=e[0];if(i==null||i.raw===void 0)r=!1,o+=$p(n,t,i);else{var l=i;o+=l[0]}for(var c=1;c<e.length;c++)if(o+=$p(n,t,e[c]),r){var u=i;o+=u[c]}L2.lastIndex=0;for(var f="",h;(h=L2.exec(o))!==null;)f+="-"+h[1];var p=Y5(o)+f;return{name:p,styles:o,next:Ii}}var tN=function(t){return t()},oM=p0.useInsertionEffect?p0.useInsertionEffect:!1,sM=oM||tN,D2=oM||m.useLayoutEffect,iM=m.createContext(typeof HTMLElement<"u"?G5({key:"css"}):null);iM.Provider;var JC=function(t){return m.forwardRef(function(n,r){var o=m.useContext(iM);return t(n,o,r)})},dh=m.createContext({}),ew={}.hasOwnProperty,z0="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",nN=function(t,n){var r={};for(var o in n)ew.call(n,o)&&(r[o]=n[o]);return r[z0]=t,r},rN=function(t){var n=t.cache,r=t.serialized,o=t.isStringTag;return XC(n,r,o),sM(function(){return ZC(n,r,o)}),null},oN=JC(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var o=e[z0],i=[r],l="";typeof e.className=="string"?l=nM(t.registered,i,e.className):e.className!=null&&(l=e.className+" ");var c=uh(i,void 0,m.useContext(dh));l+=t.key+"-"+c.name;var u={};for(var f in e)ew.call(e,f)&&f!=="css"&&f!==z0&&(u[f]=e[f]);return u.className=l,n&&(u.ref=n),m.createElement(m.Fragment,null,m.createElement(rN,{cache:t,serialized:c,isStringTag:typeof o=="string"}),m.createElement(o,u))}),sN=oN,A2=function(t,n){var r=arguments;if(n==null||!ew.call(n,"css"))return m.createElement.apply(void 0,r);var o=r.length,i=new Array(o);i[0]=sN,i[1]=nN(t,n);for(var l=2;l<o;l++)i[l]=r[l];return m.createElement.apply(null,i)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(A2||(A2={}));var iN=JC(function(e,t){var n=e.styles,r=uh([n],void 0,m.useContext(dh)),o=m.useRef();return D2(function(){var i=t.key+"-global",l=new t.sheet.constructor({key:i,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),c=!1,u=document.querySelector('style[data-emotion="'+i+" "+r.name+'"]');return t.sheet.tags.length&&(l.before=t.sheet.tags[0]),u!==null&&(c=!0,u.setAttribute("data-emotion",i),l.hydrate([u])),o.current=[l,c],function(){l.flush()}},[t]),D2(function(){var i=o.current,l=i[0],c=i[1];if(c){i[1]=!1;return}if(r.next!==void 0&&ZC(t,r.next,!0),l.tags.length){var u=l.tags[l.tags.length-1].nextElementSibling;l.before=u,l.flush()}t.insert("",r,l,!1)},[t,r.name]),null});function La(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return uh(t)}function Hi(){var e=La.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var lN=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|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|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|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|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,aN=eM(function(e){return lN.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),cN=aN,uN=function(t){return t!=="theme"},F2=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?cN:uN},N2=function(t,n,r){var o;if(n){var i=n.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(l){return t.__emotion_forwardProp(l)&&i(l)}:i}return typeof o!="function"&&r&&(o=t.__emotion_forwardProp),o},dN=function(t){var n=t.cache,r=t.serialized,o=t.isStringTag;return XC(n,r,o),sM(function(){return ZC(n,r,o)}),null},fN=function e(t,n){var r=t.__emotion_real===t,o=r&&t.__emotion_base||t,i,l;n!==void 0&&(i=n.label,l=n.target);var c=N2(t,n,r),u=c||F2(o),f=!u("as");return function(){var h=arguments,p=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&p.push("label:"+i+";"),h[0]==null||h[0].raw===void 0)p.push.apply(p,h);else{var g=h[0];p.push(g[0]);for(var y=h.length,b=1;b<y;b++)p.push(h[b],g[b])}var v=JC(function(C,S,j){var w=f&&C.as||o,k="",P=[],T=C;if(C.theme==null){T={};for(var $ in C)T[$]=C[$];T.theme=m.useContext(dh)}typeof C.className=="string"?k=nM(S.registered,P,C.className):C.className!=null&&(k=C.className+" ");var M=uh(p.concat(P),S.registered,T);k+=S.key+"-"+M.name,l!==void 0&&(k+=" "+l);var R=f&&c===void 0?F2(w):u,E={};for(var O in C)f&&O==="as"||R(O)&&(E[O]=C[O]);return E.className=k,j&&(E.ref=j),m.createElement(m.Fragment,null,m.createElement(dN,{cache:S,serialized:M,isStringTag:typeof w=="string"}),m.createElement(w,E))});return v.displayName=i!==void 0?i:"Styled("+(typeof o=="string"?o:o.displayName||o.name||"Component")+")",v.defaultProps=t.defaultProps,v.__emotion_real=v,v.__emotion_base=o,v.__emotion_styles=p,v.__emotion_forwardProp=c,Object.defineProperty(v,"toString",{value:function(){return"."+l}}),v.withComponent=function(C,S){var j=e(C,q({},n,S,{shouldForwardProp:N2(v,S,!0)}));return j.apply(void 0,p)},v}},pN=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],L0=fN.bind(null);pN.forEach(function(e){L0[e]=L0(e)});var hv={exports:{}},mv,_2;function hN(){if(_2)return mv;_2=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return mv=e,mv}var gv,H2;function mN(){if(H2)return gv;H2=1;var e=hN();function t(){}function n(){}return n.resetWarningCache=t,gv=function(){function r(l,c,u,f,h,p){if(p!==e){var g=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 g.name="Invariant Violation",g}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},gv}var B2;function gN(){return B2||(B2=1,hv.exports=mN()()),hv.exports}var xN=gN();const ve=Ld(xN);function yN(e){return e==null||Object.keys(e).length===0}function lM(e){const{styles:t,defaultTheme:n={}}=e,r=typeof t=="function"?o=>t(yN(o)?n:o):t;return s.jsx(iN,{styles:r})}/**
|
|
59
|
+
* @mui/styled-engine v6.5.0
|
|
60
|
+
*
|
|
61
|
+
* @license MIT
|
|
62
|
+
* This source code is licensed under the MIT license found in the
|
|
63
|
+
* LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/function aM(e,t){return L0(e,t)}function bN(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const W2=[];function ba(e){return W2[0]=e,uh(W2)}var xv={exports:{}},Nn={};/**
|
|
65
|
+
* @license React
|
|
66
|
+
* react-is.production.js
|
|
67
|
+
*
|
|
68
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the MIT license found in the
|
|
71
|
+
* LICENSE file in the root directory of this source tree.
|
|
72
|
+
*/var V2;function vN(){if(V2)return Nn;V2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.view_transition"),y=Symbol.for("react.client.reference");function b(v){if(typeof v=="object"&&v!==null){var C=v.$$typeof;switch(C){case e:switch(v=v.type,v){case n:case o:case r:case u:case f:case g:return v;default:switch(v=v&&v.$$typeof,v){case l:case c:case p:case h:return v;case i:return v;default:return C}}case t:return C}}}return Nn.ContextConsumer=i,Nn.ContextProvider=l,Nn.Element=e,Nn.ForwardRef=c,Nn.Fragment=n,Nn.Lazy=p,Nn.Memo=h,Nn.Portal=t,Nn.Profiler=o,Nn.StrictMode=r,Nn.Suspense=u,Nn.SuspenseList=f,Nn.isContextConsumer=function(v){return b(v)===i},Nn.isContextProvider=function(v){return b(v)===l},Nn.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},Nn.isForwardRef=function(v){return b(v)===c},Nn.isFragment=function(v){return b(v)===n},Nn.isLazy=function(v){return b(v)===p},Nn.isMemo=function(v){return b(v)===h},Nn.isPortal=function(v){return b(v)===t},Nn.isProfiler=function(v){return b(v)===o},Nn.isStrictMode=function(v){return b(v)===r},Nn.isSuspense=function(v){return b(v)===u},Nn.isSuspenseList=function(v){return b(v)===f},Nn.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===n||v===o||v===r||v===u||v===f||typeof v=="object"&&v!==null&&(v.$$typeof===p||v.$$typeof===h||v.$$typeof===l||v.$$typeof===i||v.$$typeof===c||v.$$typeof===y||v.getModuleId!==void 0)},Nn.typeOf=b,Nn}var G2;function CN(){return G2||(G2=1,xv.exports=vN()),xv.exports}var cM=CN();function Pi(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function uM(e){if(m.isValidElement(e)||cM.isValidElementType(e)||!Pi(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=uM(e[n])}),t}function qr(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return Pi(e)&&Pi(t)&&Object.keys(t).forEach(o=>{m.isValidElement(t[o])||cM.isValidElementType(t[o])?r[o]=t[o]:Pi(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&Pi(e[o])?r[o]=qr(e[o],t[o],n):n.clone?r[o]=Pi(t[o])?uM(t[o]):t[o]:r[o]=t[o]}),r}const wN=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function SN(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...o}=e,i=wN(t),l=Object.keys(i);function c(g){return`@media (min-width:${typeof t[g]=="number"?t[g]:g}${n})`}function u(g){return`@media (max-width:${(typeof t[g]=="number"?t[g]:g)-r/100}${n})`}function f(g,y){const b=l.indexOf(y);return`@media (min-width:${typeof t[g]=="number"?t[g]:g}${n}) and (max-width:${(b!==-1&&typeof t[l[b]]=="number"?t[l[b]]:y)-r/100}${n})`}function h(g){return l.indexOf(g)+1<l.length?f(g,l[l.indexOf(g)+1]):c(g)}function p(g){const y=l.indexOf(g);return y===0?c(l[1]):y===l.length-1?u(l[y]):f(g,l[l.indexOf(g)+1]).replace("@media","@media not all and")}return{keys:l,values:i,up:c,down:u,between:f,only:h,not:p,unit:n,...o}}function U2(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,o)=>{var l,c;const i=/min-width:\s*([0-9.]+)/;return+(((l=r.match(i))==null?void 0:l[1])||0)-+(((c=o.match(i))==null?void 0:c[1])||0)});return n.length?n.reduce((r,o)=>{const i=t[o];return delete r[o],r[o]=i,r},{...t}):t}function jN(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function kN(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,o]=n,i=Number.isNaN(+r)?r||0:+r;return e.containerQueries(o).up(i)}function IN(e){const t=(i,l)=>i.replace("@media",l?`@container ${l}`:"@container");function n(i,l){i.up=(...c)=>t(e.breakpoints.up(...c),l),i.down=(...c)=>t(e.breakpoints.down(...c),l),i.between=(...c)=>t(e.breakpoints.between(...c),l),i.only=(...c)=>t(e.breakpoints.only(...c),l),i.not=(...c)=>{const u=t(e.breakpoints.not(...c),l);return u.includes("not all and")?u.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):u}}const r={},o=i=>(n(r,i),r);return n(o),{...e,containerQueries:o}}const EN={borderRadius:4};function xp(e,t){return t?qr(e,t,{clone:!1}):e}const Tx={xs:0,sm:600,md:900,lg:1200,xl:1536},q2={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Tx[e]}px)`},PN={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:Tx[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function Uo(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const i=r.breakpoints||q2;return t.reduce((l,c,u)=>(l[i.up(i.keys[u])]=n(t[u]),l),{})}if(typeof t=="object"){const i=r.breakpoints||q2;return Object.keys(t).reduce((l,c)=>{if(jN(i.keys,c)){const u=kN(r.containerQueries?r:PN,c);u&&(l[u]=n(t[c],c))}else if(Object.keys(i.values||Tx).includes(c)){const u=i.up(c);l[u]=n(t[c],c)}else{const u=c;l[u]=t[u]}return l},{})}return n(t)}function dM(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((r,o)=>{const i=e.up(o);return r[i]={},r},{}))||{}}function D0(e,t){return e.reduce((n,r)=>{const o=n[r];return(!o||Object.keys(o).length===0)&&delete n[r],n},t)}function TN(e,...t){const n=dM(e),r=[n,...t].reduce((o,i)=>qr(o,i),{});return D0(Object.keys(n),r)}function MN(e,t){if(typeof e!="object")return{};const n={},r=Object.keys(t);return Array.isArray(e)?r.forEach((o,i)=>{i<e.length&&(n[o]=!0)}):r.forEach(o=>{e[o]!=null&&(n[o]=!0)}),n}function kc({values:e,breakpoints:t,base:n}){const r=n||MN(e,t),o=Object.keys(r);if(o.length===0)return e;let i;return o.reduce((l,c,u)=>(Array.isArray(e)?(l[c]=e[u]!=null?e[u]:e[i],i=u):typeof e=="object"?(l[c]=e[c]!=null?e[c]:e[i],i=c):l[c]=e,l),{})}function Pe(e){if(typeof e!="string")throw new Error(hl(7));return e.charAt(0).toUpperCase()+e.slice(1)}function xa(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((o,i)=>o&&o[i]?o[i]:null,e);if(r!=null)return r}return t.split(".").reduce((r,o)=>r&&r[o]!=null?r[o]:null,e)}function Wg(e,t,n,r=n){let o;return typeof e=="function"?o=e(n):Array.isArray(e)?o=e[n]||r:o=xa(e,n)||r,t&&(o=t(o,r,e)),o}function jr(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:o}=e,i=l=>{if(l[t]==null)return null;const c=l[t],u=l.theme,f=xa(u,r)||{};return Uo(l,c,p=>{let g=Wg(f,o,p);return p===g&&typeof p=="string"&&(g=Wg(f,o,`${t}${p==="default"?"":Pe(p)}`,p)),n===!1?g:{[n]:g}})};return i.propTypes={},i.filterProps=[t],i}function RN(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const $N={m:"margin",p:"padding"},ON={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},K2={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},zN=RN(e=>{if(e.length>2)if(K2[e])e=K2[e];else return[e];const[t,n]=e.split(""),r=$N[t],o=ON[n]||"";return Array.isArray(o)?o.map(i=>r+i):[r+o]}),tw=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],nw=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...tw,...nw];function fh(e,t,n,r){const o=xa(e,t,!0)??n;return typeof o=="number"||typeof o=="string"?i=>typeof i=="string"?i:typeof o=="string"?`calc(${i} * ${o})`:o*i:Array.isArray(o)?i=>{if(typeof i=="string")return i;const l=Math.abs(i),c=o[l];return i>=0?c:typeof c=="number"?-c:`-${c}`}:typeof o=="function"?o:()=>{}}function Mx(e){return fh(e,"spacing",8)}function $c(e,t){return typeof t=="string"||t==null?t:e(t)}function LN(e,t){return n=>e.reduce((r,o)=>(r[o]=$c(t,n),r),{})}function DN(e,t,n,r){if(!t.includes(n))return null;const o=zN(n),i=LN(o,r),l=e[n];return Uo(e,l,i)}function fM(e,t){const n=Mx(e.theme);return Object.keys(e).map(r=>DN(e,t,r,n)).reduce(xp,{})}function mr(e){return fM(e,tw)}mr.propTypes={};mr.filterProps=tw;function gr(e){return fM(e,nw)}gr.propTypes={};gr.filterProps=nw;function pM(e=8,t=Mx({spacing:e})){if(e.mui)return e;const n=(...r)=>(r.length===0?[1]:r).map(i=>{const l=t(i);return typeof l=="number"?`${l}px`:l}).join(" ");return n.mui=!0,n}function Rx(...e){const t=e.reduce((r,o)=>(o.filterProps.forEach(i=>{r[i]=o}),r),{}),n=r=>Object.keys(r).reduce((o,i)=>t[i]?xp(o,t[i](r)):o,{});return n.propTypes={},n.filterProps=e.reduce((r,o)=>r.concat(o.filterProps),[]),n}function Es(e){return typeof e!="number"?e:`${e}px solid`}function _s(e,t){return jr({prop:e,themeKey:"borders",transform:t})}const AN=_s("border",Es),FN=_s("borderTop",Es),NN=_s("borderRight",Es),_N=_s("borderBottom",Es),HN=_s("borderLeft",Es),BN=_s("borderColor"),WN=_s("borderTopColor"),VN=_s("borderRightColor"),GN=_s("borderBottomColor"),UN=_s("borderLeftColor"),qN=_s("outline",Es),KN=_s("outlineColor"),$x=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=fh(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:$c(t,r)});return Uo(e,e.borderRadius,n)}return null};$x.propTypes={};$x.filterProps=["borderRadius"];Rx(AN,FN,NN,_N,HN,BN,WN,VN,GN,UN,$x,qN,KN);const Ox=e=>{if(e.gap!==void 0&&e.gap!==null){const t=fh(e.theme,"spacing",8),n=r=>({gap:$c(t,r)});return Uo(e,e.gap,n)}return null};Ox.propTypes={};Ox.filterProps=["gap"];const zx=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=fh(e.theme,"spacing",8),n=r=>({columnGap:$c(t,r)});return Uo(e,e.columnGap,n)}return null};zx.propTypes={};zx.filterProps=["columnGap"];const Lx=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=fh(e.theme,"spacing",8),n=r=>({rowGap:$c(t,r)});return Uo(e,e.rowGap,n)}return null};Lx.propTypes={};Lx.filterProps=["rowGap"];const QN=jr({prop:"gridColumn"}),YN=jr({prop:"gridRow"}),XN=jr({prop:"gridAutoFlow"}),ZN=jr({prop:"gridAutoColumns"}),JN=jr({prop:"gridAutoRows"}),e4=jr({prop:"gridTemplateColumns"}),t4=jr({prop:"gridTemplateRows"}),n4=jr({prop:"gridTemplateAreas"}),r4=jr({prop:"gridArea"});Rx(Ox,zx,Lx,QN,YN,XN,ZN,JN,e4,t4,n4,r4);function Yu(e,t){return t==="grey"?t:e}const o4=jr({prop:"color",themeKey:"palette",transform:Yu}),s4=jr({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Yu}),i4=jr({prop:"backgroundColor",themeKey:"palette",transform:Yu});Rx(o4,s4,i4);function ss(e){return e<=1&&e!==0?`${e*100}%`:e}const l4=jr({prop:"width",transform:ss}),rw=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var o,i,l,c,u;const r=((l=(i=(o=e.theme)==null?void 0:o.breakpoints)==null?void 0:i.values)==null?void 0:l[n])||Tx[n];return r?((u=(c=e.theme)==null?void 0:c.breakpoints)==null?void 0:u.unit)!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:ss(n)}};return Uo(e,e.maxWidth,t)}return null};rw.filterProps=["maxWidth"];const a4=jr({prop:"minWidth",transform:ss}),c4=jr({prop:"height",transform:ss}),u4=jr({prop:"maxHeight",transform:ss}),d4=jr({prop:"minHeight",transform:ss});jr({prop:"size",cssProperty:"width",transform:ss});jr({prop:"size",cssProperty:"height",transform:ss});const f4=jr({prop:"boxSizing"});Rx(l4,rw,a4,c4,u4,d4,f4);const ph={border:{themeKey:"borders",transform:Es},borderTop:{themeKey:"borders",transform:Es},borderRight:{themeKey:"borders",transform:Es},borderBottom:{themeKey:"borders",transform:Es},borderLeft:{themeKey:"borders",transform:Es},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Es},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:$x},color:{themeKey:"palette",transform:Yu},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Yu},backgroundColor:{themeKey:"palette",transform:Yu},p:{style:gr},pt:{style:gr},pr:{style:gr},pb:{style:gr},pl:{style:gr},px:{style:gr},py:{style:gr},padding:{style:gr},paddingTop:{style:gr},paddingRight:{style:gr},paddingBottom:{style:gr},paddingLeft:{style:gr},paddingX:{style:gr},paddingY:{style:gr},paddingInline:{style:gr},paddingInlineStart:{style:gr},paddingInlineEnd:{style:gr},paddingBlock:{style:gr},paddingBlockStart:{style:gr},paddingBlockEnd:{style:gr},m:{style:mr},mt:{style:mr},mr:{style:mr},mb:{style:mr},ml:{style:mr},mx:{style:mr},my:{style:mr},margin:{style:mr},marginTop:{style:mr},marginRight:{style:mr},marginBottom:{style:mr},marginLeft:{style:mr},marginX:{style:mr},marginY:{style:mr},marginInline:{style:mr},marginInlineStart:{style:mr},marginInlineEnd:{style:mr},marginBlock:{style:mr},marginBlockStart:{style:mr},marginBlockEnd:{style:mr},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Ox},rowGap:{style:Lx},columnGap:{style:zx},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:ss},maxWidth:{style:rw},minWidth:{transform:ss},height:{transform:ss},maxHeight:{transform:ss},minHeight:{transform:ss},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function p4(...e){const t=e.reduce((r,o)=>r.concat(Object.keys(o)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function h4(e,t){return typeof e=="function"?e(t):e}function m4(){function e(n,r,o,i){const l={[n]:r,theme:o},c=i[n];if(!c)return{[n]:r};const{cssProperty:u=n,themeKey:f,transform:h,style:p}=c;if(r==null)return null;if(f==="typography"&&r==="inherit")return{[n]:r};const g=xa(o,f)||{};return p?p(l):Uo(l,r,b=>{let v=Wg(g,h,b);return b===v&&typeof b=="string"&&(v=Wg(g,h,`${n}${b==="default"?"":Pe(b)}`,b)),u===!1?v:{[u]:v}})}function t(n){const{sx:r,theme:o={},nested:i}=n||{};if(!r)return null;const l=o.unstable_sxConfig??ph;function c(u){let f=u;if(typeof u=="function")f=u(o);else if(typeof u!="object")return u;if(!f)return null;const h=dM(o.breakpoints),p=Object.keys(h);let g=h;return Object.keys(f).forEach(y=>{const b=h4(f[y],o);if(b!=null)if(typeof b=="object")if(l[y])g=xp(g,e(y,b,o,l));else{const v=Uo({theme:o},b,C=>({[y]:C}));p4(v,b)?g[y]=t({sx:b,theme:o,nested:!0}):g=xp(g,v)}else g=xp(g,e(y,b,o,l))}),!i&&o.modularCssLayers?{"@layer sx":U2(o,D0(p,g))}:U2(o,D0(p,g))}return Array.isArray(r)?r.map(c):c(r)}return t}const Ta=m4();Ta.filterProps=["sx"];function g4(e,t){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[e])||typeof n.getColorSchemeSelector!="function")return{};let o=n.getColorSchemeSelector(e);return o==="&"?t:((o.includes("data-")||o.includes("."))&&(o=`*:where(${o.replace(/\s*&$/,"")}) &`),{[o]:t})}return n.palette.mode===e?t:{}}function hh(e={},...t){const{breakpoints:n={},palette:r={},spacing:o,shape:i={},...l}=e,c=SN(n),u=pM(o);let f=qr({breakpoints:c,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:u,shape:{...EN,...i}},l);return f=IN(f),f.applyStyles=g4,f=t.reduce((h,p)=>qr(h,p),f),f.unstable_sxConfig={...ph,...l==null?void 0:l.unstable_sxConfig},f.unstable_sx=function(p){return Ta({sx:p,theme:this})},f}function x4(e){return Object.keys(e).length===0}function ow(e=null){const t=m.useContext(dh);return!t||x4(t)?e:t}const y4=hh();function Dx(e=y4){return ow(e)}function yv(e){const t=ba(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function hM({styles:e,themeId:t,defaultTheme:n={}}){const r=Dx(n),o=t&&r[t]||r;let i=typeof e=="function"?e(o):e;return o.modularCssLayers&&(Array.isArray(i)?i=i.map(l=>yv(typeof l=="function"?l(o):l)):i=yv(i)),s.jsx(lM,{styles:i})}const b4=e=>{var r;const t={systemProps:{},otherProps:{}},n=((r=e==null?void 0:e.theme)==null?void 0:r.unstable_sxConfig)??ph;return Object.keys(e).forEach(o=>{n[o]?t.systemProps[o]=e[o]:t.otherProps[o]=e[o]}),t};function Ax(e){const{sx:t,...n}=e,{systemProps:r,otherProps:o}=b4(n);let i;return Array.isArray(t)?i=[r,...t]:typeof t=="function"?i=(...l)=>{const c=t(...l);return Pi(c)?{...r,...c}:r}:i={...r,...t},{...o,sx:i}}const Q2=e=>e,v4=()=>{let e=Q2;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Q2}}},mM=v4();function gM(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=gM(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Me(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=gM(e))&&(r&&(r+=" "),r+=t);return r}function C4(e={}){const{themeId:t,defaultTheme:n,defaultClassName:r="MuiBox-root",generateClassName:o}=e,i=aM("div",{shouldForwardProp:c=>c!=="theme"&&c!=="sx"&&c!=="as"})(Ta);return m.forwardRef(function(u,f){const h=Dx(n),{className:p,component:g="div",...y}=Ax(u);return s.jsx(i,{as:g,ref:f,className:Me(p,o?o(r):r),theme:t&&h[t]||h,...y})})}const w4={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function ct(e,t,n="Mui"){const r=w4[t];return r?`${n}-${r}`:`${mM.generate(e)}-${t}`}function ut(e,t,n="Mui"){const r={};return t.forEach(o=>{r[o]=ct(e,o,n)}),r}function xM(e){const{variants:t,...n}=e,r={variants:t,style:ba(n),isProcessed:!0};return r.style===n||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=ba(o.style))}),r}const S4=hh();function bv(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function fc(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function j4(e){return e?(t,n)=>n[e]:null}function k4(e,t,n){e.theme=E4(e.theme)?n:e.theme[t]||e.theme}function Ig(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(o=>Ig(e,o,n));if(Array.isArray(r==null?void 0:r.variants)){let o;if(r.isProcessed)o=n?fc(r.style,n):r.style;else{const{variants:i,...l}=r;o=n?fc(ba(l),n):l}return yM(e,r.variants,[o],n)}return r!=null&&r.isProcessed?n?fc(ba(r.style),n):r.style:n?fc(ba(r),n):r}function yM(e,t,n=[],r=void 0){var i;let o;e:for(let l=0;l<t.length;l+=1){const c=t[l];if(typeof c.props=="function"){if(o??(o={...e,...e.ownerState,ownerState:e.ownerState}),!c.props(o))continue}else for(const u in c.props)if(e[u]!==c.props[u]&&((i=e.ownerState)==null?void 0:i[u])!==c.props[u])continue e;typeof c.style=="function"?(o??(o={...e,...e.ownerState,ownerState:e.ownerState}),n.push(r?fc(ba(c.style(o)),r):c.style(o))):n.push(r?fc(ba(c.style),r):c.style)}return n}function bM(e={}){const{themeId:t,defaultTheme:n=S4,rootShouldForwardProp:r=bv,slotShouldForwardProp:o=bv}=e;function i(c){k4(c,t,n)}return(c,u={})=>{bN(c,T=>T.filter($=>$!==Ta));const{name:f,slot:h,skipVariantsResolver:p,skipSx:g,overridesResolver:y=j4(T4(h)),...b}=u,v=f&&f.startsWith("Mui")||h?"components":"custom",C=p!==void 0?p:h&&h!=="Root"&&h!=="root"||!1,S=g||!1;let j=bv;h==="Root"||h==="root"?j=r:h?j=o:P4(c)&&(j=void 0);const w=aM(c,{shouldForwardProp:j,label:I4(),...b}),k=T=>{if(T.__emotion_real===T)return T;if(typeof T=="function")return function(M){return Ig(M,T,M.theme.modularCssLayers?v:void 0)};if(Pi(T)){const $=xM(T);return function(R){return $.variants?Ig(R,$,R.theme.modularCssLayers?v:void 0):R.theme.modularCssLayers?fc($.style,v):$.style}}return T},P=(...T)=>{const $=[],M=T.map(k),R=[];if($.push(i),f&&y&&R.push(function(N){var H,B;const L=(B=(H=N.theme.components)==null?void 0:H[f])==null?void 0:B.styleOverrides;if(!L)return null;const D={};for(const V in L)D[V]=Ig(N,L[V],N.theme.modularCssLayers?"theme":void 0);return y(N,D)}),f&&!C&&R.push(function(N){var D,H;const F=N.theme,L=(H=(D=F==null?void 0:F.components)==null?void 0:D[f])==null?void 0:H.variants;return L?yM(N,L,[],N.theme.modularCssLayers?"theme":void 0):null}),S||R.push(Ta),Array.isArray(M[0])){const A=M.shift(),N=new Array($.length).fill(""),F=new Array(R.length).fill("");let L;L=[...N,...A,...F],L.raw=[...N,...A.raw,...F],$.unshift(L)}const E=[...$,...M,...R],O=w(...E);return c.muiName&&(O.muiName=c.muiName),O};return w.withConfig&&(P.withConfig=w.withConfig),P}}function I4(e,t){return void 0}function E4(e){for(const t in e)return!1;return!0}function P4(e){return typeof e=="string"&&e.charCodeAt(0)>96}function T4(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}const Dn=bM();function Oc(e,t){const n={...t};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const o=r;if(o==="components"||o==="slots")n[o]={...e[o],...n[o]};else if(o==="componentsProps"||o==="slotProps"){const i=e[o],l=t[o];if(!l)n[o]=i||{};else if(!i)n[o]=l;else{n[o]={...l};for(const c in i)if(Object.prototype.hasOwnProperty.call(i,c)){const u=c;n[o][u]=Oc(i[u],l[u])}}}else n[o]===void 0&&(n[o]=e[o])}return n}function vM(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:Oc(t.components[n].defaultProps,r)}function CM({props:e,name:t,defaultTheme:n,themeId:r}){let o=Dx(n);return r&&(o=o[r]||o),vM({theme:o,name:t,props:e})}const Ln=typeof window<"u"?m.useLayoutEffect:m.useEffect;function M4(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function sw(e,t=0,n=1){return M4(e,t,n)}function R4(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,o)=>o<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Li(e){if(e.type)return e;if(e.charAt(0)==="#")return Li(R4(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(hl(9,e));let r=e.substring(t+1,e.length-1),o;if(n==="color"){if(r=r.split(" "),o=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(o))throw new Error(hl(10,o))}else r=r.split(",");return r=r.map(i=>parseFloat(i)),{type:n,values:r,colorSpace:o}}const $4=e=>{const t=Li(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},op=(e,t)=>{try{return $4(e)}catch{return e}};function mh(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((o,i)=>i<3?parseInt(o,10):o):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function wM(e){e=Li(e);const{values:t}=e,n=t[0],r=t[1]/100,o=t[2]/100,i=r*Math.min(o,1-o),l=(f,h=(f+n/30)%12)=>o-i*Math.max(Math.min(h-3,9-h,1),-1);let c="rgb";const u=[Math.round(l(0)*255),Math.round(l(8)*255),Math.round(l(4)*255)];return e.type==="hsla"&&(c+="a",u.push(t[3])),mh({type:c,values:u})}function A0(e){e=Li(e);let t=e.type==="hsl"||e.type==="hsla"?Li(wM(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function O4(e,t){const n=A0(e),r=A0(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Ye(e,t){return e=Li(e),t=sw(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,mh(e)}function Gm(e,t,n){try{return Ye(e,t)}catch{return e}}function ml(e,t){if(e=Li(e),t=sw(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return mh(e)}function Wn(e,t,n){try{return ml(e,t)}catch{return e}}function gl(e,t){if(e=Li(e),t=sw(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return mh(e)}function Vn(e,t,n){try{return gl(e,t)}catch{return e}}function Vg(e,t=.15){return A0(e)>.5?ml(e,t):gl(e,t)}function Um(e,t,n){try{return Vg(e,t)}catch{return e}}function Y2(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}function gh(e,t=166){let n;function r(...o){const i=()=>{e.apply(this,o)};clearTimeout(n),n=setTimeout(i,t)}return r.clear=()=>{clearTimeout(n)},r}function vv(e,t){var n,r,o;return m.isValidElement(e)&&t.indexOf(e.type.muiName??((o=(r=(n=e.type)==null?void 0:n._payload)==null?void 0:r.value)==null?void 0:o.muiName))!==-1}function ir(e){return e&&e.ownerDocument||document}function qo(e){return ir(e).defaultView||window}function F0(e,t){typeof e=="function"?e(t):e&&(e.current=t)}let X2=0;function z4(e){const[t,n]=m.useState(e),r=e||t;return m.useEffect(()=>{t==null&&(X2+=1,n(`mui-${X2}`))},[t]),r}const L4={...p0},Z2=L4.useId;function Sn(e){if(Z2!==void 0){const t=Z2();return e??t}return z4(e)}function va({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=m.useRef(e!==void 0),[i,l]=m.useState(t),c=o?e:i,u=m.useCallback(f=>{o||l(f)},[]);return[c,u]}function Vt(e){const t=m.useRef(e);return Ln(()=>{t.current=e}),m.useRef((...n)=>(0,t.current)(...n)).current}function Pn(...e){const t=m.useRef(void 0),n=m.useCallback(r=>{const o=e.map(i=>{if(i==null)return null;if(typeof i=="function"){const l=i,c=l(r);return typeof c=="function"?c:()=>{l(null)}}return i.current=r,()=>{i.current=null}});return()=>{o.forEach(i=>i==null?void 0:i())}},e);return m.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const J2={};function Hs(e,t){const n=m.useRef(J2);return n.current===J2&&(n.current=e(t)),n}const D4=[];function iw(e){m.useEffect(e,D4)}class Fx{constructor(){Df(this,"currentId",null);Df(this,"clear",()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)});Df(this,"disposeEffect",()=>this.clear)}static create(){return new Fx}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}function Po(){const e=Hs(Fx.create).current;return iw(e.disposeEffect),e}function pd(e){try{return e.matches(":focus-visible")}catch{}return!1}function SM(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}const lw=e=>{const t=m.useRef({});return m.useEffect(()=>{t.current=e}),t.current};function A4(e){return m.Children.toArray(e).filter(t=>m.isValidElement(t))}function Be(e,t,n=void 0){const r={};for(const o in e){const i=e[o];let l="",c=!0;for(let u=0;u<i.length;u+=1){const f=i[u];f&&(l+=(c===!0?"":" ")+t(f),c=!1,n&&n[f]&&(l+=" "+n[f]))}r[o]=l}return r}function F4(e){return typeof e=="string"}function jM(e,t,n){return e===void 0||F4(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function Gg(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function ek(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function kM(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:i}=e;if(!t){const y=Me(n==null?void 0:n.className,i,o==null?void 0:o.className,r==null?void 0:r.className),b={...n==null?void 0:n.style,...o==null?void 0:o.style,...r==null?void 0:r.style},v={...n,...o,...r};return y.length>0&&(v.className=y),Object.keys(b).length>0&&(v.style=b),{props:v,internalRef:void 0}}const l=Gg({...o,...r}),c=ek(r),u=ek(o),f=t(l),h=Me(f==null?void 0:f.className,n==null?void 0:n.className,i,o==null?void 0:o.className,r==null?void 0:r.className),p={...f==null?void 0:f.style,...n==null?void 0:n.style,...o==null?void 0:o.style,...r==null?void 0:r.style},g={...f,...n,...u,...c};return h.length>0&&(g.className=h),Object.keys(p).length>0&&(g.style=p),{props:g,internalRef:f.ref}}function IM(e,t,n){return typeof e=="function"?e(t,n):e}function zc(e){var p;const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:o=!1,...i}=e,l=o?{}:IM(n,r),{props:c,internalRef:u}=kM({...i,externalSlotProps:l}),f=Pn(u,l==null?void 0:l.ref,(p=e.additionalProps)==null?void 0:p.ref);return jM(t,{...c,ref:f},r)}function Da(e){var t;return parseInt(m.version,10)>=19?((t=e==null?void 0:e.props)==null?void 0:t.ref)||null:(e==null?void 0:e.ref)||null}const EM=m.createContext(null);function aw(){return m.useContext(EM)}const N4=typeof Symbol=="function"&&Symbol.for,_4=N4?Symbol.for("mui.nested"):"__THEME_NESTED__";function H4(e,t){return typeof t=="function"?t(e):{...e,...t}}function B4(e){const{children:t,theme:n}=e,r=aw(),o=m.useMemo(()=>{const i=r===null?{...n}:H4(r,n);return i!=null&&(i[_4]=r!==null),i},[n,r]);return s.jsx(EM.Provider,{value:o,children:t})}const PM=m.createContext();function W4({value:e,...t}){return s.jsx(PM.Provider,{value:e??!0,...t})}const Yr=()=>m.useContext(PM)??!1,TM=m.createContext(void 0);function V4({value:e,children:t}){return s.jsx(TM.Provider,{value:e,children:t})}function G4(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const o=t.components[n];return o.defaultProps?Oc(o.defaultProps,r):!o.styleOverrides&&!o.variants?Oc(o,r):r}function U4({props:e,name:t}){const n=m.useContext(TM);return G4({props:e,name:t,theme:{components:n}})}function q4(e){const t=ow(),n=Sn()||"",{modularCssLayers:r}=e;let o="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!r||t!==null?o="":typeof r=="string"?o=r.replace(/mui(?!\.)/g,o):o=`@layer ${o};`,Ln(()=>{var c,u;const i=document.querySelector("head");if(!i)return;const l=i.firstChild;if(o){if(l&&((c=l.hasAttribute)!=null&&c.call(l,"data-mui-layer-order"))&&l.getAttribute("data-mui-layer-order")===n)return;const f=document.createElement("style");f.setAttribute("data-mui-layer-order",n),f.textContent=o,i.prepend(f)}else(u=i.querySelector(`style[data-mui-layer-order="${n}"]`))==null||u.remove()},[o,n]),o?s.jsx(hM,{styles:o}):null}const tk={};function nk(e,t,n,r=!1){return m.useMemo(()=>{const o=e&&t[e]||t;if(typeof n=="function"){const i=n(o),l=e?{...t,[e]:i}:i;return r?()=>l:l}return e?{...t,[e]:n}:{...t,...n}},[e,t,n,r])}function MM(e){const{children:t,theme:n,themeId:r}=e,o=ow(tk),i=aw()||tk,l=nk(r,o,n),c=nk(r,i,n,!0),u=(r?l[r]:l).direction==="rtl",f=q4(l);return s.jsx(B4,{theme:c,children:s.jsx(dh.Provider,{value:l,children:s.jsx(W4,{value:u,children:s.jsxs(V4,{value:r?l[r].components:l.components,children:[f,t]})})})})}const rk={theme:void 0};function K4(e){let t,n;return function(o){let i=t;return(i===void 0||o.theme!==n)&&(rk.theme=o.theme,i=xM(e(rk)),t=i,n=o.theme),i}}const cw="mode",uw="color-scheme",Q4="data-color-scheme";function Y4(e){const{defaultMode:t="system",defaultLightColorScheme:n="light",defaultDarkColorScheme:r="dark",modeStorageKey:o=cw,colorSchemeStorageKey:i=uw,attribute:l=Q4,colorSchemeNode:c="document.documentElement",nonce:u}=e||{};let f="",h=l;if(l==="class"&&(h=".%s"),l==="data"&&(h="[data-%s]"),h.startsWith(".")){const g=h.substring(1);f+=`${c}.classList.remove('${g}'.replace('%s', light), '${g}'.replace('%s', dark));
|
|
73
|
+
${c}.classList.add('${g}'.replace('%s', colorScheme));`}const p=h.match(/\[([^\]]+)\]/);if(p){const[g,y]=p[1].split("=");y||(f+=`${c}.removeAttribute('${g}'.replace('%s', light));
|
|
74
|
+
${c}.removeAttribute('${g}'.replace('%s', dark));`),f+=`
|
|
75
|
+
${c}.setAttribute('${g}'.replace('%s', colorScheme), ${y?`${y}.replace('%s', colorScheme)`:'""'});`}else f+=`${c}.setAttribute('${h}', colorScheme);`;return s.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?u:"",dangerouslySetInnerHTML:{__html:`(function() {
|
|
76
|
+
try {
|
|
77
|
+
let colorScheme = '';
|
|
78
|
+
const mode = localStorage.getItem('${o}') || '${t}';
|
|
79
|
+
const dark = localStorage.getItem('${i}-dark') || '${r}';
|
|
80
|
+
const light = localStorage.getItem('${i}-light') || '${n}';
|
|
81
|
+
if (mode === 'system') {
|
|
82
|
+
// handle system mode
|
|
83
|
+
const mql = window.matchMedia('(prefers-color-scheme: dark)');
|
|
84
|
+
if (mql.matches) {
|
|
85
|
+
colorScheme = dark
|
|
86
|
+
} else {
|
|
87
|
+
colorScheme = light
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (mode === 'light') {
|
|
91
|
+
colorScheme = light;
|
|
92
|
+
}
|
|
93
|
+
if (mode === 'dark') {
|
|
94
|
+
colorScheme = dark;
|
|
95
|
+
}
|
|
96
|
+
if (colorScheme) {
|
|
97
|
+
${f}
|
|
98
|
+
}
|
|
99
|
+
} catch(e){}})();`}},"mui-color-scheme-init")}function X4(){}const Z4=({key:e,storageWindow:t})=>(!t&&typeof window<"u"&&(t=window),{get(n){if(typeof window>"u")return;if(!t)return n;let r;try{r=t.localStorage.getItem(e)}catch{}return r||n},set:n=>{if(t)try{t.localStorage.setItem(e,n)}catch{}},subscribe:n=>{if(!t)return X4;const r=o=>{const i=o.newValue;o.key===e&&n(i)};return t.addEventListener("storage",r),()=>{t.removeEventListener("storage",r)}}});function Cv(){}function ok(e){if(typeof window<"u"&&typeof window.matchMedia=="function"&&e==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function RM(e,t){if(e.mode==="light"||e.mode==="system"&&e.systemMode==="light")return t("light");if(e.mode==="dark"||e.mode==="system"&&e.systemMode==="dark")return t("dark")}function J4(e){return RM(e,t=>{if(t==="light")return e.lightColorScheme;if(t==="dark")return e.darkColorScheme})}function e3(e){const{defaultMode:t="light",defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:o=[],modeStorageKey:i=cw,colorSchemeStorageKey:l=uw,storageWindow:c=typeof window>"u"?void 0:window,storageManager:u=Z4,noSsr:f=!1}=e,h=o.join(","),p=o.length>1,g=m.useMemo(()=>u==null?void 0:u({key:i,storageWindow:c}),[u,i,c]),y=m.useMemo(()=>u==null?void 0:u({key:`${l}-light`,storageWindow:c}),[u,l,c]),b=m.useMemo(()=>u==null?void 0:u({key:`${l}-dark`,storageWindow:c}),[u,l,c]),[v,C]=m.useState(()=>{const M=(g==null?void 0:g.get(t))||t,R=(y==null?void 0:y.get(n))||n,E=(b==null?void 0:b.get(r))||r;return{mode:M,systemMode:ok(M),lightColorScheme:R,darkColorScheme:E}}),[S,j]=m.useState(f||!p);m.useEffect(()=>{j(!0)},[]);const w=J4(v),k=m.useCallback(M=>{C(R=>{if(M===R.mode)return R;const E=M??t;return g==null||g.set(E),{...R,mode:E,systemMode:ok(E)}})},[g,t]),P=m.useCallback(M=>{M?typeof M=="string"?M&&!h.includes(M)?console.error(`\`${M}\` does not exist in \`theme.colorSchemes\`.`):C(R=>{const E={...R};return RM(R,O=>{O==="light"&&(y==null||y.set(M),E.lightColorScheme=M),O==="dark"&&(b==null||b.set(M),E.darkColorScheme=M)}),E}):C(R=>{const E={...R},O=M.light===null?n:M.light,A=M.dark===null?r:M.dark;return O&&(h.includes(O)?(E.lightColorScheme=O,y==null||y.set(O)):console.error(`\`${O}\` does not exist in \`theme.colorSchemes\`.`)),A&&(h.includes(A)?(E.darkColorScheme=A,b==null||b.set(A)):console.error(`\`${A}\` does not exist in \`theme.colorSchemes\`.`)),E}):C(R=>(y==null||y.set(n),b==null||b.set(r),{...R,lightColorScheme:n,darkColorScheme:r}))},[h,y,b,n,r]),T=m.useCallback(M=>{v.mode==="system"&&C(R=>{const E=M!=null&&M.matches?"dark":"light";return R.systemMode===E?R:{...R,systemMode:E}})},[v.mode]),$=m.useRef(T);return $.current=T,m.useEffect(()=>{if(typeof window.matchMedia!="function"||!p)return;const M=(...E)=>$.current(...E),R=window.matchMedia("(prefers-color-scheme: dark)");return R.addListener(M),M(R),()=>{R.removeListener(M)}},[p]),m.useEffect(()=>{if(p){const M=(g==null?void 0:g.subscribe(O=>{(!O||["light","dark","system"].includes(O))&&k(O||t)}))||Cv,R=(y==null?void 0:y.subscribe(O=>{(!O||h.match(O))&&P({light:O})}))||Cv,E=(b==null?void 0:b.subscribe(O=>{(!O||h.match(O))&&P({dark:O})}))||Cv;return()=>{M(),R(),E()}}},[P,k,h,t,c,p,g,y,b]),{...v,mode:S?v.mode:void 0,systemMode:S?v.systemMode:void 0,colorScheme:S?w:void 0,setMode:k,setColorScheme:P}}const t3="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function n3(e){const{themeId:t,theme:n={},modeStorageKey:r=cw,colorSchemeStorageKey:o=uw,disableTransitionOnChange:i=!1,defaultColorScheme:l,resolveTheme:c}=e,u={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},f=m.createContext(void 0),h=()=>m.useContext(f)||u,p={},g={};function y(S){var Ae,st,qe,et;const{children:j,theme:w,modeStorageKey:k=r,colorSchemeStorageKey:P=o,disableTransitionOnChange:T=i,storageManager:$,storageWindow:M=typeof window>"u"?void 0:window,documentNode:R=typeof document>"u"?void 0:document,colorSchemeNode:E=typeof document>"u"?void 0:document.documentElement,disableNestedContext:O=!1,disableStyleSheetGeneration:A=!1,defaultMode:N="system",noSsr:F}=S,L=m.useRef(!1),D=aw(),H=m.useContext(f),B=!!H&&!O,V=m.useMemo(()=>w||(typeof n=="function"?n():n),[w]),G=V[t],_=G||V,{colorSchemes:U=p,components:Z=g,cssVarPrefix:Q}=_,ee=Object.keys(U).filter(oe=>!!U[oe]).join(","),ne=m.useMemo(()=>ee.split(","),[ee]),re=typeof l=="string"?l:l.light,Y=typeof l=="string"?l:l.dark,ie=U[re]&&U[Y]?N:((st=(Ae=U[_.defaultColorScheme])==null?void 0:Ae.palette)==null?void 0:st.mode)||((qe=_.palette)==null?void 0:qe.mode),{mode:ce,setMode:he,systemMode:de,lightColorScheme:le,darkColorScheme:ge,colorScheme:Se,setColorScheme:ke}=e3({supportedColorSchemes:ne,defaultLightColorScheme:re,defaultDarkColorScheme:Y,modeStorageKey:k,colorSchemeStorageKey:P,defaultMode:ie,storageManager:$,storageWindow:M,noSsr:F});let we=ce,Oe=Se;B&&(we=H.mode,Oe=H.colorScheme);const be=m.useMemo(()=>{var $e;const oe=Oe||_.defaultColorScheme,fe=(($e=_.generateThemeVars)==null?void 0:$e.call(_))||_.vars,Ie={..._,components:Z,colorSchemes:U,cssVarPrefix:Q,vars:fe};if(typeof Ie.generateSpacing=="function"&&(Ie.spacing=Ie.generateSpacing()),oe){const pt=U[oe];pt&&typeof pt=="object"&&Object.keys(pt).forEach(vt=>{pt[vt]&&typeof pt[vt]=="object"?Ie[vt]={...Ie[vt],...pt[vt]}:Ie[vt]=pt[vt]})}return c?c(Ie):Ie},[_,Oe,Z,U,Q]),Fe=_.colorSchemeSelector;Ln(()=>{if(Oe&&E&&Fe&&Fe!=="media"){const oe=Fe;let fe=Fe;if(oe==="class"&&(fe=".%s"),oe==="data"&&(fe="[data-%s]"),oe!=null&&oe.startsWith("data-")&&!oe.includes("%s")&&(fe=`[${oe}="%s"]`),fe.startsWith("."))E.classList.remove(...ne.map(Ie=>fe.substring(1).replace("%s",Ie))),E.classList.add(fe.substring(1).replace("%s",Oe));else{const Ie=fe.replace("%s",Oe).match(/\[([^\]]+)\]/);if(Ie){const[$e,pt]=Ie[1].split("=");pt||ne.forEach(vt=>{E.removeAttribute($e.replace(Oe,vt))}),E.setAttribute($e,pt?pt.replace(/"|'/g,""):"")}else E.setAttribute(fe,Oe)}}},[Oe,Fe,E,ne]),m.useEffect(()=>{let oe;if(T&&L.current&&R){const fe=R.createElement("style");fe.appendChild(R.createTextNode(t3)),R.head.appendChild(fe),window.getComputedStyle(R.body),oe=setTimeout(()=>{R.head.removeChild(fe)},1)}return()=>{clearTimeout(oe)}},[Oe,T,R]),m.useEffect(()=>(L.current=!0,()=>{L.current=!1}),[]);const Ve=m.useMemo(()=>({allColorSchemes:ne,colorScheme:Oe,darkColorScheme:ge,lightColorScheme:le,mode:we,setColorScheme:ke,setMode:he,systemMode:de}),[ne,Oe,ge,le,we,ke,he,de,be.colorSchemeSelector]);let De=!0;(A||_.cssVariables===!1||B&&(D==null?void 0:D.cssVarPrefix)===Q)&&(De=!1);const Ze=s.jsxs(m.Fragment,{children:[s.jsx(MM,{themeId:G?t:void 0,theme:be,children:j}),De&&s.jsx(lM,{styles:((et=be.generateStyleSheets)==null?void 0:et.call(be))||[]})]});return B?Ze:s.jsx(f.Provider,{value:Ve,children:Ze})}const b=typeof l=="string"?l:l.light,v=typeof l=="string"?l:l.dark;return{CssVarsProvider:y,useColorScheme:h,getInitColorSchemeScript:S=>Y4({colorSchemeStorageKey:o,defaultLightColorScheme:b,defaultDarkColorScheme:v,modeStorageKey:r,...S})}}function r3(e=""){function t(...r){if(!r.length)return"";const o=r[0];return typeof o=="string"&&!o.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${o}${t(...r.slice(1))})`:`, ${o}`}return(r,...o)=>`var(--${e?`${e}-`:""}${r}${t(...o)})`}const sk=(e,t,n,r=[])=>{let o=e;t.forEach((i,l)=>{l===t.length-1?Array.isArray(o)?o[Number(i)]=n:o&&typeof o=="object"&&(o[i]=n):o&&typeof o=="object"&&(o[i]||(o[i]=r.includes(i)?[]:{}),o=o[i])})},o3=(e,t,n)=>{function r(o,i=[],l=[]){Object.entries(o).forEach(([c,u])=>{(!n||n&&!n([...i,c]))&&u!=null&&(typeof u=="object"&&Object.keys(u).length>0?r(u,[...i,c],Array.isArray(u)?[...l,c]:l):t([...i,c],u,l))})}r(e)},s3=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function wv(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},o={},i={},l={};return o3(e,(c,u,f)=>{if((typeof u=="string"||typeof u=="number")&&(!r||!r(c,u))){const h=`--${n?`${n}-`:""}${c.join("-")}`,p=s3(c,u);Object.assign(o,{[h]:p}),sk(i,c,`var(${h})`,f),sk(l,c,`var(${h}, ${p})`,f)}},c=>c[0]==="vars"),{css:o,vars:i,varsWithDefaults:l}}function i3(e,t={}){const{getSelector:n=C,disableCssColorScheme:r,colorSchemeSelector:o}=t,{colorSchemes:i={},components:l,defaultColorScheme:c="light",...u}=e,{vars:f,css:h,varsWithDefaults:p}=wv(u,t);let g=p;const y={},{[c]:b,...v}=i;if(Object.entries(v||{}).forEach(([w,k])=>{const{vars:P,css:T,varsWithDefaults:$}=wv(k,t);g=qr(g,$),y[w]={css:T,vars:P}}),b){const{css:w,vars:k,varsWithDefaults:P}=wv(b,t);g=qr(g,P),y[c]={css:w,vars:k}}function C(w,k){var T,$;let P=o;if(o==="class"&&(P=".%s"),o==="data"&&(P="[data-%s]"),o!=null&&o.startsWith("data-")&&!o.includes("%s")&&(P=`[${o}="%s"]`),w){if(P==="media")return e.defaultColorScheme===w?":root":{[`@media (prefers-color-scheme: ${(($=(T=i[w])==null?void 0:T.palette)==null?void 0:$.mode)||w})`]:{":root":k}};if(P)return e.defaultColorScheme===w?`:root, ${P.replace("%s",String(w))}`:P.replace("%s",String(w))}return":root"}return{vars:g,generateThemeVars:()=>{let w={...f};return Object.entries(y).forEach(([,{vars:k}])=>{w=qr(w,k)}),w},generateStyleSheets:()=>{var M,R;const w=[],k=e.defaultColorScheme||"light";function P(E,O){Object.keys(O).length&&w.push(typeof E=="string"?{[E]:{...O}}:E)}P(n(void 0,{...h}),h);const{[k]:T,...$}=y;if(T){const{css:E}=T,O=(R=(M=i[k])==null?void 0:M.palette)==null?void 0:R.mode,A=!r&&O?{colorScheme:O,...E}:{...E};P(n(k,{...A}),A)}return Object.entries($).forEach(([E,{css:O}])=>{var F,L;const A=(L=(F=i[E])==null?void 0:F.palette)==null?void 0:L.mode,N=!r&&A?{colorScheme:A,...O}:{...O};P(n(E,{...N}),N)}),w}}}function l3(e){return function(n){return e==="media"?`@media (prefers-color-scheme: ${n})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}const a3=hh(),c3=Dn("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`maxWidth${Pe(String(n.maxWidth))}`],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),u3=e=>CM({props:e,name:"MuiContainer",defaultTheme:a3}),d3=(e,t)=>{const n=u=>ct(t,u),{classes:r,fixed:o,disableGutters:i,maxWidth:l}=e,c={root:["root",l&&`maxWidth${Pe(String(l))}`,o&&"fixed",i&&"disableGutters"]};return Be(c,n,r)};function f3(e={}){const{createStyledComponent:t=c3,useThemeProps:n=u3,componentName:r="MuiContainer"}=e,o=t(({theme:l,ownerState:c})=>({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",...!c.disableGutters&&{paddingLeft:l.spacing(2),paddingRight:l.spacing(2),[l.breakpoints.up("sm")]:{paddingLeft:l.spacing(3),paddingRight:l.spacing(3)}}}),({theme:l,ownerState:c})=>c.fixed&&Object.keys(l.breakpoints.values).reduce((u,f)=>{const h=f,p=l.breakpoints.values[h];return p!==0&&(u[l.breakpoints.up(h)]={maxWidth:`${p}${l.breakpoints.unit}`}),u},{}),({theme:l,ownerState:c})=>({...c.maxWidth==="xs"&&{[l.breakpoints.up("xs")]:{maxWidth:Math.max(l.breakpoints.values.xs,444)}},...c.maxWidth&&c.maxWidth!=="xs"&&{[l.breakpoints.up(c.maxWidth)]:{maxWidth:`${l.breakpoints.values[c.maxWidth]}${l.breakpoints.unit}`}}}));return m.forwardRef(function(c,u){const f=n(c),{className:h,component:p="div",disableGutters:g=!1,fixed:y=!1,maxWidth:b="lg",classes:v,...C}=f,S={...f,component:p,disableGutters:g,fixed:y,maxWidth:b},j=d3(S,r);return s.jsx(o,{as:p,ownerState:S,className:Me(j.root,h),ref:u,...C})})}const p3=hh(),h3=Dn("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function m3(e){return CM({props:e,name:"MuiStack",defaultTheme:p3})}function g3(e,t){const n=m.Children.toArray(e).filter(Boolean);return n.reduce((r,o,i)=>(r.push(o),i<n.length-1&&r.push(m.cloneElement(t,{key:`separator-${i}`})),r),[])}const x3=e=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],y3=({ownerState:e,theme:t})=>{let n={display:"flex",flexDirection:"column",...Uo({theme:t},kc({values:e.direction,breakpoints:t.breakpoints.values}),r=>({flexDirection:r}))};if(e.spacing){const r=Mx(t),o=Object.keys(t.breakpoints.values).reduce((u,f)=>((typeof e.spacing=="object"&&e.spacing[f]!=null||typeof e.direction=="object"&&e.direction[f]!=null)&&(u[f]=!0),u),{}),i=kc({values:e.direction,base:o}),l=kc({values:e.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((u,f,h)=>{if(!i[u]){const g=f>0?i[h[f-1]]:"column";i[u]=g}}),n=qr(n,Uo({theme:t},l,(u,f)=>e.useFlexGap?{gap:$c(r,u)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${x3(f?i[f]:e.direction)}`]:$c(r,u)}}))}return n=TN(t.breakpoints,n),n};function b3(e={}){const{createStyledComponent:t=h3,useThemeProps:n=m3,componentName:r="MuiStack"}=e,o=()=>Be({root:["root"]},u=>ct(r,u),{}),i=t(y3);return m.forwardRef(function(u,f){const h=n(u),p=Ax(h),{component:g="div",direction:y="column",spacing:b=0,divider:v,children:C,className:S,useFlexGap:j=!1,...w}=p,k={direction:y,spacing:b,useFlexGap:j},P=o();return s.jsx(i,{as:g,ownerState:k,ref:f,className:Me(P.root,S),...w,children:v?g3(C,v):C})})}const Op={black:"#000",white:"#fff"},v3={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Cu={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},wu={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},_f={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},Su={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},ju={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},ku={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function $M(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Op.white,default:Op.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const C3=$M();function OM(){return{text:{primary:Op.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Op.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const ik=OM();function lk(e,t,n,r){const o=r.light||r,i=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=gl(e.main,o):t==="dark"&&(e.dark=ml(e.main,i)))}function w3(e="light"){return e==="dark"?{main:Su[200],light:Su[50],dark:Su[400]}:{main:Su[700],light:Su[400],dark:Su[800]}}function S3(e="light"){return e==="dark"?{main:Cu[200],light:Cu[50],dark:Cu[400]}:{main:Cu[500],light:Cu[300],dark:Cu[700]}}function j3(e="light"){return e==="dark"?{main:wu[500],light:wu[300],dark:wu[700]}:{main:wu[700],light:wu[400],dark:wu[800]}}function k3(e="light"){return e==="dark"?{main:ju[400],light:ju[300],dark:ju[700]}:{main:ju[700],light:ju[500],dark:ju[900]}}function I3(e="light"){return e==="dark"?{main:ku[400],light:ku[300],dark:ku[700]}:{main:ku[800],light:ku[500],dark:ku[900]}}function E3(e="light"){return e==="dark"?{main:_f[400],light:_f[300],dark:_f[700]}:{main:"#ed6c02",light:_f[500],dark:_f[900]}}function dw(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,...o}=e,i=e.primary||w3(t),l=e.secondary||S3(t),c=e.error||j3(t),u=e.info||k3(t),f=e.success||I3(t),h=e.warning||E3(t);function p(v){return O4(v,ik.text.primary)>=n?ik.text.primary:C3.text.primary}const g=({color:v,name:C,mainShade:S=500,lightShade:j=300,darkShade:w=700})=>{if(v={...v},!v.main&&v[S]&&(v.main=v[S]),!v.hasOwnProperty("main"))throw new Error(hl(11,C?` (${C})`:"",S));if(typeof v.main!="string")throw new Error(hl(12,C?` (${C})`:"",JSON.stringify(v.main)));return lk(v,"light",j,r),lk(v,"dark",w,r),v.contrastText||(v.contrastText=p(v.main)),v};let y;return t==="light"?y=$M():t==="dark"&&(y=OM()),qr({common:{...Op},mode:t,primary:g({color:i,name:"primary"}),secondary:g({color:l,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:g({color:c,name:"error"}),warning:g({color:h,name:"warning"}),info:g({color:u,name:"info"}),success:g({color:f,name:"success"}),grey:v3,contrastThreshold:n,getContrastText:p,augmentColor:g,tonalOffset:r,...y},o)}function P3(e){const t={};return Object.entries(e).forEach(r=>{const[o,i]=r;typeof i=="object"&&(t[o]=`${i.fontStyle?`${i.fontStyle} `:""}${i.fontVariant?`${i.fontVariant} `:""}${i.fontWeight?`${i.fontWeight} `:""}${i.fontStretch?`${i.fontStretch} `:""}${i.fontSize||""}${i.lineHeight?`/${i.lineHeight} `:""}${i.fontFamily||""}`)}),t}function T3(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function M3(e){return Math.round(e*1e5)/1e5}const ak={textTransform:"uppercase"},ck='"Roboto", "Helvetica", "Arial", sans-serif';function zM(e,t){const{fontFamily:n=ck,fontSize:r=14,fontWeightLight:o=300,fontWeightRegular:i=400,fontWeightMedium:l=500,fontWeightBold:c=700,htmlFontSize:u=16,allVariants:f,pxToRem:h,...p}=typeof t=="function"?t(e):t,g=r/14,y=h||(C=>`${C/u*g}rem`),b=(C,S,j,w,k)=>({fontFamily:n,fontWeight:C,fontSize:y(S),lineHeight:j,...n===ck?{letterSpacing:`${M3(w/S)}em`}:{},...k,...f}),v={h1:b(o,96,1.167,-1.5),h2:b(o,60,1.2,-.5),h3:b(i,48,1.167,0),h4:b(i,34,1.235,.25),h5:b(i,24,1.334,0),h6:b(l,20,1.6,.15),subtitle1:b(i,16,1.75,.15),subtitle2:b(l,14,1.57,.1),body1:b(i,16,1.5,.15),body2:b(i,14,1.43,.15),button:b(l,14,1.75,.4,ak),caption:b(i,12,1.66,.4),overline:b(i,12,2.66,1,ak),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return qr({htmlFontSize:u,pxToRem:y,fontFamily:n,fontSize:r,fontWeightLight:o,fontWeightRegular:i,fontWeightMedium:l,fontWeightBold:c,...v},p,{clone:!1})}const R3=.2,$3=.14,O3=.12;function or(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${R3})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${$3})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${O3})`].join(",")}const z3=["none",or(0,2,1,-1,0,1,1,0,0,1,3,0),or(0,3,1,-2,0,2,2,0,0,1,5,0),or(0,3,3,-2,0,3,4,0,0,1,8,0),or(0,2,4,-1,0,4,5,0,0,1,10,0),or(0,3,5,-1,0,5,8,0,0,1,14,0),or(0,3,5,-1,0,6,10,0,0,1,18,0),or(0,4,5,-2,0,7,10,1,0,2,16,1),or(0,5,5,-3,0,8,10,1,0,3,14,2),or(0,5,6,-3,0,9,12,1,0,3,16,2),or(0,6,6,-3,0,10,14,1,0,4,18,3),or(0,6,7,-4,0,11,15,1,0,4,20,3),or(0,7,8,-4,0,12,17,2,0,5,22,4),or(0,7,8,-4,0,13,19,2,0,5,24,4),or(0,7,9,-4,0,14,21,2,0,5,26,4),or(0,8,9,-5,0,15,22,2,0,6,28,5),or(0,8,10,-5,0,16,24,2,0,6,30,5),or(0,8,11,-5,0,17,26,2,0,6,32,5),or(0,9,11,-5,0,18,28,2,0,7,34,6),or(0,9,12,-6,0,19,29,2,0,7,36,6),or(0,10,13,-6,0,20,31,3,0,8,38,7),or(0,10,13,-6,0,21,33,3,0,8,40,7),or(0,10,14,-6,0,22,35,3,0,8,42,7),or(0,11,14,-7,0,23,36,3,0,9,44,8),or(0,11,15,-7,0,24,38,3,0,9,46,8)],L3={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},LM={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function uk(e){return`${Math.round(e)}ms`}function D3(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function A3(e){const t={...L3,...e.easing},n={...LM,...e.duration};return{getAutoHeightDuration:D3,create:(o=["all"],i={})=>{const{duration:l=n.standard,easing:c=t.easeInOut,delay:u=0,...f}=i;return(Array.isArray(o)?o:[o]).map(h=>`${h} ${typeof l=="string"?l:uk(l)} ${c} ${typeof u=="string"?u:uk(u)}`).join(",")},...e,easing:t,duration:n}}const F3={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function N3(e){return Pi(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function DM(e={}){const t={...e};function n(r){const o=Object.entries(r);for(let i=0;i<o.length;i++){const[l,c]=o[i];!N3(c)||l.startsWith("unstable_")?delete r[l]:Pi(c)&&(r[l]={...c},n(r[l]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
100
|
+
|
|
101
|
+
const theme = ${JSON.stringify(t,null,2)};
|
|
102
|
+
|
|
103
|
+
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
104
|
+
theme.transitions = createTransitions(theme.transitions || {});
|
|
105
|
+
|
|
106
|
+
export default theme;`}function N0(e={},...t){const{breakpoints:n,mixins:r={},spacing:o,palette:i={},transitions:l={},typography:c={},shape:u,...f}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(hl(20));const h=dw(i),p=hh(e);let g=qr(p,{mixins:T3(p.breakpoints,r),palette:h,shadows:z3.slice(),typography:zM(h,c),transitions:A3(l),zIndex:{...F3}});return g=qr(g,f),g=t.reduce((y,b)=>qr(y,b),g),g.unstable_sxConfig={...ph,...f==null?void 0:f.unstable_sxConfig},g.unstable_sx=function(b){return Ta({sx:b,theme:this})},g.toRuntimeSource=DM,g}function _0(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const _3=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=_0(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function AM(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function FM(e){return e==="dark"?_3:[]}function H3(e){const{palette:t={mode:"light"},opacity:n,overlays:r,...o}=e,i=dw(t);return{palette:i,opacity:{...AM(i.mode),...n},overlays:r||FM(i.mode),...o}}function B3(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const W3=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],V3=e=>(t,n)=>{const r=e.rootSelector||":root",o=e.colorSchemeSelector;let i=o;if(o==="class"&&(i=".%s"),o==="data"&&(i="[data-%s]"),o!=null&&o.startsWith("data-")&&!o.includes("%s")&&(i=`[${o}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const l={};return W3(e.cssVarPrefix).forEach(c=>{l[c]=n[c],delete n[c]}),i==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:l}}:i?{[i.replace("%s",t)]:l,[`${r}, ${i.replace("%s",t)}`]:n}:{[r]:{...n,...l}}}if(i&&i!=="media")return`${r}, ${i.replace("%s",String(t))}`}else if(t){if(i==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(i)return i.replace("%s",String(t))}return r};function G3(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function ze(e,t,n){!e[t]&&n&&(e[t]=n)}function sp(e){return typeof e!="string"||!e.startsWith("hsl")?e:wM(e)}function Xi(e,t){`${t}Channel`in e||(e[`${t}Channel`]=op(sp(e[t])))}function U3(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const vi=e=>{try{return e()}catch{}},q3=(e="mui")=>r3(e);function Sv(e,t,n,r){if(!t)return;t=t===!0?{}:t;const o=r==="dark"?"dark":"light";if(!n){e[r]=H3({...t,palette:{mode:o,...t==null?void 0:t.palette}});return}const{palette:i,...l}=N0({...n,palette:{mode:o,...t==null?void 0:t.palette}});return e[r]={...t,palette:i,opacity:{...AM(o),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||FM(o)},l}function K3(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:o=!1,cssVarPrefix:i="mui",shouldSkipGeneratingVar:l=B3,colorSchemeSelector:c=n.light&&n.dark?"media":void 0,rootSelector:u=":root",...f}=e,h=Object.keys(n)[0],p=r||(n.light&&h!=="light"?"light":h),g=q3(i),{[p]:y,light:b,dark:v,...C}=n,S={...C};let j=y;if((p==="dark"&&!("dark"in n)||p==="light"&&!("light"in n))&&(j=!0),!j)throw new Error(hl(21,p));const w=Sv(S,j,f,p);b&&!S.light&&Sv(S,b,void 0,"light"),v&&!S.dark&&Sv(S,v,void 0,"dark");let k={defaultColorScheme:p,...w,cssVarPrefix:i,colorSchemeSelector:c,rootSelector:u,getCssVar:g,colorSchemes:S,font:{...P3(w.typography),...w.font},spacing:U3(f.spacing)};Object.keys(k.colorSchemes).forEach(R=>{const E=k.colorSchemes[R].palette,O=A=>{const N=A.split("-"),F=N[1],L=N[2];return g(A,E[F][L])};if(E.mode==="light"&&(ze(E.common,"background","#fff"),ze(E.common,"onBackground","#000")),E.mode==="dark"&&(ze(E.common,"background","#000"),ze(E.common,"onBackground","#fff")),G3(E,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),E.mode==="light"){ze(E.Alert,"errorColor",Wn(E.error.light,.6)),ze(E.Alert,"infoColor",Wn(E.info.light,.6)),ze(E.Alert,"successColor",Wn(E.success.light,.6)),ze(E.Alert,"warningColor",Wn(E.warning.light,.6)),ze(E.Alert,"errorFilledBg",O("palette-error-main")),ze(E.Alert,"infoFilledBg",O("palette-info-main")),ze(E.Alert,"successFilledBg",O("palette-success-main")),ze(E.Alert,"warningFilledBg",O("palette-warning-main")),ze(E.Alert,"errorFilledColor",vi(()=>E.getContrastText(E.error.main))),ze(E.Alert,"infoFilledColor",vi(()=>E.getContrastText(E.info.main))),ze(E.Alert,"successFilledColor",vi(()=>E.getContrastText(E.success.main))),ze(E.Alert,"warningFilledColor",vi(()=>E.getContrastText(E.warning.main))),ze(E.Alert,"errorStandardBg",Vn(E.error.light,.9)),ze(E.Alert,"infoStandardBg",Vn(E.info.light,.9)),ze(E.Alert,"successStandardBg",Vn(E.success.light,.9)),ze(E.Alert,"warningStandardBg",Vn(E.warning.light,.9)),ze(E.Alert,"errorIconColor",O("palette-error-main")),ze(E.Alert,"infoIconColor",O("palette-info-main")),ze(E.Alert,"successIconColor",O("palette-success-main")),ze(E.Alert,"warningIconColor",O("palette-warning-main")),ze(E.AppBar,"defaultBg",O("palette-grey-100")),ze(E.Avatar,"defaultBg",O("palette-grey-400")),ze(E.Button,"inheritContainedBg",O("palette-grey-300")),ze(E.Button,"inheritContainedHoverBg",O("palette-grey-A100")),ze(E.Chip,"defaultBorder",O("palette-grey-400")),ze(E.Chip,"defaultAvatarColor",O("palette-grey-700")),ze(E.Chip,"defaultIconColor",O("palette-grey-700")),ze(E.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),ze(E.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),ze(E.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),ze(E.LinearProgress,"primaryBg",Vn(E.primary.main,.62)),ze(E.LinearProgress,"secondaryBg",Vn(E.secondary.main,.62)),ze(E.LinearProgress,"errorBg",Vn(E.error.main,.62)),ze(E.LinearProgress,"infoBg",Vn(E.info.main,.62)),ze(E.LinearProgress,"successBg",Vn(E.success.main,.62)),ze(E.LinearProgress,"warningBg",Vn(E.warning.main,.62)),ze(E.Skeleton,"bg",`rgba(${O("palette-text-primaryChannel")} / 0.11)`),ze(E.Slider,"primaryTrack",Vn(E.primary.main,.62)),ze(E.Slider,"secondaryTrack",Vn(E.secondary.main,.62)),ze(E.Slider,"errorTrack",Vn(E.error.main,.62)),ze(E.Slider,"infoTrack",Vn(E.info.main,.62)),ze(E.Slider,"successTrack",Vn(E.success.main,.62)),ze(E.Slider,"warningTrack",Vn(E.warning.main,.62));const A=Um(E.background.default,.8);ze(E.SnackbarContent,"bg",A),ze(E.SnackbarContent,"color",vi(()=>E.getContrastText(A))),ze(E.SpeedDialAction,"fabHoverBg",Um(E.background.paper,.15)),ze(E.StepConnector,"border",O("palette-grey-400")),ze(E.StepContent,"border",O("palette-grey-400")),ze(E.Switch,"defaultColor",O("palette-common-white")),ze(E.Switch,"defaultDisabledColor",O("palette-grey-100")),ze(E.Switch,"primaryDisabledColor",Vn(E.primary.main,.62)),ze(E.Switch,"secondaryDisabledColor",Vn(E.secondary.main,.62)),ze(E.Switch,"errorDisabledColor",Vn(E.error.main,.62)),ze(E.Switch,"infoDisabledColor",Vn(E.info.main,.62)),ze(E.Switch,"successDisabledColor",Vn(E.success.main,.62)),ze(E.Switch,"warningDisabledColor",Vn(E.warning.main,.62)),ze(E.TableCell,"border",Vn(Gm(E.divider,1),.88)),ze(E.Tooltip,"bg",Gm(E.grey[700],.92))}if(E.mode==="dark"){ze(E.Alert,"errorColor",Vn(E.error.light,.6)),ze(E.Alert,"infoColor",Vn(E.info.light,.6)),ze(E.Alert,"successColor",Vn(E.success.light,.6)),ze(E.Alert,"warningColor",Vn(E.warning.light,.6)),ze(E.Alert,"errorFilledBg",O("palette-error-dark")),ze(E.Alert,"infoFilledBg",O("palette-info-dark")),ze(E.Alert,"successFilledBg",O("palette-success-dark")),ze(E.Alert,"warningFilledBg",O("palette-warning-dark")),ze(E.Alert,"errorFilledColor",vi(()=>E.getContrastText(E.error.dark))),ze(E.Alert,"infoFilledColor",vi(()=>E.getContrastText(E.info.dark))),ze(E.Alert,"successFilledColor",vi(()=>E.getContrastText(E.success.dark))),ze(E.Alert,"warningFilledColor",vi(()=>E.getContrastText(E.warning.dark))),ze(E.Alert,"errorStandardBg",Wn(E.error.light,.9)),ze(E.Alert,"infoStandardBg",Wn(E.info.light,.9)),ze(E.Alert,"successStandardBg",Wn(E.success.light,.9)),ze(E.Alert,"warningStandardBg",Wn(E.warning.light,.9)),ze(E.Alert,"errorIconColor",O("palette-error-main")),ze(E.Alert,"infoIconColor",O("palette-info-main")),ze(E.Alert,"successIconColor",O("palette-success-main")),ze(E.Alert,"warningIconColor",O("palette-warning-main")),ze(E.AppBar,"defaultBg",O("palette-grey-900")),ze(E.AppBar,"darkBg",O("palette-background-paper")),ze(E.AppBar,"darkColor",O("palette-text-primary")),ze(E.Avatar,"defaultBg",O("palette-grey-600")),ze(E.Button,"inheritContainedBg",O("palette-grey-800")),ze(E.Button,"inheritContainedHoverBg",O("palette-grey-700")),ze(E.Chip,"defaultBorder",O("palette-grey-700")),ze(E.Chip,"defaultAvatarColor",O("palette-grey-300")),ze(E.Chip,"defaultIconColor",O("palette-grey-300")),ze(E.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),ze(E.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),ze(E.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),ze(E.LinearProgress,"primaryBg",Wn(E.primary.main,.5)),ze(E.LinearProgress,"secondaryBg",Wn(E.secondary.main,.5)),ze(E.LinearProgress,"errorBg",Wn(E.error.main,.5)),ze(E.LinearProgress,"infoBg",Wn(E.info.main,.5)),ze(E.LinearProgress,"successBg",Wn(E.success.main,.5)),ze(E.LinearProgress,"warningBg",Wn(E.warning.main,.5)),ze(E.Skeleton,"bg",`rgba(${O("palette-text-primaryChannel")} / 0.13)`),ze(E.Slider,"primaryTrack",Wn(E.primary.main,.5)),ze(E.Slider,"secondaryTrack",Wn(E.secondary.main,.5)),ze(E.Slider,"errorTrack",Wn(E.error.main,.5)),ze(E.Slider,"infoTrack",Wn(E.info.main,.5)),ze(E.Slider,"successTrack",Wn(E.success.main,.5)),ze(E.Slider,"warningTrack",Wn(E.warning.main,.5));const A=Um(E.background.default,.98);ze(E.SnackbarContent,"bg",A),ze(E.SnackbarContent,"color",vi(()=>E.getContrastText(A))),ze(E.SpeedDialAction,"fabHoverBg",Um(E.background.paper,.15)),ze(E.StepConnector,"border",O("palette-grey-600")),ze(E.StepContent,"border",O("palette-grey-600")),ze(E.Switch,"defaultColor",O("palette-grey-300")),ze(E.Switch,"defaultDisabledColor",O("palette-grey-600")),ze(E.Switch,"primaryDisabledColor",Wn(E.primary.main,.55)),ze(E.Switch,"secondaryDisabledColor",Wn(E.secondary.main,.55)),ze(E.Switch,"errorDisabledColor",Wn(E.error.main,.55)),ze(E.Switch,"infoDisabledColor",Wn(E.info.main,.55)),ze(E.Switch,"successDisabledColor",Wn(E.success.main,.55)),ze(E.Switch,"warningDisabledColor",Wn(E.warning.main,.55)),ze(E.TableCell,"border",Wn(Gm(E.divider,1),.68)),ze(E.Tooltip,"bg",Gm(E.grey[700],.92))}Xi(E.background,"default"),Xi(E.background,"paper"),Xi(E.common,"background"),Xi(E.common,"onBackground"),Xi(E,"divider"),Object.keys(E).forEach(A=>{const N=E[A];A!=="tonalOffset"&&N&&typeof N=="object"&&(N.main&&ze(E[A],"mainChannel",op(sp(N.main))),N.light&&ze(E[A],"lightChannel",op(sp(N.light))),N.dark&&ze(E[A],"darkChannel",op(sp(N.dark))),N.contrastText&&ze(E[A],"contrastTextChannel",op(sp(N.contrastText))),A==="text"&&(Xi(E[A],"primary"),Xi(E[A],"secondary")),A==="action"&&(N.active&&Xi(E[A],"active"),N.selected&&Xi(E[A],"selected")))})}),k=t.reduce((R,E)=>qr(R,E),k);const P={prefix:i,disableCssColorScheme:o,shouldSkipGeneratingVar:l,getSelector:V3(k)},{vars:T,generateThemeVars:$,generateStyleSheets:M}=i3(k,P);return k.vars=T,Object.entries(k.colorSchemes[k.defaultColorScheme]).forEach(([R,E])=>{k[R]=E}),k.generateThemeVars=$,k.generateStyleSheets=M,k.generateSpacing=function(){return pM(f.spacing,Mx(this))},k.getColorSchemeSelector=l3(c),k.spacing=k.generateSpacing(),k.shouldSkipGeneratingVar=l,k.unstable_sxConfig={...ph,...f==null?void 0:f.unstable_sxConfig},k.unstable_sx=function(E){return Ta({sx:E,theme:this})},k.toRuntimeSource=DM,k}function dk(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:dw({...n===!0?{}:n.palette,mode:t})})}function Nx(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:o=n?void 0:{light:!0},defaultColorScheme:i=n==null?void 0:n.mode,...l}=e,c=i||"light",u=o==null?void 0:o[c],f={...o,...n?{[c]:{...typeof u!="boolean"&&u,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return N0(e,...t);let h=n;"palette"in e||f[c]&&(f[c]!==!0?h=f[c].palette:c==="dark"&&(h={mode:"dark"}));const p=N0({...e,palette:h},...t);return p.defaultColorScheme=c,p.colorSchemes=f,p.palette.mode==="light"&&(p.colorSchemes.light={...f.light!==!0&&f.light,palette:p.palette},dk(p,"dark",f.dark)),p.palette.mode==="dark"&&(p.colorSchemes.dark={...f.dark!==!0&&f.dark,palette:p.palette},dk(p,"light",f.light)),p}return!n&&!("light"in f)&&c==="light"&&(f.light=!0),K3({...l,colorSchemes:f,defaultColorScheme:c,...typeof r!="boolean"&&r},...t)}function Q3(e){return String(e).match(/[\d.\-+]*\s*(.*)/)[1]||""}function Y3(e){return parseFloat(e)}const fw=Nx();function Xr(){const e=Dx(fw);return e[Ti]||e}function NM(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const yo=e=>NM(e)&&e!=="classes",Ce=bM({themeId:Ti,defaultTheme:fw,rootShouldForwardProp:yo});function X3({theme:e,...t}){const n=Ti in e?e[Ti]:void 0;return s.jsx(MM,{...t,themeId:n?Ti:void 0,theme:n||e})}const qm={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:Z3}=n3({themeId:Ti,theme:()=>Nx({cssVariables:!0}),colorSchemeStorageKey:qm.colorSchemeStorageKey,modeStorageKey:qm.modeStorageKey,defaultColorScheme:{light:qm.defaultLightColorScheme,dark:qm.defaultDarkColorScheme},resolveTheme:e=>{const t={...e,typography:zM(e.palette,e.typography)};return t.unstable_sx=function(r){return Ta({sx:r,theme:this})},t}}),J3=Z3;function e_({theme:e,...t}){const n=m.useMemo(()=>{if(typeof e=="function")return e;const r=Ti in e?e[Ti]:e;return"colorSchemes"in r?null:"vars"in r?e:{...e,vars:null}},[e]);return n?s.jsx(X3,{theme:n,...t}):s.jsx(J3,{theme:e,...t})}function t_(e){return s.jsx(hM,{...e,defaultTheme:fw,themeId:Ti})}function pw(e){return function(n){return s.jsx(t_,{styles:typeof e=="function"?r=>e({theme:r,...n}):e})}}function n_(){return Ax}function ft(e){return U4(e)}const H0=typeof pw({})=="function",r_=(e,t)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...t&&!e.vars&&{colorScheme:e.palette.mode}}),o_=e=>({color:(e.vars||e).palette.text.primary,...e.typography.body1,backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}}),_M=(e,t=!1)=>{var i,l;const n={};t&&e.colorSchemes&&typeof e.getColorSchemeSelector=="function"&&Object.entries(e.colorSchemes).forEach(([c,u])=>{var h,p;const f=e.getColorSchemeSelector(c);f.startsWith("@")?n[f]={":root":{colorScheme:(h=u.palette)==null?void 0:h.mode}}:n[f.replace(/\s*&/,"")]={colorScheme:(p=u.palette)==null?void 0:p.mode}});let r={html:r_(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...o_(e),"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}},...n};const o=(l=(i=e.components)==null?void 0:i.MuiCssBaseline)==null?void 0:l.styleOverrides;return o&&(r=[r,o]),r},Eg="mui-ecs",s_=e=>{const t=_M(e,!1),n=Array.isArray(t)?t[0]:t;return!e.vars&&n&&(n.html[`:root:has(${Eg})`]={colorScheme:e.palette.mode}),e.colorSchemes&&Object.entries(e.colorSchemes).forEach(([r,o])=>{var l,c;const i=e.getColorSchemeSelector(r);i.startsWith("@")?n[i]={[`:root:not(:has(.${Eg}))`]:{colorScheme:(l=o.palette)==null?void 0:l.mode}}:n[i.replace(/\s*&/,"")]={[`&:not(:has(.${Eg}))`]:{colorScheme:(c=o.palette)==null?void 0:c.mode}}}),t},i_=pw(H0?({theme:e,enableColorScheme:t})=>_M(e,t):({theme:e})=>s_(e));function l_(e){const t=ft({props:e,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=t;return s.jsxs(m.Fragment,{children:[H0&&s.jsx(i_,{enableColorScheme:r}),!H0&&!r&&s.jsx("span",{className:Eg,style:{display:"none"}}),n]})}const hw={dark:{primary:"#14b8a6",primaryLight:"#2dd4bf",primaryDark:"#0d9488",primaryRgb:"20, 184, 166"},light:{primary:"#6366f1",primaryLight:"#818cf8",primaryDark:"#4f46e5",primaryRgb:"99, 102, 241"}},a_=e=>{const t=hw[e];return{MuiButton:{styleOverrides:{root:{textTransform:"none",fontWeight:500,borderRadius:0}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none",borderRadius:0}}},MuiCard:{styleOverrides:{root:{backgroundImage:"none",border:`1px solid ${e==="dark"?"#27272a":"#e4e4e7"}`,borderRadius:0}}},MuiTextField:{defaultProps:{size:"small"},styleOverrides:{root:{"& .MuiOutlinedInput-root":{borderRadius:0}}}},MuiSelect:{defaultProps:{size:"small"},styleOverrides:{root:{borderRadius:0}}},MuiChip:{styleOverrides:{root:{fontWeight:500,borderRadius:16}}},MuiAvatar:{styleOverrides:{root:{borderRadius:"50%"}}},MuiIconButton:{styleOverrides:{root:{borderRadius:"50%"}}},MuiTableCell:{styleOverrides:{root:{borderColor:e==="dark"?"#27272a":"#e4e4e7"},head:{fontWeight:600,backgroundColor:e==="dark"?"#18181b":"#f4f4f5"}}},MuiDrawer:{styleOverrides:{paper:{borderRight:`1px solid ${e==="dark"?"#27272a":"#e4e4e7"}`,borderRadius:0}}},MuiListItemButton:{styleOverrides:{root:{borderRadius:0,marginBottom:4,"&.Mui-selected":{backgroundColor:`rgba(${t.primaryRgb}, 0.15)`,"&:hover":{backgroundColor:`rgba(${t.primaryRgb}, 0.25)`}}}}},MuiDialog:{styleOverrides:{paper:{borderRadius:0}}},MuiAlert:{styleOverrides:{root:{borderRadius:0}}},MuiMenu:{styleOverrides:{paper:{borderRadius:0}}},MuiAutocomplete:{styleOverrides:{paper:{borderRadius:0},inputRoot:{borderRadius:0}}},MuiTabs:{styleOverrides:{root:{borderRadius:0}}},MuiTab:{styleOverrides:{root:{borderRadius:0}}}}},HM=e=>{const t=hw[e];return Nx({palette:{mode:e,primary:{main:t.primary,light:t.primaryLight,dark:t.primaryDark,contrastText:"#fff"},secondary:{main:"#f97316",light:"#fb923c",dark:"#ea580c"},error:{main:"#ef4444",light:"#f87171",dark:"#dc2626"},warning:{main:"#f59e0b",light:"#fbbf24",dark:"#d97706"},success:{main:"#10b981",light:"#34d399",dark:"#059669"},background:e==="dark"?{default:"#09090b",paper:"rgb(20, 25, 27)"}:{default:"#fafafa",paper:"#ffffff"},text:e==="dark"?{primary:"#fafafa",secondary:"#a1a1aa"}:{primary:"#18181b",secondary:"#71717a"},divider:e==="dark"?"#27272a":"#e4e4e7"},typography:{fontFamily:'"Inter", "Roboto", "Helvetica", "Arial", sans-serif',h1:{fontWeight:600},h2:{fontWeight:600},h3:{fontWeight:600},h4:{fontWeight:600},h5:{fontWeight:600},h6:{fontWeight:600}},shape:{borderRadius:0},components:a_(e)})};HM("dark");const fk=e=>{let t;const n=new Set,r=(f,h)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const g=t;t=h??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,g))}},o=()=>t,c={setState:r,getState:o,getInitialState:()=>u,subscribe:f=>(n.add(f),()=>n.delete(f))},u=t=e(r,o,c);return c},c_=(e=>e?fk(e):fk),u_=e=>e;function d_(e,t=u_){const n=br.useSyncExternalStore(e.subscribe,br.useCallback(()=>t(e.getState()),[e,t]),br.useCallback(()=>t(e.getInitialState()),[e,t]));return br.useDebugValue(n),n}const pk=e=>{const t=c_(e),n=r=>d_(t,r);return Object.assign(n,t),n},Aa=(e=>e?pk(e):pk);function f_(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var i;const l=u=>u===null?null:JSON.parse(u,void 0),c=(i=n.getItem(o))!=null?i:null;return c instanceof Promise?c.then(l):l(c)},setItem:(o,i)=>n.setItem(o,JSON.stringify(i,void 0)),removeItem:o=>n.removeItem(o)}}const B0=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return B0(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return B0(r)(n)}}}},p_=(e,t)=>(n,r,o)=>{let i={storage:f_(()=>localStorage),partialize:v=>v,version:0,merge:(v,C)=>({...C,...v}),...t},l=!1;const c=new Set,u=new Set;let f=i.storage;if(!f)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...v)},r,o);const h=()=>{const v=i.partialize({...r()});return f.setItem(i.name,{state:v,version:i.version})},p=o.setState;o.setState=(v,C)=>(p(v,C),h());const g=e((...v)=>(n(...v),h()),r,o);o.getInitialState=()=>g;let y;const b=()=>{var v,C;if(!f)return;l=!1,c.forEach(j=>{var w;return j((w=r())!=null?w:g)});const S=((C=i.onRehydrateStorage)==null?void 0:C.call(i,(v=r())!=null?v:g))||void 0;return B0(f.getItem.bind(f))(i.name).then(j=>{if(j)if(typeof j.version=="number"&&j.version!==i.version){if(i.migrate){const w=i.migrate(j.state,j.version);return w instanceof Promise?w.then(k=>[!0,k]):[!0,w]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,j.state];return[!1,void 0]}).then(j=>{var w;const[k,P]=j;if(y=i.merge(P,(w=r())!=null?w:g),n(y,!0),k)return h()}).then(()=>{S==null||S(y,void 0),y=r(),l=!0,u.forEach(j=>j(y))}).catch(j=>{S==null||S(void 0,j)})};return o.persist={setOptions:v=>{i={...i,...v},v.storage&&(f=v.storage)},clearStorage:()=>{f==null||f.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>b(),hasHydrated:()=>l,onHydrate:v=>(c.add(v),()=>{c.delete(v)}),onFinishHydration:v=>(u.add(v),()=>{u.delete(v)})},i.skipHydration||b(),y||g},xh=p_,BM=Aa()(xh(e=>({mode:"dark",toggleMode:()=>e(t=>({mode:t.mode==="dark"?"light":"dark"})),setMode:t=>e({mode:t})}),{name:"dbnexus-theme-mode"})),tt=K4;function h_(e){return ct("MuiSvgIcon",e)}ut("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const m_=e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root",t!=="inherit"&&`color${Pe(t)}`,`fontSize${Pe(n)}`]};return Be(o,h_,r)},g_=Ce("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Pe(n.color)}`],t[`fontSize${Pe(n.fontSize)}`]]}})(tt(({theme:e})=>{var t,n,r,o,i,l,c,u,f,h,p,g,y,b;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(o=(t=e.transitions)==null?void 0:t.create)==null?void 0:o.call(t,"fill",{duration:(r=(n=(e.vars??e).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:v=>!v.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((l=(i=e.typography)==null?void 0:i.pxToRem)==null?void 0:l.call(i,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((u=(c=e.typography)==null?void 0:c.pxToRem)==null?void 0:u.call(c,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((h=(f=e.typography)==null?void 0:f.pxToRem)==null?void 0:h.call(f,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,v])=>v&&v.main).map(([v])=>{var C,S;return{props:{color:v},style:{color:(S=(C=(e.vars??e).palette)==null?void 0:C[v])==null?void 0:S.main}}}),{props:{color:"action"},style:{color:(g=(p=(e.vars??e).palette)==null?void 0:p.action)==null?void 0:g.active}},{props:{color:"disabled"},style:{color:(b=(y=(e.vars??e).palette)==null?void 0:y.action)==null?void 0:b.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),W0=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiSvgIcon"}),{children:o,className:i,color:l="inherit",component:c="svg",fontSize:u="medium",htmlColor:f,inheritViewBox:h=!1,titleAccess:p,viewBox:g="0 0 24 24",...y}=r,b=m.isValidElement(o)&&o.type==="svg",v={...r,color:l,component:c,fontSize:u,instanceFontSize:t.fontSize,inheritViewBox:h,viewBox:g,hasSvgAsChild:b},C={};h||(C.viewBox=g);const S=m_(v);return s.jsxs(g_,{as:c,className:Me(S.root,i),focusable:"false",color:f,"aria-hidden":p?void 0:!0,role:p?"img":void 0,ref:n,...C,...y,...b&&o.props,ownerState:v,children:[b?o.props.children:o,p?s.jsx("title",{children:p}):null]})});W0.muiName="SvgIcon";function _e(e,t){function n(r,o){return s.jsx(W0,{"data-testid":`${t}Icon`,ref:o,...r,children:e})}return n.muiName=W0.muiName,m.memo(m.forwardRef(n))}function mw(e,t){if(!e)return t;if(typeof e=="function"||typeof t=="function")return o=>{const i=typeof t=="function"?t(o):t,l=typeof e=="function"?e({...o,...i}):e,c=Me(o==null?void 0:o.className,i==null?void 0:i.className,l==null?void 0:l.className);return{...i,...l,...!!c&&{className:c},...(i==null?void 0:i.style)&&(l==null?void 0:l.style)&&{style:{...i.style,...l.style}},...(i==null?void 0:i.sx)&&(l==null?void 0:l.sx)&&{sx:[...Array.isArray(i.sx)?i.sx:[i.sx],...Array.isArray(l.sx)?l.sx:[l.sx]]}}};const n=t,r=Me(n==null?void 0:n.className,e==null?void 0:e.className);return{...t,...e,...!!r&&{className:r},...(n==null?void 0:n.style)&&(e==null?void 0:e.style)&&{style:{...n.style,...e.style}},...(n==null?void 0:n.sx)&&(e==null?void 0:e.sx)&&{sx:[...Array.isArray(n.sx)?n.sx:[n.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}function St(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function V0(e,t){return V0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},V0(e,t)}function WM(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,V0(e,t)}const hk={disabled:!1},Ug=br.createContext(null);var x_=function(t){return t.scrollTop},ip="unmounted",sc="exited",ic="entering",Du="entered",G0="exiting",Bs=(function(e){WM(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var l=o,c=l&&!l.isMounting?r.enter:r.appear,u;return i.appearStatus=null,r.in?c?(u=sc,i.appearStatus=ic):u=Du:r.unmountOnExit||r.mountOnEnter?u=ip:u=sc,i.state={status:u},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var l=o.in;return l&&i.status===ip?{status:sc}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var l=this.state.status;this.props.in?l!==ic&&l!==Du&&(i=ic):(l===ic||l===Du)&&(i=G0)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,l,c;return i=l=c=o,o!=null&&typeof o!="number"&&(i=o.exit,l=o.enter,c=o.appear!==void 0?o.appear:l),{exit:i,enter:l,appear:c}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===ic){if(this.props.unmountOnExit||this.props.mountOnEnter){var l=this.props.nodeRef?this.props.nodeRef.current:Wm.findDOMNode(this);l&&x_(l)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===sc&&this.setState({status:ip})},n.performEnter=function(o){var i=this,l=this.props.enter,c=this.context?this.context.isMounting:o,u=this.props.nodeRef?[c]:[Wm.findDOMNode(this),c],f=u[0],h=u[1],p=this.getTimeouts(),g=c?p.appear:p.enter;if(!o&&!l||hk.disabled){this.safeSetState({status:Du},function(){i.props.onEntered(f)});return}this.props.onEnter(f,h),this.safeSetState({status:ic},function(){i.props.onEntering(f,h),i.onTransitionEnd(g,function(){i.safeSetState({status:Du},function(){i.props.onEntered(f,h)})})})},n.performExit=function(){var o=this,i=this.props.exit,l=this.getTimeouts(),c=this.props.nodeRef?void 0:Wm.findDOMNode(this);if(!i||hk.disabled){this.safeSetState({status:sc},function(){o.props.onExited(c)});return}this.props.onExit(c),this.safeSetState({status:G0},function(){o.props.onExiting(c),o.onTransitionEnd(l.exit,function(){o.safeSetState({status:sc},function(){o.props.onExited(c)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,l=!0;return this.nextCallback=function(c){l&&(l=!1,i.nextCallback=null,o(c))},this.nextCallback.cancel=function(){l=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var l=this.props.nodeRef?this.props.nodeRef.current:Wm.findDOMNode(this),c=o==null&&!this.props.addEndListener;if(!l||c){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[l,this.nextCallback],f=u[0],h=u[1];this.props.addEndListener(f,h)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===ip)return null;var i=this.props,l=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var c=St(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return br.createElement(Ug.Provider,{value:null},typeof l=="function"?l(o,c):br.cloneElement(br.Children.only(l),c))},t})(br.Component);Bs.contextType=Ug;Bs.propTypes={};function Iu(){}Bs.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Iu,onEntering:Iu,onEntered:Iu,onExit:Iu,onExiting:Iu,onExited:Iu};Bs.UNMOUNTED=ip;Bs.EXITED=sc;Bs.ENTERING=ic;Bs.ENTERED=Du;Bs.EXITING=G0;function y_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gw(e,t){var n=function(i){return t&&m.isValidElement(i)?t(i):i},r=Object.create(null);return e&&m.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function b_(e,t){e=e||{},t=t||{};function n(h){return h in t?t[h]:e[h]}var r=Object.create(null),o=[];for(var i in e)i in t?o.length&&(r[i]=o,o=[]):o.push(i);var l,c={};for(var u in t){if(r[u])for(l=0;l<r[u].length;l++){var f=r[u][l];c[r[u][l]]=n(f)}c[u]=n(u)}for(l=0;l<o.length;l++)c[o[l]]=n(o[l]);return c}function pc(e,t,n){return n[t]!=null?n[t]:e.props[t]}function v_(e,t){return gw(e.children,function(n){return m.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:pc(n,"appear",e),enter:pc(n,"enter",e),exit:pc(n,"exit",e)})})}function C_(e,t,n){var r=gw(e.children),o=b_(t,r);return Object.keys(o).forEach(function(i){var l=o[i];if(m.isValidElement(l)){var c=i in t,u=i in r,f=t[i],h=m.isValidElement(f)&&!f.props.in;u&&(!c||h)?o[i]=m.cloneElement(l,{onExited:n.bind(null,l),in:!0,exit:pc(l,"exit",e),enter:pc(l,"enter",e)}):!u&&c&&!h?o[i]=m.cloneElement(l,{in:!1}):u&&c&&m.isValidElement(f)&&(o[i]=m.cloneElement(l,{onExited:n.bind(null,l),in:f.props.in,exit:pc(l,"exit",e),enter:pc(l,"enter",e)}))}}),o}var w_=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},S_={component:"div",childFactory:function(t){return t}},xw=(function(e){WM(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var l=i.handleExited.bind(y_(i));return i.state={contextValue:{isMounting:!0},handleExited:l,firstRender:!0},i}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,i){var l=i.children,c=i.handleExited,u=i.firstRender;return{children:u?v_(o,c):C_(o,l,c),firstRender:!1}},n.handleExited=function(o,i){var l=gw(this.props.children);o.key in l||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(c){var u=q({},c.children);return delete u[o.key],{children:u}}))},n.render=function(){var o=this.props,i=o.component,l=o.childFactory,c=St(o,["component","childFactory"]),u=this.state.contextValue,f=w_(this.state.children).map(l);return delete c.appear,delete c.enter,delete c.exit,i===null?br.createElement(Ug.Provider,{value:u},f):br.createElement(Ug.Provider,{value:u},br.createElement(i,c,f))},t})(br.Component);xw.propTypes={};xw.defaultProps=S_;const yw=e=>e.scrollTop;function Ma(e,t){const{timeout:n,easing:r,style:o={}}=e;return{duration:o.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:o.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:o.transitionDelay}}function j_(e){return ct("MuiCollapse",e)}ut("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const k_=e=>{const{orientation:t,classes:n}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return Be(r,j_,n)},I_=Ce("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(tt(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),E_=Ce("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),P_=Ce("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(e,t)=>t.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Di=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiCollapse"}),{addEndListener:o,children:i,className:l,collapsedSize:c="0px",component:u,easing:f,in:h,onEnter:p,onEntered:g,onEntering:y,onExit:b,onExited:v,onExiting:C,orientation:S="vertical",style:j,timeout:w=LM.standard,TransitionComponent:k=Bs,...P}=r,T={...r,orientation:S,collapsedSize:c},$=k_(T),M=Xr(),R=Po(),E=m.useRef(null),O=m.useRef(),A=typeof c=="number"?`${c}px`:c,N=S==="horizontal",F=N?"width":"height",L=m.useRef(null),D=Pn(n,L),H=ne=>re=>{if(ne){const Y=L.current;re===void 0?ne(Y):ne(Y,re)}},B=()=>E.current?E.current[N?"clientWidth":"clientHeight"]:0,V=H((ne,re)=>{E.current&&N&&(E.current.style.position="absolute"),ne.style[F]=A,p&&p(ne,re)}),G=H((ne,re)=>{const Y=B();E.current&&N&&(E.current.style.position="");const{duration:ie,easing:ce}=Ma({style:j,timeout:w,easing:f},{mode:"enter"});if(w==="auto"){const he=M.transitions.getAutoHeightDuration(Y);ne.style.transitionDuration=`${he}ms`,O.current=he}else ne.style.transitionDuration=typeof ie=="string"?ie:`${ie}ms`;ne.style[F]=`${Y}px`,ne.style.transitionTimingFunction=ce,y&&y(ne,re)}),_=H((ne,re)=>{ne.style[F]="auto",g&&g(ne,re)}),U=H(ne=>{ne.style[F]=`${B()}px`,b&&b(ne)}),Z=H(v),Q=H(ne=>{const re=B(),{duration:Y,easing:ie}=Ma({style:j,timeout:w,easing:f},{mode:"exit"});if(w==="auto"){const ce=M.transitions.getAutoHeightDuration(re);ne.style.transitionDuration=`${ce}ms`,O.current=ce}else ne.style.transitionDuration=typeof Y=="string"?Y:`${Y}ms`;ne.style[F]=A,ne.style.transitionTimingFunction=ie,C&&C(ne)}),ee=ne=>{w==="auto"&&R.start(O.current||0,ne),o&&o(L.current,ne)};return s.jsx(k,{in:h,onEnter:V,onEntered:_,onEntering:G,onExit:U,onExited:Z,onExiting:Q,addEndListener:ee,nodeRef:L,timeout:w==="auto"?null:w,...P,children:(ne,{ownerState:re,...Y})=>s.jsx(I_,{as:u,className:Me($.root,l,{entered:$.entered,exited:!h&&A==="0px"&&$.hidden}[ne]),style:{[N?"minWidth":"minHeight"]:A,...j},ref:D,ownerState:{...T,state:ne},...Y,children:s.jsx(E_,{ownerState:{...T,state:ne},className:$.wrapper,ref:E,children:s.jsx(P_,{ownerState:{...T,state:ne},className:$.wrapperInner,children:i})})})})});Di&&(Di.muiSupportAuto=!0);function T_(e){return ct("MuiPaper",e)}ut("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const M_=e=>{const{square:t,elevation:n,variant:r,classes:o}=e,i={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return Be(i,T_,o)},R_=Ce("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(tt(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:t})=>!t.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),Un=m.forwardRef(function(t,n){var y;const r=ft({props:t,name:"MuiPaper"}),o=Xr(),{className:i,component:l="div",elevation:c=1,square:u=!1,variant:f="elevation",...h}=r,p={...r,component:l,elevation:c,square:u,variant:f},g=M_(p);return s.jsx(R_,{as:l,ownerState:p,className:Me(g.root,i),ref:n,...h,style:{...f==="elevation"&&{"--Paper-shadow":(o.vars||o).shadows[c],...o.vars&&{"--Paper-overlay":(y=o.vars.overlays)==null?void 0:y[c]},...!o.vars&&o.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${Ye("#fff",_0(c))}, ${Ye("#fff",_0(c))})`}},...h.style}})}),VM=m.createContext({});function at(e,t){const{className:n,elementType:r,ownerState:o,externalForwardedProps:i,internalForwardedProps:l,shouldForwardComponentProp:c=!1,...u}=t,{component:f,slots:h={[e]:void 0},slotProps:p={[e]:void 0},...g}=i,y=h[e]||r,b=IM(p[e],o),{props:{component:v,...C},internalRef:S}=kM({className:n,...u,externalForwardedProps:e==="root"?g:void 0,externalSlotProps:b}),j=Pn(S,b==null?void 0:b.ref,t.ref),w=e==="root"?v||f:v,k=jM(y,{...e==="root"&&!f&&!h[e]&&l,...e!=="root"&&!h[e]&&l,...C,...w&&!c&&{as:w},...w&&c&&{component:w},ref:j},o);return[y,k]}function $_(e){return ct("MuiAccordion",e)}const Km=ut("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),O_=e=>{const{classes:t,square:n,expanded:r,disabled:o,disableGutters:i}=e;return Be({root:["root",!n&&"rounded",r&&"expanded",o&&"disabled",!i&&"gutters"],heading:["heading"],region:["region"]},$_,t)},z_=Ce(Un,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Km.region}`]:t.region},t.root,!n.square&&t.rounded,!n.disableGutters&&t.gutters]}})(tt(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{position:"relative",transition:e.transitions.create(["margin"],t),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(e.vars||e).palette.divider,transition:e.transitions.create(["opacity","background-color"],t)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${Km.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${Km.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}}),tt(({theme:e})=>({variants:[{props:t=>!t.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(e.vars||e).shape.borderRadius,borderBottomRightRadius:(e.vars||e).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:t=>!t.disableGutters,style:{[`&.${Km.expanded}`]:{margin:"16px 0"}}}]}))),L_=Ce("h3",{name:"MuiAccordion",slot:"Heading",overridesResolver:(e,t)=>t.heading})({all:"unset"}),GM=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiAccordion"}),{children:o,className:i,defaultExpanded:l=!1,disabled:c=!1,disableGutters:u=!1,expanded:f,onChange:h,square:p=!1,slots:g={},slotProps:y={},TransitionComponent:b,TransitionProps:v,...C}=r,[S,j]=va({controlled:f,default:l,name:"Accordion",state:"expanded"}),w=m.useCallback(B=>{j(!S),h&&h(B,!S)},[S,h,j]),[k,...P]=m.Children.toArray(o),T=m.useMemo(()=>({expanded:S,disabled:c,disableGutters:u,toggle:w}),[S,c,u,w]),$={...r,square:p,disabled:c,disableGutters:u,expanded:S},M=O_($),R={transition:b,...g},E={transition:v,...y},O={slots:R,slotProps:E},[A,N]=at("root",{elementType:z_,externalForwardedProps:{...O,...C},className:Me(M.root,i),shouldForwardComponentProp:!0,ownerState:$,ref:n,additionalProps:{square:p}}),[F,L]=at("heading",{elementType:L_,externalForwardedProps:O,className:M.heading,ownerState:$}),[D,H]=at("transition",{elementType:Di,externalForwardedProps:O,ownerState:$});return s.jsxs(A,{...N,children:[s.jsx(F,{...L,children:s.jsx(VM.Provider,{value:T,children:k})}),s.jsx(D,{in:S,timeout:"auto",...H,children:s.jsx("div",{"aria-labelledby":k.props.id,id:k.props["aria-controls"],role:"region",className:M.region,children:P})})]})});function D_(e){return ct("MuiAccordionDetails",e)}ut("MuiAccordionDetails",["root"]);const A_=e=>{const{classes:t}=e;return Be({root:["root"]},D_,t)},F_=Ce("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(e,t)=>t.root})(tt(({theme:e})=>({padding:e.spacing(1,2,2)}))),UM=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiAccordionDetails"}),{className:o,...i}=r,l=r,c=A_(l);return s.jsx(F_,{className:Me(c.root,o),ref:n,ownerState:l,...i})});class qg{constructor(){Df(this,"mountEffect",()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())});this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}static create(){return new qg}static use(){const t=Hs(qg.create).current,[n,r]=m.useState(!1);return t.shouldMount=n,t.setShouldMount=r,m.useEffect(t.mountEffect,[n]),t}mount(){return this.mounted||(this.mounted=__(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}start(...t){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.start(...t)})}stop(...t){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.stop(...t)})}pulsate(...t){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.pulsate(...t)})}}function N_(){return qg.use()}function __(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function H_(e){const{className:t,classes:n,pulsate:r=!1,rippleX:o,rippleY:i,rippleSize:l,in:c,onExited:u,timeout:f}=e,[h,p]=m.useState(!1),g=Me(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),y={width:l,height:l,top:-(l/2)+i,left:-(l/2)+o},b=Me(n.child,h&&n.childLeaving,r&&n.childPulsate);return!c&&!h&&p(!0),m.useEffect(()=>{if(!c&&u!=null){const v=setTimeout(u,f);return()=>{clearTimeout(v)}}},[u,c,f]),s.jsx("span",{className:g,style:y,children:s.jsx("span",{className:b})})}const Is=ut("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),U0=550,B_=80,W_=Hi`
|
|
107
|
+
0% {
|
|
108
|
+
transform: scale(0);
|
|
109
|
+
opacity: 0.1;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
100% {
|
|
113
|
+
transform: scale(1);
|
|
114
|
+
opacity: 0.3;
|
|
115
|
+
}
|
|
116
|
+
`,V_=Hi`
|
|
117
|
+
0% {
|
|
118
|
+
opacity: 1;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
100% {
|
|
122
|
+
opacity: 0;
|
|
123
|
+
}
|
|
124
|
+
`,G_=Hi`
|
|
125
|
+
0% {
|
|
126
|
+
transform: scale(1);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
50% {
|
|
130
|
+
transform: scale(0.92);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
100% {
|
|
134
|
+
transform: scale(1);
|
|
135
|
+
}
|
|
136
|
+
`,U_=Ce("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),q_=Ce(H_,{name:"MuiTouchRipple",slot:"Ripple"})`
|
|
137
|
+
opacity: 0;
|
|
138
|
+
position: absolute;
|
|
139
|
+
|
|
140
|
+
&.${Is.rippleVisible} {
|
|
141
|
+
opacity: 0.3;
|
|
142
|
+
transform: scale(1);
|
|
143
|
+
animation-name: ${W_};
|
|
144
|
+
animation-duration: ${U0}ms;
|
|
145
|
+
animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&.${Is.ripplePulsate} {
|
|
149
|
+
animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
& .${Is.child} {
|
|
153
|
+
opacity: 1;
|
|
154
|
+
display: block;
|
|
155
|
+
width: 100%;
|
|
156
|
+
height: 100%;
|
|
157
|
+
border-radius: 50%;
|
|
158
|
+
background-color: currentColor;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
& .${Is.childLeaving} {
|
|
162
|
+
opacity: 0;
|
|
163
|
+
animation-name: ${V_};
|
|
164
|
+
animation-duration: ${U0}ms;
|
|
165
|
+
animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
& .${Is.childPulsate} {
|
|
169
|
+
position: absolute;
|
|
170
|
+
/* @noflip */
|
|
171
|
+
left: 0px;
|
|
172
|
+
top: 0;
|
|
173
|
+
animation-name: ${G_};
|
|
174
|
+
animation-duration: 2500ms;
|
|
175
|
+
animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
|
|
176
|
+
animation-iteration-count: infinite;
|
|
177
|
+
animation-delay: 200ms;
|
|
178
|
+
}
|
|
179
|
+
`,K_=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:l,...c}=r,[u,f]=m.useState([]),h=m.useRef(0),p=m.useRef(null);m.useEffect(()=>{p.current&&(p.current(),p.current=null)},[u]);const g=m.useRef(!1),y=Po(),b=m.useRef(null),v=m.useRef(null),C=m.useCallback(k=>{const{pulsate:P,rippleX:T,rippleY:$,rippleSize:M,cb:R}=k;f(E=>[...E,s.jsx(q_,{classes:{ripple:Me(i.ripple,Is.ripple),rippleVisible:Me(i.rippleVisible,Is.rippleVisible),ripplePulsate:Me(i.ripplePulsate,Is.ripplePulsate),child:Me(i.child,Is.child),childLeaving:Me(i.childLeaving,Is.childLeaving),childPulsate:Me(i.childPulsate,Is.childPulsate)},timeout:U0,pulsate:P,rippleX:T,rippleY:$,rippleSize:M},h.current)]),h.current+=1,p.current=R},[i]),S=m.useCallback((k={},P={},T=()=>{})=>{const{pulsate:$=!1,center:M=o||P.pulsate,fakeElement:R=!1}=P;if((k==null?void 0:k.type)==="mousedown"&&g.current){g.current=!1;return}(k==null?void 0:k.type)==="touchstart"&&(g.current=!0);const E=R?null:v.current,O=E?E.getBoundingClientRect():{width:0,height:0,left:0,top:0};let A,N,F;if(M||k===void 0||k.clientX===0&&k.clientY===0||!k.clientX&&!k.touches)A=Math.round(O.width/2),N=Math.round(O.height/2);else{const{clientX:L,clientY:D}=k.touches&&k.touches.length>0?k.touches[0]:k;A=Math.round(L-O.left),N=Math.round(D-O.top)}if(M)F=Math.sqrt((2*O.width**2+O.height**2)/3),F%2===0&&(F+=1);else{const L=Math.max(Math.abs((E?E.clientWidth:0)-A),A)*2+2,D=Math.max(Math.abs((E?E.clientHeight:0)-N),N)*2+2;F=Math.sqrt(L**2+D**2)}k!=null&&k.touches?b.current===null&&(b.current=()=>{C({pulsate:$,rippleX:A,rippleY:N,rippleSize:F,cb:T})},y.start(B_,()=>{b.current&&(b.current(),b.current=null)})):C({pulsate:$,rippleX:A,rippleY:N,rippleSize:F,cb:T})},[o,C,y]),j=m.useCallback(()=>{S({},{pulsate:!0})},[S]),w=m.useCallback((k,P)=>{if(y.clear(),(k==null?void 0:k.type)==="touchend"&&b.current){b.current(),b.current=null,y.start(0,()=>{w(k,P)});return}b.current=null,f(T=>T.length>0?T.slice(1):T),p.current=P},[y]);return m.useImperativeHandle(n,()=>({pulsate:j,start:S,stop:w}),[j,S,w]),s.jsx(U_,{className:Me(Is.root,i.root,l),ref:v,...c,children:s.jsx(xw,{component:null,exit:!0,children:u})})});function Q_(e){return ct("MuiButtonBase",e)}const Y_=ut("MuiButtonBase",["root","disabled","focusVisible"]),X_=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,l=Be({root:["root",t&&"disabled",n&&"focusVisible"]},Q_,o);return n&&r&&(l.root+=` ${r}`),l},Z_=Ce("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Y_.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Ds=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:l,className:c,component:u="button",disabled:f=!1,disableRipple:h=!1,disableTouchRipple:p=!1,focusRipple:g=!1,focusVisibleClassName:y,LinkComponent:b="a",onBlur:v,onClick:C,onContextMenu:S,onDragLeave:j,onFocus:w,onFocusVisible:k,onKeyDown:P,onKeyUp:T,onMouseDown:$,onMouseLeave:M,onMouseUp:R,onTouchEnd:E,onTouchMove:O,onTouchStart:A,tabIndex:N=0,TouchRippleProps:F,touchRippleRef:L,type:D,...H}=r,B=m.useRef(null),V=N_(),G=Pn(V.ref,L),[_,U]=m.useState(!1);f&&_&&U(!1),m.useImperativeHandle(o,()=>({focusVisible:()=>{U(!0),B.current.focus()}}),[]);const Z=V.shouldMount&&!h&&!f;m.useEffect(()=>{_&&g&&!h&&V.pulsate()},[h,g,_,V]);const Q=Zi(V,"start",$,p),ee=Zi(V,"stop",S,p),ne=Zi(V,"stop",j,p),re=Zi(V,"stop",R,p),Y=Zi(V,"stop",De=>{_&&De.preventDefault(),M&&M(De)},p),ie=Zi(V,"start",A,p),ce=Zi(V,"stop",E,p),he=Zi(V,"stop",O,p),de=Zi(V,"stop",De=>{pd(De.target)||U(!1),v&&v(De)},!1),le=Vt(De=>{B.current||(B.current=De.currentTarget),pd(De.target)&&(U(!0),k&&k(De)),w&&w(De)}),ge=()=>{const De=B.current;return u&&u!=="button"&&!(De.tagName==="A"&&De.href)},Se=Vt(De=>{g&&!De.repeat&&_&&De.key===" "&&V.stop(De,()=>{V.start(De)}),De.target===De.currentTarget&&ge()&&De.key===" "&&De.preventDefault(),P&&P(De),De.target===De.currentTarget&&ge()&&De.key==="Enter"&&!f&&(De.preventDefault(),C&&C(De))}),ke=Vt(De=>{g&&De.key===" "&&_&&!De.defaultPrevented&&V.stop(De,()=>{V.pulsate(De)}),T&&T(De),C&&De.target===De.currentTarget&&ge()&&De.key===" "&&!De.defaultPrevented&&C(De)});let we=u;we==="button"&&(H.href||H.to)&&(we=b);const Oe={};we==="button"?(Oe.type=D===void 0?"button":D,Oe.disabled=f):(!H.href&&!H.to&&(Oe.role="button"),f&&(Oe["aria-disabled"]=f));const be=Pn(n,B),Fe={...r,centerRipple:i,component:u,disabled:f,disableRipple:h,disableTouchRipple:p,focusRipple:g,tabIndex:N,focusVisible:_},Ve=X_(Fe);return s.jsxs(Z_,{as:we,className:Me(Ve.root,c),ownerState:Fe,onBlur:de,onClick:C,onContextMenu:ee,onFocus:le,onKeyDown:Se,onKeyUp:ke,onMouseDown:Q,onMouseLeave:Y,onMouseUp:re,onDragLeave:ne,onTouchEnd:ce,onTouchMove:he,onTouchStart:ie,ref:be,tabIndex:f?-1:N,type:D,...Oe,...H,children:[l,Z?s.jsx(K_,{ref:G,center:i,...F}):null]})});function Zi(e,t,n,r=!1){return Vt(o=>(n&&n(o),r||e[t](o),!0))}function J_(e){return ct("MuiAccordionSummary",e)}const Nu=ut("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),eH=e=>{const{classes:t,expanded:n,disabled:r,disableGutters:o}=e;return Be({root:["root",n&&"expanded",r&&"disabled",!o&&"gutters"],focusVisible:["focusVisible"],content:["content",n&&"expanded",!o&&"contentGutters"],expandIconWrapper:["expandIconWrapper",n&&"expanded"]},J_,t)},tH=Ce(Ds,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(e,t)=>t.root})(tt(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:e.spacing(0,2),transition:e.transitions.create(["min-height","background-color"],t),[`&.${Nu.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Nu.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`&:hover:not(.${Nu.disabled})`]:{cursor:"pointer"},variants:[{props:n=>!n.disableGutters,style:{[`&.${Nu.expanded}`]:{minHeight:64}}}]}})),nH=Ce("span",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(e,t)=>t.content})(tt(({theme:e})=>({display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:t=>!t.disableGutters,style:{transition:e.transitions.create(["margin"],{duration:e.transitions.duration.shortest}),[`&.${Nu.expanded}`]:{margin:"20px 0"}}}]}))),rH=Ce("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(e,t)=>t.expandIconWrapper})(tt(({theme:e})=>({display:"flex",color:(e.vars||e).palette.action.active,transform:"rotate(0deg)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest}),[`&.${Nu.expanded}`]:{transform:"rotate(180deg)"}}))),qM=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiAccordionSummary"}),{children:o,className:i,expandIcon:l,focusVisibleClassName:c,onClick:u,slots:f,slotProps:h,...p}=r,{disabled:g=!1,disableGutters:y,expanded:b,toggle:v}=m.useContext(VM),C=E=>{v&&v(E),u&&u(E)},S={...r,expanded:b,disabled:g,disableGutters:y},j=eH(S),w={slots:f,slotProps:h},[k,P]=at("root",{ref:n,shouldForwardComponentProp:!0,className:Me(j.root,i),elementType:tH,externalForwardedProps:{...w,...p},ownerState:S,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:g,"aria-expanded":b,focusVisibleClassName:Me(j.focusVisible,c)},getSlotProps:E=>({...E,onClick:O=>{var A;(A=E.onClick)==null||A.call(E,O),C(O)}})}),[T,$]=at("content",{className:j.content,elementType:nH,externalForwardedProps:w,ownerState:S}),[M,R]=at("expandIconWrapper",{className:j.expandIconWrapper,elementType:rH,externalForwardedProps:w,ownerState:S});return s.jsxs(k,{...P,children:[s.jsx(T,{...$,children:o}),l&&s.jsx(M,{...R,children:l})]})});function oH(e){return typeof e.main=="string"}function sH(e,t=[]){if(!oH(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function qn(e=[]){return([,t])=>t&&sH(t,e)}function iH(e){return ct("MuiAlert",e)}const mk=ut("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function lH(e){return ct("MuiCircularProgress",e)}ut("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const Yl=44,q0=Hi`
|
|
180
|
+
0% {
|
|
181
|
+
transform: rotate(0deg);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
100% {
|
|
185
|
+
transform: rotate(360deg);
|
|
186
|
+
}
|
|
187
|
+
`,K0=Hi`
|
|
188
|
+
0% {
|
|
189
|
+
stroke-dasharray: 1px, 200px;
|
|
190
|
+
stroke-dashoffset: 0;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
50% {
|
|
194
|
+
stroke-dasharray: 100px, 200px;
|
|
195
|
+
stroke-dashoffset: -15px;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
100% {
|
|
199
|
+
stroke-dasharray: 1px, 200px;
|
|
200
|
+
stroke-dashoffset: -126px;
|
|
201
|
+
}
|
|
202
|
+
`,aH=typeof q0!="string"?La`
|
|
203
|
+
animation: ${q0} 1.4s linear infinite;
|
|
204
|
+
`:null,cH=typeof K0!="string"?La`
|
|
205
|
+
animation: ${K0} 1.4s ease-in-out infinite;
|
|
206
|
+
`:null,uH=e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e,i={root:["root",n,`color${Pe(r)}`],svg:["svg"],circle:["circle",`circle${Pe(n)}`,o&&"circleDisableShrink"]};return Be(i,lH,t)},dH=Ce("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${Pe(n.color)}`]]}})(tt(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:aH||{animation:`${q0} 1.4s linear infinite`}},...Object.entries(e.palette).filter(qn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),fH=Ce("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),pH=Ce("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Pe(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(tt(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:cH||{animation:`${K0} 1.4s ease-in-out infinite`}}]}))),At=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiCircularProgress"}),{className:o,color:i="primary",disableShrink:l=!1,size:c=40,style:u,thickness:f=3.6,value:h=0,variant:p="indeterminate",...g}=r,y={...r,color:i,disableShrink:l,size:c,thickness:f,value:h,variant:p},b=uH(y),v={},C={},S={};if(p==="determinate"){const j=2*Math.PI*((Yl-f)/2);v.strokeDasharray=j.toFixed(3),S["aria-valuenow"]=Math.round(h),v.strokeDashoffset=`${((100-h)/100*j).toFixed(3)}px`,C.transform="rotate(-90deg)"}return s.jsx(dH,{className:Me(b.root,o),style:{width:c,height:c,...C,...u},ownerState:y,ref:n,role:"progressbar",...S,...g,children:s.jsx(fH,{className:b.svg,ownerState:y,viewBox:`${Yl/2} ${Yl/2} ${Yl} ${Yl}`,children:s.jsx(pH,{className:b.circle,style:v,ownerState:y,cx:Yl,cy:Yl,r:(Yl-f)/2,fill:"none",strokeWidth:f})})})});function hH(e){return ct("MuiIconButton",e)}const gk=ut("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),mH=e=>{const{classes:t,disabled:n,color:r,edge:o,size:i,loading:l}=e,c={root:["root",l&&"loading",n&&"disabled",r!=="default"&&`color${Pe(r)}`,o&&`edge${Pe(o)}`,`size${Pe(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return Be(c,hH,t)},gH=Ce(Ds,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${Pe(n.color)}`],n.edge&&t[`edge${Pe(n.edge)}`],t[`size${Pe(n.size)}`]]}})(tt(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ye(e.palette.action.active,e.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),tt(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(qn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(qn()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.vars?`rgba(${(e.vars||e).palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ye((e.vars||e).palette[t].main,e.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${gk.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${gk.loading}`]:{color:"transparent"}}))),xH=Ce("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),mt=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiIconButton"}),{edge:o=!1,children:i,className:l,color:c="default",disabled:u=!1,disableFocusRipple:f=!1,size:h="medium",id:p,loading:g=null,loadingIndicator:y,...b}=r,v=Sn(p),C=y??s.jsx(At,{"aria-labelledby":v,color:"inherit",size:16}),S={...r,edge:o,color:c,disabled:u,disableFocusRipple:f,loading:g,loadingIndicator:C,size:h},j=mH(S);return s.jsxs(gH,{id:g?v:p,className:Me(j.root,l),centerRipple:!0,focusRipple:!f,disabled:u||g,ref:n,...b,ownerState:S,children:[typeof g=="boolean"&&s.jsx("span",{className:j.loadingWrapper,style:{display:"contents"},children:s.jsx(xH,{className:j.loadingIndicator,ownerState:S,children:g&&C})}),i]})}),yH=_e(s.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),bH=_e(s.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),vH=_e(s.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),CH=_e(s.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),KM=_e(s.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),wH=e=>{const{variant:t,color:n,severity:r,classes:o}=e,i={root:["root",`color${Pe(n||r)}`,`${t}${Pe(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return Be(i,iH,o)},SH=Ce(Un,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${Pe(n.color||n.severity)}`]]}})(tt(({theme:e})=>{const t=e.palette.mode==="light"?ml:gl,n=e.palette.mode==="light"?gl:ml;return{...e.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(e.palette).filter(qn(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"standard"},style:{color:e.vars?e.vars.palette.Alert[`${r}Color`]:t(e.palette[r].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${r}StandardBg`]:n(e.palette[r].light,.9),[`& .${mk.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter(qn(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"outlined"},style:{color:e.vars?e.vars.palette.Alert[`${r}Color`]:t(e.palette[r].light,.6),border:`1px solid ${(e.vars||e).palette[r].light}`,[`& .${mk.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter(qn(["dark"])).map(([r])=>({props:{colorSeverity:r,variant:"filled"},style:{fontWeight:e.typography.fontWeightMedium,...e.vars?{color:e.vars.palette.Alert[`${r}FilledColor`],backgroundColor:e.vars.palette.Alert[`${r}FilledBg`]}:{backgroundColor:e.palette.mode==="dark"?e.palette[r].dark:e.palette[r].main,color:e.palette.getContrastText(e.palette[r].main)}}}))]}})),jH=Ce("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),kH=Ce("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),IH=Ce("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),xk={success:s.jsx(yH,{fontSize:"inherit"}),warning:s.jsx(bH,{fontSize:"inherit"}),error:s.jsx(vH,{fontSize:"inherit"}),info:s.jsx(CH,{fontSize:"inherit"})},Nt=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiAlert"}),{action:o,children:i,className:l,closeText:c="Close",color:u,components:f={},componentsProps:h={},icon:p,iconMapping:g=xk,onClose:y,role:b="alert",severity:v="success",slotProps:C={},slots:S={},variant:j="standard",...w}=r,k={...r,color:u,severity:v,variant:j,colorSeverity:u||v},P=wH(k),T={slots:{closeButton:f.CloseButton,closeIcon:f.CloseIcon,...S},slotProps:{...h,...C}},[$,M]=at("root",{ref:n,shouldForwardComponentProp:!0,className:Me(P.root,l),elementType:SH,externalForwardedProps:{...T,...w},ownerState:k,additionalProps:{role:b,elevation:0}}),[R,E]=at("icon",{className:P.icon,elementType:jH,externalForwardedProps:T,ownerState:k}),[O,A]=at("message",{className:P.message,elementType:kH,externalForwardedProps:T,ownerState:k}),[N,F]=at("action",{className:P.action,elementType:IH,externalForwardedProps:T,ownerState:k}),[L,D]=at("closeButton",{elementType:mt,externalForwardedProps:T,ownerState:k}),[H,B]=at("closeIcon",{elementType:KM,externalForwardedProps:T,ownerState:k});return s.jsxs($,{...M,children:[p!==!1?s.jsx(R,{...E,children:p||g[v]||xk[v]}):null,s.jsx(O,{...A,children:i}),o!=null?s.jsx(N,{...F,children:o}):null,o==null&&y?s.jsx(N,{...F,children:s.jsx(L,{size:"small","aria-label":c,title:c,color:"inherit",onClick:y,...D,children:s.jsx(H,{fontSize:"small",...B})})}):null]})});function EH(e){return ct("MuiTypography",e)}const yk=ut("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),PH={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},TH=n_(),MH=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:i,classes:l}=e,c={root:["root",i,e.align!=="inherit"&&`align${Pe(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]};return Be(c,EH,l)},RH=Ce("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${Pe(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(tt(({theme:e})=>{var t;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([n,r])=>n!=="inherit"&&r&&typeof r=="object").map(([n,r])=>({props:{variant:n},style:r})),...Object.entries(e.palette).filter(qn()).map(([n])=>({props:{color:n},style:{color:(e.vars||e).palette[n].main}})),...Object.entries(((t=e.palette)==null?void 0:t.text)||{}).filter(([,n])=>typeof n=="string").map(([n])=>({props:{color:`text${Pe(n)}`},style:{color:(e.vars||e).palette.text[n]}})),{props:({ownerState:n})=>n.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:n})=>n.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:n})=>n.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:n})=>n.paragraph,style:{marginBottom:16}}]}})),bk={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},J=m.forwardRef(function(t,n){const{color:r,...o}=ft({props:t,name:"MuiTypography"}),i=!PH[r],l=TH({...o,...i&&{color:r}}),{align:c="inherit",className:u,component:f,gutterBottom:h=!1,noWrap:p=!1,paragraph:g=!1,variant:y="body1",variantMapping:b=bk,...v}=l,C={...l,align:c,color:r,className:u,component:f,gutterBottom:h,noWrap:p,paragraph:g,variant:y,variantMapping:b},S=f||(g?"p":b[y]||bk[y])||"span",j=MH(C);return s.jsx(RH,{as:S,ref:n,className:Me(j.root,u),...v,ownerState:C,style:{...c!=="inherit"&&{"--Typography-textAlign":c},...v.style}})});function vk(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function QM(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:o="any",stringify:i,trim:l=!1}=e;return(c,{inputValue:u,getOptionLabel:f})=>{let h=l?u.trim():u;n&&(h=h.toLowerCase()),t&&(h=vk(h));const p=h?c.filter(g=>{let y=(i||f)(g);return n&&(y=y.toLowerCase()),t&&(y=vk(y)),o==="start"?y.startsWith(h):y.includes(h)}):c;return typeof r=="number"?p.slice(0,r):p}}const $H=QM(),Ck=5,OH=e=>{var t;return e.current!==null&&((t=e.current.parentElement)==null?void 0:t.contains(document.activeElement))},zH=[];function wk(e,t,n){if(t||e==null)return"";const r=n(e);return typeof r=="string"?r:""}function LH(e){const{unstable_isActiveElementInListbox:t=OH,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:o=!1,autoSelect:i=!1,blurOnSelect:l=!1,clearOnBlur:c=!e.freeSolo,clearOnEscape:u=!1,componentName:f="useAutocomplete",defaultValue:h=e.multiple?zH:null,disableClearable:p=!1,disableCloseOnSelect:g=!1,disabled:y,disabledItemsFocusable:b=!1,disableListWrap:v=!1,filterOptions:C=$H,filterSelectedOptions:S=!1,freeSolo:j=!1,getOptionDisabled:w,getOptionKey:k,getOptionLabel:P=se=>se.label??se,groupBy:T,handleHomeEndKeys:$=!e.freeSolo,id:M,includeInputInList:R=!1,inputValue:E,isOptionEqualToValue:O=(se,xe)=>se===xe,multiple:A=!1,onChange:N,onClose:F,onHighlightChange:L,onInputChange:D,onOpen:H,open:B,openOnFocus:V=!1,options:G,readOnly:_=!1,selectOnFocus:U=!e.freeSolo,value:Z}=e,Q=Sn(M);let ee=P;ee=se=>{const xe=P(se);return typeof xe!="string"?String(xe):xe};const ne=m.useRef(!1),re=m.useRef(!0),Y=m.useRef(null),ie=m.useRef(null),[ce,he]=m.useState(null),[de,le]=m.useState(-1),ge=o?0:-1,Se=m.useRef(ge),ke=m.useRef(wk(h??Z,A,ee)).current,[we,Oe]=va({controlled:Z,default:h,name:f}),[be,Fe]=va({controlled:E,default:ke,name:f,state:"inputValue"}),[Ve,De]=m.useState(!1),Ze=m.useCallback((se,xe,Re)=>{if(!(A?we.length<xe.length:xe!==null)&&!c)return;const wt=wk(xe,A,ee);be!==wt&&(Fe(wt),D&&D(se,wt,Re))},[ee,be,A,D,Fe,c,we]),[Ae,st]=va({controlled:B,default:!1,name:f,state:"open"}),[qe,et]=m.useState(!0),oe=!A&&we!=null&&be===ee(we),fe=Ae&&!_,Ie=fe?C(G.filter(se=>!(S&&(A?we:[we]).some(xe=>xe!==null&&O(se,xe)))),{inputValue:oe&&qe?"":be,getOptionLabel:ee}):[],$e=lw({filteredOptions:Ie,value:we,inputValue:be});m.useEffect(()=>{const se=we!==$e.value;Ve&&!se||j&&!se||Ze(null,we,"reset")},[we,Ze,Ve,$e.value,j]);const pt=Ae&&Ie.length>0&&!_,vt=Vt(se=>{se===-1?Y.current.focus():ce.querySelector(`[data-tag-index="${se}"]`).focus()});m.useEffect(()=>{A&&de>we.length-1&&(le(-1),vt(-1))},[we,A,de,vt]);function Je(se,xe){if(!ie.current||se<0||se>=Ie.length)return-1;let Re=se;for(;;){const nt=ie.current.querySelector(`[data-option-index="${Re}"]`),wt=b?!1:!nt||nt.disabled||nt.getAttribute("aria-disabled")==="true";if(nt&&nt.hasAttribute("tabindex")&&!wt)return Re;if(xe==="next"?Re=(Re+1)%Ie.length:Re=(Re-1+Ie.length)%Ie.length,Re===se)return-1}}const me=Vt(({event:se,index:xe,reason:Re})=>{if(Se.current=xe,xe===-1?Y.current.removeAttribute("aria-activedescendant"):Y.current.setAttribute("aria-activedescendant",`${Q}-option-${xe}`),L&&["mouse","keyboard","touch"].includes(Re)&&L(se,xe===-1?null:Ie[xe],Re),!ie.current)return;const nt=ie.current.querySelector(`[role="option"].${n}-focused`);nt&&(nt.classList.remove(`${n}-focused`),nt.classList.remove(`${n}-focusVisible`));let wt=ie.current;if(ie.current.getAttribute("role")!=="listbox"&&(wt=ie.current.parentElement.querySelector('[role="listbox"]')),!wt)return;if(xe===-1){wt.scrollTop=0;return}const Dt=ie.current.querySelector(`[data-option-index="${xe}"]`);if(Dt&&(Dt.classList.add(`${n}-focused`),Re==="keyboard"&&Dt.classList.add(`${n}-focusVisible`),wt.scrollHeight>wt.clientHeight&&Re!=="mouse"&&Re!=="touch")){const Yt=Dt,qt=wt.clientHeight+wt.scrollTop,on=Yt.offsetTop+Yt.offsetHeight;on>qt?wt.scrollTop=on-wt.clientHeight:Yt.offsetTop-Yt.offsetHeight*(T?1.3:0)<wt.scrollTop&&(wt.scrollTop=Yt.offsetTop-Yt.offsetHeight*(T?1.3:0))}}),Ne=Vt(({event:se,diff:xe,direction:Re="next",reason:nt})=>{if(!fe)return;const Dt=Je((()=>{const Yt=Ie.length-1;if(xe==="reset")return ge;if(xe==="start")return 0;if(xe==="end")return Yt;const qt=Se.current+xe;return qt<0?qt===-1&&R?-1:v&&Se.current!==-1||Math.abs(xe)>1?0:Yt:qt>Yt?qt===Yt+1&&R?-1:v||Math.abs(xe)>1?Yt:0:qt})(),Re);if(me({index:Dt,reason:nt,event:se}),r&&xe!=="reset")if(Dt===-1)Y.current.value=be;else{const Yt=ee(Ie[Dt]);Y.current.value=Yt,Yt.toLowerCase().indexOf(be.toLowerCase())===0&&be.length>0&&Y.current.setSelectionRange(be.length,Yt.length)}}),xt=()=>{const se=(xe,Re)=>{const nt=xe?ee(xe):"",wt=Re?ee(Re):"";return nt===wt};if(Se.current!==-1&&$e.filteredOptions&&$e.filteredOptions.length!==Ie.length&&$e.inputValue===be&&(A?we.length===$e.value.length&&$e.value.every((xe,Re)=>ee(we[Re])===ee(xe)):se($e.value,we))){const xe=$e.filteredOptions[Se.current];if(xe)return Ie.findIndex(Re=>ee(Re)===ee(xe))}return-1},Bt=m.useCallback(()=>{if(!fe)return;const se=xt();if(se!==-1){Se.current=se;return}const xe=A?we[0]:we;if(Ie.length===0||xe==null){Ne({diff:"reset"});return}if(ie.current){if(xe!=null){const Re=Ie[Se.current];if(A&&Re&&we.findIndex(wt=>O(Re,wt))!==-1)return;const nt=Ie.findIndex(wt=>O(wt,xe));nt===-1?Ne({diff:"reset"}):me({index:nt});return}if(Se.current>=Ie.length-1){me({index:Ie.length-1});return}me({index:Se.current})}},[Ie.length,A?!1:we,S,Ne,me,fe,be,A]),pn=Vt(se=>{F0(ie,se),se&&Bt()});m.useEffect(()=>{Bt()},[Bt]);const yn=se=>{Ae||(st(!0),et(!0),H&&H(se))},hn=(se,xe)=>{Ae&&(st(!1),F&&F(se,xe))},ln=(se,xe,Re,nt)=>{if(A){if(we.length===xe.length&&we.every((wt,Dt)=>wt===xe[Dt]))return}else if(we===xe)return;N&&N(se,xe,Re,nt),Oe(xe)},An=m.useRef(!1),kt=(se,xe,Re="selectOption",nt="options")=>{let wt=Re,Dt=xe;if(A){Dt=Array.isArray(we)?we.slice():[];const Yt=Dt.findIndex(qt=>O(xe,qt));Yt===-1?Dt.push(xe):nt!=="freeSolo"&&(Dt.splice(Yt,1),wt="removeOption")}Ze(se,Dt,wt),ln(se,Dt,wt,{option:xe}),!g&&(!se||!se.ctrlKey&&!se.metaKey)&&hn(se,wt),(l===!0||l==="touch"&&An.current||l==="mouse"&&!An.current)&&Y.current.blur()};function un(se,xe){if(se===-1)return-1;let Re=se;for(;;){if(xe==="next"&&Re===we.length||xe==="previous"&&Re===-1)return-1;const nt=ce.querySelector(`[data-tag-index="${Re}"]`);if(!nt||!nt.hasAttribute("tabindex")||nt.disabled||nt.getAttribute("aria-disabled")==="true")Re+=xe==="next"?1:-1;else return Re}}const er=(se,xe)=>{if(!A)return;be===""&&hn(se,"toggleInput");let Re=de;de===-1?be===""&&xe==="previous"&&(Re=we.length-1):(Re+=xe==="next"?1:-1,Re<0&&(Re=0),Re===we.length&&(Re=-1)),Re=un(Re,xe),le(Re),vt(Re)},yt=se=>{ne.current=!0,Fe(""),D&&D(se,"","clear"),ln(se,A?[]:null,"clear")},Ht=se=>xe=>{if(se.onKeyDown&&se.onKeyDown(xe),!xe.defaultMuiPrevented&&(de!==-1&&!["ArrowLeft","ArrowRight"].includes(xe.key)&&(le(-1),vt(-1)),xe.which!==229))switch(xe.key){case"Home":fe&&$&&(xe.preventDefault(),Ne({diff:"start",direction:"next",reason:"keyboard",event:xe}));break;case"End":fe&&$&&(xe.preventDefault(),Ne({diff:"end",direction:"previous",reason:"keyboard",event:xe}));break;case"PageUp":xe.preventDefault(),Ne({diff:-Ck,direction:"previous",reason:"keyboard",event:xe}),yn(xe);break;case"PageDown":xe.preventDefault(),Ne({diff:Ck,direction:"next",reason:"keyboard",event:xe}),yn(xe);break;case"ArrowDown":xe.preventDefault(),Ne({diff:1,direction:"next",reason:"keyboard",event:xe}),yn(xe);break;case"ArrowUp":xe.preventDefault(),Ne({diff:-1,direction:"previous",reason:"keyboard",event:xe}),yn(xe);break;case"ArrowLeft":er(xe,"previous");break;case"ArrowRight":er(xe,"next");break;case"Enter":if(Se.current!==-1&&fe){const Re=Ie[Se.current],nt=w?w(Re):!1;if(xe.preventDefault(),nt)return;kt(xe,Re,"selectOption"),r&&Y.current.setSelectionRange(Y.current.value.length,Y.current.value.length)}else j&&be!==""&&oe===!1&&(A&&xe.preventDefault(),kt(xe,be,"createOption","freeSolo"));break;case"Escape":fe?(xe.preventDefault(),xe.stopPropagation(),hn(xe,"escape")):u&&(be!==""||A&&we.length>0)&&(xe.preventDefault(),xe.stopPropagation(),yt(xe));break;case"Backspace":if(A&&!_&&be===""&&we.length>0){const Re=de===-1?we.length-1:de,nt=we.slice();nt.splice(Re,1),ln(xe,nt,"removeOption",{option:we[Re]})}break;case"Delete":if(A&&!_&&be===""&&we.length>0&&de!==-1){const Re=de,nt=we.slice();nt.splice(Re,1),ln(xe,nt,"removeOption",{option:we[Re]})}break}},Ke=se=>{De(!0),V&&!ne.current&&yn(se)},rt=se=>{if(t(ie)){Y.current.focus();return}De(!1),re.current=!0,ne.current=!1,i&&Se.current!==-1&&fe?kt(se,Ie[Se.current],"blur"):i&&j&&be!==""?kt(se,be,"blur","freeSolo"):c&&Ze(se,we,"blur"),hn(se,"blur")},It=se=>{const xe=se.target.value;be!==xe&&(Fe(xe),et(!1),D&&D(se,xe,"input")),xe===""?!p&&!A&&ln(se,null,"clear"):yn(se)},Lt=se=>{const xe=Number(se.currentTarget.getAttribute("data-option-index"));Se.current!==xe&&me({event:se,index:xe,reason:"mouse"})},Jt=se=>{me({event:se,index:Number(se.currentTarget.getAttribute("data-option-index")),reason:"touch"}),An.current=!0},tr=se=>{const xe=Number(se.currentTarget.getAttribute("data-option-index"));kt(se,Ie[xe],"selectOption"),An.current=!1},kr=se=>xe=>{const Re=we.slice();Re.splice(se,1),ln(xe,Re,"removeOption",{option:we[se]})},pr=se=>{Ae?hn(se,"toggleInput"):yn(se)},so=se=>{se.currentTarget.contains(se.target)&&se.target.getAttribute("id")!==Q&&se.preventDefault()},Kn=se=>{se.currentTarget.contains(se.target)&&(Y.current.focus(),U&&re.current&&Y.current.selectionEnd-Y.current.selectionStart===0&&Y.current.select(),re.current=!1)},nr=se=>{!y&&(be===""||!Ae)&&pr(se)};let io=j&&be.length>0;io=io||(A?we.length>0:we!==null);let Zr=Ie;return T&&(Zr=Ie.reduce((se,xe,Re)=>{const nt=T(xe);return se.length>0&&se[se.length-1].group===nt?se[se.length-1].options.push(xe):se.push({key:Re,index:Re,group:nt,options:[xe]}),se},[])),y&&Ve&&rt(),{getRootProps:(se={})=>({...se,onKeyDown:Ht(se),onMouseDown:so,onClick:Kn}),getInputLabelProps:()=>({id:`${Q}-label`,htmlFor:Q}),getInputProps:()=>({id:Q,value:be,onBlur:rt,onFocus:Ke,onChange:It,onMouseDown:nr,"aria-activedescendant":fe?"":null,"aria-autocomplete":r?"both":"list","aria-controls":pt?`${Q}-listbox`:void 0,"aria-expanded":pt,autoComplete:"off",ref:Y,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:y}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:yt}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:pr}),getTagProps:({index:se})=>({key:se,"data-tag-index":se,tabIndex:-1,...!_&&{onDelete:kr(se)}}),getListboxProps:()=>({role:"listbox",id:`${Q}-listbox`,"aria-labelledby":`${Q}-label`,ref:pn,onMouseDown:se=>{se.preventDefault()}}),getOptionProps:({index:se,option:xe})=>{const Re=(A?we:[we]).some(wt=>wt!=null&&O(xe,wt)),nt=w?w(xe):!1;return{key:(k==null?void 0:k(xe))??ee(xe),tabIndex:-1,role:"option",id:`${Q}-option-${se}`,onMouseMove:Lt,onClick:tr,onTouchStart:Jt,"data-option-index":se,"aria-disabled":nt,"aria-selected":Re}},id:Q,inputValue:be,value:we,dirty:io,expanded:fe&&ce,popupOpen:fe,focused:Ve||de!==-1,anchorEl:ce,setAnchorEl:he,focusedTag:de,groupedOptions:Zr}}var Wo="top",As="bottom",Fs="right",Vo="left",bw="auto",yh=[Wo,As,Fs,Vo],hd="start",zp="end",DH="clippingParents",YM="viewport",Hf="popper",AH="reference",Sk=yh.reduce(function(e,t){return e.concat([t+"-"+hd,t+"-"+zp])},[]),XM=[].concat(yh,[bw]).reduce(function(e,t){return e.concat([t,t+"-"+hd,t+"-"+zp])},[]),FH="beforeRead",NH="read",_H="afterRead",HH="beforeMain",BH="main",WH="afterMain",VH="beforeWrite",GH="write",UH="afterWrite",qH=[FH,NH,_H,HH,BH,WH,VH,GH,UH];function Ai(e){return e?(e.nodeName||"").toLowerCase():null}function us(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Lc(e){var t=us(e).Element;return e instanceof t||e instanceof Element}function Rs(e){var t=us(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function vw(e){if(typeof ShadowRoot>"u")return!1;var t=us(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function KH(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!Rs(i)||!Ai(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(l){var c=o[l];c===!1?i.removeAttribute(l):i.setAttribute(l,c===!0?"":c)}))})}function QH(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},l=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),c=l.reduce(function(u,f){return u[f]="",u},{});!Rs(o)||!Ai(o)||(Object.assign(o.style,c),Object.keys(i).forEach(function(u){o.removeAttribute(u)}))})}}const YH={name:"applyStyles",enabled:!0,phase:"write",fn:KH,effect:QH,requires:["computeStyles"]};function Ri(e){return e.split("-")[0]}var Ic=Math.max,Kg=Math.min,md=Math.round;function Q0(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function ZM(){return!/^((?!chrome|android).)*safari/i.test(Q0())}function gd(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&Rs(e)&&(o=e.offsetWidth>0&&md(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&md(r.height)/e.offsetHeight||1);var l=Lc(e)?us(e):window,c=l.visualViewport,u=!ZM()&&n,f=(r.left+(u&&c?c.offsetLeft:0))/o,h=(r.top+(u&&c?c.offsetTop:0))/i,p=r.width/o,g=r.height/i;return{width:p,height:g,top:h,right:f+p,bottom:h+g,left:f,x:f,y:h}}function Cw(e){var t=gd(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function JM(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&vw(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function xl(e){return us(e).getComputedStyle(e)}function XH(e){return["table","td","th"].indexOf(Ai(e))>=0}function Fa(e){return((Lc(e)?e.ownerDocument:e.document)||window.document).documentElement}function _x(e){return Ai(e)==="html"?e:e.assignedSlot||e.parentNode||(vw(e)?e.host:null)||Fa(e)}function jk(e){return!Rs(e)||xl(e).position==="fixed"?null:e.offsetParent}function ZH(e){var t=/firefox/i.test(Q0()),n=/Trident/i.test(Q0());if(n&&Rs(e)){var r=xl(e);if(r.position==="fixed")return null}var o=_x(e);for(vw(o)&&(o=o.host);Rs(o)&&["html","body"].indexOf(Ai(o))<0;){var i=xl(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function bh(e){for(var t=us(e),n=jk(e);n&&XH(n)&&xl(n).position==="static";)n=jk(n);return n&&(Ai(n)==="html"||Ai(n)==="body"&&xl(n).position==="static")?t:n||ZH(e)||t}function ww(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function yp(e,t,n){return Ic(e,Kg(t,n))}function JH(e,t,n){var r=yp(e,t,n);return r>n?n:r}function eR(){return{top:0,right:0,bottom:0,left:0}}function tR(e){return Object.assign({},eR(),e)}function nR(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var eB=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,tR(typeof t!="number"?t:nR(t,yh))};function tB(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,l=n.modifiersData.popperOffsets,c=Ri(n.placement),u=ww(c),f=[Vo,Fs].indexOf(c)>=0,h=f?"height":"width";if(!(!i||!l)){var p=eB(o.padding,n),g=Cw(i),y=u==="y"?Wo:Vo,b=u==="y"?As:Fs,v=n.rects.reference[h]+n.rects.reference[u]-l[u]-n.rects.popper[h],C=l[u]-n.rects.reference[u],S=bh(i),j=S?u==="y"?S.clientHeight||0:S.clientWidth||0:0,w=v/2-C/2,k=p[y],P=j-g[h]-p[b],T=j/2-g[h]/2+w,$=yp(k,T,P),M=u;n.modifiersData[r]=(t={},t[M]=$,t.centerOffset=$-T,t)}}function nB(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||JM(t.elements.popper,o)&&(t.elements.arrow=o))}const rB={name:"arrow",enabled:!0,phase:"main",fn:tB,effect:nB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function xd(e){return e.split("-")[1]}var oB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function sB(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:md(n*o)/o||0,y:md(r*o)/o||0}}function kk(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,l=e.offsets,c=e.position,u=e.gpuAcceleration,f=e.adaptive,h=e.roundOffsets,p=e.isFixed,g=l.x,y=g===void 0?0:g,b=l.y,v=b===void 0?0:b,C=typeof h=="function"?h({x:y,y:v}):{x:y,y:v};y=C.x,v=C.y;var S=l.hasOwnProperty("x"),j=l.hasOwnProperty("y"),w=Vo,k=Wo,P=window;if(f){var T=bh(n),$="clientHeight",M="clientWidth";if(T===us(n)&&(T=Fa(n),xl(T).position!=="static"&&c==="absolute"&&($="scrollHeight",M="scrollWidth")),T=T,o===Wo||(o===Vo||o===Fs)&&i===zp){k=As;var R=p&&T===P&&P.visualViewport?P.visualViewport.height:T[$];v-=R-r.height,v*=u?1:-1}if(o===Vo||(o===Wo||o===As)&&i===zp){w=Fs;var E=p&&T===P&&P.visualViewport?P.visualViewport.width:T[M];y-=E-r.width,y*=u?1:-1}}var O=Object.assign({position:c},f&&oB),A=h===!0?sB({x:y,y:v},us(n)):{x:y,y:v};if(y=A.x,v=A.y,u){var N;return Object.assign({},O,(N={},N[k]=j?"0":"",N[w]=S?"0":"",N.transform=(P.devicePixelRatio||1)<=1?"translate("+y+"px, "+v+"px)":"translate3d("+y+"px, "+v+"px, 0)",N))}return Object.assign({},O,(t={},t[k]=j?v+"px":"",t[w]=S?y+"px":"",t.transform="",t))}function iB(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,l=i===void 0?!0:i,c=n.roundOffsets,u=c===void 0?!0:c,f={placement:Ri(t.placement),variation:xd(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,kk(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,kk(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const lB={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:iB,data:{}};var Qm={passive:!0};function aB(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,l=r.resize,c=l===void 0?!0:l,u=us(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&f.forEach(function(h){h.addEventListener("scroll",n.update,Qm)}),c&&u.addEventListener("resize",n.update,Qm),function(){i&&f.forEach(function(h){h.removeEventListener("scroll",n.update,Qm)}),c&&u.removeEventListener("resize",n.update,Qm)}}const cB={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:aB,data:{}};var uB={left:"right",right:"left",bottom:"top",top:"bottom"};function Pg(e){return e.replace(/left|right|bottom|top/g,function(t){return uB[t]})}var dB={start:"end",end:"start"};function Ik(e){return e.replace(/start|end/g,function(t){return dB[t]})}function Sw(e){var t=us(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function jw(e){return gd(Fa(e)).left+Sw(e).scrollLeft}function fB(e,t){var n=us(e),r=Fa(e),o=n.visualViewport,i=r.clientWidth,l=r.clientHeight,c=0,u=0;if(o){i=o.width,l=o.height;var f=ZM();(f||!f&&t==="fixed")&&(c=o.offsetLeft,u=o.offsetTop)}return{width:i,height:l,x:c+jw(e),y:u}}function pB(e){var t,n=Fa(e),r=Sw(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=Ic(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),l=Ic(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),c=-r.scrollLeft+jw(e),u=-r.scrollTop;return xl(o||n).direction==="rtl"&&(c+=Ic(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:l,x:c,y:u}}function kw(e){var t=xl(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function rR(e){return["html","body","#document"].indexOf(Ai(e))>=0?e.ownerDocument.body:Rs(e)&&kw(e)?e:rR(_x(e))}function bp(e,t){var n;t===void 0&&(t=[]);var r=rR(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=us(r),l=o?[i].concat(i.visualViewport||[],kw(r)?r:[]):r,c=t.concat(l);return o?c:c.concat(bp(_x(l)))}function Y0(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function hB(e,t){var n=gd(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Ek(e,t,n){return t===YM?Y0(fB(e,n)):Lc(t)?hB(t,n):Y0(pB(Fa(e)))}function mB(e){var t=bp(_x(e)),n=["absolute","fixed"].indexOf(xl(e).position)>=0,r=n&&Rs(e)?bh(e):e;return Lc(r)?t.filter(function(o){return Lc(o)&&JM(o,r)&&Ai(o)!=="body"}):[]}function gB(e,t,n,r){var o=t==="clippingParents"?mB(e):[].concat(t),i=[].concat(o,[n]),l=i[0],c=i.reduce(function(u,f){var h=Ek(e,f,r);return u.top=Ic(h.top,u.top),u.right=Kg(h.right,u.right),u.bottom=Kg(h.bottom,u.bottom),u.left=Ic(h.left,u.left),u},Ek(e,l,r));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function oR(e){var t=e.reference,n=e.element,r=e.placement,o=r?Ri(r):null,i=r?xd(r):null,l=t.x+t.width/2-n.width/2,c=t.y+t.height/2-n.height/2,u;switch(o){case Wo:u={x:l,y:t.y-n.height};break;case As:u={x:l,y:t.y+t.height};break;case Fs:u={x:t.x+t.width,y:c};break;case Vo:u={x:t.x-n.width,y:c};break;default:u={x:t.x,y:t.y}}var f=o?ww(o):null;if(f!=null){var h=f==="y"?"height":"width";switch(i){case hd:u[f]=u[f]-(t[h]/2-n[h]/2);break;case zp:u[f]=u[f]+(t[h]/2-n[h]/2);break}}return u}function Lp(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,l=i===void 0?e.strategy:i,c=n.boundary,u=c===void 0?DH:c,f=n.rootBoundary,h=f===void 0?YM:f,p=n.elementContext,g=p===void 0?Hf:p,y=n.altBoundary,b=y===void 0?!1:y,v=n.padding,C=v===void 0?0:v,S=tR(typeof C!="number"?C:nR(C,yh)),j=g===Hf?AH:Hf,w=e.rects.popper,k=e.elements[b?j:g],P=gB(Lc(k)?k:k.contextElement||Fa(e.elements.popper),u,h,l),T=gd(e.elements.reference),$=oR({reference:T,element:w,placement:o}),M=Y0(Object.assign({},w,$)),R=g===Hf?M:T,E={top:P.top-R.top+S.top,bottom:R.bottom-P.bottom+S.bottom,left:P.left-R.left+S.left,right:R.right-P.right+S.right},O=e.modifiersData.offset;if(g===Hf&&O){var A=O[o];Object.keys(E).forEach(function(N){var F=[Fs,As].indexOf(N)>=0?1:-1,L=[Wo,As].indexOf(N)>=0?"y":"x";E[N]+=A[L]*F})}return E}function xB(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,l=n.padding,c=n.flipVariations,u=n.allowedAutoPlacements,f=u===void 0?XM:u,h=xd(r),p=h?c?Sk:Sk.filter(function(b){return xd(b)===h}):yh,g=p.filter(function(b){return f.indexOf(b)>=0});g.length===0&&(g=p);var y=g.reduce(function(b,v){return b[v]=Lp(e,{placement:v,boundary:o,rootBoundary:i,padding:l})[Ri(v)],b},{});return Object.keys(y).sort(function(b,v){return y[b]-y[v]})}function yB(e){if(Ri(e)===bw)return[];var t=Pg(e);return[Ik(e),t,Ik(t)]}function bB(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,l=n.altAxis,c=l===void 0?!0:l,u=n.fallbackPlacements,f=n.padding,h=n.boundary,p=n.rootBoundary,g=n.altBoundary,y=n.flipVariations,b=y===void 0?!0:y,v=n.allowedAutoPlacements,C=t.options.placement,S=Ri(C),j=S===C,w=u||(j||!b?[Pg(C)]:yB(C)),k=[C].concat(w).reduce(function(Q,ee){return Q.concat(Ri(ee)===bw?xB(t,{placement:ee,boundary:h,rootBoundary:p,padding:f,flipVariations:b,allowedAutoPlacements:v}):ee)},[]),P=t.rects.reference,T=t.rects.popper,$=new Map,M=!0,R=k[0],E=0;E<k.length;E++){var O=k[E],A=Ri(O),N=xd(O)===hd,F=[Wo,As].indexOf(A)>=0,L=F?"width":"height",D=Lp(t,{placement:O,boundary:h,rootBoundary:p,altBoundary:g,padding:f}),H=F?N?Fs:Vo:N?As:Wo;P[L]>T[L]&&(H=Pg(H));var B=Pg(H),V=[];if(i&&V.push(D[A]<=0),c&&V.push(D[H]<=0,D[B]<=0),V.every(function(Q){return Q})){R=O,M=!1;break}$.set(O,V)}if(M)for(var G=b?3:1,_=function(ee){var ne=k.find(function(re){var Y=$.get(re);if(Y)return Y.slice(0,ee).every(function(ie){return ie})});if(ne)return R=ne,"break"},U=G;U>0;U--){var Z=_(U);if(Z==="break")break}t.placement!==R&&(t.modifiersData[r]._skip=!0,t.placement=R,t.reset=!0)}}const vB={name:"flip",enabled:!0,phase:"main",fn:bB,requiresIfExists:["offset"],data:{_skip:!1}};function Pk(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Tk(e){return[Wo,Fs,As,Vo].some(function(t){return e[t]>=0})}function CB(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,l=Lp(t,{elementContext:"reference"}),c=Lp(t,{altBoundary:!0}),u=Pk(l,r),f=Pk(c,o,i),h=Tk(u),p=Tk(f);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:f,isReferenceHidden:h,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":p})}const wB={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:CB};function SB(e,t,n){var r=Ri(e),o=[Vo,Wo].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,l=i[0],c=i[1];return l=l||0,c=(c||0)*o,[Vo,Fs].indexOf(r)>=0?{x:c,y:l}:{x:l,y:c}}function jB(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,l=XM.reduce(function(h,p){return h[p]=SB(p,t.rects,i),h},{}),c=l[t.placement],u=c.x,f=c.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=f),t.modifiersData[r]=l}const kB={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:jB};function IB(e){var t=e.state,n=e.name;t.modifiersData[n]=oR({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const EB={name:"popperOffsets",enabled:!0,phase:"read",fn:IB,data:{}};function PB(e){return e==="x"?"y":"x"}function TB(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,l=n.altAxis,c=l===void 0?!1:l,u=n.boundary,f=n.rootBoundary,h=n.altBoundary,p=n.padding,g=n.tether,y=g===void 0?!0:g,b=n.tetherOffset,v=b===void 0?0:b,C=Lp(t,{boundary:u,rootBoundary:f,padding:p,altBoundary:h}),S=Ri(t.placement),j=xd(t.placement),w=!j,k=ww(S),P=PB(k),T=t.modifiersData.popperOffsets,$=t.rects.reference,M=t.rects.popper,R=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,E=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),O=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,A={x:0,y:0};if(T){if(i){var N,F=k==="y"?Wo:Vo,L=k==="y"?As:Fs,D=k==="y"?"height":"width",H=T[k],B=H+C[F],V=H-C[L],G=y?-M[D]/2:0,_=j===hd?$[D]:M[D],U=j===hd?-M[D]:-$[D],Z=t.elements.arrow,Q=y&&Z?Cw(Z):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:eR(),ne=ee[F],re=ee[L],Y=yp(0,$[D],Q[D]),ie=w?$[D]/2-G-Y-ne-E.mainAxis:_-Y-ne-E.mainAxis,ce=w?-$[D]/2+G+Y+re+E.mainAxis:U+Y+re+E.mainAxis,he=t.elements.arrow&&bh(t.elements.arrow),de=he?k==="y"?he.clientTop||0:he.clientLeft||0:0,le=(N=O==null?void 0:O[k])!=null?N:0,ge=H+ie-le-de,Se=H+ce-le,ke=yp(y?Kg(B,ge):B,H,y?Ic(V,Se):V);T[k]=ke,A[k]=ke-H}if(c){var we,Oe=k==="x"?Wo:Vo,be=k==="x"?As:Fs,Fe=T[P],Ve=P==="y"?"height":"width",De=Fe+C[Oe],Ze=Fe-C[be],Ae=[Wo,Vo].indexOf(S)!==-1,st=(we=O==null?void 0:O[P])!=null?we:0,qe=Ae?De:Fe-$[Ve]-M[Ve]-st+E.altAxis,et=Ae?Fe+$[Ve]+M[Ve]-st-E.altAxis:Ze,oe=y&&Ae?JH(qe,Fe,et):yp(y?qe:De,Fe,y?et:Ze);T[P]=oe,A[P]=oe-Fe}t.modifiersData[r]=A}}const MB={name:"preventOverflow",enabled:!0,phase:"main",fn:TB,requiresIfExists:["offset"]};function RB(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function $B(e){return e===us(e)||!Rs(e)?Sw(e):RB(e)}function OB(e){var t=e.getBoundingClientRect(),n=md(t.width)/e.offsetWidth||1,r=md(t.height)/e.offsetHeight||1;return n!==1||r!==1}function zB(e,t,n){n===void 0&&(n=!1);var r=Rs(t),o=Rs(t)&&OB(t),i=Fa(t),l=gd(e,o,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Ai(t)!=="body"||kw(i))&&(c=$B(t)),Rs(t)?(u=gd(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):i&&(u.x=jw(i))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function LB(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var l=[].concat(i.requires||[],i.requiresIfExists||[]);l.forEach(function(c){if(!n.has(c)){var u=t.get(c);u&&o(u)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function DB(e){var t=LB(e);return qH.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function AB(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function FB(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Mk={placement:"bottom",modifiers:[],strategy:"absolute"};function Rk(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function NB(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,i=o===void 0?Mk:o;return function(c,u,f){f===void 0&&(f=i);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},Mk,i),modifiersData:{},elements:{reference:c,popper:u},attributes:{},styles:{}},p=[],g=!1,y={state:h,setOptions:function(S){var j=typeof S=="function"?S(h.options):S;v(),h.options=Object.assign({},i,h.options,j),h.scrollParents={reference:Lc(c)?bp(c):c.contextElement?bp(c.contextElement):[],popper:bp(u)};var w=DB(FB([].concat(r,h.options.modifiers)));return h.orderedModifiers=w.filter(function(k){return k.enabled}),b(),y.update()},forceUpdate:function(){if(!g){var S=h.elements,j=S.reference,w=S.popper;if(Rk(j,w)){h.rects={reference:zB(j,bh(w),h.options.strategy==="fixed"),popper:Cw(w)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(E){return h.modifiersData[E.name]=Object.assign({},E.data)});for(var k=0;k<h.orderedModifiers.length;k++){if(h.reset===!0){h.reset=!1,k=-1;continue}var P=h.orderedModifiers[k],T=P.fn,$=P.options,M=$===void 0?{}:$,R=P.name;typeof T=="function"&&(h=T({state:h,options:M,name:R,instance:y})||h)}}}},update:AB(function(){return new Promise(function(C){y.forceUpdate(),C(h)})}),destroy:function(){v(),g=!0}};if(!Rk(c,u))return y;y.setOptions(f).then(function(C){!g&&f.onFirstUpdate&&f.onFirstUpdate(C)});function b(){h.orderedModifiers.forEach(function(C){var S=C.name,j=C.options,w=j===void 0?{}:j,k=C.effect;if(typeof k=="function"){var P=k({state:h,name:S,instance:y,options:w}),T=function(){};p.push(P||T)}})}function v(){p.forEach(function(C){return C()}),p=[]}return y}}var _B=[cB,EB,lB,YH,kB,vB,MB,rB,wB],HB=NB({defaultModifiers:_B});function BB(e){return typeof e=="function"?e():e}const sR=m.forwardRef(function(t,n){const{children:r,container:o,disablePortal:i=!1}=t,[l,c]=m.useState(null),u=Pn(m.isValidElement(r)?Da(r):null,n);if(Ln(()=>{i||c(BB(o)||document.body)},[o,i]),Ln(()=>{if(l&&!i)return F0(n,l),()=>{F0(n,null)}},[n,l,i]),i){if(m.isValidElement(r)){const f={ref:u};return m.cloneElement(r,f)}return r}return l&&qC.createPortal(r,l)});function WB(e){return ct("MuiPopper",e)}ut("MuiPopper",["root"]);function VB(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function X0(e){return typeof e=="function"?e():e}function GB(e){return e.nodeType!==void 0}const UB=e=>{const{classes:t}=e;return Be({root:["root"]},WB,t)},qB={},KB=m.forwardRef(function(t,n){const{anchorEl:r,children:o,direction:i,disablePortal:l,modifiers:c,open:u,placement:f,popperOptions:h,popperRef:p,slotProps:g={},slots:y={},TransitionProps:b,ownerState:v,...C}=t,S=m.useRef(null),j=Pn(S,n),w=m.useRef(null),k=Pn(w,p),P=m.useRef(k);Ln(()=>{P.current=k},[k]),m.useImperativeHandle(p,()=>w.current,[]);const T=VB(f,i),[$,M]=m.useState(T),[R,E]=m.useState(X0(r));m.useEffect(()=>{w.current&&w.current.forceUpdate()}),m.useEffect(()=>{r&&E(X0(r))},[r]),Ln(()=>{if(!R||!u)return;const L=B=>{M(B.placement)};let D=[{name:"preventOverflow",options:{altBoundary:l}},{name:"flip",options:{altBoundary:l}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:B})=>{L(B)}}];c!=null&&(D=D.concat(c)),h&&h.modifiers!=null&&(D=D.concat(h.modifiers));const H=HB(R,S.current,{placement:T,...h,modifiers:D});return P.current(H),()=>{H.destroy(),P.current(null)}},[R,l,c,u,h,T]);const O={placement:$};b!==null&&(O.TransitionProps=b);const A=UB(t),N=y.root??"div",F=zc({elementType:N,externalSlotProps:g.root,externalForwardedProps:C,additionalProps:{role:"tooltip",ref:j},ownerState:t,className:A.root});return s.jsx(N,{...F,children:typeof o=="function"?o(O):o})}),QB=m.forwardRef(function(t,n){const{anchorEl:r,children:o,container:i,direction:l="ltr",disablePortal:c=!1,keepMounted:u=!1,modifiers:f,open:h,placement:p="bottom",popperOptions:g=qB,popperRef:y,style:b,transition:v=!1,slotProps:C={},slots:S={},...j}=t,[w,k]=m.useState(!0),P=()=>{k(!1)},T=()=>{k(!0)};if(!u&&!h&&(!v||w))return null;let $;if(i)$=i;else if(r){const E=X0(r);$=E&&GB(E)?ir(E).body:ir(null).body}const M=!h&&u&&(!v||w)?"none":void 0,R=v?{in:h,onEnter:P,onExited:T}:void 0;return s.jsx(sR,{disablePortal:c,container:$,children:s.jsx(KB,{anchorEl:r,direction:l,disablePortal:c,modifiers:f,ref:n,open:v?!w:h,placement:p,popperOptions:g,popperRef:y,slotProps:C,slots:S,...j,style:{position:"fixed",top:0,left:0,display:M,...b},TransitionProps:R,children:o})})}),YB=Ce(QB,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Uc=m.forwardRef(function(t,n){const r=Yr(),o=ft({props:t,name:"MuiPopper"}),{anchorEl:i,component:l,components:c,componentsProps:u,container:f,disablePortal:h,keepMounted:p,modifiers:g,open:y,placement:b,popperOptions:v,popperRef:C,transition:S,slots:j,slotProps:w,...k}=o,P=(j==null?void 0:j.root)??(c==null?void 0:c.Root),T={anchorEl:i,container:f,disablePortal:h,keepMounted:p,modifiers:g,open:y,placement:b,popperOptions:v,popperRef:C,transition:S,...k};return s.jsx(YB,{as:l,direction:r?"rtl":"ltr",slots:{root:P},slotProps:w??u,...T,ref:n})});function XB(e){return ct("MuiListSubheader",e)}ut("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const ZB=e=>{const{classes:t,color:n,disableGutters:r,inset:o,disableSticky:i}=e,l={root:["root",n!=="default"&&`color${Pe(n)}`,!r&&"gutters",o&&"inset",!i&&"sticky"]};return Be(l,XB,t)},JB=Ce("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${Pe(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})(tt(({theme:e})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(e.vars||e).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.inset,style:{paddingLeft:72}},{props:({ownerState:t})=>!t.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}}]}))),Z0=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiListSubheader"}),{className:o,color:i="default",component:l="li",disableGutters:c=!1,disableSticky:u=!1,inset:f=!1,...h}=r,p={...r,color:i,component:l,disableGutters:c,disableSticky:u,inset:f},g=ZB(p);return s.jsx(JB,{as:l,className:Me(g.root,o),ref:n,ownerState:p,...h})});Z0&&(Z0.muiSkipListHighlight=!0);const e6=_e(s.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function t6(e){return ct("MuiChip",e)}const rn=ut("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),n6=e=>{const{classes:t,disabled:n,size:r,color:o,iconColor:i,onDelete:l,clickable:c,variant:u}=e,f={root:["root",u,n&&"disabled",`size${Pe(r)}`,`color${Pe(o)}`,c&&"clickable",c&&`clickableColor${Pe(o)}`,l&&"deletable",l&&`deletableColor${Pe(o)}`,`${u}${Pe(o)}`],label:["label",`label${Pe(r)}`],avatar:["avatar",`avatar${Pe(r)}`,`avatarColor${Pe(o)}`],icon:["icon",`icon${Pe(r)}`,`iconColor${Pe(i)}`],deleteIcon:["deleteIcon",`deleteIcon${Pe(r)}`,`deleteIconColor${Pe(o)}`,`deleteIcon${Pe(u)}Color${Pe(o)}`]};return Be(f,t6,t)},r6=Ce("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:o,clickable:i,onDelete:l,size:c,variant:u}=n;return[{[`& .${rn.avatar}`]:t.avatar},{[`& .${rn.avatar}`]:t[`avatar${Pe(c)}`]},{[`& .${rn.avatar}`]:t[`avatarColor${Pe(r)}`]},{[`& .${rn.icon}`]:t.icon},{[`& .${rn.icon}`]:t[`icon${Pe(c)}`]},{[`& .${rn.icon}`]:t[`iconColor${Pe(o)}`]},{[`& .${rn.deleteIcon}`]:t.deleteIcon},{[`& .${rn.deleteIcon}`]:t[`deleteIcon${Pe(c)}`]},{[`& .${rn.deleteIcon}`]:t[`deleteIconColor${Pe(r)}`]},{[`& .${rn.deleteIcon}`]:t[`deleteIcon${Pe(u)}Color${Pe(r)}`]},t.root,t[`size${Pe(c)}`],t[`color${Pe(r)}`],i&&t.clickable,i&&r!=="default"&&t[`clickableColor${Pe(r)})`],l&&t.deletable,l&&r!=="default"&&t[`deletableColor${Pe(r)}`],t[u],t[`${u}${Pe(r)}`]]}})(tt(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${rn.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${rn.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${rn.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${rn.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${rn.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${rn.icon}`]:{marginLeft:5,marginRight:-6},[`& .${rn.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:Ye(e.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:Ye(e.palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${rn.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${rn.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(qn(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText,[`& .${rn.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[n].contrastTextChannel} / 0.7)`:Ye(e.palette[n].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${rn.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${rn.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${rn.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Ye(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}},...Object.entries(e.palette).filter(qn(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${rn.focusVisible}`]:{background:(e.vars||e).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ye(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${rn.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Ye(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(qn(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${rn.focusVisible}`]:{backgroundColor:(e.vars||e).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${rn.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${rn.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${rn.avatar}`]:{marginLeft:4},[`& .${rn.avatarSmall}`]:{marginLeft:2},[`& .${rn.icon}`]:{marginLeft:4},[`& .${rn.iconSmall}`]:{marginLeft:2},[`& .${rn.deleteIcon}`]:{marginRight:5},[`& .${rn.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(qn()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(e.vars||e).palette[n].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[n].mainChannel} / 0.7)`:Ye(e.palette[n].main,.7)}`,[`&.${rn.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[n].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ye(e.palette[n].main,e.palette.action.hoverOpacity)},[`&.${rn.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[n].mainChannel} / ${e.vars.palette.action.focusOpacity})`:Ye(e.palette[n].main,e.palette.action.focusOpacity)},[`& .${rn.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[n].mainChannel} / 0.7)`:Ye(e.palette[n].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].main}}}}))]}})),o6=Ce("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${Pe(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function $k(e){return e.key==="Backspace"||e.key==="Delete"}const Ge=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiChip"}),{avatar:o,className:i,clickable:l,color:c="default",component:u,deleteIcon:f,disabled:h=!1,icon:p,label:g,onClick:y,onDelete:b,onKeyDown:v,onKeyUp:C,size:S="medium",variant:j="filled",tabIndex:w,skipFocusWhenDisabled:k=!1,...P}=r,T=m.useRef(null),$=Pn(T,n),M=V=>{V.stopPropagation(),b&&b(V)},R=V=>{V.currentTarget===V.target&&$k(V)&&V.preventDefault(),v&&v(V)},E=V=>{V.currentTarget===V.target&&b&&$k(V)&&b(V),C&&C(V)},O=l!==!1&&y?!0:l,A=O||b?Ds:u||"div",N={...r,component:A,disabled:h,size:S,color:c,iconColor:m.isValidElement(p)&&p.props.color||c,onDelete:!!b,clickable:O,variant:j},F=n6(N),L=A===Ds?{component:u||"div",focusVisibleClassName:F.focusVisible,...b&&{disableRipple:!0}}:{};let D=null;b&&(D=f&&m.isValidElement(f)?m.cloneElement(f,{className:Me(f.props.className,F.deleteIcon),onClick:M}):s.jsx(e6,{className:Me(F.deleteIcon),onClick:M}));let H=null;o&&m.isValidElement(o)&&(H=m.cloneElement(o,{className:Me(F.avatar,o.props.className)}));let B=null;return p&&m.isValidElement(p)&&(B=m.cloneElement(p,{className:Me(F.icon,p.props.className)})),s.jsxs(r6,{as:A,className:Me(F.root,i),disabled:O&&h?!0:void 0,onClick:y,onKeyDown:R,onKeyUp:E,ref:$,tabIndex:k&&h?-1:w,ownerState:N,...L,...P,children:[H||B,s.jsx(o6,{className:Me(F.label),ownerState:N,children:g}),D]})});function Ym(e){return parseInt(e,10)||0}const s6={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function i6(e){for(const t in e)return!1;return!0}function Ok(e){return i6(e)||e.outerHeightStyle===0&&!e.overflowing}const l6=m.forwardRef(function(t,n){const{onChange:r,maxRows:o,minRows:i=1,style:l,value:c,...u}=t,{current:f}=m.useRef(c!=null),h=m.useRef(null),p=Pn(n,h),g=m.useRef(null),y=m.useRef(null),b=m.useCallback(()=>{const w=h.current,k=y.current;if(!w||!k)return;const T=qo(w).getComputedStyle(w);if(T.width==="0px")return{outerHeightStyle:0,overflowing:!1};k.style.width=T.width,k.value=w.value||t.placeholder||"x",k.value.slice(-1)===`
|
|
207
|
+
`&&(k.value+=" ");const $=T.boxSizing,M=Ym(T.paddingBottom)+Ym(T.paddingTop),R=Ym(T.borderBottomWidth)+Ym(T.borderTopWidth),E=k.scrollHeight;k.value="x";const O=k.scrollHeight;let A=E;i&&(A=Math.max(Number(i)*O,A)),o&&(A=Math.min(Number(o)*O,A)),A=Math.max(A,O);const N=A+($==="border-box"?M+R:0),F=Math.abs(A-E)<=1;return{outerHeightStyle:N,overflowing:F}},[o,i,t.placeholder]),v=Vt(()=>{const w=h.current,k=b();if(!w||!k||Ok(k))return!1;const P=k.outerHeightStyle;return g.current!=null&&g.current!==P}),C=m.useCallback(()=>{const w=h.current,k=b();if(!w||!k||Ok(k))return;const P=k.outerHeightStyle;g.current!==P&&(g.current=P,w.style.height=`${P}px`),w.style.overflow=k.overflowing?"hidden":""},[b]),S=m.useRef(-1);Ln(()=>{const w=gh(C),k=h==null?void 0:h.current;if(!k)return;const P=qo(k);P.addEventListener("resize",w);let T;return typeof ResizeObserver<"u"&&(T=new ResizeObserver(()=>{v()&&(T.unobserve(k),cancelAnimationFrame(S.current),C(),S.current=requestAnimationFrame(()=>{T.observe(k)}))}),T.observe(k)),()=>{w.clear(),cancelAnimationFrame(S.current),P.removeEventListener("resize",w),T&&T.disconnect()}},[b,C,v]),Ln(()=>{C()});const j=w=>{f||C(),r&&r(w)};return s.jsxs(m.Fragment,{children:[s.jsx("textarea",{value:c,onChange:j,ref:p,rows:i,style:l,...u}),s.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:y,tabIndex:-1,style:{...s6.shadow,...l,paddingTop:0,paddingBottom:0}})]})});function J0(e){return typeof e=="string"}function qc({props:e,states:t,muiFormControl:n}){return t.reduce((r,o)=>(r[o]=e[o],n&&typeof e[o]>"u"&&(r[o]=n[o]),r),{})}const Hx=m.createContext(void 0);function jl(){return m.useContext(Hx)}function zk(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function Qg(e,t=!1){return e&&(zk(e.value)&&e.value!==""||t&&zk(e.defaultValue)&&e.defaultValue!=="")}function a6(e){return e.startAdornment}function c6(e){return ct("MuiInputBase",e)}const Gr=ut("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var Lk;const Bx=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${Pe(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},Wx=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},u6=e=>{const{classes:t,color:n,disabled:r,error:o,endAdornment:i,focused:l,formControl:c,fullWidth:u,hiddenLabel:f,multiline:h,readOnly:p,size:g,startAdornment:y,type:b}=e,v={root:["root",`color${Pe(n)}`,r&&"disabled",o&&"error",u&&"fullWidth",l&&"focused",c&&"formControl",g&&g!=="medium"&&`size${Pe(g)}`,h&&"multiline",y&&"adornedStart",i&&"adornedEnd",f&&"hiddenLabel",p&&"readOnly"],input:["input",r&&"disabled",b==="search"&&"inputTypeSearch",h&&"inputMultiline",g==="small"&&"inputSizeSmall",f&&"inputHiddenLabel",y&&"inputAdornedStart",i&&"inputAdornedEnd",p&&"readOnly"]};return Be(v,c6,t)},Vx=Ce("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Bx})(tt(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Gr.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:t})=>t.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:t,size:n})=>t.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:t})=>t.fullWidth,style:{width:"100%"}}]}))),Gx=Ce("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Wx})(tt(({theme:e})=>{const t=e.palette.mode==="light",n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},r={opacity:"0 !important"},o=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Gr.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${Gr.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:i})=>!i.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:i})=>i.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),Dk=pw({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),Bd=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:i,autoFocus:l,className:c,color:u,components:f={},componentsProps:h={},defaultValue:p,disabled:g,disableInjectingGlobalStyles:y,endAdornment:b,error:v,fullWidth:C=!1,id:S,inputComponent:j="input",inputProps:w={},inputRef:k,margin:P,maxRows:T,minRows:$,multiline:M=!1,name:R,onBlur:E,onChange:O,onClick:A,onFocus:N,onKeyDown:F,onKeyUp:L,placeholder:D,readOnly:H,renderSuffix:B,rows:V,size:G,slotProps:_={},slots:U={},startAdornment:Z,type:Q="text",value:ee,...ne}=r,re=w.value!=null?w.value:ee,{current:Y}=m.useRef(re!=null),ie=m.useRef(),ce=m.useCallback($e=>{},[]),he=Pn(ie,k,w.ref,ce),[de,le]=m.useState(!1),ge=jl(),Se=qc({props:r,muiFormControl:ge,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Se.focused=ge?ge.focused:de,m.useEffect(()=>{!ge&&g&&de&&(le(!1),E&&E())},[ge,g,de,E]);const ke=ge&&ge.onFilled,we=ge&&ge.onEmpty,Oe=m.useCallback($e=>{Qg($e)?ke&&ke():we&&we()},[ke,we]);Ln(()=>{Y&&Oe({value:re})},[re,Oe,Y]);const be=$e=>{N&&N($e),w.onFocus&&w.onFocus($e),ge&&ge.onFocus?ge.onFocus($e):le(!0)},Fe=$e=>{E&&E($e),w.onBlur&&w.onBlur($e),ge&&ge.onBlur?ge.onBlur($e):le(!1)},Ve=($e,...pt)=>{if(!Y){const vt=$e.target||ie.current;if(vt==null)throw new Error(hl(1));Oe({value:vt.value})}w.onChange&&w.onChange($e,...pt),O&&O($e,...pt)};m.useEffect(()=>{Oe(ie.current)},[]);const De=$e=>{ie.current&&$e.currentTarget===$e.target&&ie.current.focus(),A&&A($e)};let Ze=j,Ae=w;M&&Ze==="input"&&(V?Ae={type:void 0,minRows:V,maxRows:V,...Ae}:Ae={type:void 0,maxRows:T,minRows:$,...Ae},Ze=l6);const st=$e=>{Oe($e.animationName==="mui-auto-fill-cancel"?ie.current:{value:"x"})};m.useEffect(()=>{ge&&ge.setAdornedStart(!!Z)},[ge,Z]);const qe={...r,color:Se.color||"primary",disabled:Se.disabled,endAdornment:b,error:Se.error,focused:Se.focused,formControl:ge,fullWidth:C,hiddenLabel:Se.hiddenLabel,multiline:M,size:Se.size,startAdornment:Z,type:Q},et=u6(qe),oe=U.root||f.Root||Vx,fe=_.root||h.root||{},Ie=U.input||f.Input||Gx;return Ae={...Ae,..._.input??h.input},s.jsxs(m.Fragment,{children:[!y&&typeof Dk=="function"&&(Lk||(Lk=s.jsx(Dk,{}))),s.jsxs(oe,{...fe,ref:n,onClick:De,...ne,...!J0(oe)&&{ownerState:{...qe,...fe.ownerState}},className:Me(et.root,fe.className,c,H&&"MuiInputBase-readOnly"),children:[Z,s.jsx(Hx.Provider,{value:null,children:s.jsx(Ie,{"aria-invalid":Se.error,"aria-describedby":o,autoComplete:i,autoFocus:l,defaultValue:p,disabled:Se.disabled,id:S,onAnimationStart:st,name:R,placeholder:D,readOnly:H,required:Se.required,rows:V,value:re,onKeyDown:F,onKeyUp:L,type:Q,...Ae,...!J0(Ie)&&{as:Ze,ownerState:{...qe,...Ae.ownerState}},ref:he,className:Me(et.input,Ae.className,H&&"MuiInputBase-readOnly"),onBlur:Fe,onChange:Ve,onFocus:be})}),b,B?B({...Se,startAdornment:Z}):null]})]})});function d6(e){return ct("MuiInput",e)}const oa={...Gr,...ut("MuiInput",["root","underline","input"])};function f6(e){return ct("MuiOutlinedInput",e)}const ws={...Gr,...ut("MuiOutlinedInput",["root","notchedOutline","input"])};function p6(e){return ct("MuiFilledInput",e)}const rs={...Gr,...ut("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},iR=_e(s.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function h6(e){return ct("MuiAutocomplete",e)}const Zt=ut("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var Ak,Fk;const m6=e=>{const{classes:t,disablePortal:n,expanded:r,focused:o,fullWidth:i,hasClearIcon:l,hasPopupIcon:c,inputFocused:u,popupOpen:f,size:h}=e,p={root:["root",r&&"expanded",o&&"focused",i&&"fullWidth",l&&"hasClearIcon",c&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",u&&"inputFocused"],tag:["tag",`tagSize${Pe(h)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",f&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Be(p,h6,t)},g6=Ce("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:r,hasClearIcon:o,hasPopupIcon:i,inputFocused:l,size:c}=n;return[{[`& .${Zt.tag}`]:t.tag},{[`& .${Zt.tag}`]:t[`tagSize${Pe(c)}`]},{[`& .${Zt.inputRoot}`]:t.inputRoot},{[`& .${Zt.input}`]:t.input},{[`& .${Zt.input}`]:l&&t.inputFocused},t.root,r&&t.fullWidth,i&&t.hasPopupIcon,o&&t.hasClearIcon]}})({[`&.${Zt.focused} .${Zt.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${Zt.clearIndicator}`]:{visibility:"visible"}},[`& .${Zt.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${Zt.inputRoot}`]:{[`.${Zt.hasPopupIcon}&, .${Zt.hasClearIcon}&`]:{paddingRight:30},[`.${Zt.hasPopupIcon}.${Zt.hasClearIcon}&`]:{paddingRight:56},[`& .${Zt.input}`]:{width:0,minWidth:30}},[`& .${oa.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${oa.root}.${Gr.sizeSmall}`]:{[`& .${oa.input}`]:{padding:"2px 4px 3px 0"}},[`& .${ws.root}`]:{padding:9,[`.${Zt.hasPopupIcon}&, .${Zt.hasClearIcon}&`]:{paddingRight:39},[`.${Zt.hasPopupIcon}.${Zt.hasClearIcon}&`]:{paddingRight:65},[`& .${Zt.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${Zt.endAdornment}`]:{right:9}},[`& .${ws.root}.${Gr.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${Zt.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${rs.root}`]:{paddingTop:19,paddingLeft:8,[`.${Zt.hasPopupIcon}&, .${Zt.hasClearIcon}&`]:{paddingRight:39},[`.${Zt.hasPopupIcon}.${Zt.hasClearIcon}&`]:{paddingRight:65},[`& .${rs.input}`]:{padding:"7px 4px"},[`& .${Zt.endAdornment}`]:{right:9}},[`& .${rs.root}.${Gr.sizeSmall}`]:{paddingBottom:1,[`& .${rs.input}`]:{padding:"2.5px 4px"}},[`& .${Gr.hiddenLabel}`]:{paddingTop:8},[`& .${rs.root}.${Gr.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${Zt.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${rs.root}.${Gr.hiddenLabel}.${Gr.sizeSmall}`]:{[`& .${Zt.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${Zt.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${Zt.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${Zt.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${Zt.inputRoot}`]:{flexWrap:"wrap"}}}]}),x6=Ce("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,t)=>t.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),y6=Ce(mt,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,t)=>t.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),b6=Ce(mt,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),v6=Ce(Uc,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Zt.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(tt(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),C6=Ce(Un,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,t)=>t.paper})(tt(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),w6=Ce("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,t)=>t.loading})(tt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),S6=Ce("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,t)=>t.noOptions})(tt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),j6=Ce("ul",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,t)=>t.listbox})(tt(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${Zt.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${Zt.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${Zt.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ye(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Zt.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ye(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${Zt.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Ye(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}}}))),k6=Ce(Z0,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,t)=>t.groupLabel})(tt(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),I6=Ce("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,t)=>t.groupUl})({padding:0,[`& .${Zt.option}`]:{paddingLeft:24}}),sa=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiAutocomplete"}),{autoComplete:o=!1,autoHighlight:i=!1,autoSelect:l=!1,blurOnSelect:c=!1,ChipProps:u,className:f,clearIcon:h=Ak||(Ak=s.jsx(KM,{fontSize:"small"})),clearOnBlur:p=!r.freeSolo,clearOnEscape:g=!1,clearText:y="Clear",closeText:b="Close",componentsProps:v,defaultValue:C=r.multiple?[]:null,disableClearable:S=!1,disableCloseOnSelect:j=!1,disabled:w=!1,disabledItemsFocusable:k=!1,disableListWrap:P=!1,disablePortal:T=!1,filterOptions:$,filterSelectedOptions:M=!1,forcePopupIcon:R="auto",freeSolo:E=!1,fullWidth:O=!1,getLimitTagsText:A=Kt=>`+${Kt}`,getOptionDisabled:N,getOptionKey:F,getOptionLabel:L,isOptionEqualToValue:D,groupBy:H,handleHomeEndKeys:B=!r.freeSolo,id:V,includeInputInList:G=!1,inputValue:_,limitTags:U=-1,ListboxComponent:Z,ListboxProps:Q,loading:ee=!1,loadingText:ne="Loading…",multiple:re=!1,noOptionsText:Y="No options",onChange:ie,onClose:ce,onHighlightChange:he,onInputChange:de,onOpen:le,open:ge,openOnFocus:Se=!1,openText:ke="Open",options:we,PaperComponent:Oe,PopperComponent:be,popupIcon:Fe=Fk||(Fk=s.jsx(iR,{})),readOnly:Ve=!1,renderGroup:De,renderInput:Ze,renderOption:Ae,renderTags:st,selectOnFocus:qe=!r.freeSolo,size:et="medium",slots:oe={},slotProps:fe={},value:Ie,...$e}=r,{getRootProps:pt,getInputProps:vt,getInputLabelProps:Je,getPopupIndicatorProps:me,getClearProps:Ne,getTagProps:xt,getListboxProps:Bt,getOptionProps:pn,value:yn,dirty:hn,expanded:ln,id:An,popupOpen:kt,focused:un,focusedTag:er,anchorEl:yt,setAnchorEl:Ht,inputValue:Ke,groupedOptions:rt}=LH({...r,componentName:"Autocomplete"}),It=!S&&!w&&hn&&!Ve,Lt=(!E||R===!0)&&R!==!1,{onMouseDown:Jt}=vt(),{ref:tr,...kr}=Bt(),so=L||(Kt=>Kt.label??Kt),Kn={...r,disablePortal:T,expanded:ln,focused:un,fullWidth:O,getOptionLabel:so,hasClearIcon:It,hasPopupIcon:Lt,inputFocused:er===-1,popupOpen:kt,size:et},nr=m6(Kn),io={slots:{paper:Oe,popper:be,...oe},slotProps:{chip:u,listbox:Q,...v,...fe}},[Zr,se]=at("listbox",{elementType:j6,externalForwardedProps:io,ownerState:Kn,className:nr.listbox,additionalProps:kr,ref:tr}),[xe,Re]=at("paper",{elementType:Un,externalForwardedProps:io,ownerState:Kn,className:nr.paper}),[nt,wt]=at("popper",{elementType:Uc,externalForwardedProps:io,ownerState:Kn,className:nr.popper,additionalProps:{disablePortal:T,style:{width:yt?yt.clientWidth:null},role:"presentation",anchorEl:yt,open:kt}});let Dt;if(re&&yn.length>0){const Kt=Nr=>({className:nr.tag,disabled:w,...xt(Nr)});st?Dt=st(yn,Kt,Kn):Dt=yn.map((Nr,Qo)=>{const{key:Yo,...Ro}=Kt({index:Qo});return s.jsx(Ge,{label:so(Nr),size:et,...Ro,...io.slotProps.chip},Yo)})}if(U>-1&&Array.isArray(Dt)){const Kt=Dt.length-U;!un&&Kt>0&&(Dt=Dt.splice(0,U),Dt.push(s.jsx("span",{className:nr.tag,children:A(Kt)},Dt.length)))}const qt=De||(Kt=>s.jsxs("li",{children:[s.jsx(k6,{className:nr.groupLabel,ownerState:Kn,component:"div",children:Kt.group}),s.jsx(I6,{className:nr.groupUl,ownerState:Kn,children:Kt.children})]},Kt.key)),nn=Ae||((Kt,Nr)=>{const{key:Qo,...Yo}=Kt;return s.jsx("li",{...Yo,children:so(Nr)},Qo)}),bo=(Kt,Nr)=>{const Qo=pn({option:Kt,index:Nr});return nn({...Qo,className:nr.option},Kt,{selected:Qo["aria-selected"],index:Nr,inputValue:Ke},Kn)},To=io.slotProps.clearIndicator,Mo=io.slotProps.popupIndicator;return s.jsxs(m.Fragment,{children:[s.jsx(g6,{ref:n,className:Me(nr.root,f),ownerState:Kn,...pt($e),children:Ze({id:An,disabled:w,fullWidth:!0,size:et==="small"?"small":void 0,InputLabelProps:Je(),InputProps:{ref:Ht,className:nr.inputRoot,startAdornment:Dt,onMouseDown:Kt=>{Kt.target===Kt.currentTarget&&Jt(Kt)},...(It||Lt)&&{endAdornment:s.jsxs(x6,{className:nr.endAdornment,ownerState:Kn,children:[It?s.jsx(y6,{...Ne(),"aria-label":y,title:y,ownerState:Kn,...To,className:Me(nr.clearIndicator,To==null?void 0:To.className),children:h}):null,Lt?s.jsx(b6,{...me(),disabled:w,"aria-label":kt?b:ke,title:kt?b:ke,ownerState:Kn,...Mo,className:Me(nr.popupIndicator,Mo==null?void 0:Mo.className),children:Fe}):null]})}},inputProps:{className:nr.input,disabled:w,readOnly:Ve,...vt()}})}),yt?s.jsx(v6,{as:nt,...wt,children:s.jsxs(C6,{as:xe,...Re,children:[ee&&rt.length===0?s.jsx(w6,{className:nr.loading,ownerState:Kn,children:ne}):null,rt.length===0&&!E&&!ee?s.jsx(S6,{className:nr.noOptions,ownerState:Kn,role:"presentation",onMouseDown:Kt=>{Kt.preventDefault()},children:Y}):null,rt.length>0?s.jsx(Zr,{as:Z,...se,children:rt.map((Kt,Nr)=>H?qt({key:Kt.key,group:Kt.group,children:Kt.options.map((Qo,Yo)=>bo(Qo,Kt.index+Yo))}):bo(Kt,Nr))}):null]})}):null]})}),E6=_e(s.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function P6(e){return ct("MuiAvatar",e)}ut("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const T6=e=>{const{classes:t,variant:n,colorDefault:r}=e;return Be({root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]},P6,t)},M6=Ce("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],n.colorDefault&&t.colorDefault]}})(tt(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:{color:(e.vars||e).palette.background.default,...e.vars?{backgroundColor:e.vars.palette.Avatar.defaultBg}:{backgroundColor:e.palette.grey[400],...e.applyStyles("dark",{backgroundColor:e.palette.grey[600]})}}}]}))),R6=Ce("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(e,t)=>t.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),$6=Ce(E6,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(e,t)=>t.fallback})({width:"75%",height:"75%"});function O6({crossOrigin:e,referrerPolicy:t,src:n,srcSet:r}){const[o,i]=m.useState(!1);return m.useEffect(()=>{if(!n&&!r)return;i(!1);let l=!0;const c=new Image;return c.onload=()=>{l&&i("loaded")},c.onerror=()=>{l&&i("error")},c.crossOrigin=e,c.referrerPolicy=t,c.src=n,r&&(c.srcset=r),()=>{l=!1}},[e,t,n,r]),o}const Nk=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiAvatar"}),{alt:o,children:i,className:l,component:c="div",slots:u={},slotProps:f={},imgProps:h,sizes:p,src:g,srcSet:y,variant:b="circular",...v}=r;let C=null;const S={...r,component:c,variant:b},j=O6({...h,...typeof f.img=="function"?f.img(S):f.img,src:g,srcSet:y}),w=g||y,k=w&&j!=="error";S.colorDefault=!k,delete S.ownerState;const P=T6(S),[T,$]=at("img",{className:P.img,elementType:R6,externalForwardedProps:{slots:u,slotProps:{img:{...h,...f.img}}},additionalProps:{alt:o,src:g,srcSet:y,sizes:p},ownerState:S});return k?C=s.jsx(T,{...$}):i||i===0?C=i:w&&o?C=o[0]:C=s.jsx($6,{ownerState:S,className:P.fallback}),s.jsx(M6,{as:c,className:Me(P.root,l),ref:n,...v,ownerState:S,children:C})}),z6={entering:{opacity:1},entered:{opacity:1}},eC=m.forwardRef(function(t,n){const r=Xr(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:i,appear:l=!0,children:c,easing:u,in:f,onEnter:h,onEntered:p,onEntering:g,onExit:y,onExited:b,onExiting:v,style:C,timeout:S=o,TransitionComponent:j=Bs,...w}=t,k=m.useRef(null),P=Pn(k,Da(c),n),T=F=>L=>{if(F){const D=k.current;L===void 0?F(D):F(D,L)}},$=T(g),M=T((F,L)=>{yw(F);const D=Ma({style:C,timeout:S,easing:u},{mode:"enter"});F.style.webkitTransition=r.transitions.create("opacity",D),F.style.transition=r.transitions.create("opacity",D),h&&h(F,L)}),R=T(p),E=T(v),O=T(F=>{const L=Ma({style:C,timeout:S,easing:u},{mode:"exit"});F.style.webkitTransition=r.transitions.create("opacity",L),F.style.transition=r.transitions.create("opacity",L),y&&y(F)}),A=T(b),N=F=>{i&&i(k.current,F)};return s.jsx(j,{appear:l,in:f,nodeRef:k,onEnter:M,onEntered:R,onEntering:$,onExit:O,onExited:A,onExiting:E,addEndListener:N,timeout:S,...w,children:(F,{ownerState:L,...D})=>m.cloneElement(c,{style:{opacity:0,visibility:F==="exited"&&!f?"hidden":void 0,...z6[F],...C,...c.props.style},ref:P,...D})})});function L6(e){return ct("MuiBackdrop",e)}ut("MuiBackdrop",["root","invisible"]);const D6=e=>{const{classes:t,invisible:n}=e;return Be({root:["root",n&&"invisible"]},L6,t)},A6=Ce("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),lR=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiBackdrop"}),{children:o,className:i,component:l="div",invisible:c=!1,open:u,components:f={},componentsProps:h={},slotProps:p={},slots:g={},TransitionComponent:y,transitionDuration:b,...v}=r,C={...r,component:l,invisible:c},S=D6(C),j={transition:y,root:f.Root,...g},w={...h,...p},k={slots:j,slotProps:w},[P,T]=at("root",{elementType:A6,externalForwardedProps:k,className:Me(S.root,i),ownerState:C}),[$,M]=at("transition",{elementType:eC,externalForwardedProps:k,ownerState:C});return s.jsx($,{in:u,timeout:b,...v,...M,children:s.jsx(P,{"aria-hidden":!0,...T,classes:S,ref:n,children:o})})});function F6(e){const{badgeContent:t,invisible:n=!1,max:r=99,showZero:o=!1}=e,i=lw({badgeContent:t,max:r});let l=n;n===!1&&t===0&&!o&&(l=!0);const{badgeContent:c,max:u=r}=l?i:e,f=c&&Number(c)>u?`${u}+`:c;return{badgeContent:c,invisible:l,max:u,displayValue:f}}function N6(e){return ct("MuiBadge",e)}const Xl=ut("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),jv=10,kv=4,_6=e=>{const{color:t,anchorOrigin:n,invisible:r,overlap:o,variant:i,classes:l={}}=e,c={root:["root"],badge:["badge",i,r&&"invisible",`anchorOrigin${Pe(n.vertical)}${Pe(n.horizontal)}`,`anchorOrigin${Pe(n.vertical)}${Pe(n.horizontal)}${Pe(o)}`,`overlap${Pe(o)}`,t!=="default"&&`color${Pe(t)}`]};return Be(c,N6,l)},H6=Ce("span",{name:"MuiBadge",slot:"Root",overridesResolver:(e,t)=>t.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),B6=Ce("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.badge,t[n.variant],t[`anchorOrigin${Pe(n.anchorOrigin.vertical)}${Pe(n.anchorOrigin.horizontal)}${Pe(n.overlap)}`],n.color!=="default"&&t[`color${Pe(n.color)}`],n.invisible&&t.invisible]}})(tt(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:jv*2,lineHeight:1,padding:"0 6px",height:jv*2,borderRadius:jv,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen}),variants:[...Object.entries(e.palette).filter(qn(["contrastText"])).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main,color:(e.vars||e).palette[t].contrastText}})),{props:{variant:"dot"},style:{borderRadius:kv,height:kv*2,minWidth:kv*2,padding:0}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular",style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${Xl.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular",style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${Xl.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular",style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${Xl.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular",style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${Xl.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular",style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${Xl.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular",style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${Xl.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular",style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${Xl.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular",style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${Xl.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})}}]})));function _k(e){return{vertical:(e==null?void 0:e.vertical)??"top",horizontal:(e==null?void 0:e.horizontal)??"right"}}const lp=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiBadge"}),{anchorOrigin:o,className:i,classes:l,component:c,components:u={},componentsProps:f={},children:h,overlap:p="rectangular",color:g="default",invisible:y=!1,max:b=99,badgeContent:v,slots:C,slotProps:S,showZero:j=!1,variant:w="standard",...k}=r,{badgeContent:P,invisible:T,max:$,displayValue:M}=F6({max:b,invisible:y,badgeContent:v,showZero:j}),R=lw({anchorOrigin:_k(o),color:g,overlap:p,variant:w,badgeContent:v}),E=T||P==null&&w!=="dot",{color:O=g,overlap:A=p,anchorOrigin:N,variant:F=w}=E?R:r,L=_k(N),D=F!=="dot"?M:void 0,H={...r,badgeContent:P,invisible:E,max:$,displayValue:D,showZero:j,anchorOrigin:L,color:O,overlap:A,variant:F},B=_6(H),V={slots:{root:(C==null?void 0:C.root)??u.Root,badge:(C==null?void 0:C.badge)??u.Badge},slotProps:{root:(S==null?void 0:S.root)??f.root,badge:(S==null?void 0:S.badge)??f.badge}},[G,_]=at("root",{elementType:H6,externalForwardedProps:{...V,...k},ownerState:H,className:Me(B.root,i),ref:n,additionalProps:{as:c}}),[U,Z]=at("badge",{elementType:B6,externalForwardedProps:V,ownerState:H,className:B.badge});return s.jsxs(G,{..._,children:[h,s.jsx(U,{...Z,children:D})]})}),W6=ut("MuiBox",["root"]),V6=Nx(),K=C4({themeId:Ti,defaultTheme:V6,defaultClassName:W6.root,generateClassName:mM.generate}),G6=_e(s.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),U6=Ce(Ds,{name:"MuiBreadcrumbCollapsed"})(tt(({theme:e})=>({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`,...e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}},"&:active":{boxShadow:e.shadows[0],...e.palette.mode==="light"?{backgroundColor:Vg(e.palette.grey[200],.12)}:{backgroundColor:Vg(e.palette.grey[600],.12)}}}))),q6=Ce(G6)({width:24,height:16});function K6(e){const{slots:t={},slotProps:n={},...r}=e,o=e;return s.jsx("li",{children:s.jsx(U6,{focusRipple:!0,...r,ownerState:o,children:s.jsx(q6,{as:t.CollapsedIcon,ownerState:o,...n.collapsedIcon})})})}function Q6(e){return ct("MuiBreadcrumbs",e)}const Y6=ut("MuiBreadcrumbs",["root","ol","li","separator"]),X6=e=>{const{classes:t}=e;return Be({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},Q6,t)},Z6=Ce(J,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${Y6.li}`]:t.li},t.root]})({}),J6=Ce("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),e9=Ce("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function t9(e,t,n,r){return e.reduce((o,i,l)=>(l<e.length-1?o=o.concat(i,s.jsx(e9,{"aria-hidden":!0,className:t,ownerState:r,children:n},`separator-${l}`)):o.push(i),o),[])}const n9=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiBreadcrumbs"}),{children:o,className:i,component:l="nav",slots:c={},slotProps:u={},expandText:f="Show path",itemsAfterCollapse:h=1,itemsBeforeCollapse:p=1,maxItems:g=8,separator:y="/",...b}=r,[v,C]=m.useState(!1),S={...r,component:l,expanded:v,expandText:f,itemsAfterCollapse:h,itemsBeforeCollapse:p,maxItems:g,separator:y},j=X6(S),w=zc({elementType:c.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:S}),k=m.useRef(null),P=$=>{const M=()=>{C(!0);const R=k.current.querySelector("a[href],button,[tabindex]");R&&R.focus()};return p+h>=$.length?$:[...$.slice(0,p),s.jsx(K6,{"aria-label":f,slots:{CollapsedIcon:c.CollapsedIcon},slotProps:{collapsedIcon:w},onClick:M},"ellipsis"),...$.slice($.length-h,$.length)]},T=m.Children.toArray(o).filter($=>m.isValidElement($)).map(($,M)=>s.jsx("li",{className:j.li,children:$},`child-${M}`));return s.jsx(Z6,{ref:n,component:l,color:"textSecondary",className:Me(j.root,i),ownerState:S,...b,children:s.jsx(J6,{className:j.ol,ref:k,ownerState:S,children:t9(v||g&&T.length<=g?T:P(T),j.separator,y,S)})})});function r9(e){return ct("MuiButton",e)}const tc=ut("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),o9=m.createContext({}),s9=m.createContext(void 0),i9=e=>{const{color:t,disableElevation:n,fullWidth:r,size:o,variant:i,loading:l,loadingPosition:c,classes:u}=e,f={root:["root",l&&"loading",i,`${i}${Pe(t)}`,`size${Pe(o)}`,`${i}Size${Pe(o)}`,`color${Pe(t)}`,n&&"disableElevation",r&&"fullWidth",l&&`loadingPosition${Pe(c)}`],startIcon:["icon","startIcon",`iconSize${Pe(o)}`],endIcon:["icon","endIcon",`iconSize${Pe(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},h=Be(f,r9,u);return{...u,...h}},aR=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],l9=Ce(Ds,{shouldForwardProp:e=>yo(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${Pe(n.color)}`],t[`size${Pe(n.size)}`],t[`${n.variant}Size${Pe(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(tt(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${tc.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${tc.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${tc.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${tc.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(qn()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(e.vars||e).palette[r].main,"--variant-outlinedColor":(e.vars||e).palette[r].main,"--variant-outlinedBorder":e.vars?`rgba(${e.vars.palette[r].mainChannel} / 0.5)`:Ye(e.palette[r].main,.5),"--variant-containedColor":(e.vars||e).palette[r].contrastText,"--variant-containedBg":(e.vars||e).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[r].dark,"--variant-textBg":e.vars?`rgba(${e.vars.palette[r].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ye(e.palette[r].main,e.palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[r].main,"--variant-outlinedBg":e.vars?`rgba(${e.vars.palette[r].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ye(e.palette[r].main,e.palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Ye(e.palette.text.primary,e.palette.action.hoverOpacity),"--variant-outlinedBg":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Ye(e.palette.text.primary,e.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${tc.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${tc.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${tc.loading}`]:{color:"transparent"}}}]}})),a9=Ce("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${Pe(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...aR]})),c9=Ce("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${Pe(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...aR]})),u9=Ce("span",{name:"MuiButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),Hk=Ce("span",{name:"MuiButton",slot:"LoadingIconPlaceholder",overridesResolver:(e,t)=>t.loadingIconPlaceholder})({display:"inline-block",width:"1em",height:"1em"}),Le=m.forwardRef(function(t,n){const r=m.useContext(o9),o=m.useContext(s9),i=Oc(r,t),l=ft({props:i,name:"MuiButton"}),{children:c,color:u="primary",component:f="button",className:h,disabled:p=!1,disableElevation:g=!1,disableFocusRipple:y=!1,endIcon:b,focusVisibleClassName:v,fullWidth:C=!1,id:S,loading:j=null,loadingIndicator:w,loadingPosition:k="center",size:P="medium",startIcon:T,type:$,variant:M="text",...R}=l,E=Sn(S),O=w??s.jsx(At,{"aria-labelledby":E,color:"inherit",size:16}),A={...l,color:u,component:f,disabled:p,disableElevation:g,disableFocusRipple:y,fullWidth:C,loading:j,loadingIndicator:O,loadingPosition:k,size:P,type:$,variant:M},N=i9(A),F=(T||j&&k==="start")&&s.jsx(a9,{className:N.startIcon,ownerState:A,children:T||s.jsx(Hk,{className:N.loadingIconPlaceholder,ownerState:A})}),L=(b||j&&k==="end")&&s.jsx(c9,{className:N.endIcon,ownerState:A,children:b||s.jsx(Hk,{className:N.loadingIconPlaceholder,ownerState:A})}),D=o||"",H=typeof j=="boolean"?s.jsx("span",{className:N.loadingWrapper,style:{display:"contents"},children:j&&s.jsx(u9,{className:N.loadingIndicator,ownerState:A,children:O})}):null;return s.jsxs(l9,{ownerState:A,className:Me(r.className,N.root,h,D),component:f,disabled:p||j,focusRipple:!y,focusVisibleClassName:Me(N.focusVisible,v),ref:n,type:$,id:j?E:S,...R,classes:N,children:[F,k!=="end"&&H,c,k==="end"&&H,L]})});function d9(e){return ct("PrivateSwitchBase",e)}ut("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const f9=e=>{const{classes:t,checked:n,disabled:r,edge:o}=e,i={root:["root",n&&"checked",r&&"disabled",o&&`edge${Pe(o)}`],input:["input"]};return Be(i,d9,t)},p9=Ce(Ds,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),h9=Ce("input",{name:"MuiSwitchBase",shouldForwardProp:yo})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),cR=m.forwardRef(function(t,n){const{autoFocus:r,checked:o,checkedIcon:i,defaultChecked:l,disabled:c,disableFocusRipple:u=!1,edge:f=!1,icon:h,id:p,inputProps:g,inputRef:y,name:b,onBlur:v,onChange:C,onFocus:S,readOnly:j,required:w=!1,tabIndex:k,type:P,value:T,slots:$={},slotProps:M={},...R}=t,[E,O]=va({controlled:o,default:!!l,name:"SwitchBase",state:"checked"}),A=jl(),N=ee=>{S&&S(ee),A&&A.onFocus&&A.onFocus(ee)},F=ee=>{v&&v(ee),A&&A.onBlur&&A.onBlur(ee)},L=ee=>{if(ee.nativeEvent.defaultPrevented)return;const ne=ee.target.checked;O(ne),C&&C(ee,ne)};let D=c;A&&typeof D>"u"&&(D=A.disabled);const H=P==="checkbox"||P==="radio",B={...t,checked:E,disabled:D,disableFocusRipple:u,edge:f},V=f9(B),G={slots:$,slotProps:{input:g,...M}},[_,U]=at("root",{ref:n,elementType:p9,className:V.root,shouldForwardComponentProp:!0,externalForwardedProps:{...G,component:"span",...R},getSlotProps:ee=>({...ee,onFocus:ne=>{var re;(re=ee.onFocus)==null||re.call(ee,ne),N(ne)},onBlur:ne=>{var re;(re=ee.onBlur)==null||re.call(ee,ne),F(ne)}}),ownerState:B,additionalProps:{centerRipple:!0,focusRipple:!u,disabled:D,role:void 0,tabIndex:null}}),[Z,Q]=at("input",{ref:y,elementType:h9,className:V.input,externalForwardedProps:G,getSlotProps:ee=>({onChange:ne=>{var re;(re=ee.onChange)==null||re.call(ee,ne),L(ne)}}),ownerState:B,additionalProps:{autoFocus:r,checked:o,defaultChecked:l,disabled:D,id:H?p:void 0,name:b,readOnly:j,required:w,tabIndex:k,type:P,...P==="checkbox"&&T===void 0?{}:{value:T}}});return s.jsxs(_,{...U,children:[s.jsx(Z,{...Q}),E?i:h]})}),m9=_e(s.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),g9=_e(s.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),x9=_e(s.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function y9(e){return ct("MuiCheckbox",e)}const Iv=ut("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),b9=e=>{const{classes:t,indeterminate:n,color:r,size:o}=e,i={root:["root",n&&"indeterminate",`color${Pe(r)}`,`size${Pe(o)}`]},l=Be(i,y9,t);return{...t,...l}},v9=Ce(cR,{shouldForwardProp:e=>yo(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${Pe(n.size)}`],n.color!=="default"&&t[`color${Pe(n.color)}`]]}})(tt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ye(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(qn()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ye(e.palette[t].main,e.palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(qn()).map(([t])=>({props:{color:t},style:{[`&.${Iv.checked}, &.${Iv.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${Iv.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),C9=s.jsx(g9,{}),w9=s.jsx(m9,{}),S9=s.jsx(x9,{}),$s=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiCheckbox"}),{checkedIcon:o=C9,color:i="primary",icon:l=w9,indeterminate:c=!1,indeterminateIcon:u=S9,inputProps:f,size:h="medium",disableRipple:p=!1,className:g,slots:y={},slotProps:b={},...v}=r,C=c?u:l,S=c?u:o,j={...r,disableRipple:p,color:i,indeterminate:c,size:h},w=b9(j),k=b.input??f,[P,T]=at("root",{ref:n,elementType:v9,className:Me(w.root,g),shouldForwardComponentProp:!0,externalForwardedProps:{slots:y,slotProps:b,...v},ownerState:j,additionalProps:{type:"checkbox",icon:m.cloneElement(C,{fontSize:C.props.fontSize??h}),checkedIcon:m.cloneElement(S,{fontSize:S.props.fontSize??h}),disableRipple:p,slots:y,slotProps:{input:mw(typeof k=="function"?k(j):k,{"data-indeterminate":c})}}});return s.jsx(P,{...T,classes:w})});function Bk(e){return e.substring(2).toLowerCase()}function j9(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function Iw(e){const{children:t,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:o,touchEvent:i="onTouchEnd"}=e,l=m.useRef(!1),c=m.useRef(null),u=m.useRef(!1),f=m.useRef(!1);m.useEffect(()=>(setTimeout(()=>{u.current=!0},0),()=>{u.current=!1}),[]);const h=Pn(Da(t),c),p=Vt(b=>{const v=f.current;f.current=!1;const C=ir(c.current);if(!u.current||!c.current||"clientX"in b&&j9(b,C))return;if(l.current){l.current=!1;return}let S;b.composedPath?S=b.composedPath().includes(c.current):S=!C.documentElement.contains(b.target)||c.current.contains(b.target),!S&&(n||!v)&&o(b)}),g=b=>v=>{f.current=!0;const C=t.props[b];C&&C(v)},y={ref:h};return i!==!1&&(y[i]=g(i)),m.useEffect(()=>{if(i!==!1){const b=Bk(i),v=ir(c.current),C=()=>{l.current=!0};return v.addEventListener(b,p),v.addEventListener("touchmove",C),()=>{v.removeEventListener(b,p),v.removeEventListener("touchmove",C)}}},[p,i]),r!==!1&&(y[r]=g(r)),m.useEffect(()=>{if(r!==!1){const b=Bk(r),v=ir(c.current);return v.addEventListener(b,p),()=>{v.removeEventListener(b,p)}}},[p,r]),m.cloneElement(t,y)}const Bf=f3({createStyledComponent:Ce("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`maxWidth${Pe(String(n.maxWidth))}`],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),useThemeProps:e=>ft({props:e,name:"MuiContainer"})});function k9(e){const t=ir(e);return t.body===e?qo(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function vp(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function Wk(e){return parseInt(qo(e).getComputedStyle(e).paddingRight,10)||0}function I9(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),r=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||r}function Vk(e,t,n,r,o){const i=[t,n,...r];[].forEach.call(e.children,l=>{const c=!i.includes(l),u=!I9(l);c&&u&&vp(l,o)})}function Ev(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function E9(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(k9(r)){const l=SM(qo(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${Wk(r)+l}px`;const c=ir(r).querySelectorAll(".mui-fixed");[].forEach.call(c,u=>{n.push({value:u.style.paddingRight,property:"padding-right",el:u}),u.style.paddingRight=`${Wk(u)+l}px`})}let i;if(r.parentNode instanceof DocumentFragment)i=ir(r).body;else{const l=r.parentElement,c=qo(r);i=(l==null?void 0:l.nodeName)==="HTML"&&c.getComputedStyle(l).overflowY==="scroll"?l:r}n.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{n.forEach(({value:i,el:l,property:c})=>{i?l.style.setProperty(c,i):l.style.removeProperty(c)})}}function P9(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class T9{constructor(){this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&vp(t.modalRef,!1);const o=P9(n);Vk(n,t.mount,t.modalRef,o,!0);const i=Ev(this.containers,l=>l.container===n);return i!==-1?(this.containers[i].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),r)}mount(t,n){const r=Ev(this.containers,i=>i.modals.includes(t)),o=this.containers[r];o.restore||(o.restore=E9(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=Ev(this.containers,l=>l.modals.includes(t)),i=this.containers[o];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(r,1),i.modals.length===0)i.restore&&i.restore(),t.modalRef&&vp(t.modalRef,n),Vk(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(o,1);else{const l=i.modals[i.modals.length-1];l.modalRef&&vp(l.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}const M9=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function R9(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function $9(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function O9(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||$9(e))}function z9(e){const t=[],n=[];return Array.from(e.querySelectorAll(M9)).forEach((r,o)=>{const i=R9(r);i===-1||!O9(r)||(i===0?t.push(r):n.push({documentOrder:o,tabIndex:i,node:r}))}),n.sort((r,o)=>r.tabIndex===o.tabIndex?r.documentOrder-o.documentOrder:r.tabIndex-o.tabIndex).map(r=>r.node).concat(t)}function L9(){return!0}function uR(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:i=z9,isEnabled:l=L9,open:c}=e,u=m.useRef(!1),f=m.useRef(null),h=m.useRef(null),p=m.useRef(null),g=m.useRef(null),y=m.useRef(!1),b=m.useRef(null),v=Pn(Da(t),b),C=m.useRef(null);m.useEffect(()=>{!c||!b.current||(y.current=!n)},[n,c]),m.useEffect(()=>{if(!c||!b.current)return;const w=ir(b.current);return b.current.contains(w.activeElement)||(b.current.hasAttribute("tabIndex")||b.current.setAttribute("tabIndex","-1"),y.current&&b.current.focus()),()=>{o||(p.current&&p.current.focus&&(u.current=!0,p.current.focus()),p.current=null)}},[c]),m.useEffect(()=>{if(!c||!b.current)return;const w=ir(b.current),k=$=>{C.current=$,!(r||!l()||$.key!=="Tab")&&w.activeElement===b.current&&$.shiftKey&&(u.current=!0,h.current&&h.current.focus())},P=()=>{var R,E;const $=b.current;if($===null)return;if(!w.hasFocus()||!l()||u.current){u.current=!1;return}if($.contains(w.activeElement)||r&&w.activeElement!==f.current&&w.activeElement!==h.current)return;if(w.activeElement!==g.current)g.current=null;else if(g.current!==null)return;if(!y.current)return;let M=[];if((w.activeElement===f.current||w.activeElement===h.current)&&(M=i(b.current)),M.length>0){const O=!!((R=C.current)!=null&&R.shiftKey&&((E=C.current)==null?void 0:E.key)==="Tab"),A=M[0],N=M[M.length-1];typeof A!="string"&&typeof N!="string"&&(O?N.focus():A.focus())}else $.focus()};w.addEventListener("focusin",P),w.addEventListener("keydown",k,!0);const T=setInterval(()=>{w.activeElement&&w.activeElement.tagName==="BODY"&&P()},50);return()=>{clearInterval(T),w.removeEventListener("focusin",P),w.removeEventListener("keydown",k,!0)}},[n,r,o,l,c,i]);const S=w=>{p.current===null&&(p.current=w.relatedTarget),y.current=!0,g.current=w.target;const k=t.props.onFocus;k&&k(w)},j=w=>{p.current===null&&(p.current=w.relatedTarget),y.current=!0};return s.jsxs(m.Fragment,{children:[s.jsx("div",{tabIndex:c?0:-1,onFocus:j,ref:f,"data-testid":"sentinelStart"}),m.cloneElement(t,{ref:v,onFocus:S}),s.jsx("div",{tabIndex:c?0:-1,onFocus:j,ref:h,"data-testid":"sentinelEnd"})]})}function D9(e){return typeof e=="function"?e():e}function A9(e){return e?e.props.hasOwnProperty("in"):!1}const Gk=()=>{},Xm=new T9;function F9(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:o=!1,onTransitionEnter:i,onTransitionExited:l,children:c,onClose:u,open:f,rootRef:h}=e,p=m.useRef({}),g=m.useRef(null),y=m.useRef(null),b=Pn(y,h),[v,C]=m.useState(!f),S=A9(c);let j=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(j=!1);const w=()=>ir(g.current),k=()=>(p.current.modalRef=y.current,p.current.mount=g.current,p.current),P=()=>{Xm.mount(k(),{disableScrollLock:r}),y.current&&(y.current.scrollTop=0)},T=Vt(()=>{const L=D9(t)||w().body;Xm.add(k(),L),y.current&&P()}),$=()=>Xm.isTopModal(k()),M=Vt(L=>{g.current=L,L&&(f&&$()?P():y.current&&vp(y.current,j))}),R=m.useCallback(()=>{Xm.remove(k(),j)},[j]);m.useEffect(()=>()=>{R()},[R]),m.useEffect(()=>{f?T():(!S||!o)&&R()},[f,R,S,o,T]);const E=L=>D=>{var H;(H=L.onKeyDown)==null||H.call(L,D),!(D.key!=="Escape"||D.which===229||!$())&&(n||(D.stopPropagation(),u&&u(D,"escapeKeyDown")))},O=L=>D=>{var H;(H=L.onClick)==null||H.call(L,D),D.target===D.currentTarget&&u&&u(D,"backdropClick")};return{getRootProps:(L={})=>{const D=Gg(e);delete D.onTransitionEnter,delete D.onTransitionExited;const H={...D,...L};return{role:"presentation",...H,onKeyDown:E(H),ref:b}},getBackdropProps:(L={})=>{const D=L;return{"aria-hidden":!0,...D,onClick:O(D),open:f}},getTransitionProps:()=>{const L=()=>{C(!1),i&&i()},D=()=>{C(!0),l&&l(),o&&R()};return{onEnter:Y2(L,(c==null?void 0:c.props.onEnter)??Gk),onExited:Y2(D,(c==null?void 0:c.props.onExited)??Gk)}},rootRef:b,portalRef:M,isTopModal:$,exited:v,hasTransition:S}}function N9(e){return ct("MuiModal",e)}ut("MuiModal",["root","hidden","backdrop"]);const _9=e=>{const{open:t,exited:n,classes:r}=e;return Be({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},N9,r)},H9=Ce("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(tt(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:t})=>!t.open&&t.exited,style:{visibility:"hidden"}}]}))),B9=Ce(lR,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),Ew=m.forwardRef(function(t,n){const r=ft({name:"MuiModal",props:t}),{BackdropComponent:o=B9,BackdropProps:i,classes:l,className:c,closeAfterTransition:u=!1,children:f,container:h,component:p,components:g={},componentsProps:y={},disableAutoFocus:b=!1,disableEnforceFocus:v=!1,disableEscapeKeyDown:C=!1,disablePortal:S=!1,disableRestoreFocus:j=!1,disableScrollLock:w=!1,hideBackdrop:k=!1,keepMounted:P=!1,onBackdropClick:T,onClose:$,onTransitionEnter:M,onTransitionExited:R,open:E,slotProps:O={},slots:A={},theme:N,...F}=r,L={...r,closeAfterTransition:u,disableAutoFocus:b,disableEnforceFocus:v,disableEscapeKeyDown:C,disablePortal:S,disableRestoreFocus:j,disableScrollLock:w,hideBackdrop:k,keepMounted:P},{getRootProps:D,getBackdropProps:H,getTransitionProps:B,portalRef:V,isTopModal:G,exited:_,hasTransition:U}=F9({...L,rootRef:n}),Z={...L,exited:_},Q=_9(Z),ee={};if(f.props.tabIndex===void 0&&(ee.tabIndex="-1"),U){const{onEnter:he,onExited:de}=B();ee.onEnter=he,ee.onExited=de}const ne={slots:{root:g.Root,backdrop:g.Backdrop,...A},slotProps:{...y,...O}},[re,Y]=at("root",{ref:n,elementType:H9,externalForwardedProps:{...ne,...F,component:p},getSlotProps:D,ownerState:Z,className:Me(c,Q==null?void 0:Q.root,!Z.open&&Z.exited&&(Q==null?void 0:Q.hidden))}),[ie,ce]=at("backdrop",{ref:i==null?void 0:i.ref,elementType:o,externalForwardedProps:ne,shouldForwardComponentProp:!0,additionalProps:i,getSlotProps:he=>H({...he,onClick:de=>{T&&T(de),he!=null&&he.onClick&&he.onClick(de)}}),className:Me(i==null?void 0:i.className,Q==null?void 0:Q.backdrop),ownerState:Z});return!P&&!E&&(!U||_)?null:s.jsx(sR,{ref:V,container:h,disablePortal:S,children:s.jsxs(re,{...Y,children:[!k&&o?s.jsx(ie,{...ce}):null,s.jsx(uR,{disableEnforceFocus:v,disableAutoFocus:b,disableRestoreFocus:j,isEnabled:G,open:E,children:m.cloneElement(f,ee)})]})})});function W9(e){return ct("MuiDialog",e)}const Pv=ut("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),dR=m.createContext({}),V9=Ce(lR,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),G9=e=>{const{classes:t,scroll:n,maxWidth:r,fullWidth:o,fullScreen:i}=e,l={root:["root"],container:["container",`scroll${Pe(n)}`],paper:["paper",`paperScroll${Pe(n)}`,`paperWidth${Pe(String(r))}`,o&&"paperFullWidth",i&&"paperFullScreen"]};return Be(l,W9,t)},U9=Ce(Ew,{name:"MuiDialog",slot:"Root",overridesResolver:(e,t)=>t.root})({"@media print":{position:"absolute !important"}}),q9=Ce("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${Pe(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),K9=Ce(Un,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${Pe(n.scroll)}`],t[`paperWidth${Pe(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(tt(({theme:e})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:t})=>!t.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:e.breakpoints.unit==="px"?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${Pv.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(t=>t!=="xs").map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${Pv.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:t})=>t.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:t})=>t.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${Pv.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),gn=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiDialog"}),o=Xr(),i={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{"aria-describedby":l,"aria-labelledby":c,"aria-modal":u=!0,BackdropComponent:f,BackdropProps:h,children:p,className:g,disableEscapeKeyDown:y=!1,fullScreen:b=!1,fullWidth:v=!1,maxWidth:C="sm",onBackdropClick:S,onClick:j,onClose:w,open:k,PaperComponent:P=Un,PaperProps:T={},scroll:$="paper",slots:M={},slotProps:R={},TransitionComponent:E=eC,transitionDuration:O=i,TransitionProps:A,...N}=r,F={...r,disableEscapeKeyDown:y,fullScreen:b,fullWidth:v,maxWidth:C,scroll:$},L=G9(F),D=m.useRef(),H=ge=>{D.current=ge.target===ge.currentTarget},B=ge=>{j&&j(ge),D.current&&(D.current=null,S&&S(ge),w&&w(ge,"backdropClick"))},V=Sn(c),G=m.useMemo(()=>({titleId:V}),[V]),_={transition:E,...M},U={transition:A,paper:T,backdrop:h,...R},Z={slots:_,slotProps:U},[Q,ee]=at("root",{elementType:U9,shouldForwardComponentProp:!0,externalForwardedProps:Z,ownerState:F,className:Me(L.root,g),ref:n}),[ne,re]=at("backdrop",{elementType:V9,shouldForwardComponentProp:!0,externalForwardedProps:Z,ownerState:F}),[Y,ie]=at("paper",{elementType:K9,shouldForwardComponentProp:!0,externalForwardedProps:Z,ownerState:F,className:Me(L.paper,T.className)}),[ce,he]=at("container",{elementType:q9,externalForwardedProps:Z,ownerState:F,className:Me(L.container)}),[de,le]=at("transition",{elementType:eC,externalForwardedProps:Z,ownerState:F,additionalProps:{appear:!0,in:k,timeout:O,role:"presentation"}});return s.jsx(Q,{closeAfterTransition:!0,slots:{backdrop:ne},slotProps:{backdrop:{transitionDuration:O,as:f,...re}},disableEscapeKeyDown:y,onClose:w,open:k,onClick:B,...ee,...N,children:s.jsx(de,{...le,children:s.jsx(ce,{onMouseDown:H,...he,children:s.jsx(Y,{as:P,elevation:24,role:"dialog","aria-describedby":l,"aria-labelledby":V,"aria-modal":u,...ie,children:s.jsx(dR.Provider,{value:G,children:p})})})})})});function Q9(e){return ct("MuiDialogActions",e)}ut("MuiDialogActions",["root","spacing"]);const Y9=e=>{const{classes:t,disableSpacing:n}=e;return Be({root:["root",!n&&"spacing"]},Q9,t)},X9=Ce("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),vn=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiDialogActions"}),{className:o,disableSpacing:i=!1,...l}=r,c={...r,disableSpacing:i},u=Y9(c);return s.jsx(X9,{className:Me(u.root,o),ownerState:c,ref:n,...l})});function Z9(e){return ct("MuiDialogContent",e)}ut("MuiDialogContent",["root","dividers"]);function J9(e){return ct("MuiDialogTitle",e)}const eW=ut("MuiDialogTitle",["root"]),tW=e=>{const{classes:t,dividers:n}=e;return Be({root:["root",n&&"dividers"]},Z9,t)},nW=Ce("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(tt(({theme:e})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:t})=>t.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>!t.dividers,style:{[`.${eW.root} + &`]:{paddingTop:0}}}]}))),Cn=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiDialogContent"}),{className:o,dividers:i=!1,...l}=r,c={...r,dividers:i},u=tW(c);return s.jsx(nW,{className:Me(u.root,o),ownerState:c,ref:n,...l})}),rW=e=>{const{classes:t}=e;return Be({root:["root"]},J9,t)},oW=Ce(J,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:"16px 24px",flex:"0 0 auto"}),wn=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiDialogTitle"}),{className:o,id:i,...l}=r,c=r,u=rW(c),{titleId:f=i}=m.useContext(dR);return s.jsx(oW,{component:"h2",className:Me(u.root,o),ownerState:c,ref:n,variant:"h6",id:i??f,...l})});function sW(e){return ct("MuiDivider",e)}const Uk=ut("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),iW=e=>{const{absolute:t,children:n,classes:r,flexItem:o,light:i,orientation:l,textAlign:c,variant:u}=e;return Be({root:["root",t&&"absolute",u,i&&"light",l==="vertical"&&"vertical",o&&"flexItem",n&&"withChildren",n&&l==="vertical"&&"withChildrenVertical",c==="right"&&l!=="vertical"&&"textAlignRight",c==="left"&&l!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",l==="vertical"&&"wrapperVertical"]},sW,r)},lW=Ce("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,n.orientation==="vertical"&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&n.orientation==="vertical"&&t.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&t.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&t.textAlignLeft]}})(tt(({theme:e})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:Ye(e.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:e.spacing(2),marginRight:e.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:e.spacing(1),marginBottom:e.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:t})=>!!t.children,style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:t})=>t.children&&t.orientation!=="vertical",style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:t})=>t.orientation==="vertical"&&t.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:t})=>t.textAlign==="right"&&t.orientation!=="vertical",style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:t})=>t.textAlign==="left"&&t.orientation!=="vertical",style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),aW=Ce("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.wrapper,n.orientation==="vertical"&&t.wrapperVertical]}})(tt(({theme:e})=>({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`}}]}))),Ho=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiDivider"}),{absolute:o=!1,children:i,className:l,orientation:c="horizontal",component:u=i||c==="vertical"?"div":"hr",flexItem:f=!1,light:h=!1,role:p=u!=="hr"?"separator":void 0,textAlign:g="center",variant:y="fullWidth",...b}=r,v={...r,absolute:o,component:u,flexItem:f,light:h,orientation:c,role:p,textAlign:g,variant:y},C=iW(v);return s.jsx(lW,{as:u,className:Me(C.root,l),role:p,ref:n,ownerState:v,"aria-orientation":p==="separator"&&(u!=="hr"||c==="vertical")?c:void 0,...b,children:i?s.jsx(aW,{className:C.wrapper,ownerState:v,children:i}):null})});Ho&&(Ho.muiSkipListHighlight=!0);function cW(e,t,n){const r=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),i=qo(t);let l;if(t.fakeTransform)l=t.fakeTransform;else{const f=i.getComputedStyle(t);l=f.getPropertyValue("-webkit-transform")||f.getPropertyValue("transform")}let c=0,u=0;if(l&&l!=="none"&&typeof l=="string"){const f=l.split("(")[1].split(")")[0].split(",");c=parseInt(f[4],10),u=parseInt(f[5],10)}return e==="left"?o?`translateX(${o.right+c-r.left}px)`:`translateX(${i.innerWidth+c-r.left}px)`:e==="right"?o?`translateX(-${r.right-o.left-c}px)`:`translateX(-${r.left+r.width-c}px)`:e==="up"?o?`translateY(${o.bottom+u-r.top}px)`:`translateY(${i.innerHeight+u-r.top}px)`:o?`translateY(-${r.top-o.top+r.height-u}px)`:`translateY(-${r.top+r.height-u}px)`}function uW(e){return typeof e=="function"?e():e}function Zm(e,t,n){const r=uW(n),o=cW(e,t,r);o&&(t.style.webkitTransform=o,t.style.transform=o)}const fR=m.forwardRef(function(t,n){const r=Xr(),o={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:l,appear:c=!0,children:u,container:f,direction:h="down",easing:p=o,in:g,onEnter:y,onEntered:b,onEntering:v,onExit:C,onExited:S,onExiting:j,style:w,timeout:k=i,TransitionComponent:P=Bs,...T}=t,$=m.useRef(null),M=Pn(Da(u),$,n),R=B=>V=>{B&&(V===void 0?B($.current):B($.current,V))},E=R((B,V)=>{Zm(h,B,f),yw(B),y&&y(B,V)}),O=R((B,V)=>{const G=Ma({timeout:k,style:w,easing:p},{mode:"enter"});B.style.webkitTransition=r.transitions.create("-webkit-transform",{...G}),B.style.transition=r.transitions.create("transform",{...G}),B.style.webkitTransform="none",B.style.transform="none",v&&v(B,V)}),A=R(b),N=R(j),F=R(B=>{const V=Ma({timeout:k,style:w,easing:p},{mode:"exit"});B.style.webkitTransition=r.transitions.create("-webkit-transform",V),B.style.transition=r.transitions.create("transform",V),Zm(h,B,f),C&&C(B)}),L=R(B=>{B.style.webkitTransition="",B.style.transition="",S&&S(B)}),D=B=>{l&&l($.current,B)},H=m.useCallback(()=>{$.current&&Zm(h,$.current,f)},[h,f]);return m.useEffect(()=>{if(g||h==="down"||h==="right")return;const B=gh(()=>{$.current&&Zm(h,$.current,f)}),V=qo($.current);return V.addEventListener("resize",B),()=>{B.clear(),V.removeEventListener("resize",B)}},[h,g,f]),m.useEffect(()=>{g||H()},[g,H]),s.jsx(P,{nodeRef:$,onEnter:E,onEntered:A,onEntering:O,onExit:F,onExited:L,onExiting:N,addEndListener:D,appear:c,in:g,timeout:k,...T,children:(B,{ownerState:V,...G})=>m.cloneElement(u,{ref:M,style:{visibility:B==="exited"&&!g?"hidden":void 0,...w,...u.props.style},...G})})});function dW(e){return ct("MuiDrawer",e)}ut("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const pR=(e,t)=>{const{ownerState:n}=e;return[t.root,(n.variant==="permanent"||n.variant==="persistent")&&t.docked,t.modal]},fW=e=>{const{classes:t,anchor:n,variant:r}=e,o={root:["root",`anchor${Pe(n)}`],docked:[(r==="permanent"||r==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${Pe(n)}`,r!=="temporary"&&`paperAnchorDocked${Pe(n)}`]};return Be(o,dW,t)},pW=Ce(Ew,{name:"MuiDrawer",slot:"Root",overridesResolver:pR})(tt(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),hW=Ce("div",{shouldForwardProp:yo,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:pR})({flex:"0 0 auto"}),mW=Ce(Un,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`paperAnchor${Pe(n.anchor)}`],n.variant!=="temporary"&&t[`paperAnchorDocked${Pe(n.anchor)}`]]}})(tt(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:t})=>t.anchor==="left"&&t.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="top"&&t.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="right"&&t.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="bottom"&&t.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),hR={left:"right",right:"left",top:"down",bottom:"up"};function gW(e){return["left","right"].includes(e)}function xW({direction:e},t){return e==="rtl"&&gW(t)?hR[t]:t}const tC=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiDrawer"}),o=Xr(),i=Yr(),l={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{anchor:c="left",BackdropProps:u,children:f,className:h,elevation:p=16,hideBackdrop:g=!1,ModalProps:{BackdropProps:y,...b}={},onClose:v,open:C=!1,PaperProps:S={},SlideProps:j,TransitionComponent:w,transitionDuration:k=l,variant:P="temporary",slots:T={},slotProps:$={},...M}=r,R=m.useRef(!1);m.useEffect(()=>{R.current=!0},[]);const E=xW({direction:i?"rtl":"ltr"},c),A={...r,anchor:c,elevation:p,open:C,variant:P,...M},N=fW(A),F={slots:{transition:w,...T},slotProps:{paper:S,transition:j,...$,backdrop:mw($.backdrop||{...u,...y},{transitionDuration:k})}},[L,D]=at("root",{ref:n,elementType:pW,className:Me(N.root,N.modal,h),shouldForwardComponentProp:!0,ownerState:A,externalForwardedProps:{...F,...M,...b},additionalProps:{open:C,onClose:v,hideBackdrop:g,slots:{backdrop:F.slots.backdrop},slotProps:{backdrop:F.slotProps.backdrop}}}),[H,B]=at("paper",{elementType:mW,shouldForwardComponentProp:!0,className:Me(N.paper,S.className),ownerState:A,externalForwardedProps:F,additionalProps:{elevation:P==="temporary"?p:0,square:!0}}),[V,G]=at("docked",{elementType:hW,ref:n,className:Me(N.root,N.docked,h),ownerState:A,externalForwardedProps:F,additionalProps:M}),[_,U]=at("transition",{elementType:fR,ownerState:A,externalForwardedProps:F,additionalProps:{in:C,direction:hR[E],timeout:k,appear:R.current}}),Z=s.jsx(H,{...B,children:f});if(P==="permanent")return s.jsx(V,{...G,children:Z});const Q=s.jsx(_,{...U,children:Z});return P==="persistent"?s.jsx(V,{...G,children:Q}):s.jsx(L,{...D,children:Q})}),yW=e=>{const{classes:t,disableUnderline:n,startAdornment:r,endAdornment:o,size:i,hiddenLabel:l,multiline:c}=e,u={root:["root",!n&&"underline",r&&"adornedStart",o&&"adornedEnd",i==="small"&&`size${Pe(i)}`,l&&"hiddenLabel",c&&"multiline"],input:["input"]},f=Be(u,p6,t);return{...t,...f}},bW=Ce(Vx,{shouldForwardProp:e=>yo(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...Bx(e,t),!n.disableUnderline&&t.underline]}})(tt(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${rs.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${rs.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i},variants:[{props:({ownerState:l})=>!l.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${rs.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${rs.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${rs.disabled}, .${rs.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${rs.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(qn()).map(([l])=>{var c;return{props:{disableUnderline:!1,color:l},style:{"&::after":{borderBottom:`2px solid ${(c=(e.vars||e).palette[l])==null?void 0:c.main}`}}}}),{props:({ownerState:l})=>l.startAdornment,style:{paddingLeft:12}},{props:({ownerState:l})=>l.endAdornment,style:{paddingRight:12}},{props:({ownerState:l})=>l.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:l,size:c})=>l.multiline&&c==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:l})=>l.multiline&&l.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:l})=>l.multiline&&l.hiddenLabel&&l.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),vW=Ce(Gx,{name:"MuiFilledInput",slot:"Input",overridesResolver:Wx})(tt(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:t})=>t.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}},{props:({ownerState:t})=>t.hiddenLabel&&t.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:t})=>t.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),Pw=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiFilledInput"}),{disableUnderline:o=!1,components:i={},componentsProps:l,fullWidth:c=!1,hiddenLabel:u,inputComponent:f="input",multiline:h=!1,slotProps:p,slots:g={},type:y="text",...b}=r,v={...r,disableUnderline:o,fullWidth:c,inputComponent:f,multiline:h,type:y},C=yW(r),S={root:{ownerState:v},input:{ownerState:v}},j=p??l?qr(S,p??l):S,w=g.root??i.Root??bW,k=g.input??i.Input??vW;return s.jsx(Bd,{slots:{root:w,input:k},slotProps:j,fullWidth:c,inputComponent:f,multiline:h,ref:n,type:y,...b,classes:C})});Pw.muiName="Input";function CW(e){return ct("MuiFormControl",e)}ut("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const wW=e=>{const{classes:t,margin:n,fullWidth:r}=e,o={root:["root",n!=="none"&&`margin${Pe(n)}`,r&&"fullWidth"]};return Be(o,CW,t)},SW=Ce("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${Pe(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),_n=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiFormControl"}),{children:o,className:i,color:l="primary",component:c="div",disabled:u=!1,error:f=!1,focused:h,fullWidth:p=!1,hiddenLabel:g=!1,margin:y="none",required:b=!1,size:v="medium",variant:C="outlined",...S}=r,j={...r,color:l,component:c,disabled:u,error:f,fullWidth:p,hiddenLabel:g,margin:y,required:b,size:v,variant:C},w=wW(j),[k,P]=m.useState(()=>{let L=!1;return o&&m.Children.forEach(o,D=>{if(!vv(D,["Input","Select"]))return;const H=vv(D,["Select"])?D.props.input:D;H&&a6(H.props)&&(L=!0)}),L}),[T,$]=m.useState(()=>{let L=!1;return o&&m.Children.forEach(o,D=>{vv(D,["Input","Select"])&&(Qg(D.props,!0)||Qg(D.props.inputProps,!0))&&(L=!0)}),L}),[M,R]=m.useState(!1);u&&M&&R(!1);const E=h!==void 0&&!u?h:M;let O;m.useRef(!1);const A=m.useCallback(()=>{$(!0)},[]),N=m.useCallback(()=>{$(!1)},[]),F=m.useMemo(()=>({adornedStart:k,setAdornedStart:P,color:l,disabled:u,error:f,filled:T,focused:E,fullWidth:p,hiddenLabel:g,size:v,onBlur:()=>{R(!1)},onFocus:()=>{R(!0)},onEmpty:N,onFilled:A,registerEffect:O,required:b,variant:C}),[k,l,u,f,T,E,p,g,O,N,A,b,v,C]);return s.jsx(Hx.Provider,{value:F,children:s.jsx(SW,{as:c,ownerState:j,className:Me(w.root,i),ref:n,...S,children:o})})});function jW(e){return ct("MuiFormControlLabel",e)}const ap=ut("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),kW=e=>{const{classes:t,disabled:n,labelPlacement:r,error:o,required:i}=e,l={root:["root",n&&"disabled",`labelPlacement${Pe(r)}`,o&&"error",i&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]};return Be(l,jW,t)},IW=Ce("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${ap.label}`]:t.label},t.root,t[`labelPlacement${Pe(n.labelPlacement)}`]]}})(tt(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${ap.disabled}`]:{cursor:"default"},[`& .${ap.label}`]:{[`&.${ap.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:t})=>t==="start"||t==="top"||t==="bottom",style:{marginLeft:16}}]}))),EW=Ce("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(tt(({theme:e})=>({[`&.${ap.error}`]:{color:(e.vars||e).palette.error.main}}))),Kr=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiFormControlLabel"}),{checked:o,className:i,componentsProps:l={},control:c,disabled:u,disableTypography:f,inputRef:h,label:p,labelPlacement:g="end",name:y,onChange:b,required:v,slots:C={},slotProps:S={},value:j,...w}=r,k=jl(),P=u??c.props.disabled??(k==null?void 0:k.disabled),T=v??c.props.required,$={disabled:P,required:T};["checked","name","onChange","value","inputRef"].forEach(L=>{typeof c.props[L]>"u"&&typeof r[L]<"u"&&($[L]=r[L])});const M=qc({props:r,muiFormControl:k,states:["error"]}),R={...r,disabled:P,labelPlacement:g,required:T,error:M.error},E=kW(R),O={slots:C,slotProps:{...l,...S}},[A,N]=at("typography",{elementType:J,externalForwardedProps:O,ownerState:R});let F=p;return F!=null&&F.type!==J&&!f&&(F=s.jsx(A,{component:"span",...N,className:Me(E.label,N==null?void 0:N.className),children:F})),s.jsxs(IW,{className:Me(E.root,i),ownerState:R,ref:n,...w,children:[m.cloneElement(c,$),T?s.jsxs("div",{children:[F,s.jsxs(EW,{ownerState:R,"aria-hidden":!0,className:E.asterisk,children:[" ","*"]})]}):F]})});function PW(e){return ct("MuiFormHelperText",e)}const qk=ut("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var Kk;const TW=e=>{const{classes:t,contained:n,size:r,disabled:o,error:i,filled:l,focused:c,required:u}=e,f={root:["root",o&&"disabled",i&&"error",r&&`size${Pe(r)}`,n&&"contained",c&&"focused",l&&"filled",u&&"required"]};return Be(f,PW,t)},MW=Ce("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${Pe(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(tt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${qk.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${qk.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:t})=>t.contained,style:{marginLeft:14,marginRight:14}}]}))),RW=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiFormHelperText"}),{children:o,className:i,component:l="p",disabled:c,error:u,filled:f,focused:h,margin:p,required:g,variant:y,...b}=r,v=jl(),C=qc({props:r,muiFormControl:v,states:["variant","size","disabled","error","filled","focused","required"]}),S={...r,component:l,contained:C.variant==="filled"||C.variant==="outlined",variant:C.variant,size:C.size,disabled:C.disabled,error:C.error,filled:C.filled,focused:C.focused,required:C.required};delete S.ownerState;const j=TW(S);return s.jsx(MW,{as:l,className:Me(j.root,i),ref:n,...b,ownerState:S,children:o===" "?Kk||(Kk=s.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):o})});function $W(e){return ct("MuiFormLabel",e)}const Cp=ut("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),OW=e=>{const{classes:t,color:n,focused:r,disabled:o,error:i,filled:l,required:c}=e,u={root:["root",`color${Pe(n)}`,o&&"disabled",i&&"error",l&&"filled",r&&"focused",c&&"required"],asterisk:["asterisk",i&&"error"]};return Be(u,$W,t)},zW=Ce("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color==="secondary"&&t.colorSecondary,n.filled&&t.filled]}})(tt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(qn()).map(([t])=>({props:{color:t},style:{[`&.${Cp.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${Cp.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Cp.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),LW=Ce("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(tt(({theme:e})=>({[`&.${Cp.error}`]:{color:(e.vars||e).palette.error.main}}))),DW=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiFormLabel"}),{children:o,className:i,color:l,component:c="label",disabled:u,error:f,filled:h,focused:p,required:g,...y}=r,b=jl(),v=qc({props:r,muiFormControl:b,states:["color","required","focused","disabled","error","filled"]}),C={...r,color:v.color||"primary",component:c,disabled:v.disabled,error:v.error,filled:v.filled,focused:v.focused,required:v.required},S=OW(C);return s.jsxs(zW,{as:c,ownerState:C,className:Me(S.root,i),ref:n,...y,children:[o,v.required&&s.jsxs(LW,{ownerState:C,"aria-hidden":!0,className:S.asterisk,children:[" ","*"]})]})}),Qk=m.createContext();function AW(e){return ct("MuiGrid",e)}const FW=[0,1,2,3,4,5,6,7,8,9,10],NW=["column-reverse","column","row-reverse","row"],_W=["nowrap","wrap-reverse","wrap"],Wf=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],Dp=ut("MuiGrid",["root","container","item","zeroMinWidth",...FW.map(e=>`spacing-xs-${e}`),...NW.map(e=>`direction-xs-${e}`),..._W.map(e=>`wrap-xs-${e}`),...Wf.map(e=>`grid-xs-${e}`),...Wf.map(e=>`grid-sm-${e}`),...Wf.map(e=>`grid-md-${e}`),...Wf.map(e=>`grid-lg-${e}`),...Wf.map(e=>`grid-xl-${e}`)]);function HW({theme:e,ownerState:t}){let n;return e.breakpoints.keys.reduce((r,o)=>{let i={};if(t[o]&&(n=t[o]),!n)return r;if(n===!0)i={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")i={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const l=kc({values:t.columns,breakpoints:e.breakpoints.values}),c=typeof l=="object"?l[o]:l;if(c==null)return r;const u=`${Math.round(n/c*1e8)/1e6}%`;let f={};if(t.container&&t.item&&t.columnSpacing!==0){const h=e.spacing(t.columnSpacing);if(h!=="0px"){const p=`calc(${u} + ${h})`;f={flexBasis:p,maxWidth:p}}}i={flexBasis:u,flexGrow:0,maxWidth:u,...f}}return e.breakpoints.values[o]===0?Object.assign(r,i):r[e.breakpoints.up(o)]=i,r},{})}function BW({theme:e,ownerState:t}){const n=kc({values:t.direction,breakpoints:e.breakpoints.values});return Uo({theme:e},n,r=>{const o={flexDirection:r};return r.startsWith("column")&&(o[`& > .${Dp.item}`]={maxWidth:"none"}),o})}function mR({breakpoints:e,values:t}){let n="";Object.keys(t).forEach(o=>{n===""&&t[o]!==0&&(n=o)});const r=Object.keys(e).sort((o,i)=>e[o]-e[i]);return r.slice(0,r.indexOf(n))}function WW({theme:e,ownerState:t}){const{container:n,rowSpacing:r}=t;let o={};if(n&&r!==0){const i=kc({values:r,breakpoints:e.breakpoints.values});let l;typeof i=="object"&&(l=mR({breakpoints:e.breakpoints.values,values:i})),o=Uo({theme:e},i,(c,u)=>{const f=e.spacing(c);return f!=="0px"?{marginTop:`calc(-1 * ${f})`,[`& > .${Dp.item}`]:{paddingTop:f}}:l!=null&&l.includes(u)?{}:{marginTop:0,[`& > .${Dp.item}`]:{paddingTop:0}}})}return o}function VW({theme:e,ownerState:t}){const{container:n,columnSpacing:r}=t;let o={};if(n&&r!==0){const i=kc({values:r,breakpoints:e.breakpoints.values});let l;typeof i=="object"&&(l=mR({breakpoints:e.breakpoints.values,values:i})),o=Uo({theme:e},i,(c,u)=>{const f=e.spacing(c);if(f!=="0px"){const h=`calc(-1 * ${f})`;return{width:`calc(100% + ${f})`,marginLeft:h,[`& > .${Dp.item}`]:{paddingLeft:f}}}return l!=null&&l.includes(u)?{}:{width:"100%",marginLeft:0,[`& > .${Dp.item}`]:{paddingLeft:0}}})}return o}function GW(e,t,n={}){if(!e||e<=0)return[];if(typeof e=="string"&&!Number.isNaN(Number(e))||typeof e=="number")return[n[`spacing-xs-${String(e)}`]];const r=[];return t.forEach(o=>{const i=e[o];Number(i)>0&&r.push(n[`spacing-${o}-${String(i)}`])}),r}const UW=Ce("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{container:r,direction:o,item:i,spacing:l,wrap:c,zeroMinWidth:u,breakpoints:f}=n;let h=[];r&&(h=GW(l,f,t));const p=[];return f.forEach(g=>{const y=n[g];y&&p.push(t[`grid-${g}-${String(y)}`])}),[t.root,r&&t.container,i&&t.item,u&&t.zeroMinWidth,...h,o!=="row"&&t[`direction-xs-${String(o)}`],c!=="wrap"&&t[`wrap-xs-${String(c)}`],...p]}})(({ownerState:e})=>({boxSizing:"border-box",...e.container&&{display:"flex",flexWrap:"wrap",width:"100%"},...e.item&&{margin:0},...e.zeroMinWidth&&{minWidth:0},...e.wrap!=="wrap"&&{flexWrap:e.wrap}}),BW,WW,VW,HW);function qW(e,t){if(!e||e<=0)return[];if(typeof e=="string"&&!Number.isNaN(Number(e))||typeof e=="number")return[`spacing-xs-${String(e)}`];const n=[];return t.forEach(r=>{const o=e[r];if(Number(o)>0){const i=`spacing-${r}-${String(o)}`;n.push(i)}}),n}const KW=e=>{const{classes:t,container:n,direction:r,item:o,spacing:i,wrap:l,zeroMinWidth:c,breakpoints:u}=e;let f=[];n&&(f=qW(i,u));const h=[];u.forEach(g=>{const y=e[g];y&&h.push(`grid-${g}-${String(y)}`)});const p={root:["root",n&&"container",o&&"item",c&&"zeroMinWidth",...f,r!=="row"&&`direction-xs-${String(r)}`,l!=="wrap"&&`wrap-xs-${String(l)}`,...h]};return Be(p,AW,t)},Xs=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiGrid"}),{breakpoints:o}=Xr(),i=Ax(r),{className:l,columns:c,columnSpacing:u,component:f="div",container:h=!1,direction:p="row",item:g=!1,rowSpacing:y,spacing:b=0,wrap:v="wrap",zeroMinWidth:C=!1,...S}=i,j=y||b,w=u||b,k=m.useContext(Qk),P=h?c||12:k,T={},$={...S};o.keys.forEach(E=>{S[E]!=null&&(T[E]=S[E],delete $[E])});const M={...i,columns:P,container:h,direction:p,item:g,rowSpacing:j,columnSpacing:w,wrap:v,zeroMinWidth:C,spacing:b,...T,breakpoints:o.keys},R=KW(M);return s.jsx(Qk.Provider,{value:P,children:s.jsx(UW,{ownerState:M,className:Me(R.root,l),as:f,ref:n,...$})})});function nC(e){return`scale(${e}, ${e**2})`}const QW={entering:{opacity:1,transform:nC(1)},entered:{opacity:1,transform:"none"}},Tv=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),yd=m.forwardRef(function(t,n){const{addEndListener:r,appear:o=!0,children:i,easing:l,in:c,onEnter:u,onEntered:f,onEntering:h,onExit:p,onExited:g,onExiting:y,style:b,timeout:v="auto",TransitionComponent:C=Bs,...S}=t,j=Po(),w=m.useRef(),k=Xr(),P=m.useRef(null),T=Pn(P,Da(i),n),$=L=>D=>{if(L){const H=P.current;D===void 0?L(H):L(H,D)}},M=$(h),R=$((L,D)=>{yw(L);const{duration:H,delay:B,easing:V}=Ma({style:b,timeout:v,easing:l},{mode:"enter"});let G;v==="auto"?(G=k.transitions.getAutoHeightDuration(L.clientHeight),w.current=G):G=H,L.style.transition=[k.transitions.create("opacity",{duration:G,delay:B}),k.transitions.create("transform",{duration:Tv?G:G*.666,delay:B,easing:V})].join(","),u&&u(L,D)}),E=$(f),O=$(y),A=$(L=>{const{duration:D,delay:H,easing:B}=Ma({style:b,timeout:v,easing:l},{mode:"exit"});let V;v==="auto"?(V=k.transitions.getAutoHeightDuration(L.clientHeight),w.current=V):V=D,L.style.transition=[k.transitions.create("opacity",{duration:V,delay:H}),k.transitions.create("transform",{duration:Tv?V:V*.666,delay:Tv?H:H||V*.333,easing:B})].join(","),L.style.opacity=0,L.style.transform=nC(.75),p&&p(L)}),N=$(g),F=L=>{v==="auto"&&j.start(w.current||0,L),r&&r(P.current,L)};return s.jsx(C,{appear:o,in:c,nodeRef:P,onEnter:R,onEntered:E,onEntering:M,onExit:A,onExited:N,onExiting:O,addEndListener:F,timeout:v==="auto"?null:v,...S,children:(L,{ownerState:D,...H})=>m.cloneElement(i,{style:{opacity:0,transform:nC(.75),visibility:L==="exited"&&!c?"hidden":void 0,...QW[L],...b,...i.props.style},ref:T,...H})})});yd&&(yd.muiSupportAuto=!0);const YW=e=>{const{classes:t,disableUnderline:n}=e,o=Be({root:["root",!n&&"underline"],input:["input"]},d6,t);return{...t,...o}},XW=Ce(Vx,{shouldForwardProp:e=>yo(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...Bx(e,t),!n.disableUnderline&&t.underline]}})(tt(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:({ownerState:r})=>r.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:r})=>!r.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${oa.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${oa.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${oa.disabled}, .${oa.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${oa.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(qn()).map(([r])=>({props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}}))]}})),ZW=Ce(Gx,{name:"MuiInput",slot:"Input",overridesResolver:Wx})({}),Tw=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiInput"}),{disableUnderline:o=!1,components:i={},componentsProps:l,fullWidth:c=!1,inputComponent:u="input",multiline:f=!1,slotProps:h,slots:p={},type:g="text",...y}=r,b=YW(r),C={root:{ownerState:{disableUnderline:o}}},S=h??l?qr(h??l,C):C,j=p.root??i.Root??XW,w=p.input??i.Input??ZW;return s.jsx(Bd,{slots:{root:j,input:w},slotProps:S,fullWidth:c,inputComponent:u,multiline:f,ref:n,type:g,...y,classes:b})});Tw.muiName="Input";function JW(e){return ct("MuiInputAdornment",e)}const Yk=ut("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var Xk;const e8=(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${Pe(n.position)}`],n.disablePointerEvents===!0&&t.disablePointerEvents,t[n.variant]]},t8=e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:r,position:o,size:i,variant:l}=e,c={root:["root",n&&"disablePointerEvents",o&&`position${Pe(o)}`,l,r&&"hiddenLabel",i&&`size${Pe(i)}`]};return Be(c,JW,t)},n8=Ce("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:e8})(tt(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${Yk.positionStart}&:not(.${Yk.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),ds=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiInputAdornment"}),{children:o,className:i,component:l="div",disablePointerEvents:c=!1,disableTypography:u=!1,position:f,variant:h,...p}=r,g=jl()||{};let y=h;h&&g.variant,g&&!y&&(y=g.variant);const b={...r,hiddenLabel:g.hiddenLabel,size:g.size,disablePointerEvents:c,position:f,variant:y},v=t8(b);return s.jsx(Hx.Provider,{value:null,children:s.jsx(n8,{as:l,ownerState:b,className:Me(v.root,i),ref:n,...p,children:typeof o=="string"&&!u?s.jsx(J,{color:"textSecondary",children:o}):s.jsxs(m.Fragment,{children:[f==="start"?Xk||(Xk=s.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):null,o]})})})});function r8(e){return ct("MuiInputLabel",e)}ut("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const o8=e=>{const{classes:t,formControl:n,size:r,shrink:o,disableAnimation:i,variant:l,required:c}=e,u={root:["root",n&&"formControl",!i&&"animated",o&&"shrink",r&&r!=="normal"&&`size${Pe(r)}`,l],asterisk:[c&&"asterisk"]},f=Be(u,r8,t);return{...t,...f}},s8=Ce(DW,{shouldForwardProp:e=>yo(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Cp.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(tt(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:t})=>t.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:t})=>t.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:t})=>!t.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:t,ownerState:n,size:r})=>t==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),Hn=m.forwardRef(function(t,n){const r=ft({name:"MuiInputLabel",props:t}),{disableAnimation:o=!1,margin:i,shrink:l,variant:c,className:u,...f}=r,h=jl();let p=l;typeof p>"u"&&h&&(p=h.filled||h.focused||h.adornedStart);const g=qc({props:r,muiFormControl:h,states:["size","variant","required","focused"]}),y={...r,disableAnimation:o,formControl:h,shrink:p,size:g.size,variant:g.variant,required:g.required,focused:g.focused},b=o8(y);return s.jsx(s8,{"data-shrink":p,ref:n,className:Me(b.root,u),...f,ownerState:y,classes:b})});function i8(e){return ct("MuiLinearProgress",e)}ut("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","bar1","bar2","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const rC=4,oC=Hi`
|
|
208
|
+
0% {
|
|
209
|
+
left: -35%;
|
|
210
|
+
right: 100%;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
60% {
|
|
214
|
+
left: 100%;
|
|
215
|
+
right: -90%;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
100% {
|
|
219
|
+
left: 100%;
|
|
220
|
+
right: -90%;
|
|
221
|
+
}
|
|
222
|
+
`,l8=typeof oC!="string"?La`
|
|
223
|
+
animation: ${oC} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
|
|
224
|
+
`:null,sC=Hi`
|
|
225
|
+
0% {
|
|
226
|
+
left: -200%;
|
|
227
|
+
right: 100%;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
60% {
|
|
231
|
+
left: 107%;
|
|
232
|
+
right: -8%;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
100% {
|
|
236
|
+
left: 107%;
|
|
237
|
+
right: -8%;
|
|
238
|
+
}
|
|
239
|
+
`,a8=typeof sC!="string"?La`
|
|
240
|
+
animation: ${sC} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
|
|
241
|
+
`:null,iC=Hi`
|
|
242
|
+
0% {
|
|
243
|
+
opacity: 1;
|
|
244
|
+
background-position: 0 -23px;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
60% {
|
|
248
|
+
opacity: 0;
|
|
249
|
+
background-position: 0 -23px;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
100% {
|
|
253
|
+
opacity: 1;
|
|
254
|
+
background-position: -200px -23px;
|
|
255
|
+
}
|
|
256
|
+
`,c8=typeof iC!="string"?La`
|
|
257
|
+
animation: ${iC} 3s infinite linear;
|
|
258
|
+
`:null,u8=e=>{const{classes:t,variant:n,color:r}=e,o={root:["root",`color${Pe(r)}`,n],dashed:["dashed",`dashedColor${Pe(r)}`],bar1:["bar","bar1",`barColor${Pe(r)}`,(n==="indeterminate"||n==="query")&&"bar1Indeterminate",n==="determinate"&&"bar1Determinate",n==="buffer"&&"bar1Buffer"],bar2:["bar","bar2",n!=="buffer"&&`barColor${Pe(r)}`,n==="buffer"&&`color${Pe(r)}`,(n==="indeterminate"||n==="query")&&"bar2Indeterminate",n==="buffer"&&"bar2Buffer"]};return Be(o,i8,t)},Mw=(e,t)=>e.vars?e.vars.palette.LinearProgress[`${t}Bg`]:e.palette.mode==="light"?gl(e.palette[t].main,.62):ml(e.palette[t].main,.5),d8=Ce("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${Pe(n.color)}`],t[n.variant]]}})(tt(({theme:e})=>({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},variants:[...Object.entries(e.palette).filter(qn()).map(([t])=>({props:{color:t},style:{backgroundColor:Mw(e,t)}})),{props:({ownerState:t})=>t.color==="inherit"&&t.variant!=="buffer",style:{"&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}}},{props:{variant:"buffer"},style:{backgroundColor:"transparent"}},{props:{variant:"query"},style:{transform:"rotate(180deg)"}}]}))),f8=Ce("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.dashed,t[`dashedColor${Pe(n.color)}`]]}})(tt(({theme:e})=>({position:"absolute",marginTop:0,height:"100%",width:"100%",backgroundSize:"10px 10px",backgroundPosition:"0 -23px",variants:[{props:{color:"inherit"},style:{opacity:.3,backgroundImage:"radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)"}},...Object.entries(e.palette).filter(qn()).map(([t])=>{const n=Mw(e,t);return{props:{color:t},style:{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`}}})]})),c8||{animation:`${iC} 3s infinite linear`}),p8=Ce("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t.bar1,t[`barColor${Pe(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&t.bar1Indeterminate,n.variant==="determinate"&&t.bar1Determinate,n.variant==="buffer"&&t.bar1Buffer]}})(tt(({theme:e})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[{props:{color:"inherit"},style:{backgroundColor:"currentColor"}},...Object.entries(e.palette).filter(qn()).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main}})),{props:{variant:"determinate"},style:{transition:`transform .${rC}s linear`}},{props:{variant:"buffer"},style:{zIndex:1,transition:`transform .${rC}s linear`}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:{width:"auto"}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:l8||{animation:`${oC} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),h8=Ce("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t.bar2,t[`barColor${Pe(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&t.bar2Indeterminate,n.variant==="buffer"&&t.bar2Buffer]}})(tt(({theme:e})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[...Object.entries(e.palette).filter(qn()).map(([t])=>({props:{color:t},style:{"--LinearProgressBar2-barColor":(e.vars||e).palette[t].main}})),{props:({ownerState:t})=>t.variant!=="buffer"&&t.color!=="inherit",style:{backgroundColor:"var(--LinearProgressBar2-barColor, currentColor)"}},{props:({ownerState:t})=>t.variant!=="buffer"&&t.color==="inherit",style:{backgroundColor:"currentColor"}},{props:{color:"inherit"},style:{opacity:.3}},...Object.entries(e.palette).filter(qn()).map(([t])=>({props:{color:t,variant:"buffer"},style:{backgroundColor:Mw(e,t),transition:`transform .${rC}s linear`}})),{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:{width:"auto"}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:a8||{animation:`${sC} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),kl=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiLinearProgress"}),{className:o,color:i="primary",value:l,valueBuffer:c,variant:u="indeterminate",...f}=r,h={...r,color:i,variant:u},p=u8(h),g=Yr(),y={},b={bar1:{},bar2:{}};if((u==="determinate"||u==="buffer")&&l!==void 0){y["aria-valuenow"]=Math.round(l),y["aria-valuemin"]=0,y["aria-valuemax"]=100;let v=l-100;g&&(v=-v),b.bar1.transform=`translateX(${v}%)`}if(u==="buffer"&&c!==void 0){let v=(c||0)-100;g&&(v=-v),b.bar2.transform=`translateX(${v}%)`}return s.jsxs(d8,{className:Me(p.root,o),ownerState:h,role:"progressbar",...y,ref:n,...f,children:[u==="buffer"?s.jsx(f8,{className:p.dashed,ownerState:h}):null,s.jsx(p8,{className:p.bar1,ownerState:h,style:b.bar1}),u==="determinate"?null:s.jsx(h8,{className:p.bar2,ownerState:h,style:b.bar2})]})});function m8(e){return ct("MuiLink",e)}const g8=ut("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),x8=({theme:e,ownerState:t})=>{const n=t.color,r=xa(e,`palette.${n}.main`,!1)||xa(e,`palette.${n}`,!1)||t.color,o=xa(e,`palette.${n}.mainChannel`)||xa(e,`palette.${n}Channel`);return"vars"in e&&o?`rgba(${o} / 0.4)`:Ye(r,.4)},Zk={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},y8=e=>{const{classes:t,component:n,focusVisible:r,underline:o}=e,i={root:["root",`underline${Pe(o)}`,n==="button"&&"button",r&&"focusVisible"]};return Be(i,m8,t)},b8=Ce(J,{name:"MuiLink",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`underline${Pe(n.underline)}`],n.component==="button"&&t.button]}})(tt(({theme:e})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:t,ownerState:n})=>t==="always"&&n.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(e.palette).filter(qn()).map(([t])=>({props:{underline:"always",color:t},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.4)`:Ye(e.palette[t].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:Ye(e.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette.text.secondaryChannel} / 0.4)`:Ye(e.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(e.vars||e).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${g8.focusVisible}`]:{outline:"auto"}}}]}))),v8=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiLink"}),o=Xr(),{className:i,color:l="primary",component:c="a",onBlur:u,onFocus:f,TypographyClasses:h,underline:p="always",variant:g="inherit",sx:y,...b}=r,[v,C]=m.useState(!1),S=P=>{pd(P.target)||C(!1),u&&u(P)},j=P=>{pd(P.target)&&C(!0),f&&f(P)},w={...r,color:l,component:c,focusVisible:v,underline:p,variant:g},k=y8(w);return s.jsx(b8,{color:l,className:Me(k.root,i),classes:h,component:c,onBlur:S,onFocus:j,ref:n,ownerState:w,variant:g,...b,sx:[...Zk[l]===void 0?[{color:l}]:[],...Array.isArray(y)?y:[y]],style:{...b.style,...p==="always"&&l!=="inherit"&&!Zk[l]&&{"--Link-underlineColor":x8({theme:o,ownerState:w})}}})}),Dc=m.createContext({});function C8(e){return ct("MuiList",e)}ut("MuiList",["root","padding","dense","subheader"]);const w8=e=>{const{classes:t,disablePadding:n,dense:r,subheader:o}=e;return Be({root:["root",!n&&"padding",r&&"dense",o&&"subheader"]},C8,t)},S8=Ce("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),_u=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiList"}),{children:o,className:i,component:l="ul",dense:c=!1,disablePadding:u=!1,subheader:f,...h}=r,p=m.useMemo(()=>({dense:c}),[c]),g={...r,component:l,dense:c,disablePadding:u},y=w8(g);return s.jsx(Dc.Provider,{value:p,children:s.jsxs(S8,{as:l,className:Me(y.root,i),ref:n,ownerState:g,...h,children:[f,o]})})});function j8(e){return ct("MuiListItemButton",e)}const Vf=ut("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),k8=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems==="flex-start"&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters]},I8=e=>{const{alignItems:t,classes:n,dense:r,disabled:o,disableGutters:i,divider:l,selected:c}=e,f=Be({root:["root",r&&"dense",!i&&"gutters",l&&"divider",o&&"disabled",t==="flex-start"&&"alignItemsFlexStart",c&&"selected"]},j8,n);return{...n,...f}},E8=Ce(Ds,{shouldForwardProp:e=>yo(e)||e==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:k8})(tt(({theme:e})=>({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Vf.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ye(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Vf.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Ye(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${Vf.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ye(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ye(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${Vf.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Vf.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},variants:[{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.dense,style:{paddingTop:4,paddingBottom:4}}]}))),tl=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiListItemButton"}),{alignItems:o="center",autoFocus:i=!1,component:l="div",children:c,dense:u=!1,disableGutters:f=!1,divider:h=!1,focusVisibleClassName:p,selected:g=!1,className:y,...b}=r,v=m.useContext(Dc),C=m.useMemo(()=>({dense:u||v.dense||!1,alignItems:o,disableGutters:f}),[o,v.dense,u,f]),S=m.useRef(null);Ln(()=>{i&&S.current&&S.current.focus()},[i]);const j={...r,alignItems:o,dense:C.dense,disableGutters:f,divider:h,selected:g},w=I8(j),k=Pn(S,n);return s.jsx(Dc.Provider,{value:C,children:s.jsx(E8,{ref:k,href:b.href||b.to,component:(b.href||b.to)&&l==="div"?"button":l,focusVisibleClassName:Me(w.focusVisible,p),ownerState:j,className:Me(w.root,y),...b,classes:w,children:c})})});function P8(e){return ct("MuiListItemIcon",e)}const Jk=ut("MuiListItemIcon",["root","alignItemsFlexStart"]),T8=e=>{const{alignItems:t,classes:n}=e;return Be({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},P8,n)},M8=Ce("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(tt(({theme:e})=>({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),Rn=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiListItemIcon"}),{className:o,...i}=r,l=m.useContext(Dc),c={...r,alignItems:l.alignItems},u=T8(c);return s.jsx(M8,{className:Me(u.root,o),ownerState:c,ref:n,...i})});function R8(e){return ct("MuiListItemText",e)}const Hu=ut("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),$8=e=>{const{classes:t,inset:n,primary:r,secondary:o,dense:i}=e;return Be({root:["root",n&&"inset",i&&"dense",r&&o&&"multiline"],primary:["primary"],secondary:["secondary"]},R8,t)},O8=Ce("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Hu.primary}`]:t.primary},{[`& .${Hu.secondary}`]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${yk.root}:where(& .${Hu.primary})`]:{display:"block"},[`.${yk.root}:where(& .${Hu.secondary})`]:{display:"block"},variants:[{props:({ownerState:e})=>e.primary&&e.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:56}}]}),$n=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiListItemText"}),{children:o,className:i,disableTypography:l=!1,inset:c=!1,primary:u,primaryTypographyProps:f,secondary:h,secondaryTypographyProps:p,slots:g={},slotProps:y={},...b}=r,{dense:v}=m.useContext(Dc);let C=u??o,S=h;const j={...r,disableTypography:l,inset:c,primary:!!C,secondary:!!S,dense:v},w=$8(j),k={slots:g,slotProps:{primary:f,secondary:p,...y}},[P,T]=at("root",{className:Me(w.root,i),elementType:O8,externalForwardedProps:{...k,...b},ownerState:j,ref:n}),[$,M]=at("primary",{className:w.primary,elementType:J,externalForwardedProps:k,ownerState:j}),[R,E]=at("secondary",{className:w.secondary,elementType:J,externalForwardedProps:k,ownerState:j});return C!=null&&C.type!==J&&!l&&(C=s.jsx($,{variant:v?"body2":"body1",component:M!=null&&M.variant?void 0:"span",...M,children:C})),S!=null&&S.type!==J&&!l&&(S=s.jsx(R,{variant:"body2",color:"textSecondary",...E,children:S})),s.jsxs(P,{...T,children:[C,S]})});function Mv(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function eI(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function gR(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(""))}function Gf(e,t,n,r,o,i){let l=!1,c=o(e,t,t?n:!1);for(;c;){if(c===e.firstChild){if(l)return!1;l=!0}const u=r?!1:c.disabled||c.getAttribute("aria-disabled")==="true";if(!c.hasAttribute("tabindex")||!gR(c,i)||u)c=o(e,c,n);else return c.focus(),!0}return!1}const Ux=m.forwardRef(function(t,n){const{actions:r,autoFocus:o=!1,autoFocusItem:i=!1,children:l,className:c,disabledItemsFocusable:u=!1,disableListWrap:f=!1,onKeyDown:h,variant:p="selectedMenu",...g}=t,y=m.useRef(null),b=m.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Ln(()=>{o&&y.current.focus()},[o]),m.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(w,{direction:k})=>{const P=!y.current.style.width;if(w.clientHeight<y.current.clientHeight&&P){const T=`${SM(qo(w))}px`;y.current.style[k==="rtl"?"paddingLeft":"paddingRight"]=T,y.current.style.width=`calc(100% + ${T})`}return y.current}}),[]);const v=w=>{const k=y.current,P=w.key;if(w.ctrlKey||w.metaKey||w.altKey){h&&h(w);return}const $=ir(k).activeElement;if(P==="ArrowDown")w.preventDefault(),Gf(k,$,f,u,Mv);else if(P==="ArrowUp")w.preventDefault(),Gf(k,$,f,u,eI);else if(P==="Home")w.preventDefault(),Gf(k,null,f,u,Mv);else if(P==="End")w.preventDefault(),Gf(k,null,f,u,eI);else if(P.length===1){const M=b.current,R=P.toLowerCase(),E=performance.now();M.keys.length>0&&(E-M.lastTime>500?(M.keys=[],M.repeating=!0,M.previousKeyMatched=!0):M.repeating&&R!==M.keys[0]&&(M.repeating=!1)),M.lastTime=E,M.keys.push(R);const O=$&&!M.repeating&&gR($,M);M.previousKeyMatched&&(O||Gf(k,$,!1,u,Mv,M))?w.preventDefault():M.previousKeyMatched=!1}h&&h(w)},C=Pn(y,n);let S=-1;m.Children.forEach(l,(w,k)=>{if(!m.isValidElement(w)){S===k&&(S+=1,S>=l.length&&(S=-1));return}w.props.disabled||(p==="selectedMenu"&&w.props.selected||S===-1)&&(S=k),S===k&&(w.props.disabled||w.props.muiSkipListHighlight||w.type.muiSkipListHighlight)&&(S+=1,S>=l.length&&(S=-1))});const j=m.Children.map(l,(w,k)=>{if(k===S){const P={};return i&&(P.autoFocus=!0),w.props.tabIndex===void 0&&p==="selectedMenu"&&(P.tabIndex=0),m.cloneElement(w,P)}return w});return s.jsx(_u,{role:"menu",ref:C,className:c,onKeyDown:v,tabIndex:o?0:-1,...g,children:j})});function z8(e){return ct("MuiPopover",e)}ut("MuiPopover",["root","paper"]);function tI(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function nI(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function rI(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function Jm(e){return typeof e=="function"?e():e}const L8=e=>{const{classes:t}=e;return Be({root:["root"],paper:["paper"]},z8,t)},D8=Ce(Ew,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),xR=Ce(Un,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),A8=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiPopover"}),{action:o,anchorEl:i,anchorOrigin:l={vertical:"top",horizontal:"left"},anchorPosition:c,anchorReference:u="anchorEl",children:f,className:h,container:p,elevation:g=8,marginThreshold:y=16,open:b,PaperProps:v={},slots:C={},slotProps:S={},transformOrigin:j={vertical:"top",horizontal:"left"},TransitionComponent:w,transitionDuration:k="auto",TransitionProps:P={},disableScrollLock:T=!1,...$}=r,M=m.useRef(),R={...r,anchorOrigin:l,anchorReference:u,elevation:g,marginThreshold:y,transformOrigin:j,TransitionComponent:w,transitionDuration:k,TransitionProps:P},E=L8(R),O=m.useCallback(()=>{if(u==="anchorPosition")return c;const ce=Jm(i),de=(ce&&ce.nodeType===1?ce:ir(M.current).body).getBoundingClientRect();return{top:de.top+tI(de,l.vertical),left:de.left+nI(de,l.horizontal)}},[i,l.horizontal,l.vertical,c,u]),A=m.useCallback(ce=>({vertical:tI(ce,j.vertical),horizontal:nI(ce,j.horizontal)}),[j.horizontal,j.vertical]),N=m.useCallback(ce=>{const he={width:ce.offsetWidth,height:ce.offsetHeight},de=A(he);if(u==="none")return{top:null,left:null,transformOrigin:rI(de)};const le=O();let ge=le.top-de.vertical,Se=le.left-de.horizontal;const ke=ge+he.height,we=Se+he.width,Oe=qo(Jm(i)),be=Oe.innerHeight-y,Fe=Oe.innerWidth-y;if(y!==null&&ge<y){const Ve=ge-y;ge-=Ve,de.vertical+=Ve}else if(y!==null&&ke>be){const Ve=ke-be;ge-=Ve,de.vertical+=Ve}if(y!==null&&Se<y){const Ve=Se-y;Se-=Ve,de.horizontal+=Ve}else if(we>Fe){const Ve=we-Fe;Se-=Ve,de.horizontal+=Ve}return{top:`${Math.round(ge)}px`,left:`${Math.round(Se)}px`,transformOrigin:rI(de)}},[i,u,O,A,y]),[F,L]=m.useState(b),D=m.useCallback(()=>{const ce=M.current;if(!ce)return;const he=N(ce);he.top!==null&&ce.style.setProperty("top",he.top),he.left!==null&&(ce.style.left=he.left),ce.style.transformOrigin=he.transformOrigin,L(!0)},[N]);m.useEffect(()=>(T&&window.addEventListener("scroll",D),()=>window.removeEventListener("scroll",D)),[i,T,D]);const H=()=>{D()},B=()=>{L(!1)};m.useEffect(()=>{b&&D()}),m.useImperativeHandle(o,()=>b?{updatePosition:()=>{D()}}:null,[b,D]),m.useEffect(()=>{if(!b)return;const ce=gh(()=>{D()}),he=qo(Jm(i));return he.addEventListener("resize",ce),()=>{ce.clear(),he.removeEventListener("resize",ce)}},[i,b,D]);let V=k;const G={slots:{transition:w,...C},slotProps:{transition:P,paper:v,...S}},[_,U]=at("transition",{elementType:yd,externalForwardedProps:G,ownerState:R,getSlotProps:ce=>({...ce,onEntering:(he,de)=>{var le;(le=ce.onEntering)==null||le.call(ce,he,de),H()},onExited:he=>{var de;(de=ce.onExited)==null||de.call(ce,he),B()}}),additionalProps:{appear:!0,in:b}});k==="auto"&&!_.muiSupportAuto&&(V=void 0);const Z=p||(i?ir(Jm(i)).body:void 0),[Q,{slots:ee,slotProps:ne,...re}]=at("root",{ref:n,elementType:D8,externalForwardedProps:{...G,...$},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:C.backdrop},slotProps:{backdrop:mw(typeof S.backdrop=="function"?S.backdrop(R):S.backdrop,{invisible:!0})},container:Z,open:b},ownerState:R,className:Me(E.root,h)}),[Y,ie]=at("paper",{ref:M,className:E.paper,elementType:xR,externalForwardedProps:G,shouldForwardComponentProp:!0,additionalProps:{elevation:g,style:F?void 0:{opacity:0}},ownerState:R});return s.jsx(Q,{...re,...!J0(Q)&&{slots:ee,slotProps:ne,disableScrollLock:T},children:s.jsx(_,{...U,timeout:V,children:s.jsx(Y,{...ie,children:f})})})});function F8(e){return ct("MuiMenu",e)}ut("MuiMenu",["root","paper","list"]);const N8={vertical:"top",horizontal:"right"},_8={vertical:"top",horizontal:"left"},H8=e=>{const{classes:t}=e;return Be({root:["root"],paper:["paper"],list:["list"]},F8,t)},B8=Ce(A8,{shouldForwardProp:e=>yo(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),W8=Ce(xR,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),V8=Ce(Ux,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),Ra=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiMenu"}),{autoFocus:o=!0,children:i,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:f,open:h,PaperProps:p={},PopoverClasses:g,transitionDuration:y="auto",TransitionProps:{onEntering:b,...v}={},variant:C="selectedMenu",slots:S={},slotProps:j={},...w}=r,k=Yr(),P={...r,autoFocus:o,disableAutoFocusItem:c,MenuListProps:u,onEntering:b,PaperProps:p,transitionDuration:y,TransitionProps:v,variant:C},T=H8(P),$=o&&!c&&h,M=m.useRef(null),R=(V,G)=>{M.current&&M.current.adjustStyleForScrollbar(V,{direction:k?"rtl":"ltr"}),b&&b(V,G)},E=V=>{V.key==="Tab"&&(V.preventDefault(),f&&f(V,"tabKeyDown"))};let O=-1;m.Children.map(i,(V,G)=>{m.isValidElement(V)&&(V.props.disabled||(C==="selectedMenu"&&V.props.selected||O===-1)&&(O=G))});const A={slots:S,slotProps:{list:u,transition:v,paper:p,...j}},N=zc({elementType:S.root,externalSlotProps:j.root,ownerState:P,className:[T.root,l]}),[F,L]=at("paper",{className:T.paper,elementType:W8,externalForwardedProps:A,shouldForwardComponentProp:!0,ownerState:P}),[D,H]=at("list",{className:Me(T.list,u.className),elementType:V8,shouldForwardComponentProp:!0,externalForwardedProps:A,getSlotProps:V=>({...V,onKeyDown:G=>{var _;E(G),(_=V.onKeyDown)==null||_.call(V,G)}}),ownerState:P}),B=typeof A.slotProps.transition=="function"?A.slotProps.transition(P):A.slotProps.transition;return s.jsx(B8,{onClose:f,anchorOrigin:{vertical:"bottom",horizontal:k?"right":"left"},transformOrigin:k?N8:_8,slots:{root:S.root,paper:F,backdrop:S.backdrop,...S.transition&&{transition:S.transition}},slotProps:{root:N,paper:L,backdrop:typeof j.backdrop=="function"?j.backdrop(P):j.backdrop,transition:{...B,onEntering:(...V)=>{var G;R(...V),(G=B==null?void 0:B.onEntering)==null||G.call(B,...V)}}},open:h,ref:n,transitionDuration:y,ownerState:P,...w,classes:g,children:s.jsx(D,{actions:M,autoFocus:o&&(O===-1||c),autoFocusItem:$,variant:C,...H,children:i})})});function G8(e){return ct("MuiMenuItem",e)}const Uf=ut("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),U8=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},q8=e=>{const{disabled:t,dense:n,divider:r,disableGutters:o,selected:i,classes:l}=e,u=Be({root:["root",n&&"dense",t&&"disabled",!o&&"gutters",r&&"divider",i&&"selected"]},G8,l);return{...l,...u}},K8=Ce(Ds,{shouldForwardProp:e=>yo(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:U8})(tt(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Uf.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ye(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Uf.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Ye(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${Uf.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ye(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ye(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${Uf.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Uf.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${Uk.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${Uk.inset}`]:{marginLeft:52},[`& .${Hu.root}`]:{marginTop:0,marginBottom:0},[`& .${Hu.inset}`]:{paddingLeft:36},[`& .${Jk.root}`]:{minWidth:36},variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>!t.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:t})=>t.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${Jk.root} svg`]:{fontSize:"1.25rem"}}}]}))),it=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:i="li",dense:l=!1,divider:c=!1,disableGutters:u=!1,focusVisibleClassName:f,role:h="menuitem",tabIndex:p,className:g,...y}=r,b=m.useContext(Dc),v=m.useMemo(()=>({dense:l||b.dense||!1,disableGutters:u}),[b.dense,l,u]),C=m.useRef(null);Ln(()=>{o&&C.current&&C.current.focus()},[o]);const S={...r,dense:v.dense,divider:c,disableGutters:u},j=q8(r),w=Pn(C,n);let k;return r.disabled||(k=p!==void 0?p:-1),s.jsx(Dc.Provider,{value:v,children:s.jsx(K8,{ref:w,role:h,tabIndex:k,component:i,focusVisibleClassName:Me(j.focusVisible,f),className:Me(j.root,g),...y,ownerState:S,classes:j})})});function Q8(e){return ct("MuiNativeSelect",e)}const Rw=ut("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Y8=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:l}=e,c={select:["select",n,r&&"disabled",o&&"multiple",l&&"error"],icon:["icon",`icon${Pe(n)}`,i&&"iconOpen",r&&"disabled"]};return Be(c,Q8,t)},yR=Ce("select",{name:"MuiNativeSelect"})(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${Rw.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:t})=>t.variant!=="filled"&&t.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),X8=Ce(yR,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:yo,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${Rw.multiple}`]:t.multiple}]}})({}),bR=Ce("svg",{name:"MuiNativeSelect"})(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${Rw.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:t})=>t.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),Z8=Ce(bR,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Pe(n.variant)}`],n.open&&t.iconOpen]}})({}),J8=m.forwardRef(function(t,n){const{className:r,disabled:o,error:i,IconComponent:l,inputRef:c,variant:u="standard",...f}=t,h={...t,disabled:o,variant:u,error:i},p=Y8(h);return s.jsxs(m.Fragment,{children:[s.jsx(X8,{ownerState:h,className:Me(p.select,r),disabled:o,ref:c||n,...f}),t.multiple?null:s.jsx(Z8,{as:l,ownerState:h,className:p.icon})]})});var oI;const eV=Ce("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:yo})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),tV=Ce("legend",{name:"MuiNotchedOutlined",shouldForwardProp:yo})(tt(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:t})=>!t.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:t})=>t.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:t})=>t.withLabel&&t.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function nV(e){const{children:t,classes:n,className:r,label:o,notched:i,...l}=e,c=o!=null&&o!=="",u={...e,notched:i,withLabel:c};return s.jsx(eV,{"aria-hidden":!0,className:r,ownerState:u,...l,children:s.jsx(tV,{ownerState:u,children:c?s.jsx("span",{children:o}):oI||(oI=s.jsx("span",{className:"notranslate","aria-hidden":!0,children:""}))})})}const rV=e=>{const{classes:t}=e,r=Be({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},f6,t);return{...t,...r}},oV=Ce(Vx,{shouldForwardProp:e=>yo(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Bx})(tt(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${ws.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${ws.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${ws.focused} .${ws.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(qn()).map(([n])=>({props:{color:n},style:{[`&.${ws.focused} .${ws.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}})),{props:{},style:{[`&.${ws.error} .${ws.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${ws.disabled} .${ws.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),sV=Ce(nV,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(tt(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}})),iV=Ce(Gx,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Wx})(tt(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:t})=>t.multiline,style:{padding:0}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}}]}))),$w=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiOutlinedInput"}),{components:o={},fullWidth:i=!1,inputComponent:l="input",label:c,multiline:u=!1,notched:f,slots:h={},slotProps:p={},type:g="text",...y}=r,b=rV(r),v=jl(),C=qc({props:r,muiFormControl:v,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),S={...r,color:C.color||"primary",disabled:C.disabled,error:C.error,focused:C.focused,formControl:v,fullWidth:i,hiddenLabel:C.hiddenLabel,multiline:u,size:C.size,type:g},j=h.root??o.Root??oV,w=h.input??o.Input??iV,[k,P]=at("notchedOutline",{elementType:sV,className:b.notchedOutline,shouldForwardComponentProp:!0,ownerState:S,externalForwardedProps:{slots:h,slotProps:p},additionalProps:{label:c!=null&&c!==""&&C.required?s.jsxs(m.Fragment,{children:[c," ","*"]}):c}});return s.jsx(Bd,{slots:{root:j,input:w},slotProps:p,renderSuffix:T=>s.jsx(k,{...P,notched:typeof f<"u"?f:!!(T.startAdornment||T.filled||T.focused)}),fullWidth:i,inputComponent:l,multiline:u,ref:n,type:g,...y,classes:{...b,notchedOutline:null}})});$w.muiName="Input";const lV=_e(s.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),aV=_e(s.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage");function vR(e){return ct("MuiSelect",e)}const qf=ut("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var sI;const cV=Ce(yR,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${qf.select}`]:t.select},{[`&.${qf.select}`]:t[n.variant]},{[`&.${qf.error}`]:t.error},{[`&.${qf.multiple}`]:t.multiple}]}})({[`&.${qf.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),uV=Ce(bR,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Pe(n.variant)}`],n.open&&t.iconOpen]}})({}),dV=Ce("input",{shouldForwardProp:e=>NM(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function iI(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function fV(e){return e==null||typeof e=="string"&&!e.trim()}const pV=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:l}=e,c={select:["select",n,r&&"disabled",o&&"multiple",l&&"error"],icon:["icon",`icon${Pe(n)}`,i&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Be(c,vR,t)},hV=m.forwardRef(function(t,n){var Je;const{"aria-describedby":r,"aria-label":o,autoFocus:i,autoWidth:l,children:c,className:u,defaultOpen:f,defaultValue:h,disabled:p,displayEmpty:g,error:y=!1,IconComponent:b,inputRef:v,labelId:C,MenuProps:S={},multiple:j,name:w,onBlur:k,onChange:P,onClose:T,onFocus:$,onOpen:M,open:R,readOnly:E,renderValue:O,required:A,SelectDisplayProps:N={},tabIndex:F,type:L,value:D,variant:H="standard",...B}=t,[V,G]=va({controlled:D,default:h,name:"Select"}),[_,U]=va({controlled:R,default:f,name:"Select"}),Z=m.useRef(null),Q=m.useRef(null),[ee,ne]=m.useState(null),{current:re}=m.useRef(R!=null),[Y,ie]=m.useState(),ce=Pn(n,v),he=m.useCallback(me=>{Q.current=me,me&&ne(me)},[]),de=ee==null?void 0:ee.parentNode;m.useImperativeHandle(ce,()=>({focus:()=>{Q.current.focus()},node:Z.current,value:V}),[V]),m.useEffect(()=>{f&&_&&ee&&!re&&(ie(l?null:de.clientWidth),Q.current.focus())},[ee,l]),m.useEffect(()=>{i&&Q.current.focus()},[i]),m.useEffect(()=>{if(!C)return;const me=ir(Q.current).getElementById(C);if(me){const Ne=()=>{getSelection().isCollapsed&&Q.current.focus()};return me.addEventListener("click",Ne),()=>{me.removeEventListener("click",Ne)}}},[C]);const le=(me,Ne)=>{me?M&&M(Ne):T&&T(Ne),re||(ie(l?null:de.clientWidth),U(me))},ge=me=>{me.button===0&&(me.preventDefault(),Q.current.focus(),le(!0,me))},Se=me=>{le(!1,me)},ke=m.Children.toArray(c),we=me=>{const Ne=ke.find(xt=>xt.props.value===me.target.value);Ne!==void 0&&(G(Ne.props.value),P&&P(me,Ne))},Oe=me=>Ne=>{let xt;if(Ne.currentTarget.hasAttribute("tabindex")){if(j){xt=Array.isArray(V)?V.slice():[];const Bt=V.indexOf(me.props.value);Bt===-1?xt.push(me.props.value):xt.splice(Bt,1)}else xt=me.props.value;if(me.props.onClick&&me.props.onClick(Ne),V!==xt&&(G(xt),P)){const Bt=Ne.nativeEvent||Ne,pn=new Bt.constructor(Bt.type,Bt);Object.defineProperty(pn,"target",{writable:!0,value:{value:xt,name:w}}),P(pn,me)}j||le(!1,Ne)}},be=me=>{E||[" ","ArrowUp","ArrowDown","Enter"].includes(me.key)&&(me.preventDefault(),le(!0,me))},Fe=ee!==null&&_,Ve=me=>{!Fe&&k&&(Object.defineProperty(me,"target",{writable:!0,value:{value:V,name:w}}),k(me))};delete B["aria-invalid"];let De,Ze;const Ae=[];let st=!1;(Qg({value:V})||g)&&(O?De=O(V):st=!0);const qe=ke.map(me=>{if(!m.isValidElement(me))return null;let Ne;if(j){if(!Array.isArray(V))throw new Error(hl(2));Ne=V.some(xt=>iI(xt,me.props.value)),Ne&&st&&Ae.push(me.props.children)}else Ne=iI(V,me.props.value),Ne&&st&&(Ze=me.props.children);return m.cloneElement(me,{"aria-selected":Ne?"true":"false",onClick:Oe(me),onKeyUp:xt=>{xt.key===" "&&xt.preventDefault(),me.props.onKeyUp&&me.props.onKeyUp(xt)},role:"option",selected:Ne,value:void 0,"data-value":me.props.value})});st&&(j?Ae.length===0?De=null:De=Ae.reduce((me,Ne,xt)=>(me.push(Ne),xt<Ae.length-1&&me.push(", "),me),[]):De=Ze);let et=Y;!l&&re&&ee&&(et=de.clientWidth);let oe;typeof F<"u"?oe=F:oe=p?null:0;const fe=N.id||(w?`mui-component-select-${w}`:void 0),Ie={...t,variant:H,value:V,open:Fe,error:y},$e=pV(Ie),pt={...S.PaperProps,...(Je=S.slotProps)==null?void 0:Je.paper},vt=Sn();return s.jsxs(m.Fragment,{children:[s.jsx(cV,{as:"div",ref:he,tabIndex:oe,role:"combobox","aria-controls":Fe?vt:void 0,"aria-disabled":p?"true":void 0,"aria-expanded":Fe?"true":"false","aria-haspopup":"listbox","aria-label":o,"aria-labelledby":[C,fe].filter(Boolean).join(" ")||void 0,"aria-describedby":r,"aria-required":A?"true":void 0,"aria-invalid":y?"true":void 0,onKeyDown:be,onMouseDown:p||E?null:ge,onBlur:Ve,onFocus:$,...N,ownerState:Ie,className:Me(N.className,$e.select,u),id:fe,children:fV(De)?sI||(sI=s.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):De}),s.jsx(dV,{"aria-invalid":y,value:Array.isArray(V)?V.join(","):V,name:w,ref:Z,"aria-hidden":!0,onChange:we,tabIndex:-1,disabled:p,className:$e.nativeInput,autoFocus:i,required:A,...B,ownerState:Ie}),s.jsx(uV,{as:b,className:$e.icon,ownerState:Ie}),s.jsx(Ra,{id:`menu-${w||""}`,anchorEl:de,open:Fe,onClose:Se,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...S,slotProps:{...S.slotProps,list:{"aria-labelledby":C,role:"listbox","aria-multiselectable":j?"true":void 0,disableListWrap:!0,id:vt,...S.MenuListProps},paper:{...pt,style:{minWidth:et,...pt!=null?pt.style:null}}},children:qe})]})}),mV=e=>{const{classes:t}=e,r=Be({root:["root"]},vR,t);return{...t,...r}},Ow={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>yo(e)&&e!=="variant",slot:"Root"},gV=Ce(Tw,Ow)(""),xV=Ce($w,Ow)(""),yV=Ce(Pw,Ow)(""),On=m.forwardRef(function(t,n){const r=ft({name:"MuiSelect",props:t}),{autoWidth:o=!1,children:i,classes:l={},className:c,defaultOpen:u=!1,displayEmpty:f=!1,IconComponent:h=iR,id:p,input:g,inputProps:y,label:b,labelId:v,MenuProps:C,multiple:S=!1,native:j=!1,onClose:w,onOpen:k,open:P,renderValue:T,SelectDisplayProps:$,variant:M="outlined",...R}=r,E=j?J8:hV,O=jl(),A=qc({props:r,muiFormControl:O,states:["variant","error"]}),N=A.variant||M,F={...r,variant:N,classes:l},L=mV(F),{root:D,...H}=L,B=g||{standard:s.jsx(gV,{ownerState:F}),outlined:s.jsx(xV,{label:b,ownerState:F}),filled:s.jsx(yV,{ownerState:F})}[N],V=Pn(n,Da(B));return s.jsx(m.Fragment,{children:m.cloneElement(B,{inputComponent:E,inputProps:{children:i,error:A.error,IconComponent:h,variant:N,type:void 0,multiple:S,...j?{id:p}:{autoWidth:o,defaultOpen:u,displayEmpty:f,labelId:v,MenuProps:C,onClose:w,onOpen:k,open:P,renderValue:T,SelectDisplayProps:{id:p,...$}},...y,classes:y?qr(H,y.classes):H,...g?g.props.inputProps:{}},...(S&&j||f)&&N==="outlined"?{notched:!0}:{},ref:V,className:Me(B.props.className,c,L.root),...!g&&{variant:N},...R})})});On.muiName="Select";function bV(e){return ct("MuiSkeleton",e)}ut("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const vV=e=>{const{classes:t,variant:n,animation:r,hasChildren:o,width:i,height:l}=e;return Be({root:["root",n,r,o&&"withChildren",o&&!i&&"fitContent",o&&!l&&"heightAuto"]},bV,t)},lC=Hi`
|
|
259
|
+
0% {
|
|
260
|
+
opacity: 1;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
50% {
|
|
264
|
+
opacity: 0.4;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
100% {
|
|
268
|
+
opacity: 1;
|
|
269
|
+
}
|
|
270
|
+
`,aC=Hi`
|
|
271
|
+
0% {
|
|
272
|
+
transform: translateX(-100%);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
50% {
|
|
276
|
+
/* +0.5s of delay between each loop */
|
|
277
|
+
transform: translateX(100%);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
100% {
|
|
281
|
+
transform: translateX(100%);
|
|
282
|
+
}
|
|
283
|
+
`,CV=typeof lC!="string"?La`
|
|
284
|
+
animation: ${lC} 2s ease-in-out 0.5s infinite;
|
|
285
|
+
`:null,wV=typeof aC!="string"?La`
|
|
286
|
+
&::after {
|
|
287
|
+
animation: ${aC} 2s linear 0.5s infinite;
|
|
288
|
+
}
|
|
289
|
+
`:null,SV=Ce("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],n.animation!==!1&&t[n.animation],n.hasChildren&&t.withChildren,n.hasChildren&&!n.width&&t.fitContent,n.hasChildren&&!n.height&&t.heightAuto]}})(tt(({theme:e})=>{const t=Q3(e.shape.borderRadius)||"px",n=Y3(e.shape.borderRadius);return{display:"block",backgroundColor:e.vars?e.vars.palette.Skeleton.bg:Ye(e.palette.text.primary,e.palette.mode==="light"?.11:.13),height:"1.2em",variants:[{props:{variant:"text"},style:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${n}${t}/${Math.round(n/.6*10)/10}${t}`,"&:empty:before":{content:'"\\00a0"'}}},{props:{variant:"circular"},style:{borderRadius:"50%"}},{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:({ownerState:r})=>r.hasChildren,style:{"& > *":{visibility:"hidden"}}},{props:({ownerState:r})=>r.hasChildren&&!r.width,style:{maxWidth:"fit-content"}},{props:({ownerState:r})=>r.hasChildren&&!r.height,style:{height:"auto"}},{props:{animation:"pulse"},style:CV||{animation:`${lC} 2s ease-in-out 0.5s infinite`}},{props:{animation:"wave"},style:{position:"relative",overflow:"hidden",WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::after":{background:`linear-gradient(
|
|
290
|
+
90deg,
|
|
291
|
+
transparent,
|
|
292
|
+
${(e.vars||e).palette.action.hover},
|
|
293
|
+
transparent
|
|
294
|
+
)`,content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}}},{props:{animation:"wave"},style:wV||{"&::after":{animation:`${aC} 2s linear 0.5s infinite`}}}]}})),to=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiSkeleton"}),{animation:o="pulse",className:i,component:l="span",height:c,style:u,variant:f="text",width:h,...p}=r,g={...r,animation:o,component:l,variant:f,hasChildren:!!p.children},y=vV(g);return s.jsx(SV,{as:l,ref:n,className:Me(y.root,i),ownerState:g,...p,style:{width:h,height:c,...u}})});function jV(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:o,resumeHideDuration:i}=e,l=Po();m.useEffect(()=>{if(!o)return;function S(j){j.defaultPrevented||j.key==="Escape"&&(r==null||r(j,"escapeKeyDown"))}return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[o,r]);const c=Vt((S,j)=>{r==null||r(S,j)}),u=Vt(S=>{!r||S==null||l.start(S,()=>{c(null,"timeout")})});m.useEffect(()=>(o&&u(t),l.clear),[o,t,u,l]);const f=S=>{r==null||r(S,"clickaway")},h=l.clear,p=m.useCallback(()=>{t!=null&&u(i??t*.5)},[t,i,u]),g=S=>j=>{const w=S.onBlur;w==null||w(j),p()},y=S=>j=>{const w=S.onFocus;w==null||w(j),h()},b=S=>j=>{const w=S.onMouseEnter;w==null||w(j),h()},v=S=>j=>{const w=S.onMouseLeave;w==null||w(j),p()};return m.useEffect(()=>{if(!n&&o)return window.addEventListener("focus",p),window.addEventListener("blur",h),()=>{window.removeEventListener("focus",p),window.removeEventListener("blur",h)}},[n,o,p,h]),{getRootProps:(S={})=>{const j={...Gg(e),...Gg(S)};return{role:"presentation",...S,...j,onBlur:g(j),onFocus:y(j),onMouseEnter:b(j),onMouseLeave:v(j)}},onClickAway:f}}function kV(e){return ct("MuiSnackbarContent",e)}ut("MuiSnackbarContent",["root","message","action"]);const IV=e=>{const{classes:t}=e;return Be({root:["root"],action:["action"],message:["message"]},kV,t)},EV=Ce(Un,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(e,t)=>t.root})(tt(({theme:e})=>{const t=e.palette.mode==="light"?.8:.98,n=Vg(e.palette.background.default,t);return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(n),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),PV=Ce("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0"}),TV=Ce("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),MV=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiSnackbarContent"}),{action:o,className:i,message:l,role:c="alert",...u}=r,f=r,h=IV(f);return s.jsxs(EV,{role:c,square:!0,elevation:6,className:Me(h.root,i),ownerState:f,ref:n,...u,children:[s.jsx(PV,{className:h.message,ownerState:f,children:l}),o?s.jsx(TV,{className:h.action,ownerState:f,children:o}):null]})});function RV(e){return ct("MuiSnackbar",e)}ut("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const $V=e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${Pe(n.vertical)}${Pe(n.horizontal)}`]};return Be(r,RV,t)},OV=Ce("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${Pe(n.anchorOrigin.vertical)}${Pe(n.anchorOrigin.horizontal)}`]]}})(tt(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:t})=>t.anchorOrigin.vertical==="top",style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:t})=>t.anchorOrigin.vertical!=="top",style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="center",style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),zV=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiSnackbar"}),o=Xr(),i={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{action:l,anchorOrigin:{vertical:c,horizontal:u}={vertical:"bottom",horizontal:"left"},autoHideDuration:f=null,children:h,className:p,ClickAwayListenerProps:g,ContentProps:y,disableWindowBlurListener:b=!1,message:v,onBlur:C,onClose:S,onFocus:j,onMouseEnter:w,onMouseLeave:k,open:P,resumeHideDuration:T,slots:$={},slotProps:M={},TransitionComponent:R,transitionDuration:E=i,TransitionProps:{onEnter:O,onExited:A,...N}={},...F}=r,L={...r,anchorOrigin:{vertical:c,horizontal:u},autoHideDuration:f,disableWindowBlurListener:b,TransitionComponent:R,transitionDuration:E},D=$V(L),{getRootProps:H,onClickAway:B}=jV({...L}),[V,G]=m.useState(!0),_=le=>{G(!0),A&&A(le)},U=(le,ge)=>{G(!1),O&&O(le,ge)},Z={slots:{transition:R,...$},slotProps:{content:y,clickAwayListener:g,transition:N,...M}},[Q,ee]=at("root",{ref:n,className:[D.root,p],elementType:OV,getSlotProps:H,externalForwardedProps:{...Z,...F},ownerState:L}),[ne,{ownerState:re,...Y}]=at("clickAwayListener",{elementType:Iw,externalForwardedProps:Z,getSlotProps:le=>({onClickAway:(...ge)=>{var Se;(Se=le.onClickAway)==null||Se.call(le,...ge),B(...ge)}}),ownerState:L}),[ie,ce]=at("content",{elementType:MV,shouldForwardComponentProp:!0,externalForwardedProps:Z,additionalProps:{message:v,action:l},ownerState:L}),[he,de]=at("transition",{elementType:yd,externalForwardedProps:Z,getSlotProps:le=>({onEnter:(...ge)=>{var Se;(Se=le.onEnter)==null||Se.call(le,...ge),U(...ge)},onExited:(...ge)=>{var Se;(Se=le.onExited)==null||Se.call(le,...ge),_(...ge)}}),additionalProps:{appear:!0,in:P,timeout:E,direction:c==="top"?"down":"up"},ownerState:L});return!P&&V?null:s.jsx(ne,{...Y,...$.clickAwayListener&&{ownerState:re},children:s.jsx(Q,{...ee,children:s.jsx(he,{...de,children:h||s.jsx(ie,{...ce})})})})});function LV(e){return ct("MuiTooltip",e)}const yr=ut("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function DV(e){return Math.round(e*1e5)/1e5}const AV=e=>{const{classes:t,disableInteractive:n,arrow:r,touch:o,placement:i}=e,l={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",o&&"touch",`tooltipPlacement${Pe(i.split("-")[0])}`],arrow:["arrow"]};return Be(l,LV,t)},FV=Ce(Uc,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(tt(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:t})=>!t.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:t})=>!t,style:{pointerEvents:"none"}},{props:({ownerState:t})=>t.arrow,style:{[`&[data-popper-placement*="bottom"] .${yr.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${yr.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${yr.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${yr.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="right"] .${yr.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="right"] .${yr.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="left"] .${yr.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="left"] .${yr.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),NV=Ce("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${Pe(n.placement.split("-")[0])}`]]}})(tt(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:Ye(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${yr.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${yr.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${yr.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${yr.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:t})=>t.arrow,style:{position:"relative",margin:0}},{props:({ownerState:t})=>t.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${DV(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:t})=>!t.isRtl,style:{[`.${yr.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${yr.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:t})=>!t.isRtl&&t.touch,style:{[`.${yr.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${yr.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:t})=>!!t.isRtl,style:{[`.${yr.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${yr.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:t})=>!!t.isRtl&&t.touch,style:{[`.${yr.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${yr.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${yr.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${yr.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),_V=Ce("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(tt(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:Ye(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let eg=!1;const lI=new Fx;let Kf={x:0,y:0};function tg(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}const Pt=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiTooltip"}),{arrow:o=!1,children:i,classes:l,components:c={},componentsProps:u={},describeChild:f=!1,disableFocusListener:h=!1,disableHoverListener:p=!1,disableInteractive:g=!1,disableTouchListener:y=!1,enterDelay:b=100,enterNextDelay:v=0,enterTouchDelay:C=700,followCursor:S=!1,id:j,leaveDelay:w=0,leaveTouchDelay:k=1500,onClose:P,onOpen:T,open:$,placement:M="bottom",PopperComponent:R,PopperProps:E={},slotProps:O={},slots:A={},title:N,TransitionComponent:F,TransitionProps:L,...D}=r,H=m.isValidElement(i)?i:s.jsx("span",{children:i}),B=Xr(),V=Yr(),[G,_]=m.useState(),[U,Z]=m.useState(null),Q=m.useRef(!1),ee=g||S,ne=Po(),re=Po(),Y=Po(),ie=Po(),[ce,he]=va({controlled:$,default:!1,name:"Tooltip",state:"open"});let de=ce;const le=Sn(j),ge=m.useRef(),Se=Vt(()=>{ge.current!==void 0&&(document.body.style.WebkitUserSelect=ge.current,ge.current=void 0),ie.clear()});m.useEffect(()=>Se,[Se]);const ke=yt=>{lI.clear(),eg=!0,he(!0),T&&!de&&T(yt)},we=Vt(yt=>{lI.start(800+w,()=>{eg=!1}),he(!1),P&&de&&P(yt),ne.start(B.transitions.duration.shortest,()=>{Q.current=!1})}),Oe=yt=>{Q.current&&yt.type!=="touchstart"||(G&&G.removeAttribute("title"),re.clear(),Y.clear(),b||eg&&v?re.start(eg?v:b,()=>{ke(yt)}):ke(yt))},be=yt=>{re.clear(),Y.start(w,()=>{we(yt)})},[,Fe]=m.useState(!1),Ve=yt=>{pd(yt.target)||(Fe(!1),be(yt))},De=yt=>{G||_(yt.currentTarget),pd(yt.target)&&(Fe(!0),Oe(yt))},Ze=yt=>{Q.current=!0;const Ht=H.props;Ht.onTouchStart&&Ht.onTouchStart(yt)},Ae=yt=>{Ze(yt),Y.clear(),ne.clear(),Se(),ge.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",ie.start(C,()=>{document.body.style.WebkitUserSelect=ge.current,Oe(yt)})},st=yt=>{H.props.onTouchEnd&&H.props.onTouchEnd(yt),Se(),Y.start(k,()=>{we(yt)})};m.useEffect(()=>{if(!de)return;function yt(Ht){Ht.key==="Escape"&&we(Ht)}return document.addEventListener("keydown",yt),()=>{document.removeEventListener("keydown",yt)}},[we,de]);const qe=Pn(Da(H),_,n);!N&&N!==0&&(de=!1);const et=m.useRef(),oe=yt=>{const Ht=H.props;Ht.onMouseMove&&Ht.onMouseMove(yt),Kf={x:yt.clientX,y:yt.clientY},et.current&&et.current.update()},fe={},Ie=typeof N=="string";f?(fe.title=!de&&Ie&&!p?N:null,fe["aria-describedby"]=de?le:null):(fe["aria-label"]=Ie?N:null,fe["aria-labelledby"]=de&&!Ie?le:null);const $e={...fe,...D,...H.props,className:Me(D.className,H.props.className),onTouchStart:Ze,ref:qe,...S?{onMouseMove:oe}:{}},pt={};y||($e.onTouchStart=Ae,$e.onTouchEnd=st),p||($e.onMouseOver=tg(Oe,$e.onMouseOver),$e.onMouseLeave=tg(be,$e.onMouseLeave),ee||(pt.onMouseOver=Oe,pt.onMouseLeave=be)),h||($e.onFocus=tg(De,$e.onFocus),$e.onBlur=tg(Ve,$e.onBlur),ee||(pt.onFocus=De,pt.onBlur=Ve));const vt={...r,isRtl:V,arrow:o,disableInteractive:ee,placement:M,PopperComponentProp:R,touch:Q.current},Je=typeof O.popper=="function"?O.popper(vt):O.popper,me=m.useMemo(()=>{var Ht,Ke;let yt=[{name:"arrow",enabled:!!U,options:{element:U,padding:4}}];return(Ht=E.popperOptions)!=null&&Ht.modifiers&&(yt=yt.concat(E.popperOptions.modifiers)),(Ke=Je==null?void 0:Je.popperOptions)!=null&&Ke.modifiers&&(yt=yt.concat(Je.popperOptions.modifiers)),{...E.popperOptions,...Je==null?void 0:Je.popperOptions,modifiers:yt}},[U,E.popperOptions,Je==null?void 0:Je.popperOptions]),Ne=AV(vt),xt=typeof O.transition=="function"?O.transition(vt):O.transition,Bt={slots:{popper:c.Popper,transition:c.Transition??F,tooltip:c.Tooltip,arrow:c.Arrow,...A},slotProps:{arrow:O.arrow??u.arrow,popper:{...E,...Je??u.popper},tooltip:O.tooltip??u.tooltip,transition:{...L,...xt??u.transition}}},[pn,yn]=at("popper",{elementType:FV,externalForwardedProps:Bt,ownerState:vt,className:Me(Ne.popper,E==null?void 0:E.className)}),[hn,ln]=at("transition",{elementType:yd,externalForwardedProps:Bt,ownerState:vt}),[An,kt]=at("tooltip",{elementType:NV,className:Ne.tooltip,externalForwardedProps:Bt,ownerState:vt}),[un,er]=at("arrow",{elementType:_V,className:Ne.arrow,externalForwardedProps:Bt,ownerState:vt,ref:Z});return s.jsxs(m.Fragment,{children:[m.cloneElement(H,$e),s.jsx(pn,{as:R??Uc,placement:M,anchorEl:S?{getBoundingClientRect:()=>({top:Kf.y,left:Kf.x,right:Kf.x,bottom:Kf.y,width:0,height:0})}:G,popperRef:et,open:G?de:!1,id:le,transition:!0,...pt,...yn,popperOptions:me,children:({TransitionProps:yt})=>s.jsx(hn,{timeout:B.transitions.duration.shorter,...yt,...ln,children:s.jsxs(An,{...kt,children:[N,o?s.jsx(un,{...er}):null]})})})]})}),$a=b3({createStyledComponent:Ce("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>ft({props:e,name:"MuiStack"})});function HV(e){return ct("MuiSwitch",e)}const wo=ut("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),BV=e=>{const{classes:t,edge:n,size:r,color:o,checked:i,disabled:l}=e,c={root:["root",n&&`edge${Pe(n)}`,`size${Pe(r)}`],switchBase:["switchBase",`color${Pe(o)}`,i&&"checked",l&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},u=Be(c,HV,t);return{...t,...u}},WV=Ce("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.edge&&t[`edge${Pe(n.edge)}`],t[`size${Pe(n.size)}`]]}})({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${wo.thumb}`]:{width:16,height:16},[`& .${wo.switchBase}`]:{padding:4,[`&.${wo.checked}`]:{transform:"translateX(16px)"}}}}]}),VV=Ce(cR,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.switchBase,{[`& .${wo.input}`]:t.input},n.color!=="default"&&t[`color${Pe(n.color)}`]]}})(tt(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode==="light"?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${wo.checked}`]:{transform:"translateX(20px)"},[`&.${wo.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${wo.checked} + .${wo.track}`]:{opacity:.5},[`&.${wo.disabled} + .${wo.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode==="light"?.12:.2}`},[`& .${wo.input}`]:{left:"-100%",width:"300%"}})),tt(({theme:e})=>({"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ye(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(qn(["light"])).map(([t])=>({props:{color:t},style:{[`&.${wo.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ye(e.palette[t].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${wo.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${e.palette.mode==="light"?gl(e.palette[t].main,.62):ml(e.palette[t].main,.55)}`}},[`&.${wo.checked} + .${wo.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),GV=Ce("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(e,t)=>t.track})(tt(({theme:e})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode==="light"?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode==="light"?.38:.3}`}))),UV=Ce("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})(tt(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),wp=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiSwitch"}),{className:o,color:i="primary",edge:l=!1,size:c="medium",sx:u,slots:f={},slotProps:h={},...p}=r,g={...r,color:i,edge:l,size:c},y=BV(g),b={slots:f,slotProps:h},[v,C]=at("root",{className:Me(y.root,o),elementType:WV,externalForwardedProps:b,ownerState:g,additionalProps:{sx:u}}),[S,j]=at("thumb",{className:y.thumb,elementType:UV,externalForwardedProps:b,ownerState:g}),w=s.jsx(S,{...j}),[k,P]=at("track",{className:y.track,elementType:GV,externalForwardedProps:b,ownerState:g});return s.jsxs(v,{...C,children:[s.jsx(VV,{type:"checkbox",icon:w,checkedIcon:w,ref:n,ownerState:g,...p,classes:{...y,root:y.switchBase},slots:{...f.switchBase&&{root:f.switchBase},...f.input&&{input:f.input}},slotProps:{...h.switchBase&&{root:typeof h.switchBase=="function"?h.switchBase(g):h.switchBase},...h.input&&{input:typeof h.input=="function"?h.input(g):h.input}}}),s.jsx(k,{...P})]})});function qV(e){return ct("MuiTab",e)}const Cs=ut("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),KV=e=>{const{classes:t,textColor:n,fullWidth:r,wrapped:o,icon:i,label:l,selected:c,disabled:u}=e,f={root:["root",i&&l&&"labelIcon",`textColor${Pe(n)}`,r&&"fullWidth",o&&"wrapped",c&&"selected",u&&"disabled"],icon:["iconWrapper","icon"]};return Be(f,qV,t)},QV=Ce(Ds,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${Pe(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${Cs.iconWrapper}`]:t.iconWrapper},{[`& .${Cs.icon}`]:t.icon}]}})(tt(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:t})=>t.label&&(t.iconPosition==="top"||t.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:t})=>t.label&&t.iconPosition!=="top"&&t.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:t})=>t.icon&&t.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="top",style:{[`& > .${Cs.icon}`]:{marginBottom:6}}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="bottom",style:{[`& > .${Cs.icon}`]:{marginTop:6}}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="start",style:{[`& > .${Cs.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="end",style:{[`& > .${Cs.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${Cs.selected}`]:{opacity:1},[`&.${Cs.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${Cs.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${Cs.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${Cs.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${Cs.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:t})=>t.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:t})=>t.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),Bn=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiTab"}),{className:o,disabled:i=!1,disableFocusRipple:l=!1,fullWidth:c,icon:u,iconPosition:f="top",indicator:h,label:p,onChange:g,onClick:y,onFocus:b,selected:v,selectionFollowsFocus:C,textColor:S="inherit",value:j,wrapped:w=!1,...k}=r,P={...r,disabled:i,disableFocusRipple:l,selected:v,icon:!!u,iconPosition:f,label:!!p,fullWidth:c,textColor:S,wrapped:w},T=KV(P),$=u&&p&&m.isValidElement(u)?m.cloneElement(u,{className:Me(T.icon,u.props.className)}):u,M=E=>{!v&&g&&g(E,j),y&&y(E)},R=E=>{C&&!v&&g&&g(E,j),b&&b(E)};return s.jsxs(QV,{focusRipple:!l,className:Me(T.root,o),ref:n,role:"tab","aria-selected":v,disabled:i,onClick:M,onFocus:R,ownerState:P,tabIndex:v?0:-1,...k,children:[f==="top"||f==="start"?s.jsxs(m.Fragment,{children:[$,p]}):s.jsxs(m.Fragment,{children:[p,$]}),h]})}),CR=m.createContext();function YV(e){return ct("MuiTable",e)}ut("MuiTable",["root","stickyHeader"]);const XV=e=>{const{classes:t,stickyHeader:n}=e;return Be({root:["root",n&&"stickyHeader"]},YV,t)},ZV=Ce("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.stickyHeader&&t.stickyHeader]}})(tt(({theme:e})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...e.typography.body2,padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:t})=>t.stickyHeader,style:{borderCollapse:"separate"}}]}))),aI="table",Ca=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiTable"}),{className:o,component:i=aI,padding:l="normal",size:c="medium",stickyHeader:u=!1,...f}=r,h={...r,component:i,padding:l,size:c,stickyHeader:u},p=XV(h),g=m.useMemo(()=>({padding:l,size:c,stickyHeader:u}),[l,c,u]);return s.jsx(CR.Provider,{value:g,children:s.jsx(ZV,{as:i,role:i===aI?null:"table",ref:n,className:Me(p.root,o),ownerState:h,...f})})}),qx=m.createContext();function JV(e){return ct("MuiTableBody",e)}ut("MuiTableBody",["root"]);const eG=e=>{const{classes:t}=e;return Be({root:["root"]},JV,t)},tG=Ce("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-row-group"}),nG={variant:"body"},cI="tbody",wa=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiTableBody"}),{className:o,component:i=cI,...l}=r,c={...r,component:i},u=eG(c);return s.jsx(qx.Provider,{value:nG,children:s.jsx(tG,{className:Me(u.root,o),as:i,ref:n,role:i===cI?null:"rowgroup",ownerState:c,...l})})});function rG(e){return ct("MuiTableCell",e)}const oG=ut("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),sG=e=>{const{classes:t,variant:n,align:r,padding:o,size:i,stickyHeader:l}=e,c={root:["root",n,l&&"stickyHeader",r!=="inherit"&&`align${Pe(r)}`,o!=="normal"&&`padding${Pe(o)}`,`size${Pe(i)}`]};return Be(c,rG,t)},iG=Ce("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${Pe(n.size)}`],n.padding!=="normal"&&t[`padding${Pe(n.padding)}`],n.align!=="inherit"&&t[`align${Pe(n.align)}`],n.stickyHeader&&t.stickyHeader]}})(tt(({theme:e})=>({...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid
|
|
295
|
+
${e.palette.mode==="light"?gl(Ye(e.palette.divider,1),.88):ml(Ye(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${oG.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:t})=>t.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),lt=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiTableCell"}),{align:o="inherit",className:i,component:l,padding:c,scope:u,size:f,sortDirection:h,variant:p,...g}=r,y=m.useContext(CR),b=m.useContext(qx),v=b&&b.variant==="head";let C;l?C=l:C=v?"th":"td";let S=u;C==="td"?S=void 0:!S&&v&&(S="col");const j=p||b&&b.variant,w={...r,align:o,component:C,padding:c||(y&&y.padding?y.padding:"normal"),size:f||(y&&y.size?y.size:"medium"),sortDirection:h,stickyHeader:j==="head"&&y&&y.stickyHeader,variant:j},k=sG(w);let P=null;return h&&(P=h==="asc"?"ascending":"descending"),s.jsx(iG,{as:C,ref:n,className:Me(k.root,i),"aria-sort":P,scope:S,ownerState:w,...g})});function lG(e){return ct("MuiTableContainer",e)}ut("MuiTableContainer",["root"]);const aG=e=>{const{classes:t}=e;return Be({root:["root"]},lG,t)},cG=Ce("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(e,t)=>t.root})({width:"100%",overflowX:"auto"}),Sa=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiTableContainer"}),{className:o,component:i="div",...l}=r,c={...r,component:i},u=aG(c);return s.jsx(cG,{ref:n,as:i,className:Me(u.root,o),ownerState:c,...l})});function uG(e){return ct("MuiTableHead",e)}ut("MuiTableHead",["root"]);const dG=e=>{const{classes:t}=e;return Be({root:["root"]},uG,t)},fG=Ce("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),pG={variant:"head"},uI="thead",ja=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiTableHead"}),{className:o,component:i=uI,...l}=r,c={...r,component:i},u=dG(c);return s.jsx(qx.Provider,{value:pG,children:s.jsx(fG,{as:i,className:Me(u.root,o),ref:n,role:i===uI?null:"rowgroup",ownerState:c,...l})})});function hG(e){return ct("MuiToolbar",e)}ut("MuiToolbar",["root","gutters","regular","dense"]);const mG=e=>{const{classes:t,disableGutters:n,variant:r}=e;return Be({root:["root",!n&&"gutters",r]},hG,t)},gG=Ce("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(tt(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),xG=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiToolbar"}),{className:o,component:i="div",disableGutters:l=!1,variant:c="regular",...u}=r,f={...r,component:i,disableGutters:l,variant:c},h=mG(f);return s.jsx(gG,{as:i,className:Me(h.root,o),ref:n,ownerState:f,...u})}),wR=_e(s.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),SR=_e(s.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight"),yG=m.forwardRef(function(t,n){const{backIconButtonProps:r,count:o,disabled:i=!1,getItemAriaLabel:l,nextIconButtonProps:c,onPageChange:u,page:f,rowsPerPage:h,showFirstButton:p,showLastButton:g,slots:y={},slotProps:b={},...v}=t,C=Yr(),S=_=>{u(_,0)},j=_=>{u(_,f-1)},w=_=>{u(_,f+1)},k=_=>{u(_,Math.max(0,Math.ceil(o/h)-1))},P=y.firstButton??mt,T=y.lastButton??mt,$=y.nextButton??mt,M=y.previousButton??mt,R=y.firstButtonIcon??lV,E=y.lastButtonIcon??aV,O=y.nextButtonIcon??SR,A=y.previousButtonIcon??wR,N=C?T:P,F=C?$:M,L=C?M:$,D=C?P:T,H=C?b.lastButton:b.firstButton,B=C?b.nextButton:b.previousButton,V=C?b.previousButton:b.nextButton,G=C?b.firstButton:b.lastButton;return s.jsxs("div",{ref:n,...v,children:[p&&s.jsx(N,{onClick:S,disabled:i||f===0,"aria-label":l("first",f),title:l("first",f),...H,children:C?s.jsx(E,{...b.lastButtonIcon}):s.jsx(R,{...b.firstButtonIcon})}),s.jsx(F,{onClick:j,disabled:i||f===0,color:"inherit","aria-label":l("previous",f),title:l("previous",f),...B??r,children:C?s.jsx(O,{...b.nextButtonIcon}):s.jsx(A,{...b.previousButtonIcon})}),s.jsx(L,{onClick:w,disabled:i||(o!==-1?f>=Math.ceil(o/h)-1:!1),color:"inherit","aria-label":l("next",f),title:l("next",f),...V??c,children:C?s.jsx(A,{...b.previousButtonIcon}):s.jsx(O,{...b.nextButtonIcon})}),g&&s.jsx(D,{onClick:k,disabled:i||f>=Math.ceil(o/h)-1,"aria-label":l("last",f),title:l("last",f),...G,children:C?s.jsx(R,{...b.firstButtonIcon}):s.jsx(E,{...b.lastButtonIcon})})]})});function bG(e){return ct("MuiTablePagination",e)}const Ec=ut("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var dI;const vG=Ce(lt,{name:"MuiTablePagination",slot:"Root",overridesResolver:(e,t)=>t.root})(tt(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}}))),CG=Ce(xG,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>({[`& .${Ec.actions}`]:t.actions,...t.toolbar})})(tt(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${Ec.actions}`]:{flexShrink:0,marginLeft:20}}))),wG=Ce("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})({flex:"1 1 100%"}),SG=Ce("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(e,t)=>t.selectLabel})(tt(({theme:e})=>({...e.typography.body2,flexShrink:0}))),jG=Ce(On,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>({[`& .${Ec.selectIcon}`]:t.selectIcon,[`& .${Ec.select}`]:t.select,...t.input,...t.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${Ec.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),kG=Ce(it,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(e,t)=>t.menuItem})({}),IG=Ce("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(e,t)=>t.displayedRows})(tt(({theme:e})=>({...e.typography.body2,flexShrink:0})));function EG({from:e,to:t,count:n}){return`${e}–${t} of ${n!==-1?n:`more than ${t}`}`}function PG(e){return`Go to ${e} page`}const TG=e=>{const{classes:t}=e;return Be({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},bG,t)},MG=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiTablePagination"}),{ActionsComponent:o=yG,backIconButtonProps:i,colSpan:l,component:c=lt,count:u,disabled:f=!1,getItemAriaLabel:h=PG,labelDisplayedRows:p=EG,labelRowsPerPage:g="Rows per page:",nextIconButtonProps:y,onPageChange:b,onRowsPerPageChange:v,page:C,rowsPerPage:S,rowsPerPageOptions:j=[10,25,50,100],SelectProps:w={},showFirstButton:k=!1,showLastButton:P=!1,slotProps:T={},slots:$={},...M}=r,R=r,E=TG(R),O=(T==null?void 0:T.select)??w,A=O.native?"option":kG;let N;(c===lt||c==="td")&&(N=l||1e3);const F=Sn(O.id),L=Sn(O.labelId),D=()=>u===-1?(C+1)*S:S===-1?u:Math.min(u,(C+1)*S),H={slots:$,slotProps:T},[B,V]=at("root",{ref:n,className:E.root,elementType:vG,externalForwardedProps:{...H,component:c,...M},ownerState:R,additionalProps:{colSpan:N}}),[G,_]=at("toolbar",{className:E.toolbar,elementType:CG,externalForwardedProps:H,ownerState:R}),[U,Z]=at("spacer",{className:E.spacer,elementType:wG,externalForwardedProps:H,ownerState:R}),[Q,ee]=at("selectLabel",{className:E.selectLabel,elementType:SG,externalForwardedProps:H,ownerState:R,additionalProps:{id:L}}),[ne,re]=at("select",{className:E.select,elementType:jG,externalForwardedProps:H,ownerState:R}),[Y,ie]=at("menuItem",{className:E.menuItem,elementType:A,externalForwardedProps:H,ownerState:R}),[ce,he]=at("displayedRows",{className:E.displayedRows,elementType:IG,externalForwardedProps:H,ownerState:R});return s.jsx(B,{...V,children:s.jsxs(G,{..._,children:[s.jsx(U,{...Z}),j.length>1&&s.jsx(Q,{...ee,children:g}),j.length>1&&s.jsx(ne,{variant:"standard",...!O.variant&&{input:dI||(dI=s.jsx(Bd,{}))},value:S,onChange:v,id:F,labelId:L,...O,classes:{...O.classes,root:Me(E.input,E.selectRoot,(O.classes||{}).root),select:Me(E.select,(O.classes||{}).select),icon:Me(E.selectIcon,(O.classes||{}).icon)},disabled:f,...re,children:j.map(de=>m.createElement(Y,{...ie,key:de.label?de.label:de,value:de.value?de.value:de},de.label?de.label:de))}),s.jsx(ce,{...he,children:p({from:u===0?0:C*S+1,to:D(),count:u===-1?-1:u,page:C})}),s.jsx(o,{className:E.actions,backIconButtonProps:i,count:u,nextIconButtonProps:y,onPageChange:b,page:C,rowsPerPage:S,showFirstButton:k,showLastButton:P,slotProps:T.actions,slots:$.actions,getItemAriaLabel:h,disabled:f})]})})});function RG(e){return ct("MuiTableRow",e)}const fI=ut("MuiTableRow",["root","selected","hover","head","footer"]),$G=e=>{const{classes:t,selected:n,hover:r,head:o,footer:i}=e;return Be({root:["root",n&&"selected",r&&"hover",o&&"head",i&&"footer"]},RG,t)},OG=Ce("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})(tt(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${fI.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${fI.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ye(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ye(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)}}}))),pI="tr",Ur=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiTableRow"}),{className:o,component:i=pI,hover:l=!1,selected:c=!1,...u}=r,f=m.useContext(qx),h={...r,component:i,hover:l,selected:c,head:f&&f.variant==="head",footer:f&&f.variant==="footer"},p=$G(h);return s.jsx(OG,{as:i,ref:n,className:Me(p.root,o),role:i===pI?null:"row",ownerState:h,...u})});function zG(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function LG(e,t,n,r={},o=()=>{}){const{ease:i=zG,duration:l=300}=r;let c=null;const u=t[e];let f=!1;const h=()=>{f=!0},p=g=>{if(f){o(new Error("Animation cancelled"));return}c===null&&(c=g);const y=Math.min(1,(g-c)/l);if(t[e]=i(y)*(n-u)+u,y>=1){requestAnimationFrame(()=>{o(null)});return}requestAnimationFrame(p)};return u===n?(o(new Error("Element already at target position")),h):(requestAnimationFrame(p),h)}const DG={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function AG(e){const{onChange:t,...n}=e,r=m.useRef(),o=m.useRef(null),i=()=>{r.current=o.current.offsetHeight-o.current.clientHeight};return Ln(()=>{const l=gh(()=>{const u=r.current;i(),u!==r.current&&t(r.current)}),c=qo(o.current);return c.addEventListener("resize",l),()=>{l.clear(),c.removeEventListener("resize",l)}},[t]),m.useEffect(()=>{i(),t(r.current)},[t]),s.jsx("div",{style:DG,...n,ref:o})}function FG(e){return ct("MuiTabScrollButton",e)}const NG=ut("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),_G=e=>{const{classes:t,orientation:n,disabled:r}=e;return Be({root:["root",n,r&&"disabled"]},FG,t)},HG=Ce(Ds,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${NG.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),BG=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiTabScrollButton"}),{className:o,slots:i={},slotProps:l={},direction:c,orientation:u,disabled:f,...h}=r,p=Yr(),g={isRtl:p,...r},y=_G(g),b=i.StartScrollButtonIcon??wR,v=i.EndScrollButtonIcon??SR,C=zc({elementType:b,externalSlotProps:l.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:g}),S=zc({elementType:v,externalSlotProps:l.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:g});return s.jsx(HG,{component:"div",className:Me(y.root,o),ref:n,role:null,ownerState:g,tabIndex:null,...h,style:{...h.style,...u==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${p?-90:90}deg)`}},children:c==="left"?s.jsx(b,{...C}):s.jsx(v,{...S})})});function WG(e){return ct("MuiTabs",e)}const Rv=ut("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),hI=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,mI=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,ng=(e,t,n)=>{let r=!1,o=n(e,t);for(;o;){if(o===e.firstChild){if(r)return;r=!0}const i=o.disabled||o.getAttribute("aria-disabled")==="true";if(!o.hasAttribute("tabindex")||i)o=n(e,o);else{o.focus();return}}},VG=e=>{const{vertical:t,fixed:n,hideScrollbar:r,scrollableX:o,scrollableY:i,centered:l,scrollButtonsHideMobile:c,classes:u}=e;return Be({root:["root",t&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",o&&"scrollableX",i&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",l&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",c&&"scrollButtonsHideMobile"],scrollableX:[o&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},WG,u)},GG=Ce("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Rv.scrollButtons}`]:t.scrollButtons},{[`& .${Rv.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(tt(({theme:e})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.scrollButtonsHideMobile,style:{[`& .${Rv.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}}}]}))),UG=Ce("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),qG=Ce("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.list,t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.centered,style:{justifyContent:"center"}}]}),KG=Ce("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})(tt(({theme:e})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:t})=>t.vertical,style:{height:"100%",width:2,right:0}}]}))),QG=Ce(AG)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),gI={},yl=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiTabs"}),o=Xr(),i=Yr(),{"aria-label":l,"aria-labelledby":c,action:u,centered:f=!1,children:h,className:p,component:g="div",allowScrollButtonsMobile:y=!1,indicatorColor:b="primary",onChange:v,orientation:C="horizontal",ScrollButtonComponent:S,scrollButtons:j="auto",selectionFollowsFocus:w,slots:k={},slotProps:P={},TabIndicatorProps:T={},TabScrollButtonProps:$={},textColor:M="primary",value:R,variant:E="standard",visibleScrollbar:O=!1,...A}=r,N=E==="scrollable",F=C==="vertical",L=F?"scrollTop":"scrollLeft",D=F?"top":"left",H=F?"bottom":"right",B=F?"clientHeight":"clientWidth",V=F?"height":"width",G={...r,component:g,allowScrollButtonsMobile:y,indicatorColor:b,orientation:C,vertical:F,scrollButtons:j,textColor:M,variant:E,visibleScrollbar:O,fixed:!N,hideScrollbar:N&&!O,scrollableX:N&&!F,scrollableY:N&&F,centered:f&&!N,scrollButtonsHideMobile:!y},_=VG(G),U=zc({elementType:k.StartScrollButtonIcon,externalSlotProps:P.startScrollButtonIcon,ownerState:G}),Z=zc({elementType:k.EndScrollButtonIcon,externalSlotProps:P.endScrollButtonIcon,ownerState:G}),[Q,ee]=m.useState(!1),[ne,re]=m.useState(gI),[Y,ie]=m.useState(!1),[ce,he]=m.useState(!1),[de,le]=m.useState(!1),[ge,Se]=m.useState({overflow:"hidden",scrollbarWidth:0}),ke=new Map,we=m.useRef(null),Oe=m.useRef(null),be={slots:k,slotProps:{indicator:T,scrollButton:$,...P}},Fe=()=>{const Ke=we.current;let rt;if(Ke){const Lt=Ke.getBoundingClientRect();rt={clientWidth:Ke.clientWidth,scrollLeft:Ke.scrollLeft,scrollTop:Ke.scrollTop,scrollWidth:Ke.scrollWidth,top:Lt.top,bottom:Lt.bottom,left:Lt.left,right:Lt.right}}let It;if(Ke&&R!==!1){const Lt=Oe.current.children;if(Lt.length>0){const Jt=Lt[ke.get(R)];It=Jt?Jt.getBoundingClientRect():null}}return{tabsMeta:rt,tabMeta:It}},Ve=Vt(()=>{const{tabsMeta:Ke,tabMeta:rt}=Fe();let It=0,Lt;F?(Lt="top",rt&&Ke&&(It=rt.top-Ke.top+Ke.scrollTop)):(Lt=i?"right":"left",rt&&Ke&&(It=(i?-1:1)*(rt[Lt]-Ke[Lt]+Ke.scrollLeft)));const Jt={[Lt]:It,[V]:rt?rt[V]:0};if(typeof ne[Lt]!="number"||typeof ne[V]!="number")re(Jt);else{const tr=Math.abs(ne[Lt]-Jt[Lt]),kr=Math.abs(ne[V]-Jt[V]);(tr>=1||kr>=1)&&re(Jt)}}),De=(Ke,{animation:rt=!0}={})=>{rt?LG(L,we.current,Ke,{duration:o.transitions.duration.standard}):we.current[L]=Ke},Ze=Ke=>{let rt=we.current[L];F?rt+=Ke:rt+=Ke*(i?-1:1),De(rt)},Ae=()=>{const Ke=we.current[B];let rt=0;const It=Array.from(Oe.current.children);for(let Lt=0;Lt<It.length;Lt+=1){const Jt=It[Lt];if(rt+Jt[B]>Ke){Lt===0&&(rt=Ke);break}rt+=Jt[B]}return rt},st=()=>{Ze(-1*Ae())},qe=()=>{Ze(Ae())},[et,{onChange:oe,...fe}]=at("scrollbar",{className:Me(_.scrollableX,_.hideScrollbar),elementType:QG,shouldForwardComponentProp:!0,externalForwardedProps:be,ownerState:G}),Ie=m.useCallback(Ke=>{oe==null||oe(Ke),Se({overflow:null,scrollbarWidth:Ke})},[oe]),[$e,pt]=at("scrollButtons",{className:Me(_.scrollButtons,$.className),elementType:BG,externalForwardedProps:be,ownerState:G,additionalProps:{orientation:C,slots:{StartScrollButtonIcon:k.startScrollButtonIcon||k.StartScrollButtonIcon,EndScrollButtonIcon:k.endScrollButtonIcon||k.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:U,endScrollButtonIcon:Z}}}),vt=()=>{const Ke={};Ke.scrollbarSizeListener=N?s.jsx(et,{...fe,onChange:Ie}):null;const It=N&&(j==="auto"&&(Y||ce)||j===!0);return Ke.scrollButtonStart=It?s.jsx($e,{direction:i?"right":"left",onClick:st,disabled:!Y,...pt}):null,Ke.scrollButtonEnd=It?s.jsx($e,{direction:i?"left":"right",onClick:qe,disabled:!ce,...pt}):null,Ke},Je=Vt(Ke=>{const{tabsMeta:rt,tabMeta:It}=Fe();if(!(!It||!rt)){if(It[D]<rt[D]){const Lt=rt[L]+(It[D]-rt[D]);De(Lt,{animation:Ke})}else if(It[H]>rt[H]){const Lt=rt[L]+(It[H]-rt[H]);De(Lt,{animation:Ke})}}}),me=Vt(()=>{N&&j!==!1&&le(!de)});m.useEffect(()=>{const Ke=gh(()=>{we.current&&Ve()});let rt;const It=tr=>{tr.forEach(kr=>{kr.removedNodes.forEach(pr=>{rt==null||rt.unobserve(pr)}),kr.addedNodes.forEach(pr=>{rt==null||rt.observe(pr)})}),Ke(),me()},Lt=qo(we.current);Lt.addEventListener("resize",Ke);let Jt;return typeof ResizeObserver<"u"&&(rt=new ResizeObserver(Ke),Array.from(Oe.current.children).forEach(tr=>{rt.observe(tr)})),typeof MutationObserver<"u"&&(Jt=new MutationObserver(It),Jt.observe(Oe.current,{childList:!0})),()=>{Ke.clear(),Lt.removeEventListener("resize",Ke),Jt==null||Jt.disconnect(),rt==null||rt.disconnect()}},[Ve,me]),m.useEffect(()=>{const Ke=Array.from(Oe.current.children),rt=Ke.length;if(typeof IntersectionObserver<"u"&&rt>0&&N&&j!==!1){const It=Ke[0],Lt=Ke[rt-1],Jt={root:we.current,threshold:.99},tr=Kn=>{ie(!Kn[0].isIntersecting)},kr=new IntersectionObserver(tr,Jt);kr.observe(It);const pr=Kn=>{he(!Kn[0].isIntersecting)},so=new IntersectionObserver(pr,Jt);return so.observe(Lt),()=>{kr.disconnect(),so.disconnect()}}},[N,j,de,h==null?void 0:h.length]),m.useEffect(()=>{ee(!0)},[]),m.useEffect(()=>{Ve()}),m.useEffect(()=>{Je(gI!==ne)},[Je,ne]),m.useImperativeHandle(u,()=>({updateIndicator:Ve,updateScrollButtons:me}),[Ve,me]);const[Ne,xt]=at("indicator",{className:Me(_.indicator,T.className),elementType:KG,externalForwardedProps:be,ownerState:G,additionalProps:{style:ne}}),Bt=s.jsx(Ne,{...xt});let pn=0;const yn=m.Children.map(h,Ke=>{if(!m.isValidElement(Ke))return null;const rt=Ke.props.value===void 0?pn:Ke.props.value;ke.set(rt,pn);const It=rt===R;return pn+=1,m.cloneElement(Ke,{fullWidth:E==="fullWidth",indicator:It&&!Q&&Bt,selected:It,selectionFollowsFocus:w,onChange:v,textColor:M,value:rt,...pn===1&&R===!1&&!Ke.props.tabIndex?{tabIndex:0}:{}})}),hn=Ke=>{if(Ke.altKey||Ke.shiftKey||Ke.ctrlKey||Ke.metaKey)return;const rt=Oe.current,It=ir(rt).activeElement;if(It.getAttribute("role")!=="tab")return;let Jt=C==="horizontal"?"ArrowLeft":"ArrowUp",tr=C==="horizontal"?"ArrowRight":"ArrowDown";switch(C==="horizontal"&&i&&(Jt="ArrowRight",tr="ArrowLeft"),Ke.key){case Jt:Ke.preventDefault(),ng(rt,It,mI);break;case tr:Ke.preventDefault(),ng(rt,It,hI);break;case"Home":Ke.preventDefault(),ng(rt,null,hI);break;case"End":Ke.preventDefault(),ng(rt,null,mI);break}},ln=vt(),[An,kt]=at("root",{ref:n,className:Me(_.root,p),elementType:GG,externalForwardedProps:{...be,...A,component:g},ownerState:G}),[un,er]=at("scroller",{ref:we,className:_.scroller,elementType:UG,externalForwardedProps:be,ownerState:G,additionalProps:{style:{overflow:ge.overflow,[F?`margin${i?"Left":"Right"}`:"marginBottom"]:O?void 0:-ge.scrollbarWidth}}}),[yt,Ht]=at("list",{ref:Oe,className:Me(_.list,_.flexContainer),elementType:qG,externalForwardedProps:be,ownerState:G,getSlotProps:Ke=>({...Ke,onKeyDown:rt=>{var It;hn(rt),(It=Ke.onKeyDown)==null||It.call(Ke,rt)}})});return s.jsxs(An,{...kt,children:[ln.scrollButtonStart,ln.scrollbarSizeListener,s.jsxs(un,{...er,children:[s.jsx(yt,{"aria-label":l,"aria-labelledby":c,"aria-orientation":C==="vertical"?"vertical":null,role:"tablist",...Ht,children:yn}),Q&&Bt]}),ln.scrollButtonEnd]})});function YG(e){return ct("MuiTextField",e)}ut("MuiTextField",["root"]);const XG={standard:Tw,filled:Pw,outlined:$w},ZG=e=>{const{classes:t}=e;return Be({root:["root"]},YG,t)},JG=Ce(_n,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Wt=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiTextField"}),{autoComplete:o,autoFocus:i=!1,children:l,className:c,color:u="primary",defaultValue:f,disabled:h=!1,error:p=!1,FormHelperTextProps:g,fullWidth:y=!1,helperText:b,id:v,InputLabelProps:C,inputProps:S,InputProps:j,inputRef:w,label:k,maxRows:P,minRows:T,multiline:$=!1,name:M,onBlur:R,onChange:E,onFocus:O,placeholder:A,required:N=!1,rows:F,select:L=!1,SelectProps:D,slots:H={},slotProps:B={},type:V,value:G,variant:_="outlined",...U}=r,Z={...r,autoFocus:i,color:u,disabled:h,error:p,fullWidth:y,multiline:$,required:N,select:L,variant:_},Q=ZG(Z),ee=Sn(v),ne=b&&ee?`${ee}-helper-text`:void 0,re=k&&ee?`${ee}-label`:void 0,Y=XG[_],ie={slots:H,slotProps:{input:j,inputLabel:C,htmlInput:S,formHelperText:g,select:D,...B}},ce={},he=ie.slotProps.inputLabel;_==="outlined"&&(he&&typeof he.shrink<"u"&&(ce.notched=he.shrink),ce.label=k),L&&((!D||!D.native)&&(ce.id=void 0),ce["aria-describedby"]=void 0);const[de,le]=at("root",{elementType:JG,shouldForwardComponentProp:!0,externalForwardedProps:{...ie,...U},ownerState:Z,className:Me(Q.root,c),ref:n,additionalProps:{disabled:h,error:p,fullWidth:y,required:N,color:u,variant:_}}),[ge,Se]=at("input",{elementType:Y,externalForwardedProps:ie,additionalProps:ce,ownerState:Z}),[ke,we]=at("inputLabel",{elementType:Hn,externalForwardedProps:ie,ownerState:Z}),[Oe,be]=at("htmlInput",{elementType:"input",externalForwardedProps:ie,ownerState:Z}),[Fe,Ve]=at("formHelperText",{elementType:RW,externalForwardedProps:ie,ownerState:Z}),[De,Ze]=at("select",{elementType:On,externalForwardedProps:ie,ownerState:Z}),Ae=s.jsx(ge,{"aria-describedby":ne,autoComplete:o,autoFocus:i,defaultValue:f,fullWidth:y,multiline:$,name:M,rows:F,maxRows:P,minRows:T,type:V,value:G,id:ee,inputRef:w,onBlur:R,onChange:E,onFocus:O,placeholder:A,inputProps:be,slots:{input:H.htmlInput?Oe:void 0},...Se});return s.jsxs(de,{...le,children:[k!=null&&k!==""&&s.jsx(ke,{htmlFor:ee,id:re,...we,children:k}),L?s.jsx(De,{"aria-describedby":ne,id:ee,labelId:re,value:G,input:Ae,...Ze,children:l}):Ae,b&&s.jsx(Fe,{id:ne,...Ve,children:b})]})});function eU(e){return ct("MuiToggleButton",e)}const hc=ut("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),jR=m.createContext({}),kR=m.createContext(void 0);function tU(e,t){return t===void 0||e===void 0?!1:Array.isArray(t)?t.includes(e):e===t}const nU=e=>{const{classes:t,fullWidth:n,selected:r,disabled:o,size:i,color:l}=e,c={root:["root",r&&"selected",o&&"disabled",n&&"fullWidth",`size${Pe(i)}`,l]};return Be(c,eU,t)},rU=Ce(Ds,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`size${Pe(n.size)}`]]}})(tt(({theme:e})=>({...e.typography.button,borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active,[`&.${hc.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Ye(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${hc.selected}`]:{color:(e.vars||e).palette.text.primary,backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.selectedOpacity})`:Ye(e.palette.text.primary,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ye(e.palette.text.primary,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.selectedOpacity})`:Ye(e.palette.text.primary,e.palette.action.selectedOpacity)}}}}},...Object.entries(e.palette).filter(qn()).map(([t])=>({props:{color:t},style:{[`&.${hc.selected}`]:{color:(e.vars||e).palette[t].main,backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ye(e.palette[t].main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ye(e.palette[t].main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ye(e.palette[t].main,e.palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:e.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:e.typography.pxToRem(15)}}]}))),li=m.forwardRef(function(t,n){const{value:r,...o}=m.useContext(jR),i=m.useContext(kR),l=Oc({...o,selected:tU(t.value,r)},t),c=ft({props:l,name:"MuiToggleButton"}),{children:u,className:f,color:h="standard",disabled:p=!1,disableFocusRipple:g=!1,fullWidth:y=!1,onChange:b,onClick:v,selected:C,size:S="medium",value:j,...w}=c,k={...c,color:h,disabled:p,disableFocusRipple:g,fullWidth:y,size:S},P=nU(k),T=M=>{v&&(v(M,j),M.defaultPrevented)||b&&b(M,j)},$=i||"";return s.jsx(rU,{className:Me(o.className,P.root,f,$),disabled:p,focusRipple:!g,ref:n,onClick:T,onChange:b,value:j,ownerState:k,"aria-pressed":C,...w,children:u})});function oU(e){return ct("MuiToggleButtonGroup",e)}const Zn=ut("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),sU=e=>{const{classes:t,orientation:n,fullWidth:r,disabled:o}=e,i={root:["root",n,r&&"fullWidth"],grouped:["grouped",`grouped${Pe(n)}`,o&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return Be(i,oU,t)},iU=Ce("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Zn.grouped}`]:t.grouped},{[`& .${Zn.grouped}`]:t[`grouped${Pe(n.orientation)}`]},{[`& .${Zn.firstButton}`]:t.firstButton},{[`& .${Zn.lastButton}`]:t.lastButton},{[`& .${Zn.middleButton}`]:t.middleButton},t.root,n.orientation==="vertical"&&t.vertical,n.fullWidth&&t.fullWidth]}})(tt(({theme:e})=>({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${Zn.grouped}`]:{[`&.${Zn.selected} + .${Zn.grouped}.${Zn.selected}`]:{borderTop:0,marginTop:0}},[`& .${Zn.firstButton},& .${Zn.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${Zn.lastButton},& .${Zn.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${Zn.lastButton}.${hc.disabled},& .${Zn.middleButton}.${hc.disabled}`]:{borderTop:"1px solid transparent"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"horizontal"},style:{[`& .${Zn.grouped}`]:{[`&.${Zn.selected} + .${Zn.grouped}.${Zn.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${Zn.firstButton},& .${Zn.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${Zn.lastButton},& .${Zn.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${Zn.lastButton}.${hc.disabled},& .${Zn.middleButton}.${hc.disabled}`]:{borderLeft:"1px solid transparent"}}}]}))),Kx=m.forwardRef(function(t,n){const r=ft({props:t,name:"MuiToggleButtonGroup"}),{children:o,className:i,color:l="standard",disabled:c=!1,exclusive:u=!1,fullWidth:f=!1,onChange:h,orientation:p="horizontal",size:g="medium",value:y,...b}=r,v={...r,disabled:c,fullWidth:f,orientation:p,size:g},C=sU(v),S=m.useCallback(($,M)=>{if(!h)return;const R=y&&y.indexOf(M);let E;y&&R>=0?(E=y.slice(),E.splice(R,1)):E=y?y.concat(M):[M],h($,E)},[h,y]),j=m.useCallback(($,M)=>{h&&h($,y===M?null:M)},[h,y]),w=m.useMemo(()=>({className:C.grouped,onChange:u?j:S,value:y,size:g,fullWidth:f,color:l,disabled:c}),[C.grouped,u,j,S,y,g,f,l,c]),k=A4(o),P=k.length,T=$=>{const M=$===0,R=$===P-1;return M&&R?"":M?C.firstButton:R?C.lastButton:C.middleButton};return s.jsx(iU,{role:"group",className:Me(C.root,i),ref:n,ownerState:v,...b,children:s.jsx(jR.Provider,{value:w,children:k.map(($,M)=>s.jsx(kR.Provider,{value:T(M),children:$},M))})})}),oo=Aa(e=>({toasts:[],addToast:(t,n="info",r=4e3)=>{const o=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`;e(i=>({toasts:[...i.toasts,{id:o,message:t,severity:n,duration:r}]}))},removeToast:t=>{e(n=>({toasts:n.toasts.filter(r=>r.id!==t)}))},success:(t,n)=>{const r=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`;e(o=>({toasts:[...o.toasts,{id:r,message:t,severity:"success",duration:n??4e3}]}))},error:(t,n)=>{const r=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`;e(o=>({toasts:[...o.toasts,{id:r,message:t,severity:"error",duration:n??6e3}]}))},warning:(t,n)=>{const r=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`;e(o=>({toasts:[...o.toasts,{id:r,message:t,severity:"warning",duration:n??5e3}]}))},info:(t,n)=>{const r=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`;e(o=>({toasts:[...o.toasts,{id:r,message:t,severity:"info",duration:n??4e3}]}))}}));function lU(e){return s.jsx(fR,{...e,direction:"up"})}function aU(){const{toasts:e,removeToast:t}=oo();return s.jsx(s.Fragment,{children:e.map((n,r)=>s.jsx(zV,{open:!0,autoHideDuration:n.duration,onClose:()=>t(n.id),anchorOrigin:{vertical:"bottom",horizontal:"right"},TransitionComponent:lU,sx:{bottom:{xs:24+r*60,sm:24+r*60}},children:s.jsx(Nt,{onClose:()=>t(n.id),severity:n.severity,variant:"filled",sx:{width:"100%",minWidth:280,boxShadow:3,"& .MuiAlert-message":{fontSize:14}},children:n.message})},n.id))})}const IR=_e(s.jsx("path",{d:"M3 13h8V3H3zm0 8h8v-6H3zm10 0h8V11h-8zm0-18v6h8V3z"}),"Dashboard"),Cr=_e(s.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"}),"Storage"),cU=_e(s.jsx("path",{d:"M20 4H4c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2m0 14H4V8h16zm-2-1h-6v-2h6zM7.5 17l-1.41-1.41L8.67 13l-2.59-2.59L7.5 9l4 4z"}),"Terminal"),Wd=_e(s.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings"),uU=_e(s.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),dU=_e(s.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),fs=_e(s.jsx("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"}),"Sync"),Ap=_e(s.jsx("path",{d:"m11.99 18.54-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27z"}),"Layers"),bl=_e(s.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),Ac=_e(s.jsx("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess"),bd=_e(s.jsx("path",{d:"M9.01 14H2v2h7.01v3L13 15l-3.99-4zm5.98-1v-3H22V8h-7.01V5L11 9z"}),"CompareArrows"),vd=_e(s.jsx("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8z"}),"History"),zw=_e(s.jsx("path",{d:"M22 11V3h-7v3H9V3H2v8h7V8h2v10h4v3h7v-8h-7v3h-2V8h2v3z"}),"AccountTree"),Lw=_e(s.jsx("path",{d:"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}),"Folder"),fU="/api";async function $t(e,t){const n=await fetch(`${fU}${e}`,{...t,headers:{"Content-Type":"application/json",...t==null?void 0:t.headers}});if(!n.ok){const r=await n.json().catch(()=>({message:"Request failed"}));throw new Error(r.message||`HTTP ${n.status}`)}return n.json()}const Qr={getAll:()=>$t("/connections"),getById:e=>$t(`/connections/${e}`),create:e=>$t("/connections",{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>$t(`/connections/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>$t(`/connections/${e}`,{method:"DELETE"}),test:e=>$t(`/connections/${e}/test`,{method:"POST"}),testSettings:e=>$t("/connections/test",{method:"POST",body:JSON.stringify(e)}),connect:e=>$t(`/connections/${e}/connect`,{method:"POST"}),disconnect:e=>$t(`/connections/${e}/disconnect`,{method:"POST"}),getStatus:e=>$t(`/connections/${e}/status`)},mo={execute:(e,t,n)=>$t("/queries/execute",{method:"POST",body:JSON.stringify({connectionId:e,sql:t,confirmed:n})}),validate:(e,t)=>$t("/queries/validate",{method:"POST",body:JSON.stringify({connectionId:e,sql:t})}),getSaved:()=>$t("/queries/saved"),getSavedById:e=>$t(`/queries/saved/${e}`),createSaved:e=>$t("/queries/saved",{method:"POST",body:JSON.stringify(e)}),updateSaved:(e,t)=>$t(`/queries/saved/${e}`,{method:"PUT",body:JSON.stringify(t)}),deleteSaved:e=>$t(`/queries/saved/${e}`,{method:"DELETE"}),getHistory:(e,t)=>{const n=new URLSearchParams;return e&&n.set("connectionId",e),t&&n.set("limit",String(t)),$t(`/queries/history?${n}`)},clearHistory:e=>{const t=e?`?connectionId=${e}`:"";return $t(`/queries/history${t}`,{method:"DELETE"})}},xn={getSchemas:e=>$t(`/schema/${e}/schemas`),createSchema:(e,t)=>$t(`/schema/${e}/schemas`,{method:"POST",body:JSON.stringify({name:t})}),deleteSchema:(e,t)=>$t(`/schema/${e}/schemas/${t}`,{method:"DELETE"}),getTables:(e,t)=>{const n=t?`?schema=${t}`:"";return $t(`/schema/${e}/tables${n}`)},getTableSchema:(e,t,n)=>$t(`/schema/${e}/tables/${t}/${n}`),getTableRowCount:(e,t,n)=>$t(`/schema/${e}/tables/${t}/${n}/count`),getServerVersion:e=>$t(`/schema/${e}/version`),compareSchemasApi:(e,t,n,r)=>{const o=new URLSearchParams;return n&&o.set("sourceSchema",n),r&&o.set("targetSchema",r),$t(`/schema/diff/${e}/${t}?${o}`)},getMigrationSql:(e,t,n,r)=>{const o=new URLSearchParams;return n&&o.set("sourceSchema",n),r&&o.set("targetSchema",r),$t(`/schema/diff/${e}/${t}/sql?${o}`)},applyMigration:(e,t,n,r,o)=>{const i=new URLSearchParams;return n&&i.set("sourceSchema",n),r&&i.set("targetSchema",r),$t(`/schema/diff/${e}/${t}/apply?${i}`,{method:"POST",body:JSON.stringify({description:o})})},getMigrationHistory:e=>{const t=new URLSearchParams;return e!=null&&e.targetConnectionId&&t.set("targetConnectionId",e.targetConnectionId),e!=null&&e.limit&&t.set("limit",String(e.limit)),$t(`/schema/migrations?${t}`)},getMigration:e=>$t(`/schema/migrations/${e}`),deleteMigration:e=>$t(`/schema/migrations/${e}`,{method:"DELETE"})},pi={getAll:()=>$t("/projects"),getById:e=>$t(`/projects/${e}`),create:e=>$t("/projects",{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>$t(`/projects/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>$t(`/projects/${e}`,{method:"DELETE"}),getGroups:e=>$t(`/projects/${e}/groups`),createGroup:(e,t)=>$t(`/projects/${e}/groups`,{method:"POST",body:JSON.stringify(t)}),updateGroup:(e,t,n)=>$t(`/projects/${e}/groups/${t}`,{method:"PUT",body:JSON.stringify(n)}),deleteGroup:(e,t)=>$t(`/projects/${e}/groups/${t}`,{method:"DELETE"}),getProjectConnections:e=>$t(`/projects/${e}/connections`),getGroupConnections:(e,t)=>$t(`/projects/${e}/groups/${t}/connections`)},Cd={getAll:e=>{const t=e?`?projectId=${e}`:"";return $t(`/groups${t}`)},getById:e=>$t(`/groups/${e}`),getConnections:e=>$t(`/groups/${e}/connections`)},ai={getGroupSyncStatus:e=>$t(`/sync/groups/${e}/status`),checkSingleTargetStatus:(e,t)=>$t(`/sync/groups/${e}/status/${t}`),getSyncEnabledGroups:()=>$t("/sync/groups"),getTableRowCounts:(e,t,n="public")=>$t(`/sync/data/${e}/${t}/counts?schema=${n}`),getTableDataDiff:(e,t,n,r,o)=>$t(`/sync/data/${e}/${t}/diff/${n}/${r}?primaryKeys=${o.join(",")}`),syncTableData:(e,t,n,r,o)=>$t(`/sync/data/${e}/${t}/sync/${n}/${r}`,{method:"POST",body:JSON.stringify(o)}),syncAllTables:(e,t,n="public",r)=>$t(`/sync/groups/${e}/sync-all?targetConnectionId=${t}&schema=${n}`,{method:"POST",body:JSON.stringify(r||{})}),syncRows:(e,t,n,r,o,i,l,c="upsert")=>$t(`/sync/rows/${t}/${encodeURIComponent(r)}/${encodeURIComponent(o)}`,{method:"POST",body:JSON.stringify({sourceConnectionId:e,sourceSchema:n,rowIds:i,primaryKeys:l,mode:c})}),dumpAndRestore:(e,t,n="public",r)=>$t(`/sync/dump-restore/${e}/${t}?schema=${encodeURIComponent(n)}`,{method:"POST",body:JSON.stringify(r||{})})},$v=[{key:"Enter",ctrl:!0,description:"Run query",category:"query"},{key:"Enter",ctrl:!0,shift:!0,description:"Run query (force)",category:"query"},{key:"/",ctrl:!0,description:"Toggle comment",category:"query"},{key:"f",ctrl:!0,shift:!0,description:"Format SQL",category:"query"},{key:"1",ctrl:!0,description:"Go to Dashboard",category:"navigation"},{key:"2",ctrl:!0,description:"Go to Projects",category:"navigation"},{key:"3",ctrl:!0,description:"Go to Query",category:"navigation"},{key:"4",ctrl:!0,description:"Go to Schema Diagram",category:"navigation"},{key:"5",ctrl:!0,description:"Go to Compare",category:"navigation"},{key:"6",ctrl:!0,description:"Go to Logs",category:"navigation"},{key:"7",ctrl:!0,description:"Go to Settings",category:"navigation"},{key:"k",ctrl:!0,description:"Quick search (coming soon)",category:"general"},{key:"Escape",description:"Close dialog / Cancel",category:"general"}];function pU(e){const t=[],n=typeof navigator<"u"&&navigator.platform.toUpperCase().indexOf("MAC")>=0;e.ctrl&&t.push(n?"⌘":"Ctrl"),e.shift&&t.push(n?"⇧":"Shift"),e.alt&&t.push(n?"⌥":"Alt");let r=e.key;return r==="Enter"?r="↵":r==="Escape"?r="Esc":r==="/"?r="/":r=r.toUpperCase(),t.push(r),t.join(n?"":"+")}function hU(e){const t=m.useCallback(n=>{const r=n.target,o=r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable;for(const i of e){if(i.enabled===!1)continue;const l=i.ctrl?n.ctrlKey||n.metaKey:!n.ctrlKey&&!n.metaKey,c=i.shift?n.shiftKey:!n.shiftKey,u=i.alt?n.altKey:!n.altKey,f=n.key.toLowerCase()===i.key.toLowerCase();if(l&&c&&u&&f){if(o&&!(i.ctrl&&i.key.toLowerCase()==="enter"))continue;n.preventDefault(),i.handler();return}}},[e]);m.useEffect(()=>(window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)),[t])}function mU(e){hU([{key:"1",ctrl:!0,handler:()=>e("/dashboard")},{key:"2",ctrl:!0,handler:()=>e("/projects")},{key:"3",ctrl:!0,handler:()=>e("/query")},{key:"4",ctrl:!0,handler:()=>e("/schema-diagram")},{key:"5",ctrl:!0,handler:()=>e("/compare")},{key:"6",ctrl:!0,handler:()=>e("/logs")},{key:"7",ctrl:!0,handler:()=>e("/settings")}])}const gU=30*1e3,Vd=Aa((e,t)=>({healthStatus:{},isChecking:!1,checkConnection:async n=>{const r=t().healthStatus[n];if(r&&Date.now()-r.lastChecked<gU)return r.isOnline;try{const o=await Qr.test(n),i=o.success;return e(l=>({healthStatus:{...l.healthStatus,[n]:{isOnline:i,lastChecked:Date.now(),error:i?void 0:o.message}}})),i}catch(o){const i=o instanceof Error?o.message:"Connection failed";return e(l=>({healthStatus:{...l.healthStatus,[n]:{isOnline:!1,lastChecked:Date.now(),error:i}}})),!1}},checkAllConnections:async n=>{e({isChecking:!0}),await Promise.allSettled(n.map(r=>t().checkConnection(r))),e({isChecking:!1})},getHealth:n=>t().healthStatus[n],isOnline:n=>{const r=t().healthStatus[n];return r?r.isOnline:!0},clearHealth:n=>{e(r=>{const{[n]:o,...i}=r.healthStatus;return{healthStatus:i}})},clearAll:()=>{e({healthStatus:{}})}})),nc=Ce(({className:e,...t})=>s.jsx(Pt,{...t,classes:{popper:e}}))(({theme:e})=>({"& .MuiTooltip-tooltip":{backgroundColor:e.palette.background.paper,color:e.palette.text.primary,border:`1px solid ${e.palette.divider}`,fontSize:13,fontWeight:500,padding:"8px 12px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},"& .MuiTooltip-arrow":{color:e.palette.background.paper,"&::before":{border:`1px solid ${e.palette.divider}`}}})),xU=260,yU=64,bU=Aa()(xh(e=>({collapsed:!1,syncExpanded:!0,connectionsExpanded:!0,toggle:()=>e(t=>({collapsed:!t.collapsed})),toggleSync:()=>e(t=>({syncExpanded:!t.syncExpanded})),toggleConnections:()=>e(t=>({connectionsExpanded:!t.connectionsExpanded}))}),{name:"dbnexus-sidebar"})),vU=[{to:"/dashboard",icon:s.jsx(IR,{}),label:"Dashboard"},{to:"/projects",icon:s.jsx(Lw,{}),label:"Projects"},{to:"/query",icon:s.jsx(cU,{}),label:"Query"},{to:"/schema-diagram",icon:s.jsx(zw,{}),label:"Schema Diagram"},{to:"/compare",icon:s.jsx(bd,{}),label:"Compare"},{to:"/logs",icon:s.jsx(vd,{}),label:"Logs"}];function CU(){const e=_i(),t=Ko(),n=Xr(),{collapsed:r,syncExpanded:o,connectionsExpanded:i,toggle:l,toggleSync:c,toggleConnections:u}=bU(),f=r?yU:xU,h=hw[n.palette.mode],[p,g]=m.useState([]),[y,b]=m.useState(!0),[v,C]=m.useState(null),[S,j]=m.useState([]),[w,k]=m.useState(!0),[P,T]=m.useState(null),{healthStatus:$,checkAllConnections:M}=Vd();mU(t),m.useEffect(()=>{Promise.all([Cd.getAll(),Qr.getAll()]).then(([O,A])=>{const N=A.reduce((L,D)=>(D.groupId&&(L[D.groupId]=(L[D.groupId]||0)+1),L),{}),F=O.filter(L=>(N[L.id]||0)>1);g(F),j(A),M(A.map(L=>L.id))}).catch(()=>{g([]),j([])}).finally(()=>{b(!1),k(!1)})},[M]);const R=e.pathname.startsWith("/groups/")&&e.pathname.includes("/sync"),E=e.pathname.startsWith("/connections/");return s.jsxs(K,{sx:{display:"flex",height:"100vh"},children:[s.jsxs(tC,{variant:"permanent",sx:{width:f,flexShrink:0,transition:"width 0.2s ease","& .MuiDrawer-paper":{width:f,boxSizing:"border-box",bgcolor:"background.paper",transition:"width 0.2s ease",overflowX:"hidden",display:"flex",flexDirection:"column"}},children:[s.jsxs(K,{sx:{px:1,py:1,display:"flex",alignItems:"center",gap:1,justifyContent:r?"center":"flex-start"},children:[s.jsx(K,{component:"img",src:n.palette.mode==="dark"?"/logo-dark.svg":"/logo-light.svg",alt:"DB Nexus",sx:{width:r?40:66,height:r?40:66,transition:"all 0.2s ease"}}),!r&&s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:.5},children:[s.jsx(J,{sx:{fontFamily:"'JetBrains Mono', monospace",fontWeight:700,fontSize:"1.2rem",color:h.primary,bgcolor:`rgba(${h.primaryRgb}, 0.1)`,paddingX:.75,py:.25,borderRadius:.5},children:"DB"}),s.jsx(J,{sx:{fontFamily:"'JetBrains Mono', monospace",fontWeight:600,fontSize:"1.2rem",color:"text.primary"},children:"Nexus"})]})]}),s.jsx(Ho,{}),s.jsx(_u,{disablePadding:!0,sx:{px:r?1:1.5,pt:2},children:vU.map(({to:O,icon:A,label:N})=>{const F=e.pathname===O||e.pathname.startsWith(O+"/");return s.jsx(nc,{title:r?N:"",placement:"right",arrow:!0,children:s.jsxs(tl,{component:R0,to:O,selected:F,sx:{mb:.5,justifyContent:r?"center":"flex-start",px:r?1.5:2},children:[s.jsx(Rn,{sx:{minWidth:r?0:40,color:F?"primary.main":"text.secondary"},children:A}),!r&&s.jsx($n,{primary:N})]})},O)})}),s.jsxs(K,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",px:r?1:1.5,pb:0},children:[!r&&p.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ho,{sx:{my:.5}}),s.jsxs(tl,{onClick:c,sx:{px:2},selected:R,children:[s.jsx(Rn,{sx:{minWidth:40,color:R?"primary.main":"text.secondary"},children:s.jsx(fs,{})}),s.jsx($n,{primary:"Instance Sync",primaryTypographyProps:{fontSize:14}}),o?s.jsx(Ac,{fontSize:"small"}):s.jsx(bl,{fontSize:"small"})]}),s.jsx(Di,{in:o,children:s.jsx(_u,{disablePadding:!0,children:y?s.jsx(K,{sx:{py:2,textAlign:"center"},children:s.jsx(At,{size:16})}):p.map(O=>{const A=`/groups/${O.id}/sync`,N=e.pathname===A;return s.jsxs(tl,{onClick:()=>t(A),selected:N,sx:{pl:4,py:.75},children:[s.jsx(Rn,{sx:{minWidth:32},children:s.jsx(Ap,{sx:{fontSize:18,color:N?"primary.main":"text.disabled"}})}),s.jsx($n,{primary:O.name,primaryTypographyProps:{fontSize:13,noWrap:!0},secondary:O.projectName,secondaryTypographyProps:{fontSize:11,noWrap:!0}})]},O.id)})})})]}),r&&p.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(nc,{title:"Instance Sync",placement:"right",arrow:!0,children:s.jsx(tl,{onClick:O=>C(O.currentTarget),selected:R,sx:{justifyContent:"center",px:1.5},children:s.jsx(Rn,{sx:{minWidth:0,color:R?"primary.main":"text.secondary"},children:s.jsx(fs,{})})})}),s.jsxs(Ra,{anchorEl:v,open:!!v,onClose:()=>C(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[s.jsx(J,{variant:"caption",sx:{px:2,py:1,display:"block",color:"text.secondary"},children:"Instance Sync Groups"}),s.jsx(Ho,{}),p.map(O=>{const A=`/groups/${O.id}/sync`,N=e.pathname===A;return s.jsxs(it,{onClick:()=>{t(A),C(null)},selected:N,sx:{minWidth:180},children:[s.jsx(Rn,{sx:{minWidth:32},children:s.jsx(Ap,{sx:{fontSize:18,color:N?"primary.main":"text.disabled"}})}),s.jsx($n,{primary:O.name,secondary:O.projectName,primaryTypographyProps:{fontSize:13},secondaryTypographyProps:{fontSize:11}})]},O.id)})]})]}),!r&&S.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ho,{sx:{my:.5}}),s.jsxs(tl,{onClick:u,sx:{px:2,mb:0},selected:E,children:[s.jsx(Rn,{sx:{minWidth:40,color:E?"primary.main":"text.secondary"},children:s.jsx(Cr,{})}),s.jsx($n,{primary:"Connections",primaryTypographyProps:{fontSize:14}}),i?s.jsx(Ac,{fontSize:"small"}):s.jsx(bl,{fontSize:"small"})]}),s.jsx(Di,{in:i,children:s.jsx(_u,{disablePadding:!0,children:w?s.jsx(K,{sx:{py:2,textAlign:"center"},children:s.jsx(At,{size:16})}):S.map(O=>{const A=`/connections/${O.id}`,N=e.pathname===A,F=$[O.id],L=F?!F.isOnline:!1,D=(F==null?void 0:F.isOnline)??!1;return s.jsx(nc,{title:L?"Offline":"",placement:"right",arrow:!0,children:s.jsx("span",{children:s.jsxs(tl,{onClick:()=>t(A),selected:N,disabled:L,sx:{pl:4,py:.75,opacity:L?.5:1},children:[s.jsx(K,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:D?"success.main":L?"error.main":"text.disabled",ml:1,mr:2,flexShrink:0}}),s.jsx($n,{primary:O.name,primaryTypographyProps:{fontSize:13,noWrap:!0},secondary:O.engine,secondaryTypographyProps:{fontSize:11,noWrap:!0}})]})})},O.id)})})})]}),r&&S.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(nc,{title:"Connections",placement:"right",arrow:!0,children:s.jsx(tl,{onClick:O=>T(O.currentTarget),selected:E,sx:{justifyContent:"center",px:1.5},children:s.jsx(Rn,{sx:{minWidth:0,color:E?"primary.main":"text.secondary"},children:s.jsx(Cr,{})})})}),s.jsxs(Ra,{anchorEl:P,open:!!P,onClose:()=>T(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[s.jsx(J,{variant:"caption",sx:{px:2,py:1,display:"block",color:"text.secondary"},children:"Connections"}),s.jsx(Ho,{}),S.map(O=>{const A=`/connections/${O.id}`,N=e.pathname===A,F=$[O.id],L=F?!F.isOnline:!1,D=(F==null?void 0:F.isOnline)??!1;return s.jsx(nc,{title:L?"Offline":"",placement:"right",arrow:!0,children:s.jsx("span",{children:s.jsxs(it,{onClick:()=>{L||(t(A),T(null))},selected:N,disabled:L,sx:{minWidth:180,opacity:L?.5:1},children:[s.jsx(K,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:D?"success.main":L?"error.main":"text.disabled",ml:1,mr:2,flexShrink:0}}),s.jsx($n,{primary:O.name,secondary:O.engine,primaryTypographyProps:{fontSize:13},secondaryTypographyProps:{fontSize:11}})]})})},O.id)})]})]})]}),s.jsx(Ho,{}),s.jsx(_u,{sx:{px:r?1:1.5,py:1},children:s.jsx(nc,{title:r?"Settings":"",placement:"right",arrow:!0,children:s.jsxs(tl,{component:R0,to:"/settings",selected:e.pathname==="/settings",sx:{justifyContent:r?"center":"flex-start",px:r?1.5:2},children:[s.jsx(Rn,{sx:{minWidth:r?0:40,color:e.pathname==="/settings"?"primary.main":"text.secondary"},children:s.jsx(Wd,{})}),!r&&s.jsx($n,{primary:"Settings"})]})})}),s.jsx(K,{sx:{p:1,borderTop:"1px solid",borderColor:"divider",display:"flex",justifyContent:r?"center":"flex-end"},children:s.jsx(nc,{title:r?"Expand sidebar":"Collapse sidebar",placement:"right",arrow:!0,children:s.jsx(mt,{size:"small",onClick:l,sx:{color:"text.secondary"},children:r?s.jsx(dU,{}):s.jsx(uU,{})})})})]}),s.jsx(K,{component:"main",sx:{flexGrow:1,bgcolor:"background.default",overflow:"auto"},children:s.jsx(LF,{})})]})}const wU=_e([s.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),s.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime"),Gn=_e(s.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),ER=_e(s.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack"),xI=_e(s.jsx("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward"),SU=_e(s.jsx("path",{d:"M11 21h-1l1-7H7.5c-.58 0-.57-.32-.38-.66s.05-.08.07-.12C8.48 10.94 10.42 7.54 13 3h1l-1 7h3.5c.49 0 .56.33.47.51l-.07.15C12.96 17.55 11 21 11 21"}),"Bolt"),Fp=_e(s.jsx("path",{d:"M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2"}),"Bookmark"),jU=_e(s.jsx("path",{d:"M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2m0 15-5-2.18L7 18V5h10z"}),"BookmarkBorder"),Dw=_e(s.jsx("path",{d:"m22.7 19-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4"}),"Build"),kU=_e(s.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel"),vl=_e(s.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),Il=_e(s.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle"),IU=_e(s.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2"}),"Circle"),Ov=_e(s.jsx("path",{d:"M16 11h-1V3c0-1.1-.9-2-2-2h-2c-1.1 0-2 .9-2 2v8H8c-2.76 0-5 2.24-5 5v7h18v-7c0-2.76-2.24-5-5-5m3 10h-2v-3c0-.55-.45-1-1-1s-1 .45-1 1v3h-2v-3c0-.55-.45-1-1-1s-1 .45-1 1v3H9v-3c0-.55-.45-1-1-1s-1 .45-1 1v3H5v-5c0-1.65 1.35-3 3-3h8c1.65 0 3 1.35 3 3z"}),"CleaningServices"),Aw=_e(s.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear"),Gd=_e(s.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Fc=_e(s.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"Code"),Oa=_e(s.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy"),EU=_e(s.jsx("path",{d:"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"}),"DarkMode"),dr=_e(s.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),PU=_e(s.jsx("path",{d:"M15 16h4v2h-4zm0-8h7v2h-7zm0 4h6v2h-6zM3 18c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V8H3zM14 5h-3l-1-1H6L5 5H2v2h12z"}),"DeleteSweep"),Sp=_e(s.jsx("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}),"Download"),TU=_e(s.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator"),Dr=_e(s.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),MU=_e(s.jsx("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 4-8 5-8-5V6l8 5 8-5z"}),"Email"),Na=_e(s.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),RU=_e(s.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline"),$U=_e(s.jsx("path",{d:"M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z"}),"Fullscreen"),OU=_e(s.jsx("path",{d:"M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"}),"FullscreenExit"),zU=_e(s.jsx("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub"),$i=_e(s.jsx("path",{fillRule:"evenodd",d:"M3 3v8h8V3zm6 6H5V5h4zm-6 4v8h8v-8zm6 6H5v-4h4zm4-16v8h8V3zm6 6h-4V5h4zm-6 4v8h8v-8zm6 6h-4v-4h4z"}),"GridView"),Qx=_e(s.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),LU=_e(s.jsx("path",{d:"M8.4 18.2c.38.5.6 1.12.6 1.8 0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3c.44 0 .85.09 1.23.26l1.41-1.77c-.92-1.03-1.29-2.39-1.09-3.69l-2.03-.68c-.54.83-1.46 1.38-2.52 1.38-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3c0 .07 0 .14-.01.21l2.03.68c.64-1.21 1.82-2.09 3.22-2.32V5.91C9.96 5.57 9 4.4 9 3c0-1.66 1.34-3 3-3s3 1.34 3 3c0 1.4-.96 2.57-2.25 2.91v2.16c1.4.23 2.58 1.11 3.22 2.32L18 9.71V9.5c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3c-1.06 0-1.98-.55-2.52-1.37l-2.03.68c.2 1.29-.16 2.65-1.09 3.69l1.41 1.77Q17.34 17 18 17c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3c0-.68.22-1.3.6-1.8l-1.41-1.77c-1.35.75-3.01.76-4.37 0z"}),"Hub"),DU=_e(s.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),ri=_e(s.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"}),"Key"),AU=_e(s.jsx("path",{d:"M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m-9 3h2v2h-2zm0 3h2v2h-2zM8 8h2v2H8zm0 3h2v2H8zm-1 2H5v-2h2zm0-3H5V8h2zm9 7H8v-2h8zm0-4h-2v-2h2zm0-3h-2V8h2zm3 3h-2v-2h2zm0-3h-2V8h2z"}),"Keyboard"),FU=_e(s.jsx("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"}),"LightMode"),ll=_e(s.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link"),yI=_e(s.jsx("path",{d:"M19 5v14H5V5zm1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z"}),"ListAlt"),NU=_e(s.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreHoriz"),Yx=_e(s.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert"),Cl=_e(s.jsx("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),Eo=_e(s.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),cp=_e(s.jsx("path",{d:"M19 13H5v-2h14z"}),"Remove"),_U=_e(s.jsx("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8"}),"Replay"),HU=_e(s.jsx("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91"}),"RestartAlt"),BU=_e(s.jsx("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"}),"Save"),PR=_e(s.jsx("path",{d:"M14 9v2h-3V9H8.5V7H11V1H4v6h2.5v2H4v6h2.5v2H4v6h7v-6H8.5v-2H11v-2h3v2h7V9z"}),"Schema"),Fw=_e(s.jsx("path",{d:"M19.8 18.4 14 10.67V6.5l1.35-1.69c.26-.33.03-.81-.39-.81H9.04c-.42 0-.65.48-.39.81L10 6.5v4.17L4.2 18.4c-.49.66-.02 1.6.8 1.6h14c.82 0 1.29-.94.8-1.6"}),"Science"),Ud=_e(s.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search"),WU=_e(s.jsx("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11z"}),"Security"),Yg=_e(s.jsx("path",{d:"m20.38 8.57-1.23 1.85a8 8 0 0 1-.22 7.58H5.07A8 8 0 0 1 15.58 6.85l1.85-1.23A10 10 0 0 0 3.35 19a2 2 0 0 0 1.72 1h13.85a2 2 0 0 0 1.74-1 10 10 0 0 0-.27-10.44zm-9.79 6.84a2 2 0 0 0 2.83 0l5.66-8.49-8.49 5.66a2 2 0 0 0 0 2.83"}),"Speed"),VU=_e(s.jsx("path",{d:"M6.99 11 3 15l3.99 4v-3H14v-2H6.99zM21 9l-3.99-4v3H10v2h7.01v3z"}),"SwapHoriz"),xo=_e(s.jsx("path",{d:"M10 10.02h5V21h-5zM17 21h3c1.1 0 2-.9 2-2v-9h-5zm3-18H5c-1.1 0-2 .9-2 2v3h19V5c0-1.1-.9-2-2-2M3 19c0 1.1.9 2 2 2h3V10H3z"}),"TableChart"),GU=_e(s.jsx("path",{d:"M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2"}),"Timeline"),UU=_e(s.jsx("path",{d:"m16 18 2.29-2.29-4.88-4.88-4 4L2 7.41 3.41 6l6 6 4-4 6.3 6.29L22 12v6z"}),"TrendingDown"),qU=_e(s.jsx("path",{d:"m16 6 2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"}),"TrendingUp"),Nw=_e(s.jsx("path",{d:"M3 14h4v-4H3zm0 5h4v-4H3zM3 9h4V5H3zm5 5h13v-4H8zm0 5h13v-4H8zM8 5v4h13V5z"}),"ViewList"),vh=_e(s.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility"),Os=_e(s.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning");function cn({children:e,noPadding:t=!1,sx:n={}}){return s.jsx(K,{sx:{bgcolor:"background.paper",border:"1px solid",borderColor:"divider",p:t?0:2.5,transition:"border-color 0.2s ease","&:hover":{borderColor:"primary.main",boxShadow:"0 0 10px 0 rgba(129, 140, 248, 0.1)"},...n},children:e})}function rg({label:e,value:t,change:n,changeType:r,loading:o=!1,icon:i,color:l}){return s.jsx(cn,{children:s.jsxs(K,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[s.jsxs(K,{children:[s.jsx(J,{variant:"caption",sx:{color:"text.secondary",textTransform:"uppercase",letterSpacing:"0.05em",fontSize:11,fontWeight:500},children:e}),s.jsx(K,{sx:{display:"flex",alignItems:"baseline",gap:1.5,mt:1},children:o?s.jsx(At,{size:24,sx:{color:"text.disabled"}}):s.jsxs(s.Fragment,{children:[s.jsx(J,{variant:"h4",sx:{fontWeight:600,color:"text.primary",letterSpacing:"-0.02em"},children:t}),n&&s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:.5},children:[r==="up"&&s.jsx(qU,{sx:{fontSize:14,color:"success.main"}}),r==="down"&&s.jsx(UU,{sx:{fontSize:14,color:"error.main"}}),s.jsx(J,{variant:"caption",sx:{color:r==="up"?"success.main":r==="down"?"error.main":"text.secondary",fontWeight:500},children:n})]})]})})]}),i&&l&&s.jsx(K,{sx:{width:44,height:44,borderRadius:1,bgcolor:`${l}20`,display:"flex",alignItems:"center",justifyContent:"center",color:l},children:i})]})})}function KU({connection:e,status:t,isFirst:n=!1,onClick:r}){const o={online:"#10b981",offline:"#ef4444",checking:"#f59e0b"},i=t==="offline",l=!i&&t!=="checking",c=()=>{l&&r()},u=s.jsxs(K,{onClick:c,sx:{display:"grid",gridTemplateColumns:"1fr 1fr 100px 40px",alignItems:"center",px:2,py:1.5,borderTop:n?"none":"1px solid",borderColor:"divider",cursor:l?"pointer":"not-allowed",opacity:i?.6:1,"&:hover":{bgcolor:l?"action.hover":"transparent"}},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[s.jsx(Cr,{sx:{fontSize:18,color:"primary.main"}}),s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(J,{variant:"body2",sx:{fontWeight:500,color:"text.primary"},children:e.name}),s.jsx(Ge,{label:e.engine.toUpperCase(),size:"small",sx:{height:20,fontSize:10,fontWeight:600,bgcolor:e.engine==="postgres"?"rgba(51, 103, 145, 0.25)":"rgba(0, 122, 204, 0.25)",color:e.engine==="postgres"?"#6BA3D6":"#47A3F3",border:"1px solid",borderColor:e.engine==="postgres"?"rgba(51, 103, 145, 0.5)":"rgba(0, 122, 204, 0.5)"}})]})]}),s.jsxs(J,{variant:"body2",sx:{color:"text.secondary",fontFamily:"monospace",fontSize:13},children:[e.host,":",e.port]}),s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[t==="checking"?s.jsx(At,{size:8,sx:{color:o.checking}}):s.jsx(IU,{sx:{fontSize:8,color:o[t]}}),s.jsx(J,{variant:"caption",sx:{color:"text.secondary",textTransform:"capitalize"},children:t==="checking"?"checking...":t})]}),s.jsx(mt,{size:"small",sx:{color:"text.disabled"},onClick:f=>f.stopPropagation(),children:s.jsx(NU,{fontSize:"small"})})]});return i?s.jsx(Pt,{title:"Connection is offline. Test the connection to check status.",children:u}):u}function QU(e){const t=Math.floor((new Date().getTime()-e.getTime())/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}function YU({entry:e}){const t=e.success,n=!e.success,r=QU(new Date(e.executedAt));return s.jsxs(K,{sx:{display:"flex",gap:2,py:1.5},children:[s.jsxs(K,{sx:{pt:.25},children:[t&&s.jsx(Il,{sx:{fontSize:16,color:"success.main"}}),n&&s.jsx(Na,{sx:{fontSize:16,color:"error.main"}})]}),s.jsxs(K,{sx:{flex:1,minWidth:0},children:[s.jsxs(J,{variant:"body2",sx:{color:"text.primary",fontFamily:"monospace",fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[e.sql.substring(0,50),e.sql.length>50?"...":""]}),e.executionTimeMs>0&&s.jsxs(J,{variant:"caption",sx:{color:"text.secondary"},children:[e.executionTimeMs,"ms"]})]}),s.jsx(J,{variant:"caption",sx:{color:"text.secondary",flexShrink:0},children:r})]})}function XU({group:e,syncStatus:t,checking:n,onClick:r}){const o=!!e.sourceConnectionId,i=e.syncSchema||e.syncData,c=!t||!t.targets||t.targets.length===0?"unchecked":t.targets.some(y=>y.schemaStatus==="error"||y.dataStatus==="error")?"error":t.targets.some(y=>y.schemaStatus==="out_of_sync"||y.dataStatus==="out_of_sync")?"out_of_sync":t.targets.every(y=>(y.schemaStatus==="in_sync"||y.schemaStatus==="unchecked")&&(y.dataStatus==="in_sync"||y.dataStatus==="unchecked"))?"in_sync":"unchecked",f={in_sync:{label:"In Sync",color:"#22c55e",bgcolor:"rgba(34, 197, 94, 0.1)"},out_of_sync:{label:"Out of Sync",color:"#f59e0b",bgcolor:"rgba(245, 158, 11, 0.1)"},error:{label:"Error",color:"#ef4444",bgcolor:"rgba(239, 68, 68, 0.1)"},unchecked:{label:"Checking...",color:"#6b7280",bgcolor:"rgba(107, 114, 128, 0.1)"}}[c];return s.jsxs(K,{onClick:r,sx:{display:"flex",alignItems:"center",gap:2,px:2,py:1.5,borderBottom:"1px solid",borderColor:"divider",cursor:"pointer","&:hover":{bgcolor:"action.hover"},"&:last-child":{borderBottom:"none"}},children:[s.jsx(Ap,{sx:{fontSize:18,color:"primary.main"}}),s.jsxs(K,{sx:{flex:1},children:[s.jsx(J,{variant:"body2",sx:{fontWeight:500,color:"text.primary"},children:e.name}),s.jsx(J,{variant:"caption",sx:{color:"text.secondary"},children:e.projectName})]}),s.jsxs(K,{sx:{display:"flex",gap:.5},children:[e.syncSchema&&s.jsx(Ge,{label:"Schema",size:"small",sx:{height:20,fontSize:10}}),e.syncData&&s.jsx(Ge,{label:"Data",size:"small",sx:{height:20,fontSize:10}})]}),o?i?n?s.jsx(Ge,{label:"Checking...",size:"small",icon:s.jsx(At,{size:10,sx:{color:"inherit"}}),sx:{height:20,fontSize:10,bgcolor:"rgba(59, 130, 246, 0.1)",color:"#3b82f6"}}):s.jsx(Ge,{label:f.label,size:"small",sx:{height:20,fontSize:10,bgcolor:f.bgcolor,color:f.color}}):s.jsx(Ge,{label:"Disabled",size:"small",sx:{height:20,fontSize:10,bgcolor:"rgba(107, 114, 128, 0.1)",color:"#6b7280"}}):s.jsx(Ge,{label:"No source",size:"small",sx:{height:20,fontSize:10,bgcolor:"rgba(245, 158, 11, 0.1)",color:"#f59e0b"}})]})}function go({icon:e,title:t,description:n,action:r,secondaryAction:o,size:i="medium",sx:l}){const u={small:{icon:40,title:"body1",desc:"body2",py:3},medium:{icon:56,title:"h6",desc:"body2",py:5},large:{icon:72,title:"h5",desc:"body1",py:8}}[i];return s.jsxs(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",py:u.py,px:3,...l},children:[e&&s.jsx(K,{sx:{mb:2,color:"text.disabled","& > svg":{fontSize:u.icon,opacity:.5}},children:e}),s.jsx(J,{variant:u.title,sx:{color:"text.primary",fontWeight:600,mb:n?1:0},children:t}),n&&s.jsx(J,{variant:u.desc,sx:{color:"text.secondary",maxWidth:400,mb:r?3:0},children:n}),(r||o)&&s.jsxs(K,{sx:{display:"flex",gap:1.5,mt:1},children:[o&&s.jsx(Le,{variant:"outlined",onClick:o.onClick,sx:{textTransform:"none"},children:o.label}),r&&s.jsx(Le,{variant:r.variant||"contained",onClick:r.onClick,sx:{textTransform:"none"},children:r.label})]})]})}function wl({message:e,variant:t="circular",size:n="medium",fullPage:r=!1,sx:o}){const l={small:{spinner:20,py:2},medium:{spinner:32,py:4},large:{spinner:48,py:8}}[n];return t==="linear"?s.jsxs(K,{sx:{width:"100%",...o},children:[s.jsx(kl,{}),e&&s.jsx(J,{variant:"caption",color:"text.secondary",sx:{mt:1,display:"block",textAlign:"center"},children:e})]}):s.jsxs(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",py:l.py,...r&&{position:"absolute",inset:0,bgcolor:"background.default",zIndex:10},...o},children:[s.jsx(At,{size:l.spinner,sx:{color:"text.disabled"}}),e&&s.jsx(J,{variant:"body2",color:"text.secondary",sx:{mt:2},children:e})]})}function ZU(){const e=Ko(),t=Tr(),[n,r]=m.useState([]),[o,i]=m.useState([]),[l,c]=m.useState([]),[u,f]=m.useState({}),[h,p]=m.useState({}),[g,y]=m.useState(!0),[b,v]=m.useState(!1),{healthStatus:C,checkAllConnections:S}=Vd(),j=async R=>{p(E=>({...E,[R]:!0}));try{const E=await ai.getGroupSyncStatus(R);f(O=>({...O,[R]:E})),t.setQueryData(["groupSyncStatus",R],E)}catch(E){console.error(`Failed to check sync status for group ${R}:`,E)}finally{p(E=>({...E,[R]:!1}))}},w=async()=>{try{const[R,E,O]=await Promise.all([Qr.getAll(),mo.getHistory(void 0,10),ai.getSyncEnabledGroups().catch(()=>[])]);r(R),i(E),c(O),S(R.map(A=>A.id)),O.forEach(A=>{A.sourceConnectionId&&(A.syncSchema||A.syncData)&&j(A.id)})}catch(R){console.error("Failed to load dashboard data:",R)}finally{y(!1),v(!1)}};m.useEffect(()=>{w()},[]),m.useEffect(()=>{const O=setInterval(()=>{l.forEach(A=>{A.sourceConnectionId&&(A.syncSchema||A.syncData)&&j(A.id)})},6e5);return()=>clearInterval(O)},[l]);const k=()=>{v(!0),w()},P=o.length,T=o.filter(R=>R.success).length,$=o.filter(R=>!R.success).length,M=o.length>0?Math.round(o.reduce((R,E)=>R+E.executionTimeMs,0)/o.length):0;return s.jsxs(K,{sx:{p:4,maxWidth:1400,mx:"auto"},children:[s.jsxs(K,{sx:{mb:5,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s.jsxs(K,{children:[s.jsx(J,{variant:"h4",sx:{fontWeight:600,color:"text.primary",letterSpacing:"-0.02em",mb:1},children:"Dashboard"}),s.jsx(J,{variant:"body2",sx:{color:"text.secondary"},children:"Overview of your database connections and activity"})]}),s.jsx(mt,{onClick:k,disabled:b,sx:{color:"text.secondary","&:hover":{color:"text.primary"}},children:s.jsx(Eo,{sx:{animation:b?"spin 1s linear infinite":"none","@keyframes spin":{"100%":{transform:"rotate(360deg)"}}}})})]}),s.jsxs(Xs,{container:!0,spacing:2,sx:{mb:4},children:[s.jsx(Xs,{item:!0,xs:6,md:3,children:s.jsx(rg,{label:"Connections",value:g?"-":String(n.length),loading:g,icon:s.jsx(LU,{}),color:"#0ea5e9"})}),s.jsx(Xs,{item:!0,xs:6,md:3,children:s.jsx(rg,{label:"Recent Queries",value:g?"-":String(P),loading:g,icon:s.jsx(SU,{}),color:"#8b5cf6"})}),s.jsx(Xs,{item:!0,xs:6,md:3,children:s.jsx(rg,{label:"Avg Response",value:g?"-":`${M}ms`,loading:g,icon:s.jsx(Yg,{}),color:"#10b981"})}),s.jsx(Xs,{item:!0,xs:6,md:3,children:s.jsx(rg,{label:"Errors",value:g?"-":String($),change:$>0?`+${$}`:void 0,changeType:$>0?"down":"neutral",loading:g,icon:s.jsx(Os,{}),color:"#ef4444"})})]}),s.jsxs(Xs,{container:!0,spacing:3,children:[s.jsx(Xs,{item:!0,xs:12,lg:8,children:s.jsxs(cn,{noPadding:!0,children:[s.jsxs(K,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:2,py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:[s.jsx(J,{variant:"subtitle2",sx:{color:"text.primary",fontWeight:600},children:"Connections"}),s.jsx(Le,{size:"small",startIcon:s.jsx(Gn,{sx:{fontSize:16}}),onClick:()=>e("/dashboard"),sx:{color:"primary.main",textTransform:"none",fontSize:13,"&:hover":{bgcolor:"action.hover"}},children:"Add new"})]}),s.jsxs(K,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr 100px 40px",px:2,py:1,bgcolor:"background.default",borderBottom:"1px solid",borderColor:"divider"},children:[s.jsx(J,{variant:"caption",sx:{color:"text.secondary",fontWeight:500},children:"NAME"}),s.jsx(J,{variant:"caption",sx:{color:"text.secondary",fontWeight:500},children:"HOST"}),s.jsx(J,{variant:"caption",sx:{color:"text.secondary",fontWeight:500},children:"STATUS"}),s.jsx(K,{})]}),g?s.jsx(wl,{size:"small"}):n.length===0?s.jsx(go,{icon:s.jsx(Cr,{}),title:"No connections yet",description:"Add your first database connection to get started.",action:{label:"Add Connection",onClick:()=>e("/dashboard"),variant:"text"},size:"small"}):n.map((R,E)=>{const O=C[R.id],A=O?O.isOnline?"online":"offline":"checking";return s.jsx(KU,{connection:R,status:A,isFirst:E===0,onClick:()=>e(`/query/${R.id}`)},R.id)})]})}),s.jsx(Xs,{item:!0,xs:12,lg:4,children:s.jsxs(cn,{children:[s.jsxs(K,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[s.jsx(J,{variant:"subtitle2",sx:{color:"text.primary",fontWeight:600},children:"Recent Activity"}),o.length>0&&s.jsxs(J,{variant:"caption",sx:{color:"text.secondary"},children:[T,"/",P," successful"]})]}),g?s.jsx(wl,{size:"small"}):o.length===0?s.jsx(go,{icon:s.jsx(vd,{}),title:"No recent activity",description:"Queries you run will appear here.",size:"small"}):s.jsx(K,{sx:{"& > *:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:o.slice(0,5).map(R=>s.jsx(YU,{entry:R},R.id))})]})}),l.length>0&&s.jsx(Xs,{item:!0,xs:12,children:s.jsxs(cn,{noPadding:!0,children:[s.jsxs(K,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:2,py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(fs,{sx:{fontSize:18,color:"primary.main"}}),s.jsx(J,{variant:"subtitle2",sx:{color:"text.primary",fontWeight:600},children:"Instance Groups with Sync"})]}),s.jsxs(J,{variant:"caption",sx:{color:"text.secondary"},children:[l.length," group",l.length!==1?"s":""]})]}),l.map(R=>s.jsx(XU,{group:R,syncStatus:u[R.id],checking:h[R.id]||!1,onClick:()=>e(`/groups/${R.id}/sync`)},R.id))]})})]})]})}const ac=["#ef4444","#f97316","#eab308","#22c55e","#14b8a6","#0ea5e9","#6366f1","#a855f7","#ec4899"],bI=[{id:"production",name:"production",color:"239, 68, 68"},{id:"staging",name:"staging",color:"245, 158, 11"},{id:"development",name:"development",color:"16, 185, 129"},{id:"read-only",name:"read-only",color:"139, 92, 246"}];function JU(){return Math.random().toString(36).substring(2,9)}const _w=Aa()(xh(e=>({tags:bI,addTag:t=>e(n=>({tags:[...n.tags,{...t,id:JU()}]})),updateTag:(t,n)=>e(r=>({tags:r.tags.map(o=>o.id===t?{...o,...n}:o)})),deleteTag:t=>e(n=>({tags:n.tags.filter(r=>r.id!==t)})),resetTags:()=>e({tags:bI})}),{name:"dbnexus-tags"})),up={red:"239, 68, 68",orange:"249, 115, 22",amber:"245, 158, 11",yellow:"234, 179, 8",lime:"132, 204, 22",green:"16, 185, 129",teal:"20, 184, 166",cyan:"6, 182, 212",blue:"14, 165, 233",indigo:"99, 102, 241",purple:"139, 92, 246",pink:"236, 72, 153",gray:"107, 114, 128"};function Eu({label:e,value:t}){return s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",sx:{display:"block",textTransform:"uppercase",letterSpacing:"0.05em",fontSize:10,fontWeight:500,mb:.25},children:e}),s.jsx(J,{variant:"body2",fontFamily:"monospace",sx:{fontSize:13},children:t})]})}function Hw({connection:e,compact:t=!1,onEdit:n,onDelete:r,onQuery:o}){const i=Ko(),[l,c]=m.useState(!1),[u,f]=m.useState(!1),[h,p]=m.useState(null),{tags:g}=_w(),{healthStatus:y,checkConnection:b}=Vd();m.useEffect(()=>{y[e.id]||b(e.id)},[e.id,y,b]);const v=y[e.id],C=v?!v.isOnline:!1,S=(v==null?void 0:v.isOnline)??!1,j=async P=>{P.stopPropagation(),f(!0),p(null);try{const T=await Qr.test(e.id);p(T),b(e.id)}catch(T){p({success:!1,message:T instanceof Error?T.message:"Test failed"}),b(e.id)}finally{f(!1)}},w=P=>{const T=g.find($=>$.name===P);return T?{bgcolor:`rgba(${T.color}, 0.15)`,color:`rgb(${T.color})`,borderColor:`rgba(${T.color}, 0.3)`}:{}},k=e.engine==="sqlite"?e.database:`${e.host}:${e.port}`;return s.jsxs(K,{sx:{bgcolor:"background.paper",border:"1px solid",borderColor:"divider",overflow:"hidden",transition:"border-color 0.15s","&:hover":{borderColor:"primary.main"}},children:[s.jsxs(K,{onClick:()=>c(!l),sx:{display:"flex",alignItems:"center",gap:t?1.5:2,px:t?2:2.5,py:t?1.25:1.75,cursor:"pointer",transition:"background 0.15s","&:hover":{bgcolor:"action.hover"}},children:[s.jsx(Cr,{sx:{fontSize:t?18:20,color:"primary.main",flexShrink:0}}),s.jsxs(K,{sx:{flex:1,minWidth:0},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[s.jsx(J,{variant:t?"body2":"body1",fontWeight:600,sx:{lineHeight:1.3},children:e.name}),s.jsx(Ge,{label:e.engine.toUpperCase(),size:"small",sx:{height:18,fontSize:10,fontWeight:600,bgcolor:e.engine==="postgres"?"rgba(51, 103, 145, 0.2)":"rgba(0, 122, 204, 0.2)",color:e.engine==="postgres"?"#6BA3D6":"#47A3F3"}}),e.readOnly&&s.jsx(Ge,{label:"READ-ONLY",size:"small",sx:{height:18,fontSize:9,fontWeight:600,bgcolor:"rgba(139, 92, 246, 0.15)",color:"rgb(139, 92, 246)"}})]}),s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1.5,mt:.25,flexWrap:"wrap"},children:[s.jsx(J,{variant:"caption",color:"text.secondary",fontFamily:"monospace",sx:{fontSize:11},children:k}),e.database&&e.engine!=="sqlite"&&s.jsxs(s.Fragment,{children:[s.jsx(J,{variant:"caption",color:"text.disabled",children:"•"}),s.jsx(J,{variant:"caption",color:"text.secondary",fontFamily:"monospace",sx:{fontSize:11},children:e.database})]})]})]}),e.tags.length>0&&s.jsx(K,{sx:{display:"flex",gap:.5,flexWrap:"wrap",flexShrink:0},children:e.tags.map(P=>s.jsx(Ge,{label:P,size:"small",sx:{...w(P),height:20,fontSize:10,fontWeight:500,border:"1px solid"}},P))}),s.jsx(Pt,{title:(v==null?void 0:v.error)||`Connection is ${v!=null&&v.isOnline?"online":v?"offline":"unknown"}`,children:s.jsx(K,{sx:{display:"flex",alignItems:"center",flexShrink:0},children:S?s.jsx(Il,{fontSize:"small",color:"success"}):C?s.jsx(Na,{fontSize:"small",color:"error"}):s.jsx(Qx,{fontSize:"small",color:"disabled"})})}),s.jsx(mt,{size:"small",onClick:P=>{P.stopPropagation(),c(!l)},sx:{color:"text.secondary"},children:l?s.jsx(Ac,{fontSize:"small"}):s.jsx(bl,{fontSize:"small"})}),s.jsx(Pt,{title:C?"Connection is offline":"",children:s.jsx("span",{children:s.jsx(Le,{size:"small",variant:"contained",startIcon:s.jsx(Cl,{sx:{fontSize:16}}),onClick:P=>{P.stopPropagation(),o()},disabled:C,sx:{flexShrink:0},children:"Query"})})})]}),s.jsx(Di,{in:l,children:s.jsxs(K,{sx:{px:t?2:2.5,py:2,bgcolor:"background.default",borderTop:"1px solid",borderColor:"divider"},children:[s.jsx(K,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:2,mb:2.5},children:e.engine==="sqlite"?s.jsx(Eu,{label:"File",value:e.database}):s.jsxs(s.Fragment,{children:[s.jsx(Eu,{label:"Host",value:`${e.host}:${e.port}`}),s.jsx(Eu,{label:"Database",value:e.database}),s.jsx(Eu,{label:"User",value:e.username}),e.defaultSchema&&s.jsx(Eu,{label:"Default Schema",value:e.defaultSchema}),e.ssl&&s.jsx(Eu,{label:"SSL",value:"Enabled"})]})}),h&&s.jsx(Nt,{severity:h.success?"success":"error",onClose:()=>p(null),sx:{mb:2},children:h.message}),s.jsxs(K,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:[s.jsx(Le,{size:"small",variant:"outlined",startIcon:u?s.jsx(At,{size:14}):s.jsx(Fw,{}),onClick:j,disabled:u,children:"Test"}),s.jsx(Le,{size:"small",variant:"outlined",startIcon:s.jsx(Dr,{}),onClick:n,children:"Edit"}),s.jsx(Pt,{title:C?"Connection is offline":"",children:s.jsx("span",{children:s.jsx(Le,{size:"small",variant:"outlined",startIcon:s.jsx(Wd,{}),onClick:()=>i(`/connections/${e.id}`),disabled:C,children:"Manage"})})}),s.jsx(K,{sx:{flex:1}}),s.jsx(Le,{size:"small",color:"error",startIcon:s.jsx(dr,{}),onClick:r,children:"Delete"})]})]})})]})}function e7({group:e,connections:t,projectColor:n,onEditGroup:r,onEditConnection:o,onDeleteConnection:i,onQuery:l}){const[c,u]=m.useState(!0),[f,h]=m.useState(null),p=Tr(),g=vr({mutationFn:()=>pi.deleteGroup(e.projectId,e.id),onSuccess:()=>{p.invalidateQueries({queryKey:["groups"]}),p.invalidateQueries({queryKey:["connections"]})}});return s.jsxs(K,{sx:{bgcolor:"background.paper",border:"1px solid",borderColor:"divider",overflow:"hidden"},children:[s.jsxs(K,{onClick:()=>u(!c),sx:{display:"flex",alignItems:"center",gap:2,px:2,py:2,cursor:"pointer",transition:"background 0.15s","&:hover":{bgcolor:"action.hover"}},children:[s.jsx(K,{sx:{width:32,height:32,borderRadius:.5,bgcolor:`${n}15`,display:"flex",alignItems:"center",justifyContent:"center"},children:s.jsx(Ap,{fontSize:"small",sx:{color:n}})}),s.jsxs(K,{sx:{flex:1},children:[s.jsx(J,{variant:"body2",fontWeight:600,children:e.name}),e.description&&s.jsx(J,{variant:"caption",color:"text.secondary",children:e.description})]}),s.jsx(Ge,{label:e.databaseEngine==="postgres"?"PostgreSQL":e.databaseEngine==="mysql"?"MySQL":e.databaseEngine==="mariadb"?"MariaDB":"SQLite",size:"small",sx:{height:22,fontSize:11,bgcolor:"primary.main",color:"primary.contrastText",fontWeight:500}}),(e.syncSchema||e.syncData)&&s.jsx(Ge,{label:e.syncSchema&&e.syncData?"Schema + Data":e.syncSchema?"Schema":"Data",size:"small",icon:s.jsx(fs,{sx:{fontSize:14}}),sx:{height:22,fontSize:11,bgcolor:"rgba(34, 197, 94, 0.1)",color:"#22c55e",border:"1px solid rgba(34, 197, 94, 0.3)","& .MuiChip-icon":{color:"#22c55e"}}}),s.jsxs(J,{variant:"caption",color:"text.secondary",children:[t.length," instance",t.length!==1?"s":""]}),s.jsx(mt,{size:"small",children:c?s.jsx(Ac,{fontSize:"small"}):s.jsx(bl,{fontSize:"small"})}),s.jsx(mt,{size:"small",onClick:y=>{y.stopPropagation(),h(y.currentTarget)},sx:{color:"text.secondary"},children:s.jsx(Yx,{fontSize:"small"})})]}),s.jsxs(Ra,{anchorEl:f,open:!!f,onClose:()=>h(null),children:[s.jsxs(it,{component:"a",href:`/groups/${e.id}/sync`,onClick:()=>h(null),children:[s.jsx(Rn,{children:s.jsx(fs,{fontSize:"small"})}),s.jsx($n,{children:"Sync Status"})]}),s.jsxs(it,{onClick:()=>{h(null),r()},children:[s.jsx(Rn,{children:s.jsx(Dr,{fontSize:"small"})}),s.jsx($n,{children:"Edit Instance Group"})]}),s.jsxs(it,{onClick:()=>{h(null),g.mutate()},sx:{color:"error.main"},children:[s.jsx(Rn,{children:s.jsx(dr,{fontSize:"small",color:"error"})}),s.jsx($n,{children:"Delete Instance Group"})]})]}),s.jsx(Di,{in:c,children:s.jsx(K,{sx:{px:2,py:2,bgcolor:"background.default",borderTop:"1px solid",borderColor:"divider"},children:s.jsxs($a,{spacing:1,children:[t.map(y=>s.jsx(Hw,{connection:y,compact:!0,onEdit:()=>o(y),onDelete:()=>i(y.id),onQuery:()=>l(y.id)},y.id)),t.length===0&&s.jsx(J,{variant:"caption",sx:{color:"text.disabled",py:2,textAlign:"center"},children:"No connections in this group"})]})})})]})}function t7({project:e,groupsMap:t,allGroups:n,onEditProject:r,onAddGroup:o,onEditGroup:i,onEditConnection:l,onDeleteConnection:c,onQuery:u}){const[f,h]=m.useState(!0),[p,g]=m.useState(null),y=Tr(),b=vr({mutationFn:()=>pi.delete(e.id),onSuccess:()=>{y.invalidateQueries({queryKey:["projects"]}),y.invalidateQueries({queryKey:["connections"]})}}),v=e.color||ac[0]||"#0ea5e9",C=Array.from(t.values()).reduce((j,w)=>j+w.length,0),S=t.get(null)||[];return s.jsxs(K,{sx:{bgcolor:"background.paper",border:"1px solid",borderColor:"divider",overflow:"hidden"},children:[s.jsxs(K,{onClick:()=>h(!f),sx:{display:"flex",alignItems:"center",gap:2,px:2,py:2,cursor:"pointer",borderLeft:`3px solid ${v}`,transition:"background 0.15s","&:hover":{bgcolor:"action.hover"}},children:[s.jsx(K,{sx:{width:36,height:36,borderRadius:1,bgcolor:`${v}15`,display:"flex",alignItems:"center",justifyContent:"center"},children:s.jsx(Lw,{sx:{color:v,fontSize:20}})}),s.jsxs(K,{sx:{flex:1},children:[s.jsx(J,{variant:"subtitle1",fontWeight:600,children:e.name}),e.description&&s.jsx(J,{variant:"caption",color:"text.secondary",children:e.description})]}),s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsxs(J,{variant:"caption",color:"text.secondary",children:[C," connection",C!==1?"s":""]}),s.jsx(J,{variant:"caption",color:"text.disabled",children:"•"}),s.jsxs(J,{variant:"caption",color:"text.secondary",children:[n.length," group",n.length!==1?"s":""]})]}),s.jsx(mt,{size:"small",sx:{ml:1},children:f?s.jsx(Ac,{}):s.jsx(bl,{})}),s.jsx(mt,{size:"small",onClick:j=>{j.stopPropagation(),g(j.currentTarget)},sx:{color:"text.secondary"},children:s.jsx(Yx,{})})]}),s.jsxs(Ra,{anchorEl:p,open:!!p,onClose:()=>g(null),children:[s.jsxs(it,{onClick:()=>{g(null),o()},children:[s.jsx(Rn,{children:s.jsx(Ap,{fontSize:"small"})}),s.jsx($n,{children:"Add Instance Group"})]}),s.jsxs(it,{onClick:()=>{g(null),r()},children:[s.jsx(Rn,{children:s.jsx(Dr,{fontSize:"small"})}),s.jsx($n,{children:"Edit Project"})]}),s.jsxs(it,{onClick:()=>{g(null),b.mutate()},sx:{color:"error.main"},children:[s.jsx(Rn,{children:s.jsx(dr,{fontSize:"small",color:"error"})}),s.jsx($n,{children:"Delete Project"})]})]}),s.jsx(Di,{in:f,children:s.jsx(K,{sx:{px:2,py:2,bgcolor:"background.default",borderTop:"1px solid",borderColor:"divider"},children:s.jsxs($a,{spacing:2,children:[n.map(j=>s.jsx(e7,{group:j,connections:t.get(j.id)||[],projectColor:v,onEditGroup:()=>i(j),onEditConnection:l,onDeleteConnection:c,onQuery:u},j.id)),S.length>0&&s.jsxs(K,{children:[s.jsx(J,{variant:"caption",sx:{color:"text.secondary",mb:1.5,display:"block",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:500},children:"Ungrouped"}),s.jsx($a,{spacing:1,children:S.map(j=>s.jsx(Hw,{connection:j,compact:!0,onEdit:()=>l(j),onDelete:()=>c(j.id),onQuery:()=>u(j.id)},j.id))})]}),C===0&&n.length===0&&s.jsxs(K,{sx:{textAlign:"center",py:3},children:[s.jsx(J,{variant:"body2",color:"text.secondary",sx:{mb:1},children:"No connections or groups yet"}),s.jsx(J,{variant:"caption",color:"text.disabled",children:"Add an instance group to organize related database instances"})]})]})})})]})}function n7({open:e,project:t,onClose:n}){const r=Tr(),o=oo(),[i,l]=m.useState(""),[c,u]=m.useState(""),[f,h]=m.useState(ac[0]),p=()=>{t?(l(t.name),u(t.description||""),h(t.color||ac[0])):(l(""),u(""),h(ac[Math.floor(Math.random()*ac.length)]))},g=vr({mutationFn:pi.create,onSuccess:()=>{r.invalidateQueries({queryKey:["projects"]}),o.success("Project created"),n()}}),y=vr({mutationFn:({id:v,data:C})=>pi.update(v,C),onSuccess:()=>{r.invalidateQueries({queryKey:["projects"]}),o.success("Project updated"),n()}}),b=v=>{v.preventDefault(),t?y.mutate({id:t.id,data:{name:i,description:c,color:f}}):g.mutate({name:i,description:c,color:f})};return s.jsx(gn,{open:e,onClose:n,maxWidth:"sm",fullWidth:!0,TransitionProps:{onEnter:p},children:s.jsxs("form",{onSubmit:b,children:[s.jsx(wn,{children:t?"Edit Project":"New Project"}),s.jsx(Cn,{children:s.jsxs($a,{spacing:3,sx:{mt:1},children:[s.jsx(Wt,{label:"Project Name",value:i,onChange:v=>l(v.target.value),placeholder:"My Project",required:!0,fullWidth:!0}),s.jsx(Wt,{label:"Description",value:c,onChange:v=>u(v.target.value),placeholder:"Optional description",multiline:!0,rows:2,fullWidth:!0}),s.jsxs(K,{children:[s.jsx(J,{variant:"body2",color:"text.secondary",sx:{mb:1},children:"Color"}),s.jsx(K,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:ac.map(v=>s.jsx(K,{onClick:()=>h(v),sx:{width:32,height:32,bgcolor:v,cursor:"pointer",border:f===v?"3px solid":"1px solid",borderColor:f===v?"common.white":"transparent","&:hover":{opacity:.8}}},v))})]})]})}),s.jsxs(vn,{sx:{px:3,pb:2},children:[s.jsx(Le,{onClick:n,children:"Cancel"}),s.jsx(Le,{type:"submit",variant:"contained",disabled:g.isPending||y.isPending,children:t?"Save Changes":"Create Project"})]})]})})}function r7({open:e,group:t,projectId:n,onClose:r}){const o=Tr(),i=oo(),[l,c]=m.useState(""),[u,f]=m.useState(""),[h,p]=m.useState("postgres"),g=()=>{t?(c(t.name),f(t.description||""),p(t.databaseEngine)):(c(""),f(""),p("postgres"))},y=vr({mutationFn:()=>pi.createGroup(n,{name:l,description:u,databaseEngine:h}),onSuccess:()=>{o.invalidateQueries({queryKey:["groups"]}),i.success("Instance group created"),r()}}),b=vr({mutationFn:()=>pi.updateGroup(n,t.id,{name:l,description:u}),onSuccess:()=>{o.invalidateQueries({queryKey:["groups"]}),i.success("Instance group updated"),r()}}),v=C=>{C.preventDefault(),t?b.mutate():y.mutate()};return s.jsx(gn,{open:e,onClose:r,maxWidth:"sm",fullWidth:!0,TransitionProps:{onEnter:g},children:s.jsxs("form",{onSubmit:v,children:[s.jsx(wn,{children:t?"Edit Instance Group":"New Instance Group"}),s.jsx(Cn,{children:s.jsxs($a,{spacing:3,sx:{mt:1},children:[s.jsx(Wt,{label:"Group Name",value:l,onChange:C=>c(C.target.value),placeholder:"e.g., Users Database",helperText:"Group instances of the same database (local/dev/staging/prod)",required:!0,fullWidth:!0}),s.jsx(Wt,{label:"Description",value:u,onChange:C=>f(C.target.value),placeholder:"Optional description",multiline:!0,rows:2,fullWidth:!0}),!t&&s.jsxs(K,{children:[s.jsx(J,{variant:"body2",color:"text.secondary",sx:{mb:1},children:"Database Engine"}),s.jsx(J,{variant:"caption",color:"text.secondary",sx:{mb:1,display:"block"},children:"All connections in this group must use the same database engine"}),s.jsxs(Kx,{value:h,exclusive:!0,onChange:(C,S)=>{S&&p(S)},size:"small",sx:{flexWrap:"wrap"},children:[s.jsx(li,{value:"postgres",children:"PostgreSQL"}),s.jsx(li,{value:"mysql",children:"MySQL"}),s.jsx(li,{value:"mariadb",children:"MariaDB"}),s.jsx(li,{value:"sqlite",children:"SQLite"})]})]}),t&&s.jsx(Wt,{label:"Database Engine",value:t.databaseEngine==="postgres"?"PostgreSQL":t.databaseEngine==="mysql"?"MySQL":t.databaseEngine==="mariadb"?"MariaDB":"SQLite",disabled:!0,fullWidth:!0,helperText:"Database engine cannot be changed after group creation"})]})}),s.jsxs(vn,{sx:{px:3,pb:2},children:[s.jsx(Le,{onClick:r,children:"Cancel"}),s.jsx(Le,{type:"submit",variant:"contained",disabled:y.isPending||b.isPending,children:t?"Save Changes":"Create Group"})]})]})})}function TR({open:e,connection:t,projects:n,groups:r,onClose:o}){const i=Tr(),l=oo(),{tags:c}=_w(),[u,f]=m.useState({name:"",engine:"postgres",host:"localhost",port:5432,database:"",username:"",password:"",ssl:!1,defaultSchema:"",tags:[],readOnly:!1,projectId:void 0,groupId:void 0}),[h,p]=m.useState(!1),[g,y]=m.useState(null),{data:b=[]}=Ft({queryKey:["schemas",t==null?void 0:t.id],queryFn:()=>xn.getSchemas(t.id),enabled:!!(t!=null&&t.id)&&(t==null?void 0:t.engine)==="postgres"}),v=()=>{f(t?{name:t.name,engine:t.engine,host:t.host,port:t.port,database:t.database,username:t.username,password:"",ssl:t.ssl,defaultSchema:t.defaultSchema||"",tags:t.tags,readOnly:t.readOnly,projectId:t.projectId,groupId:t.groupId}:{name:"",engine:"postgres",host:"localhost",port:5432,database:"",username:"",password:"",ssl:!1,defaultSchema:"",tags:[],readOnly:!1,projectId:void 0,groupId:void 0}),y(null)},C=u.engine==="sqlite",S=u.engine==="mysql"||u.engine==="mariadb",j=r.filter(M=>M.projectId===u.projectId&&M.databaseEngine===u.engine),w=M=>{switch(M){case"postgres":return 5432;case"mysql":return 3306;case"mariadb":return 3306;default:return 0}},k=vr({mutationFn:Qr.create,onSuccess:()=>{i.invalidateQueries({queryKey:["connections"]}),l.success("Connection created"),o()}}),P=vr({mutationFn:({id:M,data:R})=>Qr.update(M,{...R,projectId:R.projectId===void 0?null:R.projectId,groupId:R.groupId===void 0?null:R.groupId}),onSuccess:()=>{i.invalidateQueries({queryKey:["connections"]}),l.success("Connection updated"),o()}}),T=M=>{M.preventDefault(),t?P.mutate({id:t.id,data:u}):k.mutate(u)},$=async()=>{p(!0),y(null);try{const M=await Qr.testSettings(u);y(M)}catch(M){y({success:!1,message:M instanceof Error?M.message:"Test failed"})}finally{p(!1)}};return s.jsx(gn,{open:e,onClose:o,maxWidth:"sm",fullWidth:!0,TransitionProps:{onEnter:v},children:s.jsxs("form",{onSubmit:T,children:[s.jsx(wn,{children:t?"Edit Connection":"New Connection"}),s.jsx(Cn,{children:s.jsxs($a,{spacing:3,sx:{mt:1},children:[s.jsx(Wt,{label:"Connection Name",value:u.name,onChange:M=>f({...u,name:M.target.value}),placeholder:"My Database",required:!0,fullWidth:!0}),s.jsxs(K,{sx:{display:"flex",gap:2},children:[s.jsxs(_n,{fullWidth:!0,children:[s.jsx(Hn,{children:"Project"}),s.jsxs(On,{value:u.projectId||"",onChange:M=>f({...u,projectId:M.target.value||void 0,groupId:void 0}),label:"Project",children:[s.jsx(it,{value:"",children:s.jsx("em",{children:"None"})}),n.map(M=>s.jsx(it,{value:M.id,children:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(K,{sx:{width:12,height:12,bgcolor:M.color||ac[0]}}),M.name]})},M.id))]})]}),s.jsxs(_n,{fullWidth:!0,disabled:!u.projectId,children:[s.jsx(Hn,{children:"Instance Group"}),s.jsxs(On,{value:u.groupId||"",onChange:M=>f({...u,groupId:M.target.value||void 0}),label:"Instance Group",children:[s.jsx(it,{value:"",children:s.jsx("em",{children:"None"})}),j.length===0&&u.projectId&&s.jsx(it,{disabled:!0,children:s.jsxs("em",{children:["No groups for ",u.engine," in this project"]})}),j.map(M=>s.jsx(it,{value:M.id,children:M.name},M.id))]})]})]}),!t&&s.jsxs(K,{children:[s.jsx(J,{variant:"body2",color:"text.secondary",sx:{mb:1},children:"Database Engine"}),s.jsxs(Kx,{value:u.engine,exclusive:!0,onChange:(M,R)=>{R&&f({...u,engine:R,host:R==="sqlite"?"":"localhost",port:w(R),username:R==="sqlite"?"":u.username,password:R==="sqlite"?"":u.password,groupId:void 0})},size:"small",sx:{flexWrap:"wrap"},children:[s.jsx(li,{value:"postgres",children:"PostgreSQL"}),s.jsx(li,{value:"mysql",children:"MySQL"}),s.jsx(li,{value:"mariadb",children:"MariaDB"}),s.jsx(li,{value:"sqlite",children:"SQLite"})]})]}),t&&s.jsx(Wt,{label:"Database Engine",value:u.engine==="postgres"?"PostgreSQL":u.engine==="mysql"?"MySQL":u.engine==="mariadb"?"MariaDB":"SQLite",disabled:!0,fullWidth:!0}),!C&&s.jsxs(s.Fragment,{children:[s.jsxs(K,{sx:{display:"flex",gap:2},children:[s.jsx(Wt,{label:"Host",value:u.host,onChange:M=>f({...u,host:M.target.value}),placeholder:"localhost",required:!0,sx:{flex:2}}),s.jsx(Wt,{label:"Port",type:"number",value:u.port,onChange:M=>f({...u,port:parseInt(M.target.value)}),required:!0,sx:{flex:1}})]}),s.jsx(Wt,{label:"Database",value:u.database,onChange:M=>f({...u,database:M.target.value}),placeholder:"mydb",required:!0,fullWidth:!0}),s.jsxs(K,{sx:{display:"flex",gap:2},children:[s.jsx(Wt,{label:"Username",value:u.username,onChange:M=>f({...u,username:M.target.value}),placeholder:"postgres",required:!0,sx:{flex:1}}),s.jsx(Wt,{label:"Password",type:"password",value:u.password,onChange:M=>f({...u,password:M.target.value}),placeholder:t?"••••••••":"",required:!t,sx:{flex:1}})]})]}),C&&s.jsx(Wt,{label:"Database File Path",value:u.database,onChange:M=>f({...u,database:M.target.value}),placeholder:"/path/to/database.db",helperText:"Absolute path to the SQLite database file",required:!0,fullWidth:!0}),!C&&!S&&s.jsx(s.Fragment,{children:t&&b.length>0?s.jsxs(_n,{fullWidth:!0,children:[s.jsx(Hn,{children:"Default Schema"}),s.jsxs(On,{value:u.defaultSchema||"",onChange:M=>f({...u,defaultSchema:M.target.value}),label:"Default Schema",children:[s.jsx(it,{value:"",children:s.jsx("em",{children:'None (use "public")'})}),b.map(M=>s.jsx(it,{value:M,children:M},M))]})]}):s.jsx(Wt,{label:"Default Schema",value:u.defaultSchema||"",onChange:M=>f({...u,defaultSchema:M.target.value}),placeholder:"public",helperText:"Default schema to use (leave empty for 'public')",fullWidth:!0})}),s.jsxs(K,{children:[s.jsx(J,{variant:"body2",color:"text.secondary",sx:{mb:1},children:"Tags"}),s.jsx(K,{sx:{display:"flex",gap:.5,flexWrap:"wrap"},children:c.map(M=>{const R=u.tags??[],E=R.includes(M.name);return s.jsx(Ge,{label:M.name,size:"small",onClick:()=>{f(E?{...u,tags:R.filter(O=>O!==M.name)}:{...u,tags:[...R,M.name]})},sx:{cursor:"pointer",borderRadius:.5,fontWeight:500,bgcolor:E?`rgba(${M.color}, 0.25)`:`rgba(${M.color}, 0.08)`,color:`rgb(${M.color})`,border:E?`2px solid rgba(${M.color}, 0.6)`:`1px solid rgba(${M.color}, 0.3)`,"&:hover":{bgcolor:`rgba(${M.color}, 0.2)`}}},M.id)})}),c.length===0&&s.jsx(J,{variant:"caption",color:"text.secondary",children:"No tags available. Create tags in Settings."})]}),s.jsxs(K,{sx:{display:"flex",gap:3},children:[!C&&s.jsx(Kr,{control:s.jsx($s,{checked:u.ssl,onChange:M=>f({...u,ssl:M.target.checked})}),label:"Use SSL"}),s.jsx(Kr,{control:s.jsx($s,{checked:u.readOnly,onChange:M=>f({...u,readOnly:M.target.checked})}),label:"Read-only mode"})]}),g&&s.jsx(Nt,{severity:g.success?"success":"error",children:g.message})]})}),s.jsxs(vn,{sx:{px:3,pb:2},children:[s.jsx(Le,{onClick:o,children:"Cancel"}),s.jsx(Le,{onClick:$,disabled:h,startIcon:h?s.jsx(At,{size:16}):s.jsx(Fw,{}),children:"Test"}),s.jsx(Le,{type:"submit",variant:"contained",disabled:k.isPending||P.isPending,children:t?"Save Changes":"Create Connection"})]})]})})}function o7(){const e=Tr(),t=Ko(),n=oo(),[r,o]=m.useState(!1),[i,l]=m.useState(null),[c,u]=m.useState(!1),[f,h]=m.useState(null),[p,g]=m.useState(!1),[y,b]=m.useState(null),[v,C]=m.useState(null),{data:S=[],isLoading:j}=Ft({queryKey:["connections"],queryFn:Qr.getAll}),{data:w=[],isLoading:k}=Ft({queryKey:["projects"],queryFn:pi.getAll}),{data:P=[]}=Ft({queryKey:["groups"],queryFn:()=>Cd.getAll()}),T=j||k,$=m.useMemo(()=>{const D=new Map;w.forEach(G=>D.set(G.id,G));const H=new Map;P.forEach(G=>H.set(G.id,G));const B=new Map,V=[];return S.forEach(G=>{if(G.projectId){B.has(G.projectId)||B.set(G.projectId,new Map);const _=B.get(G.projectId),U=G.groupId||null;_.has(U)||_.set(U,[]),_.get(U).push(G)}else V.push(G)}),{projects:w.map(G=>({project:G,groups:B.get(G.id)||new Map})),ungroupedConnections:V,projectMap:D,groupMap:H}},[S,w,P]),M=vr({mutationFn:Qr.delete,onSuccess:()=>{e.invalidateQueries({queryKey:["connections"]}),n.success("Connection deleted")}}),R=D=>{l(D),o(!0)},E=()=>{o(!1),l(null)},O=D=>{h(D),u(!0)},A=()=>{u(!1),h(null)},N=D=>{b(D),C(null),g(!0)},F=D=>{C(D),b(D.projectId),g(!0)},L=()=>{g(!1),b(null),C(null)};return s.jsxs(K,{sx:{p:4,maxWidth:1400,mx:"auto"},children:[s.jsxs(K,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",mb:4},children:[s.jsxs(K,{children:[s.jsx(J,{variant:"h4",fontWeight:600,gutterBottom:!0,children:"Projects"}),s.jsx(J,{variant:"body1",color:"text.secondary",children:"Organize database connections by project and group"})]}),s.jsxs(K,{sx:{display:"flex",gap:1},children:[s.jsx(Le,{variant:"outlined",startIcon:s.jsx(Lw,{}),onClick:()=>u(!0),children:"New Project"}),s.jsx(Le,{variant:"contained",startIcon:s.jsx(Gn,{}),onClick:()=>o(!0),children:"Add Connection"})]})]}),s.jsx(TR,{open:r,connection:i,projects:w,groups:P,onClose:E}),s.jsx(n7,{open:c,project:f,onClose:A}),s.jsx(r7,{open:p,group:v,projectId:y,onClose:L}),T?s.jsx(wl,{message:"Loading connections...",size:"large"}):S.length===0&&w.length===0?s.jsx(cn,{children:s.jsx(go,{icon:s.jsx(Cr,{}),title:"No connections yet",description:"Add your first database connection to start exploring your data. Organize connections into projects and instance groups for better management.",action:{label:"Add Connection",onClick:()=>o(!0)},secondaryAction:{label:"Create Project",onClick:()=>u(!0)},size:"large"})}):s.jsxs($a,{spacing:3,children:[$.projects.map(({project:D,groups:H})=>s.jsx(t7,{project:D,groupsMap:H,allGroups:P.filter(B=>B.projectId===D.id),onEditProject:()=>O(D),onAddGroup:()=>N(D.id),onEditGroup:F,onEditConnection:R,onDeleteConnection:B=>M.mutate(B),onQuery:B=>t(`/query/${B}`)},D.id)),$.ungroupedConnections.length>0&&s.jsxs(K,{children:[s.jsx(J,{variant:"caption",sx:{color:"text.secondary",mb:2,display:"block",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:500},children:"Ungrouped Connections"}),s.jsx($a,{spacing:1.5,children:$.ungroupedConnections.map(D=>s.jsx(Hw,{connection:D,onEdit:()=>R(D),onDelete:()=>M.mutate(D.id),onQuery:()=>t(`/query/${D.id}`)},D.id))})]})]})]})}const MR=["overview","schemas","tables","management","maintenance"];function s7(e){if(!e)return 0;const t=MR.indexOf(e);return t>=0?t:0}function i7(e){return MR[e]||"overview"}const rc=Aa((e,t)=>({activeTab:0,selectedSchema:null,selectedTable:null,setActiveTab:n=>e({activeTab:n}),setSelectedSchema:n=>e({selectedSchema:n,selectedTable:null}),setSelectedTable:n=>e({selectedTable:n}),setSelection:(n,r)=>e({selectedSchema:n,selectedTable:r??null}),initFromUrl:n=>{const r=n.get("tab"),o=n.get("schema"),i=n.get("table");e({activeTab:s7(r),selectedSchema:o,selectedTable:i})},getUrlParams:()=>{const n=t(),r={tab:i7(n.activeTab)};return n.selectedSchema&&(r.schema=n.selectedSchema),n.selectedTable&&(r.table=n.selectedTable),r},reset:()=>e({activeTab:0,selectedSchema:null,selectedTable:null})}));function zv({icon:e,label:t,value:n,isLoading:r,color:o="primary.main"}){return s.jsxs(cn,{sx:{display:"flex",alignItems:"center",gap:2,p:2.5},children:[s.jsx(K,{sx:{p:1.5,borderRadius:2,bgcolor:`${o}15`,color:o,display:"flex",alignItems:"center",justifyContent:"center"},children:e}),s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",sx:{textTransform:"uppercase",letterSpacing:"0.05em"},children:t}),r?s.jsx(to,{width:60,height:28}):s.jsx(J,{variant:"h5",fontWeight:600,children:n})]})]})}function l7({connection:e,schemas:t,serverVersion:n,isLoading:r}){var C;const o=Ko(),[i,l]=m.useState(!1),[c,u]=m.useState(null),[f,h]=m.useState(!1),{data:p=0,isLoading:g}=Ft({queryKey:["totalTables",e==null?void 0:e.id],queryFn:async()=>{if(!(e!=null&&e.id))return 0;let S=0;for(const j of t){const w=await xn.getTables(e.id,j);S+=w.length}return S},enabled:!!(e!=null&&e.id)&&t.length>0}),{data:y=[]}=Ft({queryKey:["projects"],queryFn:pi.getAll}),{data:b=[]}=Ft({queryKey:["groups"],queryFn:()=>Cd.getAll()}),v=async()=>{if(e!=null&&e.id){l(!0),u(null);try{const S=await Qr.test(e.id);u(S)}catch(S){u({success:!1,message:S instanceof Error?S.message:"Test failed"})}finally{l(!1)}}};return s.jsxs(K,{children:[s.jsxs(K,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:2,mb:3},children:[s.jsx(zv,{icon:s.jsx($i,{}),label:"Schemas",value:t.length,isLoading:r,color:"#8b5cf6"}),s.jsx(zv,{icon:s.jsx(xo,{}),label:"Tables",value:p,isLoading:g,color:"#06b6d4"}),s.jsx(zv,{icon:s.jsx(Cr,{}),label:"Engine",value:((C=e==null?void 0:e.engine)==null?void 0:C.toUpperCase())||"-",isLoading:r,color:"#f59e0b"})]}),s.jsxs(cn,{sx:{mb:3},children:[s.jsx(J,{variant:"h6",fontWeight:600,gutterBottom:!0,children:"Connection Details"}),s.jsx(K,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(250px, 1fr))",gap:2,mt:2},children:r?s.jsxs(s.Fragment,{children:[s.jsx(to,{height:40}),s.jsx(to,{height:40}),s.jsx(to,{height:40}),s.jsx(to,{height:40})]}):(e==null?void 0:e.engine)==="sqlite"?s.jsx(oc,{label:"Database File",value:e.database}):s.jsxs(s.Fragment,{children:[s.jsx(oc,{label:"Host",value:`${e==null?void 0:e.host}:${e==null?void 0:e.port}`}),s.jsx(oc,{label:"Database",value:e==null?void 0:e.database}),s.jsx(oc,{label:"Username",value:e==null?void 0:e.username}),(e==null?void 0:e.defaultSchema)&&s.jsx(oc,{label:"Default Schema",value:e.defaultSchema}),s.jsx(oc,{label:"SSL",value:e!=null&&e.ssl?"Enabled":"Disabled"}),n&&s.jsx(oc,{label:"Server Version",value:n})]})})]}),s.jsxs(cn,{children:[s.jsx(J,{variant:"h6",fontWeight:600,gutterBottom:!0,children:"Quick Actions"}),c&&s.jsx(Nt,{severity:c.success?"success":"error",icon:c.success?s.jsx(Il,{}):s.jsx(Na,{}),onClose:()=>u(null),sx:{mb:2},children:c.message}),s.jsxs(K,{sx:{display:"flex",gap:2,flexWrap:"wrap",mt:2},children:[s.jsx(Le,{variant:"contained",startIcon:s.jsx(Cl,{}),onClick:()=>o(`/query/${e==null?void 0:e.id}`),children:"Open Query Editor"}),s.jsx(Le,{variant:"outlined",startIcon:s.jsx(zw,{}),onClick:()=>o(`/schema-diagram?connection=${e==null?void 0:e.id}${e!=null&&e.defaultSchema?`&schema=${e.defaultSchema}`:""}`),children:"Open Schema Diagram"}),s.jsx(Le,{variant:"outlined",startIcon:s.jsx(Dr,{}),onClick:()=>h(!0),children:"Edit Connection"}),s.jsx(Le,{variant:"outlined",startIcon:i?s.jsx(At,{size:16}):s.jsx(Fw,{}),onClick:v,disabled:i,children:"Test Connection"})]})]}),s.jsx(TR,{open:f,connection:e||null,projects:y,groups:b,onClose:()=>h(!1)})]})}function oc({label:e,value:t}){return s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",sx:{textTransform:"uppercase",letterSpacing:"0.05em"},children:e}),s.jsx(J,{variant:"body1",fontFamily:"monospace",sx:{mt:.5},children:t||"-"})]})}const RR=m.createContext(void 0);function Ut(){const e=m.useContext(RR);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(`
|
|
296
|
+
`));return e}const $R=m.createContext(void 0),gt=()=>{const e=m.useContext($R);if(!e)throw new Error("MUI X: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return e},a7=parseInt(m.version,10),sn=e=>{if(a7>=19){const t=n=>e(n,n.ref??null);return t.displayName=e.displayName??e.name,t}return m.forwardRef(e)};var Xg=Symbol("NOT_FOUND");function c7(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function u7(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function d7(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var vI=e=>Array.isArray(e)?e:[e];function f7(e){const t=Array.isArray(e[0])?e[0]:e;return d7(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function p7(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}function h7(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Xg},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function m7(e,t){let n=[];function r(c){const u=n.findIndex(f=>t(c,f.key));if(u>-1){const f=n[u];return u>0&&(n.splice(u,1),n.unshift(f)),f.value}return Xg}function o(c,u){r(c)===Xg&&(n.unshift({key:c,value:u}),n.length>e&&n.pop())}function i(){return n}function l(){n=[]}return{get:r,put:o,getEntries:i,clear:l}}var g7=(e,t)=>e===t;function x7(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let i=0;i<o;i++)if(!e(n[i],r[i]))return!1;return!0}}function OR(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=g7,maxSize:o=1,resultEqualityCheck:i}=n,l=x7(r);let c=0;const u=o<=1?h7(l):m7(o,l);function f(){let h=u.get(arguments);if(h===Xg){if(h=e.apply(null,arguments),c++,i){const g=u.getEntries().find(y=>i(y.value,h));g&&(h=g.value,c!==0&&c--)}u.put(arguments,h)}return h}return f.clearCache=()=>{u.clear(),f.resetResultsCount()},f.resultsCount=()=>c,f.resetResultsCount=()=>{c=0},f}var y7=class{constructor(e){this.value=e}deref(){return this.value}},b7=typeof WeakRef<"u"?WeakRef:y7,v7=0,CI=1;function og(){return{s:v7,v:void 0,o:null,p:null}}function zR(e,t={}){let n=og();const{resultEqualityCheck:r}=t;let o,i=0;function l(){var p;let c=n;const{length:u}=arguments;for(let g=0,y=u;g<y;g++){const b=arguments[g];if(typeof b=="function"||typeof b=="object"&&b!==null){let v=c.o;v===null&&(c.o=v=new WeakMap);const C=v.get(b);C===void 0?(c=og(),v.set(b,c)):c=C}else{let v=c.p;v===null&&(c.p=v=new Map);const C=v.get(b);C===void 0?(c=og(),v.set(b,c)):c=C}}const f=c;let h;if(c.s===CI)h=c.v;else if(h=e.apply(null,arguments),i++,r){const g=((p=o==null?void 0:o.deref)==null?void 0:p.call(o))??o;g!=null&&r(g,h)&&(h=g,i!==0&&i--),o=typeof h=="object"&&h!==null||typeof h=="function"?new b7(h):h}return f.s=CI,f.v=h,h}return l.clearCache=()=>{n=og(),l.resetResultsCount()},l.resultsCount=()=>i,l.resetResultsCount=()=>{i=0},l}function LR(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let i=0,l=0,c,u={},f=o.pop();typeof f=="object"&&(u=f,f=o.pop()),c7(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const h={...n,...u},{memoize:p,memoizeOptions:g=[],argsMemoize:y=zR,argsMemoizeOptions:b=[]}=h,v=vI(g),C=vI(b),S=f7(o),j=p(function(){return i++,f.apply(null,arguments)},...v),w=y(function(){l++;const P=p7(S,arguments);return c=j.apply(null,P),c},...C);return Object.assign(w,{resultFunc:f,memoizedResultFunc:j,dependencies:S,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>c,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:p,argsMemoize:y})};return Object.assign(r,{withTypes:()=>r}),r}var DR=LR(zR),C7=Object.assign((e,t=DR)=>{u7(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(i=>e[i]);return t(r,(...i)=>i.reduce((l,c,u)=>(l[n[u]]=c,l),{}))},{withTypes:()=>C7});const w7=Object.is;function AR(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,r=0;for(const o in e)if(n+=1,!w7(e[o],t[o])||!(o in t))return!1;for(const o in t)r+=1;return n===r}var Lv={exports:{}},Dv={};/**
|
|
297
|
+
* @license React
|
|
298
|
+
* use-sync-external-store-shim.production.js
|
|
299
|
+
*
|
|
300
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
301
|
+
*
|
|
302
|
+
* This source code is licensed under the MIT license found in the
|
|
303
|
+
* LICENSE file in the root directory of this source tree.
|
|
304
|
+
*/var wI;function S7(){if(wI)return Dv;wI=1;var e=Dd();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function c(p,g){var y=g(),b=r({inst:{value:y,getSnapshot:g}}),v=b[0].inst,C=b[1];return i(function(){v.value=y,v.getSnapshot=g,u(v)&&C({inst:v})},[p,y,g]),o(function(){return u(v)&&C({inst:v}),p(function(){u(v)&&C({inst:v})})},[p]),l(y),y}function u(p){var g=p.getSnapshot;p=p.value;try{var y=g();return!n(p,y)}catch{return!0}}function f(p,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return Dv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,Dv}var SI;function FR(){return SI||(SI=1,Lv.exports=S7()),Lv.exports}var Bw=FR();function NR(e){return e.acceptsApiRef}function jI(e,t){return NR(t)?t(e):t(e.current.state)}function Av(e,t,n,r){return NR(t)?t(e,n):t(e.current.state,r)}const _R=Object.is,Ww=AR,j7=(e,t)=>e===t?!0:e.length===t.length&&e.every((n,r)=>n===t[r]),k7=(e,t)=>{let n=Object.is;return t instanceof Array?n=j7:t instanceof Object&&(n=Ww),n(e,t)},HR=()=>({state:null,equals:null,selector:null,args:void 0}),Zg=[],BR=()=>null,He=(e,t,n=_R)=>{const r=Hs(HR),o=r.current.selector!==null,[i,l]=m.useState(o?null:jI(e,t));r.current.state=i,r.current.equals=n,r.current.selector=t;const c=m.useCallback(()=>(r.current.subscription||(r.current.subscription=e.current.store.subscribe(()=>{const f=jI(e,r.current.selector);r.current.equals(r.current.state,f)||(r.current.state=f,l(f))})),null),Zg),u=m.useCallback(()=>()=>{r.current.subscription&&(r.current.subscription(),r.current.subscription=void 0)},Zg);return Bw.useSyncExternalStore(u,c,BR),i},Np=(e,t,n=void 0,r=_R)=>{const o=Hs(HR),i=o.current.selector!==null,[l,c]=m.useState(i?null:Av(e,t,n,e.current.instanceId));o.current.state=l,o.current.equals=r,o.current.selector=t;const u=o.current.args;if(o.current.args=n,i&&!k7(u,n)){const p=Av(e,o.current.selector,o.current.args,e.current.instanceId);o.current.equals(o.current.state,p)||(o.current.state=p,c(p))}const f=m.useCallback(()=>(o.current.subscription||(o.current.subscription=e.current.store.subscribe(()=>{const p=Av(e,o.current.selector,o.current.args,e.current.instanceId);o.current.equals(o.current.state,p)||(o.current.state=p,c(p))})),null),Zg),h=m.useCallback(()=>()=>{o.current.subscription&&(o.current.subscription(),o.current.subscription=void 0)},Zg);return Bw.useSyncExternalStore(h,f,BR),l},I7=LR({memoize:OR,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),kI=new WeakMap;function oi(e){return"current"in e&&"instanceId"in e.current}const si={id:"default"},Tt=(e,t,n,r,o,i,...l)=>{if(l.length>0)throw new Error("Unsupported number of selectors");let c;if(e&&t&&n&&r&&o&&i)c=(u,f)=>{const h=oi(u),p=f??(h?u.current.instanceId:si),g=h?u.current.state:u,y=e(g,p),b=t(g,p),v=n(g,p),C=r(g,p),S=o(g,p);return i(y,b,v,C,S)};else if(e&&t&&n&&r&&o)c=(u,f)=>{const h=oi(u),p=f??(h?u.current.instanceId:si),g=h?u.current.state:u,y=e(g,p),b=t(g,p),v=n(g,p),C=r(g,p);return o(y,b,v,C)};else if(e&&t&&n&&r)c=(u,f)=>{const h=oi(u),p=f??(h?u.current.instanceId:si),g=h?u.current.state:u,y=e(g,p),b=t(g,p),v=n(g,p);return r(y,b,v)};else if(e&&t&&n)c=(u,f)=>{const h=oi(u),p=f??(h?u.current.instanceId:si),g=h?u.current.state:u,y=e(g,p),b=t(g,p);return n(y,b)};else if(e&&t)c=(u,f)=>{const h=oi(u),p=f??(h?u.current.instanceId:si),g=h?u.current.state:u,y=e(g,p);return t(y)};else throw new Error("Missing arguments");return c.acceptsApiRef=!0,c},Ch=(e,t,n,r,o,i,...l)=>{if(l.length>0)throw new Error("Unsupported number of selectors");let c;if(e&&t&&n&&r&&o&&i)c=(u,f,h)=>{const p=oi(u),g=h??(p?u.current.instanceId:si),y=p?u.current.state:u,b=e(y,f,g),v=t(y,f,g),C=n(y,f,g),S=r(y,f,g),j=o(y,f,g);return i(b,v,C,S,j,f)};else if(e&&t&&n&&r&&o)c=(u,f,h)=>{const p=oi(u),g=h??(p?u.current.instanceId:si),y=p?u.current.state:u,b=e(y,f,g),v=t(y,f,g),C=n(y,f,g),S=r(y,f,g);return o(b,v,C,S,f)};else if(e&&t&&n&&r)c=(u,f,h)=>{const p=oi(u),g=h??(p?u.current.instanceId:si),y=p?u.current.state:u,b=e(y,f,g),v=t(y,f,g),C=n(y,f,g);return r(b,v,C,f)};else if(e&&t&&n)c=(u,f,h)=>{const p=oi(u),g=h??(p?u.current.instanceId:si),y=p?u.current.state:u,b=e(y,f,g),v=t(y,f,g);return n(b,v,f)};else if(e&&t)c=(u,f,h)=>{const p=oi(u),g=h??(p?u.current.instanceId:si),y=p?u.current.state:u,b=e(y,f,g);return t(b,f)};else throw new Error("Missing arguments");return c.acceptsApiRef=!0,c},fn=(...e)=>{const t=(n,r)=>{const o=oi(n),i=o?n.current.instanceId:r??si,l=o?n.current.state:n,c=kI.get(i),u=c??new Map,f=u==null?void 0:u.get(e);if(u&&f)return f(l,i);const h=I7(...e);return c||kI.set(i,u),u.set(e,h),h(l,i)};return t.acceptsApiRef=!0,t},Ar=e=>e.dimensions,Xx=Tt(Ar,e=>e.columnsTotalWidth),Vw=e=>e.dimensions.rowHeight,E7=e=>e.dimensions.contentSize.height,P7=e=>e.dimensions.hasScrollX,T7=e=>e.dimensions.hasScrollY,WR=e=>e.dimensions.columnsTotalWidth<e.dimensions.viewportOuterSize.width,M7=e=>e.dimensions.headerHeight,R7=e=>e.dimensions.groupHeaderHeight,VR=e=>e.dimensions.hasScrollY?e.dimensions.scrollbarSize:0,$7=e=>{const t=e.dimensions.hasScrollX?e.dimensions.scrollbarSize:0,n=e.dimensions.viewportOuterSize.height-e.dimensions.minimumSize.height>0;return!(t===0&&!n)};function El(e){return m.memo(e,AR)}const O7={noRowsLabel:"No rows",noResultsOverlayLabel:"No results found.",toolbarDensity:"Density",toolbarDensityLabel:"Density",toolbarDensityCompact:"Compact",toolbarDensityStandard:"Standard",toolbarDensityComfortable:"Comfortable",toolbarColumns:"Columns",toolbarColumnsLabel:"Select columns",toolbarFilters:"Filters",toolbarFiltersLabel:"Show filters",toolbarFiltersTooltipHide:"Hide filters",toolbarFiltersTooltipShow:"Show filters",toolbarFiltersTooltipActive:e=>e!==1?`${e} active filters`:`${e} active filter`,toolbarQuickFilterPlaceholder:"Search…",toolbarQuickFilterLabel:"Search",toolbarQuickFilterDeleteIconLabel:"Clear",toolbarExport:"Export",toolbarExportLabel:"Export",toolbarExportCSV:"Download as CSV",toolbarExportPrint:"Print",toolbarExportExcel:"Download as Excel",columnsManagementSearchTitle:"Search",columnsManagementNoColumns:"No columns",columnsManagementShowHideAllText:"Show/Hide All",columnsManagementReset:"Reset",columnsManagementDeleteIconLabel:"Clear",filterPanelAddFilter:"Add filter",filterPanelRemoveAll:"Remove all",filterPanelDeleteIconLabel:"Delete",filterPanelLogicOperator:"Logic operator",filterPanelOperator:"Operator",filterPanelOperatorAnd:"And",filterPanelOperatorOr:"Or",filterPanelColumns:"Columns",filterPanelInputLabel:"Value",filterPanelInputPlaceholder:"Filter value",filterOperatorContains:"contains",filterOperatorDoesNotContain:"does not contain",filterOperatorEquals:"equals",filterOperatorDoesNotEqual:"does not equal",filterOperatorStartsWith:"starts with",filterOperatorEndsWith:"ends with",filterOperatorIs:"is",filterOperatorNot:"is not",filterOperatorAfter:"is after",filterOperatorOnOrAfter:"is on or after",filterOperatorBefore:"is before",filterOperatorOnOrBefore:"is on or before",filterOperatorIsEmpty:"is empty",filterOperatorIsNotEmpty:"is not empty",filterOperatorIsAnyOf:"is any of","filterOperator=":"=","filterOperator!=":"!=","filterOperator>":">","filterOperator>=":">=","filterOperator<":"<","filterOperator<=":"<=",headerFilterOperatorContains:"Contains",headerFilterOperatorDoesNotContain:"Does not contain",headerFilterOperatorEquals:"Equals",headerFilterOperatorDoesNotEqual:"Does not equal",headerFilterOperatorStartsWith:"Starts with",headerFilterOperatorEndsWith:"Ends with",headerFilterOperatorIs:"Is",headerFilterOperatorNot:"Is not",headerFilterOperatorAfter:"Is after",headerFilterOperatorOnOrAfter:"Is on or after",headerFilterOperatorBefore:"Is before",headerFilterOperatorOnOrBefore:"Is on or before",headerFilterOperatorIsEmpty:"Is empty",headerFilterOperatorIsNotEmpty:"Is not empty",headerFilterOperatorIsAnyOf:"Is any of","headerFilterOperator=":"Equals","headerFilterOperator!=":"Not equals","headerFilterOperator>":"Greater than","headerFilterOperator>=":"Greater than or equal to","headerFilterOperator<":"Less than","headerFilterOperator<=":"Less than or equal to",filterValueAny:"any",filterValueTrue:"true",filterValueFalse:"false",columnMenuLabel:"Menu",columnMenuAriaLabel:e=>`${e} column menu`,columnMenuShowColumns:"Show columns",columnMenuManageColumns:"Manage columns",columnMenuFilter:"Filter",columnMenuHideColumn:"Hide column",columnMenuUnsort:"Unsort",columnMenuSortAsc:"Sort by ASC",columnMenuSortDesc:"Sort by DESC",columnHeaderFiltersTooltipActive:e=>e!==1?`${e} active filters`:`${e} active filter`,columnHeaderFiltersLabel:"Show filters",columnHeaderSortIconLabel:"Sort",footerRowSelected:e=>e!==1?`${e.toLocaleString()} rows selected`:`${e.toLocaleString()} row selected`,footerTotalRows:"Total Rows:",footerTotalVisibleRows:(e,t)=>`${e.toLocaleString()} of ${t.toLocaleString()}`,checkboxSelectionHeaderName:"Checkbox selection",checkboxSelectionSelectAllRows:"Select all rows",checkboxSelectionUnselectAllRows:"Unselect all rows",checkboxSelectionSelectRow:"Select row",checkboxSelectionUnselectRow:"Unselect row",booleanCellTrueLabel:"yes",booleanCellFalseLabel:"no",actionsCellMore:"more",pinToLeft:"Pin to left",pinToRight:"Pin to right",unpin:"Unpin",treeDataGroupingHeaderName:"Group",treeDataExpand:"see children",treeDataCollapse:"hide children",groupingColumnHeaderName:"Group",groupColumn:e=>`Group by ${e}`,unGroupColumn:e=>`Stop grouping by ${e}`,detailPanelToggle:"Detail panel toggle",expandDetailPanel:"Expand",collapseDetailPanel:"Collapse",MuiTablePagination:{},rowReorderingHeaderName:"Row reordering",aggregationMenuItemHeader:"Aggregation",aggregationFunctionLabelSum:"sum",aggregationFunctionLabelAvg:"avg",aggregationFunctionLabelMin:"min",aggregationFunctionLabelMax:"max",aggregationFunctionLabelSize:"size"};function en(e){return ct("MuiDataGrid",e)}const te=ut("MuiDataGrid",["actionsCell","aggregationColumnHeader","aggregationColumnHeader--alignLeft","aggregationColumnHeader--alignCenter","aggregationColumnHeader--alignRight","aggregationColumnHeaderLabel","autoHeight","autosizing","booleanCell","cell--editable","cell--editing","cell--flex","cell--textCenter","cell--textLeft","cell--textRight","cell--rangeTop","cell--rangeBottom","cell--rangeLeft","cell--rangeRight","cell--pinnedLeft","cell--pinnedRight","cell--selectionMode","cell","cellCheckbox","cellEmpty","cellSkeleton","cellOffsetLeft","checkboxInput","columnHeader","columnHeader--alignCenter","columnHeader--alignLeft","columnHeader--alignRight","columnHeader--dragging","columnHeader--moving","columnHeader--numeric","columnHeader--sortable","columnHeader--sorted","columnHeader--filtered","columnHeader--pinnedLeft","columnHeader--pinnedRight","columnHeader--last","columnHeader--lastUnpinned","columnHeader--siblingFocused","columnHeaderCheckbox","columnHeaderDraggableContainer","columnHeaderTitle","columnHeaderTitleContainer","columnHeaderTitleContainerContent","columnHeader--filledGroup","columnHeader--emptyGroup","columnHeaders","columnSeparator--resizable","columnSeparator--resizing","columnSeparator--sideLeft","columnSeparator--sideRight","columnSeparator","columnsManagement","columnsManagementRow","columnsManagementHeader","columnsManagementSearchInput","columnsManagementFooter","container--top","container--bottom","detailPanel","detailPanels","detailPanelToggleCell","detailPanelToggleCell--expanded","footerCell","panel","panelHeader","panelWrapper","panelContent","panelFooter","paper","editBooleanCell","editInputCell","filler","filler--borderBottom","filler--pinnedLeft","filler--pinnedRight","filterForm","filterFormDeleteIcon","filterFormLogicOperatorInput","filterFormColumnInput","filterFormOperatorInput","filterFormValueInput","filterIcon","footerContainer","headerFilterRow","iconButtonContainer","iconSeparator","main","main--hasPinnedRight","main--hasSkeletonLoadingOverlay","menu","menuIcon","menuIconButton","menuOpen","menuList","overlay","overlayWrapper","overlayWrapperInner","root","root--densityStandard","root--densityComfortable","root--densityCompact","root--disableUserSelection","root--noToolbar","row","row--editable","row--editing","row--firstVisible","row--lastVisible","row--dragging","row--dynamicHeight","row--detailPanelExpanded","row--borderBottom","rowReorderCellPlaceholder","rowCount","rowReorderCellContainer","rowReorderCell","rowReorderCell--draggable","rowSkeleton","scrollArea--left","scrollArea--right","scrollArea--up","scrollArea--down","scrollArea","scrollbar","scrollbar--vertical","scrollbar--horizontal","scrollbarFiller","scrollbarFiller--header","scrollbarFiller--borderTop","scrollbarFiller--borderBottom","scrollbarFiller--pinnedRight","selectedRowCount","sortButton","sortIcon","toolbarContainer","toolbarFilterList","virtualScroller","virtualScroller--hasScrollX","virtualScrollerContent","virtualScrollerContent--overflowed","virtualScrollerRenderZone","pinnedColumns","withVerticalBorder","withBorderColor","cell--withRightBorder","cell--withLeftBorder","columnHeader--withRightBorder","columnHeader--withLeftBorder","treeDataGroupingCell","treeDataGroupingCellToggle","treeDataGroupingCellLoadingContainer","groupingCriteriaCell","groupingCriteriaCellToggle","groupingCriteriaCellLoadingContainer","pinnedRows","pinnedRows--top","pinnedRows--bottom","pinnedRowsRenderZone"]),II=1e3;class z7{constructor(t=II){this.timeouts=new Map,this.cleanupTimeout=II,this.cleanupTimeout=t}register(t,n,r){this.timeouts||(this.timeouts=new Map);const o=setTimeout(()=>{typeof n=="function"&&n(),this.timeouts.delete(r.cleanupToken)},this.cleanupTimeout);this.timeouts.set(r.cleanupToken,o)}unregister(t){const n=this.timeouts.get(t.cleanupToken);n&&(this.timeouts.delete(t.cleanupToken),clearTimeout(n))}reset(){this.timeouts&&(this.timeouts.forEach((t,n)=>{this.unregister({cleanupToken:n})}),this.timeouts=void 0)}}class L7{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,n,r){this.registry.register(t,n,r)}unregister(t){this.registry.unregister(t)}reset(){}}var zs=(function(e){return e.DataGrid="DataGrid",e.DataGridPro="DataGridPro",e.DataGridPremium="DataGridPremium",e})(zs||{});class D7{}function A7(e){let t=0;return function(r,o,i,l){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new L7:new z7);const[c]=m.useState(new D7),u=m.useRef(null),f=m.useRef(null);f.current=i;const h=m.useRef(null);if(!u.current&&f.current){const p=(g,y,b)=>{var v;y&&!y.defaultMuiPrevented&&((v=f.current)==null||v.call(f,g,y,b))};u.current=r.current.subscribeEvent(o,p,l),t+=1,h.current={cleanupToken:t},e.registry.register(c,()=>{var g;(g=u.current)==null||g.call(u),u.current=null,h.current=null},h.current)}else!f.current&&u.current&&(u.current(),u.current=null,h.current&&(e.registry.unregister(h.current),h.current=null));m.useEffect(()=>{if(!u.current&&f.current){const p=(g,y,b)=>{var v;y&&!y.defaultMuiPrevented&&((v=f.current)==null||v.call(f,g,y,b))};u.current=r.current.subscribeEvent(o,p,l)}return h.current&&e.registry&&(e.registry.unregister(h.current),h.current=null),()=>{var p;(p=u.current)==null||p.call(u),u.current=null}},[r,o,l])}}const F7={registry:null},ot=A7(F7),N7={isFirst:!0};function En(e,t,n){ot(e,t,n,N7)}const _7=.7,H7=1.3,B7={compact:_7,comfortable:H7,standard:1},Bu=e=>e.density,qd=Tt(Bu,e=>B7[e]),W7=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","isValidating","debounceMs","isProcessingProps","onValueChange"],V7=e=>{const{classes:t}=e;return Be({root:["editInputCell"]},en,t)},G7=Ce(Bd,{name:"MuiDataGrid",slot:"EditInputCell",overridesResolver:(e,t)=>t.editInputCell})(({theme:e})=>q({},e.typography.body2,{padding:"1px 0","& input":{padding:"0 16px",height:"100%"}})),U7=sn((e,t)=>{const n=gt(),{id:r,value:o,field:i,colDef:l,hasFocus:c,debounceMs:u=200,isProcessingProps:f,onValueChange:h}=e,p=St(e,W7),g=Ut(),y=m.useRef(null),[b,v]=m.useState(o),C=V7(n),S=m.useCallback(async w=>{const k=w.target.value;h&&await h(w,k);const P=g.current.getColumn(i);let T=k;P.valueParser&&(T=P.valueParser(k,g.current.getRow(r),P,g)),v(T),g.current.setEditCellValue({id:r,field:i,value:T,debounceMs:u,unstable_skipValueParser:!0},w)},[g,u,i,r,h]),j=g.current.unstable_getEditCellMeta(r,i);return m.useEffect(()=>{(j==null?void 0:j.changeReason)!=="debouncedSetEditCellValue"&&v(o)},[j,o]),Ln(()=>{c&&y.current.focus()},[c]),s.jsx(G7,q({inputRef:y,className:C.root,ownerState:n,fullWidth:!0,type:l.type==="number"?l.type:"text",value:b??"",onChange:S,endAdornment:f?s.jsx(n.slots.loadIcon,{fontSize:"small",color:"action"}):void 0},p,{ref:t}))}),q7=e=>s.jsx(U7,q({},e)),Ws=e=>e.rows,wh=Tt(Ws,e=>e.totalRowCount),K7=Tt(Ws,e=>e.loading),Q7=Tt(Ws,e=>e.totalTopLevelRowCount),Ts=Tt(Ws,e=>e.dataRowIdToModelLookup),EI=Tt(Ws,e=>e.dataRowIdToIdLookup),Pr=Tt(Ws,e=>e.tree),Y7=Tt(Ws,e=>e.groupsToFetch),X7=Tt(Ws,e=>e.groupingName),PI=Tt(Ws,e=>e.treeDepths),Kc=fn(Ws,e=>{const t=Object.entries(e.treeDepths);return t.length===0?1:(t.filter(([,n])=>n>0).map(([n])=>Number(n)).sort((n,r)=>r-n)[0]??0)+1}),dp=Tt(Ws,e=>e.dataRowIds),Z7=Tt(Ws,e=>e==null?void 0:e.additionalRowGroups),Kd=fn(Z7,e=>{var n,r;const t=e==null?void 0:e.pinnedRows;return{bottom:((n=t==null?void 0:t.bottom)==null?void 0:n.map(o=>({id:o.id,model:o.model??{}})))??[],top:((r=t==null?void 0:t.top)==null?void 0:r.map(o=>({id:o.id,model:o.model??{}})))??[]}}),GR=Tt(Kd,e=>{var t,n;return(((t=e==null?void 0:e.top)==null?void 0:t.length)||0)+(((n=e==null?void 0:e.bottom)==null?void 0:n.length)||0)}),UR=(e,t)=>t&&e.length>1?[e[0]]:e,TI=(e,t)=>n=>q({},n,{sorting:q({},n.sorting,{sortModel:UR(e,t)})}),J7=e=>e==="desc",eq=(e,t)=>{const n=t.current.getColumn(e.field);if(!n||e.sort===null)return null;let r;return n.getSortComparator?r=n.getSortComparator(e.sort):r=J7(e.sort)?(...i)=>-1*n.sortComparator(...i):n.sortComparator,r?{getSortCellParams:i=>({id:i,field:n.field,rowNode:Pr(t)[i],value:t.current.getCellValue(i,n.field),api:t.current}),comparator:r}:null},tq=(e,t,n)=>e.reduce((r,o,i)=>{if(r!==0)return r;const l=t.params[i],c=n.params[i];return r=o.comparator(l.value,c.value,l,c),r},0),nq=(e,t)=>{const n=e.map(r=>eq(r,t)).filter(r=>!!r);return n.length===0?null:r=>r.map(o=>({node:o,params:n.map(i=>i.getSortCellParams(o.id))})).sort((o,i)=>tq(n,o,i)).map(o=>o.node.id)},MI=(e,t)=>{const n=e.indexOf(t);return!t||n===-1||n+1===e.length?e[0]:e[n+1]},Gw=(e,t)=>e==null&&t!=null?-1:t==null&&e!=null?1:e==null&&t==null?0:null,rq=new Intl.Collator,oq=(e,t)=>{const n=Gw(e,t);return n!==null?n:typeof e=="string"?rq.compare(e.toString(),t.toString()):e-t},qR=(e,t)=>{const n=Gw(e,t);return n!==null?n:Number(e)-Number(t)},KR=(e,t)=>{const n=Gw(e,t);return n!==null?n:e>t?1:e<t?-1:0},sq=["item","applyValue","type","apiRef","focusElementRef","tabIndex","disabled","isFilterActive","clearButton","InputProps","variant"];function Ps(e){var k;const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,tabIndex:l,disabled:c,clearButton:u,InputProps:f,variant:h="standard"}=e,p=St(e,sq),g=Po(),[y,b]=m.useState(Fv(t.value)),[v,C]=m.useState(!1),S=Sn(),j=gt(),w=m.useCallback(P=>{const T=Fv(P.target.value);b(T),C(!0),g.start(j.filterDebounceMs,()=>{const $=q({},t,{value:r==="number"&&!Number.isNaN(Number(T))?Number(T):T,fromInput:S});n($),C(!1)})},[g,j.filterDebounceMs,t,r,S,n]);return m.useEffect(()=>{(t.fromInput!==S||t.value==null)&&b(Fv(t.value))},[S,t]),s.jsx(j.slots.baseTextField,q({id:S,label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),value:y??"",onChange:w,variant:h,type:r||"text",InputProps:q({},v||u?{endAdornment:v?s.jsx(j.slots.loadIcon,{fontSize:"small",color:"action"}):u}:{},{disabled:c},f,{inputProps:q({tabIndex:l},f==null?void 0:f.inputProps)}),InputLabelProps:{shrink:!0},inputRef:i},p,(k=j.slotProps)==null?void 0:k.baseTextField))}function Fv(e){if(!(e==null||e===""))return String(e)}function iq(e){return typeof e=="number"&&!Number.isNaN(e)}function lq(e){return typeof e=="function"}function Uw(e){return typeof e=="object"&&e!==null}function aq(){try{const e="__some_random_key_you_are_not_going_to_use__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}function Jg(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}const as=(e,t,n)=>Math.max(t,Math.min(n,e));function RI(e,t){return Array.from({length:t-e}).map((n,r)=>e+r)}function ka(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const o=e.length;if(o!==t.length)return!1;for(let i=0;i<o;i+=1)if(!ka(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;const o=Array.from(e.entries());for(let i=0;i<o.length;i+=1)if(!t.has(o[i][0]))return!1;for(let i=0;i<o.length;i+=1){const l=o[i];if(!ka(l[1],t.get(l[0])))return!1}return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;const o=Array.from(e.entries());for(let i=0;i<o.length;i+=1)if(!t.has(o[i][0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){const o=e.length;if(o!==t.length)return!1;for(let i=0;i<o;i+=1)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),r=n.length;if(r!==Object.keys(t).length)return!1;for(let o=0;o<r;o+=1)if(!Object.prototype.hasOwnProperty.call(t,n[o]))return!1;for(let o=0;o<r;o+=1){const i=n[o];if(!ka(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function cq(e){return()=>{let t=e+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function uq(e){const t=cq(e);return(n,r)=>n+(r-n)*t()}function QR(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}const cc=(e,t)=>n=>{e&&t(n)},dq=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"],fq=["key"];function YR(e){const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,color:l,error:c,helperText:u,size:f,variant:h="standard"}=e,p=St(e,dq),g={color:l,error:c,helperText:u,size:f,variant:h},[y,b]=m.useState(t.value||[]),v=Sn(),C=gt();m.useEffect(()=>{const j=t.value??[];b(j.map(String))},[t.value]);const S=m.useCallback((j,w)=>{b(w.map(String)),n(q({},t,{value:[...w.map(k=>r==="number"?Number(k):k)]}))},[n,t,r]);return s.jsx(sa,q({multiple:!0,freeSolo:!0,options:[],filterOptions:(j,w)=>{const{inputValue:k}=w;return k==null||k===""?[]:[k]},id:v,value:y,onChange:S,renderTags:(j,w)=>j.map((k,P)=>{const T=w({index:P}),{key:$}=T,M=St(T,fq);return s.jsx(C.slots.baseChip,q({variant:"outlined",size:"small",label:k},M),$)}),renderInput:j=>{var w;return s.jsx(C.slots.baseTextField,q({},j,{label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:q({},j.InputLabelProps,{shrink:!0}),inputRef:i,type:r||"text"},g,(w=C.slotProps)==null?void 0:w.baseTextField))}},p))}var Fi=(function(e){return e.Cell="cell",e.Row="row",e})(Fi||{}),kn=(function(e){return e.Edit="edit",e.View="view",e})(kn||{}),Mn=(function(e){return e.Edit="edit",e.View="view",e})(Mn||{}),Io=(function(e){return e.And="and",e.Or="or",e})(Io||{}),nl=(function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e.pasteKeyDown="pasteKeyDown",e})(nl||{}),Zs=(function(e){return e.cellFocusOut="cellFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e})(Zs||{}),ta=(function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e})(ta||{}),Ci=(function(e){return e.rowFocusOut="rowFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e})(Ci||{});function XR(e){return e.field!==void 0}const ZR={filteredRowsLookup:{},filteredChildrenCountLookup:{},filteredDescendantCountLookup:{}},_p=()=>({items:[],logicOperator:Io.And,quickFilterValues:[],quickFilterLogicOperator:Io.And});function JR(e){return{current:e.current.getPublicApi()}}let na=(function(e){return e.LEFT="left",e.RIGHT="right",e})({});const ex={left:[],right:[]},e$=e=>e.isRtl,Oi=e=>e.columns,ul=Tt(Oi,e=>e.orderedFields),Pl=Tt(Oi,e=>e.lookup),Ls=fn(ul,Pl,(e,t)=>e.map(n=>t[n])),Ms=Tt(Oi,e=>e.columnVisibilityModel),fr=fn(Ls,Ms,(e,t)=>e.filter(n=>t[n.field]!==!1)),Qd=fn(fr,e=>e.map(t=>t.field)),t$=e=>e.pinnedColumns;fn(t$,ul,e$,(e,t,n)=>n$(e,t,n));const Yd=fn(Oi,t$,Qd,e$,(e,t,n,r)=>{const o=n$(t,n,r);return{left:o.left.map(l=>e.lookup[l]),right:o.right.map(l=>e.lookup[l])}});function n$(e,t,n){var c,u;if(!Array.isArray(e.left)&&!Array.isArray(e.right)||((c=e.left)==null?void 0:c.length)===0&&((u=e.right)==null?void 0:u.length)===0)return ex;const r=(f,h)=>Array.isArray(f)?f.filter(p=>h.includes(p)):[],o=r(e.left,t),i=t.filter(f=>!o.includes(f)),l=r(e.right,i);return n?{left:l,right:o}:{left:o,right:l}}const _a=fn(fr,e=>{const t=[];let n=0;for(let r=0;r<e.length;r+=1)t.push(n),n+=e[r].computedWidth;return t}),r$=fn(Ls,e=>e.filter(t=>t.filterable)),pq=fn(Ls,e=>e.reduce((t,n)=>(n.filterable&&(t[n.field]=n),t),{})),hq=fn(Ls,e=>e.some(t=>t.colSpan!==void 0));let Qf;function mq(){if(Qf!==void 0)return Qf;try{Qf=new Function("return true")()}catch{Qf=!1}return Qf}const cC=(e,t)=>{const n=q({},e);if(n.id==null&&(n.id=Math.round(Math.random()*1e5)),n.operator==null){const r=Pl(t)[n.field];n.operator=r&&r.filterOperators[0].value}return n},qw=(e,t,n)=>{const r=e.items.length>1;let o;r&&t?o=[e.items[0]]:o=e.items;const i=r&&o.some(c=>c.id==null);return o.some(c=>c.operator==null)||i?q({},e,{items:o.map(c=>cC(c,n))}):e.items!==o?q({},e,{items:o}):e},$I=(e,t,n)=>r=>q({},r,{filterModel:qw(e,t,n)}),Hp=e=>typeof e=="string"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,o$=(e,t)=>{var h;if(!e.field||!e.operator)return null;const n=t.current.getColumn(e.field);if(!n)return null;let r;if(n.valueParser){const p=n.valueParser;r=Array.isArray(e.value)?(h=e.value)==null?void 0:h.map(g=>p(g,void 0,n,t)):p(e.value,void 0,n,t)}else r=e.value;const{ignoreDiacritics:o}=t.current.rootProps;o&&(r=Hp(r));const i=q({},e,{value:r}),l=n.filterOperators;if(!(l!=null&&l.length))throw new Error(`MUI X: No filter operators found for column '${n.field}'.`);const c=l.find(p=>p.value===i.operator);if(!c)throw new Error(`MUI X: No filter operator found for column '${n.field}' and operator value '${i.operator}'.`);const u=JR(t),f=c.getApplyFilterFn(i,n);return typeof f!="function"?null:{item:i,fn:p=>{let g=t.current.getRowValue(p,n);return o&&(g=Hp(g)),f(g,p,n,u)}}};let OI=1;const gq=(e,t,n)=>{const{items:r}=e,o=r.map(c=>o$(c,t)).filter(c=>!!c);if(o.length===0)return null;if(n||!mq())return(c,u)=>{const f={};for(let h=0;h<o.length;h+=1){const p=o[h];(!u||u(p.item.field))&&(f[p.item.id]=p.fn(c))}return f};const i=new Function("appliers","row","shouldApplyFilter",`"use strict";
|
|
305
|
+
${o.map((c,u)=>`const shouldApply${u} = !shouldApplyFilter || shouldApplyFilter(${JSON.stringify(c.item.field)});`).join(`
|
|
306
|
+
`)}
|
|
307
|
+
|
|
308
|
+
const result$$ = {
|
|
309
|
+
${o.map((c,u)=>` ${JSON.stringify(String(c.item.id))}: !shouldApply${u} ? false : appliers[${u}].fn(row),`).join(`
|
|
310
|
+
`)}
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
return result$$;`.replaceAll("$$",String(OI)));return OI+=1,(c,u)=>i(o,c,u)},s$=e=>e.quickFilterExcludeHiddenColumns??!0,xq=(e,t)=>{var c;const n=((c=e.quickFilterValues)==null?void 0:c.filter(Boolean))??[];if(n.length===0)return null;const r=s$(e)?Qd(t):ul(t),o=[],{ignoreDiacritics:i}=t.current.rootProps,l=JR(t);return r.forEach(u=>{const f=t.current.getColumn(u),h=f==null?void 0:f.getApplyQuickFilterFn;h&&o.push({column:f,appliers:n.map(p=>{const g=i?Hp(p):p;return{fn:h(g,f,l)}})})}),function(f,h){const p={};e:for(let g=0;g<n.length;g+=1){const y=n[g];for(let b=0;b<o.length;b+=1){const{column:v,appliers:C}=o[b],{field:S}=v;if(h&&!h(S))continue;const j=C[g];let w=t.current.getRowValue(f,v);if(j.fn===null)continue;if(i&&(w=Hp(w)),j.fn(w,f,v,l)){p[y]=!0;continue e}}p[y]=!1}return p}},yq=(e,t,n)=>{const r=gq(e,t,n),o=xq(e,t);return function(l,c,u){u.passingFilterItems=(r==null?void 0:r(l,c))??null,u.passingQuickFilterValues=(o==null?void 0:o(l,c))??null}},zI=e=>e!=null,bq=(e,t,n)=>(e.cleanedFilterItems||(e.cleanedFilterItems=n.filter(r=>o$(r,t)!==null)),e.cleanedFilterItems),vq=(e,t,n,r,o)=>{const i=bq(o,r,n.items),l=e.filter(zI),c=t.filter(zI);if(l.length>0){const u=h=>l.some(p=>p[h.id]);if((n.logicOperator??_p().logicOperator)===Io.And){if(!i.every(u))return!1}else if(!i.some(u))return!1}if(c.length>0&&n.quickFilterValues!=null){const u=h=>c.some(p=>p[h]);if((n.quickFilterLogicOperator??_p().quickFilterLogicOperator)===Io.And){if(!n.quickFilterValues.every(u))return!1}else if(!n.quickFilterValues.some(u))return!1}return!0},Cq=e=>{if(!e)return null;const t=new RegExp(Jg(e),"i");return(n,r,o,i)=>{let l=i.current.getRowFormattedValue(r,o);return i.current.ignoreDiacritics&&(l=Hp(l)),l!=null?t.test(l.toString()):!1}},LI=(e,t)=>n=>{if(!n.value)return null;const r=e?n.value:n.value.trim(),o=new RegExp(Jg(r),"i");return i=>{if(i==null)return t;const l=o.test(String(i));return t?!l:l}},DI=(e,t)=>n=>{if(!n.value)return null;const r=e?n.value:n.value.trim(),o=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return i=>{if(i==null)return t;const l=o.compare(r,i.toString())===0;return t?!l:l}},AI=e=>()=>t=>{const n=t===""||t==null;return e?!n:n},wq=(e=!1)=>[{value:"contains",getApplyFilterFn:LI(e,!1),InputComponent:Ps},{value:"doesNotContain",getApplyFilterFn:LI(e,!0),InputComponent:Ps},{value:"equals",getApplyFilterFn:DI(e,!1),InputComponent:Ps},{value:"doesNotEqual",getApplyFilterFn:DI(e,!0),InputComponent:Ps},{value:"startsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`^${Jg(n)}.*$`,"i");return o=>o!=null?r.test(o.toString()):!1},InputComponent:Ps},{value:"endsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`.*${Jg(n)}$`,"i");return o=>o!=null?r.test(o.toString()):!1},InputComponent:Ps},{value:"isEmpty",getApplyFilterFn:AI(!1),requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:AI(!0),requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:t=>{if(!Array.isArray(t.value)||t.value.length===0)return null;const n=e?t.value:t.value.map(o=>o.trim()),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return o=>o!=null?n.some(i=>r.compare(i,o.toString()||"")===0):!1},InputComponent:YR}],di={width:100,minWidth:50,maxWidth:1/0,hideable:!0,sortable:!0,resizable:!0,filterable:!0,groupable:!0,pinnable:!0,aggregable:!0,editable:!1,sortComparator:oq,type:"string",align:"left",filterOperators:wq(),renderEditCell:q7,getApplyQuickFilterFn:Cq},Sq=["open","target","onClose","children","position","className","onExited"],jq=e=>{const{classes:t}=e;return Be({root:["menu"]},en,t)},kq=Ce(Uc,{name:"MuiDataGrid",slot:"Menu",overridesResolver:(e,t)=>t.menu})(({theme:e})=>({zIndex:e.zIndex.modal,[`& .${te.menuList}`]:{outline:0}})),Iq={"bottom-start":"top left","bottom-end":"top right"};function Kw(e){var v;const{open:t,target:n,onClose:r,children:o,position:i,className:l,onExited:c}=e,u=St(e,Sq),f=Ut(),h=gt(),p=jq(h),g=m.useRef(null);Ln(()=>{var C,S;t?g.current=document.activeElement instanceof HTMLElement?document.activeElement:null:((S=(C=g.current)==null?void 0:C.focus)==null||S.call(C),g.current=null)},[t]),m.useEffect(()=>{const C=t?"menuOpen":"menuClose";f.current.publishEvent(C,{target:n})},[f,t,n]);const y=C=>S=>{C&&C(),c&&c(S)},b=C=>{C.target&&(n===C.target||n!=null&&n.contains(C.target))||r(C)};return s.jsx(kq,q({as:h.slots.basePopper,className:Me(p.root,l),ownerState:h,open:t,anchorEl:n,transition:!0,placement:i},u,(v=h.slotProps)==null?void 0:v.basePopper,{children:({TransitionProps:C,placement:S})=>s.jsx(Iw,{onClickAway:b,mouseEvent:"onMouseDown",children:s.jsx(yd,q({},C,{style:{transformOrigin:Iq[S]},onExited:y(C==null?void 0:C.onExited),children:s.jsx(Un,{children:o})}))})}))}const Eq=["api","colDef","id","hasFocus","isEditable","field","value","formattedValue","row","rowNode","cellMode","tabIndex","position","focusElementRef"],Pq=e=>typeof e.getActions=="function";function Tq(e){var D;const{colDef:t,id:n,hasFocus:r,tabIndex:o,position:i="bottom-end",focusElementRef:l}=e,c=St(e,Eq),[u,f]=m.useState(-1),[h,p]=m.useState(!1),g=Ut(),y=m.useRef(null),b=m.useRef(null),v=m.useRef(!1),C=m.useRef({}),S=Yr(),j=Sn(),w=Sn(),k=gt();if(!Pq(t))throw new Error("MUI X: Missing the `getActions` property in the `GridColDef`.");const P=t.getActions(g.current.getRowParams(n)),T=P.filter(H=>!H.props.showInMenu),$=P.filter(H=>H.props.showInMenu),M=T.length+($.length?1:0);m.useLayoutEffect(()=>{r||Object.entries(C.current).forEach(([H,B])=>{B==null||B.stop({},()=>{delete C.current[H]})})},[r]),m.useEffect(()=>{if(u<0||!y.current||u>=y.current.children.length)return;y.current.children[u].focus({preventScroll:!0})},[u]),m.useEffect(()=>{r||(f(-1),v.current=!1)},[r]),m.useImperativeHandle(l,()=>({focus(){if(!v.current){const H=P.findIndex(B=>!B.props.disabled);f(H)}}}),[P]),m.useEffect(()=>{u>=M&&f(M-1)},[u,M]);const R=()=>{p(!0),f(M-1),v.current=!0},E=()=>{p(!1)},O=H=>{H.stopPropagation(),H.preventDefault(),h?E():R()},A=H=>B=>{C.current[H]=B},N=(H,B)=>V=>{f(H),v.current=!0,B&&B(V)},F=H=>{if(M<=1)return;const B=(G,_)=>{var Q;if(G<0||G>P.length)return G;const Z=(_==="left"?-1:1)*(S?-1:1);return(Q=P[G+Z])!=null&&Q.props.disabled?B(G+Z,_):G+Z};let V=u;H.key==="ArrowRight"?V=B(u,"right"):H.key==="ArrowLeft"&&(V=B(u,"left")),!(V<0||V>=M)&&V!==u&&(H.preventDefault(),H.stopPropagation(),f(V))},L=H=>{H.key==="Tab"&&H.preventDefault(),["Tab","Escape"].includes(H.key)&&E()};return s.jsxs("div",q({role:"menu",ref:y,tabIndex:-1,className:te.actionsCell,onKeyDown:F},c,{children:[T.map((H,B)=>m.cloneElement(H,{key:B,touchRippleRef:A(B),onClick:N(B,H.props.onClick),tabIndex:u===B?o:-1})),$.length>0&&w&&s.jsx(k.slots.baseIconButton,q({ref:b,id:w,"aria-label":g.current.getLocaleText("actionsCellMore"),"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?j:void 0,role:"menuitem",size:"small",onClick:O,touchRippleRef:A(w),tabIndex:u===T.length?o:-1},(D=k.slotProps)==null?void 0:D.baseIconButton,{children:s.jsx(k.slots.moreActionsIcon,{fontSize:"small"})})),$.length>0&&s.jsx(Kw,{open:h,target:b.current,position:i,onClose:E,children:s.jsx(Ux,{id:j,className:te.menuList,onKeyDown:L,"aria-labelledby":w,variant:"menu",autoFocusItem:!0,children:$.map((H,B)=>m.cloneElement(H,{key:B,closeMenu:E}))})})]}))}const Mq=e=>s.jsx(Tq,q({},e)),Zx="actions",Rq=q({},di,{sortable:!1,filterable:!1,aggregable:!1,width:100,display:"flex",align:"center",headerAlign:"center",headerName:"",disableColumnMenu:!0,disableExport:!0,renderCell:Mq,getApplyQuickFilterFn:void 0}),ro="auto-generated-group-node-root",wd=Symbol("mui.id_autogenerated"),$q=()=>({type:"group",id:ro,depth:-1,groupingField:null,groupingKey:null,isAutoGenerated:!0,children:[],childrenFromPath:{},childrenExpanded:!0,parent:null});function Oq(e,t,n="A row was provided without id in the rows prop:"){if(e==null)throw new Error(["MUI X: The Data Grid component requires all rows to have a unique `id` property.","Alternatively, you can use the `getRowId` prop to specify a custom id for each row.",n,JSON.stringify(t)].join(`
|
|
314
|
+
`))}const Jx=(e,t,n)=>{const r=t?t(e):e.id;return Oq(r,e,n),r},Tg=({rows:e,getRowId:t,loading:n,rowCount:r})=>{const o={type:"full",rows:[]},i={},l={};for(let c=0;c<e.length;c+=1){const u=e[c],f=Jx(u,t);i[f]=u,l[f]=f,o.rows.push(f)}return{rowsBeforePartialUpdates:e,loadingPropBeforePartialUpdates:n,rowCountPropBeforePartialUpdates:r,updates:o,dataRowIdToIdLookup:l,dataRowIdToModelLookup:i}},i$=({tree:e,rowCountProp:t=0})=>{const n=e[ro];return Math.max(t,n.children.length+(n.footerId==null?0:1))},l$=({apiRef:e,rowCountProp:t=0,loadingProp:n,previousTree:r,previousTreeDepths:o,previousGroupsToFetch:i})=>{const l=e.current.caches.rows,{tree:c,treeDepths:u,dataRowIds:f,groupingName:h,groupsToFetch:p=[]}=e.current.applyStrategyProcessor("rowTreeCreation",{previousTree:r,previousTreeDepths:o,updates:l.updates,dataRowIdToIdLookup:l.dataRowIdToIdLookup,dataRowIdToModelLookup:l.dataRowIdToModelLookup,previousGroupsToFetch:i}),g=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:c,treeDepths:u,dataRowIdToIdLookup:l.dataRowIdToIdLookup,dataRowIds:f,dataRowIdToModelLookup:l.dataRowIdToModelLookup});return e.current.caches.rows.updates={type:"partial",actions:{insert:[],modify:[],remove:[]},idToActionLookup:{}},q({},g,{totalRowCount:Math.max(t,g.dataRowIds.length),totalTopLevelRowCount:i$({tree:g.tree,rowCountProp:t}),groupingName:h,loading:n,groupsToFetch:p})},Sd=e=>e.type==="skeletonRow"||e.type==="footer"||e.type==="group"&&e.isAutoGenerated||e.type==="pinnedRow"&&e.isAutoGenerated,Qw=(e,t,n)=>{const r=e[t];if(r.type!=="group")return[];const o=[];for(let i=0;i<r.children.length;i+=1){const l=r.children[i];(!n||!Sd(e[l]))&&o.push(l);const c=Qw(e,l,n);for(let u=0;u<c.length;u+=1)o.push(c[u])}return!n&&r.footerId!=null&&o.push(r.footerId),o},FI=({previousCache:e,getRowId:t,updates:n,groupKeys:r})=>{if(e.updates.type==="full")throw new Error("MUI X: Unable to prepare a partial update if a full update is not applied yet.");const o=new Map;n.forEach(h=>{const p=Jx(h,t,"A row was provided without id when calling updateRows():");o.has(p)?o.set(p,q({},o.get(p),h)):o.set(p,h)});const i={type:"partial",actions:{insert:[...e.updates.actions.insert??[]],modify:[...e.updates.actions.modify??[]],remove:[...e.updates.actions.remove??[]]},idToActionLookup:q({},e.updates.idToActionLookup),groupKeys:r},l=q({},e.dataRowIdToModelLookup),c=q({},e.dataRowIdToIdLookup),u={insert:{},modify:{},remove:{}};o.forEach((h,p)=>{const g=i.idToActionLookup[p];if(h._action==="delete"){if(g==="remove"||!l[p])return;g!=null&&(u[g][p]=!0),i.actions.remove.push(p),delete l[p],delete c[p];return}const y=l[p];if(y){g==="remove"?(u.remove[p]=!0,i.actions.modify.push(p)):g==null&&i.actions.modify.push(p),l[p]=q({},y,h);return}g==="remove"?(u.remove[p]=!0,i.actions.insert.push(p)):g==null&&i.actions.insert.push(p),l[p]=h,c[p]=p});const f=Object.keys(u);for(let h=0;h<f.length;h+=1){const p=f[h],g=u[p];Object.keys(g).length>0&&(i.actions[p]=i.actions[p].filter(y=>!g[y]))}return{dataRowIdToModelLookup:l,dataRowIdToIdLookup:c,updates:i,rowsBeforePartialUpdates:e.rowsBeforePartialUpdates,loadingPropBeforePartialUpdates:e.loadingPropBeforePartialUpdates,rowCountPropBeforePartialUpdates:e.rowCountPropBeforePartialUpdates}},a$="var(--DataGrid-overlayHeight, calc(var(--height) * 2))";function NI(e,t,n){const r=[];return t.forEach(o=>{const i=Jx(o,n,"A row was provided without id when calling updateRows():"),l=e.current.getRowNode(i);if((l==null?void 0:l.type)==="pinnedRow"){const c=e.current.caches.pinnedRows,u=c.idLookup[i];u&&(c.idLookup[i]=q({},u,o))}else r.push(o)}),r}const c$=(e,t,n)=>typeof e=="number"&&e>0?e:t,zq="__tree_data_group__",u$="__row_group_by_columns_group__",ey="__detail_panel_toggle__";let Qt=(function(e){return e[e.NONE=0]="NONE",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.VIRTUAL=3]="VIRTUAL",e})({});const Lq=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex","hideDescendantCount"],Dq=e=>{const{classes:t}=e;return Be({root:["booleanCell"]},en,t)};function Aq(e){const{value:t,rowNode:n}=e,r=St(e,Lq),o=Ut(),i=gt(),l={classes:i.classes},c=Dq(l),f=He(o,Kc)>0&&n.type==="group"&&i.treeData===!1,h=m.useMemo(()=>t?i.slots.booleanCellTrueIcon:i.slots.booleanCellFalseIcon,[i.slots.booleanCellFalseIcon,i.slots.booleanCellTrueIcon,t]);return f&&t===void 0?null:s.jsx(h,q({fontSize:"small",className:c.root,titleAccess:o.current.getLocaleText(t?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":!!t},r))}const Fq=m.memo(Aq),Nq=e=>e.field!==u$&&Sd(e.rowNode)?"":s.jsx(Fq,q({},e)),_q=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange"],Hq=e=>{const{classes:t}=e;return Be({root:["editBooleanCell"]},en,t)};function Bq(e){var S;const{id:t,value:n,field:r,className:o,hasFocus:i,onValueChange:l}=e,c=St(e,_q),u=Ut(),f=m.useRef(null),h=Sn(),[p,g]=m.useState(n),y=gt(),b={classes:y.classes},v=Hq(b),C=m.useCallback(async j=>{const w=j.target.checked;l&&await l(j,w),g(w),await u.current.setEditCellValue({id:t,field:r,value:w},j)},[u,r,t,l]);return m.useEffect(()=>{g(n)},[n]),Ln(()=>{i&&f.current.focus()},[i]),s.jsx("label",q({htmlFor:h,className:Me(v.root,o)},c,{children:s.jsx(y.slots.baseCheckbox,q({id:h,inputRef:f,checked:!!p,onChange:C,size:"small"},(S=y.slotProps)==null?void 0:S.baseCheckbox))}))}const Wq=e=>s.jsx(Bq,q({},e)),Vq=["item","applyValue","apiRef","focusElementRef","isFilterActive","clearButton","tabIndex","label","variant","InputLabelProps"],Mg=e=>{if(String(e).toLowerCase()==="true")return!0;if(String(e).toLowerCase()==="false")return!1},Gq=Ce("div")({display:"flex",alignItems:"center",width:"100%","& button":{margin:"auto 0px 5px 5px"}});function Uq(e){var k,P,T;const{item:t,applyValue:n,apiRef:r,focusElementRef:o,clearButton:i,tabIndex:l,label:c,variant:u="standard"}=e,f=St(e,Vq),[h,p]=m.useState(Mg(t.value)),g=gt(),y=Sn(),b=Sn(),v=((k=g.slotProps)==null?void 0:k.baseSelect)||{},C=v.native??!1,S=((P=g.slotProps)==null?void 0:P.baseSelectOption)||{},j=m.useCallback($=>{const M=Mg($.target.value);p(M),n(q({},t,{value:M}))},[n,t]);m.useEffect(()=>{p(Mg(t.value))},[t.value]);const w=c??r.current.getLocaleText("filterPanelInputLabel");return s.jsxs(Gq,{children:[s.jsxs(g.slots.baseFormControl,{fullWidth:!0,children:[s.jsx(g.slots.baseInputLabel,q({},(T=g.slotProps)==null?void 0:T.baseInputLabel,{id:y,shrink:!0,variant:u,children:w})),s.jsxs(g.slots.baseSelect,q({labelId:y,id:b,label:w,value:h===void 0?"":String(h),onChange:j,variant:u,notched:u==="outlined"?!0:void 0,native:C,displayEmpty:!0,inputProps:{ref:o,tabIndex:l}},f,v,{children:[s.jsx(g.slots.baseSelectOption,q({},S,{native:C,value:"",children:r.current.getLocaleText("filterValueAny")})),s.jsx(g.slots.baseSelectOption,q({},S,{native:C,value:"true",children:r.current.getLocaleText("filterValueTrue")})),s.jsx(g.slots.baseSelectOption,q({},S,{native:C,value:"false",children:r.current.getLocaleText("filterValueFalse")}))]}))]}),i]})}const qq=()=>[{value:"is",getApplyFilterFn:e=>{const t=Mg(e.value);return t===void 0?null:n=>!!n===t},InputComponent:Uq}],Kq=(e,t,n,r)=>e?r.current.getLocaleText("booleanCellTrueLabel"):r.current.getLocaleText("booleanCellFalseLabel"),Qq=e=>{switch(e.toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case"null":case"undefined":return!1;default:return}},d$=q({},di,{type:"boolean",display:"flex",align:"center",headerAlign:"center",renderCell:Nq,renderEditCell:Wq,sortComparator:qR,valueFormatter:Kq,filterOperators:qq(),getApplyQuickFilterFn:void 0,aggregable:!1,pastedValueParser:e=>Qq(e)}),f$=e=>e.sorting,Xd=Tt(f$,e=>e.sortedRows),Yw=fn(Xd,Ts,Pr,(e,t,n)=>e.reduce((r,o)=>{const i=t[o];if(i)r.push({id:o,model:i});else{const l=n[o];l&&Sd(l)&&r.push({id:o,model:{[wd]:o}})}return r},[])),Js=Tt(f$,e=>e.sortModel),Yq=fn(Js,e=>e.reduce((n,r,o)=>(n[r.field]={sortDirection:r.sort,sortIndex:e.length>1?o+1:void 0},n),{}));fn(Xd,e=>e.reduce((t,n,r)=>(t[n]=r,t),Object.create(null)));const ty=e=>e.filter,Vr=Tt(ty,e=>e.filterModel),Xq=Tt(Vr,e=>e.quickFilterValues),Zq=e=>e.visibleRowsLookup,Zd=Tt(ty,e=>e.filteredRowsLookup);Tt(ty,e=>e.filteredChildrenCountLookup);Tt(ty,e=>e.filteredDescendantCountLookup);const Ha=fn(Zq,Yw,Kc,Vr,Xq,(e,t,n,r,o)=>n<2&&!r.items.length&&!(o!=null&&o.length)?t:t.filter(i=>e[i.id]!==!1)),Xu=fn(Ha,e=>e.map(t=>t.id)),p$=fn(Zd,Yw,(e,t)=>t.filter(n=>e[n.id]!==!1)),h$=fn(p$,e=>e.map(t=>t.id));fn(Xu,Pr,(e,t)=>{const n={};let r=0;return e.reduce((o,i)=>{const l=t[i];return n[l.depth]||(n[l.depth]=0),l.depth>r&&(n[l.depth]=0),r=l.depth,n[l.depth]+=1,o[i]=n[l.depth],o},{})});const m$=fn(Ha,Pr,Kc,(e,t,n)=>n<2?e:e.filter(r=>{var o;return((o=t[r.id])==null?void 0:o.depth)===0})),Xw=Tt(Ha,e=>e.length),Zw=Tt(m$,e=>e.length),Jq=Tt(p$,e=>e.length);Tt(Jq,Zw,(e,t)=>e-t);const g$=fn(Vr,Pl,(e,t)=>{var n;return(n=e.items)==null?void 0:n.filter(r=>{var l,c;if(!r.field)return!1;const o=t[r.field];if(!(o!=null&&o.filterOperators)||((l=o==null?void 0:o.filterOperators)==null?void 0:l.length)===0)return!1;const i=o.filterOperators.find(u=>u.value===r.operator);return i?!i.InputComponent||r.value!=null&&((c=r.value)==null?void 0:c.toString())!=="":!1})}),eK=fn(g$,e=>e.reduce((n,r)=>(n[r.field]?n[r.field].push(r):n[r.field]=[r],n),{})),ns=e=>e.rowSelection,tK=Tt(ns,e=>e.length),nK=fn(ns,Ts,(e,t)=>new Map(e.map(n=>[n,t[n]]))),Ia=fn(ns,e=>e.reduce((t,n)=>(t[n]=n,t),{}));function x$(e,t){var u;const n=Pr(e),r=Xd(e),o=Zd(e),i=n[t];if(!i||i.type!=="group")return[];const l=[],c=r.findIndex(f=>f===t)+1;for(let f=c;f<r.length&&((u=n[r[f]])==null?void 0:u.depth)>i.depth;f+=1){const h=r[f];o[h]!==!1&&e.current.isRowSelectable(h)&&l.push(h)}return l}function rK(e,t){return Tt(Pr,Xd,Zd,Ia,(n,r,o,i)=>{var h;const l=n[e];if(!l||l.type!=="group")return{isIndeterminate:!1,isChecked:i[e]===e};if(i[e]===e)return{isIndeterminate:!1,isChecked:!0};let c=0,u=0;const f=r.findIndex(p=>p===e)+1;for(let p=f;p<r.length&&((h=n[r[p]])==null?void 0:h.depth)>l.depth;p+=1){const g=r[p];o[g]!==!1&&(c+=1,i[g]!==void 0&&(u+=1))}return{isIndeterminate:u>0&&(u<c||i[e]===void 0),isChecked:t?u>0:i[e]===e}})}function Jw(e){return e.signature===zs.DataGrid?e.checkboxSelection&&e.disableMultipleRowSelection!==!0:!e.disableMultipleRowSelection}const oK=(e,t)=>{const n=[];let r=t;for(;r!=null&&r!==ro;){const o=e[r];if(!o)return n;n.push(r),r=o.parent}return n},sK=(e,t,n)=>{const r=e[n];if(!r)return[];const o=r.parent;return o==null?[]:e[o].children.filter(l=>l!==n&&t[l]!==!1)},Yf=(e,t,n,r,o,i,l=new Set(ns(e.current.state)))=>{const c=Zd(e),u=new Set([]);if(!(!r&&!o||c[n]===!1)){if(r){const f=t[n];(f==null?void 0:f.type)==="group"&&x$(e,n).forEach(p=>{i(p),u.add(p)})}if(o){const f=p=>{if(!l.has(p)&&!u.has(p))return!1;const g=t[p];return g?g.type!=="group"?!0:g.children.every(f):!1},h=p=>{const g=sK(t,c,p);if(g.length===0||g.every(f)){const y=t[p],b=y==null?void 0:y.parent;b!=null&&b!==ro&&e.current.isRowSelectable(b)&&(i(b),u.add(b),h(b))}};h(n)}}},_I=(e,t,n,r,o,i)=>{const l=Ia(e);if(!(!o&&!r)&&(o&&oK(t,n).forEach(u=>{l[u]===u&&i(u)}),r)){const c=t[n];(c==null?void 0:c.type)==="group"&&x$(e,n).forEach(f=>{i(f)})}},iK=["field","id","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","api"],lK=e=>{const{classes:t}=e;return Be({root:["checkboxInput"]},en,t)},aK=sn(function(t,n){var M,R;const{field:r,id:o,rowNode:i,hasFocus:l,tabIndex:c}=t,u=St(t,iK),f=Ut(),h=gt(),p={classes:h.classes},g=lK(p),y=m.useRef(null),b=m.useRef(null),v=Pn(y,n),C=E=>{const O={value:E.target.checked,id:o};f.current.publishEvent("rowSelectionCheckboxChange",O,E)};m.useLayoutEffect(()=>{if(c===0){const E=f.current.getCellElement(o,r);E&&(E.tabIndex=-1)}},[f,c,o,r]),m.useEffect(()=>{var E;if(l){const O=(E=y.current)==null?void 0:E.querySelector("input");O==null||O.focus({preventScroll:!0})}else b.current&&b.current.stop({})},[l]);const S=m.useCallback(E=>{E.key===" "&&E.stopPropagation()},[]),j=f.current.isRowSelectable(o),w=rK(o,((M=h.rowSelectionPropagation)==null?void 0:M.parents)??!1),{isIndeterminate:k,isChecked:P}=He(f,w,Ww);if(i.type==="footer"||i.type==="pinnedRow")return null;const T=h.indeterminateCheckboxAction==="select"?P&&!k:P,$=f.current.getLocaleText(T?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return s.jsx(h.slots.baseCheckbox,q({tabIndex:c,checked:T,onChange:C,className:g.root,inputProps:{"aria-label":$,name:"select_row"},onKeyDown:S,indeterminate:k,disabled:!j,touchRippleRef:b},(R=h.slotProps)==null?void 0:R.baseCheckbox,u,{ref:v}))}),cK=aK,ny=e=>e.focus,_o=Tt(ny,e=>e.cell),uK=Tt(ny,e=>e.columnHeader);Tt(ny,e=>e.columnHeaderFilter);const tx=Tt(ny,e=>e.columnGroupHeader),ry=e=>e.tabIndex,eS=Tt(ry,e=>e.cell),y$=Tt(ry,e=>e.columnHeader);Tt(ry,e=>e.columnHeaderFilter);const dK=Tt(ry,e=>e.columnGroupHeader);function Gt(e,t,n){const r=m.useRef(!0);Ln(()=>{r.current=!1,e.current.register(n,t)},[e,n,t]),r.current&&e.current.register(n,t)}function Fr(e,t){const n=m.useRef(null);if(n.current)return n.current;const r=e.current.getLogger(t);return n.current=r,r}const b$=(e,t,n,r,o)=>{const i=Fr(e,"useNativeEventListener");En(e,"rootMount",()=>{const l=typeof t=="function"?t():t.current;if(!(!l||!n||!r))return i.debug(`Binding native ${n} event`),l.addEventListener(n,r,o),()=>{i.debug(`Clearing native ${n} event`),l.removeEventListener(n,r,o)}})},Sh=e=>{const t=m.useRef(!0);t.current&&(t.current=!1,e())},fK=()=>{},pK=(e,t)=>{const n=m.useRef(!1);Ln(()=>n.current||!e?fK:(n.current=!0,t()),[n.current||e])},hK=100,mK=e=>e?0:100,v$=(e,t,n)=>t>0&&e>0?Math.ceil(e/t):e===-1?n+2:0,C$=e=>({page:0,pageSize:e?0:100}),gK=(e,t=0)=>t===0?e:Math.max(Math.min(e,t-1),0),w$=(e,t)=>{if(t===zs.DataGrid&&e>hK)throw new Error(["MUI X: `pageSize` cannot exceed 100 in the MIT version of the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(`
|
|
315
|
+
`))},xK=-1,jh=e=>e.pagination,S$=Tt(jh,e=>e.enabled&&e.paginationMode==="client"),ho=Tt(jh,e=>e.paginationModel),Wu=Tt(jh,e=>e.rowCount),fp=Tt(jh,e=>e.meta),yK=Tt(ho,e=>e.page),j$=Tt(ho,e=>e.pageSize),k$=Tt(ho,Wu,(e,t)=>v$(t,e.pageSize,e.page)),tS=fn(S$,ho,Pr,Kc,Ha,m$,(e,t,n,r,o,i)=>{var b;if(!e)return null;const l=i.length,c=Math.min(t.pageSize*t.page,l-1),u=t.pageSize===xK?l-1:Math.min(c+t.pageSize-1,l-1);if(c===-1||u===-1)return null;if(r<2)return{firstRowIndex:c,lastRowIndex:u};const f=i[c],h=u-c+1,p=o.findIndex(v=>v.id===f.id);let g=p,y=0;for(;g<o.length&&y<=h;){const v=o[g],C=(b=n[v.id])==null?void 0:b.depth;C===void 0?g+=1:((y<h||C>0)&&(g+=1),C===0&&(y+=1))}return{firstRowIndex:p,lastRowIndex:g-1}}),bK=fn(Ha,tS,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),I$=fn(Xu,tS,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),kh=fn(S$,tS,bK,Ha,(e,t,n,r)=>e?{rows:n,range:t,rowToIndexMap:n.reduce((o,i,l)=>(o.set(i.model,l),o),new Map)}:{rows:r,range:r.length===0?null:{firstRowIndex:0,lastRowIndex:r.length-1},rowToIndexMap:r.reduce((o,i,l)=>(o.set(i.model,l),o),new Map)}),vK=["field","colDef"],CK=e=>{const{classes:t}=e;return Be({root:["checkboxInput"]},en,t)},wK=sn(function(t,n){var M;const r=St(t,vK),[,o]=m.useState(!1),i=Ut(),l=gt(),c={classes:l.classes},u=CK(c),f=He(i,y$),h=He(i,ns),p=He(i,Xu),g=He(i,I$),y=m.useMemo(()=>typeof l.isRowSelectable!="function"?h:h.filter(R=>l.keepNonExistentRowsSelected?!0:i.current.getRow(R)?l.isRowSelectable(i.current.getRowParams(R)):!1),[i,l.isRowSelectable,h,l.keepNonExistentRowsSelected]),b=m.useMemo(()=>(!l.pagination||!l.checkboxSelectionVisibleOnly||l.paginationMode==="server"?p:g).reduce((E,O)=>(E[O]=!0,E),{}),[l.pagination,l.paginationMode,l.checkboxSelectionVisibleOnly,g,p]),v=m.useMemo(()=>y.filter(R=>b[R]).length,[y,b]),C=v>0&&v<Object.keys(b).length,S=v>0,j=R=>{const E={value:R.target.checked};i.current.publishEvent("headerSelectionCheckboxChange",E)},w=f!==null&&f.field===t.field?0:-1;m.useLayoutEffect(()=>{const R=i.current.getColumnHeaderElement(t.field);w===0&&R&&(R.tabIndex=-1)},[w,i,t.field]);const k=m.useCallback(R=>{R.key===" "&&i.current.publishEvent("headerSelectionCheckboxChange",{value:!S})},[i,S]),P=m.useCallback(()=>{o(R=>!R)},[]);m.useEffect(()=>i.current.subscribeEvent("rowSelectionChange",P),[i,P]);const T=l.indeterminateCheckboxAction==="select"?S&&!C:S,$=i.current.getLocaleText(T?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows");return s.jsx(l.slots.baseCheckbox,q({indeterminate:C,checked:T,onChange:j,className:u.root,inputProps:{"aria-label":$,name:"select_all_rows"},tabIndex:w,onKeyDown:k,disabled:!Jw(l)},(M=l.slotProps)==null?void 0:M.baseCheckbox,r,{ref:n}))}),Ih=(e,t)=>wd in t?t[wd]:e.props.getRowId?e.props.getRowId(t):t.id,Ss="__check__",Jd=q({},d$,{type:"custom",field:Ss,width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:void 0,display:"flex",valueGetter:(e,t,n,r)=>{const o=Ia(r),i=Ih(r.current.state,t);return o[i]!==void 0},renderHeader:e=>s.jsx(wK,q({},e)),renderCell:e=>s.jsx(cK,q({},e))}),SK=["item","applyValue","type","apiRef","focusElementRef","InputProps","isFilterActive","clearButton","tabIndex","disabled"];function HI(e,t){if(e==null)return"";const n=new Date(e);return Number.isNaN(n.getTime())?"":t==="date"?n.toISOString().substring(0,10):t==="datetime-local"?(n.setMinutes(n.getMinutes()-n.getTimezoneOffset()),n.toISOString().substring(0,19)):n.toISOString().substring(0,10)}function Pu(e){var w;const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,InputProps:l,clearButton:c,tabIndex:u,disabled:f}=e,h=St(e,SK),p=Po(),[g,y]=m.useState(()=>HI(t.value,r)),[b,v]=m.useState(!1),C=Sn(),S=gt(),j=m.useCallback(k=>{p.clear();const P=k.target.value;y(P),v(!0),p.start(S.filterDebounceMs,()=>{const T=new Date(P);n(q({},t,{value:Number.isNaN(T.getTime())?void 0:T})),v(!1)})},[n,t,S.filterDebounceMs,p]);return m.useEffect(()=>{const k=HI(t.value,r);y(k)},[t.value,r]),s.jsx(S.slots.baseTextField,q({fullWidth:!0,id:C,label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),value:g,onChange:j,variant:"standard",type:r||"text",InputLabelProps:{shrink:!0},inputRef:i,InputProps:q({},b||c?{endAdornment:b?s.jsx(S.slots.loadIcon,{fontSize:"small",color:"action"}):c}:{},{disabled:f},l,{inputProps:q({max:r==="datetime-local"?"9999-12-31T23:59":"9999-12-31",tabIndex:u},l==null?void 0:l.inputProps)})},h,(w=S.slotProps)==null?void 0:w.baseTextField))}function Tu(e,t,n,r){if(!e.value)return null;const o=new Date(e.value);n?o.setSeconds(0,0):(o.setMinutes(o.getMinutes()+o.getTimezoneOffset()),o.setHours(0,0,0,0));const i=o.getTime();return l=>{if(!l)return!1;if(r)return t(l.getTime(),i);const c=new Date(l);return n?c.setSeconds(0,0):c.setHours(0,0,0,0),t(c.getTime(),i)}}const E$=e=>[{value:"is",getApplyFilterFn:t=>Tu(t,(n,r)=>n===r,e),InputComponent:Pu,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"not",getApplyFilterFn:t=>Tu(t,(n,r)=>n!==r,e),InputComponent:Pu,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"after",getApplyFilterFn:t=>Tu(t,(n,r)=>n>r,e),InputComponent:Pu,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFn:t=>Tu(t,(n,r)=>n>=r,e),InputComponent:Pu,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"before",getApplyFilterFn:t=>Tu(t,(n,r)=>n<r,e,!e),InputComponent:Pu,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrBefore",getApplyFilterFn:t=>Tu(t,(n,r)=>n<=r,e),InputComponent:Pu,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFn:()=>t=>t==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>t=>t!=null,requiresFilterValue:!1}],jK=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","inputProps","isValidating","isProcessingProps","onValueChange"],kK=Ce(Bd)({fontSize:"inherit"}),IK=e=>{const{classes:t}=e;return Be({root:["editInputCell"]},en,t)};function EK(e){const{id:t,value:n,field:r,colDef:o,hasFocus:i,inputProps:l,onValueChange:c}=e,u=St(e,jK),f=o.type==="dateTime",h=Ut(),p=m.useRef(null),g=m.useMemo(()=>{let k;n==null?k=null:n instanceof Date?k=n:k=new Date((n??"").toString());let P;return k==null||Number.isNaN(k.getTime())?P="":P=new Date(k.getTime()-k.getTimezoneOffset()*60*1e3).toISOString().substr(0,f?16:10),{parsed:k,formatted:P}},[n,f]),[y,b]=m.useState(g),C={classes:gt().classes},S=IK(C),j=m.useCallback(k=>{if(k==="")return null;const[P,T]=k.split("T"),[$,M,R]=P.split("-"),E=new Date;if(E.setFullYear(Number($),Number(M)-1,Number(R)),E.setHours(0,0,0,0),T){const[O,A]=T.split(":");E.setHours(Number(O),Number(A),0,0)}return E},[]),w=m.useCallback(async k=>{const P=k.target.value,T=j(P);c&&await c(k,T),b({parsed:T,formatted:P}),h.current.setEditCellValue({id:t,field:r,value:T},k)},[h,r,t,c,j]);return m.useEffect(()=>{b(k=>{var P,T;return g.parsed!==k.parsed&&((P=g.parsed)==null?void 0:P.getTime())!==((T=k.parsed)==null?void 0:T.getTime())?g:k})},[g]),Ln(()=>{i&&p.current.focus()},[i]),s.jsx(kK,q({inputRef:p,fullWidth:!0,className:S.root,type:f?"datetime-local":"date",inputProps:q({max:f?"9999-12-31T23:59":"9999-12-31"},l),value:y.formatted,onChange:w},u))}const P$=e=>s.jsx(EK,q({},e));function T$({value:e,columnType:t,rowId:n,field:r}){if(!(e instanceof Date))throw new Error([`MUI X: \`${t}\` column type only accepts \`Date\` objects as values.`,"Use `valueGetter` to transform the value into a `Date` object.",`Row ID: ${n}, field: "${r}".`].join(`
|
|
316
|
+
`))}const PK=(e,t,n,r)=>{if(!e)return"";const o=Ih(r.current.state,t);return T$({value:e,columnType:"date",rowId:o,field:n.field}),e.toLocaleDateString()},TK=(e,t,n,r)=>{if(!e)return"";const o=Ih(r.current.state,t);return T$({value:e,columnType:"dateTime",rowId:o,field:n.field}),e.toLocaleString()},MK=q({},di,{type:"date",sortComparator:KR,valueFormatter:PK,filterOperators:E$(),renderEditCell:P$,pastedValueParser:e=>new Date(e)}),RK=q({},di,{type:"dateTime",sortComparator:KR,valueFormatter:TK,filterOperators:E$(!0),renderEditCell:P$,pastedValueParser:e=>new Date(e)}),ra=e=>e==null?null:Number(e),$K=e=>e==null||Number.isNaN(e)||e===""?null:t=>ra(t)===ra(e),OK=()=>[{value:"=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>ra(t)===e.value,InputComponent:Ps,InputComponentProps:{type:"number"}},{value:"!=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>ra(t)!==e.value,InputComponent:Ps,InputComponentProps:{type:"number"}},{value:">",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:ra(t)>e.value,InputComponent:Ps,InputComponentProps:{type:"number"}},{value:">=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:ra(t)>=e.value,InputComponent:Ps,InputComponentProps:{type:"number"}},{value:"<",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:ra(t)<e.value,InputComponent:Ps,InputComponentProps:{type:"number"}},{value:"<=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:ra(t)<=e.value,InputComponent:Ps,InputComponentProps:{type:"number"}},{value:"isEmpty",getApplyFilterFn:()=>e=>e==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>e=>e!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:e=>!Array.isArray(e.value)||e.value.length===0?null:t=>t!=null&&e.value.includes(Number(t)),InputComponent:YR,InputComponentProps:{type:"number"}}],zK=q({},di,{type:"number",align:"right",headerAlign:"right",sortComparator:qR,valueParser:e=>e===""?null:Number(e),valueFormatter:e=>iq(e)?e.toLocaleString():e||"",filterOperators:OK(),getApplyQuickFilterFn:$K});function jd(e){return(e==null?void 0:e.type)==="singleSelect"}function Nc(e,t){if(e)return typeof e.valueOptions=="function"?e.valueOptions(q({field:e.field},t)):e.valueOptions}function nx(e,t,n){if(t===void 0)return;const r=t.find(o=>{const i=n(o);return String(i)===String(e)});return n(r)}const LK=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen"],DK=["MenuProps"];function AK(e){return!!e.key}function FK(e){var A,N;const t=gt(),{id:n,value:r,field:o,row:i,colDef:l,hasFocus:c,error:u,onValueChange:f,initialOpen:h=t.editMode===Fi.Cell}=e,p=St(e,LK),g=Ut(),y=m.useRef(null),b=m.useRef(null),[v,C]=m.useState(h),j=(((A=t.slotProps)==null?void 0:A.baseSelect)||{}).native??!1,w=((N=t.slotProps)==null?void 0:N.baseSelect)||{},{MenuProps:k}=w,P=St(w,DK);if(Ln(()=>{var F;c&&((F=b.current)==null||F.focus())},[c]),!jd(l))return null;const T=Nc(l,{id:n,row:i});if(!T)return null;const $=l.getOptionValue,M=l.getOptionLabel,R=async F=>{if(!jd(l)||!T)return;C(!1);const L=F.target,D=nx(L.value,T,$);f&&await f(F,D),await g.current.setEditCellValue({id:n,field:o,value:D},F)},E=(F,L)=>{if(t.editMode===Fi.Row){C(!1);return}if(L==="backdropClick"||F.key==="Escape"){const D=g.current.getCellParams(n,o);g.current.publishEvent("cellEditStop",q({},D,{reason:F.key==="Escape"?Zs.escapeKeyDown:Zs.cellFocusOut}))}},O=F=>{AK(F)&&F.key==="Enter"||C(!0)};return!T||!l?null:s.jsx(t.slots.baseSelect,q({ref:y,inputRef:b,value:r,onChange:R,open:v,onOpen:O,MenuProps:q({onClose:E},k),error:u,native:j,fullWidth:!0},p,P,{children:T.map(F=>{var D;const L=$(F);return m.createElement(t.slots.baseSelectOption,q({},((D=t.slotProps)==null?void 0:D.baseSelectOption)||{},{native:j,key:L,value:L}),M(F))})}))}const NK=e=>s.jsx(FK,q({},e)),_K=["item","applyValue","type","apiRef","focusElementRef","placeholder","tabIndex","label","variant","isFilterActive","clearButton","InputLabelProps"],HK=({column:e,OptionComponent:t,getOptionLabel:n,getOptionValue:r,isSelectNative:o,baseSelectOptionProps:i})=>["",...Nc(e)||[]].map(c=>{const u=r(c);let f=n(c);return f===""&&(f=" "),m.createElement(t,q({},i,{native:o,key:u,value:u}),f)}),BK=Ce("div")({display:"flex",alignItems:"flex-end",width:"100%","& button":{margin:"auto 0px 5px 5px"}});function BI(e){var $,M,R,E,O;const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,placeholder:l,tabIndex:c,label:u,variant:f="standard",clearButton:h}=e,p=St(e,_K),g=t.value??"",y=Sn(),b=Sn(),v=gt(),C=((M=($=v.slotProps)==null?void 0:$.baseSelect)==null?void 0:M.native)??!1;let S=null;if(t.field){const A=o.current.getColumn(t.field);jd(A)&&(S=A)}const j=S==null?void 0:S.getOptionValue,w=S==null?void 0:S.getOptionLabel,k=m.useMemo(()=>Nc(S),[S]),P=m.useCallback(A=>{let N=A.target.value;N=nx(N,k,j),n(q({},t,{value:N}))},[k,j,n,t]);if(!jd(S))return null;const T=u??o.current.getLocaleText("filterPanelInputLabel");return s.jsxs(BK,{children:[s.jsxs(v.slots.baseFormControl,{fullWidth:!0,children:[s.jsx(v.slots.baseInputLabel,q({},(R=v.slotProps)==null?void 0:R.baseInputLabel,{id:b,htmlFor:y,shrink:!0,variant:f,children:T})),s.jsx(v.slots.baseSelect,q({id:y,label:T,labelId:b,value:g,onChange:P,variant:f,type:r||"text",inputProps:{tabIndex:c,ref:i,placeholder:l??o.current.getLocaleText("filterPanelInputPlaceholder")},native:C,notched:f==="outlined"?!0:void 0},p,(E=v.slotProps)==null?void 0:E.baseSelect,{children:HK({column:S,OptionComponent:v.slots.baseSelectOption,getOptionLabel:w,getOptionValue:j,isSelectNative:C,baseSelectOptionProps:(O=v.slotProps)==null?void 0:O.baseSelectOption})}))]}),h]})}const WK=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"],VK=["key"],GK=QM();function UK(e){const{item:t,applyValue:n,apiRef:r,focusElementRef:o,color:i,error:l,helperText:c,size:u,variant:f="standard"}=e,h=St(e,WK),p={color:i,error:l,helperText:c,size:u,variant:f},g=Sn(),y=gt();let b=null;if(t.field){const P=r.current.getColumn(t.field);jd(P)&&(b=P)}const v=b==null?void 0:b.getOptionValue,C=b==null?void 0:b.getOptionLabel,S=m.useCallback((P,T)=>v(P)===v(T),[v]),j=m.useMemo(()=>Nc(b)||[],[b]),w=m.useMemo(()=>Array.isArray(t.value)?t.value.reduce((P,T)=>{const $=j.find(M=>v(M)===T);return $!=null&&P.push($),P},[]):[],[v,t.value,j]),k=m.useCallback((P,T)=>{n(q({},t,{value:T.map(v)}))},[n,t,v]);return s.jsx(sa,q({multiple:!0,options:j,isOptionEqualToValue:S,filterOptions:GK,id:g,value:w,onChange:k,getOptionLabel:C,renderTags:(P,T)=>P.map(($,M)=>{const R=T({index:M}),{key:E}=R,O=St(R,VK);return s.jsx(y.slots.baseChip,q({variant:"outlined",size:"small",label:C($)},O),E)}),renderInput:P=>{var T;return s.jsx(y.slots.baseTextField,q({},P,{label:r.current.getLocaleText("filterPanelInputLabel"),placeholder:r.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:q({},P.InputLabelProps,{shrink:!0}),inputRef:o,type:"singleSelect"},p,(T=y.slotProps)==null?void 0:T.baseTextField))}},h))}const Mu=e=>e==null||!Uw(e)?e:e.value,qK=()=>[{value:"is",getApplyFilterFn:e=>e.value==null||e.value===""?null:t=>Mu(t)===Mu(e.value),InputComponent:BI},{value:"not",getApplyFilterFn:e=>e.value==null||e.value===""?null:t=>Mu(t)!==Mu(e.value),InputComponent:BI},{value:"isAnyOf",getApplyFilterFn:e=>{if(!Array.isArray(e.value)||e.value.length===0)return null;const t=e.value.map(Mu);return n=>t.includes(Mu(n))},InputComponent:UK}],KK=e=>typeof e[0]=="object",QK=e=>Uw(e)?e.value:e,YK=e=>Uw(e)?e.label:String(e),XK=q({},di,{type:"singleSelect",getOptionLabel:YK,getOptionValue:QK,valueFormatter(e,t,n,r){const o=Ih(r.current.state,t);if(!jd(n))return"";const i=Nc(n,{id:o,row:t});if(e==null)return"";if(!i)return e;if(!KK(i))return n.getOptionLabel(e);const l=i.find(c=>n.getOptionValue(c)===e);return l?n.getOptionLabel(l):""},renderEditCell:NK,filterOperators:qK(),pastedValueParser:(e,t,n)=>{const r=n,o=Nc(r)||[],i=r.getOptionValue;if(o.find(c=>i(c)===e))return e}}),ZK="string",JK=()=>({string:di,number:zK,date:MK,dateTime:RK,boolean:d$,singleSelect:XK,[Zx]:Rq,custom:di}),nS=e=>e.headerFiltering,eQ=Tt(nS,e=>(e==null?void 0:e.enabled)??!1),tQ=Tt(nS,e=>e.editing),nQ=Tt(nS,e=>e.menuOpen),oy=e=>e.columnGrouping,M$=fn(oy,e=>(e==null?void 0:e.unwrappedGroupingModel)??{}),R$=fn(oy,e=>(e==null?void 0:e.lookup)??{}),rQ=fn(oy,e=>(e==null?void 0:e.headerStructure)??[]),Eh=Tt(oy,e=>(e==null?void 0:e.maxDepth)??0),$$=["maxWidth","minWidth","width","flex"],Nv=JK();function oQ({initialFreeSpace:e,totalFlexUnits:t,flexColumns:n}){const r=new Set(n.map(l=>l.field)),o={all:{},frozenFields:[],freeze:l=>{const c=o.all[l];c&&c.frozen!==!0&&(o.all[l].frozen=!0,o.frozenFields.push(l))}};function i(){if(o.frozenFields.length===r.size)return;const l={min:{},max:{}};let c=e,u=t,f=0;o.frozenFields.forEach(h=>{c-=o.all[h].computedWidth,u-=o.all[h].flex});for(let h=0;h<n.length;h+=1){const p=n[h];if(o.all[p.field]&&o.all[p.field].frozen===!0)continue;let y=c/u*p.flex;y<p.minWidth?(f+=p.minWidth-y,y=p.minWidth,l.min[p.field]=!0):y>p.maxWidth&&(f+=p.maxWidth-y,y=p.maxWidth,l.max[p.field]=!0),o.all[p.field]={frozen:!1,computedWidth:y,flex:p.flex}}f<0?Object.keys(l.max).forEach(h=>{o.freeze(h)}):f>0?Object.keys(l.min).forEach(h=>{o.freeze(h)}):n.forEach(({field:h})=>{o.freeze(h)}),i()}return i(),o.all}const uC=(e,t)=>{const n={};let r=0,o=0;const i=[];e.orderedFields.forEach(u=>{let f=e.lookup[u],h=0,p=!1;e.columnVisibilityModel[u]!==!1&&(f.flex&&f.flex>0?(r+=f.flex,p=!0):h=as(f.width||di.width,f.minWidth||di.minWidth,f.maxWidth||di.maxWidth),o+=h),f.computedWidth!==h&&(f=q({},f,{computedWidth:h})),p&&i.push(f),n[u]=f});const l=t===void 0?0:t.viewportOuterSize.width-(t.hasScrollY?t.scrollbarSize:0),c=Math.max(l-o,0);if(r>0&&l>0){const u=oQ({initialFreeSpace:c,totalFlexUnits:r,flexColumns:i});Object.keys(u).forEach(f=>{n[f].computedWidth=u[f].computedWidth})}return q({},e,{lookup:n})},sQ=(e,t)=>{if(!t)return e;const{orderedFields:n=[],dimensions:r={}}=t,o=Object.keys(r);if(o.length===0&&n.length===0)return e;const i={},l=[];for(let h=0;h<n.length;h+=1){const p=n[h];e.lookup[p]&&(i[p]=!0,l.push(p))}const c=l.length===0?e.orderedFields:[...l,...e.orderedFields.filter(h=>!i[h])],u=q({},e.lookup);for(let h=0;h<o.length;h+=1){const p=o[h],g=q({},u[p],{hasBeenResized:!0});Object.entries(r[p]).forEach(([y,b])=>{g[y]=b===-1?1/0:b}),u[p]=g}return q({},e,{orderedFields:c,lookup:u})};function WI(e){let t=Nv[ZK];return e&&Nv[e]&&(t=Nv[e]),t}const Au=({apiRef:e,columnsToUpsert:t,initialState:n,columnVisibilityModel:r=Ms(e),keepOnlyColumnsToUpsert:o=!1})=>{var h,p;const i=!e.current.state.columns;let l;if(i)l={orderedFields:[],lookup:{},columnVisibilityModel:r};else{const g=Oi(e.current.state);l={orderedFields:o?[]:[...g.orderedFields],lookup:q({},g.lookup),columnVisibilityModel:r}}let c={};o&&!i&&(c=Object.keys(l.lookup).reduce((g,y)=>q({},g,{[y]:!1}),{})),t.forEach(g=>{const{field:y}=g;c[y]=!0;let b=l.lookup[y];b==null?(b=q({},WI(g.type),{field:y,hasBeenResized:!1}),l.orderedFields.push(y)):o&&l.orderedFields.push(y),b&&b.type!==g.type&&(b=q({},WI(g.type),{field:y}));let v=b.hasBeenResized;$$.forEach(C=>{g[C]!==void 0&&(v=!0,g[C]===-1&&(g[C]=1/0))}),l.lookup[y]=Oc(b,q({},g,{hasBeenResized:v}))}),o&&!i&&Object.keys(l.lookup).forEach(g=>{c[g]||delete l.lookup[g]});const u=e.current.unstable_applyPipeProcessors("hydrateColumns",l),f=sQ(u,n);return uC(f,((p=(h=e.current).getRootDimensions)==null?void 0:p.call(h))??void 0)};function iQ({firstColumnToRender:e,apiRef:t,firstRowToRender:n,lastRowToRender:r,visibleRows:o}){let i=e,l=!1;for(;!l;){l=!0;for(let c=n;c<r;c+=1)if(o[c]){const f=o[c].id,h=t.current.unstable_getCellColSpanInfo(f,i);if(h&&h.spannedByColSpan&&h.leftVisibleCellIndex<i){i=h.leftVisibleCellIndex,l=!1;break}}}return i}function sy(e,t){if(t.unstable_listView)return 0;const n=qd(e),r=Eh(e),o=eQ(e),i=Math.floor(t.columnHeaderHeight*n),l=Math.floor((t.columnGroupHeaderHeight??t.columnHeaderHeight)*n),c=o?Math.floor((t.headerFilterHeight??t.columnHeaderHeight)*n):0;return i+l*r+c}const ef=e=>e.rowsMeta,rx=1,O$=1.5,lQ=e=>{const{scrollDirection:t,classes:n}=e,r={root:["scrollArea",`scrollArea--${t}`]};return Be(r,en,n)},aQ=Dn("div",{name:"MuiDataGrid",slot:"ScrollArea",overridesResolver:(e,t)=>[{[`&.${te["scrollArea--left"]}`]:t["scrollArea--left"]},{[`&.${te["scrollArea--right"]}`]:t["scrollArea--right"]},{[`&.${te["scrollArea--up"]}`]:t["scrollArea--up"]},{[`&.${te["scrollArea--down"]}`]:t["scrollArea--down"]},t.scrollArea]})(()=>({position:"absolute",zIndex:101,[`&.${te["scrollArea--left"]}`]:{top:0,left:0,width:20,bottom:0},[`&.${te["scrollArea--right"]}`]:{top:0,right:0,width:20,bottom:0},[`&.${te["scrollArea--up"]}`]:{top:0,left:0,right:0,height:20},[`&.${te["scrollArea--down"]}`]:{bottom:0,left:0,right:0,height:20}})),cQ=Ch(Ar,(e,t)=>t==="left"?e.leftPinnedWidth:t==="right"?e.rightPinnedWidth+(e.hasScrollX?e.scrollbarSize:0):0);function uQ(e){const t=Ut(),[n,r]=m.useState("none");return ot(t,"columnHeaderDragStart",()=>r("horizontal")),ot(t,"columnHeaderDragEnd",()=>r("none")),ot(t,"rowDragStart",()=>r("vertical")),ot(t,"rowDragEnd",()=>r("none")),n==="none"?null:n==="horizontal"?s.jsx(dQ,q({},e)):s.jsx(fQ,q({},e))}function dQ(e){const{scrollDirection:t,scrollPosition:n}=e,r=m.useRef(null),o=Ut(),i=Po(),l=He(o,qd),c=He(o,Xx),u=Np(o,cQ,t),f=()=>{const v=Ar(o.current.state);if(t==="left")return n.current.left>0;if(t==="right"){const C=c-v.viewportInnerSize.width;return n.current.left<C}return!1},h=gt(),p=sy(o,h),g=Math.floor(h.columnHeaderHeight*l),y=q({height:g,top:p-g},t==="left"?{left:u}:{},t==="right"?{right:u}:{}),b=Vt(v=>{let C;if(v.preventDefault(),t==="left")C=v.clientX-r.current.getBoundingClientRect().right;else if(t==="right")C=Math.max(1,v.clientX-r.current.getBoundingClientRect().left);else throw new Error("MUI X: Wrong drag direction");C=(C-rx)*O$+rx,i.start(0,()=>{o.current.scroll({left:n.current.left+C,top:n.current.top})})});return s.jsx(z$,q({},e,{ref:r,getCanScrollMore:f,style:y,handleDragOver:b}))}function fQ(e){const{scrollDirection:t,scrollPosition:n}=e,r=m.useRef(null),o=Ut(),i=Po(),l=He(o,ef),c=()=>{const g=Ar(o.current.state);if(t==="up")return n.current.top>0;if(t==="down"){const b=(l.currentPageTotalHeight||0)-g.viewportInnerSize.height-g.scrollbarSize;return n.current.top<b}return!1},u=gt(),f=sy(o,u),h={top:t==="up"?f:void 0,bottom:t==="down"?0:void 0},p=Vt(g=>{let y;if(g.preventDefault(),t==="up")y=g.clientY-r.current.getBoundingClientRect().bottom;else if(t==="down")y=Math.max(1,g.clientY-r.current.getBoundingClientRect().top);else throw new Error("MUI X: Wrong drag direction");y=(y-rx)*O$+rx,i.start(0,()=>{o.current.scroll({left:n.current.left,top:n.current.top+y})})});return s.jsx(z$,q({},e,{ref:r,getCanScrollMore:c,style:h,handleDragOver:p}))}const z$=sn(function(t,n){const{scrollDirection:r,getCanScrollMore:o,style:i,handleDragOver:l}=t,c=Ut(),[u,f]=m.useState(o),h=gt(),p=q({},h,{scrollDirection:r}),g=lQ(p);return ot(c,"scrollPositionChange",()=>{f(o)}),u?s.jsx(aQ,{ref:n,className:g.root,ownerState:p,onDragOver:l,style:i}):null}),sg=El(uQ);var Xf={},_v={exports:{}},Hv={exports:{}},VI;function pQ(){return VI||(VI=1,(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Hv)),Hv.exports}var GI;function hQ(){return GI||(GI=1,(function(e){var t=pQ().default;function n(r,o){if(typeof WeakMap=="function")var i=new WeakMap,l=new WeakMap;return(e.exports=n=function(u,f){if(!f&&u&&u.__esModule)return u;var h,p,g={__proto__:null,default:u};if(u===null||t(u)!="object"&&typeof u!="function")return g;if(h=f?l:i){if(h.has(u))return h.get(u);h.set(u,g)}for(var y in u)y!=="default"&&{}.hasOwnProperty.call(u,y)&&((p=(h=Object.defineProperty)&&Object.getOwnPropertyDescriptor(u,y))&&(p.get||p.set)?h(g,y,p):g[y]=u[y]);return g},e.exports.__esModule=!0,e.exports.default=e.exports)(r,o)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(_v)),_v.exports}var UI;function mQ(){if(UI)return Xf;UI=1;var e=hQ().default;Object.defineProperty(Xf,"__esModule",{value:!0}),Xf.default=void 0;var t=e(Dd());return Xf.default=parseInt(t.version,10),Xf}var gQ=mQ();const xQ=Ld(gQ),L$=m.createContext(void 0);function Vs(){const e=m.useContext(L$);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid private context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(`
|
|
317
|
+
`));return e}const Ea=(e,t)=>kh(e),rS=(e,t)=>He(e,kh),yQ=typeof navigator<"u"?navigator.userAgent.toLowerCase():"empty",bQ=yQ.includes("firefox"),iy=e=>e.virtualization;Tt(iy,e=>e.enabled);const D$=Tt(iy,e=>e.enabledForColumns),vQ=Tt(iy,e=>e.enabledForRows),Ph=Tt(iy,e=>e.renderContext),CQ=fn(e=>e.virtualization.renderContext.firstColumnIndex,e=>e.virtualization.renderContext.lastColumnIndex,(e,t)=>({firstColumnIndex:e,lastColumnIndex:t})),dC={firstRowIndex:0,lastRowIndex:0,firstColumnIndex:0,lastColumnIndex:0},wQ=(e,t)=>{const{disableVirtualization:n,autoHeight:r}=t;return q({},e,{virtualization:{enabled:!n,enabledForColumns:!n,enabledForRows:!n&&!r,renderContext:dC}})};function SQ(e,t){const n=i=>{e.current.setState(l=>q({},l,{virtualization:q({},l.virtualization,{enabled:i,enabledForColumns:i,enabledForRows:i&&!t.autoHeight})}))};Gt(e,{unstable_setVirtualization:n,unstable_setColumnVirtualization:i=>{e.current.setState(l=>q({},l,{virtualization:q({},l.virtualization,{enabledForColumns:i})}))}},"public"),m.useEffect(()=>{n(!t.disableVirtualization)},[t.disableVirtualization,t.autoHeight])}const oS=e=>e.rowSpanning,A$=Tt(oS,e=>e.hiddenCells),jQ=Tt(oS,e=>e.spannedCells),kQ=Tt(oS,e=>e.hiddenCellOriginMap),kd=e=>e.listViewColumn,IQ=DR(_o,Ph,kh,fr,Ts,(e,t,n,r,o)=>{if(!e)return!1;const i=o[e.id];if(!i)return!1;const l=n.rowToIndexMap.get(i),c=r.slice(t.firstColumnIndex,t.lastColumnIndex).findIndex(f=>f.field===e.field);return!(l!==void 0&&c!==-1&&l>=t.firstRowIndex&&l<=t.lastRowIndex)}),F$=fn(IQ,fr,kh,Ts,_o,(e,t,n,r,o)=>{if(!e)return null;const i=r[o.id];if(!i)return null;const l=n.rowToIndexMap.get(i);if(l===void 0)return null;const c=t.findIndex(u=>u.field===o.field);return c===-1?null:q({},o,{rowIndex:l,columnIndex:c})});function Vu(e,t){return Math.round(e*10**t)/10**t}const ox=typeof window<"u"&&/jsdom|HappyDOM/.test(window.navigator.userAgent),Bv=50;var Sr=(function(e){return e[e.NONE=0]="NONE",e[e.UP=1]="UP",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e[e.RIGHT=4]="RIGHT",e})(Sr||{});const qI={top:0,left:0},EQ=Object.freeze(new Map),PQ=(e,t,n,r,o)=>({direction:Sr.NONE,buffer:_$(e,Sr.NONE,t,n,r,o)}),TQ=()=>{var de;const e=Vs(),t=gt(),{unstable_listView:n}=t,r=He(e,()=>n?[kd(e.current.state)]:fr(e)),o=He(e,vQ)&&!ox,i=He(e,D$)&&!ox,l=He(e,Kd),c=Yd(e),u=n?ex:c,f=l.bottom.length>0,[h,p]=m.useState(EQ),g=Yr(),y=He(e,Ia),b=rS(e),v=e.current.mainElementRef,C=e.current.virtualScrollerRef,S=e.current.virtualScrollbarVerticalRef,j=e.current.virtualScrollbarHorizontalRef,w=He(e,hq),k=m.useRef(!1),P=He(e,Vw),T=He(e,E7),$=He(e,Xx),M=He(e,MQ),R=He(e,VR),E=He(e,WR),O=m.useRef(null),A=m.useCallback(le=>{if(v.current=le,!le)return;const ge=le.getBoundingClientRect();let Se={width:Vu(ge.width,1),height:Vu(ge.height,1)};if((!O.current||Se.width!==O.current.width&&Se.height!==O.current.height)&&(O.current=Se,e.current.publishEvent("resize",Se)),typeof ResizeObserver>"u")return;const ke=new ResizeObserver(we=>{const Oe=we[0];if(!Oe)return;const be={width:Vu(Oe.contentRect.width,1),height:Vu(Oe.contentRect.height,1)};be.width===Se.width&&be.height===Se.height||(e.current.publishEvent("resize",be),Se=be)});if(ke.observe(le),xQ>=19)return()=>{v.current=null,ke.disconnect()}},[e,v]),N=m.useRef(((de=t.initialState)==null?void 0:de.scroll)??qI),F=m.useRef(!1),L=m.useRef(qI),D=m.useRef(dC),H=He(e,Ph),B=He(e,F$),V=Po(),G=m.useRef(void 0),_=Hs(()=>PQ(g,t.rowBufferPx,t.columnBufferPx,P*15,Bv*6)).current,U=m.useCallback(le=>{if(XI(le,e.current.state.virtualization.renderContext))return;const ge=le.firstRowIndex!==D.current.firstRowIndex||le.lastRowIndex!==D.current.lastRowIndex;e.current.setState(ke=>q({},ke,{virtualization:q({},ke.virtualization,{renderContext:le})})),Ar(e.current.state).isReady&&ge&&(D.current=le,e.current.publishEvent("renderedRowsIntervalChange",le)),L.current=N.current},[e]),Z=Vt(()=>{const le=C.current;if(!le)return;const ge=Ar(e.current.state),Se=Math.ceil(ge.minimumSize.height-ge.viewportOuterSize.height),ke=Math.ceil(ge.minimumSize.width-ge.viewportInnerSize.width),we={top:as(le.scrollTop,0,Se),left:g?as(le.scrollLeft,-ke,0):as(le.scrollLeft,0,ke)},Oe=we.left-N.current.left,be=we.top-N.current.top,Fe=Oe!==0||be!==0;N.current=we;const Ve=Fe?OQ(Oe,be):Sr.NONE,De=Math.abs(N.current.top-L.current.top),Ze=Math.abs(N.current.left-L.current.left),Ae=De>=P||Ze>=Bv,st=_.direction!==Ve;if(!(Ae||st))return H;if(st)switch(Ve){case Sr.NONE:case Sr.LEFT:case Sr.RIGHT:G.current=void 0;break;default:G.current=H;break}_.direction=Ve,_.buffer=_$(g,Ve,t.rowBufferPx,t.columnBufferPx,P*15,Bv*6);const et=KI(e,t,o,i),oe=QI(et,N.current,_);return XI(oe,H)||(qC.flushSync(()=>{U(oe)}),V.start(1e3,Z)),oe}),Q=()=>{if(!Ar(e.current.state).isReady&&(o||i))return;const le=KI(e,t,o,i),ge=QI(le,N.current,_);G.current=void 0,U(ge)},ee=Vt(()=>{if(F.current){F.current=!1;return}const le=Z();e.current.publishEvent("scrollPositionChange",{top:N.current.top,left:N.current.left,renderContext:le})}),ne=Vt(le=>{e.current.publishEvent("virtualScrollerWheel",{},le)}),re=Vt(le=>{e.current.publishEvent("virtualScrollerTouchMove",{},le)}),Y=(le={})=>{var et;if(!le.rows&&!b.range)return[];const ge=Pr(e);let Se=H;le.renderContext&&(Se=le.renderContext,Se.firstColumnIndex=H.firstColumnIndex,Se.lastColumnIndex=H.lastColumnIndex);const ke=!f&&le.position===void 0||f&&le.position==="bottom",we=le.position!==void 0;let Oe;switch(le.position){case"top":Oe=0;break;case"bottom":Oe=l.top.length+b.rows.length;break;case void 0:Oe=l.top.length;break}const be=le.rows??b.rows,Fe=Se.firstRowIndex,Ve=Math.min(Se.lastRowIndex,be.length),De=le.rows?RI(0,le.rows.length):RI(Fe,Ve);let Ze=-1;!we&&B&&(B.rowIndex<Fe&&(De.unshift(B.rowIndex),Ze=B.rowIndex),B.rowIndex>Ve&&(De.push(B.rowIndex),Ze=B.rowIndex));const Ae=[],st=(et=t.slotProps)==null?void 0:et.row,qe=_a(e);return De.forEach(oe=>{var un,er,yt;const{id:fe,model:Ie}=be[oe];if(!ge[fe])return;const $e=(((un=b==null?void 0:b.range)==null?void 0:un.firstRowIndex)||0)+Oe+oe;if(w){const Ht=u.left.length,Ke=r.length-u.right.length;e.current.calculateColSpan({rowId:fe,minFirstColumn:Ht,maxLastColumn:Ke,columns:r}),u.left.length>0&&e.current.calculateColSpan({rowId:fe,minFirstColumn:0,maxLastColumn:u.left.length,columns:r}),u.right.length>0&&e.current.calculateColSpan({rowId:fe,minFirstColumn:r.length-u.right.length,maxLastColumn:r.length,columns:r})}const pt=e.current.rowHasAutoHeight(fe)?"auto":e.current.unstable_getRowHeight(fe);let vt;y[fe]==null?vt=!1:vt=e.current.isRowSelectable(fe);let Je=!1;le.position===void 0&&(Je=oe===0);let me=!1;const Ne=oe===be.length-1;if(ke)if(we)me=Ne;else{const Ht=b.rows.length-1;oe===Ht&&(me=!0)}let xt=Se;G.current&&oe>=G.current.firstRowIndex&&oe<G.current.lastRowIndex&&(xt=G.current);const Bt=oe===Ze,pn=(B==null?void 0:B.rowIndex)===$e,yn=N$(qe,xt,u.left.length),hn=Ne&&le.position==="top",ln=xt.firstColumnIndex,An=xt.lastColumnIndex;if(Ae.push(s.jsx(t.slots.row,q({row:Ie,rowId:fe,index:$e,selected:vt,offsetLeft:yn,columnsTotalWidth:$,rowHeight:pt,pinnedColumns:u,visibleColumns:r,firstColumnIndex:ln,lastColumnIndex:An,focusedColumnIndex:pn?B.columnIndex:void 0,isFirstVisible:Je,isLastVisible:me,isNotVisible:Bt,showBottomBorder:hn,scrollbarWidth:R,gridHasFiller:E},st),fe)),Bt)return;const kt=h.get(fe);kt&&Ae.push(kt),le.position===void 0&&Ne&&Ae.push((yt=(er=e.current).getInfiniteLoadingTriggerElement)==null?void 0:yt.call(er,{lastRowId:fe}))}),Ae},ie=m.useMemo(()=>({overflowX:!M||n?"hidden":void 0,overflowY:t.autoHeight?"hidden":void 0}),[M,t.autoHeight,n]),ce=m.useMemo(()=>{const le={width:M?$:"auto",flexBasis:T,flexShrink:0};return le.flexBasis===0&&(le.flexBasis=a$),le},[$,T,M]),he=m.useCallback(le=>{le&&e.current.publishEvent("virtualScrollerContentSizeChange",{columnsTotalWidth:$,contentHeight:T})},[e,$,T]);return Ln(()=>{var le,ge;k.current&&((ge=(le=e.current).updateRenderContext)==null||ge.call(le))},[e,i,o]),Ln(()=>{n&&(C.current.scrollLeft=0)},[n,C]),pK(H!==dC,()=>{var le;if(e.current.publishEvent("scrollPositionChange",{top:N.current.top,left:N.current.left,renderContext:H}),k.current=!0,(le=t.initialState)!=null&&le.scroll&&C.current){const ge=C.current,{top:Se,left:ke}=t.initialState.scroll,we={top:!(Se>0),left:!(ke>0)};if(!we.left&&$&&(ge.scrollLeft=ke,F.current=!0,we.left=!0),!we.top&&T&&(ge.scrollTop=Se,F.current=!0,we.top=!0),!we.top||!we.left){const Oe=e.current.subscribeEvent("virtualScrollerContentSizeChange",be=>{!we.left&&be.columnsTotalWidth&&(ge.scrollLeft=ke,F.current=!0,we.left=!0),!we.top&&be.contentHeight&&(ge.scrollTop=Se,F.current=!0,we.top=!0),we.left&&we.top&&Oe()});return Oe}}}),e.current.register("private",{updateRenderContext:Q}),En(e,"sortedRowsSet",Q),En(e,"paginationModelChange",Q),En(e,"columnsChange",Q),{renderContext:H,setPanels:p,getRows:Y,getContainerProps:()=>({ref:A}),getScrollerProps:()=>({ref:C,onScroll:ee,onWheel:ne,onTouchMove:re,style:ie,role:"presentation",tabIndex:bQ?-1:void 0}),getContentProps:()=>({style:ce,role:"presentation",ref:he}),getRenderZoneProps:()=>({role:"rowgroup"}),getScrollbarVerticalProps:()=>({ref:S,scrollPosition:N}),getScrollbarHorizontalProps:()=>({ref:j,scrollPosition:N}),getScrollAreaProps:()=>({scrollPosition:N})}};function MQ(e){return e.dimensions.viewportOuterSize.width>0&&e.dimensions.columnsTotalWidth>e.dimensions.viewportOuterSize.width}function KI(e,t,n,r){const o=Ar(e.current.state),i=Ea(e),l=t.unstable_listView?[kd(e.current.state)]:fr(e),c=kQ(e),u=e.current.state.rows.dataRowIds.at(-1),f=l.at(-1);return{enabledForRows:n,enabledForColumns:r,apiRef:e,autoHeight:t.autoHeight,rowBufferPx:t.rowBufferPx,columnBufferPx:t.columnBufferPx,leftPinnedWidth:o.leftPinnedWidth,columnsTotalWidth:o.columnsTotalWidth,viewportInnerWidth:o.viewportInnerSize.width,viewportInnerHeight:o.viewportInnerSize.height,lastRowHeight:u!==void 0?e.current.unstable_getRowHeight(u):0,lastColumnWidth:(f==null?void 0:f.computedWidth)??0,rowsMeta:ef(e.current.state),columnPositions:_a(e),rows:i.rows,range:i.range,pinnedColumns:Yd(e),visibleColumns:l,hiddenCellsOriginMap:c,listView:t.unstable_listView??!1,virtualizeColumnsWithAutoRowHeight:t.virtualizeColumnsWithAutoRowHeight}}function QI(e,t,n){const r={firstRowIndex:0,lastRowIndex:e.rows.length,firstColumnIndex:0,lastColumnIndex:e.visibleColumns.length},{top:o,left:i}=t,l=Math.abs(i)+e.leftPinnedWidth;if(e.enabledForRows){let u=Math.min(YI(e,o,{atStart:!0,lastPosition:e.rowsMeta.positions[e.rowsMeta.positions.length-1]+e.lastRowHeight}),e.rowsMeta.positions.length-1);const f=e.hiddenCellsOriginMap[u];if(f){const p=Math.min(...Object.values(f));u=Math.min(u,p)}const h=e.autoHeight?u+e.rows.length:YI(e,o+e.viewportInnerHeight);r.firstRowIndex=u,r.lastRowIndex=h}if(e.listView)return q({},r,{lastColumnIndex:1});if(e.enabledForColumns){let u=0,f=e.columnPositions.length,h=!1;const[p,g]=fC({firstIndex:r.firstRowIndex,lastIndex:r.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight});if(!e.virtualizeColumnsWithAutoRowHeight)for(let y=p;y<g&&!h;y+=1){const b=e.rows[y];h=e.apiRef.current.rowHasAutoHeight(b.id)}(!h||e.virtualizeColumnsWithAutoRowHeight)&&(u=za(l,e.columnPositions,{atStart:!0,lastPosition:e.columnsTotalWidth}),f=za(l+e.viewportInnerWidth,e.columnPositions)),r.firstColumnIndex=u,r.lastColumnIndex=f}return RQ(e,r,n)}function YI(e,t,n){var l,c;const r=e.apiRef.current.getLastMeasuredRowIndex();let o=r===1/0;(l=e.range)!=null&&l.lastRowIndex&&!o&&(o=r>=e.range.lastRowIndex);const i=as(r-(((c=e.range)==null?void 0:c.firstRowIndex)||0),0,e.rowsMeta.positions.length);return o||e.rowsMeta.positions[i]>=t?za(t,e.rowsMeta.positions,n):$Q(t,e.rowsMeta.positions,i,n)}function RQ(e,t,n){const[r,o]=fC({firstIndex:t.firstRowIndex,lastIndex:t.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight}),[i,l]=fC({firstIndex:t.firstColumnIndex,lastIndex:t.lastColumnIndex,minFirstIndex:e.pinnedColumns.left.length,maxLastIndex:e.visibleColumns.length-e.pinnedColumns.right.length,bufferBefore:n.buffer.columnBefore,bufferAfter:n.buffer.columnAfter,positions:e.columnPositions,lastSize:e.lastColumnWidth}),c=iQ({firstColumnToRender:i,apiRef:e.apiRef,firstRowToRender:r,lastRowToRender:o,visibleRows:e.rows});return{firstRowIndex:r,lastRowIndex:o,firstColumnIndex:c,lastColumnIndex:l}}function za(e,t,n=void 0,r=0,o=t.length){if(t.length<=0)return-1;if(r>=o)return r;const i=r+Math.floor((o-r)/2),l=t[i];let c;if(n!=null&&n.atStart){const u=(i===t.length-1?n.lastPosition:t[i+1])-l;c=e-u<l}else c=e<=l;return c?za(e,t,n,r,i):za(e,t,n,i+1,o)}function $Q(e,t,n,r=void 0){let o=1;for(;n<t.length&&Math.abs(t[n])<e;)n+=o,o*=2;return za(e,t,r,Math.floor(n/2),Math.min(n,t.length))}function fC({firstIndex:e,lastIndex:t,bufferBefore:n,bufferAfter:r,minFirstIndex:o,maxLastIndex:i,positions:l,lastSize:c}){const u=l[e]-n,f=l[t]+r,h=za(u,l,{atStart:!0,lastPosition:l[l.length-1]+c}),p=za(f,l);return[as(h,o,i),as(p,o,i)]}function XI(e,t){return e===t?!0:e.firstRowIndex===t.firstRowIndex&&e.lastRowIndex===t.lastRowIndex&&e.firstColumnIndex===t.firstColumnIndex&&e.lastColumnIndex===t.lastColumnIndex}function N$(e,t,n){const r=(e[t.firstColumnIndex]??0)-(e[n]??0);return Math.abs(r)}function OQ(e,t){return e===0&&t===0?Sr.NONE:Math.abs(t)>=Math.abs(e)?t>0?Sr.DOWN:Sr.UP:e>0?Sr.RIGHT:Sr.LEFT}function _$(e,t,n,r,o,i){if(e)switch(t){case Sr.LEFT:t=Sr.RIGHT;break;case Sr.RIGHT:t=Sr.LEFT;break}switch(t){case Sr.NONE:return{rowAfter:n,rowBefore:n,columnAfter:r,columnBefore:r};case Sr.LEFT:return{rowAfter:0,rowBefore:0,columnAfter:0,columnBefore:i};case Sr.RIGHT:return{rowAfter:0,rowBefore:0,columnAfter:i,columnBefore:0};case Sr.UP:return{rowAfter:0,rowBefore:o,columnAfter:0,columnBefore:0};case Sr.DOWN:return{rowAfter:o,rowBefore:0,columnAfter:0,columnBefore:0};default:throw new Error("unreachable")}}const zQ=()=>{var p,g;const e=Ut(),t=gt(),n=He(e,wh),r=He(e,Xw),o=He(e,GR),i=n===0&&o===0,l=He(e,K7),c=!l&&i,u=!l&&n>0&&r===0;let f=null,h=null;return c&&(f="noRowsOverlay"),u&&(f="noResultsOverlay"),l&&(f="loadingOverlay",h=((g=(p=t.slotProps)==null?void 0:p.loadingOverlay)==null?void 0:g[i?"noRowsVariant":"variant"])||null),{overlayType:f,loadingOverlayVariant:h}},LQ=Dn("div",{name:"MuiDataGrid",slot:"OverlayWrapper",shouldForwardProp:e=>e!=="overlayType"&&e!=="loadingOverlayVariant",overridesResolver:(e,t)=>t.overlayWrapper})(({overlayType:e,loadingOverlayVariant:t})=>t!=="skeleton"?{position:"sticky",top:"var(--DataGrid-headersTotalHeight)",left:0,width:0,height:0,zIndex:e==="loadingOverlay"?5:4}:{}),DQ=Dn("div",{name:"MuiDataGrid",slot:"OverlayWrapperInner",shouldForwardProp:e=>e!=="overlayType"&&e!=="loadingOverlayVariant",overridesResolver:(e,t)=>t.overlayWrapperInner})({}),AQ=e=>{const{classes:t}=e;return Be({root:["overlayWrapper"],inner:["overlayWrapperInner"]},en,t)};function FQ(e){const t=Ut(),n=gt(),r=He(t,Ar);let o=Math.max(r.viewportOuterSize.height-r.topContainerHeight-r.bottomContainerHeight-(r.hasScrollX?r.scrollbarSize:0),0);o===0&&(o=a$);const i=AQ(q({},e,{classes:n.classes}));return s.jsx(LQ,q({className:Me(i.root)},e,{children:s.jsx(DQ,q({className:Me(i.inner),style:{height:o,width:r.viewportOuterSize.width}},e))}))}function NQ(e){var i,l;const{overlayType:t}=e,n=gt();if(!t)return null;const r=(i=n.slots)==null?void 0:i[t],o=(l=n.slotProps)==null?void 0:l[t];return s.jsx(FQ,q({},e,{children:s.jsx(r,q({},o))}))}const Rg=e=>e.columnMenu;function _Q(){var C;const e=Vs(),t=gt(),n=He(e,fr),r=He(e,eK),o=He(e,Yq),i=He(e,y$),l=He(e,()=>eS(e)===null),c=He(e,dK),u=He(e,uK),f=He(e,tx),h=He(e,Eh),p=He(e,Rg),g=He(e,Ms),y=He(e,rQ),b=!(c===null&&i===null&&l),v=e.current.columnHeadersContainerRef;return s.jsx(t.slots.columnHeaders,q({ref:v,visibleColumns:n,filterColumnLookup:r,sortColumnLookup:o,columnHeaderTabIndexState:i,columnGroupHeaderTabIndexState:c,columnHeaderFocus:u,columnGroupHeaderFocus:f,headerGroupingMaxDepth:h,columnMenuState:p,columnVisibility:g,columnGroupsHeaderStructure:y,hasOtherElementInTabSequence:b},(C=t.slotProps)==null?void 0:C.columnHeaders))}const HQ=El(_Q),H$=m.createContext(void 0),sS=()=>{const e=m.useContext(H$);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid configuration context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(`
|
|
318
|
+
`));return e},BQ=Dn("div")({position:"absolute",top:"var(--DataGrid-headersTotalHeight)",left:0,width:"calc(100% - (var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize)))"}),WQ=Dn("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.main,n.hasPinnedRight&&t["main--hasPinnedRight"],n.loadingOverlayVariant==="skeleton"&&t["main--hasSkeletonLoadingOverlay"]]}})({flexGrow:1,position:"relative",overflow:"hidden",display:"flex",flexDirection:"column"}),VQ=sn((e,t)=>{var l;const{ownerState:n}=e,r=gt(),i=sS().hooks.useGridAriaAttributes();return s.jsxs(WQ,q({ownerState:n,className:e.className,tabIndex:-1},i,(l=r.slotProps)==null?void 0:l.main,{ref:t,children:[s.jsx(BQ,{role:"presentation","data-id":"gridPanelAnchor"}),e.children]}))}),GQ=()=>Be({root:["topContainer"]},en,{}),UQ=Dn("div")({position:"sticky",zIndex:40,top:0});function qQ(e){const t=GQ();return s.jsx(UQ,q({},e,{className:Me(t.root,te["container--top"]),role:"presentation"}))}const KQ=()=>Be({root:["bottomContainer"]},en,{}),QQ=Dn("div")({position:"sticky",zIndex:40,bottom:"calc(var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))"});function YQ(e){const t=KQ();return s.jsx(QQ,q({},e,{className:Me(t.root,te["container--bottom"]),role:"presentation"}))}const XQ=(e,t)=>{const{classes:n}=e;return Be({root:["virtualScrollerContent",t&&"virtualScrollerContent--overflowed"]},en,n)},ZQ=Dn("div",{name:"MuiDataGrid",slot:"VirtualScrollerContent",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScrollerContent,n.overflowedContent&&t["virtualScrollerContent--overflowed"]]}})({}),JQ=sn(function(t,n){var c;const r=gt(),o=!r.autoHeight&&((c=t.style)==null?void 0:c.minHeight)==="auto",i=XQ(r,o),l={classes:r.classes,overflowedContent:o};return s.jsx(ZQ,q({},t,{ownerState:l,className:Me(i.root,t.className),ref:n}))}),eY=Dn("div")({display:"flex",flexDirection:"row",width:"var(--DataGrid-rowWidth)",boxSizing:"border-box"}),B$=Dn("div")({position:"sticky",height:"100%",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",backgroundColor:"var(--DataGrid-pinnedBackground)"}),tY=Dn(B$)({left:0,borderRight:"1px solid var(--rowBorderColor)"}),nY=Dn(B$)({right:0,borderLeft:"1px solid var(--rowBorderColor)"}),rY=Dn("div")({flexGrow:1,borderTop:"1px solid var(--rowBorderColor)"});function oY({rowsLength:e}){const t=Ut(),{viewportOuterSize:n,minimumSize:r,hasScrollX:o,hasScrollY:i,scrollbarSize:l,leftPinnedWidth:c,rightPinnedWidth:u}=He(t,Ar),f=o?l:0,h=n.height-r.height>0;return f===0&&!h?null:s.jsxs(eY,{className:te.filler,role:"presentation",style:{height:f,"--rowBorderColor":e===0?"transparent":"var(--DataGrid-rowBorderColor)"},children:[c>0&&s.jsx(tY,{className:te["filler--pinnedLeft"],style:{width:c}}),s.jsx(rY,{}),u>0&&s.jsx(nY,{className:te["filler--pinnedRight"],style:{width:u+(i?l:0)}})]})}const sY=El(oY),iY=["className"],lY=e=>{const{classes:t}=e;return Be({root:["virtualScrollerRenderZone"]},en,t)},aY=Dn("div",{name:"MuiDataGrid",slot:"VirtualScrollerRenderZone",overridesResolver:(e,t)=>t.virtualScrollerRenderZone})({position:"absolute",display:"flex",flexDirection:"column"}),cY=sn(function(t,n){const{className:r}=t,o=St(t,iY),i=Ut(),l=gt(),c=lY(l),u=He(i,()=>{const f=Ph(i);return ef(i.current.state).positions[f.firstRowIndex]??0});return s.jsx(aY,q({className:Me(c.root,r),ownerState:l,style:{transform:`translate3d(0, ${u}px, 0)`}},o,{ref:n}))}),uY={includeHeaders:!0,includeOutliers:!1,outliersFactor:1.5,expand:!1,disableColumnVirtualization:!0},zr=e=>e.editRows,W$=Ch(zr,(e,{rowId:t,editMode:n})=>n===Fi.Row&&!!e[t]),dY=Ch(zr,(e,{rowId:t,field:n})=>{var r;return((r=e[t])==null?void 0:r[n])??null}),Bp=e=>e.preferencePanel,fY=Ch(Bp,(e,t)=>!!(e.open&&e.labelId===t));var _c=(function(e){return e.filters="filters",e.columns="columns",e})(_c||{});const pY=(e,t)=>{const{classes:n}=e,r={root:["scrollbar",`scrollbar--${t}`],content:["scrollbarContent"]};return Be(r,en,n)},V$=Dn("div")({position:"absolute",display:"inline-block",zIndex:60,"&:hover":{zIndex:70},"--size":"calc(max(var(--DataGrid-scrollbarSize), 14px))"}),hY=Dn(V$)({width:"var(--size)",height:"calc(var(--DataGrid-hasScrollY) * (100% - var(--DataGrid-topContainerHeight) - var(--DataGrid-bottomContainerHeight) - var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize)))",overflowY:"auto",overflowX:"hidden",outline:0,"& > div":{width:"var(--size)"},top:"var(--DataGrid-topContainerHeight)",right:"0px"}),mY=Dn(V$)({width:"100%",height:"var(--size)",overflowY:"hidden",overflowX:"auto",outline:0,"& > div":{height:"var(--size)"},bottom:"0px"}),ZI=sn(function(t,n){const r=Vs(),o=gt(),i=m.useRef(!1),l=m.useRef(0),c=m.useRef(null),u=m.useRef(null),f=pY(o,t.position),h=He(r,Ar),p=t.position==="vertical"?"height":"width",g=t.position==="vertical"?"scrollTop":"scrollLeft",y=t.position==="vertical"?"top":"left",b=t.position==="vertical"?h.hasScrollX:h.hasScrollY,v=h.minimumSize[p]+(b?h.scrollbarSize:0),S=(t.position==="vertical"?h.viewportInnerSize.height:h.viewportOuterSize.width)*(v/h.viewportOuterSize[p]),j=Vt(()=>{const P=c.current,T=t.scrollPosition.current;if(!P||T[y]===l.current)return;if(l.current=T[y],i.current){i.current=!1;return}i.current=!0;const $=T[y]/v;P[g]=$*S}),w=Vt(()=>{const P=r.current.virtualScrollerRef.current,T=c.current;if(!T)return;if(i.current){i.current=!1;return}i.current=!0;const $=T[g]/S;P[g]=$*v});iw(()=>{const P=r.current.virtualScrollerRef.current,T=c.current,$={passive:!0};return P.addEventListener("scroll",j,$),T.addEventListener("scroll",w,$),()=>{P.removeEventListener("scroll",j,$),T.removeEventListener("scroll",w,$)}}),m.useEffect(()=>{u.current.style.setProperty(p,`${S}px`)},[S,p]);const k=t.position==="vertical"?hY:mY;return s.jsx(k,{ref:Pn(n,c),className:f.root,style:t.position==="vertical"&&o.unstable_listView?{height:"100%",top:0}:void 0,tabIndex:-1,"aria-hidden":"true",onFocus:P=>{P.target.blur()},children:s.jsx("div",{ref:u,className:f.content})})}),gY=e=>{const{classes:t,hasScrollX:n,hasPinnedRight:r,loadingOverlayVariant:o}=e;return Be({root:["main",r&&"main--hasPinnedRight",o==="skeleton"&&"main--hasSkeletonLoadingOverlay"],scroller:["virtualScroller",n&&"virtualScroller--hasScrollX"]},en,t)},xY=Dn("div",{name:"MuiDataGrid",slot:"VirtualScroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScroller,n.hasScrollX&&t["virtualScroller--hasScrollX"]]}})({position:"relative",height:"100%",flexGrow:1,overflow:"scroll",scrollbarWidth:"none",display:"flex",flexDirection:"column","&::-webkit-scrollbar":{display:"none"},"@media print":{overflow:"hidden"},zIndex:0}),yY=e=>e.dimensions.rightPinnedWidth>0;function bY(e){const t=Ut(),n=gt(),r=He(t,T7),o=He(t,P7),i=He(t,yY),l=He(t,$7),c=zQ(),u={classes:n.classes,hasScrollX:o,hasPinnedRight:i,loadingOverlayVariant:c.loadingOverlayVariant},f=gY(u),h=TQ(),{getContainerProps:p,getScrollerProps:g,getContentProps:y,getRenderZoneProps:b,getScrollbarVerticalProps:v,getScrollbarHorizontalProps:C,getRows:S,getScrollAreaProps:j}=h,w=S();return s.jsxs(VQ,q({className:f.root},p(),{ownerState:u,children:[s.jsx(sg,q({scrollDirection:"left"},j())),s.jsx(sg,q({scrollDirection:"right"},j())),s.jsx(sg,q({scrollDirection:"up"},j())),s.jsx(sg,q({scrollDirection:"down"},j())),s.jsxs(xY,q({className:f.scroller},g(),{ownerState:u,children:[s.jsxs(qQ,{children:[!n.unstable_listView&&s.jsx(HQ,{}),s.jsx(n.slots.pinnedRows,{position:"top",virtualScroller:h})]}),s.jsx(NQ,q({},c)),s.jsx(JQ,q({},y(),{children:s.jsxs(cY,q({},b(),{children:[w,s.jsx(n.slots.detailPanels,{virtualScroller:h})]}))})),l&&s.jsx(sY,{rowsLength:w.length}),s.jsx(YQ,{children:s.jsx(n.slots.pinnedRows,{position:"bottom",virtualScroller:h})})]})),o&&!n.unstable_listView&&s.jsx(ZI,q({position:"horizontal"},C())),r&&s.jsx(ZI,q({position:"vertical"},v())),e.children]}))}function vY(){var t;const e=gt();return e.hideFooter?null:s.jsx(e.slots.footer,q({},(t=e.slotProps)==null?void 0:t.footer))}let Wv;function iS(){return Wv===void 0&&document.createElement("div").focus({get preventScroll(){return Wv=!0,!1}}),Wv}function CY({defaultSlots:e,slots:t}){const n=t;if(!n||Object.keys(n).length===0)return e;const r=q({},e);return Object.keys(n).forEach(o=>{const i=o;n[i]!==void 0&&(r[i]=n[i])}),r}function wY(e){var o;if((o=e.slotProps)!=null&&o.root)return e;const t=Object.keys(e);if(!t.some(i=>i.startsWith("aria-")||i.startsWith("data-")))return e;const n={},r=e.forwardedProps??{};for(let i=0;i<t.length;i+=1){const l=t[i];l.startsWith("aria-")||l.startsWith("data-")?r[l]=e[l]:n[l]=e[l]}return n.forwardedProps=r,n}function SY(e){return m.useMemo(()=>wY(e),[e])}const jY=e=>{const t=e.match(/^__row_group_by_columns_group_(.*)__$/);return t?t[1]:null},kY=e=>e===u$||jY(e)!==null,G$=(e,t)=>{if(e)if(t){if(e===Qt.LEFT)return"right";if(e===Qt.RIGHT)return"left"}else{if(e===Qt.LEFT)return"left";if(e===Qt.RIGHT)return"right"}};function ly(e,t,n,r){const o=G$(n,t);return!o||r===void 0||(e[o]=r),e}const IY=["column","row","rowId","rowNode","align","children","colIndex","width","className","style","colSpan","disableDragEvents","isNotVisible","pinnedOffset","pinnedPosition","showRightBorder","showLeftBorder","onClick","onDoubleClick","onMouseDown","onMouseUp","onMouseOver","onKeyDown","onKeyUp","onDragEnter","onDragOver"],EY=["changeReason","unstable_updateValueOnRender"];Qt.LEFT+"",na.LEFT,Qt.RIGHT+"",na.RIGHT,Qt.NONE+"",Qt.VIRTUAL+"";const PY=e=>{const{align:t,showLeftBorder:n,showRightBorder:r,pinnedPosition:o,isEditable:i,isSelected:l,isSelectionMode:c,classes:u}=e,f={root:["cell",`cell--text${Pe(t)}`,l&&"selected",i&&"cell--editable",n&&"cell--withLeftBorder",r&&"cell--withRightBorder",o===Qt.LEFT&&"cell--pinnedLeft",o===Qt.RIGHT&&"cell--pinnedRight",c&&!i&&"cell--selectionMode"]};return Be(f,en,u)},TY=sn(function(t,n){var $e,pt,vt;const{column:r,row:o,rowId:i,rowNode:l,align:c,colIndex:u,width:f,className:h,style:p,colSpan:g,disableDragEvents:y,isNotVisible:b,pinnedOffset:v,pinnedPosition:C,showRightBorder:S,showLeftBorder:j,onClick:w,onDoubleClick:k,onMouseDown:P,onMouseUp:T,onMouseOver:$,onKeyDown:M,onKeyUp:R,onDragEnter:E,onDragOver:O}=t,A=St(t,IY),N=Vs(),F=gt(),L=Yr(),D=r.field,H=Np(N,dY,{rowId:i,field:D}),V=sS().hooks.useCellAggregationResult(i,D),G=H?kn.Edit:kn.View,_=N.current.getCellParamsForRow(i,D,o,{colDef:r,cellMode:G,rowNode:l,tabIndex:He(N,()=>{const Je=eS(N);return Je&&Je.field===D&&Je.id===i?0:-1}),hasFocus:He(N,()=>{const Je=_o(N);return(Je==null?void 0:Je.id)===i&&Je.field===D})});_.api=N.current,V&&(_.value=V.value,_.formattedValue=r.valueFormatter?r.valueFormatter(_.value,o,r,N):_.value);const U=He(N,()=>N.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:i,field:D})),Z=He(N,A$),Q=He(N,jQ),{hasFocus:ee,isEditable:ne=!1,value:re}=_,Y=r.type==="actions"&&(($e=r.getActions)==null?void 0:$e.call(r,N.current.getRowParams(i)).some(Je=>!Je.props.disabled)),ie=(G==="view"||!ne)&&!Y?_.tabIndex:-1,{classes:ce,getCellClassName:he}=F,le=[He(N,()=>N.current.unstable_applyPipeProcessors("cellClassName",[],{id:i,field:D}).filter(Boolean).join(" "))];r.cellClassName&&le.push(typeof r.cellClassName=="function"?r.cellClassName(_):r.cellClassName),r.display==="flex"&&le.push(te["cell--flex"]),he&&le.push(he(_));const ge=_.formattedValue??re,Se=m.useRef(null),ke=Pn(n,Se),we=m.useRef(null),Oe=F.cellSelection??!1,be={align:c,showLeftBorder:j,showRightBorder:S,isEditable:ne,classes:F.classes,pinnedPosition:C,isSelected:U,isSelectionMode:Oe},Fe=PY(be),Ve=m.useCallback(Je=>me=>{const Ne=N.current.getCellParams(i,D||"");N.current.publishEvent(Je,Ne,me),T&&T(me)},[N,D,T,i]),De=m.useCallback(Je=>me=>{const Ne=N.current.getCellParams(i,D||"");N.current.publishEvent(Je,Ne,me),P&&P(me)},[N,D,P,i]),Ze=m.useCallback((Je,me)=>Ne=>{if(!N.current.getRow(i))return;const xt=N.current.getCellParams(i,D||"");N.current.publishEvent(Je,xt,Ne),me&&me(Ne)},[N,D,i]),Ae=((pt=Z[i])==null?void 0:pt[D])??!1,st=((vt=Q[i])==null?void 0:vt[D])??1,qe=m.useMemo(()=>{if(b)return{padding:0,opacity:0,width:0,height:0,border:0};const Je=ly(q({"--width":`${f}px`},p),L,C,v),me=C===Qt.LEFT,Ne=C===Qt.RIGHT;return st>1&&(Je.height=`calc(var(--height) * ${st})`,Je.zIndex=10,(me||Ne)&&(Je.zIndex=40)),Je},[f,b,p,v,C,L,st]);if(m.useEffect(()=>{if(!ee||G===kn.Edit)return;const Je=ir(N.current.rootElementRef.current);if(Se.current&&!Se.current.contains(Je.activeElement)){const me=Se.current.querySelector('[tabindex="0"]'),Ne=we.current||me||Se.current;if(iS())Ne.focus({preventScroll:!0});else{const xt=N.current.getScrollPosition();Ne.focus(),N.current.scroll(xt)}}},[ee,G,N]),Ae)return s.jsx("div",{"data-colindex":u,role:"presentation",style:q({width:"var(--width)"},qe)});let et=A.onFocus,oe,fe;if(H===null&&r.renderCell&&(oe=r.renderCell(_)),H!==null&&r.renderEditCell){const Je=N.current.getRowWithUpdatedValues(i,r.field),me=St(H,EY),Ne=r.valueFormatter?r.valueFormatter(H.value,Je,r,N):_.formattedValue,xt=q({},_,{row:Je,formattedValue:Ne},me);oe=r.renderEditCell(xt),le.push(te["cell--editing"]),le.push(ce==null?void 0:ce["cell--editing"])}if(oe===void 0){const Je=ge==null?void 0:ge.toString();oe=Je,fe=Je}m.isValidElement(oe)&&Y&&(oe=m.cloneElement(oe,{focusElementRef:we}));const Ie=y?null:{onDragEnter:Ze("cellDragEnter",E),onDragOver:Ze("cellDragOver",O)};return s.jsx("div",q({className:Me(Fe.root,le,h),role:"gridcell","data-field":D,"data-colindex":u,"aria-colindex":u+1,"aria-colspan":g,"aria-rowspan":st,style:qe,title:fe,tabIndex:ie,onClick:Ze("cellClick",w),onDoubleClick:Ze("cellDoubleClick",k),onMouseOver:Ze("cellMouseOver",$),onMouseDown:De("cellMouseDown"),onMouseUp:Ve("cellMouseUp"),onKeyDown:Ze("cellKeyDown",M),onKeyUp:Ze("cellKeyUp",R)},Ie,A,{onFocus:et,ref:ke,children:oe}))}),MY=El(TY),RY=["field","type","align","width","height","empty","style","className"],JI="1.3em",$Y="1.2em",eE=[40,80],OY={number:[40,60],string:[40,80],date:[40,60],dateTime:[60,80],singleSelect:[40,80]},zY=e=>{const{align:t,classes:n,empty:r}=e,o={root:["cell","cellSkeleton",`cell--text${t?Pe(t):"Left"}`,r&&"cellEmpty"]};return Be(o,en,n)},LY=uq(12345);function DY(e){const{field:t,type:n,align:r,width:o,height:i,empty:l=!1,style:c,className:u}=e,f=St(e,RY),p={classes:gt().classes,align:r,empty:l},g=zY(p),y=m.useMemo(()=>{if(n==="boolean"||n==="actions")return{variant:"circular",width:JI,height:JI};const[v,C]=n?OY[n]??eE:eE;return{variant:"text",width:`${Math.round(LY(v,C))}%`,height:$Y}},[n]);return s.jsx("div",q({"data-field":t,className:Me(g.root,u),style:q({height:i,maxWidth:o,minWidth:o},c)},f,{children:!l&&s.jsx(to,q({},y))}))}const AY=El(DY);function FY(e){return e.vars?e.vars.palette.TableCell.border:e.palette.mode==="light"?gl(Ye(e.palette.divider,1),.88):ml(Ye(e.palette.divider,1),.68)}const NY=10,ig=-5,Ru=1,tE={width:3,rx:1.5,x:10.5},_Y="/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */",HY=e=>e.dimensions.hasScrollX&&(!e.dimensions.hasScrollY||e.dimensions.scrollbarSize===0),BY=Ce("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${te.autoHeight}`]:t.autoHeight},{[`&.${te.autosizing}`]:t.autosizing},{[`&.${te["root--densityStandard"]}`]:t["root--densityStandard"]},{[`&.${te["root--densityComfortable"]}`]:t["root--densityComfortable"]},{[`&.${te["root--densityCompact"]}`]:t["root--densityCompact"]},{[`&.${te["root--disableUserSelection"]}`]:t["root--disableUserSelection"]},{[`&.${te["root--noToolbar"]}`]:t["root--noToolbar"]},{[`&.${te.withVerticalBorder}`]:t.withVerticalBorder},{[`& .${te.actionsCell}`]:t.actionsCell},{[`& .${te.booleanCell}`]:t.booleanCell},{[`& .${te.cell}`]:t.cell},{[`& .${te["cell--editable"]}`]:t["cell--editable"]},{[`& .${te["cell--editing"]}`]:t["cell--editing"]},{[`& .${te["cell--flex"]}`]:t["cell--flex"]},{[`& .${te["cell--pinnedLeft"]}`]:t["cell--pinnedLeft"]},{[`& .${te["cell--pinnedRight"]}`]:t["cell--pinnedRight"]},{[`& .${te["cell--rangeBottom"]}`]:t["cell--rangeBottom"]},{[`& .${te["cell--rangeLeft"]}`]:t["cell--rangeLeft"]},{[`& .${te["cell--rangeRight"]}`]:t["cell--rangeRight"]},{[`& .${te["cell--rangeTop"]}`]:t["cell--rangeTop"]},{[`& .${te["cell--selectionMode"]}`]:t["cell--selectionMode"]},{[`& .${te["cell--textCenter"]}`]:t["cell--textCenter"]},{[`& .${te["cell--textLeft"]}`]:t["cell--textLeft"]},{[`& .${te["cell--textRight"]}`]:t["cell--textRight"]},{[`& .${te["cell--withLeftBorder"]}`]:t["cell--withLeftBorder"]},{[`& .${te["cell--withRightBorder"]}`]:t["cell--withRightBorder"]},{[`& .${te.cellCheckbox}`]:t.cellCheckbox},{[`& .${te.cellEmpty}`]:t.cellEmpty},{[`& .${te.cellOffsetLeft}`]:t.cellOffsetLeft},{[`& .${te.cellSkeleton}`]:t.cellSkeleton},{[`& .${te.checkboxInput}`]:t.checkboxInput},{[`& .${te.columnHeader}`]:t.columnHeader},{[`& .${te["columnHeader--alignCenter"]}`]:t["columnHeader--alignCenter"]},{[`& .${te["columnHeader--alignLeft"]}`]:t["columnHeader--alignLeft"]},{[`& .${te["columnHeader--alignRight"]}`]:t["columnHeader--alignRight"]},{[`& .${te["columnHeader--dragging"]}`]:t["columnHeader--dragging"]},{[`& .${te["columnHeader--emptyGroup"]}`]:t["columnHeader--emptyGroup"]},{[`& .${te["columnHeader--filledGroup"]}`]:t["columnHeader--filledGroup"]},{[`& .${te["columnHeader--filtered"]}`]:t["columnHeader--filtered"]},{[`& .${te["columnHeader--last"]}`]:t["columnHeader--last"]},{[`& .${te["columnHeader--lastUnpinned"]}`]:t["columnHeader--lastUnpinned"]},{[`& .${te["columnHeader--moving"]}`]:t["columnHeader--moving"]},{[`& .${te["columnHeader--numeric"]}`]:t["columnHeader--numeric"]},{[`& .${te["columnHeader--pinnedLeft"]}`]:t["columnHeader--pinnedLeft"]},{[`& .${te["columnHeader--pinnedRight"]}`]:t["columnHeader--pinnedRight"]},{[`& .${te["columnHeader--siblingFocused"]}`]:t["columnHeader--siblingFocused"]},{[`& .${te["columnHeader--sortable"]}`]:t["columnHeader--sortable"]},{[`& .${te["columnHeader--sorted"]}`]:t["columnHeader--sorted"]},{[`& .${te["columnHeader--withLeftBorder"]}`]:t["columnHeader--withLeftBorder"]},{[`& .${te["columnHeader--withRightBorder"]}`]:t["columnHeader--withRightBorder"]},{[`& .${te.columnHeaderCheckbox}`]:t.columnHeaderCheckbox},{[`& .${te.columnHeaderDraggableContainer}`]:t.columnHeaderDraggableContainer},{[`& .${te.columnHeaderTitleContainer}`]:t.columnHeaderTitleContainer},{[`& .${te.columnHeaderTitleContainerContent}`]:t.columnHeaderTitleContainerContent},{[`& .${te.columnSeparator}`]:t.columnSeparator},{[`& .${te["columnSeparator--resizable"]}`]:t["columnSeparator--resizable"]},{[`& .${te["columnSeparator--resizing"]}`]:t["columnSeparator--resizing"]},{[`& .${te["columnSeparator--sideLeft"]}`]:t["columnSeparator--sideLeft"]},{[`& .${te["columnSeparator--sideRight"]}`]:t["columnSeparator--sideRight"]},{[`& .${te["container--bottom"]}`]:t["container--bottom"]},{[`& .${te["container--top"]}`]:t["container--top"]},{[`& .${te.detailPanelToggleCell}`]:t.detailPanelToggleCell},{[`& .${te["detailPanelToggleCell--expanded"]}`]:t["detailPanelToggleCell--expanded"]},{[`& .${te.editBooleanCell}`]:t.editBooleanCell},{[`& .${te.filterIcon}`]:t.filterIcon},{[`& .${te["filler--borderBottom"]}`]:t["filler--borderBottom"]},{[`& .${te["filler--pinnedLeft"]}`]:t["filler--pinnedLeft"]},{[`& .${te["filler--pinnedRight"]}`]:t["filler--pinnedRight"]},{[`& .${te.groupingCriteriaCell}`]:t.groupingCriteriaCell},{[`& .${te.groupingCriteriaCellLoadingContainer}`]:t.groupingCriteriaCellLoadingContainer},{[`& .${te.groupingCriteriaCellToggle}`]:t.groupingCriteriaCellToggle},{[`& .${te.headerFilterRow}`]:t.headerFilterRow},{[`& .${te.iconSeparator}`]:t.iconSeparator},{[`& .${te.menuIcon}`]:t.menuIcon},{[`& .${te.menuIconButton}`]:t.menuIconButton},{[`& .${te.menuList}`]:t.menuList},{[`& .${te.menuOpen}`]:t.menuOpen},{[`& .${te.overlayWrapperInner}`]:t.overlayWrapperInner},{[`& .${te.pinnedRows}`]:t.pinnedRows},{[`& .${te["pinnedRows--bottom"]}`]:t["pinnedRows--bottom"]},{[`& .${te["pinnedRows--top"]}`]:t["pinnedRows--top"]},{[`& .${te.row}`]:t.row},{[`& .${te["row--borderBottom"]}`]:t["row--borderBottom"]},{[`& .${te["row--detailPanelExpanded"]}`]:t["row--detailPanelExpanded"]},{[`& .${te["row--dragging"]}`]:t["row--dragging"]},{[`& .${te["row--dynamicHeight"]}`]:t["row--dynamicHeight"]},{[`& .${te["row--editable"]}`]:t["row--editable"]},{[`& .${te["row--editing"]}`]:t["row--editing"]},{[`& .${te["row--firstVisible"]}`]:t["row--firstVisible"]},{[`& .${te["row--lastVisible"]}`]:t["row--lastVisible"]},{[`& .${te.rowReorderCell}`]:t.rowReorderCell},{[`& .${te["rowReorderCell--draggable"]}`]:t["rowReorderCell--draggable"]},{[`& .${te.rowReorderCellContainer}`]:t.rowReorderCellContainer},{[`& .${te.rowReorderCellPlaceholder}`]:t.rowReorderCellPlaceholder},{[`& .${te.rowSkeleton}`]:t.rowSkeleton},{[`& .${te.scrollbar}`]:t.scrollbar},{[`& .${te["scrollbar--horizontal"]}`]:t["scrollbar--horizontal"]},{[`& .${te["scrollbar--vertical"]}`]:t["scrollbar--vertical"]},{[`& .${te.scrollbarFiller}`]:t.scrollbarFiller},{[`& .${te["scrollbarFiller--borderBottom"]}`]:t["scrollbarFiller--borderBottom"]},{[`& .${te["scrollbarFiller--borderTop"]}`]:t["scrollbarFiller--borderTop"]},{[`& .${te["scrollbarFiller--header"]}`]:t["scrollbarFiller--header"]},{[`& .${te["scrollbarFiller--pinnedRight"]}`]:t["scrollbarFiller--pinnedRight"]},{[`& .${te.sortIcon}`]:t.sortIcon},{[`& .${te.treeDataGroupingCell}`]:t.treeDataGroupingCell},{[`& .${te.treeDataGroupingCellLoadingContainer}`]:t.treeDataGroupingCellLoadingContainer},{[`& .${te.treeDataGroupingCellToggle}`]:t.treeDataGroupingCellToggle},{[`& .${te.withBorderColor}`]:t.withBorderColor}]})(({theme:e})=>{var M,R;const t=Vs(),n=He(t,HY),r=FY(e),o=e.shape.borderRadius,i=e.vars?e.vars.palette.background.default:((M=e.mixins.MuiDataGrid)==null?void 0:M.containerBackground)??e.palette.background.default,l=((R=e.mixins.MuiDataGrid)==null?void 0:R.pinnedBackground)??i,c=e.vars?`rgba(${e.vars.palette.background.defaultChannel} / ${e.vars.palette.action.disabledOpacity})`:Ye(e.palette.background.default,e.palette.action.disabledOpacity),u=(e.vars||e).palette.action.hoverOpacity,f=(e.vars||e).palette.action.hover,h=(e.vars||e).palette.action.selectedOpacity,p=e.vars?`calc(${u} + ${h})`:u+h,g=e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${h})`:Ye(e.palette.primary.main,h),y=e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${p})`:Ye(e.palette.primary.main,p),b=e.vars?GY:WY,v=E=>({[`& .${te["cell--pinnedLeft"]}, & .${te["cell--pinnedRight"]}`]:{backgroundColor:E,"&.Mui-selected":{backgroundColor:b(E,g,h),"&:hover":{backgroundColor:b(E,g,p)}}}}),C=b(l,f,u),S=v(C),j=b(l,g,h),w=v(j),k=b(l,y,p),P=v(k),T={backgroundColor:g,"&:hover":{backgroundColor:y,"@media (hover: none)":{backgroundColor:g}}};return q({"--unstable_DataGrid-radius":typeof o=="number"?`${o}px`:o,"--unstable_DataGrid-headWeight":e.typography.fontWeightMedium,"--unstable_DataGrid-overlayBackground":c,"--DataGrid-containerBackground":i,"--DataGrid-pinnedBackground":l,"--DataGrid-rowBorderColor":r,"--DataGrid-cellOffsetMultiplier":2,"--DataGrid-width":"0px","--DataGrid-hasScrollX":"0","--DataGrid-hasScrollY":"0","--DataGrid-scrollbarSize":"10px","--DataGrid-rowWidth":"0px","--DataGrid-columnsTotalWidth":"0px","--DataGrid-leftPinnedWidth":"0px","--DataGrid-rightPinnedWidth":"0px","--DataGrid-headerHeight":"0px","--DataGrid-headersTotalHeight":"0px","--DataGrid-topContainerHeight":"0px","--DataGrid-bottomContainerHeight":"0px",flex:1,boxSizing:"border-box",position:"relative",borderWidth:"1px",borderStyle:"solid",borderColor:r,borderRadius:"var(--unstable_DataGrid-radius)",color:(e.vars||e).palette.text.primary},e.typography.body2,{outline:"none",height:"100%",display:"flex",minWidth:0,minHeight:0,flexDirection:"column",overflow:"hidden",overflowAnchor:"none",transform:"translate(0, 0)",[`.${te.main} > *:first-child${_Y}`]:{borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"},[`&.${te.autoHeight}`]:{height:"auto"},[`&.${te.autosizing}`]:{[`& .${te.columnHeaderTitleContainerContent} > *`]:{overflow:"visible !important"},"@media (hover: hover)":{[`& .${te.menuIcon}`]:{width:"0 !important",visibility:"hidden !important"}},[`& .${te.cell}`]:{overflow:"visible !important",whiteSpace:"nowrap",minWidth:"max-content !important",maxWidth:"max-content !important"},[`& .${te.groupingCriteriaCell}`]:{width:"unset"},[`& .${te.treeDataGroupingCell}`]:{width:"unset"}},[`& .${te.columnHeader}, & .${te.cell}`]:{WebkitTapHighlightColor:"transparent",padding:"0 10px",boxSizing:"border-box"},[`& .${te.columnHeader}:focus-within, & .${te.cell}:focus-within`]:{outline:`solid ${e.vars?`rgba(${e.vars.palette.primary.mainChannel} / 0.5)`:Ye(e.palette.primary.main,.5)} ${Ru}px`,outlineOffset:Ru*-1},[`& .${te.columnHeader}:focus, & .${te.cell}:focus`]:{outline:`solid ${e.palette.primary.main} ${Ru}px`,outlineOffset:Ru*-1},[`& .${te.columnHeader}:focus,
|
|
319
|
+
& .${te["columnHeader--withLeftBorder"]},
|
|
320
|
+
& .${te["columnHeader--withRightBorder"]},
|
|
321
|
+
& .${te["columnHeader--siblingFocused"]},
|
|
322
|
+
& .${te["virtualScroller--hasScrollX"]} .${te["columnHeader--lastUnpinned"]},
|
|
323
|
+
& .${te["virtualScroller--hasScrollX"]} .${te["columnHeader--last"]}
|
|
324
|
+
`]:{[`& .${te.columnSeparator}`]:{opacity:0},"@media (hover: none)":{[`& .${te["columnSeparator--resizable"]}`]:{opacity:1}},[`& .${te["columnSeparator--resizable"]}:hover`]:{opacity:1}},[`&.${te["root--noToolbar"]} [aria-rowindex="1"] [aria-colindex="1"]`]:{borderTopLeftRadius:"calc(var(--unstable_DataGrid-radius) - 1px)"},[`&.${te["root--noToolbar"]} [aria-rowindex="1"] .${te["columnHeader--last"]}`]:{borderTopRightRadius:n?"calc(var(--unstable_DataGrid-radius) - 1px)":void 0},[`& .${te.columnHeaderCheckbox}, & .${te.cellCheckbox}`]:{padding:0,justifyContent:"center",alignItems:"center"},[`& .${te.columnHeader}`]:{position:"relative",display:"flex",alignItems:"center"},[`& .${te["virtualScroller--hasScrollX"]} .${te["columnHeader--last"]}`]:{overflow:"hidden"},[`& .${te["columnHeader--sorted"]} .${te.iconButtonContainer}, & .${te["columnHeader--filtered"]} .${te.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${te.columnHeader}:not(.${te["columnHeader--sorted"]}) .${te.sortButton}`]:{opacity:0,transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.shorter})},[`& .${te.columnHeaderTitleContainer}`]:{display:"flex",alignItems:"center",gap:e.spacing(.25),minWidth:0,flex:1,whiteSpace:"nowrap",overflow:"hidden"},[`& .${te.columnHeaderTitleContainerContent}`]:{overflow:"hidden",display:"flex",alignItems:"center"},[`& .${te["columnHeader--filledGroup"]} .${te.columnHeaderTitleContainer}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${te.sortIcon}, & .${te.filterIcon}`]:{fontSize:"inherit"},[`& .${te["columnHeader--sortable"]}`]:{cursor:"pointer"},[`& .${te["columnHeader--alignCenter"]} .${te.columnHeaderTitleContainer}`]:{justifyContent:"center"},[`& .${te["columnHeader--alignRight"]} .${te.columnHeaderDraggableContainer}, & .${te["columnHeader--alignRight"]} .${te.columnHeaderTitleContainer}`]:{flexDirection:"row-reverse"},[`& .${te["columnHeader--alignCenter"]} .${te.menuIcon}`]:{marginLeft:"auto"},[`& .${te["columnHeader--alignRight"]} .${te.menuIcon}`]:{marginRight:"auto",marginLeft:-5},[`& .${te["columnHeader--moving"]}`]:{backgroundColor:(e.vars||e).palette.action.hover},[`& .${te["columnHeader--pinnedLeft"]}, & .${te["columnHeader--pinnedRight"]}`]:{position:"sticky",zIndex:40,background:"var(--DataGrid-pinnedBackground)"},[`& .${te.columnSeparator}`]:{position:"absolute",overflow:"hidden",zIndex:30,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",maxWidth:NY,color:r},[`& .${te.columnHeaders}`]:{width:"var(--DataGrid-rowWidth)"},"@media (hover: hover)":{[`& .${te.columnHeader}:hover`]:{[`& .${te.menuIcon}`]:{width:"auto",visibility:"visible"},[`& .${te.iconButtonContainer}`]:{visibility:"visible",width:"auto"}},[`& .${te.columnHeader}:not(.${te["columnHeader--sorted"]}):hover .${te.sortButton}`]:{opacity:.5}},"@media (hover: none)":{[`& .${te.columnHeader} .${te.menuIcon}`]:{width:"auto",visibility:"visible"},[`& .${te.columnHeader}:focus,
|
|
325
|
+
& .${te["columnHeader--siblingFocused"]}`]:{[`.${te["columnSeparator--resizable"]}`]:{color:(e.vars||e).palette.primary.main}}},[`& .${te["columnSeparator--sideLeft"]}`]:{left:ig},[`& .${te["columnSeparator--sideRight"]}`]:{right:ig},[`& .${te["columnHeader--withRightBorder"]} .${te["columnSeparator--sideLeft"]}`]:{left:ig-.5},[`& .${te["columnHeader--withRightBorder"]} .${te["columnSeparator--sideRight"]}`]:{right:ig-.5},[`& .${te["columnSeparator--resizable"]}`]:{cursor:"col-resize",touchAction:"none",[`&.${te["columnSeparator--resizing"]}`]:{color:(e.vars||e).palette.primary.main},"@media (hover: none)":{[`& .${te.iconSeparator} rect`]:tE},"@media (hover: hover)":{"&:hover":{color:(e.vars||e).palette.primary.main,[`& .${te.iconSeparator} rect`]:tE}},"& svg":{pointerEvents:"none"}},[`& .${te.iconSeparator}`]:{color:"inherit",transition:e.transitions.create(["color","width"],{duration:e.transitions.duration.shortest})},[`& .${te.menuIcon}`]:{width:0,visibility:"hidden",fontSize:20,marginRight:-5,display:"flex",alignItems:"center"},[`.${te.menuOpen}`]:{visibility:"visible",width:"auto"},[`& .${te.headerFilterRow}`]:{[`& .${te.columnHeader}`]:{boxSizing:"border-box",borderBottom:"1px solid var(--DataGrid-rowBorderColor)"}},[`& .${te["row--borderBottom"]} .${te.columnHeader},
|
|
326
|
+
& .${te["row--borderBottom"]} .${te.filler},
|
|
327
|
+
& .${te["row--borderBottom"]} .${te.scrollbarFiller}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${te["row--borderBottom"]} .${te.cell}`]:{borderBottom:"1px solid var(--rowBorderColor)"},[`.${te.row}`]:{display:"flex",width:"var(--DataGrid-rowWidth)",breakInside:"avoid","--rowBorderColor":"var(--DataGrid-rowBorderColor)",[`&.${te["row--firstVisible"]}`]:{"--rowBorderColor":"transparent"},"&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${te.rowSkeleton}:hover`]:{backgroundColor:"transparent"},"&.Mui-selected":T},[`& .${te["container--top"]}, & .${te["container--bottom"]}`]:{"[role=row]":{background:"var(--DataGrid-containerBackground)"}},[`& .${te.cell}`]:{flex:"0 0 auto",height:"var(--height)",width:"var(--width)",lineHeight:"calc(var(--height) - 1px)",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis","&.Mui-selected":T},[`& .${te["virtualScrollerContent--overflowed"]} .${te["row--lastVisible"]} .${te.cell}`]:{borderTopColor:"transparent"},[`& .${te["pinnedRows--top"]} :first-of-type`]:{[`& .${te.cell}, .${te.scrollbarFiller}`]:{borderTop:"none"}},[`&.${te["root--disableUserSelection"]}`]:{userSelect:"none"},[`& .${te["row--dynamicHeight"]} > .${te.cell}`]:{whiteSpace:"initial",lineHeight:"inherit"},[`& .${te.cellEmpty}`]:{flex:1,padding:0,height:"unset"},[`& .${te.cell}.${te["cell--selectionMode"]}`]:{cursor:"default"},[`& .${te.cell}.${te["cell--editing"]}`]:{padding:1,display:"flex",boxShadow:e.shadows[2],backgroundColor:(e.vars||e).palette.background.paper,"&:focus-within":{outline:`${Ru}px solid ${(e.vars||e).palette.primary.main}`,outlineOffset:Ru*-1}},[`& .${te["row--editing"]}`]:{boxShadow:e.shadows[2]},[`& .${te["row--editing"]} .${te.cell}`]:{boxShadow:e.shadows[0],backgroundColor:(e.vars||e).palette.background.paper},[`& .${te.editBooleanCell}`]:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},[`& .${te.booleanCell}[data-value="true"]`]:{color:(e.vars||e).palette.text.secondary},[`& .${te.booleanCell}[data-value="false"]`]:{color:(e.vars||e).palette.text.disabled},[`& .${te.actionsCell}`]:{display:"inline-flex",alignItems:"center",gridGap:e.spacing(1)},[`& .${te.rowReorderCell}`]:{display:"inline-flex",flex:1,alignItems:"center",justifyContent:"center",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${te["rowReorderCell--draggable"]}`]:{cursor:"move",opacity:1},[`& .${te.rowReorderCellContainer}`]:{padding:0,display:"flex",alignItems:"stretch"},[`.${te.withBorderColor}`]:{borderColor:r},[`& .${te["cell--withLeftBorder"]}, & .${te["columnHeader--withLeftBorder"]}`]:{borderLeftColor:"var(--DataGrid-rowBorderColor)",borderLeftWidth:"1px",borderLeftStyle:"solid"},[`& .${te["cell--withRightBorder"]}, & .${te["columnHeader--withRightBorder"]}`]:{borderRightColor:"var(--DataGrid-rowBorderColor)",borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${te["cell--flex"]}`]:{display:"flex",alignItems:"center",lineHeight:"inherit"},[`& .${te["cell--textLeft"]}`]:{textAlign:"left",justifyContent:"flex-start"},[`& .${te["cell--textRight"]}`]:{textAlign:"right",justifyContent:"flex-end"},[`& .${te["cell--textCenter"]}`]:{textAlign:"center",justifyContent:"center"},[`& .${te["cell--pinnedLeft"]}, & .${te["cell--pinnedRight"]}`]:{position:"sticky",zIndex:30,background:"var(--DataGrid-pinnedBackground)","&.Mui-selected":{backgroundColor:j}},[`& .${te.virtualScrollerContent} .${te.row}`]:{"&:hover":S,"&.Mui-selected":w,"&.Mui-selected:hover":P},[`& .${te.cellOffsetLeft}`]:{flex:"0 0 auto",display:"inline-block"},[`& .${te.cellSkeleton}`]:{flex:"0 0 auto",height:"100%",display:"inline-flex",alignItems:"center"},[`& .${te.columnHeaderDraggableContainer}`]:{display:"flex",width:"100%",height:"100%"},[`& .${te.rowReorderCellPlaceholder}`]:{display:"none"},[`& .${te["columnHeader--dragging"]}, & .${te["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${te["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity,[`& .${te.rowReorderCellPlaceholder}`]:{display:"flex"}},[`& .${te.treeDataGroupingCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${te.treeDataGroupingCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)},[`& .${te.treeDataGroupingCellLoadingContainer}, .${te.groupingCriteriaCellLoadingContainer}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},[`& .${te.groupingCriteriaCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${te.groupingCriteriaCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)},[`.${te.scrollbarFiller}`]:{minWidth:"calc(var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))",alignSelf:"stretch",[`&.${te["scrollbarFiller--borderTop"]}`]:{borderTop:"1px solid var(--DataGrid-rowBorderColor)"},[`&.${te["scrollbarFiller--borderBottom"]}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`&.${te["scrollbarFiller--pinnedRight"]}`]:{backgroundColor:"var(--DataGrid-pinnedBackground)",position:"sticky",right:0}},[`& .${te.filler}`]:{flex:"1 0 auto"},[`& .${te["filler--borderBottom"]}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${te["main--hasSkeletonLoadingOverlay"]}`]:{[`& .${te.virtualScrollerContent}`]:{position:"fixed",visibility:"hidden"},[`& .${te["scrollbar--vertical"]}, & .${te.pinnedRows}, & .${te.virtualScroller} > .${te.filler}`]:{display:"none"}}})});function WY(e,t,n,r=1){const o=(u,f)=>Math.round((u**(1/r)*(1-n)+f**(1/r)*n)**r),i=Li(e),l=Li(t),c=[o(i.values[0],l.values[0]),o(i.values[1],l.values[1]),o(i.values[2],l.values[2])];return mh({type:"rgb",values:c})}const VY=e=>`rgb(from ${e} r g b / 1)`;function GY(e,t,n){return`color-mix(in srgb,${e}, ${VY(t)} calc(${n} * 100%))`}const UY=()=>()=>{},qY=()=>!1,KY=()=>!0,QY=()=>Bw.useSyncExternalStore(UY,qY,KY);function YY(){var i,l;const e=Ut(),t=He(e,Ls),n=gt(),r=He(e,Bp),o=e.current.unstable_applyPipeProcessors("preferencePanel",null,r.openedPanelValue??_c.filters);return s.jsx(n.slots.panel,q({as:n.slots.basePopper,open:t.length>0&&r.open,id:r.panelId,"aria-labelledby":r.labelId},(i=n.slotProps)==null?void 0:i.panel,(l=n.slotProps)==null?void 0:l.basePopper,{children:o}))}function XY(){var t;const e=gt();return s.jsxs(m.Fragment,{children:[s.jsx(YY,{}),e.slots.toolbar&&s.jsx(e.slots.toolbar,q({},(t=e.slotProps)==null?void 0:t.toolbar))]})}const ZY=["className","children"],JY=(e,t)=>{const{autoHeight:n,classes:r,showCellVerticalBorder:o}=e,i={root:["root",n&&"autoHeight",`root--density${Pe(t)}`,e.slots.toolbar===null&&"root--noToolbar","withBorderColor",o&&"withVerticalBorder"]};return Be(i,en,r)},eX=sn(function(t,n){const r=gt(),{className:o,children:i}=t,l=St(t,ZY),c=Vs(),u=He(c,Bu),f=c.current.rootElementRef,h=m.useCallback(v=>{v!==null&&c.current.publishEvent("rootMount",v)},[c]),p=Pn(f,n,h),g=r,y=JY(g,u);return QY()?null:s.jsxs(BY,q({className:Me(y.root,o),ownerState:g},l,{ref:p,children:[s.jsx(XY,{}),s.jsx(bY,{children:i}),s.jsx(vY,{})]}))}),tX=El(eX),nX=["className"],rX=e=>{const{classes:t}=e;return Be({root:["footerContainer","withBorderColor"]},en,t)},oX=Dn("div",{name:"MuiDataGrid",slot:"FooterContainer",overridesResolver:(e,t)=>t.footerContainer})({display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:52,borderTop:"1px solid"}),sX=sn(function(t,n){const{className:r}=t,o=St(t,nX),i=gt(),l=rX(i);return s.jsx(oX,q({className:Me(l.root,r),ownerState:i},o,{ref:n}))}),iX=["className"],lX=e=>{const{classes:t}=e;return Be({root:["overlay"]},en,t)},aX=Dn("div",{name:"MuiDataGrid",slot:"Overlay",overridesResolver:(e,t)=>t.overlay})({width:"100%",height:"100%",display:"flex",alignSelf:"center",alignItems:"center",justifyContent:"center",backgroundColor:"var(--unstable_DataGrid-overlayBackground)"}),lS=sn(function(t,n){const{className:r}=t,o=St(t,iX),i=gt(),l=lX(i);return s.jsx(aX,q({className:Me(l.root,r),ownerState:i},o,{ref:n}))}),cX=e=>{const{classes:t,open:n}=e;return Be({root:["menuIcon",n&&"menuOpen"],button:["menuIconButton"]},en,t)},uX=m.memo(e=>{var g,y;const{colDef:t,open:n,columnMenuId:r,columnMenuButtonId:o,iconButtonRef:i}=e,l=Ut(),c=gt(),u=q({},e,{classes:c.classes}),f=cX(u),h=m.useCallback(b=>{b.preventDefault(),b.stopPropagation(),l.current.toggleColumnMenu(t.field)},[l,t.field]),p=t.headerName??t.field;return s.jsx("div",{className:f.root,children:s.jsx(c.slots.baseTooltip,q({title:l.current.getLocaleText("columnMenuLabel"),enterDelay:1e3},(g=c.slotProps)==null?void 0:g.baseTooltip,{children:s.jsx(c.slots.baseIconButton,q({ref:i,tabIndex:-1,className:f.button,"aria-label":l.current.getLocaleText("columnMenuAriaLabel")(p),size:"small",onClick:h,"aria-haspopup":"menu","aria-expanded":n,"aria-controls":n?r:void 0,id:o},(y=c.slotProps)==null?void 0:y.baseIconButton,{children:s.jsx(c.slots.columnMenuIcon,{fontSize:"inherit"})}))}))})});function dX({columnMenuId:e,columnMenuButtonId:t,ContentComponent:n,contentComponentProps:r,field:o,open:i,target:l,onExited:c}){const u=Ut(),f=u.current.getColumn(o),h=Vt(p=>{p&&(p.stopPropagation(),l!=null&&l.contains(p.target))||u.current.hideColumnMenu()});return!l||!f?null:s.jsx(Kw,{placement:`bottom-${f.align==="right"?"start":"end"}`,open:i,target:l,onClose:h,onExited:c,children:s.jsx(n,q({colDef:f,hideMenu:h,open:i,id:e,labelledby:t},r))})}function fX(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function sx(e,t){return e.closest(`.${t}`)}function Tl(e){return e.replace(/["\\]/g,"\\$&")}function pX(e,t){return e.querySelector(`[role="columnheader"][data-field="${Tl(t)}"]`)}function U$(e){return`.${te.row}[data-id="${Tl(String(e))}"]`}function hX(e,t){return e.querySelector(U$(t))}function mX(e,{id:t,field:n}){const r=U$(t),o=`.${te.cell}[data-field="${Tl(n)}"]`,i=`${r} ${o}`;return e.querySelector(i)}function Th(e){return e.target.nodeType===1&&!e.currentTarget.contains(e.target)}function gX(e){return e.getAttribute("data-field")}function xX(e,t){return e.querySelector(`[data-field="${Tl(t)}"]`)}function yX(e){return e.getAttribute("data-fields").slice(2,-2).split("-|-")}function bX(e,t){return Array.from(e.querySelectorAll(`[data-fields*="|-${Tl(t)}-|"]`)??[])}function vX(e,t){var l;if(!sx(e,te.root))throw new Error("MUI X: The root element is not found.");const r=e.getAttribute("aria-colindex");if(!r)return[];const o=Number(r)-1,i=[];return(l=t.virtualScrollerRef)!=null&&l.current?(Q$(t).forEach(c=>{const u=c.getAttribute("data-id");if(!u)return;let f=o;const h=t.unstable_getCellColSpanInfo(u,o);h&&h.spannedByColSpan&&(f=h.leftVisibleCellIndex);const p=c.querySelector(`[data-colindex="${f}"]`);p&&i.push(p)}),i):[]}function nE(e,t){return e.rootElementRef.current.querySelector(`.${te[t]}`)}const q$=({api:e,colIndex:t,position:n,filterFn:r})=>{if(t===null)return[];const o=[];return Q$(e).forEach(i=>{i.getAttribute("data-id")&&i.querySelectorAll(`.${te[n==="left"?"cell--pinnedLeft":"cell--pinnedRight"]}`).forEach(c=>{const u=tf(c);u!==null&&r(u)&&o.push(c)})}),o};function CX(e,t,n){const r=tf(t);return q$({api:e,colIndex:r,position:n?"right":"left",filterFn:o=>n?o<r:o>r})}function wX(e,t,n){const r=tf(t);return q$({api:e,colIndex:r,position:n?"left":"right",filterFn:o=>n?o>r:o<r})}const K$=({api:e,colIndex:t,position:n,filterFn:r})=>{var i;if(!((i=e.columnHeadersContainerRef)!=null&&i.current))return[];if(t===null)return[];const o=[];return e.columnHeadersContainerRef.current.querySelectorAll(`.${te[n==="left"?"columnHeader--pinnedLeft":"columnHeader--pinnedRight"]}`).forEach(l=>{const c=tf(l);c!==null&&r(c,l)&&o.push(l)}),o};function SX(e,t,n){const r=tf(t);return K$({api:e,position:n?"right":"left",colIndex:r,filterFn:o=>n?o<r:o>r})}function jX(e,t,n){const r=tf(t);return K$({api:e,position:n?"left":"right",colIndex:r,filterFn:(o,i)=>i.classList.contains(te["columnHeader--last"])?!1:n?o>r:o<r})}function kX(e,t){return e.columnHeadersContainerRef.current.querySelector(`:scope > div > [data-field="${Tl(t)}"][role="columnheader"]`)}function IX(e,t){const n=e.virtualScrollerRef.current;return Array.from(n.querySelectorAll(`:scope > div > div > div > [data-field="${Tl(t)}"][role="gridcell"]`))}function Q$(e){return e.virtualScrollerRef.current.querySelectorAll(`:scope > div > div > .${te.row}`)}function tf(e){const t=e.getAttribute("aria-colindex");return t?Number(t)-1:null}const EX=["className","aria-label"],PX=e=>{const{classes:t}=e;return Be({root:["columnHeaderTitle"]},en,t)},TX=Dn("div",{name:"MuiDataGrid",slot:"ColumnHeaderTitle",overridesResolver:(e,t)=>t.columnHeaderTitle})({textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:"var(--unstable_DataGrid-headWeight)",lineHeight:"normal"}),MX=sn(function(t,n){const{className:r}=t,o=St(t,EX),i=gt(),l=PX(i);return s.jsx(TX,q({className:Me(l.root,r),ownerState:i},o,{ref:n}))});function RX(e){var u;const{label:t,description:n}=e,r=gt(),o=m.useRef(null),[i,l]=m.useState(""),c=m.useCallback(()=>{if(!n&&(o!=null&&o.current)){const f=fX(o.current);l(f?t:"")}},[n,t]);return s.jsx(r.slots.baseTooltip,q({title:n||i},(u=r.slotProps)==null?void 0:u.baseTooltip,{children:s.jsx(MX,{onMouseOver:c,ref:o,children:t})}))}const $X=["resizable","resizing","height","side"];var aS=(function(e){return e.Left="left",e.Right="right",e})(aS||{});const OX=e=>{const{resizable:t,resizing:n,classes:r,side:o}=e,i={root:["columnSeparator",t&&"columnSeparator--resizable",n&&"columnSeparator--resizing",o&&`columnSeparator--side${Pe(o)}`],icon:["iconSeparator"]};return Be(i,en,r)};function zX(e){const{height:t,side:n=aS.Right}=e,r=St(e,$X),o=gt(),i=q({},e,{side:n,classes:o.classes}),l=OX(i),c=m.useCallback(u=>{u.preventDefault(),u.stopPropagation()},[]);return s.jsx("div",q({className:l.root,style:{minHeight:t}},r,{onClick:c,children:s.jsx(o.slots.columnResizeIcon,{className:l.icon})}))}const LX=m.memo(zX),DX=["classes","columnMenuOpen","colIndex","height","isResizing","sortDirection","hasFocus","tabIndex","separatorSide","isDraggable","headerComponent","description","elementId","width","columnMenuIconButton","columnMenu","columnTitleIconButtons","headerClassName","label","resizable","draggableContainerProps","columnHeaderSeparatorProps","style"],Y$=sn(function(t,n){const{classes:r,colIndex:o,height:i,isResizing:l,sortDirection:c,tabIndex:u,separatorSide:f,isDraggable:h,headerComponent:p,description:g,width:y,columnMenuIconButton:b=null,columnMenu:v=null,columnTitleIconButtons:C=null,headerClassName:S,label:j,resizable:w,draggableContainerProps:k,columnHeaderSeparatorProps:P,style:T}=t,$=St(t,DX),M=gt(),R=m.useRef(null),E=Pn(R,n);let O="none";return c!=null&&(O=c==="asc"?"ascending":"descending"),s.jsxs("div",q({className:Me(r.root,S),style:q({},T,{height:i,width:y}),role:"columnheader",tabIndex:u,"aria-colindex":o+1,"aria-sort":O},$,{ref:E,children:[s.jsxs("div",q({className:r.draggableContainer,draggable:h,role:"presentation"},k,{children:[s.jsxs("div",{className:r.titleContainer,role:"presentation",children:[s.jsx("div",{className:r.titleContainerContent,children:p!==void 0?p:s.jsx(RX,{label:j,description:g,columnWidth:y})}),C]}),b]})),s.jsx(LX,q({resizable:!M.disableColumnResize&&!!w,resizing:l,height:i,side:f},P)),v]}))}),AX=e=>{const{colDef:t,classes:n,isDragging:r,sortDirection:o,showRightBorder:i,showLeftBorder:l,filterItemsCounter:c,pinnedPosition:u,isLastUnpinned:f,isSiblingFocused:h}=e,p=o!=null,g=c!=null&&c>0,y=t.type==="number",b={root:["columnHeader",t.headerAlign==="left"&&"columnHeader--alignLeft",t.headerAlign==="center"&&"columnHeader--alignCenter",t.headerAlign==="right"&&"columnHeader--alignRight",t.sortable&&"columnHeader--sortable",r&&"columnHeader--moving",p&&"columnHeader--sorted",g&&"columnHeader--filtered",y&&"columnHeader--numeric","withBorderColor",i&&"columnHeader--withRightBorder",l&&"columnHeader--withLeftBorder",u===Qt.LEFT&&"columnHeader--pinnedLeft",u===Qt.RIGHT&&"columnHeader--pinnedRight",f&&"columnHeader--lastUnpinned",h&&"columnHeader--siblingFocused"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]};return Be(b,en,n)};function FX(e){var Y,ie,ce;const{colDef:t,columnMenuOpen:n,colIndex:r,headerHeight:o,isResizing:i,isLast:l,sortDirection:c,sortIndex:u,filterItemsCounter:f,hasFocus:h,tabIndex:p,disableReorder:g,separatorSide:y,showLeftBorder:b,showRightBorder:v,pinnedPosition:C,pinnedOffset:S}=e,j=Vs(),w=gt(),k=Yr(),P=m.useRef(null),T=Sn(),$=Sn(),M=m.useRef(null),[R,E]=m.useState(n),O=m.useMemo(()=>!w.disableColumnReorder&&!g&&!t.disableReorder,[w.disableColumnReorder,g,t.disableReorder]);let A;t.renderHeader&&(A=t.renderHeader(j.current.getColumnHeaderParams(t.field)));const N=q({},e,{classes:w.classes,showRightBorder:v,showLeftBorder:b}),F=AX(N),L=m.useCallback(he=>de=>{Th(de)||j.current.publishEvent(he,j.current.getColumnHeaderParams(t.field),de)},[j,t.field]),D=m.useMemo(()=>({onClick:L("columnHeaderClick"),onContextMenu:L("columnHeaderContextMenu"),onDoubleClick:L("columnHeaderDoubleClick"),onMouseOver:L("columnHeaderOver"),onMouseOut:L("columnHeaderOut"),onMouseEnter:L("columnHeaderEnter"),onMouseLeave:L("columnHeaderLeave"),onKeyDown:L("columnHeaderKeyDown"),onFocus:L("columnHeaderFocus"),onBlur:L("columnHeaderBlur")}),[L]),H=m.useMemo(()=>O?{onDragStart:L("columnHeaderDragStart"),onDragEnter:L("columnHeaderDragEnter"),onDragOver:L("columnHeaderDragOver"),onDragEnd:L("columnHeaderDragEnd")}:{},[O,L]),B=m.useMemo(()=>({onMouseDown:L("columnSeparatorMouseDown"),onDoubleClick:L("columnSeparatorDoubleClick")}),[L]);m.useEffect(()=>{R||E(n)},[R,n]);const V=m.useCallback(()=>{E(!1)},[]),G=!w.disableColumnMenu&&!t.disableColumnMenu&&s.jsx(uX,{colDef:t,columnMenuId:T,columnMenuButtonId:$,open:R,iconButtonRef:M}),_=s.jsx(dX,{columnMenuId:T,columnMenuButtonId:$,field:t.field,open:n,target:M.current,ContentComponent:w.slots.columnMenu,contentComponentProps:(Y=w.slotProps)==null?void 0:Y.columnMenu,onExited:V}),U=t.sortingOrder??w.sortingOrder,Z=(t.sortable||c!=null)&&!t.hideSortIcons&&!w.disableColumnSorting,Q=s.jsxs(m.Fragment,{children:[!w.disableColumnFilter&&s.jsx(w.slots.columnHeaderFilterIconButton,q({field:t.field,counter:f},(ie=w.slotProps)==null?void 0:ie.columnHeaderFilterIconButton)),Z&&s.jsx(w.slots.columnHeaderSortIcon,q({field:t.field,direction:c,index:u,sortingOrder:U,disabled:!t.sortable},(ce=w.slotProps)==null?void 0:ce.columnHeaderSortIcon))]});m.useLayoutEffect(()=>{const he=j.current.state.columnMenu;if(h&&!he.open){const le=P.current.querySelector('[tabindex="0"]')||P.current;if(!le)return;if(iS())le.focus({preventScroll:!0});else{const ge=j.current.getScrollPosition();le.focus(),j.current.scroll(ge)}}},[j,h]);const ee=typeof t.headerClassName=="function"?t.headerClassName({field:t.field,colDef:t}):t.headerClassName,ne=t.headerName??t.field,re=m.useMemo(()=>ly(q({},e.style),k,C,S),[C,S,e.style,k]);return s.jsx(Y$,q({ref:P,classes:F,columnMenuOpen:n,colIndex:r,height:o,isResizing:i,sortDirection:c,hasFocus:h,tabIndex:p,separatorSide:y,isDraggable:O,headerComponent:A,description:t.description,elementId:t.field,width:t.computedWidth,columnMenuIconButton:G,columnTitleIconButtons:Q,headerClassName:Me(ee,l&&te["columnHeader--last"]),label:ne,resizable:!w.disableColumnResize&&!!t.resizable,"data-field":t.field,columnMenu:_,draggableContainerProps:H,columnHeaderSeparatorProps:B,style:re},D))}const NX=El(FX),_X=["className"],HX=e=>{const{classes:t}=e;return Be({root:["iconButtonContainer"]},en,t)},BX=Dn("div",{name:"MuiDataGrid",slot:"IconButtonContainer",overridesResolver:(e,t)=>t.iconButtonContainer})(()=>({display:"flex",visibility:"hidden",width:0})),X$=sn(function(t,n){const{className:r}=t,o=St(t,_X),i=gt(),l=HX(i);return s.jsx(BX,q({className:Me(l.root,r),ownerState:i},o,{ref:n}))}),WX=["direction","index","sortingOrder","disabled","className"],VX=e=>{const{classes:t}=e;return Be({root:["sortButton"],icon:["sortIcon"]},en,t)};function GX(e,t,n,r){let o;const i={};return t==="asc"?o=e.columnSortedAscendingIcon:t==="desc"?o=e.columnSortedDescendingIcon:(o=e.columnUnsortedIcon,i.sortingOrder=r),o?s.jsx(o,q({fontSize:"small",className:n},i)):null}function UX(e){var y;const{direction:t,index:n,sortingOrder:r,disabled:o,className:i}=e,l=St(e,WX),c=Ut(),u=gt(),f=q({},e,{classes:u.classes}),h=VX(f),p=GX(u.slots,t,h.icon,r);if(!p)return null;const g=s.jsx(u.slots.baseIconButton,q({tabIndex:-1,"aria-label":c.current.getLocaleText("columnHeaderSortIconLabel"),title:c.current.getLocaleText("columnHeaderSortIconLabel"),size:"small",disabled:o,className:Me(h.root,i)},(y=u.slotProps)==null?void 0:y.baseIconButton,l,{children:p}));return s.jsxs(X$,{children:[n!=null&&s.jsx(u.slots.baseBadge,{badgeContent:n,color:"default",overlap:"circular",children:g}),n==null&&g]})}const qX=m.memo(UX),KX=e=>{const{classes:t}=e;return Be({icon:["filterIcon"]},en,t)};function QX(e){return e.counter?s.jsx(YX,q({},e)):null}function YX(e){var y,b;const{counter:t,field:n,onClick:r}=e,o=Ut(),i=gt(),l=q({},e,{classes:i.classes}),c=KX(l),u=Sn(),f=Np(o,fY,u),h=Sn(),p=m.useCallback(v=>{v.preventDefault(),v.stopPropagation();const{open:C,openedPanelValue:S}=Bp(o.current.state);C&&S===_c.filters?o.current.hideFilterPanel():o.current.showFilterPanel(void 0,h,u),r&&r(o.current.getColumnHeaderParams(n),v)},[o,n,r,h,u]);if(!t)return null;const g=s.jsx(i.slots.baseIconButton,q({id:u,onClick:p,color:"default","aria-label":o.current.getLocaleText("columnHeaderFiltersLabel"),size:"small",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":f,"aria-controls":f?h:void 0},(y=i.slotProps)==null?void 0:y.baseIconButton,{children:s.jsx(i.slots.columnFilteredIcon,{className:c.icon,fontSize:"small"})}));return s.jsx(i.slots.baseTooltip,q({title:o.current.getLocaleText("columnHeaderFiltersTooltipActive")(t),enterDelay:1e3},(b=i.slotProps)==null?void 0:b.baseTooltip,{children:s.jsxs(X$,{children:[t>1&&s.jsx(i.slots.baseBadge,{badgeContent:t,color:"default",children:g}),t===1&&g]})}))}const rE=_e(s.jsx("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward"),oE=_e(s.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward"),sE=_e(s.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"KeyboardArrowRight"),iE=_e(s.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),XX=_e(s.jsx("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}),"FilterList"),lE=_e(s.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61z"}),"FilterAlt"),ZX=_e(s.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"Search");_e(s.jsx("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");_e(s.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");const JX=_e(s.jsx("path",{d:"M6 5H3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm14 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm-7 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1z"}),"ColumnIcon"),eZ=_e(s.jsx("rect",{width:"1",height:"24",x:"11.5",rx:"0.5"}),"Separator"),tZ=_e(s.jsx("path",{d:"M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z"}),"ViewHeadline"),nZ=_e(s.jsx("path",{d:"M21,8H3V4h18V8z M21,10H3v4h18V10z M21,16H3v4h18V16z"}),"TableRows"),rZ=_e(s.jsx("path",{d:"M4 18h17v-6H4v6zM4 5v6h17V5H4z"}),"ViewStream"),oZ=_e(s.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"TripleDotsVertical"),Vv=_e(s.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),aE=_e(s.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add"),sZ=_e(s.jsx("path",{d:"M19 13H5v-2h14v2z"}),"Remove"),iZ=_e(s.jsx("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}),"Load"),cE=_e(s.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"Drag"),lZ=_e(s.jsx("path",{d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"}),"SaveAlt"),aZ=_e(s.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),cZ=_e(s.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert"),uZ=_e(s.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"}),"VisibilityOff"),dZ=_e(s.jsx("g",{children:s.jsx("path",{d:"M14.67,5v14H9.33V5H14.67z M15.67,19H21V5h-5.33V19z M8.33,19V5H3v14H8.33z"})}),"ViewColumn"),fZ=_e(s.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");_e(s.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");const pZ=_e(s.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");function Z$(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}const ix=e=>e.indexOf("Arrow")===0||e.indexOf("Page")===0||e===" "||e==="Home"||e==="End",hZ=e=>!!e.key,J$=e=>e==="Tab"||e==="Escape";function eO(e){return(e.ctrlKey||e.metaKey)&&String.fromCharCode(e.keyCode)==="V"&&!e.shiftKey&&!e.altKey}function mZ(e){return(e.ctrlKey||e.metaKey)&&String.fromCharCode(e.keyCode)==="C"&&!e.shiftKey&&!e.altKey}const gZ=["hideMenu","colDef","id","labelledby","className","children","open"],xZ=Ce(Ux)(()=>({minWidth:248})),yZ=sn(function(t,n){const{hideMenu:r,id:o,labelledby:i,className:l,children:c,open:u}=t,f=St(t,gZ),h=m.useCallback(p=>{p.key==="Tab"&&p.preventDefault(),J$(p.key)&&r(p)},[r]);return s.jsx(xZ,q({id:o,className:Me(te.menuList,l),"aria-labelledby":i,onKeyDown:h,autoFocus:u},f,{ref:n,children:c}))}),bZ=["displayOrder"],vZ=e=>{const t=Vs(),n=gt(),{defaultSlots:r,defaultSlotProps:o,slots:i={},slotProps:l={},hideMenu:c,colDef:u,addDividers:f=!0}=e,h=m.useMemo(()=>q({},r,i),[r,i]),p=m.useMemo(()=>{if(!l||Object.keys(l).length===0)return o;const b=q({},l);return Object.entries(o).forEach(([v,C])=>{b[v]=q({},C,l[v]||{})}),b},[o,l]),g=t.current.unstable_applyPipeProcessors("columnMenu",[],e.colDef),y=m.useMemo(()=>{const b=Object.keys(r);return Object.keys(i).filter(v=>!b.includes(v))},[i,r]);return m.useMemo(()=>{const C=Array.from(new Set([...g,...y])).filter(S=>h[S]!=null).sort((S,j)=>{const w=p[S],k=p[j],P=Number.isFinite(w==null?void 0:w.displayOrder)?w.displayOrder:100,T=Number.isFinite(k==null?void 0:k.displayOrder)?k.displayOrder:100;return P-T});return C.reduce((S,j,w)=>{let k={colDef:u,onClick:c};const P=p[j];if(P){const T=St(P,bZ);k=q({},k,T)}return f&&w!==C.length-1?[...S,[h[j],k],[n.slots.baseDivider,{}]]:[...S,[h[j],k]]},[])},[f,u,g,c,h,p,y,n.slots.baseDivider])};function CZ(e){const{colDef:t,onClick:n}=e,r=Ut(),o=gt(),c=fr(r).filter(f=>f.disableColumnMenu!==!0).length===1,u=m.useCallback(f=>{c||(r.current.setColumnVisibility(t.field,!1),n(f))},[r,t.field,n,c]);return o.disableColumnSelector||t.hideable===!1?null:s.jsxs(it,{onClick:u,disabled:c,children:[s.jsx(Rn,{children:s.jsx(o.slots.columnMenuHideIcon,{fontSize:"small"})}),s.jsx($n,{children:r.current.getLocaleText("columnMenuHideColumn")})]})}function wZ(e){const{onClick:t}=e,n=Ut(),r=gt(),o=m.useCallback(i=>{t(i),n.current.showPreferences(_c.columns)},[n,t]);return r.disableColumnSelector?null:s.jsxs(it,{onClick:o,children:[s.jsx(Rn,{children:s.jsx(r.slots.columnMenuManageColumnsIcon,{fontSize:"small"})}),s.jsx($n,{children:n.current.getLocaleText("columnMenuManageColumns")})]})}function SZ(e){return s.jsxs(m.Fragment,{children:[s.jsx(CZ,q({},e)),s.jsx(wZ,q({},e))]})}function jZ(e){const{colDef:t,onClick:n}=e,r=Ut(),o=gt(),i=m.useCallback(l=>{n(l),r.current.showFilterPanel(t.field)},[r,t.field,n]);return o.disableColumnFilter||!t.filterable?null:s.jsxs(it,{onClick:i,children:[s.jsx(Rn,{children:s.jsx(o.slots.columnMenuFilterIcon,{fontSize:"small"})}),s.jsx($n,{children:r.current.getLocaleText("columnMenuFilter")})]})}function kZ(e){const{colDef:t,onClick:n}=e,r=Ut(),o=He(r,Js),i=gt(),l=m.useMemo(()=>{if(!t)return null;const h=o.find(p=>p.field===t.field);return h==null?void 0:h.sort},[t,o]),c=t.sortingOrder??i.sortingOrder,u=m.useCallback(h=>{n(h);const p=h.currentTarget.getAttribute("data-value")||null;r.current.sortColumn(t.field,p===l?null:p)},[r,t,n,l]);if(i.disableColumnSorting||!t||!t.sortable||!c.some(h=>!!h))return null;const f=h=>{const p=r.current.getLocaleText(h);return typeof p=="function"?p(t):p};return s.jsxs(m.Fragment,{children:[c.includes("asc")&&l!=="asc"?s.jsxs(it,{onClick:u,"data-value":"asc",children:[s.jsx(Rn,{children:s.jsx(i.slots.columnMenuSortAscendingIcon,{fontSize:"small"})}),s.jsx($n,{children:f("columnMenuSortAsc")})]}):null,c.includes("desc")&&l!=="desc"?s.jsxs(it,{onClick:u,"data-value":"desc",children:[s.jsx(Rn,{children:s.jsx(i.slots.columnMenuSortDescendingIcon,{fontSize:"small"})}),s.jsx($n,{children:f("columnMenuSortDesc")})]}):null,c.includes(null)&&l!=null?s.jsxs(it,{onClick:u,children:[s.jsx(Rn,{}),s.jsx($n,{children:r.current.getLocaleText("columnMenuUnsort")})]}):null]})}const IZ=["defaultSlots","defaultSlotProps","slots","slotProps"],EZ={columnMenuSortItem:kZ,columnMenuFilterItem:jZ,columnMenuColumnsItem:SZ},PZ={columnMenuSortItem:{displayOrder:10},columnMenuFilterItem:{displayOrder:20},columnMenuColumnsItem:{displayOrder:30}},TZ=sn(function(t,n){const{defaultSlots:r,defaultSlotProps:o,slots:i,slotProps:l}=t,c=St(t,IZ),u=vZ(q({},c,{defaultSlots:r,defaultSlotProps:o,slots:i,slotProps:l}));return s.jsx(yZ,q({},c,{ref:n,children:u.map(([f,h],p)=>s.jsx(f,q({},h),p))}))}),MZ=sn(function(t,n){return s.jsx(TZ,q({},t,{ref:n,defaultSlots:EZ,defaultSlotProps:PZ}))}),RZ=["className","slotProps"],$Z=e=>{const{classes:t}=e;return Be({root:["panelWrapper"]},en,t)},OZ=Ce("div",{name:"MuiDataGrid",slot:"PanelWrapper",overridesResolver:(e,t)=>t.panelWrapper})({display:"flex",flexDirection:"column",flex:1,"&:focus":{outline:0}}),zZ=()=>!0,tO=sn(function(t,n){const{className:r,slotProps:o={}}=t,i=St(t,RZ),l=gt(),c=$Z(l);return s.jsx(uR,q({open:!0,disableEnforceFocus:!0,isEnabled:zZ},o.TrapFocus,{children:s.jsx(OZ,q({tabIndex:-1,className:Me(c.root,r),ownerState:l},i,{ref:n}))}))});function LZ(e){var n;const t=gt();return s.jsx(tO,q({},e,{children:s.jsx(t.slots.columnsManagement,q({},(n=t.slotProps)==null?void 0:n.columnsManagement))}))}const DZ=["children","className","classes"],AZ=ut("MuiDataGrid",["panel","paper"]),FZ=Ce(Uc,{name:"MuiDataGrid",slot:"Panel",overridesResolver:(e,t)=>t.panel})(({theme:e})=>({zIndex:e.zIndex.modal})),NZ=Ce(Un,{name:"MuiDataGrid",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,minWidth:300,maxHeight:450,display:"flex",maxWidth:`calc(100vw - ${e.spacing(.5)})`,overflow:"auto"})),_Z=sn((e,t)=>{const{children:n,className:r}=e,o=St(e,DZ),i=Ut(),l=gt(),c=AZ,[u,f]=m.useState(!1),h=m.useCallback(()=>{i.current.hidePreferences()},[i]),p=m.useCallback(v=>{v.key==="Escape"&&i.current.hidePreferences()},[i]),g=m.useMemo(()=>[{name:"flip",enabled:!0,options:{rootBoundary:"document"}},{name:"isPlaced",enabled:!0,phase:"main",fn:()=>{f(!0)},effect:()=>()=>{f(!1)}}],[]),[y,b]=m.useState(null);return m.useEffect(()=>{var C,S;const v=(S=(C=i.current.rootElementRef)==null?void 0:C.current)==null?void 0:S.querySelector('[data-id="gridPanelAnchor"]');v&&b(v)},[i]),y?s.jsx(FZ,q({placement:"bottom-start",className:Me(c.panel,r),ownerState:l,anchorEl:y,modifiers:g},o,{ref:t,children:s.jsx(Iw,{mouseEvent:"onPointerUp",touchEvent:!1,onClickAway:h,children:s.jsx(NZ,{className:c.paper,ownerState:l,elevation:8,onKeyDown:p,children:u&&n})})})):null}),HZ=["className"],BZ=e=>{const{classes:t}=e;return Be({root:["panelContent"]},en,t)},WZ=Dn("div",{name:"MuiDataGrid",slot:"PanelContent",overridesResolver:(e,t)=>t.panelContent})({display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400});function VZ(e){const{className:t}=e,n=St(e,HZ),r=gt(),o=BZ(r);return s.jsx(WZ,q({className:Me(o.root,t),ownerState:r},n))}const GZ=["className"],UZ=e=>{const{classes:t}=e;return Be({root:["panelFooter"]},en,t)},qZ=Dn("div",{name:"MuiDataGrid",slot:"PanelFooter",overridesResolver:(e,t)=>t.panelFooter})(({theme:e})=>({padding:e.spacing(.5),display:"flex",justifyContent:"space-between"}));function KZ(e){const{className:t}=e,n=St(e,GZ),r=gt(),o=UZ(r);return s.jsx(qZ,q({className:Me(o.root,t),ownerState:r},n))}const QZ=["item","hasMultipleFilters","deleteFilter","applyFilterChanges","showMultiFilterOperators","disableMultiFilterOperator","applyMultiFilterOperatorChanges","focusElementRef","logicOperators","columnsSort","filterColumns","deleteIconProps","logicOperatorInputProps","operatorInputProps","columnInputProps","valueInputProps","readOnly","children"],YZ=["InputComponentProps"],XZ=e=>{const{classes:t}=e;return Be({root:["filterForm"],deleteIcon:["filterFormDeleteIcon"],logicOperatorInput:["filterFormLogicOperatorInput"],columnInput:["filterFormColumnInput"],operatorInput:["filterFormOperatorInput"],valueInput:["filterFormValueInput"]},en,t)},ZZ=Ce("div",{name:"MuiDataGrid",slot:"FilterForm",overridesResolver:(e,t)=>t.filterForm})(({theme:e})=>({display:"flex",padding:e.spacing(1)})),JZ=Ce("div",{name:"MuiDataGrid",slot:"FilterFormDeleteIcon",overridesResolver:(e,t)=>t.filterFormDeleteIcon})(({theme:e})=>({flexShrink:0,justifyContent:"flex-end",marginRight:e.spacing(.5),marginBottom:e.spacing(.2)})),eJ=Ce("div",{name:"MuiDataGrid",slot:"FilterFormLogicOperatorInput",overridesResolver:(e,t)=>t.filterFormLogicOperatorInput})({minWidth:55,marginRight:5,justifyContent:"end"}),tJ=Ce("div",{name:"MuiDataGrid",slot:"FilterFormColumnInput",overridesResolver:(e,t)=>t.filterFormColumnInput})({width:150}),nJ=Ce("div",{name:"MuiDataGrid",slot:"FilterFormOperatorInput",overridesResolver:(e,t)=>t.filterFormOperatorInput})({width:150}),rJ=Ce("div",{name:"MuiDataGrid",slot:"FilterFormValueInput",overridesResolver:(e,t)=>t.filterFormValueInput})({width:190}),oJ=e=>{switch(e){case Io.And:return"filterPanelOperatorAnd";case Io.Or:return"filterPanelOperatorOr";default:throw new Error("MUI X: Invalid `logicOperator` property in the `GridFilterPanel`.")}},Zf=e=>e.headerName||e.field,uE=new Intl.Collator,dE=sn(function(t,n){var Se,ke,we,Oe,be,Fe,Ve,De,Ze;const{item:r,hasMultipleFilters:o,deleteFilter:i,applyFilterChanges:l,showMultiFilterOperators:c,disableMultiFilterOperator:u,applyMultiFilterOperatorChanges:f,focusElementRef:h,logicOperators:p=[Io.And,Io.Or],columnsSort:g,filterColumns:y,deleteIconProps:b={},logicOperatorInputProps:v={},operatorInputProps:C={},columnInputProps:S={},valueInputProps:j={},readOnly:w}=t,k=St(t,QZ),P=Ut(),T=He(P,Pl),$=He(P,r$),M=He(P,Vr),R=Sn(),E=Sn(),O=Sn(),A=Sn(),N=gt(),F=XZ(N),L=m.useRef(null),D=m.useRef(null),H=M.logicOperator??Io.And,B=o&&p.length>0,V=((Se=N.slotProps)==null?void 0:Se.baseFormControl)||{},_=(((ke=N.slotProps)==null?void 0:ke.baseSelect)||{}).native??!1,U=((we=N.slotProps)==null?void 0:we.baseInputLabel)||{},Z=((Oe=N.slotProps)==null?void 0:Oe.baseSelectOption)||{},{InputComponentProps:Q}=j,ee=St(j,YZ),{filteredColumns:ne,selectedField:re}=m.useMemo(()=>{let Ae=r.field;const st=T[r.field].filterable===!1?T[r.field]:null;if(st)return{filteredColumns:[st],selectedField:Ae};if(y===void 0||typeof y!="function")return{filteredColumns:$,selectedField:Ae};const qe=y({field:r.field,columns:$,currentFilters:(M==null?void 0:M.items)||[]});return{filteredColumns:$.filter(et=>{const oe=qe.includes(et.field);return et.field===r.field&&!oe&&(Ae=void 0),oe}),selectedField:Ae}},[y,M==null?void 0:M.items,$,r.field,T]),Y=m.useMemo(()=>{switch(g){case"asc":return ne.sort((Ae,st)=>uE.compare(Zf(Ae),Zf(st)));case"desc":return ne.sort((Ae,st)=>-uE.compare(Zf(Ae),Zf(st)));default:return ne}},[ne,g]),ie=r.field?P.current.getColumn(r.field):null,ce=m.useMemo(()=>{var Ae;return!r.operator||!ie?null:(Ae=ie.filterOperators)==null?void 0:Ae.find(st=>st.value===r.operator)},[r,ie]),he=m.useCallback(Ae=>{const st=Ae.target.value,qe=P.current.getColumn(st);if(qe.field===ie.field)return;const et=qe.filterOperators.find(Ie=>Ie.value===r.operator)||qe.filterOperators[0];let fe=!et.InputComponent||et.InputComponent!==(ce==null?void 0:ce.InputComponent)||qe.type!==ie.type?void 0:r.value;if(qe.type==="singleSelect"&&fe!==void 0){const Ie=qe,$e=Nc(Ie);Array.isArray(fe)?fe=fe.filter(pt=>nx(pt,$e,Ie==null?void 0:Ie.getOptionValue)!==void 0):nx(r.value,$e,Ie==null?void 0:Ie.getOptionValue)===void 0&&(fe=void 0)}l(q({},r,{field:st,operator:et.value,value:fe}))},[P,l,r,ie,ce]),de=m.useCallback(Ae=>{const st=Ae.target.value,qe=ie==null?void 0:ie.filterOperators.find(oe=>oe.value===st),et=!(qe!=null&&qe.InputComponent)||(qe==null?void 0:qe.InputComponent)!==(ce==null?void 0:ce.InputComponent);l(q({},r,{operator:st,value:et?void 0:r.value}))},[l,r,ie,ce]),le=m.useCallback(Ae=>{const st=Ae.target.value===Io.And.toString()?Io.And:Io.Or;f(st)},[f]),ge=()=>{i(r)};return m.useImperativeHandle(h,()=>({focus:()=>{var Ae;ce!=null&&ce.InputComponent?(Ae=L==null?void 0:L.current)==null||Ae.focus():D.current.focus()}}),[ce]),s.jsxs(ZZ,q({className:F.root,"data-id":r.id,ownerState:N},k,{ref:n,children:[s.jsx(JZ,q({variant:"standard",as:N.slots.baseFormControl},V,b,{className:Me(F.deleteIcon,V.className,b.className),ownerState:N,children:s.jsx(N.slots.baseIconButton,q({"aria-label":P.current.getLocaleText("filterPanelDeleteIconLabel"),title:P.current.getLocaleText("filterPanelDeleteIconLabel"),onClick:ge,size:"small",disabled:w},(be=N.slotProps)==null?void 0:be.baseIconButton,{children:s.jsx(N.slots.filterPanelDeleteIcon,{fontSize:"small"})}))})),s.jsx(eJ,q({variant:"standard",as:N.slots.baseFormControl},V,v,{sx:[B?{display:"flex"}:{display:"none"},c?{visibility:"visible"}:{visibility:"hidden"},V.sx,v.sx],className:Me(F.logicOperatorInput,V.className,v.className),ownerState:N,children:s.jsx(N.slots.baseSelect,q({inputProps:{"aria-label":P.current.getLocaleText("filterPanelLogicOperator")},value:H??"",onChange:le,disabled:!!u||p.length===1,native:_},(Fe=N.slotProps)==null?void 0:Fe.baseSelect,{children:p.map(Ae=>m.createElement(N.slots.baseSelectOption,q({},Z,{native:_,key:Ae.toString(),value:Ae.toString()}),P.current.getLocaleText(oJ(Ae))))}))})),s.jsxs(tJ,q({variant:"standard",as:N.slots.baseFormControl},V,S,{className:Me(F.columnInput,V.className,S.className),ownerState:N,children:[s.jsx(N.slots.baseInputLabel,q({},U,{htmlFor:R,id:E,children:P.current.getLocaleText("filterPanelColumns")})),s.jsx(N.slots.baseSelect,q({labelId:E,id:R,label:P.current.getLocaleText("filterPanelColumns"),value:re??"",onChange:he,native:_,disabled:w},(Ve=N.slotProps)==null?void 0:Ve.baseSelect,{children:Y.map(Ae=>m.createElement(N.slots.baseSelectOption,q({},Z,{native:_,key:Ae.field,value:Ae.field}),Zf(Ae)))}))]})),s.jsxs(nJ,q({variant:"standard",as:N.slots.baseFormControl},V,C,{className:Me(F.operatorInput,V.className,C.className),ownerState:N,children:[s.jsx(N.slots.baseInputLabel,q({},U,{htmlFor:O,id:A,children:P.current.getLocaleText("filterPanelOperator")})),s.jsx(N.slots.baseSelect,q({labelId:A,label:P.current.getLocaleText("filterPanelOperator"),id:O,value:r.operator,onChange:de,native:_,inputRef:D,disabled:w},(De=N.slotProps)==null?void 0:De.baseSelect,{children:(Ze=ie==null?void 0:ie.filterOperators)==null?void 0:Ze.map(Ae=>m.createElement(N.slots.baseSelectOption,q({},Z,{native:_,key:Ae.value,value:Ae.value}),Ae.label||P.current.getLocaleText(`filterOperator${Pe(Ae.value)}`)))}))]})),s.jsx(rJ,q({variant:"standard",as:N.slots.baseFormControl},V,ee,{className:Me(F.valueInput,V.className,ee.className),ownerState:N,children:ce!=null&&ce.InputComponent?s.jsx(ce.InputComponent,q({apiRef:P,item:r,applyValue:l,focusElementRef:L,disabled:w},ce.InputComponentProps,Q),r.field):null}))]}))}),sJ=["logicOperators","columnsSort","filterFormProps","getColumnForNewFilter","children","disableAddFilterButton","disableRemoveAllButton"],fE=e=>({field:e.field,operator:e.filterOperators[0].value,id:Math.round(Math.random()*1e5)}),iJ=sn(function(t,n){var A,N;const r=Ut(),o=gt(),i=He(r,Vr),l=He(r,r$),c=He(r,pq),u=m.useRef(null),f=m.useRef(null),{logicOperators:h=[Io.And,Io.Or],columnsSort:p,filterFormProps:g,getColumnForNewFilter:y,disableAddFilterButton:b=!1,disableRemoveAllButton:v=!1}=t,C=St(t,sJ),S=r.current.upsertFilterItem,j=m.useCallback(F=>{r.current.setFilterLogicOperator(F)},[r]),w=m.useCallback(()=>{let F;if(y&&typeof y=="function"){const L=y({currentFilters:(i==null?void 0:i.items)||[],columns:l});if(L===null)return null;F=l.find(({field:D})=>D===L)}else F=l.find(L=>{var D;return(D=L.filterOperators)==null?void 0:D.length});return F?fE(F):null},[i==null?void 0:i.items,l,y]),k=m.useCallback(()=>{if(y===void 0||typeof y!="function")return w();const F=i.items.length?i.items:[w()].filter(Boolean),L=y({currentFilters:F,columns:l});if(L===null)return null;const D=l.find(({field:H})=>H===L);return D?fE(D):null},[i.items,l,y,w]),P=m.useMemo(()=>i.items.length?i.items:(f.current||(f.current=w()),f.current?[f.current]:[]),[i.items,w]),T=P.length>1,{readOnlyFilters:$,validFilters:M}=m.useMemo(()=>P.reduce((F,L)=>(c[L.field]?F.validFilters.push(L):F.readOnlyFilters.push(L),F),{readOnlyFilters:[],validFilters:[]}),[P,c]),R=m.useCallback(()=>{const F=k();F&&r.current.upsertFilterItems([...P,F])},[r,k,P]),E=m.useCallback(F=>{const L=M.length===1;r.current.deleteFilterItem(F),L&&r.current.hideFilterPanel()},[r,M.length]),O=m.useCallback(()=>M.length===1&&M[0].value===void 0?(r.current.deleteFilterItem(M[0]),r.current.hideFilterPanel()):r.current.setFilterModel(q({},i,{items:$}),"removeAllFilterItems"),[r,$,i,M]);return m.useEffect(()=>{h.length>0&&i.logicOperator&&!h.includes(i.logicOperator)&&j(h[0])},[h,j,i.logicOperator]),m.useEffect(()=>{M.length>0&&u.current.focus()},[M.length]),s.jsxs(tO,q({},C,{ref:n,children:[s.jsxs(VZ,{children:[$.map((F,L)=>s.jsx(dE,q({item:F,applyFilterChanges:S,deleteFilter:E,hasMultipleFilters:T,showMultiFilterOperators:L>0,disableMultiFilterOperator:L!==1,applyMultiFilterOperatorChanges:j,focusElementRef:null,readOnly:!0,logicOperators:h,columnsSort:p},g),F.id==null?L:F.id)),M.map((F,L)=>s.jsx(dE,q({item:F,applyFilterChanges:S,deleteFilter:E,hasMultipleFilters:T,showMultiFilterOperators:$.length+L>0,disableMultiFilterOperator:$.length+L!==1,applyMultiFilterOperatorChanges:j,focusElementRef:L===M.length-1?u:null,logicOperators:h,columnsSort:p},g),F.id==null?L+$.length:F.id))]}),!o.disableMultipleColumnsFiltering&&!(b&&v)?s.jsxs(KZ,{children:[b?s.jsx("span",{}):s.jsx(o.slots.baseButton,q({onClick:R,startIcon:s.jsx(o.slots.filterPanelAddIcon,{})},(A=o.slotProps)==null?void 0:A.baseButton,{children:r.current.getLocaleText("filterPanelAddFilter")})),!v&&M.length>0?s.jsx(o.slots.baseButton,q({onClick:O,startIcon:s.jsx(o.slots.filterPanelRemoveAllIcon,{})},(N=o.slotProps)==null?void 0:N.baseButton,{children:r.current.getLocaleText("filterPanelRemoveAll")})):null]}):null]}))}),lJ=(e,t)=>{const n=new Set(Object.keys(e).filter(i=>e[i]===!1)),r=new Set(Object.keys(t).filter(i=>t[i]===!1));if(n.size!==r.size)return!1;let o=!0;return n.forEach(i=>{r.has(i)||(o=!1)}),o},aJ=(e,t)=>(e.headerName||e.field).toLowerCase().indexOf(t)>-1,cJ=e=>{const{classes:t}=e;return Be({root:["columnsManagement"],header:["columnsManagementHeader"],searchInput:["columnsManagementSearchInput"],footer:["columnsManagementFooter"],row:["columnsManagementRow"]},en,t)},pE=new Intl.Collator;function uJ(e){var L,D,H,B;const t=Ut(),n=m.useRef(null),r=He(t,Ls),o=Hs(()=>Ms(t)).current,i=He(t,Ms),l=gt(),[c,u]=m.useState(""),f=cJ(l),{sort:h,searchPredicate:p=aJ,autoFocusSearchField:g=!0,disableShowHideToggle:y=!1,disableResetButton:b=!1,toggleAllMode:v="all",getTogglableColumns:C,searchInputProps:S}=e,j=m.useMemo(()=>lJ(i,o),[i,o]),w=m.useMemo(()=>{switch(h){case"asc":return[...r].sort((V,G)=>pE.compare(V.headerName||V.field,G.headerName||G.field));case"desc":return[...r].sort((V,G)=>-pE.compare(V.headerName||V.field,G.headerName||G.field));default:return r}},[r,h]),k=V=>{const{name:G}=V.target;t.current.setColumnVisibility(G,i[G]===!1)},P=m.useMemo(()=>{const V=C?C(w):null,G=V?w.filter(({field:_})=>V.includes(_)):w;return c?G.filter(_=>p(_,c.toLowerCase())):G},[w,c,p,C]),T=m.useCallback(V=>{const G=Ms(t),_=q({},G),U=C?C(r):null;return(v==="filteredOnly"?P:r).forEach(Z=>{Z.hideable&&(U==null||U.includes(Z.field))&&(V?delete _[Z.field]:_[Z.field]=!1)}),t.current.setColumnVisibilityModel(_)},[t,r,C,v,P]),$=m.useCallback(V=>{u(V.target.value)},[]),M=m.useMemo(()=>P.filter(V=>V.hideable),[P]),R=m.useMemo(()=>M.every(V=>i[V.field]==null||i[V.field]!==!1),[i,M]),E=m.useMemo(()=>M.every(V=>i[V.field]===!1),[i,M]),O=m.useRef(null);m.useEffect(()=>{g?n.current.focus():O.current&&typeof O.current.focus=="function"&&O.current.focus()},[g]);let A=!1;const N=V=>A===!1&&V.hideable!==!1?(A=!0,!0):!1,F=m.useCallback(()=>{u(""),n.current.focus()},[]);return s.jsxs(m.Fragment,{children:[s.jsx(fJ,{className:f.header,ownerState:l,children:s.jsx(pJ,q({as:l.slots.baseTextField,ownerState:l,placeholder:t.current.getLocaleText("columnsManagementSearchTitle"),inputRef:n,className:f.searchInput,value:c,onChange:$,variant:"outlined",size:"small",type:"search",InputProps:{startAdornment:s.jsx(l.slots.baseInputAdornment,{position:"start",children:s.jsx(l.slots.quickFilterIcon,{})}),endAdornment:s.jsx(l.slots.baseIconButton,q({"aria-label":t.current.getLocaleText("columnsManagementDeleteIconLabel"),size:"small",sx:[c?{visibility:"visible"}:{visibility:"hidden"}],tabIndex:-1,onClick:F},(L=l.slotProps)==null?void 0:L.baseIconButton,{children:s.jsx(l.slots.quickFilterClearIcon,{fontSize:"small"})}))},inputProps:{"aria-label":t.current.getLocaleText("columnsManagementSearchTitle")},autoComplete:"off",fullWidth:!0},(D=l.slotProps)==null?void 0:D.baseTextField,S))}),s.jsxs(dJ,{className:f.root,ownerState:l,children:[P.map(V=>{var G;return s.jsx(Kr,{className:f.row,control:s.jsx(l.slots.baseCheckbox,q({disabled:V.hideable===!1,checked:i[V.field]!==!1,onClick:k,name:V.field,sx:{p:.5},inputRef:N(V)?O:void 0},(G=l.slotProps)==null?void 0:G.baseCheckbox)),label:V.headerName||V.field},V.field)}),P.length===0&&s.jsx(mJ,{ownerState:l,children:t.current.getLocaleText("columnsManagementNoColumns")})]}),(!y||!b)&&P.length>0?s.jsxs(hJ,{ownerState:l,className:f.footer,children:[y?s.jsx("span",{}):s.jsx(Kr,{control:s.jsx(l.slots.baseCheckbox,q({disabled:M.length===0,checked:R,indeterminate:!R&&!E,onClick:()=>T(!R),name:t.current.getLocaleText("columnsManagementShowHideAllText"),sx:{p:.5}},(H=l.slotProps)==null?void 0:H.baseCheckbox)),label:t.current.getLocaleText("columnsManagementShowHideAllText")}),b?null:s.jsx(l.slots.baseButton,q({onClick:()=>t.current.setColumnVisibilityModel(o),disabled:j},(B=l.slotProps)==null?void 0:B.baseButton,{children:t.current.getLocaleText("columnsManagementReset")}))]}):null]})}const dJ=Ce("div",{name:"MuiDataGrid",slot:"ColumnsManagement",overridesResolver:(e,t)=>t.columnsManagement})(({theme:e})=>({padding:e.spacing(0,3,1.5),display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400,alignItems:"flex-start"})),fJ=Ce("div",{name:"MuiDataGrid",slot:"ColumnsManagementHeader",overridesResolver:(e,t)=>t.columnsManagementHeader})(({theme:e})=>({padding:e.spacing(1.5,3)})),pJ=Ce(Wt,{name:"MuiDataGrid",slot:"ColumnsManagementSearchInput",overridesResolver:(e,t)=>t.columnsManagementSearchInput})(({theme:e})=>({[`& .${Gr.root}`]:{padding:e.spacing(0,1.5,0,1.5)},[`& .${Gr.input}::-webkit-search-decoration,
|
|
328
|
+
& .${Gr.input}::-webkit-search-cancel-button,
|
|
329
|
+
& .${Gr.input}::-webkit-search-results-button,
|
|
330
|
+
& .${Gr.input}::-webkit-search-results-decoration`]:{display:"none"}})),hJ=Ce("div",{name:"MuiDataGrid",slot:"ColumnsManagementFooter",overridesResolver:(e,t)=>t.columnsManagementFooter})(({theme:e})=>({padding:e.spacing(.5,1,.5,3),display:"flex",justifyContent:"space-between",borderTop:`1px solid ${e.palette.divider}`})),mJ=Ce("div")(({theme:e})=>({padding:e.spacing(.5,0),color:e.palette.grey[500]})),gJ=sn(function(t,n){var j,w;const{children:r,slotProps:o={}}=t,i=o.button||{},l=o.tooltip||{},c=Ut(),u=gt(),f=Sn(),h=Sn(),[p,g]=m.useState(!1),y=m.useRef(null),b=Pn(n,y),v=k=>{var P;g(T=>!T),(P=i.onClick)==null||P.call(i,k)},C=()=>g(!1),S=k=>{k.key==="Tab"&&k.preventDefault(),J$(k.key)&&C()};return r==null?null:s.jsxs(m.Fragment,{children:[s.jsx(u.slots.baseTooltip,q({title:c.current.getLocaleText("toolbarExportLabel"),enterDelay:1e3},(j=u.slotProps)==null?void 0:j.baseTooltip,l,{children:s.jsx(u.slots.baseButton,q({size:"small",startIcon:s.jsx(u.slots.exportIcon,{}),"aria-expanded":p,"aria-label":c.current.getLocaleText("toolbarExportLabel"),"aria-haspopup":"menu","aria-controls":p?h:void 0,id:f},(w=u.slotProps)==null?void 0:w.baseButton,i,{onClick:v,ref:b,children:c.current.getLocaleText("toolbarExport")}))})),s.jsx(Kw,{open:p,target:y.current,onClose:C,position:"bottom-start",children:s.jsx(Ux,{id:h,className:te.menuList,"aria-labelledby":f,onKeyDown:S,autoFocusItem:p,children:m.Children.map(r,k=>m.isValidElement(k)?m.cloneElement(k,{hideMenu:C}):k)})})]})}),xJ=["hideMenu","options"],yJ=["hideMenu","options"],bJ=["csvOptions","printOptions","excelOptions"];function vJ(e){const t=Ut(),{hideMenu:n,options:r}=e,o=St(e,xJ);return s.jsx(it,q({onClick:()=>{t.current.exportDataAsCsv(r),n==null||n()}},o,{children:t.current.getLocaleText("toolbarExportCSV")}))}function CJ(e){const t=Ut(),{hideMenu:n,options:r}=e,o=St(e,yJ);return s.jsx(it,q({onClick:()=>{t.current.exportDataAsPrint(r),n==null||n()}},o,{children:t.current.getLocaleText("toolbarExportPrint")}))}sn(function(t,n){const r=t,{csvOptions:o={},printOptions:i={},excelOptions:l}=r,c=St(r,bJ),f=Ut().current.unstable_applyPipeProcessors("exportMenu",[],{excelOptions:l,csvOptions:o,printOptions:i}).sort((h,p)=>h.componentName>p.componentName?1:-1);return f.length===0?null:s.jsx(gJ,q({},c,{ref:n,children:f.map((h,p)=>m.cloneElement(h.component,{key:p}))}))});const wJ=["className","selectedRowCount"],SJ=e=>{const{classes:t}=e;return Be({root:["selectedRowCount"]},en,t)},jJ=Dn("div",{name:"MuiDataGrid",slot:"SelectedRowCount",overridesResolver:(e,t)=>t.selectedRowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2),visibility:"hidden",width:0,height:0,[e.breakpoints.up("sm")]:{visibility:"visible",width:"auto",height:"auto"}})),kJ=sn(function(t,n){const{className:r,selectedRowCount:o}=t,i=St(t,wJ),l=Ut(),c=gt(),u=SJ(c),f=l.current.getLocaleText("footerRowSelected")(o);return s.jsx(jJ,q({className:Me(u.root,r),ownerState:c},i,{ref:n,children:f}))}),IJ=sn(function(t,n){var p,g;const r=Ut(),o=gt(),i=He(r,Q7),l=He(r,tK),c=He(r,Zw),u=!o.hideFooterSelectedRowCount&&l>0?s.jsx(kJ,{selectedRowCount:l}):s.jsx("div",{}),f=!o.hideFooterRowCount&&!o.pagination?s.jsx(o.slots.footerRowCount,q({},(p=o.slotProps)==null?void 0:p.footerRowCount,{rowCount:i,visibleRowCount:c})):null,h=o.pagination&&!o.hideFooterPagination&&o.slots.pagination&&s.jsx(o.slots.pagination,q({},(g=o.slotProps)==null?void 0:g.pagination));return s.jsxs(sX,q({},t,{ref:n,children:[u,f,h]}))}),jp=(e,t,n,r,o,i)=>{let l;switch(e){case Qt.LEFT:l=r[n];break;case Qt.RIGHT:l=o-r[n]-t+i;break;default:l=void 0;break}return l},lx=(e,t,n,r,o)=>{const i=t===n-1;return e===Qt.LEFT&&i?!0:r?e===Qt.LEFT?!0:e===Qt.RIGHT?!i:!i||o:!1},ax=(e,t)=>e===Qt.RIGHT&&t===0,Jf={root:te.scrollbarFiller,header:te["scrollbarFiller--header"],borderTop:te["scrollbarFiller--borderTop"],borderBottom:te["scrollbarFiller--borderBottom"],pinnedRight:te["scrollbarFiller--pinnedRight"]};function cS({header:e,borderTop:t=!0,borderBottom:n,pinnedRight:r}){return s.jsx("div",{role:"presentation",className:Me(Jf.root,e&&Jf.header,t&&Jf.borderTop,n&&Jf.borderBottom,r&&Jf.pinnedRight)})}const EJ=Dn("div",{name:"MuiDataGrid",slot:"SkeletonLoadingOverlay",overridesResolver:(e,t)=>t.skeletonLoadingOverlay})({minWidth:"100%",width:"max-content",height:"100%",overflow:"clip"}),PJ=e=>{const{classes:t}=e;return Be({root:["skeletonLoadingOverlay"]},en,t)},hE=e=>parseInt(e.getAttribute("data-colindex"),10),TJ=sn(function(t,n){const r=gt(),{slots:o}=r,i=Yr(),l=PJ({classes:r.classes}),c=m.useRef(null),u=Pn(c,n),f=Ut(),h=He(f,Ar),p=(h==null?void 0:h.viewportInnerSize.height)??0,g=Math.ceil(p/h.rowHeight),y=He(f,Xx),b=He(f,_a),v=m.useMemo(()=>b.filter(T=>T<=y).length,[y,b]),C=He(f,fr),S=m.useMemo(()=>C.slice(0,v),[C,v]),j=He(f,Yd),w=m.useCallback(T=>{if(j.left.findIndex($=>$.field===T)!==-1)return Qt.LEFT;if(j.right.findIndex($=>$.field===T)!==-1)return Qt.RIGHT},[j.left,j.right]),k=m.useMemo(()=>{const T=[];for(let $=0;$<g;$+=1){const M=[];for(let R=0;R<S.length;R+=1){const E=S[R],O=w(E.field),A=O===Qt.LEFT,N=O===Qt.RIGHT,F=G$(O,i),L=F?j[F].length:S.length-j.left.length-j.right.length,D=F?j[F].findIndex(ce=>ce.field===E.field):R-j.left.length,H=h.hasScrollY?h.scrollbarSize:0,B=ly({},i,O,jp(O,E.computedWidth,R,b,h.columnsTotalWidth,H)),V=h.columnsTotalWidth<h.viewportOuterSize.width,G=lx(O,D,L,r.showCellVerticalBorder,V),_=ax(O,D),U=R===S.length-1,Z=N&&D===0,Q=Z&&V,ee=U&&!Z&&V,ne=h.viewportOuterSize.width-h.columnsTotalWidth,re=Math.max(0,ne),Y=s.jsx(o.skeletonCell,{width:re,empty:!0},`skeleton-filler-column-${$}`),ie=U&&H!==0;Q&&M.push(Y),M.push(s.jsx(o.skeletonCell,{field:E.field,type:E.type,align:E.align,width:"var(--width)",height:h.rowHeight,"data-colindex":R,className:Me(A&&te["cell--pinnedLeft"],N&&te["cell--pinnedRight"],G&&te["cell--withRightBorder"],_&&te["cell--withLeftBorder"]),style:q({"--width":`${E.computedWidth}px`},B)},`skeleton-column-${$}-${E.field}`)),ee&&M.push(Y),ie&&M.push(s.jsx(cS,{pinnedRight:j.right.length>0},`skeleton-scrollbar-filler-${$}`))}T.push(s.jsx("div",{className:Me(te.row,te.rowSkeleton,$===0&&te["row--firstVisible"]),children:M},`skeleton-row-${$}`))}return T},[o,S,j,g,r.showCellVerticalBorder,h,b,w,i]);return ot(f,"columnResize",T=>{var D,H,B;const{colDef:$,width:M}=T,R=(D=c.current)==null?void 0:D.querySelectorAll(`[data-field="${Tl($.field)}"]`);if(!R)throw new Error("MUI X: Expected skeleton cells to be defined with `data-field` attribute.");const E=S.findIndex(V=>V.field===$.field),O=w($.field),A=O===Qt.LEFT,N=O===Qt.RIGHT,F=getComputedStyle(R[0]).getPropertyValue("--width"),L=parseInt(F,10)-M;if(R&&R.forEach(V=>{V.style.setProperty("--width",`${M}px`)}),A){const V=(H=c.current)==null?void 0:H.querySelectorAll(`.${te["cell--pinnedLeft"]}`);V==null||V.forEach(G=>{hE(G)>E&&(G.style.left=`${parseInt(getComputedStyle(G).left,10)-L}px`)})}if(N){const V=(B=c.current)==null?void 0:B.querySelectorAll(`.${te["cell--pinnedRight"]}`);V==null||V.forEach(G=>{hE(G)<E&&(G.style.right=`${parseInt(getComputedStyle(G).right,10)+L}px`)})}}),s.jsx(EJ,q({className:l.root},t,{ref:u,children:k}))}),MJ=["variant","noRowsVariant","style"],RJ={"circular-progress":{component:At,style:{}},"linear-progress":{component:kl,style:{display:"block"}},skeleton:{component:TJ,style:{display:"block"}}},$J=sn(function(t,n){const{variant:r="circular-progress",noRowsVariant:o="circular-progress",style:i}=t,l=St(t,MJ),c=Ut(),u=He(c,wh),f=RJ[u===0?o:r];return s.jsx(lS,q({style:q({},f.style,i)},l,{ref:n,children:s.jsx(f.component,{})}))}),OJ=sn(function(t,n){const o=Ut().current.getLocaleText("noRowsLabel");return s.jsx(lS,q({},t,{ref:n,children:o}))}),zJ=Ce(MG)(({theme:e})=>({maxHeight:"calc(100% + 1px)",flexGrow:1,[`& .${Ec.selectLabel}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},[`& .${Ec.input}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"inline-flex"}}})),LJ=(e,t)=>({from:n,to:r,count:o,page:i})=>e({from:n,to:r,count:o,page:i,estimated:t}),DJ=({from:e,to:t,count:n,estimated:r})=>r?`${e}–${t} of ${n!==-1?n:`more than ${r>t?r:t}`}`:`${e}–${t} of ${n!==-1?n:`more than ${t}`}`,AJ=sn(function(t,n){const r=Ut(),o=gt(),i=He(r,ho),l=He(r,Wu),c=He(r,k$),{paginationMode:u,loading:f,estimatedRowCount:h}=o,p=m.useMemo(()=>l===-1&&u==="server"&&f?{backIconButtonProps:{disabled:!0},nextIconButtonProps:{disabled:!0}}:{},[f,u,l]),g=m.useMemo(()=>Math.max(0,c-1),[c]),y=m.useMemo(()=>l===-1||i.page<=g?i.page:g,[g,i.page,l]),b=m.useCallback(k=>{const P=Number(k.target.value);r.current.setPageSize(P)},[r]),v=m.useCallback((k,P)=>{r.current.setPage(P)},[r]),S=(k=>{for(let P=0;P<o.pageSizeOptions.length;P+=1){const T=o.pageSizeOptions[P];if(typeof T=="number"){if(T===k)return!0}else if(T.value===k)return!0}return!1})(i.pageSize)?o.pageSizeOptions:[],j=r.current.getLocaleText("MuiTablePagination"),w=LJ(j.labelDisplayedRows||DJ,h);return s.jsx(zJ,q({component:"div",count:l,page:y,rowsPerPageOptions:S,rowsPerPage:i.pageSize,onPageChange:v,onRowsPerPageChange:b},p,j,{labelDisplayedRows:w},t,{ref:n}))}),FJ=["className","rowCount","visibleRowCount"],NJ=e=>{const{classes:t}=e;return Be({root:["rowCount"]},en,t)},_J=Dn("div",{name:"MuiDataGrid",slot:"RowCount",overridesResolver:(e,t)=>t.rowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2)})),HJ=sn(function(t,n){const{className:r,rowCount:o,visibleRowCount:i}=t,l=St(t,FJ),c=Ut(),u=gt(),f=NJ(u);if(o===0)return null;const h=i<o?c.current.getLocaleText("footerTotalVisibleRows")(i,o):o.toLocaleString();return s.jsxs(_J,q({className:Me(f.root,r),ownerState:u},l,{ref:n,children:[c.current.getLocaleText("footerTotalRows")," ",h]}))});function BJ(e){for(const t in e)return!1;return!0}function WJ(e,t){return Be(t,en,e)}const VJ=["selected","rowId","row","index","style","rowHeight","className","visibleColumns","pinnedColumns","offsetLeft","columnsTotalWidth","firstColumnIndex","lastColumnIndex","focusedColumnIndex","isFirstVisible","isLastVisible","isNotVisible","showBottomBorder","scrollbarWidth","gridHasFiller","onClick","onDoubleClick","onMouseEnter","onMouseLeave","onMouseOut","onMouseOver"],GJ=Ch(zr,(e,t)=>t?!!BJ(e):!1),UJ=sn(function(t,n){var oe;const{selected:r,rowId:o,row:i,index:l,style:c,rowHeight:u,className:f,visibleColumns:h,pinnedColumns:p,offsetLeft:g,columnsTotalWidth:y,firstColumnIndex:b,lastColumnIndex:v,focusedColumnIndex:C,isFirstVisible:S,isLastVisible:j,isNotVisible:w,showBottomBorder:k,scrollbarWidth:P,gridHasFiller:T,onClick:$,onDoubleClick:M,onMouseEnter:R,onMouseLeave:E,onMouseOut:O,onMouseOver:A}=t,N=St(t,VJ),F=Vs(),L=sS(),D=m.useRef(null),H=gt(),B=rS(F),V=He(F,Js),G=He(F,Kc),_=He(F,_a),U=H.rowReordering,Z=Np(F,GJ,U),Q=Pn(D,n),ee=F.current.getRowNode(o),ne=Np(F,W$,{rowId:o,editMode:H.editMode}),re=H.editMode===Fi.Row,Y=C!==void 0,ie=Y&&C>=p.left.length&&C<b,ce=Y&&C<h.length-p.right.length&&C>=v,he=WJ(H.classes,{root:["row",r&&"selected",re&&"row--editable",ne&&"row--editing",S&&"row--firstVisible",j&&"row--lastVisible",k&&"row--borderBottom",u==="auto"&&"row--dynamicHeight"]}),de=L.hooks.useGridRowAriaAttributes();m.useLayoutEffect(()=>{if(B.range){const fe=F.current.getRowIndexRelativeToVisibleRows(o);fe!==void 0&&F.current.unstable_setLastMeasuredRowIndex(fe)}if(D.current&&u==="auto")return F.current.observeRowHeight(D.current,o)},[F,B.range,u,o]);const le=m.useCallback((fe,Ie)=>$e=>{Th($e)||F.current.getRow(o)&&(F.current.publishEvent(fe,F.current.getRowParams(o),$e),Ie&&Ie($e))},[F,o]),ge=m.useCallback(fe=>{const Ie=sx(fe.target,te.cell),$e=Ie==null?void 0:Ie.getAttribute("data-field");if($e){if($e===Jd.field||$e===ey||$e==="__reorder__"||F.current.getCellMode(o,$e)===kn.Edit)return;const pt=F.current.getColumn($e);if((pt==null?void 0:pt.type)===Zx)return}le("rowClick",$)(fe)},[F,$,le,o]),{slots:Se,slotProps:ke,disableColumnReorder:we}=H,Oe=He(F,()=>q({},F.current.getRowHeightEntry(o)),Ww),be=m.useMemo(()=>{if(w)return{opacity:0,width:0,height:0};const fe=q({},c,{maxHeight:u==="auto"?"none":u,minHeight:u,"--height":typeof u=="number"?`${u}px`:u});if(Oe.spacingTop){const Ie=H.rowSpacingType==="border"?"borderTopWidth":"marginTop";fe[Ie]=Oe.spacingTop}if(Oe.spacingBottom){const Ie=H.rowSpacingType==="border"?"borderBottomWidth":"marginBottom";let $e=fe[Ie];typeof $e!="number"&&($e=parseInt($e||"0",10)),$e+=Oe.spacingBottom,fe[Ie]=$e}return fe},[w,u,c,Oe,H.rowSpacingType]),Fe=F.current.unstable_applyPipeProcessors("rowClassName",[],o),Ve=de(ee,l);if(typeof H.getRowClassName=="function"){const fe=l-(((oe=B.range)==null?void 0:oe.firstRowIndex)||0),Ie=q({},F.current.getRowParams(o),{isFirstVisible:fe===0,isLastVisible:fe===B.rows.length-1,indexRelativeToCurrentPage:fe});Fe.push(H.getRowClassName(Ie))}const De=(fe,Ie,$e,pt,vt=Qt.NONE)=>{const Je=F.current.unstable_getCellColSpanInfo(o,$e);if(Je!=null&&Je.spannedByColSpan)return null;const me=(Je==null?void 0:Je.cellProps.width)??fe.computedWidth,Ne=(Je==null?void 0:Je.cellProps.colSpan)??1,xt=jp(vt,fe.computedWidth,$e,_,y,P);if(ee.type==="skeletonRow")return s.jsx(Se.skeletonCell,{type:fe.type,width:me,height:u,field:fe.field,align:fe.align},fe.field);const Bt=fe.field==="__reorder__",pn=!(we||fe.disableReorder),yn=Z&&!V.length&&G<=1,hn=!(pn||Bt&&yn),ln=vt===Qt.VIRTUAL,An=ax(vt,Ie),kt=lx(vt,Ie,pt,H.showCellVerticalBorder,T);return s.jsx(Se.cell,q({column:fe,width:me,rowId:o,align:fe.align||"left",colIndex:$e,colSpan:Ne,disableDragEvents:hn,isNotVisible:ln,pinnedOffset:xt,pinnedPosition:vt,showLeftBorder:An,showRightBorder:kt,row:i,rowNode:ee},ke==null?void 0:ke.cell),fe.field)},Ze=p.left.map((fe,Ie)=>De(fe,Ie,Ie,p.left.length,Qt.LEFT)),Ae=p.right.map((fe,Ie)=>{const $e=h.length-p.right.length+Ie;return De(fe,Ie,$e,p.right.length,Qt.RIGHT)}),st=h.length-p.left.length-p.right.length,qe=[];ie&&qe.push(De(h[C],C-p.left.length,C,st,Qt.VIRTUAL));for(let fe=b;fe<v;fe+=1){const Ie=h[fe],$e=fe-p.left.length;Ie&&qe.push(De(Ie,$e,fe,st))}ce&&qe.push(De(h[C],C-p.left.length,C,st,Qt.VIRTUAL));const et=i?{onClick:ge,onDoubleClick:le("rowDoubleClick",M),onMouseEnter:le("rowMouseEnter",R),onMouseLeave:le("rowMouseLeave",E),onMouseOut:le("rowMouseOut",O),onMouseOver:le("rowMouseOver",A)}:null;return s.jsxs("div",q({"data-id":o,"data-rowindex":l,role:"row",className:Me(...Fe,he.root,f),style:be},Ve,et,N,{ref:Q,children:[Ze,s.jsx("div",{role:"presentation",className:te.cellOffsetLeft,style:{width:g}}),qe,s.jsx("div",{role:"presentation",className:Me(te.cell,te.cellEmpty)}),Ae,P!==0&&s.jsx(cS,{pinnedRight:p.right.length>0,borderTop:!S})]}))}),qJ=El(UJ),KJ=()=>{const e=Vs(),t=gt(),n=He(e,fr),r=He(e,Xw),o=He(e,Eh),i=He(e,GR);return{role:"grid","aria-colcount":n.length,"aria-rowcount":o+1+i+r,"aria-multiselectable":Jw(t)}},QJ=()=>{const e=Vs(),t=He(e,Ia),n=He(e,Eh);return m.useCallback((r,o)=>{const i={},l=o+n+2;return i["aria-rowindex"]=l,e.current.isRowSelectable(r.id)&&(i["aria-selected"]=t[r.id]!==void 0),i},[e,t,n])};function YJ({privateApiRef:e,configuration:t,props:n,children:r}){const o=m.useRef(e.current.getPublicApi());return s.jsx(H$.Provider,{value:t,children:s.jsx($R.Provider,{value:n,children:s.jsx(L$.Provider,{value:e,children:s.jsx(RR.Provider,{value:o,children:r})})})})}const XJ=e=>{const t=m.useRef(null),n=m.useRef(null),r=m.useRef(null),o=m.useRef(null),i=m.useRef(null),l=m.useRef(null);e.current.register("public",{rootElementRef:t}),e.current.register("private",{mainElementRef:n,virtualScrollerRef:r,virtualScrollbarVerticalRef:o,virtualScrollbarHorizontalRef:i,columnHeadersContainerRef:l})},ZJ=e=>{const t=Yr();e.current.state.isRtl===void 0&&(e.current.state.isRtl=t);const n=m.useRef(!0);m.useEffect(()=>{n.current?n.current=!1:e.current.setState(r=>q({},r,{isRtl:t}))},[e,t])},JJ=aq()&&window.localStorage.getItem("DEBUG")!=null,pp=()=>{},eee={debug:pp,info:pp,warn:pp,error:pp},mE=["debug","info","warn","error"];function gE(e,t,n=console){const r=mE.indexOf(t);if(r===-1)throw new Error(`MUI X: Log level ${t} not recognized.`);return mE.reduce((i,l,c)=>(c>=r?i[l]=(...u)=>{const[f,...h]=u;n[l](`MUI X: ${e} - ${f}`,...h)}:i[l]=pp,i),{})}const tee=(e,t)=>{const n=m.useCallback(r=>JJ?gE(r,"debug",t.logger):t.logLevel?gE(r,t.logLevel.toString(),t.logger):eee,[t.logLevel,t.logger]);Gt(e,{getLogger:n},"private")};class nee{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,n,r={}){let o=this.events[t];o||(o={highPriority:new Map,regular:new Map},this.events[t]=o),r.isFirst?o.highPriority.set(n,!0):o.regular.set(n,!0)}removeListener(t,n){this.events[t]&&(this.events[t].regular.delete(n),this.events[t].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(t,...n){const r=this.events[t];if(!r)return;const o=Array.from(r.highPriority.keys()),i=Array.from(r.regular.keys());for(let l=o.length-1;l>=0;l-=1){const c=o[l];r.highPriority.has(c)&&c.apply(this,n)}for(let l=0;l<i.length;l+=1){const c=i[l];r.regular.has(c)&&c.apply(this,n)}}once(t,n){const r=this;this.on(t,function o(...i){r.removeListener(t,o),n.apply(r,i)})}}class uS{static create(t){return new uS(t)}constructor(t){this.value=void 0,this.listeners=void 0,this.subscribe=n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}),this.getSnapshot=()=>this.value,this.update=n=>{this.value=n,this.listeners.forEach(r=>r(n))},this.value=t,this.listeners=new Set}}const nO=Symbol("mui.api_private"),ree=e=>e.isPropagationStopped!==void 0;let xE=0;function oee(e){var o;const t=(o=e.current)==null?void 0:o[nO];if(t)return t;const n={},r={state:n,store:uS.create(n),instanceId:{id:xE}};return xE+=1,r.getPublicApi=()=>e.current,r.register=(i,l)=>{Object.keys(l).forEach(c=>{const u=l[c],f=r[c];if((f==null?void 0:f.spying)===!0?f.target=u:r[c]=u,i==="public"){const h=e.current,p=h[c];(p==null?void 0:p.spying)===!0?p.target=u:h[c]=u}})},r.register("private",{caches:{},eventManager:new nee}),r}function see(e){return{get state(){return e.current.state},get store(){return e.current.store},get instanceId(){return e.current.instanceId},[nO]:e.current}}function iee(e,t){var l;const n=m.useRef(null),r=m.useRef(null);r.current||(r.current=oee(n)),n.current||(n.current=see(r));const o=m.useCallback((...c)=>{const[u,f,h={}]=c;if(h.defaultMuiPrevented=!1,ree(h)&&h.isPropagationStopped())return;const p=t.signature===zs.DataGridPro||t.signature===zs.DataGridPremium?{api:r.current.getPublicApi()}:{};r.current.eventManager.emit(u,f,h,p)},[r,t.signature]),i=m.useCallback((c,u,f)=>{r.current.eventManager.on(c,u,f);const h=r.current;return()=>{h.eventManager.removeListener(c,u)}},[r]);return Gt(r,{subscribeEvent:i,publishEvent:o},"public"),e&&!((l=e.current)!=null&&l.state)&&(e.current=n.current),m.useImperativeHandle(e,()=>n.current,[n]),m.useEffect(()=>{const c=r.current;return()=>{c.publishEvent("unmount")}},[r]),r}const lee=(e,t)=>{const n=m.useCallback(r=>{if(t.localeText[r]==null)throw new Error(`Missing translation for key ${r}.`);return t.localeText[r]},[t.localeText]);e.current.register("public",{getLocaleText:n})};function Wp(e){"@babel/helpers - typeof";return Wp=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},Wp(e)}function aee(e,t){if(Wp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Vp(e){var t=aee(e,"string");return Wp(t)=="symbol"?t:t+""}const cee=e=>{const t=m.useRef({}),n=m.useRef(!1),r=m.useCallback(h=>{n.current||!h||(n.current=!0,Object.values(h.appliers).forEach(p=>{p()}),n.current=!1)},[]),o=m.useCallback((h,p,g)=>{t.current[h]||(t.current[h]={processors:new Map,processorsAsArray:[],appliers:{}});const y=t.current[h];return y.processors.get(p)!==g&&(y.processors.set(p,g),y.processorsAsArray=Array.from(t.current[h].processors.values()).filter(v=>v!==null),r(y)),()=>{t.current[h].processors.set(p,null),t.current[h].processorsAsArray=Array.from(t.current[h].processors.values()).filter(v=>v!==null)}},[r]),i=m.useCallback((h,p,g)=>(t.current[h]||(t.current[h]={processors:new Map,processorsAsArray:[],appliers:{}}),t.current[h].appliers[p]=g,()=>{const y=t.current[h].appliers,b=St(y,[p].map(Vp));t.current[h].appliers=b}),[]),l=m.useCallback(h=>{r(t.current[h])},[r]),c=m.useCallback((...h)=>{const[p,g,y]=h;if(!t.current[p])return g;const b=t.current[p].processorsAsArray;let v=g;for(let C=0;C<b.length;C+=1)v=b[C](v,y);return v},[]),u={registerPipeProcessor:o,registerPipeApplier:i,requestPipeProcessorsApplication:l},f={unstable_applyPipeProcessors:c};Gt(e,u,"private"),Gt(e,f,"public")},Jn=(e,t,n,r=!0)=>{const o=m.useRef(null),i=m.useRef(`mui-${Math.round(Math.random()*1e9)}`),l=m.useCallback(()=>{o.current=e.current.registerPipeProcessor(t,i.current,n)},[e,n,t]);Sh(()=>{r&&l()});const c=m.useRef(!0);m.useEffect(()=>(c.current?c.current=!1:r&&l(),()=>{o.current&&(o.current(),o.current=null)}),[l,r])},dS=(e,t,n)=>{const r=m.useRef(null),o=m.useRef(`mui-${Math.round(Math.random()*1e9)}`),i=m.useCallback(()=>{r.current=e.current.registerPipeApplier(t,o.current,n)},[e,n,t]);Sh(()=>{i()});const l=m.useRef(!0);m.useEffect(()=>(l.current?l.current=!1:i(),()=>{r.current&&(r.current(),r.current=null)}),[i])},cx=(e,t,n,r)=>{const o=m.useCallback(()=>{e.current.registerStrategyProcessor(t,n,r)},[e,r,n,t]);Sh(()=>{o()});const i=m.useRef(!0);m.useEffect(()=>{i.current?i.current=!1:o()},[o])},Hc="none",yE={rowTreeCreation:"rowTree",filtering:"rowTree",sorting:"rowTree",visibleRowsLookupCreation:"rowTree"},uee=e=>{const t=m.useRef(new Map),n=m.useRef({}),r=m.useCallback((u,f,h)=>{const p=()=>{const b=n.current[f],v=St(b,[u].map(Vp));n.current[f]=v};n.current[f]||(n.current[f]={});const g=n.current[f],y=g[u];return g[u]=h,!y||y===h||u===e.current.getActiveStrategy(yE[f])&&e.current.publishEvent("activeStrategyProcessorChange",f),p},[e]),o=m.useCallback((u,f)=>{const h=e.current.getActiveStrategy(yE[u]);if(h==null)throw new Error("Can't apply a strategy processor before defining an active strategy");const p=n.current[u];if(!p||!p[h])throw new Error(`No processor found for processor "${u}" on strategy "${h}"`);const g=p[h];return g(f)},[e]),i=m.useCallback(u=>{const h=Array.from(t.current.entries()).find(([,p])=>p.group!==u?!1:p.isAvailable());return(h==null?void 0:h[0])??Hc},[]),l=m.useCallback((u,f,h)=>{t.current.set(f,{group:u,isAvailable:h}),e.current.publishEvent("strategyAvailabilityChange")},[e]);Gt(e,{registerStrategyProcessor:r,applyStrategyProcessor:o,getActiveStrategy:i,setStrategyAvailability:l},"private")},dee=e=>{const t=m.useRef({}),n=m.useCallback(u=>{t.current[u.stateId]=u},[]),r=m.useCallback((u,f)=>{let h;if(lq(u)?h=u(e.current.state):h=u,e.current.state===h)return!1;let p=!1;const g=[];if(Object.keys(t.current).forEach(y=>{const b=t.current[y],v=b.stateSelector(e.current.state,e.current.instanceId),C=b.stateSelector(h,e.current.instanceId);C!==v&&(g.push({stateId:b.stateId,hasPropChanged:C!==b.propModel}),b.propModel!==void 0&&C!==b.propModel&&(p=!0))}),g.length>1)throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${g[0].stateId}, therefore, you're not allowed to update ${g.map(y=>y.stateId).join(", ")} in the same transaction.`);if(p||(e.current.state=h,e.current.publishEvent("stateChange",h),e.current.store.update(h)),g.length===1){const{stateId:y,hasPropChanged:b}=g[0],v=t.current[y],C=v.stateSelector(h,e.current.instanceId);v.propOnChange&&b&&v.propOnChange(C,{reason:f,api:e.current}),p||e.current.publishEvent(v.changeEvent,C,{reason:f})}return!p},[e]),o=m.useCallback((u,f,h)=>e.current.setState(p=>q({},p,{[u]:f(p[u])}),h),[e]),i=m.useCallback(()=>{},[]),l={setState:r,forceUpdate:i},c={updateControlState:o,registerControlState:n};Gt(e,l,"public"),Gt(e,c,"private")},fee=(e,t)=>q({},e,{props:{getRowId:t.getRowId}}),pee=(e,t)=>{m.useEffect(()=>{e.current.setState(n=>q({},n,{props:{getRowId:t.getRowId}}))},[e,t.getRowId])},hee=(e,t)=>{const n=iee(e,t);return XJ(n),pee(n,t),ZJ(n),tee(n,t),dee(n),cee(n),uee(n),lee(n,t),n.current.register("private",{rootProps:t}),n},Or=(e,t,n)=>{const r=m.useRef(!1);r.current||(t.current.state=e(t.current.state,n,t),r.current=!0)};function pC(e,t){if(e==null)return"";const n=typeof e=="string"?e:`${e}`;if(t.shouldAppendQuotes||t.escapeFormulas){const r=n.replace(/"/g,'""');return t.escapeFormulas&&["=","+","-","@"," ","\r"].includes(r[0])?`"'${r}"`:[t.delimiter,`
|
|
331
|
+
`,"\r",'"'].some(o=>n.includes(o))?`"${r}"`:r}return n}const rO=(e,t)=>{var i,l;const{csvOptions:n,ignoreValueFormatter:r}=t;let o;if(r){const c=e.colDef.type;c==="number"?o=String(e.value):c==="date"||c==="dateTime"?o=(i=e.value)==null?void 0:i.toISOString():typeof((l=e.value)==null?void 0:l.toString)=="function"?o=e.value.toString():o=e.value}else o=e.formattedValue;return pC(o,n)};class hC{constructor(t){this.options=void 0,this.rowString="",this.isEmpty=!0,this.options=t}addValue(t){this.isEmpty||(this.rowString+=this.options.csvOptions.delimiter),typeof this.options.sanitizeCellValue=="function"?this.rowString+=this.options.sanitizeCellValue(t,this.options.csvOptions):this.rowString+=t,this.isEmpty=!1}getRowString(){return this.rowString}}const mee=({id:e,columns:t,getCellParams:n,csvOptions:r,ignoreValueFormatter:o})=>{const i=new hC({csvOptions:r});return t.forEach(l=>{const c=n(e,l.field);i.addValue(rO(c,{ignoreValueFormatter:o,csvOptions:r}))}),i.getRowString()};function gee(e){const{columns:t,rowIds:n,csvOptions:r,ignoreValueFormatter:o,apiRef:i}=e,l=n.reduce((p,g)=>`${p}${mee({id:g,columns:t,getCellParams:i.current.getCellParams,ignoreValueFormatter:o,csvOptions:r})}\r
|
|
332
|
+
`,"").trim();if(!r.includeHeaders)return l;const c=t.filter(p=>p.field!==Jd.field),u=[];if(r.includeColumnGroupsHeaders){const p=i.current.getAllGroupDetails();let g=0;const y=c.reduce((b,v)=>{const C=i.current.getColumnGroupPath(v.field);return b[v.field]=C,g=Math.max(g,C.length),b},{});for(let b=0;b<g;b+=1){const v=new hC({csvOptions:r,sanitizeCellValue:pC});u.push(v),c.forEach(C=>{const S=(y[C.field]||[])[b],j=p[S];v.addValue(j?j.headerName||j.groupId:"")})}}const f=new hC({csvOptions:r,sanitizeCellValue:pC});return c.forEach(p=>{f.addValue(p.headerName||p.field)}),u.push(f),`${`${u.map(p=>p.getRowString()).join(`\r
|
|
333
|
+
`)}\r
|
|
334
|
+
`}${l}`.trim()}function bE(e){const t=document.createElement("span");t.style.whiteSpace="pre",t.style.userSelect="all",t.style.opacity="0px",t.textContent=e,document.body.appendChild(t);const n=document.createRange();n.selectNode(t);const r=window.getSelection();r.removeAllRanges(),r.addRange(n);try{document.execCommand("copy")}finally{document.body.removeChild(t)}}function xee(e){navigator.clipboard?navigator.clipboard.writeText(e).catch(()=>{bE(e)}):bE(e)}function yee(e){var t;return!!((t=window.getSelection())!=null&&t.toString()||e&&(e.selectionEnd||0)-(e.selectionStart||0)>0)}const bee=(e,t)=>{const n=t.ignoreValueFormatterDuringExport,r=(typeof n=="object"?n==null?void 0:n.clipboardExport:n)||!1,o=t.clipboardCopyCellDelimiter,i=m.useCallback(l=>{if(!mZ(l)||yee(l.target))return;let c="";if(e.current.getSelectedRows().size>0)c=e.current.getDataAsCsv({includeHeaders:!1,delimiter:o,shouldAppendQuotes:!1,escapeFormulas:!1});else{const f=_o(e);if(f){const h=e.current.getCellParams(f.id,f.field);c=rO(h,{csvOptions:{delimiter:o,shouldAppendQuotes:!1,escapeFormulas:!1},ignoreValueFormatter:r})}}c=e.current.unstable_applyPipeProcessors("clipboardCopy",c),c&&(xee(c),e.current.publishEvent("clipboardCopy",c))},[e,r,o]);b$(e,()=>e.current.rootElementRef.current,"keydown",i),En(e,"clipboardCopy",t.onClipboardCopy)},vee=e=>q({},e,{columnMenu:{open:!1}}),Cee=e=>{const t=Fr(e,"useGridColumnMenu"),n=m.useCallback(l=>{const c=Rg(e.current.state),u={open:!0,field:l};(u.open!==c.open||u.field!==c.field)&&(e.current.setState(h=>h.columnMenu.open&&h.columnMenu.field===l?h:(t.debug("Opening Column Menu"),q({},h,{columnMenu:{open:!0,field:l}}))),e.current.hidePreferences())},[e,t]),r=m.useCallback(()=>{const l=Rg(e.current.state);if(l.field){const f=Pl(e),h=Ms(e),p=ul(e);let g=l.field;if(f[g]||(g=p[0]),h[g]===!1){const y=p.filter(v=>v===g?!0:h[v]!==!1),b=y.indexOf(g);g=y[b+1]||y[b-1]}e.current.setColumnHeaderFocus(g)}const c={open:!1,field:void 0};(c.open!==l.open||c.field!==l.field)&&e.current.setState(f=>(t.debug("Hiding Column Menu"),q({},f,{columnMenu:c})))},[e,t]),o=m.useCallback(l=>{t.debug("Toggle Column Menu");const c=Rg(e.current.state);!c.open||c.field!==l?n(l):r()},[e,t,n,r]);Gt(e,{showColumnMenu:n,hideColumnMenu:r,toggleColumnMenu:o},"public"),ot(e,"columnResizeStart",r),ot(e,"virtualScrollerWheel",e.current.hideColumnMenu),ot(e,"virtualScrollerTouchMove",e.current.hideColumnMenu)},wee=(e,t,n)=>{var o,i,l;const r=Au({apiRef:n,columnsToUpsert:t.columns,initialState:(o=t.initialState)==null?void 0:o.columns,columnVisibilityModel:t.columnVisibilityModel??((l=(i=t.initialState)==null?void 0:i.columns)==null?void 0:l.columnVisibilityModel)??{},keepOnlyColumnsToUpsert:!0});return q({},e,{columns:r,pinnedColumns:e.pinnedColumns??ex})};function See(e,t){var E,O;const n=Fr(e,"useGridColumns"),r=m.useRef(t.columns);e.current.registerControlState({stateId:"visibleColumns",propModel:t.columnVisibilityModel,propOnChange:t.onColumnVisibilityModelChange,stateSelector:Ms,changeEvent:"columnVisibilityModelChange"});const o=m.useCallback(A=>{n.debug("Updating columns state."),e.current.setState(vE(A)),e.current.publishEvent("columnsChange",A.orderedFields)},[n,e]),i=m.useCallback(A=>Pl(e)[A],[e]),l=m.useCallback(()=>Ls(e),[e]),c=m.useCallback(()=>fr(e),[e]),u=m.useCallback((A,N=!0)=>(N?fr(e):Ls(e)).findIndex(L=>L.field===A),[e]),f=m.useCallback(A=>{const N=u(A);return _a(e)[N]},[e,u]),h=m.useCallback(A=>{var F,L;Ms(e)!==A&&(e.current.setState(D=>q({},D,{columns:Au({apiRef:e,columnsToUpsert:[],initialState:void 0,columnVisibilityModel:A,keepOnlyColumnsToUpsert:!1})})),(L=(F=e.current).updateRenderContext)==null||L.call(F),e.current.forceUpdate())},[e]),p=m.useCallback(A=>{const N=Au({apiRef:e,columnsToUpsert:A,initialState:void 0,keepOnlyColumnsToUpsert:!1});o(N)},[e,o]),g=m.useCallback((A,N)=>{const F=Ms(e),L=F[A]??!0;if(N!==L){const D=q({},F,{[A]:N});e.current.setColumnVisibilityModel(D)}},[e]),y=m.useCallback(A=>ul(e).findIndex(F=>F===A),[e]),b=m.useCallback((A,N)=>{const F=ul(e),L=y(A);if(L===N)return;n.debug(`Moving column ${A} to index ${N}`);const D=[...F],H=D.splice(L,1)[0];D.splice(N,0,H),o(q({},Oi(e.current.state),{orderedFields:D}));const B={column:e.current.getColumn(A),targetIndex:e.current.getColumnIndexRelativeToVisibleColumns(A),oldIndex:L};e.current.publishEvent("columnIndexChange",B)},[e,n,o,y]),v=m.useCallback((A,N)=>{n.debug(`Updating column ${A} width to ${N}`);const F=Oi(e.current.state),L=F.lookup[A],D=q({},L,{width:N,hasBeenResized:!0});o(uC(q({},F,{lookup:q({},F.lookup,{[A]:D})}),e.current.getRootDimensions())),e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(A),colDef:D,width:N})},[e,n,o]),C={getColumn:i,getAllColumns:l,getColumnIndex:u,getColumnPosition:f,getVisibleColumns:c,getColumnIndexRelativeToVisibleColumns:y,updateColumns:p,setColumnVisibilityModel:h,setColumnVisibility:g,setColumnWidth:v},S={setColumnIndex:b};Gt(e,C,"public"),Gt(e,S,t.signature===zs.DataGrid?"private":"public");const j=m.useCallback((A,N)=>{var V,G;const F={},L=Ms(e);(!N.exportOnlyDirtyModels||t.columnVisibilityModel!=null||Object.keys(((G=(V=t.initialState)==null?void 0:V.columns)==null?void 0:G.columnVisibilityModel)??{}).length>0||Object.keys(L).length>0)&&(F.columnVisibilityModel=L),F.orderedFields=ul(e);const H=Ls(e),B={};return H.forEach(_=>{if(_.hasBeenResized){const U={};$$.forEach(Z=>{let Q=_[Z];Q===1/0&&(Q=-1),U[Z]=Q}),B[_.field]=U}}),Object.keys(B).length>0&&(F.dimensions=B),q({},A,{columns:F})},[e,t.columnVisibilityModel,(E=t.initialState)==null?void 0:E.columns]),w=m.useCallback((A,N)=>{var H;const F=(H=N.stateToRestore.columns)==null?void 0:H.columnVisibilityModel,L=N.stateToRestore.columns;if(F==null&&L==null)return A;const D=Au({apiRef:e,columnsToUpsert:[],initialState:L,columnVisibilityModel:F,keepOnlyColumnsToUpsert:!1});return e.current.setState(vE(D)),L!=null&&e.current.publishEvent("columnsChange",D.orderedFields),A},[e]),k=m.useCallback((A,N)=>{var F;if(N===_c.columns){const L=t.slots.columnsPanel;return s.jsx(L,q({},(F=t.slotProps)==null?void 0:F.columnsPanel))}return A},[t.slots.columnsPanel,(O=t.slotProps)==null?void 0:O.columnsPanel]),P=m.useCallback(A=>t.disableColumnSelector?A:[...A,"columnMenuColumnsItem"],[t.disableColumnSelector]);Jn(e,"columnMenu",P),Jn(e,"exportState",j),Jn(e,"restoreState",w),Jn(e,"preferencePanel",k);const T=m.useRef(null);ot(e,"viewportInnerSizeChange",A=>{if(T.current!==A.width){if(T.current=A.width,!fr(e).some(F=>F.flex&&F.flex>0))return;o(uC(Oi(e.current.state),e.current.getRootDimensions()))}});const M=m.useCallback(()=>{n.info("Columns pipe processing have changed, regenerating the columns");const A=Au({apiRef:e,columnsToUpsert:[],initialState:void 0,keepOnlyColumnsToUpsert:!1});o(A)},[e,n,o]);dS(e,"hydrateColumns",M);const R=m.useRef(!0);m.useEffect(()=>{if(R.current){R.current=!1;return}if(n.info(`GridColumns have changed, new length ${t.columns.length}`),r.current===t.columns)return;const A=Au({apiRef:e,initialState:void 0,columnsToUpsert:t.columns,keepOnlyColumnsToUpsert:!0});r.current=t.columns,o(A)},[n,e,o,t.columns]),m.useEffect(()=>{t.columnVisibilityModel!==void 0&&e.current.setColumnVisibilityModel(t.columnVisibilityModel)},[e,n,t.columnVisibilityModel])}function vE(e){return t=>q({},t,{columns:e})}const jee=(e,t)=>{var n;return q({},e,{density:((n=t.initialState)==null?void 0:n.density)??t.density??"standard"})},kee=(e,t)=>{var c;const n=Fr(e,"useDensity");e.current.registerControlState({stateId:"density",propModel:t.density,propOnChange:t.onDensityChange,stateSelector:Bu,changeEvent:"densityChange"});const o={setDensity:Vt(u=>{Bu(e.current.state)!==u&&(n.debug(`Set grid density to ${u}`),e.current.setState(h=>q({},h,{density:u})))})};Gt(e,o,"public");const i=m.useCallback((u,f)=>{var g;const h=Bu(e.current.state);return!f.exportOnlyDirtyModels||t.density!=null||((g=t.initialState)==null?void 0:g.density)!=null?q({},u,{density:h}):u},[e,t.density,(c=t.initialState)==null?void 0:c.density]),l=m.useCallback((u,f)=>{var p;const h=(p=f.stateToRestore)!=null&&p.density?f.stateToRestore.density:Bu(e.current.state);return e.current.setState(g=>q({},g,{density:h})),u},[e]);Jn(e,"exportState",i),Jn(e,"restoreState",l),m.useEffect(()=>{t.density&&e.current.setDensity(t.density)},[e,t.density])};function Iee(e,t="csv",n=document.title||"untitled"){const r=`${n}.${t}`;if("download"in HTMLAnchorElement.prototype){const o=URL.createObjectURL(e),i=document.createElement("a");i.href=o,i.download=r,i.click(),setTimeout(()=>{URL.revokeObjectURL(o)});return}throw new Error("MUI X: exportAs not supported.")}const oO=({apiRef:e,options:t})=>{const n=Ls(e);return t.fields?t.fields.reduce((o,i)=>{const l=n.find(c=>c.field===i);return l&&o.push(l),o},[]):(t.allColumns?n:fr(e)).filter(o=>!o.disableExport)},sO=({apiRef:e})=>{var u,f;const t=h$(e),n=Pr(e),r=e.current.getSelectedRows(),o=t.filter(h=>n[h].type!=="footer"),i=Kd(e),l=((u=i==null?void 0:i.top)==null?void 0:u.map(h=>h.id))||[],c=((f=i==null?void 0:i.bottom)==null?void 0:f.map(h=>h.id))||[];return o.unshift(...l),o.push(...c),r.size>0?o.filter(h=>r.has(h)):o},Eee=(e,t)=>{const n=Fr(e,"useGridCsvExport"),r=t.ignoreValueFormatterDuringExport,o=(typeof r=="object"?r==null?void 0:r.csvExport:r)||!1,i=m.useCallback((f={})=>{n.debug("Get data as CSV");const h=oO({apiRef:e,options:f}),g=(f.getRowsToExport??sO)({apiRef:e});return gee({columns:h,rowIds:g,csvOptions:{delimiter:f.delimiter||",",shouldAppendQuotes:f.shouldAppendQuotes??!0,includeHeaders:f.includeHeaders??!0,includeColumnGroupsHeaders:f.includeColumnGroupsHeaders??!0,escapeFormulas:f.escapeFormulas??!0},ignoreValueFormatter:o,apiRef:e})},[n,e,o]),l=m.useCallback(f=>{n.debug("Export data as CSV");const h=i(f),p=new Blob([f!=null&&f.utf8WithBom?new Uint8Array([239,187,191]):"",h],{type:"text/csv"});Iee(p,"csv",f==null?void 0:f.fileName)},[n,i]);Gt(e,{getDataAsCsv:i,exportDataAsCsv:l},"public");const u=m.useCallback((f,h)=>{var p;return(p=h.csvOptions)!=null&&p.disableToolbarButton?f:[...f,{component:s.jsx(vJ,{options:h.csvOptions}),componentName:"csvExport"}]},[]);Jn(e,"exportMenu",u)},$g=(e,t,n)=>{let r=e.paginationModel;const o=e.rowCount,i=(n==null?void 0:n.pageSize)??r.pageSize,l=(n==null?void 0:n.page)??r.page,c=v$(o,i,l);n&&((n==null?void 0:n.page)!==r.page||(n==null?void 0:n.pageSize)!==r.pageSize)&&(r=n);const u=i===-1?0:gK(r.page,c);return u!==r.page&&(r=q({},r,{page:u})),w$(r.pageSize,t),r},Pee=(e,t)=>{var j,w;const n=Fr(e,"useGridPaginationModel"),r=He(e,qd),o=m.useRef(Vr(e)),i=Math.floor(t.rowHeight*r);e.current.registerControlState({stateId:"paginationModel",propModel:t.paginationModel,propOnChange:t.onPaginationModelChange,stateSelector:ho,changeEvent:"paginationModelChange"});const l=m.useCallback(k=>{const P=ho(e);k!==P.page&&(n.debug(`Setting page to ${k}`),e.current.setPaginationModel({page:k,pageSize:P.pageSize}))},[e,n]),c=m.useCallback(k=>{const P=ho(e);k!==P.pageSize&&(n.debug(`Setting page size to ${k}`),e.current.setPaginationModel({pageSize:k,page:P.page}))},[e,n]),u=m.useCallback(k=>{const P=ho(e);k!==P&&(n.debug("Setting 'paginationModel' to",k),e.current.setState(T=>q({},T,{pagination:q({},T.pagination,{paginationModel:$g(T.pagination,t.signature,k)})}),"setPaginationModel"))},[e,n,t.signature]);Gt(e,{setPage:l,setPageSize:c,setPaginationModel:u},"public");const h=m.useCallback((k,P)=>{var M,R;const T=ho(e);return!P.exportOnlyDirtyModels||t.paginationModel!=null||((R=(M=t.initialState)==null?void 0:M.pagination)==null?void 0:R.paginationModel)!=null||T.page!==0&&T.pageSize!==mK(t.autoPageSize)?q({},k,{pagination:q({},k.pagination,{paginationModel:T})}):k},[e,t.paginationModel,(w=(j=t.initialState)==null?void 0:j.pagination)==null?void 0:w.paginationModel,t.autoPageSize]),p=m.useCallback((k,P)=>{var $,M;const T=($=P.stateToRestore.pagination)!=null&&$.paginationModel?q({},C$(t.autoPageSize),(M=P.stateToRestore.pagination)==null?void 0:M.paginationModel):ho(e);return e.current.setState(R=>q({},R,{pagination:q({},R.pagination,{paginationModel:$g(R.pagination,t.signature,T)})}),"stateRestorePreProcessing"),k},[e,t.autoPageSize,t.signature]);Jn(e,"exportState",h),Jn(e,"restoreState",p);const g=()=>{var P;const k=ho(e);(P=e.current.virtualScrollerRef)!=null&&P.current&&e.current.scrollToIndexes({rowIndex:k.page*k.pageSize})},y=m.useCallback(()=>{if(!t.autoPageSize)return;const k=e.current.getRootDimensions(),P=Math.max(1,Math.floor(k.viewportInnerSize.height/i));e.current.setPageSize(P)},[e,t.autoPageSize,i]),b=m.useCallback(k=>{if(k==null)return;const P=ho(e);if(P.page===0)return;const T=k$(e);P.page>T-1&&e.current.setPage(Math.max(0,T-1))},[e]),v=m.useCallback(()=>{ho(e).page!==0&&e.current.setPage(0),e.current.getScrollPosition().top!==0&&e.current.scroll({top:0})},[e]),C=m.useCallback(k=>{const P=q({},k,{items:g$(e)});ka(P,o.current)||(o.current=P,v())},[e,v]);ot(e,"viewportInnerSizeChange",y),ot(e,"paginationModelChange",g),ot(e,"rowCountChange",b),ot(e,"sortModelChange",cc(t.resetPageOnSortFilter,v)),ot(e,"filterModelChange",cc(t.resetPageOnSortFilter,C));const S=m.useRef(!0);m.useEffect(()=>{if(S.current){S.current=!1;return}t.pagination&&e.current.setState(k=>q({},k,{pagination:q({},k.pagination,{paginationModel:$g(k.pagination,t.signature,t.paginationModel)})}))},[e,t.paginationModel,t.signature,t.pagination]),m.useEffect(()=>{e.current.setState(k=>{const P=t.pagination===!0;return k.pagination.paginationMode===t.paginationMode||k.pagination.enabled===P?k:q({},k,{pagination:q({},k.pagination,{paginationMode:t.paginationMode,enabled:t.pagination===!0})})})},[e,t.paginationMode,t.pagination]),m.useEffect(y,[y])};function Tee(){return new Promise(e=>{requestAnimationFrame(()=>{e()})})}function Mee(e){const t=document.createElement("iframe");return t.style.position="absolute",t.style.width="0px",t.style.height="0px",t.title=e||document.title,t}const Ree=(e,t)=>{const n=e.current.rootElementRef.current!==null,r=Fr(e,"useGridPrintExport"),o=m.useRef(null),i=m.useRef(null),l=m.useRef({}),c=m.useRef([]),u=m.useRef(null);m.useEffect(()=>{o.current=ir(e.current.rootElementRef.current)},[e,n]);const f=m.useCallback((C,S,j)=>new Promise(w=>{const k=oO({apiRef:e,options:{fields:C,allColumns:S}}).map($=>$.field),P=Ls(e),T={};P.forEach($=>{T[$.field]=k.includes($.field)}),j&&(T[Jd.field]=!0),e.current.setColumnVisibilityModel(T),w()}),[e]),h=m.useCallback(C=>{const j=C({apiRef:e}).reduce((w,k)=>{const P=e.current.getRow(k);return P[wd]||w.push(P),w},[]);e.current.setRows(j)},[e]),p=m.useCallback((C,S)=>{var L,D,H;const j=q({copyStyles:!0,hideToolbar:!1,hideFooter:!1,includeCheckboxes:!1},S),w=C.contentDocument;if(!w)return;const k=ef(e.current.state),P=e.current.rootElementRef.current,T=P.cloneNode(!0),$=T.querySelector(`.${te.main}`);$.style.overflow="visible",T.style.contain="size";let M=((L=P.querySelector(`.${te.toolbarContainer}`))==null?void 0:L.offsetHeight)||0,R=((D=P.querySelector(`.${te.footerContainer}`))==null?void 0:D.offsetHeight)||0;const E=T.querySelector(`.${te.footerContainer}`);j.hideToolbar&&((H=T.querySelector(`.${te.toolbarContainer}`))==null||H.remove(),M=0),j.hideFooter&&E&&(E.remove(),R=0);const O=k.currentPageTotalHeight+sy(e,t)+M+R;T.style.height=`${O}px`,T.style.boxSizing="content-box",!j.hideFooter&&E&&(E.style.position="absolute",E.style.width="100%",E.style.top=`${O-R}px`);const A=document.createElement("div");A.appendChild(T),w.body.style.marginTop="0px",w.body.innerHTML=A.innerHTML;const N=typeof j.pageStyle=="function"?j.pageStyle():j.pageStyle;if(typeof N=="string"){const B=w.createElement("style");B.appendChild(w.createTextNode(N)),w.head.appendChild(B)}j.bodyClassName&&w.body.classList.add(...j.bodyClassName.split(" "));const F=[];if(j.copyStyles){const B=P.getRootNode(),G=(B.constructor.name==="ShadowRoot"?B:o.current).querySelectorAll("style, link[rel='stylesheet']");for(let _=0;_<G.length;_+=1){const U=G[_];if(U.tagName==="STYLE"){const Z=w.createElement(U.tagName),Q=U.sheet;if(Q){let ee="";for(let ne=0;ne<Q.cssRules.length;ne+=1)typeof Q.cssRules[ne].cssText=="string"&&(ee+=`${Q.cssRules[ne].cssText}\r
|
|
335
|
+
`);Z.appendChild(w.createTextNode(ee)),w.head.appendChild(Z)}}else if(U.getAttribute("href")){const Z=w.createElement(U.tagName);for(let Q=0;Q<U.attributes.length;Q+=1){const ee=U.attributes[Q];ee&&Z.setAttribute(ee.nodeName,ee.nodeValue||"")}F.push(new Promise(Q=>{Z.addEventListener("load",()=>Q())})),w.head.appendChild(Z)}}}Promise.all(F).then(()=>{C.contentWindow.print()})},[e,o,t]),g=m.useCallback(C=>{var S,j;o.current.body.removeChild(C),e.current.restoreState(i.current||{}),(j=(S=i.current)==null?void 0:S.columns)!=null&&j.columnVisibilityModel||e.current.setColumnVisibilityModel(l.current),e.current.setState(w=>q({},w,{virtualization:u.current})),e.current.setRows(c.current),i.current=null,l.current={},c.current=[]},[e]),b={exportDataAsPrint:m.useCallback(async C=>{if(r.debug("Export data as Print"),!e.current.rootElementRef.current)throw new Error("MUI X: No grid root element available.");if(i.current=e.current.exportState(),l.current=Ms(e),c.current=e.current.getSortedRows().filter(j=>!j[wd]),t.pagination){const w={page:0,pageSize:Xw(e)};e.current.setState(k=>q({},k,{pagination:q({},k.pagination,{paginationModel:$g(k.pagination,"DataGridPro",w)})}))}u.current=e.current.state.virtualization,e.current.unstable_setVirtualization(!1),await f(C==null?void 0:C.fields,C==null?void 0:C.allColumns,C==null?void 0:C.includeCheckboxes),h((C==null?void 0:C.getRowsToExport)??sO),await Tee();const S=Mee(C==null?void 0:C.fileName);S.onload=()=>{p(S,C),S.contentWindow.matchMedia("print").addEventListener("change",w=>{w.matches===!1&&g(S)})},o.current.body.appendChild(S)},[t,r,e,p,g,f,h])};Gt(e,b,"public");const v=m.useCallback((C,S)=>{var j;return(j=S.printOptions)!=null&&j.disableToolbarButton?C:[...C,{component:s.jsx(CJ,{options:S.printOptions}),componentName:"printExport"}]},[]);Jn(e,"exportMenu",v)},$ee=(e,t,n)=>{var o,i;const r=t.filterModel??((i=(o=t.initialState)==null?void 0:o.filter)==null?void 0:i.filterModel)??_p();return q({},e,{filter:q({filterModel:qw(r,t.disableMultipleColumnsFiltering,n)},ZR),visibleRowsLookup:{}})},Oee=e=>e.filteredRowsLookup;function CE(e,t){return e.current.applyStrategyProcessor("visibleRowsLookupCreation",{tree:t.rows.tree,filteredRowsLookup:t.filter.filteredRowsLookup})}function zee(){return OR(Object.values)}const Lee=(e,t)=>{var R,E,O;const n=Fr(e,"useGridFilter");e.current.registerControlState({stateId:"filter",propModel:t.filterModel,propOnChange:t.onFilterModelChange,stateSelector:Vr,changeEvent:"filterModelChange"});const r=m.useCallback(()=>{e.current.setState(A=>{const N=Vr(A,e.current.instanceId),F=e.current.getFilterState(N),L=q({},A,{filter:q({},A.filter,F)}),D=CE(e,L);return q({},L,{visibleRowsLookup:D})}),e.current.publishEvent("filteredRowsSet")},[e]),o=m.useCallback((A,N)=>N==null||N.filterable===!1||t.disableColumnFilter?A:[...A,"columnMenuFilterItem"],[t.disableColumnFilter]),i=m.useCallback(()=>{r(),e.current.forceUpdate()},[e,r]),l=m.useCallback(A=>{const N=Vr(e),F=[...N.items],L=F.findIndex(D=>D.id===A.id);L===-1?F.push(A):F[L]=A,e.current.setFilterModel(q({},N,{items:F}),"upsertFilterItem")},[e]),c=m.useCallback(A=>{const N=Vr(e),F=[...N.items];A.forEach(L=>{const D=F.findIndex(H=>H.id===L.id);D===-1?F.push(L):F[D]=L}),e.current.setFilterModel(q({},N,{items:F}),"upsertFilterItems")},[e]),u=m.useCallback(A=>{const N=Vr(e),F=N.items.filter(L=>L.id!==A.id);F.length!==N.items.length&&e.current.setFilterModel(q({},N,{items:F}),"deleteFilterItem")},[e]),f=m.useCallback((A,N,F)=>{if(n.debug("Displaying filter panel"),A){const L=Vr(e),D=L.items.filter(G=>{var Q;if(G.value!==void 0)return!(Array.isArray(G.value)&&G.value.length===0);const U=(Q=e.current.getColumn(G.field).filterOperators)==null?void 0:Q.find(ee=>ee.value===G.operator);return!(typeof(U==null?void 0:U.requiresFilterValue)>"u"?!0:U==null?void 0:U.requiresFilterValue)});let H;const B=D.find(G=>G.field===A),V=e.current.getColumn(A);B?H=D:t.disableMultipleColumnsFiltering?H=[cC({field:A,operator:V.filterOperators[0].value},e)]:H=[...D,cC({field:A,operator:V.filterOperators[0].value},e)],e.current.setFilterModel(q({},L,{items:H}))}e.current.showPreferences(_c.filters,N,F)},[e,n,t.disableMultipleColumnsFiltering]),h=m.useCallback(()=>{n.debug("Hiding filter panel"),e.current.hidePreferences()},[e,n]),p=m.useCallback(A=>{const N=Vr(e);N.logicOperator!==A&&e.current.setFilterModel(q({},N,{logicOperator:A}),"changeLogicOperator")},[e]),g=m.useCallback(A=>{const N=Vr(e);ka(N.quickFilterValues,A)||e.current.setFilterModel(q({},N,{quickFilterValues:[...A]}))},[e]),y=m.useCallback((A,N)=>{Vr(e)!==A&&(n.debug("Setting filter model"),e.current.updateControlState("filter",$I(A,t.disableMultipleColumnsFiltering,e),N),e.current.unstable_applyFilters())},[e,n,t.disableMultipleColumnsFiltering]),b=m.useCallback(A=>{const N=qw(A,t.disableMultipleColumnsFiltering,e),F=t.filterMode==="client"?yq(N,e,t.disableEval):null,L=e.current.applyStrategyProcessor("filtering",{isRowMatchingFilters:F,filterModel:N??_p()});return q({},L,{filterModel:N})},[t.disableMultipleColumnsFiltering,t.filterMode,t.disableEval,e]),v={setFilterLogicOperator:p,unstable_applyFilters:i,deleteFilterItem:u,upsertFilterItem:l,upsertFilterItems:c,setFilterModel:y,showFilterPanel:f,hideFilterPanel:h,setQuickFilterValues:g,ignoreDiacritics:t.ignoreDiacritics,getFilterState:b};Gt(e,v,"public");const C=m.useCallback((A,N)=>{var D,H;const F=Vr(e);return F.items.forEach(B=>{delete B.fromInput}),!N.exportOnlyDirtyModels||t.filterModel!=null||((H=(D=t.initialState)==null?void 0:D.filter)==null?void 0:H.filterModel)!=null||!ka(F,_p())?q({},A,{filter:{filterModel:F}}):A},[e,t.filterModel,(E=(R=t.initialState)==null?void 0:R.filter)==null?void 0:E.filterModel]),S=m.useCallback((A,N)=>{var L;const F=(L=N.stateToRestore.filter)==null?void 0:L.filterModel;return F==null?A:(e.current.updateControlState("filter",$I(F,t.disableMultipleColumnsFiltering,e),"restoreState"),q({},A,{callbacks:[...A.callbacks,e.current.unstable_applyFilters]}))},[e,t.disableMultipleColumnsFiltering]),j=m.useCallback((A,N)=>{var F;if(N===_c.filters){const L=t.slots.filterPanel;return s.jsx(L,q({},(F=t.slotProps)==null?void 0:F.filterPanel))}return A},[t.slots.filterPanel,(O=t.slotProps)==null?void 0:O.filterPanel]),{getRowId:w}=t,k=Hs(zee),P=m.useCallback(A=>{var _;if(t.filterMode!=="client"||!A.isRowMatchingFilters||!A.filterModel.items.length&&!((_=A.filterModel.quickFilterValues)!=null&&_.length))return ZR;const N=Ts(e),F={},{isRowMatchingFilters:L}=A,D={},H={passingFilterItems:null,passingQuickFilterValues:null},B=k.current(e.current.state.rows.dataRowIdToModelLookup);for(let U=0;U<B.length;U+=1){const Z=B[U],Q=w?w(Z):Z.id;L(Z,void 0,H);const ee=vq([H.passingFilterItems],[H.passingQuickFilterValues],A.filterModel,e,D);F[Q]=ee}const V="auto-generated-group-footer-root";return N[V]&&(F[V]=!0),{filteredRowsLookup:F,filteredChildrenCountLookup:{},filteredDescendantCountLookup:{}}},[e,t.filterMode,w,k]);Jn(e,"columnMenu",o),Jn(e,"exportState",C),Jn(e,"restoreState",S),Jn(e,"preferencePanel",j),cx(e,Hc,"filtering",P),cx(e,Hc,"visibleRowsLookupCreation",Oee);const T=m.useCallback(()=>{n.debug("onColUpdated - GridColumns changed, applying filters");const A=Vr(e),N=Pl(e),F=A.items.filter(L=>L.field&&N[L.field]);F.length<A.items.length&&e.current.setFilterModel(q({},A,{items:F}))},[e,n]),$=m.useCallback(A=>{A==="filtering"&&e.current.unstable_applyFilters()},[e]),M=m.useCallback(()=>{e.current.setState(A=>q({},A,{visibleRowsLookup:CE(e,A)})),e.current.forceUpdate()},[e]);ot(e,"rowsSet",r),ot(e,"columnsChange",T),ot(e,"activeStrategyProcessorChange",$),ot(e,"rowExpansionChange",M),ot(e,"columnVisibilityModelChange",()=>{const A=Vr(e);A.quickFilterValues&&s$(A)&&e.current.unstable_applyFilters()}),Sh(()=>{e.current.unstable_applyFilters()}),Ln(()=>{t.filterModel!==void 0&&e.current.setFilterModel(t.filterModel)},[e,n,t.filterModel])},Dee=e=>q({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},tabIndex:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}),Aee=(e,t)=>{const n=Fr(e,"useGridFocus"),r=m.useRef(null),o=e.current.rootElementRef.current!==null,i=m.useCallback((M,R)=>{M&&e.current.getRow(M.id)&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(M.id,M.field),R)},[e]),l=m.useCallback((M,R)=>{const E=_o(e);(E==null?void 0:E.id)===M&&(E==null?void 0:E.field)===R||(e.current.setState(O=>(n.debug(`Focusing on cell with id=${M} and field=${R}`),q({},O,{tabIndex:{cell:{id:M,field:R},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},focus:{cell:{id:M,field:R},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))),e.current.forceUpdate(),e.current.getRow(M)&&(E&&i(E,{}),e.current.publishEvent("cellFocusIn",e.current.getCellParams(M,R))))},[e,n,i]),c=m.useCallback((M,R={})=>{const E=_o(e);i(E,R),e.current.setState(O=>(n.debug(`Focusing on column header with colIndex=${M}`),q({},O,{tabIndex:{columnHeader:{field:M},columnHeaderFilter:null,cell:null,columnGroupHeader:null},focus:{columnHeader:{field:M},columnHeaderFilter:null,cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,i]),u=m.useCallback((M,R={})=>{const E=_o(e);i(E,R),e.current.setState(O=>(n.debug(`Focusing on column header filter with colIndex=${M}`),q({},O,{tabIndex:{columnHeader:null,columnHeaderFilter:{field:M},cell:null,columnGroupHeader:null},focus:{columnHeader:null,columnHeaderFilter:{field:M},cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,i]),f=m.useCallback((M,R,E={})=>{const O=_o(e);O&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(O.id,O.field),E),e.current.setState(A=>q({},A,{tabIndex:{columnGroupHeader:{field:M,depth:R},columnHeader:null,columnHeaderFilter:null,cell:null},focus:{columnGroupHeader:{field:M,depth:R},columnHeader:null,columnHeaderFilter:null,cell:null}})),e.current.forceUpdate()},[e]),h=m.useCallback(()=>tx(e),[e]),p=m.useCallback((M,R,E)=>{let O=e.current.getColumnIndex(R);const A=fr(e),N=Ea(e,{pagination:t.pagination,paginationMode:t.paginationMode}),F=Kd(e),L=[].concat(F.top||[],N.rows,F.bottom||[]);let D=L.findIndex(G=>G.id===M);E==="right"?O+=1:E==="left"?O-=1:D+=1,O>=A.length?(D+=1,D<L.length&&(O=0)):O<0&&(D-=1,D>=0&&(O=A.length-1)),D=as(D,0,L.length-1);const H=L[D];if(!H)return;const B=e.current.unstable_getCellColSpanInfo(H.id,O);B&&B.spannedByColSpan&&(E==="left"||E==="below"?O=B.leftVisibleCellIndex:E==="right"&&(O=B.rightVisibleCellIndex)),O=as(O,0,A.length-1);const V=A[O];e.current.setCellFocus(H.id,V.field)},[e,t.pagination,t.paginationMode]),g=m.useCallback(({id:M,field:R})=>{e.current.setCellFocus(M,R)},[e]),y=m.useCallback((M,R)=>{R.key==="Enter"||R.key==="Tab"||R.key==="Shift"||ix(R.key)||e.current.setCellFocus(M.id,M.field)},[e]),b=m.useCallback(({field:M},R)=>{R.target===R.currentTarget&&e.current.setColumnHeaderFocus(M,R)},[e]),v=m.useCallback(({fields:M,depth:R},E)=>{if(E.target!==E.currentTarget)return;const O=tx(e);O!==null&&O.depth===R&&M.includes(O.field)||e.current.setColumnGroupHeaderFocus(M[0],R,E)},[e]),C=m.useCallback((M,R)=>{var E,O;(O=(E=R.relatedTarget)==null?void 0:E.getAttribute("class"))!=null&&O.includes(te.columnHeader)||(n.debug("Clearing focus"),e.current.setState(A=>q({},A,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})))},[n,e]),S=m.useCallback(M=>{r.current=M},[]),j=m.useCallback(M=>{const R=r.current;r.current=null;const E=_o(e);if(!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:M,cell:R}))return;if(!E){R&&e.current.setCellFocus(R.id,R.field);return}if((R==null?void 0:R.id)===E.id&&(R==null?void 0:R.field)===E.field)return;const A=e.current.getCellElement(E.id,E.field);A!=null&&A.contains(M.target)||(R?e.current.setCellFocus(R.id,R.field):(e.current.setState(N=>q({},N,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})),e.current.forceUpdate(),i(E,M)))},[e,i]),w=m.useCallback(M=>{if(M.cellMode==="view")return;const R=_o(e);((R==null?void 0:R.id)!==M.id||(R==null?void 0:R.field)!==M.field)&&e.current.setCellFocus(M.id,M.field)},[e]),k=m.useCallback(()=>{const M=_o(e);if(M&&!e.current.getRow(M.id)){const R=M.id;let E=null;if(typeof R<"u"){const O=e.current.getRowElement(R),A=O!=null&&O.dataset.rowindex?Number(O==null?void 0:O.dataset.rowindex):0,N=Ea(e,{pagination:t.pagination,paginationMode:t.paginationMode}),F=N.rows[as(A,0,N.rows.length-1)];E=(F==null?void 0:F.id)??null}e.current.setState(O=>q({},O,{focus:{cell:E===null?null:{id:E,field:M.field},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))}},[e,t.pagination,t.paginationMode]),P=Vt(()=>{const M=_o(e);if(!M)return;const R=Ea(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(R.rows.find(A=>A.id===M.id))return;const O=fr(e);e.current.setState(A=>q({},A,{tabIndex:{cell:{id:R.rows[0].id,field:O[0].field},columnGroupHeader:null,columnHeader:null,columnHeaderFilter:null}}))}),T={setCellFocus:l,setColumnHeaderFocus:c,setColumnHeaderFilterFocus:u},$={moveFocusToRelativeCell:p,setColumnGroupHeaderFocus:f,getColumnGroupHeaderFocus:h};Gt(e,T,"public"),Gt(e,$,"private"),m.useEffect(()=>{const M=ir(e.current.rootElementRef.current);return M.addEventListener("mouseup",j),()=>{M.removeEventListener("mouseup",j)}},[e,o,j]),ot(e,"columnHeaderBlur",C),ot(e,"cellDoubleClick",g),ot(e,"cellMouseDown",S),ot(e,"cellKeyDown",y),ot(e,"cellModeChange",w),ot(e,"columnHeaderFocus",b),ot(e,"columnGroupHeaderFocus",v),ot(e,"rowsSet",k),ot(e,"paginationModelChange",P)},Gv=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:r})=>{if(r){if(e<n)return e+1}else if(!r&&e>t)return e-1;return null},Uv=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:r})=>{if(r){if(e>t)return e-1}else if(!r&&e<n)return e+1;return null};function Fee(e,t,n,r){var c,u;const o=A$(e);if(!((c=o[t])!=null&&c[n]))return t;const i=h$(e);let l=i.indexOf(t)+(r==="down"?1:-1);for(;l>=0&&l<i.length;){const f=i[l];if(!((u=o[f])!=null&&u[n]))return f;l+=r==="down"?1:-1}return t}const Nee=fn(kh,Kd,(e,t)=>(t.top||[]).concat(e.rows,t.bottom||[])),_ee=(e,t)=>{const n=Fr(e,"useGridKeyboardNavigation"),r=Yr(),o=t.unstable_listView,i=m.useCallback(()=>Nee(e),[e]),l=t.signature!=="DataGrid"&&t.headerFilters,c=m.useCallback((S,j,w="left",k="up")=>{const P=Ha(e),T=e.current.unstable_getCellColSpanInfo(j,S);T&&T.spannedByColSpan&&(w==="left"?S=T.leftVisibleCellIndex:w==="right"&&(S=T.rightVisibleCellIndex));const $=o?kd(e.current.state).field:Qd(e)[S],M=Fee(e,j,$,k),R=P.findIndex(E=>E.id===M);n.debug(`Navigating to cell row ${R}, col ${S}`),e.current.scrollToIndexes({colIndex:S,rowIndex:R}),e.current.setCellFocus(M,$)},[e,n,o]),u=m.useCallback((S,j)=>{n.debug(`Navigating to header col ${S}`),e.current.scrollToIndexes({colIndex:S});const w=e.current.getVisibleColumns()[S].field;e.current.setColumnHeaderFocus(w,j)},[e,n]),f=m.useCallback((S,j)=>{n.debug(`Navigating to header filter col ${S}`),e.current.scrollToIndexes({colIndex:S});const w=e.current.getVisibleColumns()[S].field;e.current.setColumnHeaderFilterFocus(w,j)},[e,n]),h=m.useCallback((S,j,w)=>{n.debug(`Navigating to header col ${S}`),e.current.scrollToIndexes({colIndex:S});const{field:k}=e.current.getVisibleColumns()[S];e.current.setColumnGroupHeaderFocus(k,j,w)},[e,n]),p=m.useCallback(S=>{var j;return(j=i()[S])==null?void 0:j.id},[i]),g=m.useCallback((S,j)=>{const w=j.currentTarget.querySelector(`.${te.columnHeaderTitleContainerContent}`);if(!!w&&w.contains(j.target)&&S.field!==Jd.field)return;const P=i(),T=e.current.getViewportPageSize(),$=S.field?e.current.getColumnIndex(S.field):0,M=P.length>0?0:null,R=P.length-1,E=0,O=fr(e).length-1,A=Eh(e);let N=!0;switch(j.key){case"ArrowDown":{l?f($,j):M!==null&&c($,p(M));break}case"ArrowRight":{const F=Uv({currentColIndex:$,firstColIndex:E,lastColIndex:O,isRtl:r});F!==null&&u(F,j);break}case"ArrowLeft":{const F=Gv({currentColIndex:$,firstColIndex:E,lastColIndex:O,isRtl:r});F!==null&&u(F,j);break}case"ArrowUp":{A>0&&h($,A-1,j);break}case"PageDown":{M!==null&&R!==null&&c($,p(Math.min(M+T,R)));break}case"Home":{u(E,j);break}case"End":{u(O,j);break}case"Enter":{(j.ctrlKey||j.metaKey)&&e.current.toggleColumnMenu(S.field);break}case" ":break;default:N=!1}N&&j.preventDefault()},[e,i,l,f,c,p,r,u,h]),y=m.useCallback((S,j)=>{const w=tQ(e)===S.field,k=nQ(e)===S.field;if(w||k||!ix(j.key))return;const P=i(),T=e.current.getViewportPageSize(),$=S.field?e.current.getColumnIndex(S.field):0,M=0,R=P.length-1,E=0,O=fr(e).length-1;let A=!0;switch(j.key){case"ArrowDown":{const N=p(M);N!=null&&c($,N);break}case"ArrowRight":{const N=Uv({currentColIndex:$,firstColIndex:E,lastColIndex:O,isRtl:r});N!==null&&f(N,j);break}case"ArrowLeft":{const N=Gv({currentColIndex:$,firstColIndex:E,lastColIndex:O,isRtl:r});N!==null?f(N,j):e.current.setColumnHeaderFilterFocus(S.field,j);break}case"ArrowUp":{u($,j);break}case"PageDown":{R!==null&&c($,p(Math.min(M+T,R)));break}case"Home":{f(E,j);break}case"End":{f(O,j);break}case" ":break;default:A=!1}A&&j.preventDefault()},[e,i,f,r,u,c,p]),b=m.useCallback((S,j)=>{const w=tx(e);if(w===null)return;const{field:k,depth:P}=w,{fields:T,depth:$,maxDepth:M}=S,R=i(),E=e.current.getViewportPageSize(),O=e.current.getColumnIndex(k),A=k?e.current.getColumnIndex(k):0,N=0,F=R.length-1,L=0,D=fr(e).length-1;let H=!0;switch(j.key){case"ArrowDown":{$===M-1?u(O,j):h(O,P+1,j);break}case"ArrowUp":{$>0&&h(O,P-1,j);break}case"ArrowRight":{const B=T.length-T.indexOf(k)-1;O+B+1<=D&&h(O+B+1,P,j);break}case"ArrowLeft":{const B=T.indexOf(k);O-B-1>=L&&h(O-B-1,P,j);break}case"PageDown":{F!==null&&c(A,p(Math.min(N+E,F)));break}case"Home":{h(L,P,j);break}case"End":{h(D,P,j);break}case" ":break;default:H=!1}H&&j.preventDefault()},[e,i,u,h,c,p]),v=m.useCallback((S,j)=>{if(Th(j))return;const w=e.current.getCellParams(S.id,S.field);if(w.cellMode===kn.Edit||!ix(j.key)||!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:j,cell:w}))return;const P=i();if(P.length===0)return;const T=e.current.getViewportPageSize(),$=o?()=>0:e.current.getColumnIndex,M=S.field?$(S.field):0,R=P.findIndex(D=>D.id===S.id),E=0,O=P.length-1,A=0,F=(o?[kd(e.current.state)]:fr(e)).length-1;let L=!0;switch(j.key){case"ArrowDown":{R<O&&c(M,p(R+1),r?"right":"left","down");break}case"ArrowUp":{R>E?c(M,p(R-1)):l?f(M,j):u(M,j);break}case"ArrowRight":{const D=Uv({currentColIndex:M,firstColIndex:A,lastColIndex:F,isRtl:r});D!==null&&c(D,p(R),r?"left":"right");break}case"ArrowLeft":{const D=Gv({currentColIndex:M,firstColIndex:A,lastColIndex:F,isRtl:r});D!==null&&c(D,p(R),r?"right":"left");break}case"Tab":{j.shiftKey&&M>A?c(M-1,p(R),"left"):!j.shiftKey&&M<F&&c(M+1,p(R),"right");break}case" ":{if(S.field===ey)break;const H=S.colDef;if(H&&(H.field===zq||kY(H.field)))break;!j.shiftKey&&R<O&&c(M,p(Math.min(R+T,O)));break}case"PageDown":{R<O&&c(M,p(Math.min(R+T,O)));break}case"PageUp":{const D=Math.max(R-T,E);D!==R&&D>=E?c(M,p(D)):u(M,j);break}case"Home":{j.ctrlKey||j.metaKey||j.shiftKey?c(A,p(E)):c(A,p(R));break}case"End":{j.ctrlKey||j.metaKey||j.shiftKey?c(F,p(O)):c(F,p(R));break}default:L=!1}L&&j.preventDefault()},[e,i,r,c,p,l,f,u,o]),C=m.useCallback((S,{event:j})=>j.key===" "?!1:S,[]);Jn(e,"canStartEditing",C),ot(e,"columnHeaderKeyDown",g),ot(e,"headerFilterKeyDown",y),ot(e,"columnGroupHeaderKeyDown",b),ot(e,"cellKeyDown",v)},Hee=(e,t)=>{var b,v;const n=Fr(e,"useGridRowCount"),r=He(e,Zw),o=He(e,Wu),i=He(e,fp),l=He(e,ho),c=Hs(()=>ho(e).pageSize);e.current.registerControlState({stateId:"paginationRowCount",propModel:t.rowCount,propOnChange:t.onRowCountChange,stateSelector:Wu,changeEvent:"rowCountChange"});const f={setRowCount:m.useCallback(C=>{o!==C&&(n.debug("Setting 'rowCount' to",C),e.current.setState(S=>q({},S,{pagination:q({},S.pagination,{rowCount:C})})))},[e,n,o])};Gt(e,f,"public");const h=m.useCallback((C,S)=>{var k,P;const j=Wu(e);return!S.exportOnlyDirtyModels||t.rowCount!=null||((P=(k=t.initialState)==null?void 0:k.pagination)==null?void 0:P.rowCount)!=null?q({},C,{pagination:q({},C.pagination,{rowCount:j})}):C},[e,t.rowCount,(v=(b=t.initialState)==null?void 0:b.pagination)==null?void 0:v.rowCount]),p=m.useCallback((C,S)=>{var w;const j=(w=S.stateToRestore.pagination)!=null&&w.rowCount?S.stateToRestore.pagination.rowCount:Wu(e);return e.current.setState(k=>q({},k,{pagination:q({},k.pagination,{rowCount:j})})),C},[e]);Jn(e,"exportState",h),Jn(e,"restoreState",p);const g=m.useCallback(C=>{t.paginationMode==="client"||!c.current||C.pageSize!==c.current&&(c.current=C.pageSize,o===-1&&e.current.setPage(0))},[t.paginationMode,c,o,e]);ot(e,"paginationModelChange",g),m.useEffect(()=>{t.paginationMode==="client"?e.current.setRowCount(r):t.rowCount!=null&&e.current.setRowCount(t.rowCount)},[e,t.paginationMode,r,t.rowCount]);const y=i.hasNextPage===!1;m.useEffect(()=>{y&&o===-1&&e.current.setRowCount(l.pageSize*l.page+r)},[e,r,y,o,l])},Bee=(e,t)=>{var u,f;const n=Fr(e,"useGridPaginationMeta"),r=He(e,fp);e.current.registerControlState({stateId:"paginationMeta",propModel:t.paginationMeta,propOnChange:t.onPaginationMetaChange,stateSelector:fp,changeEvent:"paginationMetaChange"});const i={setPaginationMeta:m.useCallback(h=>{r!==h&&(n.debug("Setting 'paginationMeta' to",h),e.current.setState(p=>q({},p,{pagination:q({},p.pagination,{meta:h})})))},[e,n,r])};Gt(e,i,"public");const l=m.useCallback((h,p)=>{var b,v;const g=fp(e);return!p.exportOnlyDirtyModels||t.paginationMeta!=null||((v=(b=t.initialState)==null?void 0:b.pagination)==null?void 0:v.meta)!=null?q({},h,{pagination:q({},h.pagination,{meta:g})}):h},[e,t.paginationMeta,(f=(u=t.initialState)==null?void 0:u.pagination)==null?void 0:f.meta]),c=m.useCallback((h,p)=>{var y;const g=(y=p.stateToRestore.pagination)!=null&&y.meta?p.stateToRestore.pagination.meta:fp(e);return e.current.setState(b=>q({},b,{pagination:q({},b.pagination,{meta:g})})),h},[e]);Jn(e,"exportState",l),Jn(e,"restoreState",c),m.useEffect(()=>{t.paginationMeta&&e.current.setPaginationMeta(t.paginationMeta)},[e,t.paginationMeta])},Wee=(e,t)=>{var i,l,c,u,f,h,p;const n=q({},C$(t.autoPageSize),t.paginationModel??((l=(i=t.initialState)==null?void 0:i.pagination)==null?void 0:l.paginationModel));w$(n.pageSize,t.signature);const r=t.rowCount??((u=(c=t.initialState)==null?void 0:c.pagination)==null?void 0:u.rowCount)??(t.paginationMode==="client"?(f=e.rows)==null?void 0:f.totalRowCount:void 0),o=t.paginationMeta??((p=(h=t.initialState)==null?void 0:h.pagination)==null?void 0:p.meta)??{};return q({},e,{pagination:q({},e.pagination,{paginationModel:n,rowCount:r,meta:o,enabled:t.pagination===!0,paginationMode:t.paginationMode})})},Vee=(e,t)=>{Bee(e,t),Pee(e,t),Hee(e,t)},Gee=(e,t)=>{var n;return q({},e,{preferencePanel:((n=t.initialState)==null?void 0:n.preferencePanel)??{open:!1}})},Uee=(e,t)=>{var c;const n=Fr(e,"useGridPreferencesPanel"),r=m.useCallback(()=>{e.current.setState(u=>{if(!u.preferencePanel.open)return u;n.debug("Hiding Preferences Panel");const f=Bp(u);return e.current.publishEvent("preferencePanelClose",{openedPanelValue:f.openedPanelValue}),q({},u,{preferencePanel:{open:!1}})})},[e,n]),o=m.useCallback((u,f,h)=>{n.debug("Opening Preferences Panel"),e.current.setState(p=>q({},p,{preferencePanel:q({},p.preferencePanel,{open:!0,openedPanelValue:u,panelId:f,labelId:h})})),e.current.publishEvent("preferencePanelOpen",{openedPanelValue:u})},[n,e]);Gt(e,{showPreferences:o,hidePreferences:r},"public");const i=m.useCallback((u,f)=>{var g;const h=Bp(e.current.state);return!f.exportOnlyDirtyModels||((g=t.initialState)==null?void 0:g.preferencePanel)!=null||h.open?q({},u,{preferencePanel:h}):u},[e,(c=t.initialState)==null?void 0:c.preferencePanel]),l=m.useCallback((u,f)=>{const h=f.stateToRestore.preferencePanel;return h!=null&&e.current.setState(p=>q({},p,{preferencePanel:h})),u},[e]);Jn(e,"exportState",i),Jn(e,"restoreState",l)},mC=e=>{switch(e.type){case"boolean":return!1;case"date":case"dateTime":case"number":return;case"singleSelect":return null;case"string":default:return""}},qee=["id","field"],Kee=["id","field"],Qee=(e,t)=>{const[n,r]=m.useState({}),o=m.useRef(n),i=m.useRef({}),{processRowUpdate:l,onProcessRowUpdateError:c,cellModesModel:u,onCellModesModelChange:f}=t,h=L=>(...D)=>{t.editMode===Fi.Cell&&L(...D)},p=m.useCallback((L,D)=>{const H=e.current.getCellParams(L,D);if(!e.current.isCellEditable(H))throw new Error(`MUI X: The cell with id=${L} and field=${D} is not editable.`)},[e]),g=m.useCallback((L,D,H)=>{if(e.current.getCellMode(L,D)!==H)throw new Error(`MUI X: The cell with id=${L} and field=${D} is not in ${H} mode.`)},[e]),y=m.useCallback((L,D)=>{if(!L.isEditable||L.cellMode===kn.Edit)return;const H=q({},L,{reason:nl.cellDoubleClick});e.current.publishEvent("cellEditStart",H,D)},[e]),b=m.useCallback((L,D)=>{if(L.cellMode===kn.View||e.current.getCellMode(L.id,L.field)===kn.View)return;const H=q({},L,{reason:Zs.cellFocusOut});e.current.publishEvent("cellEditStop",H,D)},[e]),v=m.useCallback((L,D)=>{if(L.cellMode===kn.Edit){if(D.which===229)return;let H;if(D.key==="Escape"?H=Zs.escapeKeyDown:D.key==="Enter"?H=Zs.enterKeyDown:D.key==="Tab"&&(H=D.shiftKey?Zs.shiftTabKeyDown:Zs.tabKeyDown,D.preventDefault()),H){const B=q({},L,{reason:H});e.current.publishEvent("cellEditStop",B,D)}}else if(L.isEditable){let H;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:D,cellParams:L,editMode:"cell"}))return;if(Z$(D)?H=nl.printableKeyDown:eO(D)?H=nl.pasteKeyDown:D.key==="Enter"?H=nl.enterKeyDown:(D.key==="Backspace"||D.key==="Delete")&&(H=nl.deleteKeyDown),H){const V=q({},L,{reason:H,key:D.key});e.current.publishEvent("cellEditStart",V,D)}}},[e]),C=m.useCallback(L=>{const{id:D,field:H,reason:B}=L,V={id:D,field:H};(B===nl.printableKeyDown||B===nl.deleteKeyDown||B===nl.pasteKeyDown)&&(V.deleteValue=!0),e.current.startCellEditMode(V)},[e]),S=m.useCallback(L=>{const{id:D,field:H,reason:B}=L;e.current.runPendingEditCellValueMutation(D,H);let V;B===Zs.enterKeyDown?V="below":B===Zs.tabKeyDown?V="right":B===Zs.shiftTabKeyDown&&(V="left");const G=B==="escapeKeyDown";e.current.stopCellEditMode({id:D,field:H,ignoreModifications:G,cellToFocusAfter:V})},[e]),j=L=>async(...D)=>{var H;if(L){const{id:B,field:V}=D[0];((H=e.current.state.editRows[B][V])==null?void 0:H.error)||L(...D)}};ot(e,"cellDoubleClick",h(y)),ot(e,"cellFocusOut",h(b)),ot(e,"cellKeyDown",h(v)),ot(e,"cellEditStart",h(C)),ot(e,"cellEditStop",h(S)),En(e,"cellEditStart",t.onCellEditStart),En(e,"cellEditStop",j(t.onCellEditStop));const w=m.useCallback((L,D)=>{const H=zr(e.current.state);return H[L]&&H[L][D]?kn.Edit:kn.View},[e]),k=Vt(L=>{const D=L!==t.cellModesModel;f&&D&&f(L,{api:e.current}),!(t.cellModesModel&&D)&&(r(L),o.current=L,e.current.publishEvent("cellModesModelChange",L))}),P=m.useCallback((L,D,H)=>{const B=q({},o.current);if(H!==null)B[L]=q({},B[L],{[D]:q({},H)});else{const V=B[L],G=St(V,[D].map(Vp));B[L]=G,Object.keys(B[L]).length===0&&delete B[L]}k(B)},[k]),T=m.useCallback((L,D,H)=>{e.current.setState(B=>{const V=q({},B.editRows);return H!==null?V[L]=q({},V[L],{[D]:q({},H)}):(delete V[L][D],Object.keys(V[L]).length===0&&delete V[L]),q({},B,{editRows:V})}),e.current.forceUpdate()},[e]),$=m.useCallback(L=>{const{id:D,field:H}=L,B=St(L,qee);p(D,H),g(D,H,kn.View),P(D,H,q({mode:kn.Edit},B))},[p,g,P]),M=Vt(async L=>{const{id:D,field:H,deleteValue:B,initialValue:V}=L,G=e.current.getCellValue(D,H);let _=G;B?_=mC(e.current.getColumn(H)):V&&(_=V);const U=e.current.getColumn(H),Z=!!U.preProcessEditCellProps&&B;let Q={value:_,error:!1,isProcessingProps:Z};if(T(D,H,Q),e.current.setCellFocus(D,H),Z&&(Q=await Promise.resolve(U.preProcessEditCellProps({id:D,row:e.current.getRow(D),props:Q,hasChanged:_!==G})),e.current.getCellMode(D,H)===kn.Edit)){const ee=zr(e.current.state);T(D,H,q({},Q,{value:ee[D][H].value,isProcessingProps:!1}))}}),R=m.useCallback(L=>{const{id:D,field:H}=L,B=St(L,Kee);g(D,H,kn.Edit),P(D,H,q({mode:kn.View},B))},[g,P]),E=Vt(async L=>{const{id:D,field:H,ignoreModifications:B,cellToFocusAfter:V="none"}=L;g(D,H,kn.Edit),e.current.runPendingEditCellValueMutation(D,H);const G=()=>{T(D,H,null),P(D,H,null),V!=="none"&&e.current.moveFocusToRelativeCell(D,H,V)};if(B){G();return}const _=zr(e.current.state),{error:U,isProcessingProps:Z}=_[D][H];if(U||Z){i.current[D][H].mode=kn.Edit,P(D,H,{mode:kn.Edit});return}const Q=e.current.getRowWithUpdatedValuesFromCellEditing(D,H);if(l){const ee=ne=>{i.current[D][H].mode=kn.Edit,P(D,H,{mode:kn.Edit}),c&&c(ne)};try{const ne=e.current.getRow(D);Promise.resolve(l(Q,ne,{rowId:D})).then(re=>{e.current.updateRows([re]),G()}).catch(ee)}catch(ne){ee(ne)}}else e.current.updateRows([Q]),G()}),O=m.useCallback(async L=>{var ne,re;const{id:D,field:H,value:B,debounceMs:V,unstable_skipValueParser:G}=L;p(D,H),g(D,H,kn.Edit);const _=e.current.getColumn(H),U=e.current.getRow(D);let Z=B;_.valueParser&&!G&&(Z=_.valueParser(B,U,_,e));let Q=zr(e.current.state),ee=q({},Q[D][H],{value:Z,changeReason:V?"debouncedSetEditCellValue":"setEditCellValue"});if(_.preProcessEditCellProps){const Y=B!==Q[D][H].value;ee=q({},ee,{isProcessingProps:!0}),T(D,H,ee),ee=await Promise.resolve(_.preProcessEditCellProps({id:D,row:U,props:ee,hasChanged:Y}))}return e.current.getCellMode(D,H)===kn.View?!1:(Q=zr(e.current.state),ee=q({},ee,{isProcessingProps:!1}),ee.value=_.preProcessEditCellProps?Q[D][H].value:Z,T(D,H,ee),Q=zr(e.current.state),!((re=(ne=Q[D])==null?void 0:ne[H])!=null&&re.error))},[e,p,g,T]),A=m.useCallback((L,D)=>{const H=e.current.getColumn(D),B=zr(e.current.state),V=e.current.getRow(L);if(!B[L]||!B[L][D])return e.current.getRow(L);const{value:G}=B[L][D];return H.valueSetter?H.valueSetter(G,V,H,e):q({},V,{[D]:G})},[e]),N={getCellMode:w,startCellEditMode:$,stopCellEditMode:R},F={setCellEditingEditCellValue:O,getRowWithUpdatedValuesFromCellEditing:A};Gt(e,N,"public"),Gt(e,F,"private"),m.useEffect(()=>{u&&k(u)},[u,k]),Ln(()=>{const L=Ts(e),D=i.current;i.current=QR(n),Object.entries(n).forEach(([H,B])=>{Object.entries(B).forEach(([V,G])=>{var Z,Q;const _=((Q=(Z=D[H])==null?void 0:Z[V])==null?void 0:Q.mode)||kn.View,U=L[H]?e.current.getRowId(L[H]):H;G.mode===kn.Edit&&_===kn.View?M(q({id:U,field:V},G)):G.mode===kn.View&&_===kn.Edit&&E(q({id:U,field:V},G))})})},[e,n,M,E])},Yee=["id"],Xee=["id"],Zee=(e,t)=>{const[n,r]=m.useState({}),o=m.useRef(n),i=m.useRef({}),l=m.useRef({}),c=m.useRef(void 0),u=m.useRef(null),{processRowUpdate:f,onProcessRowUpdateError:h,rowModesModel:p,onRowModesModelChange:g}=t,y=G=>(..._)=>{t.editMode===Fi.Row&&G(..._)},b=m.useCallback((G,_)=>{const U=e.current.getCellParams(G,_);if(!e.current.isCellEditable(U))throw new Error(`MUI X: The cell with id=${G} and field=${_} is not editable.`)},[e]),v=m.useCallback((G,_)=>{if(e.current.getRowMode(G)!==_)throw new Error(`MUI X: The row with id=${G} is not in ${_} mode.`)},[e]),C=m.useCallback(G=>{const _=zr(e.current.state);return Object.values(_[G]).some(U=>U.error)},[e]),S=m.useCallback((G,_)=>{if(!G.isEditable||e.current.getRowMode(G.id)===Mn.Edit)return;const U=e.current.getRowParams(G.id),Z=q({},U,{field:G.field,reason:ta.cellDoubleClick});e.current.publishEvent("rowEditStart",Z,_)},[e]),j=m.useCallback(G=>{u.current=G},[]),w=m.useCallback((G,_)=>{G.isEditable&&e.current.getRowMode(G.id)!==Mn.View&&(u.current=null,c.current=setTimeout(()=>{var U;if(((U=u.current)==null?void 0:U.id)!==G.id){if(!e.current.getRow(G.id)||e.current.getRowMode(G.id)===Mn.View||C(G.id))return;const Z=e.current.getRowParams(G.id),Q=q({},Z,{field:G.field,reason:Ci.rowFocusOut});e.current.publishEvent("rowEditStop",Q,_)}}))},[e,C]);m.useEffect(()=>()=>{clearTimeout(c.current)},[]);const k=m.useCallback((G,_)=>{if(G.cellMode===Mn.Edit){if(_.which===229)return;let U;if(_.key==="Escape")U=Ci.escapeKeyDown;else if(_.key==="Enter")U=Ci.enterKeyDown;else if(_.key==="Tab"){const Z=Qd(e).filter(Q=>e.current.getColumn(Q).type===Zx?!0:e.current.isCellEditable(e.current.getCellParams(G.id,Q)));if(_.shiftKey?G.field===Z[0]&&(U=Ci.shiftTabKeyDown):G.field===Z[Z.length-1]&&(U=Ci.tabKeyDown),_.preventDefault(),!U){const Q=Z.findIndex(ne=>ne===G.field),ee=Z[_.shiftKey?Q-1:Q+1];e.current.setCellFocus(G.id,ee)}}if(U){if(U!==Ci.escapeKeyDown&&C(G.id))return;const Z=q({},e.current.getRowParams(G.id),{reason:U,field:G.field});e.current.publishEvent("rowEditStop",Z,_)}}else if(G.isEditable){let U;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:_,cellParams:G,editMode:"row"}))return;if(Z$(_)||eO(_)?U=ta.printableKeyDown:_.key==="Enter"?U=ta.enterKeyDown:(_.key==="Backspace"||_.key==="Delete")&&(U=ta.deleteKeyDown),U){const Q=e.current.getRowParams(G.id),ee=q({},Q,{field:G.field,reason:U});e.current.publishEvent("rowEditStart",ee,_)}}},[e,C]),P=m.useCallback(G=>{const{id:_,field:U,reason:Z}=G,Q={id:_,fieldToFocus:U};(Z===ta.printableKeyDown||Z===ta.deleteKeyDown)&&(Q.deleteValue=!!U),e.current.startRowEditMode(Q)},[e]),T=m.useCallback(G=>{const{id:_,reason:U,field:Z}=G;e.current.runPendingEditCellValueMutation(_);let Q;U===Ci.enterKeyDown?Q="below":U===Ci.tabKeyDown?Q="right":U===Ci.shiftTabKeyDown&&(Q="left");const ee=U==="escapeKeyDown";e.current.stopRowEditMode({id:_,ignoreModifications:ee,field:Z,cellToFocusAfter:Q})},[e]);ot(e,"cellDoubleClick",y(S)),ot(e,"cellFocusIn",y(j)),ot(e,"cellFocusOut",y(w)),ot(e,"cellKeyDown",y(k)),ot(e,"rowEditStart",y(P)),ot(e,"rowEditStop",y(T)),En(e,"rowEditStart",t.onRowEditStart),En(e,"rowEditStop",t.onRowEditStop);const $=m.useCallback(G=>W$(e,{rowId:G,editMode:t.editMode})?Mn.Edit:Mn.View,[e,t.editMode]),M=Vt(G=>{const _=G!==t.rowModesModel;g&&_&&g(G,{api:e.current}),!(t.rowModesModel&&_)&&(r(G),o.current=G,e.current.publishEvent("rowModesModelChange",G))}),R=m.useCallback((G,_)=>{const U=q({},o.current);_!==null?U[G]=q({},_):delete U[G],M(U)},[M]),E=m.useCallback((G,_)=>{e.current.setState(U=>{const Z=q({},U.editRows);return _!==null?Z[G]=_:delete Z[G],q({},U,{editRows:Z})}),e.current.forceUpdate()},[e]),O=m.useCallback((G,_,U)=>{e.current.setState(Z=>{const Q=q({},Z.editRows);return U!==null?Q[G]=q({},Q[G],{[_]:q({},U)}):(delete Q[G][_],Object.keys(Q[G]).length===0&&delete Q[G]),q({},Z,{editRows:Q})}),e.current.forceUpdate()},[e]),A=m.useCallback(G=>{const{id:_}=G,U=St(G,Yee);v(_,Mn.View),R(_,q({mode:Mn.Edit},U))},[v,R]),N=Vt(G=>{const{id:_,fieldToFocus:U,deleteValue:Z,initialValue:Q}=G,ee=e.current.getRow(_),ne=Ls(e),re=ne.reduce((Y,ie)=>{const ce=ie.field;if(!e.current.getCellParams(_,ce).isEditable)return Y;const de=e.current.getColumn(ce);let le=e.current.getCellValue(_,ce);return U===ce&&(Z||Q)&&(Z?le=mC(de):Q&&(le=Q)),Y[ce]={value:le,error:!1,isProcessingProps:de.editable&&!!de.preProcessEditCellProps&&Z},Y},{});l.current[_]=ee,E(_,re),U&&e.current.setCellFocus(_,U),ne.filter(Y=>e.current.getCellParams(_,Y.field).isEditable&&Y.editable&&!!Y.preProcessEditCellProps&&Z).forEach(Y=>{const ie=Y.field,ce=e.current.getCellValue(_,ie),he=Z?mC(Y):Q??ce;Promise.resolve(Y.preProcessEditCellProps({id:_,row:ee,props:re[ie],hasChanged:he!==ce})).then(de=>{if(e.current.getRowMode(_)===Mn.Edit){const le=zr(e.current.state);O(_,ie,q({},de,{value:le[_][ie].value,isProcessingProps:!1}))}})})}),F=m.useCallback(G=>{const{id:_}=G,U=St(G,Xee);v(_,Mn.Edit),R(_,q({mode:Mn.View},U))},[v,R]),L=Vt(G=>{const{id:_,ignoreModifications:U,field:Z,cellToFocusAfter:Q="none"}=G;e.current.runPendingEditCellValueMutation(_);const ee=()=>{Q!=="none"&&Z&&e.current.moveFocusToRelativeCell(_,Z,Q),E(_,null),R(_,null),delete l.current[_]};if(U){ee();return}const ne=zr(e.current.state),re=l.current[_];if(Object.values(ne[_]).some(ce=>ce.isProcessingProps)){i.current[_].mode=Mn.Edit;return}if(C(_)){i.current[_].mode=Mn.Edit,R(_,{mode:Mn.Edit});return}const ie=e.current.getRowWithUpdatedValuesFromRowEditing(_);if(f){const ce=he=>{i.current[_]&&(i.current[_].mode=Mn.Edit,R(_,{mode:Mn.Edit})),h&&h(he)};try{Promise.resolve(f(ie,re,{rowId:_})).then(he=>{e.current.updateRows([he]),ee()}).catch(ce)}catch(he){ce(he)}}else e.current.updateRows([ie]),ee()}),D=m.useCallback(G=>{const{id:_,field:U,value:Z,debounceMs:Q,unstable_skipValueParser:ee}=G;b(_,U);const ne=e.current.getColumn(U),re=e.current.getRow(_);let Y=Z;ne.valueParser&&!ee&&(Y=ne.valueParser(Z,re,ne,e));let ie=zr(e.current.state),ce=q({},ie[_][U],{value:Y,changeReason:Q?"debouncedSetEditCellValue":"setEditCellValue"});return ne.preProcessEditCellProps||O(_,U,ce),new Promise(he=>{const de=[];if(ne.preProcessEditCellProps){const le=ce.value!==ie[_][U].value;ce=q({},ce,{isProcessingProps:!0}),O(_,U,ce);const ge=ie[_],Se=St(ge,[U].map(Vp)),ke=Promise.resolve(ne.preProcessEditCellProps({id:_,row:re,props:ce,hasChanged:le,otherFieldsProps:Se})).then(we=>{if(e.current.getRowMode(_)===Mn.View){he(!1);return}ie=zr(e.current.state),we=q({},we,{isProcessingProps:!1}),we.value=ne.preProcessEditCellProps?ie[_][U].value:Y,O(_,U,we)});de.push(ke)}Object.entries(ie[_]).forEach(([le,ge])=>{if(le===U)return;const Se=e.current.getColumn(le);if(!Se.preProcessEditCellProps)return;ge=q({},ge,{isProcessingProps:!0}),O(_,le,ge),ie=zr(e.current.state);const ke=ie[_],we=St(ke,[le].map(Vp)),Oe=Promise.resolve(Se.preProcessEditCellProps({id:_,row:re,props:ge,hasChanged:!1,otherFieldsProps:we})).then(be=>{if(e.current.getRowMode(_)===Mn.View){he(!1);return}be=q({},be,{isProcessingProps:!1}),O(_,le,be)});de.push(Oe)}),Promise.all(de).then(()=>{e.current.getRowMode(_)===Mn.Edit?(ie=zr(e.current.state),he(!ie[_][U].error)):he(!1)})})},[e,b,O]),H=m.useCallback(G=>{const _=zr(e.current.state),U=e.current.getRow(G);if(!_[G])return e.current.getRow(G);let Z=q({},l.current[G],U);return Object.entries(_[G]).forEach(([Q,ee])=>{const ne=e.current.getColumn(Q);ne!=null&&ne.valueSetter?Z=ne.valueSetter(ee.value,Z,ne,e):Z[Q]=ee.value}),Z},[e]),B={getRowMode:$,startRowEditMode:A,stopRowEditMode:F},V={setRowEditingEditCellValue:D,getRowWithUpdatedValuesFromRowEditing:H};Gt(e,B,"public"),Gt(e,V,"private"),m.useEffect(()=>{p&&M(p)},[p,M]),Ln(()=>{const G=Ts(e),_=i.current;i.current=QR(n);const U=new Set([...Object.keys(n),...Object.keys(_)]);Array.from(U).forEach(Z=>{var re;const Q=n[Z]??{mode:Mn.View},ee=((re=_[Z])==null?void 0:re.mode)||Mn.View,ne=G[Z]?e.current.getRowId(G[Z]):Z;Q.mode===Mn.Edit&&ee===Mn.View?N(q({id:ne},Q)):Q.mode===Mn.View&&ee===Mn.Edit&&L(q({id:ne},Q))})},[e,n,N,L])},Jee=e=>q({},e,{editRows:{}}),ete=(e,t)=>{Qee(e,t),Zee(e,t);const n=m.useRef({}),{isCellEditable:r}=t,o=m.useCallback(g=>Sd(g.rowNode)||!g.colDef.editable||!g.colDef.renderEditCell?!1:r?r(g):!0,[r]),i=(g,y,b,v)=>{if(!b){v();return}if(n.current[g]||(n.current[g]={}),n.current[g][y]){const[j]=n.current[g][y];clearTimeout(j)}const C=()=>{const[j]=n.current[g][y];clearTimeout(j),v(),delete n.current[g][y]},S=setTimeout(()=>{v(),delete n.current[g][y]},b);n.current[g][y]=[S,C]};m.useEffect(()=>{const g=n.current;return()=>{Object.entries(g).forEach(([y,b])=>{Object.keys(b).forEach(v=>{const[C]=g[y][v];clearTimeout(C),delete g[y][v]})})}},[]);const l=m.useCallback((g,y)=>{if(n.current[g]){if(!y)Object.keys(n.current[g]).forEach(b=>{const[,v]=n.current[g][b];v()});else if(n.current[g][y]){const[,b]=n.current[g][y];b()}}},[]),c=m.useCallback(g=>{const{id:y,field:b,debounceMs:v}=g;return new Promise(C=>{i(y,b,v,async()=>{const S=t.editMode===Fi.Row?e.current.setRowEditingEditCellValue:e.current.setCellEditingEditCellValue;if(e.current.getCellMode(y,b)===kn.Edit){const j=await S(g);C(j)}})})},[e,t.editMode]),u=m.useCallback((g,y)=>t.editMode===Fi.Cell?e.current.getRowWithUpdatedValuesFromCellEditing(g,y):e.current.getRowWithUpdatedValuesFromRowEditing(g),[e,t.editMode]),f=m.useCallback((g,y)=>{var v;return((v=zr(e.current.state)[g])==null?void 0:v[y])??null},[e]),h={isCellEditable:o,setEditCellValue:c,getRowWithUpdatedValues:u,unstable_getEditCellMeta:f},p={runPendingEditCellValueMutation:l};Gt(e,h,"public"),Gt(e,p,"private")},tte=(e,t,n)=>{const r=!!t.unstable_dataSource;return n.current.caches.rows=Tg({rows:r?[]:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),q({},e,{rows:l$({apiRef:n,rowCountProp:t.rowCount,loadingProp:r?!0:t.loading,previousTree:null,previousTreeDepths:null})})},nte=(e,t)=>{const n=Fr(e,"useGridRows"),r=m.useRef(Date.now()),o=m.useRef(t.rowCount),i=Po(),l=m.useCallback(L=>{const D=Ts(e)[L];if(D)return D;const H=e.current.getRowNode(L);return H&&Sd(H)?{[wd]:L}:null},[e]),c=m.useCallback(L=>Ih(e.current.state,L),[e]),u=m.useCallback(({cache:L,throttle:D})=>{const H=()=>{r.current=Date.now(),e.current.setState(V=>q({},V,{rows:l$({apiRef:e,rowCountProp:t.rowCount,loadingProp:t.loading,previousTree:Pr(e),previousTreeDepths:PI(e),previousGroupsToFetch:Y7(e)})})),e.current.publishEvent("rowsSet"),e.current.forceUpdate()};if(i.clear(),e.current.caches.rows=L,!D){H();return}const B=t.throttleRowsMs-(Date.now()-r.current);if(B>0){i.start(B,H);return}H()},[t.throttleRowsMs,t.rowCount,t.loading,e,i]),f=m.useCallback(L=>{n.debug(`Updating all rows, new length ${L.length}`);const D=Tg({rows:L,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),H=e.current.caches.rows;D.rowsBeforePartialUpdates=H.rowsBeforePartialUpdates,u({cache:D,throttle:!0})},[n,t.getRowId,t.loading,t.rowCount,u,e]),h=m.useCallback(L=>{if(t.signature===zs.DataGrid&&L.length>1)throw new Error(["MUI X: You cannot update several rows at once in `apiRef.current.updateRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(`
|
|
336
|
+
`));const D=NI(e,L,t.getRowId),H=FI({updates:D,getRowId:t.getRowId,previousCache:e.current.caches.rows});u({cache:H,throttle:!0})},[t.signature,t.getRowId,u,e]),p=m.useCallback((L,D)=>{const H=NI(e,L,t.getRowId),B=FI({updates:H,getRowId:t.getRowId,previousCache:e.current.caches.rows,groupKeys:D??[]});u({cache:B,throttle:!1})},[t.getRowId,u,e]),g=m.useCallback(L=>{L!==t.loading&&(n.debug(`Setting loading to ${L}`),e.current.setState(D=>q({},D,{rows:q({},D.rows,{loading:L})})),e.current.caches.rows.loadingPropBeforePartialUpdates=L)},[t.loading,e,n]),y=m.useCallback(()=>{const L=dp(e),D=Ts(e);return new Map(L.map(H=>[H,D[H]??{}]))},[e]),b=m.useCallback(()=>wh(e),[e]),v=m.useCallback(()=>dp(e),[e]),C=m.useCallback(L=>{const D=e.current.getRow(L),{rowToIndexMap:H}=Ea(e);return H.get(D)},[e]),S=m.useCallback((L,D)=>{const H=e.current.getRowNode(L);if(!H)throw new Error(`MUI X: No row with id #${L} found.`);if(H.type!=="group")throw new Error("MUI X: Only group nodes can be expanded or collapsed.");const B=q({},H,{childrenExpanded:D});e.current.setState(V=>q({},V,{rows:q({},V.rows,{tree:q({},V.rows.tree,{[L]:B})})})),e.current.forceUpdate(),e.current.publishEvent("rowExpansionChange",B)},[e]),j=m.useCallback(L=>Pr(e)[L]??null,[e]),w=m.useCallback(({skipAutoGeneratedRows:L=!0,groupId:D,applySorting:H,applyFiltering:B})=>{const V=Pr(e);let G;if(H){const _=V[D];if(!_)return[];const U=Xd(e);G=[];const Z=U.findIndex(Q=>Q===D)+1;for(let Q=Z;Q<U.length&&V[U[Q]].depth>_.depth;Q+=1){const ee=U[Q];(!L||!Sd(V[ee]))&&G.push(ee)}}else G=Qw(V,D,L);if(B){const _=Zd(e);G=G.filter(U=>_[U]!==!1)}return G},[e]),k=m.useCallback((L,D)=>{const H=e.current.getRowNode(L);if(!H)throw new Error(`MUI X: No row with id #${L} found.`);if(H.parent!==ro)throw new Error("MUI X: The row reordering do not support reordering of grouped rows yet.");if(H.type!=="leaf")throw new Error("MUI X: The row reordering do not support reordering of footer or grouping rows.");e.current.setState(B=>{const V=Pr(B,e.current.instanceId)[ro],G=V.children,_=G.findIndex(Z=>Z===L);if(_===-1||_===D)return B;n.debug(`Moving row ${L} to index ${D}`);const U=[...G];return U.splice(D,0,U.splice(_,1)[0]),q({},B,{rows:q({},B.rows,{tree:q({},B.rows.tree,{[ro]:q({},V,{children:U})})})})}),e.current.publishEvent("rowsSet")},[e,n]),P=m.useCallback((L,D)=>{if(t.signature===zs.DataGrid&&D.length>1)throw new Error(["MUI X: You cannot replace rows using `apiRef.current.unstable_replaceRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(`
|
|
337
|
+
`));if(D.length===0)return;if(Kc(e)>1)throw new Error("`apiRef.current.unstable_replaceRows` is not compatible with tree data and row grouping");const B=q({},Pr(e)),V=q({},Ts(e)),G=q({},EI(e)),_=B[ro],U=[..._.children],Z=new Set;for(let ee=0;ee<D.length;ee+=1){const ne=D[ee],re=Jx(ne,t.getRowId,"A row was provided without id when calling replaceRows()."),[Y]=U.splice(L+ee,1,re);Z.has(Y)||(delete V[Y],delete G[Y],delete B[Y]);const ie={id:re,depth:0,parent:ro,type:"leaf",groupingKey:null};V[re]=ne,G[re]=re,B[re]=ie,Z.add(re)}B[ro]=q({},_,{children:U});const Q=U.filter(ee=>{var ne;return((ne=B[ee])==null?void 0:ne.type)==="leaf"});e.current.caches.rows.dataRowIdToModelLookup=V,e.current.caches.rows.dataRowIdToIdLookup=G,e.current.setState(ee=>q({},ee,{rows:q({},ee.rows,{dataRowIdToModelLookup:V,dataRowIdToIdLookup:G,dataRowIds:Q,tree:B})})),e.current.publishEvent("rowsSet")},[e,t.signature,t.getRowId]),T={getRow:l,setLoading:g,getRowId:c,getRowModels:y,getRowsCount:b,getAllRowIds:v,setRows:f,updateRows:h,getRowNode:j,getRowIndexRelativeToVisibleRows:C,unstable_replaceRows:P},$={setRowIndex:k,setRowChildrenExpansion:S,getRowGroupChildren:w},M={updateServerRows:p},R=m.useCallback(()=>{n.info("Row grouping pre-processing have changed, regenerating the row tree");let L;e.current.caches.rows.rowsBeforePartialUpdates===t.rows?L=q({},e.current.caches.rows,{updates:{type:"full",rows:dp(e)}}):L=Tg({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),u({cache:L,throttle:!1})},[n,e,t.rows,t.getRowId,t.loading,t.rowCount,u]),E=Hs(()=>t.unstable_dataSource),O=m.useCallback(L=>{if(t.unstable_dataSource&&t.unstable_dataSource!==E.current){E.current=t.unstable_dataSource;return}L==="rowTreeCreation"&&R()},[R,E,t.unstable_dataSource]),A=m.useCallback(()=>{e.current.getActiveStrategy("rowTree")!==X7(e)&&R()},[e,R]);ot(e,"activeStrategyProcessorChange",O),ot(e,"strategyAvailabilityChange",A);const N=m.useCallback(()=>{e.current.setState(L=>{const D=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:Pr(L,e.current.instanceId),treeDepths:PI(L,e.current.instanceId),dataRowIds:dp(L,e.current.instanceId),dataRowIdToModelLookup:Ts(L,e.current.instanceId),dataRowIdToIdLookup:EI(L,e.current.instanceId)});return q({},L,{rows:q({},L.rows,D,{totalTopLevelRowCount:i$({tree:D.tree,rowCountProp:t.rowCount})})})}),e.current.publishEvent("rowsSet"),e.current.forceUpdate()},[e,t.rowCount]);dS(e,"hydrateRows",N),Gt(e,T,"public"),Gt(e,$,t.signature===zs.DataGrid?"private":"public"),Gt(e,M,"private");const F=m.useRef(!0);m.useEffect(()=>{var V;if(F.current){F.current=!1;return}let L=!1;t.rowCount!==o.current&&(L=!0,o.current=t.rowCount);const D=e.current.caches.rows.rowsBeforePartialUpdates===t.rows,H=e.current.caches.rows.loadingPropBeforePartialUpdates===t.loading,B=e.current.caches.rows.rowCountPropBeforePartialUpdates===t.rowCount;D&&(H||(e.current.setState(G=>q({},G,{rows:q({},G.rows,{loading:t.loading})})),e.current.caches.rows.loadingPropBeforePartialUpdates=t.loading,e.current.forceUpdate()),B||(e.current.setState(G=>q({},G,{rows:q({},G.rows,{totalRowCount:Math.max(t.rowCount||0,G.rows.totalRowCount),totalTopLevelRowCount:Math.max(t.rowCount||0,G.rows.totalTopLevelRowCount)})})),e.current.caches.rows.rowCountPropBeforePartialUpdates=t.rowCount,e.current.forceUpdate()),!L)||(n.debug(`Updating all rows, new length ${(V=t.rows)==null?void 0:V.length}`),u({cache:Tg({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),throttle:!1}))},[t.rows,t.rowCount,t.getRowId,t.loading,n,u,e])},rte=e=>{const t={[ro]:q({},$q(),{children:e})};for(let n=0;n<e.length;n+=1){const r=e[n];t[r]={id:r,depth:0,parent:ro,type:"leaf",groupingKey:null}}return{groupingName:Hc,tree:t,treeDepths:{0:e.length},dataRowIds:e}},ote=({previousTree:e,actions:t})=>{const n=q({},e),r={};for(let l=0;l<t.remove.length;l+=1){const c=t.remove[l];r[c]=!0,delete n[c]}for(let l=0;l<t.insert.length;l+=1){const c=t.insert[l];n[c]={id:c,depth:0,parent:ro,type:"leaf",groupingKey:null}}const o=n[ro];let i=[...o.children,...t.insert];return Object.values(r).length&&(i=i.filter(l=>!r[l])),n[ro]=q({},o,{children:i}),{groupingName:Hc,tree:n,treeDepths:{0:i.length},dataRowIds:i}},ste=e=>e.updates.type==="full"?rte(e.updates.rows):ote({previousTree:e.previousTree,actions:e.updates.actions}),ite=e=>{cx(e,Hc,"rowTreeCreation",ste)};class qv extends Error{}function lte(e,t){var b;const n=m.useCallback(v=>({field:v,colDef:e.current.getColumn(v)}),[e]),r=m.useCallback(v=>{const C=e.current.getRow(v);if(!C)throw new qv(`No row with id #${v} found`);return{id:v,columns:e.current.getAllColumns(),row:C}},[e]),o=m.useCallback((v,C,S,{cellMode:j,colDef:w,hasFocus:k,rowNode:P,tabIndex:T})=>{const $=S[C],M=w!=null&&w.valueGetter?w.valueGetter($,S,w,e):$,R={id:v,field:C,row:S,rowNode:P,colDef:w,cellMode:j,hasFocus:k,tabIndex:T,value:M,formattedValue:M,isEditable:!1,api:e.current};return w&&w.valueFormatter&&(R.formattedValue=w.valueFormatter(M,S,w,e)),R.isEditable=w&&e.current.isCellEditable(R),R},[e]),i=m.useCallback((v,C)=>{var T;const S=e.current.getRow(v),j=e.current.getRowNode(v);if(!S||!j)throw new qv(`No row with id #${v} found`);const w=_o(e),k=eS(e),P=e.current.getCellMode(v,C);return e.current.getCellParamsForRow(v,C,S,{colDef:t.unstable_listView&&((T=t.unstable_listColumn)==null?void 0:T.field)===C?kd(e.current.state):e.current.getColumn(C),rowNode:j,hasFocus:w!==null&&w.field===C&&w.id===v,tabIndex:k&&k.field===C&&k.id===v?0:-1,cellMode:P})},[e,t.unstable_listView,(b=t.unstable_listColumn)==null?void 0:b.field]),l=m.useCallback((v,C)=>{const S=e.current.getColumn(C),j=e.current.getRow(v);if(!j)throw new qv(`No row with id #${v} found`);return!S||!S.valueGetter?j[C]:S.valueGetter(j[S.field],j,S,e)},[e]),c=m.useCallback((v,C)=>{const S=C.field;if(!C||!C.valueGetter)return v[S];const j=v[C.field];return C.valueGetter(j,v,C,e)},[e]),u=m.useCallback((v,C)=>{const S=c(v,C);return!C||!C.valueFormatter?S:C.valueFormatter(S,v,C,e)},[e,c]),f=m.useCallback(v=>e.current.rootElementRef.current?pX(e.current.rootElementRef.current,v):null,[e]),h=m.useCallback(v=>e.current.rootElementRef.current?hX(e.current.rootElementRef.current,v):null,[e]),p=m.useCallback((v,C)=>e.current.rootElementRef.current?mX(e.current.rootElementRef.current,{id:v,field:C}):null,[e]),g={getCellValue:l,getCellParams:i,getCellElement:p,getRowValue:c,getRowFormattedValue:u,getRowParams:r,getRowElement:h,getColumnHeaderParams:n,getColumnHeaderElement:f},y={getCellParamsForRow:o};Gt(e,g,"public"),Gt(e,y,"private")}const iO=(e,t)=>e==null||Array.isArray(e)?e:t&&t[0]===e?t:[e],ate=(e,t)=>q({},e,{rowSelection:t.rowSelection?iO(t.rowSelectionModel)??[]:[]}),cte=(e,t)=>{var B,V,G,_,U,Z,Q,ee,ne;const n=Fr(e,"useGridSelection"),r=m.useCallback(re=>(...Y)=>{t.rowSelection&&re(...Y)},[t.rowSelection]),o=t.signature!==zs.DataGrid&&(((B=t.rowSelectionPropagation)==null?void 0:B.parents)||((V=t.rowSelectionPropagation)==null?void 0:V.descendants)),i=m.useMemo(()=>iO(t.rowSelectionModel,ns(e.current.state)),[e,t.rowSelectionModel]),l=m.useRef(null);e.current.registerControlState({stateId:"rowSelection",propModel:i,propOnChange:t.onRowSelectionModelChange,stateSelector:ns,changeEvent:"rowSelectionChange"});const{checkboxSelection:c,disableRowSelectionOnClick:u,isRowSelectable:f}=t,h=Jw(t),p=He(e,Pr),g=He(e,Kc)>1,y=m.useCallback(re=>{let Y=re;const ie=l.current??re,ce=e.current.isRowSelected(re);if(ce){const he=Xu(e),de=he.findIndex(ge=>ge===ie),le=he.findIndex(ge=>ge===Y);if(de===le)return;de>le?Y=he[le+1]:Y=he[le-1]}l.current=re,e.current.selectRowRange({startId:ie,endId:Y},!ce)},[e]),b=m.useCallback(re=>{if(t.signature===zs.DataGrid&&!h&&Array.isArray(re)&&re.length>1)throw new Error(["MUI X: `rowSelectionModel` can only contain 1 item in DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock multiple selection."].join(`
|
|
338
|
+
`));ns(e.current.state)!==re&&(n.debug("Setting selection model"),e.current.setState(ie=>q({},ie,{rowSelection:t.rowSelection?re:[]})),e.current.forceUpdate())},[e,n,t.rowSelection,t.signature,h]),v=m.useCallback(re=>ns(e.current.state).includes(re),[e]),C=m.useCallback(re=>{if(t.rowSelection===!1||f&&!f(e.current.getRowParams(re)))return!1;const Y=Pr(e)[re];return!((Y==null?void 0:Y.type)==="footer"||(Y==null?void 0:Y.type)==="pinnedRow")},[e,t.rowSelection,f]),S=m.useCallback(()=>nK(e),[e]),j=m.useCallback((re,Y=!0,ie=!1)=>{var ce,he,de,le,ge,Se;if(e.current.isRowSelectable(re))if(l.current=re,ie){n.debug(`Setting selection for row ${re}`);const ke=[],we=Oe=>{ke.push(Oe)};Y&&(we(re),o&&Yf(e,p,re,((ce=t.rowSelectionPropagation)==null?void 0:ce.descendants)??!1,((he=t.rowSelectionPropagation)==null?void 0:he.parents)??!1,we)),e.current.setRowSelectionModel(ke)}else{n.debug(`Toggling selection for row ${re}`);const ke=ns(e.current.state),we=new Set(ke);we.delete(re);const Oe=Ve=>{we.add(Ve)},be=Ve=>{we.delete(Ve)};Y?(Oe(re),o&&Yf(e,p,re,((de=t.rowSelectionPropagation)==null?void 0:de.descendants)??!1,((le=t.rowSelectionPropagation)==null?void 0:le.parents)??!1,Oe)):o&&_I(e,p,re,((ge=t.rowSelectionPropagation)==null?void 0:ge.descendants)??!1,((Se=t.rowSelectionPropagation)==null?void 0:Se.parents)??!1,be),(we.size<2||h)&&e.current.setRowSelectionModel(Array.from(we))}},[e,n,o,p,(G=t.rowSelectionPropagation)==null?void 0:G.descendants,(_=t.rowSelectionPropagation)==null?void 0:_.parents,h]),w=m.useCallback((re,Y=!0,ie=!1)=>{n.debug("Setting selection for several rows");const ce=re.filter(le=>e.current.isRowSelectable(le));let he;if(ie){if(Y){if(he=new Set(ce),o){const ge=Se=>{he.add(Se)};ce.forEach(Se=>{var ke,we;Yf(e,p,Se,((ke=t.rowSelectionPropagation)==null?void 0:ke.descendants)??!1,((we=t.rowSelectionPropagation)==null?void 0:we.parents)??!1,ge)})}}else he=new Set;const le=Ia(e);if(he.size===Object.keys(le).length&&Array.from(he).every(ge=>le[ge]===ge))return}else{he=new Set(Object.values(Ia(e)));const le=Se=>{he.add(Se)},ge=Se=>{he.delete(Se)};ce.forEach(Se=>{var ke,we,Oe,be;Y?(he.add(Se),o&&Yf(e,p,Se,((ke=t.rowSelectionPropagation)==null?void 0:ke.descendants)??!1,((we=t.rowSelectionPropagation)==null?void 0:we.parents)??!1,le)):(ge(Se),o&&_I(e,p,Se,((Oe=t.rowSelectionPropagation)==null?void 0:Oe.descendants)??!1,((be=t.rowSelectionPropagation)==null?void 0:be.parents)??!1,ge))})}(he.size<2||h)&&e.current.setRowSelectionModel(Array.from(he))},[n,o,h,e,p,(U=t.rowSelectionPropagation)==null?void 0:U.descendants,(Z=t.rowSelectionPropagation)==null?void 0:Z.parents]),k=m.useCallback(re=>{var ce,he;if(!g||!o||re.length===0)return re;const Y=new Set(re),ie=de=>{Y.add(de)};for(const de of re)Yf(e,p,de,((ce=t.rowSelectionPropagation)==null?void 0:ce.descendants)??!1,((he=t.rowSelectionPropagation)==null?void 0:he.parents)??!1,ie,Y);return Array.from(Y)},[e,p,(Q=t.rowSelectionPropagation)==null?void 0:Q.descendants,(ee=t.rowSelectionPropagation)==null?void 0:ee.parents,g,o]),P=m.useCallback(({startId:re,endId:Y},ie=!0,ce=!1)=>{if(!e.current.getRow(re)||!e.current.getRow(Y))return;n.debug(`Expanding selection from row ${re} to row ${Y}`);const he=Xu(e),de=he.indexOf(re),le=he.indexOf(Y),[ge,Se]=de>le?[le,de]:[de,le],ke=he.slice(ge,Se+1);e.current.selectRows(ke,ie,ce)},[e,n]),T={selectRow:j,setRowSelectionModel:b,getSelectedRows:S,isRowSelected:v,isRowSelectable:C},$={selectRows:w,selectRowRange:P,getPropagatedRowSelectionModel:k};Gt(e,T,"public"),Gt(e,$,t.signature===zs.DataGrid?"private":"public");const M=m.useRef(!0),R=m.useCallback((re=!1)=>{var Se;if(M.current)return;const Y=ns(e.current.state),ie=Ts(e),ce=Zd(e),he=q({},Ia(e)),de=ke=>t.filterMode==="server"?!ie[ke]:!ie[ke]||ce[ke]===!1;let le=!1;Y.forEach(ke=>{var Oe;if(de(ke)){if(t.keepNonExistentRowsSelected)return;delete he[ke],le=!0;return}if(!((Oe=t.rowSelectionPropagation)!=null&&Oe.parents))return;const we=p[ke];if(we.type==="group"){if(we.isAutoGenerated){delete he[ke],le=!0;return}we.children.every(Fe=>ce[Fe]===!1)||(delete he[ke],le=!0)}});const ge=g&&((Se=t.rowSelectionPropagation)==null?void 0:Se.parents)&&Object.keys(he).length>0;if(le||ge&&!re){const ke=Object.values(he);ge?e.current.selectRows(ke,!0,!0):e.current.setRowSelectionModel(ke)}},[e,g,(ne=t.rowSelectionPropagation)==null?void 0:ne.parents,t.keepNonExistentRowsSelected,t.filterMode,p]),E=m.useCallback((re,Y)=>{const ie=Y.metaKey||Y.ctrlKey,ce=!c&&!ie&&!hZ(Y),he=!h||ce,de=e.current.isRowSelected(re);he?e.current.selectRow(re,ce?!0:!de,!0):e.current.selectRow(re,!de,!1)},[e,h,c]),O=m.useCallback((re,Y)=>{var he;if(u)return;const ie=(he=Y.target.closest(`.${te.cell}`))==null?void 0:he.getAttribute("data-field");if(ie===Jd.field||ie===ey)return;if(ie){const de=e.current.getColumn(ie);if((de==null?void 0:de.type)===Zx)return}Pr(e)[re.id].type!=="pinnedRow"&&(Y.shiftKey&&h?y(re.id):E(re.id,Y))},[u,h,e,y,E]),A=m.useCallback((re,Y)=>{var ie;h&&Y.shiftKey&&((ie=window.getSelection())==null||ie.removeAllRanges())},[h]),N=m.useCallback((re,Y)=>{h&&Y.nativeEvent.shiftKey?y(re.id):e.current.selectRow(re.id,re.value,!h)},[e,y,h]),F=m.useCallback(re=>{const Y=t.pagination&&t.checkboxSelectionVisibleOnly&&t.paginationMode==="client"?I$(e):Xu(e);e.current.selectRows(Y,re.value)},[e,t.checkboxSelectionVisibleOnly,t.pagination,t.paginationMode]),L=m.useCallback((re,Y)=>{if(e.current.getCellMode(re.id,re.field)!==kn.Edit&&!Th(Y)){if(ix(Y.key)&&Y.shiftKey){const ie=_o(e);if(ie&&ie.id!==re.id){Y.preventDefault();const ce=e.current.isRowSelected(ie.id);if(!h){e.current.selectRow(ie.id,!ce,!0);return}const he=e.current.getRowIndexRelativeToVisibleRows(ie.id),de=e.current.getRowIndexRelativeToVisibleRows(re.id);let le,ge;he>de?ce?(le=de,ge=he-1):(le=de,ge=he):ce?(le=he+1,ge=de):(le=he,ge=de);const ke=Ea(e).rows.slice(le,ge+1).map(we=>we.id);e.current.selectRows(ke,!ce);return}}if(Y.key===" "&&Y.shiftKey){Y.preventDefault(),E(re.id,Y);return}String.fromCharCode(Y.keyCode)==="A"&&(Y.ctrlKey||Y.metaKey)&&(Y.preventDefault(),w(e.current.getAllRowIds(),!0))}},[e,E,w,h]),D=Vt(()=>{if(!t.rowSelection){e.current.setRowSelectionModel([]);return}if(i===void 0)return;if(!o||!g||i.length===0){e.current.setRowSelectionModel(i);return}const re=e.current.getPropagatedRowSelectionModel(i);if(re.length!==i.length||!re.every(Y=>i.includes(Y))){e.current.setRowSelectionModel(re);return}e.current.setRowSelectionModel(i)});ot(e,"sortedRowsSet",r(()=>R(!0))),ot(e,"filteredRowsSet",r(()=>R())),ot(e,"rowClick",r(O)),ot(e,"rowSelectionCheckboxChange",r(N)),ot(e,"headerSelectionCheckboxChange",F),ot(e,"cellMouseDown",r(A)),ot(e,"cellKeyDown",r(L)),m.useEffect(()=>{D()},[e,i,t.rowSelection,D]);const H=i!=null;m.useEffect(()=>{if(H||!t.rowSelection)return;const re=ns(e.current.state);if(C){const Y=re.filter(ie=>C(ie));Y.length<re.length&&e.current.setRowSelectionModel(Y)}},[e,C,H,t.rowSelection]),m.useEffect(()=>{if(!t.rowSelection||H)return;const re=ns(e.current.state);!h&&re.length>1&&e.current.setRowSelectionModel([])},[e,h,c,H,t.rowSelection]),m.useEffect(()=>{r(R)},[R,r]),m.useEffect(()=>{M.current&&(M.current=!1)},[])},ute=e=>{const{classes:t}=e;return m.useMemo(()=>Be({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},en,t),[t])},dte=(e,t)=>{const n={classes:t.classes},r=ute(n),o=m.useCallback(i=>{const l=q({},Jd,{cellClassName:r.cellCheckbox,headerClassName:r.columnHeaderCheckbox,headerName:e.current.getLocaleText("checkboxSelectionHeaderName")}),c=t.checkboxSelection,u=i.lookup[Ss]!=null;return c&&!u?(i.lookup[Ss]=l,i.orderedFields=[Ss,...i.orderedFields]):!c&&u?(delete i.lookup[Ss],i.orderedFields=i.orderedFields.filter(f=>f!==Ss)):c&&u&&(i.lookup[Ss]=q({},l,i.lookup[Ss]),t.columns.some(f=>f.field===Ss)||(i.orderedFields=[Ss,...i.orderedFields.filter(f=>f!==Ss)])),i},[e,r,t.columns,t.checkboxSelection]);Jn(e,"hydrateColumns",o)},fte=(e,t)=>{var r,o;const n=t.sortModel??((o=(r=t.initialState)==null?void 0:r.sorting)==null?void 0:o.sortModel)??[];return q({},e,{sorting:{sortModel:UR(n,t.disableMultipleColumnsSorting),sortedRows:[]}})},pte=(e,t)=>{var P,T;const n=Fr(e,"useGridSorting");e.current.registerControlState({stateId:"sortModel",propModel:t.sortModel,propOnChange:t.onSortModelChange,stateSelector:Js,changeEvent:"sortModelChange"});const r=m.useCallback(($,M)=>{const R=Js(e),E=R.findIndex(A=>A.field===$);let O=[...R];return E>-1?(M==null?void 0:M.sort)==null?O.splice(E,1):O.splice(E,1,M):O=[...R,M],O},[e]),o=m.useCallback(($,M)=>{const E=Js(e).find(O=>O.field===$.field);if(E){const O=M===void 0?MI($.sortingOrder??t.sortingOrder,E.sort):M;return O===void 0?void 0:q({},E,{sort:O})}return{field:$.field,sort:M===void 0?MI($.sortingOrder??t.sortingOrder):M}},[e,t.sortingOrder]),i=m.useCallback(($,M)=>M==null||M.sortable===!1||t.disableColumnSorting?$:(M.sortingOrder||t.sortingOrder).some(E=>!!E)?[...$,"columnMenuSortItem"]:$,[t.sortingOrder,t.disableColumnSorting]),l=m.useCallback(()=>{e.current.setState($=>{if(t.sortingMode==="server")return n.debug("Skipping sorting rows as sortingMode = server"),q({},$,{sorting:q({},$.sorting,{sortedRows:Qw(Pr(e),ro,!1)})});const M=Js($,e.current.instanceId),R=nq(M,e),E=e.current.applyStrategyProcessor("sorting",{sortRowList:R});return q({},$,{sorting:q({},$.sorting,{sortedRows:E})})}),e.current.publishEvent("sortedRowsSet"),e.current.forceUpdate()},[e,n,t.sortingMode]),c=m.useCallback($=>{Js(e)!==$&&(n.debug("Setting sort model"),e.current.setState(TI($,t.disableMultipleColumnsSorting)),e.current.forceUpdate(),e.current.applySorting())},[e,n,t.disableMultipleColumnsSorting]),u=m.useCallback(($,M,R)=>{const E=e.current.getColumn($),O=o(E,M);let A;!R||t.disableMultipleColumnsSorting?A=(O==null?void 0:O.sort)==null?[]:[O]:A=r(E.field,O),e.current.setSortModel(A)},[e,r,o,t.disableMultipleColumnsSorting]),f=m.useCallback(()=>Js(e),[e]),h=m.useCallback(()=>Yw(e).map(M=>M.model),[e]),p=m.useCallback(()=>Xd(e),[e]),g=m.useCallback($=>e.current.getSortedRowIds()[$],[e]);Gt(e,{getSortModel:f,getSortedRows:h,getSortedRowIds:p,getRowIdFromRowIndex:g,setSortModel:c,sortColumn:u,applySorting:l},"public");const b=m.useCallback(($,M)=>{var O,A;const R=Js(e);return!M.exportOnlyDirtyModels||t.sortModel!=null||((A=(O=t.initialState)==null?void 0:O.sorting)==null?void 0:A.sortModel)!=null||R.length>0?q({},$,{sorting:{sortModel:R}}):$},[e,t.sortModel,(T=(P=t.initialState)==null?void 0:P.sorting)==null?void 0:T.sortModel]),v=m.useCallback(($,M)=>{var E;const R=(E=M.stateToRestore.sorting)==null?void 0:E.sortModel;return R==null?$:(e.current.setState(TI(R,t.disableMultipleColumnsSorting)),q({},$,{callbacks:[...$.callbacks,e.current.applySorting]}))},[e,t.disableMultipleColumnsSorting]),C=m.useCallback($=>{const M=Pr(e),R=M[ro],E=$.sortRowList?$.sortRowList(R.children.map(O=>M[O])):[...R.children];return R.footerId!=null&&E.push(R.footerId),E},[e]);Jn(e,"exportState",b),Jn(e,"restoreState",v),cx(e,Hc,"sorting",C);const S=m.useCallback(({field:$,colDef:M},R)=>{if(!M.sortable||t.disableColumnSorting)return;const E=R.shiftKey||R.metaKey||R.ctrlKey;u($,void 0,E)},[u,t.disableColumnSorting]),j=m.useCallback(({field:$,colDef:M},R)=>{!M.sortable||t.disableColumnSorting||R.key==="Enter"&&!R.ctrlKey&&!R.metaKey&&u($,void 0,R.shiftKey)},[u,t.disableColumnSorting]),w=m.useCallback(()=>{const $=Js(e),M=Pl(e);if($.length>0){const R=$.filter(E=>M[E.field]);R.length<$.length&&e.current.setSortModel(R)}},[e]),k=m.useCallback($=>{$==="sorting"&&e.current.applySorting()},[e]);Jn(e,"columnMenu",i),ot(e,"columnHeaderClick",S),ot(e,"columnHeaderKeyDown",j),ot(e,"rowsSet",e.current.applySorting),ot(e,"columnsChange",w),ot(e,"activeStrategyProcessorChange",k),Sh(()=>{e.current.applySorting()}),Ln(()=>{t.sortModel!==void 0&&e.current.setSortModel(t.sortModel)},[e,t.sortModel])};function wE(e){const{containerSize:t,scrollPosition:n,elementSize:r,elementOffset:o}=e,i=o+r;if(r>t)return o;if(i-t>n)return i-t;if(o<n)return o}const hte=(e,t)=>{const n=Yr(),r=Fr(e,"useGridScroll"),o=e.current.columnHeadersContainerRef,i=e.current.virtualScrollerRef,l=He(e,Ha),c=m.useCallback(p=>{var S;const g=Ar(e.current.state),y=wh(e),b=t.unstable_listView?[kd(e.current.state)]:fr(e);if(!(p.rowIndex==null)&&y===0||b.length===0)return!1;r.debug(`Scrolling to cell at row ${p.rowIndex}, col: ${p.colIndex} `);let C={};if(p.colIndex!==void 0){const j=_a(e);let w;if(typeof p.rowIndex<"u"){const k=(S=l[p.rowIndex])==null?void 0:S.id,P=e.current.unstable_getCellColSpanInfo(k,p.colIndex);P&&!P.spannedByColSpan&&(w=P.cellProps.width)}typeof w>"u"&&(w=b[p.colIndex].computedWidth),C.left=wE({containerSize:g.viewportOuterSize.width,scrollPosition:Math.abs(i.current.scrollLeft),elementSize:w,elementOffset:j[p.colIndex]})}if(p.rowIndex!==void 0){const j=ef(e.current.state),w=yK(e),k=j$(e),P=t.pagination?p.rowIndex-w*k:p.rowIndex,T=j.positions[P+1]?j.positions[P+1]-j.positions[P]:j.currentPageTotalHeight-j.positions[P];C.top=wE({containerSize:g.viewportInnerSize.height,scrollPosition:i.current.scrollTop,elementSize:T,elementOffset:j.positions[P]})}return C=e.current.unstable_applyPipeProcessors("scrollToIndexes",C,p),typeof C.left!==void 0||typeof C.top!==void 0?(e.current.scroll(C),!0):!1},[r,e,i,t.pagination,l,t.unstable_listView]),u=m.useCallback(p=>{if(i.current&&p.left!==void 0&&o.current){const g=n?-1:1;o.current.scrollLeft=p.left,i.current.scrollLeft=g*p.left,r.debug(`Scrolling left: ${p.left}`)}i.current&&p.top!==void 0&&(i.current.scrollTop=p.top,r.debug(`Scrolling top: ${p.top}`)),r.debug("Scrolling, updating container, and viewport")},[i,n,o,r]),f=m.useCallback(()=>i!=null&&i.current?{top:i.current.scrollTop,left:i.current.scrollLeft}:{top:0,left:0},[i]);Gt(e,{scroll:u,scrollToIndexes:c,getScrollPosition:f},"public")};function mte(e,t){En(e,"columnHeaderClick",t.onColumnHeaderClick),En(e,"columnHeaderContextMenu",t.onColumnHeaderContextMenu),En(e,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),En(e,"columnHeaderOver",t.onColumnHeaderOver),En(e,"columnHeaderOut",t.onColumnHeaderOut),En(e,"columnHeaderEnter",t.onColumnHeaderEnter),En(e,"columnHeaderLeave",t.onColumnHeaderLeave),En(e,"cellClick",t.onCellClick),En(e,"cellDoubleClick",t.onCellDoubleClick),En(e,"cellKeyDown",t.onCellKeyDown),En(e,"preferencePanelClose",t.onPreferencePanelClose),En(e,"preferencePanelOpen",t.onPreferencePanelOpen),En(e,"menuOpen",t.onMenuOpen),En(e,"menuClose",t.onMenuClose),En(e,"rowDoubleClick",t.onRowDoubleClick),En(e,"rowClick",t.onRowClick),En(e,"stateChange",t.onStateChange)}function gte(e,t=166){let n,r;const o=()=>{n=void 0,e(...r)};function i(...l){r=l,n===void 0&&(n=setTimeout(o,t))}return i.clear=()=>{clearTimeout(n),n=void 0},i}const gC={autoHeight:!1,autoPageSize:!1,autosizeOnMount:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,clipboardCopyCellDelimiter:" ",columnBufferPx:150,columnHeaderHeight:56,disableAutosize:!1,disableColumnFilter:!1,disableColumnMenu:!1,disableColumnReorder:!1,disableColumnResize:!1,disableColumnSelector:!1,disableColumnSorting:!1,disableDensitySelector:!1,disableEval:!1,disableMultipleColumnsFiltering:!1,disableMultipleColumnsSorting:!1,disableMultipleRowSelection:!1,disableRowSelectionOnClick:!1,disableVirtualization:!1,editMode:Fi.Cell,filterDebounceMs:150,filterMode:"client",hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,ignoreDiacritics:!1,ignoreValueFormatterDuringExport:!1,indeterminateCheckboxAction:"deselect",keepColumnPositionIfDraggedOutside:!1,keepNonExistentRowsSelected:!1,loading:!1,logger:console,logLevel:"error",pageSizeOptions:[25,50,100],pagination:!1,paginationMode:"client",resetPageOnSortFilter:!1,resizeThrottleMs:60,rowBufferPx:150,rowHeight:52,rowPositionsDebounceMs:166,rows:[],rowSelection:!0,rowSpacingType:"margin",showCellVerticalBorder:!1,showColumnVerticalBorder:!1,sortingMode:"client",sortingOrder:["asc","desc",null],throttleRowsMs:0,unstable_rowSpanning:!1,virtualizeColumnsWithAutoRowHeight:!1},Fu={width:0,height:0},xte={isReady:!1,root:Fu,viewportOuterSize:Fu,viewportInnerSize:Fu,contentSize:Fu,minimumSize:Fu,hasScrollX:!1,hasScrollY:!1,scrollbarSize:0,headerHeight:0,groupHeaderHeight:0,headerFilterHeight:0,rowWidth:0,rowHeight:0,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,headersTotalHeight:0,topContainerHeight:0,bottomContainerHeight:0},yte=(e,t,n)=>{const r=xte,o=qd(n);return q({},e,{dimensions:q({},r,aO(t,n,o,Yd(n)))})},lO=Tt(fr,_a,(e,t)=>{const n=e.length;return n===0?0:Vu(t[n-1]+e[n-1].computedWidth,1)});function bte(e,t){const n=Fr(e,"useResizeContainer"),r=m.useRef(!1),o=m.useRef(Fu),i=He(e,Yd),l=He(e,qd),c=He(e,lO),u=m.useRef(!0),{rowHeight:f,headerHeight:h,groupHeaderHeight:p,headerFilterHeight:g,headersTotalHeight:y,leftPinnedWidth:b,rightPinnedWidth:v}=aO(t,e,l,i),C=m.useRef(void 0),S=m.useCallback(()=>Ar(e.current.state),[e]),j=m.useCallback(A=>{e.current.setState(N=>q({},N,{dimensions:A})),e.current.rootElementRef.current&&SE(e.current.rootElementRef.current,Ar(e.current.state))},[e]),w=m.useCallback(()=>{const A=e.current.mainElementRef.current;if(!A)return;const N=qo(A).getComputedStyle(A),F={width:parseFloat(N.width)||0,height:parseFloat(N.height)||0};(!C.current||!kE(C.current,F))&&(e.current.publishEvent("resize",F),C.current=F)},[e]),k=m.useCallback(()=>{const A=Ar(e.current.state);if(!A.isReady)return 0;const N=Ea(e);if(t.getRowHeight){const L=Ph(e),D=L.lastRowIndex-L.firstRowIndex;return Math.min(D-1,N.rows.length)}const F=Math.floor(A.viewportInnerSize.height/f);return Math.min(F,N.rows.length)},[e,t.getRowHeight,f]),P=m.useCallback(()=>{var ne,re;if(u.current)return;const A=vte(e.current.mainElementRef.current,t.scrollbarSize),N=ef(e.current.state),F=y+N.pinnedTopRowsTotalHeight,L=N.pinnedBottomRowsTotalHeight,H={width:c-b-v,height:Vu(N.currentPageTotalHeight,1)};let B,V,G=!1,_=!1;if(t.autoHeight)_=!1,G=Math.round(c)>Math.round(o.current.width),B={width:o.current.width,height:F+L+H.height},V={width:Math.max(0,B.width-(_?A:0)),height:Math.max(0,B.height-(G?A:0))};else{B={width:o.current.width,height:o.current.height},V={width:Math.max(0,B.width-b-v),height:Math.max(0,B.height-F-L)};const Y=H,ie=V,ce=Y.width>ie.width,he=Y.height>ie.height;(ce||he)&&(_=he,G=Y.width+(_?A:0)>ie.width,G&&(_=Y.height+A>ie.height)),_&&(V.width-=A),G&&(V.height-=A)}const U=Math.max(B.width,c+(_?A:0)),Z={width:c,height:F+H.height+L},Q={isReady:!0,root:o.current,viewportOuterSize:B,viewportInnerSize:V,contentSize:H,minimumSize:Z,hasScrollX:G,hasScrollY:_,scrollbarSize:A,headerHeight:h,groupHeaderHeight:p,headerFilterHeight:g,rowWidth:U,rowHeight:f,columnsTotalWidth:c,leftPinnedWidth:b,rightPinnedWidth:v,headersTotalHeight:y,topContainerHeight:F,bottomContainerHeight:L},ee=e.current.state.dimensions;ka(ee,Q)||(j(Q),kE(Q.viewportInnerSize,ee.viewportInnerSize)||e.current.publishEvent("viewportInnerSizeChange",Q.viewportInnerSize),(re=(ne=e.current).updateRenderContext)==null||re.call(ne))},[e,j,t.scrollbarSize,t.autoHeight,f,h,p,g,c,y,b,v]),T=Vt(P),$=m.useMemo(()=>t.resizeThrottleMs>0?gte(()=>{T(),e.current.publishEvent("debouncedResize",o.current)},t.resizeThrottleMs):void 0,[e,t.resizeThrottleMs,T]);m.useEffect(()=>$==null?void 0:$.clear,[$]);const M={resize:w,getRootDimensions:S},R={updateDimensions:P,getViewportPageSize:k};Ln(P,[P]),Gt(e,M,"public"),Gt(e,R,"private");const E=m.useCallback(A=>{SE(A,Ar(e.current.state))},[e]),O=m.useCallback(A=>{if(o.current=A,A.height===0&&!r.current&&!t.autoHeight&&!ox&&(n.error(["The parent DOM element of the Data Grid has an empty height.","Please make sure that this element has an intrinsic height.","The grid displays with a height of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(`
|
|
339
|
+
`)),r.current=!0),A.width===0&&!r.current&&!ox&&(n.error(["The parent DOM element of the Data Grid has an empty width.","Please make sure that this element has an intrinsic width.","The grid displays with a width of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(`
|
|
340
|
+
`)),r.current=!0),u.current||!$){u.current=!1,P();return}$()},[P,t.autoHeight,$,n]);En(e,"rootMount",E),En(e,"resize",O),En(e,"debouncedResize",t.onResize)}function SE(e,t){const n=(r,o)=>e.style.setProperty(r,o);n("--DataGrid-hasScrollX",`${Number(t.hasScrollX)}`),n("--DataGrid-hasScrollY",`${Number(t.hasScrollY)}`),n("--DataGrid-scrollbarSize",`${t.scrollbarSize}px`),n("--DataGrid-rowWidth",`${t.rowWidth}px`),n("--DataGrid-columnsTotalWidth",`${t.columnsTotalWidth}px`),n("--DataGrid-leftPinnedWidth",`${t.leftPinnedWidth}px`),n("--DataGrid-rightPinnedWidth",`${t.rightPinnedWidth}px`),n("--DataGrid-headerHeight",`${t.headerHeight}px`),n("--DataGrid-headersTotalHeight",`${t.headersTotalHeight}px`),n("--DataGrid-topContainerHeight",`${t.topContainerHeight}px`),n("--DataGrid-bottomContainerHeight",`${t.bottomContainerHeight}px`),n("--height",`${t.rowHeight}px`)}function aO(e,t,n,r){const o=c$(e.rowHeight,gC.rowHeight);return{rowHeight:Math.floor(o*n),headerHeight:Math.floor(e.columnHeaderHeight*n),groupHeaderHeight:Math.floor((e.columnGroupHeaderHeight??e.columnHeaderHeight)*n),headerFilterHeight:Math.floor((e.headerFilterHeight??e.columnHeaderHeight)*n),columnsTotalWidth:lO(t),headersTotalHeight:sy(t,e),leftPinnedWidth:r.left.reduce((i,l)=>i+l.computedWidth,0),rightPinnedWidth:r.right.reduce((i,l)=>i+l.computedWidth,0)}}const jE=new WeakMap;function vte(e,t){if(t!==void 0)return t;if(e===null)return 0;const n=jE.get(e);if(n!==void 0)return n;const o=ir(e).createElement("div");o.style.width="99px",o.style.height="99px",o.style.position="absolute",o.style.overflow="scroll",o.className="scrollDiv",e.appendChild(o);const i=o.offsetWidth-o.clientWidth;return e.removeChild(o),jE.set(e,i),i}function kE(e,t){return e.width===t.width&&e.height===t.height}const Cte=typeof globalThis.ResizeObserver<"u"?globalThis.ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},wte=(e,t,n)=>{n.current.caches.rowsMeta={heights:new Map};const r=Vw(n.current.state),o=wh(n),i=jh(n.current.state),l=Math.min(i.enabled?i.paginationModel.pageSize:o,o);return q({},e,{rowsMeta:{currentPageTotalHeight:l*r,positions:Array.from({length:l},(c,u)=>u*r),pinnedTopRowsTotalHeight:0,pinnedBottomRowsTotalHeight:0}})},Ste=(e,t)=>{const{getRowHeight:n,getRowSpacing:r,getEstimatedRowHeight:o}=t,i=e.current.caches.rowsMeta.heights,l=m.useRef(-1),c=m.useRef(!1),u=m.useRef(!1),f=He(e,qd),h=rS(e),p=He(e,Kd),g=He(e,Vw),y=E=>{let O=i.get(E);return O===void 0&&(O={content:g,spacingTop:0,spacingBottom:0,detail:0,autoHeight:!1,needsFirstMeasurement:!0},i.set(E,O)),O},b=m.useCallback(E=>{const O=Ar(e.current.state).rowHeight,A=e.current.getRowHeightEntry(E.id);if(!n)A.content=O,A.needsFirstMeasurement=!1;else{const N=n(q({},E,{densityFactor:f}));if(N==="auto"){if(A.needsFirstMeasurement){const F=o?o(q({},E,{densityFactor:f})):O;A.content=F??O}c.current=!0,A.autoHeight=!0}else A.content=c$(N,O),A.needsFirstMeasurement=!1,A.autoHeight=!1}if(r){const N=e.current.getRowIndexRelativeToVisibleRows(E.id),F=r(q({},E,{isFirstVisible:N===0,isLastVisible:N===h.rows.length-1,indexRelativeToCurrentPage:N}));A.spacingTop=F.top??0,A.spacingBottom=F.bottom??0}else A.spacingTop=0,A.spacingBottom=0;return e.current.unstable_applyPipeProcessors("rowHeight",A,E),A},[e,h.rows,n,o,g,r,f]),v=m.useCallback(()=>{c.current=!1;const E=p.top.reduce((D,H)=>{const B=b(H);return D+B.content+B.spacingTop+B.spacingBottom+B.detail},0),O=p.bottom.reduce((D,H)=>{const B=b(H);return D+B.content+B.spacingTop+B.spacingBottom+B.detail},0),A=[],N=h.rows.reduce((D,H)=>{A.push(D);const B=b(H),V=B.content+B.spacingTop+B.spacingBottom+B.detail;return D+V},0);c.current||(l.current=1/0);const F=E!==e.current.state.rowsMeta.pinnedTopRowsTotalHeight||O!==e.current.state.rowsMeta.pinnedBottomRowsTotalHeight||N!==e.current.state.rowsMeta.currentPageTotalHeight,L={currentPageTotalHeight:N,positions:A,pinnedTopRowsTotalHeight:E,pinnedBottomRowsTotalHeight:O};e.current.setState(D=>q({},D,{rowsMeta:L})),F&&e.current.updateDimensions(),u.current=!0},[e,p,h.rows,b]),C=E=>{var O;return((O=i.get(E))==null?void 0:O.content)??g},S=(E,O)=>{const A=e.current.getRowHeightEntry(E),N=A.content!==O;A.needsFirstMeasurement=!1,A.content=O,u.current&&(u.current=!N)},j=E=>{var O;return((O=i.get(E))==null?void 0:O.autoHeight)??!1},w=()=>l.current,k=E=>{c.current&&E>l.current&&(l.current=E)},P=()=>{i.clear(),v()},T=Hs(()=>new Cte(E=>{var O;for(let A=0;A<E.length;A+=1){const N=E[A],F=N.borderBoxSize&&N.borderBoxSize.length>0?N.borderBoxSize[0].blockSize:N.contentRect.height,L=N.target.__mui_id;if(((O=F$(e))==null?void 0:O.id)===L&&F===0)return;e.current.unstable_storeRowHeightMeasurement(L,F)}u.current||requestAnimationFrame(()=>{e.current.requestPipeProcessorsApplication("rowHeight")})})).current,$=(E,O)=>(E.__mui_id=O,T.observe(E),()=>T.unobserve(E));dS(e,"rowHeight",v),Ln(()=>{v()},[v]);const M={unstable_getRowHeight:C,unstable_setLastMeasuredRowIndex:k,unstable_storeRowHeightMeasurement:S,resetRowHeights:P},R={hydrateRowsMeta:v,observeRowHeight:$,rowHasAutoHeight:j,getRowHeightEntry:y,getLastMeasuredRowIndex:w};Gt(e,M,"public"),Gt(e,R,"private")},jte=e=>{const t=m.useCallback((o={})=>e.current.unstable_applyPipeProcessors("exportState",{},o),[e]),n=m.useCallback(o=>{e.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:o}).callbacks.forEach(l=>{l()}),e.current.forceUpdate()},[e]);Gt(e,{exportState:t,restoreState:n},"public")},kte=e=>{const t=m.useRef({}),n=(c,u)=>{var f;return(f=t.current[c])==null?void 0:f[u]},r=()=>{t.current={}},o=m.useCallback(({rowId:c,minFirstColumn:u,maxLastColumn:f,columns:h})=>{for(let p=u;p<f;p+=1){const g=Ite({apiRef:e,lookup:t.current,columnIndex:p,rowId:c,minFirstColumnIndex:u,maxLastColumnIndex:f,columns:h});g.colSpan>1&&(p+=g.colSpan-1)}},[e]),i={unstable_getCellColSpanInfo:n},l={resetColSpan:r,calculateColSpan:o};Gt(e,i,"public"),Gt(e,l,"private"),ot(e,"columnOrderChange",r)};function Ite(e){const{apiRef:t,lookup:n,columnIndex:r,rowId:o,minFirstColumnIndex:i,maxLastColumnIndex:l,columns:c}=e,u=c.length,f=c[r],h=t.current.getRow(o),p=t.current.getRowValue(h,f),g=typeof f.colSpan=="function"?f.colSpan(p,h,f,t):f.colSpan;if(!g||g===1)return Kv(n,o,r,{spannedByColSpan:!1,cellProps:{colSpan:1,width:f.computedWidth}}),{colSpan:1};let y=f.computedWidth;for(let b=1;b<g;b+=1){const v=r+b;if(v>=i&&v<l){const C=c[v];y+=C.computedWidth,Kv(n,o,r+b,{spannedByColSpan:!0,rightVisibleCellIndex:Math.min(r+g,u-1),leftVisibleCellIndex:r})}Kv(n,o,r,{spannedByColSpan:!1,cellProps:{colSpan:g,width:y}})}return{colSpan:g}}function Kv(e,t,n,r){e[t]||(e[t]={}),e[t][n]=r}const cO=(e,t,n)=>{if(XR(e)){if(n[e.field]!==void 0)throw new Error(["MUI X: columnGroupingModel contains duplicated field",`column field ${e.field} occurs two times in the grouping model:`,`- ${n[e.field].join(" > ")}`,`- ${t.join(" > ")}`].join(`
|
|
341
|
+
`));n[e.field]=t;return}const{groupId:r,children:o}=e;o.forEach(i=>{cO(i,[...t,r],n)})},xC=e=>{if(!e)return{};const t={};return e.forEach(n=>{cO(n,[],t)}),t},yC=(e,t,n)=>{const r=u=>t[u]??[],o=[],i=Math.max(...e.map(u=>r(u).length)),l=(u,f,h)=>ka(r(u).slice(0,h+1),r(f).slice(0,h+1)),c=(u,f)=>!!(n!=null&&n.left&&n.left.includes(u)&&!n.left.includes(f)||n!=null&&n.right&&!n.right.includes(u)&&n.right.includes(f));for(let u=0;u<i;u+=1){const f=e.reduce((h,p)=>{const g=r(p)[u]??null;if(h.length===0)return[{columnFields:[p],groupId:g}];const y=h[h.length-1],b=y.columnFields[y.columnFields.length-1];return y.groupId!==g||!l(b,p,u)||c(b,p)?[...h,{columnFields:[p],groupId:g}]:[...h.slice(0,h.length-1),{columnFields:[...y.columnFields,p],groupId:g}]},[]);o.push(f)}return o},Ete=["groupId","children"],fS=e=>{let t={};return e.forEach(n=>{if(XR(n))return;const{groupId:r,children:o}=n,i=St(n,Ete);if(!r)throw new Error("MUI X: An element of the columnGroupingModel does not have either `field` or `groupId`.");const l=q({},i,{groupId:r}),c=fS(o);if(c[r]!==void 0||t[r]!==void 0)throw new Error(`MUI X: The groupId ${r} is used multiple times in the columnGroupingModel.`);t=q({},t,c,{[r]:l})}),q({},t)},Pte=(e,t,n)=>{if(!t.columnGroupingModel)return e;const r=ul(n),o=Qd(n),i=fS(t.columnGroupingModel??[]),l=xC(t.columnGroupingModel??[]),c=yC(r,l,n.current.state.pinnedColumns??{}),u=o.length===0?0:Math.max(...o.map(f=>{var h;return((h=l[f])==null?void 0:h.length)??0}));return q({},e,{columnGrouping:{lookup:i,unwrappedGroupingModel:l,headerStructure:c,maxDepth:u}})},Tte=(e,t)=>{const n=m.useCallback(c=>M$(e)[c]??[],[e]),r=m.useCallback(()=>R$(e),[e]);Gt(e,{getColumnGroupPath:n,getAllGroupDetails:r},"public");const i=m.useCallback(()=>{const c=xC(t.columnGroupingModel??[]);e.current.setState(u=>{var g;const f=((g=u.columns)==null?void 0:g.orderedFields)??[],h=u.pinnedColumns??{},p=yC(f,c,h);return q({},u,{columnGrouping:q({},u.columnGrouping,{headerStructure:p})})})},[e,t.columnGroupingModel]),l=m.useCallback(c=>{var v,C;const u=((C=(v=e.current).getPinnedColumns)==null?void 0:C.call(v))??{},f=ul(e),h=Qd(e),p=fS(c??[]),g=xC(c??[]),y=yC(f,g,u),b=h.length===0?0:Math.max(...h.map(S=>{var j;return((j=g[S])==null?void 0:j.length)??0}));e.current.setState(S=>q({},S,{columnGrouping:{lookup:p,unwrappedGroupingModel:g,headerStructure:y,maxDepth:b}}))},[e]);ot(e,"columnIndexChange",i),ot(e,"columnsChange",()=>{l(t.columnGroupingModel)}),ot(e,"columnVisibilityModelChange",()=>{l(t.columnGroupingModel)}),m.useEffect(()=>{l(t.columnGroupingModel)},[l,t.columnGroupingModel])};function Mte(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function IE(e,t){if(t!==void 0&&e.changedTouches){for(let n=0;n<e.changedTouches.length;n+=1){const r=e.changedTouches[n];if(r.identifier===t)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function EE(e,t,n,r){let o=e;return r==="Right"?o+=t-n.left:o+=n.right-t,o}function Rte(e,t,n){return n==="Left"?e-t.left:t.right-e}function $te(e){return e==="Right"?"Left":"Right"}function Ote(e,t){const n=e.classList.contains(te["columnSeparator--sideRight"])?"Right":"Left";return t?$te(n):n}function PE(e){e.preventDefault(),e.stopImmediatePropagation()}function zte(e){const t=m.useRef(void 0),n=()=>D$(e),r=He(e,n);return m.useEffect(()=>{t.current&&r===!1&&(t.current.resolve(),t.current=void 0)}),()=>{if(!t.current){if(n()===!1)return Promise.resolve();t.current=Mte()}return t.current}}function Lte(e,t){if(e.length<4)return e;const n=e.slice();n.sort((c,u)=>c-u);const r=n[Math.floor(n.length*.25)],o=n[Math.floor(n.length*.75)-1],i=o-r,l=i<5?5:i*t;return n.filter(c=>c>r-l&&c<o+l)}function Dte(e,t,n){const r={},o=e.current.rootElementRef.current;return o.classList.add(te.autosizing),n.forEach(i=>{const c=IX(e.current,i.field).map(b=>b.getBoundingClientRect().width??0),u=t.includeOutliers?c:Lte(c,t.outliersFactor);if(t.includeHeaders){const b=kX(e.current,i.field);if(b){const v=b.querySelector(`.${te.columnHeaderTitle}`),C=b.querySelector(`.${te.columnHeaderTitleContainerContent}`),S=b.querySelector(`.${te.iconButtonContainer}`),j=b.querySelector(`.${te.menuIcon}`),w=v??C,k=window.getComputedStyle(b,null),P=parseInt(k.paddingLeft,10)+parseInt(k.paddingRight,10),$=w.scrollWidth+1+P+((S==null?void 0:S.clientWidth)??0)+((j==null?void 0:j.clientWidth)??0);u.push($)}}const f=i.minWidth!==-1/0&&i.minWidth!==void 0,h=i.maxWidth!==1/0&&i.maxWidth!==void 0,p=f?i.minWidth:0,g=h?i.maxWidth:1/0,y=u.length===0?0:Math.max(...u);r[i.field]=as(y,p,g)}),o.classList.remove(te.autosizing),r}const Ate=e=>q({},e,{columnResize:{resizingColumnField:""}});function Fte(){return{colDef:void 0,initialColWidth:0,initialTotalWidth:0,previousMouseClickEvent:void 0,columnHeaderElement:void 0,headerFilterElement:void 0,groupHeaderElements:[],cellElements:[],leftPinnedCellsAfter:[],rightPinnedCellsBefore:[],fillerLeft:void 0,fillerRight:void 0,leftPinnedHeadersAfter:[],rightPinnedHeadersBefore:[]}}const Nte=(e,t)=>{const n=Yr(),r=Fr(e,"useGridColumnResize"),o=Hs(Fte).current,i=m.useRef(null),l=m.useRef(null),c=Po(),u=m.useRef(void 0),f=R=>{var L,D;r.debug(`Updating width to ${R} for col ${o.colDef.field}`);const E=o.columnHeaderElement.offsetWidth,O=R-E,A=R-o.initialColWidth;if(A>0){const H=o.initialTotalWidth+A;(D=(L=e.current.rootElementRef)==null?void 0:L.current)==null||D.style.setProperty("--DataGrid-rowWidth",`${H}px`)}o.colDef.computedWidth=R,o.colDef.width=R,o.colDef.flex=0,o.columnHeaderElement.style.width=`${R}px`;const N=o.headerFilterElement;N&&(N.style.width=`${R}px`),o.groupHeaderElements.forEach(H=>{const B=H;let V;B.getAttribute("aria-colspan")==="1"?V=`${R}px`:V=`${B.offsetWidth+O}px`,B.style.width=V}),o.cellElements.forEach(H=>{const B=H;let V;B.getAttribute("aria-colspan")==="1"?V=`${R}px`:V=`${B.offsetWidth+O}px`,B.style.setProperty("--width",V)});const F=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);F===na.LEFT&&($u(o.fillerLeft,"width",O),o.leftPinnedCellsAfter.forEach(H=>{$u(H,"left",O)}),o.leftPinnedHeadersAfter.forEach(H=>{$u(H,"left",O)})),F===na.RIGHT&&($u(o.fillerRight,"width",O),o.rightPinnedCellsBefore.forEach(H=>{$u(H,"right",O)}),o.rightPinnedHeadersBefore.forEach(H=>{$u(H,"right",O)}))},h=R=>{if(S(),o.previousMouseClickEvent){const E=o.previousMouseClickEvent,O=E.timeStamp,A=E.clientX,N=E.clientY;if(R.timeStamp-O<300&&R.clientX===A&&R.clientY===N){o.previousMouseClickEvent=void 0,e.current.publishEvent("columnResizeStop",null,R);return}}if(o.colDef){e.current.setColumnWidth(o.colDef.field,o.colDef.width),r.debug(`Updating col ${o.colDef.field} with new width: ${o.colDef.width}`);const E=Oi(e.current.state);o.groupHeaderElements.forEach(O=>{const A=yX(O),N=O,L=`${A.reduce((D,H)=>E.columnVisibilityModel[H]!==!1?D+E.lookup[H].computedWidth:D,0)}px`;N.style.width=L})}c.start(0,()=>{e.current.publishEvent("columnResizeStop",null,R)})},p=(R,E,O)=>{var L;const A=e.current.rootElementRef.current;o.initialColWidth=R.computedWidth,o.initialTotalWidth=e.current.getRootDimensions().rowWidth,o.colDef=R,o.columnHeaderElement=xX(e.current.columnHeadersContainerRef.current,R.field);const N=A.querySelector(`.${te.headerFilterRow} [data-field="${Tl(R.field)}"]`);N&&(o.headerFilterElement=N),o.groupHeaderElements=bX((L=e.current.columnHeadersContainerRef)==null?void 0:L.current,R.field),o.cellElements=vX(o.columnHeaderElement,e.current),o.fillerLeft=nE(e.current,n?"filler--pinnedRight":"filler--pinnedLeft"),o.fillerRight=nE(e.current,n?"filler--pinnedLeft":"filler--pinnedRight");const F=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);o.leftPinnedCellsAfter=F!==na.LEFT?[]:CX(e.current,o.columnHeaderElement,n),o.rightPinnedCellsBefore=F!==na.RIGHT?[]:wX(e.current,o.columnHeaderElement,n),o.leftPinnedHeadersAfter=F!==na.LEFT?[]:SX(e.current,o.columnHeaderElement,n),o.rightPinnedHeadersBefore=F!==na.RIGHT?[]:jX(e.current,o.columnHeaderElement,n),l.current=Ote(E,n),i.current=Rte(O,o.columnHeaderElement.getBoundingClientRect(),l.current)},g=Vt(h),y=Vt(R=>{if(R.buttons===0){g(R);return}let E=EE(i.current,R.clientX,o.columnHeaderElement.getBoundingClientRect(),l.current);E=as(E,o.colDef.minWidth,o.colDef.maxWidth),f(E);const O={element:o.columnHeaderElement,colDef:o.colDef,width:E};e.current.publishEvent("columnResize",O,R)}),b=Vt(R=>{IE(R,u.current)&&h(R)}),v=Vt(R=>{const E=IE(R,u.current);if(!E)return;if(R.type==="mousemove"&&R.buttons===0){b(R);return}let O=EE(i.current,E.x,o.columnHeaderElement.getBoundingClientRect(),l.current);O=as(O,o.colDef.minWidth,o.colDef.maxWidth),f(O);const A={element:o.columnHeaderElement,colDef:o.colDef,width:O};e.current.publishEvent("columnResize",A,R)}),C=Vt(R=>{const E=sx(R.target,te["columnSeparator--resizable"]);if(!E)return;const O=R.changedTouches[0];O!=null&&(u.current=O.identifier);const A=sx(R.target,te.columnHeader),N=gX(A),F=e.current.getColumn(N);r.debug(`Start Resize on col ${F.field}`),e.current.publishEvent("columnResizeStart",{field:N},R),p(F,E,O.clientX);const L=ir(R.currentTarget);L.addEventListener("touchmove",v),L.addEventListener("touchend",b)}),S=m.useCallback(()=>{const R=ir(e.current.rootElementRef.current);R.body.style.removeProperty("cursor"),R.removeEventListener("mousemove",y),R.removeEventListener("mouseup",g),R.removeEventListener("touchmove",v),R.removeEventListener("touchend",b),setTimeout(()=>{R.removeEventListener("click",PE,!0)},100),o.columnHeaderElement&&(o.columnHeaderElement.style.pointerEvents="unset")},[e,o,y,g,v,b]),j=m.useCallback(({field:R})=>{e.current.setState(E=>q({},E,{columnResize:q({},E.columnResize,{resizingColumnField:R})})),e.current.forceUpdate()},[e]),w=m.useCallback(()=>{e.current.setState(R=>q({},R,{columnResize:q({},R.columnResize,{resizingColumnField:""})})),e.current.forceUpdate()},[e]),k=Vt(({colDef:R},E)=>{if(E.button!==0||!E.currentTarget.classList.contains(te["columnSeparator--resizable"]))return;E.preventDefault(),r.debug(`Start Resize on col ${R.field}`),e.current.publishEvent("columnResizeStart",{field:R.field},E),p(R,E.currentTarget,E.clientX);const O=ir(e.current.rootElementRef.current);O.body.style.cursor="col-resize",o.previousMouseClickEvent=E.nativeEvent,O.addEventListener("mousemove",y),O.addEventListener("mouseup",g),O.addEventListener("click",PE,!0)}),P=Vt((R,E)=>{if(t.disableAutosize||E.button!==0)return;const O=e.current.state.columns.lookup[R.field];O.resizable!==!1&&e.current.autosizeColumns(q({},t.autosizeOptions,{disableColumnVirtualization:!1,columns:[O.field]}))}),T=zte(e),$=m.useRef(!1),M=m.useCallback(async R=>{var F;if(!((F=e.current.rootElementRef)==null?void 0:F.current)||$.current)return;$.current=!0;const O=Oi(e.current.state),A=q({},uY,R,{columns:(R==null?void 0:R.columns)??O.orderedFields});A.columns=A.columns.filter(L=>O.columnVisibilityModel[L]!==!1);const N=A.columns.map(L=>e.current.state.columns.lookup[L]);try{!t.disableVirtualization&&A.disableColumnVirtualization&&(e.current.unstable_setColumnVirtualization(!1),await T());const L=Dte(e,A,N),D=N.map(H=>q({},H,{width:L[H.field],computedWidth:L[H.field],flex:0}));if(A.expand){const B=O.orderedFields.map(U=>O.lookup[U]).filter(U=>O.columnVisibilityModel[U.field]!==!1).reduce((U,Z)=>U+(L[Z.field]??Z.computedWidth??Z.width),0),_=e.current.getRootDimensions().viewportInnerSize.width-B;if(_>0){const U=_/(D.length||1);D.forEach(Z=>{Z.width+=U,Z.computedWidth+=U})}}e.current.updateColumns(D),D.forEach((H,B)=>{if(H.width!==N[B].width){const V=H.width;e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(H.field),colDef:H,width:V})}})}finally{t.disableVirtualization||e.current.unstable_setColumnVirtualization(!0),$.current=!1}},[e,T,t.disableVirtualization]);m.useEffect(()=>S,[S]),iw(()=>{t.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(t.autosizeOptions)})}),b$(e,()=>{var R;return(R=e.current.columnHeadersContainerRef)==null?void 0:R.current},"touchstart",C,{passive:!0}),Gt(e,{autosizeColumns:M},"public"),ot(e,"columnResizeStop",w),ot(e,"columnResizeStart",j),ot(e,"columnSeparatorMouseDown",k),ot(e,"columnSeparatorDoubleClick",P),En(e,"columnResize",t.onColumnResize),En(e,"columnWidthChange",t.onColumnWidthChange)};function $u(e,t,n){e&&(e.style[t]=`${parseInt(e.style[t],10)+n}px`)}function _te(e,t){return e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?null:e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex>t.lastRowIndex?{firstRowIndex:t.lastRowIndex,lastRowIndex:e.lastRowIndex}:e.firstRowIndex<t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?{firstRowIndex:e.firstRowIndex,lastRowIndex:t.firstRowIndex-1}:e}function TE(e){return e.firstRowIndex!==0||e.lastRowIndex!==0}const Qv=(e,t,n)=>{if(!e)return null;let r=e[t.field];const o=t.rowSpanValueGetter??t.valueGetter;return o&&(r=o(r,e,t,n)),r},Gu={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},ux={firstRowIndex:0,lastRowIndex:0},Hte=new Set([Ss,"__reorder__",ey]),ME=20,uO=(e,t,n,r,o,i,l)=>{const c=i?{}:q({},e.current.state.rowSpanning.spannedCells),u=i?{}:q({},e.current.state.rowSpanning.hiddenCells),f=i?{}:q({},e.current.state.rowSpanning.hiddenCellOriginMap);return i&&(l=ux),t.forEach(h=>{var p;if(!Hte.has(h.field)){for(let g=o.firstRowIndex;g<o.lastRowIndex;g+=1){const y=n[g];if((p=u[y.id])!=null&&p[h.field])continue;const b=Qv(y.model,h,e);if(b==null)continue;let v=y.id,C=g,S=0;const j=[];if(g===o.firstRowIndex){let k=g-1,P=n[k];for(;k>=r.firstRowIndex&&P&&Qv(P.model,h,e)===b;){const T=n[k+1];u[T.id]?u[T.id][h.field]=!0:u[T.id]={[h.field]:!0},j.push(g),S+=1,v=P.id,C=k,k-=1,P=n[k]}}j.forEach(k=>{f[k]?f[k][h.field]=C:f[k]={[h.field]:C}});let w=g+1;for(;w<=r.lastRowIndex&&n[w]&&Qv(n[w].model,h,e)===b;){const k=n[w];u[k.id]?u[k.id][h.field]=!0:u[k.id]={[h.field]:!0},f[w]?f[w][h.field]=C:f[w]={[h.field]:C},w+=1,S+=1}S>0&&(c[v]?c[v][h.field]=S+1:c[v]={[h.field]:S+1})}l={firstRowIndex:Math.min(l.firstRowIndex,o.firstRowIndex),lastRowIndex:Math.max(l.lastRowIndex,o.lastRowIndex)}}}),{spannedCells:c,hiddenCells:u,hiddenCellOriginMap:f,processedRange:l}},dO=(e,t)=>{const n=dp(t).length;if(e.pagination){const r=j$(t);let o=ME;return r>0&&(o=r-1),{firstRowIndex:0,lastRowIndex:Math.min(o,n)}}return{firstRowIndex:0,lastRowIndex:Math.min(ME,n)}},Bte=(e,t,n)=>{var b;if(!t.unstable_rowSpanning)return q({},e,{rowSpanning:Gu});const r=e.rows.dataRowIds||[],o=e.columns.orderedFields||[],i=e.rows.dataRowIdToModelLookup,l=e.columns.lookup,c=!!e.filter.filterModel.items.length||!!((b=e.filter.filterModel.quickFilterValues)!=null&&b.length);if(!r.length||!o.length||!i||!l||c)return q({},e,{rowSpanning:Gu});const u=dO(t,n),f=r.map(v=>({id:v,model:i[v]})),h=o.map(v=>l[v]),{spannedCells:p,hiddenCells:g,hiddenCellOriginMap:y}=uO(n,h,f,u,u,!0,ux);return q({},e,{rowSpanning:{spannedCells:p,hiddenCells:g,hiddenCellOriginMap:y}})},Wte=(e,t)=>{const n=Hs(()=>e.current.state.rowSpanning!==Gu?dO(t,e):ux),r=m.useCallback((i,l=!1)=>{const{range:c,rows:u}=Ea(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(c===null||!TE(i))return;l&&(n.current=ux);const f=_te({firstRowIndex:i.firstRowIndex,lastRowIndex:Math.min(i.lastRowIndex,c.lastRowIndex+1)},n.current);if(f===null)return;const h=fr(e),{spannedCells:p,hiddenCells:g,hiddenCellOriginMap:y,processedRange:b}=uO(e,h,u,c,f,l,n.current);n.current=b;const v=Object.keys(p).length,C=Object.keys(g).length,S=Object.keys(e.current.state.rowSpanning.spannedCells).length,j=Object.keys(e.current.state.rowSpanning.hiddenCells).length;!(l||v!==S||C!==j)||v===0&&S===0||e.current.setState(P=>q({},P,{rowSpanning:{spannedCells:p,hiddenCells:g,hiddenCellOriginMap:y}}))},[e,n,t.pagination,t.paginationMode]),o=m.useCallback(()=>{const i=Ph(e);TE(i)&&r(i,!0)},[e,r]);ot(e,"renderedRowsIntervalChange",cc(t.unstable_rowSpanning,r)),ot(e,"sortedRowsSet",cc(t.unstable_rowSpanning,o)),ot(e,"paginationModelChange",cc(t.unstable_rowSpanning,o)),ot(e,"filteredRowsSet",cc(t.unstable_rowSpanning,o)),ot(e,"columnsChange",cc(t.unstable_rowSpanning,o)),m.useEffect(()=>{t.unstable_rowSpanning?e.current.state.rowSpanning===Gu&&o():e.current.state.rowSpanning!==Gu&&e.current.setState(i=>q({},i,{rowSpanning:Gu}))},[e,o,t.unstable_rowSpanning])},Vte=(e,t,n)=>q({},e,{listViewColumn:t.unstable_listColumn?q({},t.unstable_listColumn,{computedWidth:bC(n)}):void 0});function Gte(e,t){const n=()=>{e.current.setState(i=>i.listViewColumn?q({},i,{listViewColumn:q({},i.listViewColumn,{computedWidth:bC(e)})}):i)},r=m.useRef(null);ot(e,"viewportInnerSizeChange",i=>{r.current!==i.width&&(r.current=i.width,n())}),ot(e,"columnVisibilityModelChange",n),Ln(()=>{const i=t.unstable_listColumn;i&&e.current.setState(l=>q({},l,{listViewColumn:q({},i,{computedWidth:bC(e)})}))},[e,t.unstable_listColumn]),m.useEffect(()=>{t.unstable_listView&&t.unstable_listColumn},[t.unstable_listView,t.unstable_listColumn])}function bC(e){return Ar(e.current.state).viewportInnerSize.width}const Ute=(e,t)=>{const n=hee(e,t);return dte(n,t),ite(n),Or(fee,n,t),Or(ate,n,t),Or(wee,n,t),Or(tte,n,t),Or(Wee,n,t),Or(Jee,n,t),Or(Dee,n,t),Or(fte,n,t),Or(Gee,n,t),Or($ee,n,t),Or(Bte,n,t),Or(jee,n,t),Or(Ate,n,t),Or(vee,n,t),Or(Pte,n,t),Or(wQ,n,t),Or(yte,n,t),Or(wte,n,t),Or(Vte,n,t),_ee(n,t),cte(n,t),See(n,t),nte(n,t),Wte(n,t),lte(n,t),kte(n),Tte(n,t),ete(n,t),Aee(n,t),Uee(n,t),Lee(n,t),pte(n,t),kee(n,t),Nte(n,t),Vee(n,t),Ste(n,t),hte(n,t),Cee(n),Eee(n,t),Ree(n,t),bee(n,t),bte(n,t),mte(n,t),jte(n),SQ(n,t),Gte(n,t),n},qte=e=>{const{classes:t,headerAlign:n,isDragging:r,isLastColumn:o,showLeftBorder:i,showRightBorder:l,groupId:c,pinnedPosition:u}=e,f={root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",r&&"columnHeader--moving",l&&"columnHeader--withRightBorder",i&&"columnHeader--withLeftBorder","withBorderColor",c===null?"columnHeader--emptyGroup":"columnHeader--filledGroup",u===Qt.LEFT&&"columnHeader--pinnedLeft",u===Qt.RIGHT&&"columnHeader--pinnedRight",o&&"columnHeader--last"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]};return Be(f,en,t)};function Kte(e){var B;const{groupId:t,width:n,depth:r,maxDepth:o,fields:i,height:l,colIndex:c,hasFocus:u,tabIndex:f,isLastColumn:h,pinnedPosition:p,pinnedOffset:g}=e,y=gt(),b=Yr(),v=m.useRef(null),C=Ut(),S=He(C,R$),j=t?S[t]:{},{headerName:w=t??"",description:k="",headerAlign:P=void 0}=j;let T;const $=t&&((B=S[t])==null?void 0:B.renderHeaderGroup),M=m.useMemo(()=>({groupId:t,headerName:w,description:k,depth:r,maxDepth:o,fields:i,colIndex:c,isLastColumn:h}),[t,w,k,r,o,i,c,h]);t&&$&&(T=$(M));const R=q({},e,{classes:y.classes,headerAlign:P,depth:r,isDragging:!1}),E=w??t,O=Sn(),A=t===null?`empty-group-cell-${O}`:t,N=qte(R);m.useLayoutEffect(()=>{if(u){const G=v.current.querySelector('[tabindex="0"]')||v.current;if(!G)return;if(iS())G.focus({preventScroll:!0});else{const _=C.current.getScrollPosition();G.focus(),C.current.scroll(_)}}},[C,u]);const F=m.useCallback(V=>G=>{Th(G)||C.current.publishEvent(V,M,G)},[C,M]),L=m.useMemo(()=>({onKeyDown:F("columnGroupHeaderKeyDown"),onFocus:F("columnGroupHeaderFocus"),onBlur:F("columnGroupHeaderBlur")}),[F]),D=typeof j.headerClassName=="function"?j.headerClassName(M):j.headerClassName,H=m.useMemo(()=>ly(q({},e.style),b,p,g),[p,g,e.style,b]);return s.jsx(Y$,q({ref:v,classes:N,columnMenuOpen:!1,colIndex:c,height:l,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:f,isDraggable:!1,headerComponent:T,headerClassName:D,description:k,elementId:A,width:n,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:E,"aria-colspan":i.length,"data-fields":`|-${i.join("-|-")}-|`,style:H},L))}const RE=Ce("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow",overridesResolver:(e,t)=>t.columnHeaderRow})({display:"flex"}),Qte=e=>{const{visibleColumns:t,sortColumnLookup:n,filterColumnLookup:r,columnHeaderTabIndexState:o,columnGroupHeaderTabIndexState:i,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:f,columnVisibility:h,columnGroupsHeaderStructure:p,hasOtherElementInTabSequence:g}=e,[y,b]=m.useState(""),[v,C]=m.useState(""),S=Vs(),j=gt(),w=He(S,M$),k=He(S,_a),P=He(S,CQ),T=He(S,Yd),$=He(S,Pl),M=N$(k,P,T.left.length),R=He(S,Xx),E=He(S,WR),O=He(S,M7),A=He(S,R7),N=He(S,VR),F=m.useCallback(ne=>C(ne.field),[]),L=m.useCallback(()=>C(""),[]),D=m.useCallback(ne=>b(ne.field),[]),H=m.useCallback(()=>b(""),[]),B=m.useMemo(()=>T.left.length?{firstColumnIndex:0,lastColumnIndex:T.left.length}:null,[T.left.length]),V=m.useMemo(()=>T.right.length?{firstColumnIndex:t.length-T.right.length,lastColumnIndex:t.length}:null,[T.right.length,t.length]);ot(S,"columnResizeStart",F),ot(S,"columnResizeStop",L),ot(S,"columnHeaderDragStart",D),ot(S,"columnHeaderDragEnd",H);const G=ne=>{const{renderContext:re=P}=ne||{},Y=re.firstColumnIndex,ie=re.lastColumnIndex;return{renderedColumns:t.slice(Y,ie),firstColumnToRender:Y,lastColumnToRender:ie}},_=(ne,re,Y,ie=!1)=>{const ce=(ne==null?void 0:ne.position)===Qt.RIGHT,he=(ne==null?void 0:ne.position)===void 0,de=T.right.length>0&&ce||T.right.length===0&&he,le=M-Y;return s.jsxs(m.Fragment,{children:[he&&s.jsx("div",{role:"presentation",style:{width:le}}),re,he&&s.jsx("div",{role:"presentation",className:Me(te.filler,ie&&te["filler--borderBottom"])}),de&&s.jsx(cS,{header:!0,pinnedRight:ce,borderBottom:ie,borderTop:!1})]})},U=(ne,re={})=>{const{renderedColumns:Y,firstColumnToRender:ie}=G(ne),ce=[];for(let he=0;he<Y.length;he+=1){const de=Y[he],le=ie+he,ge=le===0,Se=o!==null&&o.field===de.field||ge&&!g?0:-1,ke=l!==null&&l.field===de.field,we=f.open&&f.field===de.field,Oe=ne==null?void 0:ne.position,be=jp(Oe,de.computedWidth,le,k,R,N),Fe=Oe===Qt.RIGHT?Y[he-1]:Y[he+1],Ve=Fe?l!==null&&l.field===Fe.field:!1,De=le+1===k.length-T.right.length,Ze=he,Ae=Y.length,st=ax(Oe,Ze),qe=lx(Oe,Ze,Ae,j.showColumnVerticalBorder,E);ce.push(s.jsx(NX,q({},n[de.field],{columnMenuOpen:we,filterItemsCounter:r[de.field]&&r[de.field].length,headerHeight:O,isDragging:de.field===y,colDef:de,colIndex:le,isResizing:v===de.field,isLast:le===k.length-1,hasFocus:ke,tabIndex:Se,pinnedPosition:Oe,pinnedOffset:be,isLastUnpinned:De,isSiblingFocused:Ve,showLeftBorder:st,showRightBorder:qe},re),de.field))}return _(ne,ce,0)},Z=()=>s.jsxs(RE,{role:"row","aria-rowindex":u+1,ownerState:j,className:te["row--borderBottom"],children:[B&&U({position:Qt.LEFT,renderContext:B},{disableReorder:!0}),U({renderContext:P}),V&&U({position:Qt.RIGHT,renderContext:V},{disableReorder:!0,separatorSide:aS.Left})]}),Q=({depth:ne,params:re})=>{var Ae,st;const Y=G(re);if(Y.renderedColumns.length===0)return null;const{firstColumnToRender:ie,lastColumnToRender:ce}=Y,he=p[ne],de=t[ie].field,le=((Ae=w[de])==null?void 0:Ae[ne])??null,ge=he.findIndex(({groupId:qe,columnFields:et})=>qe===le&&et.includes(de)),Se=t[ce-1].field,ke=((st=w[Se])==null?void 0:st[ne])??null,we=he.findIndex(({groupId:qe,columnFields:et})=>qe===ke&&et.includes(Se)),Oe=he.slice(ge,we+1).map(qe=>q({},qe,{columnFields:qe.columnFields.filter(et=>h[et]!==!1)})).filter(qe=>qe.columnFields.length>0),be=Oe[0].columnFields.indexOf(de),Ve=Oe[0].columnFields.slice(0,be).reduce((qe,et)=>{const oe=$[et];return qe+(oe.computedWidth??0)},0);let De=ie;const Ze=Oe.map(({groupId:qe,columnFields:et},oe)=>{const fe=c!==null&&c.depth===ne&&et.includes(c.field),Ie=i!==null&&i.depth===ne&&et.includes(i.field)?0:-1,$e={width:et.reduce((me,Ne)=>me+$[Ne].computedWidth,0),fields:et,colIndex:De},pt=re.position,vt=jp(pt,$e.width,De,k,R,N);De+=et.length;let Je=oe;return pt===Qt.LEFT&&(Je=De-1),s.jsx(Kte,{groupId:qe,width:$e.width,fields:$e.fields,colIndex:$e.colIndex,depth:ne,isLastColumn:oe===Oe.length-1,maxDepth:u,height:A,hasFocus:fe,tabIndex:Ie,pinnedPosition:pt,pinnedOffset:vt,showLeftBorder:ax(pt,Je),showRightBorder:lx(pt,Je,Oe.length,j.showColumnVerticalBorder,E)},oe)});return _(re,Ze,Ve)};return{renderContext:P,leftRenderContext:B,rightRenderContext:V,pinnedColumns:T,visibleColumns:t,columnPositions:k,getFillers:_,getColumnHeadersRow:Z,getColumnsToRender:G,getColumnGroupHeadersRows:()=>{if(u===0)return null;const ne=[];for(let re=0;re<u;re+=1)ne.push(s.jsxs(RE,{role:"row","aria-rowindex":re+1,ownerState:j,children:[B&&Q({depth:re,params:{position:Qt.LEFT,renderContext:B,maxLastColumn:B.lastColumnIndex}}),Q({depth:re,params:{renderContext:P}}),V&&Q({depth:re,params:{position:Qt.RIGHT,renderContext:V,maxLastColumn:V.lastColumnIndex}})]},re));return ne},getPinnedCellOffset:jp,isDragging:!!y,getInnerProps:()=>({role:"rowgroup"})}},Yte=["className"],Xte=e=>{const{classes:t}=e;return Be({root:["columnHeaders"]},en,t)},Zte=Dn("div",{name:"MuiDataGrid",slot:"ColumnHeaders",overridesResolver:(e,t)=>t.columnHeaders})({display:"flex",flexDirection:"column",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),Jte=sn(function(t,n){const{className:r}=t,o=St(t,Yte),i=gt(),l=Xte(i);return s.jsx(Zte,q({className:Me(l.root,r),ownerState:i},o,{role:"presentation",ref:n}))}),ene=["className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],tne=sn(function(t,n){const{visibleColumns:r,sortColumnLookup:o,filterColumnLookup:i,columnHeaderTabIndexState:l,columnGroupHeaderTabIndexState:c,columnHeaderFocus:u,columnGroupHeaderFocus:f,headerGroupingMaxDepth:h,columnMenuState:p,columnVisibility:g,columnGroupsHeaderStructure:y,hasOtherElementInTabSequence:b}=t,v=St(t,ene),{getInnerProps:C,getColumnHeadersRow:S,getColumnGroupHeadersRows:j}=Qte({visibleColumns:r,sortColumnLookup:o,filterColumnLookup:i,columnHeaderTabIndexState:l,columnGroupHeaderTabIndexState:c,columnHeaderFocus:u,columnGroupHeaderFocus:f,headerGroupingMaxDepth:h,columnMenuState:p,columnVisibility:g,columnGroupsHeaderStructure:y,hasOtherElementInTabSequence:b});return s.jsxs(Jte,q({},v,C(),{ref:n,children:[j(),S()]}))}),nne=El(tne);function rne(e){return null}function one(e){return null}const sne=sn(function(t,n){const o=Ut().current.getLocaleText("noResultsOverlayLabel");return s.jsx(lS,q({},t,{ref:n,children:o}))}),ine=["sortingOrder"],lne=m.memo(function(t){const{sortingOrder:n}=t,r=St(t,ine),o=gt(),[i]=n,l=i==="asc"?o.slots.columnSortedAscendingIcon:o.slots.columnSortedDescendingIcon;return l?s.jsx(l,q({},r)):null}),ane=["native"];function cne(e){let{native:t}=e,n=St(e,ane);return t?s.jsx("option",q({},n)):s.jsx(it,q({},n))}const une={booleanCellTrueIcon:aZ,booleanCellFalseIcon:Vv,columnMenuIcon:oZ,openFilterButtonIcon:XX,filterPanelDeleteIcon:Vv,columnFilteredIcon:lE,columnSelectorIcon:JX,columnUnsortedIcon:lne,columnSortedAscendingIcon:rE,columnSortedDescendingIcon:oE,columnResizeIcon:eZ,densityCompactIcon:tZ,densityStandardIcon:nZ,densityComfortableIcon:rZ,exportIcon:lZ,moreActionsIcon:cZ,treeDataCollapseIcon:iE,treeDataExpandIcon:sE,groupingCriteriaCollapseIcon:iE,groupingCriteriaExpandIcon:sE,detailPanelExpandIcon:aE,detailPanelCollapseIcon:sZ,rowReorderIcon:cE,quickFilterIcon:ZX,quickFilterClearIcon:Vv,columnMenuHideIcon:uZ,columnMenuSortAscendingIcon:rE,columnMenuSortDescendingIcon:oE,columnMenuFilterIcon:lE,columnMenuManageColumnsIcon:dZ,columnMenuClearIcon:fZ,loadIcon:iZ,filterPanelAddIcon:aE,filterPanelRemoveAllIcon:pZ,columnReorderIcon:cE},dne=q({},une,{baseBadge:lp,baseCheckbox:$s,baseDivider:Ho,baseTextField:Wt,baseFormControl:_n,baseSelect:On,baseButton:Le,baseIconButton:mt,baseInputAdornment:ds,baseTooltip:Pt,basePopper:Uc,baseInputLabel:Hn,baseSelectOption:cne,baseChip:Ge}),fne=q({},dne,{cell:MY,skeletonCell:AY,columnHeaderFilterIconButton:QX,columnHeaderSortIcon:qX,columnMenu:MZ,columnHeaders:nne,detailPanels:rne,footer:IJ,footerRowCount:HJ,toolbar:null,pinnedRows:one,loadingOverlay:$J,noResultsOverlay:sne,noRowsOverlay:OJ,pagination:AJ,filterPanel:iJ,columnsPanel:LZ,columnsManagement:uJ,panel:_Z,row:qJ}),pne={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid",unstable_listView:!1},hne=fne,mne=e=>{const t=Xr(),n=SY(m.useMemo(()=>vM({props:e,theme:t,name:"MuiDataGrid"}),[t,e])),r=m.useMemo(()=>q({},O7,n.localeText),[n.localeText]),o=m.useMemo(()=>CY({defaultSlots:hne,slots:n.slots}),[n.slots]),i=m.useMemo(()=>Object.keys(gC).reduce((l,c)=>(l[c]=n[c]??gC[c],l),{}),[n]);return m.useMemo(()=>q({},n,i,{localeText:r,slots:o},pne),[n,r,o,i])},gne={hooks:{useGridAriaAttributes:KJ,useGridRowAriaAttributes:QJ,useCellAggregationResult:()=>null}},fO=sn(function(t,n){var i;const r=mne(t),o=Ute(r.apiRef,r);return s.jsx(YJ,{privateApiRef:o,configuration:gne,props:r,children:s.jsx(tX,q({className:r.className,style:r.style,sx:r.sx},r.forwardedProps,(i=r.slotProps)==null?void 0:i.root,{ref:n}))})}),fi=m.memo(fO);fO.propTypes={apiRef:ve.shape({current:ve.object.isRequired}),"aria-label":ve.string,"aria-labelledby":ve.string,autoHeight:ve.bool,autoPageSize:ve.bool,autosizeOnMount:ve.bool,autosizeOptions:ve.shape({columns:ve.arrayOf(ve.string),disableColumnVirtualization:ve.bool,expand:ve.bool,includeHeaders:ve.bool,includeOutliers:ve.bool,outliersFactor:ve.number}),cellModesModel:ve.object,checkboxSelection:ve.bool,classes:ve.object,clipboardCopyCellDelimiter:ve.string,columnBufferPx:ve.number,columnGroupHeaderHeight:ve.number,columnGroupingModel:ve.arrayOf(ve.object),columnHeaderHeight:ve.number,columns:ve.arrayOf(ve.object).isRequired,columnVisibilityModel:ve.object,density:ve.oneOf(["comfortable","compact","standard"]),disableAutosize:ve.bool,disableColumnFilter:ve.bool,disableColumnMenu:ve.bool,disableColumnResize:ve.bool,disableColumnSelector:ve.bool,disableColumnSorting:ve.bool,disableDensitySelector:ve.bool,disableEval:ve.bool,disableMultipleRowSelection:ve.bool,disableRowSelectionOnClick:ve.bool,disableVirtualization:ve.bool,editMode:ve.oneOf(["cell","row"]),estimatedRowCount:ve.number,experimentalFeatures:ve.shape({warnIfFocusStateIsNotSynced:ve.bool}),filterDebounceMs:ve.number,filterMode:ve.oneOf(["client","server"]),filterModel:ve.shape({items:ve.arrayOf(ve.shape({field:ve.string.isRequired,id:ve.oneOfType([ve.number,ve.string]),operator:ve.string.isRequired,value:ve.any})).isRequired,logicOperator:ve.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:ve.bool,quickFilterLogicOperator:ve.oneOf(["and","or"]),quickFilterValues:ve.array}),forwardedProps:ve.object,getCellClassName:ve.func,getDetailPanelContent:ve.func,getEstimatedRowHeight:ve.func,getRowClassName:ve.func,getRowHeight:ve.func,getRowId:ve.func,getRowSpacing:ve.func,hideFooter:ve.bool,hideFooterPagination:ve.bool,hideFooterSelectedRowCount:ve.bool,ignoreDiacritics:ve.bool,ignoreValueFormatterDuringExport:ve.oneOfType([ve.shape({clipboardExport:ve.bool,csvExport:ve.bool}),ve.bool]),indeterminateCheckboxAction:ve.oneOf(["deselect","select"]),initialState:ve.object,isCellEditable:ve.func,isRowSelectable:ve.func,keepNonExistentRowsSelected:ve.bool,loading:ve.bool,localeText:ve.object,logger:ve.shape({debug:ve.func.isRequired,error:ve.func.isRequired,info:ve.func.isRequired,warn:ve.func.isRequired}),logLevel:ve.oneOf(["debug","error","info","warn",!1]),nonce:ve.string,onCellClick:ve.func,onCellDoubleClick:ve.func,onCellEditStart:ve.func,onCellEditStop:ve.func,onCellKeyDown:ve.func,onCellModesModelChange:ve.func,onClipboardCopy:ve.func,onColumnHeaderClick:ve.func,onColumnHeaderContextMenu:ve.func,onColumnHeaderDoubleClick:ve.func,onColumnHeaderEnter:ve.func,onColumnHeaderLeave:ve.func,onColumnHeaderOut:ve.func,onColumnHeaderOver:ve.func,onColumnOrderChange:ve.func,onColumnResize:ve.func,onColumnVisibilityModelChange:ve.func,onColumnWidthChange:ve.func,onDensityChange:ve.func,onFilterModelChange:ve.func,onMenuClose:ve.func,onMenuOpen:ve.func,onPaginationMetaChange:ve.func,onPaginationModelChange:ve.func,onPreferencePanelClose:ve.func,onPreferencePanelOpen:ve.func,onProcessRowUpdateError:ve.func,onResize:ve.func,onRowClick:ve.func,onRowCountChange:ve.func,onRowDoubleClick:ve.func,onRowEditStart:ve.func,onRowEditStop:ve.func,onRowModesModelChange:ve.func,onRowSelectionModelChange:ve.func,onSortModelChange:ve.func,onStateChange:ve.func,pageSizeOptions:ve.arrayOf(ve.oneOfType([ve.number,ve.shape({label:ve.string.isRequired,value:ve.number.isRequired})]).isRequired),pagination:ve.oneOf([!0]),paginationMeta:ve.shape({hasNextPage:ve.bool}),paginationMode:ve.oneOf(["client","server"]),paginationModel:ve.shape({page:ve.number.isRequired,pageSize:ve.number.isRequired}),processRowUpdate:ve.func,resetPageOnSortFilter:ve.bool,resizeThrottleMs:ve.number,rowBufferPx:ve.number,rowCount:ve.number,rowHeight:ve.number,rowModesModel:ve.object,rowPositionsDebounceMs:ve.number,rows:ve.arrayOf(ve.object),rowSelection:ve.bool,rowSelectionModel:ve.oneOfType([ve.arrayOf(ve.oneOfType([ve.number,ve.string]).isRequired),ve.number,ve.string]),rowSpacingType:ve.oneOf(["border","margin"]),scrollbarSize:ve.number,showCellVerticalBorder:ve.bool,showColumnVerticalBorder:ve.bool,slotProps:ve.object,slots:ve.object,sortingMode:ve.oneOf(["client","server"]),sortingOrder:ve.arrayOf(ve.oneOf(["asc","desc"])),sortModel:ve.arrayOf(ve.shape({field:ve.string.isRequired,sort:ve.oneOf(["asc","desc"])})),sx:ve.oneOfType([ve.arrayOf(ve.oneOfType([ve.func,ve.object,ve.bool])),ve.func,ve.object]),unstable_rowSpanning:ve.bool,virtualizeColumnsWithAutoRowHeight:ve.bool};function xne({connectionId:e,connection:t,schemas:n,isLoading:r,onViewTables:o}){const i=Tr(),l=oo(),[c,u]=m.useState(!1),[f,h]=m.useState(!1),[p,g]=m.useState(null),[y,b]=m.useState(""),[v,C]=m.useState(""),[S,j]=m.useState(null),w=vr({mutationFn:N=>xn.createSchema(e,N),onSuccess:(N,F)=>{i.invalidateQueries({queryKey:["schemas",e]}),l.success(`Schema "${F}" created successfully`),P()},onError:N=>{j(N instanceof Error?N.message:"Failed to create schema")}}),k=vr({mutationFn:N=>xn.deleteSchema(e,N),onSuccess:(N,F)=>{i.invalidateQueries({queryKey:["schemas",e]}),l.success(`Schema "${F}" deleted successfully`),T()},onError:N=>{l.error(N instanceof Error?N.message:"Failed to delete schema")}}),P=()=>{u(!1),b(""),j(null)},T=()=>{h(!1),g(null),C("")},$=()=>{if(!y.trim()){j("Schema name is required");return}if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(y)){j("Invalid name. Use only letters, numbers, and underscores.");return}w.mutate(y.trim())},M=()=>{p&&v===p&&k.mutate(p)},R=()=>{i.invalidateQueries({queryKey:["schemas",e]})},E=(t==null?void 0:t.engine)==="sqlite",O=[{field:"name",headerName:"Schema Name",flex:1,minWidth:200,renderCell:N=>s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx($i,{fontSize:"small",sx:{color:"primary.main",opacity:.7}}),s.jsx(J,{fontFamily:"monospace",children:N.value})]})},{field:"actions",headerName:"Actions",width:120,sortable:!1,renderCell:N=>{const F=["information_schema","pg_catalog","pg_toast"].includes(N.row.name);return s.jsxs(K,{sx:{display:"flex",gap:1},children:[o&&s.jsx(Pt,{title:"View Tables",children:s.jsx(mt,{size:"small",onClick:()=>o(N.row.name),children:s.jsx(xo,{fontSize:"small"})})}),s.jsx(Pt,{title:F?"Cannot delete system schema":"Delete schema",children:s.jsx("span",{children:s.jsx(mt,{size:"small",color:"error",disabled:F||E,onClick:()=>{g(N.row.name),h(!0)},children:s.jsx(dr,{fontSize:"small"})})})})]})}}],A=n.map(N=>({id:N,name:N}));return r?s.jsx(cn,{children:s.jsx(to,{height:300})}):s.jsxs(K,{children:[s.jsxs(K,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[s.jsxs(J,{variant:"h6",fontWeight:600,children:["Schemas (",n.length,")"]}),s.jsxs(K,{sx:{display:"flex",gap:1},children:[s.jsx(Le,{variant:"outlined",size:"small",startIcon:s.jsx(Eo,{}),onClick:R,children:"Refresh"}),!E&&s.jsx(Le,{variant:"contained",size:"small",startIcon:s.jsx(Gn,{}),onClick:()=>u(!0),children:"Create Schema"})]})]}),E&&s.jsx(Nt,{severity:"info",sx:{mb:2},children:"SQLite does not support multiple schemas. The database file acts as a single schema."}),n.length===0?s.jsx(cn,{children:s.jsx(go,{icon:s.jsx($i,{}),title:"No schemas found",description:"This database has no schemas yet.",action:E?void 0:{label:"Create Schema",onClick:()=>u(!0)}})}):s.jsx(cn,{sx:{p:0},children:s.jsx(fi,{rows:A,columns:O,autoHeight:!0,disableRowSelectionOnClick:!0,pageSizeOptions:[10,25,50],initialState:{pagination:{paginationModel:{pageSize:10}}},sx:{border:"none","& .MuiDataGrid-cell":{borderColor:"divider",display:"flex",alignItems:"center"},"& .MuiDataGrid-columnHeaders":{bgcolor:"background.default",borderColor:"divider"}}})}),s.jsxs(gn,{open:c,onClose:P,maxWidth:"xs",fullWidth:!0,children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx($i,{color:"primary"}),"Create New Schema"]}),s.jsx(Cn,{children:s.jsxs(K,{sx:{pt:1},children:[S&&s.jsx(Nt,{severity:"error",sx:{mb:2},children:S}),s.jsx(Wt,{autoFocus:!0,fullWidth:!0,label:"Schema Name",value:y,onChange:N=>{b(N.target.value),j(null)},onKeyDown:N=>{N.key==="Enter"&&y.trim()&&$()},placeholder:"my_schema",helperText:"Use letters, numbers, and underscores",disabled:w.isPending})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:P,disabled:w.isPending,children:"Cancel"}),s.jsx(Le,{variant:"contained",onClick:$,disabled:!y.trim()||w.isPending,startIcon:w.isPending?s.jsx(At,{size:16}):s.jsx(Gn,{}),children:w.isPending?"Creating...":"Create"})]})]}),s.jsxs(gn,{open:f,onClose:T,maxWidth:"sm",fullWidth:!0,children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1,color:"error.main"},children:[s.jsx(Os,{}),"Delete Schema"]}),s.jsx(Cn,{children:s.jsxs(K,{sx:{pt:1},children:[s.jsxs(Nt,{severity:"error",sx:{mb:2},children:[s.jsxs(J,{variant:"body2",gutterBottom:!0,children:[s.jsx("strong",{children:"Warning:"})," This will permanently delete the schema"," ",s.jsxs("strong",{children:['"',p,'"']})," and ALL tables, data, and objects within it."]}),s.jsx(J,{variant:"body2",children:"This action cannot be undone."})]}),s.jsxs(J,{variant:"body2",sx:{mb:2},children:["To confirm, type the schema name: ",s.jsx("strong",{children:p})]}),s.jsx(Wt,{autoFocus:!0,fullWidth:!0,value:v,onChange:N=>C(N.target.value),placeholder:p||"",error:v.length>0&&v!==p,helperText:v.length>0&&v!==p?"Schema name does not match":"",disabled:k.isPending})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:T,disabled:k.isPending,children:"Cancel"}),s.jsx(Le,{variant:"contained",color:"error",onClick:M,disabled:v!==p||k.isPending,startIcon:k.isPending?s.jsx(At,{size:16}):s.jsx(dr,{}),children:k.isPending?"Deleting...":"Delete Schema"})]})]})]})}const yne=[{id:"vacuum",name:"VACUUM",description:"Reclaim storage occupied by dead tuples. Recommended after large DELETE operations.",icon:s.jsx(Ov,{}),engines:["postgres","sqlite"],getCommand:()=>"VACUUM",color:"#8b5cf6"},{id:"vacuum_full",name:"VACUUM FULL",description:"Aggressive vacuum that reclaims more space but requires exclusive lock. Use with caution.",icon:s.jsx(Ov,{}),engines:["postgres"],getCommand:()=>"VACUUM FULL",color:"#dc2626"},{id:"analyze",name:"ANALYZE",description:"Update statistics used by the query planner. Improves query performance.",icon:s.jsx(Yg,{}),engines:["postgres","sqlite"],getCommand:e=>e?`ANALYZE "${e}"`:"ANALYZE",requiresSchema:!1,color:"#06b6d4"},{id:"vacuum_analyze",name:"VACUUM ANALYZE",description:"Combines VACUUM and ANALYZE in one operation. Good for routine maintenance.",icon:s.jsx(Dw,{}),engines:["postgres"],getCommand:()=>"VACUUM ANALYZE",color:"#22c55e"},{id:"reindex",name:"REINDEX DATABASE",description:"Rebuild all indexes in the database. Useful after heavy write operations.",icon:s.jsx(Cr,{}),engines:["postgres"],getCommand:()=>"REINDEX DATABASE CURRENT_DATABASE",color:"#f59e0b"},{id:"optimize",name:"OPTIMIZE TABLE",description:"Reorganize table storage and rebuild indexes. MySQL/MariaDB equivalent of VACUUM.",icon:s.jsx(Ov,{}),engines:["mysql","mariadb"],getCommand:e=>`OPTIMIZE TABLE ${e?`\`${e}\`.*`:"*"}`,requiresSchema:!0,color:"#8b5cf6"},{id:"analyze_mysql",name:"ANALYZE TABLE",description:"Update table statistics for the query optimizer.",icon:s.jsx(Yg,{}),engines:["mysql","mariadb"],getCommand:e=>`ANALYZE TABLE ${e?`\`${e}\`.*`:"*"}`,requiresSchema:!0,color:"#06b6d4"}];function bne({connectionId:e,connection:t,schemas:n,selectedSchema:r,onSchemaChange:o}){const i=oo(),[l,c]=m.useState(r||""),u=r??l,[f,h]=m.useState([]),[p,g]=m.useState(null),y=j=>{c(j),o==null||o(j)},b=vr({mutationFn:async({operation:j,schema:w})=>{const k=Date.now();let P=j.getCommand(w);return j.id==="reindex"&&(t==null?void 0:t.engine)==="postgres"&&(P=`REINDEX DATABASE "${t.database}"`),await mo.execute(e,P),{duration:Date.now()-k}},onSuccess:(j,{operation:w})=>{const k={operationId:w.id,success:!0,message:`${w.name} completed successfully`,duration:j.duration};h(P=>[k,...P.slice(0,9)]),i.success(`${w.name} completed in ${(j.duration/1e3).toFixed(2)}s`),g(null)},onError:(j,{operation:w})=>{const k={operationId:w.id,success:!1,message:j instanceof Error?j.message:"Operation failed"};h(P=>[k,...P.slice(0,9)]),i.error(`${w.name} failed: ${k.message}`),g(null)}}),v=j=>{g(j.id),b.mutate({operation:j,schema:j.requiresSchema?u:void 0})},C=yne.filter(j=>(t==null?void 0:t.engine)&&j.engines.includes(t.engine)),S=(t==null?void 0:t.engine)==="sqlite";return s.jsxs(K,{children:[s.jsx(Nt,{severity:"info",sx:{mb:3},children:s.jsx(J,{variant:"body2",children:"Maintenance operations help keep your database running efficiently. Some operations may temporarily lock tables or impact performance. Run during low-traffic periods when possible."})}),!S&&n.length>0&&s.jsx(K,{sx:{mb:3},children:s.jsxs(_n,{size:"small",sx:{minWidth:200},children:[s.jsx(Hn,{children:"Target Schema"}),s.jsxs(On,{value:u||"",onChange:j=>y(j.target.value),label:"Target Schema",children:[s.jsx(it,{value:"",children:"All schemas"}),n.map(j=>s.jsx(it,{value:j,children:j},j))]})]})}),s.jsx(K,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(300px, 1fr))",gap:2,mb:3},children:C.map(j=>{const w=p===j.id,k=j.requiresSchema&&!u;return s.jsx(cn,{sx:{p:2.5},children:s.jsxs(K,{sx:{display:"flex",alignItems:"flex-start",gap:2},children:[s.jsx(K,{sx:{p:1.5,borderRadius:2,bgcolor:`${j.color}15`,color:j.color,display:"flex",alignItems:"center",justifyContent:"center"},children:j.icon}),s.jsxs(K,{sx:{flex:1},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[s.jsx(J,{variant:"subtitle1",fontWeight:600,children:j.name}),j.id==="vacuum_full"&&s.jsx(Ge,{label:"CAUTION",size:"small",sx:{height:18,fontSize:9,bgcolor:"rgba(220, 38, 38, 0.15)",color:"#dc2626"}})]}),s.jsx(J,{variant:"body2",color:"text.secondary",sx:{mb:2},children:j.description}),s.jsx(Le,{variant:"outlined",size:"small",onClick:()=>v(j),disabled:w||k||(t==null?void 0:t.readOnly),startIcon:w?s.jsx(At,{size:14}):j.icon,sx:{borderColor:j.color,color:j.color,"&:hover":{borderColor:j.color,bgcolor:`${j.color}10`}},children:w?"Running...":`Run ${j.name}`}),k&&s.jsx(J,{variant:"caption",color:"warning.main",sx:{display:"block",mt:1},children:"Select a schema first"})]})]})},j.id)})}),(t==null?void 0:t.readOnly)&&s.jsx(Nt,{severity:"warning",sx:{mb:3},children:"This connection is read-only. Maintenance operations are disabled."}),f.length>0&&s.jsxs(cn,{children:[s.jsx(J,{variant:"h6",fontWeight:600,gutterBottom:!0,children:"Recent Operations"}),s.jsx(K,{sx:{display:"flex",flexDirection:"column",gap:1},children:f.map((j,w)=>s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:2,p:1.5,bgcolor:j.success?"rgba(34, 197, 94, 0.1)":"rgba(220, 38, 38, 0.1)",borderRadius:1,border:1,borderColor:j.success?"rgba(34, 197, 94, 0.3)":"rgba(220, 38, 38, 0.3)"},children:[j.success?s.jsx(Il,{sx:{color:"success.main"}}):s.jsx(Dw,{sx:{color:"error.main"}}),s.jsx(K,{sx:{flex:1},children:s.jsx(J,{variant:"body2",children:j.message})}),j.duration&&s.jsx(Ge,{label:`${(j.duration/1e3).toFixed(2)}s`,size:"small",sx:{height:22,fontSize:11}})]},w))})]})]})}function vne({connectionId:e,connection:t,schemas:n,isLoading:r,initialSchema:o,onSchemaViewed:i,onManageTable:l,onSchemaChange:c}){const u=Ko(),f=Tr(),h=oo(),[p,g]=m.useState(()=>o&&n.includes(o)?o:n.includes("public")?"public":n.includes("main")?"main":n[0]||""),[y,b]=m.useState(!1),[v,C]=m.useState(!1),[S,j]=m.useState(null),[w,k]=m.useState(""),[P,T]=m.useState(""),[$,M]=m.useState(!1),[R,E]=m.useState(!1);m.useMemo(()=>{o&&n.includes(o)&&(g(o),i==null||i())},[o,n,i]),m.useMemo(()=>{n.length>0&&!p&&(n.includes("public")?g("public"):n.includes("main")?g("main"):n[0]&&g(n[0]))},[n,p]);const{data:O=[],isLoading:A,refetch:N}=Ft({queryKey:["tables",e,p],queryFn:()=>xn.getTables(e,p),enabled:!!e&&!!p}),F=Z=>{u(`/query/${e}?schema=${Z.schema}&table=${Z.name}`)},L=Z=>(t==null?void 0:t.engine)==="mysql"||(t==null?void 0:t.engine)==="mariadb"?`\`${Z}\``:`"${Z}"`,D=(Z,Q)=>{const ee=L(Z),ne=L(Q);return(t==null?void 0:t.engine)==="sqlite"?ne:`${ee}.${ne}`},H=async()=>{if(w.trim()){M(!0);try{const Q=`CREATE TABLE ${D(p,w.trim())} (id SERIAL PRIMARY KEY);`;await mo.execute(e,Q),await N(),f.invalidateQueries({queryKey:["tables",e]}),h.success(`Table "${w}" created`),b(!1),k("")}catch(Z){h.error(Z instanceof Error?Z.message:"Failed to create table")}finally{M(!1)}}},B=async()=>{if(!(!S||P!==S.name)){E(!0);try{const Q=`DROP TABLE ${D(S.schema,S.name)};`;await mo.execute(e,Q),await N(),f.invalidateQueries({queryKey:["tables",e]}),h.success(`Table "${S.name}" dropped`),C(!1),j(null),T("")}catch(Z){h.error(Z instanceof Error?Z.message:"Failed to drop table")}finally{E(!1)}}},V=()=>{b(!1),k("")},G=()=>{C(!1),j(null),T("")},_=[{field:"name",headerName:"Table Name",flex:1,minWidth:200,renderCell:Z=>s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(xo,{fontSize:"small",sx:{color:"primary.main",opacity:.7}}),s.jsx(J,{fontFamily:"monospace",children:Z.value})]})},{field:"type",headerName:"Type",width:120,renderCell:Z=>s.jsx(Ge,{label:Z.value,size:"small",sx:{height:22,fontSize:11,bgcolor:Z.value==="table"?"rgba(34, 197, 94, 0.15)":"rgba(99, 102, 241, 0.15)",color:Z.value==="table"?"rgb(34, 197, 94)":"rgb(99, 102, 241)"}})},{field:"rowCount",headerName:"Rows",width:120,align:"right",headerAlign:"right",renderCell:Z=>s.jsx(J,{fontFamily:"monospace",color:"text.secondary",children:Z.value>=0?Z.value.toLocaleString():"-"})},{field:"actions",headerName:"Actions",width:220,sortable:!1,renderCell:Z=>s.jsxs(K,{sx:{display:"flex",gap:.5},children:[s.jsx(Pt,{title:"Query Table",children:s.jsx(mt,{size:"small",onClick:()=>F(Z.row),children:s.jsx(Cl,{fontSize:"small"})})}),s.jsx(Pt,{title:"Manage Table",children:s.jsx(mt,{size:"small",color:"primary",onClick:()=>l==null?void 0:l(Z.row.schema,Z.row.name),children:s.jsx(Wd,{fontSize:"small"})})}),s.jsx(Pt,{title:"Drop Table",children:s.jsx(mt,{size:"small",color:"error",onClick:()=>{j(Z.row),C(!0)},disabled:t==null?void 0:t.readOnly,children:s.jsx(dr,{fontSize:"small"})})})]})}],U=O.map(Z=>({id:`${Z.schema}.${Z.name}`,...Z}));return r?s.jsx(cn,{children:s.jsx(to,{height:300})}):s.jsxs(K,{children:[s.jsxs(K,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,gap:2},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:2},children:[s.jsxs(_n,{size:"small",sx:{minWidth:200},children:[s.jsx(Hn,{children:"Schema"}),s.jsx(On,{value:p,onChange:Z=>{const Q=Z.target.value;g(Q),c==null||c(Q)},label:"Schema",children:n.map(Z=>s.jsx(it,{value:Z,children:Z},Z))})]}),s.jsxs(J,{variant:"body2",color:"text.secondary",children:[O.length," table",O.length!==1?"s":""]})]}),s.jsxs(K,{sx:{display:"flex",gap:1},children:[s.jsx(Le,{variant:"outlined",size:"small",startIcon:s.jsx(Eo,{}),onClick:()=>N(),children:"Refresh"}),s.jsx(Le,{variant:"contained",size:"small",startIcon:s.jsx(Gn,{}),onClick:()=>b(!0),disabled:t==null?void 0:t.readOnly,children:"Create Table"})]})]}),O.length===0?s.jsx(cn,{children:s.jsx(go,{icon:s.jsx(Nw,{}),title:"No tables found",description:`Schema "${p}" has no tables yet.`,action:{label:"Open Query Editor",onClick:()=>u(`/query/${e}?schema=${p}`)}})}):s.jsx(cn,{sx:{p:0},children:s.jsx(fi,{rows:U,columns:_,loading:A,autoHeight:!0,disableRowSelectionOnClick:!0,pageSizeOptions:[10,25,50,100],initialState:{pagination:{paginationModel:{pageSize:25}},sorting:{sortModel:[{field:"name",sort:"asc"}]}},sx:{border:"none","& .MuiDataGrid-cell":{borderColor:"divider",display:"flex",alignItems:"center"},"& .MuiDataGrid-columnHeaders":{bgcolor:"background.default",borderColor:"divider"}}})}),s.jsxs(gn,{open:y,onClose:V,maxWidth:"xs",fullWidth:!0,children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(xo,{color:"primary"}),"Create New Table"]}),s.jsx(Cn,{children:s.jsxs(K,{sx:{pt:1},children:[s.jsx(Nt,{severity:"info",sx:{mb:2},children:"Creates a simple table with an auto-increment ID column. You can add more columns using the Query Editor."}),s.jsx(Wt,{autoFocus:!0,fullWidth:!0,label:"Table Name",value:w,onChange:Z=>k(Z.target.value),onKeyDown:Z=>{Z.key==="Enter"&&w.trim()&&H()},placeholder:"my_table",helperText:`Will be created in schema: ${p}`,disabled:$})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:V,disabled:$,children:"Cancel"}),s.jsx(Le,{variant:"contained",onClick:H,disabled:!w.trim()||$,startIcon:$?s.jsx(At,{size:16}):s.jsx(Gn,{}),children:$?"Creating...":"Create"})]})]}),s.jsxs(gn,{open:v,onClose:G,maxWidth:"sm",fullWidth:!0,children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1,color:"error.main"},children:[s.jsx(Os,{}),"Drop Table"]}),s.jsx(Cn,{children:s.jsxs(K,{sx:{pt:1},children:[s.jsxs(Nt,{severity:"error",sx:{mb:2},children:[s.jsxs(J,{variant:"body2",gutterBottom:!0,children:[s.jsx("strong",{children:"Warning:"})," This will permanently delete the table"," ",s.jsxs("strong",{children:['"',S==null?void 0:S.name,'"']})," and ALL data within it."]}),s.jsx(J,{variant:"body2",children:"This action cannot be undone."})]}),s.jsxs(J,{variant:"body2",sx:{mb:2},children:["To confirm, type the table name: ",s.jsx("strong",{children:S==null?void 0:S.name})]}),s.jsx(Wt,{autoFocus:!0,fullWidth:!0,value:P,onChange:Z=>T(Z.target.value),placeholder:(S==null?void 0:S.name)||"",error:P.length>0&&P!==(S==null?void 0:S.name),helperText:P.length>0&&P!==(S==null?void 0:S.name)?"Table name does not match":"",disabled:R})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:G,disabled:R,children:"Cancel"}),s.jsx(Le,{variant:"contained",color:"error",onClick:B,disabled:P!==(S==null?void 0:S.name)||R,startIcon:R?s.jsx(At,{size:16}):s.jsx(dr,{}),children:R?"Dropping...":"Drop Table"})]})]})]})}function Yv(e){if(Array.isArray(e))return e;if(typeof e=="string"){if(e.startsWith("{")&&e.endsWith("}")){const t=e.slice(1,-1);return t?t.split(",").map(n=>n.trim().replace(/^"|"$/g,"")):[]}return e?[e]:[]}return[]}const $E={postgres:["integer","bigint","smallint","serial","bigserial","numeric","decimal","real","double precision","varchar","char","text","boolean","date","time","timestamp","timestamptz","interval","uuid","json","jsonb","bytea","array"],mysql:["int","bigint","smallint","tinyint","mediumint","decimal","float","double","varchar","char","text","mediumtext","longtext","boolean","tinyint(1)","date","time","datetime","timestamp","json","blob","binary","varbinary"],sqlite:["integer","real","text","blob","numeric"]};function Cne({connectionId:e,connection:t,schemas:n,isLoading:r,initialSchema:o,initialTable:i,onSelectionChange:l}){const c=Tr(),u=oo(),[f,h]=m.useState(()=>o&&n.includes(o)?o:n.includes("public")?"public":n.includes("main")?"main":n[0]||""),[p,g]=m.useState(i||""),[y,b]=m.useState(0);m.useEffect(()=>{o&&n.includes(o)&&o!==f&&h(o)},[o,n,f]),m.useEffect(()=>{i&&i!==p&&g(i)},[i,p]);const[v,C]=m.useState(!1),[S,j]=m.useState(!1),[w,k]=m.useState(!1),[P,T]=m.useState(!1),[$,M]=m.useState(!1),[R,E]=m.useState(!1),[O,A]=m.useState(!1),[N,F]=m.useState(null),[L,D]=m.useState(null),[H,B]=m.useState(null),[V,G]=m.useState(null),[_,U]=m.useState({name:"",dataType:"",nullable:!0,defaultValue:""}),[Z,Q]=m.useState({name:"",columns:[],isUnique:!1}),[ee,ne]=m.useState({name:"",columns:[],referencedSchema:"",referencedTable:"",referencedColumns:[],onDelete:"NO ACTION",onUpdate:"NO ACTION"});m.useMemo(()=>{n.length>0&&!f&&(n.includes("public")?h("public"):n.includes("main")?h("main"):n[0]&&h(n[0]))},[n,f]);const{data:re=[],isLoading:Y}=Ft({queryKey:["tables",e,f],queryFn:()=>xn.getTables(e,f),enabled:!!e&&!!f}),{data:ie,isLoading:ce,refetch:he}=Ft({queryKey:["tableSchema",e,f,p],queryFn:()=>xn.getTableSchema(e,f,p),enabled:!!e&&!!f&&!!p}),{data:de=[]}=Ft({queryKey:["tables",e,ee.referencedSchema],queryFn:()=>xn.getTables(e,ee.referencedSchema),enabled:!!e&&!!ee.referencedSchema&&R}),{data:le}=Ft({queryKey:["tableSchema",e,ee.referencedSchema,ee.referencedTable],queryFn:()=>xn.getTableSchema(e,ee.referencedSchema,ee.referencedTable),enabled:!!e&&!!ee.referencedSchema&&!!ee.referencedTable&&R}),ge=m.useCallback(oe=>(t==null?void 0:t.engine)==="mysql"||(t==null?void 0:t.engine)==="mariadb"?`\`${oe}\``:`"${oe}"`,[t==null?void 0:t.engine]),Se=m.useCallback((oe,fe)=>{const Ie=ge(oe),$e=ge(fe);return(t==null?void 0:t.engine)==="sqlite"?$e:`${Ie}.${$e}`},[t==null?void 0:t.engine,ge]),ke=vr({mutationFn:async oe=>mo.execute(e,oe),onSuccess:()=>{he(),c.invalidateQueries({queryKey:["tableSchema",e]})}}),we=async()=>{if(!_.name||!_.dataType)return;const oe=Se(f,p),fe=ge(_.name);let Ie=`ALTER TABLE ${oe} ADD COLUMN ${fe} ${_.dataType}`;_.nullable||(Ie+=" NOT NULL"),_.defaultValue&&(Ie+=` DEFAULT ${_.defaultValue}`);try{await ke.mutateAsync(Ie),u.success(`Column "${_.name}" added`),C(!1),U({name:"",dataType:"",nullable:!0,defaultValue:""})}catch($e){u.error($e instanceof Error?$e.message:"Failed to add column")}},Oe=async()=>{if(!N)return;const oe=Se(f,p),fe=ge(N.name),Ie=[];if((t==null?void 0:t.engine)==="postgres")_.dataType&&_.dataType!==N.dataType&&Ie.push(`ALTER TABLE ${oe} ALTER COLUMN ${fe} TYPE ${_.dataType}`),_.nullable!==N.nullable&&(_.nullable?Ie.push(`ALTER TABLE ${oe} ALTER COLUMN ${fe} DROP NOT NULL`):Ie.push(`ALTER TABLE ${oe} ALTER COLUMN ${fe} SET NOT NULL`)),_.defaultValue!==(N.defaultValue||"")&&(_.defaultValue?Ie.push(`ALTER TABLE ${oe} ALTER COLUMN ${fe} SET DEFAULT ${_.defaultValue}`):Ie.push(`ALTER TABLE ${oe} ALTER COLUMN ${fe} DROP DEFAULT`));else{let $e=`ALTER TABLE ${oe} MODIFY COLUMN ${fe} ${_.dataType||N.dataType}`;_.nullable||($e+=" NOT NULL"),_.defaultValue&&($e+=` DEFAULT ${_.defaultValue}`),Ie.push($e)}try{for(const $e of Ie)await ke.mutateAsync($e);u.success(`Column "${N.name}" updated`),j(!1),F(null),U({name:"",dataType:"",nullable:!0,defaultValue:""})}catch($e){u.error($e instanceof Error?$e.message:"Failed to update column")}},be=async()=>{if(!L)return;const oe=Se(f,p),fe=ge(L.name),Ie=`ALTER TABLE ${oe} DROP COLUMN ${fe}`;try{await ke.mutateAsync(Ie),u.success(`Column "${L.name}" deleted`),k(!1),D(null)}catch($e){u.error($e instanceof Error?$e.message:"Failed to delete column")}},Fe=async()=>{if(!Z.name||Z.columns.length===0)return;const oe=Se(f,p),fe=ge(Z.name),Ie=Z.columns.map(vt=>ge(vt)).join(", "),pt=`CREATE ${Z.isUnique?"UNIQUE ":""}INDEX ${fe} ON ${oe} (${Ie})`;try{await ke.mutateAsync(pt),u.success(`Index "${Z.name}" created`),T(!1),Q({name:"",columns:[],isUnique:!1})}catch(vt){u.error(vt instanceof Error?vt.message:"Failed to create index")}},Ve=async()=>{if(!H)return;const oe=ge(H.name);let fe;if((t==null?void 0:t.engine)==="postgres")fe=`DROP INDEX ${ge(f)}.${oe}`;else if((t==null?void 0:t.engine)==="mysql"||(t==null?void 0:t.engine)==="mariadb"){const Ie=Se(f,p);fe=`DROP INDEX ${oe} ON ${Ie}`}else fe=`DROP INDEX ${oe}`;try{await ke.mutateAsync(fe),u.success(`Index "${H.name}" deleted`),M(!1),B(null)}catch(Ie){u.error(Ie instanceof Error?Ie.message:"Failed to delete index")}},De=async()=>{if(!ee.name||ee.columns.length===0||!ee.referencedTable||ee.referencedColumns.length===0)return;const oe=Se(f,p),fe=ge(ee.name),Ie=ee.columns.map(Je=>ge(Je)).join(", "),$e=Se(ee.referencedSchema,ee.referencedTable),pt=ee.referencedColumns.map(Je=>ge(Je)).join(", "),vt=`ALTER TABLE ${oe} ADD CONSTRAINT ${fe} FOREIGN KEY (${Ie}) REFERENCES ${$e} (${pt}) ON DELETE ${ee.onDelete} ON UPDATE ${ee.onUpdate}`;try{await ke.mutateAsync(vt),u.success(`Foreign key "${ee.name}" created`),E(!1),ne({name:"",columns:[],referencedSchema:"",referencedTable:"",referencedColumns:[],onDelete:"NO ACTION",onUpdate:"NO ACTION"})}catch(Je){u.error(Je instanceof Error?Je.message:"Failed to create foreign key")}},Ze=async()=>{if(!V)return;const oe=Se(f,p),fe=ge(V.name);let Ie;(t==null?void 0:t.engine)==="mysql"||(t==null?void 0:t.engine)==="mariadb"?Ie=`ALTER TABLE ${oe} DROP FOREIGN KEY ${fe}`:Ie=`ALTER TABLE ${oe} DROP CONSTRAINT ${fe}`;try{await ke.mutateAsync(Ie),u.success(`Foreign key "${V.name}" deleted`),A(!1),G(null)}catch($e){u.error($e instanceof Error?$e.message:"Failed to delete foreign key")}},Ae=[{field:"name",headerName:"Column Name",flex:1,minWidth:150,renderCell:oe=>s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[oe.row.isPrimaryKey&&s.jsx(Pt,{title:"Primary Key",children:s.jsx(ri,{fontSize:"small",sx:{color:"warning.main"}})}),s.jsx(J,{fontFamily:"monospace",children:oe.value})]})},{field:"dataType",headerName:"Data Type",width:150,renderCell:oe=>s.jsx(Ge,{label:oe.value,size:"small",sx:{height:22,fontSize:11,fontFamily:"monospace",bgcolor:"rgba(99, 102, 241, 0.15)",color:"rgb(99, 102, 241)"}})},{field:"nullable",headerName:"Nullable",width:100,renderCell:oe=>s.jsx(Ge,{label:oe.value?"YES":"NO",size:"small",sx:{height:20,fontSize:10,bgcolor:oe.value?"rgba(34, 197, 94, 0.15)":"rgba(239, 68, 68, 0.15)",color:oe.value?"rgb(34, 197, 94)":"rgb(239, 68, 68)"}})},{field:"defaultValue",headerName:"Default",flex:1,minWidth:150,renderCell:oe=>s.jsx(J,{fontFamily:"monospace",fontSize:12,color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:oe.value||"-"})},{field:"actions",headerName:"Actions",width:100,sortable:!1,renderCell:oe=>s.jsxs(K,{sx:{display:"flex",gap:.5},children:[s.jsx(Pt,{title:"Edit Column",children:s.jsx(mt,{size:"small",onClick:()=>{F(oe.row),U({name:oe.row.name,dataType:oe.row.dataType,nullable:oe.row.nullable,defaultValue:oe.row.defaultValue||""}),j(!0)},disabled:t==null?void 0:t.readOnly,children:s.jsx(Dr,{fontSize:"small"})})}),s.jsx(Pt,{title:oe.row.isPrimaryKey?"Cannot delete primary key column":"Delete Column",children:s.jsx("span",{children:s.jsx(mt,{size:"small",color:"error",onClick:()=>{D(oe.row),k(!0)},disabled:(t==null?void 0:t.readOnly)||oe.row.isPrimaryKey,children:s.jsx(dr,{fontSize:"small"})})})})]})}],st=[{field:"name",headerName:"Index Name",flex:1,minWidth:200,renderCell:oe=>s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[oe.row.isPrimary&&s.jsx(Pt,{title:"Primary Key Index",children:s.jsx(ri,{fontSize:"small",sx:{color:"warning.main"}})}),s.jsx(J,{fontFamily:"monospace",children:oe.value})]})},{field:"columns",headerName:"Columns",flex:1,minWidth:200,renderCell:oe=>{const fe=Yv(oe.value);return s.jsx(K,{sx:{display:"flex",gap:.5,flexWrap:"wrap"},children:fe.map(Ie=>s.jsx(Ge,{label:Ie,size:"small",sx:{height:20,fontSize:10,fontFamily:"monospace"}},Ie))})}},{field:"isUnique",headerName:"Unique",width:100,renderCell:oe=>s.jsx(Ge,{label:oe.value?"YES":"NO",size:"small",sx:{height:20,fontSize:10,bgcolor:oe.value?"rgba(99, 102, 241, 0.15)":"transparent",color:oe.value?"rgb(99, 102, 241)":"text.secondary"}})},{field:"type",headerName:"Type",width:100,renderCell:oe=>s.jsx(J,{fontSize:12,color:"text.secondary",children:oe.value})},{field:"actions",headerName:"Actions",width:80,sortable:!1,renderCell:oe=>s.jsx(Pt,{title:oe.row.isPrimary?"Cannot delete primary key index":"Delete Index",children:s.jsx("span",{children:s.jsx(mt,{size:"small",color:"error",onClick:()=>{B(oe.row),M(!0)},disabled:(t==null?void 0:t.readOnly)||oe.row.isPrimary,children:s.jsx(dr,{fontSize:"small"})})})})}],qe=[{field:"name",headerName:"Constraint Name",flex:1,minWidth:200,renderCell:oe=>s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(ll,{fontSize:"small",sx:{color:"info.main"}}),s.jsx(J,{fontFamily:"monospace",children:oe.value})]})},{field:"columns",headerName:"Columns",width:150,renderCell:oe=>{const fe=Yv(oe.value);return s.jsx(K,{sx:{display:"flex",gap:.5,flexWrap:"wrap"},children:fe.map(Ie=>s.jsx(Ge,{label:Ie,size:"small",sx:{height:20,fontSize:10,fontFamily:"monospace"}},Ie))})}},{field:"referencedTable",headerName:"References",flex:1,minWidth:200,renderCell:oe=>{const fe=Yv(oe.row.referencedColumns);return s.jsxs(J,{fontFamily:"monospace",fontSize:12,children:[oe.row.referencedSchema,".",oe.value,"(",fe.join(", "),")"]})}},{field:"onDelete",headerName:"On Delete",width:120,renderCell:oe=>s.jsx(Ge,{label:oe.value,size:"small",sx:{height:20,fontSize:10}})},{field:"onUpdate",headerName:"On Update",width:120,renderCell:oe=>s.jsx(Ge,{label:oe.value,size:"small",sx:{height:20,fontSize:10}})},{field:"actions",headerName:"Actions",width:80,sortable:!1,renderCell:oe=>s.jsx(Pt,{title:"Delete Foreign Key",children:s.jsx(mt,{size:"small",color:"error",onClick:()=>{G(oe.row),A(!0)},disabled:t==null?void 0:t.readOnly,children:s.jsx(dr,{fontSize:"small"})})})}],et=$E[t==null?void 0:t.engine]||$E.postgres;return r?s.jsx(cn,{children:s.jsx(wl,{message:"Loading schemas...",size:"large"})}):s.jsxs(K,{children:[s.jsx(cn,{sx:{mb:3,p:2},children:s.jsxs(K,{sx:{display:"flex",gap:2,alignItems:"center"},children:[s.jsxs(_n,{size:"small",sx:{minWidth:180},children:[s.jsx(Hn,{children:"Schema"}),s.jsx(On,{value:f,onChange:oe=>{const fe=oe.target.value;h(fe),g(""),l==null||l(fe)},label:"Schema",children:n.map(oe=>s.jsx(it,{value:oe,children:oe},oe))})]}),s.jsxs(_n,{size:"small",sx:{minWidth:250},children:[s.jsx(Hn,{children:"Table"}),s.jsx(On,{value:p,onChange:oe=>{const fe=oe.target.value;g(fe),l==null||l(f,fe)},label:"Table",disabled:Y,endAdornment:Y?s.jsx(At,{size:20,sx:{mr:3}}):null,children:re.map(oe=>s.jsx(it,{value:oe.name,children:oe.name},oe.name))})]}),p&&s.jsx(Le,{size:"small",startIcon:s.jsx(Eo,{}),onClick:()=>he(),disabled:ce,children:"Refresh"})]})}),p?ce?s.jsx(cn,{children:s.jsx(wl,{message:"Loading table structure...",size:"large"})}):ie?s.jsxs(cn,{sx:{p:0},children:[s.jsx(K,{sx:{borderBottom:1,borderColor:"divider"},children:s.jsxs(yl,{value:y,onChange:(oe,fe)=>b(fe),sx:{px:2,"& .MuiTab-root":{textTransform:"none",minHeight:48}},children:[s.jsx(Bn,{icon:s.jsx(yI,{fontSize:"small"}),iconPosition:"start",label:`Columns (${ie.columns.length})`}),s.jsx(Bn,{icon:s.jsx(ri,{fontSize:"small"}),iconPosition:"start",label:`Indexes (${ie.indexes.length})`}),s.jsx(Bn,{icon:s.jsx(ll,{fontSize:"small"}),iconPosition:"start",label:`Foreign Keys (${ie.foreignKeys.length})`})]})}),y===0&&s.jsxs(K,{children:[s.jsx(K,{sx:{p:2,display:"flex",justifyContent:"flex-end"},children:s.jsx(Le,{variant:"contained",size:"small",startIcon:s.jsx(Gn,{}),onClick:()=>C(!0),disabled:t==null?void 0:t.readOnly,children:"Add Column"})}),s.jsx(fi,{rows:ie.columns.map((oe,fe)=>({id:fe,...oe})),columns:Ae,autoHeight:!0,disableRowSelectionOnClick:!0,pageSizeOptions:[10,25,50],initialState:{pagination:{paginationModel:{pageSize:25}}},sx:{border:"none","& .MuiDataGrid-cell":{borderColor:"divider",display:"flex",alignItems:"center"},"& .MuiDataGrid-columnHeaders":{bgcolor:"background.default",borderColor:"divider"}}})]}),y===1&&s.jsxs(K,{children:[s.jsx(K,{sx:{p:2,display:"flex",justifyContent:"flex-end"},children:s.jsx(Le,{variant:"contained",size:"small",startIcon:s.jsx(Gn,{}),onClick:()=>T(!0),disabled:t==null?void 0:t.readOnly,children:"Add Index"})}),ie.indexes.length===0?s.jsx(K,{sx:{p:4},children:s.jsx(go,{icon:s.jsx(ri,{}),title:"No indexes",description:"This table has no indexes defined."})}):s.jsx(fi,{rows:ie.indexes.map((oe,fe)=>({id:fe,...oe})),columns:st,autoHeight:!0,disableRowSelectionOnClick:!0,pageSizeOptions:[10,25],initialState:{pagination:{paginationModel:{pageSize:10}}},sx:{border:"none","& .MuiDataGrid-cell":{borderColor:"divider",display:"flex",alignItems:"center"},"& .MuiDataGrid-columnHeaders":{bgcolor:"background.default",borderColor:"divider"}}})]}),y===2&&s.jsxs(K,{children:[s.jsx(K,{sx:{p:2,display:"flex",justifyContent:"flex-end"},children:s.jsx(Le,{variant:"contained",size:"small",startIcon:s.jsx(Gn,{}),onClick:()=>{ne(oe=>({...oe,referencedSchema:f})),E(!0)},disabled:t==null?void 0:t.readOnly,children:"Add Foreign Key"})}),ie.foreignKeys.length===0?s.jsx(K,{sx:{p:4},children:s.jsx(go,{icon:s.jsx(ll,{}),title:"No foreign keys",description:"This table has no foreign key constraints defined."})}):s.jsx(fi,{rows:ie.foreignKeys.map((oe,fe)=>({id:fe,...oe})),columns:qe,autoHeight:!0,disableRowSelectionOnClick:!0,pageSizeOptions:[10,25],initialState:{pagination:{paginationModel:{pageSize:10}}},sx:{border:"none","& .MuiDataGrid-cell":{borderColor:"divider",display:"flex",alignItems:"center"},"& .MuiDataGrid-columnHeaders":{bgcolor:"background.default",borderColor:"divider"}}})]})]}):null:s.jsx(cn,{children:s.jsx(go,{icon:s.jsx(xo,{}),title:"Select a table",description:"Choose a schema and table above to view and manage its structure."})}),s.jsxs(gn,{open:v,onClose:()=>C(!1),maxWidth:"sm",fullWidth:!0,children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(yI,{color:"primary"}),"Add Column"]}),s.jsx(Cn,{children:s.jsxs(K,{sx:{pt:1,display:"flex",flexDirection:"column",gap:2},children:[s.jsx(Wt,{autoFocus:!0,fullWidth:!0,label:"Column Name",value:_.name,onChange:oe=>U(fe=>({...fe,name:oe.target.value})),placeholder:"column_name"}),s.jsx(sa,{freeSolo:!0,options:et,value:_.dataType,onChange:(oe,fe)=>U(Ie=>({...Ie,dataType:fe||""})),onInputChange:(oe,fe)=>U(Ie=>({...Ie,dataType:fe})),renderInput:oe=>s.jsx(Wt,{...oe,label:"Data Type",placeholder:"varchar(255)"})}),s.jsx(Kr,{control:s.jsx(wp,{checked:_.nullable,onChange:oe=>U(fe=>({...fe,nullable:oe.target.checked}))}),label:"Nullable"}),s.jsx(Wt,{fullWidth:!0,label:"Default Value (optional)",value:_.defaultValue,onChange:oe=>U(fe=>({...fe,defaultValue:oe.target.value})),placeholder:"NULL, 0, 'default', now()",helperText:"Enter SQL expression for default value"})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:()=>C(!1),children:"Cancel"}),s.jsx(Le,{variant:"contained",onClick:we,disabled:!_.name||!_.dataType||ke.isPending,startIcon:ke.isPending?s.jsx(At,{size:16}):s.jsx(Gn,{}),children:"Add Column"})]})]}),s.jsxs(gn,{open:S,onClose:()=>j(!1),maxWidth:"sm",fullWidth:!0,children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(Dr,{color:"primary"}),"Edit Column: ",N==null?void 0:N.name]}),s.jsx(Cn,{children:s.jsxs(K,{sx:{pt:1,display:"flex",flexDirection:"column",gap:2},children:[s.jsx(Nt,{severity:"info",children:"Column name cannot be changed here. Use SQL to rename columns."}),s.jsx(sa,{freeSolo:!0,options:et,value:_.dataType,onChange:(oe,fe)=>U(Ie=>({...Ie,dataType:fe||""})),onInputChange:(oe,fe)=>U(Ie=>({...Ie,dataType:fe})),renderInput:oe=>s.jsx(Wt,{...oe,label:"Data Type"})}),s.jsx(Kr,{control:s.jsx(wp,{checked:_.nullable,onChange:oe=>U(fe=>({...fe,nullable:oe.target.checked}))}),label:"Nullable"}),s.jsx(Wt,{fullWidth:!0,label:"Default Value",value:_.defaultValue,onChange:oe=>U(fe=>({...fe,defaultValue:oe.target.value})),placeholder:"NULL, 0, 'default', now()",helperText:"Enter SQL expression for default value, or leave empty to drop default"})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:()=>j(!1),children:"Cancel"}),s.jsx(Le,{variant:"contained",onClick:Oe,disabled:ke.isPending,startIcon:ke.isPending?s.jsx(At,{size:16}):s.jsx(Dr,{}),children:"Save Changes"})]})]}),s.jsxs(gn,{open:w,onClose:()=>k(!1),maxWidth:"sm",fullWidth:!0,children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1,color:"error.main"},children:[s.jsx(Os,{}),"Delete Column"]}),s.jsx(Cn,{children:s.jsxs(Nt,{severity:"error",sx:{mt:1},children:[s.jsxs(J,{variant:"body2",gutterBottom:!0,children:[s.jsx("strong",{children:"Warning:"})," This will permanently delete the column"," ",s.jsxs("strong",{children:['"',L==null?void 0:L.name,'"']})," and ALL data within it."]}),s.jsx(J,{variant:"body2",children:"This action cannot be undone."})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:()=>k(!1),children:"Cancel"}),s.jsx(Le,{variant:"contained",color:"error",onClick:be,disabled:ke.isPending,startIcon:ke.isPending?s.jsx(At,{size:16}):s.jsx(dr,{}),children:"Delete Column"})]})]}),s.jsxs(gn,{open:P,onClose:()=>T(!1),maxWidth:"sm",fullWidth:!0,children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(ri,{color:"primary"}),"Add Index"]}),s.jsx(Cn,{children:s.jsxs(K,{sx:{pt:1,display:"flex",flexDirection:"column",gap:2},children:[s.jsx(Wt,{autoFocus:!0,fullWidth:!0,label:"Index Name",value:Z.name,onChange:oe=>Q(fe=>({...fe,name:oe.target.value})),placeholder:"idx_table_column"}),s.jsx(sa,{multiple:!0,options:(ie==null?void 0:ie.columns.map(oe=>oe.name))||[],value:Z.columns,onChange:(oe,fe)=>Q(Ie=>({...Ie,columns:fe})),renderInput:oe=>s.jsx(Wt,{...oe,label:"Columns",placeholder:"Select columns"})}),s.jsx(Kr,{control:s.jsx(wp,{checked:Z.isUnique,onChange:oe=>Q(fe=>({...fe,isUnique:oe.target.checked}))}),label:"Unique Index"})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:()=>T(!1),children:"Cancel"}),s.jsx(Le,{variant:"contained",onClick:Fe,disabled:!Z.name||Z.columns.length===0||ke.isPending,startIcon:ke.isPending?s.jsx(At,{size:16}):s.jsx(Gn,{}),children:"Create Index"})]})]}),s.jsxs(gn,{open:$,onClose:()=>M(!1),maxWidth:"sm",fullWidth:!0,children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1,color:"error.main"},children:[s.jsx(Os,{}),"Delete Index"]}),s.jsx(Cn,{children:s.jsxs(Nt,{severity:"warning",sx:{mt:1},children:[s.jsxs(J,{variant:"body2",gutterBottom:!0,children:["Are you sure you want to delete the index"," ",s.jsxs("strong",{children:['"',H==null?void 0:H.name,'"']}),"?"]}),s.jsx(J,{variant:"body2",children:"This may affect query performance."})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:()=>M(!1),children:"Cancel"}),s.jsx(Le,{variant:"contained",color:"error",onClick:Ve,disabled:ke.isPending,startIcon:ke.isPending?s.jsx(At,{size:16}):s.jsx(dr,{}),children:"Delete Index"})]})]}),s.jsxs(gn,{open:R,onClose:()=>E(!1),maxWidth:"md",fullWidth:!0,children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(ll,{color:"primary"}),"Add Foreign Key"]}),s.jsx(Cn,{children:s.jsxs(K,{sx:{pt:1,display:"flex",flexDirection:"column",gap:2},children:[s.jsx(Wt,{autoFocus:!0,fullWidth:!0,label:"Constraint Name",value:ee.name,onChange:oe=>ne(fe=>({...fe,name:oe.target.value})),placeholder:"fk_table_column"}),s.jsx(Ho,{children:"Source Columns"}),s.jsx(sa,{multiple:!0,options:(ie==null?void 0:ie.columns.map(oe=>oe.name))||[],value:ee.columns,onChange:(oe,fe)=>ne(Ie=>({...Ie,columns:fe})),renderInput:oe=>s.jsx(Wt,{...oe,label:"Columns",placeholder:"Select columns"})}),s.jsx(Ho,{children:"Referenced Table"}),s.jsxs(K,{sx:{display:"flex",gap:2},children:[s.jsxs(_n,{size:"small",sx:{flex:1},children:[s.jsx(Hn,{children:"Schema"}),s.jsx(On,{value:ee.referencedSchema,onChange:oe=>ne(fe=>({...fe,referencedSchema:oe.target.value,referencedTable:"",referencedColumns:[]})),label:"Schema",children:n.map(oe=>s.jsx(it,{value:oe,children:oe},oe))})]}),s.jsxs(_n,{size:"small",sx:{flex:1},children:[s.jsx(Hn,{children:"Table"}),s.jsx(On,{value:ee.referencedTable,onChange:oe=>ne(fe=>({...fe,referencedTable:oe.target.value,referencedColumns:[]})),label:"Table",disabled:!ee.referencedSchema,children:de.map(oe=>s.jsx(it,{value:oe.name,children:oe.name},oe.name))})]})]}),s.jsx(sa,{multiple:!0,options:(le==null?void 0:le.columns.map(oe=>oe.name))||[],value:ee.referencedColumns,onChange:(oe,fe)=>ne(Ie=>({...Ie,referencedColumns:fe})),disabled:!ee.referencedTable,renderInput:oe=>s.jsx(Wt,{...oe,label:"Referenced Columns",placeholder:"Select columns"})}),s.jsx(Ho,{children:"Actions"}),s.jsxs(K,{sx:{display:"flex",gap:2},children:[s.jsxs(_n,{size:"small",sx:{flex:1},children:[s.jsx(Hn,{children:"On Delete"}),s.jsxs(On,{value:ee.onDelete,onChange:oe=>ne(fe=>({...fe,onDelete:oe.target.value})),label:"On Delete",children:[s.jsx(it,{value:"NO ACTION",children:"NO ACTION"}),s.jsx(it,{value:"CASCADE",children:"CASCADE"}),s.jsx(it,{value:"SET NULL",children:"SET NULL"}),s.jsx(it,{value:"SET DEFAULT",children:"SET DEFAULT"}),s.jsx(it,{value:"RESTRICT",children:"RESTRICT"})]})]}),s.jsxs(_n,{size:"small",sx:{flex:1},children:[s.jsx(Hn,{children:"On Update"}),s.jsxs(On,{value:ee.onUpdate,onChange:oe=>ne(fe=>({...fe,onUpdate:oe.target.value})),label:"On Update",children:[s.jsx(it,{value:"NO ACTION",children:"NO ACTION"}),s.jsx(it,{value:"CASCADE",children:"CASCADE"}),s.jsx(it,{value:"SET NULL",children:"SET NULL"}),s.jsx(it,{value:"SET DEFAULT",children:"SET DEFAULT"}),s.jsx(it,{value:"RESTRICT",children:"RESTRICT"})]})]})]})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:()=>E(!1),children:"Cancel"}),s.jsx(Le,{variant:"contained",onClick:De,disabled:!ee.name||ee.columns.length===0||!ee.referencedTable||ee.referencedColumns.length===0||ee.columns.length!==ee.referencedColumns.length||ke.isPending,startIcon:ke.isPending?s.jsx(At,{size:16}):s.jsx(Gn,{}),children:"Create Foreign Key"})]})]}),s.jsxs(gn,{open:O,onClose:()=>A(!1),maxWidth:"sm",fullWidth:!0,children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1,color:"error.main"},children:[s.jsx(Os,{}),"Delete Foreign Key"]}),s.jsx(Cn,{children:s.jsxs(Nt,{severity:"warning",sx:{mt:1},children:[s.jsxs(J,{variant:"body2",gutterBottom:!0,children:["Are you sure you want to delete the foreign key constraint"," ",s.jsxs("strong",{children:['"',V==null?void 0:V.name,'"']}),"?"]}),s.jsx(J,{variant:"body2",children:"This will remove the referential integrity constraint between tables."})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:()=>A(!1),children:"Cancel"}),s.jsx(Le,{variant:"contained",color:"error",onClick:Ze,disabled:ke.isPending,startIcon:ke.isPending?s.jsx(At,{size:16}):s.jsx(dr,{}),children:"Delete Foreign Key"})]})]})]})}const ep=[s.jsx(IR,{fontSize:"small"},"overview"),s.jsx($i,{fontSize:"small"},"schemas"),s.jsx(xo,{fontSize:"small"},"tables"),s.jsx(Wd,{fontSize:"small"},"table-management"),s.jsx(Dw,{fontSize:"small"},"maintenance")];function wne(){var $;const{connectionId:e}=Sx(),t=Ko(),[n,r]=kx(),{activeTab:o,selectedSchema:i,selectedTable:l,setActiveTab:c,setSelectedSchema:u,setSelection:f,initFromUrl:h}=rc();m.useEffect(()=>{h(n)},[]);const p=m.useCallback((M,R)=>{c(R),setTimeout(()=>{const E=rc.getState().getUrlParams();r(E,{replace:!0})},0)},[c,r]),g=m.useCallback(M=>{c(2),f(M,null),setTimeout(()=>{const R=rc.getState().getUrlParams();r(R,{replace:!0})},0)},[c,f,r]),y=m.useCallback((M,R)=>{c(3),f(M,R),setTimeout(()=>{const E=rc.getState().getUrlParams();r(E,{replace:!0})},0)},[c,f,r]),b=m.useCallback(M=>{u(M),setTimeout(()=>{const R=rc.getState().getUrlParams();r(R,{replace:!0})},0)},[u,r]),v=m.useCallback((M,R)=>{f(M,R??null),setTimeout(()=>{const E=rc.getState().getUrlParams();r(E,{replace:!0})},0)},[f,r]),{data:C,isLoading:S,error:j}=Ft({queryKey:["connection",e],queryFn:()=>Qr.getById(e),enabled:!!e}),{data:w=[],isLoading:k}=Ft({queryKey:["schemas",e],queryFn:()=>xn.getSchemas(e),enabled:!!e}),{data:P}=Ft({queryKey:["serverVersion",e],queryFn:()=>xn.getServerVersion(e),enabled:!!e});if(m.useEffect(()=>{if(w.length>0&&!i&&C){const M=C.defaultSchema&&w.includes(C.defaultSchema)?C.defaultSchema:w[0];u(M),setTimeout(()=>{const R=rc.getState().getUrlParams();r(R,{replace:!0})},0)}},[w,i,C,u,r]),m.useEffect(()=>{j&&t("/dashboard")},[j,t]),!e)return s.jsx(K,{sx:{p:4},children:s.jsx(go,{icon:s.jsx(Cr,{}),title:"No connection selected",description:"Please select a connection from the connections page.",action:{label:"Go to Connections",onClick:()=>t("/connections")}})});const T=S||k;return S&&!C?s.jsxs(K,{sx:{p:4,maxWidth:1400,mx:"auto"},children:[s.jsxs(K,{sx:{mb:4},children:[s.jsx(to,{width:150,height:20,sx:{mb:2}}),s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:2},children:[s.jsx(to,{variant:"circular",width:40,height:40}),s.jsx(to,{variant:"circular",width:32,height:32}),s.jsxs(K,{sx:{flex:1},children:[s.jsx(to,{width:250,height:36}),s.jsx(to,{width:180,height:20,sx:{mt:.5}})]})]})]}),s.jsx(cn,{sx:{mb:3,p:0},children:s.jsx(K,{sx:{display:"flex",gap:2,p:2},children:[1,2,3,4,5].map(M=>s.jsx(to,{width:100,height:40},M))})}),s.jsx(cn,{children:s.jsx(wl,{message:"Loading connection details...",size:"large"})})]}):s.jsxs(K,{sx:{p:4,maxWidth:1400,mx:"auto"},children:[s.jsxs(K,{sx:{mb:4},children:[s.jsxs(n9,{sx:{mb:2},children:[s.jsx(v8,{component:"button",variant:"body2",onClick:()=>t("/connections"),sx:{color:"text.secondary",textDecoration:"none","&:hover":{color:"primary.main"}},children:"Connections"}),s.jsx(J,{variant:"body2",color:"text.primary",children:S?s.jsx(to,{width:100}):C==null?void 0:C.name})]}),s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:2},children:[s.jsx(mt,{onClick:()=>t("/connections"),sx:{color:"text.secondary"},children:s.jsx(ER,{})}),s.jsx(Cr,{sx:{fontSize:32,color:"primary.main"}}),s.jsx(K,{sx:{flex:1},children:S?s.jsxs(s.Fragment,{children:[s.jsx(to,{width:200,height:32}),s.jsx(to,{width:150,height:20})]}):s.jsxs(s.Fragment,{children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[s.jsx(J,{variant:"h4",fontWeight:600,children:C==null?void 0:C.name}),s.jsx(Ge,{label:($=C==null?void 0:C.engine)==null?void 0:$.toUpperCase(),size:"small",sx:{height:22,fontSize:11,fontWeight:600,bgcolor:(C==null?void 0:C.engine)==="postgres"?"rgba(51, 103, 145, 0.2)":"rgba(0, 122, 204, 0.2)",color:(C==null?void 0:C.engine)==="postgres"?"#6BA3D6":"#47A3F3"}}),(C==null?void 0:C.readOnly)&&s.jsx(Ge,{label:"READ-ONLY",size:"small",sx:{height:22,fontSize:10,fontWeight:600,bgcolor:"rgba(139, 92, 246, 0.15)",color:"rgb(139, 92, 246)"}})]}),s.jsxs(J,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:[(C==null?void 0:C.engine)==="sqlite"?C==null?void 0:C.database:`${C==null?void 0:C.host}:${C==null?void 0:C.port} • ${C==null?void 0:C.database}`,(P==null?void 0:P.version)&&` • ${P.version}`]})]})})]})]}),s.jsx(cn,{sx:{mb:3,p:0},children:s.jsxs(K,{sx:{display:"flex",alignItems:"center"},children:[s.jsxs(yl,{value:o,onChange:p,sx:{flex:1,px:2,"& .MuiTabs-indicator":{bgcolor:"primary.main"},"& .MuiTab-root":{color:"text.secondary",textTransform:"none",fontWeight:500,minHeight:56,gap:1,"&.Mui-selected":{color:"primary.main"}}},children:[s.jsx(Bn,{icon:ep[0],iconPosition:"start",label:"Overview"}),s.jsx(Bn,{icon:ep[1],iconPosition:"start",label:`Schemas${w.length>0?` (${w.length})`:""}`}),s.jsx(Bn,{icon:ep[2],iconPosition:"start",label:"Tables"}),s.jsx(Bn,{icon:ep[3],iconPosition:"start",label:"Table Management"}),s.jsx(Bn,{icon:ep[4],iconPosition:"start",label:"Maintenance"})]}),s.jsx(Pt,{title:"Open Schema Diagram",children:s.jsx(mt,{onClick:()=>t(`/schema-diagram?connection=${e}${i?`&schema=${i}`:""}`),sx:{mr:2,color:"text.secondary",border:1,borderColor:"divider",borderRadius:1,"&:hover":{color:"primary.main",borderColor:"primary.main"}},children:s.jsx(zw,{fontSize:"small"})})})]})}),o===0&&s.jsx(l7,{connection:C,schemas:w,serverVersion:P==null?void 0:P.version,isLoading:T}),o===1&&s.jsx(xne,{connectionId:e,connection:C,schemas:w,isLoading:k,onViewTables:g}),o===2&&s.jsx(vne,{connectionId:e,connection:C,schemas:w,isLoading:k,initialSchema:i,onSchemaViewed:()=>{},onManageTable:y,onSchemaChange:b}),o===3&&s.jsx(Cne,{connectionId:e,connection:C,schemas:w,isLoading:k,initialSchema:i,initialTable:l,onSelectionChange:v}),o===4&&s.jsx(bne,{connectionId:e,connection:C,schemas:w,selectedSchema:i,onSchemaChange:b})]})}const Sne=Aa()(xh(e=>({lastState:null,saveState:t=>e({lastState:t}),clearState:()=>e({lastState:null})}),{name:"dbnexus-query-page-state"})),pO=Aa()(xh(e=>({selectedConnectionId:"",selectedSchema:"",setConnection:t=>e({selectedConnectionId:t,selectedSchema:""}),setSchema:t=>e({selectedSchema:t}),setConnectionAndSchema:(t,n)=>e({selectedConnectionId:t,selectedSchema:n}),clear:()=>e({selectedConnectionId:"",selectedSchema:""})}),{name:"dbnexus-connection-state"}));function jne({table:e,selected:t,onClick:n}){return s.jsxs(K,{sx:{display:"flex",alignItems:"center",px:2,py:.75,pl:4,cursor:"pointer",bgcolor:t?"action.selected":"transparent","&:hover":{bgcolor:t?"action.selected":"action.hover"},borderLeft:t?2:0,borderColor:"primary.main"},onClick:n,children:[e.type==="view"?s.jsx(vh,{fontSize:"small",sx:{mr:1,fontSize:16,color:"secondary.main"}}):s.jsx(xo,{fontSize:"small",sx:{mr:1,fontSize:16,color:"text.secondary"}}),s.jsx(J,{variant:"body2",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:t?600:400},children:e.name}),e.rowCount!==void 0&&s.jsx(J,{variant:"caption",color:"text.secondary",sx:{ml:1},children:e.rowCount.toLocaleString()})]})}function OE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function kne(e){if(Array.isArray(e))return e}function Ine(e,t,n){return(t=One(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ene(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,i,l,c=[],u=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(h){f=!0,o=h}finally{try{if(!u&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw o}}return c}}function Pne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
342
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function LE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zE(Object(n),!0).forEach(function(r){Ine(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tne(e,t){if(e==null)return{};var n,r,o=Mne(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Mne(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Rne(e,t){return kne(e)||Ene(e,t)||zne(e,t)||Pne()}function $ne(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function One(e){var t=$ne(e,"string");return typeof t=="symbol"?t:t+""}function zne(e,t){if(e){if(typeof e=="string")return OE(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?OE(e,t):void 0}}function Lne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function AE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DE(Object(n),!0).forEach(function(r){Lne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dne(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(o,i){return i(o)},r)}}function hp(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];return t.apply(n,[].concat(o,c))}}}function dx(e){return{}.toString.call(e).includes("Object")}function Ane(e){return!Object.keys(e).length}function Gp(e){return typeof e=="function"}function Fne(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Nne(e,t){return dx(t)||Pa("changeType"),Object.keys(t).some(function(n){return!Fne(e,n)})&&Pa("changeField"),t}function _ne(e){Gp(e)||Pa("selectorType")}function Hne(e){Gp(e)||dx(e)||Pa("handlerType"),dx(e)&&Object.values(e).some(function(t){return!Gp(t)})&&Pa("handlersType")}function Bne(e){e||Pa("initialIsRequired"),dx(e)||Pa("initialType"),Ane(e)&&Pa("initialContent")}function Wne(e,t){throw new Error(e[t]||e.default)}var Vne={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Pa=hp(Wne)(Vne),lg={changes:Nne,selector:_ne,handler:Hne,initial:Bne};function Gne(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};lg.initial(e),lg.handler(t);var n={current:e},r=hp(Kne)(n,t),o=hp(qne)(n),i=hp(lg.changes)(e),l=hp(Une)(n);function c(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(h){return h};return lg.selector(f),f(n.current)}function u(f){Dne(r,o,i,l)(f)}return[c,u]}function Une(e,t){return Gp(t)?t(e.current):t}function qne(e,t){return e.current=AE(AE({},e.current),t),t}function Kne(e,t,n){return Gp(t)?t(e.current):Object.keys(n).forEach(function(r){var o;return(o=t[r])===null||o===void 0?void 0:o.call(t,e.current[r])}),n}var Qne={create:Gne},Yne={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function Xne(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];return t.apply(n,[].concat(o,c))}}}function Zne(e){return{}.toString.call(e).includes("Object")}function Jne(e){return e||FE("configIsRequired"),Zne(e)||FE("configType"),e.urls?(ere(),{paths:{vs:e.urls.monacoBase}}):e}function ere(){console.warn(hO.deprecation)}function tre(e,t){throw new Error(e[t]||e.default)}var hO={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
343
|
+
You are using deprecated way of configuration.
|
|
344
|
+
|
|
345
|
+
Instead of using
|
|
346
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
347
|
+
use
|
|
348
|
+
monaco.config({ paths: { vs: '...' } })
|
|
349
|
+
|
|
350
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
351
|
+
`},FE=Xne(tre)(hO),nre={config:Jne},rre=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(i,l){return l(i)},o)}};function mO(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],mO(e[n],t[n]))}),LE(LE({},e),t)}var ore={type:"cancelation",msg:"operation is manually canceled"};function Xv(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(ore):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var sre=["monaco"],ire=Qne.create({config:Yne,isInitialized:!1,resolve:null,reject:null,monaco:null}),gO=Rne(ire,2),Mh=gO[0],ay=gO[1];function lre(e){var t=nre.config(e),n=t.monaco,r=Tne(t,sre);ay(function(o){return{config:mO(o.config,r),monaco:n}})}function are(){var e=Mh(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(ay({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Xv(Zv);if(window.monaco&&window.monaco.editor)return xO(window.monaco),e.resolve(window.monaco),Xv(Zv);rre(cre,dre)(fre)}return Xv(Zv)}function cre(e){return document.body.appendChild(e)}function ure(e){var t=document.createElement("script");return e&&(t.src=e),t}function dre(e){var t=Mh(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=ure("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function fre(){var e=Mh(function(n){var r=n.config,o=n.resolve,i=n.reject;return{config:r,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m||n;xO(r),e.resolve(r)},function(n){e.reject(n)})}function xO(e){Mh().monaco||ay({monaco:e})}function pre(){return Mh(function(e){var t=e.monaco;return t})}var Zv=new Promise(function(e,t){return ay({resolve:e,reject:t})}),yO={config:lre,init:are,__getMonacoInstance:pre},hre={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Jv=hre,mre={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},gre=mre;function xre({children:e}){return br.createElement("div",{style:gre.container},e)}var yre=xre,bre=yre;function vre({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:l}){return br.createElement("section",{style:{...Jv.wrapper,width:e,height:t},...l},!n&&br.createElement(bre,null,r),br.createElement("div",{ref:o,style:{...Jv.fullWidth,...!n&&Jv.hide},className:i}))}var Cre=vre,bO=m.memo(Cre);function wre(e){m.useEffect(e,[])}var vO=wre;function Sre(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var os=Sre;function kp(){}function Uu(e,t,n,r){return jre(e,r)||kre(e,t,n,r)}function jre(e,t){return e.editor.getModel(CO(e,t))}function kre(e,t,n,r){return e.editor.createModel(t,n,r?CO(e,r):void 0)}function CO(e,t){return e.Uri.parse(t)}function Ire({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:l,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:u=!1,theme:f="light",loading:h="Loading...",options:p={},height:g="100%",width:y="100%",className:b,wrapperProps:v={},beforeMount:C=kp,onMount:S=kp}){let[j,w]=m.useState(!1),[k,P]=m.useState(!0),T=m.useRef(null),$=m.useRef(null),M=m.useRef(null),R=m.useRef(S),E=m.useRef(C),O=m.useRef(!1);vO(()=>{let L=yO.init();return L.then(D=>($.current=D)&&P(!1)).catch(D=>(D==null?void 0:D.type)!=="cancelation"&&console.error("Monaco initialization: error:",D)),()=>T.current?F():L.cancel()}),os(()=>{if(T.current&&$.current){let L=T.current.getOriginalEditor(),D=Uu($.current,e||"",r||n||"text",i||"");D!==L.getModel()&&L.setModel(D)}},[i],j),os(()=>{if(T.current&&$.current){let L=T.current.getModifiedEditor(),D=Uu($.current,t||"",o||n||"text",l||"");D!==L.getModel()&&L.setModel(D)}},[l],j),os(()=>{let L=T.current.getModifiedEditor();L.getOption($.current.editor.EditorOption.readOnly)?L.setValue(t||""):t!==L.getValue()&&(L.executeEdits("",[{range:L.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),L.pushUndoStop())},[t],j),os(()=>{var L,D;(D=(L=T.current)==null?void 0:L.getModel())==null||D.original.setValue(e||"")},[e],j),os(()=>{let{original:L,modified:D}=T.current.getModel();$.current.editor.setModelLanguage(L,r||n||"text"),$.current.editor.setModelLanguage(D,o||n||"text")},[n,r,o],j),os(()=>{var L;(L=$.current)==null||L.editor.setTheme(f)},[f],j),os(()=>{var L;(L=T.current)==null||L.updateOptions(p)},[p],j);let A=m.useCallback(()=>{var H;if(!$.current)return;E.current($.current);let L=Uu($.current,e||"",r||n||"text",i||""),D=Uu($.current,t||"",o||n||"text",l||"");(H=T.current)==null||H.setModel({original:L,modified:D})},[n,t,o,e,r,i,l]),N=m.useCallback(()=>{var L;!O.current&&M.current&&(T.current=$.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...p}),A(),(L=$.current)==null||L.editor.setTheme(f),w(!0),O.current=!0)},[p,f,A]);m.useEffect(()=>{j&&R.current(T.current,$.current)},[j]),m.useEffect(()=>{!k&&!j&&N()},[k,j,N]);function F(){var D,H,B,V;let L=(D=T.current)==null?void 0:D.getModel();c||((H=L==null?void 0:L.original)==null||H.dispose()),u||((B=L==null?void 0:L.modified)==null||B.dispose()),(V=T.current)==null||V.dispose()}return br.createElement(bO,{width:y,height:g,isEditorReady:j,loading:h,_ref:M,className:b,wrapperProps:v})}var Ere=Ire;m.memo(Ere);function Pre(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var Tre=Pre,ag=new Map;function Mre({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:i,theme:l="light",line:c,loading:u="Loading...",options:f={},overrideServices:h={},saveViewState:p=!0,keepCurrentModel:g=!1,width:y="100%",height:b="100%",className:v,wrapperProps:C={},beforeMount:S=kp,onMount:j=kp,onChange:w,onValidate:k=kp}){let[P,T]=m.useState(!1),[$,M]=m.useState(!0),R=m.useRef(null),E=m.useRef(null),O=m.useRef(null),A=m.useRef(j),N=m.useRef(S),F=m.useRef(),L=m.useRef(r),D=Tre(i),H=m.useRef(!1),B=m.useRef(!1);vO(()=>{let _=yO.init();return _.then(U=>(R.current=U)&&M(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>E.current?G():_.cancel()}),os(()=>{var U,Z,Q,ee;let _=Uu(R.current,e||r||"",t||o||"",i||n||"");_!==((U=E.current)==null?void 0:U.getModel())&&(p&&ag.set(D,(Z=E.current)==null?void 0:Z.saveViewState()),(Q=E.current)==null||Q.setModel(_),p&&((ee=E.current)==null||ee.restoreViewState(ag.get(i))))},[i],P),os(()=>{var _;(_=E.current)==null||_.updateOptions(f)},[f],P),os(()=>{!E.current||r===void 0||(E.current.getOption(R.current.editor.EditorOption.readOnly)?E.current.setValue(r):r!==E.current.getValue()&&(B.current=!0,E.current.executeEdits("",[{range:E.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),E.current.pushUndoStop(),B.current=!1))},[r],P),os(()=>{var U,Z;let _=(U=E.current)==null?void 0:U.getModel();_&&o&&((Z=R.current)==null||Z.editor.setModelLanguage(_,o))},[o],P),os(()=>{var _;c!==void 0&&((_=E.current)==null||_.revealLine(c))},[c],P),os(()=>{var _;(_=R.current)==null||_.editor.setTheme(l)},[l],P);let V=m.useCallback(()=>{var _;if(!(!O.current||!R.current)&&!H.current){N.current(R.current);let U=i||n,Z=Uu(R.current,r||e||"",t||o||"",U||"");E.current=(_=R.current)==null?void 0:_.editor.create(O.current,{model:Z,automaticLayout:!0,...f},h),p&&E.current.restoreViewState(ag.get(U)),R.current.editor.setTheme(l),c!==void 0&&E.current.revealLine(c),T(!0),H.current=!0}},[e,t,n,r,o,i,f,h,p,l,c]);m.useEffect(()=>{P&&A.current(E.current,R.current)},[P]),m.useEffect(()=>{!$&&!P&&V()},[$,P,V]),L.current=r,m.useEffect(()=>{var _,U;P&&w&&((_=F.current)==null||_.dispose(),F.current=(U=E.current)==null?void 0:U.onDidChangeModelContent(Z=>{B.current||w(E.current.getValue(),Z)}))},[P,w]),m.useEffect(()=>{if(P){let _=R.current.editor.onDidChangeMarkers(U=>{var Q;let Z=(Q=E.current.getModel())==null?void 0:Q.uri;if(Z&&U.find(ee=>ee.path===Z.path)){let ee=R.current.editor.getModelMarkers({resource:Z});k==null||k(ee)}});return()=>{_==null||_.dispose()}}return()=>{}},[P,k]);function G(){var _,U;(_=F.current)==null||_.dispose(),g?p&&ag.set(i,E.current.saveViewState()):(U=E.current.getModel())==null||U.dispose(),E.current.dispose()}return br.createElement(bO,{width:y,height:b,isEditorReady:P,loading:u,_ref:O,className:v,wrapperProps:C})}var Rre=Mre,$re=m.memo(Rre),wO=$re;function Ore({value:e,onSaveJson:t}){const[n,r]=m.useState(!1),[o,i]=m.useState(!1),[l,c]=m.useState(""),[u,f]=m.useState(null);if(e===null)return s.jsx(J,{variant:"body2",color:"text.disabled",fontStyle:"italic",children:"NULL"});if(typeof e=="boolean")return s.jsx(Ge,{label:String(e),size:"small",color:e?"success":"error",sx:{fontSize:10}});const h=typeof e=="object";let p=null,g=!1;if(typeof e=="string")try{const b=e.trim();(b.startsWith("{")&&b.endsWith("}")||b.startsWith("[")&&b.endsWith("]"))&&(p=JSON.parse(e),g=!0)}catch{}if(h||g){const b=h?e:p,v=JSON.stringify(b),C=JSON.stringify(b,null,2),S=T=>{T.stopPropagation(),r(!0),i(!1),c(C),f(null)},j=()=>{r(!1),i(!1),f(null)},w=()=>{i(!0),c(C)},k=()=>{i(!1),c(C),f(null)},P=()=>{try{const T=JSON.parse(l);t&&t(T),r(!1),i(!1)}catch(T){f("Invalid JSON: "+T.message)}};return s.jsxs(s.Fragment,{children:[s.jsxs(K,{onClick:S,sx:{display:"flex",alignItems:"center",gap:.5,cursor:"pointer","&:hover":{opacity:.8}},children:[s.jsx(Fc,{sx:{fontSize:14,color:"warning.main"}}),s.jsx(J,{variant:"body2",color:"warning.main",fontFamily:"monospace",sx:{maxWidth:180},noWrap:!0,children:v.length>40?v.slice(0,40)+"...":v})]}),s.jsxs(gn,{open:n,onClose:j,maxWidth:!1,PaperProps:{sx:{width:"60vw",maxWidth:"900px",minWidth:"400px",height:"70vh",maxHeight:"800px",minHeight:"300px",resize:"both",overflow:"auto"}},children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(Fc,{color:"warning"}),o?"Edit JSON":"JSON Viewer",s.jsx(K,{sx:{flex:1}}),!o&&s.jsxs(s.Fragment,{children:[t&&s.jsx(Pt,{title:"Edit",children:s.jsx(mt,{size:"small",onClick:w,sx:{mr:1},children:s.jsx(Dr,{fontSize:"small"})})}),s.jsx(Pt,{title:"Copy to clipboard",children:s.jsx(mt,{size:"small",onClick:()=>navigator.clipboard.writeText(C),sx:{mr:1},children:s.jsx(Oa,{fontSize:"small"})})})]}),s.jsx(mt,{size:"small",onClick:j,children:s.jsx(Gd,{fontSize:"small"})})]}),s.jsxs(Cn,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[u&&s.jsx(Nt,{severity:"error",sx:{mb:2},children:u}),s.jsx(K,{sx:{flex:1,minHeight:0},children:s.jsx(wO,{height:"100%",defaultLanguage:"json",value:o?l:C,onChange:T=>c(T??""),theme:"vs-dark",options:{readOnly:!o,minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, Fira Code, monospace",lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on"}})})]}),o&&s.jsxs(vn,{children:[s.jsx(Le,{onClick:k,children:"Cancel"}),s.jsx(Le,{variant:"contained",onClick:P,children:"Save"})]})]})]})}const y=String(e);return y.length>100?s.jsx(Pt,{title:y,children:s.jsxs(J,{variant:"body2",fontFamily:"monospace",sx:{maxWidth:200,cursor:"pointer"},noWrap:!0,children:[y.slice(0,100),"..."]})}):s.jsx(J,{variant:"body2",fontFamily:"monospace",children:y})}function zre({result:e,error:t,loading:n,confirmDangerous:r,onConfirm:o,onCancel:i,totalRowCount:l,paginationModel:c,onPaginationChange:u,onSearch:f,searchQuery:h,tableSchema:p,onUpdateRow:g,onDeleteRow:y,onSyncRow:b,connectionHost:v,connectionDatabase:C,tableName:S}){var Oe;const[j,w]=m.useState(h),[k,P]=m.useState({}),[T,$]=m.useState(null),[M,R]=m.useState([]),[E,O]=m.useState(null),A=oo(),N=(p==null?void 0:p.columns.filter(be=>be.isPrimaryKey).map(be=>be.name))||[],F=!p&&(e!=null&&e.columns)?e.columns.filter(be=>{const Fe=be.name.toLowerCase();return Fe==="id"||Fe==="version"||Fe.endsWith("_id")}).map(be=>be.name):[],D=(N.length>0?N:F).length>0,H=M.length>0,B=be=>()=>{P({...k,[be]:{mode:Mn.View}})},V=be=>()=>{P({...k,[be]:{mode:Mn.View,ignoreModifications:!0}})},G=()=>{T&&y&&y(T),$(null)},_=async(be,Fe)=>(g&&await g(Fe,be),be),U=be=>{console.error("Row update error:",be)},Z=be=>{const Fe=be.toLowerCase();return Fe.includes("json")||Fe.includes("jsonb")},Q=(be,Fe,Ve)=>{if(!g)return;const De={...be,[Fe]:Ve};g(be,De)},ee=e?e.columns.map(be=>{const Fe=N.includes(be.name),Ve=Z(be.dataType),De=D&&!Fe&&!Ve,Ze=D&&!Fe&&Ve;return{field:be.name,headerName:be.name,description:be.dataType,flex:1,minWidth:120,editable:De,renderCell:Ae=>s.jsx(Ore,{value:Ae.value,onSaveJson:Ze?st=>Q(Ae.row,be.name,st):void 0}),renderHeader:()=>s.jsxs(K,{children:[s.jsx(J,{variant:"body2",fontWeight:600,children:be.name}),s.jsx(J,{variant:"caption",color:"text.secondary",children:be.dataType})]})}}):[],ne=(Oe=Object.entries(k).find(([,be])=>be.mode===Mn.Edit))==null?void 0:Oe[0],re=ee,Y=e?e.rows.map((be,Fe)=>({__rowIndex:Fe,...be})):[],ie=()=>M.map(be=>{const Fe=Y.find(Ze=>Ze.__rowIndex===be||String(Ze.__rowIndex)===String(be));if(!Fe)return console.warn("Row not found for __rowIndex:",be,"Available indices:",Y.map(Ze=>Ze.__rowIndex)),null;const{__rowIndex:Ve,...De}=Fe;return De}).filter(be=>be!==null&&Object.keys(be).length>0),ce=()=>{if(M.length===1){const be=M[0];P({[String(be)]:{mode:Mn.Edit}})}},he=()=>{if(M.length===1){const be=Y.find(Fe=>Fe.__rowIndex===M[0]);if(be){const{__rowIndex:Fe,...Ve}=be;$(Ve)}}},de=()=>{const be=ie();be.length>0&&b&&b(be)},le=be=>`${[v||"localhost",C||"db",S||"query"].map(De=>De.replace(/[^a-zA-Z0-9_-]/g,"_")).join("-")}.${be}`,ge=()=>M.length>0?ie():(e==null?void 0:e.rows)||[],Se=()=>{if(!e||e.rows.length===0)return;const be=ge();if(be.length===0)return;const Fe=e.columns.map(Ae=>Ae.name),De=[Fe.join(","),...be.map(Ae=>Fe.map(st=>{const qe=Ae[st];if(qe==null)return"";if(typeof qe=="object")return`"${JSON.stringify(qe).replace(/"/g,'""')}"`;const et=String(qe);return et.includes(",")||et.includes(`
|
|
352
|
+
`)||et.includes('"')?`"${et.replace(/"/g,'""')}"`:et}).join(","))].join(`
|
|
353
|
+
`);we(De,le("csv"),"text/csv");const Ze=M.length>0?`Exported ${be.length} selected row(s) to CSV`:"Exported to CSV";A.success(Ze)},ke=()=>{if(!e||e.rows.length===0)return;const be=ge();if(be.length===0)return;const Fe=JSON.stringify(be,null,2);we(Fe,le("json"),"application/json");const Ve=M.length>0?`Exported ${be.length} selected row(s) to JSON`:"Exported to JSON";A.success(Ve)},we=(be,Fe,Ve)=>{const De=new Blob([be],{type:Ve}),Ze=URL.createObjectURL(De),Ae=document.createElement("a");Ae.href=Ze,Ae.download=Fe,document.body.appendChild(Ae),Ae.click(),document.body.removeChild(Ae),URL.revokeObjectURL(Ze)};return s.jsxs(K,{sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[n&&s.jsx(kl,{}),r&&s.jsxs(Nt,{severity:"warning",icon:s.jsx(Os,{}),action:s.jsxs(K,{sx:{display:"flex",gap:1},children:[s.jsx(Le,{color:"inherit",size:"small",onClick:i,children:"Cancel"}),s.jsx(Le,{color:"error",size:"small",variant:"contained",onClick:o,children:"Execute Anyway"})]}),children:[s.jsx(J,{variant:"subtitle2",children:"Dangerous Query Detected"}),s.jsx(J,{variant:"body2",children:r.message})]}),t&&s.jsxs(Nt,{severity:"error",icon:s.jsx(Na,{}),sx:{m:2},children:[s.jsx(J,{variant:"subtitle2",children:"Query Error"}),s.jsx(J,{variant:"body2",fontFamily:"monospace",children:t})]}),e&&s.jsxs(s.Fragment,{children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1,px:2,minHeight:48,bgcolor:"background.paper",borderBottom:1,borderColor:"divider"},children:[ne?s.jsxs(s.Fragment,{children:[s.jsx(J,{variant:"body2",color:"warning.main",sx:{fontWeight:500},children:"Editing row..."}),s.jsx(Le,{size:"small",variant:"contained",color:"success",startIcon:s.jsx(BU,{}),onClick:B(ne),sx:{minWidth:"auto",px:1.5},children:"Save"}),s.jsx(Le,{size:"small",variant:"outlined",startIcon:s.jsx(kU,{}),onClick:V(ne),sx:{minWidth:"auto",px:1.5},children:"Cancel"})]}):H?s.jsxs(s.Fragment,{children:[s.jsx(Ge,{label:`${M.length} selected`,size:"small",color:"primary",onDelete:()=>R([])}),s.jsx(Pt,{title:D?M.length>1?"Select 1 row":"Edit":"No primary key",children:s.jsx("span",{children:s.jsx(mt,{size:"small",onClick:ce,disabled:!D||M.length!==1||!g,children:s.jsx(Dr,{fontSize:"small"})})})}),s.jsx(Pt,{title:D?M.length>1?"Select 1 row":"Delete":"No primary key",children:s.jsx("span",{children:s.jsx(mt,{size:"small",color:"error",onClick:he,disabled:!D||M.length!==1||!y,children:s.jsx(dr,{fontSize:"small"})})})}),s.jsx(Pt,{title:D?`Sync ${M.length} row${M.length>1?"s":""}`:"No primary key",children:s.jsx("span",{children:s.jsx(mt,{size:"small",color:"primary",onClick:de,disabled:!D||!b,children:s.jsx(fs,{fontSize:"small"})})})})]}):s.jsxs(s.Fragment,{children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:.5,color:"success.main"},children:[s.jsx(Il,{fontSize:"small"}),s.jsx(J,{variant:"body2",children:l!==null?`${l.toLocaleString()} rows`:`${e.rowCount} rows`})]}),l!==null&&l>c.pageSize&&s.jsxs(J,{variant:"body2",color:"text.secondary",children:[c.page*c.pageSize+1,"-",Math.min((c.page+1)*c.pageSize,l)]}),s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:.5,color:"text.secondary"},children:[s.jsx(wU,{fontSize:"small"}),s.jsxs(J,{variant:"body2",children:[e.executionTimeMs,"ms"]})]})]}),s.jsx(K,{sx:{flex:1}}),e.rows.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Pt,{title:M.length>0?`Export ${M.length} selected row(s)`:"Export all rows",children:s.jsx(mt,{size:"small",onClick:be=>O(be.currentTarget),children:s.jsx(Sp,{fontSize:"small"})})}),s.jsxs(Ra,{anchorEl:E,open:!!E,onClose:()=>O(null),children:[s.jsxs(it,{onClick:()=>{Se(),O(null)},children:[s.jsx(Rn,{children:s.jsx(Sp,{fontSize:"small"})}),s.jsxs($n,{children:["Export as CSV",M.length>0&&s.jsxs(J,{variant:"caption",color:"text.secondary",sx:{ml:1},children:["(",M.length," rows)"]})]})]}),s.jsxs(it,{onClick:()=>{ke(),O(null)},children:[s.jsx(Rn,{children:s.jsx(Sp,{fontSize:"small"})}),s.jsxs($n,{children:["Export as JSON",M.length>0&&s.jsxs(J,{variant:"caption",color:"text.secondary",sx:{ml:1},children:["(",M.length," rows)"]})]})]})]})]}),s.jsx(Wt,{size:"small",placeholder:"Search...",value:j,onChange:be=>w(be.target.value),onKeyDown:be=>{be.key==="Enter"&&f(j)},InputProps:{startAdornment:s.jsx(ds,{position:"start",children:s.jsx(Ud,{fontSize:"small",sx:{color:"text.disabled"}})}),endAdornment:j&&s.jsx(ds,{position:"end",children:s.jsx(mt,{size:"small",onClick:()=>{w(""),f("")},children:s.jsx(Gd,{fontSize:"small"})})})},sx:{width:180,"& .MuiOutlinedInput-root":{bgcolor:"background.default",height:32},"& .MuiOutlinedInput-input":{py:.5}}}),h&&s.jsx(Ge,{label:`"${h}"`,size:"small",onDelete:()=>{w(""),f("")},color:"primary",variant:"outlined"})]}),s.jsx(K,{sx:{flex:1,minHeight:0},children:e.rows.length>0?s.jsx(fi,{rows:Y,columns:re,getRowId:be=>be.__rowIndex,density:"compact",checkboxSelection:!0,rowSelectionModel:M,onRowSelectionModelChange:be=>R(be),loading:n,paginationMode:l!==null?"server":"client",rowCount:l??e.rowCount,paginationModel:c,onPaginationModelChange:u,pageSizeOptions:[50,100,250,500],editMode:"row",rowModesModel:k,onRowModesModelChange:P,processRowUpdate:_,onProcessRowUpdateError:U,sx:{border:"none",borderRadius:0,"& .MuiDataGrid-cell":{fontFamily:"monospace",fontSize:12,display:"flex",alignItems:"center"},"& .MuiDataGrid-columnHeaders":{bgcolor:"background.paper",borderRadius:0},"& .MuiDataGrid-columnHeader":{"&:focus":{outline:"none"}},"& .MuiDataGrid-cell:focus":{outline:"none"},"& .MuiDataGrid-row:hover":{bgcolor:"action.hover"},"& .MuiDataGrid-footerContainer":{borderRadius:0},"& .MuiDataGrid-cell--editing":{bgcolor:"action.selected"}}}):s.jsx(K,{sx:{p:4,textAlign:"center",color:"text.secondary"},children:"Query executed successfully. No rows returned."})})]}),!e&&!t&&!n&&s.jsx(K,{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:s.jsx(J,{variant:"body2",children:"Loading data..."})}),s.jsxs(gn,{open:!!T,onClose:()=>$(null),children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(Os,{color:"error"}),"Delete Row"]}),s.jsxs(Cn,{children:[s.jsx(J,{children:"Are you sure you want to delete this row? This action cannot be undone."}),T&&N.length>0&&s.jsxs(K,{sx:{mt:2,p:1.5,bgcolor:"action.hover",borderRadius:1},children:[s.jsx(J,{variant:"caption",color:"text.secondary",display:"block",mb:.5,children:"Row identifier:"}),N.map(be=>s.jsxs(J,{variant:"body2",fontFamily:"monospace",children:[be,": ",String(T[be])]},be))]})]}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:()=>$(null),children:"Cancel"}),s.jsx(Le,{variant:"contained",color:"error",onClick:G,children:"Delete Row"})]})]})]})}function Lre({schema:e,loading:t}){return t?s.jsx(kl,{}):e?s.jsx(K,{sx:{flex:1,overflow:"auto"},children:s.jsx(Sa,{children:s.jsxs(Ca,{size:"small",stickyHeader:!0,children:[s.jsx(ja,{children:s.jsxs(Ur,{children:[s.jsx(lt,{sx:{fontWeight:600,bgcolor:"background.paper"},children:"Column"}),s.jsx(lt,{sx:{fontWeight:600,bgcolor:"background.paper"},children:"Type"}),s.jsx(lt,{sx:{fontWeight:600,bgcolor:"background.paper"},children:"Nullable"}),s.jsx(lt,{sx:{fontWeight:600,bgcolor:"background.paper"},children:"Default"}),s.jsx(lt,{sx:{fontWeight:600,bgcolor:"background.paper"},children:"Key"})]})}),s.jsx(wa,{children:e.columns.map(n=>s.jsxs(Ur,{hover:!0,children:[s.jsx(lt,{children:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[n.isPrimaryKey&&s.jsx(ri,{fontSize:"small",sx:{color:"warning.main"}}),s.jsx(J,{variant:"body2",fontWeight:n.isPrimaryKey?600:400,children:n.name})]})}),s.jsx(lt,{children:s.jsx(Ge,{label:n.dataType,size:"small",variant:"outlined",sx:{fontFamily:"monospace",fontSize:11}})}),s.jsx(lt,{children:s.jsx(Ge,{label:n.nullable?"NULL":"NOT NULL",size:"small",color:n.nullable?"default":"primary",sx:{fontSize:10}})}),s.jsx(lt,{children:n.defaultValue?s.jsx(J,{variant:"body2",fontFamily:"monospace",color:"text.secondary",children:n.defaultValue}):s.jsx(J,{variant:"body2",color:"text.disabled",children:"—"})}),s.jsx(lt,{children:s.jsxs(K,{sx:{display:"flex",gap:.5},children:[n.isPrimaryKey&&s.jsx(Ge,{label:"PK",size:"small",color:"warning",sx:{fontSize:10}}),n.isUnique&&s.jsx(Ge,{label:"UQ",size:"small",color:"info",sx:{fontSize:10}})]})})]},n.name))})]})})}):null}function Dre({schema:e,loading:t}){return t?s.jsx(kl,{}):e?e.indexes.length===0?s.jsxs(K,{sx:{p:4,textAlign:"center",color:"text.secondary"},children:[s.jsx(ri,{sx:{fontSize:48,opacity:.3,mb:1}}),s.jsx(J,{children:"No indexes defined"})]}):s.jsx(K,{sx:{flex:1,overflow:"auto"},children:s.jsx(Sa,{children:s.jsxs(Ca,{size:"small",stickyHeader:!0,children:[s.jsx(ja,{children:s.jsxs(Ur,{children:[s.jsx(lt,{sx:{fontWeight:600,bgcolor:"background.paper"},children:"Name"}),s.jsx(lt,{sx:{fontWeight:600,bgcolor:"background.paper"},children:"Columns"}),s.jsx(lt,{sx:{fontWeight:600,bgcolor:"background.paper"},children:"Type"}),s.jsx(lt,{sx:{fontWeight:600,bgcolor:"background.paper"},children:"Properties"})]})}),s.jsx(wa,{children:e.indexes.map((n,r)=>{const o=Array.isArray(n.columns)?n.columns:[];return s.jsxs(Ur,{hover:!0,children:[s.jsx(lt,{children:s.jsx(J,{variant:"body2",fontFamily:"monospace",children:n.name||`idx_${r}`})}),s.jsx(lt,{children:s.jsx(K,{sx:{display:"flex",gap:.5,flexWrap:"wrap"},children:o.map(i=>s.jsx(Ge,{label:i,size:"small",variant:"outlined",sx:{fontFamily:"monospace",fontSize:11}},i))})}),s.jsx(lt,{children:s.jsx(J,{variant:"body2",color:"text.secondary",children:n.type||"btree"})}),s.jsx(lt,{children:s.jsxs(K,{sx:{display:"flex",gap:.5},children:[n.isPrimary&&s.jsx(Ge,{label:"PRIMARY",size:"small",color:"warning",sx:{fontSize:10}}),n.isUnique&&s.jsx(Ge,{label:"UNIQUE",size:"small",color:"info",sx:{fontSize:10}})]})})]},n.name||r)})})]})})}):null}function Are({schema:e,loading:t}){return t?s.jsx(kl,{}):e?e.foreignKeys.length===0?s.jsxs(K,{sx:{p:4,textAlign:"center",color:"text.secondary"},children:[s.jsx(ll,{sx:{fontSize:48,opacity:.3,mb:1}}),s.jsx(J,{children:"No foreign keys defined"})]}):s.jsx(K,{sx:{flex:1,overflow:"auto"},children:s.jsx(Sa,{children:s.jsxs(Ca,{size:"small",stickyHeader:!0,children:[s.jsx(ja,{children:s.jsxs(Ur,{children:[s.jsx(lt,{sx:{fontWeight:600,bgcolor:"background.paper"},children:"Name"}),s.jsx(lt,{sx:{fontWeight:600,bgcolor:"background.paper"},children:"Columns"}),s.jsx(lt,{sx:{fontWeight:600,bgcolor:"background.paper"},children:"References"}),s.jsx(lt,{sx:{fontWeight:600,bgcolor:"background.paper"},children:"On Delete"}),s.jsx(lt,{sx:{fontWeight:600,bgcolor:"background.paper"},children:"On Update"})]})}),s.jsx(wa,{children:e.foreignKeys.map((n,r)=>{const o=Array.isArray(n.columns)?n.columns:[],i=Array.isArray(n.referencedColumns)?n.referencedColumns:[];return s.jsxs(Ur,{hover:!0,children:[s.jsx(lt,{children:s.jsx(J,{variant:"body2",fontFamily:"monospace",children:n.name||`fk_${r}`})}),s.jsx(lt,{children:s.jsx(K,{sx:{display:"flex",gap:.5,flexWrap:"wrap"},children:o.map(l=>s.jsx(Ge,{label:l,size:"small",variant:"outlined",sx:{fontFamily:"monospace",fontSize:11}},l))})}),s.jsxs(lt,{children:[s.jsxs(J,{variant:"body2",fontFamily:"monospace",children:[n.referencedSchema,".",n.referencedTable]}),s.jsxs(J,{variant:"caption",color:"text.secondary",children:["(",i.join(", "),")"]})]}),s.jsx(lt,{children:s.jsx(Ge,{label:n.onDelete||"NO ACTION",size:"small",color:n.onDelete==="CASCADE"?"error":"default",sx:{fontSize:10}})}),s.jsx(lt,{children:s.jsx(Ge,{label:n.onUpdate||"NO ACTION",size:"small",color:n.onUpdate==="CASCADE"?"warning":"default",sx:{fontSize:10}})})]},n.name||r)})})]})})}):null}function Fre({sql:e,onSqlChange:t,onExecute:n,onSave:r,onKeyDown:o,loading:i}){return s.jsxs(K,{sx:{flex:1,display:"flex",flexDirection:"column"},children:[s.jsx(K,{sx:{flex:1},onKeyDown:o,children:s.jsx(wO,{height:"100%",defaultLanguage:"sql",value:e,onChange:l=>t(l??""),theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:14,fontFamily:"JetBrains Mono, Fira Code, monospace",lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",padding:{top:16,bottom:16}}})}),s.jsxs(K,{sx:{p:1.5,borderTop:1,borderColor:"divider",display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"background.paper"},children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:"Press ⌘+Enter to execute • ⌘+S to save"}),s.jsxs(K,{sx:{display:"flex",gap:1},children:[r&&s.jsx(Pt,{title:"Save Query (⌘+S)",children:s.jsx(Le,{variant:"outlined",size:"small",startIcon:s.jsx(jU,{}),onClick:r,disabled:!e.trim(),children:"Save"})}),s.jsx(Le,{variant:"contained",size:"small",startIcon:i?s.jsx(At,{size:16,color:"inherit"}):s.jsx(Cl,{}),onClick:n,disabled:!e.trim()||i,children:"Run Query"})]})]})]})}function Nre({history:e,connections:t,onSelect:n,onRerun:r,onClear:o,onClose:i,onRefresh:l,clearing:c}){const u=p=>{const g=t.find(y=>y.id===p);return(g==null?void 0:g.name)??"Unknown"},f=p=>{const g=new Date(p),b=new Date().getTime()-g.getTime(),v=Math.floor(b/6e4),C=Math.floor(b/36e5),S=Math.floor(b/864e5);return v<1?"Just now":v<60?`${v}m ago`:C<24?`${C}h ago`:S<7?`${S}d ago`:g.toLocaleDateString()},h=(p,g=150)=>{const y=p.replace(/\s+/g," ").trim();return y.length<=g?y:y.slice(0,g)+"..."};return s.jsxs(K,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1,p:2,borderBottom:1,borderColor:"divider",bgcolor:"background.paper"},children:[s.jsx(vd,{color:"primary"}),s.jsx(J,{variant:"h6",sx:{flex:1,fontWeight:600},children:"Query History"}),s.jsx(Pt,{title:"Refresh",children:s.jsx(mt,{size:"small",onClick:l,children:s.jsx(Eo,{fontSize:"small"})})}),s.jsx(Pt,{title:"Clear All",children:s.jsx(mt,{size:"small",onClick:o,disabled:c||e.length===0,color:"error",children:s.jsx(PU,{fontSize:"small"})})}),s.jsx(mt,{size:"small",onClick:i,children:s.jsx(Gd,{fontSize:"small"})})]}),s.jsx(K,{sx:{flex:1,overflow:"auto"},children:e.length===0?s.jsxs(K,{sx:{p:4,textAlign:"center",color:"text.secondary"},children:[s.jsx(vd,{sx:{fontSize:48,opacity:.3,mb:1}}),s.jsx(J,{variant:"body2",children:"No query history yet"}),s.jsx(J,{variant:"caption",children:"Executed queries will appear here"})]}):e.map(p=>s.jsxs(K,{sx:{p:2,borderBottom:1,borderColor:"divider",cursor:"pointer","&:hover":{bgcolor:"action.hover"},transition:"background-color 0.15s"},onClick:()=>n(p),children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[p.success?s.jsx(Il,{sx:{fontSize:16,color:"success.main"}}):s.jsx(Na,{sx:{fontSize:16,color:"error.main"}}),s.jsx(J,{variant:"caption",color:"text.secondary",children:f(p.executedAt)}),s.jsx(K,{sx:{flex:1}}),s.jsx(Ge,{label:u(p.connectionId),size:"small",sx:{height:18,fontSize:10}})]}),s.jsx(J,{variant:"body2",fontFamily:"monospace",sx:{fontSize:12,color:p.success?"text.primary":"error.main",bgcolor:"action.hover",p:1,borderRadius:.5,mb:1,wordBreak:"break-all"},children:h(p.sql)}),s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:2},children:[p.success?s.jsxs(s.Fragment,{children:[s.jsxs(J,{variant:"caption",color:"text.secondary",children:[p.rowCount," rows"]}),s.jsxs(J,{variant:"caption",color:"text.secondary",children:[p.executionTimeMs,"ms"]})]}):s.jsx(J,{variant:"caption",color:"error.main",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.error}),s.jsx(K,{sx:{flex:1}}),s.jsx(Pt,{title:"Run Again",children:s.jsx(mt,{size:"small",onClick:g=>{g.stopPropagation(),r(p)},sx:{bgcolor:"primary.dark","&:hover":{bgcolor:"primary.main"}},children:s.jsx(_U,{sx:{fontSize:16}})})})]})]},p.id))}),e.length>0&&s.jsx(K,{sx:{p:1.5,borderTop:1,borderColor:"divider",bgcolor:"background.paper"},children:s.jsxs(J,{variant:"caption",color:"text.secondary",children:[e.length," queries • ",e.filter(p=>p.success).length," ","successful • ",e.filter(p=>!p.success).length," failed"]})})]})}function _re({queries:e,connections:t,onSelect:n,onRun:r,onEdit:o,onDelete:i,onClose:l,onRefresh:c}){const[u,f]=m.useState(""),[h,p]=m.useState(null),[g,y]=m.useState(null),b=k=>{if(!k)return"Any connection";const P=t.find(T=>T.id===k);return(P==null?void 0:P.name)??"Unknown"},v=k=>{const P=new Date(k),$=new Date().getTime()-P.getTime(),M=Math.floor($/864e5);return M<1?"Today":M<2?"Yesterday":M<7?`${M} days ago`:P.toLocaleDateString()},C=(k,P=120)=>{const T=k.replace(/\s+/g," ").trim();return T.length<=P?T:T.slice(0,P)+"..."},S=e.filter(k=>k.name.toLowerCase().includes(u.toLowerCase())||k.sql.toLowerCase().includes(u.toLowerCase())),j=(k,P)=>{k.stopPropagation(),p(k.currentTarget),y(P)},w=()=>{p(null),y(null)};return s.jsxs(K,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1,p:2,borderBottom:1,borderColor:"divider",bgcolor:"background.paper"},children:[s.jsx(Fp,{color:"primary"}),s.jsx(J,{variant:"h6",sx:{flex:1,fontWeight:600},children:"Saved Queries"}),s.jsx(Pt,{title:"Refresh",children:s.jsx(mt,{size:"small",onClick:c,children:s.jsx(Eo,{fontSize:"small"})})}),s.jsx(mt,{size:"small",onClick:l,children:s.jsx(Gd,{fontSize:"small"})})]}),s.jsx(K,{sx:{p:1.5,borderBottom:1,borderColor:"divider"},children:s.jsx(Wt,{size:"small",placeholder:"Search saved queries...",value:u,onChange:k=>f(k.target.value),fullWidth:!0,InputProps:{startAdornment:s.jsx(ds,{position:"start",children:s.jsx(Ud,{fontSize:"small",sx:{opacity:.5}})})}})}),s.jsx(K,{sx:{flex:1,overflow:"auto"},children:S.length===0?s.jsxs(K,{sx:{p:4,textAlign:"center",color:"text.secondary"},children:[s.jsx(Fp,{sx:{fontSize:48,opacity:.3,mb:1}}),s.jsx(J,{variant:"body2",children:u?"No matching queries":"No saved queries yet"}),s.jsx(J,{variant:"caption",children:u?"Try a different search term":"Save queries from the SQL tab to access them here"})]}):S.map(k=>s.jsxs(K,{sx:{p:2,borderBottom:1,borderColor:"divider",cursor:"pointer","&:hover":{bgcolor:"action.hover"},transition:"background-color 0.15s"},onClick:()=>n(k),children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[s.jsx(Fc,{sx:{fontSize:16,color:"primary.main"}}),s.jsx(J,{variant:"body2",fontWeight:600,sx:{flex:1},children:k.name}),s.jsx(Ge,{label:b(k.connectionId),size:"small",sx:{height:18,fontSize:10}}),s.jsx(mt,{size:"small",onClick:P=>j(P,k),sx:{ml:-.5},children:s.jsx(Yx,{sx:{fontSize:16}})})]}),s.jsx(J,{variant:"body2",fontFamily:"monospace",sx:{fontSize:12,color:"text.secondary",bgcolor:"action.hover",p:1,borderRadius:.5,mb:1,wordBreak:"break-all"},children:C(k.sql)}),s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:2},children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:v(k.updatedAt)}),s.jsx(K,{sx:{flex:1}}),s.jsx(Pt,{title:"Run Query",children:s.jsx(mt,{size:"small",onClick:P=>{P.stopPropagation(),r(k)},sx:{bgcolor:"primary.dark","&:hover":{bgcolor:"primary.main"}},children:s.jsx(Cl,{sx:{fontSize:16}})})})]})]},k.id))}),e.length>0&&s.jsx(K,{sx:{p:1.5,borderTop:1,borderColor:"divider",bgcolor:"background.paper"},children:s.jsx(J,{variant:"caption",color:"text.secondary",children:S.length===e.length?`${e.length} saved queries`:`${S.length} of ${e.length} queries`})}),s.jsxs(Ra,{anchorEl:h,open:!!h,onClose:w,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[s.jsxs(it,{onClick:()=>{g&&r(g),w()},children:[s.jsx(Rn,{children:s.jsx(Cl,{fontSize:"small"})}),s.jsx($n,{children:"Run"})]}),s.jsxs(it,{onClick:()=>{g&&n(g),w()},children:[s.jsx(Rn,{children:s.jsx(Fc,{fontSize:"small"})}),s.jsx($n,{children:"Load to Editor"})]}),s.jsxs(it,{onClick:()=>{g&&o(g),w()},children:[s.jsx(Rn,{children:s.jsx(Dr,{fontSize:"small"})}),s.jsx($n,{children:"Edit"})]}),s.jsxs(it,{onClick:()=>{g&&i(g),w()},sx:{color:"error.main"},children:[s.jsx(Rn,{children:s.jsx(dr,{fontSize:"small",color:"error"})}),s.jsx($n,{children:"Delete"})]})]})]})}const ia=(e,t)=>t==="mysql"||t==="mariadb"?`\`${e}\``:`"${e}"`,cg=(e,t,n)=>n==="sqlite"?ia(t,n):`${ia(e,n)}.${ia(t,n)}`,Og=["data","structure","indexes","foreignKeys","sql"],NE=e=>{if(!e)return 0;const t=Og.indexOf(e);return t>=0?t:0};function Hre(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(1))+" "+n[r]}const Bre=280;function Wre(e){const t=e.replace(/\s+/g," ").trim(),n=[/\bFROM\s+(?:["'`]?(\w+)["'`]?\.)?["'`]?(\w+)["'`]?/i,/\bINTO\s+(?:["'`]?(\w+)["'`]?\.)?["'`]?(\w+)["'`]?/i,/\bUPDATE\s+(?:["'`]?(\w+)["'`]?\.)?["'`]?(\w+)["'`]?/i];for(const r of n){const o=t.match(r);if(o){const i=o[1],l=o[2];if(l)return i?{schema:i,table:l}:{table:l}}}return null}function Vre({targetConnections:e,targetConnectionId:t,onConnectionChange:n}){const{healthStatus:r,checkConnection:o}=Vd(),i=u=>{const f=r[u.id];return f?f.isOnline?s.jsx(Pt,{title:"Connected",children:s.jsx(Il,{sx:{fontSize:14,color:"success.main",ml:"auto"}})}):s.jsx(Pt,{title:f.error||"Connection failed",children:s.jsx(Na,{sx:{fontSize:14,color:"error.main",ml:"auto"}})}):s.jsx(Pt,{title:"Status unknown",children:s.jsx(Qx,{sx:{fontSize:14,color:"text.disabled",ml:"auto"}})})},l=u=>{const f=r[u.id];return f&&!f.isOnline},c=async u=>{const f=r[u];if(f){if(!f.isOnline)return}else if(!await o(u))return;n(u)};return s.jsxs(_n,{fullWidth:!0,children:[s.jsx(Hn,{children:"Target Connection"}),s.jsx(On,{value:t,onChange:u=>c(u.target.value),label:"Target Connection",children:e.map(u=>{const f=l(u);return s.jsx(it,{value:u.id,disabled:f,sx:{opacity:f?.5:1},children:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%"},children:[s.jsx(Cr,{fontSize:"small",sx:{opacity:.6}}),s.jsx("span",{children:u.name}),s.jsx(Ge,{label:u.engine,size:"small",sx:{ml:"auto",mr:1}}),i(u)]})},u.id)})})]})}function _E({open:e,onClose:t,onConfirm:n,title:r,message:o,confirmText:i="Confirm",confirmColor:l="error",requireTyping:c,loading:u=!1}){const[f,h]=m.useState("");m.useEffect(()=>{e||h("")},[e]);const p=c?f===c:!0;return s.jsxs(gn,{open:e,onClose:t,maxWidth:"sm",fullWidth:!0,children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(Os,{color:l}),r]}),s.jsx(Cn,{children:s.jsxs(K,{sx:{display:"flex",flexDirection:"column",gap:2},children:[typeof o=="string"?s.jsx(J,{children:o}):o,c&&s.jsx(Wt,{fullWidth:!0,size:"small",label:`Type "${c}" to confirm`,value:f,onChange:g=>h(g.target.value),autoFocus:!0,error:f.length>0&&f!==c,helperText:f.length>0&&f!==c?"Text does not match":void 0})]})}),s.jsxs(vn,{sx:{px:3,py:2},children:[s.jsx(Le,{onClick:t,disabled:u,children:"Cancel"}),s.jsx(Le,{variant:"contained",color:l,onClick:n,disabled:!p||u,startIcon:u?s.jsx(At,{size:16,color:"inherit"}):void 0,children:i})]})]})}function Gre({open:e,onClose:t,onSubmit:n,columns:r,tableName:o}){const[i,l]=m.useState({}),c=()=>{n(i),l({})},u=()=>{l({}),t()},f=r.filter(h=>!h.dataType.toLowerCase().includes("serial")&&!h.dataType.toLowerCase().includes("identity"));return s.jsxs(gn,{open:e,onClose:u,maxWidth:"sm",fullWidth:!0,children:[s.jsxs(wn,{children:["Add Row to ",o]}),s.jsx(Cn,{children:s.jsx(K,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:f.map(h=>s.jsx(Wt,{label:s.jsxs(K,{component:"span",sx:{display:"flex",alignItems:"center",gap:.5},children:[h.name,s.jsxs(J,{component:"span",variant:"caption",color:"text.secondary",sx:{ml:.5},children:["(",h.dataType,")"]}),!h.nullable&&s.jsx(J,{component:"span",color:"error.main",children:"*"})]}),value:i[h.name]||"",onChange:p=>l({...i,[h.name]:p.target.value}),size:"small",fullWidth:!0,placeholder:h.defaultValue?`Default: ${h.defaultValue}`:void 0},h.name))})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:u,children:"Cancel"}),s.jsx(Le,{variant:"contained",onClick:c,children:"Add Row"})]})]})}function Ure({open:e,onClose:t,rows:n,sourceConnectionId:r,sourceConnection:o,schema:i,table:l,primaryKeys:c,connections:u}){const[f,h]=m.useState(""),[p,g]=m.useState(""),[y,b]=m.useState("upsert"),[v,C]=m.useState(!1),[S,j]=m.useState(null),w=oo(),k=o==null?void 0:o.groupId,P=u.filter(E=>E.id!==r&&E.groupId===k&&k),T=!!k,{data:$=[]}=Ft({queryKey:["schemas",f],queryFn:()=>xn.getSchemas(f),enabled:!!f});m.useEffect(()=>{if($.length>0&&!p){const E=u.find(O=>O.id===f);if(((E==null?void 0:E.engine)==="mysql"||(E==null?void 0:E.engine)==="mariadb")&&E.database&&$.includes(E.database)){g(E.database);return}$.includes(i)?g(i):g($[0]||"")}},[$,p,i,f,u]);const M=()=>{h(""),g(""),j(null),t()},R=async()=>{if(!(!f||!p||n.length===0)){C(!0),j(null);try{const E=n.map(A=>{const N={};for(const F of c)N[F]=A[F];return N}),O=await ai.syncRows(r,f,i,p,l,E,c,y);j(O),O.errors.length===0?w.success(`Synced ${O.inserted+O.updated} row(s)`):w.warning(`Sync completed with ${O.errors.length} error(s)`)}catch(E){j({inserted:0,updated:0,errors:[E instanceof Error?E.message:"Sync failed"]}),w.error("Row sync failed")}finally{C(!1)}}};return s.jsxs(gn,{open:e,onClose:M,maxWidth:"sm",fullWidth:!0,children:[s.jsxs(wn,{children:["Sync ",n.length," Row",n.length>1?"s":""," Within Instance Group"]}),s.jsx(Cn,{children:s.jsxs(K,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[s.jsxs(Nt,{severity:"info",icon:!1,children:[s.jsxs(J,{variant:"body2",children:[s.jsx("strong",{children:"Source:"})," ",(o==null?void 0:o.name)||"Unknown"," →"," ",i,".",l]}),s.jsxs(J,{variant:"body2",color:"text.secondary",children:["Primary keys:"," ",c.length>0?c.join(", "):"(none detected)"]}),(o==null?void 0:o.groupName)&&s.jsxs(J,{variant:"body2",color:"text.secondary",children:["Instance Group: ",o.groupName]}),n.length>0&&n[0]&&s.jsxs(J,{variant:"body2",color:"text.secondary",children:["Row IDs to sync:"," ",c.length>0?n.map(E=>c.map(O=>`${O}=${E[O]}`).join(",")).join(" | "):`(row keys: ${Object.keys(n[0]).join(", ")})`]})]}),c.length===0&&s.jsxs(Nt,{severity:"error",children:[s.jsx(J,{variant:"body2",children:"No primary keys detected for this table."}),s.jsx(J,{variant:"body2",color:"text.secondary",children:"Cannot sync rows without primary keys to identify them."})]}),!T&&s.jsxs(Nt,{severity:"warning",children:[s.jsx(J,{variant:"body2",children:"This connection is not part of an Instance Group."}),s.jsx(J,{variant:"body2",color:"text.secondary",children:"Row sync is only available between connections in the same Instance Group. Add this connection to a group on the Connections page to enable syncing."})]}),T&&P.length===0&&s.jsxs(Nt,{severity:"warning",children:[s.jsx(J,{variant:"body2",children:"No other connections in this Instance Group."}),s.jsx(J,{variant:"body2",color:"text.secondary",children:"Add more connections to the same group to enable syncing between them."})]}),T&&P.length>0&&s.jsx(Vre,{targetConnections:P,targetConnectionId:f,onConnectionChange:E=>{h(E),g("")}}),f&&s.jsxs(_n,{fullWidth:!0,children:[s.jsx(Hn,{children:"Target Schema/Database"}),s.jsx(On,{value:p,onChange:E=>g(E.target.value),label:"Target Schema/Database",children:$.map(E=>s.jsx(it,{value:E,children:E},E))})]}),f&&s.jsxs(_n,{fullWidth:!0,children:[s.jsx(Hn,{children:"Sync Mode"}),s.jsxs(On,{value:y,onChange:E=>b(E.target.value),label:"Sync Mode",children:[s.jsx(it,{value:"upsert",children:s.jsxs(K,{children:[s.jsx(J,{variant:"body2",children:"Upsert (Insert or Update)"}),s.jsx(J,{variant:"caption",color:"text.secondary",children:"Insert new rows, update existing ones"})]})}),s.jsx(it,{value:"insert",children:s.jsxs(K,{children:[s.jsx(J,{variant:"body2",children:"Insert Only"}),s.jsx(J,{variant:"caption",color:"text.secondary",children:"Only insert new rows, skip existing"})]})})]})]}),S&&s.jsxs(Nt,{severity:S.errors.length>0?"warning":"success",children:[s.jsxs(J,{variant:"body2",children:[S.inserted>0&&`Inserted: ${S.inserted} `,S.updated>0&&`Updated: ${S.updated} `,S.inserted===0&&S.updated===0&&S.errors.length===0&&"No changes made"]}),S.errors.length>0&&s.jsxs(J,{variant:"body2",color:"error",children:["Errors: ",S.errors.join(", ")]})]})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:M,children:S?"Close":"Cancel"}),!S&&T&&P.length>0&&s.jsx(Le,{variant:"contained",onClick:R,disabled:!f||!p||v||c.length===0,startIcon:v?s.jsx(At,{size:16}):s.jsx(fs,{}),children:v?"Syncing...":"Sync"})]})]})}function qre({open:e,onClose:t,onSave:n,sql:r,connectionId:o,connections:i,editingQuery:l}){const[c,u]=m.useState(""),[f,h]=m.useState(""),[p,g]=m.useState(!1);m.useEffect(()=>{e&&(l?(u(l.name),h(l.connectionId||""),g(!!l.connectionId)):(u(""),h(o||""),g(!1)))},[e,l,o]);const y=()=>{u(""),h(""),g(!1),t()},b=()=>{c.trim()&&(n({name:c.trim(),sql:r,connectionId:p?f:void 0}),y())},v=!!l;return s.jsxs(gn,{open:e,onClose:y,maxWidth:"sm",fullWidth:!0,children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(Fp,{color:"primary"}),v?"Edit Saved Query":"Save Query"]}),s.jsx(Cn,{children:s.jsxs(K,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[s.jsx(Wt,{label:"Query Name",value:c,onChange:C=>u(C.target.value),fullWidth:!0,size:"small",autoFocus:!0,placeholder:"e.g., Get active users, Monthly report",helperText:"Give your query a descriptive name"}),s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",sx:{mb:.5,display:"block"},children:"SQL Query"}),s.jsx(K,{sx:{bgcolor:"action.hover",p:1.5,borderRadius:1,fontFamily:"monospace",fontSize:12,maxHeight:150,overflow:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:r||"(empty query)"})]}),s.jsx(Kr,{control:s.jsx($s,{checked:p,onChange:C=>g(C.target.checked)}),label:"Bind to specific connection"}),p&&s.jsxs(_n,{fullWidth:!0,size:"small",children:[s.jsx(Hn,{children:"Connection"}),s.jsx(On,{value:f,onChange:C=>h(C.target.value),label:"Connection",children:i.map(C=>s.jsx(it,{value:C.id,children:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(Cr,{fontSize:"small",sx:{opacity:.6}}),C.name,s.jsx(Ge,{label:C.engine,size:"small",sx:{ml:"auto",height:18,fontSize:10}})]})},C.id))})]}),p&&s.jsx(J,{variant:"caption",color:"text.secondary",children:"When bound to a connection, this query will automatically switch to that connection when loaded."})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:y,children:"Cancel"}),s.jsx(Le,{variant:"contained",onClick:b,disabled:!c.trim()||!r.trim(),startIcon:s.jsx(Fp,{}),children:v?"Update":"Save"})]})]})}function Kre({connectionSelected:e}){return s.jsx(K,{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},children:e?s.jsx(go,{icon:s.jsx(xo,{}),title:"Select a table",description:"Choose a table from the sidebar to view its data, structure, indexes, and foreign keys. Or write a custom SQL query above.",size:"medium"}):s.jsx(go,{icon:s.jsx(Cr,{}),title:"No connection selected",description:"Select a database connection from the dropdown above to browse tables and run queries.",size:"medium"})})}function SO({value:e,onChange:t,disabled:n=!1,size:r="small",minWidth:o=200,label:i="Connection",disableOffline:l=!0}){const{data:c=[],isLoading:u}=Ft({queryKey:["connections"],queryFn:Qr.getAll}),{healthStatus:f,checkConnection:h}=Vd(),p=b=>{if(!l)return!1;const v=f[b.id];return v&&!v.isOnline},g=async b=>{const v=b.target.value,C=f[v];if(C){if(!C.isOnline&&l)return}else if(!await h(v)&&l)return;t(v)},y=m.useMemo(()=>[...c].sort((b,v)=>{const C=f[b.id],S=f[v.id],j=C?C.isOnline?1:-1:0;return(S?S.isOnline?1:-1:0)-j}),[c,f]);return s.jsxs(_n,{size:r,sx:{minWidth:o},disabled:n||u,children:[s.jsx(Hn,{children:i}),s.jsx(On,{value:e,onChange:g,label:i,children:y.map(b=>{const v=p(b);return s.jsx(it,{value:b.id,disabled:v,sx:{opacity:v?.5:1},children:b.name},b.id)})})]})}function HE(){const{connectionId:e}=Sx(),[t,n]=kx(),r=Ko(),{lastState:o,saveState:i}=Sne(),l=oo(),{selectedConnectionId:c,selectedSchema:u,setConnectionAndSchema:f}=pO(),h=t.get("schema"),p=t.get("table"),g=t.get("tab"),[y,b]=m.useState(()=>e||c||(o==null?void 0:o.connectionId)||""),[v,C]=m.useState(()=>h||u||(o==null?void 0:o.schema)||"");m.useEffect(()=>{e&&e!==y&&b(e)},[e,y]),m.useEffect(()=>{h&&h!==v&&C(h)},[h,v]);const S=()=>g?NE(g):!e&&(o!=null&&o.tab)?NE(o.tab):0,[j,w]=m.useState(null),[k,P]=m.useState(""),[T,$]=m.useState(""),[M,R]=m.useState(null),[E,O]=m.useState(null),[A,N]=m.useState(null),[F,L]=m.useState({page:0,pageSize:100}),[D,H]=m.useState(""),[B,V]=m.useState(S()),[G,_]=m.useState(null),[U,Z]=m.useState(()=>{const se={},xe=h||(o==null?void 0:o.schema);return xe&&(se[xe]=!0),se}),[Q,ee]=m.useState(!1),[ne,re]=m.useState(!1),[Y,ie]=m.useState(!1),[ce,he]=m.useState([]),[de,le]=m.useState(!1),[ge,Se]=m.useState(!1),[ke,we]=m.useState(null),[Oe,be]=m.useState(null),[Fe,Ve]=m.useState(null),De=m.useRef("");m.useEffect(()=>{if(!e){const se=c||(o==null?void 0:o.connectionId),xe=u||(o==null?void 0:o.schema);if(se){const Re=new URLSearchParams;xe&&Re.set("schema",xe),o!=null&&o.table&&Re.set("table",o.table),o!=null&&o.tab&&Re.set("tab",o.tab),r(`/query/${se}?${Re.toString()}`,{replace:!0})}}},[]);const Ze=m.useCallback(se=>{const xe=new URLSearchParams(t);if(se.schema!==void 0&&(se.schema?xe.set("schema",se.schema):xe.delete("schema")),se.table!==void 0&&(se.table?xe.set("table",se.table):xe.delete("table")),se.tab!==void 0){const Re=Og[se.tab];Re&&xe.set("tab",Re)}n(xe,{replace:!0})},[t,n]),Ae=m.useCallback(se=>{b(se);const xe=Og[B];r(`/query/${se}?tab=${xe}`,{replace:!0}),w(null),C(""),R(null),O(null),$("")},[r,B]),st=m.useCallback(se=>{C(se),Z(xe=>({...xe,[se]:!0})),Ze({schema:se,table:""}),w(null)},[Ze]),qe=m.useCallback(se=>{V(se),Ze({tab:se})},[Ze]);m.useEffect(()=>{y&&(i({connectionId:y,schema:v,table:(j==null?void 0:j.name)??"",tab:Og[B]??"data"}),f(y,v))},[y,v,j==null?void 0:j.name,B,i,f]);const{data:et=[]}=Ft({queryKey:["connections"],queryFn:Qr.getAll}),oe=et.find(se=>se.id===y),{data:fe=[],isLoading:Ie,refetch:$e}=Ft({queryKey:["schemas",y],queryFn:()=>xn.getSchemas(y),enabled:!!y}),{data:pt=[],isLoading:vt,refetch:Je}=Ft({queryKey:["tables",y,v],queryFn:()=>xn.getTables(y,v||void 0),enabled:!!y}),{data:me,isLoading:Ne}=Ft({queryKey:["tableSchema",y,j==null?void 0:j.schema,j==null?void 0:j.name],queryFn:()=>xn.getTableSchema(y,(j==null?void 0:j.schema)??"public",(j==null?void 0:j.name)??""),enabled:!!y&&!!j}),{data:xt=[],refetch:Bt}=Ft({queryKey:["queryHistory",y],queryFn:()=>mo.getHistory(y||void 0,50),enabled:Q}),pn=vr({mutationFn:()=>mo.clearHistory(y||void 0),onSuccess:()=>{Bt(),l.success("Query history cleared")}}),{data:yn=[],refetch:hn}=Ft({queryKey:["savedQueries"],queryFn:()=>mo.getSaved(),enabled:de}),ln=vr({mutationFn:se=>ke?mo.updateSaved(ke.id,se):mo.createSaved(se),onSuccess:()=>{hn(),l.success(ke?"Query updated":"Query saved"),we(null)},onError:()=>{l.error("Failed to save query")}}),An=vr({mutationFn:se=>mo.deleteSaved(se),onSuccess:()=>{hn(),l.success("Query deleted")},onError:()=>{l.error("Failed to delete query")}});m.useEffect(()=>{if(fe.length>0&&!v){const se=h;if(se&&fe.includes(se))C(se),Z({[se]:!0});else{const xe=oe==null?void 0:oe.engine;let Re;xe==="mysql"||xe==="mariadb"?Re=oe!=null&&oe.database&&fe.includes(oe.database)?oe.database:fe[0]:Re=(oe!=null&&oe.defaultSchema&&fe.includes(oe.defaultSchema)?oe.defaultSchema:null)??fe.find(nt=>nt==="public")??fe.find(nt=>nt==="main")??fe[0],Re&&(C(Re),Z({[Re]:!0}),Ze({schema:Re}))}}},[fe,v,h,Ze,oe==null?void 0:oe.defaultSchema,oe==null?void 0:oe.engine,oe==null?void 0:oe.database]);const kt=vr({mutationFn:async({query:se,confirmed:xe})=>{if(!y)throw new Error("No connection selected");return De.current=se,mo.execute(y,se,xe)},onSuccess:se=>{R(se),O(null),_(null),V(0),Ze({tab:0});const xe=Wre(De.current);if(xe&&pt.length>0){const Re=pt.find(nt=>{const wt=nt.name.toLowerCase()===xe.table.toLowerCase();return xe.schema?wt&&nt.schema.toLowerCase()===xe.schema.toLowerCase():wt});Re&&Re.name!==(j==null?void 0:j.name)&&(w(Re),C(Re.schema),Z(nt=>({...nt,[Re.schema]:!0})),Ze({schema:Re.schema,table:Re.name}))}Q&&Bt()},onError:se=>{try{const xe=JSON.parse(se.message);if(xe.requiresConfirmation){_({message:xe.message,type:xe.dangerousType});return}}catch{}O(se.message),R(null),_(null),l.error("Query failed")}}),un=m.useCallback(()=>{T.trim()&&(_(null),kt.mutate({query:T}))},[kt,T]),er=()=>{kt.mutate({query:T,confirmed:!0})};m.useEffect(()=>{if(pt.length>0&&!j){const se=p||(o==null?void 0:o.table),xe=h||(o==null?void 0:o.schema);if(se){const Re=pt.find(nt=>nt.name===se&&(!xe||nt.schema===xe));Re&&Ke(Re)}}},[pt,p,h,j]);const yt=m.useCallback(se=>{(se.metaKey||se.ctrlKey)&&se.key==="Enter"&&(se.preventDefault(),un()),(se.metaKey||se.ctrlKey)&&se.key==="s"&&(se.preventDefault(),T.trim()&&Se(!0))},[un,T]),Ht=m.useCallback((se,xe,Re,nt,wt)=>{const Dt=xe*Re,Yt=oe==null?void 0:oe.engine,qt=cg(se.schema,se.name,Yt);let on;if(nt&&nt.trim()&&(wt!=null&&wt.columns.length)){const nn=nt.replaceAll("'","''"),bo=["text","varchar","char","character varying","character","name","citext","uuid"],To=wt.columns.filter(Mo=>bo.some(Kt=>Mo.dataType.toLowerCase().includes(Kt))||Mo.dataType.toLowerCase().includes("text"));if(To.length>0){const Mo=To.map(Kt=>{const Nr=ia(Kt.name,Yt);return Yt==="sqlite"?`${Nr} LIKE '%${nn}%'`:Yt==="mysql"||Yt==="mariadb"?`${Nr} LIKE '%${nn}%'`:`${Nr}::text ILIKE '%${nn}%'`});on=`SELECT * FROM ${qt} WHERE ${Mo.join(" OR ")} LIMIT ${Re} OFFSET ${Dt};`}else on=`SELECT * FROM ${qt} LIMIT ${Re} OFFSET ${Dt};`}else on=`SELECT * FROM ${qt} LIMIT ${Re} OFFSET ${Dt};`;$(on),kt.mutate({query:on})},[oe==null?void 0:oe.engine,kt]),Ke=m.useCallback(async se=>{w(se),N(null),L({page:0,pageSize:100}),H(""),Ze({table:se.name});try{const{count:xe}=await xn.getTableRowCount(y,se.schema||"main",se.name);N(xe)}catch{N(null)}Ht(se,0,100)},[y,Ze,Ht]),rt=m.useCallback(se=>{L(se),j&&Ht(j,se.page,se.pageSize,D,me)},[j,Ht,D,me]),It=m.useCallback(async se=>{if(H(se),L(xe=>({...xe,page:0})),j){if(se.trim())N(null);else try{const{count:xe}=await xn.getTableRowCount(y,j.schema||"main",j.name);N(xe)}catch{N(null)}Ht(j,0,F.pageSize,se,me)}},[j,y,Ht,F.pageSize,me]),Jt=pt.filter(se=>se.name.toLowerCase().includes(k.toLowerCase())).reduce((se,xe)=>{const Re=xe.schema||"main";return se[Re]??(se[Re]=[]),se[Re].push(xe),se},{}),tr=()=>{$e(),Je()},kr=m.useCallback(se=>{if(!j||!y||!me)return;const xe=oe==null?void 0:oe.engine,Re=cg(j.schema,j.name,xe),nt=Object.keys(se).filter(Yt=>se[Yt]!==""),wt=nt.map(Yt=>{const qt=me.columns.find(nn=>nn.name===Yt),on=se[Yt]??"";return qt!=null&&qt.dataType.toLowerCase().includes("int")||qt!=null&&qt.dataType.toLowerCase().includes("numeric")||qt!=null&&qt.dataType.toLowerCase().includes("decimal")||qt!=null&&qt.dataType.toLowerCase().includes("float")||qt!=null&&qt.dataType.toLowerCase().includes("double")||qt!=null&&qt.dataType.toLowerCase().includes("real")?on:`'${on.replaceAll("'","''")}'`}),Dt=`INSERT INTO ${Re} (${nt.map(Yt=>ia(Yt,xe)).join(", ")}) VALUES (${wt.join(", ")});`;$(Dt),kt.mutate({query:Dt},{onSuccess:()=>{re(!1),l.success("Row added successfully"),j&&Ht(j,F.page,F.pageSize,D,me)}})},[j,y,oe==null?void 0:oe.engine,me,kt,Ht,F,D,l]),pr=m.useCallback((se,xe)=>{if(se==null)return"NULL";const Re=me==null?void 0:me.columns.find(wt=>wt.name===xe),nt=(Re==null?void 0:Re.dataType.toLowerCase())||"";return nt.includes("int")||nt.includes("numeric")||nt.includes("decimal")||nt.includes("float")||nt.includes("double")||nt.includes("real")||nt.includes("bool")?String(se):nt.includes("json")||nt.includes("jsonb")?`'${(typeof se=="object"?JSON.stringify(se):String(se)).replaceAll("'","''")}'`:typeof se=="object"?`'${JSON.stringify(se).replaceAll("'","''")}'`:`'${String(se).replaceAll("'","''")}'`},[me]),so=se=>{var Re;const xe=se.match(/FROM\s+([`"]?[\w.]+[`"]?)/i);return((Re=xe==null?void 0:xe[1])==null?void 0:Re.replace(/[`"]/g,""))??null},Kn=se=>se?se.columns.filter(xe=>{const Re=xe.name.toLowerCase();return Re==="id"||Re==="version"||Re.endsWith("_id")}).map(xe=>xe.name):[],nr=m.useCallback(async(se,xe)=>{if(!y)return;const Re=oe==null?void 0:oe.engine;let nt,wt;if(j&&me)nt=cg(j.schema,j.name,Re),wt=me.columns.filter(on=>on.isPrimaryKey).map(on=>on.name);else{const on=so(T);if(!on)throw new Error("Cannot determine table name for update");if(nt=on,wt=Kn(M),wt.length===0)throw new Error("Cannot update row: no primary key identified (looking for columns named: id, version, or ending with _id)")}const Dt=[];for(const on of Object.keys(xe)){if(on==="__rowIndex")continue;const nn=se[on],bo=xe[on];(typeof nn=="object"||typeof bo=="object"?JSON.stringify(nn)!==JSON.stringify(bo):nn!==bo)&&Dt.push(`${ia(on,Re)} = ${pr(bo,on)}`)}if(Dt.length===0)return;const Yt=wt.map(on=>`${ia(on,Re)} = ${pr(se[on],on)}`),qt=`UPDATE ${nt} SET ${Dt.join(", ")} WHERE ${Yt.join(" AND ")};`;return $(qt),new Promise((on,nn)=>{kt.mutate({query:qt,confirmed:!0},{onSuccess:()=>{j&&me?Ht(j,F.page,F.pageSize,D,me):kt.mutate({query:T,confirmed:!0}),l.success("Row updated"),on()},onError:bo=>{l.error("Failed to update row"),nn(bo)}})})},[j,y,oe==null?void 0:oe.engine,me,kt,Ht,F,D,pr,l,T,M]),io=m.useCallback(se=>{Ve(se)},[]),Zr=m.useCallback(()=>{if(!j||!y||!me||!Fe)return;const se=oe==null?void 0:oe.engine,xe=cg(j.schema,j.name,se),Re=me.columns.filter(Dt=>Dt.isPrimaryKey).map(Dt=>Dt.name);if(Re.length===0){O("Cannot delete row: no primary key defined"),Ve(null);return}const nt=Re.map(Dt=>`${ia(Dt,se)} = ${pr(Fe[Dt],Dt)}`),wt=`DELETE FROM ${xe} WHERE ${nt.join(" AND ")};`;$(wt),kt.mutate({query:wt,confirmed:!0},{onSuccess:()=>{j&&Ht(j,F.page,F.pageSize,D,me),A!==null&&N(A-1),l.success("Row deleted"),Ve(null)}})},[j,y,oe==null?void 0:oe.engine,me,Fe,kt,Ht,F,D,pr,A,l]);return s.jsxs(K,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:2,px:2,py:1.5,borderBottom:1,borderColor:"divider",bgcolor:"background.paper"},children:[s.jsx(SO,{value:y,onChange:Ae,disableOffline:!0}),oe&&s.jsxs(s.Fragment,{children:[s.jsx(J,{variant:"body2",color:"text.secondary",fontFamily:"monospace",children:oe.engine==="sqlite"?oe.database.split("/").pop():`${oe.host}/${oe.database}`}),s.jsx(Ge,{label:oe.engine.toUpperCase(),size:"small",sx:{fontSize:10,height:20,bgcolor:"primary.dark",color:"primary.contrastText"}})]}),s.jsx(K,{sx:{flex:1}}),s.jsx(Pt,{title:"Saved Queries",children:s.jsx(mt,{size:"small",onClick:()=>le(!0),color:de?"primary":"default",children:s.jsx(Fp,{fontSize:"small"})})}),s.jsx(Pt,{title:"Query History",children:s.jsx(mt,{size:"small",onClick:()=>ee(!0),color:Q?"primary":"default",children:s.jsx(vd,{fontSize:"small"})})}),s.jsx(Pt,{title:"Refresh",children:s.jsx(mt,{size:"small",onClick:tr,children:s.jsx(Eo,{fontSize:"small"})})})]}),s.jsxs(K,{sx:{flex:1,display:"flex",minHeight:0},children:[s.jsxs(K,{sx:{width:Bre,borderRight:1,borderColor:"divider",display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[y&&fe.length>0&&s.jsx(K,{sx:{p:1.5,borderBottom:1,borderColor:"divider"},children:s.jsxs(_n,{size:"small",fullWidth:!0,children:[s.jsx(Hn,{children:"Schema"}),s.jsx(On,{value:v,onChange:se=>st(se.target.value),label:"Schema",startAdornment:s.jsx(ds,{position:"start",children:s.jsx($i,{fontSize:"small",sx:{color:"primary.main"}})}),children:fe.map(se=>s.jsx(it,{value:se,children:se},se))})]})}),s.jsx(K,{sx:{p:1.5},children:s.jsx(Wt,{size:"small",placeholder:"Search tables...",value:k,onChange:se=>P(se.target.value),fullWidth:!0,InputProps:{startAdornment:s.jsx(ds,{position:"start",children:s.jsx(Ud,{fontSize:"small",sx:{opacity:.5}})})},sx:{"& .MuiOutlinedInput-root":{bgcolor:"background.paper"}}})}),s.jsxs(K,{sx:{flex:1,overflow:"auto"},children:[(Ie||vt)&&s.jsx(kl,{}),!y&&s.jsxs(K,{sx:{p:2,textAlign:"center",color:"text.secondary"},children:[s.jsx(Cr,{sx:{fontSize:36,opacity:.3,mb:1}}),s.jsx(J,{variant:"body2",fontWeight:500,children:"Select a connection"}),s.jsx(J,{variant:"caption",color:"text.disabled",children:"Choose from the dropdown above"})]}),y&&Object.keys(Jt).length===0&&!vt&&s.jsxs(K,{sx:{p:2,textAlign:"center",color:"text.secondary"},children:[s.jsx(xo,{sx:{fontSize:36,opacity:.3,mb:1}}),s.jsx(J,{variant:"body2",fontWeight:500,children:"No tables found"}),s.jsx(J,{variant:"caption",color:"text.disabled",children:"This schema is empty"})]}),Object.entries(Jt).map(([se,xe])=>s.jsxs(K,{children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",px:1.5,py:1,cursor:"pointer","&:hover":{bgcolor:"action.hover"},borderBottom:1,borderColor:"divider"},onClick:()=>Z(Re=>({...Re,[se]:!Re[se]})),children:[U[se]?s.jsx(Ac,{fontSize:"small",sx:{mr:.5}}):s.jsx(bl,{fontSize:"small",sx:{mr:.5}}),s.jsx($i,{fontSize:"small",sx:{mr:1,color:"primary.main"}}),s.jsx(J,{variant:"body2",fontWeight:600,children:se}),s.jsx(Ge,{label:xe.length,size:"small",sx:{ml:"auto",height:18,fontSize:10}})]}),s.jsx(Di,{in:U[se],children:xe.map(Re=>s.jsx(jne,{table:Re,selected:(j==null?void 0:j.schema)===Re.schema&&(j==null?void 0:j.name)===Re.name,onClick:()=>Ke(Re)},`${Re.schema}.${Re.name}`))})]},se))]}),y&&pt.length>0&&s.jsx(K,{sx:{p:1.5,borderTop:1,borderColor:"divider",bgcolor:"background.paper"},children:s.jsxs(J,{variant:"caption",color:"text.secondary",children:[pt.filter(se=>se.type==="table").length," tables,"," ",pt.filter(se=>se.type==="view").length," views"]})})]}),s.jsx(K,{sx:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:y?s.jsxs(s.Fragment,{children:[j&&s.jsxs(K,{sx:{px:2,py:1.5,borderBottom:1,borderColor:"divider",bgcolor:"background.paper",display:"flex",alignItems:"center",gap:2},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[j.type==="view"?s.jsx(vh,{color:"secondary"}):s.jsx(xo,{color:"primary"}),s.jsx(J,{variant:"h6",fontWeight:600,children:j.name}),s.jsx(Ge,{label:j.type,size:"small",color:j.type==="view"?"secondary":"default",sx:{textTransform:"uppercase",fontSize:10}})]}),j.rowCount!==void 0&&s.jsxs(J,{variant:"body2",color:"text.secondary",children:["~",j.rowCount.toLocaleString()," rows"]}),j.sizeBytes!==void 0&&s.jsx(J,{variant:"body2",color:"text.secondary",children:Hre(j.sizeBytes)}),s.jsx(K,{sx:{flex:1}}),j.type!=="view"&&s.jsx(Pt,{title:"Add Row",children:s.jsx(mt,{size:"small",onClick:()=>re(!0),disabled:!me,children:s.jsx(Gn,{fontSize:"small"})})}),s.jsx(Pt,{title:"Run Query (⌘+Enter)",children:s.jsx("span",{children:s.jsx(Le,{variant:"contained",size:"small",startIcon:kt.isPending?s.jsx(At,{size:16,color:"inherit"}):s.jsx(Cl,{}),onClick:un,disabled:!T.trim()||kt.isPending,children:"Run"})})})]}),s.jsx(K,{sx:{borderBottom:1,borderColor:"divider"},children:s.jsxs(yl,{value:B,onChange:(se,xe)=>qe(xe),sx:{minHeight:48},children:[s.jsx(Bn,{label:s.jsx(lp,{badgeContent:M==null?void 0:M.rowCount,color:"primary",max:999,children:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:.5,pr:1},children:[s.jsx(Nw,{fontSize:"small"}),"Data"]})}),sx:{minHeight:48,textTransform:"none"}}),s.jsx(Bn,{label:s.jsx(lp,{badgeContent:me==null?void 0:me.columns.length,color:"primary",children:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:.5,pr:1},children:[s.jsx($i,{fontSize:"small"}),"Structure"]})}),sx:{minHeight:48,textTransform:"none"}}),s.jsx(Bn,{label:s.jsx(lp,{badgeContent:me==null?void 0:me.indexes.length,color:"primary",children:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:.5,pr:1},children:[s.jsx(ri,{fontSize:"small"}),"Indexes"]})}),sx:{minHeight:40,textTransform:"none"}}),s.jsx(Bn,{label:s.jsx(lp,{badgeContent:me==null?void 0:me.foreignKeys.length,color:"primary",children:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:.5,pr:1},children:[s.jsx(ll,{fontSize:"small"}),"Foreign Keys"]})}),sx:{minHeight:40,textTransform:"none"}}),s.jsx(Bn,{label:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:.5},children:[s.jsx(Fc,{fontSize:"small"}),"SQL"]}),sx:{minHeight:40,textTransform:"none"}})]})}),s.jsxs(K,{sx:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:[B===0&&s.jsx(zre,{result:M,error:E,loading:kt.isPending,confirmDangerous:G,onConfirm:er,onCancel:()=>_(null),totalRowCount:A,paginationModel:F,onPaginationChange:rt,onSearch:It,searchQuery:D,tableSchema:me,onUpdateRow:nr,onDeleteRow:io,onSyncRow:se=>{he(se),ie(!0)},connectionHost:oe==null?void 0:oe.host,connectionDatabase:oe==null?void 0:oe.database,tableName:j==null?void 0:j.name}),B===1&&(j?s.jsx(Lre,{schema:me,loading:Ne}):s.jsxs(K,{sx:{p:4,textAlign:"center",color:"text.secondary"},children:[s.jsx(xo,{sx:{fontSize:48,opacity:.3,mb:1}}),s.jsx(J,{variant:"body2",children:"Select a table to view its structure"})]})),B===2&&(j?s.jsx(Dre,{schema:me,loading:Ne}):s.jsxs(K,{sx:{p:4,textAlign:"center",color:"text.secondary"},children:[s.jsx(ri,{sx:{fontSize:48,opacity:.3,mb:1}}),s.jsx(J,{variant:"body2",children:"Select a table to view its indexes"})]})),B===3&&(j?s.jsx(Are,{schema:me,loading:Ne}):s.jsxs(K,{sx:{p:4,textAlign:"center",color:"text.secondary"},children:[s.jsx(ll,{sx:{fontSize:48,opacity:.3,mb:1}}),s.jsx(J,{variant:"body2",children:"Select a table to view its foreign keys"})]})),B===4&&s.jsx(Fre,{sql:T,onSqlChange:$,onExecute:un,onSave:()=>Se(!0),onKeyDown:yt,loading:kt.isPending})]})]}):s.jsx(Kre,{connectionSelected:!!y})})]}),s.jsx(tC,{anchor:"right",open:Q,onClose:()=>ee(!1),PaperProps:{sx:{width:420,bgcolor:"background.default"}},children:s.jsx(Nre,{history:xt,connections:et,onSelect:se=>{$(se.sql),se.connectionId&&se.connectionId!==y&&Ae(se.connectionId),qe(4),ee(!1)},onRerun:se=>{$(se.sql),se.connectionId&&se.connectionId!==y&&Ae(se.connectionId),qe(0),ee(!1),setTimeout(()=>{kt.mutate({query:se.sql})},100)},onClear:()=>pn.mutate(),onClose:()=>ee(!1),onRefresh:()=>Bt(),clearing:pn.isPending})}),s.jsx(_E,{open:!!Fe,onClose:()=>Ve(null),onConfirm:Zr,title:"Delete Row",message:s.jsxs(K,{children:[s.jsxs(J,{gutterBottom:!0,children:["Are you sure you want to delete this row from"," ",s.jsx("strong",{children:j==null?void 0:j.name}),"?"]}),Fe&&me&&s.jsx(K,{sx:{mt:1,p:1.5,bgcolor:"action.hover",borderRadius:1,fontFamily:"monospace",fontSize:12,maxHeight:150,overflow:"auto"},children:me.columns.filter(se=>se.isPrimaryKey).map(se=>s.jsxs(K,{children:[s.jsxs("strong",{children:[se.name,":"]})," ",String(Fe[se.name])]},se.name))})]}),confirmText:"Delete Row",confirmColor:"error",loading:kt.isPending}),s.jsx(Gre,{open:ne,onClose:()=>re(!1),onSubmit:kr,columns:(me==null?void 0:me.columns)||[],tableName:(j==null?void 0:j.name)||""}),s.jsx(Ure,{open:Y,onClose:()=>{ie(!1),he([])},rows:ce,sourceConnectionId:y,sourceConnection:oe,schema:(j==null?void 0:j.schema)||v||"",table:(j==null?void 0:j.name)||"",primaryKeys:(me==null?void 0:me.columns.filter(se=>se.isPrimaryKey).map(se=>se.name))||[],connections:et}),s.jsx(tC,{anchor:"right",open:de,onClose:()=>le(!1),PaperProps:{sx:{width:420,bgcolor:"background.default"}},children:s.jsx(_re,{queries:yn,connections:et,onSelect:se=>{$(se.sql),se.connectionId&&se.connectionId!==y&&Ae(se.connectionId),qe(4),le(!1)},onRun:se=>{$(se.sql),se.connectionId&&se.connectionId!==y&&Ae(se.connectionId),qe(0),le(!1),setTimeout(()=>{kt.mutate({query:se.sql})},100)},onEdit:se=>{we(se),Se(!0)},onDelete:se=>{be(se)},onClose:()=>le(!1),onRefresh:()=>hn()})}),s.jsx(qre,{open:ge,onClose:()=>{Se(!1),we(null)},onSave:se=>ln.mutate(se),sql:(ke==null?void 0:ke.sql)||T,connectionId:y,connections:et,editingQuery:ke}),s.jsx(_E,{open:!!Oe,onClose:()=>be(null),onConfirm:()=>{Oe&&(An.mutate(Oe.id),be(null))},title:"Delete Saved Query",message:s.jsxs(K,{children:[s.jsxs(J,{gutterBottom:!0,children:["Are you sure you want to delete the saved query"," ",s.jsxs("strong",{children:["“",Oe==null?void 0:Oe.name,"”"]}),"?"]}),s.jsx(J,{variant:"body2",color:"text.secondary",children:"This action cannot be undone."})]}),confirmText:"Delete",confirmColor:"error",loading:An.isPending})]})}function Qre(){const{connectionId:e}=Sx(),[t,n]=m.useState("public"),[r,o]=m.useState(null),[i,l]=m.useState(0),{data:c}=Ft({queryKey:["connection",e],queryFn:()=>Qr.getById(e),enabled:!!e}),{data:u=[]}=Ft({queryKey:["schemas",e],queryFn:()=>xn.getSchemas(e),enabled:!!e}),{data:f=[],isLoading:h}=Ft({queryKey:["tables",e,t],queryFn:()=>xn.getTables(e,t),enabled:!!e}),{data:p,isLoading:g}=Ft({queryKey:["tableSchema",e,t,r],queryFn:()=>xn.getTableSchema(e,t,r),enabled:!!e&&!!r});return e?s.jsxs(K,{sx:{display:"flex",height:"100%"},children:[s.jsxs(Un,{sx:{width:280,borderRadius:0,borderRight:1,borderColor:"divider",display:"flex",flexDirection:"column"},children:[s.jsxs(K,{sx:{p:2,borderBottom:1,borderColor:"divider"},children:[s.jsx(J,{variant:"subtitle1",fontWeight:600,children:c==null?void 0:c.name}),s.jsx(J,{variant:"caption",color:"text.secondary",children:c==null?void 0:c.database})]}),s.jsx(yl,{value:u.indexOf(t),onChange:(y,b)=>n(u[b]??"public"),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:1,borderColor:"divider",minHeight:40},children:u.map(y=>s.jsx(Bn,{label:y,sx:{minHeight:40,py:0}},y))}),s.jsx(K,{sx:{flex:1,overflow:"auto"},children:h?s.jsx(K,{sx:{display:"flex",justifyContent:"center",py:4},children:s.jsx(At,{size:24})}):s.jsx(_u,{dense:!0,sx:{py:1},children:f.map(y=>s.jsxs(tl,{selected:r===y.name,onClick:()=>o(y.name),children:[s.jsx(Rn,{sx:{minWidth:36},children:y.type==="view"?s.jsx(Nw,{fontSize:"small"}):s.jsx(xo,{fontSize:"small"})}),s.jsx($n,{primary:y.name,secondary:y.rowCount!==void 0?`~${y.rowCount} rows`:void 0,primaryTypographyProps:{variant:"body2"},secondaryTypographyProps:{variant:"caption"}})]},`${y.schema}.${y.name}`))})})]}),s.jsx(K,{sx:{flex:1,overflow:"auto",p:3},children:r&&p?s.jsxs(K,{children:[s.jsxs(J,{variant:"h5",fontWeight:600,gutterBottom:!0,children:[t,".",r]}),s.jsxs(yl,{value:i,onChange:(y,b)=>l(b),sx:{mb:3,borderBottom:1,borderColor:"divider"},children:[s.jsx(Bn,{label:"Columns"}),s.jsx(Bn,{label:"Indexes"}),s.jsx(Bn,{label:"Foreign Keys"})]}),i===0&&s.jsx(Sa,{component:Un,variant:"outlined",children:s.jsxs(Ca,{size:"small",children:[s.jsx(ja,{children:s.jsxs(Ur,{children:[s.jsx(lt,{children:"Name"}),s.jsx(lt,{children:"Type"}),s.jsx(lt,{children:"Nullable"}),s.jsx(lt,{children:"Default"}),s.jsx(lt,{children:"Constraints"})]})}),s.jsx(wa,{children:p.columns.map(y=>s.jsxs(Ur,{children:[s.jsx(lt,{children:s.jsx(J,{variant:"body2",fontFamily:"monospace",fontWeight:500,children:y.name})}),s.jsx(lt,{children:s.jsx(J,{variant:"body2",fontFamily:"monospace",color:"text.secondary",children:y.dataType})}),s.jsx(lt,{children:s.jsx(Ge,{label:y.nullable?"NULL":"NOT NULL",size:"small",color:y.nullable?"default":"primary",variant:"outlined"})}),s.jsx(lt,{children:s.jsx(J,{variant:"body2",fontFamily:"monospace",color:"text.secondary",children:y.defaultValue??"-"})}),s.jsx(lt,{children:s.jsxs(K,{sx:{display:"flex",gap:.5},children:[y.isPrimaryKey&&s.jsx(Ge,{icon:s.jsx(ri,{}),label:"PK",size:"small",color:"warning"}),y.isUnique&&!y.isPrimaryKey&&s.jsx(Ge,{label:"UNIQUE",size:"small",variant:"outlined"})]})})]},y.name))})]})}),i===1&&s.jsx(Sa,{component:Un,variant:"outlined",children:s.jsxs(Ca,{size:"small",children:[s.jsx(ja,{children:s.jsxs(Ur,{children:[s.jsx(lt,{children:"Name"}),s.jsx(lt,{children:"Columns"}),s.jsx(lt,{children:"Type"}),s.jsx(lt,{children:"Properties"})]})}),s.jsx(wa,{children:p.indexes.map(y=>s.jsxs(Ur,{children:[s.jsx(lt,{children:s.jsx(J,{variant:"body2",fontFamily:"monospace",children:y.name})}),s.jsx(lt,{children:s.jsx(J,{variant:"body2",fontFamily:"monospace",color:"text.secondary",children:y.columns.join(", ")})}),s.jsx(lt,{children:s.jsx(J,{variant:"body2",color:"text.secondary",children:y.type})}),s.jsx(lt,{children:s.jsxs(K,{sx:{display:"flex",gap:.5},children:[y.isPrimary&&s.jsx(Ge,{label:"PRIMARY",size:"small",color:"warning"}),y.isUnique&&!y.isPrimary&&s.jsx(Ge,{label:"UNIQUE",size:"small",variant:"outlined"})]})})]},y.name))})]})}),i===2&&s.jsx(Sa,{component:Un,variant:"outlined",children:s.jsxs(Ca,{size:"small",children:[s.jsx(ja,{children:s.jsxs(Ur,{children:[s.jsx(lt,{children:"Name"}),s.jsx(lt,{children:"Columns"}),s.jsx(lt,{children:"References"}),s.jsx(lt,{children:"On Delete"}),s.jsx(lt,{children:"On Update"})]})}),s.jsx(wa,{children:p.foreignKeys.length===0?s.jsx(Ur,{children:s.jsx(lt,{colSpan:5,sx:{textAlign:"center",color:"text.secondary"},children:"No foreign keys"})}):p.foreignKeys.map(y=>s.jsxs(Ur,{children:[s.jsx(lt,{children:s.jsx(J,{variant:"body2",fontFamily:"monospace",children:y.name})}),s.jsx(lt,{children:s.jsx(J,{variant:"body2",fontFamily:"monospace",color:"text.secondary",children:y.columns.join(", ")})}),s.jsx(lt,{children:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:.5},children:[s.jsx(ll,{fontSize:"small",color:"primary"}),s.jsxs(J,{variant:"body2",fontFamily:"monospace",children:[y.referencedSchema,".",y.referencedTable,"(",y.referencedColumns.join(", "),")"]})]})}),s.jsx(lt,{children:s.jsx(J,{variant:"body2",color:"text.secondary",children:y.onDelete})}),s.jsx(lt,{children:s.jsx(J,{variant:"body2",color:"text.secondary",children:y.onUpdate})})]},y.name))})]})})]}):g?s.jsx(K,{sx:{display:"flex",justifyContent:"center",py:8},children:s.jsx(At,{})}):s.jsx(K,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"text.secondary"},children:s.jsxs(K,{sx:{textAlign:"center"},children:[s.jsx(xo,{sx:{fontSize:64,opacity:.3,mb:2}}),s.jsx(J,{variant:"body1",children:"Select a table to view its schema"})]})})})]}):s.jsx(K,{sx:{p:4,textAlign:"center",color:"text.secondary"},children:"No connection selected"})}function BE({status:e}){switch(e){case"in_sync":return s.jsx(Il,{sx:{color:"#22c55e"}});case"out_of_sync":return s.jsx(Os,{sx:{color:"#f59e0b"}});case"error":return s.jsx(Na,{sx:{color:"#ef4444"}});default:return s.jsx(Qx,{sx:{color:"text.disabled"}})}}function WE({status:e}){const t={in_sync:{label:"In Sync",color:"#22c55e",bg:"rgba(34, 197, 94, 0.1)"},out_of_sync:{label:"Out of Sync",color:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},error:{label:"Error",color:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},unchecked:{label:"Not Checked",color:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"}}[e];return s.jsx(Ge,{label:t.label,size:"small",sx:{bgcolor:t.bg,color:t.color,border:`1px solid ${t.color}`,fontWeight:500}})}function Yre(e){return e.includes("added")?"added":e.includes("removed")?"removed":"modified"}function VE({type:e}){const t=Yre(e),n={added:{icon:s.jsx(Gn,{sx:{fontSize:14}}),color:"#22c55e",label:"Added"},removed:{icon:s.jsx(cp,{sx:{fontSize:14}}),color:"#ef4444",label:"Removed"},modified:{icon:s.jsx(Dr,{sx:{fontSize:14}}),color:"#f59e0b",label:"Modified"}}[t];return s.jsx(Ge,{icon:n.icon,label:n.label,size:"small",sx:{bgcolor:`${n.color}20`,color:n.color,border:`1px solid ${n.color}`,height:22,"& .MuiChip-icon":{color:n.color}}})}function Xre({diff:e,migrationSql:t,onApplyMigration:n,applying:r}){const[o,i]=m.useState(!1),l=t.join(`
|
|
354
|
+
|
|
355
|
+
`),c=()=>{navigator.clipboard.writeText(l),i(!0),setTimeout(()=>i(!1),2e3)},u=m.useMemo(()=>{var y;const g={};for(const b of e.items){const v=b.table||"Other";g[v]??(g[v]=[]),(y=g[v])==null||y.push(b)}return g},[e.items]),f=e.summary.tablesAdded+e.summary.columnsAdded+e.summary.indexesAdded+e.summary.fksAdded,h=e.summary.tablesRemoved+e.summary.columnsRemoved+e.summary.indexesRemoved+e.summary.fksRemoved,p=e.summary.columnsModified+e.summary.indexesModified+e.summary.fksModified;return e.items.length===0?s.jsx(Nt,{severity:"success",children:"Schemas are in sync! No differences found."}):s.jsxs(K,{sx:{mt:2},children:[s.jsxs(K,{sx:{display:"flex",gap:2,mb:2},children:[s.jsx(Ge,{label:`${f} added`,size:"small",sx:{bgcolor:"rgba(34, 197, 94, 0.1)",color:"#22c55e"}}),s.jsx(Ge,{label:`${h} removed`,size:"small",sx:{bgcolor:"rgba(239, 68, 68, 0.1)",color:"#ef4444"}}),s.jsx(Ge,{label:`${p} modified`,size:"small",sx:{bgcolor:"rgba(245, 158, 11, 0.1)",color:"#f59e0b"}})]}),Object.entries(u).map(([g,y])=>s.jsxs(GM,{defaultExpanded:!0,sx:{mb:1,"&:before":{display:"none"}},children:[s.jsxs(qM,{expandIcon:s.jsx(bl,{}),sx:{px:1,minHeight:40,"&.Mui-expanded":{minHeight:40},"& .MuiAccordionSummary-content":{my:.5},"& .MuiAccordionSummary-content.Mui-expanded":{my:.5}},children:[s.jsx(J,{fontWeight:500,children:g}),s.jsx(K,{sx:{ml:2,display:"flex",gap:.5},children:y.map(b=>s.jsx(VE,{type:b.type},`${b.type}-${b.name}`))})]}),s.jsx(UM,{sx:{px:1,py:.5},children:y.map(b=>s.jsxs(K,{sx:{p:1,mb:.5,bgcolor:"background.default",border:"1px solid",borderColor:"divider"},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[s.jsx(VE,{type:b.type}),s.jsxs(J,{variant:"body2",fontWeight:500,children:[b.type.replaceAll("_"," "),": ",b.name||b.table]})]}),b.migrationSql&&b.migrationSql.length>0&&s.jsx(J,{variant:"caption",color:"text.secondary",component:"pre",sx:{whiteSpace:"pre-wrap",fontFamily:"monospace",m:0},children:b.migrationSql.join(`
|
|
356
|
+
`)})]},`${b.type}-${b.name}-${b.table}`))})]},g)),t.length>0&&s.jsxs(K,{sx:{mt:3},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1},children:[s.jsx(J,{variant:"subtitle2",children:"Migration SQL"}),s.jsxs(K,{sx:{display:"flex",gap:1},children:[s.jsx(Le,{size:"small",startIcon:o?s.jsx(vl,{}):s.jsx(Oa,{}),onClick:c,children:o?"Copied!":"Copy"}),s.jsx(Le,{size:"small",variant:"contained",color:"warning",startIcon:r?s.jsx(At,{size:16}):s.jsx(fs,{}),onClick:n,disabled:r,children:"Apply Migration"})]})]}),s.jsx(Un,{sx:{p:2,bgcolor:"background.default",maxHeight:300,overflow:"auto"},children:s.jsx(J,{component:"pre",sx:{fontFamily:"monospace",fontSize:12,whiteSpace:"pre-wrap",m:0},children:l})})]})]})}function jO({sourceConnectionId:e,targetConnectionId:t,sourceSchema:n,targetSchema:r,sourceConnectionName:o="Source",targetConnectionName:i="Target",dataDiff:l,onSyncComplete:c,compact:u=!1,queryKeyPrefix:f="tableDiffs"}){const h=Tr(),p=oo(),[g,y]=m.useState([]),[b,v]=m.useState({insertMissing:!0,updateDifferent:!0,deleteExtra:!1}),[C,S]=m.useState(!1),[j,w]=m.useState(!1),[k,P]=m.useState([]),[T,$]=m.useState(null),M=!l&&!!e&&!!t&&!!n,R=600*1e3,{data:E=[],isLoading:O,isFetching:A,refetch:N}=Ft({queryKey:[f,e,t,n],queryFn:()=>ai.getTableRowCounts(e,t,n),enabled:M,staleTime:R,gcTime:R}),F=l??E,L=m.useMemo(()=>F.filter(Q=>Q.sourceCount!==Q.targetCount||Q.missingInTarget>0||Q.missingInSource>0),[F]),D=m.useMemo(()=>F.filter(Q=>Q.sourceCount===Q.targetCount&&Q.missingInTarget===0&&Q.missingInSource===0),[F]),H=()=>{P([]),M&&(h.invalidateQueries({queryKey:[f,e,t]}),N()),c==null||c()},B=async()=>{S(!0),P([]);const Q=g.length>0?g:L.map(Y=>Y.table),ee=[];for(const Y of Q)try{const ie=await ai.syncTableData(e,t,n,Y,{primaryKeys:["id"],...b});ee.push(ie),P([...ee])}catch(ie){const ce={table:Y,inserted:0,updated:0,deleted:0,errors:[ie instanceof Error?ie.message:String(ie)]};ee.push(ce),P([...ee])}S(!1);const ne=ee.filter(Y=>Y.errors.length===0).length,re=ee.filter(Y=>Y.errors.length>0).length;re===0?(p.success(`Successfully synced ${ne} table(s)`),H()):ne>0?p.warning(`Synced ${ne} table(s), ${re} failed. See details below.`):p.error(`Failed to sync ${re} table(s). See details below.`)},V=async Q=>{S(!0);try{const ee=await ai.syncTableData(e,t,n,Q,{primaryKeys:["id"],insertMissing:!0,updateDifferent:!0,deleteExtra:!1});P(ne=>[...ne.filter(re=>re.table!==Q),ee]),ee.errors&&ee.errors.length>0?p.error(`Table "${Q}" sync had errors: ${ee.errors[0]}`):p.success(`Table "${Q}" synced: +${ee.inserted} ~${ee.updated}`),c==null||c()}catch(ee){const ne=ee instanceof Error?ee.message:String(ee);p.error(`Failed to sync "${Q}": ${ne}`),P(re=>[...re.filter(Y=>Y.table!==Q),{table:Q,inserted:0,updated:0,deleted:0,errors:[ne]}])}finally{S(!1)}},G=async()=>{w(!0),$(null),P([]);try{const Q=await ai.dumpAndRestore(e,t,n,{truncateTarget:!0});$(Q),Q.success?p.success(`Copied ${Q.rowsCopied} rows across ${Q.tablesProcessed} tables`):p.warning(`Completed with ${Q.errors.length} error(s)`),H()}catch(Q){p.error(`Dump & Restore failed: ${Q instanceof Error?Q.message:String(Q)}`)}finally{w(!1)}},_=()=>{$(null)},U=()=>{P([])},Z=[{field:"table",headerName:"Table",flex:1,minWidth:150,renderCell:Q=>s.jsx(J,{variant:"body2",fontFamily:"monospace",children:Q.value})},{field:"sourceCount",headerName:u?"Source":`Source (${o})`,width:u?100:150,align:"right",headerAlign:"right"},{field:"targetCount",headerName:u?"Target":`Target (${i})`,width:u?100:150,align:"right",headerAlign:"right"},{field:"missingInTarget",headerName:"Missing",width:100,align:"right",headerAlign:"right",renderCell:Q=>Q.value>0?s.jsx(Ge,{label:Q.value,size:"small",color:"warning"}):"-"},{field:"missingInSource",headerName:"Extra",width:100,align:"right",headerAlign:"right",renderCell:Q=>Q.value>0?s.jsx(Ge,{label:Q.value,size:"small",color:"info"}):"-"},...u?[{field:"actions",headerName:"Actions",width:120,sortable:!1,renderCell:Q=>{const ee=Q.row,ne=ee.sourceCount!==ee.targetCount||ee.missingInTarget>0,re=k.find(Y=>Y.table===ee.table);return re?s.jsxs(J,{variant:"caption",color:re.errors.length>0?"error":"success.main",children:["+",re.inserted," ~",re.updated]}):ne?s.jsx(Le,{size:"small",variant:"outlined",onClick:Y=>{Y.stopPropagation(),V(ee.table)},disabled:C,children:"Sync"}):s.jsx(Ge,{label:"In sync",size:"small",color:"success",variant:"outlined"})}}]:[{field:"difference",headerName:"Status",width:120,align:"center",headerAlign:"center",valueGetter:(Q,ee)=>ee.sourceCount-ee.targetCount,renderCell:Q=>{const ee=Q.value;return ee===0?s.jsx(Ge,{icon:s.jsx(vl,{}),label:"In Sync",size:"small",color:"success",variant:"outlined",sx:{height:24}}):s.jsxs(J,{variant:"body2",fontWeight:500,color:ee>0?"warning.main":"error.main",children:[ee>0?"+":"",ee]})}}]];if(O&&M)return s.jsx(wl,{message:"Comparing data...",size:"medium"});if(!u&&T)return s.jsxs(K,{children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[s.jsx(J,{variant:"subtitle1",fontWeight:500,children:"Dump & Restore Results"}),s.jsxs(K,{sx:{display:"flex",gap:1},children:[s.jsx(Ge,{label:`${T.tablesProcessed} tables`,size:"small",color:"primary",variant:"outlined"}),s.jsx(Ge,{label:`${T.rowsCopied} rows copied`,size:"small",color:"success",variant:"outlined"}),T.errors.length>0&&s.jsx(Ge,{label:`${T.errors.length} errors`,size:"small",color:"error",variant:"outlined"})]})]}),s.jsx(Nt,{severity:T.success?"success":"warning",sx:{mb:2},children:T.success?"Successfully copied all data from source to target.":"Completed with some errors. Check the details below."}),T.tableResults.map(Q=>s.jsxs(K,{sx:{p:1.5,mb:.5,bgcolor:Q.error?"error.dark":"background.paper",borderRadius:1,border:1,borderColor:Q.error?"error.main":"divider",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s.jsx(J,{variant:"body2",fontFamily:"monospace",children:Q.table}),s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(Ge,{label:`${Q.rows} rows`,size:"small",color:Q.rows>0?"success":"default",variant:"outlined"}),Q.error&&s.jsx(J,{variant:"caption",color:"error",children:Q.error})]})]},Q.table)),T.errors.length>0&&s.jsxs(Nt,{severity:"error",sx:{mt:2},children:[s.jsx(J,{variant:"subtitle2",gutterBottom:!0,children:"Errors:"}),T.errors.map((Q,ee)=>s.jsxs(J,{variant:"body2",children:["• ",Q]},ee))]}),s.jsxs(K,{sx:{mt:2,display:"flex",gap:1},children:[s.jsx(Le,{variant:"outlined",onClick:_,children:"Back to Comparison"}),s.jsx(Le,{variant:"contained",startIcon:s.jsx(Eo,{}),onClick:H,children:"Refresh Data"})]})]});if(!u&&k.length>0){const Q=k.filter(Y=>Y.errors.length===0).length,ee=k.filter(Y=>Y.errors.length>0).length,ne=k.filter(Y=>Y.errors.length>0),re=k.filter(Y=>Y.errors.length===0);return s.jsxs(K,{children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[s.jsx(J,{variant:"subtitle1",fontWeight:500,children:"Sync Results"}),s.jsxs(K,{sx:{display:"flex",gap:1},children:[s.jsx(Ge,{label:`${Q} succeeded`,size:"small",color:"success",variant:"outlined"}),ee>0&&s.jsx(Ge,{label:`${ee} failed`,size:"small",color:"error",variant:"outlined"})]})]}),ne.length>0&&s.jsxs(Nt,{severity:"error",sx:{mb:2},children:[s.jsxs(J,{variant:"subtitle2",gutterBottom:!0,children:[ne.length," table(s) failed to sync:"]}),ne.map(Y=>s.jsxs(K,{sx:{mb:1.5},children:[s.jsx(J,{variant:"body2",fontWeight:600,fontFamily:"monospace",children:Y.table}),Y.errors.map((ie,ce)=>s.jsxs(J,{variant:"body2",sx:{pl:2,wordBreak:"break-word",whiteSpace:"pre-wrap"},children:["• ",ie]},ce))]},Y.table))]}),re.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(J,{variant:"subtitle2",sx:{mb:1},children:"Successfully synced:"}),re.map(Y=>s.jsxs(K,{sx:{p:1.5,mb:.5,bgcolor:"success.dark",borderRadius:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s.jsx(J,{variant:"body2",fontFamily:"monospace",children:Y.table}),s.jsxs(K,{sx:{display:"flex",gap:1},children:[Y.inserted>0&&s.jsx(Ge,{label:`+${Y.inserted}`,size:"small",color:"success"}),Y.updated>0&&s.jsx(Ge,{label:`~${Y.updated}`,size:"small",color:"info"}),Y.deleted>0&&s.jsx(Ge,{label:`-${Y.deleted}`,size:"small",color:"warning"}),Y.inserted===0&&Y.updated===0&&Y.deleted===0&&s.jsx(Ge,{label:"No changes",size:"small",variant:"outlined"})]})]},Y.table))]}),s.jsxs(K,{sx:{mt:2,display:"flex",gap:1},children:[s.jsx(Le,{variant:"outlined",onClick:U,children:"Back to Comparison"}),s.jsx(Le,{variant:"contained",startIcon:s.jsx(Eo,{}),onClick:H,children:"Refresh Data"})]})]})}return F.length>0&&L.length===0?s.jsxs(K,{children:[s.jsxs(Nt,{severity:"success",icon:s.jsx(vl,{}),sx:{mb:2},children:["All ",D.length," tables are in sync between source and target."]}),M&&s.jsx(Le,{variant:"outlined",startIcon:A?s.jsx(At,{size:16}):s.jsx(Eo,{}),onClick:H,disabled:A,children:"Refresh"})]}):F.length===0?s.jsxs(K,{children:[s.jsx(Nt,{severity:"info",sx:{mb:2},children:"No tables found in the selected schema, or unable to compare data."}),M&&s.jsx(Le,{variant:"outlined",startIcon:A?s.jsx(At,{size:16}):s.jsx(Eo,{}),onClick:H,disabled:A,children:"Refresh"})]}):s.jsxs(K,{children:[s.jsxs(K,{sx:{display:"flex",gap:1,mb:2,flexWrap:"wrap",alignItems:"center"},children:[s.jsx(Ge,{label:`${L.length} out of sync`,size:"small",color:"warning"}),s.jsx(Ge,{label:`${D.length} in sync`,size:"small",color:"success",variant:"outlined"}),s.jsx(K,{sx:{flex:1}}),M&&s.jsx(Le,{size:"small",startIcon:A?s.jsx(At,{size:14}):s.jsx(Eo,{}),onClick:H,disabled:A,children:"Refresh"})]}),!u&&s.jsxs(J,{variant:"subtitle2",sx:{mb:1},children:["Tables with differences (",L.length,")"]}),s.jsx(fi,{rows:u?F:L,columns:Z,getRowId:Q=>Q.table,checkboxSelection:!u,disableRowSelectionOnClick:u,rowSelectionModel:g,onRowSelectionModelChange:y,pageSizeOptions:[10,25,50],initialState:{pagination:{paginationModel:{pageSize:10}}},sx:{mb:u?0:3,height:u?300:400,border:"none","& .MuiDataGrid-cell":{borderColor:"divider",display:"flex",alignItems:"center"},"& .MuiDataGrid-columnHeaders":{bgcolor:"background.default",borderColor:"divider"}}}),!u&&s.jsxs(s.Fragment,{children:[s.jsx(J,{variant:"subtitle2",sx:{mb:1},children:"Sync Options"}),s.jsxs(K,{sx:{display:"flex",flexDirection:"column",gap:1,mb:3},children:[s.jsx(Kr,{control:s.jsx($s,{checked:b.insertMissing,onChange:Q=>v({...b,insertMissing:Q.target.checked})}),label:"Insert missing rows (rows in source but not in target)"}),s.jsx(Kr,{control:s.jsx($s,{checked:b.updateDifferent,onChange:Q=>v({...b,updateDifferent:Q.target.checked})}),label:"Update different rows (rows that exist in both but have different values)"}),s.jsx(Kr,{control:s.jsx($s,{checked:b.deleteExtra,onChange:Q=>v({...b,deleteExtra:Q.target.checked})}),label:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:["Delete extra rows in target (rows in target but not in source)",s.jsx(Ge,{label:"Destructive",size:"small",color:"error"})]})})]}),s.jsxs(K,{sx:{display:"flex",gap:2,flexWrap:"wrap",alignItems:"center"},children:[s.jsx(Le,{variant:"contained",color:"warning",onClick:B,disabled:C||j||L.length===0,startIcon:C?s.jsx(At,{size:16,color:"inherit"}):s.jsx(fs,{}),children:C?"Syncing...":`Sync ${g.length||L.length} Table(s)`}),s.jsx(J,{variant:"body2",color:"text.secondary",children:"or"}),s.jsx(Le,{variant:"contained",color:"primary",onClick:G,disabled:C||j||F.length===0,startIcon:j?s.jsx(At,{size:16,color:"inherit"}):s.jsx(Oa,{}),children:j?"Copying...":"Dump & Restore All"}),s.jsx(Ge,{label:"Handles FK constraints",size:"small",color:"info",variant:"outlined"})]}),s.jsxs(Nt,{severity:"info",sx:{mt:2},children:[s.jsxs(J,{variant:"body2",children:[s.jsx("strong",{children:"Sync Tables:"})," Incrementally sync selected tables (may fail with FK constraints)."]}),s.jsxs(J,{variant:"body2",children:[s.jsx("strong",{children:"Dump & Restore:"})," Truncates target and copies all data in dependency order (handles FK constraints properly)."]})]}),(C||j)&&s.jsx(kl,{sx:{mt:2}})]})]})}function Zre({target:e,group:t,sourceConnectionId:n,sourceSchema:r,targetSchema:o}){const[i,l]=m.useState(!1),[c,u]=m.useState(0),[f,h]=m.useState(!1),[p,g]=m.useState(e),y=Tr(),b=oo();m.useEffect(()=>{g(e)},[e]);const v=p.schemaDiff,C=p.migrationSql||[],S=p.dataDiff||[],j=vr({mutationFn:async()=>{const T=await ai.checkSingleTargetStatus(t.id,e.connectionId);if(!T)throw new Error("Failed to check target status");return T},onSuccess:T=>{g(T),y.invalidateQueries({queryKey:["groupSyncStatus",t.id]}),b.success("Status updated")},onError:T=>{console.error("Failed to recheck status:",T),b.error("Failed to recheck status")}}),w=async()=>{h(!0);try{await xn.applyMigration(n,e.connectionId,r,o,"Applied from Instance Group Sync"),j.mutate(),b.success("Migration applied successfully"),l(!1)}catch(T){console.error("Failed to apply migration:",T),b.error("Failed to apply migration")}finally{h(!1)}},k=()=>{j.mutate()},P=T=>{T.stopPropagation(),j.mutate(),i||l(!0)};return s.jsxs(s.Fragment,{children:[s.jsxs(Ur,{sx:{cursor:"pointer","&:hover":{bgcolor:"action.hover"}},onClick:()=>l(!i),children:[s.jsx(lt,{children:s.jsx(mt,{size:"small",children:i?s.jsx(Ac,{}):s.jsx(bl,{})})}),s.jsx(lt,{children:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(Cr,{sx:{color:"primary.main"}}),s.jsx(J,{fontWeight:500,children:e.connectionName})]})}),s.jsx(lt,{children:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(BE,{status:p.schemaStatus}),s.jsx(WE,{status:p.schemaStatus}),p.schemaDiffCount!==void 0&&p.schemaDiffCount>0&&s.jsxs(J,{variant:"caption",color:"text.secondary",children:["(",p.schemaDiffCount," differences)"]})]})}),s.jsx(lt,{children:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(BE,{status:p.dataStatus}),s.jsx(WE,{status:p.dataStatus}),p.dataDiffSummary&&s.jsx(J,{variant:"caption",color:"text.secondary",children:p.dataDiffSummary})]})}),s.jsx(lt,{children:s.jsx(K,{sx:{display:"flex",gap:1},children:s.jsx(Le,{size:"small",variant:"outlined",startIcon:j.isPending?s.jsx(At,{size:16}):s.jsx(Eo,{}),onClick:P,disabled:j.isPending,children:j.isPending?"Checking...":"Recheck"})})})]}),s.jsx(Ur,{children:s.jsx(lt,{colSpan:5,sx:{py:0,borderBottom:i?void 0:"none"},children:s.jsx(Di,{in:i,children:s.jsxs(K,{sx:{py:1},children:[p.error&&s.jsx(Nt,{severity:"error",sx:{mb:1},children:p.error}),s.jsxs(yl,{value:c,onChange:(T,$)=>u($),sx:{borderBottom:1,borderColor:"divider",minHeight:48},children:[s.jsx(Bn,{icon:s.jsx(PR,{fontSize:"small"}),iconPosition:"start",label:`Schema ${p.schemaDiffCount?`(${p.schemaDiffCount})`:""}`,sx:{minHeight:48},disabled:!t.syncSchema}),s.jsx(Bn,{icon:s.jsx(xo,{fontSize:"small"}),iconPosition:"start",label:`Data ${S.length>0?`(${S.filter(T=>T.sourceCount!==T.targetCount||T.missingInTarget>0).length} tables)`:""}`,sx:{minHeight:48},disabled:!t.syncData})]}),c===0&&t.syncSchema&&s.jsx(K,{sx:{pt:1},children:v?s.jsx(Xre,{diff:v,migrationSql:C,onApplyMigration:w,applying:f}):p.schemaStatus==="in_sync"?s.jsx(Nt,{severity:"success",children:"Schema is in sync"}):s.jsx(Nt,{severity:"info",children:'Click "Recheck" to load schema diff'})}),c===1&&t.syncData&&s.jsx(K,{sx:{py:1},children:S.length>0?s.jsx(jO,{sourceConnectionId:n,targetConnectionId:p.connectionId,sourceSchema:r,targetSchema:o,dataDiff:S,onSyncComplete:k}):p.dataStatus==="in_sync"?s.jsx(Nt,{severity:"success",sx:{mt:1},children:"All tables are in sync"}):s.jsx(Nt,{severity:"info",sx:{mt:1},children:'Click "Recheck" to load data diff'})})]})})})})]})}function Jre({open:e,onClose:t,group:n,connections:r}){const o=Tr(),[i,l]=m.useState(n.sourceConnectionId||""),[c,u]=m.useState(n.syncSchema),[f,h]=m.useState(n.syncData),[p,g]=m.useState(n.syncTargetSchema||""),[y,b]=m.useState([]),[v,C]=m.useState(!1);m.useEffect(()=>{i?(C(!0),xn.getSchemas(i).then(b).catch(()=>b([])).finally(()=>C(!1))):b([])},[i]);const S=vr({mutationFn:()=>pi.updateGroup(n.projectId,n.id,{sourceConnectionId:i||null,syncSchema:c,syncData:f,syncTargetSchema:p||null}),onSuccess:()=>{o.invalidateQueries({queryKey:["group",n.id]}),o.invalidateQueries({queryKey:["groupSyncStatus",n.id]}),t()}}),j=r.find(P=>P.id===i),k=(P=>P?P.engine==="mysql"||P.engine==="mariadb"?P.database:P.defaultSchema||"public":"public")(j);return s.jsxs(gn,{open:e,onClose:t,maxWidth:"sm",fullWidth:!0,children:[s.jsx(wn,{children:"Instance Group Settings"}),s.jsx(Cn,{children:s.jsxs(K,{sx:{display:"flex",flexDirection:"column",gap:3,mt:1},children:[s.jsxs(_n,{fullWidth:!0,children:[s.jsx(Hn,{children:"Source Connection (Reference)"}),s.jsxs(On,{value:i,onChange:P=>{l(P.target.value),g("")},label:"Source Connection (Reference)",children:[s.jsx(it,{value:"",children:s.jsx("em",{children:"None"})}),r.map(P=>s.jsxs(it,{value:P.id,children:[P.name,P.defaultSchema&&s.jsxs(J,{component:"span",variant:"caption",sx:{ml:1,color:"text.secondary"},children:["(",P.defaultSchema,")"]})]},P.id))]})]}),i&&s.jsxs(_n,{fullWidth:!0,children:[s.jsx(Hn,{children:"Target Schema"}),s.jsxs(On,{value:p,onChange:P=>g(P.target.value),label:"Target Schema",disabled:v,children:[s.jsx(it,{value:"",children:s.jsxs("em",{children:["Use connection default (",k,")"]})}),y.map(P=>s.jsx(it,{value:P,children:P},P))]}),s.jsx(J,{variant:"caption",color:"text.secondary",sx:{mt:.5},children:"Schema to use for sync operations (applies to all connections in group)"})]}),s.jsxs(K,{children:[s.jsx(J,{variant:"subtitle2",sx:{mb:1},children:"Sync Options"}),s.jsx(Kr,{control:s.jsx($s,{checked:c,onChange:P=>u(P.target.checked)}),label:"Enable schema sync checking"}),s.jsx(Kr,{control:s.jsx($s,{checked:f,onChange:P=>h(P.target.checked)}),label:"Enable data sync checking"})]})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:t,children:"Cancel"}),s.jsx(Le,{variant:"contained",onClick:()=>S.mutate(),disabled:S.isPending,children:"Save Settings"})]})]})}function eoe({open:e,onClose:t,sourceConnectionId:n,targetConnectionId:r,targetName:o,schema:i}){const l=Tr(),[c,u]=m.useState([]),[f,h]=m.useState({insertMissing:!0,updateDifferent:!0,deleteExtra:!1}),[p,g]=m.useState(!1),[y,b]=m.useState([]),{data:v=[],isLoading:C}=Ft({queryKey:["tableDiffs",n,r,i],queryFn:()=>ai.getTableRowCounts(n,r,i),enabled:e}),S=m.useMemo(()=>v.filter(k=>k.sourceCount!==k.targetCount||k.missingInTarget>0||k.missingInSource>0),[v]),j=async()=>{g(!0),b([]);const k=c.length>0?c:S.map(P=>P.table);for(const P of k)try{const T=await ai.syncTableData(n,r,i,P,{primaryKeys:["id"],...f});b($=>[...$,T])}catch(T){b($=>[...$,{table:P,inserted:0,updated:0,deleted:0,errors:[T instanceof Error?T.message:String(T)]}])}g(!1),l.invalidateQueries({queryKey:["groupSyncStatus"]})},w=[{field:"table",headerName:"Table",flex:1,minWidth:150},{field:"sourceCount",headerName:"Source",width:100,align:"right",headerAlign:"right"},{field:"targetCount",headerName:"Target",width:100,align:"right",headerAlign:"right"},{field:"difference",headerName:"Difference",width:120,align:"right",headerAlign:"right",valueGetter:(k,P)=>P.sourceCount-P.targetCount,renderCell:k=>{const P=k.value;return s.jsxs(J,{variant:"body2",color:P>0?"success.main":P<0?"error.main":"text.secondary",children:[P>0?"+":"",P]})}}];return s.jsxs(gn,{open:e,onClose:t,maxWidth:"md",fullWidth:!0,children:[s.jsxs(wn,{children:["Sync Data to ",o]}),s.jsxs(Cn,{children:[C?s.jsx(K,{sx:{py:4,textAlign:"center"},children:s.jsx(At,{})}):y.length>0?s.jsxs(K,{children:[s.jsx(J,{variant:"subtitle2",sx:{mb:2},children:"Sync Results"}),y.map((k,P)=>s.jsxs(K,{sx:{p:2,mb:1,bgcolor:k.errors.length>0?"error.dark":"success.dark",borderRadius:1,opacity:.9},children:[s.jsx(J,{fontWeight:600,children:k.table}),s.jsxs(J,{variant:"body2",children:["Inserted: ",k.inserted,", Updated: ",k.updated,", Deleted:"," ",k.deleted]}),k.errors.map((T,$)=>s.jsx(J,{variant:"caption",color:"error.light",children:T},$))]},P))]}):s.jsxs(K,{children:[s.jsxs(J,{variant:"subtitle2",sx:{mb:2},children:["Tables out of sync (",S.length,")"]}),s.jsx(fi,{rows:S,columns:w,getRowId:k=>k.table,checkboxSelection:!0,rowSelectionModel:c,onRowSelectionModelChange:u,autoHeight:!0,pageSizeOptions:[10,25,50],initialState:{pagination:{paginationModel:{pageSize:10}}},sx:{mb:3,maxHeight:300,border:"none","& .MuiDataGrid-cell":{borderColor:"divider"},"& .MuiDataGrid-columnHeaders":{bgcolor:"background.default",borderColor:"divider"}}}),s.jsx(J,{variant:"subtitle2",sx:{mb:1},children:"Sync Options"}),s.jsxs(K,{sx:{display:"flex",flexDirection:"column",gap:1},children:[s.jsx(Kr,{control:s.jsx($s,{checked:f.insertMissing,onChange:k=>h({...f,insertMissing:k.target.checked})}),label:"Insert missing rows"}),s.jsx(Kr,{control:s.jsx($s,{checked:f.updateDifferent,onChange:k=>h({...f,updateDifferent:k.target.checked})}),label:"Update different rows"}),s.jsx(Kr,{control:s.jsx($s,{checked:f.deleteExtra,onChange:k=>h({...f,deleteExtra:k.target.checked})}),label:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:["Delete extra rows in target",s.jsx(Ge,{label:"Destructive",size:"small",color:"error"})]})})]})]}),p&&s.jsx(kl,{sx:{mt:2}})]}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:t,children:"Close"}),y.length===0&&s.jsx(Le,{variant:"contained",onClick:j,disabled:p||S.length===0,startIcon:p?s.jsx(At,{size:16}):s.jsx(fs,{}),children:p?"Syncing...":`Sync ${c.length||S.length} Table(s)`})]})]})}function toe(e){const n=new Date().getTime()-e.getTime(),r=Math.floor(n/1e3),o=Math.floor(r/60),i=Math.floor(o/60);return r<10?"just now":r<60?`${r} seconds ago`:o<60?`${o} minute${o>1?"s":""} ago`:i<24?`${i} hour${i>1?"s":""} ago`:e.toLocaleString()}function GE(e){return e?e.engine==="mysql"||e.engine==="mariadb"?e.database:e.defaultSchema||"public":"public"}function noe(){const{groupId:e}=Sx(),t=Ko(),[n,r]=m.useState(!1),[o,i]=m.useState(null),[l,c]=m.useState(null),{data:u,isLoading:f}=Ft({queryKey:["group",e],queryFn:()=>Cd.getById(e),enabled:!!e}),{data:h=[]}=Ft({queryKey:["groupConnections",e],queryFn:()=>Cd.getConnections(e),enabled:!!e}),{data:p,isLoading:g,isFetching:y,refetch:b,dataUpdatedAt:v}=Ft({queryKey:["groupSyncStatus",e],queryFn:async()=>{const k=await ai.getGroupSyncStatus(e);return c(new Date),k},enabled:!!e&&!!(u!=null&&u.sourceConnectionId),refetchInterval:600*1e3,refetchIntervalInBackground:!0,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,staleTime:1/0,gcTime:3600*1e3});m.useEffect(()=>{v&&v>0&&c(new Date(v))},[v]);const C=()=>{c(null),b()},S=h.find(k=>k.id===(u==null?void 0:u.sourceConnectionId)),j=(u==null?void 0:u.syncTargetSchema)||GE(S),w=k=>{if(u!=null&&u.syncTargetSchema)return u.syncTargetSchema;const P=h.find(T=>T.id===k);return GE(P)};return f?s.jsx(K,{sx:{p:4,display:"flex",justifyContent:"center"},children:s.jsx(At,{})}):u?s.jsxs(K,{sx:{p:4,maxWidth:1400,mx:"auto"},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:2,mb:4},children:[s.jsx(mt,{onClick:()=>t("/dashboard"),children:s.jsx(ER,{})}),s.jsxs(K,{sx:{flex:1},children:[s.jsx(J,{variant:"h4",fontWeight:600,children:u.name}),s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsxs(J,{variant:"body2",color:"text.secondary",children:["Instance Group Sync Status",u.projectName&&` • ${u.projectName}`]}),l&&s.jsxs(J,{variant:"caption",color:"text.disabled",sx:{display:"flex",alignItems:"center",gap:.5},children:["• Last checked: ",toe(l)]})]})]}),s.jsx(Le,{variant:"outlined",startIcon:s.jsx(Wd,{}),onClick:()=>r(!0),children:"Settings"}),s.jsx(Le,{variant:"contained",startIcon:g||y?s.jsx(At,{size:16}):s.jsx(Eo,{}),onClick:C,disabled:g||y||!u.sourceConnectionId,children:y?"Checking...":"Refresh Status"})]}),!u.sourceConnectionId&&s.jsx(Nt,{severity:"warning",sx:{mb:3},children:"No source connection set. Configure a source connection in settings to enable sync checking."}),u.sourceConnectionId&&!u.syncSchema&&!u.syncData&&s.jsx(Nt,{severity:"info",sx:{mb:3},children:"Neither schema nor data sync is enabled. Enable sync options in settings."}),u.sourceConnectionId&&s.jsxs(cn,{children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:2,mb:2},children:[s.jsx(J,{variant:"subtitle2",color:"text.secondary",children:"Source (Reference)"}),s.jsx(Ge,{label:u.sourceConnectionName||"Unknown",icon:s.jsx(Cr,{}),color:"primary"}),u.syncSchema&&s.jsx(Ge,{label:"Schema Sync",size:"small"}),u.syncData&&s.jsx(Ge,{label:"Data Sync",size:"small"})]}),p&&p.targets.length>0?s.jsx(Sa,{children:s.jsxs(Ca,{children:[s.jsx(ja,{children:s.jsxs(Ur,{children:[s.jsx(lt,{width:50}),s.jsx(lt,{children:"Target Connection"}),s.jsx(lt,{children:"Schema Status"}),s.jsx(lt,{children:"Data Status"}),s.jsx(lt,{children:"Actions"})]})}),s.jsx(wa,{children:p.targets.map(k=>s.jsx(Zre,{target:k,group:u,sourceConnectionId:u.sourceConnectionId,sourceSchema:j,targetSchema:w(k.connectionId)},k.connectionId))})]})}):g?s.jsxs(K,{sx:{py:4,textAlign:"center"},children:[s.jsx(At,{size:24}),s.jsx(J,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"Checking sync status..."})]}):s.jsx(J,{color:"text.secondary",sx:{py:2},children:"No target connections in this group."})]}),!u.sourceConnectionId&&h.length>0&&s.jsxs(cn,{children:[s.jsxs(J,{variant:"subtitle2",sx:{mb:2},children:["Connections in this group (",h.length,")"]}),h.map(k=>s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:2,py:1,borderBottom:"1px solid",borderColor:"divider","&:last-child":{borderBottom:"none"}},children:[s.jsx(Cr,{sx:{color:"primary.main"}}),s.jsx(J,{children:k.name}),s.jsxs(J,{variant:"caption",color:"text.secondary",children:[k.host,":",k.port]})]},k.id))]}),s.jsx(Jre,{open:n,onClose:()=>r(!1),group:u,connections:h}),o&&u.sourceConnectionId&&s.jsx(eoe,{open:!0,onClose:()=>i(null),sourceConnectionId:u.sourceConnectionId,targetConnectionId:o.connectionId,targetName:o.connectionName,schema:j})]}):s.jsx(K,{sx:{p:4},children:s.jsx(Nt,{severity:"error",children:"Instance group not found"})})}function UE({label:e,connectionId:t,schema:n,connections:r,schemas:o,disabledConnectionId:i,loadingConnections:l,onConnectionChange:c,onSchemaChange:u}){const{healthStatus:f,checkConnection:h}=Vd(),p=b=>{const v=f[b.id];return v?v.isOnline?s.jsx(Pt,{title:"Connected",children:s.jsx(Il,{sx:{fontSize:14,color:"success.main",ml:"auto"}})}):s.jsx(Pt,{title:v.error||"Connection failed",children:s.jsx(Na,{sx:{fontSize:14,color:"error.main",ml:"auto"}})}):s.jsx(Pt,{title:"Status unknown",children:s.jsx(Qx,{sx:{fontSize:14,color:"text.disabled",ml:"auto"}})})},g=b=>{if(b.id===i)return!0;const v=f[b.id];return v&&!v.isOnline},y=async b=>{const v=f[b];if(v){if(!v.isOnline)return}else if(!await h(b))return;c(b)};return s.jsxs(K,{sx:{flex:1,minWidth:200},children:[s.jsx(J,{variant:"caption",color:"text.secondary",sx:{mb:.5,display:"block"},children:e}),s.jsxs(K,{sx:{display:"flex",gap:1},children:[s.jsxs(_n,{size:"small",sx:{flex:1},children:[s.jsx(Hn,{children:"Connection"}),s.jsx(On,{value:t,onChange:b=>y(b.target.value),label:"Connection",disabled:l,children:r.map(b=>{const v=g(b);return s.jsx(it,{value:b.id,disabled:v,sx:{opacity:v?.5:1},children:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%"},children:[s.jsx(Cr,{fontSize:"small",sx:{opacity:.6}}),s.jsx("span",{children:b.name}),p(b)]})},b.id)})})]}),o.length>0&&s.jsxs(_n,{size:"small",sx:{minWidth:120},children:[s.jsx(Hn,{children:"Schema"}),s.jsx(On,{value:n,onChange:b=>u(b.target.value),label:"Schema",children:o.map(b=>s.jsx(it,{value:b,children:b},b))})]})]})]})}function qE({type:e}){const n={table_added:{icon:s.jsx(Gn,{sx:{fontSize:14}}),color:"#22c55e",bg:"rgba(34, 197, 94, 0.1)"},table_removed:{icon:s.jsx(cp,{sx:{fontSize:14}}),color:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},column_added:{icon:s.jsx(Gn,{sx:{fontSize:14}}),color:"#22c55e",bg:"rgba(34, 197, 94, 0.1)"},column_removed:{icon:s.jsx(cp,{sx:{fontSize:14}}),color:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},column_modified:{icon:s.jsx(Dr,{sx:{fontSize:14}}),color:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},index_added:{icon:s.jsx(Gn,{sx:{fontSize:14}}),color:"#22c55e",bg:"rgba(34, 197, 94, 0.1)"},index_removed:{icon:s.jsx(cp,{sx:{fontSize:14}}),color:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},index_modified:{icon:s.jsx(Dr,{sx:{fontSize:14}}),color:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},fk_added:{icon:s.jsx(Gn,{sx:{fontSize:14}}),color:"#22c55e",bg:"rgba(34, 197, 94, 0.1)"},fk_removed:{icon:s.jsx(cp,{sx:{fontSize:14}}),color:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},fk_modified:{icon:s.jsx(Dr,{sx:{fontSize:14}}),color:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"}}[e]||{icon:s.jsx(Dr,{sx:{fontSize:14}}),color:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"};return s.jsx(Ge,{icon:n.icon,label:e.replace(/_/g," "),size:"small",sx:{bgcolor:n.bg,color:n.color,border:`1px solid ${n.color}`,"& .MuiChip-icon":{color:n.color},fontSize:11,height:24}})}function roe({diff:e,migrationSql:t,onApplyMigration:n,applying:r}){const[o,i]=m.useState(!1),l=t.join(`
|
|
357
|
+
|
|
358
|
+
`),c=()=>{navigator.clipboard.writeText(l),i(!0),setTimeout(()=>i(!1),2e3)},u=m.useMemo(()=>{const g={};for(const y of e.items){const b=y.table||"General";g[b]??(g[b]=[]),g[b].push(y)}return g},[e.items]),f=e.summary.tablesAdded+e.summary.columnsAdded+e.summary.indexesAdded+e.summary.fksAdded,h=e.summary.tablesRemoved+e.summary.columnsRemoved+e.summary.indexesRemoved+e.summary.fksRemoved,p=e.summary.columnsModified+e.summary.indexesModified+e.summary.fksModified;return e.items.length===0?s.jsx(Nt,{severity:"success",icon:s.jsx(vl,{}),children:"Schemas are identical - no differences found."}):s.jsxs(K,{children:[s.jsxs(K,{sx:{display:"flex",gap:1,mb:2,flexWrap:"wrap"},children:[s.jsx(Ge,{label:`${f} added`,size:"small",sx:{bgcolor:"rgba(34, 197, 94, 0.1)",color:"#22c55e"}}),s.jsx(Ge,{label:`${h} removed`,size:"small",sx:{bgcolor:"rgba(239, 68, 68, 0.1)",color:"#ef4444"}}),s.jsx(Ge,{label:`${p} modified`,size:"small",sx:{bgcolor:"rgba(245, 158, 11, 0.1)",color:"#f59e0b"}})]}),Object.entries(u).map(([g,y])=>s.jsxs(GM,{defaultExpanded:!0,sx:{mb:1},children:[s.jsxs(qM,{expandIcon:s.jsx(bl,{}),children:[s.jsx(J,{fontWeight:500,children:g}),s.jsx(K,{sx:{ml:2,display:"flex",gap:.5},children:y.map((b,v)=>s.jsx(qE,{type:b.type},v))})]}),s.jsx(UM,{children:y.map((b,v)=>s.jsxs(K,{sx:{p:1.5,mb:1,bgcolor:"background.default",border:"1px solid",borderColor:"divider"},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[s.jsx(qE,{type:b.type}),s.jsxs(J,{variant:"body2",fontWeight:500,children:[b.type.replace(/_/g," "),": ",b.name||b.table]})]}),b.migrationSql&&b.migrationSql.length>0&&s.jsx(J,{variant:"caption",color:"text.secondary",component:"pre",sx:{whiteSpace:"pre-wrap",fontFamily:"monospace"},children:b.migrationSql.join(`
|
|
359
|
+
`)})]},v))})]},g)),t.length>0&&s.jsxs(K,{sx:{mt:3},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1},children:[s.jsx(J,{variant:"subtitle2",children:"Migration SQL"}),s.jsxs(K,{sx:{display:"flex",gap:1},children:[s.jsx(Le,{size:"small",startIcon:o?s.jsx(vl,{}):s.jsx(Oa,{}),onClick:c,children:o?"Copied!":"Copy"}),s.jsx(Le,{size:"small",variant:"contained",color:"warning",startIcon:r?s.jsx(At,{size:16}):s.jsx(fs,{}),onClick:n,disabled:r,children:"Apply Migration"})]})]}),s.jsx(Un,{sx:{p:2,bgcolor:"background.default",maxHeight:300,overflow:"auto"},children:s.jsx(J,{component:"pre",sx:{fontFamily:"monospace",fontSize:12,whiteSpace:"pre-wrap",m:0},children:l})})]})]})}function KE(e,t){return e?(e.engine==="mysql"||e.engine==="mariadb")&&e.database&&t.includes(e.database)?e.database:e.defaultSchema&&t.includes(e.defaultSchema)?e.defaultSchema:t.includes("public")?"public":t.includes("main")?"main":t.includes("dbo")?"dbo":t[0]||"":""}const ug=600*1e3;function ooe(){const e=Tr(),[t,n]=m.useState(""),[r,o]=m.useState(""),[i,l]=m.useState(""),[c,u]=m.useState(""),[f,h]=m.useState(""),[p,g]=m.useState(!1),[y,b]=m.useState(!1),[v,C]=m.useState("schema"),{data:S=[],isLoading:j}=Ft({queryKey:["connections"],queryFn:Qr.getAll}),{data:w=[]}=Ft({queryKey:["groups"],queryFn:()=>Cd.getAll()}),{data:k=[]}=Ft({queryKey:["projects"],queryFn:pi.getAll}),P=m.useMemo(()=>t?S.filter(Q=>Q.groupId===t):[],[S,t]);m.useEffect(()=>{w.length>0&&!t&&w[0]&&n(w[0].id)},[w,t]);const T=P.find(Q=>Q.id===r),$=P.find(Q=>Q.id===i),M=w.find(Q=>Q.id===t),{data:R=[]}=Ft({queryKey:["schemas",r],queryFn:()=>xn.getSchemas(r),enabled:!!r}),{data:E=[]}=Ft({queryKey:["schemas",i],queryFn:()=>xn.getSchemas(i),enabled:!!i});if(R.length>0&&!c){const Q=KE(T,R);Q&&u(Q)}if(E.length>0&&!f){const Q=KE($,E);Q&&h(Q)}const O=["schemaDiff",r,i,c,f],A=!!e.getQueryData(O);m.useEffect(()=>{A&&!p&&g(!0)},[A,p]);const{data:N,isLoading:F,isFetching:L,refetch:D}=Ft({queryKey:O,queryFn:()=>xn.compareSchemasApi(r,i,c,f),enabled:p&&v==="schema"&&!!r&&!!i&&!!c&&!!f,staleTime:ug,gcTime:ug}),H=F||L,{data:B}=Ft({queryKey:["migrationSql",r,i,c,f],queryFn:()=>xn.getMigrationSql(r,i,c,f),enabled:p&&v==="schema"&&!!N&&!!r&&!!i,staleTime:ug,gcTime:ug}),V=()=>{g(!0),e.invalidateQueries({queryKey:["schemaDiff",r,i]}),e.invalidateQueries({queryKey:["migrationSql",r,i]}),e.invalidateQueries({queryKey:["tableDiffs",r,i]}),v==="schema"&&D()},G=()=>{const Q=r,ee=c;o(i),u(f),l(Q),h(ee)},_=async()=>{if(!(!r||!i||!c||!f)){b(!0);try{await xn.applyMigration(r,i,c,f,"Applied from Compare page"),e.invalidateQueries({queryKey:["schemaDiff"]}),e.invalidateQueries({queryKey:["migrationSql"]}),D()}catch(Q){console.error("Failed to apply migration:",Q)}finally{b(!1)}}},U=(Q,ee)=>{C(ee)},Z=r&&i&&c&&f;return m.useEffect(()=>{o(""),l(""),u(""),h(""),g(!1)},[t]),s.jsxs(K,{sx:{p:3,height:"100%",overflow:"auto"},children:[s.jsxs(K,{sx:{mb:3},children:[s.jsx(J,{variant:"h5",fontWeight:600,gutterBottom:!0,children:"Compare Databases"}),s.jsx(J,{variant:"body2",color:"text.secondary",children:"Compare schemas and data between connections within the same instance group."})]}),s.jsxs(Un,{sx:{p:3,mb:3},children:[s.jsx(J,{variant:"subtitle2",fontWeight:600,gutterBottom:!0,children:"Select Instance Group"}),w.length===0?s.jsx(Nt,{severity:"info",sx:{mt:2},children:"No instance groups found. Create groups in the Projects page to compare connections."}):s.jsxs(_n,{fullWidth:!0,size:"small",sx:{mt:1},children:[s.jsx(Hn,{children:"Instance Group"}),s.jsx(On,{value:t,onChange:Q=>n(Q.target.value),label:"Instance Group",children:w.map(Q=>{const ee=k.find(ne=>ne.id===Q.projectId);return s.jsx(it,{value:Q.id,children:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%"},children:[ee&&s.jsx(Ge,{label:ee.name,size:"small",sx:{height:20,fontSize:11,bgcolor:`${ee.color}20`,color:ee.color}}),s.jsx("span",{children:Q.name}),s.jsx(Ge,{label:Q.databaseEngine==="postgres"?"PostgreSQL":Q.databaseEngine==="mysql"?"MySQL":Q.databaseEngine==="mariadb"?"MariaDB":"SQLite",size:"small",sx:{height:20,fontSize:11,bgcolor:"primary.main",color:"primary.contrastText"}}),s.jsxs(J,{variant:"caption",color:"text.secondary",sx:{ml:"auto"},children:[S.filter(ne=>ne.groupId===Q.id).length," ","connections"]})]})},Q.id)})})]})]}),t&&P.length>=2&&s.jsx(Un,{sx:{p:3,mb:3},children:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"},children:[s.jsx(UE,{label:"Source (reference)",connectionId:r,schema:c,connections:P,schemas:R,disabledConnectionId:i,loadingConnections:j,onConnectionChange:Q=>{o(Q),u("")},onSchemaChange:Q=>{u(Q)}}),s.jsx(Pt,{title:"Swap source and target",children:s.jsx(mt,{onClick:G,disabled:!r||!i,sx:{mt:2},children:s.jsx(VU,{})})}),s.jsx(UE,{label:"Target (to be updated)",connectionId:i,schema:f,connections:P,schemas:E,disabledConnectionId:r,loadingConnections:j,onConnectionChange:Q=>{l(Q),h("")},onSchemaChange:Q=>{h(Q)}}),s.jsxs(Le,{variant:"contained",startIcon:H?s.jsx(At,{size:16,color:"inherit"}):s.jsx(bd,{}),onClick:V,disabled:!Z||H,sx:{mt:2},children:[H&&"Comparing...",!H&&(A||N)&&"Refresh",!H&&!A&&!N&&"Compare"]})]})}),t&&P.length<2&&s.jsx(Nt,{severity:"info",children:P.length===0?`No connections found in the "${M==null?void 0:M.name}" group. Add connections to this group in the Projects page.`:`Only ${P.length} connection found in the "${M==null?void 0:M.name}" group. At least 2 connections are required for comparison.`}),p&&s.jsxs(Un,{sx:{p:0},children:[s.jsx(K,{sx:{borderBottom:1,borderColor:"divider"},children:s.jsxs(yl,{value:v,onChange:U,children:[s.jsx(Bn,{value:"schema",label:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(PR,{fontSize:"small"}),"Schema",N&&N.items.length>0&&s.jsx(Ge,{label:N.items.length,size:"small",color:"warning",sx:{height:20,fontSize:11}})]})}),s.jsx(Bn,{value:"data",label:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(Cr,{fontSize:"small"}),"Data"]})})]})}),s.jsxs(K,{sx:{p:3},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:2,mb:2},children:[s.jsx(J,{variant:"h6",children:v==="schema"?"Schema Differences":"Data Differences"}),s.jsx(Ge,{label:`${(T==null?void 0:T.name)||"Source"}.${c}`,size:"small",color:"primary",variant:"outlined"}),s.jsx(J,{color:"text.secondary",children:"→"}),s.jsx(Ge,{label:`${($==null?void 0:$.name)||"Target"}.${f}`,size:"small",color:"secondary",variant:"outlined"})]}),v==="schema"&&H&&s.jsx(wl,{message:"Comparing schemas...",size:"medium"}),v==="schema"&&!H&&N&&s.jsx(roe,{diff:N,migrationSql:(B==null?void 0:B.sql)||[],onApplyMigration:_,applying:y}),v==="schema"&&!H&&!N&&s.jsx(Nt,{severity:"info",children:"Click Compare to see schema differences."}),v==="data"&&s.jsx(jO,{sourceConnectionId:r,targetConnectionId:i,sourceSchema:c,targetSchema:f,sourceConnectionName:(T==null?void 0:T.name)||"Source",targetConnectionName:($==null?void 0:$.name)||"Target"})]})]}),!p&&s.jsx(Un,{sx:{p:3},children:s.jsx(go,{icon:s.jsx(bd,{}),title:"Select connections to compare",description:"Choose a source and target database connection above, then click Compare to see schema and data differences.",size:"large"})})]})}function QE(e){return new Date(e).toLocaleString()}function YE(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}function soe(){const e=Ko(),t=Tr(),n=oo(),[r,o]=m.useState(""),[i,l]=m.useState(""),[c,u]=m.useState("all"),[f,h]=m.useState(null),[p,g]=m.useState(!1),[y,b]=m.useState(null),{data:v=[]}=Ft({queryKey:["connections"],queryFn:Qr.getAll}),{data:C=[]}=Ft({queryKey:["projects"],queryFn:pi.getAll}),{data:S=[],isLoading:j}=Ft({queryKey:["queryHistory",r],queryFn:()=>mo.getHistory(r||void 0,500)}),w=vr({mutationFn:()=>mo.clearHistory(r||void 0),onSuccess:()=>{t.invalidateQueries({queryKey:["queryHistory"]}),g(!1),n.success("Query history cleared")}}),k=(E,O)=>{navigator.clipboard.writeText(E),h(O),n.success("SQL copied to clipboard"),setTimeout(()=>h(null),2e3)},P=E=>{e(`/query/${E.connectionId}`,{state:{sql:E.sql}})},T=E=>{const O=v.find(F=>F.id===E);if(!O)return{name:"Unknown",color:void 0};const A=C.find(F=>F.id===O.projectId),N=A==null?void 0:A.color;return{name:O.name,color:N}},$=E=>T(E).name,M=S.filter(E=>!(c==="success"&&!E.success||c==="error"&&E.success||i&&!E.sql.toLowerCase().includes(i.toLowerCase()))),R=[{field:"executedAt",headerName:"Time",width:170,renderCell:E=>s.jsx(J,{variant:"body2",sx:{fontSize:12},children:QE(E.value)})},{field:"connectionId",headerName:"Connection",width:150,renderCell:E=>{const{name:O,color:A}=T(E.value);return s.jsx(Ge,{label:O,size:"small",sx:{fontSize:11,...A&&{bgcolor:`${A}15`,color:A,border:`1px solid ${A}`}}})}},{field:"sql",headerName:"Query",flex:1,minWidth:300,renderCell:E=>s.jsx(Pt,{title:E.value,placement:"top-start",children:s.jsx(J,{variant:"body2",sx:{fontFamily:"monospace",fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:E.value})})},{field:"executionTimeMs",headerName:"Duration",width:100,renderCell:E=>s.jsx(J,{variant:"body2",sx:{fontSize:12,color:E.value>1e3?"warning.main":"text.secondary"},children:YE(E.value)})},{field:"rowCount",headerName:"Rows",width:80,renderCell:E=>s.jsx(J,{variant:"body2",sx:{fontSize:12},children:E.value.toLocaleString()})},{field:"success",headerName:"Status",width:90,renderCell:E=>s.jsx(Ge,{label:E.value?"Success":"Error",size:"small",sx:{fontSize:10,height:20,bgcolor:E.value?"rgba(34, 197, 94, 0.1)":"rgba(239, 68, 68, 0.1)",color:E.value?"#22c55e":"#ef4444"}})},{field:"actions",headerName:"",width:100,sortable:!1,renderCell:E=>s.jsxs(K,{sx:{display:"flex",gap:.5},children:[s.jsx(Pt,{title:"Copy SQL",children:s.jsx(mt,{size:"small",onClick:()=>k(E.row.sql,E.row.id),children:f===E.row.id?s.jsx(vl,{sx:{fontSize:16,color:"success.main"}}):s.jsx(Oa,{sx:{fontSize:16}})})}),s.jsx(Pt,{title:"Run Again",children:s.jsx(mt,{size:"small",onClick:()=>P(E.row),children:s.jsx(Cl,{sx:{fontSize:16}})})}),s.jsx(Pt,{title:"View Details",children:s.jsx(mt,{size:"small",onClick:()=>b(E.row),children:s.jsx(vh,{sx:{fontSize:16}})})})]})}];return s.jsxs(K,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[s.jsxs(K,{sx:{display:"flex",gap:2,mt:1,mb:2,flexWrap:"wrap",alignItems:"center"},children:[s.jsxs(_n,{size:"small",sx:{minWidth:180},children:[s.jsx(Hn,{children:"Connection"}),s.jsxs(On,{value:r,onChange:E=>o(E.target.value),label:"Connection",children:[s.jsx(it,{value:"",children:"All Connections"}),v.map(E=>s.jsx(it,{value:E.id,children:E.name},E.id))]})]}),s.jsxs(_n,{size:"small",sx:{minWidth:120},children:[s.jsx(Hn,{children:"Status"}),s.jsxs(On,{value:c,onChange:E=>u(E.target.value),label:"Status",children:[s.jsx(it,{value:"all",children:"All"}),s.jsx(it,{value:"success",children:"Success"}),s.jsx(it,{value:"error",children:"Errors"})]})]}),s.jsx(Wt,{size:"small",placeholder:"Search queries...",value:i,onChange:E=>l(E.target.value),sx:{minWidth:250},InputProps:{startAdornment:s.jsx(ds,{position:"start",children:s.jsx(Ud,{sx:{fontSize:18,color:"text.secondary"}})}),endAdornment:i&&s.jsx(ds,{position:"end",children:s.jsx(mt,{size:"small",onClick:()=>l(""),children:s.jsx(Aw,{sx:{fontSize:16}})})})}}),s.jsx(K,{sx:{flex:1}}),s.jsxs(J,{variant:"body2",color:"text.secondary",children:[M.length," entries"]}),s.jsx(Le,{size:"small",color:"error",startIcon:s.jsx(dr,{}),onClick:()=>g(!0),disabled:S.length===0,children:"Clear History"})]}),s.jsx(K,{sx:{flex:1,minHeight:400},children:s.jsx(fi,{rows:M,columns:R,loading:j,pageSizeOptions:[25,50,100],initialState:{pagination:{paginationModel:{pageSize:25}},sorting:{sortModel:[{field:"executedAt",sort:"desc"}]}},disableRowSelectionOnClick:!0,sx:{border:"none","& .MuiDataGrid-cell":{fontSize:12,display:"flex",alignItems:"center"}}})}),s.jsxs(gn,{open:p,onClose:()=>g(!1),children:[s.jsx(wn,{children:"Clear Query History"}),s.jsx(Cn,{children:s.jsxs(J,{children:["Are you sure you want to clear"," ",r?`history for ${$(r)}`:"all query history","? This action cannot be undone."]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:()=>g(!1),children:"Cancel"}),s.jsx(Le,{color:"error",variant:"contained",onClick:()=>w.mutate(),disabled:w.isPending,children:"Clear"})]})]}),s.jsxs(gn,{open:!!y,onClose:()=>b(null),maxWidth:"md",fullWidth:!0,children:[s.jsx(wn,{children:"Query Details"}),s.jsx(Cn,{children:y&&s.jsxs(K,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[s.jsxs(K,{sx:{display:"flex",gap:2,flexWrap:"wrap"},children:[s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:"Connection"}),s.jsx(J,{variant:"body2",children:$(y.connectionId)})]}),s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:"Executed At"}),s.jsx(J,{variant:"body2",children:QE(y.executedAt)})]}),s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:"Duration"}),s.jsx(J,{variant:"body2",children:YE(y.executionTimeMs)})]}),s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:"Rows"}),s.jsx(J,{variant:"body2",children:y.rowCount.toLocaleString()})]})]}),!y.success&&y.error&&s.jsxs(Nt,{severity:"error",sx:{"& .MuiAlert-message":{width:"100%"}},children:[s.jsx(J,{variant:"subtitle2",sx:{fontWeight:600,mb:1},children:"Error Details"}),s.jsx(K,{sx:{fontFamily:"monospace",fontSize:12,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:200,overflow:"auto",bgcolor:"rgba(0,0,0,0.1)",p:1.5,borderRadius:1},children:y.error})]}),s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:"SQL Query"}),s.jsx(K,{sx:{p:2,bgcolor:"background.default",borderRadius:1,fontFamily:"monospace",fontSize:13,whiteSpace:"pre-wrap",wordBreak:"break-all",maxHeight:300,overflow:"auto"},children:y.sql})]})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:()=>b(null),children:"Close"}),y&&s.jsxs(s.Fragment,{children:[s.jsx(Le,{startIcon:s.jsx(Oa,{}),onClick:()=>k(y.sql,y.id),children:"Copy SQL"}),s.jsx(Le,{variant:"contained",startIcon:s.jsx(Cl,{}),onClick:()=>{P(y),b(null)},children:"Run Again"})]})]})]})]})}function XE(e){return new Date(e).toLocaleString()}function ioe(){const e=Tr(),t=oo(),[n,r]=m.useState(""),[o,i]=m.useState(null),[l,c]=m.useState(null),[u,f]=m.useState(!1),[h,p]=m.useState(null),{data:g=[],isLoading:y}=Ft({queryKey:["migrationHistory"],queryFn:()=>xn.getMigrationHistory({limit:500})}),b=vr({mutationFn:w=>xn.deleteMigration(w),onSuccess:()=>{e.invalidateQueries({queryKey:["migrationHistory"]}),f(!1),p(null),t.success("Migration record deleted")}}),v=(w,k)=>{navigator.clipboard.writeText(w.join(`
|
|
360
|
+
|
|
361
|
+
`)),i(k),t.success("SQL copied to clipboard"),setTimeout(()=>i(null),2e3)},C=w=>{p(w),f(!0)},S=g.filter(w=>{var P,T,$;if(!n)return!0;const k=n.toLowerCase();return((P=w.sourceConnectionName)==null?void 0:P.toLowerCase().includes(k))||((T=w.targetConnectionName)==null?void 0:T.toLowerCase().includes(k))||w.sourceSchema.toLowerCase().includes(k)||w.targetSchema.toLowerCase().includes(k)||(($=w.description)==null?void 0:$.toLowerCase().includes(k))||w.sqlStatements.some(M=>M.toLowerCase().includes(k))}),j=[{field:"appliedAt",headerName:"Applied At",width:170,renderCell:w=>s.jsx(J,{variant:"body2",sx:{fontSize:12},children:XE(w.value)})},{field:"source",headerName:"Source",width:180,valueGetter:(w,k)=>`${k.sourceConnectionName||"Unknown"}.${k.sourceSchema}`,renderCell:w=>s.jsxs(K,{sx:{lineHeight:1.3},children:[s.jsx(J,{variant:"body2",sx:{fontSize:12,fontWeight:500,lineHeight:1.3},children:w.row.sourceConnectionName||"Unknown"}),s.jsx(J,{variant:"caption",color:"text.secondary",sx:{lineHeight:1.2},children:w.row.sourceSchema})]})},{field:"arrow",headerName:"",width:40,sortable:!1,renderCell:()=>s.jsx(xI,{sx:{fontSize:16,color:"text.secondary"}})},{field:"target",headerName:"Target",width:180,valueGetter:(w,k)=>`${k.targetConnectionName||"Unknown"}.${k.targetSchema}`,renderCell:w=>s.jsxs(K,{sx:{lineHeight:1.3},children:[s.jsx(J,{variant:"body2",sx:{fontSize:12,fontWeight:500,lineHeight:1.3},children:w.row.targetConnectionName||"Unknown"}),s.jsx(J,{variant:"caption",color:"text.secondary",sx:{lineHeight:1.2},children:w.row.targetSchema})]})},{field:"description",headerName:"Description",flex:1,minWidth:200,renderCell:w=>s.jsx(J,{variant:"body2",sx:{fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:w.value||"-"})},{field:"sqlStatements",headerName:"Statements",width:100,renderCell:w=>{var k;return s.jsx(Ge,{label:`${((k=w.value)==null?void 0:k.length)||0} SQL`,size:"small",sx:{fontSize:10,height:20}})}},{field:"success",headerName:"Status",width:90,renderCell:w=>s.jsx(Ge,{label:w.value?"Success":"Failed",size:"small",sx:{fontSize:10,height:20,bgcolor:w.value?"rgba(34, 197, 94, 0.1)":"rgba(239, 68, 68, 0.1)",color:w.value?"#22c55e":"#ef4444"}})},{field:"actions",headerName:"",width:100,sortable:!1,renderCell:w=>s.jsxs(K,{sx:{display:"flex",gap:.5},children:[s.jsx(Pt,{title:"Copy SQL",children:s.jsx(mt,{size:"small",onClick:()=>v(w.row.sqlStatements,w.row.id),children:o===w.row.id?s.jsx(vl,{sx:{fontSize:16,color:"success.main"}}):s.jsx(Oa,{sx:{fontSize:16}})})}),s.jsx(Pt,{title:"View Details",children:s.jsx(mt,{size:"small",onClick:()=>c(w.row),children:s.jsx(vh,{sx:{fontSize:16}})})}),s.jsx(Pt,{title:"Delete",children:s.jsx(mt,{size:"small",onClick:()=>C(w.row.id),sx:{color:"error.main"},children:s.jsx(dr,{sx:{fontSize:16}})})})]})}];return s.jsxs(K,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[s.jsxs(K,{sx:{display:"flex",gap:2,mt:1,mb:2,flexWrap:"wrap",alignItems:"center"},children:[s.jsx(Wt,{size:"small",placeholder:"Search migrations...",value:n,onChange:w=>r(w.target.value),sx:{minWidth:300},InputProps:{startAdornment:s.jsx(ds,{position:"start",children:s.jsx(Ud,{sx:{fontSize:18,color:"text.secondary"}})}),endAdornment:n&&s.jsx(ds,{position:"end",children:s.jsx(mt,{size:"small",onClick:()=>r(""),children:s.jsx(Aw,{sx:{fontSize:16}})})})}}),s.jsx(K,{sx:{flex:1}}),s.jsxs(J,{variant:"body2",color:"text.secondary",children:[S.length," migrations"]})]}),s.jsx(K,{sx:{flex:1,minHeight:400},children:s.jsx(fi,{rows:S,columns:j,loading:y,pageSizeOptions:[25,50,100],initialState:{pagination:{paginationModel:{pageSize:25}},sorting:{sortModel:[{field:"appliedAt",sort:"desc"}]}},disableRowSelectionOnClick:!0,sx:{border:"none","& .MuiDataGrid-cell":{fontSize:12,display:"flex",alignItems:"center"}}})}),s.jsxs(gn,{open:u,onClose:()=>f(!1),children:[s.jsx(wn,{children:"Delete Migration Record"}),s.jsx(Cn,{children:s.jsx(J,{children:"Are you sure you want to delete this migration record? This only removes the history entry, not the actual database changes."})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:()=>f(!1),children:"Cancel"}),s.jsx(Le,{color:"error",variant:"contained",onClick:()=>h&&b.mutate(h),disabled:b.isPending,children:"Delete"})]})]}),s.jsxs(gn,{open:!!l,onClose:()=>c(null),maxWidth:"md",fullWidth:!0,children:[s.jsx(wn,{children:"Migration Details"}),s.jsx(Cn,{children:l&&s.jsxs(K,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[s.jsxs(K,{sx:{display:"flex",gap:3,flexWrap:"wrap",alignItems:"center"},children:[s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:"Source"}),s.jsxs(J,{variant:"body2",children:[l.sourceConnectionName,".",l.sourceSchema]})]}),s.jsx(xI,{sx:{color:"text.secondary"}}),s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:"Target"}),s.jsxs(J,{variant:"body2",children:[l.targetConnectionName,".",l.targetSchema]})]}),s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:"Applied At"}),s.jsx(J,{variant:"body2",children:XE(l.appliedAt)})]}),s.jsx(Ge,{label:l.success?"Success":"Failed",size:"small",sx:{bgcolor:l.success?"rgba(34, 197, 94, 0.1)":"rgba(239, 68, 68, 0.1)",color:l.success?"#22c55e":"#ef4444"}})]}),l.description&&s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:"Description"}),s.jsx(J,{variant:"body2",children:l.description})]}),!l.success&&l.error&&s.jsxs(Nt,{severity:"error",sx:{"& .MuiAlert-message":{width:"100%"}},children:[s.jsx(J,{variant:"subtitle2",sx:{fontWeight:600,mb:1},children:"Error Details"}),s.jsx(K,{sx:{fontFamily:"monospace",fontSize:12,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:200,overflow:"auto",bgcolor:"rgba(0,0,0,0.1)",p:1.5,borderRadius:1},children:l.error})]}),s.jsxs(K,{children:[s.jsxs(J,{variant:"caption",color:"text.secondary",sx:{mb:1,display:"block"},children:["SQL Statements (",l.sqlStatements.length,")"]}),s.jsx(K,{sx:{p:2,bgcolor:"background.default",borderRadius:1,fontFamily:"monospace",fontSize:12,whiteSpace:"pre-wrap",wordBreak:"break-all",maxHeight:400,overflow:"auto"},children:l.sqlStatements.join(`
|
|
362
|
+
|
|
363
|
+
`)})]})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:()=>c(null),children:"Close"}),l&&s.jsx(Le,{startIcon:s.jsx(Oa,{}),onClick:()=>v(l.sqlStatements,l.id),children:"Copy All SQL"})]})]})]})}function ZE(e){return e.toLocaleString()}function JE(e){return e===void 0?"-":e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}function eP(e,t){switch(e){case"query":return s.jsx(Fc,{sx:{fontSize:18}});case"migration":return s.jsx(bd,{sx:{fontSize:18}});case"sync":return s.jsx(fs,{sx:{fontSize:18}});case"connection":return t.includes("create")?s.jsx(Gn,{sx:{fontSize:18}}):t.includes("delete")?s.jsx(dr,{sx:{fontSize:18}}):t.includes("update")?s.jsx(Dr,{sx:{fontSize:18}}):s.jsx(Cr,{sx:{fontSize:18}});default:return s.jsx(Wd,{sx:{fontSize:18}})}}function Ou(e,t){if(t==="error")return"#ef4444";switch(e){case"query":return"#8b5cf6";case"migration":return"#f59e0b";case"sync":return"#22c55e";case"connection":return"#0ea5e9";default:return"#6b7280"}}function loe(){var v,C,S,j,w,k,P;const[e,t]=m.useState(""),[n,r]=m.useState("all"),[o,i]=m.useState(null),{data:l=[],isLoading:c}=Ft({queryKey:["queryHistory"],queryFn:()=>mo.getHistory(void 0,500)}),{data:u=[],isLoading:f}=Ft({queryKey:["migrationHistory"],queryFn:()=>xn.getMigrationHistory({limit:500})}),{data:h=[]}=Ft({queryKey:["connections"],queryFn:Qr.getAll}),p=c||f,g=[...l.map(T=>{var $;return{id:`query-${T.id}`,type:"query",action:"execute",description:T.sql,timestamp:new Date(T.executedAt),status:T.success?"success":"error",details:{connectionId:T.connectionId,connectionName:($=h.find(M=>M.id===T.connectionId))==null?void 0:$.name,executionTimeMs:T.executionTimeMs,rowCount:T.rowCount,error:T.error}}}),...u.map(T=>({id:`migration-${T.id}`,type:"migration",action:"apply",description:T.description||`Migration from ${T.sourceConnectionName} to ${T.targetConnectionName}`,timestamp:new Date(T.appliedAt),status:T.success?"success":"error",details:{sourceConnection:T.sourceConnectionName,targetConnection:T.targetConnectionName,sourceSchema:T.sourceSchema,targetSchema:T.targetSchema,statementCount:T.sqlStatements.length,error:T.error}}))];g.sort((T,$)=>$.timestamp.getTime()-T.timestamp.getTime());const y=g.filter(T=>{var $,M,R,E,O,A;if(n!=="all"&&T.type!==n)return!1;if(e){const N=e.toLowerCase();return T.description.toLowerCase().includes(N)||T.action.toLowerCase().includes(N)||T.type.toLowerCase().includes(N)||((M=($=T.details)==null?void 0:$.connectionName)==null?void 0:M.toLowerCase().includes(N))||((E=(R=T.details)==null?void 0:R.sourceConnection)==null?void 0:E.toLowerCase().includes(N))||((A=(O=T.details)==null?void 0:O.targetConnection)==null?void 0:A.toLowerCase().includes(N))}return!0}),b=[{field:"timestamp",headerName:"Time",width:170,renderCell:T=>s.jsx(J,{variant:"body2",sx:{fontSize:12},children:ZE(T.value)})},{field:"type",headerName:"Type",width:120,renderCell:T=>s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(Nk,{sx:{width:24,height:24,bgcolor:`${Ou(T.row.type,T.row.status)}20`,color:Ou(T.row.type,T.row.status)},children:eP(T.row.type,T.row.action)}),s.jsx(Ge,{label:T.value,size:"small",sx:{fontSize:10,height:20,textTransform:"capitalize",bgcolor:`${Ou(T.row.type,T.row.status)}15`,color:Ou(T.row.type,T.row.status)}})]})},{field:"description",headerName:"Description",flex:1,minWidth:300,renderCell:T=>s.jsx(Pt,{title:T.value,placement:"top-start",children:s.jsx(J,{variant:"body2",sx:{fontFamily:T.row.type==="query"?"monospace":"inherit",fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:T.value})})},{field:"connection",headerName:"Connection",width:150,valueGetter:(T,$)=>{var M,R,E;return(M=$.details)!=null&&M.connectionName?$.details.connectionName:(R=$.details)!=null&&R.sourceConnection&&((E=$.details)!=null&&E.targetConnection)?`${$.details.sourceConnection} → ${$.details.targetConnection}`:"-"},renderCell:T=>s.jsx(Pt,{title:T.value,children:s.jsx(J,{variant:"body2",sx:{fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:T.value})})},{field:"duration",headerName:"Duration",width:90,valueGetter:(T,$)=>{var M;return(M=$.details)==null?void 0:M.executionTimeMs},renderCell:T=>s.jsx(J,{variant:"body2",sx:{fontSize:12,color:T.value&&T.value>1e3?"warning.main":"text.secondary"},children:JE(T.value)})},{field:"rows",headerName:"Rows",width:80,valueGetter:(T,$)=>{var M;return(M=$.details)==null?void 0:M.rowCount},renderCell:T=>s.jsx(J,{variant:"body2",sx:{fontSize:12},children:T.value!==void 0?T.value.toLocaleString():"-"})},{field:"status",headerName:"Status",width:90,renderCell:T=>s.jsx(Ge,{label:T.value==="error"?"Error":"Success",size:"small",sx:{fontSize:10,height:20,bgcolor:T.value==="error"?"rgba(239, 68, 68, 0.1)":"rgba(34, 197, 94, 0.1)",color:T.value==="error"?"#ef4444":"#22c55e"}})},{field:"actions",headerName:"",width:60,sortable:!1,renderCell:T=>s.jsx(Pt,{title:"View Details",children:s.jsx(mt,{size:"small",onClick:()=>i(T.row),children:s.jsx(vh,{sx:{fontSize:16}})})})}];return s.jsxs(K,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[s.jsxs(K,{sx:{display:"flex",gap:2,mt:1,mb:2,flexWrap:"wrap",alignItems:"center"},children:[s.jsxs(_n,{size:"small",sx:{minWidth:150},children:[s.jsx(Hn,{children:"Type"}),s.jsxs(On,{value:n,onChange:T=>r(T.target.value),label:"Type",children:[s.jsx(it,{value:"all",children:"All Activity"}),s.jsx(it,{value:"query",children:"Queries"}),s.jsx(it,{value:"migration",children:"Migrations"}),s.jsx(it,{value:"sync",children:"Sync Operations"}),s.jsx(it,{value:"connection",children:"Connections"})]})]}),s.jsx(Wt,{size:"small",placeholder:"Search activity...",value:e,onChange:T=>t(T.target.value),sx:{minWidth:300},InputProps:{startAdornment:s.jsx(ds,{position:"start",children:s.jsx(Ud,{sx:{fontSize:18,color:"text.secondary"}})}),endAdornment:e&&s.jsx(ds,{position:"end",children:s.jsx(mt,{size:"small",onClick:()=>t(""),children:s.jsx(Aw,{sx:{fontSize:16}})})})}}),s.jsx(K,{sx:{flex:1}}),s.jsxs(J,{variant:"body2",color:"text.secondary",children:[y.length," activities"]})]}),s.jsx(K,{sx:{flex:1,minHeight:400},children:s.jsx(fi,{rows:y,columns:b,loading:p,pageSizeOptions:[25,50,100],initialState:{pagination:{paginationModel:{pageSize:25}},sorting:{sortModel:[{field:"timestamp",sort:"desc"}]}},disableRowSelectionOnClick:!0,sx:{border:"none","& .MuiDataGrid-cell":{fontSize:12,display:"flex",alignItems:"center"}}})}),s.jsxs(gn,{open:!!o,onClose:()=>i(null),maxWidth:"md",fullWidth:!0,children:[s.jsx(wn,{children:s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[o&&s.jsx(Nk,{sx:{width:32,height:32,bgcolor:`${Ou(o.type,o.status)}20`,color:Ou(o.type,o.status)},children:eP(o.type,o.action)}),s.jsxs(J,{variant:"h6",sx:{textTransform:"capitalize"},children:[o==null?void 0:o.type," Details"]})]})}),s.jsx(Cn,{children:o&&s.jsxs(K,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[s.jsxs(K,{sx:{display:"flex",gap:3,flexWrap:"wrap"},children:[s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:"Time"}),s.jsx(J,{variant:"body2",children:ZE(o.timestamp)})]}),((v=o.details)==null?void 0:v.connectionName)&&s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:"Connection"}),s.jsx(J,{variant:"body2",children:o.details.connectionName})]}),((C=o.details)==null?void 0:C.sourceConnection)&&s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:"Source"}),s.jsxs(J,{variant:"body2",children:[o.details.sourceConnection,o.details.sourceSchema&&`.${o.details.sourceSchema}`]})]}),((S=o.details)==null?void 0:S.targetConnection)&&s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:"Target"}),s.jsxs(J,{variant:"body2",children:[o.details.targetConnection,o.details.targetSchema&&`.${o.details.targetSchema}`]})]}),((j=o.details)==null?void 0:j.executionTimeMs)!==void 0&&s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:"Duration"}),s.jsx(J,{variant:"body2",children:JE(o.details.executionTimeMs)})]}),((w=o.details)==null?void 0:w.rowCount)!==void 0&&s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:"Rows"}),s.jsx(J,{variant:"body2",children:o.details.rowCount.toLocaleString()})]}),((k=o.details)==null?void 0:k.statementCount)!==void 0&&s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:"Statements"}),s.jsx(J,{variant:"body2",children:o.details.statementCount})]}),s.jsx(Ge,{label:o.status==="error"?"Error":"Success",size:"small",sx:{alignSelf:"center",bgcolor:o.status==="error"?"rgba(239, 68, 68, 0.1)":"rgba(34, 197, 94, 0.1)",color:o.status==="error"?"#ef4444":"#22c55e"}})]}),o.status==="error"&&((P=o.details)==null?void 0:P.error)&&s.jsxs(Nt,{severity:"error",sx:{"& .MuiAlert-message":{width:"100%"}},children:[s.jsx(J,{variant:"subtitle2",sx:{fontWeight:600,mb:1},children:"Error Details"}),s.jsx(K,{sx:{fontFamily:"monospace",fontSize:12,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:200,overflow:"auto",bgcolor:"rgba(0,0,0,0.1)",p:1.5,borderRadius:1},children:o.details.error})]}),s.jsxs(K,{children:[s.jsx(J,{variant:"caption",color:"text.secondary",children:o.type==="query"?"SQL Query":"Description"}),s.jsx(K,{sx:{p:2,bgcolor:"background.default",borderRadius:1,fontFamily:o.type==="query"?"monospace":"inherit",fontSize:13,whiteSpace:"pre-wrap",wordBreak:"break-all",maxHeight:300,overflow:"auto"},children:o.description})]})]})}),s.jsx(vn,{children:s.jsx(Le,{onClick:()=>i(null),children:"Close"})})]})]})}function e0({children:e,value:t,index:n}){return s.jsx(K,{role:"tabpanel",hidden:t!==n,sx:{flex:1,display:t===n?"flex":"none",flexDirection:"column",overflow:"hidden"},children:t===n&&e})}function aoe(){const[e,t]=m.useState(0);return s.jsxs(K,{sx:{p:3,height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsxs(K,{sx:{mb:3},children:[s.jsx(J,{variant:"h5",fontWeight:600,gutterBottom:!0,children:"Logs & History"}),s.jsx(J,{variant:"body2",color:"text.secondary",children:"Review query history, migrations, and system activity"})]}),s.jsxs(Un,{sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsxs(yl,{value:e,onChange:(n,r)=>t(r),sx:{borderBottom:1,borderColor:"divider",minHeight:48,"& .MuiTab-root":{minHeight:48,textTransform:"none"}},children:[s.jsx(Bn,{icon:s.jsx(vd,{sx:{fontSize:18}}),iconPosition:"start",label:"Query History"}),s.jsx(Bn,{icon:s.jsx(bd,{sx:{fontSize:18}}),iconPosition:"start",label:"Migrations"}),s.jsx(Bn,{icon:s.jsx(GU,{sx:{fontSize:18}}),iconPosition:"start",label:"Activity"})]}),s.jsxs(K,{sx:{flex:1,p:2,pt:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:[s.jsx(e0,{value:e,index:0,children:s.jsx(soe,{})}),s.jsx(e0,{value:e,index:1,children:s.jsx(ioe,{})}),s.jsx(e0,{value:e,index:2,children:s.jsx(loe,{})})]})]})]})}function kO({label:e,value:t,onChange:n,colors:r}){return s.jsxs(K,{children:[s.jsx(J,{variant:"caption",sx:{color:"text.secondary",mb:1,display:"block"},children:e}),s.jsx(Kx,{value:t,exclusive:!0,onChange:(o,i)=>i&&n(i),size:"small",sx:{gap:.5,flexWrap:"wrap"},children:Object.entries(r).map(([o,i])=>s.jsx(li,{value:i,title:o,sx:{width:24,height:24,borderRadius:.5,bgcolor:`rgba(${i}, 0.4)`,border:`1px solid rgba(${i}, 0.6)`,"&.Mui-selected":{bgcolor:`rgba(${i}, 0.6)`,border:`2px solid rgba(${i}, 1)`},"&:hover":{bgcolor:`rgba(${i}, 0.5)`}}},o))})]})}function coe(){const{mode:e,toggleMode:t}=BM();return s.jsx(cn,{children:s.jsxs(K,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s.jsxs(K,{children:[s.jsx(J,{variant:"h6",sx:{color:"text.primary",fontWeight:600},children:"Theme"}),s.jsx(J,{variant:"body2",sx:{color:"text.secondary",mt:.5},children:"Choose between light and dark mode"})]}),s.jsxs(Kx,{value:e,exclusive:!0,onChange:(n,r)=>r&&t(),size:"small",children:[s.jsxs(li,{value:"light",sx:{px:2,"&.Mui-selected":{bgcolor:"primary.main",color:"primary.contrastText","&:hover":{bgcolor:"primary.dark"}}},children:[s.jsx(FU,{sx:{mr:1,fontSize:18}}),"Light"]}),s.jsxs(li,{value:"dark",sx:{px:2,"&.Mui-selected":{bgcolor:"primary.main",color:"primary.contrastText","&:hover":{bgcolor:"primary.dark"}}},children:[s.jsx(EU,{sx:{mr:1,fontSize:18}}),"Dark"]})]})]})})}function uoe({tag:e,onUpdate:t,onDelete:n}){const[r,o]=m.useState(!1),[i,l]=m.useState(e.name),[c,u]=m.useState(e.color),f=()=>{i.trim()&&(t({name:i.trim(),color:c}),o(!1))},h=()=>{l(e.name),u(e.color),o(!1)};return r?s.jsxs(K,{sx:{display:"flex",alignItems:"flex-start",gap:2,py:2,borderBottom:1,borderColor:"divider"},children:[s.jsxs(K,{sx:{flex:1},children:[s.jsx(Wt,{size:"small",value:i,onChange:p=>l(p.target.value),placeholder:"Tag name",autoFocus:!0,sx:{mb:1.5},fullWidth:!0}),s.jsx(kO,{label:"Color",value:c,onChange:u,colors:up})]}),s.jsxs(K,{sx:{display:"flex",gap:.5,pt:.5},children:[s.jsx(mt,{size:"small",onClick:f,sx:{color:"success.main","&:hover":{bgcolor:"action.hover"}},children:s.jsx(vl,{fontSize:"small"})}),s.jsx(mt,{size:"small",onClick:h,sx:{color:"text.secondary","&:hover":{bgcolor:"action.hover"}},children:s.jsx(Gd,{fontSize:"small"})})]})]}):s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,borderBottom:1,borderColor:"divider"},children:[s.jsx(Ge,{label:e.name,size:"small",sx:{bgcolor:`rgba(${e.color}, 0.15)`,color:`rgb(${e.color})`,border:`1px solid rgba(${e.color}, 0.3)`,borderRadius:.5,fontWeight:500}}),s.jsx(K,{sx:{flex:1}}),s.jsx(mt,{size:"small",onClick:()=>o(!0),sx:{color:"text.secondary","&:hover":{color:"text.primary",bgcolor:"action.hover"}},children:s.jsx(Dr,{fontSize:"small"})}),s.jsx(mt,{size:"small",onClick:n,sx:{color:"text.secondary","&:hover":{color:"error.main",bgcolor:"action.hover"}},children:s.jsx(dr,{fontSize:"small"})})]})}function doe(){const{tags:e,addTag:t,updateTag:n,deleteTag:r,resetTags:o}=_w(),[i,l]=m.useState(!1),[c,u]=m.useState(""),[f,h]=m.useState(up.blue),p=()=>{c.trim()&&(t({name:c.trim(),color:f}),u(""),h(up.blue),l(!1))},g=()=>{u(""),h(up.blue),l(!1)};return s.jsxs(cn,{children:[s.jsxs(K,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:[s.jsx(J,{variant:"h6",sx:{color:"text.primary",fontWeight:600},children:"Connection Tags"}),s.jsxs(K,{sx:{display:"flex",gap:1},children:[s.jsx(Le,{size:"small",startIcon:s.jsx(HU,{}),onClick:o,sx:{color:"text.secondary",textTransform:"none","&:hover":{color:"text.primary",bgcolor:"action.hover"}},children:"Reset"}),!i&&s.jsx(Le,{size:"small",startIcon:s.jsx(Gn,{}),onClick:()=>l(!0),sx:{color:"success.main",textTransform:"none","&:hover":{bgcolor:"action.hover"}},children:"Add tag"})]})]}),s.jsx(J,{variant:"body2",sx:{color:"text.secondary",mb:3},children:"Tags help you organize and categorize your database connections."}),i&&s.jsxs(K,{sx:{display:"flex",alignItems:"flex-start",gap:2,py:2,mb:2,borderBottom:1,borderColor:"divider",bgcolor:y=>y.palette.mode==="dark"?"rgba(34, 197, 94, 0.05)":"rgba(34, 197, 94, 0.08)",mx:-2.5,px:2.5},children:[s.jsxs(K,{sx:{flex:1},children:[s.jsx(Wt,{size:"small",value:c,onChange:y=>u(y.target.value),placeholder:"New tag name",autoFocus:!0,onKeyDown:y=>{y.key==="Enter"&&p(),y.key==="Escape"&&g()},sx:{mb:1.5},fullWidth:!0}),s.jsx(kO,{label:"Color",value:f,onChange:h,colors:up})]}),s.jsxs(K,{sx:{display:"flex",gap:.5,pt:.5},children:[s.jsx(mt,{size:"small",onClick:p,disabled:!c.trim(),sx:{color:"success.main","&:hover":{bgcolor:"action.hover"}},children:s.jsx(vl,{fontSize:"small"})}),s.jsx(mt,{size:"small",onClick:g,sx:{color:"text.secondary","&:hover":{bgcolor:"action.hover"}},children:s.jsx(Gd,{fontSize:"small"})})]})]}),e.length===0?s.jsx(K,{sx:{py:4,textAlign:"center"},children:s.jsx(J,{variant:"body2",sx:{color:"text.secondary"},children:"No tags yet. Add your first tag to get started."})}):s.jsx(K,{children:e.map(y=>s.jsx(uoe,{tag:y,onUpdate:b=>n(y.id,b),onDelete:()=>r(y.id)},y.id))}),s.jsxs(K,{sx:{mt:4,pt:3,borderTop:"1px solid rgba(255,255,255,0.1)"},children:[s.jsx(J,{variant:"subtitle2",sx:{color:"rgba(255,255,255,0.5)",mb:2},children:"Preview"}),s.jsx(K,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:e.map(y=>s.jsx(Ge,{label:y.name,size:"small",sx:{bgcolor:`rgba(${y.color}, 0.15)`,color:`rgb(${y.color})`,border:`1px solid rgba(${y.color}, 0.3)`,borderRadius:.5,fontWeight:500}},y.id))})]})]})}function foe(){return s.jsxs(s.Fragment,{children:[s.jsxs(cn,{sx:{mb:3},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:3},children:[s.jsx(DU,{sx:{color:"primary.main"}}),s.jsx(J,{variant:"h6",sx:{color:"text.primary",fontWeight:600},children:"About DB Nexus"})]}),s.jsx(J,{variant:"body2",sx:{color:"text.secondary",mb:2},children:"DB Nexus is a powerful database management tool that helps you manage multiple database connections, compare schemas, synchronize data, and visualize database structures across PostgreSQL, MySQL, MariaDB, and SQLite databases."}),s.jsx(J,{variant:"body2",sx:{color:"text.secondary",mb:3},children:"Built with modern technologies including React, TypeScript, NestJS, and Material-UI, DB Nexus provides a seamless experience for database administrators and developers."}),s.jsxs(J,{variant:"caption",sx:{color:"text.disabled"},children:["Version ","0.1.0"]})]}),s.jsxs(cn,{sx:{mb:3},children:[s.jsx(J,{variant:"h6",sx:{color:"text.primary",fontWeight:600,mb:2},children:"Contact & Support"}),s.jsx(J,{variant:"body2",sx:{color:"text.secondary",mb:2},children:"For questions, feedback, or support:"}),s.jsx(Le,{variant:"outlined",startIcon:s.jsx(MU,{}),href:"mailto:admin@dbnexus.dev",sx:{textTransform:"none",borderColor:"divider",color:"text.primary","&:hover":{borderColor:"primary.main",bgcolor:"action.hover"}},children:"admin@dbnexus.dev"})]}),s.jsxs(cn,{sx:{mb:3},children:[s.jsx(J,{variant:"h6",sx:{color:"text.primary",fontWeight:600,mb:2},children:"Resources"}),s.jsxs(K,{sx:{display:"flex",gap:2,flexWrap:"wrap"},children:[s.jsx(Le,{variant:"outlined",href:"https://github.com/akademskig/dbnexus",target:"_blank",rel:"noopener noreferrer",sx:{textTransform:"none","&:hover":{bgcolor:"action.hover"}},children:"⭐ Star on GitHub"}),s.jsx(Le,{variant:"outlined",href:"https://docs.dbnexus.dev",target:"_blank",rel:"noopener noreferrer",sx:{textTransform:"none","&:hover":{bgcolor:"action.hover"}},children:"Documentation"}),s.jsx(Le,{variant:"outlined",href:"https://github.com/akademskig/dbnexus/issues",target:"_blank",rel:"noopener noreferrer",sx:{textTransform:"none","&:hover":{bgcolor:"action.hover"}},children:"Report Issue"})]})]}),s.jsxs(cn,{children:[s.jsx(J,{variant:"h6",sx:{color:"text.primary",fontWeight:600,mb:2},children:"License & Credits"}),s.jsx(J,{variant:"body2",sx:{color:"text.secondary",mb:2},children:"DB Nexus is open source software."}),s.jsxs(J,{variant:"caption",sx:{color:"text.disabled"},children:["© ",new Date().getFullYear()," DB Nexus. All rights reserved."]})]})]})}function poe(){const e=$v.filter(o=>o.category==="query"),t=$v.filter(o=>o.category==="navigation"),n=$v.filter(o=>o.category==="general"),r=({title:o,shortcuts:i})=>s.jsxs(K,{sx:{mb:4},children:[s.jsx(J,{variant:"subtitle2",sx:{color:"text.secondary",mb:1.5,textTransform:"uppercase",fontSize:11,letterSpacing:"0.05em"},children:o}),s.jsx(Sa,{children:s.jsxs(Ca,{size:"small",children:[s.jsx(ja,{children:s.jsxs(Ur,{children:[s.jsx(lt,{sx:{fontWeight:600,width:150},children:"Shortcut"}),s.jsx(lt,{sx:{fontWeight:600},children:"Action"})]})}),s.jsx(wa,{children:i.map((l,c)=>s.jsxs(Ur,{sx:{"&:last-child td":{borderBottom:0}},children:[s.jsx(lt,{children:s.jsx(K,{sx:{display:"inline-flex",gap:.5,fontFamily:"monospace",fontSize:12},children:pU(l).split("+").map((u,f)=>s.jsx(K,{component:"kbd",sx:{px:1,py:.25,bgcolor:"action.hover",border:1,borderColor:"divider",borderRadius:.5,fontSize:11,fontWeight:600,minWidth:24,textAlign:"center"},children:u},f))})}),s.jsx(lt,{children:s.jsx(J,{variant:"body2",children:l.description})})]},c))})]})})]});return s.jsxs(cn,{children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:3},children:[s.jsx(AU,{sx:{color:"primary.main"}}),s.jsx(J,{variant:"h6",sx:{color:"text.primary",fontWeight:600},children:"Keyboard Shortcuts"})]}),s.jsx(J,{variant:"body2",sx:{color:"text.secondary",mb:4},children:"Use these keyboard shortcuts to navigate and work faster. On Mac, use ⌘ (Command) instead of Ctrl."}),s.jsx(r,{title:"Query Editor",shortcuts:e}),s.jsx(r,{title:"Navigation",shortcuts:t}),s.jsx(r,{title:"General",shortcuts:n})]})}function hoe(){const[e,t]=kx(),[n,r]=m.useState(0);m.useEffect(()=>{const i=e.get("tab");i==="appearance"?r(0):i==="tags"?r(1):i==="shortcuts"?r(2):i==="about"&&r(3)},[e]);const o=(i,l)=>{r(l);const u=["appearance","tags","shortcuts","about"][l];u&&t({tab:u})};return s.jsx(K,{sx:{p:4,maxWidth:1400,mx:"auto"},children:s.jsxs(K,{sx:{maxWidth:800,mx:"auto"},children:[s.jsxs(K,{sx:{mb:4},children:[s.jsx(J,{variant:"h4",sx:{fontWeight:600,color:"text.primary",letterSpacing:"-0.02em",mb:1},children:"Settings"}),s.jsx(J,{variant:"body2",sx:{color:"text.secondary"},children:"Customize the appearance and manage tags"})]}),s.jsxs(yl,{value:n,onChange:o,sx:{"& .MuiTabs-indicator":{bgcolor:"primary.main"},"& .MuiTab-root":{color:"text.secondary",textTransform:"none",fontWeight:500,"&.Mui-selected":{color:"primary.main"}}},children:[s.jsx(Bn,{label:"Appearance"}),s.jsx(Bn,{label:"Tags"}),s.jsx(Bn,{label:"Keyboard Shortcuts"}),s.jsx(Bn,{label:"About"})]}),n===0&&s.jsx(coe,{}),n===1&&s.jsx(doe,{}),n===2&&s.jsx(poe,{}),n===3&&s.jsx(foe,{})]})})}function moe({icon:e,title:t,description:n}){const r=Xr();return s.jsxs(Un,{elevation:0,sx:{p:3,height:"100%",bgcolor:Ye(r.palette.primary.main,.05),border:"1px solid",borderColor:Ye(r.palette.primary.main,.1),borderRadius:2,transition:"all 0.2s ease","&:hover":{transform:"translateY(-4px)",borderColor:Ye(r.palette.primary.main,.3),boxShadow:`0 8px 24px ${Ye(r.palette.primary.main,.15)}`}},children:[s.jsx(K,{sx:{width:48,height:48,borderRadius:2,bgcolor:Ye(r.palette.primary.main,.1),display:"flex",alignItems:"center",justifyContent:"center",mb:2,color:"primary.main"},children:e}),s.jsx(J,{variant:"h6",fontWeight:600,gutterBottom:!0,children:t}),s.jsx(J,{variant:"body2",color:"text.secondary",children:n})]})}const goe=[{icon:s.jsx(Cr,{}),title:"Multi-Database Support",description:"Connect to PostgreSQL, MySQL, MariaDB, and SQLite databases. Manage all your databases from a single interface."},{icon:s.jsx(bd,{}),title:"Schema Comparison",description:"Compare schemas between databases and generate migration scripts automatically. Keep environments in sync."},{icon:s.jsx(fs,{}),title:"Data Synchronization",description:"Sync data between database instances with conflict resolution. Perfect for dev/staging/prod workflows."},{icon:s.jsx(Fc,{}),title:"Powerful Query Editor",description:"Write and execute SQL with syntax highlighting, autocomplete, and query history. Export results to CSV or JSON."},{icon:s.jsx(Yg,{}),title:"Fast & Local",description:"Runs entirely on your machine. No cloud required, no data leaves your computer. Lightning fast performance."},{icon:s.jsx(WU,{}),title:"Secure by Design",description:"Your credentials stay local. Connections are encrypted. No telemetry, no tracking, no accounts required."}],xoe=[{name:"PostgreSQL",color:"#336791"},{name:"MySQL",color:"#4479A1"},{name:"MariaDB",color:"#003545"},{name:"SQLite",color:"#003B57"}];function yoe(){const e=Xr(),t=Ko();return s.jsxs(K,{sx:{minHeight:"100vh",bgcolor:"background.default"},children:[s.jsx(K,{sx:{position:"relative",overflow:"hidden",pt:{xs:8,md:12},pb:{xs:10,md:16},"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,background:`radial-gradient(ellipse at 50% 0%, ${Ye(e.palette.primary.main,.15)} 0%, transparent 70%)`,pointerEvents:"none"}},children:s.jsx(Bf,{maxWidth:"lg",children:s.jsxs(K,{sx:{textAlign:"center",position:"relative",zIndex:1},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:2,mb:4},children:[s.jsx(K,{component:"img",src:e.palette.mode==="dark"?"/logo-dark.svg":"/logo-light.svg",alt:"DB Nexus",sx:{width:72,height:72}}),s.jsxs(J,{variant:"h3",sx:{fontFamily:'"JetBrains Mono", monospace',fontWeight:700,letterSpacing:"-0.02em"},children:[s.jsx(K,{component:"span",sx:{bgcolor:"primary.main",color:"primary.contrastText",px:1,py:.5,borderRadius:1,mr:.5},children:"DB"}),"Nexus"]})]}),s.jsxs(J,{variant:"h4",sx:{fontWeight:600,mb:2,maxWidth:700,mx:"auto",lineHeight:1.3},children:["The Modern Database Manager",s.jsx("br",{}),s.jsx(K,{component:"span",sx:{color:"primary.main"},children:"for Developers"})]}),s.jsx(J,{variant:"h6",color:"text.secondary",sx:{mb:4,maxWidth:600,mx:"auto",fontWeight:400},children:"Connect, query, compare, and sync your databases. All from a beautiful, local-first interface. No cloud required."}),s.jsxs(K,{sx:{display:"flex",gap:2,justifyContent:"center",mb:6},children:[s.jsx(Le,{variant:"contained",size:"large",startIcon:s.jsx(Sp,{}),sx:{px:4,py:1.5,fontSize:16,fontWeight:600,textTransform:"none",borderRadius:2},onClick:()=>t("/dashboard"),children:"Get Started"}),s.jsx(Le,{variant:"outlined",size:"large",startIcon:s.jsx(zU,{}),sx:{px:4,py:1.5,fontSize:16,fontWeight:600,textTransform:"none",borderRadius:2},href:"https://github.com/akademskig/dbnexus",target:"_blank",children:"View on GitHub"})]}),s.jsx(K,{sx:{display:"flex",gap:1.5,justifyContent:"center",flexWrap:"wrap"},children:xoe.map(n=>s.jsx(K,{sx:{px:2,py:.75,borderRadius:1,bgcolor:Ye(n.color,.1),border:"1px solid",borderColor:Ye(n.color,.2)},children:s.jsx(J,{variant:"body2",sx:{fontWeight:500,color:n.color},children:n.name})},n.name))})]})})}),s.jsxs(Bf,{maxWidth:"lg",sx:{py:{xs:8,md:12}},children:[s.jsxs(K,{sx:{textAlign:"center",mb:6},children:[s.jsx(J,{variant:"h4",fontWeight:600,gutterBottom:!0,children:"Everything you need to manage databases"}),s.jsx(J,{variant:"body1",color:"text.secondary",sx:{maxWidth:600,mx:"auto"},children:"A complete toolkit for database development, from schema design to data synchronization."})]}),s.jsx(Xs,{container:!0,spacing:3,children:goe.map(n=>s.jsx(Xs,{item:!0,xs:12,sm:6,md:4,children:s.jsx(moe,{...n})},n.title))})]}),s.jsx(K,{sx:{bgcolor:Ye(e.palette.primary.main,.03),py:{xs:8,md:12}},children:s.jsxs(Bf,{maxWidth:"lg",children:[s.jsxs(K,{sx:{textAlign:"center",mb:6},children:[s.jsx(J,{variant:"h4",fontWeight:600,gutterBottom:!0,children:"Beautiful, intuitive interface"}),s.jsx(J,{variant:"body1",color:"text.secondary",children:"Designed for productivity with dark and light themes."})]}),s.jsx(Un,{elevation:0,sx:{p:1,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",overflow:"hidden"},children:s.jsx(K,{sx:{height:400,borderRadius:2,bgcolor:"background.default",display:"flex",alignItems:"center",justifyContent:"center"},children:s.jsx(J,{color:"text.secondary",children:"[Screenshot placeholder - Add actual app screenshot here]"})})})]})}),s.jsx(Bf,{maxWidth:"md",sx:{py:{xs:8,md:12}},children:s.jsxs(Un,{elevation:0,sx:{p:{xs:4,md:6},textAlign:"center",borderRadius:3,background:`linear-gradient(135deg, ${Ye(e.palette.primary.main,.1)} 0%, ${Ye(e.palette.primary.dark,.1)} 100%)`,border:"1px solid",borderColor:Ye(e.palette.primary.main,.2)},children:[s.jsx(J,{variant:"h4",fontWeight:600,gutterBottom:!0,children:"Ready to get started?"}),s.jsx(J,{variant:"body1",color:"text.secondary",sx:{mb:4},children:"Download DB Nexus for free and take control of your databases."}),s.jsx(Le,{variant:"contained",size:"large",startIcon:s.jsx(Sp,{}),sx:{px:4,py:1.5,fontSize:16,fontWeight:600,textTransform:"none",borderRadius:2},onClick:()=>t("/dashboard"),children:"Launch DB Nexus"})]})}),s.jsx(K,{sx:{borderTop:"1px solid",borderColor:"divider",py:4},children:s.jsx(Bf,{maxWidth:"lg",children:s.jsxs(K,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:2},children:[s.jsx(J,{variant:"body2",color:"text.secondary",children:"© 2026 DB Nexus. Open source under MIT license."}),s.jsxs(K,{sx:{display:"flex",gap:3},children:[s.jsx(J,{variant:"body2",component:"a",href:"https://github.com/akademskig/dbnexus",target:"_blank",sx:{color:"text.secondary",textDecoration:"none","&:hover":{color:"primary.main"}},children:"GitHub"}),s.jsx(J,{variant:"body2",component:"a",href:"#",sx:{color:"text.secondary",textDecoration:"none","&:hover":{color:"primary.main"}},children:"Documentation"}),s.jsx(J,{variant:"body2",component:"a",href:"#",sx:{color:"text.secondary",textDecoration:"none","&:hover":{color:"primary.main"}},children:"Releases"})]})]})})})]})}function Mr(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Mr(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var boe={value:()=>{}};function cy(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new zg(n)}function zg(e){this._=e}function voe(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}zg.prototype=cy.prototype={constructor:zg,on:function(e,t){var n=this._,r=voe(e+"",n),o,i=-1,l=r.length;if(arguments.length<2){for(;++i<l;)if((o=(e=r[i]).type)&&(o=Coe(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<l;)if(o=(e=r[i]).type)n[o]=tP(n[o],e.name,t);else if(t==null)for(o in n)n[o]=tP(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new zg(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function Coe(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function tP(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=boe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var vC="http://www.w3.org/1999/xhtml";const nP={svg:"http://www.w3.org/2000/svg",xhtml:vC,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function uy(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),nP.hasOwnProperty(t)?{space:nP[t],local:e}:e}function woe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===vC&&t.documentElement.namespaceURI===vC?t.createElement(e):t.createElementNS(n,e)}}function Soe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function IO(e){var t=uy(e);return(t.local?Soe:woe)(t)}function joe(){}function pS(e){return e==null?joe:function(){return this.querySelector(e)}}function koe(e){typeof e!="function"&&(e=pS(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],l=i.length,c=r[o]=new Array(l),u,f,h=0;h<l;++h)(u=i[h])&&(f=e.call(u,u.__data__,h,i))&&("__data__"in u&&(f.__data__=u.__data__),c[h]=f);return new ps(r,this._parents)}function Ioe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Eoe(){return[]}function EO(e){return e==null?Eoe:function(){return this.querySelectorAll(e)}}function Poe(e){return function(){return Ioe(e.apply(this,arguments))}}function Toe(e){typeof e=="function"?e=Poe(e):e=EO(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var l=t[i],c=l.length,u,f=0;f<c;++f)(u=l[f])&&(r.push(e.call(u,u.__data__,f,l)),o.push(u));return new ps(r,o)}function PO(e){return function(){return this.matches(e)}}function TO(e){return function(t){return t.matches(e)}}var Moe=Array.prototype.find;function Roe(e){return function(){return Moe.call(this.children,e)}}function $oe(){return this.firstElementChild}function Ooe(e){return this.select(e==null?$oe:Roe(typeof e=="function"?e:TO(e)))}var zoe=Array.prototype.filter;function Loe(){return Array.from(this.children)}function Doe(e){return function(){return zoe.call(this.children,e)}}function Aoe(e){return this.selectAll(e==null?Loe:Doe(typeof e=="function"?e:TO(e)))}function Foe(e){typeof e!="function"&&(e=PO(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],l=i.length,c=r[o]=[],u,f=0;f<l;++f)(u=i[f])&&e.call(u,u.__data__,f,i)&&c.push(u);return new ps(r,this._parents)}function MO(e){return new Array(e.length)}function Noe(){return new ps(this._enter||this._groups.map(MO),this._parents)}function fx(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}fx.prototype={constructor:fx,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 _oe(e){return function(){return e}}function Hoe(e,t,n,r,o,i){for(var l=0,c,u=t.length,f=i.length;l<f;++l)(c=t[l])?(c.__data__=i[l],r[l]=c):n[l]=new fx(e,i[l]);for(;l<u;++l)(c=t[l])&&(o[l]=c)}function Boe(e,t,n,r,o,i,l){var c,u,f=new Map,h=t.length,p=i.length,g=new Array(h),y;for(c=0;c<h;++c)(u=t[c])&&(g[c]=y=l.call(u,u.__data__,c,t)+"",f.has(y)?o[c]=u:f.set(y,u));for(c=0;c<p;++c)y=l.call(e,i[c],c,i)+"",(u=f.get(y))?(r[c]=u,u.__data__=i[c],f.delete(y)):n[c]=new fx(e,i[c]);for(c=0;c<h;++c)(u=t[c])&&f.get(g[c])===u&&(o[c]=u)}function Woe(e){return e.__data__}function Voe(e,t){if(!arguments.length)return Array.from(this,Woe);var n=t?Boe:Hoe,r=this._parents,o=this._groups;typeof e!="function"&&(e=_oe(e));for(var i=o.length,l=new Array(i),c=new Array(i),u=new Array(i),f=0;f<i;++f){var h=r[f],p=o[f],g=p.length,y=Goe(e.call(h,h&&h.__data__,f,r)),b=y.length,v=c[f]=new Array(b),C=l[f]=new Array(b),S=u[f]=new Array(g);n(h,p,v,C,S,y,t);for(var j=0,w=0,k,P;j<b;++j)if(k=v[j]){for(j>=w&&(w=j+1);!(P=C[w])&&++w<b;);k._next=P||null}}return l=new ps(l,r),l._enter=c,l._exit=u,l}function Goe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Uoe(){return new ps(this._exit||this._groups.map(MO),this._parents)}function qoe(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function Koe(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,l=Math.min(o,i),c=new Array(o),u=0;u<l;++u)for(var f=n[u],h=r[u],p=f.length,g=c[u]=new Array(p),y,b=0;b<p;++b)(y=f[b]||h[b])&&(g[b]=y);for(;u<o;++u)c[u]=n[u];return new ps(c,this._parents)}function Qoe(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],l;--o>=0;)(l=r[o])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function Yoe(e){e||(e=Xoe);function t(p,g){return p&&g?e(p.__data__,g.__data__):!p-!g}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var l=n[i],c=l.length,u=o[i]=new Array(c),f,h=0;h<c;++h)(f=l[h])&&(u[h]=f);u.sort(t)}return new ps(o,this._parents).order()}function Xoe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Zoe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Joe(){return Array.from(this)}function ese(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var l=r[o];if(l)return l}return null}function tse(){let e=0;for(const t of this)++e;return e}function nse(){return!this.node()}function rse(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,l=o.length,c;i<l;++i)(c=o[i])&&e.call(c,c.__data__,i,o);return this}function ose(e){return function(){this.removeAttribute(e)}}function sse(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ise(e,t){return function(){this.setAttribute(e,t)}}function lse(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ase(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function cse(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function use(e,t){var n=uy(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?sse:ose:typeof t=="function"?n.local?cse:ase:n.local?lse:ise)(n,t))}function RO(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function dse(e){return function(){this.style.removeProperty(e)}}function fse(e,t,n){return function(){this.style.setProperty(e,t,n)}}function pse(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function hse(e,t,n){return arguments.length>1?this.each((t==null?dse:typeof t=="function"?pse:fse)(e,t,n??"")):Id(this.node(),e)}function Id(e,t){return e.style.getPropertyValue(t)||RO(e).getComputedStyle(e,null).getPropertyValue(t)}function mse(e){return function(){delete this[e]}}function gse(e,t){return function(){this[e]=t}}function xse(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function yse(e,t){return arguments.length>1?this.each((t==null?mse:typeof t=="function"?xse:gse)(e,t)):this.node()[e]}function $O(e){return e.trim().split(/^|\s+/)}function hS(e){return e.classList||new OO(e)}function OO(e){this._node=e,this._names=$O(e.getAttribute("class")||"")}OO.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 zO(e,t){for(var n=hS(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function LO(e,t){for(var n=hS(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function bse(e){return function(){zO(this,e)}}function vse(e){return function(){LO(this,e)}}function Cse(e,t){return function(){(t.apply(this,arguments)?zO:LO)(this,e)}}function wse(e,t){var n=$O(e+"");if(arguments.length<2){for(var r=hS(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?Cse:t?bse:vse)(n,t))}function Sse(){this.textContent=""}function jse(e){return function(){this.textContent=e}}function kse(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Ise(e){return arguments.length?this.each(e==null?Sse:(typeof e=="function"?kse:jse)(e)):this.node().textContent}function Ese(){this.innerHTML=""}function Pse(e){return function(){this.innerHTML=e}}function Tse(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Mse(e){return arguments.length?this.each(e==null?Ese:(typeof e=="function"?Tse:Pse)(e)):this.node().innerHTML}function Rse(){this.nextSibling&&this.parentNode.appendChild(this)}function $se(){return this.each(Rse)}function Ose(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function zse(){return this.each(Ose)}function Lse(e){var t=typeof e=="function"?e:IO(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Dse(){return null}function Ase(e,t){var n=typeof e=="function"?e:IO(e),r=t==null?Dse:typeof t=="function"?t:pS(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Fse(){var e=this.parentNode;e&&e.removeChild(this)}function Nse(){return this.each(Fse)}function _se(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Hse(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Bse(e){return this.select(e?Hse:_se)}function Wse(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Vse(e){return function(t){e.call(this,t,this.__data__)}}function Gse(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Use(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function qse(e,t,n){return function(){var r=this.__on,o,i=Vse(t);if(r){for(var l=0,c=r.length;l<c;++l)if((o=r[l]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function Kse(e,t,n){var r=Gse(e+""),o,i=r.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var u=0,f=c.length,h;u<f;++u)for(o=0,h=c[u];o<i;++o)if((l=r[o]).type===h.type&&l.name===h.name)return h.value}return}for(c=t?qse:Use,o=0;o<i;++o)this.each(c(r[o],t,n));return this}function DO(e,t,n){var r=RO(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function Qse(e,t){return function(){return DO(this,e,t)}}function Yse(e,t){return function(){return DO(this,e,t.apply(this,arguments))}}function Xse(e,t){return this.each((typeof t=="function"?Yse:Qse)(e,t))}function*Zse(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,l;o<i;++o)(l=r[o])&&(yield l)}var AO=[null];function ps(e,t){this._groups=e,this._parents=t}function Rh(){return new ps([[document.documentElement]],AO)}function Jse(){return this}ps.prototype=Rh.prototype={constructor:ps,select:koe,selectAll:Toe,selectChild:Ooe,selectChildren:Aoe,filter:Foe,data:Voe,enter:Noe,exit:Uoe,join:qoe,merge:Koe,selection:Jse,order:Qoe,sort:Yoe,call:Zoe,nodes:Joe,node:ese,size:tse,empty:nse,each:rse,attr:use,style:hse,property:yse,classed:wse,text:Ise,html:Mse,raise:$se,lower:zse,append:Lse,insert:Ase,remove:Nse,clone:Bse,datum:Wse,on:Kse,dispatch:Xse,[Symbol.iterator]:Zse};function is(e){return typeof e=="string"?new ps([[document.querySelector(e)]],[document.documentElement]):new ps([[e]],AO)}function eie(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ni(e,t){if(e=eie(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const tie={passive:!1},Up={capture:!0,passive:!1};function t0(e){e.stopImmediatePropagation()}function Zu(e){e.preventDefault(),e.stopImmediatePropagation()}function FO(e){var t=e.document.documentElement,n=is(e).on("dragstart.drag",Zu,Up);"onselectstart"in t?n.on("selectstart.drag",Zu,Up):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function NO(e,t){var n=e.document.documentElement,r=is(e).on("dragstart.drag",null);t&&(r.on("click.drag",Zu,Up),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const dg=e=>()=>e;function CC(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:l,y:c,dx:u,dy:f,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:h}})}CC.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function nie(e){return!e.ctrlKey&&!e.button}function rie(){return this.parentNode}function oie(e,t){return t??{x:e.x,y:e.y}}function sie(){return navigator.maxTouchPoints||"ontouchstart"in this}function _O(){var e=nie,t=rie,n=oie,r=sie,o={},i=cy("start","drag","end"),l=0,c,u,f,h,p=0;function g(k){k.on("mousedown.drag",y).filter(r).on("touchstart.drag",C).on("touchmove.drag",S,tie).on("touchend.drag touchcancel.drag",j).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(k,P){if(!(h||!e.call(this,k,P))){var T=w(this,t.call(this,k,P),k,P,"mouse");T&&(is(k.view).on("mousemove.drag",b,Up).on("mouseup.drag",v,Up),FO(k.view),t0(k),f=!1,c=k.clientX,u=k.clientY,T("start",k))}}function b(k){if(Zu(k),!f){var P=k.clientX-c,T=k.clientY-u;f=P*P+T*T>p}o.mouse("drag",k)}function v(k){is(k.view).on("mousemove.drag mouseup.drag",null),NO(k.view,f),Zu(k),o.mouse("end",k)}function C(k,P){if(e.call(this,k,P)){var T=k.changedTouches,$=t.call(this,k,P),M=T.length,R,E;for(R=0;R<M;++R)(E=w(this,$,k,P,T[R].identifier,T[R]))&&(t0(k),E("start",k,T[R]))}}function S(k){var P=k.changedTouches,T=P.length,$,M;for($=0;$<T;++$)(M=o[P[$].identifier])&&(Zu(k),M("drag",k,P[$]))}function j(k){var P=k.changedTouches,T=P.length,$,M;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),$=0;$<T;++$)(M=o[P[$].identifier])&&(t0(k),M("end",k,P[$]))}function w(k,P,T,$,M,R){var E=i.copy(),O=ni(R||T,P),A,N,F;if((F=n.call(k,new CC("beforestart",{sourceEvent:T,target:g,identifier:M,active:l,x:O[0],y:O[1],dx:0,dy:0,dispatch:E}),$))!=null)return A=F.x-O[0]||0,N=F.y-O[1]||0,function L(D,H,B){var V=O,G;switch(D){case"start":o[M]=L,G=l++;break;case"end":delete o[M],--l;case"drag":O=ni(B||H,P),G=l;break}E.call(D,k,new CC(D,{sourceEvent:H,subject:F,target:g,identifier:M,active:G,x:O[0]+A,y:O[1]+N,dx:O[0]-V[0],dy:O[1]-V[1],dispatch:E}),$)}}return g.filter=function(k){return arguments.length?(e=typeof k=="function"?k:dg(!!k),g):e},g.container=function(k){return arguments.length?(t=typeof k=="function"?k:dg(k),g):t},g.subject=function(k){return arguments.length?(n=typeof k=="function"?k:dg(k),g):n},g.touchable=function(k){return arguments.length?(r=typeof k=="function"?k:dg(!!k),g):r},g.on=function(){var k=i.on.apply(i,arguments);return k===i?g:k},g.clickDistance=function(k){return arguments.length?(p=(k=+k)*k,g):Math.sqrt(p)},g}function mS(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function HO(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function $h(){}var qp=.7,px=1/qp,Ju="\\s*([+-]?\\d+)\\s*",Kp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",zi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",iie=/^#([0-9a-f]{3,8})$/,lie=new RegExp(`^rgb\\(${Ju},${Ju},${Ju}\\)$`),aie=new RegExp(`^rgb\\(${zi},${zi},${zi}\\)$`),cie=new RegExp(`^rgba\\(${Ju},${Ju},${Ju},${Kp}\\)$`),uie=new RegExp(`^rgba\\(${zi},${zi},${zi},${Kp}\\)$`),die=new RegExp(`^hsl\\(${Kp},${zi},${zi}\\)$`),fie=new RegExp(`^hsla\\(${Kp},${zi},${zi},${Kp}\\)$`),rP={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};mS($h,Bc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:oP,formatHex:oP,formatHex8:pie,formatHsl:hie,formatRgb:sP,toString:sP});function oP(){return this.rgb().formatHex()}function pie(){return this.rgb().formatHex8()}function hie(){return BO(this).formatHsl()}function sP(){return this.rgb().formatRgb()}function Bc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=iie.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?iP(t):n===3?new Bo(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?fg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?fg(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=lie.exec(e))?new Bo(t[1],t[2],t[3],1):(t=aie.exec(e))?new Bo(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cie.exec(e))?fg(t[1],t[2],t[3],t[4]):(t=uie.exec(e))?fg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=die.exec(e))?cP(t[1],t[2]/100,t[3]/100,1):(t=fie.exec(e))?cP(t[1],t[2]/100,t[3]/100,t[4]):rP.hasOwnProperty(e)?iP(rP[e]):e==="transparent"?new Bo(NaN,NaN,NaN,0):null}function iP(e){return new Bo(e>>16&255,e>>8&255,e&255,1)}function fg(e,t,n,r){return r<=0&&(e=t=n=NaN),new Bo(e,t,n,r)}function mie(e){return e instanceof $h||(e=Bc(e)),e?(e=e.rgb(),new Bo(e.r,e.g,e.b,e.opacity)):new Bo}function wC(e,t,n,r){return arguments.length===1?mie(e):new Bo(e,t,n,r??1)}function Bo(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}mS(Bo,wC,HO($h,{brighter(e){return e=e==null?px:Math.pow(px,e),new Bo(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?qp:Math.pow(qp,e),new Bo(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Bo(Pc(this.r),Pc(this.g),Pc(this.b),hx(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:lP,formatHex:lP,formatHex8:gie,formatRgb:aP,toString:aP}));function lP(){return`#${mc(this.r)}${mc(this.g)}${mc(this.b)}`}function gie(){return`#${mc(this.r)}${mc(this.g)}${mc(this.b)}${mc((isNaN(this.opacity)?1:this.opacity)*255)}`}function aP(){const e=hx(this.opacity);return`${e===1?"rgb(":"rgba("}${Pc(this.r)}, ${Pc(this.g)}, ${Pc(this.b)}${e===1?")":`, ${e})`}`}function hx(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function mc(e){return e=Pc(e),(e<16?"0":"")+e.toString(16)}function cP(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ii(e,t,n,r)}function BO(e){if(e instanceof ii)return new ii(e.h,e.s,e.l,e.opacity);if(e instanceof $h||(e=Bc(e)),!e)return new ii;if(e instanceof ii)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),l=NaN,c=i-o,u=(i+o)/2;return c?(t===i?l=(n-r)/c+(n<r)*6:n===i?l=(r-t)/c+2:l=(t-n)/c+4,c/=u<.5?i+o:2-i-o,l*=60):c=u>0&&u<1?0:l,new ii(l,c,u,e.opacity)}function xie(e,t,n,r){return arguments.length===1?BO(e):new ii(e,t,n,r??1)}function ii(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}mS(ii,xie,HO($h,{brighter(e){return e=e==null?px:Math.pow(px,e),new ii(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?qp:Math.pow(qp,e),new ii(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Bo(n0(e>=240?e-240:e+120,o,r),n0(e,o,r),n0(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new ii(uP(this.h),pg(this.s),pg(this.l),hx(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=hx(this.opacity);return`${e===1?"hsl(":"hsla("}${uP(this.h)}, ${pg(this.s)*100}%, ${pg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function uP(e){return e=(e||0)%360,e<0?e+360:e}function pg(e){return Math.max(0,Math.min(1,e||0))}function n0(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const gS=e=>()=>e;function yie(e,t){return function(n){return e+n*t}}function bie(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function vie(e){return(e=+e)==1?WO:function(t,n){return n-t?bie(t,n,e):gS(isNaN(t)?n:t)}}function WO(e,t){var n=t-e;return n?yie(e,n):gS(isNaN(e)?t:e)}const mx=(function e(t){var n=vie(t);function r(o,i){var l=n((o=wC(o)).r,(i=wC(i)).r),c=n(o.g,i.g),u=n(o.b,i.b),f=WO(o.opacity,i.opacity);return function(h){return o.r=l(h),o.g=c(h),o.b=u(h),o.opacity=f(h),o+""}}return r.gamma=e,r})(1);function Cie(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=e[o]*(1-i)+t[o]*i;return r}}function wie(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Sie(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),i=new Array(n),l;for(l=0;l<r;++l)o[l]=Ip(e[l],t[l]);for(;l<n;++l)i[l]=t[l];return function(c){for(l=0;l<r;++l)i[l]=o[l](c);return i}}function jie(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ei(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function kie(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=Ip(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var SC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,r0=new RegExp(SC.source,"g");function Iie(e){return function(){return e}}function Eie(e){return function(t){return e(t)+""}}function VO(e,t){var n=SC.lastIndex=r0.lastIndex=0,r,o,i,l=-1,c=[],u=[];for(e=e+"",t=t+"";(r=SC.exec(e))&&(o=r0.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),c[l]?c[l]+=i:c[++l]=i),(r=r[0])===(o=o[0])?c[l]?c[l]+=o:c[++l]=o:(c[++l]=null,u.push({i:l,x:Ei(r,o)})),n=r0.lastIndex;return n<t.length&&(i=t.slice(n),c[l]?c[l]+=i:c[++l]=i),c.length<2?u[0]?Eie(u[0].x):Iie(t):(t=u.length,function(f){for(var h=0,p;h<t;++h)c[(p=u[h]).i]=p.x(f);return c.join("")})}function Ip(e,t){var n=typeof t,r;return t==null||n==="boolean"?gS(t):(n==="number"?Ei:n==="string"?(r=Bc(t))?(t=r,mx):VO:t instanceof Bc?mx:t instanceof Date?jie:wie(t)?Cie:Array.isArray(t)?Sie:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?kie:Ei)(e,t)}var dP=180/Math.PI,jC={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function GO(e,t,n,r,o,i){var l,c,u;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(c=Math.sqrt(n*n+r*r))&&(n/=c,r/=c,u/=c),e*r<t*n&&(e=-e,t=-t,u=-u,l=-l),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*dP,skewX:Math.atan(u)*dP,scaleX:l,scaleY:c}}var hg;function Pie(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?jC:GO(t.a,t.b,t.c,t.d,t.e,t.f)}function Tie(e){return e==null||(hg||(hg=document.createElementNS("http://www.w3.org/2000/svg","g")),hg.setAttribute("transform",e),!(e=hg.transform.baseVal.consolidate()))?jC:(e=e.matrix,GO(e.a,e.b,e.c,e.d,e.e,e.f))}function UO(e,t,n,r){function o(f){return f.length?f.pop()+" ":""}function i(f,h,p,g,y,b){if(f!==p||h!==g){var v=y.push("translate(",null,t,null,n);b.push({i:v-4,x:Ei(f,p)},{i:v-2,x:Ei(h,g)})}else(p||g)&&y.push("translate("+p+t+g+n)}function l(f,h,p,g){f!==h?(f-h>180?h+=360:h-f>180&&(f+=360),g.push({i:p.push(o(p)+"rotate(",null,r)-2,x:Ei(f,h)})):h&&p.push(o(p)+"rotate("+h+r)}function c(f,h,p,g){f!==h?g.push({i:p.push(o(p)+"skewX(",null,r)-2,x:Ei(f,h)}):h&&p.push(o(p)+"skewX("+h+r)}function u(f,h,p,g,y,b){if(f!==p||h!==g){var v=y.push(o(y)+"scale(",null,",",null,")");b.push({i:v-4,x:Ei(f,p)},{i:v-2,x:Ei(h,g)})}else(p!==1||g!==1)&&y.push(o(y)+"scale("+p+","+g+")")}return function(f,h){var p=[],g=[];return f=e(f),h=e(h),i(f.translateX,f.translateY,h.translateX,h.translateY,p,g),l(f.rotate,h.rotate,p,g),c(f.skewX,h.skewX,p,g),u(f.scaleX,f.scaleY,h.scaleX,h.scaleY,p,g),f=h=null,function(y){for(var b=-1,v=g.length,C;++b<v;)p[(C=g[b]).i]=C.x(y);return p.join("")}}}var Mie=UO(Pie,"px, ","px)","deg)"),Rie=UO(Tie,", ",")",")"),$ie=1e-12;function fP(e){return((e=Math.exp(e))+1/e)/2}function Oie(e){return((e=Math.exp(e))-1/e)/2}function zie(e){return((e=Math.exp(2*e))-1)/(e+1)}const Lg=(function e(t,n,r){function o(i,l){var c=i[0],u=i[1],f=i[2],h=l[0],p=l[1],g=l[2],y=h-c,b=p-u,v=y*y+b*b,C,S;if(v<$ie)S=Math.log(g/f)/t,C=function($){return[c+$*y,u+$*b,f*Math.exp(t*$*S)]};else{var j=Math.sqrt(v),w=(g*g-f*f+r*v)/(2*f*n*j),k=(g*g-f*f-r*v)/(2*g*n*j),P=Math.log(Math.sqrt(w*w+1)-w),T=Math.log(Math.sqrt(k*k+1)-k);S=(T-P)/t,C=function($){var M=$*S,R=fP(P),E=f/(n*j)*(R*zie(t*M+P)-Oie(P));return[c+E*y,u+E*b,f*R/fP(t*M+P)]}}return C.duration=S*1e3*t/Math.SQRT2,C}return o.rho=function(i){var l=Math.max(.001,+i),c=l*l,u=c*c;return e(l,c,u)},o})(Math.SQRT2,2,4);var Ed=0,mp=0,tp=0,qO=1e3,gx,gp,xx=0,Wc=0,dy=0,Qp=typeof performance=="object"&&performance.now?performance:Date,KO=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function xS(){return Wc||(KO(Lie),Wc=Qp.now()+dy)}function Lie(){Wc=0}function yx(){this._call=this._time=this._next=null}yx.prototype=QO.prototype={constructor:yx,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?xS():+n)+(t==null?0:+t),!this._next&&gp!==this&&(gp?gp._next=this:gx=this,gp=this),this._call=e,this._time=n,kC()},stop:function(){this._call&&(this._call=null,this._time=1/0,kC())}};function QO(e,t,n){var r=new yx;return r.restart(e,t,n),r}function Die(){xS(),++Ed;for(var e=gx,t;e;)(t=Wc-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ed}function pP(){Wc=(xx=Qp.now())+dy,Ed=mp=0;try{Die()}finally{Ed=0,Fie(),Wc=0}}function Aie(){var e=Qp.now(),t=e-xx;t>qO&&(dy-=t,xx=e)}function Fie(){for(var e,t=gx,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:gx=n);gp=e,kC(r)}function kC(e){if(!Ed){mp&&(mp=clearTimeout(mp));var t=e-Wc;t>24?(e<1/0&&(mp=setTimeout(pP,e-Qp.now()-dy)),tp&&(tp=clearInterval(tp))):(tp||(xx=Qp.now(),tp=setInterval(Aie,qO)),Ed=1,KO(pP))}}function hP(e,t,n){var r=new yx;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var Nie=cy("start","end","cancel","interrupt"),_ie=[],YO=0,mP=1,IC=2,Dg=3,gP=4,EC=5,Ag=6;function fy(e,t,n,r,o,i){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;Hie(e,n,{name:t,index:r,group:o,on:Nie,tween:_ie,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:YO})}function yS(e,t){var n=hi(e,t);if(n.state>YO)throw new Error("too late; already scheduled");return n}function Bi(e,t){var n=hi(e,t);if(n.state>Dg)throw new Error("too late; already running");return n}function hi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Hie(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=QO(i,0,n.time);function i(f){n.state=mP,n.timer.restart(l,n.delay,n.time),n.delay<=f&&l(f-n.delay)}function l(f){var h,p,g,y;if(n.state!==mP)return u();for(h in r)if(y=r[h],y.name===n.name){if(y.state===Dg)return hP(l);y.state===gP?(y.state=Ag,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete r[h]):+h<t&&(y.state=Ag,y.timer.stop(),y.on.call("cancel",e,e.__data__,y.index,y.group),delete r[h])}if(hP(function(){n.state===Dg&&(n.state=gP,n.timer.restart(c,n.delay,n.time),c(f))}),n.state=IC,n.on.call("start",e,e.__data__,n.index,n.group),n.state===IC){for(n.state=Dg,o=new Array(g=n.tween.length),h=0,p=-1;h<g;++h)(y=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(o[++p]=y);o.length=p+1}}function c(f){for(var h=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(u),n.state=EC,1),p=-1,g=o.length;++p<g;)o[p].call(e,h);n.state===EC&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=Ag,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function Fg(e,t){var n=e.__transition,r,o,i=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((r=n[l]).name!==t){i=!1;continue}o=r.state>IC&&r.state<EC,r.state=Ag,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[l]}i&&delete e.__transition}}function Bie(e){return this.each(function(){Fg(this,e)})}function Wie(e,t){var n,r;return function(){var o=Bi(this,e),i=o.tween;if(i!==n){r=n=i;for(var l=0,c=r.length;l<c;++l)if(r[l].name===t){r=r.slice(),r.splice(l,1);break}}o.tween=r}}function Vie(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Bi(this,e),l=i.tween;if(l!==r){o=(r=l).slice();for(var c={name:t,value:n},u=0,f=o.length;u<f;++u)if(o[u].name===t){o[u]=c;break}u===f&&o.push(c)}i.tween=o}}function Gie(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=hi(this.node(),n).tween,o=0,i=r.length,l;o<i;++o)if((l=r[o]).name===e)return l.value;return null}return this.each((t==null?Wie:Vie)(n,e,t))}function bS(e,t,n){var r=e._id;return e.each(function(){var o=Bi(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return hi(o,r).value[t]}}function XO(e,t){var n;return(typeof t=="number"?Ei:t instanceof Bc?mx:(n=Bc(t))?(t=n,mx):VO)(e,t)}function Uie(e){return function(){this.removeAttribute(e)}}function qie(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Kie(e,t,n){var r,o=n+"",i;return function(){var l=this.getAttribute(e);return l===o?null:l===r?i:i=t(r=l,n)}}function Qie(e,t,n){var r,o=n+"",i;return function(){var l=this.getAttributeNS(e.space,e.local);return l===o?null:l===r?i:i=t(r=l,n)}}function Yie(e,t,n){var r,o,i;return function(){var l,c=n(this),u;return c==null?void this.removeAttribute(e):(l=this.getAttribute(e),u=c+"",l===u?null:l===r&&u===o?i:(o=u,i=t(r=l,c)))}}function Xie(e,t,n){var r,o,i;return function(){var l,c=n(this),u;return c==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),u=c+"",l===u?null:l===r&&u===o?i:(o=u,i=t(r=l,c)))}}function Zie(e,t){var n=uy(e),r=n==="transform"?Rie:XO;return this.attrTween(e,typeof t=="function"?(n.local?Xie:Yie)(n,r,bS(this,"attr."+e,t)):t==null?(n.local?qie:Uie)(n):(n.local?Qie:Kie)(n,r,t))}function Jie(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ele(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function tle(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&ele(e,i)),n}return o._value=t,o}function nle(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Jie(e,i)),n}return o._value=t,o}function rle(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=uy(e);return this.tween(n,(r.local?tle:nle)(r,t))}function ole(e,t){return function(){yS(this,e).delay=+t.apply(this,arguments)}}function sle(e,t){return t=+t,function(){yS(this,e).delay=t}}function ile(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ole:sle)(t,e)):hi(this.node(),t).delay}function lle(e,t){return function(){Bi(this,e).duration=+t.apply(this,arguments)}}function ale(e,t){return t=+t,function(){Bi(this,e).duration=t}}function cle(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?lle:ale)(t,e)):hi(this.node(),t).duration}function ule(e,t){if(typeof t!="function")throw new Error;return function(){Bi(this,e).ease=t}}function dle(e){var t=this._id;return arguments.length?this.each(ule(t,e)):hi(this.node(),t).ease}function fle(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Bi(this,e).ease=n}}function ple(e){if(typeof e!="function")throw new Error;return this.each(fle(this._id,e))}function hle(e){typeof e!="function"&&(e=PO(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],l=i.length,c=r[o]=[],u,f=0;f<l;++f)(u=i[f])&&e.call(u,u.__data__,f,i)&&c.push(u);return new Sl(r,this._parents,this._name,this._id)}function mle(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),l=new Array(r),c=0;c<i;++c)for(var u=t[c],f=n[c],h=u.length,p=l[c]=new Array(h),g,y=0;y<h;++y)(g=u[y]||f[y])&&(p[y]=g);for(;c<r;++c)l[c]=t[c];return new Sl(l,this._parents,this._name,this._id)}function gle(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function xle(e,t,n){var r,o,i=gle(t)?yS:Bi;return function(){var l=i(this,e),c=l.on;c!==r&&(o=(r=c).copy()).on(t,n),l.on=o}}function yle(e,t){var n=this._id;return arguments.length<2?hi(this.node(),n).on.on(e):this.each(xle(n,e,t))}function ble(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function vle(){return this.on("end.remove",ble(this._id))}function Cle(e){var t=this._name,n=this._id;typeof e!="function"&&(e=pS(e));for(var r=this._groups,o=r.length,i=new Array(o),l=0;l<o;++l)for(var c=r[l],u=c.length,f=i[l]=new Array(u),h,p,g=0;g<u;++g)(h=c[g])&&(p=e.call(h,h.__data__,g,c))&&("__data__"in h&&(p.__data__=h.__data__),f[g]=p,fy(f[g],t,n,g,f,hi(h,n)));return new Sl(i,this._parents,t,n)}function wle(e){var t=this._name,n=this._id;typeof e!="function"&&(e=EO(e));for(var r=this._groups,o=r.length,i=[],l=[],c=0;c<o;++c)for(var u=r[c],f=u.length,h,p=0;p<f;++p)if(h=u[p]){for(var g=e.call(h,h.__data__,p,u),y,b=hi(h,n),v=0,C=g.length;v<C;++v)(y=g[v])&&fy(y,t,n,v,g,b);i.push(g),l.push(h)}return new Sl(i,l,t,n)}var Sle=Rh.prototype.constructor;function jle(){return new Sle(this._groups,this._parents)}function kle(e,t){var n,r,o;return function(){var i=Id(this,e),l=(this.style.removeProperty(e),Id(this,e));return i===l?null:i===n&&l===r?o:o=t(n=i,r=l)}}function ZO(e){return function(){this.style.removeProperty(e)}}function Ile(e,t,n){var r,o=n+"",i;return function(){var l=Id(this,e);return l===o?null:l===r?i:i=t(r=l,n)}}function Ele(e,t,n){var r,o,i;return function(){var l=Id(this,e),c=n(this),u=c+"";return c==null&&(u=c=(this.style.removeProperty(e),Id(this,e))),l===u?null:l===r&&u===o?i:(o=u,i=t(r=l,c))}}function Ple(e,t){var n,r,o,i="style."+t,l="end."+i,c;return function(){var u=Bi(this,e),f=u.on,h=u.value[i]==null?c||(c=ZO(t)):void 0;(f!==n||o!==h)&&(r=(n=f).copy()).on(l,o=h),u.on=r}}function Tle(e,t,n){var r=(e+="")=="transform"?Mie:XO;return t==null?this.styleTween(e,kle(e,r)).on("end.style."+e,ZO(e)):typeof t=="function"?this.styleTween(e,Ele(e,r,bS(this,"style."+e,t))).each(Ple(this._id,e)):this.styleTween(e,Ile(e,r,t),n).on("end.style."+e,null)}function Mle(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Rle(e,t,n){var r,o;function i(){var l=t.apply(this,arguments);return l!==o&&(r=(o=l)&&Mle(e,l,n)),r}return i._value=t,i}function $le(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Rle(e,t,n??""))}function Ole(e){return function(){this.textContent=e}}function zle(e){return function(){var t=e(this);this.textContent=t??""}}function Lle(e){return this.tween("text",typeof e=="function"?zle(bS(this,"text",e)):Ole(e==null?"":e+""))}function Dle(e){return function(t){this.textContent=e.call(this,t)}}function Ale(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&Dle(o)),t}return r._value=e,r}function Fle(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,Ale(e))}function Nle(){for(var e=this._name,t=this._id,n=JO(),r=this._groups,o=r.length,i=0;i<o;++i)for(var l=r[i],c=l.length,u,f=0;f<c;++f)if(u=l[f]){var h=hi(u,t);fy(u,e,n,f,l,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Sl(r,this._parents,e,n)}function _le(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,l){var c={value:l},u={value:function(){--o===0&&i()}};n.each(function(){var f=Bi(this,r),h=f.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(u)),f.on=t}),o===0&&i()})}var Hle=0;function Sl(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function JO(){return++Hle}var Ji=Rh.prototype;Sl.prototype={constructor:Sl,select:Cle,selectAll:wle,selectChild:Ji.selectChild,selectChildren:Ji.selectChildren,filter:hle,merge:mle,selection:jle,transition:Nle,call:Ji.call,nodes:Ji.nodes,node:Ji.node,size:Ji.size,empty:Ji.empty,each:Ji.each,on:yle,attr:Zie,attrTween:rle,style:Tle,styleTween:$le,text:Lle,textTween:Fle,remove:vle,tween:Gie,delay:ile,duration:cle,ease:dle,easeVarying:ple,end:_le,[Symbol.iterator]:Ji[Symbol.iterator]};function Ble(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Wle={time:null,delay:0,duration:250,ease:Ble};function Vle(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Gle(e){var t,n;e instanceof Sl?(t=e._id,e=e._name):(t=JO(),(n=Wle).time=xS(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var l=r[i],c=l.length,u,f=0;f<c;++f)(u=l[f])&&fy(u,e,t,f,l,n||Vle(u,t));return new Sl(r,this._parents,e,t)}Rh.prototype.interrupt=Bie;Rh.prototype.transition=Gle;const mg=e=>()=>e;function Ule(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function al(e,t,n){this.k=e,this.x=t,this.y=n}al.prototype={constructor:al,scale:function(e){return e===1?this:new al(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new al(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 py=new al(1,0,0);ez.prototype=al.prototype;function ez(e){for(;!e.__zoom;)if(!(e=e.parentNode))return py;return e.__zoom}function o0(e){e.stopImmediatePropagation()}function np(e){e.preventDefault(),e.stopImmediatePropagation()}function qle(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Kle(){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 xP(){return this.__zoom||py}function Qle(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Yle(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xle(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function tz(){var e=qle,t=Kle,n=Xle,r=Qle,o=Yle,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,u=Lg,f=cy("start","zoom","end"),h,p,g,y=500,b=150,v=0,C=10;function S(F){F.property("__zoom",xP).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",E).filter(o).on("touchstart.zoom",O).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(F,L,D,H){var B=F.selection?F.selection():F;B.property("__zoom",xP),F!==B?P(F,L,D,H):B.interrupt().each(function(){T(this,arguments).event(H).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},S.scaleBy=function(F,L,D,H){S.scaleTo(F,function(){var B=this.__zoom.k,V=typeof L=="function"?L.apply(this,arguments):L;return B*V},D,H)},S.scaleTo=function(F,L,D,H){S.transform(F,function(){var B=t.apply(this,arguments),V=this.__zoom,G=D==null?k(B):typeof D=="function"?D.apply(this,arguments):D,_=V.invert(G),U=typeof L=="function"?L.apply(this,arguments):L;return n(w(j(V,U),G,_),B,l)},D,H)},S.translateBy=function(F,L,D,H){S.transform(F,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),l)},null,H)},S.translateTo=function(F,L,D,H,B){S.transform(F,function(){var V=t.apply(this,arguments),G=this.__zoom,_=H==null?k(V):typeof H=="function"?H.apply(this,arguments):H;return n(py.translate(_[0],_[1]).scale(G.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof D=="function"?-D.apply(this,arguments):-D),V,l)},H,B)};function j(F,L){return L=Math.max(i[0],Math.min(i[1],L)),L===F.k?F:new al(L,F.x,F.y)}function w(F,L,D){var H=L[0]-D[0]*F.k,B=L[1]-D[1]*F.k;return H===F.x&&B===F.y?F:new al(F.k,H,B)}function k(F){return[(+F[0][0]+ +F[1][0])/2,(+F[0][1]+ +F[1][1])/2]}function P(F,L,D,H){F.on("start.zoom",function(){T(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(H).end()}).tween("zoom",function(){var B=this,V=arguments,G=T(B,V).event(H),_=t.apply(B,V),U=D==null?k(_):typeof D=="function"?D.apply(B,V):D,Z=Math.max(_[1][0]-_[0][0],_[1][1]-_[0][1]),Q=B.__zoom,ee=typeof L=="function"?L.apply(B,V):L,ne=u(Q.invert(U).concat(Z/Q.k),ee.invert(U).concat(Z/ee.k));return function(re){if(re===1)re=ee;else{var Y=ne(re),ie=Z/Y[2];re=new al(ie,U[0]-Y[0]*ie,U[1]-Y[1]*ie)}G.zoom(null,re)}})}function T(F,L,D){return!D&&F.__zooming||new $(F,L)}function $(F,L){this.that=F,this.args=L,this.active=0,this.sourceEvent=null,this.extent=t.apply(F,L),this.taps=0}$.prototype={event:function(F){return F&&(this.sourceEvent=F),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(F,L){return this.mouse&&F!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&F!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&F!=="touch"&&(this.touch1[1]=L.invert(this.touch1[0])),this.that.__zoom=L,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(F){var L=is(this.that).datum();f.call(F,this.that,new Ule(F,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:f}),L)}};function M(F,...L){if(!e.apply(this,arguments))return;var D=T(this,L).event(F),H=this.__zoom,B=Math.max(i[0],Math.min(i[1],H.k*Math.pow(2,r.apply(this,arguments)))),V=ni(F);if(D.wheel)(D.mouse[0][0]!==V[0]||D.mouse[0][1]!==V[1])&&(D.mouse[1]=H.invert(D.mouse[0]=V)),clearTimeout(D.wheel);else{if(H.k===B)return;D.mouse=[V,H.invert(V)],Fg(this),D.start()}np(F),D.wheel=setTimeout(G,b),D.zoom("mouse",n(w(j(H,B),D.mouse[0],D.mouse[1]),D.extent,l));function G(){D.wheel=null,D.end()}}function R(F,...L){if(g||!e.apply(this,arguments))return;var D=F.currentTarget,H=T(this,L,!0).event(F),B=is(F.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",Z,!0),V=ni(F,D),G=F.clientX,_=F.clientY;FO(F.view),o0(F),H.mouse=[V,this.__zoom.invert(V)],Fg(this),H.start();function U(Q){if(np(Q),!H.moved){var ee=Q.clientX-G,ne=Q.clientY-_;H.moved=ee*ee+ne*ne>v}H.event(Q).zoom("mouse",n(w(H.that.__zoom,H.mouse[0]=ni(Q,D),H.mouse[1]),H.extent,l))}function Z(Q){B.on("mousemove.zoom mouseup.zoom",null),NO(Q.view,H.moved),np(Q),H.event(Q).end()}}function E(F,...L){if(e.apply(this,arguments)){var D=this.__zoom,H=ni(F.changedTouches?F.changedTouches[0]:F,this),B=D.invert(H),V=D.k*(F.shiftKey?.5:2),G=n(w(j(D,V),H,B),t.apply(this,L),l);np(F),c>0?is(this).transition().duration(c).call(P,G,H,F):is(this).call(S.transform,G,H,F)}}function O(F,...L){if(e.apply(this,arguments)){var D=F.touches,H=D.length,B=T(this,L,F.changedTouches.length===H).event(F),V,G,_,U;for(o0(F),G=0;G<H;++G)_=D[G],U=ni(_,this),U=[U,this.__zoom.invert(U),_.identifier],B.touch0?!B.touch1&&B.touch0[2]!==U[2]&&(B.touch1=U,B.taps=0):(B.touch0=U,V=!0,B.taps=1+!!h);h&&(h=clearTimeout(h)),V&&(B.taps<2&&(p=U[0],h=setTimeout(function(){h=null},y)),Fg(this),B.start())}}function A(F,...L){if(this.__zooming){var D=T(this,L).event(F),H=F.changedTouches,B=H.length,V,G,_,U;for(np(F),V=0;V<B;++V)G=H[V],_=ni(G,this),D.touch0&&D.touch0[2]===G.identifier?D.touch0[0]=_:D.touch1&&D.touch1[2]===G.identifier&&(D.touch1[0]=_);if(G=D.that.__zoom,D.touch1){var Z=D.touch0[0],Q=D.touch0[1],ee=D.touch1[0],ne=D.touch1[1],re=(re=ee[0]-Z[0])*re+(re=ee[1]-Z[1])*re,Y=(Y=ne[0]-Q[0])*Y+(Y=ne[1]-Q[1])*Y;G=j(G,Math.sqrt(re/Y)),_=[(Z[0]+ee[0])/2,(Z[1]+ee[1])/2],U=[(Q[0]+ne[0])/2,(Q[1]+ne[1])/2]}else if(D.touch0)_=D.touch0[0],U=D.touch0[1];else return;D.zoom("touch",n(w(G,_,U),D.extent,l))}}function N(F,...L){if(this.__zooming){var D=T(this,L).event(F),H=F.changedTouches,B=H.length,V,G;for(o0(F),g&&clearTimeout(g),g=setTimeout(function(){g=null},y),V=0;V<B;++V)G=H[V],D.touch0&&D.touch0[2]===G.identifier?delete D.touch0:D.touch1&&D.touch1[2]===G.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(G=ni(G,this),Math.hypot(p[0]-G[0],p[1]-G[1])<C)){var _=is(this).on("dblclick.zoom");_&&_.apply(this,arguments)}}}return S.wheelDelta=function(F){return arguments.length?(r=typeof F=="function"?F:mg(+F),S):r},S.filter=function(F){return arguments.length?(e=typeof F=="function"?F:mg(!!F),S):e},S.touchable=function(F){return arguments.length?(o=typeof F=="function"?F:mg(!!F),S):o},S.extent=function(F){return arguments.length?(t=typeof F=="function"?F:mg([[+F[0][0],+F[0][1]],[+F[1][0],+F[1][1]]]),S):t},S.scaleExtent=function(F){return arguments.length?(i[0]=+F[0],i[1]=+F[1],S):[i[0],i[1]]},S.translateExtent=function(F){return arguments.length?(l[0][0]=+F[0][0],l[1][0]=+F[1][0],l[0][1]=+F[0][1],l[1][1]=+F[1][1],S):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},S.constrain=function(F){return arguments.length?(n=F,S):n},S.duration=function(F){return arguments.length?(c=+F,S):c},S.interpolate=function(F){return arguments.length?(u=F,S):u},S.on=function(){var F=f.on.apply(f,arguments);return F===f?S:F},S.clickDistance=function(F){return arguments.length?(v=(F=+F)*F,S):Math.sqrt(v)},S.tapDistance=function(F){return arguments.length?(C=+F,S):C},S}const Ni={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Yp=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nz=["Enter"," ","Escape"],rz={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Pd;(function(e){e.Strict="strict",e.Loose="loose"})(Pd||(Pd={}));var Tc;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Tc||(Tc={}));var Xp;(function(e){e.Partial="partial",e.Full="full"})(Xp||(Xp={}));const oz={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var la;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(la||(la={}));var Zp;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Zp||(Zp={}));var Rt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Rt||(Rt={}));const yP={[Rt.Left]:Rt.Right,[Rt.Right]:Rt.Left,[Rt.Top]:Rt.Bottom,[Rt.Bottom]:Rt.Top};function sz(e){return e===null?null:e?"valid":"invalid"}const iz=e=>"id"in e&&"source"in e&&"target"in e,Zle=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),vS=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Oh=(e,t=[0,0])=>{const{width:n,height:r}=Ml(e),o=e.origin??t,i=n*o[0],l=r*o[1];return{x:e.position.x-i,y:e.position.y-l}},Jle=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const i=typeof o=="string";let l=!t.nodeLookup&&!i?o:void 0;t.nodeLookup&&(l=i?t.nodeLookup.get(o):vS(o)?o:t.nodeLookup.get(o.id));const c=l?bx(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return hy(r,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return my(n)},zh=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=hy(n,bx(o)),r=!0)}),r?my(n):{x:0,y:0,width:0,height:0}},CS=(e,t,[n,r,o]=[0,0,1],i=!1,l=!1)=>{const c={...Dh(t,[n,r,o]),width:t.width/o,height:t.height/o},u=[];for(const f of e.values()){const{measured:h,selectable:p=!0,hidden:g=!1}=f;if(l&&!p||g)continue;const y=h.width??f.width??f.initialWidth??null,b=h.height??f.height??f.initialHeight??null,v=Jp(c,Md(f)),C=(y??0)*(b??0),S=i&&v>0;(!f.internals.handleBounds||S||v>=C||f.dragging)&&u.push(f)}return u},eae=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function tae(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function nae({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},l){if(e.size===0)return Promise.resolve(!0);const c=tae(e,l),u=zh(c),f=wS(u,t,n,(l==null?void 0:l.minZoom)??o,(l==null?void 0:l.maxZoom)??i,(l==null?void 0:l.padding)??.1);return await r.setViewport(f,{duration:l==null?void 0:l.duration,ease:l==null?void 0:l.ease,interpolate:l==null?void 0:l.interpolate}),Promise.resolve(!0)}function lz({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const l=n.get(e),c=l.parentId?n.get(l.parentId):void 0,{x:u,y:f}=c?c.internals.positionAbsolute:{x:0,y:0},h=l.origin??r;let p=l.extent||o;if(l.extent==="parent"&&!l.expandParent)if(!c)i==null||i("005",Ni.error005());else{const y=c.measured.width,b=c.measured.height;y&&b&&(p=[[u,f],[u+y,f+b]])}else c&&Rd(l.extent)&&(p=[[l.extent[0][0]+u,l.extent[0][1]+f],[l.extent[1][0]+u,l.extent[1][1]+f]]);const g=Rd(p)?Vc(t,p,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&(i==null||i("015",Ni.error015())),{position:{x:g.x-u+(l.measured.width??0)*h[0],y:g.y-f+(l.measured.height??0)*h[1]},positionAbsolute:g}}async function rae({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(g=>g.id)),l=[];for(const g of n){if(g.deletable===!1)continue;const y=i.has(g.id),b=!y&&g.parentId&&l.find(v=>v.id===g.parentId);(y||b)&&l.push(g)}const c=new Set(t.map(g=>g.id)),u=r.filter(g=>g.deletable!==!1),h=eae(l,u);for(const g of u)c.has(g.id)&&!h.find(b=>b.id===g.id)&&h.push(g);if(!o)return{edges:h,nodes:l};const p=await o({nodes:l,edges:h});return typeof p=="boolean"?p?{edges:h,nodes:l}:{edges:[],nodes:[]}:p}const Td=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Vc=(e={x:0,y:0},t,n)=>({x:Td(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Td(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function az(e,t,n){const{width:r,height:o}=Ml(n),{x:i,y:l}=n.internals.positionAbsolute;return Vc(e,[[i,l],[i+r,l+o]],t)}const bP=(e,t,n)=>e<t?Td(Math.abs(e-t),1,t)/t:e>n?-Td(Math.abs(e-n),1,t)/t:0,cz=(e,t,n=15,r=40)=>{const o=bP(e.x,r,t.width-r)*n,i=bP(e.y,r,t.height-r)*n;return[o,i]},hy=(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)}),PC=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),my=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Md=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=vS(e)?e.internals.positionAbsolute:Oh(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},bx=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=vS(e)?e.internals.positionAbsolute:Oh(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},uz=(e,t)=>my(hy(PC(e),PC(t))),Jp=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},vP=e=>ci(e.width)&&ci(e.height)&&ci(e.x)&&ci(e.y),ci=e=>!isNaN(e)&&isFinite(e),oae=(e,t)=>{},Lh=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Dh=({x:e,y:t},[n,r,o],i=!1,l=[1,1])=>{const c={x:(e-n)/o,y:(t-r)/o};return i?Lh(c,l):c},vx=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function zu(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function sae(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=zu(e,n),o=zu(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=zu(e.top??e.y??0,n),o=zu(e.bottom??e.y??0,n),i=zu(e.left??e.x??0,t),l=zu(e.right??e.x??0,t);return{top:r,right:l,bottom:o,left:i,x:i+l,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function iae(e,t,n,r,o,i){const{x:l,y:c}=vx(e,[t,n,r]),{x:u,y:f}=vx({x:e.x+e.width,y:e.y+e.height},[t,n,r]),h=o-u,p=i-f;return{left:Math.floor(l),top:Math.floor(c),right:Math.floor(h),bottom:Math.floor(p)}}const wS=(e,t,n,r,o,i)=>{const l=sae(i,t,n),c=(t-l.x)/e.width,u=(n-l.y)/e.height,f=Math.min(c,u),h=Td(f,r,o),p=e.x+e.width/2,g=e.y+e.height/2,y=t/2-p*h,b=n/2-g*h,v=iae(e,y,b,h,t,n),C={left:Math.min(v.left-l.left,0),top:Math.min(v.top-l.top,0),right:Math.min(v.right-l.right,0),bottom:Math.min(v.bottom-l.bottom,0)};return{x:y-C.left+C.right,y:b-C.top+C.bottom,zoom:h}},eh=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Rd(e){return e!=null&&e!=="parent"}function Ml(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function dz(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function fz(e,t={width:0,height:0},n,r,o){const i={...e},l=r.get(n);if(l){const c=l.origin||o;i.x+=l.internals.positionAbsolute.x-(t.width??0)*c[0],i.y+=l.internals.positionAbsolute.y-(t.height??0)*c[1]}return i}function CP(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function lae(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function aae(e){return{...rz,...e||{}}}function Ep(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:l}=ui(e),c=Dh({x:i-((o==null?void 0:o.left)??0),y:l-((o==null?void 0:o.top)??0)},r),{x:u,y:f}=n?Lh(c,t):c;return{xSnapped:u,ySnapped:f,...c}}const SS=e=>({width:e.offsetWidth,height:e.offsetHeight}),pz=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},cae=["INPUT","SELECT","TEXTAREA"];function hz(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:cae.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const mz=e=>"clientX"in e,ui=(e,t)=>{var i,l;const n=mz(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},wP=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:o,position:l.getAttribute("data-handlepos"),x:(c.left-n.left)/r,y:(c.top-n.top)/r,...SS(l)}})};function gz({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:l,targetControlY:c}){const u=e*.125+o*.375+l*.375+n*.125,f=t*.125+i*.375+c*.375+r*.125,h=Math.abs(u-e),p=Math.abs(f-t);return[u,f,h,p]}function gg(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function SP({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case Rt.Left:return[t-gg(t-r,i),n];case Rt.Right:return[t+gg(r-t,i),n];case Rt.Top:return[t,n-gg(n-o,i)];case Rt.Bottom:return[t,n+gg(o-n,i)]}}function xz({sourceX:e,sourceY:t,sourcePosition:n=Rt.Bottom,targetX:r,targetY:o,targetPosition:i=Rt.Top,curvature:l=.25}){const[c,u]=SP({pos:n,x1:e,y1:t,x2:r,y2:o,c:l}),[f,h]=SP({pos:i,x1:r,y1:o,x2:e,y2:t,c:l}),[p,g,y,b]=gz({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:c,sourceControlY:u,targetControlX:f,targetControlY:h});return[`M${e},${t} C${c},${u} ${f},${h} ${r},${o}`,p,g,y,b]}function yz({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,l=Math.abs(r-t)/2,c=r<t?r+l:r-l;return[i,c,o,l]}function uae({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const l=o&&n?r+1e3:r,c=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return l+c}function dae({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=hy(bx(e),bx(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const l={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return Jp(l,my(i))>0}const fae=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,pae=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),hae=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||fae;let o;return iz(e)?o={...e}:o={...e,id:r(e)},pae(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function bz({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,l,c]=yz({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,l,c]}const jP={[Rt.Left]:{x:-1,y:0},[Rt.Right]:{x:1,y:0},[Rt.Top]:{x:0,y:-1},[Rt.Bottom]:{x:0,y:1}},mae=({source:e,sourcePosition:t=Rt.Bottom,target:n})=>t===Rt.Left||t===Rt.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},kP=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function gae({source:e,sourcePosition:t=Rt.Bottom,target:n,targetPosition:r=Rt.Top,center:o,offset:i,stepPosition:l}){const c=jP[t],u=jP[r],f={x:e.x+c.x*i,y:e.y+c.y*i},h={x:n.x+u.x*i,y:n.y+u.y*i},p=mae({source:f,sourcePosition:t,target:h}),g=p.x!==0?"x":"y",y=p[g];let b=[],v,C;const S={x:0,y:0},j={x:0,y:0},[,,w,k]=yz({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[g]*u[g]===-1){g==="x"?(v=o.x??f.x+(h.x-f.x)*l,C=o.y??(f.y+h.y)/2):(v=o.x??(f.x+h.x)/2,C=o.y??f.y+(h.y-f.y)*l);const T=[{x:v,y:f.y},{x:v,y:h.y}],$=[{x:f.x,y:C},{x:h.x,y:C}];c[g]===y?b=g==="x"?T:$:b=g==="x"?$:T}else{const T=[{x:f.x,y:h.y}],$=[{x:h.x,y:f.y}];if(g==="x"?b=c.x===y?$:T:b=c.y===y?T:$,t===r){const A=Math.abs(e[g]-n[g]);if(A<=i){const N=Math.min(i-1,i-A);c[g]===y?S[g]=(f[g]>e[g]?-1:1)*N:j[g]=(h[g]>n[g]?-1:1)*N}}if(t!==r){const A=g==="x"?"y":"x",N=c[g]===u[A],F=f[A]>h[A],L=f[A]<h[A];(c[g]===1&&(!N&&F||N&&L)||c[g]!==1&&(!N&&L||N&&F))&&(b=g==="x"?T:$)}const M={x:f.x+S.x,y:f.y+S.y},R={x:h.x+j.x,y:h.y+j.y},E=Math.max(Math.abs(M.x-b[0].x),Math.abs(R.x-b[0].x)),O=Math.max(Math.abs(M.y-b[0].y),Math.abs(R.y-b[0].y));E>=O?(v=(M.x+R.x)/2,C=b[0].y):(v=b[0].x,C=(M.y+R.y)/2)}return[[e,{x:f.x+S.x,y:f.y+S.y},...b,{x:h.x+j.x,y:h.y+j.y},n],v,C,w,k]}function xae(e,t,n,r){const o=Math.min(kP(e,t)/2,kP(t,n)/2,r),{x:i,y:l}=t;if(e.x===i&&i===n.x||e.y===l&&l===n.y)return`L${i} ${l}`;if(e.y===l){const f=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${i+o*f},${l}Q ${i},${l} ${i},${l+o*h}`}const c=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${i},${l+o*u}Q ${i},${l} ${i+o*c},${l}`}function TC({sourceX:e,sourceY:t,sourcePosition:n=Rt.Bottom,targetX:r,targetY:o,targetPosition:i=Rt.Top,borderRadius:l=5,centerX:c,centerY:u,offset:f=20,stepPosition:h=.5}){const[p,g,y,b,v]=gae({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:c,y:u},offset:f,stepPosition:h});return[p.reduce((S,j,w)=>{let k="";return w>0&&w<p.length-1?k=xae(p[w-1],j,p[w+1],l):k=`${w===0?"M":"L"}${j.x} ${j.y}`,S+=k,S},""),g,y,b,v]}function IP(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function yae(e){var p;const{sourceNode:t,targetNode:n}=e;if(!IP(t)||!IP(n))return null;const r=t.internals.handleBounds||EP(t.handles),o=n.internals.handleBounds||EP(n.handles),i=PP((r==null?void 0:r.source)??[],e.sourceHandle),l=PP(e.connectionMode===Pd.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!i||!l)return(p=e.onError)==null||p.call(e,"008",Ni.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(i==null?void 0:i.position)||Rt.Bottom,u=(l==null?void 0:l.position)||Rt.Top,f=Gc(t,i,c),h=Gc(n,l,u);return{sourceX:f.x,sourceY:f.y,targetX:h.x,targetY:h.y,sourcePosition:c,targetPosition:u}}function EP(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Gc(e,t,n=Rt.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:l,height:c}=t??Ml(e);if(r)return{x:o+l/2,y:i+c/2};switch((t==null?void 0:t.position)??n){case Rt.Top:return{x:o+l/2,y:i};case Rt.Right:return{x:o+l,y:i+c/2};case Rt.Bottom:return{x:o+l/2,y:i+c};case Rt.Left:return{x:o,y:i+c/2}}}function PP(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function MC(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function bae(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((l,c)=>([c.markerStart||r,c.markerEnd||o].forEach(u=>{if(u&&typeof u=="object"){const f=MC(u,t);i.has(f)||(l.push({id:f,color:u.color||n,...u}),i.add(f))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const vz=1e3,vae=10,jS={nodeOrigin:[0,0],nodeExtent:Yp,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Cae={...jS,checkEquality:!0};function kS(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function wae(e,t,n){const r=kS(jS,n);for(const o of e.values())if(o.parentId)ES(o,e,t,r);else{const i=Oh(o,r.nodeOrigin),l=Rd(o.extent)?o.extent:r.nodeExtent,c=Vc(i,l,Ml(o));o.internals.positionAbsolute=c}}function Sae(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const i={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(i):o.type==="target"&&r.push(i)}return{source:n,target:r}}function IS(e){return e==="manual"}function RC(e,t,n,r={}){var f,h;const o=kS(Cae,r),i={i:0},l=new Map(t),c=o!=null&&o.elevateNodesOnSelect&&!IS(o.zIndexMode)?vz:0;let u=e.length>0;t.clear(),n.clear();for(const p of e){let g=l.get(p.id);if(o.checkEquality&&p===(g==null?void 0:g.internals.userNode))t.set(p.id,g);else{const y=Oh(p,o.nodeOrigin),b=Rd(p.extent)?p.extent:o.nodeExtent,v=Vc(y,b,Ml(p));g={...o.defaults,...p,measured:{width:(f=p.measured)==null?void 0:f.width,height:(h=p.measured)==null?void 0:h.height},internals:{positionAbsolute:v,handleBounds:Sae(p,g),z:Cz(p,c,o.zIndexMode),userNode:p}},t.set(p.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(u=!1),p.parentId&&ES(g,t,n,r,i)}return u}function jae(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function ES(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:l,nodeExtent:c,zIndexMode:u}=kS(jS,r),f=e.parentId,h=t.get(f);if(!h){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}jae(e,n),o&&!h.parentId&&h.internals.rootParentIndex===void 0&&u==="auto"&&(h.internals.rootParentIndex=++o.i,h.internals.z=h.internals.z+o.i*vae),o&&h.internals.rootParentIndex!==void 0&&(o.i=h.internals.rootParentIndex);const p=i&&!IS(u)?vz:0,{x:g,y,z:b}=kae(e,h,l,c,p,u),{positionAbsolute:v}=e.internals,C=g!==v.x||y!==v.y;(C||b!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:C?{x:g,y}:v,z:b}})}function Cz(e,t,n){const r=ci(e.zIndex)?e.zIndex:0;return IS(n)?r:r+(e.selected?t:0)}function kae(e,t,n,r,o,i){const{x:l,y:c}=t.internals.positionAbsolute,u=Ml(e),f=Oh(e,n),h=Rd(e.extent)?Vc(f,e.extent,u):f;let p=Vc({x:l+h.x,y:c+h.y},r,u);e.extent==="parent"&&(p=az(p,u,t));const g=Cz(e,o,i),y=t.internals.z??0;return{x:p.x,y:p.y,z:y>=g?y+1:g}}function PS(e,t,n,r=[0,0]){var l;const o=[],i=new Map;for(const c of e){const u=t.get(c.parentId);if(!u)continue;const f=((l=i.get(c.parentId))==null?void 0:l.expandedRect)??Md(u),h=uz(f,c.rect);i.set(c.parentId,{expandedRect:h,parent:u})}return i.size>0&&i.forEach(({expandedRect:c,parent:u},f)=>{var w;const h=u.internals.positionAbsolute,p=Ml(u),g=u.origin??r,y=c.x<h.x?Math.round(Math.abs(h.x-c.x)):0,b=c.y<h.y?Math.round(Math.abs(h.y-c.y)):0,v=Math.max(p.width,Math.round(c.width)),C=Math.max(p.height,Math.round(c.height)),S=(v-p.width)*g[0],j=(C-p.height)*g[1];(y>0||b>0||S||j)&&(o.push({id:f,type:"position",position:{x:u.position.x-y+S,y:u.position.y-b+j}}),(w=n.get(f))==null||w.forEach(k=>{e.some(P=>P.id===k.id)||o.push({id:k.id,type:"position",position:{x:k.position.x+y,y:k.position.y+b}})})),(p.width<c.width||p.height<c.height||y||b)&&o.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:v+(y?g[0]*y-S:0),height:C+(b?g[1]*b-j:0)}})}),o}function Iae(e,t,n,r,o,i,l){const c=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!c)return{changes:[],updatedInternals:u};const f=[],h=window.getComputedStyle(c),{m22:p}=new window.DOMMatrixReadOnly(h.transform),g=[];for(const y of e.values()){const b=t.get(y.id);if(!b)continue;if(b.hidden){t.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),u=!0;continue}const v=SS(y.nodeElement),C=b.measured.width!==v.width||b.measured.height!==v.height;if(!!(v.width&&v.height&&(C||!b.internals.handleBounds||y.force))){const j=y.nodeElement.getBoundingClientRect(),w=Rd(b.extent)?b.extent:i;let{positionAbsolute:k}=b.internals;b.parentId&&b.extent==="parent"?k=az(k,v,t.get(b.parentId)):w&&(k=Vc(k,w,v));const P={...b,measured:v,internals:{...b.internals,positionAbsolute:k,handleBounds:{source:wP("source",y.nodeElement,j,p,b.id),target:wP("target",y.nodeElement,j,p,b.id)}}};t.set(b.id,P),b.parentId&&ES(P,t,n,{nodeOrigin:o,zIndexMode:l}),u=!0,C&&(f.push({id:b.id,type:"dimensions",dimensions:v}),b.expandParent&&b.parentId&&g.push({id:b.id,parentId:b.parentId,rect:Md(P,o)}))}}if(g.length>0){const y=PS(g,t,n,o);f.push(...y)}return{changes:f,updatedInternals:u}}async function Eae({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r),c=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(c)}function TP(e,t,n,r,o,i){let l=o;const c=r.get(l)||new Map;r.set(l,c.set(n,t)),l=`${o}-${e}`;const u=r.get(l)||new Map;if(r.set(l,u.set(n,t)),i){l=`${o}-${e}-${i}`;const f=r.get(l)||new Map;r.set(l,f.set(n,t))}}function wz(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:l=null,targetHandle:c=null}=r,u={edgeId:r.id,source:o,target:i,sourceHandle:l,targetHandle:c},f=`${o}-${l}--${i}-${c}`,h=`${i}-${c}--${o}-${l}`;TP("source",u,h,e,o,l),TP("target",u,f,e,i,c),t.set(r.id,r)}}function Sz(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Sz(n,t):!1}function MP(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Pae(e,t,n,r){const o=new Map;for(const[i,l]of e)if((l.selected||l.id===r)&&(!l.parentId||!Sz(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const c=e.get(i);c&&o.set(i,{id:i,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return o}function s0({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var l,c,u;const o=[];for(const[f,h]of t){const p=(l=n.get(f))==null?void 0:l.internals.userNode;p&&o.push({...p,position:h.position,dragging:r})}if(!e)return[o[0],o];const i=(c=n.get(e))==null?void 0:c.internals.userNode;return[i?{...i,position:((u=t.get(e))==null?void 0:u.position)||i.position,dragging:r}:o[0],o]}function Tae({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const i={x:n-o.distance.x,y:r-o.distance.y},l=Lh(i,t);return{x:l.x-i.x,y:l.y-i.y}}function Mae({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},l=0,c=new Map,u=!1,f={x:0,y:0},h=null,p=!1,g=null,y=!1,b=!1,v=null;function C({noDragClassName:j,handleSelector:w,domNode:k,isSelectable:P,nodeId:T,nodeClickDistance:$=0}){g=is(k);function M({x:A,y:N}){const{nodeLookup:F,nodeExtent:L,snapGrid:D,snapToGrid:H,nodeOrigin:B,onNodeDrag:V,onSelectionDrag:G,onError:_,updateNodePositions:U}=t();i={x:A,y:N};let Z=!1;const Q=c.size>1,ee=Q&&L?PC(zh(c)):null,ne=Q&&H?Tae({dragItems:c,snapGrid:D,x:A,y:N}):null;for(const[re,Y]of c){if(!F.has(re))continue;let ie={x:A-Y.distance.x,y:N-Y.distance.y};H&&(ie=ne?{x:Math.round(ie.x+ne.x),y:Math.round(ie.y+ne.y)}:Lh(ie,D));let ce=null;if(Q&&L&&!Y.extent&&ee){const{positionAbsolute:le}=Y.internals,ge=le.x-ee.x+L[0][0],Se=le.x+Y.measured.width-ee.x2+L[1][0],ke=le.y-ee.y+L[0][1],we=le.y+Y.measured.height-ee.y2+L[1][1];ce=[[ge,ke],[Se,we]]}const{position:he,positionAbsolute:de}=lz({nodeId:re,nextPosition:ie,nodeLookup:F,nodeExtent:ce||L,nodeOrigin:B,onError:_});Z=Z||Y.position.x!==he.x||Y.position.y!==he.y,Y.position=he,Y.internals.positionAbsolute=de}if(b=b||Z,!!Z&&(U(c,!0),v&&(r||V||!T&&G))){const[re,Y]=s0({nodeId:T,dragItems:c,nodeLookup:F});r==null||r(v,c,re,Y),V==null||V(v,re,Y),T||G==null||G(v,Y)}}async function R(){if(!h)return;const{transform:A,panBy:N,autoPanSpeed:F,autoPanOnNodeDrag:L}=t();if(!L){u=!1,cancelAnimationFrame(l);return}const[D,H]=cz(f,h,F);(D!==0||H!==0)&&(i.x=(i.x??0)-D/A[2],i.y=(i.y??0)-H/A[2],await N({x:D,y:H})&&M(i)),l=requestAnimationFrame(R)}function E(A){var Q;const{nodeLookup:N,multiSelectionActive:F,nodesDraggable:L,transform:D,snapGrid:H,snapToGrid:B,selectNodesOnDrag:V,onNodeDragStart:G,onSelectionDragStart:_,unselectNodesAndEdges:U}=t();p=!0,(!V||!P)&&!F&&T&&((Q=N.get(T))!=null&&Q.selected||U()),P&&V&&T&&(e==null||e(T));const Z=Ep(A.sourceEvent,{transform:D,snapGrid:H,snapToGrid:B,containerBounds:h});if(i=Z,c=Pae(N,L,Z,T),c.size>0&&(n||G||!T&&_)){const[ee,ne]=s0({nodeId:T,dragItems:c,nodeLookup:N});n==null||n(A.sourceEvent,c,ee,ne),G==null||G(A.sourceEvent,ee,ne),T||_==null||_(A.sourceEvent,ne)}}const O=_O().clickDistance($).on("start",A=>{const{domNode:N,nodeDragThreshold:F,transform:L,snapGrid:D,snapToGrid:H}=t();h=(N==null?void 0:N.getBoundingClientRect())||null,y=!1,b=!1,v=A.sourceEvent,F===0&&E(A),i=Ep(A.sourceEvent,{transform:L,snapGrid:D,snapToGrid:H,containerBounds:h}),f=ui(A.sourceEvent,h)}).on("drag",A=>{const{autoPanOnNodeDrag:N,transform:F,snapGrid:L,snapToGrid:D,nodeDragThreshold:H,nodeLookup:B}=t(),V=Ep(A.sourceEvent,{transform:F,snapGrid:L,snapToGrid:D,containerBounds:h});if(v=A.sourceEvent,(A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||T&&!B.has(T))&&(y=!0),!y){if(!u&&N&&p&&(u=!0,R()),!p){const G=ui(A.sourceEvent,h),_=G.x-f.x,U=G.y-f.y;Math.sqrt(_*_+U*U)>H&&E(A)}(i.x!==V.xSnapped||i.y!==V.ySnapped)&&c&&p&&(f=ui(A.sourceEvent,h),M(V))}}).on("end",A=>{if(!(!p||y)&&(u=!1,p=!1,cancelAnimationFrame(l),c.size>0)){const{nodeLookup:N,updateNodePositions:F,onNodeDragStop:L,onSelectionDragStop:D}=t();if(b&&(F(c,!1),b=!1),o||L||!T&&D){const[H,B]=s0({nodeId:T,dragItems:c,nodeLookup:N,dragging:!1});o==null||o(A.sourceEvent,c,H,B),L==null||L(A.sourceEvent,H,B),T||D==null||D(A.sourceEvent,B)}}}).filter(A=>{const N=A.target;return!A.button&&(!j||!MP(N,`.${j}`,k))&&(!w||MP(N,w,k))});g.call(O)}function S(){g==null||g.on(".drag",null)}return{update:C,destroy:S}}function Rae(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Jp(o,Md(i))>0&&r.push(i);return r}const $ae=250;function Oae(e,t,n,r){var c,u;let o=[],i=1/0;const l=Rae(e,n,t+$ae);for(const f of l){const h=[...((c=f.internals.handleBounds)==null?void 0:c.source)??[],...((u=f.internals.handleBounds)==null?void 0:u.target)??[]];for(const p of h){if(r.nodeId===p.nodeId&&r.type===p.type&&r.id===p.id)continue;const{x:g,y}=Gc(f,p,p.position,!0),b=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(y-e.y,2));b>t||(b<i?(o=[{...p,x:g,y}],i=b):b===i&&o.push({...p,x:g,y}))}}if(!o.length)return null;if(o.length>1){const f=r.type==="source"?"target":"source";return o.find(h=>h.type===f)??o[0]}return o[0]}function jz(e,t,n,r,o,i=!1){var f,h,p;const l=r.get(e);if(!l)return null;const c=o==="strict"?(f=l.internals.handleBounds)==null?void 0:f[t]:[...((h=l.internals.handleBounds)==null?void 0:h.source)??[],...((p=l.internals.handleBounds)==null?void 0:p.target)??[]],u=(n?c==null?void 0:c.find(g=>g.id===n):c==null?void 0:c[0])??null;return u&&i?{...u,...Gc(l,u,u.position,!0)}:u}function kz(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function zae(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Iz=()=>!0;function Lae(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:l,domNode:c,nodeLookup:u,lib:f,autoPanOnConnect:h,flowId:p,panBy:g,cancelConnection:y,onConnectStart:b,onConnect:v,onConnectEnd:C,isValidConnection:S=Iz,onReconnectEnd:j,updateConnection:w,getTransform:k,getFromHandle:P,autoPanSpeed:T,dragThreshold:$=1,handleDomNode:M}){const R=pz(e.target);let E=0,O;const{x:A,y:N}=ui(e),F=kz(i,M),L=c==null?void 0:c.getBoundingClientRect();let D=!1;if(!L||!F)return;const H=jz(o,F,r,u,t);if(!H)return;let B=ui(e,L),V=!1,G=null,_=!1,U=null;function Z(){if(!h||!L)return;const[he,de]=cz(B,L,T);g({x:he,y:de}),E=requestAnimationFrame(Z)}const Q={...H,nodeId:o,type:F,position:H.position},ee=u.get(o);let re={inProgress:!0,isValid:null,from:Gc(ee,Q,Rt.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:ee,to:B,toHandle:null,toPosition:yP[Q.position],toNode:null,pointer:B};function Y(){D=!0,w(re),b==null||b(e,{nodeId:o,handleId:r,handleType:F})}$===0&&Y();function ie(he){if(!D){const{x:we,y:Oe}=ui(he),be=we-A,Fe=Oe-N;if(!(be*be+Fe*Fe>$*$))return;Y()}if(!P()||!Q){ce(he);return}const de=k();B=ui(he,L),O=Oae(Dh(B,de,!1,[1,1]),n,u,Q),V||(Z(),V=!0);const le=Ez(he,{handle:O,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:l?"target":"source",isValidConnection:S,doc:R,lib:f,flowId:p,nodeLookup:u});U=le.handleDomNode,G=le.connection,_=zae(!!O,le.isValid);const ge=u.get(o),Se=ge?Gc(ge,Q,Rt.Left,!0):re.from,ke={...re,from:Se,isValid:_,to:le.toHandle&&_?vx({x:le.toHandle.x,y:le.toHandle.y},de):B,toHandle:le.toHandle,toPosition:_&&le.toHandle?le.toHandle.position:yP[Q.position],toNode:le.toHandle?u.get(le.toHandle.nodeId):null,pointer:B};w(ke),re=ke}function ce(he){if(!("touches"in he&&he.touches.length>0)){if(D){(O||U)&&G&&_&&(v==null||v(G));const{inProgress:de,...le}=re,ge={...le,toPosition:re.toHandle?re.toPosition:null};C==null||C(he,ge),i&&(j==null||j(he,ge))}y(),cancelAnimationFrame(E),V=!1,_=!1,G=null,U=null,R.removeEventListener("mousemove",ie),R.removeEventListener("mouseup",ce),R.removeEventListener("touchmove",ie),R.removeEventListener("touchend",ce)}}R.addEventListener("mousemove",ie),R.addEventListener("mouseup",ce),R.addEventListener("touchmove",ie),R.addEventListener("touchend",ce)}function Ez(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:l,lib:c,flowId:u,isValidConnection:f=Iz,nodeLookup:h}){const p=i==="target",g=t?l.querySelector(`.${c}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:y,y:b}=ui(e),v=l.elementFromPoint(y,b),C=v!=null&&v.classList.contains(`${c}-flow__handle`)?v:g,S={handleDomNode:C,isValid:!1,connection:null,toHandle:null};if(C){const j=kz(void 0,C),w=C.getAttribute("data-nodeid"),k=C.getAttribute("data-handleid"),P=C.classList.contains("connectable"),T=C.classList.contains("connectableend");if(!w||!j)return S;const $={source:p?w:r,sourceHandle:p?k:o,target:p?r:w,targetHandle:p?o:k};S.connection=$;const R=P&&T&&(n===Pd.Strict?p&&j==="source"||!p&&j==="target":w!==r||k!==o);S.isValid=R&&f($),S.toHandle=jz(w,j,k,h,n,!0)}return S}const $C={onPointerDown:Lae,isValid:Ez};function Dae({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=is(e);function i({translateExtent:c,width:u,height:f,zoomStep:h=1,pannable:p=!0,zoomable:g=!0,inversePan:y=!1}){const b=w=>{if(w.sourceEvent.type!=="wheel"||!t)return;const k=n(),P=w.sourceEvent.ctrlKey&&eh()?10:1,T=-w.sourceEvent.deltaY*(w.sourceEvent.deltaMode===1?.05:w.sourceEvent.deltaMode?1:.002)*h,$=k[2]*Math.pow(2,T*P);t.scaleTo($)};let v=[0,0];const C=w=>{(w.sourceEvent.type==="mousedown"||w.sourceEvent.type==="touchstart")&&(v=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY])},S=w=>{const k=n();if(w.sourceEvent.type!=="mousemove"&&w.sourceEvent.type!=="touchmove"||!t)return;const P=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY],T=[P[0]-v[0],P[1]-v[1]];v=P;const $=r()*Math.max(k[2],Math.log(k[2]))*(y?-1:1),M={x:k[0]-T[0]*$,y:k[1]-T[1]*$},R=[[0,0],[u,f]];t.setViewportConstrained({x:M.x,y:M.y,zoom:k[2]},R,c)},j=tz().on("start",C).on("zoom",p?S:null).on("zoom.wheel",g?b:null);o.call(j,{})}function l(){o.on("zoom",null)}return{update:i,destroy:l,pointer:ni}}const gy=e=>({x:e.x,y:e.y,zoom:e.k}),i0=({x:e,y:t,zoom:n})=>py.translate(e,t).scale(n),qu=(e,t)=>e.target.closest(`.${t}`),Pz=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Aae=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,l0=(e,t=0,n=Aae,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},Tz=e=>{const t=e.ctrlKey&&eh()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Fae({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:u,onPanZoomEnd:f}){return h=>{if(qu(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(h.ctrlKey&&l){const C=ni(h),S=Tz(h),j=p*Math.pow(2,S);r.scaleTo(n,j,C,h);return}const g=h.deltaMode===1?20:1;let y=o===Tc.Vertical?0:h.deltaX*g,b=o===Tc.Horizontal?0:h.deltaY*g;!eh()&&h.shiftKey&&o!==Tc.Vertical&&(y=h.deltaY*g,b=0),r.translateBy(n,-(y/p)*i,-(b/p)*i,{internal:!0});const v=gy(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(h,v),e.panScrollTimeout=setTimeout(()=>{f==null||f(h,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(h,v))}}function Nae({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",l=!t&&i&&!r.ctrlKey,c=qu(r,e);if(r.ctrlKey&&i&&c&&r.preventDefault(),l||c)return null;r.preventDefault(),n.call(this,r,o)}}function _ae({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,l,c;if((i=r.sourceEvent)!=null&&i.internal)return;const o=gy(r.transform);e.mouseButton=((l=r.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((c=r.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function Hae({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var l,c;e.usedRightMouseButton=!!(n&&Pz(t,e.mouseButton??0)),(l=i.sourceEvent)!=null&&l.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!((c=i.sourceEvent)!=null&&c.internal)&&(o==null||o(i.sourceEvent,gy(i.transform)))}}function Bae({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return l=>{var c;if(!((c=l.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,i&&Pz(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const u=gy(l.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(l.sourceEvent,u)},n?150:0)}}}function Wae({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:c,noPanClassName:u,lib:f,connectionInProgress:h}){return p=>{var C;const g=e||t,y=n&&p.ctrlKey,b=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(qu(p,`${f}-flow__node`)||qu(p,`${f}-flow__edge`)))return!0;if(!r&&!g&&!o&&!i&&!n||l||h&&!b||qu(p,c)&&b||qu(p,u)&&(!b||o&&b&&!e)||!n&&p.ctrlKey&&b)return!1;if(!n&&p.type==="touchstart"&&((C=p.touches)==null?void 0:C.length)>1)return p.preventDefault(),!1;if(!g&&!o&&!y&&b||!r&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(r)&&!r.includes(p.button)&&p.type==="mousedown")return!1;const v=Array.isArray(r)&&r.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||b)&&v}}function Vae({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:u}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),p=tz().scaleExtent([t,n]).translateExtent(r),g=is(e).call(p);j({x:o.x,y:o.y,zoom:Td(o.zoom,t,n)},[[0,0],[h.width,h.height]],r);const y=g.on("wheel.zoom"),b=g.on("dblclick.zoom");p.wheelDelta(Tz);function v(O,A){return g?new Promise(N=>{p==null||p.interpolate((A==null?void 0:A.interpolate)==="linear"?Ip:Lg).transform(l0(g,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),O)}):Promise.resolve(!1)}function C({noWheelClassName:O,noPanClassName:A,onPaneContextMenu:N,userSelectionActive:F,panOnScroll:L,panOnDrag:D,panOnScrollMode:H,panOnScrollSpeed:B,preventScrolling:V,zoomOnPinch:G,zoomOnScroll:_,zoomOnDoubleClick:U,zoomActivationKeyPressed:Z,lib:Q,onTransformChange:ee,connectionInProgress:ne,paneClickDistance:re,selectionOnDrag:Y}){F&&!f.isZoomingOrPanning&&S();const ie=L&&!Z&&!F;p.clickDistance(Y?1/0:!ci(re)||re<0?0:re);const ce=ie?Fae({zoomPanValues:f,noWheelClassName:O,d3Selection:g,d3Zoom:p,panOnScrollMode:H,panOnScrollSpeed:B,zoomOnPinch:G,onPanZoomStart:l,onPanZoom:i,onPanZoomEnd:c}):Nae({noWheelClassName:O,preventScrolling:V,d3ZoomHandler:y});if(g.on("wheel.zoom",ce,{passive:!1}),!F){const de=_ae({zoomPanValues:f,onDraggingChange:u,onPanZoomStart:l});p.on("start",de);const le=Hae({zoomPanValues:f,panOnDrag:D,onPaneContextMenu:!!N,onPanZoom:i,onTransformChange:ee});p.on("zoom",le);const ge=Bae({zoomPanValues:f,panOnDrag:D,panOnScroll:L,onPaneContextMenu:N,onPanZoomEnd:c,onDraggingChange:u});p.on("end",ge)}const he=Wae({zoomActivationKeyPressed:Z,panOnDrag:D,zoomOnScroll:_,panOnScroll:L,zoomOnDoubleClick:U,zoomOnPinch:G,userSelectionActive:F,noPanClassName:A,noWheelClassName:O,lib:Q,connectionInProgress:ne});p.filter(he),U?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function S(){p.on("zoom",null)}async function j(O,A,N){const F=i0(O),L=p==null?void 0:p.constrain()(F,A,N);return L&&await v(L),new Promise(D=>D(L))}async function w(O,A){const N=i0(O);return await v(N,A),new Promise(F=>F(N))}function k(O){if(g){const A=i0(O),N=g.property("__zoom");(N.k!==O.zoom||N.x!==O.x||N.y!==O.y)&&(p==null||p.transform(g,A,null,{sync:!0}))}}function P(){const O=g?ez(g.node()):{x:0,y:0,k:1};return{x:O.x,y:O.y,zoom:O.k}}function T(O,A){return g?new Promise(N=>{p==null||p.interpolate((A==null?void 0:A.interpolate)==="linear"?Ip:Lg).scaleTo(l0(g,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),O)}):Promise.resolve(!1)}function $(O,A){return g?new Promise(N=>{p==null||p.interpolate((A==null?void 0:A.interpolate)==="linear"?Ip:Lg).scaleBy(l0(g,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),O)}):Promise.resolve(!1)}function M(O){p==null||p.scaleExtent(O)}function R(O){p==null||p.translateExtent(O)}function E(O){const A=!ci(O)||O<0?0:O;p==null||p.clickDistance(A)}return{update:C,destroy:S,setViewport:w,setViewportConstrained:j,getViewport:P,scaleTo:T,scaleBy:$,setScaleExtent:M,setTranslateExtent:R,syncViewport:k,setClickDistance:E}}var $d;(function(e){e.Line="line",e.Handle="handle"})($d||($d={}));function Gae({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){const l=e-t,c=n-r,u=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&o&&(u[0]=u[0]*-1),c&&i&&(u[1]=u[1]*-1),u}function RP(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function Zl(e,t){return Math.max(0,t-e)}function Jl(e,t){return Math.max(0,e-t)}function xg(e,t,n){return Math.max(0,t-e,e-n)}function $P(e,t){return e?!t:t}function Uae(e,t,n,r,o,i,l,c){let{affectsX:u,affectsY:f}=t;const{isHorizontal:h,isVertical:p}=t,g=h&&p,{xSnapped:y,ySnapped:b}=n,{minWidth:v,maxWidth:C,minHeight:S,maxHeight:j}=r,{x:w,y:k,width:P,height:T,aspectRatio:$}=e;let M=Math.floor(h?y-e.pointerX:0),R=Math.floor(p?b-e.pointerY:0);const E=P+(u?-M:M),O=T+(f?-R:R),A=-i[0]*P,N=-i[1]*T;let F=xg(E,v,C),L=xg(O,S,j);if(l){let B=0,V=0;u&&M<0?B=Zl(w+M+A,l[0][0]):!u&&M>0&&(B=Jl(w+E+A,l[1][0])),f&&R<0?V=Zl(k+R+N,l[0][1]):!f&&R>0&&(V=Jl(k+O+N,l[1][1])),F=Math.max(F,B),L=Math.max(L,V)}if(c){let B=0,V=0;u&&M>0?B=Jl(w+M,c[0][0]):!u&&M<0&&(B=Zl(w+E,c[1][0])),f&&R>0?V=Jl(k+R,c[0][1]):!f&&R<0&&(V=Zl(k+O,c[1][1])),F=Math.max(F,B),L=Math.max(L,V)}if(o){if(h){const B=xg(E/$,S,j)*$;if(F=Math.max(F,B),l){let V=0;!u&&!f||u&&!f&&g?V=Jl(k+N+E/$,l[1][1])*$:V=Zl(k+N+(u?M:-M)/$,l[0][1])*$,F=Math.max(F,V)}if(c){let V=0;!u&&!f||u&&!f&&g?V=Zl(k+E/$,c[1][1])*$:V=Jl(k+(u?M:-M)/$,c[0][1])*$,F=Math.max(F,V)}}if(p){const B=xg(O*$,v,C)/$;if(L=Math.max(L,B),l){let V=0;!u&&!f||f&&!u&&g?V=Jl(w+O*$+A,l[1][0])/$:V=Zl(w+(f?R:-R)*$+A,l[0][0])/$,L=Math.max(L,V)}if(c){let V=0;!u&&!f||f&&!u&&g?V=Zl(w+O*$,c[1][0])/$:V=Jl(w+(f?R:-R)*$,c[0][0])/$,L=Math.max(L,V)}}}R=R+(R<0?L:-L),M=M+(M<0?F:-F),o&&(g?E>O*$?R=($P(u,f)?-M:M)/$:M=($P(u,f)?-R:R)*$:h?(R=M/$,f=u):(M=R*$,u=f));const D=u?w+M:w,H=f?k+R:k;return{width:P+(u?-M:M),height:T+(f?-R:R),x:i[0]*M*(u?-1:1)+D,y:i[1]*R*(f?-1:1)+H}}const Mz={width:0,height:0,x:0,y:0},qae={...Mz,pointerX:0,pointerY:0,aspectRatio:1};function Kae(e){return[[0,0],[e.measured.width,e.measured.height]]}function Qae(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,l=e.measured.height??0,c=n[0]*i,u=n[1]*l;return[[r-c,o-u],[r+i-c,o+l-u]]}function Yae({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=is(e);let l={controlDirection:RP("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:f,boundaries:h,keepAspectRatio:p,resizeDirection:g,onResizeStart:y,onResize:b,onResizeEnd:v,shouldResize:C}){let S={...Mz},j={...qae};l={boundaries:h,resizeDirection:g,keepAspectRatio:p,controlDirection:RP(f)};let w,k=null,P=[],T,$,M,R=!1;const E=_O().on("start",O=>{const{nodeLookup:A,transform:N,snapGrid:F,snapToGrid:L,nodeOrigin:D,paneDomNode:H}=n();if(w=A.get(t),!w)return;k=(H==null?void 0:H.getBoundingClientRect())??null;const{xSnapped:B,ySnapped:V}=Ep(O.sourceEvent,{transform:N,snapGrid:F,snapToGrid:L,containerBounds:k});S={width:w.measured.width??0,height:w.measured.height??0,x:w.position.x??0,y:w.position.y??0},j={...S,pointerX:B,pointerY:V,aspectRatio:S.width/S.height},T=void 0,w.parentId&&(w.extent==="parent"||w.expandParent)&&(T=A.get(w.parentId),$=T&&w.extent==="parent"?Kae(T):void 0),P=[],M=void 0;for(const[G,_]of A)if(_.parentId===t&&(P.push({id:G,position:{..._.position},extent:_.extent}),_.extent==="parent"||_.expandParent)){const U=Qae(_,w,_.origin??D);M?M=[[Math.min(U[0][0],M[0][0]),Math.min(U[0][1],M[0][1])],[Math.max(U[1][0],M[1][0]),Math.max(U[1][1],M[1][1])]]:M=U}y==null||y(O,{...S})}).on("drag",O=>{const{transform:A,snapGrid:N,snapToGrid:F,nodeOrigin:L}=n(),D=Ep(O.sourceEvent,{transform:A,snapGrid:N,snapToGrid:F,containerBounds:k}),H=[];if(!w)return;const{x:B,y:V,width:G,height:_}=S,U={},Z=w.origin??L,{width:Q,height:ee,x:ne,y:re}=Uae(j,l.controlDirection,D,l.boundaries,l.keepAspectRatio,Z,$,M),Y=Q!==G,ie=ee!==_,ce=ne!==B&&Y,he=re!==V&&ie;if(!ce&&!he&&!Y&&!ie)return;if((ce||he||Z[0]===1||Z[1]===1)&&(U.x=ce?ne:S.x,U.y=he?re:S.y,S.x=U.x,S.y=U.y,P.length>0)){const Se=ne-B,ke=re-V;for(const we of P)we.position={x:we.position.x-Se+Z[0]*(Q-G),y:we.position.y-ke+Z[1]*(ee-_)},H.push(we)}if((Y||ie)&&(U.width=Y&&(!l.resizeDirection||l.resizeDirection==="horizontal")?Q:S.width,U.height=ie&&(!l.resizeDirection||l.resizeDirection==="vertical")?ee:S.height,S.width=U.width,S.height=U.height),T&&w.expandParent){const Se=Z[0]*(U.width??0);U.x&&U.x<Se&&(S.x=Se,j.x=j.x-(U.x-Se));const ke=Z[1]*(U.height??0);U.y&&U.y<ke&&(S.y=ke,j.y=j.y-(U.y-ke))}const de=Gae({width:S.width,prevWidth:G,height:S.height,prevHeight:_,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),le={...S,direction:de};(C==null?void 0:C(O,le))!==!1&&(R=!0,b==null||b(O,le),r(U,H))}).on("end",O=>{R&&(v==null||v(O,{...S}),o==null||o({...S}),R=!1)});i.call(E)}function u(){i.on(".drag",null)}return{update:c,destroy:u}}var a0={exports:{}},c0={};/**
|
|
364
|
+
* @license React
|
|
365
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
366
|
+
*
|
|
367
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
368
|
+
*
|
|
369
|
+
* This source code is licensed under the MIT license found in the
|
|
370
|
+
* LICENSE file in the root directory of this source tree.
|
|
371
|
+
*/var OP;function Xae(){if(OP)return c0;OP=1;var e=Dd(),t=FR();function n(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,c=e.useMemo,u=e.useDebugValue;return c0.useSyncExternalStoreWithSelector=function(f,h,p,g,y){var b=i(null);if(b.current===null){var v={hasValue:!1,value:null};b.current=v}else v=b.current;b=c(function(){function S(T){if(!j){if(j=!0,w=T,T=g(T),y!==void 0&&v.hasValue){var $=v.value;if(y($,T))return k=$}return k=T}if($=k,r(w,T))return $;var M=g(T);return y!==void 0&&y($,M)?(w=T,$):(w=T,k=M)}var j=!1,w,k,P=p===void 0?null:p;return[function(){return S(h())},P===null?void 0:function(){return S(P())}]},[h,p,g,y]);var C=o(f,b[0],b[1]);return l(function(){v.hasValue=!0,v.value=C},[C]),u(C),C},c0}var zP;function Zae(){return zP||(zP=1,a0.exports=Xae()),a0.exports}var Jae=Zae();const ece=Ld(Jae),tce={},LP=e=>{let t;const n=new Set,r=(h,p)=>{const g=typeof h=="function"?h(t):h;if(!Object.is(g,t)){const y=t;t=p??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,y))}},o=()=>t,u={setState:r,getState:o,getInitialState:()=>f,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(tce?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=t=e(r,o,u);return u},nce=e=>e?LP(e):LP,{useDebugValue:rce}=br,{useSyncExternalStoreWithSelector:oce}=ece,sce=e=>e;function Rz(e,t=sce,n){const r=oce(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return rce(r),r}const DP=(e,t)=>{const n=nce(e),r=(o,i=t)=>Rz(n,o,i);return Object.assign(r,n),r},ice=(e,t)=>e?DP(e,t):DP;function lr(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const xy=m.createContext(null),lce=xy.Provider,$z=Ni.error001();function dn(e,t){const n=m.useContext(xy);if(n===null)throw new Error($z);return Rz(n,e,t)}function ar(){const e=m.useContext(xy);if(e===null)throw new Error($z);return m.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const AP={display:"none"},ace={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Oz="react-flow__node-desc",zz="react-flow__edge-desc",cce="react-flow__aria-live",uce=e=>e.ariaLiveMessage,dce=e=>e.ariaLabelConfig;function fce({rfId:e}){const t=dn(uce);return s.jsx("div",{id:`${cce}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:ace,children:t})}function pce({rfId:e,disableKeyboardA11y:t}){const n=dn(dce);return s.jsxs(s.Fragment,{children:[s.jsx("div",{id:`${Oz}-${e}`,style:AP,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),s.jsx("div",{id:`${zz}-${e}`,style:AP,children:n["edge.a11yDescription.default"]}),!t&&s.jsx(fce,{rfId:e})]})}const Od=m.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{const l=`${e}`.split("-");return s.jsx("div",{className:Mr(["react-flow__panel",n,...l]),style:r,ref:i,...o,children:t})});Od.displayName="Panel";function hce({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:s.jsx(Od,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:s.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const mce=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},yg=e=>e.id;function gce(e,t){return lr(e.selectedNodes.map(yg),t.selectedNodes.map(yg))&&lr(e.selectedEdges.map(yg),t.selectedEdges.map(yg))}function xce({onSelectionChange:e}){const t=ar(),{selectedNodes:n,selectedEdges:r}=dn(mce,gce);return m.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,r,e]),null}const yce=e=>!!e.onSelectionChangeHandlers;function bce({onSelectionChange:e}){const t=dn(yce);return e||t?s.jsx(xce,{onSelectionChange:e}):null}const Lz=[0,0],vce={x:0,y:0,zoom:1},Cce=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],FP=[...Cce,"rfId"],wce=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),NP={translateExtent:Yp,nodeOrigin:Lz,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Sce(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:u}=dn(wce,lr),f=ar();m.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{h.current=NP,c()}),[]);const h=m.useRef(NP);return m.useEffect(()=>{for(const p of FP){const g=e[p],y=h.current[p];g!==y&&(typeof e[p]>"u"||(p==="nodes"?t(g):p==="edges"?n(g):p==="minZoom"?r(g):p==="maxZoom"?o(g):p==="translateExtent"?i(g):p==="nodeExtent"?l(g):p==="ariaLabelConfig"?f.setState({ariaLabelConfig:aae(g)}):p==="fitView"?f.setState({fitViewQueued:g}):p==="fitViewOptions"?f.setState({fitViewOptions:g}):f.setState({[p]:g})))}h.current=e},FP.map(p=>e[p])),null}function _P(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function jce(e){var r;const[t,n]=m.useState(e==="system"?null:e);return m.useEffect(()=>{if(e!=="system"){n(e);return}const o=_P(),i=()=>n(o!=null&&o.matches?"dark":"light");return i(),o==null||o.addEventListener("change",i),()=>{o==null||o.removeEventListener("change",i)}},[e]),t!==null?t:(r=_P())!=null&&r.matches?"dark":"light"}const HP=typeof document<"u"?document:null;function th(e=null,t={target:HP,actInsideInputWithModifier:!0}){const[n,r]=m.useState(!1),o=m.useRef(!1),i=m.useRef(new Set([])),[l,c]=m.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
|
|
372
|
+
`).replace(`
|
|
373
|
+
|
|
374
|
+
`,`
|
|
375
|
+
+`).split(`
|
|
376
|
+
`)),h=f.reduce((p,g)=>p.concat(...g),[]);return[f,h]}return[[],[]]},[e]);return m.useEffect(()=>{const u=(t==null?void 0:t.target)??HP,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=y=>{var C,S;if(o.current=y.ctrlKey||y.metaKey||y.shiftKey||y.altKey,(!o.current||o.current&&!f)&&hz(y))return!1;const v=WP(y.code,c);if(i.current.add(y[v]),BP(l,i.current,!1)){const j=((S=(C=y.composedPath)==null?void 0:C.call(y))==null?void 0:S[0])||y.target,w=(j==null?void 0:j.nodeName)==="BUTTON"||(j==null?void 0:j.nodeName)==="A";t.preventDefault!==!1&&(o.current||!w)&&y.preventDefault(),r(!0)}},p=y=>{const b=WP(y.code,c);BP(l,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(y[b]),y.key==="Meta"&&i.current.clear(),o.current=!1},g=()=>{i.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",h),u==null||u.addEventListener("keyup",p),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{u==null||u.removeEventListener("keydown",h),u==null||u.removeEventListener("keyup",p),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function BP(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function WP(e,t){return t.includes(e)?"code":"key"}const kce=()=>{const e=ar();return m.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,o,i],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:o,minZoom:i,maxZoom:l,panZoom:c}=e.getState(),u=wS(t,r,o,i,l,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:i,domNode:l}=e.getState();if(!l)return t;const{x:c,y:u}=l.getBoundingClientRect(),f={x:t.x-c,y:t.y-u},h=n.snapGrid??o,p=n.snapToGrid??i;return Dh(f,r,p,h)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),l=vx(t,n);return{x:l.x+o,y:l.y+i}}}),[])};function Dz(e,t){const n=[],r=new Map,o=[];for(const i of e)if(i.type==="add"){o.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const l=r.get(i.id);l?l.push(i):r.set(i.id,[i])}for(const i of t){const l=r.get(i.id);if(!l){n.push(i);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...i};for(const u of l)Ice(u,c);n.push(c)}return o.length&&o.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function Ice(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Az(e,t){return Dz(e,t)}function Fz(e,t){return Dz(e,t)}function lc(e,t){return{id:e,type:"select",selected:t}}function Ku(e,t=new Set,n=!1){const r=[];for(const[o,i]of e){const l=t.has(o);!(i.selected===void 0&&!l)&&i.selected!==l&&(n&&(i.selected=l),r.push(lc(i.id,l)))}return r}function VP({items:e=[],lookup:t}){var o;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,l]of e.entries()){const c=t.get(l.id),u=((o=c==null?void 0:c.internals)==null?void 0:o.userNode)??c;u!==void 0&&u!==l&&n.push({id:l.id,item:l,type:"replace"}),u===void 0&&n.push({item:l,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function GP(e){return{id:e.id,type:"remove"}}const UP=e=>Zle(e),Ece=e=>iz(e);function Nz(e){return m.forwardRef(e)}const Pce=typeof window<"u"?m.useLayoutEffect:m.useEffect;function qP(e){const[t,n]=m.useState(BigInt(0)),[r]=m.useState(()=>Tce(()=>n(o=>o+BigInt(1))));return Pce(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function Tce(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const _z=m.createContext(null);function Mce({children:e}){const t=ar(),n=m.useCallback(c=>{const{nodes:u=[],setNodes:f,hasDefaultNodes:h,onNodesChange:p,nodeLookup:g,fitViewQueued:y,onNodesChangeMiddlewareMap:b}=t.getState();let v=u;for(const S of c)v=typeof S=="function"?S(v):S;let C=VP({items:v,lookup:g});for(const S of b.values())C=S(C);h&&f(v),C.length>0?p==null||p(C):y&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:j,setNodes:w}=t.getState();S&&w(j)})},[]),r=qP(n),o=m.useCallback(c=>{const{edges:u=[],setEdges:f,hasDefaultEdges:h,onEdgesChange:p,edgeLookup:g}=t.getState();let y=u;for(const b of c)y=typeof b=="function"?b(y):b;h?f(y):p&&p(VP({items:y,lookup:g}))},[]),i=qP(o),l=m.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return s.jsx(_z.Provider,{value:l,children:e})}function Rce(){const e=m.useContext(_z);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const $ce=e=>!!e.panZoom;function TS(){const e=kce(),t=ar(),n=Rce(),r=dn($ce),o=m.useMemo(()=>{const i=p=>t.getState().nodeLookup.get(p),l=p=>{n.nodeQueue.push(p)},c=p=>{n.edgeQueue.push(p)},u=p=>{var S,j;const{nodeLookup:g,nodeOrigin:y}=t.getState(),b=UP(p)?p:g.get(p.id),v=b.parentId?fz(b.position,b.measured,b.parentId,g,y):b.position,C={...b,position:v,width:((S=b.measured)==null?void 0:S.width)??b.width,height:((j=b.measured)==null?void 0:j.height)??b.height};return Md(C)},f=(p,g,y={replace:!1})=>{l(b=>b.map(v=>{if(v.id===p){const C=typeof g=="function"?g(v):g;return y.replace&&UP(C)?C:{...v,...C}}return v}))},h=(p,g,y={replace:!1})=>{c(b=>b.map(v=>{if(v.id===p){const C=typeof g=="function"?g(v):g;return y.replace&&Ece(C)?C:{...v,...C}}return v}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>{var g;return(g=i(p))==null?void 0:g.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(g=>({...g}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:l,setEdges:c,addNodes:p=>{const g=Array.isArray(p)?p:[p];n.nodeQueue.push(y=>[...y,...g])},addEdges:p=>{const g=Array.isArray(p)?p:[p];n.edgeQueue.push(y=>[...y,...g])},toObject:()=>{const{nodes:p=[],edges:g=[],transform:y}=t.getState(),[b,v,C]=y;return{nodes:p.map(S=>({...S})),edges:g.map(S=>({...S})),viewport:{x:b,y:v,zoom:C}}},deleteElements:async({nodes:p=[],edges:g=[]})=>{const{nodes:y,edges:b,onNodesDelete:v,onEdgesDelete:C,triggerNodeChanges:S,triggerEdgeChanges:j,onDelete:w,onBeforeDelete:k}=t.getState(),{nodes:P,edges:T}=await rae({nodesToRemove:p,edgesToRemove:g,nodes:y,edges:b,onBeforeDelete:k}),$=T.length>0,M=P.length>0;if($){const R=T.map(GP);C==null||C(T),j(R)}if(M){const R=P.map(GP);v==null||v(P),S(R)}return(M||$)&&(w==null||w({nodes:P,edges:T})),{deletedNodes:P,deletedEdges:T}},getIntersectingNodes:(p,g=!0,y)=>{const b=vP(p),v=b?p:u(p),C=y!==void 0;return v?(y||t.getState().nodes).filter(S=>{const j=t.getState().nodeLookup.get(S.id);if(j&&!b&&(S.id===p.id||!j.internals.positionAbsolute))return!1;const w=Md(C?S:j),k=Jp(w,v);return g&&k>0||k>=w.width*w.height||k>=v.width*v.height}):[]},isNodeIntersecting:(p,g,y=!0)=>{const v=vP(p)?p:u(p);if(!v)return!1;const C=Jp(v,g);return y&&C>0||C>=g.width*g.height||C>=v.width*v.height},updateNode:f,updateNodeData:(p,g,y={replace:!1})=>{f(p,b=>{const v=typeof g=="function"?g(b):g;return y.replace?{...b,data:v}:{...b,data:{...b.data,...v}}},y)},updateEdge:h,updateEdgeData:(p,g,y={replace:!1})=>{h(p,b=>{const v=typeof g=="function"?g(b):g;return y.replace?{...b,data:v}:{...b,data:{...b.data,...v}}},y)},getNodesBounds:p=>{const{nodeLookup:g,nodeOrigin:y}=t.getState();return Jle(p,{nodeLookup:g,nodeOrigin:y})},getHandleConnections:({type:p,id:g,nodeId:y})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${y}-${p}${g?`-${g}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:p,handleId:g,nodeId:y})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${y}${p?g?`-${p}-${g}`:`-${p}`:""}`))==null?void 0:b.values())??[])},fitView:async p=>{const g=t.getState().fitViewResolver??lae();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:g}),n.nodeQueue.push(y=>[...y]),g.promise}}},[]);return m.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const KP=e=>e.selected,Oce=typeof window<"u"?window:void 0;function zce({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ar(),{deleteElements:r}=TS(),o=th(e,{actInsideInputWithModifier:!1}),i=th(t,{target:Oce});m.useEffect(()=>{if(o){const{edges:l,nodes:c}=n.getState();r({nodes:c.filter(KP),edges:l.filter(KP)}),n.setState({nodesSelectionActive:!1})}},[o]),m.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function Lce(e){const t=ar();m.useEffect(()=>{const n=()=>{var o,i,l,c;if(!e.current||!(((i=(o=e.current).checkVisibility)==null?void 0:i.call(o))??!0))return!1;const r=SS(e.current);(r.height===0||r.width===0)&&((c=(l=t.getState()).onError)==null||c.call(l,"004",Ni.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const yy={position:"absolute",width:"100%",height:"100%",top:0,left:0},Dce=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Ace({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:i=Tc.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:u,translateExtent:f,minZoom:h,maxZoom:p,zoomActivationKeyCode:g,preventScrolling:y=!0,children:b,noWheelClassName:v,noPanClassName:C,onViewportChange:S,isControlledViewport:j,paneClickDistance:w,selectionOnDrag:k}){const P=ar(),T=m.useRef(null),{userSelectionActive:$,lib:M,connectionInProgress:R}=dn(Dce,lr),E=th(g),O=m.useRef();Lce(T);const A=m.useCallback(N=>{S==null||S({x:N[0],y:N[1],zoom:N[2]}),j||P.setState({transform:N})},[S,j]);return m.useEffect(()=>{if(T.current){O.current=Vae({domNode:T.current,minZoom:h,maxZoom:p,translateExtent:f,viewport:u,onDraggingChange:D=>P.setState({paneDragging:D}),onPanZoomStart:(D,H)=>{const{onViewportChangeStart:B,onMoveStart:V}=P.getState();V==null||V(D,H),B==null||B(H)},onPanZoom:(D,H)=>{const{onViewportChange:B,onMove:V}=P.getState();V==null||V(D,H),B==null||B(H)},onPanZoomEnd:(D,H)=>{const{onViewportChangeEnd:B,onMoveEnd:V}=P.getState();V==null||V(D,H),B==null||B(H)}});const{x:N,y:F,zoom:L}=O.current.getViewport();return P.setState({panZoom:O.current,transform:[N,F,L],domNode:T.current.closest(".react-flow")}),()=>{var D;(D=O.current)==null||D.destroy()}}},[]),m.useEffect(()=>{var N;(N=O.current)==null||N.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:E,preventScrolling:y,noPanClassName:C,userSelectionActive:$,noWheelClassName:v,lib:M,onTransformChange:A,connectionInProgress:R,selectionOnDrag:k,paneClickDistance:w})},[e,t,n,r,o,i,l,c,E,y,C,$,v,M,A,R,k,w]),s.jsx("div",{className:"react-flow__renderer",ref:T,style:yy,children:b})}const Fce=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Nce(){const{userSelectionActive:e,userSelectionRect:t}=dn(Fce,lr);return e&&t?s.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const u0=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},_ce=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function Hce({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Xp.Full,panOnDrag:r,paneClickDistance:o,selectionOnDrag:i,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:f,onPaneScroll:h,onPaneMouseEnter:p,onPaneMouseMove:g,onPaneMouseLeave:y,children:b}){const v=ar(),{userSelectionActive:C,elementsSelectable:S,dragging:j,connectionInProgress:w}=dn(_ce,lr),k=S&&(e||C),P=m.useRef(null),T=m.useRef(),$=m.useRef(new Set),M=m.useRef(new Set),R=m.useRef(!1),E=B=>{if(R.current||w){R.current=!1;return}u==null||u(B),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},O=B=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){B.preventDefault();return}f==null||f(B)},A=h?B=>h(B):void 0,N=B=>{R.current&&(B.stopPropagation(),R.current=!1)},F=B=>{var ee,ne;const{domNode:V}=v.getState();if(T.current=V==null?void 0:V.getBoundingClientRect(),!T.current)return;const G=B.target===P.current;if(!G&&!!B.target.closest(".nokey")||!e||!(i&&G||t)||B.button!==0||!B.isPrimary)return;(ne=(ee=B.target)==null?void 0:ee.setPointerCapture)==null||ne.call(ee,B.pointerId),R.current=!1;const{x:Z,y:Q}=ui(B.nativeEvent,T.current);v.setState({userSelectionRect:{width:0,height:0,startX:Z,startY:Q,x:Z,y:Q}}),G||(B.stopPropagation(),B.preventDefault())},L=B=>{const{userSelectionRect:V,transform:G,nodeLookup:_,edgeLookup:U,connectionLookup:Z,triggerNodeChanges:Q,triggerEdgeChanges:ee,defaultEdgeOptions:ne,resetSelectedElements:re}=v.getState();if(!T.current||!V)return;const{x:Y,y:ie}=ui(B.nativeEvent,T.current),{startX:ce,startY:he}=V;if(!R.current){const ke=t?0:o;if(Math.hypot(Y-ce,ie-he)<=ke)return;re(),l==null||l(B)}R.current=!0;const de={startX:ce,startY:he,x:Y<ce?Y:ce,y:ie<he?ie:he,width:Math.abs(Y-ce),height:Math.abs(ie-he)},le=$.current,ge=M.current;$.current=new Set(CS(_,de,G,n===Xp.Partial,!0).map(ke=>ke.id)),M.current=new Set;const Se=(ne==null?void 0:ne.selectable)??!0;for(const ke of $.current){const we=Z.get(ke);if(we)for(const{edgeId:Oe}of we.values()){const be=U.get(Oe);be&&(be.selectable??Se)&&M.current.add(Oe)}}if(!CP(le,$.current)){const ke=Ku(_,$.current,!0);Q(ke)}if(!CP(ge,M.current)){const ke=Ku(U,M.current);ee(ke)}v.setState({userSelectionRect:de,userSelectionActive:!0,nodesSelectionActive:!1})},D=B=>{var V,G;B.button===0&&((G=(V=B.target)==null?void 0:V.releasePointerCapture)==null||G.call(V,B.pointerId),!C&&B.target===P.current&&v.getState().userSelectionRect&&(E==null||E(B)),v.setState({userSelectionActive:!1,userSelectionRect:null}),R.current&&(c==null||c(B),v.setState({nodesSelectionActive:$.current.size>0})))},H=r===!0||Array.isArray(r)&&r.includes(0);return s.jsxs("div",{className:Mr(["react-flow__pane",{draggable:H,dragging:j,selection:e}]),onClick:k?void 0:u0(E,P),onContextMenu:u0(O,P),onWheel:u0(A,P),onPointerEnter:k?void 0:p,onPointerMove:k?L:g,onPointerUp:k?D:void 0,onPointerDownCapture:k?F:void 0,onClickCapture:k?N:void 0,onPointerLeave:y,ref:P,style:yy,children:[b,s.jsx(Nce,{})]})}function OC({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:c,onError:u}=t.getState(),f=c.get(e);if(!f){u==null||u("012",Ni.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&l)&&(i({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):o([e])}function Hz({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:l}){const c=ar(),[u,f]=m.useState(!1),h=m.useRef();return m.useEffect(()=>{h.current=Mae({getStoreItems:()=>c.getState(),onNodeMouseDown:p=>{OC({id:p,store:c,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),m.useEffect(()=>{var p,g;if(t)(p=h.current)==null||p.destroy();else if(e.current)return(g=h.current)==null||g.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:o,nodeClickDistance:l}),()=>{var y;(y=h.current)==null||y.destroy()}},[n,r,t,i,e,o]),u}const Bce=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Bz(){const e=ar();return m.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:i,nodesDraggable:l,onError:c,updateNodePositions:u,nodeLookup:f,nodeOrigin:h}=e.getState(),p=new Map,g=Bce(l),y=o?i[0]:5,b=o?i[1]:5,v=n.direction.x*y*n.factor,C=n.direction.y*b*n.factor;for(const[,S]of f){if(!g(S))continue;let j={x:S.internals.positionAbsolute.x+v,y:S.internals.positionAbsolute.y+C};o&&(j=Lh(j,i));const{position:w,positionAbsolute:k}=lz({nodeId:S.id,nextPosition:j,nodeLookup:f,nodeExtent:r,nodeOrigin:h,onError:c});S.position=w,S.internals.positionAbsolute=k,p.set(S.id,S)}u(p)},[])}const MS=m.createContext(null),Wce=MS.Provider;MS.Consumer;const Wz=()=>m.useContext(MS),Vce=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Gce=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:i,connection:l}=r,{fromHandle:c,toHandle:u,isValid:f}=l,h=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:h,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:i===Pd.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!o,valid:h&&f}};function Uce({type:e="source",position:t=Rt.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:l,onConnect:c,children:u,className:f,onMouseDown:h,onTouchStart:p,...g},y){var L,D;const b=l||null,v=e==="target",C=ar(),S=Wz(),{connectOnClick:j,noPanClassName:w,rfId:k}=dn(Vce,lr),{connectingFrom:P,connectingTo:T,clickConnecting:$,isPossibleEndHandle:M,connectionInProcess:R,clickConnectionInProcess:E,valid:O}=dn(Gce(S,b,e),lr);S||(D=(L=C.getState()).onError)==null||D.call(L,"010",Ni.error010());const A=H=>{const{defaultEdgeOptions:B,onConnect:V,hasDefaultEdges:G}=C.getState(),_={...B,...H};if(G){const{edges:U,setEdges:Z}=C.getState();Z(hae(_,U))}V==null||V(_),c==null||c(_)},N=H=>{if(!S)return;const B=mz(H.nativeEvent);if(o&&(B&&H.button===0||!B)){const V=C.getState();$C.onPointerDown(H.nativeEvent,{handleDomNode:H.currentTarget,autoPanOnConnect:V.autoPanOnConnect,connectionMode:V.connectionMode,connectionRadius:V.connectionRadius,domNode:V.domNode,nodeLookup:V.nodeLookup,lib:V.lib,isTarget:v,handleId:b,nodeId:S,flowId:V.rfId,panBy:V.panBy,cancelConnection:V.cancelConnection,onConnectStart:V.onConnectStart,onConnectEnd:V.onConnectEnd,updateConnection:V.updateConnection,onConnect:A,isValidConnection:n||V.isValidConnection,getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,autoPanSpeed:V.autoPanSpeed,dragThreshold:V.connectionDragThreshold})}B?h==null||h(H):p==null||p(H)},F=H=>{const{onClickConnectStart:B,onClickConnectEnd:V,connectionClickStartHandle:G,connectionMode:_,isValidConnection:U,lib:Z,rfId:Q,nodeLookup:ee,connection:ne}=C.getState();if(!S||!G&&!o)return;if(!G){B==null||B(H.nativeEvent,{nodeId:S,handleId:b,handleType:e}),C.setState({connectionClickStartHandle:{nodeId:S,type:e,id:b}});return}const re=pz(H.target),Y=n||U,{connection:ie,isValid:ce}=$C.isValid(H.nativeEvent,{handle:{nodeId:S,id:b,type:e},connectionMode:_,fromNodeId:G.nodeId,fromHandleId:G.id||null,fromType:G.type,isValidConnection:Y,flowId:Q,doc:re,lib:Z,nodeLookup:ee});ce&&ie&&A(ie);const he=structuredClone(ne);delete he.inProgress,he.toPosition=he.toHandle?he.toHandle.position:null,V==null||V(H,he),C.setState({connectionClickStartHandle:null})};return s.jsx("div",{"data-handleid":b,"data-nodeid":S,"data-handlepos":t,"data-id":`${k}-${S}-${b}-${e}`,className:Mr(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",w,f,{source:!v,target:v,connectable:r,connectablestart:o,connectableend:i,clickconnecting:$,connectingfrom:P,connectingto:T,valid:O,connectionindicator:r&&(!R||M)&&(R||E?i:o)}]),onMouseDown:N,onTouchStart:N,onClick:j?F:void 0,ref:y,...g,children:u})}const zd=m.memo(Nz(Uce));function qce({data:e,isConnectable:t,sourcePosition:n=Rt.Bottom}){return s.jsxs(s.Fragment,{children:[e==null?void 0:e.label,s.jsx(zd,{type:"source",position:n,isConnectable:t})]})}function Kce({data:e,isConnectable:t,targetPosition:n=Rt.Top,sourcePosition:r=Rt.Bottom}){return s.jsxs(s.Fragment,{children:[s.jsx(zd,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,s.jsx(zd,{type:"source",position:r,isConnectable:t})]})}function Qce(){return null}function Yce({data:e,isConnectable:t,targetPosition:n=Rt.Top}){return s.jsxs(s.Fragment,{children:[s.jsx(zd,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Cx={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},QP={input:qce,default:Kce,output:Yce,group:Qce};function Xce(e){var t,n,r,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const Zce=e=>{const{width:t,height:n,x:r,y:o}=zh(e.nodeLookup,{filter:i=>!!i.selected});return{width:ci(t)?t:null,height:ci(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function Jce({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ar(),{width:o,height:i,transformString:l,userSelectionActive:c}=dn(Zce,lr),u=Bz(),f=m.useRef(null);if(m.useEffect(()=>{var g;n||(g=f.current)==null||g.focus({preventScroll:!0})},[n]),Hz({nodeRef:f}),c||!o||!i)return null;const h=e?g=>{const y=r.getState().nodes.filter(b=>b.selected);e(g,y)}:void 0,p=g=>{Object.prototype.hasOwnProperty.call(Cx,g.key)&&(g.preventDefault(),u({direction:Cx[g.key],factor:g.shiftKey?4:1}))};return s.jsx("div",{className:Mr(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:s.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:o,height:i}})})}const YP=typeof window<"u"?window:void 0,eue=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Vz({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:u,selectionKeyCode:f,selectionOnDrag:h,selectionMode:p,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:b,panActivationKeyCode:v,zoomActivationKeyCode:C,elementsSelectable:S,zoomOnScroll:j,zoomOnPinch:w,panOnScroll:k,panOnScrollSpeed:P,panOnScrollMode:T,zoomOnDoubleClick:$,panOnDrag:M,defaultViewport:R,translateExtent:E,minZoom:O,maxZoom:A,preventScrolling:N,onSelectionContextMenu:F,noWheelClassName:L,noPanClassName:D,disableKeyboardA11y:H,onViewportChange:B,isControlledViewport:V}){const{nodesSelectionActive:G,userSelectionActive:_}=dn(eue,lr),U=th(f,{target:YP}),Z=th(v,{target:YP}),Q=Z||M,ee=Z||k,ne=h&&Q!==!0,re=U||_||ne;return zce({deleteKeyCode:u,multiSelectionKeyCode:b}),s.jsx(Ace,{onPaneContextMenu:i,elementsSelectable:S,zoomOnScroll:j,zoomOnPinch:w,panOnScroll:ee,panOnScrollSpeed:P,panOnScrollMode:T,zoomOnDoubleClick:$,panOnDrag:!U&&Q,defaultViewport:R,translateExtent:E,minZoom:O,maxZoom:A,zoomActivationKeyCode:C,preventScrolling:N,noWheelClassName:L,noPanClassName:D,onViewportChange:B,isControlledViewport:V,paneClickDistance:c,selectionOnDrag:ne,children:s.jsxs(Hce,{onSelectionStart:g,onSelectionEnd:y,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:Q,isSelecting:!!re,selectionMode:p,selectionKeyPressed:U,paneClickDistance:c,selectionOnDrag:ne,children:[e,G&&s.jsx(Jce,{onSelectionContextMenu:F,noPanClassName:D,disableKeyboardA11y:H})]})})}Vz.displayName="FlowRenderer";const tue=m.memo(Vz),nue=e=>t=>e?CS(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function rue(e){return dn(m.useCallback(nue(e),[e]),lr)}const oue=e=>e.updateNodeInternals;function sue(){const e=dn(oue),[t]=m.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(o=>{const i=o.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:o.target,force:!0})}),e(r)}));return m.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function iue({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=ar(),i=m.useRef(null),l=m.useRef(null),c=m.useRef(e.sourcePosition),u=m.useRef(e.targetPosition),f=m.useRef(t),h=n&&!!e.internals.handleBounds;return m.useEffect(()=>{i.current&&!e.hidden&&(!h||l.current!==i.current)&&(l.current&&(r==null||r.unobserve(l.current)),r==null||r.observe(i.current),l.current=i.current)},[h,e.hidden]),m.useEffect(()=>()=>{l.current&&(r==null||r.unobserve(l.current),l.current=null)},[]),m.useEffect(()=>{if(i.current){const p=f.current!==t,g=c.current!==e.sourcePosition,y=u.current!==e.targetPosition;(p||g||y)&&(f.current=t,c.current=e.sourcePosition,u.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function lue({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:l,nodesDraggable:c,elementsSelectable:u,nodesConnectable:f,nodesFocusable:h,resizeObserver:p,noDragClassName:g,noPanClassName:y,disableKeyboardA11y:b,rfId:v,nodeTypes:C,nodeClickDistance:S,onError:j}){const{node:w,internals:k,isParent:P}=dn(Y=>{const ie=Y.nodeLookup.get(e),ce=Y.parentLookup.has(e);return{node:ie,internals:ie.internals,isParent:ce}},lr);let T=w.type||"default",$=(C==null?void 0:C[T])||QP[T];$===void 0&&(j==null||j("003",Ni.error003(T)),T="default",$=(C==null?void 0:C.default)||QP.default);const M=!!(w.draggable||c&&typeof w.draggable>"u"),R=!!(w.selectable||u&&typeof w.selectable>"u"),E=!!(w.connectable||f&&typeof w.connectable>"u"),O=!!(w.focusable||h&&typeof w.focusable>"u"),A=ar(),N=dz(w),F=iue({node:w,nodeType:T,hasDimensions:N,resizeObserver:p}),L=Hz({nodeRef:F,disabled:w.hidden||!M,noDragClassName:g,handleSelector:w.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:S}),D=Bz();if(w.hidden)return null;const H=Ml(w),B=Xce(w),V=R||M||t||n||r||o,G=n?Y=>n(Y,{...k.userNode}):void 0,_=r?Y=>r(Y,{...k.userNode}):void 0,U=o?Y=>o(Y,{...k.userNode}):void 0,Z=i?Y=>i(Y,{...k.userNode}):void 0,Q=l?Y=>l(Y,{...k.userNode}):void 0,ee=Y=>{const{selectNodesOnDrag:ie,nodeDragThreshold:ce}=A.getState();R&&(!ie||!M||ce>0)&&OC({id:e,store:A,nodeRef:F}),t&&t(Y,{...k.userNode})},ne=Y=>{if(!(hz(Y.nativeEvent)||b)){if(nz.includes(Y.key)&&R){const ie=Y.key==="Escape";OC({id:e,store:A,unselect:ie,nodeRef:F})}else if(M&&w.selected&&Object.prototype.hasOwnProperty.call(Cx,Y.key)){Y.preventDefault();const{ariaLabelConfig:ie}=A.getState();A.setState({ariaLiveMessage:ie["node.a11yDescription.ariaLiveMessage"]({direction:Y.key.replace("Arrow","").toLowerCase(),x:~~k.positionAbsolute.x,y:~~k.positionAbsolute.y})}),D({direction:Cx[Y.key],factor:Y.shiftKey?4:1})}}},re=()=>{var ge;if(b||!((ge=F.current)!=null&&ge.matches(":focus-visible")))return;const{transform:Y,width:ie,height:ce,autoPanOnNodeFocus:he,setCenter:de}=A.getState();if(!he)return;CS(new Map([[e,w]]),{x:0,y:0,width:ie,height:ce},Y,!0).length>0||de(w.position.x+H.width/2,w.position.y+H.height/2,{zoom:Y[2]})};return s.jsx("div",{className:Mr(["react-flow__node",`react-flow__node-${T}`,{[y]:M},w.className,{selected:w.selected,selectable:R,parent:P,draggable:M,dragging:L}]),ref:F,style:{zIndex:k.z,transform:`translate(${k.positionAbsolute.x}px,${k.positionAbsolute.y}px)`,pointerEvents:V?"all":"none",visibility:N?"visible":"hidden",...w.style,...B},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:G,onMouseMove:_,onMouseLeave:U,onContextMenu:Z,onClick:ee,onDoubleClick:Q,onKeyDown:O?ne:void 0,tabIndex:O?0:void 0,onFocus:O?re:void 0,role:w.ariaRole??(O?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${Oz}-${v}`,"aria-label":w.ariaLabel,...w.domAttributes,children:s.jsx(Wce,{value:e,children:s.jsx($,{id:e,data:w.data,type:T,positionAbsoluteX:k.positionAbsolute.x,positionAbsoluteY:k.positionAbsolute.y,selected:w.selected??!1,selectable:R,draggable:M,deletable:w.deletable??!0,isConnectable:E,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:L,dragHandle:w.dragHandle,zIndex:k.z,parentId:w.parentId,...H})})})}var aue=m.memo(lue);const cue=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Gz(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,onError:i}=dn(cue,lr),l=rue(e.onlyRenderVisibleElements),c=sue();return s.jsx("div",{className:"react-flow__nodes",style:yy,children:l.map(u=>s.jsx(aue,{id:u,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:i},u))})}Gz.displayName="NodeRenderer";const uue=m.memo(Gz);function due(e){return dn(m.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const r=[];if(n.width&&n.height)for(const o of n.edges){const i=n.nodeLookup.get(o.source),l=n.nodeLookup.get(o.target);i&&l&&dae({sourceNode:i,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),lr)}const fue=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return s.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},pue=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return s.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},XP={[Zp.Arrow]:fue,[Zp.ArrowClosed]:pue};function hue(e){const t=ar();return m.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(XP,e)?XP[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Ni.error009(e)),null)},[e])}const mue=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const u=hue(t);return u?s.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:c,refX:"0",refY:"0",children:s.jsx(u,{color:n,strokeWidth:l})}):null},Uz=({defaultColor:e,rfId:t})=>{const n=dn(i=>i.edges),r=dn(i=>i.defaultEdgeOptions),o=m.useMemo(()=>bae(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return o.length?s.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:s.jsx("defs",{children:o.map(i=>s.jsx(mue,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};Uz.displayName="MarkerDefinitions";var gue=m.memo(Uz);function qz({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:u,className:f,...h}){const[p,g]=m.useState({x:1,y:0,width:0,height:0}),y=Mr(["react-flow__edge-textwrapper",f]),b=m.useRef(null);return m.useEffect(()=>{if(b.current){const v=b.current.getBBox();g({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?s.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:y,visibility:p.width?"visible":"hidden",...h,children:[o&&s.jsx("rect",{width:p.width+2*l[0],x:-l[0],y:-l[1],height:p.height+2*l[1],className:"react-flow__edge-textbg",style:i,rx:c,ry:c}),s.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:b,style:r,children:n}),u]}):null}qz.displayName="EdgeText";const xue=m.memo(qz);function by({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,interactionWidth:f=20,...h}){return s.jsxs(s.Fragment,{children:[s.jsx("path",{...h,d:e,fill:"none",className:Mr(["react-flow__edge-path",h.className])}),f?s.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&ci(t)&&ci(n)?s.jsx(xue,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null]})}function ZP({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===Rt.Left||e===Rt.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Kz({sourceX:e,sourceY:t,sourcePosition:n=Rt.Bottom,targetX:r,targetY:o,targetPosition:i=Rt.Top}){const[l,c]=ZP({pos:n,x1:e,y1:t,x2:r,y2:o}),[u,f]=ZP({pos:i,x1:r,y1:o,x2:e,y2:t}),[h,p,g,y]=gz({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:f});return[`M${e},${t} C${l},${c} ${u},${f} ${r},${o}`,h,p,g,y]}function Qz(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:l,targetPosition:c,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:y,style:b,markerEnd:v,markerStart:C,interactionWidth:S})=>{const[j,w,k]=Kz({sourceX:n,sourceY:r,sourcePosition:l,targetX:o,targetY:i,targetPosition:c}),P=e.isInternal?void 0:t;return s.jsx(by,{id:P,path:j,labelX:w,labelY:k,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:y,style:b,markerEnd:v,markerStart:C,interactionWidth:S})})}const yue=Qz({isInternal:!1}),Yz=Qz({isInternal:!0});yue.displayName="SimpleBezierEdge";Yz.displayName="SimpleBezierEdgeInternal";function Xz(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,sourcePosition:y=Rt.Bottom,targetPosition:b=Rt.Top,markerEnd:v,markerStart:C,pathOptions:S,interactionWidth:j})=>{const[w,k,P]=TC({sourceX:n,sourceY:r,sourcePosition:y,targetX:o,targetY:i,targetPosition:b,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset,stepPosition:S==null?void 0:S.stepPosition}),T=e.isInternal?void 0:t;return s.jsx(by,{id:T,path:w,labelX:k,labelY:P,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:C,interactionWidth:j})})}const Zz=Xz({isInternal:!1}),Jz=Xz({isInternal:!0});Zz.displayName="SmoothStepEdge";Jz.displayName="SmoothStepEdgeInternal";function eL(e){return m.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return s.jsx(Zz,{...n,id:r,pathOptions:m.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const bue=eL({isInternal:!1}),tL=eL({isInternal:!0});bue.displayName="StepEdge";tL.displayName="StepEdgeInternal";function nL(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:y,markerStart:b,interactionWidth:v})=>{const[C,S,j]=bz({sourceX:n,sourceY:r,targetX:o,targetY:i}),w=e.isInternal?void 0:t;return s.jsx(by,{id:w,path:C,labelX:S,labelY:j,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:y,markerStart:b,interactionWidth:v})})}const vue=nL({isInternal:!1}),rL=nL({isInternal:!0});vue.displayName="StraightEdge";rL.displayName="StraightEdgeInternal";function oL(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:l=Rt.Bottom,targetPosition:c=Rt.Top,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:y,style:b,markerEnd:v,markerStart:C,pathOptions:S,interactionWidth:j})=>{const[w,k,P]=xz({sourceX:n,sourceY:r,sourcePosition:l,targetX:o,targetY:i,targetPosition:c,curvature:S==null?void 0:S.curvature}),T=e.isInternal?void 0:t;return s.jsx(by,{id:T,path:w,labelX:k,labelY:P,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:y,style:b,markerEnd:v,markerStart:C,interactionWidth:j})})}const Cue=oL({isInternal:!1}),sL=oL({isInternal:!0});Cue.displayName="BezierEdge";sL.displayName="BezierEdgeInternal";const JP={default:sL,straight:rL,step:tL,smoothstep:Jz,simplebezier:Yz},eT={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},wue=(e,t,n)=>n===Rt.Left?e-t:n===Rt.Right?e+t:e,Sue=(e,t,n)=>n===Rt.Top?e-t:n===Rt.Bottom?e+t:e,tT="react-flow__edgeupdater";function nT({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:l,type:c}){return s.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:l,className:Mr([tT,`${tT}-${c}`]),cx:wue(t,r,e),cy:Sue(n,r,e),r,stroke:"transparent",fill:"transparent"})}function jue({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:l,sourcePosition:c,targetPosition:u,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,setReconnecting:g,setUpdateHover:y}){const b=ar(),v=(k,P)=>{if(k.button!==0)return;const{autoPanOnConnect:T,domNode:$,isValidConnection:M,connectionMode:R,connectionRadius:E,lib:O,onConnectStart:A,onConnectEnd:N,cancelConnection:F,nodeLookup:L,rfId:D,panBy:H,updateConnection:B}=b.getState(),V=P.type==="target",G=(Z,Q)=>{g(!1),p==null||p(Z,n,P.type,Q)},_=Z=>f==null?void 0:f(n,Z),U=(Z,Q)=>{g(!0),h==null||h(k,n,P.type),A==null||A(Z,Q)};$C.onPointerDown(k.nativeEvent,{autoPanOnConnect:T,connectionMode:R,connectionRadius:E,domNode:$,handleId:P.id,nodeId:P.nodeId,nodeLookup:L,isTarget:V,edgeUpdaterType:P.type,lib:O,flowId:D,cancelConnection:F,panBy:H,isValidConnection:M,onConnect:_,onConnectStart:U,onConnectEnd:N,onReconnectEnd:G,updateConnection:B,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:k.currentTarget})},C=k=>v(k,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),S=k=>v(k,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),j=()=>y(!0),w=()=>y(!1);return s.jsxs(s.Fragment,{children:[(e===!0||e==="source")&&s.jsx(nT,{position:c,centerX:r,centerY:o,radius:t,onMouseDown:C,onMouseEnter:j,onMouseOut:w,type:"source"}),(e===!0||e==="target")&&s.jsx(nT,{position:u,centerX:i,centerY:l,radius:t,onMouseDown:S,onMouseEnter:j,onMouseOut:w,type:"target"})]})}function kue({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:l,onMouseEnter:c,onMouseMove:u,onMouseLeave:f,reconnectRadius:h,onReconnect:p,onReconnectStart:g,onReconnectEnd:y,rfId:b,edgeTypes:v,noPanClassName:C,onError:S,disableKeyboardA11y:j}){let w=dn(de=>de.edgeLookup.get(e));const k=dn(de=>de.defaultEdgeOptions);w=k?{...k,...w}:w;let P=w.type||"default",T=(v==null?void 0:v[P])||JP[P];T===void 0&&(S==null||S("011",Ni.error011(P)),P="default",T=(v==null?void 0:v.default)||JP.default);const $=!!(w.focusable||t&&typeof w.focusable>"u"),M=typeof p<"u"&&(w.reconnectable||n&&typeof w.reconnectable>"u"),R=!!(w.selectable||r&&typeof w.selectable>"u"),E=m.useRef(null),[O,A]=m.useState(!1),[N,F]=m.useState(!1),L=ar(),{zIndex:D,sourceX:H,sourceY:B,targetX:V,targetY:G,sourcePosition:_,targetPosition:U}=dn(m.useCallback(de=>{const le=de.nodeLookup.get(w.source),ge=de.nodeLookup.get(w.target);if(!le||!ge)return{zIndex:w.zIndex,...eT};const Se=yae({id:e,sourceNode:le,targetNode:ge,sourceHandle:w.sourceHandle||null,targetHandle:w.targetHandle||null,connectionMode:de.connectionMode,onError:S});return{zIndex:uae({selected:w.selected,zIndex:w.zIndex,sourceNode:le,targetNode:ge,elevateOnSelect:de.elevateEdgesOnSelect,zIndexMode:de.zIndexMode}),...Se||eT}},[w.source,w.target,w.sourceHandle,w.targetHandle,w.selected,w.zIndex]),lr),Z=m.useMemo(()=>w.markerStart?`url('#${MC(w.markerStart,b)}')`:void 0,[w.markerStart,b]),Q=m.useMemo(()=>w.markerEnd?`url('#${MC(w.markerEnd,b)}')`:void 0,[w.markerEnd,b]);if(w.hidden||H===null||B===null||V===null||G===null)return null;const ee=de=>{var ke;const{addSelectedEdges:le,unselectNodesAndEdges:ge,multiSelectionActive:Se}=L.getState();R&&(L.setState({nodesSelectionActive:!1}),w.selected&&Se?(ge({nodes:[],edges:[w]}),(ke=E.current)==null||ke.blur()):le([e])),o&&o(de,w)},ne=i?de=>{i(de,{...w})}:void 0,re=l?de=>{l(de,{...w})}:void 0,Y=c?de=>{c(de,{...w})}:void 0,ie=u?de=>{u(de,{...w})}:void 0,ce=f?de=>{f(de,{...w})}:void 0,he=de=>{var le;if(!j&&nz.includes(de.key)&&R){const{unselectNodesAndEdges:ge,addSelectedEdges:Se}=L.getState();de.key==="Escape"?((le=E.current)==null||le.blur(),ge({edges:[w]})):Se([e])}};return s.jsx("svg",{style:{zIndex:D},children:s.jsxs("g",{className:Mr(["react-flow__edge",`react-flow__edge-${P}`,w.className,C,{selected:w.selected,animated:w.animated,inactive:!R&&!o,updating:O,selectable:R}]),onClick:ee,onDoubleClick:ne,onContextMenu:re,onMouseEnter:Y,onMouseMove:ie,onMouseLeave:ce,onKeyDown:$?he:void 0,tabIndex:$?0:void 0,role:w.ariaRole??($?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":w.ariaLabel===null?void 0:w.ariaLabel||`Edge from ${w.source} to ${w.target}`,"aria-describedby":$?`${zz}-${b}`:void 0,ref:E,...w.domAttributes,children:[!N&&s.jsx(T,{id:e,source:w.source,target:w.target,type:w.type,selected:w.selected,animated:w.animated,selectable:R,deletable:w.deletable??!0,label:w.label,labelStyle:w.labelStyle,labelShowBg:w.labelShowBg,labelBgStyle:w.labelBgStyle,labelBgPadding:w.labelBgPadding,labelBgBorderRadius:w.labelBgBorderRadius,sourceX:H,sourceY:B,targetX:V,targetY:G,sourcePosition:_,targetPosition:U,data:w.data,style:w.style,sourceHandleId:w.sourceHandle,targetHandleId:w.targetHandle,markerStart:Z,markerEnd:Q,pathOptions:"pathOptions"in w?w.pathOptions:void 0,interactionWidth:w.interactionWidth}),M&&s.jsx(jue,{edge:w,isReconnectable:M,reconnectRadius:h,onReconnect:p,onReconnectStart:g,onReconnectEnd:y,sourceX:H,sourceY:B,targetX:V,targetY:G,sourcePosition:_,targetPosition:U,setUpdateHover:A,setReconnecting:F})]})})}var Iue=m.memo(kue);const Eue=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function iL({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:f,onEdgeClick:h,reconnectRadius:p,onEdgeDoubleClick:g,onReconnectStart:y,onReconnectEnd:b,disableKeyboardA11y:v}){const{edgesFocusable:C,edgesReconnectable:S,elementsSelectable:j,onError:w}=dn(Eue,lr),k=due(t);return s.jsxs("div",{className:"react-flow__edges",children:[s.jsx(gue,{defaultColor:e,rfId:n}),k.map(P=>s.jsx(Iue,{id:P,edgesFocusable:C,edgesReconnectable:S,elementsSelectable:j,noPanClassName:o,onReconnect:i,onContextMenu:l,onMouseEnter:c,onMouseMove:u,onMouseLeave:f,onClick:h,reconnectRadius:p,onDoubleClick:g,onReconnectStart:y,onReconnectEnd:b,rfId:n,onError:w,edgeTypes:r,disableKeyboardA11y:v},P))]})}iL.displayName="EdgeRenderer";const Pue=m.memo(iL),Tue=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Mue({children:e}){const t=dn(Tue);return s.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Rue(e){const t=TS(),n=m.useRef(!1);m.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const $ue=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Oue(e){const t=dn($ue),n=ar();return m.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function zue(e){return e.connection.inProgress?{...e.connection,to:Dh(e.connection.to,e.transform)}:{...e.connection}}function Lue(e){return zue}function Due(e){const t=Lue();return dn(t,lr)}const Aue=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Fue({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:i,height:l,isValid:c,inProgress:u}=dn(Aue,lr);return!(i&&o&&u)?null:s.jsx("svg",{style:e,width:i,height:l,className:"react-flow__connectionline react-flow__container",children:s.jsx("g",{className:Mr(["react-flow__connection",sz(c)]),children:s.jsx(lL,{style:t,type:n,CustomComponent:r,isValid:c})})})}const lL=({style:e,type:t=la.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:i,fromNode:l,fromHandle:c,fromPosition:u,to:f,toNode:h,toHandle:p,toPosition:g,pointer:y}=Due();if(!o)return;if(n)return s.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:c,fromX:i.x,fromY:i.y,toX:f.x,toY:f.y,fromPosition:u,toPosition:g,connectionStatus:sz(r),toNode:h,toHandle:p,pointer:y});let b="";const v={sourceX:i.x,sourceY:i.y,sourcePosition:u,targetX:f.x,targetY:f.y,targetPosition:g};switch(t){case la.Bezier:[b]=xz(v);break;case la.SimpleBezier:[b]=Kz(v);break;case la.Step:[b]=TC({...v,borderRadius:0});break;case la.SmoothStep:[b]=TC(v);break;default:[b]=bz(v)}return s.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};lL.displayName="ConnectionLine";const Nue={};function rT(e=Nue){m.useRef(e),ar(),m.useEffect(()=>{},[e])}function _ue(){ar(),m.useRef(!1),m.useEffect(()=>{},[])}function aL({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:p,onSelectionStart:g,onSelectionEnd:y,connectionLineType:b,connectionLineStyle:v,connectionLineComponent:C,connectionLineContainerStyle:S,selectionKeyCode:j,selectionOnDrag:w,selectionMode:k,multiSelectionKeyCode:P,panActivationKeyCode:T,zoomActivationKeyCode:$,deleteKeyCode:M,onlyRenderVisibleElements:R,elementsSelectable:E,defaultViewport:O,translateExtent:A,minZoom:N,maxZoom:F,preventScrolling:L,defaultMarkerColor:D,zoomOnScroll:H,zoomOnPinch:B,panOnScroll:V,panOnScrollSpeed:G,panOnScrollMode:_,zoomOnDoubleClick:U,panOnDrag:Z,onPaneClick:Q,onPaneMouseEnter:ee,onPaneMouseMove:ne,onPaneMouseLeave:re,onPaneScroll:Y,onPaneContextMenu:ie,paneClickDistance:ce,nodeClickDistance:he,onEdgeContextMenu:de,onEdgeMouseEnter:le,onEdgeMouseMove:ge,onEdgeMouseLeave:Se,reconnectRadius:ke,onReconnect:we,onReconnectStart:Oe,onReconnectEnd:be,noDragClassName:Fe,noWheelClassName:Ve,noPanClassName:De,disableKeyboardA11y:Ze,nodeExtent:Ae,rfId:st,viewport:qe,onViewportChange:et}){return rT(e),rT(t),_ue(),Rue(n),Oue(qe),s.jsx(tue,{onPaneClick:Q,onPaneMouseEnter:ee,onPaneMouseMove:ne,onPaneMouseLeave:re,onPaneContextMenu:ie,onPaneScroll:Y,paneClickDistance:ce,deleteKeyCode:M,selectionKeyCode:j,selectionOnDrag:w,selectionMode:k,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:P,panActivationKeyCode:T,zoomActivationKeyCode:$,elementsSelectable:E,zoomOnScroll:H,zoomOnPinch:B,zoomOnDoubleClick:U,panOnScroll:V,panOnScrollSpeed:G,panOnScrollMode:_,panOnDrag:Z,defaultViewport:O,translateExtent:A,minZoom:N,maxZoom:F,onSelectionContextMenu:p,preventScrolling:L,noDragClassName:Fe,noWheelClassName:Ve,noPanClassName:De,disableKeyboardA11y:Ze,onViewportChange:et,isControlledViewport:!!qe,children:s.jsxs(Mue,{children:[s.jsx(Pue,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:l,onReconnect:we,onReconnectStart:Oe,onReconnectEnd:be,onlyRenderVisibleElements:R,onEdgeContextMenu:de,onEdgeMouseEnter:le,onEdgeMouseMove:ge,onEdgeMouseLeave:Se,reconnectRadius:ke,defaultMarkerColor:D,noPanClassName:De,disableKeyboardA11y:Ze,rfId:st}),s.jsx(Fue,{style:v,type:b,component:C,containerStyle:S}),s.jsx("div",{className:"react-flow__edgelabel-renderer"}),s.jsx(uue,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:h,nodeClickDistance:he,onlyRenderVisibleElements:R,noPanClassName:De,noDragClassName:Fe,disableKeyboardA11y:Ze,nodeExtent:Ae,rfId:st}),s.jsx("div",{className:"react-flow__viewport-portal"})]})})}aL.displayName="GraphView";const Hue=m.memo(aL),oT=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:l,fitViewOptions:c,minZoom:u=.5,maxZoom:f=2,nodeOrigin:h,nodeExtent:p,zIndexMode:g="basic"}={})=>{const y=new Map,b=new Map,v=new Map,C=new Map,S=r??t??[],j=n??e??[],w=h??[0,0],k=p??Yp;wz(v,C,S);const P=RC(j,y,b,{nodeOrigin:w,nodeExtent:k,zIndexMode:g});let T=[0,0,1];if(l&&o&&i){const $=zh(y,{filter:O=>!!((O.width||O.initialWidth)&&(O.height||O.initialHeight))}),{x:M,y:R,zoom:E}=wS($,o,i,u,f,(c==null?void 0:c.padding)??.1);T=[M,R,E]}return{rfId:"1",width:o??0,height:i??0,transform:T,nodes:j,nodesInitialized:P,nodeLookup:y,parentLookup:b,edges:S,edgeLookup:C,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:f,translateExtent:Yp,nodeExtent:k,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Pd.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:w,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:c,fitViewResolver:null,connection:{...oz},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:oae,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:rz,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Bue=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:f,nodeOrigin:h,nodeExtent:p,zIndexMode:g})=>ice((y,b)=>{async function v(){const{nodeLookup:C,panZoom:S,fitViewOptions:j,fitViewResolver:w,width:k,height:P,minZoom:T,maxZoom:$}=b();S&&(await nae({nodes:C,width:k,height:P,panZoom:S,minZoom:T,maxZoom:$},j),w==null||w.resolve(!0),y({fitViewResolver:null}))}return{...oT({nodes:e,edges:t,width:o,height:i,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:f,nodeOrigin:h,nodeExtent:p,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:C=>{const{nodeLookup:S,parentLookup:j,nodeOrigin:w,elevateNodesOnSelect:k,fitViewQueued:P,zIndexMode:T}=b(),$=RC(C,S,j,{nodeOrigin:w,nodeExtent:p,elevateNodesOnSelect:k,checkEquality:!0,zIndexMode:T});P&&$?(v(),y({nodes:C,nodesInitialized:$,fitViewQueued:!1,fitViewOptions:void 0})):y({nodes:C,nodesInitialized:$})},setEdges:C=>{const{connectionLookup:S,edgeLookup:j}=b();wz(S,j,C),y({edges:C})},setDefaultNodesAndEdges:(C,S)=>{if(C){const{setNodes:j}=b();j(C),y({hasDefaultNodes:!0})}if(S){const{setEdges:j}=b();j(S),y({hasDefaultEdges:!0})}},updateNodeInternals:C=>{const{triggerNodeChanges:S,nodeLookup:j,parentLookup:w,domNode:k,nodeOrigin:P,nodeExtent:T,debug:$,fitViewQueued:M,zIndexMode:R}=b(),{changes:E,updatedInternals:O}=Iae(C,j,w,k,P,T,R);O&&(wae(j,w,{nodeOrigin:P,nodeExtent:T,zIndexMode:R}),M?(v(),y({fitViewQueued:!1,fitViewOptions:void 0})):y({}),(E==null?void 0:E.length)>0&&($&&console.log("React Flow: trigger node changes",E),S==null||S(E)))},updateNodePositions:(C,S=!1)=>{const j=[];let w=[];const{nodeLookup:k,triggerNodeChanges:P,connection:T,updateConnection:$,onNodesChangeMiddlewareMap:M}=b();for(const[R,E]of C){const O=k.get(R),A=!!(O!=null&&O.expandParent&&(O!=null&&O.parentId)&&(E!=null&&E.position)),N={id:R,type:"position",position:A?{x:Math.max(0,E.position.x),y:Math.max(0,E.position.y)}:E.position,dragging:S};if(O&&T.inProgress&&T.fromNode.id===O.id){const F=Gc(O,T.fromHandle,Rt.Left,!0);$({...T,from:F})}A&&O.parentId&&j.push({id:R,parentId:O.parentId,rect:{...E.internals.positionAbsolute,width:E.measured.width??0,height:E.measured.height??0}}),w.push(N)}if(j.length>0){const{parentLookup:R,nodeOrigin:E}=b(),O=PS(j,k,R,E);w.push(...O)}for(const R of M.values())w=R(w);P(w)},triggerNodeChanges:C=>{const{onNodesChange:S,setNodes:j,nodes:w,hasDefaultNodes:k,debug:P}=b();if(C!=null&&C.length){if(k){const T=Az(C,w);j(T)}P&&console.log("React Flow: trigger node changes",C),S==null||S(C)}},triggerEdgeChanges:C=>{const{onEdgesChange:S,setEdges:j,edges:w,hasDefaultEdges:k,debug:P}=b();if(C!=null&&C.length){if(k){const T=Fz(C,w);j(T)}P&&console.log("React Flow: trigger edge changes",C),S==null||S(C)}},addSelectedNodes:C=>{const{multiSelectionActive:S,edgeLookup:j,nodeLookup:w,triggerNodeChanges:k,triggerEdgeChanges:P}=b();if(S){const T=C.map($=>lc($,!0));k(T);return}k(Ku(w,new Set([...C]),!0)),P(Ku(j))},addSelectedEdges:C=>{const{multiSelectionActive:S,edgeLookup:j,nodeLookup:w,triggerNodeChanges:k,triggerEdgeChanges:P}=b();if(S){const T=C.map($=>lc($,!0));P(T);return}P(Ku(j,new Set([...C]))),k(Ku(w,new Set,!0))},unselectNodesAndEdges:({nodes:C,edges:S}={})=>{const{edges:j,nodes:w,nodeLookup:k,triggerNodeChanges:P,triggerEdgeChanges:T}=b(),$=C||w,M=S||j,R=$.map(O=>{const A=k.get(O.id);return A&&(A.selected=!1),lc(O.id,!1)}),E=M.map(O=>lc(O.id,!1));P(R),T(E)},setMinZoom:C=>{const{panZoom:S,maxZoom:j}=b();S==null||S.setScaleExtent([C,j]),y({minZoom:C})},setMaxZoom:C=>{const{panZoom:S,minZoom:j}=b();S==null||S.setScaleExtent([j,C]),y({maxZoom:C})},setTranslateExtent:C=>{var S;(S=b().panZoom)==null||S.setTranslateExtent(C),y({translateExtent:C})},resetSelectedElements:()=>{const{edges:C,nodes:S,triggerNodeChanges:j,triggerEdgeChanges:w,elementsSelectable:k}=b();if(!k)return;const P=S.reduce(($,M)=>M.selected?[...$,lc(M.id,!1)]:$,[]),T=C.reduce(($,M)=>M.selected?[...$,lc(M.id,!1)]:$,[]);j(P),w(T)},setNodeExtent:C=>{const{nodes:S,nodeLookup:j,parentLookup:w,nodeOrigin:k,elevateNodesOnSelect:P,nodeExtent:T,zIndexMode:$}=b();C[0][0]===T[0][0]&&C[0][1]===T[0][1]&&C[1][0]===T[1][0]&&C[1][1]===T[1][1]||(RC(S,j,w,{nodeOrigin:k,nodeExtent:C,elevateNodesOnSelect:P,checkEquality:!1,zIndexMode:$}),y({nodeExtent:C}))},panBy:C=>{const{transform:S,width:j,height:w,panZoom:k,translateExtent:P}=b();return Eae({delta:C,panZoom:k,transform:S,translateExtent:P,width:j,height:w})},setCenter:async(C,S,j)=>{const{width:w,height:k,maxZoom:P,panZoom:T}=b();if(!T)return Promise.resolve(!1);const $=typeof(j==null?void 0:j.zoom)<"u"?j.zoom:P;return await T.setViewport({x:w/2-C*$,y:k/2-S*$,zoom:$},{duration:j==null?void 0:j.duration,ease:j==null?void 0:j.ease,interpolate:j==null?void 0:j.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{y({connection:{...oz}})},updateConnection:C=>{y({connection:C})},reset:()=>y({...oT()})}},Object.is);function Wue({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:l,initialMaxZoom:c,initialFitViewOptions:u,fitView:f,nodeOrigin:h,nodeExtent:p,zIndexMode:g,children:y}){const[b]=m.useState(()=>Bue({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:f,minZoom:l,maxZoom:c,fitViewOptions:u,nodeOrigin:h,nodeExtent:p,zIndexMode:g}));return s.jsx(lce,{value:b,children:s.jsx(Mce,{children:y})})}function Vue({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:l,fitView:c,fitViewOptions:u,minZoom:f,maxZoom:h,nodeOrigin:p,nodeExtent:g,zIndexMode:y}){return m.useContext(xy)?s.jsx(s.Fragment,{children:e}):s.jsx(Wue,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:l,fitView:c,initialFitViewOptions:u,initialMinZoom:f,initialMaxZoom:h,nodeOrigin:p,nodeExtent:g,zIndexMode:y,children:e})}const Gue={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Uue({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:l,onNodeClick:c,onEdgeClick:u,onInit:f,onMove:h,onMoveStart:p,onMoveEnd:g,onConnect:y,onConnectStart:b,onConnectEnd:v,onClickConnectStart:C,onClickConnectEnd:S,onNodeMouseEnter:j,onNodeMouseMove:w,onNodeMouseLeave:k,onNodeContextMenu:P,onNodeDoubleClick:T,onNodeDragStart:$,onNodeDrag:M,onNodeDragStop:R,onNodesDelete:E,onEdgesDelete:O,onDelete:A,onSelectionChange:N,onSelectionDragStart:F,onSelectionDrag:L,onSelectionDragStop:D,onSelectionContextMenu:H,onSelectionStart:B,onSelectionEnd:V,onBeforeDelete:G,connectionMode:_,connectionLineType:U=la.Bezier,connectionLineStyle:Z,connectionLineComponent:Q,connectionLineContainerStyle:ee,deleteKeyCode:ne="Backspace",selectionKeyCode:re="Shift",selectionOnDrag:Y=!1,selectionMode:ie=Xp.Full,panActivationKeyCode:ce="Space",multiSelectionKeyCode:he=eh()?"Meta":"Control",zoomActivationKeyCode:de=eh()?"Meta":"Control",snapToGrid:le,snapGrid:ge,onlyRenderVisibleElements:Se=!1,selectNodesOnDrag:ke,nodesDraggable:we,autoPanOnNodeFocus:Oe,nodesConnectable:be,nodesFocusable:Fe,nodeOrigin:Ve=Lz,edgesFocusable:De,edgesReconnectable:Ze,elementsSelectable:Ae=!0,defaultViewport:st=vce,minZoom:qe=.5,maxZoom:et=2,translateExtent:oe=Yp,preventScrolling:fe=!0,nodeExtent:Ie,defaultMarkerColor:$e="#b1b1b7",zoomOnScroll:pt=!0,zoomOnPinch:vt=!0,panOnScroll:Je=!1,panOnScrollSpeed:me=.5,panOnScrollMode:Ne=Tc.Free,zoomOnDoubleClick:xt=!0,panOnDrag:Bt=!0,onPaneClick:pn,onPaneMouseEnter:yn,onPaneMouseMove:hn,onPaneMouseLeave:ln,onPaneScroll:An,onPaneContextMenu:kt,paneClickDistance:un=1,nodeClickDistance:er=0,children:yt,onReconnect:Ht,onReconnectStart:Ke,onReconnectEnd:rt,onEdgeContextMenu:It,onEdgeDoubleClick:Lt,onEdgeMouseEnter:Jt,onEdgeMouseMove:tr,onEdgeMouseLeave:kr,reconnectRadius:pr=10,onNodesChange:so,onEdgesChange:Kn,noDragClassName:nr="nodrag",noWheelClassName:io="nowheel",noPanClassName:Zr="nopan",fitView:se,fitViewOptions:xe,connectOnClick:Re,attributionPosition:nt,proOptions:wt,defaultEdgeOptions:Dt,elevateNodesOnSelect:Yt=!0,elevateEdgesOnSelect:qt=!1,disableKeyboardA11y:on=!1,autoPanOnConnect:nn,autoPanOnNodeDrag:bo,autoPanSpeed:To,connectionRadius:Mo,isValidConnection:Kt,onError:Nr,style:Qo,id:Yo,nodeDragThreshold:Ro,connectionDragThreshold:vy,viewport:Xo,onViewportChange:Cy,width:wy,height:Sy,colorMode:Qc="light",debug:Yc,onScroll:mi,ariaLabelConfig:Xc,zIndexMode:Ah="basic",...jy},nf){const Zc=Yo||"1",rf=jce(Qc),Ba=m.useCallback(Fh=>{Fh.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),mi==null||mi(Fh)},[mi]);return s.jsx("div",{"data-testid":"rf__wrapper",...jy,onScroll:Ba,style:{...Qo,...Gue},ref:nf,className:Mr(["react-flow",o,rf]),id:Yo,role:"application",children:s.jsxs(Vue,{nodes:e,edges:t,width:wy,height:Sy,fitView:se,fitViewOptions:xe,minZoom:qe,maxZoom:et,nodeOrigin:Ve,nodeExtent:Ie,zIndexMode:Ah,children:[s.jsx(Hue,{onInit:f,onNodeClick:c,onEdgeClick:u,onNodeMouseEnter:j,onNodeMouseMove:w,onNodeMouseLeave:k,onNodeContextMenu:P,onNodeDoubleClick:T,nodeTypes:i,edgeTypes:l,connectionLineType:U,connectionLineStyle:Z,connectionLineComponent:Q,connectionLineContainerStyle:ee,selectionKeyCode:re,selectionOnDrag:Y,selectionMode:ie,deleteKeyCode:ne,multiSelectionKeyCode:he,panActivationKeyCode:ce,zoomActivationKeyCode:de,onlyRenderVisibleElements:Se,defaultViewport:st,translateExtent:oe,minZoom:qe,maxZoom:et,preventScrolling:fe,zoomOnScroll:pt,zoomOnPinch:vt,zoomOnDoubleClick:xt,panOnScroll:Je,panOnScrollSpeed:me,panOnScrollMode:Ne,panOnDrag:Bt,onPaneClick:pn,onPaneMouseEnter:yn,onPaneMouseMove:hn,onPaneMouseLeave:ln,onPaneScroll:An,onPaneContextMenu:kt,paneClickDistance:un,nodeClickDistance:er,onSelectionContextMenu:H,onSelectionStart:B,onSelectionEnd:V,onReconnect:Ht,onReconnectStart:Ke,onReconnectEnd:rt,onEdgeContextMenu:It,onEdgeDoubleClick:Lt,onEdgeMouseEnter:Jt,onEdgeMouseMove:tr,onEdgeMouseLeave:kr,reconnectRadius:pr,defaultMarkerColor:$e,noDragClassName:nr,noWheelClassName:io,noPanClassName:Zr,rfId:Zc,disableKeyboardA11y:on,nodeExtent:Ie,viewport:Xo,onViewportChange:Cy}),s.jsx(Sce,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:y,onConnectStart:b,onConnectEnd:v,onClickConnectStart:C,onClickConnectEnd:S,nodesDraggable:we,autoPanOnNodeFocus:Oe,nodesConnectable:be,nodesFocusable:Fe,edgesFocusable:De,edgesReconnectable:Ze,elementsSelectable:Ae,elevateNodesOnSelect:Yt,elevateEdgesOnSelect:qt,minZoom:qe,maxZoom:et,nodeExtent:Ie,onNodesChange:so,onEdgesChange:Kn,snapToGrid:le,snapGrid:ge,connectionMode:_,translateExtent:oe,connectOnClick:Re,defaultEdgeOptions:Dt,fitView:se,fitViewOptions:xe,onNodesDelete:E,onEdgesDelete:O,onDelete:A,onNodeDragStart:$,onNodeDrag:M,onNodeDragStop:R,onSelectionDrag:L,onSelectionDragStart:F,onSelectionDragStop:D,onMove:h,onMoveStart:p,onMoveEnd:g,noPanClassName:Zr,nodeOrigin:Ve,rfId:Zc,autoPanOnConnect:nn,autoPanOnNodeDrag:bo,autoPanSpeed:To,onError:Nr,connectionRadius:Mo,isValidConnection:Kt,selectNodesOnDrag:ke,nodeDragThreshold:Ro,connectionDragThreshold:vy,onBeforeDelete:G,debug:Yc,ariaLabelConfig:Xc,zIndexMode:Ah}),s.jsx(bce,{onSelectionChange:N}),yt,s.jsx(hce,{proOptions:wt,position:nt}),s.jsx(pce,{rfId:Zc,disableKeyboardA11y:on})]})})}var que=Nz(Uue);function Kue(e){const[t,n]=m.useState(e),r=m.useCallback(o=>n(i=>Az(o,i)),[]);return[t,n,r]}function Que(e){const[t,n]=m.useState(e),r=m.useCallback(o=>n(i=>Fz(o,i)),[]);return[t,n,r]}function Yue({dimensions:e,lineWidth:t,variant:n,className:r}){return s.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Mr(["react-flow__background-pattern",n,r])})}function Xue({radius:e,className:t}){return s.jsx("circle",{cx:e,cy:e,r:e,className:Mr(["react-flow__background-pattern","dots",t])})}var dl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(dl||(dl={}));const Zue={[dl.Dots]:1,[dl.Lines]:1,[dl.Cross]:6},Jue=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function cL({id:e,variant:t=dl.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:l,bgColor:c,style:u,className:f,patternClassName:h}){const p=m.useRef(null),{transform:g,patternId:y}=dn(Jue,lr),b=r||Zue[t],v=t===dl.Dots,C=t===dl.Cross,S=Array.isArray(n)?n:[n,n],j=[S[0]*g[2]||1,S[1]*g[2]||1],w=b*g[2],k=Array.isArray(i)?i:[i,i],P=C?[w,w]:j,T=[k[0]*g[2]||1+P[0]/2,k[1]*g[2]||1+P[1]/2],$=`${y}${e||""}`;return s.jsxs("svg",{className:Mr(["react-flow__background",f]),style:{...u,...yy,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:p,"data-testid":"rf__background",children:[s.jsx("pattern",{id:$,x:g[0]%j[0],y:g[1]%j[1],width:j[0],height:j[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:v?s.jsx(Xue,{radius:w/2,className:h}):s.jsx(Yue,{dimensions:P,lineWidth:o,variant:t,className:h})}),s.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${$})`})]})}cL.displayName="Background";const ede=m.memo(cL);function tde(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:s.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function nde(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:s.jsx("path",{d:"M0 0h32v4.2H0z"})})}function rde(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:s.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function ode(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:s.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function sde(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:s.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function bg({children:e,className:t,...n}){return s.jsx("button",{type:"button",className:Mr(["react-flow__controls-button",t]),...n,children:e})}const ide=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function uL({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:l,onFitView:c,onInteractiveChange:u,className:f,children:h,position:p="bottom-left",orientation:g="vertical","aria-label":y}){const b=ar(),{isInteractive:v,minZoomReached:C,maxZoomReached:S,ariaLabelConfig:j}=dn(ide,lr),{zoomIn:w,zoomOut:k,fitView:P}=TS(),T=()=>{w(),i==null||i()},$=()=>{k(),l==null||l()},M=()=>{P(o),c==null||c()},R=()=>{b.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),u==null||u(!v)},E=g==="horizontal"?"horizontal":"vertical";return s.jsxs(Od,{className:Mr(["react-flow__controls",E,f]),position:p,style:e,"data-testid":"rf__controls","aria-label":y??j["controls.ariaLabel"],children:[t&&s.jsxs(s.Fragment,{children:[s.jsx(bg,{onClick:T,className:"react-flow__controls-zoomin",title:j["controls.zoomIn.ariaLabel"],"aria-label":j["controls.zoomIn.ariaLabel"],disabled:S,children:s.jsx(tde,{})}),s.jsx(bg,{onClick:$,className:"react-flow__controls-zoomout",title:j["controls.zoomOut.ariaLabel"],"aria-label":j["controls.zoomOut.ariaLabel"],disabled:C,children:s.jsx(nde,{})})]}),n&&s.jsx(bg,{className:"react-flow__controls-fitview",onClick:M,title:j["controls.fitView.ariaLabel"],"aria-label":j["controls.fitView.ariaLabel"],children:s.jsx(rde,{})}),r&&s.jsx(bg,{className:"react-flow__controls-interactive",onClick:R,title:j["controls.interactive.ariaLabel"],"aria-label":j["controls.interactive.ariaLabel"],children:v?s.jsx(sde,{}):s.jsx(ode,{})}),h]})}uL.displayName="Controls";const lde=m.memo(uL);function ade({id:e,x:t,y:n,width:r,height:o,style:i,color:l,strokeColor:c,strokeWidth:u,className:f,borderRadius:h,shapeRendering:p,selected:g,onClick:y}){const{background:b,backgroundColor:v}=i||{},C=l||b||v;return s.jsx("rect",{className:Mr(["react-flow__minimap-node",{selected:g},f]),x:t,y:n,rx:h,ry:h,width:r,height:o,style:{fill:C,stroke:c,strokeWidth:u},shapeRendering:p,onClick:y?S=>y(S,e):void 0})}const cde=m.memo(ade),ude=e=>e.nodes.map(t=>t.id),d0=e=>e instanceof Function?e:()=>e;function dde({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=cde,onClick:l}){const c=dn(ude,lr),u=d0(t),f=d0(e),h=d0(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return s.jsx(s.Fragment,{children:c.map(g=>s.jsx(pde,{id:g,nodeColorFunc:u,nodeStrokeColorFunc:f,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:l,shapeRendering:p},g))})}function fde({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:l,NodeComponent:c,onClick:u}){const{node:f,x:h,y:p,width:g,height:y}=dn(b=>{const{internals:v}=b.nodeLookup.get(e),C=v.userNode,{x:S,y:j}=v.positionAbsolute,{width:w,height:k}=Ml(C);return{node:C,x:S,y:j,width:w,height:k}},lr);return!f||f.hidden||!dz(f)?null:s.jsx(c,{x:h,y:p,width:g,height:y,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:o,strokeColor:n(f),strokeWidth:i,shapeRendering:l,onClick:u,id:f.id})}const pde=m.memo(fde);var hde=m.memo(dde);const mde=200,gde=150,xde=e=>!e.hidden,yde=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?uz(zh(e.nodeLookup,{filter:xde}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},bde="react-flow__minimap-desc";function dL({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:u,maskColor:f,maskStrokeColor:h,maskStrokeWidth:p,position:g="bottom-right",onClick:y,onNodeClick:b,pannable:v=!1,zoomable:C=!1,ariaLabel:S,inversePan:j,zoomStep:w=1,offsetScale:k=5}){const P=ar(),T=m.useRef(null),{boundingRect:$,viewBB:M,rfId:R,panZoom:E,translateExtent:O,flowWidth:A,flowHeight:N,ariaLabelConfig:F}=dn(yde,lr),L=(e==null?void 0:e.width)??mde,D=(e==null?void 0:e.height)??gde,H=$.width/L,B=$.height/D,V=Math.max(H,B),G=V*L,_=V*D,U=k*V,Z=$.x-(G-$.width)/2-U,Q=$.y-(_-$.height)/2-U,ee=G+U*2,ne=_+U*2,re=`${bde}-${R}`,Y=m.useRef(0),ie=m.useRef();Y.current=V,m.useEffect(()=>{if(T.current&&E)return ie.current=Dae({domNode:T.current,panZoom:E,getTransform:()=>P.getState().transform,getViewScale:()=>Y.current}),()=>{var le;(le=ie.current)==null||le.destroy()}},[E]),m.useEffect(()=>{var le;(le=ie.current)==null||le.update({translateExtent:O,width:A,height:N,inversePan:j,pannable:v,zoomStep:w,zoomable:C})},[v,C,j,w,O,A,N]);const ce=y?le=>{var ke;const[ge,Se]=((ke=ie.current)==null?void 0:ke.pointer(le))||[0,0];y(le,{x:ge,y:Se})}:void 0,he=b?m.useCallback((le,ge)=>{const Se=P.getState().nodeLookup.get(ge).internals.userNode;b(le,Se)},[]):void 0,de=S??F["minimap.ariaLabel"];return s.jsx(Od,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*V:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:Mr(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:s.jsxs("svg",{width:L,height:D,viewBox:`${Z} ${Q} ${ee} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":re,ref:T,onClick:ce,children:[de&&s.jsx("title",{id:re,children:de}),s.jsx(hde,{onClick:he,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:l,nodeComponent:c}),s.jsx("path",{className:"react-flow__minimap-mask",d:`M${Z-U},${Q-U}h${ee+U*2}v${ne+U*2}h${-ee-U*2}z
|
|
377
|
+
M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}dL.displayName="MiniMap";const vde=m.memo(dL),Cde=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,wde={[$d.Line]:"right",[$d.Handle]:"bottom-right"};function Sde({nodeId:e,position:t,variant:n=$d.Handle,className:r,style:o=void 0,children:i,color:l,minWidth:c=10,minHeight:u=10,maxWidth:f=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:g,autoScale:y=!0,shouldResize:b,onResizeStart:v,onResize:C,onResizeEnd:S}){const j=Wz(),w=typeof e=="string"?e:j,k=ar(),P=m.useRef(null),T=n===$d.Handle,$=dn(m.useCallback(Cde(T&&y),[T,y]),lr),M=m.useRef(null),R=t??wde[n];m.useEffect(()=>{if(!(!P.current||!w))return M.current||(M.current=Yae({domNode:P.current,nodeId:w,getStoreItems:()=>{const{nodeLookup:O,transform:A,snapGrid:N,snapToGrid:F,nodeOrigin:L,domNode:D}=k.getState();return{nodeLookup:O,transform:A,snapGrid:N,snapToGrid:F,nodeOrigin:L,paneDomNode:D}},onChange:(O,A)=>{const{triggerNodeChanges:N,nodeLookup:F,parentLookup:L,nodeOrigin:D}=k.getState(),H=[],B={x:O.x,y:O.y},V=F.get(w);if(V&&V.expandParent&&V.parentId){const G=V.origin??D,_=O.width??V.measured.width??0,U=O.height??V.measured.height??0,Z={id:V.id,parentId:V.parentId,rect:{width:_,height:U,...fz({x:O.x??V.position.x,y:O.y??V.position.y},{width:_,height:U},V.parentId,F,G)}},Q=PS([Z],F,L,D);H.push(...Q),B.x=O.x?Math.max(G[0]*_,O.x):void 0,B.y=O.y?Math.max(G[1]*U,O.y):void 0}if(B.x!==void 0&&B.y!==void 0){const G={id:w,type:"position",position:{...B}};H.push(G)}if(O.width!==void 0&&O.height!==void 0){const _={id:w,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:O.width,height:O.height}};H.push(_)}for(const G of A){const _={...G,type:"position"};H.push(_)}N(H)},onEnd:({width:O,height:A})=>{const N={id:w,type:"dimensions",resizing:!1,dimensions:{width:O,height:A}};k.getState().triggerNodeChanges([N])}})),M.current.update({controlPosition:R,boundaries:{minWidth:c,minHeight:u,maxWidth:f,maxHeight:h},keepAspectRatio:p,resizeDirection:g,onResizeStart:v,onResize:C,onResizeEnd:S,shouldResize:b}),()=>{var O;(O=M.current)==null||O.destroy()}},[R,c,u,f,h,p,v,C,S,b]);const E=R.split("-");return s.jsx("div",{className:Mr(["react-flow__resize-control","nodrag",...E,n,r]),ref:P,style:{...o,scale:$,...l&&{[T?"backgroundColor":"borderColor"]:l}},children:i})}m.memo(Sde);function jde({id:e,data:t,selected:n}){const r=Xr(),{label:o,columns:i,schema:l,isNew:c,onAddColumn:u,onEditColumn:f,onDeleteColumn:h,onEditTable:p,onDeleteTable:g}=t,[y,b]=m.useState(null),[v,C]=m.useState(null),S=T=>{T.stopPropagation(),b(T.currentTarget)},j=()=>{b(null)},w=()=>{j(),u==null||u(e)},k=()=>{j(),p==null||p(e)},P=()=>{j(),g==null||g(e)};return s.jsx(K,{sx:{px:1},children:s.jsxs(K,{sx:{minWidth:240,maxWidth:350,bgcolor:"background.paper",borderRadius:2,border:"2px solid",borderColor:n?"primary.main":c?"success.main":"divider",boxShadow:n?`0 0 0 3px ${Ye(r.palette.primary.main,.3)}`:c?`0 0 0 2px ${Ye(r.palette.success.main,.3)}`:"0 4px 12px rgba(0,0,0,0.15)",overflow:"visible",transition:"all 0.2s ease"},children:[s.jsxs(K,{sx:{px:1.5,py:1,bgcolor:n?"primary.main":c?Ye(r.palette.success.main,.15):Ye(r.palette.primary.main,.1),borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1},children:[s.jsx(TU,{sx:{fontSize:16,color:n?Ye("#fff",.7):"text.disabled",cursor:"grab"}}),s.jsxs(K,{sx:{flex:1},children:[s.jsx(J,{variant:"subtitle2",sx:{fontWeight:700,color:n?"primary.contrastText":"text.primary",fontFamily:"monospace"},children:o}),s.jsx(J,{variant:"caption",sx:{color:n?Ye("#fff",.7):"text.secondary",fontSize:10},children:l})]}),c&&s.jsx(Ge,{label:"NEW",size:"small",sx:{height:18,fontSize:9,bgcolor:"success.main",color:"#fff"}}),s.jsx(mt,{size:"small",onClick:S,sx:{color:n?"#fff":"text.secondary","&:hover":{bgcolor:Ye(n?"#fff":r.palette.primary.main,.1)}},children:s.jsx(Yx,{fontSize:"small"})}),s.jsxs(Ra,{anchorEl:y,open:!!y,onClose:j,onClick:T=>T.stopPropagation(),children:[s.jsxs(it,{onClick:w,children:[s.jsx(Rn,{children:s.jsx(Gn,{fontSize:"small"})}),s.jsx($n,{children:"Add Column"})]}),s.jsxs(it,{onClick:k,children:[s.jsx(Rn,{children:s.jsx(Dr,{fontSize:"small"})}),s.jsx($n,{children:"Rename Table"})]}),s.jsx(Ho,{}),s.jsxs(it,{onClick:P,sx:{color:"error.main"},children:[s.jsx(Rn,{children:s.jsx(dr,{fontSize:"small",color:"error"})}),s.jsx($n,{children:"Drop Table"})]})]})]}),s.jsx(K,{sx:{maxHeight:350,overflow:"visible"},children:i.length===0?s.jsxs(K,{sx:{p:2,textAlign:"center",color:"text.secondary"},children:[s.jsx(J,{variant:"caption",children:"No columns yet"}),s.jsx(K,{sx:{mt:1},children:s.jsx(Ge,{icon:s.jsx(Gn,{}),label:"Add Column",size:"small",onClick:()=>u==null?void 0:u(e),sx:{cursor:"pointer"}})})]}):i.map((T,$)=>s.jsxs(K,{onMouseEnter:()=>C(T.id),onMouseLeave:()=>C(null),sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,py:.75,borderBottom:$<i.length-1?"1px solid":"none",borderColor:"divider",bgcolor:T.isPrimaryKey?Ye(r.palette.warning.main,.08):T.isForeignKey?Ye(r.palette.info.main,.08):"transparent",position:"relative","&:hover":{bgcolor:Ye(r.palette.primary.main,.08)}},children:[s.jsxs(K,{sx:{width:16,display:"flex",justifyContent:"center"},children:[T.isPrimaryKey&&s.jsx(Pt,{title:"Primary Key",children:s.jsx(ri,{sx:{fontSize:14,color:"warning.main"}})}),T.isForeignKey&&!T.isPrimaryKey&&s.jsx(Pt,{title:"Foreign Key",children:s.jsx(ll,{sx:{fontSize:14,color:"info.main"}})})]}),s.jsx(J,{variant:"body2",sx:{flex:1,fontFamily:"monospace",fontSize:12,fontWeight:T.isPrimaryKey?600:400,color:"text.primary"},children:T.name}),s.jsx(Ge,{label:T.dataType,size:"small",sx:{height:18,fontSize:9,fontFamily:"monospace",bgcolor:Ye(r.palette.info.main,.1),color:"info.main"}}),!T.nullable&&s.jsx(Pt,{title:"NOT NULL",children:s.jsx(J,{variant:"caption",sx:{fontSize:9,color:"error.main",fontWeight:700},children:"NN"})}),v===T.id&&s.jsxs(K,{sx:{display:"flex",gap:.25,position:"absolute",right:4,bgcolor:"background.paper",borderRadius:1,boxShadow:1},children:[s.jsx(Pt,{title:"Edit Column",children:s.jsx(mt,{size:"small",onClick:M=>{M.stopPropagation(),f==null||f(e,T)},sx:{p:.25},children:s.jsx(Dr,{sx:{fontSize:14}})})}),!T.isPrimaryKey&&s.jsx(Pt,{title:"Delete Column",children:s.jsx(mt,{size:"small",onClick:M=>{M.stopPropagation(),h==null||h(e,T.id)},sx:{p:.25,color:"error.main"},children:s.jsx(dr,{sx:{fontSize:14}})})})]}),s.jsx(zd,{type:"source",position:Rt.Right,id:`${T.id}-source`,style:{width:12,height:12,background:T.isForeignKey?r.palette.info.main:r.palette.primary.main,border:`2px solid ${r.palette.background.paper}`,right:-7,opacity:v===T.id?1:T.isForeignKey?.8:.3,transition:"opacity 0.2s, transform 0.2s",cursor:"crosshair",transform:v===T.id?"scale(1.2)":"scale(1)"}}),s.jsx(zd,{type:"target",position:Rt.Left,id:`${T.id}-target`,style:{width:12,height:12,background:T.isPrimaryKey?r.palette.warning.main:r.palette.success.main,border:`2px solid ${r.palette.background.paper}`,left:-7,opacity:v===T.id?1:T.isPrimaryKey?.8:.3,transition:"opacity 0.2s, transform 0.2s",cursor:"crosshair",transform:v===T.id?"scale(1.2)":"scale(1)"}})]},T.id))}),i.length>0&&s.jsxs(K,{onClick:()=>u==null?void 0:u(e),sx:{px:1.5,py:.75,display:"flex",alignItems:"center",gap:.5,cursor:"pointer",borderTop:"1px dashed",borderColor:"divider",color:"text.disabled","&:hover":{bgcolor:Ye(r.palette.primary.main,.05),color:"primary.main"}},children:[s.jsx(Gn,{sx:{fontSize:14}}),s.jsx(J,{variant:"caption",sx:{fontSize:11},children:"Add column"})]})]})})}const kde=m.memo(jde),sT={postgres:["integer","bigint","smallint","serial","bigserial","varchar(255)","text","boolean","timestamp","date","uuid","jsonb"],mysql:["int","bigint","varchar(255)","text","boolean","datetime","date","json"],sqlite:["integer","real","text","blob"]},Ide={editableTable:kde};function f0(e){if(Array.isArray(e))return e;if(typeof e=="string"){if(e.startsWith("{")&&e.endsWith("}")){const t=e.slice(1,-1);return t?t.split(",").map(n=>n.trim().replace(/^"|"$/g,"")):[]}return e?[e]:[]}return[]}function uc(e,t){return t==="mysql"||t==="mariadb"?`\`${e}\``:`"${e}"`}function Lu(e,t,n){const r=uc(e,n),o=uc(t,n);return`${r}.${o}`}function Ede(){const e=Xr(),t=Tr(),n=oo(),[r,o]=kx(),{selectedConnectionId:i,selectedSchema:l,setConnectionAndSchema:c}=pO(),u=r.get("connection")||"",f=r.get("schema")||"",h=u||i||"",p=f||l||"",[g,y]=m.useState(!1),[b,v]=m.useState(!1),[C,S,j]=Kue([]),[w,k,P]=Que([]),[T,$]=m.useState(!1),[M,R]=m.useState(!1),[E,O]=m.useState(!1),[A,N]=m.useState(!1),[F,L]=m.useState(!1),[D,H]=m.useState(""),[B,V]=m.useState(null),[G,_]=m.useState(null),[U,Z]=m.useState(null),[Q,ee]=m.useState({name:"",dataType:"",nullable:!0,isPrimaryKey:!1,defaultValue:""}),{data:ne=[],isLoading:re}=Ft({queryKey:["connections"],queryFn:Qr.getAll}),Y=ne.find(me=>me.id===h),{data:ie=[],isLoading:ce,error:he,refetch:de}=Ft({queryKey:["schemas",h],queryFn:()=>xn.getSchemas(h),enabled:!!h,retry:1}),{data:le=[],isLoading:ge,error:Se,refetch:ke}=Ft({queryKey:["tables",h,p],queryFn:()=>xn.getTables(h,p),enabled:!!h&&!!p,retry:1}),we=he||Se;m.useEffect(()=>{(u||f)&&c(u,f)},[]);const Oe=me=>{const Ne=new URLSearchParams(r);me?(Ne.set("connection",me),Ne.delete("schema")):(Ne.delete("connection"),Ne.delete("schema")),o(Ne,{replace:!0}),c(me,"")},be=me=>{const Ne=new URLSearchParams(r);me?Ne.set("schema",me):Ne.delete("schema"),o(Ne,{replace:!0}),c(h,me)};m.useEffect(()=>{if(ie.length>0&&!p&&h){const me=Y!=null&&Y.defaultSchema&&ie.includes(Y.defaultSchema)?Y.defaultSchema:ie.includes("public")?"public":ie[0];me&&be(me)}},[ie,p,h,Y==null?void 0:Y.defaultSchema]);const Fe=m.useCallback(me=>{V(me),ee({name:"",dataType:"",nullable:!0,isPrimaryKey:!1,defaultValue:""}),R(!0)},[]),Ve=m.useCallback((me,Ne)=>{_(Ne)},[]),De=m.useCallback((me,Ne)=>{V(me);const xt=C.find(Bt=>Bt.id===me);if(xt){const Bt=xt.data.columns.find(pn=>pn.id===Ne);Bt&&(_(Bt),O(!0))}},[C]),Ze=m.useCallback(me=>{},[]),Ae=m.useCallback(me=>{V(me),N(!0)},[]);m.useEffect(()=>{if(!le.length||!h||!p){S([]),k([]);return}(async()=>{v(!0);try{const Ne=await Promise.all(le.map(kt=>xn.getTableSchema(h,p,kt.name))),xt=280,Bt=250,pn=80,yn=60,hn=Math.ceil(Math.sqrt(Ne.length)),ln=Ne.map((kt,un)=>{const er=kt.columns.map((It,Lt)=>({id:`${kt.name}-col-${Lt}`,name:It.name,dataType:It.dataType,nullable:It.nullable,isPrimaryKey:It.isPrimaryKey,isForeignKey:kt.foreignKeys.some(Jt=>f0(Jt.columns).includes(It.name)),defaultValue:It.defaultValue||void 0})),yt=Math.floor(un/hn),Ke=un%hn*(xt+pn),rt=yt*(Bt+yn);return{id:kt.name,type:"editableTable",position:{x:Ke,y:rt},data:{label:kt.name,columns:er,schema:p,onAddColumn:Fe,onEditColumn:Ve,onDeleteColumn:De,onEditTable:Ze,onDeleteTable:Ae}}}),An=[];Ne.forEach(kt=>{kt.foreignKeys.forEach((un,er)=>{const yt=f0(un.columns),Ht=f0(un.referencedColumns);if(yt[0]&&Ht[0]){const Ke=ln.find(It=>It.id===kt.name),rt=ln.find(It=>It.id===un.referencedTable);if(Ke&&rt){const It=Ke.data.columns.find(Jt=>Jt.name===yt[0]),Lt=rt.data.columns.find(Jt=>Jt.name===Ht[0]);It&&Lt&&An.push({id:`${kt.name}-${un.name}-${er}`,source:kt.name,target:un.referencedTable,sourceHandle:`${It.id}-source`,targetHandle:`${Lt.id}-target`,type:"smoothstep",animated:!0,style:{stroke:e.palette.info.main,strokeWidth:2},markerEnd:{type:Zp.ArrowClosed,color:e.palette.info.main},label:un.name,labelStyle:{fontSize:10,fill:e.palette.text.secondary},labelBgStyle:{fill:e.palette.background.paper}})}}})}),S(ln),k(An)}catch(Ne){console.error("Failed to load table details:",Ne),n.error("Failed to load table details")}finally{v(!1)}})()},[le,h,p]);const st=m.useCallback(me=>{Z(me),L(!0)},[]),qe=vr({mutationFn:async me=>mo.execute(h,me),onSuccess:()=>{t.invalidateQueries({queryKey:["tables",h,p]}),ke()}}),et=async()=>{if(!D.trim())return;const Ne=`CREATE TABLE ${Lu(p,D,Y==null?void 0:Y.engine)} (
|
|
378
|
+
id SERIAL PRIMARY KEY
|
|
379
|
+
)`;try{await qe.mutateAsync(Ne),n.success(`Table "${D}" created`),$(!1),H("")}catch(xt){n.error(xt instanceof Error?xt.message:"Failed to create table")}},oe=async()=>{if(!B||!Q.name||!Q.dataType)return;let Ne=`ALTER TABLE ${Lu(p,B,Y==null?void 0:Y.engine)} ADD COLUMN ${uc(Q.name,Y==null?void 0:Y.engine)} ${Q.dataType}`;Q.nullable||(Ne+=" NOT NULL"),Q.defaultValue&&(Ne+=` DEFAULT ${Q.defaultValue}`),Q.isPrimaryKey&&(Ne+=" PRIMARY KEY");try{await qe.mutateAsync(Ne),n.success(`Column "${Q.name}" added to "${B}"`),R(!1),V(null)}catch(xt){n.error(xt instanceof Error?xt.message:"Failed to add column")}},fe=async()=>{if(!B||!G)return;const Ne=`ALTER TABLE ${Lu(p,B,Y==null?void 0:Y.engine)} DROP COLUMN ${uc(G.name,Y==null?void 0:Y.engine)}`;try{await qe.mutateAsync(Ne),n.success(`Column "${G.name}" dropped from "${B}"`),O(!1),V(null),_(null)}catch(xt){n.error(xt instanceof Error?xt.message:"Failed to drop column")}},Ie=async()=>{if(!B)return;const Ne=`DROP TABLE ${Lu(p,B,Y==null?void 0:Y.engine)} CASCADE`;try{await qe.mutateAsync(Ne),n.success(`Table "${B}" dropped`),N(!1),V(null)}catch(xt){n.error(xt instanceof Error?xt.message:"Failed to drop table")}},$e=async()=>{if(!U)return;const me=U.source,Ne=U.target,xt=U.sourceHandle,Bt=U.targetHandle;if(!me||!Ne||!xt||!Bt)return;const pn=C.find(Ke=>Ke.id===me),yn=C.find(Ke=>Ke.id===Ne);if(!pn||!yn)return;const hn=xt.replace("-source",""),ln=Bt.replace("-target",""),An=pn.data.columns.find(Ke=>Ke.id===hn),kt=yn.data.columns.find(Ke=>Ke.id===ln);if(!An||!kt){n.error("Could not determine columns for foreign key");return}const un=`fk_${me}_${An.name}`,er=Lu(p,me,Y==null?void 0:Y.engine),yt=Lu(p,Ne,Y==null?void 0:Y.engine),Ht=`ALTER TABLE ${er} ADD CONSTRAINT ${uc(un,Y==null?void 0:Y.engine)} FOREIGN KEY (${uc(An.name,Y==null?void 0:Y.engine)}) REFERENCES ${yt} (${uc(kt.name,Y==null?void 0:Y.engine)})`;try{await qe.mutateAsync(Ht),n.success(`Foreign key "${un}" created`),L(!1),Z(null)}catch(Ke){n.error(Ke instanceof Error?Ke.message:"Failed to create foreign key")}},pt=sT[Y==null?void 0:Y.engine]||sT.postgres,vt=()=>{if(!h)return s.jsx(go,{icon:s.jsx(Cr,{}),title:"Select a connection",description:"Choose a database connection to start editing the schema diagram."});if(we){const me=we instanceof Error?we.message:"Unknown error",Ne=me.includes("ECONNREFUSED")||me.includes("connect")||me.includes("Connection")||me.includes("timeout");return s.jsx(go,{icon:s.jsx(RU,{sx:{color:"error.main"}}),title:Ne?"Database Unavailable":"Connection Error",description:Ne?"Unable to connect to the database. Please ensure the database server is running and accessible.":`Failed to load schema data: ${me}`,action:{label:"Retry Connection",onClick:()=>{de(),p&&ke()}}})}return p?ge||b?s.jsx(wl,{message:ge?"Loading tables...":"Rendering diagram...",size:"large"}):le.length===0?s.jsx(go,{icon:s.jsx(xo,{}),title:"No tables in this schema",description:"Create a new table to get started with the schema diagram.",action:{label:"Create Table",onClick:()=>$(!0)}}):s.jsx(K,{sx:{width:"100%",height:"100%","& .react-flow__controls":{bgcolor:"background.paper",borderColor:"divider",borderRadius:2,boxShadow:"0 2px 8px rgba(0,0,0,0.2)",bottom:"auto",top:0},"& .react-flow__controls-button":{bgcolor:"background.paper",borderColor:"divider",color:"text.primary","&:hover":{bgcolor:Ye(e.palette.primary.main,.1)},"& svg":{fill:e.palette.text.primary}}},children:s.jsxs(que,{nodes:C,edges:w,onNodesChange:j,onEdgesChange:P,onConnect:st,nodeTypes:Ide,fitView:!0,minZoom:.1,maxZoom:2,defaultEdgeOptions:{type:"smoothstep",animated:!0},proOptions:{hideAttribution:!0},children:[s.jsx(ede,{variant:dl.Dots,gap:20,size:1,color:Ye(e.palette.text.primary,.1)}),s.jsx(lde,{}),s.jsx(vde,{nodeColor:me=>me.selected?e.palette.primary.main:Ye(e.palette.primary.main,.5),maskColor:Ye(e.palette.background.default,.8),style:{backgroundColor:e.palette.background.paper,border:`1px solid ${e.palette.divider}`}}),s.jsx(Od,{position:"top-right",children:s.jsx(Un,{sx:{p:1,display:"flex",flexDirection:"column",gap:.5,bgcolor:"background.paper"},children:s.jsx(J,{variant:"caption",color:"text.secondary",sx:{px:1},children:"Drag between columns to create FK"})})}),s.jsx(Od,{position:"bottom-left",children:s.jsxs(Un,{sx:{p:1.5,display:"flex",gap:2,alignItems:"center"},children:[s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:.5},children:[s.jsx(K,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"warning.main"}}),s.jsx(J,{variant:"caption",children:"Primary Key"})]}),s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:.5},children:[s.jsx(K,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"info.main"}}),s.jsx(J,{variant:"caption",children:"Foreign Key"})]}),s.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:.5},children:[s.jsx(J,{variant:"caption",sx:{color:"error.main",fontWeight:600},children:"NN"}),s.jsx(J,{variant:"caption",children:"Not Null"})]})]})})]})}):s.jsx(go,{icon:s.jsx($i,{}),title:"Select a schema",description:"Choose a schema to view and edit its tables."})},Je=s.jsxs(K,{sx:{display:"flex",flexDirection:"column",height:g?"calc(100vh - 32px)":"calc(100vh - 35px)",minHeight:500},children:[s.jsx(cn,{sx:{mb:2,p:1.5},children:s.jsxs(K,{sx:{display:"flex",gap:2,alignItems:"center",flexWrap:"wrap"},children:[s.jsx(SO,{value:h,onChange:Oe,disabled:re,disableOffline:!0}),s.jsxs(_n,{size:"small",sx:{minWidth:150},children:[s.jsx(Hn,{children:"Schema"}),s.jsx(On,{value:p,onChange:me=>be(me.target.value),label:"Schema",disabled:!h||ce,startAdornment:s.jsx(ds,{position:"start",children:s.jsx($i,{fontSize:"small",sx:{color:"primary.main"}})}),children:ie.map(me=>s.jsx(it,{value:me,children:me},me))})]}),s.jsx(Ho,{orientation:"vertical",flexItem:!0}),s.jsx(Le,{variant:"contained",size:"small",startIcon:s.jsx(Gn,{}),onClick:()=>$(!0),disabled:!h||!p||(Y==null?void 0:Y.readOnly),children:"New Table"}),s.jsx(Le,{variant:"outlined",size:"small",startIcon:s.jsx(Eo,{}),onClick:()=>ke(),disabled:ge||!h||!p,children:"Refresh"}),s.jsx(K,{sx:{flex:1}}),s.jsx(Ge,{label:`${le.length} table${le.length!==1?"s":""}`,size:"small",sx:{bgcolor:Ye(e.palette.primary.main,.1)}}),s.jsx(Pt,{title:g?"Exit Fullscreen":"Fullscreen",children:s.jsx(mt,{size:"small",onClick:()=>y(!g),sx:{border:1,borderColor:"divider",borderRadius:1},children:g?s.jsx(OU,{fontSize:"small"}):s.jsx($U,{fontSize:"small"})})})]})}),s.jsx(cn,{sx:{flex:1,p:0,overflow:"hidden",backgroundColor:"background.default","&:hover":{borderColor:"divider",boxShadow:"none"}},children:vt()}),s.jsxs(gn,{open:T,onClose:()=>$(!1),maxWidth:"sm",fullWidth:!0,children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(xo,{color:"primary"}),"Create New Table"]}),s.jsx(Cn,{children:s.jsx(Wt,{autoFocus:!0,margin:"dense",label:"Table Name",fullWidth:!0,value:D,onChange:me=>H(me.target.value),onKeyDown:me=>{me.key==="Enter"&&et()},helperText:"Table will be created with a default 'id' serial primary key column"})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:()=>$(!1),children:"Cancel"}),s.jsx(Le,{variant:"contained",onClick:et,disabled:!D.trim()||qe.isPending,startIcon:qe.isPending?s.jsx(At,{size:16}):s.jsx(Gn,{}),children:"Create Table"})]})]}),s.jsxs(gn,{open:M,onClose:()=>R(!1),maxWidth:"sm",fullWidth:!0,children:[s.jsxs(wn,{children:['Add Column to "',B,'"']}),s.jsx(Cn,{children:s.jsxs(K,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[s.jsx(Wt,{autoFocus:!0,label:"Column Name",fullWidth:!0,value:Q.name,onChange:me=>ee({...Q,name:me.target.value})}),s.jsx(sa,{freeSolo:!0,options:pt,value:Q.dataType,onChange:(me,Ne)=>ee({...Q,dataType:Ne||""}),onInputChange:(me,Ne)=>ee({...Q,dataType:Ne}),renderInput:me=>s.jsx(Wt,{...me,label:"Data Type",fullWidth:!0})}),s.jsx(Wt,{label:"Default Value (optional)",fullWidth:!0,value:Q.defaultValue,onChange:me=>ee({...Q,defaultValue:me.target.value}),helperText:"Enter SQL expression (e.g., 'now()', '0', 'true')"}),s.jsxs(K,{sx:{display:"flex",gap:2},children:[s.jsx(Kr,{control:s.jsx(wp,{checked:Q.nullable,onChange:me=>ee({...Q,nullable:me.target.checked})}),label:"Nullable"}),s.jsx(Kr,{control:s.jsx(wp,{checked:Q.isPrimaryKey,onChange:me=>ee({...Q,isPrimaryKey:me.target.checked})}),label:"Primary Key"})]})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:()=>R(!1),children:"Cancel"}),s.jsx(Le,{variant:"contained",onClick:oe,disabled:!Q.name||!Q.dataType||qe.isPending,startIcon:qe.isPending?s.jsx(At,{size:16}):s.jsx(Gn,{}),children:"Add Column"})]})]}),s.jsxs(gn,{open:E,onClose:()=>O(!1),children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(Os,{color:"error"}),"Delete Column"]}),s.jsxs(Cn,{children:[s.jsx(Nt,{severity:"warning",sx:{mb:2},children:"This action cannot be undone. All data in this column will be lost."}),s.jsxs(J,{children:['Are you sure you want to delete column "',G==null?void 0:G.name,'" from table "',B,'"?']})]}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:()=>O(!1),children:"Cancel"}),s.jsx(Le,{variant:"contained",color:"error",onClick:fe,disabled:qe.isPending,startIcon:qe.isPending?s.jsx(At,{size:16}):s.jsx(dr,{}),children:"Delete Column"})]})]}),s.jsxs(gn,{open:A,onClose:()=>N(!1),children:[s.jsxs(wn,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(Os,{color:"error"}),"Drop Table"]}),s.jsxs(Cn,{children:[s.jsx(Nt,{severity:"error",sx:{mb:2},children:"This will permanently delete the table and all its data. This action cannot be undone."}),s.jsxs(J,{children:['Are you sure you want to drop table "',B,'"?']})]}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:()=>N(!1),children:"Cancel"}),s.jsx(Le,{variant:"contained",color:"error",onClick:Ie,disabled:qe.isPending,startIcon:qe.isPending?s.jsx(At,{size:16}):s.jsx(dr,{}),children:"Drop Table"})]})]}),s.jsxs(gn,{open:F,onClose:()=>L(!1),children:[s.jsx(wn,{children:"Create Foreign Key"}),s.jsx(Cn,{children:s.jsxs(K,{sx:{pt:1},children:[s.jsx(Nt,{severity:"info",sx:{mb:2},children:"Create a foreign key relationship between the connected columns?"}),U&&s.jsxs(J,{variant:"body2",color:"text.secondary",children:["From: ",s.jsx("strong",{children:U.source})," → To:"," ",s.jsx("strong",{children:U.target})]})]})}),s.jsxs(vn,{children:[s.jsx(Le,{onClick:()=>{L(!1),Z(null)},children:"Cancel"}),s.jsx(Le,{variant:"contained",onClick:$e,disabled:qe.isPending,startIcon:qe.isPending?s.jsx(At,{size:16}):s.jsx(Gn,{}),children:"Create Foreign Key"})]})]})]});return g?s.jsx(gn,{open:g,onClose:()=>y(!1),fullScreen:!0,slotProps:{paper:{sx:{bgcolor:"background.default"}}},children:s.jsx(K,{sx:{p:2,height:"100%"},children:Je})}):s.jsx(K,{sx:{px:3,pt:2,pb:1,height:"calc(100vh - 64px)"},children:Je})}function Pde(){return s.jsxs(AF,{children:[s.jsx(fo,{path:"/welcome",element:s.jsx(yoe,{})}),s.jsxs(fo,{path:"/",element:s.jsx(CU,{}),children:[s.jsx(fo,{index:!0,element:s.jsx(k2,{to:"/dashboard",replace:!0})}),s.jsx(fo,{path:"dashboard",element:s.jsx(ZU,{})}),s.jsx(fo,{path:"projects",element:s.jsx(o7,{})}),s.jsx(fo,{path:"connections/:connectionId",element:s.jsx(wne,{})}),s.jsx(fo,{path:"query",element:s.jsx(HE,{})}),s.jsx(fo,{path:"query/:connectionId",element:s.jsx(HE,{})}),s.jsx(fo,{path:"schema/:connectionId",element:s.jsx(Qre,{})}),s.jsx(fo,{path:"groups/:groupId/sync",element:s.jsx(noe,{})}),s.jsx(fo,{path:"compare",element:s.jsx(ooe,{})}),s.jsx(fo,{path:"logs",element:s.jsx(aoe,{})}),s.jsx(fo,{path:"schema-diagram",element:s.jsx(Ede,{})}),s.jsx(fo,{path:"diagram-editor",element:s.jsx(k2,{to:"/schema-diagram",replace:!0})}),s.jsx(fo,{path:"settings",element:s.jsx(hoe,{})})]})]})}const Tde=new kA({defaultOptions:{queries:{staleTime:1e3*60,retry:1}}});function Mde(){const e=BM(n=>n.mode),t=HM(e);return s.jsxs(e_,{theme:t,children:[s.jsx(l_,{}),s.jsx(a5,{children:s.jsx(Pde,{})}),s.jsx(aU,{})]})}tA.createRoot(document.getElementById("root")).render(s.jsx(br.StrictMode,{children:s.jsx(IA,{client:Tde,children:s.jsx(Mde,{})})}));
|