(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))r(u);new MutationObserver(u=>{for(const c of u)if(c.type==="childList")for(const g of c.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&r(g)}).observe(document,{childList:!0,subtree:!0});function a(u){const c={};return u.integrity&&(c.integrity=u.integrity),u.referrerPolicy&&(c.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?c.credentials="include":u.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(u){if(u.ep)return;u.ep=!0;const c=a(u);fetch(u.href,c)}})();function Uh(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d}var mu={exports:{}},xa={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var gh;function Wm(){if(gh)return xa;gh=1;var d=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(r,u,c){var g=null;if(c!==void 0&&(g=""+c),u.key!==void 0&&(g=""+u.key),"key"in u){c={};for(var m in u)m!=="key"&&(c[m]=u[m])}else c=u;return u=c.ref,{$$typeof:d,type:r,key:g,ref:u!==void 0?u:null,props:c}}return xa.Fragment=n,xa.jsx=a,xa.jsxs=a,xa}var mh;function $m(){return mh||(mh=1,mu.exports=Wm()),mu.exports}var h=$m(),pu={exports:{}},Ee={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ph;function Fm(){if(ph)return Ee;ph=1;var d=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),g=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),T=Symbol.iterator;function Q(_){return _===null||typeof _!="object"?null:(_=T&&_[T]||_["@@iterator"],typeof _=="function"?_:null)}var Z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},F=Object.assign,ie={};function he(_,U,w){this.props=_,this.context=U,this.refs=ie,this.updater=w||Z}he.prototype.isReactComponent={},he.prototype.setState=function(_,U){if(typeof _!="object"&&typeof _!="function"&&_!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,_,U,"setState")},he.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function pe(){}pe.prototype=he.prototype;function W(_,U,w){this.props=_,this.context=U,this.refs=ie,this.updater=w||Z}var re=W.prototype=new pe;re.constructor=W,F(re,he.prototype),re.isPureReactComponent=!0;var I=Array.isArray;function H(){}var G={H:null,A:null,T:null,S:null},le=Object.prototype.hasOwnProperty;function me(_,U,w){var V=w.ref;return{$$typeof:d,type:_,key:U,ref:V!==void 0?V:null,props:w}}function Oe(_,U){return me(_.type,U,_.props)}function $(_){return typeof _=="object"&&_!==null&&_.$$typeof===d}function xe(_){var U={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(w){return U[w]})}var K=/\/+/g;function te(_,U){return typeof _=="object"&&_!==null&&_.key!=null?xe(""+_.key):U.toString(36)}function Se(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(H,H):(_.status="pending",_.then(function(U){_.status==="pending"&&(_.status="fulfilled",_.value=U)},function(U){_.status==="pending"&&(_.status="rejected",_.reason=U)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function C(_,U,w,V,P){var ae=typeof _;(ae==="undefined"||ae==="boolean")&&(_=null);var oe=!1;if(_===null)oe=!0;else switch(ae){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(_.$$typeof){case d:case n:oe=!0;break;case b:return oe=_._init,C(oe(_._payload),U,w,V,P)}}if(oe)return P=P(_),oe=V===""?"."+te(_,0):V,I(P)?(w="",oe!=null&&(w=oe.replace(K,"$&/")+"/"),C(P,U,w,"",function(Pe){return Pe})):P!=null&&($(P)&&(P=Oe(P,w+(P.key==null||_&&_.key===P.key?"":(""+P.key).replace(K,"$&/")+"/")+oe)),U.push(P)),1;oe=0;var Te=V===""?".":V+":";if(I(_))for(var ze=0;ze<_.length;ze++)V=_[ze],ae=Te+te(V,ze),oe+=C(V,U,w,ae,P);else if(ze=Q(_),typeof ze=="function")for(_=ze.call(_),ze=0;!(V=_.next()).done;)V=V.value,ae=Te+te(V,ze++),oe+=C(V,U,w,ae,P);else if(ae==="object"){if(typeof _.then=="function")return C(Se(_),U,w,V,P);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 oe}function X(_,U,w){if(_==null)return _;var V=[],P=0;return C(_,V,"","",function(ae){return U.call(w,ae,P++)}),V}function L(_){if(_._status===-1){var U=_._result;U=U(),U.then(function(w){(_._status===0||_._status===-1)&&(_._status=1,_._result=w)},function(w){(_._status===0||_._status===-1)&&(_._status=2,_._result=w)}),_._status===-1&&(_._status=0,_._result=U)}if(_._status===1)return _._result.default;throw _._result}var ne=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},_e={map:X,forEach:function(_,U,w){X(_,function(){U.apply(this,arguments)},w)},count:function(_){var U=0;return X(_,function(){U++}),U},toArray:function(_){return X(_,function(U){return U})||[]},only:function(_){if(!$(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return Ee.Activity=v,Ee.Children=_e,Ee.Component=he,Ee.Fragment=a,Ee.Profiler=u,Ee.PureComponent=W,Ee.StrictMode=r,Ee.Suspense=E,Ee.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,Ee.__COMPILER_RUNTIME={__proto__:null,c:function(_){return G.H.useMemoCache(_)}},Ee.cache=function(_){return function(){return _.apply(null,arguments)}},Ee.cacheSignal=function(){return null},Ee.cloneElement=function(_,U,w){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var V=F({},_.props),P=_.key;if(U!=null)for(ae in U.key!==void 0&&(P=""+U.key),U)!le.call(U,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&U.ref===void 0||(V[ae]=U[ae]);var ae=arguments.length-2;if(ae===1)V.children=w;else if(1<ae){for(var oe=Array(ae),Te=0;Te<ae;Te++)oe[Te]=arguments[Te+2];V.children=oe}return me(_.type,P,V)},Ee.createContext=function(_){return _={$$typeof:g,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:c,_context:_},_},Ee.createElement=function(_,U,w){var V,P={},ae=null;if(U!=null)for(V in U.key!==void 0&&(ae=""+U.key),U)le.call(U,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(P[V]=U[V]);var oe=arguments.length-2;if(oe===1)P.children=w;else if(1<oe){for(var Te=Array(oe),ze=0;ze<oe;ze++)Te[ze]=arguments[ze+2];P.children=Te}if(_&&_.defaultProps)for(V in oe=_.defaultProps,oe)P[V]===void 0&&(P[V]=oe[V]);return me(_,ae,P)},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(_){return{$$typeof:m,render:_}},Ee.isValidElement=$,Ee.lazy=function(_){return{$$typeof:b,_payload:{_status:-1,_result:_},_init:L}},Ee.memo=function(_,U){return{$$typeof:y,type:_,compare:U===void 0?null:U}},Ee.startTransition=function(_){var U=G.T,w={};G.T=w;try{var V=_(),P=G.S;P!==null&&P(w,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(H,ne)}catch(ae){ne(ae)}finally{U!==null&&w.types!==null&&(U.types=w.types),G.T=U}},Ee.unstable_useCacheRefresh=function(){return G.H.useCacheRefresh()},Ee.use=function(_){return G.H.use(_)},Ee.useActionState=function(_,U,w){return G.H.useActionState(_,U,w)},Ee.useCallback=function(_,U){return G.H.useCallback(_,U)},Ee.useContext=function(_){return G.H.useContext(_)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(_,U){return G.H.useDeferredValue(_,U)},Ee.useEffect=function(_,U){return G.H.useEffect(_,U)},Ee.useEffectEvent=function(_){return G.H.useEffectEvent(_)},Ee.useId=function(){return G.H.useId()},Ee.useImperativeHandle=function(_,U,w){return G.H.useImperativeHandle(_,U,w)},Ee.useInsertionEffect=function(_,U){return G.H.useInsertionEffect(_,U)},Ee.useLayoutEffect=function(_,U){return G.H.useLayoutEffect(_,U)},Ee.useMemo=function(_,U){return G.H.useMemo(_,U)},Ee.useOptimistic=function(_,U){return G.H.useOptimistic(_,U)},Ee.useReducer=function(_,U,w){return G.H.useReducer(_,U,w)},Ee.useRef=function(_){return G.H.useRef(_)},Ee.useState=function(_){return G.H.useState(_)},Ee.useSyncExternalStore=function(_,U,w){return G.H.useSyncExternalStore(_,U,w)},Ee.useTransition=function(){return G.H.useTransition()},Ee.version="19.2.4",Ee}var yh;function Cu(){return yh||(yh=1,pu.exports=Fm()),pu.exports}var D=Cu();const Im=Uh(D);var yu={exports:{}},ba={},vu={exports:{}},xu={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var vh;function Pm(){return vh||(vh=1,(function(d){function n(C,X){var L=C.length;C.push(X);e:for(;0<L;){var ne=L-1>>>1,_e=C[ne];if(0<u(_e,X))C[ne]=X,C[L]=_e,L=ne;else break e}}function a(C){return C.length===0?null:C[0]}function r(C){if(C.length===0)return null;var X=C[0],L=C.pop();if(L!==X){C[0]=L;e:for(var ne=0,_e=C.length,_=_e>>>1;ne<_;){var U=2*(ne+1)-1,w=C[U],V=U+1,P=C[V];if(0>u(w,L))V<_e&&0>u(P,w)?(C[ne]=P,C[V]=L,ne=V):(C[ne]=w,C[U]=L,ne=U);else if(V<_e&&0>u(P,L))C[ne]=P,C[V]=L,ne=V;else break e}}return X}function u(C,X){var L=C.sortIndex-X.sortIndex;return L!==0?L:C.id-X.id}if(d.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;d.unstable_now=function(){return c.now()}}else{var g=Date,m=g.now();d.unstable_now=function(){return g.now()-m}}var E=[],y=[],b=1,v=null,T=3,Q=!1,Z=!1,F=!1,ie=!1,he=typeof setTimeout=="function"?setTimeout:null,pe=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;function re(C){for(var X=a(y);X!==null;){if(X.callback===null)r(y);else if(X.startTime<=C)r(y),X.sortIndex=X.expirationTime,n(E,X);else break;X=a(y)}}function I(C){if(F=!1,re(C),!Z)if(a(E)!==null)Z=!0,H||(H=!0,xe());else{var X=a(y);X!==null&&Se(I,X.startTime-C)}}var H=!1,G=-1,le=5,me=-1;function Oe(){return ie?!0:!(d.unstable_now()-me<le)}function $(){if(ie=!1,H){var C=d.unstable_now();me=C;var X=!0;try{e:{Z=!1,F&&(F=!1,pe(G),G=-1),Q=!0;var L=T;try{t:{for(re(C),v=a(E);v!==null&&!(v.expirationTime>C&&Oe());){var ne=v.callback;if(typeof ne=="function"){v.callback=null,T=v.priorityLevel;var _e=ne(v.expirationTime<=C);if(C=d.unstable_now(),typeof _e=="function"){v.callback=_e,re(C),X=!0;break t}v===a(E)&&r(E),re(C)}else r(E);v=a(E)}if(v!==null)X=!0;else{var _=a(y);_!==null&&Se(I,_.startTime-C),X=!1}}break e}finally{v=null,T=L,Q=!1}X=void 0}}finally{X?xe():H=!1}}}var xe;if(typeof W=="function")xe=function(){W($)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,te=K.port2;K.port1.onmessage=$,xe=function(){te.postMessage(null)}}else xe=function(){he($,0)};function Se(C,X){G=he(function(){C(d.unstable_now())},X)}d.unstable_IdlePriority=5,d.unstable_ImmediatePriority=1,d.unstable_LowPriority=4,d.unstable_NormalPriority=3,d.unstable_Profiling=null,d.unstable_UserBlockingPriority=2,d.unstable_cancelCallback=function(C){C.callback=null},d.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<C?Math.floor(1e3/C):5},d.unstable_getCurrentPriorityLevel=function(){return T},d.unstable_next=function(C){switch(T){case 1:case 2:case 3:var X=3;break;default:X=T}var L=T;T=X;try{return C()}finally{T=L}},d.unstable_requestPaint=function(){ie=!0},d.unstable_runWithPriority=function(C,X){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var L=T;T=C;try{return X()}finally{T=L}},d.unstable_scheduleCallback=function(C,X,L){var ne=d.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?ne+L:ne):L=ne,C){case 1:var _e=-1;break;case 2:_e=250;break;case 5:_e=1073741823;break;case 4:_e=1e4;break;default:_e=5e3}return _e=L+_e,C={id:b++,callback:X,priorityLevel:C,startTime:L,expirationTime:_e,sortIndex:-1},L>ne?(C.sortIndex=L,n(y,C),a(E)===null&&C===a(y)&&(F?(pe(G),G=-1):F=!0,Se(I,L-ne))):(C.sortIndex=_e,n(E,C),Z||Q||(Z=!0,H||(H=!0,xe()))),C},d.unstable_shouldYield=Oe,d.unstable_wrapCallback=function(C){var X=T;return function(){var L=T;T=X;try{return C.apply(this,arguments)}finally{T=L}}}})(xu)),xu}var xh;function ep(){return xh||(xh=1,vu.exports=Pm()),vu.exports}var bu={exports:{}},Et={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var bh;function tp(){if(bh)return Et;bh=1;var d=Cu();function n(E){var y="https://react.dev/errors/"+E;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)y+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+E+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},u=Symbol.for("react.portal");function c(E,y,b){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:v==null?null:""+v,children:E,containerInfo:y,implementation:b}}var g=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(E,y){if(E==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return Et.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Et.createPortal=function(E,y){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(n(299));return c(E,y,null,b)},Et.flushSync=function(E){var y=g.T,b=r.p;try{if(g.T=null,r.p=2,E)return E()}finally{g.T=y,r.p=b,r.d.f()}},Et.preconnect=function(E,y){typeof E=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,r.d.C(E,y))},Et.prefetchDNS=function(E){typeof E=="string"&&r.d.D(E)},Et.preinit=function(E,y){if(typeof E=="string"&&y&&typeof y.as=="string"){var b=y.as,v=m(b,y.crossOrigin),T=typeof y.integrity=="string"?y.integrity:void 0,Q=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;b==="style"?r.d.S(E,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:v,integrity:T,fetchPriority:Q}):b==="script"&&r.d.X(E,{crossOrigin:v,integrity:T,fetchPriority:Q,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},Et.preinitModule=function(E,y){if(typeof E=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var b=m(y.as,y.crossOrigin);r.d.M(E,{crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&r.d.M(E)},Et.preload=function(E,y){if(typeof E=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var b=y.as,v=m(b,y.crossOrigin);r.d.L(E,b,{crossOrigin:v,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},Et.preloadModule=function(E,y){if(typeof E=="string")if(y){var b=m(y.as,y.crossOrigin);r.d.m(E,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else r.d.m(E)},Et.requestFormReset=function(E){r.d.r(E)},Et.unstable_batchedUpdates=function(E,y){return E(y)},Et.useFormState=function(E,y,b){return g.H.useFormState(E,y,b)},Et.useFormStatus=function(){return g.H.useHostTransitionStatus()},Et.version="19.2.4",Et}var Sh;function Bh(){if(Sh)return bu.exports;Sh=1;function d(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(d)}catch(n){console.error(n)}}return d(),bu.exports=tp(),bu.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Eh;function lp(){if(Eh)return ba;Eh=1;var d=ep(),n=Cu(),a=Bh();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function g(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function E(e){if(c(e)!==e)throw Error(r(188))}function y(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(r(188));return t!==e?null:e}for(var l=e,i=t;;){var s=l.return;if(s===null)break;var o=s.alternate;if(o===null){if(i=s.return,i!==null){l=i;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===l)return E(s),e;if(o===i)return E(s),t;o=o.sibling}throw Error(r(188))}if(l.return!==i.return)l=s,i=o;else{for(var f=!1,p=s.child;p;){if(p===l){f=!0,l=s,i=o;break}if(p===i){f=!0,i=s,l=o;break}p=p.sibling}if(!f){for(p=o.child;p;){if(p===l){f=!0,l=o,i=s;break}if(p===i){f=!0,i=o,l=s;break}p=p.sibling}if(!f)throw Error(r(189))}}if(l.alternate!==i)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,T=Symbol.for("react.element"),Q=Symbol.for("react.transitional.element"),Z=Symbol.for("react.portal"),F=Symbol.for("react.fragment"),ie=Symbol.for("react.strict_mode"),he=Symbol.for("react.profiler"),pe=Symbol.for("react.consumer"),W=Symbol.for("react.context"),re=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),me=Symbol.for("react.activity"),Oe=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function xe(e){return e===null||typeof e!="object"?null:(e=$&&e[$]||e["@@iterator"],typeof e=="function"?e:null)}var K=Symbol.for("react.client.reference");function te(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===K?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case F:return"Fragment";case he:return"Profiler";case ie:return"StrictMode";case I:return"Suspense";case H:return"SuspenseList";case me:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Z:return"Portal";case W:return e.displayName||"Context";case pe:return(e._context.displayName||"Context")+".Consumer";case re:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return t=e.displayName||null,t!==null?t:te(e.type)||"Memo";case le:t=e._payload,e=e._init;try{return te(e(t))}catch{}}return null}var Se=Array.isArray,C=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},ne=[],_e=-1;function _(e){return{current:e}}function U(e){0>_e||(e.current=ne[_e],ne[_e]=null,_e--)}function w(e,t){_e++,ne[_e]=e.current,e.current=t}var V=_(null),P=_(null),ae=_(null),oe=_(null);function Te(e,t){switch(w(ae,t),w(P,e),w(V,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ld(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ld(t),e=Ud(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(V),w(V,e)}function ze(){U(V),U(P),U(ae)}function Pe(e){e.memoizedState!==null&&w(oe,e);var t=V.current,l=Ud(t,e.type);t!==l&&(w(P,e),w(V,l))}function Ct(e){P.current===e&&(U(V),U(P)),oe.current===e&&(U(oe),ma._currentValue=L)}var Dt,ce;function Ue(e){if(Dt===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Dt=t&&t[1]||"",ce=-1<l.stack.indexOf(`
    at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Dt+e+ce}var It=!1;function cl(e,t){if(!e||It)return"";It=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(N){var A=N}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(N){A=N}e.call(Y.prototype)}}else{try{throw Error()}catch(N){A=N}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(N){if(N&&A&&typeof N.stack=="string")return[N.stack,A.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=i.DetermineComponentFrameRoot(),f=o[0],p=o[1];if(f&&p){var S=f.split(`
`),M=p.split(`
`);for(s=i=0;i<S.length&&!S[i].includes("DetermineComponentFrameRoot");)i++;for(;s<M.length&&!M[s].includes("DetermineComponentFrameRoot");)s++;if(i===S.length||s===M.length)for(i=S.length-1,s=M.length-1;1<=i&&0<=s&&S[i]!==M[s];)s--;for(;1<=i&&0<=s;i--,s--)if(S[i]!==M[s]){if(i!==1||s!==1)do if(i--,s--,0>s||S[i]!==M[s]){var k=`
`+S[i].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),k}while(1<=i&&0<=s);break}}}finally{It=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Ue(l):""}function Fe(e,t){switch(e.tag){case 26:case 27:case 5:return Ue(e.type);case 16:return Ue("Lazy");case 13:return e.child!==t&&t!==null?Ue("Suspense Fallback"):Ue("Suspense");case 19:return Ue("SuspenseList");case 0:case 15:return cl(e.type,!1);case 11:return cl(e.type.render,!1);case 1:return cl(e.type,!0);case 31:return Ue("Activity");default:return""}}function _n(e){try{var t="",l=null;do t+=Fe(e,l),l=e,e=e.return;while(e);return t}catch(i){return`
Error generating stack: `+i.message+`
`+i.stack}}var Ni=Object.prototype.hasOwnProperty,Hi=d.unstable_scheduleCallback,ki=d.unstable_cancelCallback,za=d.unstable_shouldYield,Ca=d.unstable_requestPaint,xt=d.unstable_now,Ta=d.unstable_getCurrentPriorityLevel,zn=d.unstable_ImmediatePriority,Dl=d.unstable_UserBlockingPriority,ci=d.unstable_NormalPriority,fi=d.unstable_LowPriority,Cn=d.unstable_IdlePriority,Ra=d.log,wa=d.unstable_setDisableYieldValue,Ol=null,bt=null;function Ze(e){if(typeof Ra=="function"&&wa(e),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(Ol,e)}catch{}}var tt=Math.clz32?Math.clz32:Tn,Qe=Math.log,ft=Math.LN2;function Tn(e){return e>>>=0,e===0?32:31-(Qe(e)/ft|0)|0}var Li=256,Ui=262144,Nl=4194304;function fl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function di(e,t,l){var i=e.pendingLanes;if(i===0)return 0;var s=0,o=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var p=i&134217727;return p!==0?(i=p&~o,i!==0?s=fl(i):(f&=p,f!==0?s=fl(f):l||(l=p&~e,l!==0&&(s=fl(l))))):(p=i&~o,p!==0?s=fl(p):f!==0?s=fl(f):l||(l=i&~e,l!==0&&(s=fl(l)))),s===0?0:t!==0&&t!==s&&(t&o)===0&&(o=s&-s,l=t&-t,o>=l||o===32&&(l&4194048)!==0)?t:s}function hi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function gi(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ja(){var e=Nl;return Nl<<=1,(Nl&62914560)===0&&(Nl=4194304),e}function Rn(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function mi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ar(e,t,l,i,s,o){var f=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var p=e.entanglements,S=e.expirationTimes,M=e.hiddenUpdates;for(l=f&~l;0<l;){var k=31-tt(l),Y=1<<k;p[k]=0,S[k]=-1;var A=M[k];if(A!==null)for(M[k]=null,k=0;k<A.length;k++){var N=A[k];N!==null&&(N.lane&=-536870913)}l&=~Y}i!==0&&Ma(e,i,0),o!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=o&~(f&~t))}function Ma(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-tt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|l&261930}function Aa(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var i=31-tt(l),s=1<<i;s&t|e[i]&t&&(e[i]|=t),l&=~s}}function Da(e,t){var l=t&-t;return l=(l&42)!==0?1:Bi(l),(l&(e.suspendedLanes|t))!==0?0:l}function Bi(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function wn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Hl(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:rh(e.type))}function qi(e,t){var l=X.p;try{return X.p=e,t()}finally{X.p=l}}var Pt=Math.random().toString(36).slice(2),dt="__reactFiber$"+Pt,St="__reactProps$"+Pt,kl="__reactContainer$"+Pt,jn="__reactEvents$"+Pt,sr="__reactListeners$"+Pt,rr="__reactHandles$"+Pt,Mn="__reactResources$"+Pt,Ll="__reactMarker$"+Pt;function An(e){delete e[dt],delete e[St],delete e[jn],delete e[sr],delete e[rr]}function dl(e){var t=e[dt];if(t)return t;for(var l=e.parentNode;l;){if(t=l[kl]||l[dt]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Qd(e);e!==null;){if(l=e[dt])return l;e=Qd(e)}return t}e=l,l=e.parentNode}return null}function Ul(e){if(e=e[dt]||e[kl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Bl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function el(e){var t=e[Mn];return t||(t=e[Mn]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function et(e){e[Ll]=!0}var Oa=new Set,Na={};function nt(e,t){x(e,t),x(e+"Capture",t)}function x(e,t){for(Na[e]=t,e=0;e<t.length;e++)Oa.add(t[e])}var q=RegExp("^[: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]*$"),J={},ee={};function be(e){return Ni.call(ee,e)?!0:Ni.call(J,e)?!1:q.test(e)?ee[e]=!0:(J[e]=!0,!1)}function Ke(e,t,l){if(be(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function ye(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function Ne(e,t,l,i){if(i===null)e.removeAttribute(l);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+i)}}function Je(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function hl(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ql(e,t,l){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var s=i.get,o=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(f){l=""+f,o.call(this,f)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(f){l=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function pi(e){if(!e._valueTracker){var t=hl(e)?"checked":"value";e._valueTracker=ql(e,t,""+e[t])}}function Ha(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),i="";return e&&(i=hl(e)?e.checked?"true":"false":e.value),e=i,e!==l?(t.setValue(e),!0):!1}function ka(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Xh=/[\n"\\]/g;function Xt(e){return e.replace(Xh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function or(e,t,l,i,s,o,f,p){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Je(t)):e.value!==""+Je(t)&&(e.value=""+Je(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?ur(e,f,Je(t)):l!=null?ur(e,f,Je(l)):i!=null&&e.removeAttribute("value"),s==null&&o!=null&&(e.defaultChecked=!!o),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+Je(p):e.removeAttribute("name")}function Mu(e,t,l,i,s,o,f,p){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||l!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){pi(e);return}l=l!=null?""+Je(l):"",t=t!=null?""+Je(t):l,p||t===e.value||(e.value=t),e.defaultValue=t}i=i??s,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=p?e.checked:!!i,e.defaultChecked=!!i,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),pi(e)}function ur(e,t,l){t==="number"&&ka(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Gi(e,t,l,i){if(e=e.options,t){t={};for(var s=0;s<l.length;s++)t["$"+l[s]]=!0;for(l=0;l<e.length;l++)s=t.hasOwnProperty("$"+e[l].value),e[l].selected!==s&&(e[l].selected=s),s&&i&&(e[l].defaultSelected=!0)}else{for(l=""+Je(l),t=null,s=0;s<e.length;s++){if(e[s].value===l){e[s].selected=!0,i&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Au(e,t,l){if(t!=null&&(t=""+Je(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Je(l):""}function Du(e,t,l,i){if(t==null){if(i!=null){if(l!=null)throw Error(r(92));if(Se(i)){if(1<i.length)throw Error(r(93));i=i[0]}l=i}l==null&&(l=""),t=l}l=Je(t),e.defaultValue=l,i=e.textContent,i===l&&i!==""&&i!==null&&(e.value=i),pi(e)}function Yi(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var Vh=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ou(e,t,l){var i=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,l):typeof l!="number"||l===0||Vh.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Nu(e,t,l){if(t!=null&&typeof t!="object")throw Error(r(62));if(e=e.style,l!=null){for(var i in l)!l.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var s in t)i=t[s],t.hasOwnProperty(s)&&l[s]!==i&&Ou(e,s,i)}else for(var o in t)t.hasOwnProperty(o)&&Ou(e,o,t[o])}function cr(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Qh=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Zh=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function La(e){return Zh.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function gl(){}var fr=null;function dr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xi=null,Vi=null;function Hu(e){var t=Ul(e);if(t&&(e=t.stateNode)){var l=e[St]||null;e:switch(e=t.stateNode,t.type){case"input":if(or(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Xt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var i=l[t];if(i!==e&&i.form===e.form){var s=i[St]||null;if(!s)throw Error(r(90));or(i,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<l.length;t++)i=l[t],i.form===e.form&&Ha(i)}break e;case"textarea":Au(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Gi(e,!!l.multiple,t,!1)}}}var hr=!1;function ku(e,t,l){if(hr)return e(t,l);hr=!0;try{var i=e(t);return i}finally{if(hr=!1,(Xi!==null||Vi!==null)&&(zs(),Xi&&(t=Xi,e=Vi,Vi=Xi=null,Hu(t),e)))for(t=0;t<e.length;t++)Hu(e[t])}}function Dn(e,t){var l=e.stateNode;if(l===null)return null;var i=l[St]||null;if(i===null)return null;l=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(r(231,t,typeof l));return l}var ml=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gr=!1;if(ml)try{var On={};Object.defineProperty(On,"passive",{get:function(){gr=!0}}),window.addEventListener("test",On,On),window.removeEventListener("test",On,On)}catch{gr=!1}var Gl=null,mr=null,Ua=null;function Lu(){if(Ua)return Ua;var e,t=mr,l=t.length,i,s="value"in Gl?Gl.value:Gl.textContent,o=s.length;for(e=0;e<l&&t[e]===s[e];e++);var f=l-e;for(i=1;i<=f&&t[l-i]===s[o-i];i++);return Ua=s.slice(e,1<i?1-i:void 0)}function Ba(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function qa(){return!0}function Uu(){return!1}function Tt(e){function t(l,i,s,o,f){this._reactName=l,this._targetInst=s,this.type=i,this.nativeEvent=o,this.target=f,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(l=e[p],this[p]=l?l(o):o[p]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?qa:Uu,this.isPropagationStopped=Uu,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=qa)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=qa)},persist:function(){},isPersistent:qa}),t}var yi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ga=Tt(yi),Nn=v({},yi,{view:0,detail:0}),Kh=Tt(Nn),pr,yr,Hn,Ya=v({},Nn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Hn&&(Hn&&e.type==="mousemove"?(pr=e.screenX-Hn.screenX,yr=e.screenY-Hn.screenY):yr=pr=0,Hn=e),pr)},movementY:function(e){return"movementY"in e?e.movementY:yr}}),Bu=Tt(Ya),Jh=v({},Ya,{dataTransfer:0}),Wh=Tt(Jh),$h=v({},Nn,{relatedTarget:0}),vr=Tt($h),Fh=v({},yi,{animationName:0,elapsedTime:0,pseudoElement:0}),Ih=Tt(Fh),Ph=v({},yi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),eg=Tt(Ph),tg=v({},yi,{data:0}),qu=Tt(tg),lg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ig={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"},ng={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ag(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ng[e])?!!t[e]:!1}function xr(){return ag}var sg=v({},Nn,{key:function(e){if(e.key){var t=lg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ba(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ig[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xr,charCode:function(e){return e.type==="keypress"?Ba(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ba(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),rg=Tt(sg),og=v({},Ya,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gu=Tt(og),ug=v({},Nn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xr}),cg=Tt(ug),fg=v({},yi,{propertyName:0,elapsedTime:0,pseudoElement:0}),dg=Tt(fg),hg=v({},Ya,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),gg=Tt(hg),mg=v({},yi,{newState:0,oldState:0}),pg=Tt(mg),yg=[9,13,27,32],br=ml&&"CompositionEvent"in window,kn=null;ml&&"documentMode"in document&&(kn=document.documentMode);var vg=ml&&"TextEvent"in window&&!kn,Yu=ml&&(!br||kn&&8<kn&&11>=kn),Xu=" ",Vu=!1;function Qu(e,t){switch(e){case"keyup":return yg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qi=!1;function xg(e,t){switch(e){case"compositionend":return Zu(t);case"keypress":return t.which!==32?null:(Vu=!0,Xu);case"textInput":return e=t.data,e===Xu&&Vu?null:e;default:return null}}function bg(e,t){if(Qi)return e==="compositionend"||!br&&Qu(e,t)?(e=Lu(),Ua=mr=Gl=null,Qi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Yu&&t.locale!=="ko"?null:t.data;default:return null}}var Sg={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 Ku(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Sg[e.type]:t==="textarea"}function Ju(e,t,l,i){Xi?Vi?Vi.push(i):Vi=[i]:Xi=i,t=As(t,"onChange"),0<t.length&&(l=new Ga("onChange","change",null,l,i),e.push({event:l,listeners:t}))}var Ln=null,Un=null;function Eg(e){Ad(e,0)}function Xa(e){var t=Bl(e);if(Ha(t))return e}function Wu(e,t){if(e==="change")return t}var $u=!1;if(ml){var Sr;if(ml){var Er="oninput"in document;if(!Er){var Fu=document.createElement("div");Fu.setAttribute("oninput","return;"),Er=typeof Fu.oninput=="function"}Sr=Er}else Sr=!1;$u=Sr&&(!document.documentMode||9<document.documentMode)}function Iu(){Ln&&(Ln.detachEvent("onpropertychange",Pu),Un=Ln=null)}function Pu(e){if(e.propertyName==="value"&&Xa(Un)){var t=[];Ju(t,Un,e,dr(e)),ku(Eg,t)}}function _g(e,t,l){e==="focusin"?(Iu(),Ln=t,Un=l,Ln.attachEvent("onpropertychange",Pu)):e==="focusout"&&Iu()}function zg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xa(Un)}function Cg(e,t){if(e==="click")return Xa(t)}function Tg(e,t){if(e==="input"||e==="change")return Xa(t)}function Rg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ot=typeof Object.is=="function"?Object.is:Rg;function Bn(e,t){if(Ot(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),i=Object.keys(t);if(l.length!==i.length)return!1;for(i=0;i<l.length;i++){var s=l[i];if(!Ni.call(t,s)||!Ot(e[s],t[s]))return!1}return!0}function ec(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tc(e,t){var l=ec(e);e=0;for(var i;l;){if(l.nodeType===3){if(i=e+l.textContent.length,e<=t&&i>=t)return{node:l,offset:t-e};e=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=ec(l)}}function lc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?lc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ic(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ka(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=ka(e.document)}return t}function _r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var wg=ml&&"documentMode"in document&&11>=document.documentMode,Zi=null,zr=null,qn=null,Cr=!1;function nc(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Cr||Zi==null||Zi!==ka(i)||(i=Zi,"selectionStart"in i&&_r(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}),qn&&Bn(qn,i)||(qn=i,i=As(zr,"onSelect"),0<i.length&&(t=new Ga("onSelect","select",null,t,l),e.push({event:t,listeners:i}),t.target=Zi)))}function vi(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Ki={animationend:vi("Animation","AnimationEnd"),animationiteration:vi("Animation","AnimationIteration"),animationstart:vi("Animation","AnimationStart"),transitionrun:vi("Transition","TransitionRun"),transitionstart:vi("Transition","TransitionStart"),transitioncancel:vi("Transition","TransitionCancel"),transitionend:vi("Transition","TransitionEnd")},Tr={},ac={};ml&&(ac=document.createElement("div").style,"AnimationEvent"in window||(delete Ki.animationend.animation,delete Ki.animationiteration.animation,delete Ki.animationstart.animation),"TransitionEvent"in window||delete Ki.transitionend.transition);function xi(e){if(Tr[e])return Tr[e];if(!Ki[e])return e;var t=Ki[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in ac)return Tr[e]=t[l];return e}var sc=xi("animationend"),rc=xi("animationiteration"),oc=xi("animationstart"),jg=xi("transitionrun"),Mg=xi("transitionstart"),Ag=xi("transitioncancel"),uc=xi("transitionend"),cc=new Map,Rr="abort auxClick beforeToggle 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(" ");Rr.push("scrollEnd");function tl(e,t){cc.set(e,t),nt(t,[e])}var Va=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Vt=[],Ji=0,wr=0;function Qa(){for(var e=Ji,t=wr=Ji=0;t<e;){var l=Vt[t];Vt[t++]=null;var i=Vt[t];Vt[t++]=null;var s=Vt[t];Vt[t++]=null;var o=Vt[t];if(Vt[t++]=null,i!==null&&s!==null){var f=i.pending;f===null?s.next=s:(s.next=f.next,f.next=s),i.pending=s}o!==0&&fc(l,s,o)}}function Za(e,t,l,i){Vt[Ji++]=e,Vt[Ji++]=t,Vt[Ji++]=l,Vt[Ji++]=i,wr|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function jr(e,t,l,i){return Za(e,t,l,i),Ka(e)}function bi(e,t){return Za(e,null,null,t),Ka(e)}function fc(e,t,l){e.lanes|=l;var i=e.alternate;i!==null&&(i.lanes|=l);for(var s=!1,o=e.return;o!==null;)o.childLanes|=l,i=o.alternate,i!==null&&(i.childLanes|=l),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(s=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,s&&t!==null&&(s=31-tt(l),e=o.hiddenUpdates,i=e[s],i===null?e[s]=[t]:i.push(t),t.lane=l|536870912),o):null}function Ka(e){if(50<oa)throw oa=0,Bo=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Wi={};function Dg(e,t,l,i){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,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 Nt(e,t,l,i){return new Dg(e,t,l,i)}function Mr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pl(e,t){var l=e.alternate;return l===null?(l=Nt(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function dc(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ja(e,t,l,i,s,o){var f=0;if(i=e,typeof e=="function")Mr(e)&&(f=1);else if(typeof e=="string")f=Lm(e,l,V.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case me:return e=Nt(31,l,t,s),e.elementType=me,e.lanes=o,e;case F:return Si(l.children,s,o,t);case ie:f=8,s|=24;break;case he:return e=Nt(12,l,t,s|2),e.elementType=he,e.lanes=o,e;case I:return e=Nt(13,l,t,s),e.elementType=I,e.lanes=o,e;case H:return e=Nt(19,l,t,s),e.elementType=H,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case W:f=10;break e;case pe:f=9;break e;case re:f=11;break e;case G:f=14;break e;case le:f=16,i=null;break e}f=29,l=Error(r(130,e===null?"null":typeof e,"")),i=null}return t=Nt(f,l,t,s),t.elementType=e,t.type=i,t.lanes=o,t}function Si(e,t,l,i){return e=Nt(7,e,i,t),e.lanes=l,e}function Ar(e,t,l){return e=Nt(6,e,null,t),e.lanes=l,e}function hc(e){var t=Nt(18,null,null,0);return t.stateNode=e,t}function Dr(e,t,l){return t=Nt(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gc=new WeakMap;function Qt(e,t){if(typeof e=="object"&&e!==null){var l=gc.get(e);return l!==void 0?l:(t={value:e,source:t,stack:_n(t)},gc.set(e,t),t)}return{value:e,source:t,stack:_n(t)}}var $i=[],Fi=0,Wa=null,Gn=0,Zt=[],Kt=0,Yl=null,al=1,sl="";function yl(e,t){$i[Fi++]=Gn,$i[Fi++]=Wa,Wa=e,Gn=t}function mc(e,t,l){Zt[Kt++]=al,Zt[Kt++]=sl,Zt[Kt++]=Yl,Yl=e;var i=al;e=sl;var s=32-tt(i)-1;i&=~(1<<s),l+=1;var o=32-tt(t)+s;if(30<o){var f=s-s%5;o=(i&(1<<f)-1).toString(32),i>>=f,s-=f,al=1<<32-tt(t)+s|l<<s|i,sl=o+e}else al=1<<o|l<<s|i,sl=e}function Or(e){e.return!==null&&(yl(e,1),mc(e,1,0))}function Nr(e){for(;e===Wa;)Wa=$i[--Fi],$i[Fi]=null,Gn=$i[--Fi],$i[Fi]=null;for(;e===Yl;)Yl=Zt[--Kt],Zt[Kt]=null,sl=Zt[--Kt],Zt[Kt]=null,al=Zt[--Kt],Zt[Kt]=null}function pc(e,t){Zt[Kt++]=al,Zt[Kt++]=sl,Zt[Kt++]=Yl,al=t.id,sl=t.overflow,Yl=e}var mt=null,We=null,De=!1,Xl=null,Jt=!1,Hr=Error(r(519));function Vl(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Yn(Qt(t,e)),Hr}function yc(e){var t=e.stateNode,l=e.type,i=e.memoizedProps;switch(t[dt]=e,t[St]=i,l){case"dialog":je("cancel",t),je("close",t);break;case"iframe":case"object":case"embed":je("load",t);break;case"video":case"audio":for(l=0;l<ca.length;l++)je(ca[l],t);break;case"source":je("error",t);break;case"img":case"image":case"link":je("error",t),je("load",t);break;case"details":je("toggle",t);break;case"input":je("invalid",t),Mu(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":je("invalid",t);break;case"textarea":je("invalid",t),Du(t,i.value,i.defaultValue,i.children)}l=i.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||i.suppressHydrationWarning===!0||Hd(t.textContent,l)?(i.popover!=null&&(je("beforetoggle",t),je("toggle",t)),i.onScroll!=null&&je("scroll",t),i.onScrollEnd!=null&&je("scrollend",t),i.onClick!=null&&(t.onclick=gl),t=!0):t=!1,t||Vl(e,!0)}function vc(e){for(mt=e.return;mt;)switch(mt.tag){case 5:case 31:case 13:Jt=!1;return;case 27:case 3:Jt=!0;return;default:mt=mt.return}}function Ii(e){if(e!==mt)return!1;if(!De)return vc(e),De=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||eu(e.type,e.memoizedProps)),l=!l),l&&We&&Vl(e),vc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));We=Vd(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));We=Vd(e)}else t===27?(t=We,ni(e.type)?(e=au,au=null,We=e):We=t):We=mt?$t(e.stateNode.nextSibling):null;return!0}function Ei(){We=mt=null,De=!1}function kr(){var e=Xl;return e!==null&&(Mt===null?Mt=e:Mt.push.apply(Mt,e),Xl=null),e}function Yn(e){Xl===null?Xl=[e]:Xl.push(e)}var Lr=_(null),_i=null,vl=null;function Ql(e,t,l){w(Lr,t._currentValue),t._currentValue=l}function xl(e){e._currentValue=Lr.current,U(Lr)}function Ur(e,t,l){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===l)break;e=e.return}}function Br(e,t,l,i){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var o=s.dependencies;if(o!==null){var f=s.child;o=o.firstContext;e:for(;o!==null;){var p=o;o=s;for(var S=0;S<t.length;S++)if(p.context===t[S]){o.lanes|=l,p=o.alternate,p!==null&&(p.lanes|=l),Ur(o.return,l,e),i||(f=null);break e}o=p.next}}else if(s.tag===18){if(f=s.return,f===null)throw Error(r(341));f.lanes|=l,o=f.alternate,o!==null&&(o.lanes|=l),Ur(f,l,e),f=null}else f=s.child;if(f!==null)f.return=s;else for(f=s;f!==null;){if(f===e){f=null;break}if(s=f.sibling,s!==null){s.return=f.return,f=s;break}f=f.return}s=f}}function Pi(e,t,l,i){e=null;for(var s=t,o=!1;s!==null;){if(!o){if((s.flags&524288)!==0)o=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var f=s.alternate;if(f===null)throw Error(r(387));if(f=f.memoizedProps,f!==null){var p=s.type;Ot(s.pendingProps.value,f.value)||(e!==null?e.push(p):e=[p])}}else if(s===oe.current){if(f=s.alternate,f===null)throw Error(r(387));f.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(ma):e=[ma])}s=s.return}e!==null&&Br(t,e,l,i),t.flags|=262144}function $a(e){for(e=e.firstContext;e!==null;){if(!Ot(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function zi(e){_i=e,vl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function pt(e){return xc(_i,e)}function Fa(e,t){return _i===null&&zi(e),xc(e,t)}function xc(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},vl===null){if(e===null)throw Error(r(308));vl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else vl=vl.next=t;return l}var Og=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},Ng=d.unstable_scheduleCallback,Hg=d.unstable_NormalPriority,rt={$$typeof:W,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function qr(){return{controller:new Og,data:new Map,refCount:0}}function Xn(e){e.refCount--,e.refCount===0&&Ng(Hg,function(){e.controller.abort()})}var Vn=null,Gr=0,en=0,tn=null;function kg(e,t){if(Vn===null){var l=Vn=[];Gr=0,en=Qo(),tn={status:"pending",value:void 0,then:function(i){l.push(i)}}}return Gr++,t.then(bc,bc),t}function bc(){if(--Gr===0&&Vn!==null){tn!==null&&(tn.status="fulfilled");var e=Vn;Vn=null,en=0,tn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Lg(e,t){var l=[],i={status:"pending",value:null,reason:null,then:function(s){l.push(s)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var s=0;s<l.length;s++)(0,l[s])(t)},function(s){for(i.status="rejected",i.reason=s,s=0;s<l.length;s++)(0,l[s])(void 0)}),i}var Sc=C.S;C.S=function(e,t){ad=xt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&kg(e,t),Sc!==null&&Sc(e,t)};var Ci=_(null);function Yr(){var e=Ci.current;return e!==null?e:Ve.pooledCache}function Ia(e,t){t===null?w(Ci,Ci.current):w(Ci,t.pool)}function Ec(){var e=Yr();return e===null?null:{parent:rt._currentValue,pool:e}}var ln=Error(r(460)),Xr=Error(r(474)),Pa=Error(r(542)),es={then:function(){}};function _c(e){return e=e.status,e==="fulfilled"||e==="rejected"}function zc(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(gl,gl),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Tc(e),e;default:if(typeof t.status=="string")t.then(gl,gl);else{if(e=Ve,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=i}},function(i){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Tc(e),e}throw Ri=t,ln}}function Ti(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Ri=l,ln):l}}var Ri=null;function Cc(){if(Ri===null)throw Error(r(459));var e=Ri;return Ri=null,e}function Tc(e){if(e===ln||e===Pa)throw Error(r(483))}var nn=null,Qn=0;function ts(e){var t=Qn;return Qn+=1,nn===null&&(nn=[]),zc(nn,e,t)}function Zn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ls(e,t){throw t.$$typeof===T?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Rc(e){function t(R,z){if(e){var j=R.deletions;j===null?(R.deletions=[z],R.flags|=16):j.push(z)}}function l(R,z){if(!e)return null;for(;z!==null;)t(R,z),z=z.sibling;return null}function i(R){for(var z=new Map;R!==null;)R.key!==null?z.set(R.key,R):z.set(R.index,R),R=R.sibling;return z}function s(R,z){return R=pl(R,z),R.index=0,R.sibling=null,R}function o(R,z,j){return R.index=j,e?(j=R.alternate,j!==null?(j=j.index,j<z?(R.flags|=67108866,z):j):(R.flags|=67108866,z)):(R.flags|=1048576,z)}function f(R){return e&&R.alternate===null&&(R.flags|=67108866),R}function p(R,z,j,B){return z===null||z.tag!==6?(z=Ar(j,R.mode,B),z.return=R,z):(z=s(z,j),z.return=R,z)}function S(R,z,j,B){var de=j.type;return de===F?k(R,z,j.props.children,B,j.key):z!==null&&(z.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===le&&Ti(de)===z.type)?(z=s(z,j.props),Zn(z,j),z.return=R,z):(z=Ja(j.type,j.key,j.props,null,R.mode,B),Zn(z,j),z.return=R,z)}function M(R,z,j,B){return z===null||z.tag!==4||z.stateNode.containerInfo!==j.containerInfo||z.stateNode.implementation!==j.implementation?(z=Dr(j,R.mode,B),z.return=R,z):(z=s(z,j.children||[]),z.return=R,z)}function k(R,z,j,B,de){return z===null||z.tag!==7?(z=Si(j,R.mode,B,de),z.return=R,z):(z=s(z,j),z.return=R,z)}function Y(R,z,j){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=Ar(""+z,R.mode,j),z.return=R,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case Q:return j=Ja(z.type,z.key,z.props,null,R.mode,j),Zn(j,z),j.return=R,j;case Z:return z=Dr(z,R.mode,j),z.return=R,z;case le:return z=Ti(z),Y(R,z,j)}if(Se(z)||xe(z))return z=Si(z,R.mode,j,null),z.return=R,z;if(typeof z.then=="function")return Y(R,ts(z),j);if(z.$$typeof===W)return Y(R,Fa(R,z),j);ls(R,z)}return null}function A(R,z,j,B){var de=z!==null?z.key:null;if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return de!==null?null:p(R,z,""+j,B);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Q:return j.key===de?S(R,z,j,B):null;case Z:return j.key===de?M(R,z,j,B):null;case le:return j=Ti(j),A(R,z,j,B)}if(Se(j)||xe(j))return de!==null?null:k(R,z,j,B,null);if(typeof j.then=="function")return A(R,z,ts(j),B);if(j.$$typeof===W)return A(R,z,Fa(R,j),B);ls(R,j)}return null}function N(R,z,j,B,de){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return R=R.get(j)||null,p(z,R,""+B,de);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case Q:return R=R.get(B.key===null?j:B.key)||null,S(z,R,B,de);case Z:return R=R.get(B.key===null?j:B.key)||null,M(z,R,B,de);case le:return B=Ti(B),N(R,z,j,B,de)}if(Se(B)||xe(B))return R=R.get(j)||null,k(z,R,B,de,null);if(typeof B.then=="function")return N(R,z,j,ts(B),de);if(B.$$typeof===W)return N(R,z,j,Fa(z,B),de);ls(z,B)}return null}function se(R,z,j,B){for(var de=null,He=null,ue=z,Re=z=0,Ae=null;ue!==null&&Re<j.length;Re++){ue.index>Re?(Ae=ue,ue=null):Ae=ue.sibling;var ke=A(R,ue,j[Re],B);if(ke===null){ue===null&&(ue=Ae);break}e&&ue&&ke.alternate===null&&t(R,ue),z=o(ke,z,Re),He===null?de=ke:He.sibling=ke,He=ke,ue=Ae}if(Re===j.length)return l(R,ue),De&&yl(R,Re),de;if(ue===null){for(;Re<j.length;Re++)ue=Y(R,j[Re],B),ue!==null&&(z=o(ue,z,Re),He===null?de=ue:He.sibling=ue,He=ue);return De&&yl(R,Re),de}for(ue=i(ue);Re<j.length;Re++)Ae=N(ue,R,Re,j[Re],B),Ae!==null&&(e&&Ae.alternate!==null&&ue.delete(Ae.key===null?Re:Ae.key),z=o(Ae,z,Re),He===null?de=Ae:He.sibling=Ae,He=Ae);return e&&ue.forEach(function(ui){return t(R,ui)}),De&&yl(R,Re),de}function ge(R,z,j,B){if(j==null)throw Error(r(151));for(var de=null,He=null,ue=z,Re=z=0,Ae=null,ke=j.next();ue!==null&&!ke.done;Re++,ke=j.next()){ue.index>Re?(Ae=ue,ue=null):Ae=ue.sibling;var ui=A(R,ue,ke.value,B);if(ui===null){ue===null&&(ue=Ae);break}e&&ue&&ui.alternate===null&&t(R,ue),z=o(ui,z,Re),He===null?de=ui:He.sibling=ui,He=ui,ue=Ae}if(ke.done)return l(R,ue),De&&yl(R,Re),de;if(ue===null){for(;!ke.done;Re++,ke=j.next())ke=Y(R,ke.value,B),ke!==null&&(z=o(ke,z,Re),He===null?de=ke:He.sibling=ke,He=ke);return De&&yl(R,Re),de}for(ue=i(ue);!ke.done;Re++,ke=j.next())ke=N(ue,R,Re,ke.value,B),ke!==null&&(e&&ke.alternate!==null&&ue.delete(ke.key===null?Re:ke.key),z=o(ke,z,Re),He===null?de=ke:He.sibling=ke,He=ke);return e&&ue.forEach(function(Jm){return t(R,Jm)}),De&&yl(R,Re),de}function Xe(R,z,j,B){if(typeof j=="object"&&j!==null&&j.type===F&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case Q:e:{for(var de=j.key;z!==null;){if(z.key===de){if(de=j.type,de===F){if(z.tag===7){l(R,z.sibling),B=s(z,j.props.children),B.return=R,R=B;break e}}else if(z.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===le&&Ti(de)===z.type){l(R,z.sibling),B=s(z,j.props),Zn(B,j),B.return=R,R=B;break e}l(R,z);break}else t(R,z);z=z.sibling}j.type===F?(B=Si(j.props.children,R.mode,B,j.key),B.return=R,R=B):(B=Ja(j.type,j.key,j.props,null,R.mode,B),Zn(B,j),B.return=R,R=B)}return f(R);case Z:e:{for(de=j.key;z!==null;){if(z.key===de)if(z.tag===4&&z.stateNode.containerInfo===j.containerInfo&&z.stateNode.implementation===j.implementation){l(R,z.sibling),B=s(z,j.children||[]),B.return=R,R=B;break e}else{l(R,z);break}else t(R,z);z=z.sibling}B=Dr(j,R.mode,B),B.return=R,R=B}return f(R);case le:return j=Ti(j),Xe(R,z,j,B)}if(Se(j))return se(R,z,j,B);if(xe(j)){if(de=xe(j),typeof de!="function")throw Error(r(150));return j=de.call(j),ge(R,z,j,B)}if(typeof j.then=="function")return Xe(R,z,ts(j),B);if(j.$$typeof===W)return Xe(R,z,Fa(R,j),B);ls(R,j)}return typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint"?(j=""+j,z!==null&&z.tag===6?(l(R,z.sibling),B=s(z,j),B.return=R,R=B):(l(R,z),B=Ar(j,R.mode,B),B.return=R,R=B),f(R)):l(R,z)}return function(R,z,j,B){try{Qn=0;var de=Xe(R,z,j,B);return nn=null,de}catch(ue){if(ue===ln||ue===Pa)throw ue;var He=Nt(29,ue,null,R.mode);return He.lanes=B,He.return=R,He}finally{}}}var wi=Rc(!0),wc=Rc(!1),Zl=!1;function Vr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qr(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Kl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Jl(e,t,l){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Le&2)!==0){var s=i.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),i.pending=t,t=Ka(e),fc(e,null,l),t}return Za(e,i,t,l),Ka(e)}function Kn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,Aa(e,l)}}function Zr(e,t){var l=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var s=null,o=null;if(l=l.firstBaseUpdate,l!==null){do{var f={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};o===null?s=o=f:o=o.next=f,l=l.next}while(l!==null);o===null?s=o=t:o=o.next=t}else s=o=t;l={baseState:i.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:i.shared,callbacks:i.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Kr=!1;function Jn(){if(Kr){var e=tn;if(e!==null)throw e}}function Wn(e,t,l,i){Kr=!1;var s=e.updateQueue;Zl=!1;var o=s.firstBaseUpdate,f=s.lastBaseUpdate,p=s.shared.pending;if(p!==null){s.shared.pending=null;var S=p,M=S.next;S.next=null,f===null?o=M:f.next=M,f=S;var k=e.alternate;k!==null&&(k=k.updateQueue,p=k.lastBaseUpdate,p!==f&&(p===null?k.firstBaseUpdate=M:p.next=M,k.lastBaseUpdate=S))}if(o!==null){var Y=s.baseState;f=0,k=M=S=null,p=o;do{var A=p.lane&-536870913,N=A!==p.lane;if(N?(Me&A)===A:(i&A)===A){A!==0&&A===en&&(Kr=!0),k!==null&&(k=k.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var se=e,ge=p;A=t;var Xe=l;switch(ge.tag){case 1:if(se=ge.payload,typeof se=="function"){Y=se.call(Xe,Y,A);break e}Y=se;break e;case 3:se.flags=se.flags&-65537|128;case 0:if(se=ge.payload,A=typeof se=="function"?se.call(Xe,Y,A):se,A==null)break e;Y=v({},Y,A);break e;case 2:Zl=!0}}A=p.callback,A!==null&&(e.flags|=64,N&&(e.flags|=8192),N=s.callbacks,N===null?s.callbacks=[A]:N.push(A))}else N={lane:A,tag:p.tag,payload:p.payload,callback:p.callback,next:null},k===null?(M=k=N,S=Y):k=k.next=N,f|=A;if(p=p.next,p===null){if(p=s.shared.pending,p===null)break;N=p,p=N.next,N.next=null,s.lastBaseUpdate=N,s.shared.pending=null}}while(!0);k===null&&(S=Y),s.baseState=S,s.firstBaseUpdate=M,s.lastBaseUpdate=k,o===null&&(s.shared.lanes=0),Pl|=f,e.lanes=f,e.memoizedState=Y}}function jc(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function Mc(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)jc(l[e],t)}var an=_(null),is=_(0);function Ac(e,t){e=wl,w(is,e),w(an,t),wl=e|t.baseLanes}function Jr(){w(is,wl),w(an,an.current)}function Wr(){wl=is.current,U(an),U(is)}var Ht=_(null),Wt=null;function Wl(e){var t=e.alternate;w(at,at.current&1),w(Ht,e),Wt===null&&(t===null||an.current!==null||t.memoizedState!==null)&&(Wt=e)}function $r(e){w(at,at.current),w(Ht,e),Wt===null&&(Wt=e)}function Dc(e){e.tag===22?(w(at,at.current),w(Ht,e),Wt===null&&(Wt=e)):$l()}function $l(){w(at,at.current),w(Ht,Ht.current)}function kt(e){U(Ht),Wt===e&&(Wt=null),U(at)}var at=_(0);function ns(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||iu(l)||nu(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var bl=0,Ce=null,Ge=null,ot=null,as=!1,sn=!1,ji=!1,ss=0,$n=0,rn=null,Ug=0;function lt(){throw Error(r(321))}function Fr(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!Ot(e[l],t[l]))return!1;return!0}function Ir(e,t,l,i,s,o){return bl=o,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?pf:go,ji=!1,o=l(i,s),ji=!1,sn&&(o=Nc(t,l,i,s)),Oc(e),o}function Oc(e){C.H=Pn;var t=Ge!==null&&Ge.next!==null;if(bl=0,ot=Ge=Ce=null,as=!1,$n=0,rn=null,t)throw Error(r(300));e===null||ut||(e=e.dependencies,e!==null&&$a(e)&&(ut=!0))}function Nc(e,t,l,i){Ce=e;var s=0;do{if(sn&&(rn=null),$n=0,sn=!1,25<=s)throw Error(r(301));if(s+=1,ot=Ge=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}C.H=yf,o=t(l,i)}while(sn);return o}function Bg(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?Fn(t):t,e=e.useState()[0],(Ge!==null?Ge.memoizedState:null)!==e&&(Ce.flags|=1024),t}function Pr(){var e=ss!==0;return ss=0,e}function eo(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function to(e){if(as){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}as=!1}bl=0,ot=Ge=Ce=null,sn=!1,$n=ss=0,rn=null}function _t(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ot===null?Ce.memoizedState=ot=e:ot=ot.next=e,ot}function st(){if(Ge===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=ot===null?Ce.memoizedState:ot.next;if(t!==null)ot=t,Ge=e;else{if(e===null)throw Ce.alternate===null?Error(r(467)):Error(r(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},ot===null?Ce.memoizedState=ot=e:ot=ot.next=e}return ot}function rs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fn(e){var t=$n;return $n+=1,rn===null&&(rn=[]),e=zc(rn,e,t),t=Ce,(ot===null?t.memoizedState:ot.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?pf:go),e}function os(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Fn(e);if(e.$$typeof===W)return pt(e)}throw Error(r(438,String(e)))}function lo(e){var t=null,l=Ce.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var i=Ce.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=rs(),Ce.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),i=0;i<e;i++)l[i]=Oe;return t.index++,l}function Sl(e,t){return typeof t=="function"?t(e):t}function us(e){var t=st();return io(t,Ge,e)}function io(e,t,l){var i=e.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=l;var s=e.baseQueue,o=i.pending;if(o!==null){if(s!==null){var f=s.next;s.next=o.next,o.next=f}t.baseQueue=s=o,i.pending=null}if(o=e.baseState,s===null)e.memoizedState=o;else{t=s.next;var p=f=null,S=null,M=t,k=!1;do{var Y=M.lane&-536870913;if(Y!==M.lane?(Me&Y)===Y:(bl&Y)===Y){var A=M.revertLane;if(A===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null}),Y===en&&(k=!0);else if((bl&A)===A){M=M.next,A===en&&(k=!0);continue}else Y={lane:0,revertLane:M.revertLane,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},S===null?(p=S=Y,f=o):S=S.next=Y,Ce.lanes|=A,Pl|=A;Y=M.action,ji&&l(o,Y),o=M.hasEagerState?M.eagerState:l(o,Y)}else A={lane:Y,revertLane:M.revertLane,gesture:M.gesture,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},S===null?(p=S=A,f=o):S=S.next=A,Ce.lanes|=Y,Pl|=Y;M=M.next}while(M!==null&&M!==t);if(S===null?f=o:S.next=p,!Ot(o,e.memoizedState)&&(ut=!0,k&&(l=tn,l!==null)))throw l;e.memoizedState=o,e.baseState=f,e.baseQueue=S,i.lastRenderedState=o}return s===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function no(e){var t=st(),l=t.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=e;var i=l.dispatch,s=l.pending,o=t.memoizedState;if(s!==null){l.pending=null;var f=s=s.next;do o=e(o,f.action),f=f.next;while(f!==s);Ot(o,t.memoizedState)||(ut=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),l.lastRenderedState=o}return[o,i]}function Hc(e,t,l){var i=Ce,s=st(),o=De;if(o){if(l===void 0)throw Error(r(407));l=l()}else l=t();var f=!Ot((Ge||s).memoizedState,l);if(f&&(s.memoizedState=l,ut=!0),s=s.queue,ro(Uc.bind(null,i,s,e),[e]),s.getSnapshot!==t||f||ot!==null&&ot.memoizedState.tag&1){if(i.flags|=2048,on(9,{destroy:void 0},Lc.bind(null,i,s,l,t),null),Ve===null)throw Error(r(349));o||(bl&127)!==0||kc(i,t,l)}return l}function kc(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=Ce.updateQueue,t===null?(t=rs(),Ce.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function Lc(e,t,l,i){t.value=l,t.getSnapshot=i,Bc(t)&&qc(e)}function Uc(e,t,l){return l(function(){Bc(t)&&qc(e)})}function Bc(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!Ot(e,l)}catch{return!0}}function qc(e){var t=bi(e,2);t!==null&&At(t,e,2)}function ao(e){var t=_t();if(typeof e=="function"){var l=e;if(e=l(),ji){Ze(!0);try{l()}finally{Ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sl,lastRenderedState:e},t}function Gc(e,t,l,i){return e.baseState=l,io(e,Ge,typeof i=="function"?i:Sl)}function qg(e,t,l,i,s){if(ds(e))throw Error(r(485));if(e=t.action,e!==null){var o={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){o.listeners.push(f)}};C.T!==null?l(!0):o.isTransition=!1,i(o),l=t.pending,l===null?(o.next=t.pending=o,Yc(t,o)):(o.next=l.next,t.pending=l.next=o)}}function Yc(e,t){var l=t.action,i=t.payload,s=e.state;if(t.isTransition){var o=C.T,f={};C.T=f;try{var p=l(s,i),S=C.S;S!==null&&S(f,p),Xc(e,t,p)}catch(M){so(e,t,M)}finally{o!==null&&f.types!==null&&(o.types=f.types),C.T=o}}else try{o=l(s,i),Xc(e,t,o)}catch(M){so(e,t,M)}}function Xc(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(i){Vc(e,t,i)},function(i){return so(e,t,i)}):Vc(e,t,l)}function Vc(e,t,l){t.status="fulfilled",t.value=l,Qc(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Yc(e,l)))}function so(e,t,l){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=l,Qc(t),t=t.next;while(t!==i)}e.action=null}function Qc(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zc(e,t){return t}function Kc(e,t){if(De){var l=Ve.formState;if(l!==null){e:{var i=Ce;if(De){if(We){t:{for(var s=We,o=Jt;s.nodeType!==8;){if(!o){s=null;break t}if(s=$t(s.nextSibling),s===null){s=null;break t}}o=s.data,s=o==="F!"||o==="F"?s:null}if(s){We=$t(s.nextSibling),i=s.data==="F!";break e}}Vl(i)}i=!1}i&&(t=l[0])}}return l=_t(),l.memoizedState=l.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zc,lastRenderedState:t},l.queue=i,l=hf.bind(null,Ce,i),i.dispatch=l,i=ao(!1),o=ho.bind(null,Ce,!1,i.queue),i=_t(),s={state:t,dispatch:null,action:e,pending:null},i.queue=s,l=qg.bind(null,Ce,s,o,l),s.dispatch=l,i.memoizedState=e,[t,l,!1]}function Jc(e){var t=st();return Wc(t,Ge,e)}function Wc(e,t,l){if(t=io(e,t,Zc)[0],e=us(Sl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Fn(t)}catch(f){throw f===ln?Pa:f}else i=t;t=st();var s=t.queue,o=s.dispatch;return l!==t.memoizedState&&(Ce.flags|=2048,on(9,{destroy:void 0},Gg.bind(null,s,l),null)),[i,o,e]}function Gg(e,t){e.action=t}function $c(e){var t=st(),l=Ge;if(l!==null)return Wc(t,l,e);st(),t=t.memoizedState,l=st();var i=l.queue.dispatch;return l.memoizedState=e,[t,i,!1]}function on(e,t,l,i){return e={tag:e,create:l,deps:i,inst:t,next:null},t=Ce.updateQueue,t===null&&(t=rs(),Ce.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(i=l.next,l.next=e,e.next=i,t.lastEffect=e),e}function Fc(){return st().memoizedState}function cs(e,t,l,i){var s=_t();Ce.flags|=e,s.memoizedState=on(1|t,{destroy:void 0},l,i===void 0?null:i)}function fs(e,t,l,i){var s=st();i=i===void 0?null:i;var o=s.memoizedState.inst;Ge!==null&&i!==null&&Fr(i,Ge.memoizedState.deps)?s.memoizedState=on(t,o,l,i):(Ce.flags|=e,s.memoizedState=on(1|t,o,l,i))}function Ic(e,t){cs(8390656,8,e,t)}function ro(e,t){fs(2048,8,e,t)}function Yg(e){Ce.flags|=4;var t=Ce.updateQueue;if(t===null)t=rs(),Ce.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Pc(e){var t=st().memoizedState;return Yg({ref:t,nextImpl:e}),function(){if((Le&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function ef(e,t){return fs(4,2,e,t)}function tf(e,t){return fs(4,4,e,t)}function lf(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function nf(e,t,l){l=l!=null?l.concat([e]):null,fs(4,4,lf.bind(null,t,e),l)}function oo(){}function af(e,t){var l=st();t=t===void 0?null:t;var i=l.memoizedState;return t!==null&&Fr(t,i[1])?i[0]:(l.memoizedState=[e,t],e)}function sf(e,t){var l=st();t=t===void 0?null:t;var i=l.memoizedState;if(t!==null&&Fr(t,i[1]))return i[0];if(i=e(),ji){Ze(!0);try{e()}finally{Ze(!1)}}return l.memoizedState=[i,t],i}function uo(e,t,l){return l===void 0||(bl&1073741824)!==0&&(Me&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=rd(),Ce.lanes|=e,Pl|=e,l)}function rf(e,t,l,i){return Ot(l,t)?l:an.current!==null?(e=uo(e,l,i),Ot(e,t)||(ut=!0),e):(bl&42)===0||(bl&1073741824)!==0&&(Me&261930)===0?(ut=!0,e.memoizedState=l):(e=rd(),Ce.lanes|=e,Pl|=e,t)}function of(e,t,l,i,s){var o=X.p;X.p=o!==0&&8>o?o:8;var f=C.T,p={};C.T=p,ho(e,!1,t,l);try{var S=s(),M=C.S;if(M!==null&&M(p,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var k=Lg(S,i);In(e,t,k,Bt(e))}else In(e,t,i,Bt(e))}catch(Y){In(e,t,{then:function(){},status:"rejected",reason:Y},Bt())}finally{X.p=o,f!==null&&p.types!==null&&(f.types=p.types),C.T=f}}function Xg(){}function co(e,t,l,i){if(e.tag!==5)throw Error(r(476));var s=uf(e).queue;of(e,s,t,L,l===null?Xg:function(){return cf(e),l(i)})}function uf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sl,lastRenderedState:L},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sl,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function cf(e){var t=uf(e);t.next===null&&(t=e.alternate.memoizedState),In(e,t.next.queue,{},Bt())}function fo(){return pt(ma)}function ff(){return st().memoizedState}function df(){return st().memoizedState}function Vg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Bt();e=Kl(l);var i=Jl(t,e,l);i!==null&&(At(i,t,l),Kn(i,t,l)),t={cache:qr()},e.payload=t;return}t=t.return}}function Qg(e,t,l){var i=Bt();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ds(e)?gf(t,l):(l=jr(e,t,l,i),l!==null&&(At(l,e,i),mf(l,t,i)))}function hf(e,t,l){var i=Bt();In(e,t,l,i)}function In(e,t,l,i){var s={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ds(e))gf(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var f=t.lastRenderedState,p=o(f,l);if(s.hasEagerState=!0,s.eagerState=p,Ot(p,f))return Za(e,t,s,0),Ve===null&&Qa(),!1}catch{}finally{}if(l=jr(e,t,s,i),l!==null)return At(l,e,i),mf(l,t,i),!0}return!1}function ho(e,t,l,i){if(i={lane:2,revertLane:Qo(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},ds(e)){if(t)throw Error(r(479))}else t=jr(e,l,i,2),t!==null&&At(t,e,2)}function ds(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function gf(e,t){sn=as=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function mf(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,Aa(e,l)}}var Pn={readContext:pt,use:os,useCallback:lt,useContext:lt,useEffect:lt,useImperativeHandle:lt,useLayoutEffect:lt,useInsertionEffect:lt,useMemo:lt,useReducer:lt,useRef:lt,useState:lt,useDebugValue:lt,useDeferredValue:lt,useTransition:lt,useSyncExternalStore:lt,useId:lt,useHostTransitionStatus:lt,useFormState:lt,useActionState:lt,useOptimistic:lt,useMemoCache:lt,useCacheRefresh:lt};Pn.useEffectEvent=lt;var pf={readContext:pt,use:os,useCallback:function(e,t){return _t().memoizedState=[e,t===void 0?null:t],e},useContext:pt,useEffect:Ic,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,cs(4194308,4,lf.bind(null,t,e),l)},useLayoutEffect:function(e,t){return cs(4194308,4,e,t)},useInsertionEffect:function(e,t){cs(4,2,e,t)},useMemo:function(e,t){var l=_t();t=t===void 0?null:t;var i=e();if(ji){Ze(!0);try{e()}finally{Ze(!1)}}return l.memoizedState=[i,t],i},useReducer:function(e,t,l){var i=_t();if(l!==void 0){var s=l(t);if(ji){Ze(!0);try{l(t)}finally{Ze(!1)}}}else s=t;return i.memoizedState=i.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},i.queue=e,e=e.dispatch=Qg.bind(null,Ce,e),[i.memoizedState,e]},useRef:function(e){var t=_t();return e={current:e},t.memoizedState=e},useState:function(e){e=ao(e);var t=e.queue,l=hf.bind(null,Ce,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:oo,useDeferredValue:function(e,t){var l=_t();return uo(l,e,t)},useTransition:function(){var e=ao(!1);return e=of.bind(null,Ce,e.queue,!0,!1),_t().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var i=Ce,s=_t();if(De){if(l===void 0)throw Error(r(407));l=l()}else{if(l=t(),Ve===null)throw Error(r(349));(Me&127)!==0||kc(i,t,l)}s.memoizedState=l;var o={value:l,getSnapshot:t};return s.queue=o,Ic(Uc.bind(null,i,o,e),[e]),i.flags|=2048,on(9,{destroy:void 0},Lc.bind(null,i,o,l,t),null),l},useId:function(){var e=_t(),t=Ve.identifierPrefix;if(De){var l=sl,i=al;l=(i&~(1<<32-tt(i)-1)).toString(32)+l,t="_"+t+"R_"+l,l=ss++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=Ug++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:fo,useFormState:Kc,useActionState:Kc,useOptimistic:function(e){var t=_t();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=ho.bind(null,Ce,!0,l),l.dispatch=t,[e,t]},useMemoCache:lo,useCacheRefresh:function(){return _t().memoizedState=Vg.bind(null,Ce)},useEffectEvent:function(e){var t=_t(),l={impl:e};return t.memoizedState=l,function(){if((Le&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},go={readContext:pt,use:os,useCallback:af,useContext:pt,useEffect:ro,useImperativeHandle:nf,useInsertionEffect:ef,useLayoutEffect:tf,useMemo:sf,useReducer:us,useRef:Fc,useState:function(){return us(Sl)},useDebugValue:oo,useDeferredValue:function(e,t){var l=st();return rf(l,Ge.memoizedState,e,t)},useTransition:function(){var e=us(Sl)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Fn(e),t]},useSyncExternalStore:Hc,useId:ff,useHostTransitionStatus:fo,useFormState:Jc,useActionState:Jc,useOptimistic:function(e,t){var l=st();return Gc(l,Ge,e,t)},useMemoCache:lo,useCacheRefresh:df};go.useEffectEvent=Pc;var yf={readContext:pt,use:os,useCallback:af,useContext:pt,useEffect:ro,useImperativeHandle:nf,useInsertionEffect:ef,useLayoutEffect:tf,useMemo:sf,useReducer:no,useRef:Fc,useState:function(){return no(Sl)},useDebugValue:oo,useDeferredValue:function(e,t){var l=st();return Ge===null?uo(l,e,t):rf(l,Ge.memoizedState,e,t)},useTransition:function(){var e=no(Sl)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Fn(e),t]},useSyncExternalStore:Hc,useId:ff,useHostTransitionStatus:fo,useFormState:$c,useActionState:$c,useOptimistic:function(e,t){var l=st();return Ge!==null?Gc(l,Ge,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:lo,useCacheRefresh:df};yf.useEffectEvent=Pc;function mo(e,t,l,i){t=e.memoizedState,l=l(i,t),l=l==null?t:v({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var po={enqueueSetState:function(e,t,l){e=e._reactInternals;var i=Bt(),s=Kl(i);s.payload=t,l!=null&&(s.callback=l),t=Jl(e,s,i),t!==null&&(At(t,e,i),Kn(t,e,i))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var i=Bt(),s=Kl(i);s.tag=1,s.payload=t,l!=null&&(s.callback=l),t=Jl(e,s,i),t!==null&&(At(t,e,i),Kn(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Bt(),i=Kl(l);i.tag=2,t!=null&&(i.callback=t),t=Jl(e,i,l),t!==null&&(At(t,e,l),Kn(t,e,l))}};function vf(e,t,l,i,s,o,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,o,f):t.prototype&&t.prototype.isPureReactComponent?!Bn(l,i)||!Bn(s,o):!0}function xf(e,t,l,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,i),t.state!==e&&po.enqueueReplaceState(t,t.state,null)}function Mi(e,t){var l=t;if("ref"in t){l={};for(var i in t)i!=="ref"&&(l[i]=t[i])}if(e=e.defaultProps){l===t&&(l=v({},l));for(var s in e)l[s]===void 0&&(l[s]=e[s])}return l}function bf(e){Va(e)}function Sf(e){console.error(e)}function Ef(e){Va(e)}function hs(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function _f(e,t,l){try{var i=e.onCaughtError;i(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function yo(e,t,l){return l=Kl(l),l.tag=3,l.payload={element:null},l.callback=function(){hs(e,t)},l}function zf(e){return e=Kl(e),e.tag=3,e}function Cf(e,t,l,i){var s=l.type.getDerivedStateFromError;if(typeof s=="function"){var o=i.value;e.payload=function(){return s(o)},e.callback=function(){_f(t,l,i)}}var f=l.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){_f(t,l,i),typeof s!="function"&&(ei===null?ei=new Set([this]):ei.add(this));var p=i.stack;this.componentDidCatch(i.value,{componentStack:p!==null?p:""})})}function Zg(e,t,l,i,s){if(l.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=l.alternate,t!==null&&Pi(t,l,s,!0),l=Ht.current,l!==null){switch(l.tag){case 31:case 13:return Wt===null?Cs():l.alternate===null&&it===0&&(it=3),l.flags&=-257,l.flags|=65536,l.lanes=s,i===es?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([i]):t.add(i),Yo(e,i,s)),!1;case 22:return l.flags|=65536,i===es?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([i]):l.add(i)),Yo(e,i,s)),!1}throw Error(r(435,l.tag))}return Yo(e,i,s),Cs(),!1}if(De)return t=Ht.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,i!==Hr&&(e=Error(r(422),{cause:i}),Yn(Qt(e,l)))):(i!==Hr&&(t=Error(r(423),{cause:i}),Yn(Qt(t,l))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,i=Qt(i,l),s=yo(e.stateNode,i,s),Zr(e,s),it!==4&&(it=2)),!1;var o=Error(r(520),{cause:i});if(o=Qt(o,l),ra===null?ra=[o]:ra.push(o),it!==4&&(it=2),t===null)return!0;i=Qt(i,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=s&-s,l.lanes|=e,e=yo(l.stateNode,i,e),Zr(l,e),!1;case 1:if(t=l.type,o=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(ei===null||!ei.has(o))))return l.flags|=65536,s&=-s,l.lanes|=s,s=zf(s),Cf(s,e,l,i),Zr(l,s),!1}l=l.return}while(l!==null);return!1}var vo=Error(r(461)),ut=!1;function yt(e,t,l,i){t.child=e===null?wc(t,null,l,i):wi(t,e.child,l,i)}function Tf(e,t,l,i,s){l=l.render;var o=t.ref;if("ref"in i){var f={};for(var p in i)p!=="ref"&&(f[p]=i[p])}else f=i;return zi(t),i=Ir(e,t,l,f,o,s),p=Pr(),e!==null&&!ut?(eo(e,t,s),El(e,t,s)):(De&&p&&Or(t),t.flags|=1,yt(e,t,i,s),t.child)}function Rf(e,t,l,i,s){if(e===null){var o=l.type;return typeof o=="function"&&!Mr(o)&&o.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=o,wf(e,t,o,i,s)):(e=Ja(l.type,null,i,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!To(e,s)){var f=o.memoizedProps;if(l=l.compare,l=l!==null?l:Bn,l(f,i)&&e.ref===t.ref)return El(e,t,s)}return t.flags|=1,e=pl(o,i),e.ref=t.ref,e.return=t,t.child=e}function wf(e,t,l,i,s){if(e!==null){var o=e.memoizedProps;if(Bn(o,i)&&e.ref===t.ref)if(ut=!1,t.pendingProps=i=o,To(e,s))(e.flags&131072)!==0&&(ut=!0);else return t.lanes=e.lanes,El(e,t,s)}return xo(e,t,l,i,s)}function jf(e,t,l,i){var s=i.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|l:l,e!==null){for(i=t.child=e.child,s=0;i!==null;)s=s|i.lanes|i.childLanes,i=i.sibling;i=s&~o}else i=0,t.child=null;return Mf(e,t,o,l,i)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ia(t,o!==null?o.cachePool:null),o!==null?Ac(t,o):Jr(),Dc(t);else return i=t.lanes=536870912,Mf(e,t,o!==null?o.baseLanes|l:l,l,i)}else o!==null?(Ia(t,o.cachePool),Ac(t,o),$l(),t.memoizedState=null):(e!==null&&Ia(t,null),Jr(),$l());return yt(e,t,s,l),t.child}function ea(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Mf(e,t,l,i,s){var o=Yr();return o=o===null?null:{parent:rt._currentValue,pool:o},t.memoizedState={baseLanes:l,cachePool:o},e!==null&&Ia(t,null),Jr(),Dc(t),e!==null&&Pi(e,t,i,!0),t.childLanes=s,null}function gs(e,t){return t=ps({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Af(e,t,l){return wi(t,e.child,null,l),e=gs(t,t.pendingProps),e.flags|=2,kt(t),t.memoizedState=null,e}function Kg(e,t,l){var i=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(De){if(i.mode==="hidden")return e=gs(t,i),t.lanes=536870912,ea(null,e);if($r(t),(e=We)?(e=Xd(e,Jt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yl!==null?{id:al,overflow:sl}:null,retryLane:536870912,hydrationErrors:null},l=hc(e),l.return=t,t.child=l,mt=t,We=null)):e=null,e===null)throw Vl(t);return t.lanes=536870912,null}return gs(t,i)}var o=e.memoizedState;if(o!==null){var f=o.dehydrated;if($r(t),s)if(t.flags&256)t.flags&=-257,t=Af(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if(ut||Pi(e,t,l,!1),s=(l&e.childLanes)!==0,ut||s){if(i=Ve,i!==null&&(f=Da(i,l),f!==0&&f!==o.retryLane))throw o.retryLane=f,bi(e,f),At(i,e,f),vo;Cs(),t=Af(e,t,l)}else e=o.treeContext,We=$t(f.nextSibling),mt=t,De=!0,Xl=null,Jt=!1,e!==null&&pc(t,e),t=gs(t,i),t.flags|=4096;return t}return e=pl(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ms(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function xo(e,t,l,i,s){return zi(t),l=Ir(e,t,l,i,void 0,s),i=Pr(),e!==null&&!ut?(eo(e,t,s),El(e,t,s)):(De&&i&&Or(t),t.flags|=1,yt(e,t,l,s),t.child)}function Df(e,t,l,i,s,o){return zi(t),t.updateQueue=null,l=Nc(t,i,l,s),Oc(e),i=Pr(),e!==null&&!ut?(eo(e,t,o),El(e,t,o)):(De&&i&&Or(t),t.flags|=1,yt(e,t,l,o),t.child)}function Of(e,t,l,i,s){if(zi(t),t.stateNode===null){var o=Wi,f=l.contextType;typeof f=="object"&&f!==null&&(o=pt(f)),o=new l(i,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=po,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=i,o.state=t.memoizedState,o.refs={},Vr(t),f=l.contextType,o.context=typeof f=="object"&&f!==null?pt(f):Wi,o.state=t.memoizedState,f=l.getDerivedStateFromProps,typeof f=="function"&&(mo(t,l,f,i),o.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(f=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),f!==o.state&&po.enqueueReplaceState(o,o.state,null),Wn(t,i,o,s),Jn(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){o=t.stateNode;var p=t.memoizedProps,S=Mi(l,p);o.props=S;var M=o.context,k=l.contextType;f=Wi,typeof k=="object"&&k!==null&&(f=pt(k));var Y=l.getDerivedStateFromProps;k=typeof Y=="function"||typeof o.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,k||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(p||M!==f)&&xf(t,o,i,f),Zl=!1;var A=t.memoizedState;o.state=A,Wn(t,i,o,s),Jn(),M=t.memoizedState,p||A!==M||Zl?(typeof Y=="function"&&(mo(t,l,Y,i),M=t.memoizedState),(S=Zl||vf(t,l,S,i,A,M,f))?(k||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=M),o.props=i,o.state=M,o.context=f,i=S):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{o=t.stateNode,Qr(e,t),f=t.memoizedProps,k=Mi(l,f),o.props=k,Y=t.pendingProps,A=o.context,M=l.contextType,S=Wi,typeof M=="object"&&M!==null&&(S=pt(M)),p=l.getDerivedStateFromProps,(M=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(f!==Y||A!==S)&&xf(t,o,i,S),Zl=!1,A=t.memoizedState,o.state=A,Wn(t,i,o,s),Jn();var N=t.memoizedState;f!==Y||A!==N||Zl||e!==null&&e.dependencies!==null&&$a(e.dependencies)?(typeof p=="function"&&(mo(t,l,p,i),N=t.memoizedState),(k=Zl||vf(t,l,k,i,A,N,S)||e!==null&&e.dependencies!==null&&$a(e.dependencies))?(M||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,N,S),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,N,S)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||f===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=N),o.props=i,o.state=N,o.context=S,i=k):(typeof o.componentDidUpdate!="function"||f===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),i=!1)}return o=i,ms(e,t),i=(t.flags&128)!==0,o||i?(o=t.stateNode,l=i&&typeof l.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&i?(t.child=wi(t,e.child,null,s),t.child=wi(t,null,l,s)):yt(e,t,l,s),t.memoizedState=o.state,e=t.child):e=El(e,t,s),e}function Nf(e,t,l,i){return Ei(),t.flags|=256,yt(e,t,l,i),t.child}var bo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function So(e){return{baseLanes:e,cachePool:Ec()}}function Eo(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Ut),e}function Hf(e,t,l){var i=t.pendingProps,s=!1,o=(t.flags&128)!==0,f;if((f=o)||(f=e!==null&&e.memoizedState===null?!1:(at.current&2)!==0),f&&(s=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(De){if(s?Wl(t):$l(),(e=We)?(e=Xd(e,Jt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yl!==null?{id:al,overflow:sl}:null,retryLane:536870912,hydrationErrors:null},l=hc(e),l.return=t,t.child=l,mt=t,We=null)):e=null,e===null)throw Vl(t);return nu(e)?t.lanes=32:t.lanes=536870912,null}var p=i.children;return i=i.fallback,s?($l(),s=t.mode,p=ps({mode:"hidden",children:p},s),i=Si(i,s,l,null),p.return=t,i.return=t,p.sibling=i,t.child=p,i=t.child,i.memoizedState=So(l),i.childLanes=Eo(e,f,l),t.memoizedState=bo,ea(null,i)):(Wl(t),_o(t,p))}var S=e.memoizedState;if(S!==null&&(p=S.dehydrated,p!==null)){if(o)t.flags&256?(Wl(t),t.flags&=-257,t=zo(e,t,l)):t.memoizedState!==null?($l(),t.child=e.child,t.flags|=128,t=null):($l(),p=i.fallback,s=t.mode,i=ps({mode:"visible",children:i.children},s),p=Si(p,s,l,null),p.flags|=2,i.return=t,p.return=t,i.sibling=p,t.child=i,wi(t,e.child,null,l),i=t.child,i.memoizedState=So(l),i.childLanes=Eo(e,f,l),t.memoizedState=bo,t=ea(null,i));else if(Wl(t),nu(p)){if(f=p.nextSibling&&p.nextSibling.dataset,f)var M=f.dgst;f=M,i=Error(r(419)),i.stack="",i.digest=f,Yn({value:i,source:null,stack:null}),t=zo(e,t,l)}else if(ut||Pi(e,t,l,!1),f=(l&e.childLanes)!==0,ut||f){if(f=Ve,f!==null&&(i=Da(f,l),i!==0&&i!==S.retryLane))throw S.retryLane=i,bi(e,i),At(f,e,i),vo;iu(p)||Cs(),t=zo(e,t,l)}else iu(p)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,We=$t(p.nextSibling),mt=t,De=!0,Xl=null,Jt=!1,e!==null&&pc(t,e),t=_o(t,i.children),t.flags|=4096);return t}return s?($l(),p=i.fallback,s=t.mode,S=e.child,M=S.sibling,i=pl(S,{mode:"hidden",children:i.children}),i.subtreeFlags=S.subtreeFlags&65011712,M!==null?p=pl(M,p):(p=Si(p,s,l,null),p.flags|=2),p.return=t,i.return=t,i.sibling=p,t.child=i,ea(null,i),i=t.child,p=e.child.memoizedState,p===null?p=So(l):(s=p.cachePool,s!==null?(S=rt._currentValue,s=s.parent!==S?{parent:S,pool:S}:s):s=Ec(),p={baseLanes:p.baseLanes|l,cachePool:s}),i.memoizedState=p,i.childLanes=Eo(e,f,l),t.memoizedState=bo,ea(e.child,i)):(Wl(t),l=e.child,e=l.sibling,l=pl(l,{mode:"visible",children:i.children}),l.return=t,l.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=l,t.memoizedState=null,l)}function _o(e,t){return t=ps({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ps(e,t){return e=Nt(22,e,null,t),e.lanes=0,e}function zo(e,t,l){return wi(t,e.child,null,l),e=_o(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kf(e,t,l){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Ur(e.return,t,l)}function Co(e,t,l,i,s,o){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:l,tailMode:s,treeForkCount:o}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=i,f.tail=l,f.tailMode=s,f.treeForkCount=o)}function Lf(e,t,l){var i=t.pendingProps,s=i.revealOrder,o=i.tail;i=i.children;var f=at.current,p=(f&2)!==0;if(p?(f=f&1|2,t.flags|=128):f&=1,w(at,f),yt(e,t,i,l),i=De?Gn:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kf(e,l,t);else if(e.tag===19)kf(e,l,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(s){case"forwards":for(l=t.child,s=null;l!==null;)e=l.alternate,e!==null&&ns(e)===null&&(s=l),l=l.sibling;l=s,l===null?(s=t.child,t.child=null):(s=l.sibling,l.sibling=null),Co(t,!1,s,l,o,i);break;case"backwards":case"unstable_legacy-backwards":for(l=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&ns(e)===null){t.child=s;break}e=s.sibling,s.sibling=l,l=s,s=e}Co(t,!0,l,null,o,i);break;case"together":Co(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function El(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Pl|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Pi(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,l=pl(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=pl(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function To(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&$a(e)))}function Jg(e,t,l){switch(t.tag){case 3:Te(t,t.stateNode.containerInfo),Ql(t,rt,e.memoizedState.cache),Ei();break;case 27:case 5:Pe(t);break;case 4:Te(t,t.stateNode.containerInfo);break;case 10:Ql(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,$r(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Wl(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Hf(e,t,l):(Wl(t),e=El(e,t,l),e!==null?e.sibling:null);Wl(t);break;case 19:var s=(e.flags&128)!==0;if(i=(l&t.childLanes)!==0,i||(Pi(e,t,l,!1),i=(l&t.childLanes)!==0),s){if(i)return Lf(e,t,l);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),w(at,at.current),i)break;return null;case 22:return t.lanes=0,jf(e,t,l,t.pendingProps);case 24:Ql(t,rt,e.memoizedState.cache)}return El(e,t,l)}function Uf(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)ut=!0;else{if(!To(e,l)&&(t.flags&128)===0)return ut=!1,Jg(e,t,l);ut=(e.flags&131072)!==0}else ut=!1,De&&(t.flags&1048576)!==0&&mc(t,Gn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Ti(t.elementType),t.type=e,typeof e=="function")Mr(e)?(i=Mi(e,i),t.tag=1,t=Of(null,t,e,i,l)):(t.tag=0,t=xo(null,t,e,i,l));else{if(e!=null){var s=e.$$typeof;if(s===re){t.tag=11,t=Tf(null,t,e,i,l);break e}else if(s===G){t.tag=14,t=Rf(null,t,e,i,l);break e}}throw t=te(e)||e,Error(r(306,t,""))}}return t;case 0:return xo(e,t,t.type,t.pendingProps,l);case 1:return i=t.type,s=Mi(i,t.pendingProps),Of(e,t,i,s,l);case 3:e:{if(Te(t,t.stateNode.containerInfo),e===null)throw Error(r(387));i=t.pendingProps;var o=t.memoizedState;s=o.element,Qr(e,t),Wn(t,i,null,l);var f=t.memoizedState;if(i=f.cache,Ql(t,rt,i),i!==o.cache&&Br(t,[rt],l,!0),Jn(),i=f.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Nf(e,t,i,l);break e}else if(i!==s){s=Qt(Error(r(424)),t),Yn(s),t=Nf(e,t,i,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(We=$t(e.firstChild),mt=t,De=!0,Xl=null,Jt=!0,l=wc(t,null,i,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Ei(),i===s){t=El(e,t,l);break e}yt(e,t,i,l)}t=t.child}return t;case 26:return ms(e,t),e===null?(l=Wd(t.type,null,t.pendingProps,null))?t.memoizedState=l:De||(l=t.type,e=t.pendingProps,i=Ds(ae.current).createElement(l),i[dt]=t,i[St]=e,vt(i,l,e),et(i),t.stateNode=i):t.memoizedState=Wd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Pe(t),e===null&&De&&(i=t.stateNode=Zd(t.type,t.pendingProps,ae.current),mt=t,Jt=!0,s=We,ni(t.type)?(au=s,We=$t(i.firstChild)):We=s),yt(e,t,t.pendingProps.children,l),ms(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&De&&((s=i=We)&&(i=zm(i,t.type,t.pendingProps,Jt),i!==null?(t.stateNode=i,mt=t,We=$t(i.firstChild),Jt=!1,s=!0):s=!1),s||Vl(t)),Pe(t),s=t.type,o=t.pendingProps,f=e!==null?e.memoizedProps:null,i=o.children,eu(s,o)?i=null:f!==null&&eu(s,f)&&(t.flags|=32),t.memoizedState!==null&&(s=Ir(e,t,Bg,null,null,l),ma._currentValue=s),ms(e,t),yt(e,t,i,l),t.child;case 6:return e===null&&De&&((e=l=We)&&(l=Cm(l,t.pendingProps,Jt),l!==null?(t.stateNode=l,mt=t,We=null,e=!0):e=!1),e||Vl(t)),null;case 13:return Hf(e,t,l);case 4:return Te(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=wi(t,null,i,l):yt(e,t,i,l),t.child;case 11:return Tf(e,t,t.type,t.pendingProps,l);case 7:return yt(e,t,t.pendingProps,l),t.child;case 8:return yt(e,t,t.pendingProps.children,l),t.child;case 12:return yt(e,t,t.pendingProps.children,l),t.child;case 10:return i=t.pendingProps,Ql(t,t.type,i.value),yt(e,t,i.children,l),t.child;case 9:return s=t.type._context,i=t.pendingProps.children,zi(t),s=pt(s),i=i(s),t.flags|=1,yt(e,t,i,l),t.child;case 14:return Rf(e,t,t.type,t.pendingProps,l);case 15:return wf(e,t,t.type,t.pendingProps,l);case 19:return Lf(e,t,l);case 31:return Kg(e,t,l);case 22:return jf(e,t,l,t.pendingProps);case 24:return zi(t),i=pt(rt),e===null?(s=Yr(),s===null&&(s=Ve,o=qr(),s.pooledCache=o,o.refCount++,o!==null&&(s.pooledCacheLanes|=l),s=o),t.memoizedState={parent:i,cache:s},Vr(t),Ql(t,rt,s)):((e.lanes&l)!==0&&(Qr(e,t),Wn(t,null,null,l),Jn()),s=e.memoizedState,o=t.memoizedState,s.parent!==i?(s={parent:i,cache:i},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Ql(t,rt,i)):(i=o.cache,Ql(t,rt,i),i!==s.cache&&Br(t,[rt],l,!0))),yt(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function _l(e){e.flags|=4}function Ro(e,t,l,i,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(fd())e.flags|=8192;else throw Ri=es,Xr}else e.flags&=-16777217}function Bf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!eh(t))if(fd())e.flags|=8192;else throw Ri=es,Xr}function ys(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ja():536870912,e.lanes|=t,dn|=t)}function ta(e,t){if(!De)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var i=null;l!==null;)l.alternate!==null&&(i=l),l=l.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function $e(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,i=0;if(t)for(var s=e.child;s!==null;)l|=s.lanes|s.childLanes,i|=s.subtreeFlags&65011712,i|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)l|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=i,e.childLanes=l,t}function Wg(e,t,l){var i=t.pendingProps;switch(Nr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $e(t),null;case 1:return $e(t),null;case 3:return l=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),xl(rt),ze(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ii(t)?_l(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,kr())),$e(t),null;case 26:var s=t.type,o=t.memoizedState;return e===null?(_l(t),o!==null?($e(t),Bf(t,o)):($e(t),Ro(t,s,null,i,l))):o?o!==e.memoizedState?(_l(t),$e(t),Bf(t,o)):($e(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&_l(t),$e(t),Ro(t,s,e,i,l)),null;case 27:if(Ct(t),l=ae.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&_l(t);else{if(!i){if(t.stateNode===null)throw Error(r(166));return $e(t),null}e=V.current,Ii(t)?yc(t):(e=Zd(s,i,l),t.stateNode=e,_l(t))}return $e(t),null;case 5:if(Ct(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&_l(t);else{if(!i){if(t.stateNode===null)throw Error(r(166));return $e(t),null}if(o=V.current,Ii(t))yc(t);else{var f=Ds(ae.current);switch(o){case 1:o=f.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:o=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":o=f.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":o=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":o=f.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof i.is=="string"?f.createElement("select",{is:i.is}):f.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o=typeof i.is=="string"?f.createElement(s,{is:i.is}):f.createElement(s)}}o[dt]=t,o[St]=i;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)o.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=o;e:switch(vt(o,s,i),s){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&_l(t)}}return $e(t),Ro(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&_l(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(r(166));if(e=ae.current,Ii(t)){if(e=t.stateNode,l=t.memoizedProps,i=null,s=mt,s!==null)switch(s.tag){case 27:case 5:i=s.memoizedProps}e[dt]=t,e=!!(e.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||Hd(e.nodeValue,l)),e||Vl(t,!0)}else e=Ds(e).createTextNode(i),e[dt]=t,t.stateNode=e}return $e(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(i=Ii(t),l!==null){if(e===null){if(!i)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[dt]=t}else Ei(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),e=!1}else l=kr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(kt(t),t):(kt(t),null);if((t.flags&128)!==0)throw Error(r(558))}return $e(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Ii(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));s[dt]=t}else Ei(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),s=!1}else s=kr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(kt(t),t):(kt(t),null)}return kt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=i!==null,e=e!==null&&e.memoizedState!==null,l&&(i=t.child,s=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(s=i.alternate.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==s&&(i.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),ys(t,t.updateQueue),$e(t),null);case 4:return ze(),e===null&&Wo(t.stateNode.containerInfo),$e(t),null;case 10:return xl(t.type),$e(t),null;case 19:if(U(at),i=t.memoizedState,i===null)return $e(t),null;if(s=(t.flags&128)!==0,o=i.rendering,o===null)if(s)ta(i,!1);else{if(it!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=ns(e),o!==null){for(t.flags|=128,ta(i,!1),e=o.updateQueue,t.updateQueue=e,ys(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)dc(l,e),l=l.sibling;return w(at,at.current&1|2),De&&yl(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&xt()>Es&&(t.flags|=128,s=!0,ta(i,!1),t.lanes=4194304)}else{if(!s)if(e=ns(o),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,ys(t,e),ta(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!De)return $e(t),null}else 2*xt()-i.renderingStartTime>Es&&l!==536870912&&(t.flags|=128,s=!0,ta(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(e=i.last,e!==null?e.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=xt(),e.sibling=null,l=at.current,w(at,s?l&1|2:l&1),De&&yl(t,i.treeForkCount),e):($e(t),null);case 22:case 23:return kt(t),Wr(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(l&536870912)!==0&&(t.flags&128)===0&&($e(t),t.subtreeFlags&6&&(t.flags|=8192)):$e(t),l=t.updateQueue,l!==null&&ys(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==l&&(t.flags|=2048),e!==null&&U(Ci),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),xl(rt),$e(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function $g(e,t){switch(Nr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xl(rt),ze(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ct(t),null;case 31:if(t.memoizedState!==null){if(kt(t),t.alternate===null)throw Error(r(340));Ei()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(kt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ei()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(at),null;case 4:return ze(),null;case 10:return xl(t.type),null;case 22:case 23:return kt(t),Wr(),e!==null&&U(Ci),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return xl(rt),null;case 25:return null;default:return null}}function qf(e,t){switch(Nr(t),t.tag){case 3:xl(rt),ze();break;case 26:case 27:case 5:Ct(t);break;case 4:ze();break;case 31:t.memoizedState!==null&&kt(t);break;case 13:kt(t);break;case 19:U(at);break;case 10:xl(t.type);break;case 22:case 23:kt(t),Wr(),e!==null&&U(Ci);break;case 24:xl(rt)}}function la(e,t){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var s=i.next;l=s;do{if((l.tag&e)===e){i=void 0;var o=l.create,f=l.inst;i=o(),f.destroy=i}l=l.next}while(l!==s)}}catch(p){qe(t,t.return,p)}}function Fl(e,t,l){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var o=s.next;i=o;do{if((i.tag&e)===e){var f=i.inst,p=f.destroy;if(p!==void 0){f.destroy=void 0,s=t;var S=l,M=p;try{M()}catch(k){qe(s,S,k)}}}i=i.next}while(i!==o)}}catch(k){qe(t,t.return,k)}}function Gf(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Mc(t,l)}catch(i){qe(e,e.return,i)}}}function Yf(e,t,l){l.props=Mi(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){qe(e,t,i)}}function ia(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof l=="function"?e.refCleanup=l(i):l.current=i}}catch(s){qe(e,t,s)}}function rl(e,t){var l=e.ref,i=e.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(s){qe(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(s){qe(e,t,s)}else l.current=null}function Xf(e){var t=e.type,l=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&i.focus();break e;case"img":l.src?i.src=l.src:l.srcSet&&(i.srcset=l.srcSet)}}catch(s){qe(e,e.return,s)}}function wo(e,t,l){try{var i=e.stateNode;vm(i,e.type,l,t),i[St]=t}catch(s){qe(e,e.return,s)}}function Vf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ni(e.type)||e.tag===4}function jo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ni(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Mo(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=gl));else if(i!==4&&(i===27&&ni(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Mo(e,t,l),e=e.sibling;e!==null;)Mo(e,t,l),e=e.sibling}function vs(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(i!==4&&(i===27&&ni(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(vs(e,t,l),e=e.sibling;e!==null;)vs(e,t,l),e=e.sibling}function Qf(e){var t=e.stateNode,l=e.memoizedProps;try{for(var i=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);vt(t,i,l),t[dt]=e,t[St]=l}catch(o){qe(e,e.return,o)}}var zl=!1,ct=!1,Ao=!1,Zf=typeof WeakSet=="function"?WeakSet:Set,gt=null;function Fg(e,t){if(e=e.containerInfo,Io=Bs,e=ic(e),_r(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var i=l.getSelection&&l.getSelection();if(i&&i.rangeCount!==0){l=i.anchorNode;var s=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{l.nodeType,o.nodeType}catch{l=null;break e}var f=0,p=-1,S=-1,M=0,k=0,Y=e,A=null;t:for(;;){for(var N;Y!==l||s!==0&&Y.nodeType!==3||(p=f+s),Y!==o||i!==0&&Y.nodeType!==3||(S=f+i),Y.nodeType===3&&(f+=Y.nodeValue.length),(N=Y.firstChild)!==null;)A=Y,Y=N;for(;;){if(Y===e)break t;if(A===l&&++M===s&&(p=f),A===o&&++k===i&&(S=f),(N=Y.nextSibling)!==null)break;Y=A,A=Y.parentNode}Y=N}l=p===-1||S===-1?null:{start:p,end:S}}else l=null}l=l||{start:0,end:0}}else l=null;for(Po={focusedElem:e,selectionRange:l},Bs=!1,gt=t;gt!==null;)if(t=gt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,gt=e;else for(;gt!==null;){switch(t=gt,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)s=e[l],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,l=t,s=o.memoizedProps,o=o.memoizedState,i=l.stateNode;try{var se=Mi(l.type,s);e=i.getSnapshotBeforeUpdate(se,o),i.__reactInternalSnapshotBeforeUpdate=e}catch(ge){qe(l,l.return,ge)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)lu(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":lu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(r(163))}if(e=t.sibling,e!==null){e.return=t.return,gt=e;break}gt=t.return}}function Kf(e,t,l){var i=l.flags;switch(l.tag){case 0:case 11:case 15:Tl(e,l),i&4&&la(5,l);break;case 1:if(Tl(e,l),i&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(f){qe(l,l.return,f)}else{var s=Mi(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){qe(l,l.return,f)}}i&64&&Gf(l),i&512&&ia(l,l.return);break;case 3:if(Tl(e,l),i&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Mc(e,t)}catch(f){qe(l,l.return,f)}}break;case 27:t===null&&i&4&&Qf(l);case 26:case 5:Tl(e,l),t===null&&i&4&&Xf(l),i&512&&ia(l,l.return);break;case 12:Tl(e,l);break;case 31:Tl(e,l),i&4&&$f(e,l);break;case 13:Tl(e,l),i&4&&Ff(e,l),i&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=sm.bind(null,l),Tm(e,l))));break;case 22:if(i=l.memoizedState!==null||zl,!i){t=t!==null&&t.memoizedState!==null||ct,s=zl;var o=ct;zl=i,(ct=t)&&!o?Rl(e,l,(l.subtreeFlags&8772)!==0):Tl(e,l),zl=s,ct=o}break;case 30:break;default:Tl(e,l)}}function Jf(e){var t=e.alternate;t!==null&&(e.alternate=null,Jf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&An(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ie=null,Rt=!1;function Cl(e,t,l){for(l=l.child;l!==null;)Wf(e,t,l),l=l.sibling}function Wf(e,t,l){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(Ol,l)}catch{}switch(l.tag){case 26:ct||rl(l,t),Cl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:ct||rl(l,t);var i=Ie,s=Rt;ni(l.type)&&(Ie=l.stateNode,Rt=!1),Cl(e,t,l),da(l.stateNode),Ie=i,Rt=s;break;case 5:ct||rl(l,t);case 6:if(i=Ie,s=Rt,Ie=null,Cl(e,t,l),Ie=i,Rt=s,Ie!==null)if(Rt)try{(Ie.nodeType===9?Ie.body:Ie.nodeName==="HTML"?Ie.ownerDocument.body:Ie).removeChild(l.stateNode)}catch(o){qe(l,t,o)}else try{Ie.removeChild(l.stateNode)}catch(o){qe(l,t,o)}break;case 18:Ie!==null&&(Rt?(e=Ie,Gd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),bn(e)):Gd(Ie,l.stateNode));break;case 4:i=Ie,s=Rt,Ie=l.stateNode.containerInfo,Rt=!0,Cl(e,t,l),Ie=i,Rt=s;break;case 0:case 11:case 14:case 15:Fl(2,l,t),ct||Fl(4,l,t),Cl(e,t,l);break;case 1:ct||(rl(l,t),i=l.stateNode,typeof i.componentWillUnmount=="function"&&Yf(l,t,i)),Cl(e,t,l);break;case 21:Cl(e,t,l);break;case 22:ct=(i=ct)||l.memoizedState!==null,Cl(e,t,l),ct=i;break;default:Cl(e,t,l)}}function $f(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{bn(e)}catch(l){qe(t,t.return,l)}}}function Ff(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{bn(e)}catch(l){qe(t,t.return,l)}}function Ig(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zf),t;default:throw Error(r(435,e.tag))}}function xs(e,t){var l=Ig(e);t.forEach(function(i){if(!l.has(i)){l.add(i);var s=rm.bind(null,e,i);i.then(s,s)}})}function wt(e,t){var l=t.deletions;if(l!==null)for(var i=0;i<l.length;i++){var s=l[i],o=e,f=t,p=f;e:for(;p!==null;){switch(p.tag){case 27:if(ni(p.type)){Ie=p.stateNode,Rt=!1;break e}break;case 5:Ie=p.stateNode,Rt=!1;break e;case 3:case 4:Ie=p.stateNode.containerInfo,Rt=!0;break e}p=p.return}if(Ie===null)throw Error(r(160));Wf(o,f,s),Ie=null,Rt=!1,o=s.alternate,o!==null&&(o.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)If(t,e),t=t.sibling}var ll=null;function If(e,t){var l=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:wt(t,e),jt(e),i&4&&(Fl(3,e,e.return),la(3,e),Fl(5,e,e.return));break;case 1:wt(t,e),jt(e),i&512&&(ct||l===null||rl(l,l.return)),i&64&&zl&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?i:l.concat(i))));break;case 26:var s=ll;if(wt(t,e),jt(e),i&512&&(ct||l===null||rl(l,l.return)),i&4){var o=l!==null?l.memoizedState:null;if(i=e.memoizedState,l===null)if(i===null)if(e.stateNode===null){e:{i=e.type,l=e.memoizedProps,s=s.ownerDocument||s;t:switch(i){case"title":o=s.getElementsByTagName("title")[0],(!o||o[Ll]||o[dt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=s.createElement(i),s.head.insertBefore(o,s.querySelector("head > title"))),vt(o,i,l),o[dt]=e,et(o),i=o;break e;case"link":var f=Id("link","href",s).get(i+(l.href||""));if(f){for(var p=0;p<f.length;p++)if(o=f[p],o.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&o.getAttribute("rel")===(l.rel==null?null:l.rel)&&o.getAttribute("title")===(l.title==null?null:l.title)&&o.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){f.splice(p,1);break t}}o=s.createElement(i),vt(o,i,l),s.head.appendChild(o);break;case"meta":if(f=Id("meta","content",s).get(i+(l.content||""))){for(p=0;p<f.length;p++)if(o=f[p],o.getAttribute("content")===(l.content==null?null:""+l.content)&&o.getAttribute("name")===(l.name==null?null:l.name)&&o.getAttribute("property")===(l.property==null?null:l.property)&&o.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&o.getAttribute("charset")===(l.charSet==null?null:l.charSet)){f.splice(p,1);break t}}o=s.createElement(i),vt(o,i,l),s.head.appendChild(o);break;default:throw Error(r(468,i))}o[dt]=e,et(o),i=o}e.stateNode=i}else Pd(s,e.type,e.stateNode);else e.stateNode=Fd(s,i,e.memoizedProps);else o!==i?(o===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):o.count--,i===null?Pd(s,e.type,e.stateNode):Fd(s,i,e.memoizedProps)):i===null&&e.stateNode!==null&&wo(e,e.memoizedProps,l.memoizedProps)}break;case 27:wt(t,e),jt(e),i&512&&(ct||l===null||rl(l,l.return)),l!==null&&i&4&&wo(e,e.memoizedProps,l.memoizedProps);break;case 5:if(wt(t,e),jt(e),i&512&&(ct||l===null||rl(l,l.return)),e.flags&32){s=e.stateNode;try{Yi(s,"")}catch(se){qe(e,e.return,se)}}i&4&&e.stateNode!=null&&(s=e.memoizedProps,wo(e,s,l!==null?l.memoizedProps:s)),i&1024&&(Ao=!0);break;case 6:if(wt(t,e),jt(e),i&4){if(e.stateNode===null)throw Error(r(162));i=e.memoizedProps,l=e.stateNode;try{l.nodeValue=i}catch(se){qe(e,e.return,se)}}break;case 3:if(Hs=null,s=ll,ll=Os(t.containerInfo),wt(t,e),ll=s,jt(e),i&4&&l!==null&&l.memoizedState.isDehydrated)try{bn(t.containerInfo)}catch(se){qe(e,e.return,se)}Ao&&(Ao=!1,Pf(e));break;case 4:i=ll,ll=Os(e.stateNode.containerInfo),wt(t,e),jt(e),ll=i;break;case 12:wt(t,e),jt(e);break;case 31:wt(t,e),jt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,xs(e,i)));break;case 13:wt(t,e),jt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Ss=xt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,xs(e,i)));break;case 22:s=e.memoizedState!==null;var S=l!==null&&l.memoizedState!==null,M=zl,k=ct;if(zl=M||s,ct=k||S,wt(t,e),ct=k,zl=M,jt(e),i&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(l===null||S||zl||ct||Ai(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){S=l=t;try{if(o=S.stateNode,s)f=o.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{p=S.stateNode;var Y=S.memoizedProps.style,A=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;p.style.display=A==null||typeof A=="boolean"?"":(""+A).trim()}}catch(se){qe(S,S.return,se)}}}else if(t.tag===6){if(l===null){S=t;try{S.stateNode.nodeValue=s?"":S.memoizedProps}catch(se){qe(S,S.return,se)}}}else if(t.tag===18){if(l===null){S=t;try{var N=S.stateNode;s?Yd(N,!0):Yd(S.stateNode,!1)}catch(se){qe(S,S.return,se)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(l=i.retryQueue,l!==null&&(i.retryQueue=null,xs(e,l))));break;case 19:wt(t,e),jt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,xs(e,i)));break;case 30:break;case 21:break;default:wt(t,e),jt(e)}}function jt(e){var t=e.flags;if(t&2){try{for(var l,i=e.return;i!==null;){if(Vf(i)){l=i;break}i=i.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var s=l.stateNode,o=jo(e);vs(e,o,s);break;case 5:var f=l.stateNode;l.flags&32&&(Yi(f,""),l.flags&=-33);var p=jo(e);vs(e,p,f);break;case 3:case 4:var S=l.stateNode.containerInfo,M=jo(e);Mo(e,M,S);break;default:throw Error(r(161))}}catch(k){qe(e,e.return,k)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Pf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Tl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Kf(e,t.alternate,t),t=t.sibling}function Ai(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Fl(4,t,t.return),Ai(t);break;case 1:rl(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Yf(t,t.return,l),Ai(t);break;case 27:da(t.stateNode);case 26:case 5:rl(t,t.return),Ai(t);break;case 22:t.memoizedState===null&&Ai(t);break;case 30:Ai(t);break;default:Ai(t)}e=e.sibling}}function Rl(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,s=e,o=t,f=o.flags;switch(o.tag){case 0:case 11:case 15:Rl(s,o,l),la(4,o);break;case 1:if(Rl(s,o,l),i=o,s=i.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(M){qe(i,i.return,M)}if(i=o,s=i.updateQueue,s!==null){var p=i.stateNode;try{var S=s.shared.hiddenCallbacks;if(S!==null)for(s.shared.hiddenCallbacks=null,s=0;s<S.length;s++)jc(S[s],p)}catch(M){qe(i,i.return,M)}}l&&f&64&&Gf(o),ia(o,o.return);break;case 27:Qf(o);case 26:case 5:Rl(s,o,l),l&&i===null&&f&4&&Xf(o),ia(o,o.return);break;case 12:Rl(s,o,l);break;case 31:Rl(s,o,l),l&&f&4&&$f(s,o);break;case 13:Rl(s,o,l),l&&f&4&&Ff(s,o);break;case 22:o.memoizedState===null&&Rl(s,o,l),ia(o,o.return);break;case 30:break;default:Rl(s,o,l)}t=t.sibling}}function Do(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Xn(l))}function Oo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xn(e))}function il(e,t,l,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ed(e,t,l,i),t=t.sibling}function ed(e,t,l,i){var s=t.flags;switch(t.tag){case 0:case 11:case 15:il(e,t,l,i),s&2048&&la(9,t);break;case 1:il(e,t,l,i);break;case 3:il(e,t,l,i),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xn(e)));break;case 12:if(s&2048){il(e,t,l,i),e=t.stateNode;try{var o=t.memoizedProps,f=o.id,p=o.onPostCommit;typeof p=="function"&&p(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){qe(t,t.return,S)}}else il(e,t,l,i);break;case 31:il(e,t,l,i);break;case 13:il(e,t,l,i);break;case 23:break;case 22:o=t.stateNode,f=t.alternate,t.memoizedState!==null?o._visibility&2?il(e,t,l,i):na(e,t):o._visibility&2?il(e,t,l,i):(o._visibility|=2,un(e,t,l,i,(t.subtreeFlags&10256)!==0||!1)),s&2048&&Do(f,t);break;case 24:il(e,t,l,i),s&2048&&Oo(t.alternate,t);break;default:il(e,t,l,i)}}function un(e,t,l,i,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,f=t,p=l,S=i,M=f.flags;switch(f.tag){case 0:case 11:case 15:un(o,f,p,S,s),la(8,f);break;case 23:break;case 22:var k=f.stateNode;f.memoizedState!==null?k._visibility&2?un(o,f,p,S,s):na(o,f):(k._visibility|=2,un(o,f,p,S,s)),s&&M&2048&&Do(f.alternate,f);break;case 24:un(o,f,p,S,s),s&&M&2048&&Oo(f.alternate,f);break;default:un(o,f,p,S,s)}t=t.sibling}}function na(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,i=t,s=i.flags;switch(i.tag){case 22:na(l,i),s&2048&&Do(i.alternate,i);break;case 24:na(l,i),s&2048&&Oo(i.alternate,i);break;default:na(l,i)}t=t.sibling}}var aa=8192;function cn(e,t,l){if(e.subtreeFlags&aa)for(e=e.child;e!==null;)td(e,t,l),e=e.sibling}function td(e,t,l){switch(e.tag){case 26:cn(e,t,l),e.flags&aa&&e.memoizedState!==null&&Um(l,ll,e.memoizedState,e.memoizedProps);break;case 5:cn(e,t,l);break;case 3:case 4:var i=ll;ll=Os(e.stateNode.containerInfo),cn(e,t,l),ll=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=aa,aa=16777216,cn(e,t,l),aa=i):cn(e,t,l));break;default:cn(e,t,l)}}function ld(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function sa(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var i=t[l];gt=i,nd(i,e)}ld(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)id(e),e=e.sibling}function id(e){switch(e.tag){case 0:case 11:case 15:sa(e),e.flags&2048&&Fl(9,e,e.return);break;case 3:sa(e);break;case 12:sa(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,bs(e)):sa(e);break;default:sa(e)}}function bs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var i=t[l];gt=i,nd(i,e)}ld(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Fl(8,t,t.return),bs(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,bs(t));break;default:bs(t)}e=e.sibling}}function nd(e,t){for(;gt!==null;){var l=gt;switch(l.tag){case 0:case 11:case 15:Fl(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var i=l.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Xn(l.memoizedState.cache)}if(i=l.child,i!==null)i.return=l,gt=i;else e:for(l=e;gt!==null;){i=gt;var s=i.sibling,o=i.return;if(Jf(i),i===l){gt=null;break e}if(s!==null){s.return=o,gt=s;break e}gt=o}}}var Pg={getCacheForType:function(e){var t=pt(rt),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return pt(rt).controller.signal}},em=typeof WeakMap=="function"?WeakMap:Map,Le=0,Ve=null,we=null,Me=0,Be=0,Lt=null,Il=!1,fn=!1,No=!1,wl=0,it=0,Pl=0,Di=0,Ho=0,Ut=0,dn=0,ra=null,Mt=null,ko=!1,Ss=0,ad=0,Es=1/0,_s=null,ei=null,ht=0,ti=null,hn=null,jl=0,Lo=0,Uo=null,sd=null,oa=0,Bo=null;function Bt(){return(Le&2)!==0&&Me!==0?Me&-Me:C.T!==null?Qo():Hl()}function rd(){if(Ut===0)if((Me&536870912)===0||De){var e=Ui;Ui<<=1,(Ui&3932160)===0&&(Ui=262144),Ut=e}else Ut=536870912;return e=Ht.current,e!==null&&(e.flags|=32),Ut}function At(e,t,l){(e===Ve&&(Be===2||Be===9)||e.cancelPendingCommit!==null)&&(gn(e,0),li(e,Me,Ut,!1)),mi(e,l),((Le&2)===0||e!==Ve)&&(e===Ve&&((Le&2)===0&&(Di|=l),it===4&&li(e,Me,Ut,!1)),ol(e))}function od(e,t,l){if((Le&6)!==0)throw Error(r(327));var i=!l&&(t&127)===0&&(t&e.expiredLanes)===0||hi(e,t),s=i?im(e,t):Go(e,t,!0),o=i;do{if(s===0){fn&&!i&&li(e,t,0,!1);break}else{if(l=e.current.alternate,o&&!tm(l)){s=Go(e,t,!1),o=!1;continue}if(s===2){if(o=t,e.errorRecoveryDisabledLanes&o)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var p=e;s=ra;var S=p.current.memoizedState.isDehydrated;if(S&&(gn(p,f).flags|=256),f=Go(p,f,!1),f!==2){if(No&&!S){p.errorRecoveryDisabledLanes|=o,Di|=o,s=4;break e}o=Mt,Mt=s,o!==null&&(Mt===null?Mt=o:Mt.push.apply(Mt,o))}s=f}if(o=!1,s!==2)continue}}if(s===1){gn(e,0),li(e,t,0,!0);break}e:{switch(i=e,o=s,o){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t)break;case 6:li(i,t,Ut,!Il);break e;case 2:Mt=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(s=Ss+300-xt(),10<s)){if(li(i,t,Ut,!Il),di(i,0,!0)!==0)break e;jl=t,i.timeoutHandle=Bd(ud.bind(null,i,l,Mt,_s,ko,t,Ut,Di,dn,Il,o,"Throttled",-0,0),s);break e}ud(i,l,Mt,_s,ko,t,Ut,Di,dn,Il,o,null,-0,0)}}break}while(!0);ol(e)}function ud(e,t,l,i,s,o,f,p,S,M,k,Y,A,N){if(e.timeoutHandle=-1,Y=t.subtreeFlags,Y&8192||(Y&16785408)===16785408){Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:gl},td(t,o,Y);var se=(o&62914560)===o?Ss-xt():(o&4194048)===o?ad-xt():0;if(se=Bm(Y,se),se!==null){jl=o,e.cancelPendingCommit=se(yd.bind(null,e,t,o,l,i,s,f,p,S,k,Y,null,A,N)),li(e,o,f,!M);return}}yd(e,t,o,l,i,s,f,p,S)}function tm(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var i=0;i<l.length;i++){var s=l[i],o=s.getSnapshot;s=s.value;try{if(!Ot(o(),s))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function li(e,t,l,i){t&=~Ho,t&=~Di,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var s=t;0<s;){var o=31-tt(s),f=1<<o;i[o]=-1,s&=~f}l!==0&&Ma(e,l,t)}function zs(){return(Le&6)===0?(ua(0),!1):!0}function qo(){if(we!==null){if(Be===0)var e=we.return;else e=we,vl=_i=null,to(e),nn=null,Qn=0,e=we;for(;e!==null;)qf(e.alternate,e),e=e.return;we=null}}function gn(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Sm(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),jl=0,qo(),Ve=e,we=l=pl(e.current,null),Me=t,Be=0,Lt=null,Il=!1,fn=hi(e,t),No=!1,dn=Ut=Ho=Di=Pl=it=0,Mt=ra=null,ko=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var s=31-tt(i),o=1<<s;t|=e[s],i&=~o}return wl=t,Qa(),l}function cd(e,t){Ce=null,C.H=Pn,t===ln||t===Pa?(t=Cc(),Be=3):t===Xr?(t=Cc(),Be=4):Be=t===vo?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Lt=t,we===null&&(it=1,hs(e,Qt(t,e.current)))}function fd(){var e=Ht.current;return e===null?!0:(Me&4194048)===Me?Wt===null:(Me&62914560)===Me||(Me&536870912)!==0?e===Wt:!1}function dd(){var e=C.H;return C.H=Pn,e===null?Pn:e}function hd(){var e=C.A;return C.A=Pg,e}function Cs(){it=4,Il||(Me&4194048)!==Me&&Ht.current!==null||(fn=!0),(Pl&134217727)===0&&(Di&134217727)===0||Ve===null||li(Ve,Me,Ut,!1)}function Go(e,t,l){var i=Le;Le|=2;var s=dd(),o=hd();(Ve!==e||Me!==t)&&(_s=null,gn(e,t)),t=!1;var f=it;e:do try{if(Be!==0&&we!==null){var p=we,S=Lt;switch(Be){case 8:qo(),f=6;break e;case 3:case 2:case 9:case 6:Ht.current===null&&(t=!0);var M=Be;if(Be=0,Lt=null,mn(e,p,S,M),l&&fn){f=0;break e}break;default:M=Be,Be=0,Lt=null,mn(e,p,S,M)}}lm(),f=it;break}catch(k){cd(e,k)}while(!0);return t&&e.shellSuspendCounter++,vl=_i=null,Le=i,C.H=s,C.A=o,we===null&&(Ve=null,Me=0,Qa()),f}function lm(){for(;we!==null;)gd(we)}function im(e,t){var l=Le;Le|=2;var i=dd(),s=hd();Ve!==e||Me!==t?(_s=null,Es=xt()+500,gn(e,t)):fn=hi(e,t);e:do try{if(Be!==0&&we!==null){t=we;var o=Lt;t:switch(Be){case 1:Be=0,Lt=null,mn(e,t,o,1);break;case 2:case 9:if(_c(o)){Be=0,Lt=null,md(t);break}t=function(){Be!==2&&Be!==9||Ve!==e||(Be=7),ol(e)},o.then(t,t);break e;case 3:Be=7;break e;case 4:Be=5;break e;case 7:_c(o)?(Be=0,Lt=null,md(t)):(Be=0,Lt=null,mn(e,t,o,7));break;case 5:var f=null;switch(we.tag){case 26:f=we.memoizedState;case 5:case 27:var p=we;if(f?eh(f):p.stateNode.complete){Be=0,Lt=null;var S=p.sibling;if(S!==null)we=S;else{var M=p.return;M!==null?(we=M,Ts(M)):we=null}break t}}Be=0,Lt=null,mn(e,t,o,5);break;case 6:Be=0,Lt=null,mn(e,t,o,6);break;case 8:qo(),it=6;break e;default:throw Error(r(462))}}nm();break}catch(k){cd(e,k)}while(!0);return vl=_i=null,C.H=i,C.A=s,Le=l,we!==null?0:(Ve=null,Me=0,Qa(),it)}function nm(){for(;we!==null&&!za();)gd(we)}function gd(e){var t=Uf(e.alternate,e,wl);e.memoizedProps=e.pendingProps,t===null?Ts(e):we=t}function md(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Df(l,t,t.pendingProps,t.type,void 0,Me);break;case 11:t=Df(l,t,t.pendingProps,t.type.render,t.ref,Me);break;case 5:to(t);default:qf(l,t),t=we=dc(t,wl),t=Uf(l,t,wl)}e.memoizedProps=e.pendingProps,t===null?Ts(e):we=t}function mn(e,t,l,i){vl=_i=null,to(t),nn=null,Qn=0;var s=t.return;try{if(Zg(e,s,t,l,Me)){it=1,hs(e,Qt(l,e.current)),we=null;return}}catch(o){if(s!==null)throw we=s,o;it=1,hs(e,Qt(l,e.current)),we=null;return}t.flags&32768?(De||i===1?e=!0:fn||(Me&536870912)!==0?e=!1:(Il=e=!0,(i===2||i===9||i===3||i===6)&&(i=Ht.current,i!==null&&i.tag===13&&(i.flags|=16384))),pd(t,e)):Ts(t)}function Ts(e){var t=e;do{if((t.flags&32768)!==0){pd(t,Il);return}e=t.return;var l=Wg(t.alternate,t,wl);if(l!==null){we=l;return}if(t=t.sibling,t!==null){we=t;return}we=t=e}while(t!==null);it===0&&(it=5)}function pd(e,t){do{var l=$g(e.alternate,e);if(l!==null){l.flags&=32767,we=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){we=e;return}we=e=l}while(e!==null);it=6,we=null}function yd(e,t,l,i,s,o,f,p,S){e.cancelPendingCommit=null;do Rs();while(ht!==0);if((Le&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));if(o=t.lanes|t.childLanes,o|=wr,ar(e,l,o,f,p,S),e===Ve&&(we=Ve=null,Me=0),hn=t,ti=e,jl=l,Lo=o,Uo=s,sd=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,om(ci,function(){return Ed(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=C.T,C.T=null,s=X.p,X.p=2,f=Le,Le|=4;try{Fg(e,t,l)}finally{Le=f,X.p=s,C.T=i}}ht=1,vd(),xd(),bd()}}function vd(){if(ht===1){ht=0;var e=ti,t=hn,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=C.T,C.T=null;var i=X.p;X.p=2;var s=Le;Le|=4;try{If(t,e);var o=Po,f=ic(e.containerInfo),p=o.focusedElem,S=o.selectionRange;if(f!==p&&p&&p.ownerDocument&&lc(p.ownerDocument.documentElement,p)){if(S!==null&&_r(p)){var M=S.start,k=S.end;if(k===void 0&&(k=M),"selectionStart"in p)p.selectionStart=M,p.selectionEnd=Math.min(k,p.value.length);else{var Y=p.ownerDocument||document,A=Y&&Y.defaultView||window;if(A.getSelection){var N=A.getSelection(),se=p.textContent.length,ge=Math.min(S.start,se),Xe=S.end===void 0?ge:Math.min(S.end,se);!N.extend&&ge>Xe&&(f=Xe,Xe=ge,ge=f);var R=tc(p,ge),z=tc(p,Xe);if(R&&z&&(N.rangeCount!==1||N.anchorNode!==R.node||N.anchorOffset!==R.offset||N.focusNode!==z.node||N.focusOffset!==z.offset)){var j=Y.createRange();j.setStart(R.node,R.offset),N.removeAllRanges(),ge>Xe?(N.addRange(j),N.extend(z.node,z.offset)):(j.setEnd(z.node,z.offset),N.addRange(j))}}}}for(Y=[],N=p;N=N.parentNode;)N.nodeType===1&&Y.push({element:N,left:N.scrollLeft,top:N.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<Y.length;p++){var B=Y[p];B.element.scrollLeft=B.left,B.element.scrollTop=B.top}}Bs=!!Io,Po=Io=null}finally{Le=s,X.p=i,C.T=l}}e.current=t,ht=2}}function xd(){if(ht===2){ht=0;var e=ti,t=hn,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=C.T,C.T=null;var i=X.p;X.p=2;var s=Le;Le|=4;try{Kf(e,t.alternate,t)}finally{Le=s,X.p=i,C.T=l}}ht=3}}function bd(){if(ht===4||ht===3){ht=0,Ca();var e=ti,t=hn,l=jl,i=sd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ht=5:(ht=0,hn=ti=null,Sd(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(ei=null),wn(l),t=t.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(Ol,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=C.T,s=X.p,X.p=2,C.T=null;try{for(var o=e.onRecoverableError,f=0;f<i.length;f++){var p=i[f];o(p.value,{componentStack:p.stack})}}finally{C.T=t,X.p=s}}(jl&3)!==0&&Rs(),ol(e),s=e.pendingLanes,(l&261930)!==0&&(s&42)!==0?e===Bo?oa++:(oa=0,Bo=e):oa=0,ua(0)}}function Sd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Xn(t)))}function Rs(){return vd(),xd(),bd(),Ed()}function Ed(){if(ht!==5)return!1;var e=ti,t=Lo;Lo=0;var l=wn(jl),i=C.T,s=X.p;try{X.p=32>l?32:l,C.T=null,l=Uo,Uo=null;var o=ti,f=jl;if(ht=0,hn=ti=null,jl=0,(Le&6)!==0)throw Error(r(331));var p=Le;if(Le|=4,id(o.current),ed(o,o.current,f,l),Le=p,ua(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(Ol,o)}catch{}return!0}finally{X.p=s,C.T=i,Sd(e,t)}}function _d(e,t,l){t=Qt(l,t),t=yo(e.stateNode,t,2),e=Jl(e,t,2),e!==null&&(mi(e,2),ol(e))}function qe(e,t,l){if(e.tag===3)_d(e,e,l);else for(;t!==null;){if(t.tag===3){_d(t,e,l);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(ei===null||!ei.has(i))){e=Qt(l,e),l=zf(2),i=Jl(t,l,2),i!==null&&(Cf(l,i,t,e),mi(i,2),ol(i));break}}t=t.return}}function Yo(e,t,l){var i=e.pingCache;if(i===null){i=e.pingCache=new em;var s=new Set;i.set(t,s)}else s=i.get(t),s===void 0&&(s=new Set,i.set(t,s));s.has(l)||(No=!0,s.add(l),e=am.bind(null,e,t,l),t.then(e,e))}function am(e,t,l){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Ve===e&&(Me&l)===l&&(it===4||it===3&&(Me&62914560)===Me&&300>xt()-Ss?(Le&2)===0&&gn(e,0):Ho|=l,dn===Me&&(dn=0)),ol(e)}function zd(e,t){t===0&&(t=ja()),e=bi(e,t),e!==null&&(mi(e,t),ol(e))}function sm(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),zd(e,l)}function rm(e,t){var l=0;switch(e.tag){case 31:case 13:var i=e.stateNode,s=e.memoizedState;s!==null&&(l=s.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(r(314))}i!==null&&i.delete(t),zd(e,l)}function om(e,t){return Hi(e,t)}var ws=null,pn=null,Xo=!1,js=!1,Vo=!1,ii=0;function ol(e){e!==pn&&e.next===null&&(pn===null?ws=pn=e:pn=pn.next=e),js=!0,Xo||(Xo=!0,cm())}function ua(e,t){if(!Vo&&js){Vo=!0;do for(var l=!1,i=ws;i!==null;){if(e!==0){var s=i.pendingLanes;if(s===0)var o=0;else{var f=i.suspendedLanes,p=i.pingedLanes;o=(1<<31-tt(42|e)+1)-1,o&=s&~(f&~p),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(l=!0,wd(i,o))}else o=Me,o=di(i,i===Ve?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(o&3)===0||hi(i,o)||(l=!0,wd(i,o));i=i.next}while(l);Vo=!1}}function um(){Cd()}function Cd(){js=Xo=!1;var e=0;ii!==0&&bm()&&(e=ii);for(var t=xt(),l=null,i=ws;i!==null;){var s=i.next,o=Td(i,t);o===0?(i.next=null,l===null?ws=s:l.next=s,s===null&&(pn=l)):(l=i,(e!==0||(o&3)!==0)&&(js=!0)),i=s}ht!==0&&ht!==5||ua(e),ii!==0&&(ii=0)}function Td(e,t){for(var l=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var f=31-tt(o),p=1<<f,S=s[f];S===-1?((p&l)===0||(p&i)!==0)&&(s[f]=gi(p,t)):S<=t&&(e.expiredLanes|=p),o&=~p}if(t=Ve,l=Me,l=di(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,l===0||e===t&&(Be===2||Be===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&ki(i),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||hi(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(i!==null&&ki(i),wn(l)){case 2:case 8:l=Dl;break;case 32:l=ci;break;case 268435456:l=Cn;break;default:l=ci}return i=Rd.bind(null,e),l=Hi(l,i),e.callbackPriority=t,e.callbackNode=l,t}return i!==null&&i!==null&&ki(i),e.callbackPriority=2,e.callbackNode=null,2}function Rd(e,t){if(ht!==0&&ht!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Rs()&&e.callbackNode!==l)return null;var i=Me;return i=di(e,e===Ve?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(od(e,i,t),Td(e,xt()),e.callbackNode!=null&&e.callbackNode===l?Rd.bind(null,e):null)}function wd(e,t){if(Rs())return null;od(e,t,!0)}function cm(){Em(function(){(Le&6)!==0?Hi(zn,um):Cd()})}function Qo(){if(ii===0){var e=en;e===0&&(e=Li,Li<<=1,(Li&261888)===0&&(Li=256)),ii=e}return ii}function jd(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:La(""+e)}function Md(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function fm(e,t,l,i,s){if(t==="submit"&&l&&l.stateNode===s){var o=jd((s[St]||null).action),f=i.submitter;f&&(t=(t=f[St]||null)?jd(t.formAction):f.getAttribute("formAction"),t!==null&&(o=t,f=null));var p=new Ga("action","action",null,i,s);e.push({event:p,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(ii!==0){var S=f?Md(s,f):new FormData(s);co(l,{pending:!0,data:S,method:s.method,action:o},null,S)}}else typeof o=="function"&&(p.preventDefault(),S=f?Md(s,f):new FormData(s),co(l,{pending:!0,data:S,method:s.method,action:o},o,S))},currentTarget:s}]})}}for(var Zo=0;Zo<Rr.length;Zo++){var Ko=Rr[Zo],dm=Ko.toLowerCase(),hm=Ko[0].toUpperCase()+Ko.slice(1);tl(dm,"on"+hm)}tl(sc,"onAnimationEnd"),tl(rc,"onAnimationIteration"),tl(oc,"onAnimationStart"),tl("dblclick","onDoubleClick"),tl("focusin","onFocus"),tl("focusout","onBlur"),tl(jg,"onTransitionRun"),tl(Mg,"onTransitionStart"),tl(Ag,"onTransitionCancel"),tl(uc,"onTransitionEnd"),x("onMouseEnter",["mouseout","mouseover"]),x("onMouseLeave",["mouseout","mouseover"]),x("onPointerEnter",["pointerout","pointerover"]),x("onPointerLeave",["pointerout","pointerover"]),nt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),nt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),nt("onBeforeInput",["compositionend","keypress","textInput","paste"]),nt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),nt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),nt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ca="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(" "),gm=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ca));function Ad(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var i=e[l],s=i.event;i=i.listeners;e:{var o=void 0;if(t)for(var f=i.length-1;0<=f;f--){var p=i[f],S=p.instance,M=p.currentTarget;if(p=p.listener,S!==o&&s.isPropagationStopped())break e;o=p,s.currentTarget=M;try{o(s)}catch(k){Va(k)}s.currentTarget=null,o=S}else for(f=0;f<i.length;f++){if(p=i[f],S=p.instance,M=p.currentTarget,p=p.listener,S!==o&&s.isPropagationStopped())break e;o=p,s.currentTarget=M;try{o(s)}catch(k){Va(k)}s.currentTarget=null,o=S}}}}function je(e,t){var l=t[jn];l===void 0&&(l=t[jn]=new Set);var i=e+"__bubble";l.has(i)||(Dd(t,e,2,!1),l.add(i))}function Jo(e,t,l){var i=0;t&&(i|=4),Dd(l,e,i,t)}var Ms="_reactListening"+Math.random().toString(36).slice(2);function Wo(e){if(!e[Ms]){e[Ms]=!0,Oa.forEach(function(l){l!=="selectionchange"&&(gm.has(l)||Jo(l,!1,e),Jo(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ms]||(t[Ms]=!0,Jo("selectionchange",!1,t))}}function Dd(e,t,l,i){switch(rh(t)){case 2:var s=Ym;break;case 8:s=Xm;break;default:s=cu}l=s.bind(null,t,l,e),s=void 0,!gr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),i?s!==void 0?e.addEventListener(t,l,{capture:!0,passive:s}):e.addEventListener(t,l,!0):s!==void 0?e.addEventListener(t,l,{passive:s}):e.addEventListener(t,l,!1)}function $o(e,t,l,i,s){var o=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var f=i.tag;if(f===3||f===4){var p=i.stateNode.containerInfo;if(p===s)break;if(f===4)for(f=i.return;f!==null;){var S=f.tag;if((S===3||S===4)&&f.stateNode.containerInfo===s)return;f=f.return}for(;p!==null;){if(f=dl(p),f===null)return;if(S=f.tag,S===5||S===6||S===26||S===27){i=o=f;continue e}p=p.parentNode}}i=i.return}ku(function(){var M=o,k=dr(l),Y=[];e:{var A=cc.get(e);if(A!==void 0){var N=Ga,se=e;switch(e){case"keypress":if(Ba(l)===0)break e;case"keydown":case"keyup":N=rg;break;case"focusin":se="focus",N=vr;break;case"focusout":se="blur",N=vr;break;case"beforeblur":case"afterblur":N=vr;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":N=Bu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":N=Wh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":N=cg;break;case sc:case rc:case oc:N=Ih;break;case uc:N=dg;break;case"scroll":case"scrollend":N=Kh;break;case"wheel":N=gg;break;case"copy":case"cut":case"paste":N=eg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":N=Gu;break;case"toggle":case"beforetoggle":N=pg}var ge=(t&4)!==0,Xe=!ge&&(e==="scroll"||e==="scrollend"),R=ge?A!==null?A+"Capture":null:A;ge=[];for(var z=M,j;z!==null;){var B=z;if(j=B.stateNode,B=B.tag,B!==5&&B!==26&&B!==27||j===null||R===null||(B=Dn(z,R),B!=null&&ge.push(fa(z,B,j))),Xe)break;z=z.return}0<ge.length&&(A=new N(A,se,null,l,k),Y.push({event:A,listeners:ge}))}}if((t&7)===0){e:{if(A=e==="mouseover"||e==="pointerover",N=e==="mouseout"||e==="pointerout",A&&l!==fr&&(se=l.relatedTarget||l.fromElement)&&(dl(se)||se[kl]))break e;if((N||A)&&(A=k.window===k?k:(A=k.ownerDocument)?A.defaultView||A.parentWindow:window,N?(se=l.relatedTarget||l.toElement,N=M,se=se?dl(se):null,se!==null&&(Xe=c(se),ge=se.tag,se!==Xe||ge!==5&&ge!==27&&ge!==6)&&(se=null)):(N=null,se=M),N!==se)){if(ge=Bu,B="onMouseLeave",R="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(ge=Gu,B="onPointerLeave",R="onPointerEnter",z="pointer"),Xe=N==null?A:Bl(N),j=se==null?A:Bl(se),A=new ge(B,z+"leave",N,l,k),A.target=Xe,A.relatedTarget=j,B=null,dl(k)===M&&(ge=new ge(R,z+"enter",se,l,k),ge.target=j,ge.relatedTarget=Xe,B=ge),Xe=B,N&&se)t:{for(ge=mm,R=N,z=se,j=0,B=R;B;B=ge(B))j++;B=0;for(var de=z;de;de=ge(de))B++;for(;0<j-B;)R=ge(R),j--;for(;0<B-j;)z=ge(z),B--;for(;j--;){if(R===z||z!==null&&R===z.alternate){ge=R;break t}R=ge(R),z=ge(z)}ge=null}else ge=null;N!==null&&Od(Y,A,N,ge,!1),se!==null&&Xe!==null&&Od(Y,Xe,se,ge,!0)}}e:{if(A=M?Bl(M):window,N=A.nodeName&&A.nodeName.toLowerCase(),N==="select"||N==="input"&&A.type==="file")var He=Wu;else if(Ku(A))if($u)He=Tg;else{He=zg;var ue=_g}else N=A.nodeName,!N||N.toLowerCase()!=="input"||A.type!=="checkbox"&&A.type!=="radio"?M&&cr(M.elementType)&&(He=Wu):He=Cg;if(He&&(He=He(e,M))){Ju(Y,He,l,k);break e}ue&&ue(e,A,M),e==="focusout"&&M&&A.type==="number"&&M.memoizedProps.value!=null&&ur(A,"number",A.value)}switch(ue=M?Bl(M):window,e){case"focusin":(Ku(ue)||ue.contentEditable==="true")&&(Zi=ue,zr=M,qn=null);break;case"focusout":qn=zr=Zi=null;break;case"mousedown":Cr=!0;break;case"contextmenu":case"mouseup":case"dragend":Cr=!1,nc(Y,l,k);break;case"selectionchange":if(wg)break;case"keydown":case"keyup":nc(Y,l,k)}var Re;if(br)e:{switch(e){case"compositionstart":var Ae="onCompositionStart";break e;case"compositionend":Ae="onCompositionEnd";break e;case"compositionupdate":Ae="onCompositionUpdate";break e}Ae=void 0}else Qi?Qu(e,l)&&(Ae="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ae="onCompositionStart");Ae&&(Yu&&l.locale!=="ko"&&(Qi||Ae!=="onCompositionStart"?Ae==="onCompositionEnd"&&Qi&&(Re=Lu()):(Gl=k,mr="value"in Gl?Gl.value:Gl.textContent,Qi=!0)),ue=As(M,Ae),0<ue.length&&(Ae=new qu(Ae,e,null,l,k),Y.push({event:Ae,listeners:ue}),Re?Ae.data=Re:(Re=Zu(l),Re!==null&&(Ae.data=Re)))),(Re=vg?xg(e,l):bg(e,l))&&(Ae=As(M,"onBeforeInput"),0<Ae.length&&(ue=new qu("onBeforeInput","beforeinput",null,l,k),Y.push({event:ue,listeners:Ae}),ue.data=Re)),fm(Y,e,M,l,k)}Ad(Y,t)})}function fa(e,t,l){return{instance:e,listener:t,currentTarget:l}}function As(e,t){for(var l=t+"Capture",i=[];e!==null;){var s=e,o=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||o===null||(s=Dn(e,l),s!=null&&i.unshift(fa(e,s,o)),s=Dn(e,t),s!=null&&i.push(fa(e,s,o))),e.tag===3)return i;e=e.return}return[]}function mm(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,l,i,s){for(var o=t._reactName,f=[];l!==null&&l!==i;){var p=l,S=p.alternate,M=p.stateNode;if(p=p.tag,S!==null&&S===i)break;p!==5&&p!==26&&p!==27||M===null||(S=M,s?(M=Dn(l,o),M!=null&&f.unshift(fa(l,M,S))):s||(M=Dn(l,o),M!=null&&f.push(fa(l,M,S)))),l=l.return}f.length!==0&&e.push({event:t,listeners:f})}var pm=/\r\n?/g,ym=/\u0000|\uFFFD/g;function Nd(e){return(typeof e=="string"?e:""+e).replace(pm,`
`).replace(ym,"")}function Hd(e,t){return t=Nd(t),Nd(e)===t}function Ye(e,t,l,i,s,o){switch(l){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Yi(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Yi(e,""+i);break;case"className":ye(e,"class",i);break;case"tabIndex":ye(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":ye(e,l,i);break;case"style":Nu(e,i,o);break;case"data":if(t!=="object"){ye(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(l);break}i=La(""+i),e.setAttribute(l,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof o=="function"&&(l==="formAction"?(t!=="input"&&Ye(e,t,"name",s.name,s,null),Ye(e,t,"formEncType",s.formEncType,s,null),Ye(e,t,"formMethod",s.formMethod,s,null),Ye(e,t,"formTarget",s.formTarget,s,null)):(Ye(e,t,"encType",s.encType,s,null),Ye(e,t,"method",s.method,s,null),Ye(e,t,"target",s.target,s,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(l);break}i=La(""+i),e.setAttribute(l,i);break;case"onClick":i!=null&&(e.onclick=gl);break;case"onScroll":i!=null&&je("scroll",e);break;case"onScrollEnd":i!=null&&je("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(r(61));if(l=i.__html,l!=null){if(s.children!=null)throw Error(r(60));e.innerHTML=l}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}l=La(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(l,""+i):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":i===!0?e.setAttribute(l,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(l,i):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(l,i):e.removeAttribute(l);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(l):e.setAttribute(l,i);break;case"popover":je("beforetoggle",e),je("toggle",e),Ke(e,"popover",i);break;case"xlinkActuate":Ne(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Ne(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Ne(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Ne(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Ne(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Ne(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Ne(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Ne(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Ne(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Ke(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Qh.get(l)||l,Ke(e,l,i))}}function Fo(e,t,l,i,s,o){switch(l){case"style":Nu(e,i,o);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(r(61));if(l=i.__html,l!=null){if(s.children!=null)throw Error(r(60));e.innerHTML=l}}break;case"children":typeof i=="string"?Yi(e,i):(typeof i=="number"||typeof i=="bigint")&&Yi(e,""+i);break;case"onScroll":i!=null&&je("scroll",e);break;case"onScrollEnd":i!=null&&je("scrollend",e);break;case"onClick":i!=null&&(e.onclick=gl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Na.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(s=l.endsWith("Capture"),t=l.slice(2,s?l.length-7:void 0),o=e[St]||null,o=o!=null?o[l]:null,typeof o=="function"&&e.removeEventListener(t,o,s),typeof i=="function")){typeof o!="function"&&o!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,i,s);break e}l in e?e[l]=i:i===!0?e.setAttribute(l,""):Ke(e,l,i)}}}function vt(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":je("error",e),je("load",e);var i=!1,s=!1,o;for(o in l)if(l.hasOwnProperty(o)){var f=l[o];if(f!=null)switch(o){case"src":i=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:Ye(e,t,o,f,l,null)}}s&&Ye(e,t,"srcSet",l.srcSet,l,null),i&&Ye(e,t,"src",l.src,l,null);return;case"input":je("invalid",e);var p=o=f=s=null,S=null,M=null;for(i in l)if(l.hasOwnProperty(i)){var k=l[i];if(k!=null)switch(i){case"name":s=k;break;case"type":f=k;break;case"checked":S=k;break;case"defaultChecked":M=k;break;case"value":o=k;break;case"defaultValue":p=k;break;case"children":case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(137,t));break;default:Ye(e,t,i,k,l,null)}}Mu(e,o,p,S,M,f,s,!1);return;case"select":je("invalid",e),i=f=o=null;for(s in l)if(l.hasOwnProperty(s)&&(p=l[s],p!=null))switch(s){case"value":o=p;break;case"defaultValue":f=p;break;case"multiple":i=p;default:Ye(e,t,s,p,l,null)}t=o,l=f,e.multiple=!!i,t!=null?Gi(e,!!i,t,!1):l!=null&&Gi(e,!!i,l,!0);return;case"textarea":je("invalid",e),o=s=i=null;for(f in l)if(l.hasOwnProperty(f)&&(p=l[f],p!=null))switch(f){case"value":i=p;break;case"defaultValue":s=p;break;case"children":o=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(r(91));break;default:Ye(e,t,f,p,l,null)}Du(e,i,s,o);return;case"option":for(S in l)if(l.hasOwnProperty(S)&&(i=l[S],i!=null))switch(S){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Ye(e,t,S,i,l,null)}return;case"dialog":je("beforetoggle",e),je("toggle",e),je("cancel",e),je("close",e);break;case"iframe":case"object":je("load",e);break;case"video":case"audio":for(i=0;i<ca.length;i++)je(ca[i],e);break;case"image":je("error",e),je("load",e);break;case"details":je("toggle",e);break;case"embed":case"source":case"link":je("error",e),je("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(M in l)if(l.hasOwnProperty(M)&&(i=l[M],i!=null))switch(M){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:Ye(e,t,M,i,l,null)}return;default:if(cr(t)){for(k in l)l.hasOwnProperty(k)&&(i=l[k],i!==void 0&&Fo(e,t,k,i,l,void 0));return}}for(p in l)l.hasOwnProperty(p)&&(i=l[p],i!=null&&Ye(e,t,p,i,l,null))}function vm(e,t,l,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,o=null,f=null,p=null,S=null,M=null,k=null;for(N in l){var Y=l[N];if(l.hasOwnProperty(N)&&Y!=null)switch(N){case"checked":break;case"value":break;case"defaultValue":S=Y;default:i.hasOwnProperty(N)||Ye(e,t,N,null,i,Y)}}for(var A in i){var N=i[A];if(Y=l[A],i.hasOwnProperty(A)&&(N!=null||Y!=null))switch(A){case"type":o=N;break;case"name":s=N;break;case"checked":M=N;break;case"defaultChecked":k=N;break;case"value":f=N;break;case"defaultValue":p=N;break;case"children":case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(137,t));break;default:N!==Y&&Ye(e,t,A,N,i,Y)}}or(e,f,p,S,M,k,o,s);return;case"select":N=f=p=A=null;for(o in l)if(S=l[o],l.hasOwnProperty(o)&&S!=null)switch(o){case"value":break;case"multiple":N=S;default:i.hasOwnProperty(o)||Ye(e,t,o,null,i,S)}for(s in i)if(o=i[s],S=l[s],i.hasOwnProperty(s)&&(o!=null||S!=null))switch(s){case"value":A=o;break;case"defaultValue":p=o;break;case"multiple":f=o;default:o!==S&&Ye(e,t,s,o,i,S)}t=p,l=f,i=N,A!=null?Gi(e,!!l,A,!1):!!i!=!!l&&(t!=null?Gi(e,!!l,t,!0):Gi(e,!!l,l?[]:"",!1));return;case"textarea":N=A=null;for(p in l)if(s=l[p],l.hasOwnProperty(p)&&s!=null&&!i.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:Ye(e,t,p,null,i,s)}for(f in i)if(s=i[f],o=l[f],i.hasOwnProperty(f)&&(s!=null||o!=null))switch(f){case"value":A=s;break;case"defaultValue":N=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(r(91));break;default:s!==o&&Ye(e,t,f,s,i,o)}Au(e,A,N);return;case"option":for(var se in l)if(A=l[se],l.hasOwnProperty(se)&&A!=null&&!i.hasOwnProperty(se))switch(se){case"selected":e.selected=!1;break;default:Ye(e,t,se,null,i,A)}for(S in i)if(A=i[S],N=l[S],i.hasOwnProperty(S)&&A!==N&&(A!=null||N!=null))switch(S){case"selected":e.selected=A&&typeof A!="function"&&typeof A!="symbol";break;default:Ye(e,t,S,A,i,N)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ge in l)A=l[ge],l.hasOwnProperty(ge)&&A!=null&&!i.hasOwnProperty(ge)&&Ye(e,t,ge,null,i,A);for(M in i)if(A=i[M],N=l[M],i.hasOwnProperty(M)&&A!==N&&(A!=null||N!=null))switch(M){case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(r(137,t));break;default:Ye(e,t,M,A,i,N)}return;default:if(cr(t)){for(var Xe in l)A=l[Xe],l.hasOwnProperty(Xe)&&A!==void 0&&!i.hasOwnProperty(Xe)&&Fo(e,t,Xe,void 0,i,A);for(k in i)A=i[k],N=l[k],!i.hasOwnProperty(k)||A===N||A===void 0&&N===void 0||Fo(e,t,k,A,i,N);return}}for(var R in l)A=l[R],l.hasOwnProperty(R)&&A!=null&&!i.hasOwnProperty(R)&&Ye(e,t,R,null,i,A);for(Y in i)A=i[Y],N=l[Y],!i.hasOwnProperty(Y)||A===N||A==null&&N==null||Ye(e,t,Y,A,i,N)}function kd(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function xm(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),i=0;i<l.length;i++){var s=l[i],o=s.transferSize,f=s.initiatorType,p=s.duration;if(o&&p&&kd(f)){for(f=0,p=s.responseEnd,i+=1;i<l.length;i++){var S=l[i],M=S.startTime;if(M>p)break;var k=S.transferSize,Y=S.initiatorType;k&&kd(Y)&&(S=S.responseEnd,f+=k*(S<p?1:(p-M)/(S-M)))}if(--i,t+=8*(o+f)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Io=null,Po=null;function Ds(e){return e.nodeType===9?e:e.ownerDocument}function Ld(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ud(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function eu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var tu=null;function bm(){var e=window.event;return e&&e.type==="popstate"?e===tu?!1:(tu=e,!0):(tu=null,!1)}var Bd=typeof setTimeout=="function"?setTimeout:void 0,Sm=typeof clearTimeout=="function"?clearTimeout:void 0,qd=typeof Promise=="function"?Promise:void 0,Em=typeof queueMicrotask=="function"?queueMicrotask:typeof qd<"u"?function(e){return qd.resolve(null).then(e).catch(_m)}:Bd;function _m(e){setTimeout(function(){throw e})}function ni(e){return e==="head"}function Gd(e,t){var l=t,i=0;do{var s=l.nextSibling;if(e.removeChild(l),s&&s.nodeType===8)if(l=s.data,l==="/$"||l==="/&"){if(i===0){e.removeChild(s),bn(t);return}i--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")i++;else if(l==="html")da(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,da(l);for(var o=l.firstChild;o;){var f=o.nextSibling,p=o.nodeName;o[Ll]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&o.rel.toLowerCase()==="stylesheet"||l.removeChild(o),o=f}}else l==="body"&&da(e.ownerDocument.body);l=s}while(l);bn(t)}function Yd(e,t){var l=e;e=0;do{var i=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),i&&i.nodeType===8)if(l=i.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=i}while(l)}function lu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":lu(l),An(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function zm(e,t,l,i){for(;e.nodeType===1;){var s=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Ll])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=$t(e.nextSibling),e===null)break}return null}function Cm(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=$t(e.nextSibling),e===null))return null;return e}function Xd(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=$t(e.nextSibling),e===null))return null;return e}function iu(e){return e.data==="$?"||e.data==="$~"}function nu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Tm(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var i=function(){t(),l.removeEventListener("DOMContentLoaded",i)};l.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function $t(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var au=null;function Vd(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return $t(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Qd(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function Zd(e,t,l){switch(t=Ds(l),e){case"html":if(e=t.documentElement,!e)throw Error(r(452));return e;case"head":if(e=t.head,!e)throw Error(r(453));return e;case"body":if(e=t.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function da(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);An(e)}var Ft=new Map,Kd=new Set;function Os(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ml=X.d;X.d={f:Rm,r:wm,D:jm,C:Mm,L:Am,m:Dm,X:Nm,S:Om,M:Hm};function Rm(){var e=Ml.f(),t=zs();return e||t}function wm(e){var t=Ul(e);t!==null&&t.tag===5&&t.type==="form"?cf(t):Ml.r(e)}var yn=typeof document>"u"?null:document;function Jd(e,t,l){var i=yn;if(i&&typeof t=="string"&&t){var s=Xt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof l=="string"&&(s+='[crossorigin="'+l+'"]'),Kd.has(s)||(Kd.add(s),e={rel:e,crossOrigin:l,href:t},i.querySelector(s)===null&&(t=i.createElement("link"),vt(t,"link",e),et(t),i.head.appendChild(t)))}}function jm(e){Ml.D(e),Jd("dns-prefetch",e,null)}function Mm(e,t){Ml.C(e,t),Jd("preconnect",e,t)}function Am(e,t,l){Ml.L(e,t,l);var i=yn;if(i&&e&&t){var s='link[rel="preload"][as="'+Xt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(s+='[imagesrcset="'+Xt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(s+='[imagesizes="'+Xt(l.imageSizes)+'"]')):s+='[href="'+Xt(e)+'"]';var o=s;switch(t){case"style":o=vn(e);break;case"script":o=xn(e)}Ft.has(o)||(e=v({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Ft.set(o,e),i.querySelector(s)!==null||t==="style"&&i.querySelector(ha(o))||t==="script"&&i.querySelector(ga(o))||(t=i.createElement("link"),vt(t,"link",e),et(t),i.head.appendChild(t)))}}function Dm(e,t){Ml.m(e,t);var l=yn;if(l&&e){var i=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Xt(i)+'"][href="'+Xt(e)+'"]',o=s;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=xn(e)}if(!Ft.has(o)&&(e=v({rel:"modulepreload",href:e},t),Ft.set(o,e),l.querySelector(s)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(ga(o)))return}i=l.createElement("link"),vt(i,"link",e),et(i),l.head.appendChild(i)}}}function Om(e,t,l){Ml.S(e,t,l);var i=yn;if(i&&e){var s=el(i).hoistableStyles,o=vn(e);t=t||"default";var f=s.get(o);if(!f){var p={loading:0,preload:null};if(f=i.querySelector(ha(o)))p.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Ft.get(o))&&su(e,l);var S=f=i.createElement("link");et(S),vt(S,"link",e),S._p=new Promise(function(M,k){S.onload=M,S.onerror=k}),S.addEventListener("load",function(){p.loading|=1}),S.addEventListener("error",function(){p.loading|=2}),p.loading|=4,Ns(f,t,i)}f={type:"stylesheet",instance:f,count:1,state:p},s.set(o,f)}}}function Nm(e,t){Ml.X(e,t);var l=yn;if(l&&e){var i=el(l).hoistableScripts,s=xn(e),o=i.get(s);o||(o=l.querySelector(ga(s)),o||(e=v({src:e,async:!0},t),(t=Ft.get(s))&&ru(e,t),o=l.createElement("script"),et(o),vt(o,"link",e),l.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(s,o))}}function Hm(e,t){Ml.M(e,t);var l=yn;if(l&&e){var i=el(l).hoistableScripts,s=xn(e),o=i.get(s);o||(o=l.querySelector(ga(s)),o||(e=v({src:e,async:!0,type:"module"},t),(t=Ft.get(s))&&ru(e,t),o=l.createElement("script"),et(o),vt(o,"link",e),l.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(s,o))}}function Wd(e,t,l,i){var s=(s=ae.current)?Os(s):null;if(!s)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=vn(l.href),l=el(s).hoistableStyles,i=l.get(t),i||(i={type:"style",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=vn(l.href);var o=el(s).hoistableStyles,f=o.get(e);if(f||(s=s.ownerDocument||s,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,f),(o=s.querySelector(ha(e)))&&!o._p&&(f.instance=o,f.state.loading=5),Ft.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Ft.set(e,l),o||km(s,e,l,f.state))),t&&i===null)throw Error(r(528,""));return f}if(t&&i!==null)throw Error(r(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=xn(l),l=el(s).hoistableScripts,i=l.get(t),i||(i={type:"script",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function vn(e){return'href="'+Xt(e)+'"'}function ha(e){return'link[rel="stylesheet"]['+e+"]"}function $d(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function km(e,t,l,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),vt(t,"link",l),et(t),e.head.appendChild(t))}function xn(e){return'[src="'+Xt(e)+'"]'}function ga(e){return"script[async]"+e}function Fd(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Xt(l.href)+'"]');if(i)return t.instance=i,et(i),i;var s=v({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),et(i),vt(i,"style",s),Ns(i,l.precedence,e),t.instance=i;case"stylesheet":s=vn(l.href);var o=e.querySelector(ha(s));if(o)return t.state.loading|=4,t.instance=o,et(o),o;i=$d(l),(s=Ft.get(s))&&su(i,s),o=(e.ownerDocument||e).createElement("link"),et(o);var f=o;return f._p=new Promise(function(p,S){f.onload=p,f.onerror=S}),vt(o,"link",i),t.state.loading|=4,Ns(o,l.precedence,e),t.instance=o;case"script":return o=xn(l.src),(s=e.querySelector(ga(o)))?(t.instance=s,et(s),s):(i=l,(s=Ft.get(o))&&(i=v({},l),ru(i,s)),e=e.ownerDocument||e,s=e.createElement("script"),et(s),vt(s,"link",i),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Ns(i,l.precedence,e));return t.instance}function Ns(e,t,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=i.length?i[i.length-1]:null,o=s,f=0;f<i.length;f++){var p=i[f];if(p.dataset.precedence===t)o=p;else if(o!==s)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function su(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ru(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Hs=null;function Id(e,t,l){if(Hs===null){var i=new Map,s=Hs=new Map;s.set(l,i)}else s=Hs,i=s.get(l),i||(i=new Map,s.set(l,i));if(i.has(e))return i;for(i.set(e,null),l=l.getElementsByTagName(e),s=0;s<l.length;s++){var o=l[s];if(!(o[Ll]||o[dt]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var f=o.getAttribute(t)||"";f=e+f;var p=i.get(f);p?p.push(o):i.set(f,[o])}}return i}function Pd(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Lm(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function eh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Um(e,t,l,i){if(l.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var s=vn(i.href),o=t.querySelector(ha(s));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ks.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=o,et(o);return}o=t.ownerDocument||t,i=$d(i),(s=Ft.get(s))&&su(i,s),o=o.createElement("link"),et(o);var f=o;f._p=new Promise(function(p,S){f.onload=p,f.onerror=S}),vt(o,"link",i),l.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=ks.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var ou=0;function Bm(e,t){return e.stylesheets&&e.count===0&&Us(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var i=setTimeout(function(){if(e.stylesheets&&Us(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&ou===0&&(ou=62500*xm());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Us(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>ou?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(s)}}:null}function ks(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Us(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ls=null;function Us(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ls=new Map,t.forEach(qm,e),Ls=null,ks.call(e))}function qm(e,t){if(!(t.state.loading&4)){var l=Ls.get(e);if(l)var i=l.get(null);else{l=new Map,Ls.set(e,l);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<s.length;o++){var f=s[o];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(l.set(f.dataset.precedence,f),i=f)}i&&l.set(null,i)}s=t.instance,f=s.getAttribute("data-precedence"),o=l.get(f)||i,o===i&&l.set(null,s),l.set(f,s),this.count++,i=ks.bind(this),s.addEventListener("load",i),s.addEventListener("error",i),o?o.parentNode.insertBefore(s,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var ma={$$typeof:W,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function Gm(e,t,l,i,s,o,f,p,S){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Rn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rn(0),this.hiddenUpdates=Rn(null),this.identifierPrefix=i,this.onUncaughtError=s,this.onCaughtError=o,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function th(e,t,l,i,s,o,f,p,S,M,k,Y){return e=new Gm(e,t,l,f,S,M,k,Y,p),t=1,o===!0&&(t|=24),o=Nt(3,null,null,t),e.current=o,o.stateNode=e,t=qr(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:i,isDehydrated:l,cache:t},Vr(o),e}function lh(e){return e?(e=Wi,e):Wi}function ih(e,t,l,i,s,o){s=lh(s),i.context===null?i.context=s:i.pendingContext=s,i=Kl(t),i.payload={element:l},o=o===void 0?null:o,o!==null&&(i.callback=o),l=Jl(e,i,t),l!==null&&(At(l,e,t),Kn(l,e,t))}function nh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function uu(e,t){nh(e,t),(e=e.alternate)&&nh(e,t)}function ah(e){if(e.tag===13||e.tag===31){var t=bi(e,67108864);t!==null&&At(t,e,67108864),uu(e,67108864)}}function sh(e){if(e.tag===13||e.tag===31){var t=Bt();t=Bi(t);var l=bi(e,t);l!==null&&At(l,e,t),uu(e,t)}}var Bs=!0;function Ym(e,t,l,i){var s=C.T;C.T=null;var o=X.p;try{X.p=2,cu(e,t,l,i)}finally{X.p=o,C.T=s}}function Xm(e,t,l,i){var s=C.T;C.T=null;var o=X.p;try{X.p=8,cu(e,t,l,i)}finally{X.p=o,C.T=s}}function cu(e,t,l,i){if(Bs){var s=fu(i);if(s===null)$o(e,t,i,qs,l),oh(e,i);else if(Qm(s,e,t,l,i))i.stopPropagation();else if(oh(e,i),t&4&&-1<Vm.indexOf(e)){for(;s!==null;){var o=Ul(s);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var f=fl(o.pendingLanes);if(f!==0){var p=o;for(p.pendingLanes|=2,p.entangledLanes|=2;f;){var S=1<<31-tt(f);p.entanglements[1]|=S,f&=~S}ol(o),(Le&6)===0&&(Es=xt()+500,ua(0))}}break;case 31:case 13:p=bi(o,2),p!==null&&At(p,o,2),zs(),uu(o,2)}if(o=fu(i),o===null&&$o(e,t,i,qs,l),o===s)break;s=o}s!==null&&i.stopPropagation()}else $o(e,t,i,null,l)}}function fu(e){return e=dr(e),du(e)}var qs=null;function du(e){if(qs=null,e=dl(e),e!==null){var t=c(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=g(t),e!==null)return e;e=null}else if(l===31){if(e=m(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return qs=e,null}function rh(e){switch(e){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ta()){case zn:return 2;case Dl:return 8;case ci:case fi:return 32;case Cn:return 268435456;default:return 32}default:return 32}}var hu=!1,ai=null,si=null,ri=null,pa=new Map,ya=new Map,oi=[],Vm="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".split(" ");function oh(e,t){switch(e){case"focusin":case"focusout":ai=null;break;case"dragenter":case"dragleave":si=null;break;case"mouseover":case"mouseout":ri=null;break;case"pointerover":case"pointerout":pa.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ya.delete(t.pointerId)}}function va(e,t,l,i,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:l,eventSystemFlags:i,nativeEvent:o,targetContainers:[s]},t!==null&&(t=Ul(t),t!==null&&ah(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Qm(e,t,l,i,s){switch(t){case"focusin":return ai=va(ai,e,t,l,i,s),!0;case"dragenter":return si=va(si,e,t,l,i,s),!0;case"mouseover":return ri=va(ri,e,t,l,i,s),!0;case"pointerover":var o=s.pointerId;return pa.set(o,va(pa.get(o)||null,e,t,l,i,s)),!0;case"gotpointercapture":return o=s.pointerId,ya.set(o,va(ya.get(o)||null,e,t,l,i,s)),!0}return!1}function uh(e){var t=dl(e.target);if(t!==null){var l=c(t);if(l!==null){if(t=l.tag,t===13){if(t=g(l),t!==null){e.blockedOn=t,qi(e.priority,function(){sh(l)});return}}else if(t===31){if(t=m(l),t!==null){e.blockedOn=t,qi(e.priority,function(){sh(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Gs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=fu(e.nativeEvent);if(l===null){l=e.nativeEvent;var i=new l.constructor(l.type,l);fr=i,l.target.dispatchEvent(i),fr=null}else return t=Ul(l),t!==null&&ah(t),e.blockedOn=l,!1;t.shift()}return!0}function ch(e,t,l){Gs(e)&&l.delete(t)}function Zm(){hu=!1,ai!==null&&Gs(ai)&&(ai=null),si!==null&&Gs(si)&&(si=null),ri!==null&&Gs(ri)&&(ri=null),pa.forEach(ch),ya.forEach(ch)}function Ys(e,t){e.blockedOn===t&&(e.blockedOn=null,hu||(hu=!0,d.unstable_scheduleCallback(d.unstable_NormalPriority,Zm)))}var Xs=null;function fh(e){Xs!==e&&(Xs=e,d.unstable_scheduleCallback(d.unstable_NormalPriority,function(){Xs===e&&(Xs=null);for(var t=0;t<e.length;t+=3){var l=e[t],i=e[t+1],s=e[t+2];if(typeof i!="function"){if(du(i||l)===null)continue;break}var o=Ul(l);o!==null&&(e.splice(t,3),t-=3,co(o,{pending:!0,data:s,method:l.method,action:i},i,s))}}))}function bn(e){function t(S){return Ys(S,e)}ai!==null&&Ys(ai,e),si!==null&&Ys(si,e),ri!==null&&Ys(ri,e),pa.forEach(t),ya.forEach(t);for(var l=0;l<oi.length;l++){var i=oi[l];i.blockedOn===e&&(i.blockedOn=null)}for(;0<oi.length&&(l=oi[0],l.blockedOn===null);)uh(l),l.blockedOn===null&&oi.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(i=0;i<l.length;i+=3){var s=l[i],o=l[i+1],f=s[St]||null;if(typeof o=="function")f||fh(l);else if(f){var p=null;if(o&&o.hasAttribute("formAction")){if(s=o,f=o[St]||null)p=f.formAction;else if(du(s)!==null)continue}else p=f.action;typeof p=="function"?l[i+1]=p:(l.splice(i,3),i-=3),fh(l)}}}function dh(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(f){return s=f})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),i||setTimeout(l,20)}function l(){if(!i&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function gu(e){this._internalRoot=e}Vs.prototype.render=gu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var l=t.current,i=Bt();ih(l,i,e,t,null,null)},Vs.prototype.unmount=gu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ih(e.current,2,null,e,null,null),zs(),t[kl]=null}};function Vs(e){this._internalRoot=e}Vs.prototype.unstable_scheduleHydration=function(e){if(e){var t=Hl();e={blockedOn:null,target:e,priority:t};for(var l=0;l<oi.length&&t!==0&&t<oi[l].priority;l++);oi.splice(l,0,e),l===0&&uh(e)}};var hh=n.version;if(hh!=="19.2.4")throw Error(r(527,hh,"19.2.4"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=y(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var Km={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qs.isDisabled&&Qs.supportsFiber)try{Ol=Qs.inject(Km),bt=Qs}catch{}}return ba.createRoot=function(e,t){if(!u(e))throw Error(r(299));var l=!1,i="",s=bf,o=Sf,f=Ef;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=th(e,1,!1,null,null,l,i,null,s,o,f,dh),e[kl]=t.current,Wo(e),new gu(t)},ba.hydrateRoot=function(e,t,l){if(!u(e))throw Error(r(299));var i=!1,s="",o=bf,f=Sf,p=Ef,S=null;return l!=null&&(l.unstable_strictMode===!0&&(i=!0),l.identifierPrefix!==void 0&&(s=l.identifierPrefix),l.onUncaughtError!==void 0&&(o=l.onUncaughtError),l.onCaughtError!==void 0&&(f=l.onCaughtError),l.onRecoverableError!==void 0&&(p=l.onRecoverableError),l.formState!==void 0&&(S=l.formState)),t=th(e,1,!0,t,l??null,i,s,S,o,f,p,dh),t.context=lh(null),l=t.current,i=Bt(),i=Bi(i),s=Kl(i),s.callback=null,Jl(l,s,i),l=i,t.current.lanes=l,mi(t,l),ol(t),e[kl]=t.current,Wo(e),new Vs(t)},ba.version="19.2.4",ba}var _h;function ip(){if(_h)return yu.exports;_h=1;function d(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(d)}catch(n){console.error(n)}}return d(),yu.exports=lp(),yu.exports}var np=ip();const ap=Uh(np);function Sn({label:d,active:n,onClick:a,color:r}){return h.jsx("button",{onMouseDown:u=>{u.preventDefault(),a()},title:d,style:{background:n?r+"22":"transparent",border:`1px solid ${n?r+"66":"transparent"}`,borderRadius:3,padding:"1px 4px",cursor:"pointer",fontFamily:"inherit",fontSize:11,fontWeight:600,color:n?r:"var(--text-dim)",lineHeight:1.3,transition:"all 0.15s"},children:d})}function sp({label:d,color:n,bgColor:a,value:r,onChange:u,columns:c,columnsOnly:g=!1,plainText:m=!1,highlightOptions:E,onHighlightOptionToggle:y}){const[b,v]=D.useState(!1),[T,Q]=D.useState(0),[Z,F]=D.useState([]),ie=D.useRef(null),he=D.useRef(null),pe=D.useCallback(()=>{const G=ie.current;if(!G)return{text:"",start:0,end:0};const le=G.selectionStart||0,me=G.value;let Oe=me.lastIndexOf(",",le-1)+1,$=me.indexOf(",",le);$===-1&&($=me.length);const xe=me.slice(Oe,$).trimStart(),K=me.slice(Oe,$).length-me.slice(Oe,$).trimStart().length;return{text:xe,start:Oe+K,end:$}},[]),W=D.useCallback(()=>{const{text:G}=pe();if(!g&&G.includes(":")){v(!1);return}const le=G.toLowerCase(),me=c.filter(Oe=>!le||Oe.name.toLowerCase().includes(le));F(me),Q(0),v(me.length>0&&document.activeElement===ie.current)},[c,g,pe]),re=D.useCallback(G=>{const le=ie.current;if(!le)return;const{start:me,end:Oe}=pe(),$=le.value,xe=$.slice(0,me),K=$.slice(Oe),te=g?G+", ":G+":",Se=xe+te+K;u(Se),v(!1),requestAnimationFrame(()=>{const C=me+te.length;le.setSelectionRange(C,C),le.focus()})},[g,pe,u]),I=G=>{b&&(G.key==="ArrowDown"?(G.preventDefault(),Q(le=>Math.min(le+1,Z.length-1))):G.key==="ArrowUp"?(G.preventDefault(),Q(le=>Math.max(le-1,0))):G.key==="Tab"||G.key==="Enter"?Z.length>0&&(G.preventDefault(),re(Z[T].name)):G.key==="Escape"&&v(!1))},H=G=>{u(G.target.value),m||requestAnimationFrame(W)};return D.useEffect(()=>{const G=le=>{he.current&&!he.current.contains(le.target)&&le.target!==ie.current&&v(!1)};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[]),D.useEffect(()=>{if(b&&he.current){const G=he.current.children[T];G&&G.scrollIntoView({block:"nearest"})}},[T,b]),h.jsxs("div",{style:{position:"relative",flex:1,minWidth:200},children:[h.jsx("label",{style:{display:"block",fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:n,marginBottom:4},children:d}),h.jsxs("div",{style:{display:"flex",alignItems:"center",background:a,border:`1px solid ${n}33`,borderRadius:6,transition:"border-color 0.15s"},children:[h.jsx("input",{ref:ie,type:"text",value:r,onChange:H,onFocus:m?void 0:W,onKeyDown:m?void 0:I,placeholder:`${d.toLowerCase()}...`,spellCheck:!1,style:{flex:1,background:"transparent",border:"none",padding:"8px 12px",color:"var(--text)",fontFamily:"inherit",fontSize:13,outline:"none",minWidth:0},onFocusCapture:G=>{G.target.closest("div").style.borderColor=n+"66"},onBlurCapture:G=>{G.target.closest("div").style.borderColor=n+"33",setTimeout(()=>v(!1),150)}}),E&&h.jsxs("div",{style:{display:"flex",gap:2,paddingRight:6,flexShrink:0},children:[h.jsx(Sn,{label:"Aa",active:E.caseSensitive,onClick:()=>y("caseSensitive"),color:n}),h.jsx(Sn,{label:"ab",active:E.wholeWord,onClick:()=>y("wholeWord"),color:n}),h.jsx(Sn,{label:".*",active:E.regex,onClick:()=>y("regex"),color:n})]})]}),b&&Z.length>0&&h.jsx("div",{ref:he,style:{position:"absolute",top:"100%",left:0,right:0,marginTop:4,background:"var(--panel)",border:"1px solid var(--border)",borderRadius:6,maxHeight:200,overflowY:"auto",zIndex:100,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},children:Z.map((G,le)=>h.jsxs("div",{onMouseDown:me=>{me.preventDefault(),re(G.name)},style:{padding:"6px 12px",cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center",background:le===T?"rgba(255,255,255,0.05)":"transparent"},children:[h.jsx("span",{style:{color:"var(--text)"},children:G.name}),h.jsx("span",{style:{color:"var(--text-dim)",fontSize:11},children:G.type})]},G.name))})]})}function Tu({onClick:d}){return h.jsx("button",{onClick:d,title:"Refresh",style:{alignSelf:"flex-end",background:"none",border:"1px solid var(--border)",borderRadius:6,padding:"8px 10px",color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:14,lineHeight:1,flexShrink:0,display:"flex",alignItems:"center"},onMouseEnter:n=>{n.currentTarget.style.color="var(--text)",n.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:n=>{n.currentTarget.style.color="var(--text-dim)",n.currentTarget.style.borderColor="var(--border)"},children:"↻"})}function rp({filters:d,onFilterChange:n,columns:a,highlightOptions:r,onHighlightOptionToggle:u,onRefresh:c}){const g=[{key:"include",label:"Include",color:"var(--green)",bgColor:"var(--green-bg)"},{key:"exclude",label:"Exclude",color:"var(--red)",bgColor:"var(--red-bg)"},{key:"highlight",label:"Highlight",color:"var(--yellow)",bgColor:"var(--yellow-bg)",plainText:!0},{key:"columns",label:"Columns",color:"var(--purple)",bgColor:"var(--purple-bg)",columnsOnly:!0}];return h.jsxs("div",{style:{display:"flex",gap:12,padding:"16px 20px",background:"var(--panel)",borderBottom:"1px solid var(--border)",flexWrap:"wrap"},children:[g.map(m=>h.jsx(sp,{label:m.label,color:m.color,bgColor:m.bgColor,value:d[m.key],onChange:E=>n(m.key,E),columns:a,columnsOnly:m.columnsOnly||!1,plainText:m.plainText||!1,highlightOptions:m.key==="highlight"?r:void 0,onHighlightOptionToggle:m.key==="highlight"?u:void 0},m.key)),c&&h.jsx(Tu,{onClick:c})]})}function op({sql:d}){const[n,a]=D.useState(!1);return d?h.jsxs("div",{style:{borderBottom:"1px solid var(--border)",background:"var(--panel)"},children:[h.jsxs("button",{onClick:()=>a(!n),style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"8px 20px",background:"none",border:"none",color:"var(--text-dim)",fontFamily:"inherit",fontSize:11,cursor:"pointer",textAlign:"left"},children:[h.jsx("span",{style:{transform:n?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s"},children:"▶"}),"SQL Preview"]}),n&&h.jsx("pre",{style:{padding:"8px 20px 12px",margin:0,color:"var(--text-dim)",fontSize:11,lineHeight:1.6,overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:d})]}):null}function up(d){return typeof d=="number"?d.toLocaleString(void 0,{maximumFractionDigits:2}):String(d)}function cp({results:d,config:n,tableName:a}){const r=(d==null?void 0:d.value)??0,u=(d==null?void 0:d.label)??((n==null?void 0:n.aggregation)||"COUNT").toUpperCase();return h.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:20,gap:8,overflow:"hidden"},children:[h.jsx("span",{style:{fontSize:11,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:"0.1em"},children:u}),h.jsx("span",{style:{fontSize:48,fontWeight:700,color:"var(--cyan)",lineHeight:1.1,textAlign:"center",wordBreak:"break-all"},children:up(r)}),h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)",opacity:.6},children:a})]})}function Ru(d){return typeof d=="number"?d.toLocaleString(void 0,{maximumFractionDigits:2}):String(d)}const Ws=["var(--cyan)","var(--purple)","var(--green)","var(--yellow)","var(--red)","#ff9f43","#a29bfe","#fd79a8","#00cec9","#e17055"];function zh({data:d,maxValue:n}){return h.jsx("div",{style:{flex:1,overflow:"auto",padding:"4px 0"},children:d.length===0?h.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:"No data"}):d.map((a,r)=>h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"4px 16px",fontSize:12,background:r%2===1?"var(--row-alt)":"transparent"},onMouseEnter:u=>{u.currentTarget.style.background="var(--row-hover)"},onMouseLeave:u=>{u.currentTarget.style.background=r%2===1?"var(--row-alt)":"transparent"},children:[h.jsx("span",{style:{width:120,flexShrink:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--text)",fontSize:11},title:a.group,children:a.group}),h.jsx("div",{style:{flex:1,height:18,background:"rgba(34, 211, 238, 0.06)",borderRadius:3,overflow:"hidden"},children:h.jsx("div",{style:{width:`${Math.abs(a.value)/n*100}%`,height:"100%",background:"var(--cyan)",opacity:.4,borderRadius:3,transition:"width 0.3s ease",minWidth:2}})}),h.jsx("span",{style:{width:80,flexShrink:0,textAlign:"right",color:"var(--cyan)",fontWeight:600,fontSize:11},children:Ru(a.value)})]},a.group))})}function fp({data:d,maxValue:n}){const a=D.useRef(null),[r,u]=D.useState({w:400,h:300});D.useEffect(()=>{if(!a.current)return;const b=new ResizeObserver(v=>{const{width:T,height:Q}=v[0].contentRect;u({w:T,h:Q})});return b.observe(a.current),()=>b.disconnect()},[]);const c={top:20,right:20,bottom:60,left:60},g=r.w-c.left-c.right,m=r.h-c.top-c.bottom,E=d.length>0?Math.min(40,g/d.length*.7):20,y=d.length>0?g/d.length:0;return h.jsx("div",{ref:a,style:{flex:1,overflow:"hidden"},children:h.jsxs("svg",{width:r.w,height:r.h,children:[h.jsx("line",{x1:c.left,y1:c.top,x2:c.left,y2:c.top+m,stroke:"var(--border)",strokeWidth:1}),h.jsx("line",{x1:c.left,y1:c.top+m,x2:c.left+g,y2:c.top+m,stroke:"var(--border)",strokeWidth:1}),[0,.25,.5,.75,1].map(b=>{const v=c.top+m*(1-b);return h.jsxs("g",{children:[h.jsx("line",{x1:c.left-4,y1:v,x2:c.left+g,y2:v,stroke:"var(--border)",strokeWidth:.5,strokeDasharray:b>0?"2,4":"0"}),h.jsx("text",{x:c.left-8,y:v+3,textAnchor:"end",fill:"var(--text-dim)",fontSize:9,children:Ru(Math.round(n*b))})]},b)}),d.map((b,v)=>{const T=c.left+y*v+(y-E)/2,Q=n>0?Math.abs(b.value)/n*m:0,Z=c.top+m-Q;return h.jsxs("g",{children:[h.jsx("rect",{x:T,y:Z,width:E,height:Q,fill:Ws[v%Ws.length],opacity:.6,rx:2}),h.jsx("text",{x:T+E/2,y:c.top+m+12,textAnchor:"middle",fill:"var(--text-dim)",fontSize:9,transform:`rotate(-35, ${T+E/2}, ${c.top+m+12})`,children:b.group.length>10?b.group.slice(0,9)+"…":b.group})]},b.group)})]})})}function dp({data:d}){const n=D.useRef(null),[a,r]=D.useState({w:400,h:300});D.useEffect(()=>{if(!n.current)return;const v=new ResizeObserver(T=>{const{width:Q,height:Z}=T[0].contentRect;r({w:Q,h:Z})});return v.observe(n.current),()=>v.disconnect()},[]);const u=d.reduce((v,T)=>v+Math.abs(T.value),0),c=Math.min(a.w*.35,(a.h-20)*.45),g=a.w*.4,m=a.h/2;let E=-Math.PI/2;const y=d.map((v,T)=>{const Q=u>0?Math.abs(v.value)/u:0,Z=Q*Math.PI*2,F=E;E+=Z;const ie=E,he=Z>Math.PI?1:0,pe=g+c*Math.cos(F),W=m+c*Math.sin(F),re=g+c*Math.cos(ie),I=m+c*Math.sin(ie),H=Q>=1?`M ${g-c} ${m} A ${c} ${c} 0 1 1 ${g+c} ${m} A ${c} ${c} 0 1 1 ${g-c} ${m}`:`M ${g} ${m} L ${pe} ${W} A ${c} ${c} 0 ${he} 1 ${re} ${I} Z`;return{...v,d:H,color:Ws[T%Ws.length],frac:Q}}),b=a.w*.72;return h.jsx("div",{ref:n,style:{flex:1,overflow:"hidden"},children:h.jsxs("svg",{width:a.w,height:a.h,children:[y.map(v=>h.jsx("path",{d:v.d,fill:v.color,opacity:.7,stroke:"var(--bg)",strokeWidth:1.5},v.group)),y.slice(0,12).map((v,T)=>h.jsxs("g",{transform:`translate(${b}, ${20+T*18})`,children:[h.jsx("rect",{width:10,height:10,fill:v.color,opacity:.7,rx:2}),h.jsx("text",{x:14,y:9,fill:"var(--text)",fontSize:10,children:v.group.length>14?v.group.slice(0,13)+"…":v.group}),h.jsxs("text",{x:124,y:9,fill:"var(--text-dim)",fontSize:9,textAnchor:"end",children:[(v.frac*100).toFixed(1),"%"]})]},v.group)),d.length>12&&h.jsxs("text",{x:b,y:246,fill:"var(--text-dim)",fontSize:9,children:["+",d.length-12," more..."]})]})})}function Ch({data:d,maxValue:n,filled:a}){const r=D.useRef(null),[u,c]=D.useState({w:400,h:300});D.useEffect(()=>{if(!r.current)return;const T=new ResizeObserver(Q=>{const{width:Z,height:F}=Q[0].contentRect;c({w:Z,h:F})});return T.observe(r.current),()=>T.disconnect()},[]);const g={top:20,right:20,bottom:60,left:60},m=u.w-g.left-g.right,E=u.h-g.top-g.bottom,y=d.map((T,Q)=>{const Z=g.left+(d.length>1?Q/(d.length-1)*m:m/2),F=g.top+E-(n>0?Math.abs(T.value)/n*E:0);return{x:Z,y:F,...T}}),b=y.map(T=>`${T.x},${T.y}`).join(" "),v=y.length>0?`M ${g.left} ${g.top+E} `+y.map(T=>`L ${T.x} ${T.y}`).join(" ")+` L ${g.left+m} ${g.top+E} Z`:"";return h.jsx("div",{ref:r,style:{flex:1,overflow:"hidden"},children:h.jsxs("svg",{width:u.w,height:u.h,children:[h.jsx("line",{x1:g.left,y1:g.top,x2:g.left,y2:g.top+E,stroke:"var(--border)",strokeWidth:1}),h.jsx("line",{x1:g.left,y1:g.top+E,x2:g.left+m,y2:g.top+E,stroke:"var(--border)",strokeWidth:1}),[0,.25,.5,.75,1].map(T=>{const Q=g.top+E*(1-T);return h.jsxs("g",{children:[h.jsx("line",{x1:g.left-4,y1:Q,x2:g.left+m,y2:Q,stroke:"var(--border)",strokeWidth:.5,strokeDasharray:T>0?"2,4":"0"}),h.jsx("text",{x:g.left-8,y:Q+3,textAnchor:"end",fill:"var(--text-dim)",fontSize:9,children:Ru(Math.round(n*T))})]},T)}),a&&v&&h.jsx("path",{d:v,fill:"var(--cyan)",opacity:.15}),y.length>1&&h.jsx("polyline",{points:b,fill:"none",stroke:"var(--cyan)",strokeWidth:2,opacity:.8}),y.map(T=>h.jsx("circle",{cx:T.x,cy:T.y,r:3.5,fill:"var(--cyan)",opacity:.9},T.group)),y.map((T,Q)=>h.jsx("text",{x:T.x,y:g.top+E+12,textAnchor:"middle",fill:"var(--text-dim)",fontSize:9,transform:`rotate(-35, ${T.x}, ${g.top+E+12})`,children:T.group.length>10?T.group.slice(0,9)+"…":T.group},T.group))]})})}function hp({results:d,config:n,tableName:a,chartType:r="hbar"}){const u=(d==null?void 0:d.results)??[],c=D.useMemo(()=>Math.max(...u.map(m=>Math.abs(m.value)),1),[u]),g=(n==null?void 0:n.aggregation)==="count"?"COUNT":`${((n==null?void 0:n.aggregation)||"count").toUpperCase()} of ${(n==null?void 0:n.valueColumn)||"?"}`;return h.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[h.jsxs("div",{style:{padding:"6px 16px",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)",background:"var(--panel)",flexShrink:0},children:["GROUP BY ",h.jsx("span",{style:{color:"var(--text)"},children:n==null?void 0:n.groupByColumn})," — ",g,h.jsxs("span",{style:{marginLeft:8,opacity:.6},children:[u.length," groups"]})]}),u.length===0?h.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-dim)"},children:"No data"}):r==="hbar"?h.jsx(zh,{data:u,maxValue:c}):r==="vbar"?h.jsx(fp,{data:u,maxValue:c}):r==="pie"?h.jsx(dp,{data:u}):r==="line"?h.jsx(Ch,{data:u,maxValue:c,filled:!1}):r==="area"?h.jsx(Ch,{data:u,maxValue:c,filled:!0}):h.jsx(zh,{data:u,maxValue:c})]})}const Yt="";async function gp(){const d=await fetch(`${Yt}/api/health`);if(!d.ok)throw new Error(`Health check failed: ${d.statusText}`);return d.json()}async function mp(d,n=""){const a=await fetch(`${Yt}/api/pg/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connection_string:d,label:n})});if(!a.ok){const r=await a.json().catch(()=>({detail:a.statusText}));throw new Error(r.detail||a.statusText)}return a.json()}async function Zs(d){const n=await fetch(`${Yt}/api/pg/${encodeURIComponent(d)}/tables`);if(!n.ok)throw new Error(`Failed to fetch tables: ${n.statusText}`);return n.json()}async function pp(d,n,a){const r=await fetch(`${Yt}/api/pg/${encodeURIComponent(d)}/tables/${encodeURIComponent(n)}/${encodeURIComponent(a)}/columns`);if(!r.ok)throw new Error(`Failed to fetch columns: ${r.statusText}`);return r.json()}async function Th(d,{schema:n,table:a,include:r="",exclude:u="",highlight:c="",columns:g="",limit:m=500,offset:E=0,view_mode:y,aggregation:b,agg_column:v,group_by_column:T,value_column:Q}){const Z={schema:n,table:a,include:r,exclude:u,highlight:c,columns:g,limit:m,offset:E};y&&(Z.view_mode=y),b&&(Z.aggregation=b),v&&(Z.agg_column=v),T&&(Z.group_by_column=T),Q&&(Z.value_column=Q);const F=await fetch(`${Yt}/api/pg/${encodeURIComponent(d)}/query`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Z)});if(!F.ok){const ie=await F.json().catch(()=>({detail:F.statusText}));throw new Error(ie.detail||F.statusText)}return F.json()}async function yp({project:d,dataset:n,credentialsPath:a,label:r=""}){const u=await fetch(`${Yt}/api/bigquery/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:d,dataset:n,credentials_path:a||"",label:r})});if(!u.ok){const c=await u.json().catch(()=>({detail:u.statusText}));throw new Error(c.detail||u.statusText)}return u.json()}async function vp(d,n=""){const a=await fetch(`${Yt}/api/redis/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connection_string:d,label:n})});if(!a.ok){const r=await a.json().catch(()=>({detail:a.statusText}));throw new Error(r.detail||a.statusText)}return a.json()}async function xp(d,{pattern:n="*",offset:a=0,limit:r=100}){const u=await fetch(`${Yt}/api/redis/${encodeURIComponent(d)}/keys`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pattern:n,offset:a,limit:r})});if(!u.ok){const c=await u.json().catch(()=>({detail:u.statusText}));throw new Error(c.detail||u.statusText)}return u.json()}async function bp(d,n){const a=await fetch(`${Yt}/api/redis/${encodeURIComponent(d)}/keys/${encodeURIComponent(n)}`);if(!a.ok){const r=await a.json().catch(()=>({detail:a.statusText}));throw new Error(r.detail||a.statusText)}return a.json()}async function Sp({endpointUrl:d,accessKey:n,secretKey:a,region:r,label:u=""}){const c=await fetch(`${Yt}/api/s3/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint_url:d,access_key:n,secret_key:a,region:r||"us-east-1",label:u})});if(!c.ok){const g=await c.json().catch(()=>({detail:c.statusText}));throw new Error(g.detail||c.statusText)}return c.json()}async function Su(d){const n=await fetch(`${Yt}/api/s3/${encodeURIComponent(d)}/buckets`);if(!n.ok)throw new Error(`Failed to fetch buckets: ${n.statusText}`);return n.json()}async function Ep(d,{bucket:n,prefix:a="",continuationToken:r=null,limit:u=100}){const c=await fetch(`${Yt}/api/s3/${encodeURIComponent(d)}/keys`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({bucket:n,prefix:a,continuation_token:r,limit:u})});if(!c.ok){const g=await c.json().catch(()=>({detail:c.statusText}));throw new Error(g.detail||c.statusText)}return c.json()}async function _p(d,n,a){const r=await fetch(`${Yt}/api/s3/${encodeURIComponent(d)}/keys/${encodeURIComponent(n)}/${encodeURIComponent(a)}`);if(!r.ok){const u=await r.json().catch(()=>({detail:r.statusText}));throw new Error(u.detail||r.statusText)}return r.json()}function zp(d,n,a={}){if(!n)return!1;const{caseSensitive:r,wholeWord:u,regex:c}=a;return Object.values(d).some(g=>{if(g==null)return!1;const m=String(g);if(c)try{const E=r?"":"i",y=u?`\\b${n}\\b`:n;return new RegExp(y,E).test(m)}catch{return!1}if(u){const E=r?"":"i";try{return new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,E).test(m)}catch{return!1}}return r?m.includes(n):m.toLowerCase().includes(n.toLowerCase())})}const Rh=d=>({background:"none",border:"1px solid var(--border)",borderRadius:4,padding:"2px 8px",color:d?"var(--text)":"var(--text-dim)",cursor:d?"pointer":"default",fontFamily:"inherit",fontSize:11,opacity:d?1:.4});function wh(d,n){return d==="number"?{view_mode:"number",aggregation:(n==null?void 0:n.aggregation)||"count",agg_column:(n==null?void 0:n.column)||null}:d==="chart"?{view_mode:"chart",aggregation:(n==null?void 0:n.aggregation)||"count",group_by_column:(n==null?void 0:n.groupByColumn)||null,value_column:(n==null?void 0:n.valueColumn)||null}:{}}function Eu(d,n){const a=[];for(const r of d){const u=n.find(c=>c.id===r.parentPanelId);if(u!=null&&u.selectedRow)for(const c of r.mappings){const g=u.selectedRow[c.parentColumn];g!=null&&a.push({column:c.childColumn,value:String(g),parentColumn:c.parentColumn,parentName:u.displayName})}}return a}function Cp(d){return d.map(n=>`${n.column}:=${n.value}`).join(", ")}function jh(d,n){const a=Cp(n);return a?!d||!d.trim()?a:`${d}, ${a}`:d}function Tp({tab:d,updateTab:n,allPanels:a=[],pageSize:r,setError:u,refreshKey:c,locked:g}){var xe,K,te,Se,C,X;const m=D.useRef(null),E=D.useRef(r);E.current=r;const y=D.useRef(c);D.useEffect(()=>{d.columns.length>0||pp(d.instanceId,d.schema,d.name).then(L=>n({columns:L.columns})).catch(L=>u(L.message))},[]),D.useEffect(()=>{d.columns.length===0||d.results||Z(d,0)},[d.columns.length]),D.useEffect(()=>{c!==y.current&&Z(d,d.page)},[c]);const b=D.useRef({viewMode:d.viewMode,viewConfig:d.viewConfig});D.useEffect(()=>{const L=b.current,ne={viewMode:d.viewMode,viewConfig:d.viewConfig};b.current=ne,d.columns.length!==0&&JSON.stringify(L)!==JSON.stringify(ne)&&Z(d,0)},[d.viewMode,d.viewConfig]);const v=Eu(d.links||[],a),T=JSON.stringify(v),Q=D.useRef(T);D.useEffect(()=>{Q.current!==T&&(Q.current=T,d.columns.length!==0&&Z(d,0))},[T]);const Z=D.useCallback((L,ne=0)=>{const _e=E.current,_=L.viewMode||"table",U=Eu(L.links||[],a),w=jh(L.filters.include,U);n({loading:!0}),u(null),Th(L.instanceId,{schema:L.schema,table:L.name,include:w,exclude:L.filters.exclude,highlight:L.filters.highlight,columns:L.filters.columns,limit:_e,offset:ne*_e,...wh(_,L.viewConfig)}).then(V=>n({results:V,loading:!1})).catch(V=>{u(V.message),n({loading:!1})})},[n,u,a]),F=(L,ne)=>{const _e={...d.filters,[L]:ne};n({filters:_e}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{const _=Eu(d.links||[],a),U=jh(L==="include"?ne:d.filters.include,_);n({page:0,loading:!0}),u(null),Th(d.instanceId,{schema:d.schema,table:d.name,include:U,exclude:L==="exclude"?ne:d.filters.exclude,highlight:L==="highlight"?ne:d.filters.highlight,columns:L==="columns"?ne:d.filters.columns,limit:E.current,offset:0,...wh(d.viewMode||"table",d.viewConfig)}).then(w=>n({results:w,loading:!1})).catch(w=>{u(w.message),n({loading:!1})})},300)},ie=L=>{n({page:L}),Z({...d,page:L},L)},he=L=>{const ne=d.selectedRow&&Object.keys(L).every(_e=>d.selectedRow[_e]===L[_e]);n({selectedRow:ne?null:L})},pe=L=>d.selectedRow?Object.keys(L).every(ne=>d.selectedRow[ne]===L[ne]):!1,W=(xe=d.results)==null?void 0:xe.rows,re=W&&W.length>0?Object.keys(W[0]):[],I=(K=d.results)==null?void 0:K.total_count,H=I!=null?Math.ceil(I/r):0,G=d.page>0,le=I!=null&&(d.page+1)*r<I,me=d.page*r+1,Oe=d.page*r+((W==null?void 0:W.length)||0),$=d.viewMode||"table";return h.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[v.length>0&&$==="table"&&h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 20px",background:"rgba(34, 211, 238, 0.04)",borderBottom:"1px solid var(--border)",flexWrap:"wrap",fontSize:11},children:[h.jsx("span",{style:{color:"var(--cyan)",fontWeight:600,fontSize:10,flexShrink:0},children:"LINKED"}),v.map((L,ne)=>h.jsxs("span",{style:{background:"rgba(34, 211, 238, 0.10)",border:"1px solid rgba(34, 211, 238, 0.25)",borderRadius:4,padding:"2px 8px",color:"var(--cyan)",whiteSpace:"nowrap"},children:[L.column," = ",L.value]},ne)),h.jsxs("span",{style:{color:"var(--text-dim)",fontSize:10,marginLeft:4},children:["from ",(te=v[0])==null?void 0:te.parentName]})]}),d.filtersVisible!==!1&&d.columns.length>0&&$==="table"&&h.jsx(rp,{filters:d.filters,onFilterChange:F,columns:d.columns,highlightOptions:d.highlightOptions,onHighlightOptionToggle:L=>n({highlightOptions:{...d.highlightOptions,[L]:!d.highlightOptions[L]}}),onRefresh:()=>Z(d,d.page)}),d.filtersVisible!==!1&&$==="table"&&h.jsx(op,{sql:(Se=d.results)==null?void 0:Se.sql}),$==="number"&&((C=d.results)==null?void 0:C.view_mode)==="number"&&h.jsx(cp,{results:d.results,config:d.viewConfig,tableName:d.displayName}),$==="number"&&!d.results&&h.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-dim)"},children:"Loading..."}),$==="chart"&&((X=d.results)==null?void 0:X.view_mode)==="chart"&&h.jsx(hp,{results:d.results,config:d.viewConfig,tableName:d.displayName,chartType:d.chartType||"hbar"}),$==="chart"&&!d.results&&h.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-dim)"},children:"Loading..."}),$==="table"&&W&&h.jsxs("div",{style:{flex:1,overflow:"auto",position:"relative"},children:[h.jsxs("div",{style:{padding:"8px 20px",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)",background:"var(--panel)",position:"sticky",top:0,zIndex:10,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsx("span",{children:W.length>0?`${me}–${Oe} of ${I??"?"}`:`0 of ${I??"?"}`}),h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[g&&$==="table"&&h.jsxs("button",{onClick:()=>n({filtersVisible:d.filtersVisible===!1}),title:d.filtersVisible!==!1?"Hide filters":"Show filters",style:{background:d.filtersVisible!==!1?"rgba(255,255,255,0.04)":"none",border:"1px solid var(--border)",borderRadius:4,color:d.filtersVisible!==!1?"var(--text)":"var(--text-dim)",fontSize:10,padding:"1px 6px",cursor:"pointer",display:"flex",alignItems:"center",gap:3},onMouseEnter:L=>{L.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:L=>{L.currentTarget.style.borderColor="var(--border)"},children:[h.jsx("span",{style:{fontSize:8},children:d.filtersVisible!==!1?"▾":"▸"}),h.jsx("span",{children:"filters"})]}),H>1&&h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[h.jsx("button",{style:Rh(G),disabled:!G,onClick:()=>G&&ie(d.page-1),children:"Prev"}),h.jsxs("span",{children:[d.page+1," / ",H]}),h.jsx("button",{style:Rh(le),disabled:!le,onClick:()=>le&&ie(d.page+1),children:"Next"})]})]})]}),W.length===0?h.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:"No results"}):h.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[h.jsx("thead",{children:h.jsx("tr",{children:re.map(L=>h.jsx("th",{style:{position:"sticky",top:33,background:"var(--bg)",padding:"8px 12px",textAlign:"left",fontWeight:600,fontSize:11,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-dim)",borderBottom:"1px solid var(--border)",whiteSpace:"nowrap",zIndex:5},children:L},L))})}),h.jsx("tbody",{children:W.map((L,ne)=>{const _e=zp(L,d.filters.highlight,d.highlightOptions),_=pe(L),U=_?"rgba(34, 211, 238, 0.10)":_e?"var(--highlight-row)":ne%2===1?"var(--row-alt)":"transparent",w=_?"var(--cyan)":_e?"var(--yellow)":"transparent";return h.jsx("tr",{onClick:()=>he(L),style:{background:U,borderLeft:`3px solid ${w}`,cursor:"pointer"},onMouseEnter:V=>{!_&&!_e&&(V.currentTarget.style.background="var(--row-hover)")},onMouseLeave:V=>{V.currentTarget.style.background=U},children:re.map(V=>h.jsx("td",{style:{padding:"6px 12px",borderBottom:"1px solid var(--border)",whiteSpace:"nowrap",maxWidth:300,overflow:"hidden",textOverflow:"ellipsis"},children:L[V]===null?h.jsx("span",{style:{color:"var(--text-dim)",fontStyle:"italic"},children:"null"}):String(L[V])},V))},ne)})})]})]})]})}function Rp(d,n){return d==null?"null":n==="hash"&&typeof d=="object"&&!Array.isArray(d)?JSON.stringify(d,null,2):n==="zset"&&Array.isArray(d)?d.map(([a,r])=>`${r}  ${a}`).join(`
`):Array.isArray(d)?d.map((a,r)=>`[${r}] ${typeof a=="object"?JSON.stringify(a):a}`).join(`
`):typeof d=="object"?JSON.stringify(d,null,2):String(d)}function wp(d){return d<1024?`${d} B`:d<1048576?`${(d/1024).toFixed(1)} KB`:d<1073741824?`${(d/1048576).toFixed(1)} MB`:`${(d/1073741824).toFixed(1)} GB`}function jp({detail:d,loading:n,onClose:a}){return!d&&!n?null:h.jsxs("div",{style:{width:420,minWidth:320,borderLeft:"1px solid var(--border)",background:"var(--panel)",display:"flex",flexDirection:"column",overflow:"hidden",flexShrink:0},children:[h.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--cyan)"},children:n?"Loading...":(d==null?void 0:d.key)||"Key Detail"}),h.jsx("button",{onClick:a,style:{background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:14,padding:"0 4px",borderRadius:3},onMouseEnter:r=>{r.target.style.color="var(--red)"},onMouseLeave:r=>{r.target.style.color="var(--text-dim)"},children:"x"})]}),n&&h.jsx("div",{style:{padding:20,color:"var(--text-dim)",fontSize:12},children:"Loading..."}),d&&!n&&h.jsxs("div",{style:{flex:1,overflow:"auto",padding:16},children:[h.jsxs("div",{style:{display:"flex",gap:12,marginBottom:16,flexWrap:"wrap"},children:[h.jsxs("div",{style:{fontSize:11},children:[h.jsx("span",{style:{color:"var(--text-dim)"},children:"Type "}),h.jsx("span",{style:{color:"var(--cyan)",background:"var(--cyan-bg)",padding:"2px 6px",borderRadius:3,fontSize:10,fontWeight:600},children:d.type})]}),d.ttl!==null&&d.ttl!==void 0&&h.jsxs("div",{style:{fontSize:11},children:[h.jsx("span",{style:{color:"var(--text-dim)"},children:"TTL "}),h.jsxs("span",{style:{color:"var(--yellow)"},children:[d.ttl,"s"]})]}),d.size!==null&&d.size!==void 0&&h.jsxs("div",{style:{fontSize:11},children:[h.jsx("span",{style:{color:"var(--text-dim)"},children:"Size "}),h.jsxs("span",{style:{color:"var(--text)"},children:[d.size," bytes"]})]})]}),h.jsx("div",{style:{marginBottom:8},children:h.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--text-dim)"},children:"Value"})}),h.jsx("pre",{style:{background:"var(--bg)",border:"1px solid var(--border)",borderRadius:6,padding:12,margin:0,color:"var(--text)",fontSize:12,lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-all",overflow:"auto",maxHeight:"calc(100vh - 200px)"},children:Rp(d.value,d.type)})]})]})}function Mp({detail:d,loading:n,onClose:a}){return!d&&!n?null:h.jsxs("div",{style:{width:420,minWidth:320,borderLeft:"1px solid var(--border)",background:"var(--panel)",display:"flex",flexDirection:"column",overflow:"hidden",flexShrink:0},children:[h.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--orange)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,marginRight:8},children:n?"Loading...":(d==null?void 0:d.key)||"Object Detail"}),h.jsx("button",{onClick:a,style:{background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:14,padding:"0 4px",borderRadius:3,flexShrink:0},onMouseEnter:r=>{r.target.style.color="var(--red)"},onMouseLeave:r=>{r.target.style.color="var(--text-dim)"},children:"x"})]}),n&&h.jsx("div",{style:{padding:20,color:"var(--text-dim)",fontSize:12},children:"Loading..."}),d&&!n&&h.jsxs("div",{style:{flex:1,overflow:"auto",padding:16},children:[h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginBottom:16},children:[h.jsxs("div",{style:{fontSize:11},children:[h.jsx("span",{style:{color:"var(--text-dim)"},children:"Size "}),h.jsx("span",{style:{color:"var(--text)"},children:wp(d.size)})]}),h.jsxs("div",{style:{fontSize:11},children:[h.jsx("span",{style:{color:"var(--text-dim)"},children:"Type "}),h.jsx("span",{style:{color:"var(--orange)",background:"var(--orange-bg)",padding:"2px 6px",borderRadius:3,fontSize:10,fontWeight:600},children:d.content_type})]}),h.jsxs("div",{style:{fontSize:11},children:[h.jsx("span",{style:{color:"var(--text-dim)"},children:"Modified "}),h.jsx("span",{style:{color:"var(--text)"},children:d.last_modified})]}),h.jsxs("div",{style:{fontSize:11},children:[h.jsx("span",{style:{color:"var(--text-dim)"},children:"ETag "}),h.jsx("span",{style:{color:"var(--text-dim)"},children:d.etag})]}),d.metadata&&Object.keys(d.metadata).length>0&&h.jsxs("div",{style:{fontSize:11},children:[h.jsx("span",{style:{color:"var(--text-dim)"},children:"Metadata "}),h.jsx("span",{style:{color:"var(--text)"},children:JSON.stringify(d.metadata)})]})]}),h.jsx("div",{style:{marginBottom:8},children:h.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--text-dim)"},children:"Content"})}),h.jsx("pre",{style:{background:"var(--bg)",border:"1px solid var(--border)",borderRadius:6,padding:12,margin:0,color:"var(--text)",fontSize:12,lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-all",overflow:"auto",maxHeight:"calc(100vh - 280px)"},children:d.value||"[no preview available]"})]})]})}function Mh(d){return{string:"var(--green)",list:"var(--yellow)",set:"var(--purple)",zset:"var(--cyan)",hash:"#ff9f43",stream:"var(--red)"}[d]||"var(--text-dim)"}const Ah=d=>({background:"none",border:"1px solid var(--border)",borderRadius:4,padding:"2px 8px",color:d?"var(--text)":"var(--text-dim)",cursor:d?"pointer":"default",fontFamily:"inherit",fontSize:11,opacity:d?1:.4});function Ap({tab:d,updateTab:n,pageSize:a,setError:r,refreshKey:u,locked:c}){var le,me,Oe;const[g,m]=D.useState(null),[E,y]=D.useState(null),[b,v]=D.useState(!1),T=D.useRef(null),Q=D.useRef(a);Q.current=a;const Z=D.useRef(u);D.useEffect(()=>{d.results||F(d.filter||"*",0)},[]),D.useEffect(()=>{u!==Z.current&&F(d.filter||"*",d.page*a)},[u]);const F=D.useCallback(($,xe=0)=>{n({loading:!0}),r(null),xp(d.instanceId,{pattern:$||"*",offset:xe,limit:Q.current}).then(K=>{n({results:K,loading:!1})}).catch(K=>{r(K.message),n({loading:!1})})},[n,r]),ie=$=>{n({filter:$}),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{n({page:0}),F($||"*",0)},300)},he=()=>{var xe;if(!((xe=d.results)!=null&&xe.has_more))return;const $=d.page+1;n({page:$}),F(d.filter||"*",$*a)},pe=()=>{if(d.page<=0)return;const $=d.page-1;n({page:$}),F(d.filter||"*",$*a)},W=$=>{if(g===$){m(null),y(null);return}m($),v(!0),y(null),bp(d.instanceId,$).then(xe=>{y(xe),v(!1)}).catch(xe=>{r(xe.message),v(!1)})},re=(le=d.results)==null?void 0:le.rows,I=((me=d.results)==null?void 0:me.total_count)||0,H=((Oe=d.results)==null?void 0:Oe.has_more)||!1,G=re&&re.length>0?Object.keys(re[0]):[];return h.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[h.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[d.filtersVisible!==!1&&h.jsxs("div",{style:{display:"flex",gap:12,padding:"12px 20px",background:"var(--panel)",borderBottom:"1px solid var(--border)",alignItems:"flex-end"},children:[h.jsxs("div",{style:{flex:1},children:[h.jsx("label",{style:{display:"block",fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--green)",marginBottom:4},children:"Filter keys"}),h.jsx("div",{style:{display:"flex",alignItems:"center",background:"var(--green-bg)",border:"1px solid var(--green)33",borderRadius:6},children:h.jsx("input",{type:"text",value:d.filter||"",onChange:$=>ie($.target.value),placeholder:"pattern (e.g. user:*, session:abc*, *config*)",spellCheck:!1,style:{flex:1,background:"transparent",border:"none",padding:"8px 12px",color:"var(--text)",fontFamily:"inherit",fontSize:13,outline:"none"},onFocus:$=>{$.target.closest("div").style.borderColor="var(--green)66"},onBlur:$=>{$.target.closest("div").style.borderColor="var(--green)33"}})}),h.jsx("div",{style:{fontSize:10,color:"var(--text-dim)",marginTop:4},children:"Supports glob patterns: * ? [abc]. Plain text auto-wraps as *text*."})]}),h.jsx(Tu,{onClick:()=>F(d.filter||"*",d.page*a)})]}),re!=null&&h.jsxs("div",{style:{flex:1,overflow:"auto",position:"relative"},children:[h.jsxs("div",{style:{padding:"8px 20px",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)",background:"var(--panel)",position:"sticky",top:0,zIndex:10,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsxs("span",{children:[I," keys",d.filter?` matching "${d.filter}"`:"",I>a?` (showing ${d.page*a+1}–${Math.min((d.page+1)*a,I)})`:""]}),h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c&&h.jsxs("button",{onClick:()=>n({filtersVisible:d.filtersVisible===!1}),title:d.filtersVisible!==!1?"Hide filters":"Show filters",style:{background:d.filtersVisible!==!1?"rgba(255,255,255,0.04)":"none",border:"1px solid var(--border)",borderRadius:4,color:d.filtersVisible!==!1?"var(--text)":"var(--text-dim)",fontSize:10,padding:"1px 6px",cursor:"pointer",display:"flex",alignItems:"center",gap:3},onMouseEnter:$=>{$.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:$=>{$.currentTarget.style.borderColor="var(--border)"},children:[h.jsx("span",{style:{fontSize:8},children:d.filtersVisible!==!1?"▾":"▸"}),h.jsx("span",{children:"filters"})]}),(H||d.page>0)&&h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[h.jsx("button",{style:Ah(d.page>0),disabled:d.page<=0,onClick:pe,children:"Prev"}),h.jsxs("span",{children:["Page ",d.page+1," of ",Math.ceil(I/a)]}),h.jsx("button",{style:Ah(H),disabled:!H,onClick:he,children:"Next"})]})]})]}),re.length===0?h.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:"No keys found"}):h.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[h.jsx("thead",{children:h.jsx("tr",{children:G.map($=>h.jsx("th",{style:{position:"sticky",top:33,background:"var(--bg)",padding:"8px 12px",textAlign:"left",fontWeight:600,fontSize:11,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-dim)",borderBottom:"1px solid var(--border)",whiteSpace:"nowrap",zIndex:5},children:$},$))})}),h.jsx("tbody",{children:re.map(($,xe)=>{const K=g===$.key;return h.jsx("tr",{onClick:()=>W($.key),style:{cursor:"pointer",background:K?"var(--selected-row)":xe%2===1?"var(--row-alt)":"transparent",borderLeft:K?"3px solid var(--purple)":"3px solid transparent"},onMouseEnter:te=>{K||(te.currentTarget.style.background="var(--row-hover)")},onMouseLeave:te=>{te.currentTarget.style.background=K?"var(--selected-row)":xe%2===1?"var(--row-alt)":"transparent"},children:G.map(te=>h.jsx("td",{style:{padding:"6px 12px",borderBottom:"1px solid var(--border)",whiteSpace:"nowrap",maxWidth:500,overflow:"hidden",textOverflow:"ellipsis"},children:te==="type"?h.jsx("span",{style:{color:Mh($[te]),background:Mh($[te])+"15",padding:"1px 6px",borderRadius:3,fontSize:10,fontWeight:600},children:$[te]}):String($[te])},te))},$.key)})})]})]})]}),g&&h.jsx(jp,{detail:E,loading:b,onClose:()=>{m(null),y(null)}})]})}function Dp(d,n,a={}){if(!n)return!0;const{caseSensitive:r,wholeWord:u,regex:c}=a,g=String(d);if(c)try{const m=r?"":"i",E=u?`\\b${n}\\b`:n;return new RegExp(E,m).test(g)}catch{return!1}if(u){const m=r?"":"i";try{return new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,m).test(g)}catch{return!1}}return r?g.includes(n):g.toLowerCase().includes(n.toLowerCase())}function Op(d){return d<1024?`${d} B`:d<1048576?`${(d/1024).toFixed(1)} KB`:d<1073741824?`${(d/1048576).toFixed(1)} MB`:`${(d/1073741824).toFixed(1)} GB`}const Dh=d=>({background:"none",border:"1px solid var(--border)",borderRadius:4,padding:"2px 8px",color:d?"var(--text)":"var(--text-dim)",cursor:d?"pointer":"default",fontFamily:"inherit",fontSize:11,opacity:d?1:.4});function Np({tab:d,updateTab:n,pageSize:a,setError:r,refreshKey:u,locked:c}){var K,te,Se;const[g,m]=D.useState(null),[E,y]=D.useState(null),[b,v]=D.useState(!1),[T,Q]=D.useState(""),[Z,F]=D.useState({caseSensitive:!1,wholeWord:!1,regex:!1}),ie=D.useRef(null),he=D.useRef(a);he.current=a;const pe=D.useRef(u);D.useEffect(()=>{d.results||W(d.filter||"",null)},[]),D.useEffect(()=>{u!==pe.current&&W(d.filter||"",(d.tokens||[null])[d.page])},[u]);const W=D.useCallback((C,X)=>{n({loading:!0}),r(null),Ep(d.instanceId,{bucket:d.bucket,prefix:C,continuationToken:X,limit:he.current}).then(L=>{n({results:L,loading:!1,nextToken:L.next_token})}).catch(L=>{r(L.message),n({loading:!1})})},[d.bucket,n,r]),re=C=>{n({filter:C}),ie.current&&clearTimeout(ie.current),ie.current=setTimeout(()=>{n({page:0,tokens:[null]}),W(C,null)},300)},I=()=>{var L;if(!((L=d.results)!=null&&L.has_more))return;const C=d.page+1,X=[...d.tokens||[null]];X.length<=C&&X.push(d.nextToken),n({page:C,tokens:X}),W(d.filter||"",d.nextToken)},H=()=>{if(d.page<=0)return;const C=d.page-1;n({page:C}),W(d.filter||"",(d.tokens||[null])[C])},G=C=>{if(g===C){m(null),y(null);return}m(C),v(!0),y(null),_p(d.instanceId,d.bucket,C).then(X=>{y(X),v(!1)}).catch(X=>{r(X.message),v(!1)})},le=(K=d.results)==null?void 0:K.rows,me=((te=d.results)==null?void 0:te.total_count)||0,Oe=((Se=d.results)==null?void 0:Se.has_more)||!1,$=le&&le.length>0?Object.keys(le[0]):[],xe=le&&T?le.filter(C=>Object.values(C).some(X=>Dp(X,T,Z))):le;return h.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[h.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[d.filtersVisible!==!1&&h.jsxs("div",{style:{display:"flex",gap:12,padding:"12px 20px",background:"var(--panel)",borderBottom:"1px solid var(--border)",alignItems:"flex-end"},children:[h.jsxs("div",{style:{flex:1,minWidth:200},children:[h.jsx("label",{style:{display:"block",fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--green)",marginBottom:4},children:"Prefix"}),h.jsx("div",{style:{display:"flex",alignItems:"center",background:"var(--green-bg)",border:"1px solid var(--green)33",borderRadius:6},children:h.jsx("input",{type:"text",value:d.filter||"",onChange:C=>re(C.target.value),placeholder:"e.g. logs/, data/2024-, config",spellCheck:!1,style:{flex:1,background:"transparent",border:"none",padding:"8px 12px",color:"var(--text)",fontFamily:"inherit",fontSize:13,outline:"none"},onFocus:C=>{C.target.closest("div").style.borderColor="var(--green)66"},onBlur:C=>{C.target.closest("div").style.borderColor="var(--green)33"}})})]}),h.jsxs("div",{style:{flex:1,minWidth:200},children:[h.jsx("label",{style:{display:"block",fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--yellow)",marginBottom:4},children:"Filter"}),h.jsxs("div",{style:{display:"flex",alignItems:"center",background:"var(--yellow-bg)",border:"1px solid var(--yellow)33",borderRadius:6},children:[h.jsx("input",{type:"text",value:T,onChange:C=>Q(C.target.value),placeholder:"filter returned keys...",spellCheck:!1,style:{flex:1,background:"transparent",border:"none",padding:"8px 12px",color:"var(--text)",fontFamily:"inherit",fontSize:13,outline:"none"},onFocus:C=>{C.target.closest("div").style.borderColor="var(--yellow)66"},onBlur:C=>{C.target.closest("div").style.borderColor="var(--yellow)33"}}),h.jsxs("div",{style:{display:"flex",gap:2,paddingRight:6,flexShrink:0},children:[h.jsx(Sn,{label:"Aa",active:Z.caseSensitive,onClick:()=>F(C=>({...C,caseSensitive:!C.caseSensitive})),color:"var(--yellow)"}),h.jsx(Sn,{label:"ab",active:Z.wholeWord,onClick:()=>F(C=>({...C,wholeWord:!C.wholeWord})),color:"var(--yellow)"}),h.jsx(Sn,{label:".*",active:Z.regex,onClick:()=>F(C=>({...C,regex:!C.regex})),color:"var(--yellow)"})]})]})]}),h.jsx(Tu,{onClick:()=>W(d.filter||"",(d.tokens||[null])[d.page])})]}),le!=null&&h.jsxs("div",{style:{flex:1,overflow:"auto",position:"relative"},children:[h.jsxs("div",{style:{padding:"8px 20px",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)",background:"var(--panel)",position:"sticky",top:0,zIndex:10,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsxs("span",{children:[T?`${xe.length} of ${me} objects`:`${me} objects`,d.filter?` with prefix "${d.filter}"`:""]}),h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c&&h.jsxs("button",{onClick:()=>n({filtersVisible:d.filtersVisible===!1}),title:d.filtersVisible!==!1?"Hide filters":"Show filters",style:{background:d.filtersVisible!==!1?"rgba(255,255,255,0.04)":"none",border:"1px solid var(--border)",borderRadius:4,color:d.filtersVisible!==!1?"var(--text)":"var(--text-dim)",fontSize:10,padding:"1px 6px",cursor:"pointer",display:"flex",alignItems:"center",gap:3},onMouseEnter:C=>{C.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:C=>{C.currentTarget.style.borderColor="var(--border)"},children:[h.jsx("span",{style:{fontSize:8},children:d.filtersVisible!==!1?"▾":"▸"}),h.jsx("span",{children:"filters"})]}),(Oe||d.page>0)&&h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[h.jsx("button",{style:Dh(d.page>0),disabled:d.page<=0,onClick:H,children:"Prev"}),h.jsxs("span",{children:["Page ",d.page+1]}),h.jsx("button",{style:Dh(Oe),disabled:!Oe,onClick:I,children:"Next"})]})]})]}),xe&&xe.length===0?h.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:T?"No matching objects":"No objects found"}):xe&&h.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[h.jsx("thead",{children:h.jsx("tr",{children:$.map(C=>h.jsx("th",{style:{position:"sticky",top:33,background:"var(--bg)",padding:"8px 12px",textAlign:"left",fontWeight:600,fontSize:11,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-dim)",borderBottom:"1px solid var(--border)",whiteSpace:"nowrap",zIndex:5},children:C},C))})}),h.jsx("tbody",{children:xe.map((C,X)=>{const L=g===C.key;return h.jsx("tr",{onClick:()=>G(C.key),style:{cursor:"pointer",background:L?"var(--selected-row)":X%2===1?"var(--row-alt)":"transparent",borderLeft:L?"3px solid var(--purple)":"3px solid transparent"},onMouseEnter:ne=>{L||(ne.currentTarget.style.background="var(--row-hover)")},onMouseLeave:ne=>{ne.currentTarget.style.background=L?"var(--selected-row)":X%2===1?"var(--row-alt)":"transparent"},children:$.map(ne=>h.jsx("td",{style:{padding:"6px 12px",borderBottom:"1px solid var(--border)",whiteSpace:"nowrap",maxWidth:500,overflow:"hidden",textOverflow:"ellipsis"},children:ne==="size"?Op(C[ne]):String(C[ne])},ne))},C.key)})})]})]})]}),g&&h.jsx(Mp,{detail:E,loading:b,onClose:()=>{m(null),y(null)}})]})}var lr=Bh();class O{static getElements(n,a=document){if(typeof n=="string"){const r="getElementById"in a?a:void 0;if(r&&!isNaN(+n[0])){const c=r.getElementById(n);return c?[c]:[]}let u=a.querySelectorAll(n);if(!u.length&&n[0]!=="."&&n[0]!=="#"&&(u=a.querySelectorAll("."+n),u.length||(u=a.querySelectorAll("#"+n)),!u.length)){const c=a.querySelector(`[gs-id="${n}"]`);return c?[c]:[]}return Array.from(u)}return[n]}static getElement(n,a=document){if(typeof n=="string"){const r="getElementById"in a?a:void 0;if(!n.length)return null;if(r&&n[0]==="#")return r.getElementById(n.substring(1));if(n[0]==="#"||n[0]==="."||n[0]==="[")return a.querySelector(n);if(r&&!isNaN(+n[0]))return r.getElementById(n);let u=a.querySelector(n);return r&&!u&&(u=r.getElementById(n)),u||(u=a.querySelector("."+n)),u}return n}static lazyLoad(n){var a,r;return n.lazyLoad||((r=(a=n.grid)==null?void 0:a.opts)==null?void 0:r.lazyLoad)&&n.lazyLoad!==!1}static createDiv(n,a){const r=document.createElement("div");return n.forEach(u=>{u&&r.classList.add(u)}),a==null||a.appendChild(r),r}static shouldSizeToContent(n,a=!1){return(n==null?void 0:n.grid)&&(a?n.sizeToContent===!0||n.grid.opts.sizeToContent===!0&&n.sizeToContent===void 0:!!n.sizeToContent||n.grid.opts.sizeToContent&&n.sizeToContent!==!1)}static isIntercepted(n,a){return!(n.y>=a.y+a.h||n.y+n.h<=a.y||n.x+n.w<=a.x||n.x>=a.x+a.w)}static isTouching(n,a){return O.isIntercepted(n,{x:a.x-.5,y:a.y-.5,w:a.w+1,h:a.h+1})}static areaIntercept(n,a){const r=n.x>a.x?n.x:a.x,u=n.x+n.w<a.x+a.w?n.x+n.w:a.x+a.w;if(u<=r)return 0;const c=n.y>a.y?n.y:a.y,g=n.y+n.h<a.y+a.h?n.y+n.h:a.y+a.h;return g<=c?0:(u-r)*(g-c)}static area(n){return n.w*n.h}static sort(n,a=1){return n.sort((u,c)=>{const g=a*((u.y??1e4)-(c.y??1e4));return g===0?a*((u.x??1e4)-(c.x??1e4)):g})}static find(n,a){return a?n.find(r=>r.id===a):void 0}static toBool(n){return typeof n=="boolean"?n:typeof n=="string"?(n=n.toLowerCase(),!(n===""||n==="no"||n==="false"||n==="0")):!!n}static toNumber(n){return n===null||n.length===0?void 0:Number(n)}static parseHeight(n){let a,r="px";if(typeof n=="string")if(n==="auto"||n==="")a=0;else{const u=n.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!u)throw new Error(`Invalid height val = ${n}`);r=u[2]||"px",a=parseFloat(u[1])}else a=n;return{h:a,unit:r}}static defaults(n,...a){return a.forEach(r=>{for(const u in r){if(!r.hasOwnProperty(u))return;n[u]===null||n[u]===void 0?n[u]=r[u]:typeof r[u]=="object"&&typeof n[u]=="object"&&O.defaults(n[u],r[u])}}),n}static same(n,a){if(typeof n!="object")return n==a;if(typeof n!=typeof a||Object.keys(n).length!==Object.keys(a).length)return!1;for(const r in n)if(n[r]!==a[r])return!1;return!0}static copyPos(n,a,r=!1){return a.x!==void 0&&(n.x=a.x),a.y!==void 0&&(n.y=a.y),a.w!==void 0&&(n.w=a.w),a.h!==void 0&&(n.h=a.h),r&&(a.minW&&(n.minW=a.minW),a.minH&&(n.minH=a.minH),a.maxW&&(n.maxW=a.maxW),a.maxH&&(n.maxH=a.maxH)),n}static samePos(n,a){return n&&a&&n.x===a.x&&n.y===a.y&&(n.w||1)===(a.w||1)&&(n.h||1)===(a.h||1)}static sanitizeMinMax(n){n.minW||delete n.minW,n.minH||delete n.minH,n.maxW||delete n.maxW,n.maxH||delete n.maxH}static removeInternalAndSame(n,a){if(!(typeof n!="object"||typeof a!="object")&&!(Array.isArray(n)||Array.isArray(a)))for(let r in n){const u=n[r],c=a[r];r[0]==="_"||u===c?delete n[r]:u&&typeof u=="object"&&c!==void 0&&(O.removeInternalAndSame(u,c),Object.keys(u).length||delete n[r])}}static removeInternalForSave(n,a=!0){for(let r in n)(r[0]==="_"||n[r]===null||n[r]===void 0)&&delete n[r];delete n.grid,a&&delete n.el,n.autoPosition||delete n.autoPosition,n.noResize||delete n.noResize,n.noMove||delete n.noMove,n.locked||delete n.locked,(n.w===1||n.w===n.minW)&&delete n.w,(n.h===1||n.h===n.minH)&&delete n.h}static throttle(n,a){let r=!1;return(...u)=>{r||(r=!0,setTimeout(()=>{n(...u),r=!1},a))}}static removePositioningStyles(n){const a=n.style;a.position&&a.removeProperty("position"),a.left&&a.removeProperty("left"),a.top&&a.removeProperty("top"),a.width&&a.removeProperty("width"),a.height&&a.removeProperty("height")}static getScrollElement(n){if(!n)return document.scrollingElement||document.documentElement;const a=getComputedStyle(n);return/(auto|scroll)/.test(a.overflow+a.overflowY)?n:O.getScrollElement(n.parentElement)}static updateScrollPosition(n,a,r){const u=O.getScrollElement(n);if(!u)return;const c=n.getBoundingClientRect(),g=u.getBoundingClientRect(),m=window.innerHeight||document.documentElement.clientHeight,E=c.bottom-Math.min(g.bottom,m),y=c.top-Math.max(g.top,0),b=u.scrollTop;y<0&&r<0?n.offsetHeight>g.height?u.scrollTop+=r:u.scrollTop+=Math.abs(y)>Math.abs(r)?r:y:E>0&&r>0&&(n.offsetHeight>g.height?u.scrollTop+=r:u.scrollTop+=E>r?r:E),a.top+=u.scrollTop-b}static updateScrollResize(n,a,r){const u=O.getScrollElement(a),c=u.clientHeight,g=u===O.getScrollElement()?0:u.getBoundingClientRect().top,m=n.clientY-g,E=m<r,y=m>c-r;E?u.scrollBy({behavior:"smooth",top:m-r}):y&&u.scrollBy({behavior:"smooth",top:r-(c-m)})}static clone(n){return n==null||typeof n!="object"?n:n instanceof Array?[...n]:{...n}}static cloneDeep(n){const a=["parentGrid","el","grid","subGrid","engine"],r=O.clone(n);for(const u in r)r.hasOwnProperty(u)&&typeof r[u]=="object"&&u.substring(0,2)!=="__"&&!a.find(c=>c===u)&&(r[u]=O.cloneDeep(n[u]));return r}static cloneNode(n){const a=n.cloneNode(!0);return a.removeAttribute("id"),a}static appendTo(n,a){let r;typeof a=="string"?r=O.getElement(a):r=a,r&&r.appendChild(n)}static addElStyles(n,a){if(a instanceof Object)for(const r in a)a.hasOwnProperty(r)&&(Array.isArray(a[r])?a[r].forEach(u=>{n.style[r]=u}):n.style[r]=a[r])}static initEvent(n,a){const r={type:a.type},u={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:a.target?a.target:n.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(c=>r[c]=n[c]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(c=>r[c]=n[c]),{...r,...u}}static simulateMouseEvent(n,a,r){const u=n,c=new MouseEvent(a,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY,ctrlKey:u.ctrlKey??!1,altKey:u.altKey??!1,shiftKey:u.shiftKey??!1,metaKey:u.metaKey??!1,button:0,relatedTarget:n.target});(r||n.target).dispatchEvent(c)}static getValuesFromTransformedElement(n){const a=document.createElement("div");O.addElStyles(a,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),n.appendChild(a);const r=a.getBoundingClientRect();return n.removeChild(a),a.remove(),{xScale:1/r.width,yScale:1/r.height,xOffset:r.left,yOffset:r.top}}static swap(n,a,r){if(!n)return;const u=n[a];n[a]=n[r],n[r]=u}static canBeRotated(n){var a;return!(!n||n.w===n.h||n.locked||n.noResize||(a=n.grid)!=null&&a.opts.disableResize||n.minW&&n.minW===n.maxW||n.minH&&n.minH===n.maxH)}}class Al{constructor(n={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=n.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=n.maxRow,this._float=n.float,this.nodes=n.nodes||[],this.onChange=n.onChange}batchUpdate(n=!0,a=!0){return!!this.batchMode===n?this:(this.batchMode=n,n?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,a&&this._packNodes(),this._notify()),this)}_useEntireRowArea(n,a){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!n._moving||n._skipDown||a.y<=n.y)}_fixCollisions(n,a=n,r,u={}){if(this.sortNodes(-1),r=r||this.collide(n,a),!r)return!1;if(n._moving&&!u.nested&&!this.float&&this.swap(n,r))return!0;let c=a;!this._loading&&this._useEntireRowArea(n,a)&&(c={x:0,w:this.column,y:a.y,h:a.h},r=this.collide(n,c,u.skip));let g=!1;const m={nested:!0,pack:!1};let E=0;for(;r=r||this.collide(n,c,u.skip);){if(E++>this.nodes.length*2)throw new Error("Infinite collide check");let y;if(r.locked||this._loading||n._moving&&!n._skipDown&&a.y>n.y&&!this.float&&(!this.collide(r,{...r,y:n.y},n)||!this.collide(r,{...r,y:a.y-r.h},n))){n._skipDown=n._skipDown||a.y>n.y;const b={...a,y:r.y+r.h,...m};y=this._loading&&O.samePos(n,b)?!0:this.moveNode(n,b),(r.locked||this._loading)&&y?O.copyPos(a,n):!r.locked&&y&&u.pack&&(this._packNodes(),a.y=r.y+r.h,O.copyPos(n,a)),g=g||y}else y=this.moveNode(r,{...r,y:a.y+a.h,skip:n,...m});if(!y)return g;r=void 0}return g}collide(n,a=n,r){const u=n._id,c=r==null?void 0:r._id;return this.nodes.find(g=>g._id!==u&&g._id!==c&&O.isIntercepted(g,a))}collideAll(n,a=n,r){const u=n._id,c=r==null?void 0:r._id;return this.nodes.filter(g=>g._id!==u&&g._id!==c&&O.isIntercepted(g,a))}directionCollideCoverage(n,a,r){if(!a.rect||!n._rect)return;const u=n._rect,c={...a.rect};c.y>u.y?(c.h+=c.y-u.y,c.y=u.y):c.h+=u.y-c.y,c.x>u.x?(c.w+=c.x-u.x,c.x=u.x):c.w+=u.x-c.x;let g,m=.5;for(let E of r){if(E.locked||!E._rect)break;const y=E._rect;let b=Number.MAX_VALUE,v=Number.MAX_VALUE;u.y<y.y?b=(c.y+c.h-y.y)/y.h:u.y+u.h>y.y+y.h&&(b=(y.y+y.h-c.y)/y.h),u.x<y.x?v=(c.x+c.w-y.x)/y.w:u.x+u.w>y.x+y.w&&(v=(y.x+y.w-c.x)/y.w);const T=Math.min(v,b);T>m&&(m=T,g=E)}return a.collide=g,g}cacheRects(n,a,r,u,c,g){return this.nodes.forEach(m=>m._rect={y:m.y*a+r,x:m.x*n+g,w:m.w*n-g-u,h:m.h*a-r-c}),this}swap(n,a){if(!a||a.locked||!n||n.locked)return!1;function r(){const c=a.x,g=a.y;return a.x=n.x,a.y=n.y,n.h!=a.h?(n.x=c,n.y=a.y+a.h):n.w!=a.w?(n.x=a.x+a.w,n.y=g):(n.x=c,n.y=g),n._dirty=a._dirty=!0,!0}let u;if(n.w===a.w&&n.h===a.h&&(n.x===a.x||n.y===a.y)&&(u=O.isTouching(n,a)))return r();if(u!==!1){if(n.w===a.w&&n.x===a.x&&(u||(u=O.isTouching(n,a)))){if(a.y<n.y){const c=n;n=a,a=c}return r()}if(u!==!1){if(n.h===a.h&&n.y===a.y&&(u||(u=O.isTouching(n,a)))){if(a.x<n.x){const c=n;n=a,a=c}return r()}return!1}}}isAreaEmpty(n,a,r,u){const c={x:n||0,y:a||0,w:r||1,h:u||1};return!this.collide(c)}compact(n="compact",a=!0){if(this.nodes.length===0)return this;a&&this.sortNodes();const r=this.batchMode;r||this.batchUpdate();const u=this._inColumnResize;u||(this._inColumnResize=!0);const c=this.nodes;return this.nodes=[],c.forEach((g,m,E)=>{let y;g.locked||(g.autoPosition=!0,n==="list"&&m&&(y=E[m-1])),this.addNode(g,!1,y)}),u||delete this._inColumnResize,r||this.batchUpdate(!1),this}set float(n){this._float!==n&&(this._float=n||!1,n||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(n=1){return this.nodes=O.sort(this.nodes,n),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(n=>{if(n._updating||n._orig===void 0||n.y===n._orig.y)return;let a=n.y;for(;a>n._orig.y;)--a,this.collide(n,{x:n.x,y:a,w:n.w,h:n.h})||(n._dirty=!0,n.y=a)}):this.nodes.forEach((n,a)=>{if(!n.locked)for(;n.y>0;){const r=a===0?0:n.y-1;if(!(a===0||!this.collide(n,{x:n.x,y:r,w:n.w,h:n.h})))break;n._dirty=n.y!==r,n.y=r}}),this)}prepareNode(n,a){n._id=n._id??Al._idSeq++;const r=n.id;if(r){let c=1;for(;this.nodes.find(g=>g.id===n.id&&g!==n);)n.id=r+"_"+c++}(n.x===void 0||n.y===void 0||n.x===null||n.y===null)&&(n.autoPosition=!0);const u={x:0,y:0,w:1,h:1};return O.defaults(n,u),n.autoPosition||delete n.autoPosition,n.noResize||delete n.noResize,n.noMove||delete n.noMove,O.sanitizeMinMax(n),typeof n.x=="string"&&(n.x=Number(n.x)),typeof n.y=="string"&&(n.y=Number(n.y)),typeof n.w=="string"&&(n.w=Number(n.w)),typeof n.h=="string"&&(n.h=Number(n.h)),isNaN(n.x)&&(n.x=u.x,n.autoPosition=!0),isNaN(n.y)&&(n.y=u.y,n.autoPosition=!0),isNaN(n.w)&&(n.w=u.w),isNaN(n.h)&&(n.h=u.h),this.nodeBoundFix(n,a),n}nodeBoundFix(n,a){const r=n._orig||O.copyPos({},n);if(n.maxW&&(n.w=Math.min(n.w||1,n.maxW)),n.maxH&&(n.h=Math.min(n.h||1,n.maxH)),n.minW&&(n.w=Math.max(n.w||1,n.minW)),n.minH&&(n.h=Math.max(n.h||1,n.minH)),(n.x||0)+(n.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&n._id!=null&&this.findCacheLayout(n,this.defaultColumn)===-1){const c={...n};c.autoPosition||c.x===void 0?(delete c.x,delete c.y):c.x=Math.min(this.defaultColumn-1,c.x),c.w=Math.min(this.defaultColumn,c.w||1),this.cacheOneLayout(c,this.defaultColumn)}return n.w>this.column?n.w=this.column:n.w<1&&(n.w=1),this.maxRow&&n.h>this.maxRow?n.h=this.maxRow:n.h<1&&(n.h=1),n.x<0&&(n.x=0),n.y<0&&(n.y=0),n.x+n.w>this.column&&(a?n.w=this.column-n.x:n.x=this.column-n.w),this.maxRow&&n.y+n.h>this.maxRow&&(a?n.h=this.maxRow-n.y:n.y=this.maxRow-n.h),O.samePos(n,r)||(n._dirty=!0),this}getDirtyNodes(n){return n?this.nodes.filter(a=>a._dirty&&!O.samePos(a,a._orig)):this.nodes.filter(a=>a._dirty)}_notify(n){if(this.batchMode||!this.onChange)return this;const a=(n||[]).concat(this.getDirtyNodes());return this.onChange(a),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(n=>{delete n._dirty,delete n._lastTried}),this)}saveInitial(){return this.nodes.forEach(n=>{n._orig=O.copyPos({},n),delete n._dirty}),this._hasLocked=this.nodes.some(n=>n.locked),this}restoreInitial(){return this.nodes.forEach(n=>{!n._orig||O.samePos(n,n._orig)||(O.copyPos(n,n._orig),n._dirty=!0)}),this._notify(),this}findEmptyPosition(n,a=this.nodes,r=this.column,u){const c=u?u.y*r+(u.x+u.w):0;let g=!1;for(let m=c;!g;++m){const E=m%r,y=Math.floor(m/r);if(E+n.w>r)continue;const b={x:E,y,w:n.w,h:n.h};a.find(v=>O.isIntercepted(b,v))||((n.x!==E||n.y!==y)&&(n._dirty=!0),n.x=E,n.y=y,delete n.autoPosition,g=!0)}return g}addNode(n,a=!1,r){const u=this.nodes.find(g=>g._id===n._id);if(u)return u;this._inColumnResize?this.nodeBoundFix(n):this.prepareNode(n),delete n._temporaryRemoved,delete n._removeDOM;let c;return n.autoPosition&&this.findEmptyPosition(n,this.nodes,this.column,r)&&(delete n.autoPosition,c=!0),this.nodes.push(n),a&&this.addedNodes.push(n),c||this._fixCollisions(n),this.batchMode||this._packNodes()._notify(),n}removeNode(n,a=!0,r=!1){return this.nodes.find(u=>u._id===n._id)?(r&&this.removedNodes.push(n),a&&(n._removeDOM=!0),this.nodes=this.nodes.filter(u=>u._id!==n._id),n._isAboutToRemove||this._packNodes(),this._notify([n]),this):this}removeAll(n=!0,a=!0){if(delete this._layouts,!this.nodes.length)return this;n&&this.nodes.forEach(u=>u._removeDOM=!0);const r=this.nodes;return this.removedNodes=a?r:[],this.nodes=[],this._notify(r)}moveNodeCheck(n,a){if(!this.changedPosConstrain(n,a))return!1;if(a.pack=!0,!this.maxRow)return this.moveNode(n,a);let r;const u=new Al({column:this.column,float:this.float,nodes:this.nodes.map(g=>g._id===n._id?(r={...g},r):{...g})});if(!r)return!1;const c=u.moveNode(r,a)&&u.getRow()<=Math.max(this.getRow(),this.maxRow);if(!c&&!a.resizing&&a.collide){const g=a.collide.el.gridstackNode;if(this.swap(n,g))return this._notify(),!0}return c?(u.nodes.filter(g=>g._dirty).forEach(g=>{const m=this.nodes.find(E=>E._id===g._id);m&&(O.copyPos(m,g),m._dirty=!0)}),this._notify(),!0):!1}willItFit(n){if(delete n._willFitPos,!this.maxRow)return!0;const a=new Al({column:this.column,float:this.float,nodes:this.nodes.map(u=>({...u}))}),r={...n};return this.cleanupNode(r),delete r.el,delete r._id,delete r.content,delete r.grid,a.addNode(r),a.getRow()<=this.maxRow?(n._willFitPos=O.copyPos({},r),!0):!1}changedPosConstrain(n,a){return a.w=a.w||n.w,a.h=a.h||n.h,n.x!==a.x||n.y!==a.y?!0:(n.maxW&&(a.w=Math.min(a.w,n.maxW)),n.maxH&&(a.h=Math.min(a.h,n.maxH)),n.minW&&(a.w=Math.max(a.w,n.minW)),n.minH&&(a.h=Math.max(a.h,n.minH)),n.w!==a.w||n.h!==a.h)}moveNode(n,a){var y,b;if(!n||!a)return!1;let r;a.pack===void 0&&!this.batchMode&&(r=a.pack=!0),typeof a.x!="number"&&(a.x=n.x),typeof a.y!="number"&&(a.y=n.y),typeof a.w!="number"&&(a.w=n.w),typeof a.h!="number"&&(a.h=n.h);const u=n.w!==a.w||n.h!==a.h,c=O.copyPos({},n,!0);if(O.copyPos(c,a),this.nodeBoundFix(c,u),O.copyPos(a,c),!a.forceCollide&&O.samePos(n,a))return!1;const g=O.copyPos({},n),m=this.collideAll(n,c,a.skip);let E=!0;if(m.length){const v=n._moving&&!a.nested;let T=v?this.directionCollideCoverage(n,a,m):m[0];if(v&&T&&((b=(y=n.grid)==null?void 0:y.opts)!=null&&b.subGridDynamic)&&!n.grid._isTemp){const Q=O.areaIntercept(a.rect,T._rect),Z=O.area(a.rect),F=O.area(T._rect);Q/(Z<F?Z:F)>.8&&(T.grid.makeSubGrid(T.el,void 0,n),T=void 0)}T?E=!this._fixCollisions(n,c,T,a):(E=!1,r&&delete a.pack)}return E&&!O.samePos(n,c)&&(n._dirty=!0,O.copyPos(n,c)),a.pack&&this._packNodes()._notify(),!O.samePos(n,g)}getRow(){return this.nodes.reduce((n,a)=>Math.max(n,a.y+a.h),0)}beginUpdate(n){return n._updating||(n._updating=!0,delete n._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const n=this.nodes.find(a=>a._updating);return n&&(delete n._updating,delete n._skipDown),this}save(n=!0,a,r){var m;const u=((m=this._layouts)==null?void 0:m.length)||0;let c;u&&(r?r!==this.column&&(c=this._layouts[r]):this.column!==u-1&&(c=this._layouts[u-1]));const g=[];return this.sortNodes(),this.nodes.forEach(E=>{const y=c==null?void 0:c.find(v=>v._id===E._id),b={...E,...y||{}};O.removeInternalForSave(b,!n),a&&a(E,b),g.push(b)}),g}layoutsNodesChange(n){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((a,r)=>{if(!a||r===this.column)return this;if(r<this.column)this._layouts[r]=void 0;else{const u=r/this.column;n.forEach(c=>{if(!c._orig)return;const g=a.find(m=>m._id===c._id);g&&(g.y>=0&&c.y!==c._orig.y&&(g.y+=c.y-c._orig.y,g.y<0&&(g.y=0)),c.x!==c._orig.x&&(g.x=Math.round(c.x*u),g.x<0&&(g.x=0)),c.w!==c._orig.w&&(g.w=Math.round(c.w*u),g.w<1&&(g.w=1)))})}}),this)}columnChanged(n,a,r="moveScale"){var m;if(!this.nodes.length||!a||n===a)return this;const u=r==="compact"||r==="list";u&&this.sortNodes(1),a<n&&this.cacheLayout(this.nodes,n),this.batchUpdate();let c=[],g=u?this.nodes:O.sort(this.nodes,-1);if(a>n&&this._layouts){const E=this._layouts[a]||[],y=this._layouts.length-1;!E.length&&n!==y&&((m=this._layouts[y])!=null&&m.length)&&(n=y,this._layouts[y].forEach(b=>{const v=g.find(T=>T._id===b._id);v&&(!u&&!b.autoPosition&&(v.x=b.x??v.x,v.y=b.y??v.y),v.w=b.w??v.w,(b.x==null||b.y===void 0)&&(v.autoPosition=!0))})),E.forEach(b=>{const v=g.findIndex(T=>T._id===b._id);if(v!==-1){const T=g[v];if(u){T.w=b.w;return}(b.autoPosition||isNaN(b.x)||isNaN(b.y))&&this.findEmptyPosition(b,c),b.autoPosition||(T.x=b.x??T.x,T.y=b.y??T.y,T.w=b.w??T.w,c.push(T)),g.splice(v,1)}})}if(u)this.compact(r,!1);else{if(g.length)if(typeof r=="function")r(a,n,c,g);else{const E=u||r==="none"?1:a/n,y=r==="move"||r==="moveScale",b=r==="scale"||r==="moveScale";g.forEach(v=>{v.x=a===1?0:y?Math.round(v.x*E):Math.min(v.x,a-1),v.w=a===1||n===1?1:b?Math.round(v.w*E)||1:Math.min(v.w,a),c.push(v)}),g=[]}c=O.sort(c,-1),this._inColumnResize=!0,this.nodes=[],c.forEach(E=>{this.addNode(E,!1),delete E._orig})}return this.nodes.forEach(E=>delete E._orig),this.batchUpdate(!1,!u),delete this._inColumnResize,this}cacheLayout(n,a,r=!1){const u=[];return n.forEach((c,g)=>{if(c._id===void 0){const m=c.id?this.nodes.find(E=>E.id===c.id):void 0;c._id=(m==null?void 0:m._id)??Al._idSeq++}u[g]={x:c.x,y:c.y,w:c.w,_id:c._id}}),this._layouts=r?[]:this._layouts||[],this._layouts[a]=u,this}cacheOneLayout(n,a){n._id=n._id??Al._idSeq++;const r={x:n.x,y:n.y,w:n.w,_id:n._id};(n.autoPosition||n.x===void 0)&&(delete r.x,delete r.y,n.autoPosition&&(r.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[a]=this._layouts[a]||[];const u=this.findCacheLayout(n,a);return u===-1?this._layouts[a].push(r):this._layouts[a][u]=r,this}findCacheLayout(n,a){var r,u;return((u=(r=this._layouts)==null?void 0:r[a])==null?void 0:u.findIndex(c=>c._id===n._id))??-1}removeNodeFromLayoutCache(n){if(this._layouts)for(let a=0;a<this._layouts.length;a++){const r=this.findCacheLayout(n,a);r!==-1&&this._layouts[a].splice(r,1)}}cleanupNode(n){for(const a in n)a[0]==="_"&&a!=="_id"&&delete n[a];return this}}Al._idSeq=0;const qt={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};class ve{}const nl=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class Gt{}function $s(d,n){d.touches.length>1||(d.cancelable&&d.preventDefault(),O.simulateMouseEvent(d.changedTouches[0],n))}function qh(d,n){d.cancelable&&d.preventDefault(),O.simulateMouseEvent(d,n)}function Fs(d){Gt.touchHandled||(Gt.touchHandled=!0,$s(d,"mousedown"))}function Is(d){Gt.touchHandled&&$s(d,"mousemove")}function Ps(d){if(!Gt.touchHandled)return;Gt.pointerLeaveTimeout&&(window.clearTimeout(Gt.pointerLeaveTimeout),delete Gt.pointerLeaveTimeout);const n=!!ve.dragElement;$s(d,"mouseup"),n||$s(d,"click"),Gt.touchHandled=!1}function er(d){d.pointerType!=="mouse"&&d.target.releasePointerCapture(d.pointerId)}function Oh(d){ve.dragElement&&d.pointerType!=="mouse"&&qh(d,"mouseenter")}function Nh(d){ve.dragElement&&d.pointerType!=="mouse"&&(Gt.pointerLeaveTimeout=window.setTimeout(()=>{delete Gt.pointerLeaveTimeout,qh(d,"mouseleave")},10))}class ir{constructor(n,a,r){this.host=n,this.dir=a,this.option=r,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(n){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",n)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${ir.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),nl&&(this.el.addEventListener("touchstart",Fs),this.el.addEventListener("pointerdown",er)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),nl&&(this.el.removeEventListener("touchstart",Fs),this.el.removeEventListener("pointerdown",er)),this.option.element||this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(n){this.mouseDownEvent=n,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),nl&&(this.el.addEventListener("touchmove",Is),this.el.addEventListener("touchend",Ps)),n.stopPropagation(),n.preventDefault()}_mouseMove(n){const a=this.mouseDownEvent;this.moving?this._triggerEvent("move",n):Math.abs(n.x-a.x)+Math.abs(n.y-a.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",n),document.addEventListener("keydown",this._keyEvent)),n.stopPropagation()}_mouseUp(n){this.moving&&(this._triggerEvent("stop",n),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),nl&&(this.el.removeEventListener("touchmove",Is),this.el.removeEventListener("touchend",Ps)),delete this.moving,delete this.mouseDownEvent,n.stopPropagation(),n.preventDefault()}_keyEvent(n){var a,r;n.key==="Escape"&&((r=(a=this.host.gridstackNode)==null?void 0:a.grid)==null||r.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(n,a){return this.option[n]&&this.option[n](a),this}}ir.prefix="ui-resizable-";class wu{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(n,a){this._eventRegister[n]=a}off(n){delete this._eventRegister[n]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(n,a){if(!this.disabled&&this._eventRegister&&this._eventRegister[n])return this._eventRegister[n](a)}}class Ea extends wu{constructor(n,a={}){super(),this.el=n,this.option=a,this.rectScale={x:1,y:1},this._ui=()=>{const u=this.el.parentElement.getBoundingClientRect(),c={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},g=this.temporalRect||c;return{position:{left:(g.left-u.left)*this.rectScale.x,top:(g.top-u.top)*this.rectScale.y},size:{width:g.width*this.rectScale.x,height:g.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(n,a){super.on(n,a)}off(n){super.off(n)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(n){const a=n.handles&&n.handles!==this.option.handles,r=n.autoHide&&n.autoHide!==this.option.autoHide;return Object.keys(n).forEach(u=>this.option[u]=n[u]),a&&(this._removeHandlers(),this._setupHandlers()),r&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(n){return n?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),ve.overResizeElement===this&&delete ve.overResizeElement),this}_mouseOver(n){ve.overResizeElement||ve.dragElement||(ve.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(n){ve.overResizeElement===this&&(delete ve.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(n=>n.trim()).map(n=>new ir(this.el,n,{element:this.option.element,start:a=>this._resizeStart(a),stop:a=>this._resizeStop(a),move:a=>this._resizing(a,n)})),this}_resizeStart(n){this.sizeToContent=O.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=O.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=n,this._setupHelper(),this._applyChange();const a=O.initEvent(n,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(a,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",a),this}_resizing(n,a){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(n,a),this._applyChange();const r=O.initEvent(n,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(r,this._ui()),this.triggerEvent("resize",r),this}_resizeStop(n){const a=O.initEvent(n,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(a),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",a),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=Ea._originStyleProp.map(r=>this.el.style[r]),this.parentOriginStylePosition=this.el.parentElement.style.position;const n=this.el.parentElement,a=O.getValuesFromTransformedElement(n);return this.rectScale={x:a.xScale,y:a.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return Ea._originStyleProp.forEach((n,a)=>{this.el.style[n]=this.elOriginStyleVal[a]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(n,a){const r=this.startEvent,u={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},c=n.clientX-r.clientX,g=this.sizeToContent?0:n.clientY-r.clientY;let m,E;a.indexOf("e")>-1?u.width+=c:a.indexOf("w")>-1&&(u.width-=c,u.left+=c,m=!0),a.indexOf("s")>-1?u.height+=g:a.indexOf("n")>-1&&(u.height-=g,u.top+=g,E=!0);const y=this._constrainSize(u.width,u.height,m,E);return Math.round(u.width)!==Math.round(y.width)&&(a.indexOf("w")>-1&&(u.left+=u.width-y.width),u.width=y.width),Math.round(u.height)!==Math.round(y.height)&&(a.indexOf("n")>-1&&(u.top+=u.height-y.height),u.height=y.height),u}_constrainSize(n,a,r,u){const c=this.option,g=(r?c.maxWidthMoveLeft:c.maxWidth)||Number.MAX_SAFE_INTEGER,m=c.minWidth/this.rectScale.x||n,E=(u?c.maxHeightMoveUp:c.maxHeight)||Number.MAX_SAFE_INTEGER,y=c.minHeight/this.rectScale.y||a,b=Math.min(g,Math.max(m,n)),v=Math.min(E,Math.max(y,a));return{width:b,height:v}}_applyChange(){let n={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const a=this.el.parentElement,{left:r,top:u}=a.getBoundingClientRect();n={left:r,top:u,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(a=>{const r=this.temporalRect[a],u=a==="width"||a==="left"?this.rectScale.x:a==="height"||a==="top"?this.rectScale.y:1;this.el.style[a]=(r-n[a])*u+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(n=>n.destroy()),delete this.handlers,this}}Ea._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const Hp='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class _a extends wu{constructor(n,a={}){var c;super(),this.el=n,this.option=a,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const r=(c=a==null?void 0:a.handle)==null?void 0:c.substring(1),u=n.gridstackNode;this.dragEls=!r||n.classList.contains(r)?[n]:u!=null&&u.subGrid?[n.querySelector(a.handle)||n]:Array.from(n.querySelectorAll(a.handle)),this.dragEls.length===0&&(this.dragEls=[n]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(n,a){super.on(n,a)}off(n){super.off(n)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(n=>{n.addEventListener("mousedown",this._mouseDown),nl&&(n.addEventListener("touchstart",Fs),n.addEventListener("pointerdown",er))}),this.el.classList.remove("ui-draggable-disabled"))}disable(n=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(a=>{a.removeEventListener("mousedown",this._mouseDown),nl&&(a.removeEventListener("touchstart",Fs),a.removeEventListener("pointerdown",er))}),n||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(n){return Object.keys(n).forEach(a=>this.option[a]=n[a]),this}_mouseDown(n){if(Gt.touchHandled&&n.isTrusted&&(Gt.touchHandled=!1),!ve.mouseHandled)return n.button!==0||!this.dragEls.find(a=>a===n.target)&&n.target.closest(Hp)||this.option.cancel&&n.target.closest(this.option.cancel)||(this.mouseDownEvent=n,delete this.dragging,delete ve.dragElement,delete ve.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),nl&&(n.currentTarget.addEventListener("touchmove",Is),n.currentTarget.addEventListener("touchend",Ps)),n.preventDefault(),document.activeElement&&document.activeElement.blur(),ve.mouseHandled=!0),!0}_callDrag(n){if(!this.dragging)return;const a=O.initEvent(n,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(a,this.ui()),this.triggerEvent("drag",a)}_mouseMove(n){var r;const a=this.mouseDownEvent;if(this.lastDrag=n,this.dragging)if(this._dragFollow(n),ve.pauseDrag){const u=Number.isInteger(ve.pauseDrag)?ve.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(n),u)}else this._callDrag(n);else if(Math.abs(n.x-a.x)+Math.abs(n.y-a.y)>3){this.dragging=!0,ve.dragElement=this;const u=(r=this.el.gridstackNode)==null?void 0:r.grid;u?ve.dropElement=u.el.ddElement.ddDroppable:delete ve.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=O.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(n,this.el,this.helperContainment),this._setupHelperStyle(n);const c=O.initEvent(n,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(c,this.ui()),this.triggerEvent("dragstart",c),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(n){var a,r;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),nl&&n.currentTarget&&(n.currentTarget.removeEventListener("touchmove",Is,!0),n.currentTarget.removeEventListener("touchend",Ps,!0)),this.dragging){delete this.dragging,(a=this.el.gridstackNode)==null||delete a._origRotate,document.removeEventListener("keydown",this._keyEvent),((r=ve.dropElement)==null?void 0:r.el)===this.el.parentElement&&delete ve.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const u=O.initEvent(n,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(u),this.triggerEvent("dragstop",u),ve.dropElement&&ve.dropElement.drop(n)}delete this.helper,delete this.mouseDownEvent,delete ve.dragElement,delete ve.dropElement,delete ve.mouseHandled,n.preventDefault()}_keyEvent(n){var u,c;const a=this.el.gridstackNode,r=(a==null?void 0:a.grid)||((c=(u=ve.dropElement)==null?void 0:u.el)==null?void 0:c.gridstack);if(n.key==="Escape")a&&a._origRotate&&(a._orig=a._origRotate,delete a._origRotate),r==null||r.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(a&&r&&(n.key==="r"||n.key==="R")){if(!O.canBeRotated(a))return;a._origRotate=a._origRotate||{...a._orig},delete a._moving,r.setAnimation(!1).rotate(a.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),a._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,a.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",O.swap(a._orig,"w","h"),delete a._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let n=this.el;return typeof this.option.helper=="function"?n=this.option.helper(this.el):this.option.helper==="clone"&&(n=O.cloneNode(this.el)),n.parentElement||O.appendTo(n,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=_a.originStyleProp.map(a=>this.el.style[a]),n}_setupHelperStyle(n){var r,u;this.helper.classList.add("ui-draggable-dragging"),(u=(r=this.el.gridstackNode)==null?void 0:r.grid)==null||u.el.classList.add("grid-stack-dragging");const a=this.helper.style;return a.pointerEvents="none",a.width=this.dragOffset.width+"px",a.height=this.dragOffset.height+"px",a.willChange="left, top",a.position="fixed",this._dragFollow(n),a.transition="none",setTimeout(()=>{this.helper&&(a.transition=null)},0),this}_removeHelperStyle(){var a,r,u;this.helper.classList.remove("ui-draggable-dragging"),(r=(a=this.el.gridstackNode)==null?void 0:a.grid)==null||r.el.classList.remove("grid-stack-dragging");const n=(u=this.helper)==null?void 0:u.gridstackNode;if(!(n!=null&&n._isAboutToRemove)&&this.dragElementOriginStyle){const c=this.helper,g=this.dragElementOriginStyle.transition||null;c.style.transition=this.dragElementOriginStyle.transition="none",_a.originStyleProp.forEach(m=>c.style[m]=this.dragElementOriginStyle[m]||null),setTimeout(()=>c.style.transition=g,50)}return delete this.dragElementOriginStyle,this}_dragFollow(n){const a={left:0,top:0},r=this.helper.style,u=this.dragOffset;r.left=(n.clientX+u.offsetLeft-a.left)*this.dragTransform.xScale+"px",r.top=(n.clientY+u.offsetTop-a.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(n,a,r){let u=0,c=0;r&&(u=this.dragTransform.xOffset,c=this.dragTransform.yOffset);const g=a.getBoundingClientRect();return{left:g.left,top:g.top,offsetLeft:-n.clientX+g.left-u,offsetTop:-n.clientY+g.top-c,width:g.width*this.dragTransform.xScale,height:g.height*this.dragTransform.yScale}}ui(){const a=this.el.parentElement.getBoundingClientRect(),r=this.helper.getBoundingClientRect();return{position:{top:(r.top-a.top)*this.dragTransform.yScale,left:(r.left-a.left)*this.dragTransform.xScale}}}}_a.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class kp extends wu{constructor(n,a={}){super(),this.el=n,this.option=a,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(n,a){super.on(n,a)}off(n){super.off(n)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),nl&&(this.el.addEventListener("pointerenter",Oh),this.el.addEventListener("pointerleave",Nh)))}disable(n=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),n||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),nl&&(this.el.removeEventListener("pointerenter",Oh),this.el.removeEventListener("pointerleave",Nh)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(n){return Object.keys(n).forEach(a=>this.option[a]=n[a]),this._setupAccept(),this}_mouseEnter(n){if(!ve.dragElement||Gt.touchHandled&&n.isTrusted||!this._canDrop(ve.dragElement.el))return;n.preventDefault(),n.stopPropagation(),ve.dropElement&&ve.dropElement!==this&&ve.dropElement._mouseLeave(n,!0),ve.dropElement=this;const a=O.initEvent(n,{target:this.el,type:"dropover"});this.option.over&&this.option.over(a,this._ui(ve.dragElement)),this.triggerEvent("dropover",a),this.el.classList.add("ui-droppable-over")}_mouseLeave(n,a=!1){var u;if(!ve.dragElement||ve.dropElement!==this)return;n.preventDefault(),n.stopPropagation();const r=O.initEvent(n,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(r,this._ui(ve.dragElement)),this.triggerEvent("dropout",r),ve.dropElement===this&&(delete ve.dropElement,!a)){let c,g=this.el.parentElement;for(;!c&&g;)c=(u=g.ddElement)==null?void 0:u.ddDroppable,g=g.parentElement;c&&c._mouseEnter(n)}}drop(n){n.preventDefault();const a=O.initEvent(n,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(a,this._ui(ve.dragElement)),this.triggerEvent("drop",a)}_canDrop(n){return n&&(!this.accept||this.accept(n))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=n=>n.classList.contains(this.option.accept)||n.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(n){return{draggable:n.el,...n.ui()}}}class ju{static init(n){return n.ddElement||(n.ddElement=new ju(n)),n.ddElement}constructor(n){this.el=n}on(n,a){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(n)>-1?this.ddDraggable.on(n,a):this.ddDroppable&&["drop","dropover","dropout"].indexOf(n)>-1?this.ddDroppable.on(n,a):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(n)>-1&&this.ddResizable.on(n,a),this}off(n){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(n)>-1?this.ddDraggable.off(n):this.ddDroppable&&["drop","dropover","dropout"].indexOf(n)>-1?this.ddDroppable.off(n):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(n)>-1&&this.ddResizable.off(n),this}setupDraggable(n){return this.ddDraggable?this.ddDraggable.updateOption(n):this.ddDraggable=new _a(this.el,n),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(n){return this.ddResizable?this.ddResizable.updateOption(n):this.ddResizable=new Ea(this.el,n),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(n){return this.ddDroppable?this.ddDroppable.updateOption(n):this.ddDroppable=new kp(this.el,n),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class Lp{resizable(n,a,r,u){return this._getDDElements(n,a).forEach(c=>{if(a==="disable"||a==="enable")c.ddResizable&&c.ddResizable[a]();else if(a==="destroy")c.ddResizable&&c.cleanResizable();else if(a==="option")c.setupResizable({[r]:u});else{const m=c.el.gridstackNode.grid;let E=c.el.getAttribute("gs-resize-handles")||m.opts.resizable.handles||"e,s,se";E==="all"&&(E="n,e,s,w,se,sw,ne,nw");const y=!m.opts.alwaysShowResizeHandle;c.setupResizable({...m.opts.resizable,handles:E,autoHide:y,start:a.start,stop:a.stop,resize:a.resize})}}),this}draggable(n,a,r,u){return this._getDDElements(n,a).forEach(c=>{if(a==="disable"||a==="enable")c.ddDraggable&&c.ddDraggable[a]();else if(a==="destroy")c.ddDraggable&&c.cleanDraggable();else if(a==="option")c.setupDraggable({[r]:u});else{const g=c.el.gridstackNode.grid;c.setupDraggable({...g.opts.draggable,start:a.start,stop:a.stop,drag:a.drag})}}),this}dragIn(n,a){return this._getDDElements(n).forEach(r=>r.setupDraggable(a)),this}droppable(n,a,r,u){return typeof a.accept=="function"&&!a._accept&&(a._accept=a.accept,a.accept=c=>a._accept(c)),this._getDDElements(n,a).forEach(c=>{a==="disable"||a==="enable"?c.ddDroppable&&c.ddDroppable[a]():a==="destroy"?c.ddDroppable&&c.cleanDroppable():a==="option"?c.setupDroppable({[r]:u}):c.setupDroppable(a)}),this}isDroppable(n){var a;return!!((a=n==null?void 0:n.ddElement)!=null&&a.ddDroppable&&!n.ddElement.ddDroppable.disabled)}isDraggable(n){var a;return!!((a=n==null?void 0:n.ddElement)!=null&&a.ddDraggable&&!n.ddElement.ddDraggable.disabled)}isResizable(n){var a;return!!((a=n==null?void 0:n.ddElement)!=null&&a.ddResizable&&!n.ddElement.ddResizable.disabled)}on(n,a,r){return this._getDDElements(n).forEach(u=>u.on(a,c=>{r(c,ve.dragElement?ve.dragElement.el:c.target,ve.dragElement?ve.dragElement.helper:null)})),this}off(n,a){return this._getDDElements(n).forEach(r=>r.off(a)),this}_getDDElements(n,a){const r=n.gridstack||a!=="destroy"&&a!=="disable",u=O.getElements(n);return u.length?u.map(g=>g.ddElement||(r?ju.init(g):null)).filter(g=>g):[]}}/*!
 * GridStack 12.4.2
 * https://gridstackjs.com/
 *
 * Copyright (c) 2021-2025  Alain Dumesny
 * see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
 */const zt=new Lp;class fe{static init(n={},a=".grid-stack"){if(typeof document>"u")return null;const r=fe.getGridElement(a);return r?(r.gridstack||(r.gridstack=new fe(r,O.cloneDeep(n))),r.gridstack):(console.error(typeof a=="string"?'GridStack.initAll() no grid was found with selector "'+a+`" - element missing or wrong selector ?
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(n={},a=".grid-stack"){const r=[];return typeof document>"u"||(fe.getGridElements(a).forEach(u=>{u.gridstack||(u.gridstack=new fe(u,O.cloneDeep(n))),r.push(u.gridstack)}),r.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+a+`" - element missing or wrong selector ?
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),r}static addGrid(n,a={}){if(!n)return null;let r=n;if(r.gridstack){const g=r.gridstack;return a&&(g.opts={...g.opts,...a}),a.children!==void 0&&g.load(a.children),g}return(!n.classList.contains("grid-stack")||fe.addRemoveCB)&&(fe.addRemoveCB?r=fe.addRemoveCB(n,a,!0,!0):r=O.createDiv(["grid-stack",a.class],n)),fe.init(a,r)}static registerEngine(n){fe.engineClass=n}get placeholder(){if(!this._placeholder){this._placeholder=O.createDiv([this.opts.placeholderClass,qt.itemClass,this.opts.itemClass]);const n=O.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(n.textContent=this.opts.placeholderText)}return this._placeholder}constructor(n,a={}){var y;this.el=n,this.opts=a,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},n.gridstack=this,this.opts=a=a||{},n.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),a.row&&(a.minRow=a.maxRow=a.row,delete a.row);const r=O.toNumber(n.getAttribute("gs-row"));a.column==="auto"&&delete a.column,a.alwaysShowResizeHandle!==void 0&&(a._alwaysShowResizeHandle=a.alwaysShowResizeHandle);const u=a.columnOpts;if(u){const b=u.breakpoints;!u.columnWidth&&!(b!=null&&b.length)?delete a.columnOpts:(u.columnMax=u.columnMax||12,(b==null?void 0:b.length)>1&&b.sort((v,T)=>(T.w||0)-(v.w||0)))}const c={...O.cloneDeep(qt),column:O.toNumber(n.getAttribute("gs-column"))||qt.column,minRow:r||O.toNumber(n.getAttribute("gs-min-row"))||qt.minRow,maxRow:r||O.toNumber(n.getAttribute("gs-max-row"))||qt.maxRow,staticGrid:O.toBool(n.getAttribute("gs-static"))||qt.staticGrid,sizeToContent:O.toBool(n.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(a.handleClass?"."+a.handleClass:a.handle?a.handle:"")||qt.draggable.handle},removableOptions:{accept:a.itemClass||qt.removableOptions.accept,decline:qt.removableOptions.decline}};n.getAttribute("gs-animate")&&(c.animate=O.toBool(n.getAttribute("gs-animate"))),a=O.defaults(a,c),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(a),a.rtl==="auto"&&(a.rtl=n.style.direction==="rtl"),a.rtl&&this.el.classList.add("grid-stack-rtl");const g=this.el.closest("."+qt.itemClass),m=g==null?void 0:g.gridstackNode;if(m&&(m.subGrid=this,this.parentGridNode=m,this.el.classList.add("grid-stack-nested"),m.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=a.cellHeight==="auto",this._isAutoCellHeight||a.cellHeight==="initial")this.cellHeight(void 0);else{typeof a.cellHeight=="number"&&a.cellHeightUnit&&a.cellHeightUnit!==qt.cellHeightUnit&&(a.cellHeight=a.cellHeight+a.cellHeightUnit,delete a.cellHeightUnit);const b=a.cellHeight;delete a.cellHeight,this.cellHeight(b)}a.alwaysShowResizeHandle==="mobile"&&(a.alwaysShowResizeHandle=nl),this._setStaticClass();const E=a.engineClass||fe.engineClass||Al;if(this.engine=new E({column:this.getColumn(),float:a.float,maxRow:a.maxRow,onChange:b=>{b.forEach(v=>{const T=v.el;T&&(v._removeDOM?(T&&T.remove(),delete v._removeDOM):this._writePosAttr(T,v))}),this._updateContainerHeight()}}),a.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(b=>this._prepareElement(b)),delete this.engine._loading,this.batchUpdate(!1)),a.children){const b=a.children;delete a.children,b.length&&this.load(b)}this.setAnimation(),a.subGridDynamic&&!ve.pauseDrag&&(ve.pauseDrag=!0),((y=a.draggable)==null?void 0:y.pause)!==void 0&&(ve.pauseDrag=a.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(n=this.opts){this.el.classList.add("gs-"+n.column),typeof n.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/n.column}%`)}addWidget(n){if(!n)return;if(typeof n=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(n.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(n);let a,r=n;if(r.grid=this,r.el?a=r.el:fe.addRemoveCB?a=fe.addRemoveCB(this.el,n,!0,!1):a=this.createWidgetDivs(r),!a)return;if(r=a.gridstackNode,r&&a.parentElement===this.el&&this.engine.nodes.find(c=>c._id===r._id))return a;const u=this._readAttr(a);return O.defaults(n,u),this.engine.prepareNode(n),this.el.appendChild(a),this.makeWidget(a,n),a}createWidgetDivs(n){const a=O.createDiv(["grid-stack-item",this.opts.itemClass]),r=O.createDiv(["grid-stack-item-content"],a);return O.lazyLoad(n)?n.visibleObservable||(n.visibleObservable=new IntersectionObserver(([u])=>{var c,g;u.isIntersecting&&((c=n.visibleObservable)==null||c.disconnect(),delete n.visibleObservable,fe.renderCB(r,n),(g=n.grid)==null||g.prepareDragDrop(n.el))}),window.setTimeout(()=>{var u;return(u=n.visibleObservable)==null?void 0:u.observe(a)})):fe.renderCB(r,n),a}makeSubGrid(n,a,r,u=!0){var Q,Z,F;let c=n.gridstackNode;if(c||(c=this.makeWidget(n).gridstackNode),(Q=c.subGrid)!=null&&Q.el)return c.subGrid;let g,m=this;for(;m&&!g;)g=(Z=m.opts)==null?void 0:Z.subGridOpts,m=(F=m.parentGridNode)==null?void 0:F.grid;a=O.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...g||{},...a||c.subGridOpts||{}}),c.subGridOpts=a;let E;a.column==="auto"&&(E=!0,a.column=Math.max(c.w||1,(r==null?void 0:r.w)||1),delete a.columnOpts);let y=c.el.querySelector(".grid-stack-item-content"),b,v;if(u&&(this._removeDD(c.el),v={...c,x:0,y:0},O.removeInternalForSave(v),delete v.subGridOpts,c.content&&(v.content=c.content,delete c.content),fe.addRemoveCB?b=fe.addRemoveCB(this.el,v,!0,!1):(b=O.createDiv(["grid-stack-item"]),b.appendChild(y),y=O.createDiv(["grid-stack-item-content"],c.el)),this.prepareDragDrop(c.el)),r){const ie=E?a.column:c.w,he=c.h+r.h,pe=c.el.style;pe.transition="none",this.update(c.el,{w:ie,h:he}),setTimeout(()=>pe.transition=null)}const T=c.subGrid=fe.addGrid(y,a);return r!=null&&r._moving&&(T._isTemp=!0),E&&(T._autoColumn=!0),u&&T.makeWidget(b,v),r&&(r._moving?window.setTimeout(()=>O.simulateMouseEvent(r._event,"mouseenter",T.el),0):T.makeWidget(c.el,c)),this.resizeToContentCheck(!1,c),T}removeAsSubGrid(n){var r;const a=(r=this.parentGridNode)==null?void 0:r.grid;a&&(a.batchUpdate(),a.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(u=>{u.x+=this.parentGridNode.x,u.y+=this.parentGridNode.y,a.makeWidget(u.el,u)}),a.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,n&&window.setTimeout(()=>O.simulateMouseEvent(n._event,"mouseenter",a.el),0))}save(n=!0,a=!1,r=fe.saveCB,u){const c=this.engine.save(n,r,u);if(c.forEach(g=>{var m;if(n&&g.el&&!g.subGrid&&!r){const E=g.el.querySelector(".grid-stack-item-content");g.content=E==null?void 0:E.innerHTML,g.content||delete g.content}else if(!n&&!r&&delete g.content,(m=g.subGrid)!=null&&m.el){const E=g.w||g.subGrid.getColumn(),y=g.subGrid.save(n,a,r,E);g.subGridOpts=a?y:{children:y},delete g.subGrid}delete g.el}),a){const g=O.cloneDeep(this.opts);g.marginBottom===g.marginTop&&g.marginRight===g.marginLeft&&g.marginTop===g.marginRight&&(g.margin=g.marginTop,delete g.marginTop,delete g.marginRight,delete g.marginBottom,delete g.marginLeft),g.rtl===(this.el.style.direction==="rtl")&&(g.rtl="auto"),this._isAutoCellHeight&&(g.cellHeight="auto"),this._autoColumn&&(g.column="auto");const m=g._alwaysShowResizeHandle;return delete g._alwaysShowResizeHandle,m!==void 0?g.alwaysShowResizeHandle=m:delete g.alwaysShowResizeHandle,O.removeInternalAndSame(g,qt),g.children=c,g}return c}load(n,a=fe.addRemoveCB||!0){n=O.cloneDeep(n);const r=this.getColumn();n.forEach(b=>{b.w=b.w||b.minW||1,b.h=b.h||b.minH||1}),n=O.sort(n),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let u=0;n.forEach(b=>{u=Math.max(u,(b.x||0)+b.w)}),u>this.engine.defaultColumn&&(this.engine.defaultColumn=u),u>r&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=n,this.engine.columnChanged(u,r,this.responseLayout),n=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(n,u,!0));const c=fe.addRemoveCB;typeof a=="function"&&(fe.addRemoveCB=a);const g=[];this.batchUpdate();const m=!this.engine.nodes.length,E=m&&this.opts.animate;E&&this.setAnimation(!1),!m&&a&&[...this.engine.nodes].forEach(v=>{if(!v.id)return;O.find(n,v.id)||(fe.addRemoveCB&&fe.addRemoveCB(this.el,v,!1,!1),g.push(v),this.removeWidget(v.el,!0,!1))}),this.engine._loading=!0;const y=[];return this.engine.nodes=this.engine.nodes.filter(b=>O.find(n,b.id)?(y.push(b),!1):!0),n.forEach(b=>{var T;const v=O.find(y,b.id);if(v){if(O.shouldSizeToContent(v)&&(b.h=v.h),this.engine.nodeBoundFix(b),(b.autoPosition||b.x===void 0||b.y===void 0)&&(b.w=b.w||v.w,b.h=b.h||v.h,this.engine.findEmptyPosition(b)),this.engine.nodes.push(v),O.samePos(v,b)&&this.engine.nodes.length>1&&(this.moveNode(v,{...b,forceCollide:!0}),O.copyPos(b,v)),this.update(v.el,b),(T=b.subGridOpts)!=null&&T.children){const Q=v.el.querySelector(".grid-stack");Q&&Q.gridstack&&Q.gridstack.load(b.subGridOpts.children)}}else a&&this.addWidget(b)}),delete this.engine._loading,this.engine.removedNodes=g,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,c?fe.addRemoveCB=c:delete fe.addRemoveCB,E&&this.setAnimation(!0,!0),this}batchUpdate(n=!0){return this.engine.batchUpdate(n),n||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(n=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!n||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;const a=this.el.querySelector("."+this.opts.itemClass);if(a){const u=O.toNumber(a.getAttribute("gs-h"))||1;return Math.round(a.offsetHeight/u)}const r=parseInt(this.el.getAttribute("gs-current-row"));return r?Math.round(this.el.getBoundingClientRect().height/r):this.opts.cellHeight}cellHeight(n){if(n!==void 0&&this._isAutoCellHeight!==(n==="auto")&&(this._isAutoCellHeight=n==="auto",this._updateResizeEvent()),(n==="initial"||n==="auto")&&(n=void 0),n===void 0){const r=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;n=this.cellWidth()+r}const a=O.parseHeight(n);return this.opts.cellHeightUnit===a.unit&&this.opts.cellHeight===a.h?this:(this.opts.cellHeightUnit=a.unit,this.opts.cellHeight=a.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(n=!1){var a;return n&&((a=this.opts.columnOpts)!=null&&a.breakpointForWindow)?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var c,g;const n=this.opts.columnOpts;if(!n||!n.columnWidth&&!((c=n.breakpoints)!=null&&c.length))return!1;const a=this.getColumn();let r=a;const u=this._widthOrContainer(!0);if(n.columnWidth)r=Math.min(Math.round(u/n.columnWidth)||1,n.columnMax);else{r=n.columnMax;let m=0;for(;m<n.breakpoints.length&&u<=n.breakpoints[m].w;)r=n.breakpoints[m++].c||a}if(r!==a){const m=(g=n.breakpoints)==null?void 0:g.find(E=>E.c===r);return this.column(r,(m==null?void 0:m.layout)||n.layout),!0}return!1}compact(n="compact",a=!0){return this.engine.compact(n,a),this._triggerChangeEvent(),this}column(n,a="moveScale"){if(!n||n<1||this.opts.column===n)return this;const r=this.getColumn();return this.opts.column=n,this.engine?(this.engine.column=n,this.el.classList.remove("gs-"+r),this._updateColumnVar(),this.engine.columnChanged(r,n,a),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=a,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(n=>n.matches("."+this.opts.itemClass)&&!n.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(n=!0){var a;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),n?this.el.parentNode.removeChild(this.el):(this.removeAll(n),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,(a=this._placeholder)==null||delete a.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(n){return this.opts.float!==n&&(this.opts.float=this.engine.float=n,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(n,a=!1){const r=this.el.getBoundingClientRect();let u;a?u={top:r.top+document.documentElement.scrollTop,left:r.left}:u={top:this.el.offsetTop,left:this.el.offsetLeft};const c=n.left-u.left,g=n.top-u.top,m=r.width/this.getColumn(),E=r.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(c/m),y:Math.floor(g/E)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(n,a,r,u){return this.engine.isAreaEmpty(n,a,r,u)}makeWidget(n,a){const r=fe.getElement(n);if(!r||r.gridstackNode)return r;r.parentElement||this.el.appendChild(r),this._prepareElement(r,!0,a);const u=r.gridstackNode;this._updateContainerHeight(),u.subGridOpts&&this.makeSubGrid(r,u.subGridOpts,void 0,!1);let c;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(c=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),c&&delete this._ignoreLayoutsNodeChange,r}on(n,a){return n.indexOf(" ")!==-1?(n.split(" ").forEach(u=>this.on(u,a)),this):(n==="change"||n==="added"||n==="removed"||n==="enable"||n==="disable"?(n==="enable"||n==="disable"?this._gsEventHandler[n]=u=>a(u):this._gsEventHandler[n]=u=>{u.detail&&a(u,u.detail)},this.el.addEventListener(n,this._gsEventHandler[n])):n==="drag"||n==="dragstart"||n==="dragstop"||n==="resizestart"||n==="resize"||n==="resizestop"||n==="dropped"||n==="resizecontent"?this._gsEventHandler[n]=a:console.error("GridStack.on("+n+") event not supported"),this)}off(n){return n.indexOf(" ")!==-1?(n.split(" ").forEach(r=>this.off(r)),this):((n==="change"||n==="added"||n==="removed"||n==="enable"||n==="disable")&&this._gsEventHandler[n]&&this.el.removeEventListener(n,this._gsEventHandler[n]),delete this._gsEventHandler[n],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(n=>this.off(n)),this}removeWidget(n,a=!0,r=!0){return n?(fe.getElements(n).forEach(u=>{if(u.parentElement&&u.parentElement!==this.el)return;let c=u.gridstackNode;c||(c=this.engine.nodes.find(g=>u===g.el)),c&&(a&&fe.addRemoveCB&&fe.addRemoveCB(this.el,c,!1,!1),delete u.gridstackNode,this._removeDD(u),this.engine.removeNode(c,a,r),a&&u.parentElement&&u.remove())}),r&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(n=!0,a=!0){return this.engine.nodes.forEach(r=>{n&&fe.addRemoveCB&&fe.addRemoveCB(this.el,r,!1,!1),delete r.el.gridstackNode,this.opts.staticGrid||this._removeDD(r.el)}),this.engine.removeAll(n,a),a&&this._triggerRemoveEvent(),this}setAnimation(n=this.opts.animate,a){return a?setTimeout(()=>{this.opts&&this.setAnimation(n)}):n?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=n,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(n,a=!0,r=!0){return!!this.opts.staticGrid===n?this:(n?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(u=>{this.prepareDragDrop(u.el),u.subGrid&&r&&u.subGrid.setStatic(n,a,r)}),a&&this._setStaticClass(),this)}updateOptions(n){var r;const a=this.opts;return n===a?this:(n.acceptWidgets!==void 0&&(a.acceptWidgets=n.acceptWidgets,this._setupAcceptWidget()),n.animate!==void 0&&this.setAnimation(n.animate),n.cellHeight&&this.cellHeight(n.cellHeight),n.class!==void 0&&n.class!==a.class&&(a.class&&this.el.classList.remove(a.class),n.class&&this.el.classList.add(n.class)),n.columnOpts?(this.opts.columnOpts=n.columnOpts,this.checkDynamicColumn()):n.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof n.column=="number"&&this.column(n.column),n.margin!==void 0&&this.margin(n.margin),n.staticGrid!==void 0&&this.setStatic(n.staticGrid),n.disableDrag!==void 0&&!n.staticGrid&&this.enableMove(!n.disableDrag),n.disableResize!==void 0&&!n.staticGrid&&this.enableResize(!n.disableResize),n.float!==void 0&&this.float(n.float),n.row!==void 0?(a.minRow=a.maxRow=a.row=n.row,this._updateContainerHeight()):(n.minRow!==void 0&&(a.minRow=n.minRow,this._updateContainerHeight()),n.maxRow!==void 0&&(a.maxRow=n.maxRow)),n.lazyLoad!==void 0&&(a.lazyLoad=n.lazyLoad),(r=n.children)!=null&&r.length&&this.load(n.children),this)}update(n,a){return fe.getElements(n).forEach(r=>{var b;const u=r==null?void 0:r.gridstackNode;if(!u)return;const c={...O.copyPos({},u),...O.cloneDeep(a)};this.engine.nodeBoundFix(c),delete c.autoPosition;const g=["x","y","w","h"];let m;if(g.some(v=>c[v]!==void 0&&c[v]!==u[v])&&(m={},g.forEach(v=>{m[v]=c[v]!==void 0?c[v]:u[v],delete c[v]})),!m&&(c.minW||c.minH||c.maxW||c.maxH)&&(m={}),c.content!==void 0){const v=r.querySelector(".grid-stack-item-content");v&&v.textContent!==c.content&&(u.content=c.content,fe.renderCB(v,c),(b=u.subGrid)!=null&&b.el&&(v.appendChild(u.subGrid.el),u.subGrid._updateContainerHeight())),delete c.content}let E=!1,y=!1;for(const v in c)v[0]!=="_"&&u[v]!==c[v]&&(u[v]=c[v],E=!0,y=y||!this.opts.staticGrid&&(v==="noResize"||v==="noMove"||v==="locked"));if(O.sanitizeMinMax(u),m){const v=m.w!==void 0&&m.w!==u.w;this.moveNode(u,m),v&&u.subGrid?u.subGrid.onResize(this.hasAnimationCSS()?u.w:void 0):this.resizeToContentCheck(v,u),delete u._orig}(m||E)&&this._writeAttr(r,u),y&&this.prepareDragDrop(u.el),fe.updateCB&&fe.updateCB(u)}),this}moveNode(n,a){const r=n._updating;r||this.engine.cleanNodes().beginUpdate(n),this.engine.moveNode(n,a),this._updateContainerHeight(),r||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(n){var T,Q;if(!n||(n.classList.remove("size-to-content-max"),!n.clientHeight))return;const a=n.gridstackNode;if(!a)return;const r=a.grid;if(!r||n.parentElement!==r.el)return;const u=r.getCellHeight(!0);if(!u)return;let c=a.h?a.h*u:n.clientHeight,g;if(a.resizeToContentParent&&(g=n.querySelector(a.resizeToContentParent)),g||(g=n.querySelector(fe.resizeToContentParent)),!g)return;const m=n.clientHeight-g.clientHeight,E=a.h?a.h*u-m:g.clientHeight;let y;if(a.subGrid){y=a.subGrid.getRow()*a.subGrid.getCellHeight(!0);const Z=a.subGrid.el.getBoundingClientRect(),F=n.getBoundingClientRect();y+=Z.top-F.top}else{if((Q=(T=a.subGridOpts)==null?void 0:T.children)!=null&&Q.length)return;{const Z=g.firstElementChild;if(!Z){console.error(`Error: GridStack.resizeToContent() widget id:${a.id} '${fe.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}y=Z.getBoundingClientRect().height||E}}if(E===y)return;c+=y-E;let b=Math.ceil(c/u);const v=Number.isInteger(a.sizeToContent)?a.sizeToContent:0;v&&b>v&&(b=v,n.classList.add("size-to-content-max")),a.minH&&b<a.minH?b=a.minH:a.maxH&&b>a.maxH&&(b=a.maxH),b!==a.h&&(r._ignoreLayoutsNodeChange=!0,r.moveNode(a,{h:b}),delete r._ignoreLayoutsNodeChange)}resizeToContentCBCheck(n){fe.resizeToContentCB?fe.resizeToContentCB(n):this.resizeToContent(n)}rotate(n,a){return fe.getElements(n).forEach(r=>{const u=r.gridstackNode;if(!O.canBeRotated(u))return;const c={w:u.h,h:u.w,minH:u.minW,minW:u.minH,maxH:u.maxW,maxW:u.maxH};if(a){const m=a.left>0?Math.floor(a.left/this.cellWidth()):0,E=a.top>0?Math.floor(a.top/this.opts.cellHeight):0;c.x=u.x+m-(u.h-(E+1)),c.y=u.y+E-m}Object.keys(c).forEach(m=>{c[m]===void 0&&delete c[m]});const g=u._orig;this.update(r,c),u._orig=g}),this}margin(n){if(!(typeof n=="string"&&n.split(" ").length>1)){const r=O.parseHeight(n);if(this.opts.marginUnit===r.unit&&this.opts.margin===r.h)return}return this.opts.margin=n,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(n){return this.engine.willItFit(n)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const n=this.engine.getDirtyNodes(!0);return n&&n.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(n),this._triggerEvent("change",n)),this.engine.saveInitial(),this}_triggerAddEvent(){var n;if(this.engine.batchMode)return this;if((n=this.engine.addedNodes)!=null&&n.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(r=>{delete r._dirty});const a=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",a)}return this}_triggerRemoveEvent(){var n;if(this.engine.batchMode)return this;if((n=this.engine.removedNodes)!=null&&n.length){const a=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",a)}return this}_triggerEvent(n,a){const r=a?new CustomEvent(n,{bubbles:!1,detail:a}):new Event(n);let u=this;for(;u.parentGridNode;)u=u.parentGridNode.grid;return u.el.dispatchEvent(r),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const n=this.parentGridNode;let a=this.getRow()+this._extraDragRow;const r=this.opts.cellHeight,u=this.opts.cellHeightUnit;if(!r)return this;if(!n&&!this.opts.minRow){const c=O.parseHeight(getComputedStyle(this.el).minHeight);if(c.h>0&&c.unit===u){const g=Math.floor(c.h/r);a<g&&(a=g)}}return this.el.setAttribute("gs-current-row",String(a)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),a&&(this.el.style[n?"minHeight":"height"]=a*r+u),n&&O.shouldSizeToContent(n)&&n.grid.resizeToContentCBCheck(n.el),this}_prepareElement(n,a=!1,r){r=r||this._readAttr(n),n.gridstackNode=r,r.el=n,r.grid=this,r=this.engine.addNode(r,a),this._writeAttr(n,r),n.classList.add(qt.itemClass,this.opts.itemClass);const u=O.shouldSizeToContent(r);return u?n.classList.add("size-to-content"):n.classList.remove("size-to-content"),u&&this.resizeToContentCheck(!1,r),O.lazyLoad(r)||this.prepareDragDrop(r.el),this}_writePosAttr(n,a){return(!a._moving&&!a._resizing||this._placeholder===n)&&(n.style.top=a.y?a.y===1?"var(--gs-cell-height)":`calc(${a.y} * var(--gs-cell-height))`:null,n.style.left=a.x?a.x===1?"var(--gs-column-width)":`calc(${a.x} * var(--gs-column-width))`:null,n.style.width=a.w>1?`calc(${a.w} * var(--gs-column-width))`:null,n.style.height=a.h>1?`calc(${a.h} * var(--gs-cell-height))`:null),n.setAttribute("gs-x",String(a.x)),n.setAttribute("gs-y",String(a.y)),a.w>1?n.setAttribute("gs-w",String(a.w)):n.removeAttribute("gs-w"),a.h>1?n.setAttribute("gs-h",String(a.h)):n.removeAttribute("gs-h"),this}_writeAttr(n,a){if(!a)return this;this._writePosAttr(n,a);const r={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const u in r)a[u]?n.setAttribute(r[u],String(a[u])):n.removeAttribute(r[u]);return this}_readAttr(n,a=!0){const r={};r.x=O.toNumber(n.getAttribute("gs-x")),r.y=O.toNumber(n.getAttribute("gs-y")),r.w=O.toNumber(n.getAttribute("gs-w")),r.h=O.toNumber(n.getAttribute("gs-h")),r.autoPosition=O.toBool(n.getAttribute("gs-auto-position")),r.noResize=O.toBool(n.getAttribute("gs-no-resize")),r.noMove=O.toBool(n.getAttribute("gs-no-move")),r.locked=O.toBool(n.getAttribute("gs-locked"));const u=n.getAttribute("gs-size-to-content");u&&(u==="true"||u==="false"?r.sizeToContent=O.toBool(u):r.sizeToContent=parseInt(u,10)),r.id=n.getAttribute("gs-id"),r.maxW=O.toNumber(n.getAttribute("gs-max-w")),r.minW=O.toNumber(n.getAttribute("gs-min-w")),r.maxH=O.toNumber(n.getAttribute("gs-max-h")),r.minH=O.toNumber(n.getAttribute("gs-min-h")),a&&(r.w===1&&n.removeAttribute("gs-w"),r.h===1&&n.removeAttribute("gs-h"),r.maxW&&n.removeAttribute("gs-max-w"),r.minW&&n.removeAttribute("gs-min-w"),r.maxH&&n.removeAttribute("gs-max-h"),r.minH&&n.removeAttribute("gs-min-h"));for(const c in r){if(!r.hasOwnProperty(c))return;!r[c]&&r[c]!==0&&c!=="sizeToContent"&&delete r[c]}return r}_setStaticClass(){const n=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...n),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...n),this.el.removeAttribute("gs-static")),this}onResize(n=(a=>(a=this.el)==null?void 0:a.clientWidth)()){if(!n||this.prevWidth===n)return;this.prevWidth=n,this.batchUpdate();let r=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),r=!0):r=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(u=>{u.subGrid&&u.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(r),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(n=!1,a=void 0){if(this.engine){if(n&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,a),this.animationDelay);if(a)O.shouldSizeToContent(a)&&this.resizeToContentCBCheck(a.el);else if(this.engine.nodes.some(r=>O.shouldSizeToContent(r))){const r=[...this.engine.nodes];this.batchUpdate(),r.forEach(u=>{O.shouldSizeToContent(u)&&this.resizeToContentCBCheck(u.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,a?[a]:this.engine.nodes)}}_updateResizeEvent(n=!1){const a=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(r=>r.sizeToContent));return!n&&a&&!this.resizeObserver?(this._sizeThrottle=O.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(n||!a)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(n=".grid-stack-item"){return O.getElement(n)}static getElements(n=".grid-stack-item"){return O.getElements(n)}static getGridElement(n){return fe.getElement(n)}static getGridElements(n){return O.getElements(n)}_initMargin(){let n,a=0,r=[];typeof this.opts.margin=="string"&&(r=this.opts.margin.split(" ")),r.length===2?(this.opts.marginTop=this.opts.marginBottom=r[0],this.opts.marginLeft=this.opts.marginRight=r[1]):r.length===4?(this.opts.marginTop=r[0],this.opts.marginRight=r[1],this.opts.marginBottom=r[2],this.opts.marginLeft=r[3]):(n=O.parseHeight(this.opts.margin),this.opts.marginUnit=n.unit,a=this.opts.margin=n.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(g=>{this.opts[g]===void 0?this.opts[g]=a:(n=O.parseHeight(this.opts[g]),this.opts[g]=n.h,delete this.opts.margin)}),this.opts.marginUnit=n.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);const c=this.el.style;return c.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),c.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),c.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),c.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return zt}static setupDragIn(n,a,r,u=document){(a==null?void 0:a.pause)!==void 0&&(ve.pauseDrag=a.pause),a={appendTo:"body",helper:"clone",...a||{}},(typeof n=="string"?O.getElements(n,u):n).forEach((g,m)=>{zt.isDraggable(g)||zt.dragIn(g,a),r!=null&&r[m]&&(g.gridstackNode=r[m])})}movable(n,a){return this.opts.staticGrid?this:(fe.getElements(n).forEach(r=>{const u=r.gridstackNode;u&&(a?delete u.noMove:u.noMove=!0,this.prepareDragDrop(u.el))}),this)}resizable(n,a){return this.opts.staticGrid?this:(fe.getElements(n).forEach(r=>{const u=r.gridstackNode;u&&(a?delete u.noResize:u.noResize=!0,this.prepareDragDrop(u.el))}),this)}disable(n=!0){if(!this.opts.staticGrid)return this.enableMove(!1,n),this.enableResize(!1,n),this._triggerEvent("disable"),this}enable(n=!0){if(!this.opts.staticGrid)return this.enableMove(!0,n),this.enableResize(!0,n),this._triggerEvent("enable"),this}enableMove(n,a=!0){return this.opts.staticGrid?this:(n?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(r=>{this.prepareDragDrop(r.el),r.subGrid&&a&&r.subGrid.enableMove(n,a)}),this)}enableResize(n,a=!0){return this.opts.staticGrid?this:(n?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(r=>{this.prepareDragDrop(r.el),r.subGrid&&a&&r.subGrid.enableResize(n,a)}),this)}cancelDrag(){var a;const n=(a=this._placeholder)==null?void 0:a.gridstackNode;n&&(n._isExternal?(n._isAboutToRemove=!0,this.engine.removeNode(n)):n._isAboutToRemove&&fe._itemRemoving(n.el,!1),this.engine.restoreInitial())}_removeDD(n){return zt.draggable(n,"destroy").resizable(n,"destroy"),n.gridstackNode&&delete n.gridstackNode._initDD,delete n.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return zt.droppable(this.el,"destroy"),this;let n,a;const r=(u,c,g)=>{var T;g=g||c;const m=g.gridstackNode;if(!m)return;if(!((T=m.grid)!=null&&T.el)){g.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const Q=g.getBoundingClientRect();g.style.left=Q.x+(this.dragTransform.xScale-1)*(u.clientX-Q.x)/this.dragTransform.xScale+"px",g.style.top=Q.y+(this.dragTransform.yScale-1)*(u.clientY-Q.y)/this.dragTransform.yScale+"px",g.style.transformOrigin="0px 0px"}let{top:E,left:y}=g.getBoundingClientRect();const b=this.el.getBoundingClientRect();y-=b.left,E-=b.top;const v={position:{top:E*this.dragTransform.xScale,left:y*this.dragTransform.yScale}};if(m._temporaryRemoved){if(m.x=Math.max(0,Math.round(y/a)),m.y=Math.max(0,Math.round(E/n)),delete m.autoPosition,this.engine.nodeBoundFix(m),!this.engine.willItFit(m)){if(m.autoPosition=!0,!this.engine.willItFit(m)){zt.off(c,"drag");return}m._willFitPos&&(O.copyPos(m,m._willFitPos),delete m._willFitPos)}this._onStartMoving(g,u,v,m,a,n)}else this._dragOrResize(g,u,v,m,a,n)};return zt.droppable(this.el,{accept:u=>{const c=u.gridstackNode||this._readAttr(u,!1);if((c==null?void 0:c.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let g=!0;if(typeof this.opts.acceptWidgets=="function")g=this.opts.acceptWidgets(u);else{const m=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;g=u.matches(m)}if(g&&c&&this.opts.maxRow){const m={w:c.w,h:c.h,minW:c.minW,minH:c.minH};g=this.engine.willItFit(m)}return g}}).on(this.el,"dropover",(u,c,g)=>{let m=(g==null?void 0:g.gridstackNode)||c.gridstackNode;if((m==null?void 0:m.grid)===this&&!m._temporaryRemoved)return!1;if(m!=null&&m._sidebarOrig&&(m.w=m._sidebarOrig.w,m.h=m._sidebarOrig.h),m!=null&&m.grid&&m.grid!==this&&!m._temporaryRemoved&&m.grid._leave(c,g),g=g||c,a=this.cellWidth(),n=this.getCellHeight(!0),!m){const b=g.getAttribute("data-gs-widget")||g.getAttribute("gridstacknode");if(b){try{m=JSON.parse(b)}catch{console.error("Gridstack dropover: Bad JSON format: ",b)}g.removeAttribute("data-gs-widget"),g.removeAttribute("gridstacknode")}m||(m=this._readAttr(g)),m._sidebarOrig={w:m.w,h:m.h}}m.grid||(m.el||(m={...m}),m._isExternal=!0,g.gridstackNode=m);const E=m.w||Math.round(g.offsetWidth/a)||1,y=m.h||Math.round(g.offsetHeight/n)||1;return m.grid&&m.grid!==this?(c._gridstackNodeOrig||(c._gridstackNodeOrig=m),c.gridstackNode=m={...m,w:E,h:y,grid:this},delete m.x,delete m.y,this.engine.cleanupNode(m).nodeBoundFix(m),m._initDD=m._isExternal=m._temporaryRemoved=!0):(m.w=E,m.h=y,m._temporaryRemoved=!0),fe._itemRemoving(m.el,!1),zt.on(c,"drag",r),r(u,c,g),!1}).on(this.el,"dropout",(u,c,g)=>{const m=(g==null?void 0:g.gridstackNode)||c.gridstackNode;return m&&(!m.grid||m.grid===this)&&(this._leave(c,g),this._isTemp&&this.removeAsSubGrid(m)),!1}).on(this.el,"drop",(u,c,g)=>{var T,Q,Z;const m=(g==null?void 0:g.gridstackNode)||c.gridstackNode;if((m==null?void 0:m.grid)===this&&!m._isExternal)return!1;const E=!!this.placeholder.parentElement,y=c!==g;this.placeholder.remove(),delete this.placeholder.gridstackNode,E&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const b=c._gridstackNodeOrig;if(delete c._gridstackNodeOrig,E&&(b!=null&&b.grid)&&b.grid!==this){const F=b.grid;F.engine.removeNodeFromLayoutCache(b),F.engine.removedNodes.push(b),F._triggerRemoveEvent()._triggerChangeEvent(),F.parentGridNode&&!F.engine.nodes.length&&F.opts.subGridDynamic&&F.removeAsSubGrid()}if(!m||(E&&(this.engine.cleanupNode(m),m.grid=this),(T=m.grid)==null||delete T._isTemp,zt.off(c,"drag"),g!==c?(g.remove(),c=g):c.remove(),this._removeDD(c),!E))return!1;const v=(Z=(Q=m.subGrid)==null?void 0:Q.el)==null?void 0:Z.gridstack;return O.copyPos(m,this._readAttr(this.placeholder)),O.removePositioningStyles(c),y&&(m.content||m.subGridOpts||fe.addRemoveCB)?(delete m.el,c=this.addWidget(m)):(this._prepareElement(c,!0,m),this.el.appendChild(c),this.resizeToContentCheck(!1,m),v&&(v.parentGridNode=m),this._updateContainerHeight()),this.engine.addedNodes.push(m),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...u,type:"dropped"},b&&b.grid?b:void 0,m),!1}),this}static _itemRemoving(n,a){if(!n)return;const r=n?n.gridstackNode:void 0;!(r!=null&&r.grid)||n.classList.contains(r.grid.opts.removableOptions.decline)||(a?r._isAboutToRemove=!0:delete r._isAboutToRemove,a?n.classList.add("grid-stack-item-removing"):n.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const n=document.querySelector(this.opts.removable);return n?(!this.opts.staticGrid&&!zt.isDroppable(n)&&zt.droppable(n,this.opts.removableOptions).on(n,"dropover",(a,r)=>fe._itemRemoving(r,!0)).on(n,"dropout",(a,r)=>fe._itemRemoving(r,!1)),this):this}prepareDragDrop(n,a=!1){const r=n==null?void 0:n.gridstackNode;if(!r)return;const u=r.noMove||this.opts.disableDrag,c=r.noResize||this.opts.disableResize,g=this.opts.staticGrid||u&&c;if((a||g)&&(r._initDD&&(this._removeDD(n),delete r._initDD),g&&n.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!a))return this;if(!r._initDD){let m,E;const y=(T,Q)=>{this.triggerEvent(T,T.target),m=this.cellWidth(),E=this.getCellHeight(!0),this._onStartMoving(n,T,Q,r,m,E)},b=(T,Q)=>{this._dragOrResize(n,T,Q,r,m,E)},v=T=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete r._moving,delete r._resizing,delete r._event,delete r._lastTried;const Q=r.w!==r._orig.w,Z=T.target;if(!(!Z.gridstackNode||Z.gridstackNode.grid!==this)){if(r.el=Z,r._isAboutToRemove){const F=n.gridstackNode.grid;F._gsEventHandler[T.type]&&F._gsEventHandler[T.type](T,Z),F.engine.nodes.push(r),F.removeWidget(n,!0,!0)}else O.removePositioningStyles(Z),r._temporaryRemoved?(this._writePosAttr(Z,r),this.engine.addNode(r)):this._writePosAttr(Z,r),this.triggerEvent(T,Z);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),T.type==="resizestop"&&(Number.isInteger(r.sizeToContent)&&(r.sizeToContent=r.h),this.resizeToContentCheck(Q,r))}};zt.draggable(n,{start:y,stop:v,drag:b}).resizable(n,{start:y,stop:v,resize:b}),r._initDD=!0}return zt.draggable(n,u?"disable":"enable").resizable(n,c?"disable":"enable"),this}_onStartMoving(n,a,r,u,c,g){var m;if(this.engine.cleanNodes().beginUpdate(u),this._writePosAttr(this.placeholder,u),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=u,(m=u.grid)!=null&&m.el)this.dragTransform=O.getValuesFromTransformedElement(n);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const E=this.placeholder.closest(".grid-stack");this.dragTransform=O.getValuesFromTransformedElement(E)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(u.el=this.placeholder,u._lastUiPosition=r.position,u._prevYPix=r.position.top,u._moving=a.type==="dragstart",u._resizing=a.type==="resizestart",delete u._lastTried,a.type==="dropover"&&u._temporaryRemoved&&(this.engine.addNode(u),u._moving=!0),this.engine.cacheRects(c,g,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),a.type==="resizestart"){const E=this.getColumn()-u.x,y=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-u.y;zt.resizable(n,"option","minWidth",c*Math.min(u.minW||1,E)).resizable(n,"option","minHeight",g*Math.min(u.minH||1,y)).resizable(n,"option","maxWidth",c*Math.min(u.maxW||Number.MAX_SAFE_INTEGER,E)).resizable(n,"option","maxWidthMoveLeft",c*Math.min(u.maxW||Number.MAX_SAFE_INTEGER,u.x+u.w)).resizable(n,"option","maxHeight",g*Math.min(u.maxH||Number.MAX_SAFE_INTEGER,y)).resizable(n,"option","maxHeightMoveUp",g*Math.min(u.maxH||Number.MAX_SAFE_INTEGER,u.y+u.h))}}_dragOrResize(n,a,r,u,c,g){const m={...u._orig};let E,y=this.opts.marginLeft,b=this.opts.marginRight,v=this.opts.marginTop,T=this.opts.marginBottom;const Q=Math.round(g*.1),Z=Math.round(c*.1);if(y=Math.min(y,Z),b=Math.min(b,Z),v=Math.min(v,Q),T=Math.min(T,Q),a.type==="drag"){if(u._temporaryRemoved)return;const ie=r.position.top-u._prevYPix;u._prevYPix=r.position.top,this.opts.draggable.scroll!==!1&&O.updateScrollPosition(n,r.position,ie);const he=r.position.left+(r.position.left>u._lastUiPosition.left?-b:y),pe=r.position.top+(r.position.top>u._lastUiPosition.top?-T:v);m.x=Math.round(he/c),m.y=Math.round(pe/g);const W=this._extraDragRow;if(this.engine.collide(u,m)){const re=this.getRow();let I=Math.max(0,m.y+u.h-re);this.opts.maxRow&&re+I>this.opts.maxRow&&(I=Math.max(0,this.opts.maxRow-re)),this._extraDragRow=I}else this._extraDragRow=0;if(this._extraDragRow!==W&&this._updateContainerHeight(),u.x===m.x&&u.y===m.y)return}else if(a.type==="resize"){if(m.x<0||(O.updateScrollResize(a,n,g),m.w=Math.round((r.size.width-y)/c),m.h=Math.round((r.size.height-v)/g),u.w===m.w&&u.h===m.h)||u._lastTried&&u._lastTried.w===m.w&&u._lastTried.h===m.h)return;const ie=r.position.left+y,he=r.position.top+v;m.x=Math.round(ie/c),m.y=Math.round(he/g),E=!0}u._event=a,u._lastTried=m;const F={x:r.position.left+y,y:r.position.top+v,w:(r.size?r.size.width:u.w*c)-y-b,h:(r.size?r.size.height:u.h*g)-v-T};if(this.engine.moveNodeCheck(u,{...m,cellWidth:c,cellHeight:g,rect:F,resizing:E})){u._lastUiPosition=r.position,this.engine.cacheRects(c,g,v,b,T,y),delete u._skipDown,E&&u.subGrid&&u.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const ie=a.target;u._sidebarOrig||this._writePosAttr(ie,u),this.triggerEvent(a,ie)}}triggerEvent(n,a){let r=this;for(;r.parentGridNode;)r=r.parentGridNode.grid;r._gsEventHandler[n.type]&&r._gsEventHandler[n.type](n,a)}_leave(n,a){a=a||n;const r=a.gridstackNode;if(!r||(a.style.transform=a.style.transformOrigin=null,zt.off(n,"drag"),r._temporaryRemoved))return;r._temporaryRemoved=!0,this.engine.removeNode(r),r.el=r._isExternal&&a?a:n;const u=r._sidebarOrig;r._isExternal&&this.engine.cleanupNode(r),r._sidebarOrig=u,this.opts.removable===!0&&fe._itemRemoving(n,!0),n._gridstackNodeOrig?(n.gridstackNode=n._gridstackNodeOrig,delete n._gridstackNodeOrig):r._isExternal&&this.engine.restoreInitial()}}fe.renderCB=(d,n)=>{d&&(n!=null&&n.content)&&(d.textContent=n.content)};fe.resizeToContentParent=".grid-stack-item-content";fe.Utils=O;fe.Engine=Al;fe.GDRev="12.4.2";const Up={column:12,cellHeight:80,margin:4,animate:!0,float:!0,resizable:{handles:"e, se, s, sw, w"},draggable:{handle:".widget-drag-handle"}},ul={background:"none",border:"1px solid var(--border)",borderRadius:3,padding:"1px 5px",color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:10,lineHeight:"16px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:22,height:20,flexShrink:0},Sa={...ul,color:"var(--cyan)",borderColor:"var(--cyan)",background:"rgba(34, 211, 238, 0.08)"},Bp={color:"var(--border)",fontSize:12,margin:"0 2px",userSelect:"none",flexShrink:0},Hh=["count","sum","avg","min","max"],qp=[{key:"hbar",label:"☰",title:"Horizontal bars"},{key:"vbar",label:"▥",title:"Vertical bars"},{key:"pie",label:"◔",title:"Pie chart"},{key:"line",label:"⌇",title:"Line chart"},{key:"area",label:"▤",title:"Area chart"}];function Gp({panelId:d,panel:n,onCopy:a,onChartTypeChange:r,onClose:u,anchorEl:c}){const g=D.useRef(null),[m,E]=D.useState({top:0,left:0});return D.useEffect(()=>{if(!c)return;const y=()=>{const b=c.getBoundingClientRect(),v=160;let T=b.right-v;T<4&&(T=b.left),T+v>window.innerWidth-4&&(T=window.innerWidth-v-4),E({top:b.bottom+4,left:T})};return y(),window.addEventListener("scroll",y,!0),window.addEventListener("resize",y),()=>{window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y)}},[c]),D.useEffect(()=>{const y=b=>{g.current&&!g.current.contains(b.target)&&(!c||!c.contains(b.target))&&u()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[u,c]),lr.createPortal(h.jsxs("div",{ref:g,style:{position:"fixed",top:m.top,left:m.left,background:"var(--panel)",border:"1px solid var(--border)",borderRadius:6,minWidth:160,zIndex:1e4,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},onClick:y=>y.stopPropagation(),children:[h.jsxs("div",{onClick:()=>{a(d),u()},style:{padding:"7px 12px",cursor:"pointer",fontSize:12,display:"flex",justifyContent:"space-between",alignItems:"center",color:"var(--text)"},onMouseEnter:y=>{y.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:y=>{y.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:"Copy panel"}),h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"then ⌘V"})]}),(n==null?void 0:n.viewMode)==="chart"&&h.jsxs(h.Fragment,{children:[h.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"4px 0"}}),h.jsx("div",{style:{padding:"4px 12px 2px",fontSize:10,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Chart type"}),qp.map(y=>{const b=(n.chartType||"hbar")===y.key;return h.jsxs("div",{onClick:()=>{r(d,y.key),u()},style:{padding:"6px 12px",cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",gap:8,color:b?"var(--cyan)":"var(--text)",background:b?"rgba(34, 211, 238, 0.08)":"transparent"},onMouseEnter:v=>{b||(v.currentTarget.style.background="rgba(255,255,255,0.05)")},onMouseLeave:v=>{v.currentTarget.style.background=b?"rgba(34, 211, 238, 0.08)":"transparent"},children:[h.jsx("span",{style:{width:18,textAlign:"center"},children:y.label}),h.jsx("span",{children:y.title}),b&&h.jsx("span",{style:{marginLeft:"auto",fontSize:11},children:"✓"})]},y.key)})]})]}),document.body)}function Gh(d,n){var r;if(!d)return null;const a=((r=d.aggregation)==null?void 0:r.toUpperCase())||"";return n==="chart"||d.groupByColumn?`${d.valueColumn?`${a}(${d.valueColumn})`:a} by ${d.groupByColumn}`:d.column?`${a}(${d.column})`:a}function Yp({panel:d,columns:n,onSelect:a,onClose:r,anchorEl:u}){const[c,g]=D.useState("main"),[m,E]=D.useState(null),[y,b]=D.useState(null),[v,T]=D.useState(null),Q=D.useRef(null),[Z,F]=D.useState({top:0,left:0});D.useEffect(()=>{if(!u)return;const H=()=>{const G=u.getBoundingClientRect(),le=220;let me=G.right-le;me<4&&(me=G.left),me+le>window.innerWidth-4&&(me=window.innerWidth-le-4),F({top:G.bottom+4,left:me})};return H(),window.addEventListener("scroll",H,!0),window.addEventListener("resize",H),()=>{window.removeEventListener("scroll",H,!0),window.removeEventListener("resize",H)}},[u]),D.useEffect(()=>{const H=G=>{Q.current&&!Q.current.contains(G.target)&&(!u||!u.contains(G.target))&&r()};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[r,u]);const ie={padding:"7px 12px",cursor:"pointer",fontSize:12,display:"flex",justifyContent:"space-between",alignItems:"center",color:"var(--text)"},he=H=>{H==="count"?a("number",{aggregation:"count",column:null}):(E(H),g("pickColumn"))},pe=H=>{a("number",{aggregation:m,column:H})},W=H=>{b(H),g("groupByAgg")},re=H=>{H==="count"?a("chart",{groupByColumn:y,valueColumn:null,aggregation:"count"}):(T(H),g("groupByValCol"))},I=H=>{a("chart",{groupByColumn:y,valueColumn:H,aggregation:v})};return lr.createPortal(h.jsxs("div",{ref:Q,style:{position:"fixed",top:Z.top,left:Z.left,background:"var(--panel)",border:"1px solid var(--border)",borderRadius:6,minWidth:220,maxHeight:320,overflowY:"auto",zIndex:1e4,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},onClick:H=>H.stopPropagation(),children:[c==="main"&&h.jsxs(h.Fragment,{children:[d.savedViewConfig&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{onClick:()=>a(d.savedViewMode||"number",d.savedViewConfig),style:{padding:"8px 12px",cursor:"pointer",fontSize:12,display:"flex",justifyContent:"space-between",alignItems:"center",color:"var(--cyan)",background:"rgba(34, 211, 238, 0.05)"},onMouseEnter:H=>{H.currentTarget.style.background="rgba(34, 211, 238, 0.1)"},onMouseLeave:H=>{H.currentTarget.style.background="rgba(34, 211, 238, 0.05)"},children:[h.jsx("span",{children:Gh(d.savedViewConfig,d.savedViewMode)}),h.jsx("span",{style:{fontSize:10},children:"↻"})]}),h.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}})]}),h.jsx("div",{style:{padding:"6px 12px",fontSize:10,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Single value"}),Hh.map(H=>h.jsxs("div",{onClick:()=>he(H),style:ie,onMouseEnter:G=>{G.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:G=>{G.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:H.toUpperCase()}),H!=="count"&&h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"▶"})]},H)),h.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}}),h.jsx("div",{style:{padding:"6px 12px",fontSize:10,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Grouped"}),h.jsxs("div",{onClick:()=>g("groupByCol"),style:ie,onMouseEnter:H=>{H.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:H=>{H.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:"Group By..."}),h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"▶"})]})]}),c==="pickColumn"&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{onClick:()=>{g("main"),E(null)},style:{padding:"6px 12px",cursor:"pointer",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)"},onMouseEnter:H=>{H.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:H=>{H.currentTarget.style.background="transparent"},children:["◀ ",m==null?void 0:m.toUpperCase()," — pick column"]}),n.map(H=>h.jsxs("div",{onClick:()=>pe(H.name),style:ie,onMouseEnter:G=>{G.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:G=>{G.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:H.name}),h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:H.type})]},H.name))]}),c==="groupByCol"&&h.jsxs(h.Fragment,{children:[h.jsx("div",{onClick:()=>{g("main"),b(null)},style:{padding:"6px 12px",cursor:"pointer",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)"},onMouseEnter:H=>{H.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:H=>{H.currentTarget.style.background="transparent"},children:"◀ Group By — pick column"}),n.map(H=>h.jsxs("div",{onClick:()=>W(H.name),style:ie,onMouseEnter:G=>{G.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:G=>{G.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:H.name}),h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:H.type})]},H.name))]}),c==="groupByAgg"&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{onClick:()=>{g("groupByCol")},style:{padding:"6px 12px",cursor:"pointer",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)"},onMouseEnter:H=>{H.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:H=>{H.currentTarget.style.background="transparent"},children:["◀ Group by ",y," — pick aggregation"]}),Hh.map(H=>h.jsxs("div",{onClick:()=>re(H),style:ie,onMouseEnter:G=>{G.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:G=>{G.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:H.toUpperCase()}),H!=="count"&&h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"▶"})]},H))]}),c==="groupByValCol"&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{onClick:()=>{g("groupByAgg"),T(null)},style:{padding:"6px 12px",cursor:"pointer",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)"},onMouseEnter:H=>{H.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:H=>{H.currentTarget.style.background="transparent"},children:["◀ ",v==null?void 0:v.toUpperCase()," — pick column"]}),n.filter(H=>H.name!==y).map(H=>h.jsxs("div",{onClick:()=>I(H.name),style:ie,onMouseEnter:G=>{G.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:G=>{G.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:H.name}),h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:H.type})]},H.name))]})]}),document.body)}function Xp({panel:d,panels:n,onSave:a,onClose:r,anchorEl:u,SOURCE_CONFIG:c,panelDisplayName:g}){const m=D.useRef(null),[E,y]=D.useState({top:0,left:0}),b=(d.links||[])[0]||null,[v,T]=D.useState((b==null?void 0:b.parentPanelId)??null),[Q,Z]=D.useState((b==null?void 0:b.mappings)||[]),[F,ie]=D.useState(!1),he=new Set,pe=K=>{for(const te of n)if(!he.has(te.id))for(const Se of te.links||[])Se.parentPanelId===K&&(he.add(te.id),pe(te.id))};pe(d.id);const W=n.filter(K=>K.id!==d.id&&(K.sourceType==="postgres"||K.sourceType==="bigquery")&&!he.has(K.id)),re=n.find(K=>K.id===v),I=(re==null?void 0:re.columns)||[],H=d.columns||[],G=I.filter(K=>H.some(te=>te.name===K.name)&&!Q.some(te=>te.parentColumn===K.name&&te.childColumn===K.name));D.useEffect(()=>{if(!u)return;const K=()=>{const te=u.getBoundingClientRect(),Se=280;let C=te.right-Se;C<4&&(C=te.left),C+Se>window.innerWidth-4&&(C=window.innerWidth-Se-4),y({top:te.bottom+4,left:C})};return K(),window.addEventListener("scroll",K,!0),window.addEventListener("resize",K),()=>{window.removeEventListener("scroll",K,!0),window.removeEventListener("resize",K)}},[u]),D.useEffect(()=>{const K=te=>{m.current&&!m.current.contains(te.target)&&(!u||!u.contains(te.target))&&r()};return document.addEventListener("mousedown",K),()=>document.removeEventListener("mousedown",K)},[r,u]);const le=()=>{!v||Q.length===0?a([]):a([{parentPanelId:v,mappings:Q}]),r()},me=()=>{a([]),r()},Oe=K=>{T(K);const te=n.find(X=>X.id===K),C=((te==null?void 0:te.columns)||[]).filter(X=>H.some(L=>L.name===X.name)).map(X=>({parentColumn:X.name,childColumn:X.name}));Z(C)},$=(K,te)=>{Z(Se=>[...Se,{parentColumn:K,childColumn:te}]),ie(!1)},xe=K=>{Z(te=>te.filter((Se,C)=>C!==K))};return lr.createPortal(h.jsxs("div",{ref:m,style:{position:"fixed",top:E.top,left:E.left,background:"var(--panel)",border:"1px solid var(--border)",borderRadius:6,minWidth:280,maxHeight:400,overflowY:"auto",zIndex:1e4,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},onClick:K=>K.stopPropagation(),children:[h.jsx("div",{style:{padding:"8px 12px",fontSize:10,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:"0.05em",borderBottom:"1px solid var(--border)"},children:"Link Panel"}),h.jsxs("div",{style:{padding:"8px 12px"},children:[h.jsx("div",{style:{fontSize:10,color:"var(--text-dim)",marginBottom:4},children:"Parent panel"}),W.length===0?h.jsx("div",{style:{fontSize:11,color:"var(--text-dim)",fontStyle:"italic"},children:"No other panels available"}):h.jsxs("select",{value:v||"",onChange:K=>Oe(Number(K.target.value)),style:{width:"100%",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4,padding:"5px 8px",color:"var(--text)",fontFamily:"inherit",fontSize:12,outline:"none"},children:[h.jsx("option",{value:"",children:"Select parent..."}),W.map(K=>h.jsx("option",{value:K.id,children:g(K)},K.id))]})]}),v&&h.jsxs("div",{style:{padding:"0 12px 8px"},children:[h.jsx("div",{style:{fontSize:10,color:"var(--text-dim)",marginBottom:4},children:"Column mappings"}),Q.map((K,te)=>h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,marginBottom:4,fontSize:11},children:[h.jsx("span",{style:{color:"var(--text)",background:"var(--bg)",padding:"2px 6px",borderRadius:3,border:"1px solid var(--border)"},children:K.parentColumn}),h.jsx("span",{style:{color:"var(--text-dim)"},children:"="}),h.jsx("span",{style:{color:"var(--text)",background:"var(--bg)",padding:"2px 6px",borderRadius:3,border:"1px solid var(--border)"},children:K.childColumn}),h.jsx("button",{onClick:()=>xe(te),style:{background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",fontSize:11,padding:"0 4px"},onMouseEnter:Se=>{Se.currentTarget.style.color="var(--red)"},onMouseLeave:Se=>{Se.currentTarget.style.color="var(--text-dim)"},children:"x"})]},te)),!F&&G.length>0&&Q.length===0&&h.jsxs("div",{style:{fontSize:10,color:"var(--text-dim)",fontStyle:"italic",marginBottom:4},children:["Auto-matched ",G.length," column",G.length>1?"s":""]}),F?h.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center",fontSize:11},children:[h.jsx("select",{id:"link-parent-col",style:{flex:1,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:3,padding:"3px 4px",color:"var(--text)",fontFamily:"inherit",fontSize:11},children:I.filter(K=>!Q.some(te=>te.parentColumn===K.name)).map(K=>h.jsx("option",{value:K.name,children:K.name},K.name))}),h.jsx("span",{style:{color:"var(--text-dim)"},children:"="}),h.jsx("select",{id:"link-child-col",style:{flex:1,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:3,padding:"3px 4px",color:"var(--text)",fontFamily:"inherit",fontSize:11},children:H.filter(K=>!Q.some(te=>te.childColumn===K.name)).map(K=>h.jsx("option",{value:K.name,children:K.name},K.name))}),h.jsx("button",{onClick:()=>{var Se,C;const K=(Se=document.getElementById("link-parent-col"))==null?void 0:Se.value,te=(C=document.getElementById("link-child-col"))==null?void 0:C.value;K&&te&&$(K,te)},style:{background:"none",border:"1px solid var(--border)",borderRadius:3,padding:"2px 6px",color:"var(--cyan)",cursor:"pointer",fontFamily:"inherit",fontSize:10},children:"Add"}),h.jsx("button",{onClick:()=>ie(!1),style:{background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",fontSize:11},children:"x"})]}):h.jsx("button",{onClick:()=>ie(!0),style:{background:"none",border:"none",color:"var(--cyan)",cursor:"pointer",fontFamily:"inherit",fontSize:11,padding:0},children:"+ Add column mapping"})]}),h.jsxs("div",{style:{borderTop:"1px solid var(--border)",padding:"8px 12px",display:"flex",gap:8},children:[h.jsx("button",{onClick:le,disabled:v&&Q.length===0,style:{flex:1,background:v&&Q.length>0?"var(--cyan)":"var(--border)",border:"none",borderRadius:4,padding:"5px 10px",color:v&&Q.length>0?"#000":"var(--text-dim)",fontFamily:"inherit",fontSize:11,fontWeight:600,cursor:v&&Q.length>0?"pointer":"default"},children:"Save"}),b&&h.jsx("button",{onClick:me,style:{background:"none",border:"1px solid var(--red)",borderRadius:4,padding:"5px 10px",color:"var(--red)",fontFamily:"inherit",fontSize:11,cursor:"pointer"},children:"Remove"})]})]}),document.body)}const Vp=D.forwardRef(function({panels:n,locked:a,renderPanel:r,onPanelClose:u,onToggleFilters:c,onLayoutChange:g,onViewModeChange:m,onCopyPanel:E,onChartTypeChange:y,onUpdatePanelLinks:b,focusPanelId:v,focusCounter:T,SOURCE_CONFIG:Q,panelDisplayName:Z},F){const ie=D.useRef(null),he=D.useRef(null),pe=D.useRef({}),W=D.useRef(g),[re,I]=D.useState(!1),[H,G]=D.useState(0),[le,me]=D.useState(null),Oe=D.useRef(null),[$,xe]=D.useState(null),K=D.useRef(null),[te,Se]=D.useState(null),C=D.useRef(null),X=D.useRef({}),L=D.useRef({});D.useEffect(()=>{W.current=g},[g]),D.useImperativeHandle(F,()=>({resizePanel:(w,V,P)=>{const ae=ie.current,oe=pe.current[String(w)];ae&&oe&&ae.update(oe.el,{w:V,h:P})},getPanelSize:w=>{const V=pe.current[String(w)];if(V){const P=V.el.gridstackNode;if(P)return{w:P.w,h:P.h}}return null}}),[]),D.useEffect(()=>{if(!he.current)return;const w=fe.init(Up,he.current);ie.current=w,I(!0);const V=(P,ae)=>{if(!W.current||!ae)return;const oe={};for(const Te of ae)Te.id&&(oe[Te.id]={x:Te.x,y:Te.y,w:Te.w,h:Te.h});W.current(oe)};return w.on("change",V),w.on("added",V),()=>{w.off("change"),w.off("added"),w.destroy(!1),ie.current=null,pe.current={},I(!1)}},[]),D.useEffect(()=>{if(!ie.current||!re)return;const w=ie.current,V=new Set(n.map(oe=>String(oe.id))),P=new Set(Object.keys(pe.current));let ae=!1;for(const oe of n){const Te=String(oe.id);if(!P.has(Te)){const ze=oe.gridPos,Pe=document.createElement("div");Pe.className="grid-stack-item",Pe.setAttribute("gs-id",Te),Pe.setAttribute("gs-w",String((ze==null?void 0:ze.w)??6)),Pe.setAttribute("gs-h",String((ze==null?void 0:ze.h)??5)),ze&&ze.x!=null&&ze.y!=null?(Pe.setAttribute("gs-x",String(ze.x)),Pe.setAttribute("gs-y",String(ze.y))):Pe.setAttribute("gs-auto-position","true");const Ct=document.createElement("div");Ct.className="grid-stack-item-content widget-content-wrapper",Pe.appendChild(Ct);const Dt=document.createElement("div");Dt.className="widget-portal-root",Ct.appendChild(Dt),he.current.appendChild(Pe),w.makeWidget(Pe),pe.current[Te]={el:Pe,portalRoot:Dt},ae=!0}}for(const oe of P)if(!V.has(oe)){const{el:Te}=pe.current[oe];w.removeWidget(Te,!0),delete pe.current[oe],ae=!0}ae&&G(oe=>oe+1)},[n,re]),D.useEffect(()=>{!ie.current||!re||ie.current.setStatic(!!a)},[a,re]),D.useEffect(()=>{if(!v||!pe.current[String(v)])return;const{el:w}=pe.current[String(v)];w.scrollIntoView({behavior:"smooth",block:"nearest"}),w.classList.add("widget-focused");const V=setTimeout(()=>w.classList.remove("widget-focused"),1e3);return()=>clearTimeout(V)},[v,T]);const ne=w=>{const V=ie.current,P=pe.current[String(w)];if(!V||!P)return;const ae=P.el.gridstackNode;if(!ae)return;const oe=String(w);ae.w===12&&X.current[oe]?(V.update(P.el,{w:X.current[oe]}),delete X.current[oe]):(X.current[oe]=ae.w,V.update(P.el,{w:12}))},_e=w=>{const V=ie.current,P=pe.current[String(w)];if(!V||!P)return;const ae=P.el.gridstackNode;if(!ae)return;const oe=String(w);ae.h===12&&L.current[oe]?(V.update(P.el,{h:L.current[oe]}),delete L.current[oe]):(L.current[oe]=ae.h,V.update(P.el,{h:12}))},_=(w,V,P)=>{me(null),m&&m(w,V,P)},U=w=>{me(null),m&&m(w,"table",null)};return h.jsxs("div",{style:{flex:1,overflow:"auto",padding:4},children:[h.jsx("div",{ref:he,className:"grid-stack"}),re&&n.map(w=>{var ze,Pe,Ct,Dt;const V=pe.current[String(w.id)];if(!V)return null;const P=Q[w.sourceType],ae=w.filtersVisible!==!1,oe=w.sourceType==="postgres",Te=w.viewMode||"table";return lr.createPortal(h.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},children:[!a&&h.jsxs("div",{className:"widget-drag-handle",style:{display:"flex",alignItems:"center",gap:4,padding:"4px 8px",background:"var(--panel)",borderBottom:"1px solid var(--border)",cursor:"grab",flexShrink:0,minHeight:28},children:[h.jsx("span",{style:{color:"var(--text-dim)",fontSize:10,cursor:"grab",userSelect:"none"},children:"⠿"}),h.jsx("span",{style:{fontSize:9,fontWeight:700,color:P.color,background:P.color+"20",padding:"1px 4px",borderRadius:3,letterSpacing:"0.05em"},children:P.label}),h.jsx("span",{style:{fontSize:11,color:"var(--text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginRight:4},children:Z(w)}),((ze=w.links)==null?void 0:ze.length)>0&&(()=>{const ce=n.find(It=>It.id===w.links[0].parentPanelId),Ue=(ce==null?void 0:ce.selectedRow)!=null;return h.jsxs("span",{style:{fontSize:9,color:Ue?"var(--cyan)":"var(--text-dim)",background:Ue?"rgba(34, 211, 238, 0.10)":"rgba(255,255,255,0.06)",padding:"1px 5px",borderRadius:3,whiteSpace:"nowrap",flexShrink:0},children:["⛓"," ",ce?Z(ce):"?"]})})(),w.loading&&h.jsx("span",{style:{color:"var(--yellow)",fontSize:10,flexShrink:0},children:"..."}),h.jsx("div",{style:{flex:1}}),h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:2,flexShrink:0},children:[h.jsx("button",{onClick:ce=>{ce.stopPropagation(),K.current=ce.currentTarget,xe($===w.id?null:w.id)},title:"Panel options",style:ul,onMouseEnter:ce=>{ce.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:ce=>{ce.currentTarget.style.borderColor="var(--border)"},children:"⋮"}),$===w.id&&h.jsx(Gp,{panelId:w.id,panel:w,onCopy:E,onChartTypeChange:y,onClose:()=>xe(null),anchorEl:K.current}),oe&&h.jsxs(h.Fragment,{children:[h.jsx("button",{onClick:ce=>{ce.stopPropagation(),C.current=ce.currentTarget,Se(te===w.id?null:w.id)},title:((Pe=w.links)==null?void 0:Pe.length)>0?`Linked to ${Z(n.find(ce=>{var Ue;return ce.id===((Ue=w.links[0])==null?void 0:Ue.parentPanelId)})||{})}`:"Link to parent panel",style:((Ct=w.links)==null?void 0:Ct.length)>0?Sa:ul,onMouseEnter:ce=>{var Ue;(Ue=w.links)!=null&&Ue.length||(ce.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:ce=>{var Ue;(Ue=w.links)!=null&&Ue.length||(ce.currentTarget.style.borderColor="var(--border)")},children:(((Dt=w.links)==null?void 0:Dt.length)>0,"🔗")}),te===w.id&&h.jsx(Xp,{panel:w,panels:n,onSave:ce=>b(w.id,ce),onClose:()=>Se(null),anchorEl:C.current,SOURCE_CONFIG:Q,panelDisplayName:Z})]}),h.jsxs("button",{onClick:ce=>{ce.stopPropagation(),c(w.id)},title:ae?"Hide filters":"Show filters",style:{...ul,color:ae?"var(--text)":"var(--text-dim)",background:ae?"rgba(255,255,255,0.04)":"none",gap:3,paddingLeft:6,paddingRight:7,minWidth:"auto"},onMouseEnter:ce=>{ce.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:ce=>{ce.currentTarget.style.borderColor="var(--border)"},children:[h.jsx("span",{style:{fontSize:8},children:ae?"▾":"▸"}),h.jsx("span",{children:"filters"})]}),oe&&h.jsxs(h.Fragment,{children:[h.jsx("button",{onClick:ce=>{ce.stopPropagation(),U(w.id)},title:"Table view",style:Te==="table"?Sa:ul,onMouseEnter:ce=>{Te!=="table"&&(ce.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:ce=>{Te!=="table"&&(ce.currentTarget.style.borderColor="var(--border)")},children:"⊞"}),h.jsx("button",{onClick:ce=>{ce.stopPropagation(),Te==="table"&&w.savedViewConfig?_(w.id,w.savedViewMode||"number",w.savedViewConfig):(Oe.current=ce.currentTarget,me(le===w.id?null:w.id))},title:Te==="table"&&w.savedViewConfig?`Restore: ${Gh(w.savedViewConfig,w.savedViewMode)}`:"Summary view",style:Te!=="table"?Sa:w.savedViewConfig?{...ul,color:"var(--cyan)"}:ul,onMouseEnter:ce=>{Te==="table"&&(ce.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:ce=>{Te==="table"&&(ce.currentTarget.style.borderColor="var(--border)")},children:"Σ"}),le===w.id&&h.jsx(Yp,{panel:w,columns:w.columns||[],onSelect:(ce,Ue)=>_(w.id,ce,Ue),onClose:()=>me(null),anchorEl:Oe.current})]}),(()=>{var It,cl;const ce=((It=w.gridPos)==null?void 0:It.w)===12,Ue=((cl=w.gridPos)==null?void 0:cl.h)===12;return h.jsxs(h.Fragment,{children:[h.jsx("span",{style:Bp,children:"|"}),h.jsx("button",{onClick:Fe=>{Fe.stopPropagation(),ne(w.id)},title:ce?"Restore width":"Full row",style:ce?Sa:ul,onMouseEnter:Fe=>{ce||(Fe.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:Fe=>{ce||(Fe.currentTarget.style.borderColor="var(--border)")},children:"⇔"}),h.jsx("button",{onClick:Fe=>{Fe.stopPropagation(),_e(w.id)},title:Ue?"Restore height":"Full column",style:Ue?Sa:ul,onMouseEnter:Fe=>{Ue||(Fe.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:Fe=>{Ue||(Fe.currentTarget.style.borderColor="var(--border)")},children:"⇕"}),h.jsx("button",{onClick:Fe=>{Fe.stopPropagation(),u(w.id)},style:{...ul,border:"none",color:"var(--text-dim)",fontSize:12,minWidth:18,padding:"0 2px"},onMouseEnter:Fe=>{Fe.currentTarget.style.color="var(--red)",Fe.currentTarget.style.background="var(--red-bg)"},onMouseLeave:Fe=>{Fe.currentTarget.style.color="var(--text-dim)",Fe.currentTarget.style.background="none"},children:"×"})]})})()]})]}),h.jsx("div",{style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:r(w)})]},w.id),V.portalRoot)})]})}),Qp=100,Yh="mdash_state",tr={postgres:{color:"var(--purple)",label:"PG"},bigquery:{color:"var(--green)",label:"BQ"},redis:{color:"var(--red)",label:"RD"},s3:{color:"var(--orange)",label:"S3"}};let nr=1,En=1,Oi=null;function _u(d){return d.map(n=>({...n,panels:n.panels.map(a=>{const{results:r,loading:u,columns:c,tokens:g,nextToken:m,selectedRow:E,...y}=a;return y})}))}function Zp(){var d;try{const n=localStorage.getItem(Yh);if(!n)return null;const a=JSON.parse(n);if(!((d=a.dashboards)!=null&&d.length))return null;let r=0,u=0;for(const g of a.dashboards){g.id>r&&(r=g.id);for(const m of g.panels)m.id>u&&(u=m.id)}return nr=r+1,En=u+1,{dashboards:a.dashboards.map(g=>({...g,locked:g.locked??!1,panels:g.panels.map(m=>({results:null,loading:!1,selectedRow:null,...m.sourceType==="postgres"||m.sourceType==="bigquery"?{columns:[],links:m.links??[]}:{},...m.sourceType==="s3"?{tokens:[null],nextToken:null}:{},...m}))})),activeDashboardId:a.activeDashboardId,autoRefreshInterval:a.autoRefreshInterval??null}}catch{return null}}const Kp={table:{w:6,h:5},number:{w:3,h:2},chart:{w:6,h:5}};function Jp(d,n,a,r,u="postgres"){return{id:En++,sourceType:u,instanceId:d,instanceLabel:n,schema:a,name:r,displayName:`${a}.${r}`,filters:{include:"",exclude:"",highlight:"",columns:""},highlightOptions:{caseSensitive:!1,wholeWord:!1,regex:!1},page:0,columns:[],results:null,loading:!1,filtersVisible:!0,viewMode:"table",viewConfig:null,savedViewConfig:null,savedViewMode:null,viewSizes:{},chartType:"hbar",links:[],selectedRow:null}}function Wp(d,n){return{id:En++,sourceType:"redis",instanceId:d,instanceLabel:n,displayName:"keys",filter:"",page:0,results:null,loading:!1,filtersVisible:!0}}function $p(d,n,a){return{id:En++,sourceType:"s3",instanceId:d,instanceLabel:n,bucket:a,displayName:a,filter:"",page:0,tokens:[null],nextToken:null,results:null,loading:!1,filtersVisible:!0}}function kh(d){return{id:nr++,name:d,panels:[],locked:!1}}function Lh(d,n){const a=JSON.stringify(d,null,2),r=new Blob([a],{type:"application/json"}),u=URL.createObjectURL(r),c=document.createElement("a");c.href=u,c.download=n,c.click(),URL.revokeObjectURL(u)}function Fp(d){if(!d||typeof d!="object")return null;let n;if(Array.isArray(d.dashboards))n=d.dashboards;else if(d.dashboard&&typeof d.dashboard=="object")n=[d.dashboard];else return null;for(const a of n){if(typeof a.name!="string"||!Array.isArray(a.panels))return null;for(const r of a.panels)if(!r.sourceType||typeof r.sourceType!="string")return null}return n}function Ip(d){return d.map(n=>{const a={},r=n.panels.map(u=>{const c=En++;return a[u.id]=c,{results:null,loading:!1,selectedRow:null,...u.sourceType==="postgres"||u.sourceType==="bigquery"?{columns:[],links:u.links??[]}:{},...u.sourceType==="s3"?{tokens:[null],nextToken:null}:{},...u,id:c}});for(const u of r)u.links&&(u.links=u.links.map(c=>({...c,parentPanelId:a[c.parentPanelId]})).filter(c=>c.parentPanelId!=null));return{...n,id:nr++,panels:r}})}function Pp(){const[d,n]=D.useState([]),[a,r]=D.useState(Qp),[u,c]=D.useState(null),[g,m]=D.useState(null),[E]=D.useState(()=>Zp()),[y,b]=D.useState(()=>E?E.dashboards:[kh("Dashboard 1")]),[v,T]=D.useState(()=>E?E.activeDashboardId:1),[Q,Z]=D.useState(null),[F,ie]=D.useState(0),[he,pe]=D.useState(0),[W,re]=D.useState(null),[I,H]=D.useState(()=>(E==null?void 0:E.autoRefreshInterval)??null),[G,le]=D.useState(!1),[me,Oe]=D.useState(""),$=D.useRef(null),xe=D.useRef(null),K=D.useRef(null),[te,Se]=D.useState(!1),[C,X]=D.useState("type"),[L,ne]=D.useState(null),[_e,_]=D.useState(null),U=D.useRef(null),[w,V]=D.useState(null),[P,ae]=D.useState({}),[oe,Te]=D.useState({}),[ze,Pe]=D.useState(""),[Ct,Dt]=D.useState(""),[ce,Ue]=D.useState(""),[It,cl]=D.useState(""),[Fe,_n]=D.useState(""),[Ni,Hi]=D.useState(""),[ki,za]=D.useState(""),[Ca,xt]=D.useState("us-east-1"),[Ta,zn]=D.useState(""),[Dl,ci]=D.useState(""),[fi,Cn]=D.useState(""),[Ra,wa]=D.useState(""),[Ol,bt]=D.useState(""),[Ze,tt]=D.useState(!1),Qe=y.find(x=>x.id===v)||null,ft=(Qe==null?void 0:Qe.panels)||[],Tn=x=>d.filter(q=>q.type===x&&q.status==="connected"),Li=x=>Tn(x).length>1,Ui=d.some(x=>x.status==="connected"),Nl=D.useCallback((x,q)=>{b(J=>J.map(ee=>({...ee,panels:ee.panels.map(be=>be.id===x?{...be,...q}:be)})))},[]),fl=()=>{const x=kh(`Dashboard ${nr}`);b(q=>[...q,x]),T(x.id)},di=(x,q)=>{const J=q.trim();J&&b(ee=>ee.map(be=>be.id===x?{...be,name:J}:be))},hi=(x,q)=>{q&&q.stopPropagation(),b(J=>{const ee=J.filter(be=>be.id!==x);if(v===x){const be=J.findIndex(ye=>ye.id===x),Ke=ee[Math.min(be,ee.length-1)];T(Ke?Ke.id:null)}return ee})},gi=x=>{b(q=>q.map(J=>J.id===v?{...J,panels:[...J.panels,x]}:J)),Z(x.id),ie(q=>q+1)},ja=x=>{b(q=>q.map(J=>({...J,panels:J.panels.filter(ee=>ee.id!==x)})))},Rn=x=>{b(q=>q.map(J=>J.id===x?{...J,locked:!J.locked}:J))},mi=D.useCallback((x,q)=>{b(J=>J.map(ee=>({...ee,panels:ee.panels.map(be=>be.id===x?{...be,links:q,selectedRow:null}:be)})))},[]),ar=D.useCallback(x=>{b(q=>q.map(J=>({...J,panels:J.panels.map(ee=>ee.id===x?{...ee,filtersVisible:!ee.filtersVisible}:ee)})))},[]),Ma=D.useCallback((x,q,J)=>{var be;const ee=(be=K.current)==null?void 0:be.getPanelSize(x);b(Ke=>Ke.map(ye=>({...ye,panels:ye.panels.map(Ne=>{if(Ne.id!==x)return Ne;const Je=Ne.viewMode||"table",hl=q==="table"?null:J;if(Je===q&&JSON.stringify(Ne.viewConfig)===JSON.stringify(hl))return Ne;const ql={...Ne.viewSizes};ee&&(ql[Je]={w:ee.w,h:ee.h});const pi=q==="table"?Ne.viewConfig||Ne.savedViewConfig:J,Ha=q==="table"?Ne.viewMode!=="table"?Ne.viewMode:Ne.savedViewMode:q;return{...Ne,viewMode:q,viewConfig:hl,savedViewConfig:pi,savedViewMode:Ha,viewSizes:ql,results:null}})}))),requestAnimationFrame(()=>{var hl;const Ke=ft.find(ql=>ql.id===x),ye=(Ke==null?void 0:Ke.viewSizes)||{},Ne=(Ke==null?void 0:Ke.viewMode)||"table";ee&&(ye[Ne]={w:ee.w,h:ee.h});const Je=ye[q]||Kp[q]||{w:6,h:5};(hl=K.current)==null||hl.resizePanel(x,Je.w,Je.h)})},[ft]),Aa=D.useCallback((x,q)=>{b(J=>J.map(ee=>({...ee,panels:ee.panels.map(be=>be.id===x?{...be,chartType:q}:be)})))},[]),Da=D.useCallback(x=>{const q=ft.find(pi=>pi.id===x);if(!q)return;const{results:J,loading:ee,columns:be,tokens:Ke,nextToken:ye,id:Ne,gridPos:Je,selectedRow:hl,...ql}=q;Oi=ql},[ft]),Bi=D.useCallback(()=>{if(!Oi)return;const x={...Oi,id:En++,results:null,loading:!1,...Oi.sourceType==="postgres"||Oi.sourceType==="bigquery"?{columns:[]}:{},...Oi.sourceType==="s3"?{tokens:[null],nextToken:null}:{}};gi(x)},[gi]),[wn,Hl]=D.useState(!1),qi=D.useRef(null),Pt=D.useRef(null),dt=D.useCallback(()=>{if(!Qe)return;const x=_u([Qe])[0],q=new Date().toISOString().slice(0,10);Lh({dashboard:x},`mdash-${x.name.replace(/\s+/g,"-").toLowerCase()}-${q}.json`),Hl(!1)},[Qe]),St=D.useCallback(()=>{const x=_u(y),q=new Date().toISOString().slice(0,10);Lh({dashboards:x,activeDashboardId:v,autoRefreshInterval:I},`mdash-all-dashboards-${q}.json`),Hl(!1)},[y,v,I]),kl=D.useCallback(x=>{var ee;const q=(ee=x.target.files)==null?void 0:ee[0];if(!q)return;const J=new FileReader;J.onload=be=>{try{const Ke=JSON.parse(be.target.result),ye=Fp(Ke);if(!ye){c("Invalid dashboard config file. Expected JSON with 'dashboard' or 'dashboards' key.");return}const Ne=Ip(ye);b(Je=>[...Je,...Ne]),T(Ne[0].id)}catch{c("Failed to parse JSON file.")}},J.readAsText(q),x.target.value="",Hl(!1)},[]);D.useEffect(()=>{const x=q=>{var J,ee;if((q.metaKey||q.ctrlKey)&&q.key==="v"){const be=(J=document.activeElement)==null?void 0:J.tagName;if(be==="INPUT"||be==="TEXTAREA"||(ee=document.activeElement)!=null&&ee.isContentEditable||!Oi)return;q.preventDefault(),Bi()}};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[Bi]);const jn=(x,q,J,ee,be="postgres")=>{const Ke=ft.find(ye=>(ye.sourceType==="postgres"||ye.sourceType==="bigquery")&&ye.instanceId===x&&ye.schema===J&&ye.name===ee);Ke?(Z(Ke.id),ie(ye=>ye+1)):gi(Jp(x,q,J,ee,be)),el()},sr=(x,q)=>{const J=ft.find(ee=>ee.sourceType==="redis"&&ee.instanceId===x);J?(Z(J.id),ie(ee=>ee+1)):gi(Wp(x,q)),el()},rr=(x,q,J)=>{const ee=ft.find(be=>be.sourceType==="s3"&&be.instanceId===x&&be.bucket===J);ee?(Z(ee.id),ie(be=>be+1)):gi($p(x,q,J)),el()};D.useEffect(()=>{gp().then(x=>{var J,ee,be,Ke;x.version&&m(x.version),x.page_size&&r(x.page_size);const q=[];for(const ye of((J=x.sources)==null?void 0:J.postgres)||[])q.push({id:ye.id,type:"postgres",label:ye.label,status:ye.status});for(const ye of((ee=x.sources)==null?void 0:ee.bigquery)||[])q.push({id:ye.id,type:"bigquery",label:ye.label,status:ye.status});for(const ye of((be=x.sources)==null?void 0:be.redis)||[])q.push({id:ye.id,type:"redis",label:ye.label,status:ye.status});for(const ye of((Ke=x.sources)==null?void 0:Ke.s3)||[])q.push({id:ye.id,type:"s3",label:ye.label,status:ye.status});n(q);for(const ye of q)ye.status==="connected"&&((ye.type==="postgres"||ye.type==="bigquery")&&Zs(ye.id).then(Ne=>ae(Je=>({...Je,[ye.id]:Ne.tables}))).catch(()=>{}),ye.type==="s3"&&Su(ye.id).then(Ne=>Te(Je=>({...Je,[ye.id]:Ne.buckets}))).catch(()=>{}))}).catch(()=>n([]))},[]);const Mn=()=>{tt(!0),c(null),mp(ze,Ct).then(x=>{const q={id:x.instance_id,type:"postgres",label:x.label||x.instance_id,status:"connected"};return n(J=>[...J,q]),V(null),Pe(""),Dt(""),Zs(x.instance_id).then(J=>{ae(ee=>({...ee,[x.instance_id]:J.tables}))})}).catch(x=>c(x.message)).finally(()=>tt(!1))},Ll=()=>{tt(!0),c(null),vp(ce,It).then(x=>{const q={id:x.instance_id,type:"redis",label:x.label||x.instance_id,status:"connected"};n(J=>[...J,q]),V(null),Ue(""),cl("")}).catch(x=>c(x.message)).finally(()=>tt(!1))},An=()=>{tt(!0),c(null),Sp({endpointUrl:Fe,accessKey:Ni,secretKey:ki,region:Ca,label:Ta}).then(x=>{const q={id:x.instance_id,type:"s3",label:x.label||x.instance_id,status:"connected"};return n(J=>[...J,q]),V(null),_n(""),Hi(""),za(""),xt("us-east-1"),zn(""),Su(x.instance_id).then(J=>{Te(ee=>({...ee,[x.instance_id]:J.buckets}))})}).catch(x=>c(x.message)).finally(()=>tt(!1))},dl=()=>{tt(!0),c(null),yp({project:Dl,dataset:fi,credentialsPath:Ra,label:Ol}).then(x=>{const q={id:x.instance_id,type:"bigquery",label:x.label||x.instance_id,status:"connected"};return n(J=>[...J,q]),V(null),ci(""),Cn(""),wa(""),bt(""),Zs(x.instance_id).then(J=>{ae(ee=>({...ee,[x.instance_id]:J.tables}))})}).catch(x=>c(x.message)).finally(()=>tt(!1))},Ul=x=>{const q=Tn(x);if(q.length===0){Se(!1),V(x);return}if(q.length===1){Bl(q[0],x);return}ne(x),X("instance")},Bl=(x,q)=>{const J=q||L;if(J==="redis"){sr(x.id,x.label);return}_(x.id),ne(J),X("target"),(J==="postgres"||J==="bigquery")&&!P[x.id]&&Zs(x.id).then(ee=>ae(be=>({...be,[x.id]:ee.tables}))).catch(ee=>c(ee.message)),J==="s3"&&!oe[x.id]&&Su(x.id).then(ee=>Te(be=>({...be,[x.id]:ee.buckets}))).catch(ee=>c(ee.message))},el=()=>{Se(!1),X("type"),ne(null),_(null)};D.useEffect(()=>{const x=q=>{U.current&&!U.current.contains(q.target)&&el(),xe.current&&!xe.current.contains(q.target)&&le(!1),qi.current&&!qi.current.contains(q.target)&&Hl(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[]);const et=D.useCallback(()=>{b(x=>x.map(q=>q.id===v?{...q,panels:q.panels.map(J=>({...J,results:null}))}:q)),pe(x=>x+1)},[v]);D.useEffect(()=>($.current&&(clearInterval($.current),$.current=null),I&&ft.length>0&&($.current=setInterval(()=>{et()},I*60*1e3)),()=>{$.current&&clearInterval($.current)}),[I,ft.length,et]),D.useEffect(()=>{try{localStorage.setItem(Yh,JSON.stringify({dashboards:_u(y),activeDashboardId:v,autoRefreshInterval:I}))}catch{}},[y,v,I]);const Oa=D.useCallback(x=>{b(q=>q.map(J=>J.id===v?{...J,panels:J.panels.map(ee=>x[String(ee.id)]?{...ee,gridPos:x[String(ee.id)]}:ee)}:J))},[v]),Na=x=>(Li(x.sourceType)?`${x.instanceLabel} `:"")+x.displayName,nt={background:"var(--bg)",border:"1px solid var(--border)",borderRadius:6,padding:"10px 12px",color:"var(--text)",fontFamily:"inherit",fontSize:13,outline:"none",width:"100%"};return h.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",background:"var(--bg)"},children:[h.jsxs("div",{style:{display:"flex",alignItems:"stretch",borderBottom:"1px solid var(--border)",background:"var(--panel)",minHeight:40},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 16px",borderRight:"1px solid var(--border)",flexShrink:0},children:[h.jsx("span",{style:{fontWeight:700,fontSize:14,color:"var(--cyan)"},children:"mdash"}),g&&h.jsxs("span",{style:{fontSize:11,color:"var(--text-dim)",marginLeft:6},children:["v",g]})]}),h.jsx("div",{style:{display:"flex",alignItems:"stretch",overflowX:"auto"},children:y.map(x=>h.jsxs("div",{onClick:()=>T(x.id),style:{display:"flex",alignItems:"center",gap:6,padding:"0 14px",cursor:"pointer",fontSize:12,borderRight:"1px solid var(--border)",background:x.id===v?"var(--bg)":"transparent",borderBottom:x.id===v?"2px solid var(--cyan)":"2px solid transparent",color:x.id===v?"var(--text)":"var(--text-dim)",transition:"all 0.1s",whiteSpace:"nowrap",flexShrink:0},children:[W===x.id?h.jsx("input",{autoFocus:!0,defaultValue:x.name,onClick:q=>q.stopPropagation(),onFocus:q=>q.target.select(),onBlur:q=>{di(x.id,q.target.value),re(null)},onKeyDown:q=>{q.key==="Enter"?(di(x.id,q.target.value),re(null)):q.key==="Escape"&&re(null)},style:{background:"transparent",border:"1px solid var(--cyan)",borderRadius:3,color:"inherit",fontFamily:"inherit",fontSize:"inherit",padding:"1px 4px",outline:"none",width:Math.max(60,x.name.length*7.5)}}):h.jsx("span",{onDoubleClick:q=>{q.stopPropagation(),re(x.id)},children:x.name}),x.panels.length>0&&h.jsx("span",{style:{fontSize:9,color:"var(--text-dim)",background:"rgba(255,255,255,0.06)",padding:"1px 4px",borderRadius:3},children:x.panels.length}),y.length>1&&h.jsx("button",{onClick:q=>hi(x.id,q),style:{background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:13,padding:"0 2px",lineHeight:1,borderRadius:3},onMouseEnter:q=>{q.target.style.color="var(--red)",q.target.style.background="var(--red-bg)"},onMouseLeave:q=>{q.target.style.color="var(--text-dim)",q.target.style.background="none"},children:"x"})]},x.id))}),h.jsx("button",{onClick:fl,style:{background:"none",border:"none",borderLeft:"1px solid var(--border)",color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:16,padding:"0 12px",flexShrink:0,lineHeight:1},onMouseEnter:x=>{x.target.style.color="var(--text)"},onMouseLeave:x=>{x.target.style.color="var(--text-dim)"},title:"New dashboard",children:"+"}),h.jsx("div",{style:{flex:1}}),Qe&&ft.length>0&&h.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:10,flexShrink:0},children:h.jsxs("button",{onClick:()=>Rn(v),title:Qe.locked?"Unlock layout (allow moving panels)":"Lock layout (prevent moving panels)",style:{background:Qe.locked?"rgba(250, 204, 21, 0.08)":"none",border:"1px solid",borderColor:Qe.locked?"var(--yellow)":"var(--border)",borderRadius:4,color:Qe.locked?"var(--yellow)":"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:11,padding:"3px 10px",lineHeight:1,display:"flex",alignItems:"center",gap:5,transition:"all 0.15s"},onMouseEnter:x=>{Qe.locked||(x.currentTarget.style.color="var(--text)",x.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:x=>{Qe.locked||(x.currentTarget.style.color="var(--text-dim)",x.currentTarget.style.borderColor="var(--border)")},children:[h.jsx("span",{style:{fontSize:12},children:Qe.locked?"🔒":"🔓"}),Qe.locked?"Locked":"Unlocked"]})}),h.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",flexShrink:0},ref:qi,children:[h.jsx("input",{ref:Pt,type:"file",accept:".json",style:{display:"none"},onChange:kl}),h.jsx("button",{onClick:()=>Hl(x=>!x),title:"Import / Export dashboards",style:{background:"none",border:"1px solid var(--border)",borderRadius:4,color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:11,padding:"3px 10px",lineHeight:1,display:"flex",alignItems:"center",gap:4},onMouseEnter:x=>{x.currentTarget.style.color="var(--text)",x.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:x=>{x.currentTarget.style.color="var(--text-dim)",x.currentTarget.style.borderColor="var(--border)"},children:"Config"}),wn&&h.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,background:"var(--panel)",border:"1px solid var(--border)",borderRadius:6,minWidth:200,zIndex:200,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},children:[Qe&&h.jsx(zu,{label:`Export "${Qe.name}"`,onClick:dt}),y.length>0&&h.jsx(zu,{label:"Export all dashboards",onClick:St}),h.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}}),h.jsx(zu,{label:"Import from file...",onClick:()=>{var x;return(x=Pt.current)==null?void 0:x.click()}})]})]}),Qe&&h.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",flexShrink:0},ref:U,children:[h.jsx("button",{onClick:()=>{Se(!te),X("type"),ne(null),_(null)},style:{background:"none",border:"1px solid var(--border)",borderRadius:4,color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:11,padding:"3px 10px",lineHeight:1,display:"flex",alignItems:"center",gap:4},onMouseEnter:x=>{x.currentTarget.style.color="var(--text)",x.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:x=>{x.currentTarget.style.color="var(--text-dim)",x.currentTarget.style.borderColor="var(--border)"},children:"+ Panel"}),te&&h.jsx(ey,{pickerStage:C,pickerType:L,pickerInstance:_e,instancesOfType:Tn,handlePickType:Ul,handlePickInstance:Bl,setShowSourcePicker:Se,setShowConnectForm:V,setPickerStage:X,setPickerType:ne,setPickerInstance:_,pgTablesCache:P,s3BucketsCache:oe,instances:d,activePanels:ft,addPgPanel:jn,addS3Panel:rr})]}),h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,paddingRight:16,paddingLeft:10,flexShrink:0},ref:xe,children:[ft.some(x=>x.loading)&&h.jsx("span",{style:{color:"var(--yellow)",fontSize:11},children:"loading..."}),ft.length>0&&h.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",gap:0},children:[h.jsxs("button",{onClick:et,title:"Refresh all panels",style:{background:I?"rgba(34, 211, 238, 0.08)":"none",border:"1px solid",borderColor:I?"var(--cyan)":"var(--border)",borderRadius:"4px 0 0 4px",padding:"3px 8px",color:I?"var(--cyan)":"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:11,lineHeight:1,display:"flex",alignItems:"center",gap:4},onMouseEnter:x=>{I||(x.currentTarget.style.color="var(--text)",x.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:x=>{I||(x.currentTarget.style.color="var(--text-dim)",x.currentTarget.style.borderColor="var(--border)")},children:[h.jsx("span",{style:{fontSize:13,...I?{animation:"spin 2s linear infinite"}:{}},children:"↻"}),I?`${I}m`:"all"]}),h.jsx("button",{onClick:()=>le(x=>!x),title:"Auto-refresh options",style:{background:I?"rgba(34, 211, 238, 0.08)":"none",border:"1px solid",borderColor:I?"var(--cyan)":"var(--border)",borderLeft:"none",borderRadius:"0 4px 4px 0",padding:"3px 5px",color:I?"var(--cyan)":"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:8,lineHeight:1,display:"flex",alignItems:"center"},onMouseEnter:x=>{I||(x.currentTarget.style.color="var(--text)",x.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:x=>{I||(x.currentTarget.style.color="var(--text-dim)",x.currentTarget.style.borderColor="var(--border)")},children:"▼"}),G&&h.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,background:"var(--panel)",border:"1px solid var(--border)",borderRadius:6,minWidth:180,zIndex:200,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},children:[h.jsx(Ks,{label:"Refresh now",hint:"↻",onClick:()=>{et(),le(!1)}}),h.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}}),h.jsx(Ks,{label:"Every 1 min",active:I===1,onClick:()=>{H(I===1?null:1),le(!1)}}),h.jsx(Ks,{label:"Every 5 min",active:I===5,onClick:()=>{H(I===5?null:5),le(!1)}}),h.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}}),h.jsxs("div",{style:{padding:"6px 12px",display:"flex",alignItems:"center",gap:6},children:[h.jsx("span",{style:{fontSize:11,color:"var(--text-dim)",whiteSpace:"nowrap"},children:"Every"}),h.jsx("input",{type:"number",min:"1",value:me,onChange:x=>Oe(x.target.value),onKeyDown:x=>{if(x.key==="Enter"){const q=parseInt(me,10);q>0&&(H(q),le(!1),Oe(""))}},placeholder:"N",style:{background:"var(--bg)",border:"1px solid var(--border)",borderRadius:3,padding:"3px 6px",color:"var(--text)",fontFamily:"inherit",fontSize:11,outline:"none",width:44,textAlign:"center"},autoFocus:!0}),h.jsx("span",{style:{fontSize:11,color:"var(--text-dim)"},children:"min"}),h.jsx("button",{onClick:()=>{const x=parseInt(me,10);x>0&&(H(x),le(!1),Oe(""))},style:{background:"none",border:"1px solid var(--border)",borderRadius:3,padding:"2px 8px",color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:10},children:"Set"})]}),I&&h.jsxs(h.Fragment,{children:[h.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}}),h.jsx(Ks,{label:"Turn off auto-refresh",hint:"✕",onClick:()=>{H(null),le(!1),Oe("")}})]})]})]})]})]}),u&&h.jsxs("div",{style:{padding:"8px 20px",background:"var(--red-bg)",borderBottom:"1px solid var(--red)",color:"var(--red)",fontSize:12,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsx("span",{children:u}),h.jsx("button",{onClick:()=>c(null),style:{background:"none",border:"none",color:"var(--red)",cursor:"pointer",fontFamily:"inherit",fontSize:14},children:"x"})]}),h.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[w&&h.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},children:h.jsxs("div",{style:{background:"var(--panel)",border:"1px solid var(--border)",borderRadius:8,padding:"32px 40px",display:"flex",flexDirection:"column",gap:12,minWidth:420},children:[w==="postgres"&&h.jsxs(h.Fragment,{children:[h.jsx("span",{style:{color:"var(--text)",fontSize:14,fontWeight:600},children:"Connect to PostgreSQL"}),h.jsx("input",{type:"text",value:ze,onChange:x=>Pe(x.target.value),onKeyDown:x=>{x.key==="Enter"&&ze.trim()&&Mn()},placeholder:"postgresql://user:password@host:5432/dbname",style:nt,autoFocus:!0}),h.jsx("input",{type:"text",value:Ct,onChange:x=>Dt(x.target.value),placeholder:"Label (optional, e.g. prod, staging)",style:nt}),h.jsxs("div",{style:{display:"flex",gap:8},children:[h.jsx("button",{onClick:Mn,disabled:Ze||!ze.trim(),style:{background:"var(--purple)",border:"none",borderRadius:6,padding:"10px 16px",color:"#fff",fontFamily:"inherit",fontSize:13,fontWeight:600,cursor:Ze?"wait":"pointer",opacity:Ze||!ze.trim()?.5:1,flex:1},children:Ze?"Connecting...":"Connect"}),h.jsx("button",{onClick:()=>V(null),style:{background:"none",border:"1px solid var(--border)",borderRadius:6,padding:"10px 16px",color:"var(--text-dim)",fontFamily:"inherit",fontSize:13,cursor:"pointer"},children:"Cancel"})]})]}),w==="redis"&&h.jsxs(h.Fragment,{children:[h.jsx("span",{style:{color:"var(--text)",fontSize:14,fontWeight:600},children:"Connect to Redis"}),h.jsx("input",{type:"text",value:ce,onChange:x=>Ue(x.target.value),onKeyDown:x=>{x.key==="Enter"&&ce.trim()&&Ll()},placeholder:"redis://localhost:6379",style:nt,autoFocus:!0}),h.jsx("input",{type:"text",value:It,onChange:x=>cl(x.target.value),placeholder:"Label (optional, e.g. cache, sessions)",style:nt}),h.jsxs("div",{style:{display:"flex",gap:8},children:[h.jsx("button",{onClick:Ll,disabled:Ze||!ce.trim(),style:{background:"var(--red)",border:"none",borderRadius:6,padding:"10px 16px",color:"#fff",fontFamily:"inherit",fontSize:13,fontWeight:600,cursor:Ze?"wait":"pointer",opacity:Ze||!ce.trim()?.5:1,flex:1},children:Ze?"Connecting...":"Connect"}),h.jsx("button",{onClick:()=>V(null),style:{background:"none",border:"1px solid var(--border)",borderRadius:6,padding:"10px 16px",color:"var(--text-dim)",fontFamily:"inherit",fontSize:13,cursor:"pointer"},children:"Cancel"})]})]}),w==="bigquery"&&h.jsxs(h.Fragment,{children:[h.jsx("span",{style:{color:"var(--text)",fontSize:14,fontWeight:600},children:"Connect to BigQuery"}),h.jsx("input",{type:"text",value:Dl,onChange:x=>ci(x.target.value),placeholder:"GCP Project ID (e.g. my-project)",style:nt,autoFocus:!0}),h.jsx("input",{type:"text",value:fi,onChange:x=>Cn(x.target.value),onKeyDown:x=>{x.key==="Enter"&&Dl.trim()&&fi.trim()&&dl()},placeholder:"Dataset (e.g. my_dataset)",style:nt}),h.jsx("input",{type:"text",value:Ra,onChange:x=>wa(x.target.value),placeholder:"Service account JSON path (optional)",style:nt}),h.jsx("input",{type:"text",value:Ol,onChange:x=>bt(x.target.value),placeholder:"Label (optional)",style:nt}),h.jsxs("div",{style:{display:"flex",gap:8},children:[h.jsx("button",{onClick:dl,disabled:Ze||!Dl.trim()||!fi.trim(),style:{background:"var(--green)",border:"none",borderRadius:6,padding:"10px 16px",color:"#fff",fontFamily:"inherit",fontSize:13,fontWeight:600,cursor:Ze?"wait":"pointer",opacity:Ze||!Dl.trim()||!fi.trim()?.5:1,flex:1},children:Ze?"Connecting...":"Connect"}),h.jsx("button",{onClick:()=>V(null),style:{background:"none",border:"1px solid var(--border)",borderRadius:6,padding:"10px 16px",color:"var(--text-dim)",fontFamily:"inherit",fontSize:13,cursor:"pointer"},children:"Cancel"})]})]}),w==="s3"&&h.jsxs(h.Fragment,{children:[h.jsx("span",{style:{color:"var(--text)",fontSize:14,fontWeight:600},children:"Connect to S3"}),h.jsx("input",{type:"text",value:Fe,onChange:x=>_n(x.target.value),placeholder:"Endpoint URL (e.g. http://localhost:9000)",style:nt,autoFocus:!0}),h.jsx("input",{type:"text",value:Ni,onChange:x=>Hi(x.target.value),placeholder:"Access Key ID",style:nt}),h.jsx("input",{type:"password",value:ki,onChange:x=>za(x.target.value),placeholder:"Secret Access Key",style:nt}),h.jsx("input",{type:"text",value:Ca,onChange:x=>xt(x.target.value),placeholder:"Region (default: us-east-1)",style:nt}),h.jsx("input",{type:"text",value:Ta,onChange:x=>zn(x.target.value),placeholder:"Label (optional, e.g. prod, logs)",style:nt}),h.jsxs("div",{style:{display:"flex",gap:8},children:[h.jsx("button",{onClick:An,disabled:Ze,style:{background:"var(--orange)",border:"none",borderRadius:6,padding:"10px 16px",color:"#fff",fontFamily:"inherit",fontSize:13,fontWeight:600,cursor:Ze?"wait":"pointer",opacity:Ze?.5:1,flex:1},children:Ze?"Connecting...":"Connect"}),h.jsx("button",{onClick:()=>V(null),style:{background:"none",border:"1px solid var(--border)",borderRadius:6,padding:"10px 16px",color:"var(--text-dim)",fontFamily:"inherit",fontSize:13,cursor:"pointer"},children:"Cancel"})]})]})]})}),!w&&Qe&&ft.length>0&&h.jsx(Vp,{ref:K,panels:ft,locked:Qe.locked,focusPanelId:Q,focusCounter:F,SOURCE_CONFIG:tr,panelDisplayName:Na,onPanelClose:ja,onToggleFilters:ar,onLayoutChange:Oa,onViewModeChange:Ma,onCopyPanel:Da,onChartTypeChange:Aa,onUpdatePanelLinks:mi,renderPanel:x=>{const q=Qe.locked;return x.sourceType==="postgres"||x.sourceType==="bigquery"?h.jsx(Tp,{tab:x,updateTab:J=>Nl(x.id,J),allPanels:ft,pageSize:a,setError:c,refreshKey:he,locked:q},x.id):x.sourceType==="redis"?h.jsx(Ap,{tab:x,updateTab:J=>Nl(x.id,J),pageSize:a,setError:c,refreshKey:he,locked:q},x.id):x.sourceType==="s3"?h.jsx(Np,{tab:x,updateTab:J=>Nl(x.id,J),pageSize:a,setError:c,refreshKey:he,locked:q},x.id):null}},v),!w&&!Qe&&h.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-dim)",flexDirection:"column",gap:8},children:h.jsx("span",{children:"Click + to create a dashboard"})}),!w&&Qe&&ft.length===0&&h.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-dim)",flexDirection:"column",gap:12},children:[h.jsx("span",{style:{fontSize:14},children:Qe.name}),h.jsxs("span",{children:["Click ",h.jsx("strong",{children:"+ Panel"})," to add a data source"]}),!Ui&&h.jsx("span",{style:{fontSize:11},children:"Connect to PostgreSQL, BigQuery, Redis, or S3 to get started"})]})]})]})}function ey({pickerStage:d,pickerType:n,pickerInstance:a,instancesOfType:r,handlePickType:u,handlePickInstance:c,setShowSourcePicker:g,setShowConnectForm:m,setPickerStage:E,setPickerType:y,setPickerInstance:b,pgTablesCache:v,s3BucketsCache:T,instances:Q,activePanels:Z,addPgPanel:F,addS3Panel:ie}){var he,pe;return h.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,background:"var(--panel)",border:"1px solid var(--border)",borderRadius:6,minWidth:240,maxHeight:400,overflowY:"auto",zIndex:200,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},children:[d==="type"&&h.jsxs(h.Fragment,{children:[h.jsx(Js,{typeKey:"postgres",label:"PostgreSQL",badge:"PG",connected:r("postgres"),onClick:()=>u("postgres"),onConnect:()=>{g(!1),m("postgres")}}),h.jsx(Js,{typeKey:"bigquery",label:"BigQuery",badge:"BQ",connected:r("bigquery"),onClick:()=>u("bigquery"),onConnect:()=>{g(!1),m("bigquery")}}),h.jsx(Js,{typeKey:"redis",label:"Redis",badge:"RD",connected:r("redis"),onClick:()=>u("redis"),onConnect:()=>{g(!1),m("redis")}}),h.jsx(Js,{typeKey:"s3",label:"S3",badge:"S3",connected:r("s3"),onClick:()=>u("s3"),onConnect:()=>{g(!1),m("s3")}})]}),d==="instance"&&n&&h.jsxs(h.Fragment,{children:[h.jsx("div",{onClick:()=>{E("type"),y(null)},style:{padding:"6px 12px",cursor:"pointer",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)"},onMouseEnter:W=>{W.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:W=>{W.currentTarget.style.background="transparent"},children:"◀ Back"}),r(n).map(W=>h.jsxs("div",{onClick:()=>c(W),style:{padding:"8px 12px",cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",gap:8,color:"var(--text)"},onMouseEnter:re=>{re.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:re=>{re.currentTarget.style.background="transparent"},children:[h.jsx("span",{style:{color:tr[n].color,fontWeight:600,fontSize:10},children:tr[n].label}),h.jsx("span",{children:W.label}),n!=="redis"&&h.jsx("span",{style:{color:"var(--text-dim)",fontSize:10,marginLeft:"auto"},children:"▶"})]},W.id)),h.jsx("div",{onClick:()=>{g(!1),m(n)},style:{padding:"8px 12px",cursor:"pointer",fontSize:12,color:"var(--text-dim)",borderTop:"1px solid var(--border)"},onMouseEnter:W=>{W.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:W=>{W.currentTarget.style.background="transparent"},children:"+ Connect new..."})]}),d==="target"&&a&&h.jsxs(h.Fragment,{children:[h.jsx("div",{onClick:()=>{r(n).length>1?(E("instance"),b(null)):(E("type"),y(null),b(null))},style:{padding:"6px 12px",cursor:"pointer",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)"},onMouseEnter:W=>{W.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:W=>{W.currentTarget.style.background="transparent"},children:"◀ Back"}),(n==="postgres"||n==="bigquery")&&h.jsxs(h.Fragment,{children:[(v[a]||[]).map(W=>{const re=Q.find(H=>H.id===a),I=Z.some(H=>(H.sourceType==="postgres"||H.sourceType==="bigquery")&&H.instanceId===a&&H.schema===W.schema&&H.name===W.name);return h.jsxs("div",{onClick:()=>F(a,(re==null?void 0:re.label)||a,W.schema,W.name,n),style:{padding:"8px 12px",cursor:"pointer",fontSize:12,display:"flex",justifyContent:"space-between",alignItems:"center",color:I?"var(--text-dim)":"var(--text)"},onMouseEnter:H=>{H.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:H=>{H.currentTarget.style.background="transparent"},children:[h.jsxs("span",{children:[W.schema,".",W.name]}),I&&h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"open"})]},`${W.schema}.${W.name}`)}),!v[a]&&h.jsx("div",{style:{padding:"12px",fontSize:12,color:"var(--text-dim)"},children:"Loading tables..."}),((he=v[a])==null?void 0:he.length)===0&&h.jsx("div",{style:{padding:"12px",fontSize:12,color:"var(--text-dim)"},children:"No tables found"})]}),n==="s3"&&h.jsxs(h.Fragment,{children:[(T[a]||[]).map(W=>{const re=Q.find(H=>H.id===a),I=Z.some(H=>H.sourceType==="s3"&&H.instanceId===a&&H.bucket===W.name);return h.jsxs("div",{onClick:()=>ie(a,(re==null?void 0:re.label)||a,W.name),style:{padding:"8px 12px",cursor:"pointer",fontSize:12,display:"flex",justifyContent:"space-between",alignItems:"center",color:I?"var(--text-dim)":"var(--text)"},onMouseEnter:H=>{H.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:H=>{H.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:W.name}),I&&h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"open"})]},W.name)}),!T[a]&&h.jsx("div",{style:{padding:"12px",fontSize:12,color:"var(--text-dim)"},children:"Loading buckets..."}),((pe=T[a])==null?void 0:pe.length)===0&&h.jsx("div",{style:{padding:"12px",fontSize:12,color:"var(--text-dim)"},children:"No buckets found"})]})]})]})}function Ks({label:d,hint:n,active:a,onClick:r}){return h.jsxs("div",{onClick:r,style:{padding:"7px 12px",cursor:"pointer",fontSize:12,display:"flex",justifyContent:"space-between",alignItems:"center",color:a?"var(--cyan)":"var(--text)"},onMouseEnter:u=>{u.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:u=>{u.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:d}),n&&h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:n}),a&&h.jsx("span",{style:{fontSize:10,color:"var(--cyan)"},children:"●"})]})}function zu({label:d,onClick:n}){return h.jsx("div",{onClick:n,style:{padding:"7px 12px",cursor:"pointer",fontSize:12,color:"var(--text)"},onMouseEnter:a=>{a.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:d})}function Js({typeKey:d,label:n,badge:a,connected:r,onClick:u,onConnect:c}){const g=tr[d];return r.length>0?h.jsxs("div",{onClick:u,style:{padding:"8px 12px",cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",gap:8},onMouseEnter:m=>{m.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:m=>{m.currentTarget.style.background="transparent"},children:[h.jsx("span",{style:{color:g.color,fontWeight:600,fontSize:10},children:a}),h.jsxs("span",{style:{color:"var(--text)"},children:[n,r.length>1&&h.jsxs("span",{style:{color:"var(--text-dim)",fontSize:10,marginLeft:4},children:["(",r.length,")"]})]}),h.jsx("span",{style:{color:"var(--text-dim)",fontSize:10,marginLeft:"auto"},children:"▶"})]}):h.jsxs("div",{onClick:c,style:{padding:"8px 12px",cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",gap:8},onMouseEnter:m=>{m.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:m=>{m.currentTarget.style.background="transparent"},children:[h.jsx("span",{style:{color:g.color,fontWeight:600,fontSize:10},children:a}),h.jsxs("span",{style:{color:"var(--text-dim)"},children:["Connect ",n,"..."]})]})}ap.createRoot(document.getElementById("root")).render(h.jsx(Im.StrictMode,{children:h.jsx(Pp,{})}));
