function yA(e,t){for(var r=0;r<t.length;r++){const o=t[r];if(typeof o!="string"&&!Array.isArray(o)){for(const i in o)if(i!=="default"&&!(i in e)){const l=Object.getOwnPropertyDescriptor(o,i);l&&Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>o[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&o(u)}).observe(document,{childList:!0,subtree:!0});function r(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(i){if(i.ep)return;i.ep=!0;const l=r(i);fetch(i.href,l)}})();function dg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bm={exports:{}},gl={};/**
 * @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 J0;function xA(){if(J0)return gl;J0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(o,i,l){var u=null;if(l!==void 0&&(u=""+l),i.key!==void 0&&(u=""+i.key),"key"in i){l={};for(var f in i)f!=="key"&&(l[f]=i[f])}else l=i;return i=l.ref,{$$typeof:e,type:o,key:u,ref:i!==void 0?i:null,props:l}}return gl.Fragment=t,gl.jsx=r,gl.jsxs=r,gl}var eb;function bA(){return eb||(eb=1,Bm.exports=xA()),Bm.exports}var d=bA(),Hm={exports:{}},ke={};/**
 * @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 tb;function wA(){if(tb)return ke;tb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.iterator;function b(R){return R===null||typeof R!="object"?null:(R=v&&R[v]||R["@@iterator"],typeof R=="function"?R:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,S={};function N(R,V,F){this.props=R,this.context=V,this.refs=S,this.updater=F||w}N.prototype.isReactComponent={},N.prototype.setState=function(R,V){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,V,"setState")},N.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function C(){}C.prototype=N.prototype;function T(R,V,F){this.props=R,this.context=V,this.refs=S,this.updater=F||w}var A=T.prototype=new C;A.constructor=T,E(A,N.prototype),A.isPureReactComponent=!0;var _=Array.isArray,O={H:null,A:null,T:null,S:null,V:null},L=Object.prototype.hasOwnProperty;function B(R,V,F,K,re,de){return F=de.ref,{$$typeof:e,type:R,key:V,ref:F!==void 0?F:null,props:de}}function I(R,V){return B(R.type,V,void 0,void 0,void 0,R.props)}function q(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function Q(R){var V={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(F){return V[F]})}var te=/\/+/g;function P(R,V){return typeof R=="object"&&R!==null&&R.key!=null?Q(""+R.key):V.toString(36)}function W(){}function k(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(W,W):(R.status="pending",R.then(function(V){R.status==="pending"&&(R.status="fulfilled",R.value=V)},function(V){R.status==="pending"&&(R.status="rejected",R.reason=V)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function Y(R,V,F,K,re){var de=typeof R;(de==="undefined"||de==="boolean")&&(R=null);var se=!1;if(R===null)se=!0;else switch(de){case"bigint":case"string":case"number":se=!0;break;case"object":switch(R.$$typeof){case e:case t:se=!0;break;case g:return se=R._init,Y(se(R._payload),V,F,K,re)}}if(se)return re=re(R),se=K===""?"."+P(R,0):K,_(re)?(F="",se!=null&&(F=se.replace(te,"$&/")+"/"),Y(re,V,F,"",function(pe){return pe})):re!=null&&(q(re)&&(re=I(re,F+(re.key==null||R&&R.key===re.key?"":(""+re.key).replace(te,"$&/")+"/")+se)),V.push(re)),1;se=0;var ie=K===""?".":K+":";if(_(R))for(var me=0;me<R.length;me++)K=R[me],de=ie+P(K,me),se+=Y(K,V,F,de,re);else if(me=b(R),typeof me=="function")for(R=me.call(R),me=0;!(K=R.next()).done;)K=K.value,de=ie+P(K,me++),se+=Y(K,V,F,de,re);else if(de==="object"){if(typeof R.then=="function")return Y(k(R),V,F,K,re);throw V=String(R),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return se}function M(R,V,F){if(R==null)return R;var K=[],re=0;return Y(R,K,"","",function(de){return V.call(F,de,re++)}),K}function $(R){if(R._status===-1){var V=R._result;V=V(),V.then(function(F){(R._status===0||R._status===-1)&&(R._status=1,R._result=F)},function(F){(R._status===0||R._status===-1)&&(R._status=2,R._result=F)}),R._status===-1&&(R._status=0,R._result=V)}if(R._status===1)return R._result.default;throw R._result}var U=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)};function z(){}return ke.Children={map:M,forEach:function(R,V,F){M(R,function(){V.apply(this,arguments)},F)},count:function(R){var V=0;return M(R,function(){V++}),V},toArray:function(R){return M(R,function(V){return V})||[]},only:function(R){if(!q(R))throw Error("React.Children.only expected to receive a single React element child.");return R}},ke.Component=N,ke.Fragment=r,ke.Profiler=i,ke.PureComponent=T,ke.StrictMode=o,ke.Suspense=m,ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,ke.__COMPILER_RUNTIME={__proto__:null,c:function(R){return O.H.useMemoCache(R)}},ke.cache=function(R){return function(){return R.apply(null,arguments)}},ke.cloneElement=function(R,V,F){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var K=E({},R.props),re=R.key,de=void 0;if(V!=null)for(se in V.ref!==void 0&&(de=void 0),V.key!==void 0&&(re=""+V.key),V)!L.call(V,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&V.ref===void 0||(K[se]=V[se]);var se=arguments.length-2;if(se===1)K.children=F;else if(1<se){for(var ie=Array(se),me=0;me<se;me++)ie[me]=arguments[me+2];K.children=ie}return B(R.type,re,void 0,void 0,de,K)},ke.createContext=function(R){return R={$$typeof:u,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:l,_context:R},R},ke.createElement=function(R,V,F){var K,re={},de=null;if(V!=null)for(K in V.key!==void 0&&(de=""+V.key),V)L.call(V,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(re[K]=V[K]);var se=arguments.length-2;if(se===1)re.children=F;else if(1<se){for(var ie=Array(se),me=0;me<se;me++)ie[me]=arguments[me+2];re.children=ie}if(R&&R.defaultProps)for(K in se=R.defaultProps,se)re[K]===void 0&&(re[K]=se[K]);return B(R,de,void 0,void 0,null,re)},ke.createRef=function(){return{current:null}},ke.forwardRef=function(R){return{$$typeof:f,render:R}},ke.isValidElement=q,ke.lazy=function(R){return{$$typeof:g,_payload:{_status:-1,_result:R},_init:$}},ke.memo=function(R,V){return{$$typeof:h,type:R,compare:V===void 0?null:V}},ke.startTransition=function(R){var V=O.T,F={};O.T=F;try{var K=R(),re=O.S;re!==null&&re(F,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(z,U)}catch(de){U(de)}finally{O.T=V}},ke.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},ke.use=function(R){return O.H.use(R)},ke.useActionState=function(R,V,F){return O.H.useActionState(R,V,F)},ke.useCallback=function(R,V){return O.H.useCallback(R,V)},ke.useContext=function(R){return O.H.useContext(R)},ke.useDebugValue=function(){},ke.useDeferredValue=function(R,V){return O.H.useDeferredValue(R,V)},ke.useEffect=function(R,V,F){var K=O.H;if(typeof F=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return K.useEffect(R,V)},ke.useId=function(){return O.H.useId()},ke.useImperativeHandle=function(R,V,F){return O.H.useImperativeHandle(R,V,F)},ke.useInsertionEffect=function(R,V){return O.H.useInsertionEffect(R,V)},ke.useLayoutEffect=function(R,V){return O.H.useLayoutEffect(R,V)},ke.useMemo=function(R,V){return O.H.useMemo(R,V)},ke.useOptimistic=function(R,V){return O.H.useOptimistic(R,V)},ke.useReducer=function(R,V,F){return O.H.useReducer(R,V,F)},ke.useRef=function(R){return O.H.useRef(R)},ke.useState=function(R){return O.H.useState(R)},ke.useSyncExternalStore=function(R,V,F){return O.H.useSyncExternalStore(R,V,F)},ke.useTransition=function(){return O.H.useTransition()},ke.version="19.1.0",ke}var nb;function ec(){return nb||(nb=1,Hm.exports=wA()),Hm.exports}var x=ec();const ae=dg(x),fS=yA({__proto__:null,default:ae},[x]);var $m={exports:{}},vl={},Im={exports:{}},Vm={};/**
 * @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 rb;function SA(){return rb||(rb=1,function(e){function t(M,$){var U=M.length;M.push($);e:for(;0<U;){var z=U-1>>>1,R=M[z];if(0<i(R,$))M[z]=$,M[U]=R,U=z;else break e}}function r(M){return M.length===0?null:M[0]}function o(M){if(M.length===0)return null;var $=M[0],U=M.pop();if(U!==$){M[0]=U;e:for(var z=0,R=M.length,V=R>>>1;z<V;){var F=2*(z+1)-1,K=M[F],re=F+1,de=M[re];if(0>i(K,U))re<R&&0>i(de,K)?(M[z]=de,M[re]=U,z=re):(M[z]=K,M[F]=U,z=F);else if(re<R&&0>i(de,U))M[z]=de,M[re]=U,z=re;else break e}}return $}function i(M,$){var U=M.sortIndex-$.sortIndex;return U!==0?U:M.id-$.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var m=[],h=[],g=1,v=null,b=3,w=!1,E=!1,S=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function _(M){for(var $=r(h);$!==null;){if($.callback===null)o(h);else if($.startTime<=M)o(h),$.sortIndex=$.expirationTime,t(m,$);else break;$=r(h)}}function O(M){if(S=!1,_(M),!E)if(r(m)!==null)E=!0,L||(L=!0,P());else{var $=r(h);$!==null&&Y(O,$.startTime-M)}}var L=!1,B=-1,I=5,q=-1;function Q(){return N?!0:!(e.unstable_now()-q<I)}function te(){if(N=!1,L){var M=e.unstable_now();q=M;var $=!0;try{e:{E=!1,S&&(S=!1,T(B),B=-1),w=!0;var U=b;try{t:{for(_(M),v=r(m);v!==null&&!(v.expirationTime>M&&Q());){var z=v.callback;if(typeof z=="function"){v.callback=null,b=v.priorityLevel;var R=z(v.expirationTime<=M);if(M=e.unstable_now(),typeof R=="function"){v.callback=R,_(M),$=!0;break t}v===r(m)&&o(m),_(M)}else o(m);v=r(m)}if(v!==null)$=!0;else{var V=r(h);V!==null&&Y(O,V.startTime-M),$=!1}}break e}finally{v=null,b=U,w=!1}$=void 0}}finally{$?P():L=!1}}}var P;if(typeof A=="function")P=function(){A(te)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,k=W.port2;W.port1.onmessage=te,P=function(){k.postMessage(null)}}else P=function(){C(te,0)};function Y(M,$){B=C(function(){M(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(M){switch(b){case 1:case 2:case 3:var $=3;break;default:$=b}var U=b;b=$;try{return M()}finally{b=U}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(M,$){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var U=b;b=M;try{return $()}finally{b=U}},e.unstable_scheduleCallback=function(M,$,U){var z=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?z+U:z):U=z,M){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=U+R,M={id:g++,callback:$,priorityLevel:M,startTime:U,expirationTime:R,sortIndex:-1},U>z?(M.sortIndex=U,t(h,M),r(m)===null&&M===r(h)&&(S?(T(B),B=-1):S=!0,Y(O,U-z))):(M.sortIndex=R,t(m,M),E||w||(E=!0,L||(L=!0,P()))),M},e.unstable_shouldYield=Q,e.unstable_wrapCallback=function(M){var $=b;return function(){var U=b;b=$;try{return M.apply(this,arguments)}finally{b=U}}}}(Vm)),Vm}var ab;function EA(){return ab||(ab=1,Im.exports=SA()),Im.exports}var qm={exports:{}},Zt={};/**
 * @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 ob;function NA(){if(ob)return Zt;ob=1;var e=ec();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var o={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},i=Symbol.for("react.portal");function l(m,h,g){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:v==null?null:""+v,children:m,containerInfo:h,implementation:g}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Zt.createPortal=function(m,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return l(m,h,null,g)},Zt.flushSync=function(m){var h=u.T,g=o.p;try{if(u.T=null,o.p=2,m)return m()}finally{u.T=h,o.p=g,o.d.f()}},Zt.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(m,h))},Zt.prefetchDNS=function(m){typeof m=="string"&&o.d.D(m)},Zt.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var g=h.as,v=f(g,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?o.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:v,integrity:b,fetchPriority:w}):g==="script"&&o.d.X(m,{crossOrigin:v,integrity:b,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Zt.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=f(h.as,h.crossOrigin);o.d.M(m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(m)},Zt.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,v=f(g,h.crossOrigin);o.d.L(m,g,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Zt.preloadModule=function(m,h){if(typeof m=="string")if(h){var g=f(h.as,h.crossOrigin);o.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(m)},Zt.requestFormReset=function(m){o.d.r(m)},Zt.unstable_batchedUpdates=function(m,h){return m(h)},Zt.useFormState=function(m,h,g){return u.H.useFormState(m,h,g)},Zt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Zt.version="19.1.0",Zt}var sb;function hS(){if(sb)return qm.exports;sb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),qm.exports=NA(),qm.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 ib;function CA(){if(ib)return vl;ib=1;var e=EA(),t=ec(),r=hS();function o(n){var a="https://react.dev/errors/"+n;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+n+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function l(n){var a=n,s=n;if(n.alternate)for(;a.return;)a=a.return;else{n=a;do a=n,(a.flags&4098)!==0&&(s=a.return),n=a.return;while(n)}return a.tag===3?s:null}function u(n){if(n.tag===13){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function f(n){if(l(n)!==n)throw Error(o(188))}function m(n){var a=n.alternate;if(!a){if(a=l(n),a===null)throw Error(o(188));return a!==n?null:n}for(var s=n,c=a;;){var p=s.return;if(p===null)break;var y=p.alternate;if(y===null){if(c=p.return,c!==null){s=c;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===s)return f(p),n;if(y===c)return f(p),a;y=y.sibling}throw Error(o(188))}if(s.return!==c.return)s=p,c=y;else{for(var j=!1,D=p.child;D;){if(D===s){j=!0,s=p,c=y;break}if(D===c){j=!0,c=p,s=y;break}D=D.sibling}if(!j){for(D=y.child;D;){if(D===s){j=!0,s=y,c=p;break}if(D===c){j=!0,c=y,s=p;break}D=D.sibling}if(!j)throw Error(o(189))}}if(s.alternate!==c)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?n:a}function h(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n;for(n=n.child;n!==null;){if(a=h(n),a!==null)return a;n=n.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),T=Symbol.for("react.consumer"),A=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function P(n){return n===null||typeof n!="object"?null:(n=te&&n[te]||n["@@iterator"],typeof n=="function"?n:null)}var W=Symbol.for("react.client.reference");function k(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===W?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case E:return"Fragment";case N:return"Profiler";case S:return"StrictMode";case O:return"Suspense";case L:return"SuspenseList";case q:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case w:return"Portal";case A:return(n.displayName||"Context")+".Provider";case T:return(n._context.displayName||"Context")+".Consumer";case _:var a=n.render;return n=n.displayName,n||(n=a.displayName||a.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case B:return a=n.displayName||null,a!==null?a:k(n.type)||"Memo";case I:a=n._payload,n=n._init;try{return k(n(a))}catch{}}return null}var Y=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},z=[],R=-1;function V(n){return{current:n}}function F(n){0>R||(n.current=z[R],z[R]=null,R--)}function K(n,a){R++,z[R]=n.current,n.current=a}var re=V(null),de=V(null),se=V(null),ie=V(null);function me(n,a){switch(K(se,a),K(de,n),K(re,null),a.nodeType){case 9:case 11:n=(n=a.documentElement)&&(n=n.namespaceURI)?_0(n):0;break;default:if(n=a.tagName,a=a.namespaceURI)a=_0(a),n=A0(a,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}F(re),K(re,n)}function pe(){F(re),F(de),F(se)}function ge(n){n.memoizedState!==null&&K(ie,n);var a=re.current,s=A0(a,n.type);a!==s&&(K(de,n),K(re,s))}function Se(n){de.current===n&&(F(re),F(de)),ie.current===n&&(F(ie),dl._currentValue=U)}var we=Object.prototype.hasOwnProperty,Ge=e.unstable_scheduleCallback,Ke=e.unstable_cancelCallback,Je=e.unstable_shouldYield,mt=e.unstable_requestPaint,he=e.unstable_now,fe=e.unstable_getCurrentPriorityLevel,Te=e.unstable_ImmediatePriority,qe=e.unstable_UserBlockingPriority,Be=e.unstable_NormalPriority,on=e.unstable_LowPriority,Rr=e.unstable_IdlePriority,Xn=e.log,ha=e.unstable_setDisableYieldValue,yn=null,bt=null;function en(n){if(typeof Xn=="function"&&ha(n),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(yn,n)}catch{}}var Ct=Math.clz32?Math.clz32:xn,io=Math.log,zt=Math.LN2;function xn(n){return n>>>=0,n===0?32:31-(io(n)/zt|0)|0}var Mn=256,Dn=4194304;function tn(n){var a=n&42;if(a!==0)return a;switch(n&-n){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:case 262144:case 524288:case 1048576:case 2097152:return n&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function sn(n,a,s){var c=n.pendingLanes;if(c===0)return 0;var p=0,y=n.suspendedLanes,j=n.pingedLanes;n=n.warmLanes;var D=c&134217727;return D!==0?(c=D&~y,c!==0?p=tn(c):(j&=D,j!==0?p=tn(j):s||(s=D&~n,s!==0&&(p=tn(s))))):(D=c&~y,D!==0?p=tn(D):j!==0?p=tn(j):s||(s=c&~n,s!==0&&(p=tn(s)))),p===0?0:a!==0&&a!==p&&(a&y)===0&&(y=p&-p,s=a&-a,y>=s||y===32&&(s&4194048)!==0)?a:p}function Xt(n,a){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&a)===0}function lo(n,a){switch(n){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 rs(){var n=Mn;return Mn<<=1,(Mn&4194048)===0&&(Mn=256),n}function ma(){var n=Dn;return Dn<<=1,(Dn&62914560)===0&&(Dn=4194304),n}function co(n){for(var a=[],s=0;31>s;s++)a.push(n);return a}function pa(n,a){n.pendingLanes|=a,a!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Mr(n,a,s,c,p,y){var j=n.pendingLanes;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=s,n.entangledLanes&=s,n.errorRecoveryDisabledLanes&=s,n.shellSuspendCounter=0;var D=n.entanglements,H=n.expirationTimes,J=n.hiddenUpdates;for(s=j&~s;0<s;){var le=31-Ct(s),ue=1<<le;D[le]=0,H[le]=-1;var ee=J[le];if(ee!==null)for(J[le]=null,le=0;le<ee.length;le++){var ne=ee[le];ne!==null&&(ne.lane&=-536870913)}s&=~ue}c!==0&&yc(n,c,0),y!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=y&~(j&~a))}function yc(n,a,s){n.pendingLanes|=a,n.suspendedLanes&=~a;var c=31-Ct(a);n.entangledLanes|=a,n.entanglements[c]=n.entanglements[c]|1073741824|s&4194090}function xc(n,a){var s=n.entangledLanes|=a;for(n=n.entanglements;s;){var c=31-Ct(s),p=1<<c;p&a|n[c]&a&&(n[c]|=a),s&=~p}}function xi(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function bi(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function bc(){var n=$.p;return n!==0?n:(n=window.event,n===void 0?32:F0(n.type))}function Df(n,a){var s=$.p;try{return $.p=n,a()}finally{$.p=s}}var gr=Math.random().toString(36).slice(2),Lt="__reactFiber$"+gr,Wt="__reactProps$"+gr,ga="__reactContainer$"+gr,wi="__reactEvents$"+gr,Of="__reactListeners$"+gr,kf="__reactHandles$"+gr,wc="__reactResources$"+gr,uo="__reactMarker$"+gr;function Si(n){delete n[Lt],delete n[Wt],delete n[wi],delete n[Of],delete n[kf]}function Dr(n){var a=n[Lt];if(a)return a;for(var s=n.parentNode;s;){if(a=s[ga]||s[Lt]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(n=D0(n);n!==null;){if(s=n[Lt])return s;n=D0(n)}return a}n=s,s=n.parentNode}return null}function va(n){if(n=n[Lt]||n[ga]){var a=n.tag;if(a===5||a===6||a===13||a===26||a===27||a===3)return n}return null}function fo(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n.stateNode;throw Error(o(33))}function ya(n){var a=n[wc];return a||(a=n[wc]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function jt(n){n[uo]=!0}var Sc=new Set,Ec={};function Or(n,a){xa(n,a),xa(n+"Capture",a)}function xa(n,a){for(Ec[n]=a,n=0;n<a.length;n++)Sc.add(a[n])}var Nc=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]*$"),Cc={},jc={};function zf(n){return we.call(jc,n)?!0:we.call(Cc,n)?!1:Nc.test(n)?jc[n]=!0:(Cc[n]=!0,!1)}function as(n,a,s){if(zf(a))if(s===null)n.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":n.removeAttribute(a);return;case"boolean":var c=a.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(a);return}}n.setAttribute(a,""+s)}}function os(n,a,s){if(s===null)n.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttribute(a,""+s)}}function Wn(n,a,s,c){if(c===null)n.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttributeNS(a,s,""+c)}}var ss,_c;function ba(n){if(ss===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);ss=a&&a[1]||"",_c=-1<s.stack.indexOf(`
    at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ss+n+_c}var Ei=!1;function ho(n,a){if(!n||Ei)return"";Ei=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(a){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(ne){var ee=ne}Reflect.construct(n,[],ue)}else{try{ue.call()}catch(ne){ee=ne}n.call(ue.prototype)}}else{try{throw Error()}catch(ne){ee=ne}(ue=n())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(ne){if(ne&&ee&&typeof ne.stack=="string")return[ne.stack,ee.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=c.DetermineComponentFrameRoot(),j=y[0],D=y[1];if(j&&D){var H=j.split(`
`),J=D.split(`
`);for(p=c=0;c<H.length&&!H[c].includes("DetermineComponentFrameRoot");)c++;for(;p<J.length&&!J[p].includes("DetermineComponentFrameRoot");)p++;if(c===H.length||p===J.length)for(c=H.length-1,p=J.length-1;1<=c&&0<=p&&H[c]!==J[p];)p--;for(;1<=c&&0<=p;c--,p--)if(H[c]!==J[p]){if(c!==1||p!==1)do if(c--,p--,0>p||H[c]!==J[p]){var le=`
`+H[c].replace(" at new "," at ");return n.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",n.displayName)),le}while(1<=c&&0<=p);break}}}finally{Ei=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?ba(s):""}function fj(n){switch(n.tag){case 26:case 27:case 5:return ba(n.type);case 16:return ba("Lazy");case 13:return ba("Suspense");case 19:return ba("SuspenseList");case 0:case 15:return ho(n.type,!1);case 11:return ho(n.type.render,!1);case 1:return ho(n.type,!0);case 31:return ba("Activity");default:return""}}function wv(n){try{var a="";do a+=fj(n),n=n.return;while(n);return a}catch(s){return`
Error generating stack: `+s.message+`
`+s.stack}}function On(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Sv(n){var a=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function hj(n){var a=Sv(n)?"checked":"value",s=Object.getOwnPropertyDescriptor(n.constructor.prototype,a),c=""+n[a];if(!n.hasOwnProperty(a)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var p=s.get,y=s.set;return Object.defineProperty(n,a,{configurable:!0,get:function(){return p.call(this)},set:function(j){c=""+j,y.call(this,j)}}),Object.defineProperty(n,a,{enumerable:s.enumerable}),{getValue:function(){return c},setValue:function(j){c=""+j},stopTracking:function(){n._valueTracker=null,delete n[a]}}}}function Ac(n){n._valueTracker||(n._valueTracker=hj(n))}function Ev(n){if(!n)return!1;var a=n._valueTracker;if(!a)return!0;var s=a.getValue(),c="";return n&&(c=Sv(n)?n.checked?"true":"false":n.value),n=c,n!==s?(a.setValue(n),!0):!1}function Tc(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var mj=/[\n"\\]/g;function kn(n){return n.replace(mj,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Lf(n,a,s,c,p,y,j,D){n.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?n.type=j:n.removeAttribute("type"),a!=null?j==="number"?(a===0&&n.value===""||n.value!=a)&&(n.value=""+On(a)):n.value!==""+On(a)&&(n.value=""+On(a)):j!=="submit"&&j!=="reset"||n.removeAttribute("value"),a!=null?Pf(n,j,On(a)):s!=null?Pf(n,j,On(s)):c!=null&&n.removeAttribute("value"),p==null&&y!=null&&(n.defaultChecked=!!y),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?n.name=""+On(D):n.removeAttribute("name")}function Nv(n,a,s,c,p,y,j,D){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(n.type=y),a!=null||s!=null){if(!(y!=="submit"&&y!=="reset"||a!=null))return;s=s!=null?""+On(s):"",a=a!=null?""+On(a):s,D||a===n.value||(n.value=a),n.defaultValue=a}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=D?n.checked:!!c,n.defaultChecked=!!c,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(n.name=j)}function Pf(n,a,s){a==="number"&&Tc(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function is(n,a,s,c){if(n=n.options,a){a={};for(var p=0;p<s.length;p++)a["$"+s[p]]=!0;for(s=0;s<n.length;s++)p=a.hasOwnProperty("$"+n[s].value),n[s].selected!==p&&(n[s].selected=p),p&&c&&(n[s].defaultSelected=!0)}else{for(s=""+On(s),a=null,p=0;p<n.length;p++){if(n[p].value===s){n[p].selected=!0,c&&(n[p].defaultSelected=!0);return}a!==null||n[p].disabled||(a=n[p])}a!==null&&(a.selected=!0)}}function Cv(n,a,s){if(a!=null&&(a=""+On(a),a!==n.value&&(n.value=a),s==null)){n.defaultValue!==a&&(n.defaultValue=a);return}n.defaultValue=s!=null?""+On(s):""}function jv(n,a,s,c){if(a==null){if(c!=null){if(s!=null)throw Error(o(92));if(Y(c)){if(1<c.length)throw Error(o(93));c=c[0]}s=c}s==null&&(s=""),a=s}s=On(a),n.defaultValue=s,c=n.textContent,c===s&&c!==""&&c!==null&&(n.value=c)}function ls(n,a){if(a){var s=n.firstChild;if(s&&s===n.lastChild&&s.nodeType===3){s.nodeValue=a;return}}n.textContent=a}var pj=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 _v(n,a,s){var c=a.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?n.setProperty(a,""):a==="float"?n.cssFloat="":n[a]="":c?n.setProperty(a,s):typeof s!="number"||s===0||pj.has(a)?a==="float"?n.cssFloat=s:n[a]=(""+s).trim():n[a]=s+"px"}function Av(n,a,s){if(a!=null&&typeof a!="object")throw Error(o(62));if(n=n.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||a!=null&&a.hasOwnProperty(c)||(c.indexOf("--")===0?n.setProperty(c,""):c==="float"?n.cssFloat="":n[c]="");for(var p in a)c=a[p],a.hasOwnProperty(p)&&s[p]!==c&&_v(n,p,c)}else for(var y in a)a.hasOwnProperty(y)&&_v(n,y,a[y])}function Uf(n){if(n.indexOf("-")===-1)return!1;switch(n){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 gj=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"]]),vj=/^[\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 Rc(n){return vj.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}var Bf=null;function Hf(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var cs=null,us=null;function Tv(n){var a=va(n);if(a&&(n=a.stateNode)){var s=n[Wt]||null;e:switch(n=a.stateNode,a.type){case"input":if(Lf(n,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),a=s.name,s.type==="radio"&&a!=null){for(s=n;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+kn(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var c=s[a];if(c!==n&&c.form===n.form){var p=c[Wt]||null;if(!p)throw Error(o(90));Lf(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(a=0;a<s.length;a++)c=s[a],c.form===n.form&&Ev(c)}break e;case"textarea":Cv(n,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&is(n,!!s.multiple,a,!1)}}}var $f=!1;function Rv(n,a,s){if($f)return n(a,s);$f=!0;try{var c=n(a);return c}finally{if($f=!1,(cs!==null||us!==null)&&(pu(),cs&&(a=cs,n=us,us=cs=null,Tv(a),n)))for(a=0;a<n.length;a++)Tv(n[a])}}function Ni(n,a){var s=n.stateNode;if(s===null)return null;var c=s[Wt]||null;if(c===null)return null;s=c[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(n=n.type,c=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!c;break e;default:n=!1}if(n)return null;if(s&&typeof s!="function")throw Error(o(231,a,typeof s));return s}var kr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),If=!1;if(kr)try{var Ci={};Object.defineProperty(Ci,"passive",{get:function(){If=!0}}),window.addEventListener("test",Ci,Ci),window.removeEventListener("test",Ci,Ci)}catch{If=!1}var wa=null,Vf=null,Mc=null;function Mv(){if(Mc)return Mc;var n,a=Vf,s=a.length,c,p="value"in wa?wa.value:wa.textContent,y=p.length;for(n=0;n<s&&a[n]===p[n];n++);var j=s-n;for(c=1;c<=j&&a[s-c]===p[y-c];c++);return Mc=p.slice(n,1<c?1-c:void 0)}function Dc(n){var a=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&a===13&&(n=13)):n=a,n===10&&(n=13),32<=n||n===13?n:0}function Oc(){return!0}function Dv(){return!1}function ln(n){function a(s,c,p,y,j){this._reactName=s,this._targetInst=p,this.type=c,this.nativeEvent=y,this.target=j,this.currentTarget=null;for(var D in n)n.hasOwnProperty(D)&&(s=n[D],this[D]=s?s(y):y[D]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Oc:Dv,this.isPropagationStopped=Dv,this}return g(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Oc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Oc)},persist:function(){},isPersistent:Oc}),a}var mo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kc=ln(mo),ji=g({},mo,{view:0,detail:0}),yj=ln(ji),qf,Yf,_i,zc=g({},ji,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ff,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==_i&&(_i&&n.type==="mousemove"?(qf=n.screenX-_i.screenX,Yf=n.screenY-_i.screenY):Yf=qf=0,_i=n),qf)},movementY:function(n){return"movementY"in n?n.movementY:Yf}}),Ov=ln(zc),xj=g({},zc,{dataTransfer:0}),bj=ln(xj),wj=g({},ji,{relatedTarget:0}),Gf=ln(wj),Sj=g({},mo,{animationName:0,elapsedTime:0,pseudoElement:0}),Ej=ln(Sj),Nj=g({},mo,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),Cj=ln(Nj),jj=g({},mo,{data:0}),kv=ln(jj),_j={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Aj={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"},Tj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Rj(n){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(n):(n=Tj[n])?!!a[n]:!1}function Ff(){return Rj}var Mj=g({},ji,{key:function(n){if(n.key){var a=_j[n.key]||n.key;if(a!=="Unidentified")return a}return n.type==="keypress"?(n=Dc(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?Aj[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ff,charCode:function(n){return n.type==="keypress"?Dc(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Dc(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),Dj=ln(Mj),Oj=g({},zc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zv=ln(Oj),kj=g({},ji,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ff}),zj=ln(kj),Lj=g({},mo,{propertyName:0,elapsedTime:0,pseudoElement:0}),Pj=ln(Lj),Uj=g({},zc,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),Bj=ln(Uj),Hj=g({},mo,{newState:0,oldState:0}),$j=ln(Hj),Ij=[9,13,27,32],Xf=kr&&"CompositionEvent"in window,Ai=null;kr&&"documentMode"in document&&(Ai=document.documentMode);var Vj=kr&&"TextEvent"in window&&!Ai,Lv=kr&&(!Xf||Ai&&8<Ai&&11>=Ai),Pv=" ",Uv=!1;function Bv(n,a){switch(n){case"keyup":return Ij.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hv(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ds=!1;function qj(n,a){switch(n){case"compositionend":return Hv(a);case"keypress":return a.which!==32?null:(Uv=!0,Pv);case"textInput":return n=a.data,n===Pv&&Uv?null:n;default:return null}}function Yj(n,a){if(ds)return n==="compositionend"||!Xf&&Bv(n,a)?(n=Mv(),Mc=Vf=wa=null,ds=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Lv&&a.locale!=="ko"?null:a.data;default:return null}}var Gj={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 $v(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a==="input"?!!Gj[n.type]:a==="textarea"}function Iv(n,a,s,c){cs?us?us.push(c):us=[c]:cs=c,a=wu(a,"onChange"),0<a.length&&(s=new kc("onChange","change",null,s,c),n.push({event:s,listeners:a}))}var Ti=null,Ri=null;function Fj(n){S0(n,0)}function Lc(n){var a=fo(n);if(Ev(a))return n}function Vv(n,a){if(n==="change")return a}var qv=!1;if(kr){var Wf;if(kr){var Kf="oninput"in document;if(!Kf){var Yv=document.createElement("div");Yv.setAttribute("oninput","return;"),Kf=typeof Yv.oninput=="function"}Wf=Kf}else Wf=!1;qv=Wf&&(!document.documentMode||9<document.documentMode)}function Gv(){Ti&&(Ti.detachEvent("onpropertychange",Fv),Ri=Ti=null)}function Fv(n){if(n.propertyName==="value"&&Lc(Ri)){var a=[];Iv(a,Ri,n,Hf(n)),Rv(Fj,a)}}function Xj(n,a,s){n==="focusin"?(Gv(),Ti=a,Ri=s,Ti.attachEvent("onpropertychange",Fv)):n==="focusout"&&Gv()}function Wj(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Lc(Ri)}function Kj(n,a){if(n==="click")return Lc(a)}function Zj(n,a){if(n==="input"||n==="change")return Lc(a)}function Qj(n,a){return n===a&&(n!==0||1/n===1/a)||n!==n&&a!==a}var bn=typeof Object.is=="function"?Object.is:Qj;function Mi(n,a){if(bn(n,a))return!0;if(typeof n!="object"||n===null||typeof a!="object"||a===null)return!1;var s=Object.keys(n),c=Object.keys(a);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var p=s[c];if(!we.call(a,p)||!bn(n[p],a[p]))return!1}return!0}function Xv(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Wv(n,a){var s=Xv(n);n=0;for(var c;s;){if(s.nodeType===3){if(c=n+s.textContent.length,n<=a&&c>=a)return{node:s,offset:a-n};n=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Xv(s)}}function Kv(n,a){return n&&a?n===a?!0:n&&n.nodeType===3?!1:a&&a.nodeType===3?Kv(n,a.parentNode):"contains"in n?n.contains(a):n.compareDocumentPosition?!!(n.compareDocumentPosition(a)&16):!1:!1}function Zv(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var a=Tc(n.document);a instanceof n.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)n=a.contentWindow;else break;a=Tc(n.document)}return a}function Zf(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a&&(a==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||a==="textarea"||n.contentEditable==="true")}var Jj=kr&&"documentMode"in document&&11>=document.documentMode,fs=null,Qf=null,Di=null,Jf=!1;function Qv(n,a,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Jf||fs==null||fs!==Tc(c)||(c=fs,"selectionStart"in c&&Zf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Di&&Mi(Di,c)||(Di=c,c=wu(Qf,"onSelect"),0<c.length&&(a=new kc("onSelect","select",null,a,s),n.push({event:a,listeners:c}),a.target=fs)))}function po(n,a){var s={};return s[n.toLowerCase()]=a.toLowerCase(),s["Webkit"+n]="webkit"+a,s["Moz"+n]="moz"+a,s}var hs={animationend:po("Animation","AnimationEnd"),animationiteration:po("Animation","AnimationIteration"),animationstart:po("Animation","AnimationStart"),transitionrun:po("Transition","TransitionRun"),transitionstart:po("Transition","TransitionStart"),transitioncancel:po("Transition","TransitionCancel"),transitionend:po("Transition","TransitionEnd")},eh={},Jv={};kr&&(Jv=document.createElement("div").style,"AnimationEvent"in window||(delete hs.animationend.animation,delete hs.animationiteration.animation,delete hs.animationstart.animation),"TransitionEvent"in window||delete hs.transitionend.transition);function go(n){if(eh[n])return eh[n];if(!hs[n])return n;var a=hs[n],s;for(s in a)if(a.hasOwnProperty(s)&&s in Jv)return eh[n]=a[s];return n}var ey=go("animationend"),ty=go("animationiteration"),ny=go("animationstart"),e_=go("transitionrun"),t_=go("transitionstart"),n_=go("transitioncancel"),ry=go("transitionend"),ay=new Map,th="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(" ");th.push("scrollEnd");function Kn(n,a){ay.set(n,a),Or(a,[n])}var oy=new WeakMap;function zn(n,a){if(typeof n=="object"&&n!==null){var s=oy.get(n);return s!==void 0?s:(a={value:n,source:a,stack:wv(a)},oy.set(n,a),a)}return{value:n,source:a,stack:wv(a)}}var Ln=[],ms=0,nh=0;function Pc(){for(var n=ms,a=nh=ms=0;a<n;){var s=Ln[a];Ln[a++]=null;var c=Ln[a];Ln[a++]=null;var p=Ln[a];Ln[a++]=null;var y=Ln[a];if(Ln[a++]=null,c!==null&&p!==null){var j=c.pending;j===null?p.next=p:(p.next=j.next,j.next=p),c.pending=p}y!==0&&sy(s,p,y)}}function Uc(n,a,s,c){Ln[ms++]=n,Ln[ms++]=a,Ln[ms++]=s,Ln[ms++]=c,nh|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function rh(n,a,s,c){return Uc(n,a,s,c),Bc(n)}function ps(n,a){return Uc(n,null,null,a),Bc(n)}function sy(n,a,s){n.lanes|=s;var c=n.alternate;c!==null&&(c.lanes|=s);for(var p=!1,y=n.return;y!==null;)y.childLanes|=s,c=y.alternate,c!==null&&(c.childLanes|=s),y.tag===22&&(n=y.stateNode,n===null||n._visibility&1||(p=!0)),n=y,y=y.return;return n.tag===3?(y=n.stateNode,p&&a!==null&&(p=31-Ct(s),n=y.hiddenUpdates,c=n[p],c===null?n[p]=[a]:c.push(a),a.lane=s|536870912),y):null}function Bc(n){if(50<rl)throw rl=0,cm=null,Error(o(185));for(var a=n.return;a!==null;)n=a,a=n.return;return n.tag===3?n.stateNode:null}var gs={};function r_(n,a,s,c){this.tag=n,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wn(n,a,s,c){return new r_(n,a,s,c)}function ah(n){return n=n.prototype,!(!n||!n.isReactComponent)}function zr(n,a){var s=n.alternate;return s===null?(s=wn(n.tag,a,n.key,n.mode),s.elementType=n.elementType,s.type=n.type,s.stateNode=n.stateNode,s.alternate=n,n.alternate=s):(s.pendingProps=a,s.type=n.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=n.flags&65011712,s.childLanes=n.childLanes,s.lanes=n.lanes,s.child=n.child,s.memoizedProps=n.memoizedProps,s.memoizedState=n.memoizedState,s.updateQueue=n.updateQueue,a=n.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},s.sibling=n.sibling,s.index=n.index,s.ref=n.ref,s.refCleanup=n.refCleanup,s}function iy(n,a){n.flags&=65011714;var s=n.alternate;return s===null?(n.childLanes=0,n.lanes=a,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,n.type=s.type,a=s.dependencies,n.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),n}function Hc(n,a,s,c,p,y){var j=0;if(c=n,typeof n=="function")ah(n)&&(j=1);else if(typeof n=="string")j=oA(n,s,re.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case q:return n=wn(31,s,a,p),n.elementType=q,n.lanes=y,n;case E:return vo(s.children,p,y,a);case S:j=8,p|=24;break;case N:return n=wn(12,s,a,p|2),n.elementType=N,n.lanes=y,n;case O:return n=wn(13,s,a,p),n.elementType=O,n.lanes=y,n;case L:return n=wn(19,s,a,p),n.elementType=L,n.lanes=y,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case C:case A:j=10;break e;case T:j=9;break e;case _:j=11;break e;case B:j=14;break e;case I:j=16,c=null;break e}j=29,s=Error(o(130,n===null?"null":typeof n,"")),c=null}return a=wn(j,s,a,p),a.elementType=n,a.type=c,a.lanes=y,a}function vo(n,a,s,c){return n=wn(7,n,c,a),n.lanes=s,n}function oh(n,a,s){return n=wn(6,n,null,a),n.lanes=s,n}function sh(n,a,s){return a=wn(4,n.children!==null?n.children:[],n.key,a),a.lanes=s,a.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},a}var vs=[],ys=0,$c=null,Ic=0,Pn=[],Un=0,yo=null,Lr=1,Pr="";function xo(n,a){vs[ys++]=Ic,vs[ys++]=$c,$c=n,Ic=a}function ly(n,a,s){Pn[Un++]=Lr,Pn[Un++]=Pr,Pn[Un++]=yo,yo=n;var c=Lr;n=Pr;var p=32-Ct(c)-1;c&=~(1<<p),s+=1;var y=32-Ct(a)+p;if(30<y){var j=p-p%5;y=(c&(1<<j)-1).toString(32),c>>=j,p-=j,Lr=1<<32-Ct(a)+p|s<<p|c,Pr=y+n}else Lr=1<<y|s<<p|c,Pr=n}function ih(n){n.return!==null&&(xo(n,1),ly(n,1,0))}function lh(n){for(;n===$c;)$c=vs[--ys],vs[ys]=null,Ic=vs[--ys],vs[ys]=null;for(;n===yo;)yo=Pn[--Un],Pn[Un]=null,Pr=Pn[--Un],Pn[Un]=null,Lr=Pn[--Un],Pn[Un]=null}var nn=null,gt=null,et=!1,bo=null,vr=!1,ch=Error(o(519));function wo(n){var a=Error(o(418,""));throw zi(zn(a,n)),ch}function cy(n){var a=n.stateNode,s=n.type,c=n.memoizedProps;switch(a[Lt]=n,a[Wt]=c,s){case"dialog":Ve("cancel",a),Ve("close",a);break;case"iframe":case"object":case"embed":Ve("load",a);break;case"video":case"audio":for(s=0;s<ol.length;s++)Ve(ol[s],a);break;case"source":Ve("error",a);break;case"img":case"image":case"link":Ve("error",a),Ve("load",a);break;case"details":Ve("toggle",a);break;case"input":Ve("invalid",a),Nv(a,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0),Ac(a);break;case"select":Ve("invalid",a);break;case"textarea":Ve("invalid",a),jv(a,c.value,c.defaultValue,c.children),Ac(a)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||a.textContent===""+s||c.suppressHydrationWarning===!0||j0(a.textContent,s)?(c.popover!=null&&(Ve("beforetoggle",a),Ve("toggle",a)),c.onScroll!=null&&Ve("scroll",a),c.onScrollEnd!=null&&Ve("scrollend",a),c.onClick!=null&&(a.onclick=Su),a=!0):a=!1,a||wo(n)}function uy(n){for(nn=n.return;nn;)switch(nn.tag){case 5:case 13:vr=!1;return;case 27:case 3:vr=!0;return;default:nn=nn.return}}function Oi(n){if(n!==nn)return!1;if(!et)return uy(n),et=!0,!1;var a=n.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=n.type,s=!(s!=="form"&&s!=="button")||Cm(n.type,n.memoizedProps)),s=!s),s&&gt&&wo(n),uy(n),a===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));e:{for(n=n.nextSibling,a=0;n;){if(n.nodeType===8)if(s=n.data,s==="/$"){if(a===0){gt=Qn(n.nextSibling);break e}a--}else s!=="$"&&s!=="$!"&&s!=="$?"||a++;n=n.nextSibling}gt=null}}else a===27?(a=gt,Pa(n.type)?(n=Tm,Tm=null,gt=n):gt=a):gt=nn?Qn(n.stateNode.nextSibling):null;return!0}function ki(){gt=nn=null,et=!1}function dy(){var n=bo;return n!==null&&(dn===null?dn=n:dn.push.apply(dn,n),bo=null),n}function zi(n){bo===null?bo=[n]:bo.push(n)}var uh=V(null),So=null,Ur=null;function Sa(n,a,s){K(uh,a._currentValue),a._currentValue=s}function Br(n){n._currentValue=uh.current,F(uh)}function dh(n,a,s){for(;n!==null;){var c=n.alternate;if((n.childLanes&a)!==a?(n.childLanes|=a,c!==null&&(c.childLanes|=a)):c!==null&&(c.childLanes&a)!==a&&(c.childLanes|=a),n===s)break;n=n.return}}function fh(n,a,s,c){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var y=p.dependencies;if(y!==null){var j=p.child;y=y.firstContext;e:for(;y!==null;){var D=y;y=p;for(var H=0;H<a.length;H++)if(D.context===a[H]){y.lanes|=s,D=y.alternate,D!==null&&(D.lanes|=s),dh(y.return,s,n),c||(j=null);break e}y=D.next}}else if(p.tag===18){if(j=p.return,j===null)throw Error(o(341));j.lanes|=s,y=j.alternate,y!==null&&(y.lanes|=s),dh(j,s,n),j=null}else j=p.child;if(j!==null)j.return=p;else for(j=p;j!==null;){if(j===n){j=null;break}if(p=j.sibling,p!==null){p.return=j.return,j=p;break}j=j.return}p=j}}function Li(n,a,s,c){n=null;for(var p=a,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var j=p.alternate;if(j===null)throw Error(o(387));if(j=j.memoizedProps,j!==null){var D=p.type;bn(p.pendingProps.value,j.value)||(n!==null?n.push(D):n=[D])}}else if(p===ie.current){if(j=p.alternate,j===null)throw Error(o(387));j.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(dl):n=[dl])}p=p.return}n!==null&&fh(a,n,s,c),a.flags|=262144}function Vc(n){for(n=n.firstContext;n!==null;){if(!bn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Eo(n){So=n,Ur=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Kt(n){return fy(So,n)}function qc(n,a){return So===null&&Eo(n),fy(n,a)}function fy(n,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},Ur===null){if(n===null)throw Error(o(308));Ur=a,n.dependencies={lanes:0,firstContext:a},n.flags|=524288}else Ur=Ur.next=a;return s}var a_=typeof AbortController<"u"?AbortController:function(){var n=[],a=this.signal={aborted:!1,addEventListener:function(s,c){n.push(c)}};this.abort=function(){a.aborted=!0,n.forEach(function(s){return s()})}},o_=e.unstable_scheduleCallback,s_=e.unstable_NormalPriority,Mt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hh(){return{controller:new a_,data:new Map,refCount:0}}function Pi(n){n.refCount--,n.refCount===0&&o_(s_,function(){n.controller.abort()})}var Ui=null,mh=0,xs=0,bs=null;function i_(n,a){if(Ui===null){var s=Ui=[];mh=0,xs=gm(),bs={status:"pending",value:void 0,then:function(c){s.push(c)}}}return mh++,a.then(hy,hy),a}function hy(){if(--mh===0&&Ui!==null){bs!==null&&(bs.status="fulfilled");var n=Ui;Ui=null,xs=0,bs=null;for(var a=0;a<n.length;a++)(0,n[a])()}}function l_(n,a){var s=[],c={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return n.then(function(){c.status="fulfilled",c.value=a;for(var p=0;p<s.length;p++)(0,s[p])(a)},function(p){for(c.status="rejected",c.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),c}var my=M.S;M.S=function(n,a){typeof a=="object"&&a!==null&&typeof a.then=="function"&&i_(n,a),my!==null&&my(n,a)};var No=V(null);function ph(){var n=No.current;return n!==null?n:lt.pooledCache}function Yc(n,a){a===null?K(No,No.current):K(No,a.pool)}function py(){var n=ph();return n===null?null:{parent:Mt._currentValue,pool:n}}var Bi=Error(o(460)),gy=Error(o(474)),Gc=Error(o(542)),gh={then:function(){}};function vy(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Fc(){}function yy(n,a,s){switch(s=n[s],s===void 0?n.push(a):s!==a&&(a.then(Fc,Fc),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,by(n),n;default:if(typeof a.status=="string")a.then(Fc,Fc);else{if(n=lt,n!==null&&100<n.shellSuspendCounter)throw Error(o(482));n=a,n.status="pending",n.then(function(c){if(a.status==="pending"){var p=a;p.status="fulfilled",p.value=c}},function(c){if(a.status==="pending"){var p=a;p.status="rejected",p.reason=c}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,by(n),n}throw Hi=a,Bi}}var Hi=null;function xy(){if(Hi===null)throw Error(o(459));var n=Hi;return Hi=null,n}function by(n){if(n===Bi||n===Gc)throw Error(o(483))}var Ea=!1;function vh(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yh(n,a){n=n.updateQueue,a.updateQueue===n&&(a.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Na(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Ca(n,a,s){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(tt&2)!==0){var p=c.pending;return p===null?a.next=a:(a.next=p.next,p.next=a),c.pending=a,a=Bc(n),sy(n,null,s),a}return Uc(n,c,a,s),Bc(n)}function $i(n,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var c=a.lanes;c&=n.pendingLanes,s|=c,a.lanes=s,xc(n,s)}}function xh(n,a){var s=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var p=null,y=null;if(s=s.firstBaseUpdate,s!==null){do{var j={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};y===null?p=y=j:y=y.next=j,s=s.next}while(s!==null);y===null?p=y=a:y=y.next=a}else p=y=a;s={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:c.shared,callbacks:c.callbacks},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=a:n.next=a,s.lastBaseUpdate=a}var bh=!1;function Ii(){if(bh){var n=bs;if(n!==null)throw n}}function Vi(n,a,s,c){bh=!1;var p=n.updateQueue;Ea=!1;var y=p.firstBaseUpdate,j=p.lastBaseUpdate,D=p.shared.pending;if(D!==null){p.shared.pending=null;var H=D,J=H.next;H.next=null,j===null?y=J:j.next=J,j=H;var le=n.alternate;le!==null&&(le=le.updateQueue,D=le.lastBaseUpdate,D!==j&&(D===null?le.firstBaseUpdate=J:D.next=J,le.lastBaseUpdate=H))}if(y!==null){var ue=p.baseState;j=0,le=J=H=null,D=y;do{var ee=D.lane&-536870913,ne=ee!==D.lane;if(ne?(Fe&ee)===ee:(c&ee)===ee){ee!==0&&ee===xs&&(bh=!0),le!==null&&(le=le.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var Re=n,je=D;ee=a;var st=s;switch(je.tag){case 1:if(Re=je.payload,typeof Re=="function"){ue=Re.call(st,ue,ee);break e}ue=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=je.payload,ee=typeof Re=="function"?Re.call(st,ue,ee):Re,ee==null)break e;ue=g({},ue,ee);break e;case 2:Ea=!0}}ee=D.callback,ee!==null&&(n.flags|=64,ne&&(n.flags|=8192),ne=p.callbacks,ne===null?p.callbacks=[ee]:ne.push(ee))}else ne={lane:ee,tag:D.tag,payload:D.payload,callback:D.callback,next:null},le===null?(J=le=ne,H=ue):le=le.next=ne,j|=ee;if(D=D.next,D===null){if(D=p.shared.pending,D===null)break;ne=D,D=ne.next,ne.next=null,p.lastBaseUpdate=ne,p.shared.pending=null}}while(!0);le===null&&(H=ue),p.baseState=H,p.firstBaseUpdate=J,p.lastBaseUpdate=le,y===null&&(p.shared.lanes=0),Oa|=j,n.lanes=j,n.memoizedState=ue}}function wy(n,a){if(typeof n!="function")throw Error(o(191,n));n.call(a)}function Sy(n,a){var s=n.callbacks;if(s!==null)for(n.callbacks=null,n=0;n<s.length;n++)wy(s[n],a)}var ws=V(null),Xc=V(0);function Ey(n,a){n=Gr,K(Xc,n),K(ws,a),Gr=n|a.baseLanes}function wh(){K(Xc,Gr),K(ws,ws.current)}function Sh(){Gr=Xc.current,F(ws),F(Xc)}var ja=0,Le=null,at=null,_t=null,Wc=!1,Ss=!1,Co=!1,Kc=0,qi=0,Es=null,c_=0;function wt(){throw Error(o(321))}function Eh(n,a){if(a===null)return!1;for(var s=0;s<a.length&&s<n.length;s++)if(!bn(n[s],a[s]))return!1;return!0}function Nh(n,a,s,c,p,y){return ja=y,Le=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,M.H=n===null||n.memoizedState===null?sx:ix,Co=!1,y=s(c,p),Co=!1,Ss&&(y=Cy(a,s,c,p)),Ny(n),y}function Ny(n){M.H=nu;var a=at!==null&&at.next!==null;if(ja=0,_t=at=Le=null,Wc=!1,qi=0,Es=null,a)throw Error(o(300));n===null||Pt||(n=n.dependencies,n!==null&&Vc(n)&&(Pt=!0))}function Cy(n,a,s,c){Le=n;var p=0;do{if(Ss&&(Es=null),qi=0,Ss=!1,25<=p)throw Error(o(301));if(p+=1,_t=at=null,n.updateQueue!=null){var y=n.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}M.H=g_,y=a(s,c)}while(Ss);return y}function u_(){var n=M.H,a=n.useState()[0];return a=typeof a.then=="function"?Yi(a):a,n=n.useState()[0],(at!==null?at.memoizedState:null)!==n&&(Le.flags|=1024),a}function Ch(){var n=Kc!==0;return Kc=0,n}function jh(n,a,s){a.updateQueue=n.updateQueue,a.flags&=-2053,n.lanes&=~s}function _h(n){if(Wc){for(n=n.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}Wc=!1}ja=0,_t=at=Le=null,Ss=!1,qi=Kc=0,Es=null}function cn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?Le.memoizedState=_t=n:_t=_t.next=n,_t}function At(){if(at===null){var n=Le.alternate;n=n!==null?n.memoizedState:null}else n=at.next;var a=_t===null?Le.memoizedState:_t.next;if(a!==null)_t=a,at=n;else{if(n===null)throw Le.alternate===null?Error(o(467)):Error(o(310));at=n,n={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},_t===null?Le.memoizedState=_t=n:_t=_t.next=n}return _t}function Ah(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yi(n){var a=qi;return qi+=1,Es===null&&(Es=[]),n=yy(Es,n,a),a=Le,(_t===null?a.memoizedState:_t.next)===null&&(a=a.alternate,M.H=a===null||a.memoizedState===null?sx:ix),n}function Zc(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Yi(n);if(n.$$typeof===A)return Kt(n)}throw Error(o(438,String(n)))}function Th(n){var a=null,s=Le.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var c=Le.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(a={data:c.data.map(function(p){return p.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),s===null&&(s=Ah(),Le.updateQueue=s),s.memoCache=a,s=a.data[a.index],s===void 0)for(s=a.data[a.index]=Array(n),c=0;c<n;c++)s[c]=Q;return a.index++,s}function Hr(n,a){return typeof a=="function"?a(n):a}function Qc(n){var a=At();return Rh(a,at,n)}function Rh(n,a,s){var c=n.queue;if(c===null)throw Error(o(311));c.lastRenderedReducer=s;var p=n.baseQueue,y=c.pending;if(y!==null){if(p!==null){var j=p.next;p.next=y.next,y.next=j}a.baseQueue=p=y,c.pending=null}if(y=n.baseState,p===null)n.memoizedState=y;else{a=p.next;var D=j=null,H=null,J=a,le=!1;do{var ue=J.lane&-536870913;if(ue!==J.lane?(Fe&ue)===ue:(ja&ue)===ue){var ee=J.revertLane;if(ee===0)H!==null&&(H=H.next={lane:0,revertLane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),ue===xs&&(le=!0);else if((ja&ee)===ee){J=J.next,ee===xs&&(le=!0);continue}else ue={lane:0,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},H===null?(D=H=ue,j=y):H=H.next=ue,Le.lanes|=ee,Oa|=ee;ue=J.action,Co&&s(y,ue),y=J.hasEagerState?J.eagerState:s(y,ue)}else ee={lane:ue,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},H===null?(D=H=ee,j=y):H=H.next=ee,Le.lanes|=ue,Oa|=ue;J=J.next}while(J!==null&&J!==a);if(H===null?j=y:H.next=D,!bn(y,n.memoizedState)&&(Pt=!0,le&&(s=bs,s!==null)))throw s;n.memoizedState=y,n.baseState=j,n.baseQueue=H,c.lastRenderedState=y}return p===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function Mh(n){var a=At(),s=a.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=n;var c=s.dispatch,p=s.pending,y=a.memoizedState;if(p!==null){s.pending=null;var j=p=p.next;do y=n(y,j.action),j=j.next;while(j!==p);bn(y,a.memoizedState)||(Pt=!0),a.memoizedState=y,a.baseQueue===null&&(a.baseState=y),s.lastRenderedState=y}return[y,c]}function jy(n,a,s){var c=Le,p=At(),y=et;if(y){if(s===void 0)throw Error(o(407));s=s()}else s=a();var j=!bn((at||p).memoizedState,s);j&&(p.memoizedState=s,Pt=!0),p=p.queue;var D=Ty.bind(null,c,p,n);if(Gi(2048,8,D,[n]),p.getSnapshot!==a||j||_t!==null&&_t.memoizedState.tag&1){if(c.flags|=2048,Ns(9,Jc(),Ay.bind(null,c,p,s,a),null),lt===null)throw Error(o(349));y||(ja&124)!==0||_y(c,a,s)}return s}function _y(n,a,s){n.flags|=16384,n={getSnapshot:a,value:s},a=Le.updateQueue,a===null?(a=Ah(),Le.updateQueue=a,a.stores=[n]):(s=a.stores,s===null?a.stores=[n]:s.push(n))}function Ay(n,a,s,c){a.value=s,a.getSnapshot=c,Ry(a)&&My(n)}function Ty(n,a,s){return s(function(){Ry(a)&&My(n)})}function Ry(n){var a=n.getSnapshot;n=n.value;try{var s=a();return!bn(n,s)}catch{return!0}}function My(n){var a=ps(n,2);a!==null&&jn(a,n,2)}function Dh(n){var a=cn();if(typeof n=="function"){var s=n;if(n=s(),Co){en(!0);try{s()}finally{en(!1)}}}return a.memoizedState=a.baseState=n,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:n},a}function Dy(n,a,s,c){return n.baseState=s,Rh(n,at,typeof c=="function"?c:Hr)}function d_(n,a,s,c,p){if(tu(n))throw Error(o(485));if(n=a.action,n!==null){var y={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){y.listeners.push(j)}};M.T!==null?s(!0):y.isTransition=!1,c(y),s=a.pending,s===null?(y.next=a.pending=y,Oy(a,y)):(y.next=s.next,a.pending=s.next=y)}}function Oy(n,a){var s=a.action,c=a.payload,p=n.state;if(a.isTransition){var y=M.T,j={};M.T=j;try{var D=s(p,c),H=M.S;H!==null&&H(j,D),ky(n,a,D)}catch(J){Oh(n,a,J)}finally{M.T=y}}else try{y=s(p,c),ky(n,a,y)}catch(J){Oh(n,a,J)}}function ky(n,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){zy(n,a,c)},function(c){return Oh(n,a,c)}):zy(n,a,s)}function zy(n,a,s){a.status="fulfilled",a.value=s,Ly(a),n.state=s,a=n.pending,a!==null&&(s=a.next,s===a?n.pending=null:(s=s.next,a.next=s,Oy(n,s)))}function Oh(n,a,s){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do a.status="rejected",a.reason=s,Ly(a),a=a.next;while(a!==c)}n.action=null}function Ly(n){n=n.listeners;for(var a=0;a<n.length;a++)(0,n[a])()}function Py(n,a){return a}function Uy(n,a){if(et){var s=lt.formState;if(s!==null){e:{var c=Le;if(et){if(gt){t:{for(var p=gt,y=vr;p.nodeType!==8;){if(!y){p=null;break t}if(p=Qn(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){gt=Qn(p.nextSibling),c=p.data==="F!";break e}}wo(c)}c=!1}c&&(a=s[0])}}return s=cn(),s.memoizedState=s.baseState=a,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Py,lastRenderedState:a},s.queue=c,s=rx.bind(null,Le,c),c.dispatch=s,c=Dh(!1),y=Uh.bind(null,Le,!1,c.queue),c=cn(),p={state:a,dispatch:null,action:n,pending:null},c.queue=p,s=d_.bind(null,Le,p,y,s),p.dispatch=s,c.memoizedState=n,[a,s,!1]}function By(n){var a=At();return Hy(a,at,n)}function Hy(n,a,s){if(a=Rh(n,a,Py)[0],n=Qc(Hr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var c=Yi(a)}catch(j){throw j===Bi?Gc:j}else c=a;a=At();var p=a.queue,y=p.dispatch;return s!==a.memoizedState&&(Le.flags|=2048,Ns(9,Jc(),f_.bind(null,p,s),null)),[c,y,n]}function f_(n,a){n.action=a}function $y(n){var a=At(),s=at;if(s!==null)return Hy(a,s,n);At(),a=a.memoizedState,s=At();var c=s.queue.dispatch;return s.memoizedState=n,[a,c,!1]}function Ns(n,a,s,c){return n={tag:n,create:s,deps:c,inst:a,next:null},a=Le.updateQueue,a===null&&(a=Ah(),Le.updateQueue=a),s=a.lastEffect,s===null?a.lastEffect=n.next=n:(c=s.next,s.next=n,n.next=c,a.lastEffect=n),n}function Jc(){return{destroy:void 0,resource:void 0}}function Iy(){return At().memoizedState}function eu(n,a,s,c){var p=cn();c=c===void 0?null:c,Le.flags|=n,p.memoizedState=Ns(1|a,Jc(),s,c)}function Gi(n,a,s,c){var p=At();c=c===void 0?null:c;var y=p.memoizedState.inst;at!==null&&c!==null&&Eh(c,at.memoizedState.deps)?p.memoizedState=Ns(a,y,s,c):(Le.flags|=n,p.memoizedState=Ns(1|a,y,s,c))}function Vy(n,a){eu(8390656,8,n,a)}function qy(n,a){Gi(2048,8,n,a)}function Yy(n,a){return Gi(4,2,n,a)}function Gy(n,a){return Gi(4,4,n,a)}function Fy(n,a){if(typeof a=="function"){n=n();var s=a(n);return function(){typeof s=="function"?s():a(null)}}if(a!=null)return n=n(),a.current=n,function(){a.current=null}}function Xy(n,a,s){s=s!=null?s.concat([n]):null,Gi(4,4,Fy.bind(null,a,n),s)}function kh(){}function Wy(n,a){var s=At();a=a===void 0?null:a;var c=s.memoizedState;return a!==null&&Eh(a,c[1])?c[0]:(s.memoizedState=[n,a],n)}function Ky(n,a){var s=At();a=a===void 0?null:a;var c=s.memoizedState;if(a!==null&&Eh(a,c[1]))return c[0];if(c=n(),Co){en(!0);try{n()}finally{en(!1)}}return s.memoizedState=[c,a],c}function zh(n,a,s){return s===void 0||(ja&1073741824)!==0?n.memoizedState=a:(n.memoizedState=s,n=Jx(),Le.lanes|=n,Oa|=n,s)}function Zy(n,a,s,c){return bn(s,a)?s:ws.current!==null?(n=zh(n,s,c),bn(n,a)||(Pt=!0),n):(ja&42)===0?(Pt=!0,n.memoizedState=s):(n=Jx(),Le.lanes|=n,Oa|=n,a)}function Qy(n,a,s,c,p){var y=$.p;$.p=y!==0&&8>y?y:8;var j=M.T,D={};M.T=D,Uh(n,!1,a,s);try{var H=p(),J=M.S;if(J!==null&&J(D,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var le=l_(H,c);Fi(n,a,le,Cn(n))}else Fi(n,a,c,Cn(n))}catch(ue){Fi(n,a,{then:function(){},status:"rejected",reason:ue},Cn())}finally{$.p=y,M.T=j}}function h_(){}function Lh(n,a,s,c){if(n.tag!==5)throw Error(o(476));var p=Jy(n).queue;Qy(n,p,a,U,s===null?h_:function(){return ex(n),s(c)})}function Jy(n){var a=n.memoizedState;if(a!==null)return a;a={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:U},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:s},next:null},n.memoizedState=a,n=n.alternate,n!==null&&(n.memoizedState=a),a}function ex(n){var a=Jy(n).next.queue;Fi(n,a,{},Cn())}function Ph(){return Kt(dl)}function tx(){return At().memoizedState}function nx(){return At().memoizedState}function m_(n){for(var a=n.return;a!==null;){switch(a.tag){case 24:case 3:var s=Cn();n=Na(s);var c=Ca(a,n,s);c!==null&&(jn(c,a,s),$i(c,a,s)),a={cache:hh()},n.payload=a;return}a=a.return}}function p_(n,a,s){var c=Cn();s={lane:c,revertLane:0,action:s,hasEagerState:!1,eagerState:null,next:null},tu(n)?ax(a,s):(s=rh(n,a,s,c),s!==null&&(jn(s,n,c),ox(s,a,c)))}function rx(n,a,s){var c=Cn();Fi(n,a,s,c)}function Fi(n,a,s,c){var p={lane:c,revertLane:0,action:s,hasEagerState:!1,eagerState:null,next:null};if(tu(n))ax(a,p);else{var y=n.alternate;if(n.lanes===0&&(y===null||y.lanes===0)&&(y=a.lastRenderedReducer,y!==null))try{var j=a.lastRenderedState,D=y(j,s);if(p.hasEagerState=!0,p.eagerState=D,bn(D,j))return Uc(n,a,p,0),lt===null&&Pc(),!1}catch{}finally{}if(s=rh(n,a,p,c),s!==null)return jn(s,n,c),ox(s,a,c),!0}return!1}function Uh(n,a,s,c){if(c={lane:2,revertLane:gm(),action:c,hasEagerState:!1,eagerState:null,next:null},tu(n)){if(a)throw Error(o(479))}else a=rh(n,s,c,2),a!==null&&jn(a,n,2)}function tu(n){var a=n.alternate;return n===Le||a!==null&&a===Le}function ax(n,a){Ss=Wc=!0;var s=n.pending;s===null?a.next=a:(a.next=s.next,s.next=a),n.pending=a}function ox(n,a,s){if((s&4194048)!==0){var c=a.lanes;c&=n.pendingLanes,s|=c,a.lanes=s,xc(n,s)}}var nu={readContext:Kt,use:Zc,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useLayoutEffect:wt,useInsertionEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useSyncExternalStore:wt,useId:wt,useHostTransitionStatus:wt,useFormState:wt,useActionState:wt,useOptimistic:wt,useMemoCache:wt,useCacheRefresh:wt},sx={readContext:Kt,use:Zc,useCallback:function(n,a){return cn().memoizedState=[n,a===void 0?null:a],n},useContext:Kt,useEffect:Vy,useImperativeHandle:function(n,a,s){s=s!=null?s.concat([n]):null,eu(4194308,4,Fy.bind(null,a,n),s)},useLayoutEffect:function(n,a){return eu(4194308,4,n,a)},useInsertionEffect:function(n,a){eu(4,2,n,a)},useMemo:function(n,a){var s=cn();a=a===void 0?null:a;var c=n();if(Co){en(!0);try{n()}finally{en(!1)}}return s.memoizedState=[c,a],c},useReducer:function(n,a,s){var c=cn();if(s!==void 0){var p=s(a);if(Co){en(!0);try{s(a)}finally{en(!1)}}}else p=a;return c.memoizedState=c.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},c.queue=n,n=n.dispatch=p_.bind(null,Le,n),[c.memoizedState,n]},useRef:function(n){var a=cn();return n={current:n},a.memoizedState=n},useState:function(n){n=Dh(n);var a=n.queue,s=rx.bind(null,Le,a);return a.dispatch=s,[n.memoizedState,s]},useDebugValue:kh,useDeferredValue:function(n,a){var s=cn();return zh(s,n,a)},useTransition:function(){var n=Dh(!1);return n=Qy.bind(null,Le,n.queue,!0,!1),cn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,a,s){var c=Le,p=cn();if(et){if(s===void 0)throw Error(o(407));s=s()}else{if(s=a(),lt===null)throw Error(o(349));(Fe&124)!==0||_y(c,a,s)}p.memoizedState=s;var y={value:s,getSnapshot:a};return p.queue=y,Vy(Ty.bind(null,c,y,n),[n]),c.flags|=2048,Ns(9,Jc(),Ay.bind(null,c,y,s,a),null),s},useId:function(){var n=cn(),a=lt.identifierPrefix;if(et){var s=Pr,c=Lr;s=(c&~(1<<32-Ct(c)-1)).toString(32)+s,a="«"+a+"R"+s,s=Kc++,0<s&&(a+="H"+s.toString(32)),a+="»"}else s=c_++,a="«"+a+"r"+s.toString(32)+"»";return n.memoizedState=a},useHostTransitionStatus:Ph,useFormState:Uy,useActionState:Uy,useOptimistic:function(n){var a=cn();a.memoizedState=a.baseState=n;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=Uh.bind(null,Le,!0,s),s.dispatch=a,[n,a]},useMemoCache:Th,useCacheRefresh:function(){return cn().memoizedState=m_.bind(null,Le)}},ix={readContext:Kt,use:Zc,useCallback:Wy,useContext:Kt,useEffect:qy,useImperativeHandle:Xy,useInsertionEffect:Yy,useLayoutEffect:Gy,useMemo:Ky,useReducer:Qc,useRef:Iy,useState:function(){return Qc(Hr)},useDebugValue:kh,useDeferredValue:function(n,a){var s=At();return Zy(s,at.memoizedState,n,a)},useTransition:function(){var n=Qc(Hr)[0],a=At().memoizedState;return[typeof n=="boolean"?n:Yi(n),a]},useSyncExternalStore:jy,useId:tx,useHostTransitionStatus:Ph,useFormState:By,useActionState:By,useOptimistic:function(n,a){var s=At();return Dy(s,at,n,a)},useMemoCache:Th,useCacheRefresh:nx},g_={readContext:Kt,use:Zc,useCallback:Wy,useContext:Kt,useEffect:qy,useImperativeHandle:Xy,useInsertionEffect:Yy,useLayoutEffect:Gy,useMemo:Ky,useReducer:Mh,useRef:Iy,useState:function(){return Mh(Hr)},useDebugValue:kh,useDeferredValue:function(n,a){var s=At();return at===null?zh(s,n,a):Zy(s,at.memoizedState,n,a)},useTransition:function(){var n=Mh(Hr)[0],a=At().memoizedState;return[typeof n=="boolean"?n:Yi(n),a]},useSyncExternalStore:jy,useId:tx,useHostTransitionStatus:Ph,useFormState:$y,useActionState:$y,useOptimistic:function(n,a){var s=At();return at!==null?Dy(s,at,n,a):(s.baseState=n,[n,s.queue.dispatch])},useMemoCache:Th,useCacheRefresh:nx},Cs=null,Xi=0;function ru(n){var a=Xi;return Xi+=1,Cs===null&&(Cs=[]),yy(Cs,n,a)}function Wi(n,a){a=a.props.ref,n.ref=a!==void 0?a:null}function au(n,a){throw a.$$typeof===v?Error(o(525)):(n=Object.prototype.toString.call(a),Error(o(31,n==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":n)))}function lx(n){var a=n._init;return a(n._payload)}function cx(n){function a(X,G){if(n){var Z=X.deletions;Z===null?(X.deletions=[G],X.flags|=16):Z.push(G)}}function s(X,G){if(!n)return null;for(;G!==null;)a(X,G),G=G.sibling;return null}function c(X){for(var G=new Map;X!==null;)X.key!==null?G.set(X.key,X):G.set(X.index,X),X=X.sibling;return G}function p(X,G){return X=zr(X,G),X.index=0,X.sibling=null,X}function y(X,G,Z){return X.index=Z,n?(Z=X.alternate,Z!==null?(Z=Z.index,Z<G?(X.flags|=67108866,G):Z):(X.flags|=67108866,G)):(X.flags|=1048576,G)}function j(X){return n&&X.alternate===null&&(X.flags|=67108866),X}function D(X,G,Z,ce){return G===null||G.tag!==6?(G=oh(Z,X.mode,ce),G.return=X,G):(G=p(G,Z),G.return=X,G)}function H(X,G,Z,ce){var ye=Z.type;return ye===E?le(X,G,Z.props.children,ce,Z.key):G!==null&&(G.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===I&&lx(ye)===G.type)?(G=p(G,Z.props),Wi(G,Z),G.return=X,G):(G=Hc(Z.type,Z.key,Z.props,null,X.mode,ce),Wi(G,Z),G.return=X,G)}function J(X,G,Z,ce){return G===null||G.tag!==4||G.stateNode.containerInfo!==Z.containerInfo||G.stateNode.implementation!==Z.implementation?(G=sh(Z,X.mode,ce),G.return=X,G):(G=p(G,Z.children||[]),G.return=X,G)}function le(X,G,Z,ce,ye){return G===null||G.tag!==7?(G=vo(Z,X.mode,ce,ye),G.return=X,G):(G=p(G,Z),G.return=X,G)}function ue(X,G,Z){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=oh(""+G,X.mode,Z),G.return=X,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case b:return Z=Hc(G.type,G.key,G.props,null,X.mode,Z),Wi(Z,G),Z.return=X,Z;case w:return G=sh(G,X.mode,Z),G.return=X,G;case I:var ce=G._init;return G=ce(G._payload),ue(X,G,Z)}if(Y(G)||P(G))return G=vo(G,X.mode,Z,null),G.return=X,G;if(typeof G.then=="function")return ue(X,ru(G),Z);if(G.$$typeof===A)return ue(X,qc(X,G),Z);au(X,G)}return null}function ee(X,G,Z,ce){var ye=G!==null?G.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return ye!==null?null:D(X,G,""+Z,ce);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:return Z.key===ye?H(X,G,Z,ce):null;case w:return Z.key===ye?J(X,G,Z,ce):null;case I:return ye=Z._init,Z=ye(Z._payload),ee(X,G,Z,ce)}if(Y(Z)||P(Z))return ye!==null?null:le(X,G,Z,ce,null);if(typeof Z.then=="function")return ee(X,G,ru(Z),ce);if(Z.$$typeof===A)return ee(X,G,qc(X,Z),ce);au(X,Z)}return null}function ne(X,G,Z,ce,ye){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return X=X.get(Z)||null,D(G,X,""+ce,ye);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case b:return X=X.get(ce.key===null?Z:ce.key)||null,H(G,X,ce,ye);case w:return X=X.get(ce.key===null?Z:ce.key)||null,J(G,X,ce,ye);case I:var He=ce._init;return ce=He(ce._payload),ne(X,G,Z,ce,ye)}if(Y(ce)||P(ce))return X=X.get(Z)||null,le(G,X,ce,ye,null);if(typeof ce.then=="function")return ne(X,G,Z,ru(ce),ye);if(ce.$$typeof===A)return ne(X,G,Z,qc(G,ce),ye);au(G,ce)}return null}function Re(X,G,Z,ce){for(var ye=null,He=null,Ee=G,_e=G=0,Bt=null;Ee!==null&&_e<Z.length;_e++){Ee.index>_e?(Bt=Ee,Ee=null):Bt=Ee.sibling;var Ze=ee(X,Ee,Z[_e],ce);if(Ze===null){Ee===null&&(Ee=Bt);break}n&&Ee&&Ze.alternate===null&&a(X,Ee),G=y(Ze,G,_e),He===null?ye=Ze:He.sibling=Ze,He=Ze,Ee=Bt}if(_e===Z.length)return s(X,Ee),et&&xo(X,_e),ye;if(Ee===null){for(;_e<Z.length;_e++)Ee=ue(X,Z[_e],ce),Ee!==null&&(G=y(Ee,G,_e),He===null?ye=Ee:He.sibling=Ee,He=Ee);return et&&xo(X,_e),ye}for(Ee=c(Ee);_e<Z.length;_e++)Bt=ne(Ee,X,_e,Z[_e],ce),Bt!==null&&(n&&Bt.alternate!==null&&Ee.delete(Bt.key===null?_e:Bt.key),G=y(Bt,G,_e),He===null?ye=Bt:He.sibling=Bt,He=Bt);return n&&Ee.forEach(function(Ia){return a(X,Ia)}),et&&xo(X,_e),ye}function je(X,G,Z,ce){if(Z==null)throw Error(o(151));for(var ye=null,He=null,Ee=G,_e=G=0,Bt=null,Ze=Z.next();Ee!==null&&!Ze.done;_e++,Ze=Z.next()){Ee.index>_e?(Bt=Ee,Ee=null):Bt=Ee.sibling;var Ia=ee(X,Ee,Ze.value,ce);if(Ia===null){Ee===null&&(Ee=Bt);break}n&&Ee&&Ia.alternate===null&&a(X,Ee),G=y(Ia,G,_e),He===null?ye=Ia:He.sibling=Ia,He=Ia,Ee=Bt}if(Ze.done)return s(X,Ee),et&&xo(X,_e),ye;if(Ee===null){for(;!Ze.done;_e++,Ze=Z.next())Ze=ue(X,Ze.value,ce),Ze!==null&&(G=y(Ze,G,_e),He===null?ye=Ze:He.sibling=Ze,He=Ze);return et&&xo(X,_e),ye}for(Ee=c(Ee);!Ze.done;_e++,Ze=Z.next())Ze=ne(Ee,X,_e,Ze.value,ce),Ze!==null&&(n&&Ze.alternate!==null&&Ee.delete(Ze.key===null?_e:Ze.key),G=y(Ze,G,_e),He===null?ye=Ze:He.sibling=Ze,He=Ze);return n&&Ee.forEach(function(vA){return a(X,vA)}),et&&xo(X,_e),ye}function st(X,G,Z,ce){if(typeof Z=="object"&&Z!==null&&Z.type===E&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:e:{for(var ye=Z.key;G!==null;){if(G.key===ye){if(ye=Z.type,ye===E){if(G.tag===7){s(X,G.sibling),ce=p(G,Z.props.children),ce.return=X,X=ce;break e}}else if(G.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===I&&lx(ye)===G.type){s(X,G.sibling),ce=p(G,Z.props),Wi(ce,Z),ce.return=X,X=ce;break e}s(X,G);break}else a(X,G);G=G.sibling}Z.type===E?(ce=vo(Z.props.children,X.mode,ce,Z.key),ce.return=X,X=ce):(ce=Hc(Z.type,Z.key,Z.props,null,X.mode,ce),Wi(ce,Z),ce.return=X,X=ce)}return j(X);case w:e:{for(ye=Z.key;G!==null;){if(G.key===ye)if(G.tag===4&&G.stateNode.containerInfo===Z.containerInfo&&G.stateNode.implementation===Z.implementation){s(X,G.sibling),ce=p(G,Z.children||[]),ce.return=X,X=ce;break e}else{s(X,G);break}else a(X,G);G=G.sibling}ce=sh(Z,X.mode,ce),ce.return=X,X=ce}return j(X);case I:return ye=Z._init,Z=ye(Z._payload),st(X,G,Z,ce)}if(Y(Z))return Re(X,G,Z,ce);if(P(Z)){if(ye=P(Z),typeof ye!="function")throw Error(o(150));return Z=ye.call(Z),je(X,G,Z,ce)}if(typeof Z.then=="function")return st(X,G,ru(Z),ce);if(Z.$$typeof===A)return st(X,G,qc(X,Z),ce);au(X,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,G!==null&&G.tag===6?(s(X,G.sibling),ce=p(G,Z),ce.return=X,X=ce):(s(X,G),ce=oh(Z,X.mode,ce),ce.return=X,X=ce),j(X)):s(X,G)}return function(X,G,Z,ce){try{Xi=0;var ye=st(X,G,Z,ce);return Cs=null,ye}catch(Ee){if(Ee===Bi||Ee===Gc)throw Ee;var He=wn(29,Ee,null,X.mode);return He.lanes=ce,He.return=X,He}finally{}}}var js=cx(!0),ux=cx(!1),Bn=V(null),yr=null;function _a(n){var a=n.alternate;K(Dt,Dt.current&1),K(Bn,n),yr===null&&(a===null||ws.current!==null||a.memoizedState!==null)&&(yr=n)}function dx(n){if(n.tag===22){if(K(Dt,Dt.current),K(Bn,n),yr===null){var a=n.alternate;a!==null&&a.memoizedState!==null&&(yr=n)}}else Aa()}function Aa(){K(Dt,Dt.current),K(Bn,Bn.current)}function $r(n){F(Bn),yr===n&&(yr=null),F(Dt)}var Dt=V(0);function ou(n){for(var a=n;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||Am(s)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}function Bh(n,a,s,c){a=n.memoizedState,s=s(c,a),s=s==null?a:g({},a,s),n.memoizedState=s,n.lanes===0&&(n.updateQueue.baseState=s)}var Hh={enqueueSetState:function(n,a,s){n=n._reactInternals;var c=Cn(),p=Na(c);p.payload=a,s!=null&&(p.callback=s),a=Ca(n,p,c),a!==null&&(jn(a,n,c),$i(a,n,c))},enqueueReplaceState:function(n,a,s){n=n._reactInternals;var c=Cn(),p=Na(c);p.tag=1,p.payload=a,s!=null&&(p.callback=s),a=Ca(n,p,c),a!==null&&(jn(a,n,c),$i(a,n,c))},enqueueForceUpdate:function(n,a){n=n._reactInternals;var s=Cn(),c=Na(s);c.tag=2,a!=null&&(c.callback=a),a=Ca(n,c,s),a!==null&&(jn(a,n,s),$i(a,n,s))}};function fx(n,a,s,c,p,y,j){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(c,y,j):a.prototype&&a.prototype.isPureReactComponent?!Mi(s,c)||!Mi(p,y):!0}function hx(n,a,s,c){n=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(s,c),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(s,c),a.state!==n&&Hh.enqueueReplaceState(a,a.state,null)}function jo(n,a){var s=a;if("ref"in a){s={};for(var c in a)c!=="ref"&&(s[c]=a[c])}if(n=n.defaultProps){s===a&&(s=g({},s));for(var p in n)s[p]===void 0&&(s[p]=n[p])}return s}var su=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function mx(n){su(n)}function px(n){console.error(n)}function gx(n){su(n)}function iu(n,a){try{var s=n.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(c){setTimeout(function(){throw c})}}function vx(n,a,s){try{var c=n.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function $h(n,a,s){return s=Na(s),s.tag=3,s.payload={element:null},s.callback=function(){iu(n,a)},s}function yx(n){return n=Na(n),n.tag=3,n}function xx(n,a,s,c){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var y=c.value;n.payload=function(){return p(y)},n.callback=function(){vx(a,s,c)}}var j=s.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(n.callback=function(){vx(a,s,c),typeof p!="function"&&(ka===null?ka=new Set([this]):ka.add(this));var D=c.stack;this.componentDidCatch(c.value,{componentStack:D!==null?D:""})})}function v_(n,a,s,c,p){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(a=s.alternate,a!==null&&Li(a,s,p,!0),s=Bn.current,s!==null){switch(s.tag){case 13:return yr===null?dm():s.alternate===null&&vt===0&&(vt=3),s.flags&=-257,s.flags|=65536,s.lanes=p,c===gh?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([c]):a.add(c),hm(n,c,p)),!1;case 22:return s.flags|=65536,c===gh?s.flags|=16384:(a=s.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=a):(s=a.retryQueue,s===null?a.retryQueue=new Set([c]):s.add(c)),hm(n,c,p)),!1}throw Error(o(435,s.tag))}return hm(n,c,p),dm(),!1}if(et)return a=Bn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=p,c!==ch&&(n=Error(o(422),{cause:c}),zi(zn(n,s)))):(c!==ch&&(a=Error(o(423),{cause:c}),zi(zn(a,s))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,c=zn(c,s),p=$h(n.stateNode,c,p),xh(n,p),vt!==4&&(vt=2)),!1;var y=Error(o(520),{cause:c});if(y=zn(y,s),nl===null?nl=[y]:nl.push(y),vt!==4&&(vt=2),a===null)return!0;c=zn(c,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,n=p&-p,s.lanes|=n,n=$h(s.stateNode,c,n),xh(s,n),!1;case 1:if(a=s.type,y=s.stateNode,(s.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ka===null||!ka.has(y))))return s.flags|=65536,p&=-p,s.lanes|=p,p=yx(p),xx(p,n,s,c),xh(s,p),!1}s=s.return}while(s!==null);return!1}var bx=Error(o(461)),Pt=!1;function qt(n,a,s,c){a.child=n===null?ux(a,null,s,c):js(a,n.child,s,c)}function wx(n,a,s,c,p){s=s.render;var y=a.ref;if("ref"in c){var j={};for(var D in c)D!=="ref"&&(j[D]=c[D])}else j=c;return Eo(a),c=Nh(n,a,s,j,y,p),D=Ch(),n!==null&&!Pt?(jh(n,a,p),Ir(n,a,p)):(et&&D&&ih(a),a.flags|=1,qt(n,a,c,p),a.child)}function Sx(n,a,s,c,p){if(n===null){var y=s.type;return typeof y=="function"&&!ah(y)&&y.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=y,Ex(n,a,y,c,p)):(n=Hc(s.type,null,c,a,a.mode,p),n.ref=a.ref,n.return=a,a.child=n)}if(y=n.child,!Wh(n,p)){var j=y.memoizedProps;if(s=s.compare,s=s!==null?s:Mi,s(j,c)&&n.ref===a.ref)return Ir(n,a,p)}return a.flags|=1,n=zr(y,c),n.ref=a.ref,n.return=a,a.child=n}function Ex(n,a,s,c,p){if(n!==null){var y=n.memoizedProps;if(Mi(y,c)&&n.ref===a.ref)if(Pt=!1,a.pendingProps=c=y,Wh(n,p))(n.flags&131072)!==0&&(Pt=!0);else return a.lanes=n.lanes,Ir(n,a,p)}return Ih(n,a,s,c,p)}function Nx(n,a,s){var c=a.pendingProps,p=c.children,y=n!==null?n.memoizedState:null;if(c.mode==="hidden"){if((a.flags&128)!==0){if(c=y!==null?y.baseLanes|s:s,n!==null){for(p=a.child=n.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;a.childLanes=y&~c}else a.childLanes=0,a.child=null;return Cx(n,a,c,s)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},n!==null&&Yc(a,y!==null?y.cachePool:null),y!==null?Ey(a,y):wh(),dx(a);else return a.lanes=a.childLanes=536870912,Cx(n,a,y!==null?y.baseLanes|s:s,s)}else y!==null?(Yc(a,y.cachePool),Ey(a,y),Aa(),a.memoizedState=null):(n!==null&&Yc(a,null),wh(),Aa());return qt(n,a,p,s),a.child}function Cx(n,a,s,c){var p=ph();return p=p===null?null:{parent:Mt._currentValue,pool:p},a.memoizedState={baseLanes:s,cachePool:p},n!==null&&Yc(a,null),wh(),dx(a),n!==null&&Li(n,a,c,!0),null}function lu(n,a){var s=a.ref;if(s===null)n!==null&&n.ref!==null&&(a.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(n===null||n.ref!==s)&&(a.flags|=4194816)}}function Ih(n,a,s,c,p){return Eo(a),s=Nh(n,a,s,c,void 0,p),c=Ch(),n!==null&&!Pt?(jh(n,a,p),Ir(n,a,p)):(et&&c&&ih(a),a.flags|=1,qt(n,a,s,p),a.child)}function jx(n,a,s,c,p,y){return Eo(a),a.updateQueue=null,s=Cy(a,c,s,p),Ny(n),c=Ch(),n!==null&&!Pt?(jh(n,a,y),Ir(n,a,y)):(et&&c&&ih(a),a.flags|=1,qt(n,a,s,y),a.child)}function _x(n,a,s,c,p){if(Eo(a),a.stateNode===null){var y=gs,j=s.contextType;typeof j=="object"&&j!==null&&(y=Kt(j)),y=new s(c,y),a.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Hh,a.stateNode=y,y._reactInternals=a,y=a.stateNode,y.props=c,y.state=a.memoizedState,y.refs={},vh(a),j=s.contextType,y.context=typeof j=="object"&&j!==null?Kt(j):gs,y.state=a.memoizedState,j=s.getDerivedStateFromProps,typeof j=="function"&&(Bh(a,s,j,c),y.state=a.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(j=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),j!==y.state&&Hh.enqueueReplaceState(y,y.state,null),Vi(a,c,y,p),Ii(),y.state=a.memoizedState),typeof y.componentDidMount=="function"&&(a.flags|=4194308),c=!0}else if(n===null){y=a.stateNode;var D=a.memoizedProps,H=jo(s,D);y.props=H;var J=y.context,le=s.contextType;j=gs,typeof le=="object"&&le!==null&&(j=Kt(le));var ue=s.getDerivedStateFromProps;le=typeof ue=="function"||typeof y.getSnapshotBeforeUpdate=="function",D=a.pendingProps!==D,le||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(D||J!==j)&&hx(a,y,c,j),Ea=!1;var ee=a.memoizedState;y.state=ee,Vi(a,c,y,p),Ii(),J=a.memoizedState,D||ee!==J||Ea?(typeof ue=="function"&&(Bh(a,s,ue,c),J=a.memoizedState),(H=Ea||fx(a,s,H,c,ee,J,j))?(le||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(a.flags|=4194308)):(typeof y.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=c,a.memoizedState=J),y.props=c,y.state=J,y.context=j,c=H):(typeof y.componentDidMount=="function"&&(a.flags|=4194308),c=!1)}else{y=a.stateNode,yh(n,a),j=a.memoizedProps,le=jo(s,j),y.props=le,ue=a.pendingProps,ee=y.context,J=s.contextType,H=gs,typeof J=="object"&&J!==null&&(H=Kt(J)),D=s.getDerivedStateFromProps,(J=typeof D=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(j!==ue||ee!==H)&&hx(a,y,c,H),Ea=!1,ee=a.memoizedState,y.state=ee,Vi(a,c,y,p),Ii();var ne=a.memoizedState;j!==ue||ee!==ne||Ea||n!==null&&n.dependencies!==null&&Vc(n.dependencies)?(typeof D=="function"&&(Bh(a,s,D,c),ne=a.memoizedState),(le=Ea||fx(a,s,le,c,ee,ne,H)||n!==null&&n.dependencies!==null&&Vc(n.dependencies))?(J||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,ne,H),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,ne,H)),typeof y.componentDidUpdate=="function"&&(a.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof y.componentDidUpdate!="function"||j===n.memoizedProps&&ee===n.memoizedState||(a.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&ee===n.memoizedState||(a.flags|=1024),a.memoizedProps=c,a.memoizedState=ne),y.props=c,y.state=ne,y.context=H,c=le):(typeof y.componentDidUpdate!="function"||j===n.memoizedProps&&ee===n.memoizedState||(a.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&ee===n.memoizedState||(a.flags|=1024),c=!1)}return y=c,lu(n,a),c=(a.flags&128)!==0,y||c?(y=a.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:y.render(),a.flags|=1,n!==null&&c?(a.child=js(a,n.child,null,p),a.child=js(a,null,s,p)):qt(n,a,s,p),a.memoizedState=y.state,n=a.child):n=Ir(n,a,p),n}function Ax(n,a,s,c){return ki(),a.flags|=256,qt(n,a,s,c),a.child}var Vh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qh(n){return{baseLanes:n,cachePool:py()}}function Yh(n,a,s){return n=n!==null?n.childLanes&~s:0,a&&(n|=Hn),n}function Tx(n,a,s){var c=a.pendingProps,p=!1,y=(a.flags&128)!==0,j;if((j=y)||(j=n!==null&&n.memoizedState===null?!1:(Dt.current&2)!==0),j&&(p=!0,a.flags&=-129),j=(a.flags&32)!==0,a.flags&=-33,n===null){if(et){if(p?_a(a):Aa(),et){var D=gt,H;if(H=D){e:{for(H=D,D=vr;H.nodeType!==8;){if(!D){D=null;break e}if(H=Qn(H.nextSibling),H===null){D=null;break e}}D=H}D!==null?(a.memoizedState={dehydrated:D,treeContext:yo!==null?{id:Lr,overflow:Pr}:null,retryLane:536870912,hydrationErrors:null},H=wn(18,null,null,0),H.stateNode=D,H.return=a,a.child=H,nn=a,gt=null,H=!0):H=!1}H||wo(a)}if(D=a.memoizedState,D!==null&&(D=D.dehydrated,D!==null))return Am(D)?a.lanes=32:a.lanes=536870912,null;$r(a)}return D=c.children,c=c.fallback,p?(Aa(),p=a.mode,D=cu({mode:"hidden",children:D},p),c=vo(c,p,s,null),D.return=a,c.return=a,D.sibling=c,a.child=D,p=a.child,p.memoizedState=qh(s),p.childLanes=Yh(n,j,s),a.memoizedState=Vh,c):(_a(a),Gh(a,D))}if(H=n.memoizedState,H!==null&&(D=H.dehydrated,D!==null)){if(y)a.flags&256?(_a(a),a.flags&=-257,a=Fh(n,a,s)):a.memoizedState!==null?(Aa(),a.child=n.child,a.flags|=128,a=null):(Aa(),p=c.fallback,D=a.mode,c=cu({mode:"visible",children:c.children},D),p=vo(p,D,s,null),p.flags|=2,c.return=a,p.return=a,c.sibling=p,a.child=c,js(a,n.child,null,s),c=a.child,c.memoizedState=qh(s),c.childLanes=Yh(n,j,s),a.memoizedState=Vh,a=p);else if(_a(a),Am(D)){if(j=D.nextSibling&&D.nextSibling.dataset,j)var J=j.dgst;j=J,c=Error(o(419)),c.stack="",c.digest=j,zi({value:c,source:null,stack:null}),a=Fh(n,a,s)}else if(Pt||Li(n,a,s,!1),j=(s&n.childLanes)!==0,Pt||j){if(j=lt,j!==null&&(c=s&-s,c=(c&42)!==0?1:xi(c),c=(c&(j.suspendedLanes|s))!==0?0:c,c!==0&&c!==H.retryLane))throw H.retryLane=c,ps(n,c),jn(j,n,c),bx;D.data==="$?"||dm(),a=Fh(n,a,s)}else D.data==="$?"?(a.flags|=192,a.child=n.child,a=null):(n=H.treeContext,gt=Qn(D.nextSibling),nn=a,et=!0,bo=null,vr=!1,n!==null&&(Pn[Un++]=Lr,Pn[Un++]=Pr,Pn[Un++]=yo,Lr=n.id,Pr=n.overflow,yo=a),a=Gh(a,c.children),a.flags|=4096);return a}return p?(Aa(),p=c.fallback,D=a.mode,H=n.child,J=H.sibling,c=zr(H,{mode:"hidden",children:c.children}),c.subtreeFlags=H.subtreeFlags&65011712,J!==null?p=zr(J,p):(p=vo(p,D,s,null),p.flags|=2),p.return=a,c.return=a,c.sibling=p,a.child=c,c=p,p=a.child,D=n.child.memoizedState,D===null?D=qh(s):(H=D.cachePool,H!==null?(J=Mt._currentValue,H=H.parent!==J?{parent:J,pool:J}:H):H=py(),D={baseLanes:D.baseLanes|s,cachePool:H}),p.memoizedState=D,p.childLanes=Yh(n,j,s),a.memoizedState=Vh,c):(_a(a),s=n.child,n=s.sibling,s=zr(s,{mode:"visible",children:c.children}),s.return=a,s.sibling=null,n!==null&&(j=a.deletions,j===null?(a.deletions=[n],a.flags|=16):j.push(n)),a.child=s,a.memoizedState=null,s)}function Gh(n,a){return a=cu({mode:"visible",children:a},n.mode),a.return=n,n.child=a}function cu(n,a){return n=wn(22,n,null,a),n.lanes=0,n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},n}function Fh(n,a,s){return js(a,n.child,null,s),n=Gh(a,a.pendingProps.children),n.flags|=2,a.memoizedState=null,n}function Rx(n,a,s){n.lanes|=a;var c=n.alternate;c!==null&&(c.lanes|=a),dh(n.return,a,s)}function Xh(n,a,s,c,p){var y=n.memoizedState;y===null?n.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:p}:(y.isBackwards=a,y.rendering=null,y.renderingStartTime=0,y.last=c,y.tail=s,y.tailMode=p)}function Mx(n,a,s){var c=a.pendingProps,p=c.revealOrder,y=c.tail;if(qt(n,a,c.children,s),c=Dt.current,(c&2)!==0)c=c&1|2,a.flags|=128;else{if(n!==null&&(n.flags&128)!==0)e:for(n=a.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Rx(n,s,a);else if(n.tag===19)Rx(n,s,a);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===a)break e;for(;n.sibling===null;){if(n.return===null||n.return===a)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}c&=1}switch(K(Dt,c),p){case"forwards":for(s=a.child,p=null;s!==null;)n=s.alternate,n!==null&&ou(n)===null&&(p=s),s=s.sibling;s=p,s===null?(p=a.child,a.child=null):(p=s.sibling,s.sibling=null),Xh(a,!1,p,s,y);break;case"backwards":for(s=null,p=a.child,a.child=null;p!==null;){if(n=p.alternate,n!==null&&ou(n)===null){a.child=p;break}n=p.sibling,p.sibling=s,s=p,p=n}Xh(a,!0,s,null,y);break;case"together":Xh(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function Ir(n,a,s){if(n!==null&&(a.dependencies=n.dependencies),Oa|=a.lanes,(s&a.childLanes)===0)if(n!==null){if(Li(n,a,s,!1),(s&a.childLanes)===0)return null}else return null;if(n!==null&&a.child!==n.child)throw Error(o(153));if(a.child!==null){for(n=a.child,s=zr(n,n.pendingProps),a.child=s,s.return=a;n.sibling!==null;)n=n.sibling,s=s.sibling=zr(n,n.pendingProps),s.return=a;s.sibling=null}return a.child}function Wh(n,a){return(n.lanes&a)!==0?!0:(n=n.dependencies,!!(n!==null&&Vc(n)))}function y_(n,a,s){switch(a.tag){case 3:me(a,a.stateNode.containerInfo),Sa(a,Mt,n.memoizedState.cache),ki();break;case 27:case 5:ge(a);break;case 4:me(a,a.stateNode.containerInfo);break;case 10:Sa(a,a.type,a.memoizedProps.value);break;case 13:var c=a.memoizedState;if(c!==null)return c.dehydrated!==null?(_a(a),a.flags|=128,null):(s&a.child.childLanes)!==0?Tx(n,a,s):(_a(a),n=Ir(n,a,s),n!==null?n.sibling:null);_a(a);break;case 19:var p=(n.flags&128)!==0;if(c=(s&a.childLanes)!==0,c||(Li(n,a,s,!1),c=(s&a.childLanes)!==0),p){if(c)return Mx(n,a,s);a.flags|=128}if(p=a.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),K(Dt,Dt.current),c)break;return null;case 22:case 23:return a.lanes=0,Nx(n,a,s);case 24:Sa(a,Mt,n.memoizedState.cache)}return Ir(n,a,s)}function Dx(n,a,s){if(n!==null)if(n.memoizedProps!==a.pendingProps)Pt=!0;else{if(!Wh(n,s)&&(a.flags&128)===0)return Pt=!1,y_(n,a,s);Pt=(n.flags&131072)!==0}else Pt=!1,et&&(a.flags&1048576)!==0&&ly(a,Ic,a.index);switch(a.lanes=0,a.tag){case 16:e:{n=a.pendingProps;var c=a.elementType,p=c._init;if(c=p(c._payload),a.type=c,typeof c=="function")ah(c)?(n=jo(c,n),a.tag=1,a=_x(null,a,c,n,s)):(a.tag=0,a=Ih(null,a,c,n,s));else{if(c!=null){if(p=c.$$typeof,p===_){a.tag=11,a=wx(null,a,c,n,s);break e}else if(p===B){a.tag=14,a=Sx(null,a,c,n,s);break e}}throw a=k(c)||c,Error(o(306,a,""))}}return a;case 0:return Ih(n,a,a.type,a.pendingProps,s);case 1:return c=a.type,p=jo(c,a.pendingProps),_x(n,a,c,p,s);case 3:e:{if(me(a,a.stateNode.containerInfo),n===null)throw Error(o(387));c=a.pendingProps;var y=a.memoizedState;p=y.element,yh(n,a),Vi(a,c,null,s);var j=a.memoizedState;if(c=j.cache,Sa(a,Mt,c),c!==y.cache&&fh(a,[Mt],s,!0),Ii(),c=j.element,y.isDehydrated)if(y={element:c,isDehydrated:!1,cache:j.cache},a.updateQueue.baseState=y,a.memoizedState=y,a.flags&256){a=Ax(n,a,c,s);break e}else if(c!==p){p=zn(Error(o(424)),a),zi(p),a=Ax(n,a,c,s);break e}else{switch(n=a.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(gt=Qn(n.firstChild),nn=a,et=!0,bo=null,vr=!0,s=ux(a,null,c,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(ki(),c===p){a=Ir(n,a,s);break e}qt(n,a,c,s)}a=a.child}return a;case 26:return lu(n,a),n===null?(s=L0(a.type,null,a.pendingProps,null))?a.memoizedState=s:et||(s=a.type,n=a.pendingProps,c=Eu(se.current).createElement(s),c[Lt]=a,c[Wt]=n,Gt(c,s,n),jt(c),a.stateNode=c):a.memoizedState=L0(a.type,n.memoizedProps,a.pendingProps,n.memoizedState),null;case 27:return ge(a),n===null&&et&&(c=a.stateNode=O0(a.type,a.pendingProps,se.current),nn=a,vr=!0,p=gt,Pa(a.type)?(Tm=p,gt=Qn(c.firstChild)):gt=p),qt(n,a,a.pendingProps.children,s),lu(n,a),n===null&&(a.flags|=4194304),a.child;case 5:return n===null&&et&&((p=c=gt)&&(c=G_(c,a.type,a.pendingProps,vr),c!==null?(a.stateNode=c,nn=a,gt=Qn(c.firstChild),vr=!1,p=!0):p=!1),p||wo(a)),ge(a),p=a.type,y=a.pendingProps,j=n!==null?n.memoizedProps:null,c=y.children,Cm(p,y)?c=null:j!==null&&Cm(p,j)&&(a.flags|=32),a.memoizedState!==null&&(p=Nh(n,a,u_,null,null,s),dl._currentValue=p),lu(n,a),qt(n,a,c,s),a.child;case 6:return n===null&&et&&((n=s=gt)&&(s=F_(s,a.pendingProps,vr),s!==null?(a.stateNode=s,nn=a,gt=null,n=!0):n=!1),n||wo(a)),null;case 13:return Tx(n,a,s);case 4:return me(a,a.stateNode.containerInfo),c=a.pendingProps,n===null?a.child=js(a,null,c,s):qt(n,a,c,s),a.child;case 11:return wx(n,a,a.type,a.pendingProps,s);case 7:return qt(n,a,a.pendingProps,s),a.child;case 8:return qt(n,a,a.pendingProps.children,s),a.child;case 12:return qt(n,a,a.pendingProps.children,s),a.child;case 10:return c=a.pendingProps,Sa(a,a.type,c.value),qt(n,a,c.children,s),a.child;case 9:return p=a.type._context,c=a.pendingProps.children,Eo(a),p=Kt(p),c=c(p),a.flags|=1,qt(n,a,c,s),a.child;case 14:return Sx(n,a,a.type,a.pendingProps,s);case 15:return Ex(n,a,a.type,a.pendingProps,s);case 19:return Mx(n,a,s);case 31:return c=a.pendingProps,s=a.mode,c={mode:c.mode,children:c.children},n===null?(s=cu(c,s),s.ref=a.ref,a.child=s,s.return=a,a=s):(s=zr(n.child,c),s.ref=a.ref,a.child=s,s.return=a,a=s),a;case 22:return Nx(n,a,s);case 24:return Eo(a),c=Kt(Mt),n===null?(p=ph(),p===null&&(p=lt,y=hh(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=s),p=y),a.memoizedState={parent:c,cache:p},vh(a),Sa(a,Mt,p)):((n.lanes&s)!==0&&(yh(n,a),Vi(a,null,null,s),Ii()),p=n.memoizedState,y=a.memoizedState,p.parent!==c?(p={parent:c,cache:c},a.memoizedState=p,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=p),Sa(a,Mt,c)):(c=y.cache,Sa(a,Mt,c),c!==p.cache&&fh(a,[Mt],s,!0))),qt(n,a,a.pendingProps.children,s),a.child;case 29:throw a.pendingProps}throw Error(o(156,a.tag))}function Vr(n){n.flags|=4}function Ox(n,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!$0(a)){if(a=Bn.current,a!==null&&((Fe&4194048)===Fe?yr!==null:(Fe&62914560)!==Fe&&(Fe&536870912)===0||a!==yr))throw Hi=gh,gy;n.flags|=8192}}function uu(n,a){a!==null&&(n.flags|=4),n.flags&16384&&(a=n.tag!==22?ma():536870912,n.lanes|=a,Rs|=a)}function Ki(n,a){if(!et)switch(n.tailMode){case"hidden":a=n.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?n.tail=null:s.sibling=null;break;case"collapsed":s=n.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?a||n.tail===null?n.tail=null:n.tail.sibling=null:c.sibling=null}}function pt(n){var a=n.alternate!==null&&n.alternate.child===n.child,s=0,c=0;if(a)for(var p=n.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=c,n.childLanes=s,a}function x_(n,a,s){var c=a.pendingProps;switch(lh(a),a.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pt(a),null;case 1:return pt(a),null;case 3:return s=a.stateNode,c=null,n!==null&&(c=n.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),Br(Mt),pe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(n===null||n.child===null)&&(Oi(a)?Vr(a):n===null||n.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,dy())),pt(a),null;case 26:return s=a.memoizedState,n===null?(Vr(a),s!==null?(pt(a),Ox(a,s)):(pt(a),a.flags&=-16777217)):s?s!==n.memoizedState?(Vr(a),pt(a),Ox(a,s)):(pt(a),a.flags&=-16777217):(n.memoizedProps!==c&&Vr(a),pt(a),a.flags&=-16777217),null;case 27:Se(a),s=se.current;var p=a.type;if(n!==null&&a.stateNode!=null)n.memoizedProps!==c&&Vr(a);else{if(!c){if(a.stateNode===null)throw Error(o(166));return pt(a),null}n=re.current,Oi(a)?cy(a):(n=O0(p,c,s),a.stateNode=n,Vr(a))}return pt(a),null;case 5:if(Se(a),s=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==c&&Vr(a);else{if(!c){if(a.stateNode===null)throw Error(o(166));return pt(a),null}if(n=re.current,Oi(a))cy(a);else{switch(p=Eu(se.current),n){case 1:n=p.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:n=p.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":n=p.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":n=p.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":n=p.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof c.is=="string"?p.createElement("select",{is:c.is}):p.createElement("select"),c.multiple?n.multiple=!0:c.size&&(n.size=c.size);break;default:n=typeof c.is=="string"?p.createElement(s,{is:c.is}):p.createElement(s)}}n[Lt]=a,n[Wt]=c;e:for(p=a.child;p!==null;){if(p.tag===5||p.tag===6)n.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===a)break e;for(;p.sibling===null;){if(p.return===null||p.return===a)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}a.stateNode=n;e:switch(Gt(n,s,c),s){case"button":case"input":case"select":case"textarea":n=!!c.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Vr(a)}}return pt(a),a.flags&=-16777217,null;case 6:if(n&&a.stateNode!=null)n.memoizedProps!==c&&Vr(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(o(166));if(n=se.current,Oi(a)){if(n=a.stateNode,s=a.memoizedProps,c=null,p=nn,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}n[Lt]=a,n=!!(n.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||j0(n.nodeValue,s)),n||wo(a)}else n=Eu(n).createTextNode(c),n[Lt]=a,a.stateNode=n}return pt(a),null;case 13:if(c=a.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=Oi(a),c!==null&&c.dehydrated!==null){if(n===null){if(!p)throw Error(o(318));if(p=a.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(o(317));p[Lt]=a}else ki(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;pt(a),p=!1}else p=dy(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return a.flags&256?($r(a),a):($r(a),null)}if($r(a),(a.flags&128)!==0)return a.lanes=s,a;if(s=c!==null,n=n!==null&&n.memoizedState!==null,s){c=a.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool);var y=null;c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==p&&(c.flags|=2048)}return s!==n&&s&&(a.child.flags|=8192),uu(a,a.updateQueue),pt(a),null;case 4:return pe(),n===null&&bm(a.stateNode.containerInfo),pt(a),null;case 10:return Br(a.type),pt(a),null;case 19:if(F(Dt),p=a.memoizedState,p===null)return pt(a),null;if(c=(a.flags&128)!==0,y=p.rendering,y===null)if(c)Ki(p,!1);else{if(vt!==0||n!==null&&(n.flags&128)!==0)for(n=a.child;n!==null;){if(y=ou(n),y!==null){for(a.flags|=128,Ki(p,!1),n=y.updateQueue,a.updateQueue=n,uu(a,n),a.subtreeFlags=0,n=s,s=a.child;s!==null;)iy(s,n),s=s.sibling;return K(Dt,Dt.current&1|2),a.child}n=n.sibling}p.tail!==null&&he()>hu&&(a.flags|=128,c=!0,Ki(p,!1),a.lanes=4194304)}else{if(!c)if(n=ou(y),n!==null){if(a.flags|=128,c=!0,n=n.updateQueue,a.updateQueue=n,uu(a,n),Ki(p,!0),p.tail===null&&p.tailMode==="hidden"&&!y.alternate&&!et)return pt(a),null}else 2*he()-p.renderingStartTime>hu&&s!==536870912&&(a.flags|=128,c=!0,Ki(p,!1),a.lanes=4194304);p.isBackwards?(y.sibling=a.child,a.child=y):(n=p.last,n!==null?n.sibling=y:a.child=y,p.last=y)}return p.tail!==null?(a=p.tail,p.rendering=a,p.tail=a.sibling,p.renderingStartTime=he(),a.sibling=null,n=Dt.current,K(Dt,c?n&1|2:n&1),a):(pt(a),null);case 22:case 23:return $r(a),Sh(),c=a.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(a.flags|=8192):c&&(a.flags|=8192),c?(s&536870912)!==0&&(a.flags&128)===0&&(pt(a),a.subtreeFlags&6&&(a.flags|=8192)):pt(a),s=a.updateQueue,s!==null&&uu(a,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==s&&(a.flags|=2048),n!==null&&F(No),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),Br(Mt),pt(a),null;case 25:return null;case 30:return null}throw Error(o(156,a.tag))}function b_(n,a){switch(lh(a),a.tag){case 1:return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 3:return Br(Mt),pe(),n=a.flags,(n&65536)!==0&&(n&128)===0?(a.flags=n&-65537|128,a):null;case 26:case 27:case 5:return Se(a),null;case 13:if($r(a),n=a.memoizedState,n!==null&&n.dehydrated!==null){if(a.alternate===null)throw Error(o(340));ki()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 19:return F(Dt),null;case 4:return pe(),null;case 10:return Br(a.type),null;case 22:case 23:return $r(a),Sh(),n!==null&&F(No),n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 24:return Br(Mt),null;case 25:return null;default:return null}}function kx(n,a){switch(lh(a),a.tag){case 3:Br(Mt),pe();break;case 26:case 27:case 5:Se(a);break;case 4:pe();break;case 13:$r(a);break;case 19:F(Dt);break;case 10:Br(a.type);break;case 22:case 23:$r(a),Sh(),n!==null&&F(No);break;case 24:Br(Mt)}}function Zi(n,a){try{var s=a.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var p=c.next;s=p;do{if((s.tag&n)===n){c=void 0;var y=s.create,j=s.inst;c=y(),j.destroy=c}s=s.next}while(s!==p)}}catch(D){it(a,a.return,D)}}function Ta(n,a,s){try{var c=a.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var y=p.next;c=y;do{if((c.tag&n)===n){var j=c.inst,D=j.destroy;if(D!==void 0){j.destroy=void 0,p=a;var H=s,J=D;try{J()}catch(le){it(p,H,le)}}}c=c.next}while(c!==y)}}catch(le){it(a,a.return,le)}}function zx(n){var a=n.updateQueue;if(a!==null){var s=n.stateNode;try{Sy(a,s)}catch(c){it(n,n.return,c)}}}function Lx(n,a,s){s.props=jo(n.type,n.memoizedProps),s.state=n.memoizedState;try{s.componentWillUnmount()}catch(c){it(n,a,c)}}function Qi(n,a){try{var s=n.ref;if(s!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof s=="function"?n.refCleanup=s(c):s.current=c}}catch(p){it(n,a,p)}}function xr(n,a){var s=n.ref,c=n.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(p){it(n,a,p)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){it(n,a,p)}else s.current=null}function Px(n){var a=n.type,s=n.memoizedProps,c=n.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(p){it(n,n.return,p)}}function Kh(n,a,s){try{var c=n.stateNode;$_(c,n.type,s,a),c[Wt]=a}catch(p){it(n,n.return,p)}}function Ux(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Pa(n.type)||n.tag===4}function Zh(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Ux(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Pa(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Qh(n,a,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(n,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(n),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=Su));else if(c!==4&&(c===27&&Pa(n.type)&&(s=n.stateNode,a=null),n=n.child,n!==null))for(Qh(n,a,s),n=n.sibling;n!==null;)Qh(n,a,s),n=n.sibling}function du(n,a,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,a?s.insertBefore(n,a):s.appendChild(n);else if(c!==4&&(c===27&&Pa(n.type)&&(s=n.stateNode),n=n.child,n!==null))for(du(n,a,s),n=n.sibling;n!==null;)du(n,a,s),n=n.sibling}function Bx(n){var a=n.stateNode,s=n.memoizedProps;try{for(var c=n.type,p=a.attributes;p.length;)a.removeAttributeNode(p[0]);Gt(a,c,s),a[Lt]=n,a[Wt]=s}catch(y){it(n,n.return,y)}}var qr=!1,St=!1,Jh=!1,Hx=typeof WeakSet=="function"?WeakSet:Set,Ut=null;function w_(n,a){if(n=n.containerInfo,Em=Tu,n=Zv(n),Zf(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var p=c.anchorOffset,y=c.focusNode;c=c.focusOffset;try{s.nodeType,y.nodeType}catch{s=null;break e}var j=0,D=-1,H=-1,J=0,le=0,ue=n,ee=null;t:for(;;){for(var ne;ue!==s||p!==0&&ue.nodeType!==3||(D=j+p),ue!==y||c!==0&&ue.nodeType!==3||(H=j+c),ue.nodeType===3&&(j+=ue.nodeValue.length),(ne=ue.firstChild)!==null;)ee=ue,ue=ne;for(;;){if(ue===n)break t;if(ee===s&&++J===p&&(D=j),ee===y&&++le===c&&(H=j),(ne=ue.nextSibling)!==null)break;ue=ee,ee=ue.parentNode}ue=ne}s=D===-1||H===-1?null:{start:D,end:H}}else s=null}s=s||{start:0,end:0}}else s=null;for(Nm={focusedElem:n,selectionRange:s},Tu=!1,Ut=a;Ut!==null;)if(a=Ut,n=a.child,(a.subtreeFlags&1024)!==0&&n!==null)n.return=a,Ut=n;else for(;Ut!==null;){switch(a=Ut,y=a.alternate,n=a.flags,a.tag){case 0:break;case 11:case 15:break;case 1:if((n&1024)!==0&&y!==null){n=void 0,s=a,p=y.memoizedProps,y=y.memoizedState,c=s.stateNode;try{var Re=jo(s.type,p,s.elementType===s.type);n=c.getSnapshotBeforeUpdate(Re,y),c.__reactInternalSnapshotBeforeUpdate=n}catch(je){it(s,s.return,je)}}break;case 3:if((n&1024)!==0){if(n=a.stateNode.containerInfo,s=n.nodeType,s===9)_m(n);else if(s===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":_m(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(o(163))}if(n=a.sibling,n!==null){n.return=a.return,Ut=n;break}Ut=a.return}}function $x(n,a,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:Ra(n,s),c&4&&Zi(5,s);break;case 1:if(Ra(n,s),c&4)if(n=s.stateNode,a===null)try{n.componentDidMount()}catch(j){it(s,s.return,j)}else{var p=jo(s.type,a.memoizedProps);a=a.memoizedState;try{n.componentDidUpdate(p,a,n.__reactInternalSnapshotBeforeUpdate)}catch(j){it(s,s.return,j)}}c&64&&zx(s),c&512&&Qi(s,s.return);break;case 3:if(Ra(n,s),c&64&&(n=s.updateQueue,n!==null)){if(a=null,s.child!==null)switch(s.child.tag){case 27:case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}try{Sy(n,a)}catch(j){it(s,s.return,j)}}break;case 27:a===null&&c&4&&Bx(s);case 26:case 5:Ra(n,s),a===null&&c&4&&Px(s),c&512&&Qi(s,s.return);break;case 12:Ra(n,s);break;case 13:Ra(n,s),c&4&&qx(n,s),c&64&&(n=s.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(s=R_.bind(null,s),X_(n,s))));break;case 22:if(c=s.memoizedState!==null||qr,!c){a=a!==null&&a.memoizedState!==null||St,p=qr;var y=St;qr=c,(St=a)&&!y?Ma(n,s,(s.subtreeFlags&8772)!==0):Ra(n,s),qr=p,St=y}break;case 30:break;default:Ra(n,s)}}function Ix(n){var a=n.alternate;a!==null&&(n.alternate=null,Ix(a)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(a=n.stateNode,a!==null&&Si(a)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var ft=null,un=!1;function Yr(n,a,s){for(s=s.child;s!==null;)Vx(n,a,s),s=s.sibling}function Vx(n,a,s){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(yn,s)}catch{}switch(s.tag){case 26:St||xr(s,a),Yr(n,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:St||xr(s,a);var c=ft,p=un;Pa(s.type)&&(ft=s.stateNode,un=!1),Yr(n,a,s),il(s.stateNode),ft=c,un=p;break;case 5:St||xr(s,a);case 6:if(c=ft,p=un,ft=null,Yr(n,a,s),ft=c,un=p,ft!==null)if(un)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(s.stateNode)}catch(y){it(s,a,y)}else try{ft.removeChild(s.stateNode)}catch(y){it(s,a,y)}break;case 18:ft!==null&&(un?(n=ft,M0(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,s.stateNode),pl(n)):M0(ft,s.stateNode));break;case 4:c=ft,p=un,ft=s.stateNode.containerInfo,un=!0,Yr(n,a,s),ft=c,un=p;break;case 0:case 11:case 14:case 15:St||Ta(2,s,a),St||Ta(4,s,a),Yr(n,a,s);break;case 1:St||(xr(s,a),c=s.stateNode,typeof c.componentWillUnmount=="function"&&Lx(s,a,c)),Yr(n,a,s);break;case 21:Yr(n,a,s);break;case 22:St=(c=St)||s.memoizedState!==null,Yr(n,a,s),St=c;break;default:Yr(n,a,s)}}function qx(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{pl(n)}catch(s){it(a,a.return,s)}}function S_(n){switch(n.tag){case 13:case 19:var a=n.stateNode;return a===null&&(a=n.stateNode=new Hx),a;case 22:return n=n.stateNode,a=n._retryCache,a===null&&(a=n._retryCache=new Hx),a;default:throw Error(o(435,n.tag))}}function em(n,a){var s=S_(n);a.forEach(function(c){var p=M_.bind(null,n,c);s.has(c)||(s.add(c),c.then(p,p))})}function Sn(n,a){var s=a.deletions;if(s!==null)for(var c=0;c<s.length;c++){var p=s[c],y=n,j=a,D=j;e:for(;D!==null;){switch(D.tag){case 27:if(Pa(D.type)){ft=D.stateNode,un=!1;break e}break;case 5:ft=D.stateNode,un=!1;break e;case 3:case 4:ft=D.stateNode.containerInfo,un=!0;break e}D=D.return}if(ft===null)throw Error(o(160));Vx(y,j,p),ft=null,un=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(a.subtreeFlags&13878)for(a=a.child;a!==null;)Yx(a,n),a=a.sibling}var Zn=null;function Yx(n,a){var s=n.alternate,c=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Sn(a,n),En(n),c&4&&(Ta(3,n,n.return),Zi(3,n),Ta(5,n,n.return));break;case 1:Sn(a,n),En(n),c&512&&(St||s===null||xr(s,s.return)),c&64&&qr&&(n=n.updateQueue,n!==null&&(c=n.callbacks,c!==null&&(s=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var p=Zn;if(Sn(a,n),En(n),c&512&&(St||s===null||xr(s,s.return)),c&4){var y=s!==null?s.memoizedState:null;if(c=n.memoizedState,s===null)if(c===null)if(n.stateNode===null){e:{c=n.type,s=n.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":y=p.getElementsByTagName("title")[0],(!y||y[uo]||y[Lt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(c),p.head.insertBefore(y,p.querySelector("head > title"))),Gt(y,c,s),y[Lt]=n,jt(y),c=y;break e;case"link":var j=B0("link","href",p).get(c+(s.href||""));if(j){for(var D=0;D<j.length;D++)if(y=j[D],y.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&y.getAttribute("rel")===(s.rel==null?null:s.rel)&&y.getAttribute("title")===(s.title==null?null:s.title)&&y.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){j.splice(D,1);break t}}y=p.createElement(c),Gt(y,c,s),p.head.appendChild(y);break;case"meta":if(j=B0("meta","content",p).get(c+(s.content||""))){for(D=0;D<j.length;D++)if(y=j[D],y.getAttribute("content")===(s.content==null?null:""+s.content)&&y.getAttribute("name")===(s.name==null?null:s.name)&&y.getAttribute("property")===(s.property==null?null:s.property)&&y.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&y.getAttribute("charset")===(s.charSet==null?null:s.charSet)){j.splice(D,1);break t}}y=p.createElement(c),Gt(y,c,s),p.head.appendChild(y);break;default:throw Error(o(468,c))}y[Lt]=n,jt(y),c=y}n.stateNode=c}else H0(p,n.type,n.stateNode);else n.stateNode=U0(p,c,n.memoizedProps);else y!==c?(y===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):y.count--,c===null?H0(p,n.type,n.stateNode):U0(p,c,n.memoizedProps)):c===null&&n.stateNode!==null&&Kh(n,n.memoizedProps,s.memoizedProps)}break;case 27:Sn(a,n),En(n),c&512&&(St||s===null||xr(s,s.return)),s!==null&&c&4&&Kh(n,n.memoizedProps,s.memoizedProps);break;case 5:if(Sn(a,n),En(n),c&512&&(St||s===null||xr(s,s.return)),n.flags&32){p=n.stateNode;try{ls(p,"")}catch(ne){it(n,n.return,ne)}}c&4&&n.stateNode!=null&&(p=n.memoizedProps,Kh(n,p,s!==null?s.memoizedProps:p)),c&1024&&(Jh=!0);break;case 6:if(Sn(a,n),En(n),c&4){if(n.stateNode===null)throw Error(o(162));c=n.memoizedProps,s=n.stateNode;try{s.nodeValue=c}catch(ne){it(n,n.return,ne)}}break;case 3:if(ju=null,p=Zn,Zn=Nu(a.containerInfo),Sn(a,n),Zn=p,En(n),c&4&&s!==null&&s.memoizedState.isDehydrated)try{pl(a.containerInfo)}catch(ne){it(n,n.return,ne)}Jh&&(Jh=!1,Gx(n));break;case 4:c=Zn,Zn=Nu(n.stateNode.containerInfo),Sn(a,n),En(n),Zn=c;break;case 12:Sn(a,n),En(n);break;case 13:Sn(a,n),En(n),n.child.flags&8192&&n.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(sm=he()),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,em(n,c)));break;case 22:p=n.memoizedState!==null;var H=s!==null&&s.memoizedState!==null,J=qr,le=St;if(qr=J||p,St=le||H,Sn(a,n),St=le,qr=J,En(n),c&8192)e:for(a=n.stateNode,a._visibility=p?a._visibility&-2:a._visibility|1,p&&(s===null||H||qr||St||_o(n)),s=null,a=n;;){if(a.tag===5||a.tag===26){if(s===null){H=s=a;try{if(y=H.stateNode,p)j=y.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{D=H.stateNode;var ue=H.memoizedProps.style,ee=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;D.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(ne){it(H,H.return,ne)}}}else if(a.tag===6){if(s===null){H=a;try{H.stateNode.nodeValue=p?"":H.memoizedProps}catch(ne){it(H,H.return,ne)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===n)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break e;for(;a.sibling===null;){if(a.return===null||a.return===n)break e;s===a&&(s=null),a=a.return}s===a&&(s=null),a.sibling.return=a.return,a=a.sibling}c&4&&(c=n.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,em(n,s))));break;case 19:Sn(a,n),En(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,em(n,c)));break;case 30:break;case 21:break;default:Sn(a,n),En(n)}}function En(n){var a=n.flags;if(a&2){try{for(var s,c=n.return;c!==null;){if(Ux(c)){s=c;break}c=c.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var p=s.stateNode,y=Zh(n);du(n,y,p);break;case 5:var j=s.stateNode;s.flags&32&&(ls(j,""),s.flags&=-33);var D=Zh(n);du(n,D,j);break;case 3:case 4:var H=s.stateNode.containerInfo,J=Zh(n);Qh(n,J,H);break;default:throw Error(o(161))}}catch(le){it(n,n.return,le)}n.flags&=-3}a&4096&&(n.flags&=-4097)}function Gx(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var a=n;Gx(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),n=n.sibling}}function Ra(n,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)$x(n,a.alternate,a),a=a.sibling}function _o(n){for(n=n.child;n!==null;){var a=n;switch(a.tag){case 0:case 11:case 14:case 15:Ta(4,a,a.return),_o(a);break;case 1:xr(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&Lx(a,a.return,s),_o(a);break;case 27:il(a.stateNode);case 26:case 5:xr(a,a.return),_o(a);break;case 22:a.memoizedState===null&&_o(a);break;case 30:_o(a);break;default:_o(a)}n=n.sibling}}function Ma(n,a,s){for(s=s&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var c=a.alternate,p=n,y=a,j=y.flags;switch(y.tag){case 0:case 11:case 15:Ma(p,y,s),Zi(4,y);break;case 1:if(Ma(p,y,s),c=y,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(J){it(c,c.return,J)}if(c=y,p=c.updateQueue,p!==null){var D=c.stateNode;try{var H=p.shared.hiddenCallbacks;if(H!==null)for(p.shared.hiddenCallbacks=null,p=0;p<H.length;p++)wy(H[p],D)}catch(J){it(c,c.return,J)}}s&&j&64&&zx(y),Qi(y,y.return);break;case 27:Bx(y);case 26:case 5:Ma(p,y,s),s&&c===null&&j&4&&Px(y),Qi(y,y.return);break;case 12:Ma(p,y,s);break;case 13:Ma(p,y,s),s&&j&4&&qx(p,y);break;case 22:y.memoizedState===null&&Ma(p,y,s),Qi(y,y.return);break;case 30:break;default:Ma(p,y,s)}a=a.sibling}}function tm(n,a){var s=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),n=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(n=a.memoizedState.cachePool.pool),n!==s&&(n!=null&&n.refCount++,s!=null&&Pi(s))}function nm(n,a){n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&Pi(n))}function br(n,a,s,c){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Fx(n,a,s,c),a=a.sibling}function Fx(n,a,s,c){var p=a.flags;switch(a.tag){case 0:case 11:case 15:br(n,a,s,c),p&2048&&Zi(9,a);break;case 1:br(n,a,s,c);break;case 3:br(n,a,s,c),p&2048&&(n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&Pi(n)));break;case 12:if(p&2048){br(n,a,s,c),n=a.stateNode;try{var y=a.memoizedProps,j=y.id,D=y.onPostCommit;typeof D=="function"&&D(j,a.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(H){it(a,a.return,H)}}else br(n,a,s,c);break;case 13:br(n,a,s,c);break;case 23:break;case 22:y=a.stateNode,j=a.alternate,a.memoizedState!==null?y._visibility&2?br(n,a,s,c):Ji(n,a):y._visibility&2?br(n,a,s,c):(y._visibility|=2,_s(n,a,s,c,(a.subtreeFlags&10256)!==0)),p&2048&&tm(j,a);break;case 24:br(n,a,s,c),p&2048&&nm(a.alternate,a);break;default:br(n,a,s,c)}}function _s(n,a,s,c,p){for(p=p&&(a.subtreeFlags&10256)!==0,a=a.child;a!==null;){var y=n,j=a,D=s,H=c,J=j.flags;switch(j.tag){case 0:case 11:case 15:_s(y,j,D,H,p),Zi(8,j);break;case 23:break;case 22:var le=j.stateNode;j.memoizedState!==null?le._visibility&2?_s(y,j,D,H,p):Ji(y,j):(le._visibility|=2,_s(y,j,D,H,p)),p&&J&2048&&tm(j.alternate,j);break;case 24:_s(y,j,D,H,p),p&&J&2048&&nm(j.alternate,j);break;default:_s(y,j,D,H,p)}a=a.sibling}}function Ji(n,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var s=n,c=a,p=c.flags;switch(c.tag){case 22:Ji(s,c),p&2048&&tm(c.alternate,c);break;case 24:Ji(s,c),p&2048&&nm(c.alternate,c);break;default:Ji(s,c)}a=a.sibling}}var el=8192;function As(n){if(n.subtreeFlags&el)for(n=n.child;n!==null;)Xx(n),n=n.sibling}function Xx(n){switch(n.tag){case 26:As(n),n.flags&el&&n.memoizedState!==null&&iA(Zn,n.memoizedState,n.memoizedProps);break;case 5:As(n);break;case 3:case 4:var a=Zn;Zn=Nu(n.stateNode.containerInfo),As(n),Zn=a;break;case 22:n.memoizedState===null&&(a=n.alternate,a!==null&&a.memoizedState!==null?(a=el,el=16777216,As(n),el=a):As(n));break;default:As(n)}}function Wx(n){var a=n.alternate;if(a!==null&&(n=a.child,n!==null)){a.child=null;do a=n.sibling,n.sibling=null,n=a;while(n!==null)}}function tl(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var c=a[s];Ut=c,Zx(c,n)}Wx(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Kx(n),n=n.sibling}function Kx(n){switch(n.tag){case 0:case 11:case 15:tl(n),n.flags&2048&&Ta(9,n,n.return);break;case 3:tl(n);break;case 12:tl(n);break;case 22:var a=n.stateNode;n.memoizedState!==null&&a._visibility&2&&(n.return===null||n.return.tag!==13)?(a._visibility&=-3,fu(n)):tl(n);break;default:tl(n)}}function fu(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var c=a[s];Ut=c,Zx(c,n)}Wx(n)}for(n=n.child;n!==null;){switch(a=n,a.tag){case 0:case 11:case 15:Ta(8,a,a.return),fu(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,fu(a));break;default:fu(a)}n=n.sibling}}function Zx(n,a){for(;Ut!==null;){var s=Ut;switch(s.tag){case 0:case 11:case 15:Ta(8,s,a);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Pi(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,Ut=c;else e:for(s=n;Ut!==null;){c=Ut;var p=c.sibling,y=c.return;if(Ix(c),c===s){Ut=null;break e}if(p!==null){p.return=y,Ut=p;break e}Ut=y}}}var E_={getCacheForType:function(n){var a=Kt(Mt),s=a.data.get(n);return s===void 0&&(s=n(),a.data.set(n,s)),s}},N_=typeof WeakMap=="function"?WeakMap:Map,tt=0,lt=null,Ie=null,Fe=0,nt=0,Nn=null,Da=!1,Ts=!1,rm=!1,Gr=0,vt=0,Oa=0,Ao=0,am=0,Hn=0,Rs=0,nl=null,dn=null,om=!1,sm=0,hu=1/0,mu=null,ka=null,Yt=0,za=null,Ms=null,Ds=0,im=0,lm=null,Qx=null,rl=0,cm=null;function Cn(){if((tt&2)!==0&&Fe!==0)return Fe&-Fe;if(M.T!==null){var n=xs;return n!==0?n:gm()}return bc()}function Jx(){Hn===0&&(Hn=(Fe&536870912)===0||et?rs():536870912);var n=Bn.current;return n!==null&&(n.flags|=32),Hn}function jn(n,a,s){(n===lt&&(nt===2||nt===9)||n.cancelPendingCommit!==null)&&(Os(n,0),La(n,Fe,Hn,!1)),pa(n,s),((tt&2)===0||n!==lt)&&(n===lt&&((tt&2)===0&&(Ao|=s),vt===4&&La(n,Fe,Hn,!1)),wr(n))}function e0(n,a,s){if((tt&6)!==0)throw Error(o(327));var c=!s&&(a&124)===0&&(a&n.expiredLanes)===0||Xt(n,a),p=c?__(n,a):fm(n,a,!0),y=c;do{if(p===0){Ts&&!c&&La(n,a,0,!1);break}else{if(s=n.current.alternate,y&&!C_(s)){p=fm(n,a,!1),y=!1;continue}if(p===2){if(y=a,n.errorRecoveryDisabledLanes&y)var j=0;else j=n.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){a=j;e:{var D=n;p=nl;var H=D.current.memoizedState.isDehydrated;if(H&&(Os(D,j).flags|=256),j=fm(D,j,!1),j!==2){if(rm&&!H){D.errorRecoveryDisabledLanes|=y,Ao|=y,p=4;break e}y=dn,dn=p,y!==null&&(dn===null?dn=y:dn.push.apply(dn,y))}p=j}if(y=!1,p!==2)continue}}if(p===1){Os(n,0),La(n,a,0,!0);break}e:{switch(c=n,y=p,y){case 0:case 1:throw Error(o(345));case 4:if((a&4194048)!==a)break;case 6:La(c,a,Hn,!Da);break e;case 2:dn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((a&62914560)===a&&(p=sm+300-he(),10<p)){if(La(c,a,Hn,!Da),sn(c,0,!0)!==0)break e;c.timeoutHandle=T0(t0.bind(null,c,s,dn,mu,om,a,Hn,Ao,Rs,Da,y,2,-0,0),p);break e}t0(c,s,dn,mu,om,a,Hn,Ao,Rs,Da,y,0,-0,0)}}break}while(!0);wr(n)}function t0(n,a,s,c,p,y,j,D,H,J,le,ue,ee,ne){if(n.timeoutHandle=-1,ue=a.subtreeFlags,(ue&8192||(ue&16785408)===16785408)&&(ul={stylesheets:null,count:0,unsuspend:sA},Xx(a),ue=lA(),ue!==null)){n.cancelPendingCommit=ue(l0.bind(null,n,a,y,s,c,p,j,D,H,le,1,ee,ne)),La(n,y,j,!J);return}l0(n,a,y,s,c,p,j,D,H)}function C_(n){for(var a=n;;){var s=a.tag;if((s===0||s===11||s===15)&&a.flags&16384&&(s=a.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var p=s[c],y=p.getSnapshot;p=p.value;try{if(!bn(y(),p))return!1}catch{return!1}}if(s=a.child,a.subtreeFlags&16384&&s!==null)s.return=a,a=s;else{if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function La(n,a,s,c){a&=~am,a&=~Ao,n.suspendedLanes|=a,n.pingedLanes&=~a,c&&(n.warmLanes|=a),c=n.expirationTimes;for(var p=a;0<p;){var y=31-Ct(p),j=1<<y;c[y]=-1,p&=~j}s!==0&&yc(n,s,a)}function pu(){return(tt&6)===0?(al(0),!1):!0}function um(){if(Ie!==null){if(nt===0)var n=Ie.return;else n=Ie,Ur=So=null,_h(n),Cs=null,Xi=0,n=Ie;for(;n!==null;)kx(n.alternate,n),n=n.return;Ie=null}}function Os(n,a){var s=n.timeoutHandle;s!==-1&&(n.timeoutHandle=-1,V_(s)),s=n.cancelPendingCommit,s!==null&&(n.cancelPendingCommit=null,s()),um(),lt=n,Ie=s=zr(n.current,null),Fe=a,nt=0,Nn=null,Da=!1,Ts=Xt(n,a),rm=!1,Rs=Hn=am=Ao=Oa=vt=0,dn=nl=null,om=!1,(a&8)!==0&&(a|=a&32);var c=n.entangledLanes;if(c!==0)for(n=n.entanglements,c&=a;0<c;){var p=31-Ct(c),y=1<<p;a|=n[p],c&=~y}return Gr=a,Pc(),s}function n0(n,a){Le=null,M.H=nu,a===Bi||a===Gc?(a=xy(),nt=3):a===gy?(a=xy(),nt=4):nt=a===bx?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Nn=a,Ie===null&&(vt=1,iu(n,zn(a,n.current)))}function r0(){var n=M.H;return M.H=nu,n===null?nu:n}function a0(){var n=M.A;return M.A=E_,n}function dm(){vt=4,Da||(Fe&4194048)!==Fe&&Bn.current!==null||(Ts=!0),(Oa&134217727)===0&&(Ao&134217727)===0||lt===null||La(lt,Fe,Hn,!1)}function fm(n,a,s){var c=tt;tt|=2;var p=r0(),y=a0();(lt!==n||Fe!==a)&&(mu=null,Os(n,a)),a=!1;var j=vt;e:do try{if(nt!==0&&Ie!==null){var D=Ie,H=Nn;switch(nt){case 8:um(),j=6;break e;case 3:case 2:case 9:case 6:Bn.current===null&&(a=!0);var J=nt;if(nt=0,Nn=null,ks(n,D,H,J),s&&Ts){j=0;break e}break;default:J=nt,nt=0,Nn=null,ks(n,D,H,J)}}j_(),j=vt;break}catch(le){n0(n,le)}while(!0);return a&&n.shellSuspendCounter++,Ur=So=null,tt=c,M.H=p,M.A=y,Ie===null&&(lt=null,Fe=0,Pc()),j}function j_(){for(;Ie!==null;)o0(Ie)}function __(n,a){var s=tt;tt|=2;var c=r0(),p=a0();lt!==n||Fe!==a?(mu=null,hu=he()+500,Os(n,a)):Ts=Xt(n,a);e:do try{if(nt!==0&&Ie!==null){a=Ie;var y=Nn;t:switch(nt){case 1:nt=0,Nn=null,ks(n,a,y,1);break;case 2:case 9:if(vy(y)){nt=0,Nn=null,s0(a);break}a=function(){nt!==2&&nt!==9||lt!==n||(nt=7),wr(n)},y.then(a,a);break e;case 3:nt=7;break e;case 4:nt=5;break e;case 7:vy(y)?(nt=0,Nn=null,s0(a)):(nt=0,Nn=null,ks(n,a,y,7));break;case 5:var j=null;switch(Ie.tag){case 26:j=Ie.memoizedState;case 5:case 27:var D=Ie;if(!j||$0(j)){nt=0,Nn=null;var H=D.sibling;if(H!==null)Ie=H;else{var J=D.return;J!==null?(Ie=J,gu(J)):Ie=null}break t}}nt=0,Nn=null,ks(n,a,y,5);break;case 6:nt=0,Nn=null,ks(n,a,y,6);break;case 8:um(),vt=6;break e;default:throw Error(o(462))}}A_();break}catch(le){n0(n,le)}while(!0);return Ur=So=null,M.H=c,M.A=p,tt=s,Ie!==null?0:(lt=null,Fe=0,Pc(),vt)}function A_(){for(;Ie!==null&&!Je();)o0(Ie)}function o0(n){var a=Dx(n.alternate,n,Gr);n.memoizedProps=n.pendingProps,a===null?gu(n):Ie=a}function s0(n){var a=n,s=a.alternate;switch(a.tag){case 15:case 0:a=jx(s,a,a.pendingProps,a.type,void 0,Fe);break;case 11:a=jx(s,a,a.pendingProps,a.type.render,a.ref,Fe);break;case 5:_h(a);default:kx(s,a),a=Ie=iy(a,Gr),a=Dx(s,a,Gr)}n.memoizedProps=n.pendingProps,a===null?gu(n):Ie=a}function ks(n,a,s,c){Ur=So=null,_h(a),Cs=null,Xi=0;var p=a.return;try{if(v_(n,p,a,s,Fe)){vt=1,iu(n,zn(s,n.current)),Ie=null;return}}catch(y){if(p!==null)throw Ie=p,y;vt=1,iu(n,zn(s,n.current)),Ie=null;return}a.flags&32768?(et||c===1?n=!0:Ts||(Fe&536870912)!==0?n=!1:(Da=n=!0,(c===2||c===9||c===3||c===6)&&(c=Bn.current,c!==null&&c.tag===13&&(c.flags|=16384))),i0(a,n)):gu(a)}function gu(n){var a=n;do{if((a.flags&32768)!==0){i0(a,Da);return}n=a.return;var s=x_(a.alternate,a,Gr);if(s!==null){Ie=s;return}if(a=a.sibling,a!==null){Ie=a;return}Ie=a=n}while(a!==null);vt===0&&(vt=5)}function i0(n,a){do{var s=b_(n.alternate,n);if(s!==null){s.flags&=32767,Ie=s;return}if(s=n.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(n=n.sibling,n!==null)){Ie=n;return}Ie=n=s}while(n!==null);vt=6,Ie=null}function l0(n,a,s,c,p,y,j,D,H){n.cancelPendingCommit=null;do vu();while(Yt!==0);if((tt&6)!==0)throw Error(o(327));if(a!==null){if(a===n.current)throw Error(o(177));if(y=a.lanes|a.childLanes,y|=nh,Mr(n,s,y,j,D,H),n===lt&&(Ie=lt=null,Fe=0),Ms=a,za=n,Ds=s,im=y,lm=p,Qx=c,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,D_(Be,function(){return h0(),null})):(n.callbackNode=null,n.callbackPriority=0),c=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||c){c=M.T,M.T=null,p=$.p,$.p=2,j=tt,tt|=4;try{w_(n,a,s)}finally{tt=j,$.p=p,M.T=c}}Yt=1,c0(),u0(),d0()}}function c0(){if(Yt===1){Yt=0;var n=za,a=Ms,s=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||s){s=M.T,M.T=null;var c=$.p;$.p=2;var p=tt;tt|=4;try{Yx(a,n);var y=Nm,j=Zv(n.containerInfo),D=y.focusedElem,H=y.selectionRange;if(j!==D&&D&&D.ownerDocument&&Kv(D.ownerDocument.documentElement,D)){if(H!==null&&Zf(D)){var J=H.start,le=H.end;if(le===void 0&&(le=J),"selectionStart"in D)D.selectionStart=J,D.selectionEnd=Math.min(le,D.value.length);else{var ue=D.ownerDocument||document,ee=ue&&ue.defaultView||window;if(ee.getSelection){var ne=ee.getSelection(),Re=D.textContent.length,je=Math.min(H.start,Re),st=H.end===void 0?je:Math.min(H.end,Re);!ne.extend&&je>st&&(j=st,st=je,je=j);var X=Wv(D,je),G=Wv(D,st);if(X&&G&&(ne.rangeCount!==1||ne.anchorNode!==X.node||ne.anchorOffset!==X.offset||ne.focusNode!==G.node||ne.focusOffset!==G.offset)){var Z=ue.createRange();Z.setStart(X.node,X.offset),ne.removeAllRanges(),je>st?(ne.addRange(Z),ne.extend(G.node,G.offset)):(Z.setEnd(G.node,G.offset),ne.addRange(Z))}}}}for(ue=[],ne=D;ne=ne.parentNode;)ne.nodeType===1&&ue.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<ue.length;D++){var ce=ue[D];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Tu=!!Em,Nm=Em=null}finally{tt=p,$.p=c,M.T=s}}n.current=a,Yt=2}}function u0(){if(Yt===2){Yt=0;var n=za,a=Ms,s=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||s){s=M.T,M.T=null;var c=$.p;$.p=2;var p=tt;tt|=4;try{$x(n,a.alternate,a)}finally{tt=p,$.p=c,M.T=s}}Yt=3}}function d0(){if(Yt===4||Yt===3){Yt=0,mt();var n=za,a=Ms,s=Ds,c=Qx;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Yt=5:(Yt=0,Ms=za=null,f0(n,n.pendingLanes));var p=n.pendingLanes;if(p===0&&(ka=null),bi(s),a=a.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(yn,a,void 0,(a.current.flags&128)===128)}catch{}if(c!==null){a=M.T,p=$.p,$.p=2,M.T=null;try{for(var y=n.onRecoverableError,j=0;j<c.length;j++){var D=c[j];y(D.value,{componentStack:D.stack})}}finally{M.T=a,$.p=p}}(Ds&3)!==0&&vu(),wr(n),p=n.pendingLanes,(s&4194090)!==0&&(p&42)!==0?n===cm?rl++:(rl=0,cm=n):rl=0,al(0)}}function f0(n,a){(n.pooledCacheLanes&=a)===0&&(a=n.pooledCache,a!=null&&(n.pooledCache=null,Pi(a)))}function vu(n){return c0(),u0(),d0(),h0()}function h0(){if(Yt!==5)return!1;var n=za,a=im;im=0;var s=bi(Ds),c=M.T,p=$.p;try{$.p=32>s?32:s,M.T=null,s=lm,lm=null;var y=za,j=Ds;if(Yt=0,Ms=za=null,Ds=0,(tt&6)!==0)throw Error(o(331));var D=tt;if(tt|=4,Kx(y.current),Fx(y,y.current,j,s),tt=D,al(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(yn,y)}catch{}return!0}finally{$.p=p,M.T=c,f0(n,a)}}function m0(n,a,s){a=zn(s,a),a=$h(n.stateNode,a,2),n=Ca(n,a,2),n!==null&&(pa(n,2),wr(n))}function it(n,a,s){if(n.tag===3)m0(n,n,s);else for(;a!==null;){if(a.tag===3){m0(a,n,s);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(ka===null||!ka.has(c))){n=zn(s,n),s=yx(2),c=Ca(a,s,2),c!==null&&(xx(s,c,a,n),pa(c,2),wr(c));break}}a=a.return}}function hm(n,a,s){var c=n.pingCache;if(c===null){c=n.pingCache=new N_;var p=new Set;c.set(a,p)}else p=c.get(a),p===void 0&&(p=new Set,c.set(a,p));p.has(s)||(rm=!0,p.add(s),n=T_.bind(null,n,a,s),a.then(n,n))}function T_(n,a,s){var c=n.pingCache;c!==null&&c.delete(a),n.pingedLanes|=n.suspendedLanes&s,n.warmLanes&=~s,lt===n&&(Fe&s)===s&&(vt===4||vt===3&&(Fe&62914560)===Fe&&300>he()-sm?(tt&2)===0&&Os(n,0):am|=s,Rs===Fe&&(Rs=0)),wr(n)}function p0(n,a){a===0&&(a=ma()),n=ps(n,a),n!==null&&(pa(n,a),wr(n))}function R_(n){var a=n.memoizedState,s=0;a!==null&&(s=a.retryLane),p0(n,s)}function M_(n,a){var s=0;switch(n.tag){case 13:var c=n.stateNode,p=n.memoizedState;p!==null&&(s=p.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(o(314))}c!==null&&c.delete(a),p0(n,s)}function D_(n,a){return Ge(n,a)}var yu=null,zs=null,mm=!1,xu=!1,pm=!1,To=0;function wr(n){n!==zs&&n.next===null&&(zs===null?yu=zs=n:zs=zs.next=n),xu=!0,mm||(mm=!0,k_())}function al(n,a){if(!pm&&xu){pm=!0;do for(var s=!1,c=yu;c!==null;){if(n!==0){var p=c.pendingLanes;if(p===0)var y=0;else{var j=c.suspendedLanes,D=c.pingedLanes;y=(1<<31-Ct(42|n)+1)-1,y&=p&~(j&~D),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(s=!0,x0(c,y))}else y=Fe,y=sn(c,c===lt?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(y&3)===0||Xt(c,y)||(s=!0,x0(c,y));c=c.next}while(s);pm=!1}}function O_(){g0()}function g0(){xu=mm=!1;var n=0;To!==0&&(I_()&&(n=To),To=0);for(var a=he(),s=null,c=yu;c!==null;){var p=c.next,y=v0(c,a);y===0?(c.next=null,s===null?yu=p:s.next=p,p===null&&(zs=s)):(s=c,(n!==0||(y&3)!==0)&&(xu=!0)),c=p}al(n)}function v0(n,a){for(var s=n.suspendedLanes,c=n.pingedLanes,p=n.expirationTimes,y=n.pendingLanes&-62914561;0<y;){var j=31-Ct(y),D=1<<j,H=p[j];H===-1?((D&s)===0||(D&c)!==0)&&(p[j]=lo(D,a)):H<=a&&(n.expiredLanes|=D),y&=~D}if(a=lt,s=Fe,s=sn(n,n===a?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c=n.callbackNode,s===0||n===a&&(nt===2||nt===9)||n.cancelPendingCommit!==null)return c!==null&&c!==null&&Ke(c),n.callbackNode=null,n.callbackPriority=0;if((s&3)===0||Xt(n,s)){if(a=s&-s,a===n.callbackPriority)return a;switch(c!==null&&Ke(c),bi(s)){case 2:case 8:s=qe;break;case 32:s=Be;break;case 268435456:s=Rr;break;default:s=Be}return c=y0.bind(null,n),s=Ge(s,c),n.callbackPriority=a,n.callbackNode=s,a}return c!==null&&c!==null&&Ke(c),n.callbackPriority=2,n.callbackNode=null,2}function y0(n,a){if(Yt!==0&&Yt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var s=n.callbackNode;if(vu()&&n.callbackNode!==s)return null;var c=Fe;return c=sn(n,n===lt?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c===0?null:(e0(n,c,a),v0(n,he()),n.callbackNode!=null&&n.callbackNode===s?y0.bind(null,n):null)}function x0(n,a){if(vu())return null;e0(n,a,!0)}function k_(){q_(function(){(tt&6)!==0?Ge(Te,O_):g0()})}function gm(){return To===0&&(To=rs()),To}function b0(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Rc(""+n)}function w0(n,a){var s=a.ownerDocument.createElement("input");return s.name=a.name,s.value=a.value,n.id&&s.setAttribute("form",n.id),a.parentNode.insertBefore(s,a),n=new FormData(n),s.parentNode.removeChild(s),n}function z_(n,a,s,c,p){if(a==="submit"&&s&&s.stateNode===p){var y=b0((p[Wt]||null).action),j=c.submitter;j&&(a=(a=j[Wt]||null)?b0(a.formAction):j.getAttribute("formAction"),a!==null&&(y=a,j=null));var D=new kc("action","action",null,c,p);n.push({event:D,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(To!==0){var H=j?w0(p,j):new FormData(p);Lh(s,{pending:!0,data:H,method:p.method,action:y},null,H)}}else typeof y=="function"&&(D.preventDefault(),H=j?w0(p,j):new FormData(p),Lh(s,{pending:!0,data:H,method:p.method,action:y},y,H))},currentTarget:p}]})}}for(var vm=0;vm<th.length;vm++){var ym=th[vm],L_=ym.toLowerCase(),P_=ym[0].toUpperCase()+ym.slice(1);Kn(L_,"on"+P_)}Kn(ey,"onAnimationEnd"),Kn(ty,"onAnimationIteration"),Kn(ny,"onAnimationStart"),Kn("dblclick","onDoubleClick"),Kn("focusin","onFocus"),Kn("focusout","onBlur"),Kn(e_,"onTransitionRun"),Kn(t_,"onTransitionStart"),Kn(n_,"onTransitionCancel"),Kn(ry,"onTransitionEnd"),xa("onMouseEnter",["mouseout","mouseover"]),xa("onMouseLeave",["mouseout","mouseover"]),xa("onPointerEnter",["pointerout","pointerover"]),xa("onPointerLeave",["pointerout","pointerover"]),Or("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Or("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Or("onBeforeInput",["compositionend","keypress","textInput","paste"]),Or("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Or("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Or("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ol="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(" "),U_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ol));function S0(n,a){a=(a&4)!==0;for(var s=0;s<n.length;s++){var c=n[s],p=c.event;c=c.listeners;e:{var y=void 0;if(a)for(var j=c.length-1;0<=j;j--){var D=c[j],H=D.instance,J=D.currentTarget;if(D=D.listener,H!==y&&p.isPropagationStopped())break e;y=D,p.currentTarget=J;try{y(p)}catch(le){su(le)}p.currentTarget=null,y=H}else for(j=0;j<c.length;j++){if(D=c[j],H=D.instance,J=D.currentTarget,D=D.listener,H!==y&&p.isPropagationStopped())break e;y=D,p.currentTarget=J;try{y(p)}catch(le){su(le)}p.currentTarget=null,y=H}}}}function Ve(n,a){var s=a[wi];s===void 0&&(s=a[wi]=new Set);var c=n+"__bubble";s.has(c)||(E0(a,n,2,!1),s.add(c))}function xm(n,a,s){var c=0;a&&(c|=4),E0(s,n,c,a)}var bu="_reactListening"+Math.random().toString(36).slice(2);function bm(n){if(!n[bu]){n[bu]=!0,Sc.forEach(function(s){s!=="selectionchange"&&(U_.has(s)||xm(s,!1,n),xm(s,!0,n))});var a=n.nodeType===9?n:n.ownerDocument;a===null||a[bu]||(a[bu]=!0,xm("selectionchange",!1,a))}}function E0(n,a,s,c){switch(F0(a)){case 2:var p=dA;break;case 8:p=fA;break;default:p=km}s=p.bind(null,a,s,n),p=void 0,!If||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(p=!0),c?p!==void 0?n.addEventListener(a,s,{capture:!0,passive:p}):n.addEventListener(a,s,!0):p!==void 0?n.addEventListener(a,s,{passive:p}):n.addEventListener(a,s,!1)}function wm(n,a,s,c,p){var y=c;if((a&1)===0&&(a&2)===0&&c!==null)e:for(;;){if(c===null)return;var j=c.tag;if(j===3||j===4){var D=c.stateNode.containerInfo;if(D===p)break;if(j===4)for(j=c.return;j!==null;){var H=j.tag;if((H===3||H===4)&&j.stateNode.containerInfo===p)return;j=j.return}for(;D!==null;){if(j=Dr(D),j===null)return;if(H=j.tag,H===5||H===6||H===26||H===27){c=y=j;continue e}D=D.parentNode}}c=c.return}Rv(function(){var J=y,le=Hf(s),ue=[];e:{var ee=ay.get(n);if(ee!==void 0){var ne=kc,Re=n;switch(n){case"keypress":if(Dc(s)===0)break e;case"keydown":case"keyup":ne=Dj;break;case"focusin":Re="focus",ne=Gf;break;case"focusout":Re="blur",ne=Gf;break;case"beforeblur":case"afterblur":ne=Gf;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=Ov;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=bj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=zj;break;case ey:case ty:case ny:ne=Ej;break;case ry:ne=Pj;break;case"scroll":case"scrollend":ne=yj;break;case"wheel":ne=Bj;break;case"copy":case"cut":case"paste":ne=Cj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=zv;break;case"toggle":case"beforetoggle":ne=$j}var je=(a&4)!==0,st=!je&&(n==="scroll"||n==="scrollend"),X=je?ee!==null?ee+"Capture":null:ee;je=[];for(var G=J,Z;G!==null;){var ce=G;if(Z=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||Z===null||X===null||(ce=Ni(G,X),ce!=null&&je.push(sl(G,ce,Z))),st)break;G=G.return}0<je.length&&(ee=new ne(ee,Re,null,s,le),ue.push({event:ee,listeners:je}))}}if((a&7)===0){e:{if(ee=n==="mouseover"||n==="pointerover",ne=n==="mouseout"||n==="pointerout",ee&&s!==Bf&&(Re=s.relatedTarget||s.fromElement)&&(Dr(Re)||Re[ga]))break e;if((ne||ee)&&(ee=le.window===le?le:(ee=le.ownerDocument)?ee.defaultView||ee.parentWindow:window,ne?(Re=s.relatedTarget||s.toElement,ne=J,Re=Re?Dr(Re):null,Re!==null&&(st=l(Re),je=Re.tag,Re!==st||je!==5&&je!==27&&je!==6)&&(Re=null)):(ne=null,Re=J),ne!==Re)){if(je=Ov,ce="onMouseLeave",X="onMouseEnter",G="mouse",(n==="pointerout"||n==="pointerover")&&(je=zv,ce="onPointerLeave",X="onPointerEnter",G="pointer"),st=ne==null?ee:fo(ne),Z=Re==null?ee:fo(Re),ee=new je(ce,G+"leave",ne,s,le),ee.target=st,ee.relatedTarget=Z,ce=null,Dr(le)===J&&(je=new je(X,G+"enter",Re,s,le),je.target=Z,je.relatedTarget=st,ce=je),st=ce,ne&&Re)t:{for(je=ne,X=Re,G=0,Z=je;Z;Z=Ls(Z))G++;for(Z=0,ce=X;ce;ce=Ls(ce))Z++;for(;0<G-Z;)je=Ls(je),G--;for(;0<Z-G;)X=Ls(X),Z--;for(;G--;){if(je===X||X!==null&&je===X.alternate)break t;je=Ls(je),X=Ls(X)}je=null}else je=null;ne!==null&&N0(ue,ee,ne,je,!1),Re!==null&&st!==null&&N0(ue,st,Re,je,!0)}}e:{if(ee=J?fo(J):window,ne=ee.nodeName&&ee.nodeName.toLowerCase(),ne==="select"||ne==="input"&&ee.type==="file")var ye=Vv;else if($v(ee))if(qv)ye=Zj;else{ye=Wj;var He=Xj}else ne=ee.nodeName,!ne||ne.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?J&&Uf(J.elementType)&&(ye=Vv):ye=Kj;if(ye&&(ye=ye(n,J))){Iv(ue,ye,s,le);break e}He&&He(n,ee,J),n==="focusout"&&J&&ee.type==="number"&&J.memoizedProps.value!=null&&Pf(ee,"number",ee.value)}switch(He=J?fo(J):window,n){case"focusin":($v(He)||He.contentEditable==="true")&&(fs=He,Qf=J,Di=null);break;case"focusout":Di=Qf=fs=null;break;case"mousedown":Jf=!0;break;case"contextmenu":case"mouseup":case"dragend":Jf=!1,Qv(ue,s,le);break;case"selectionchange":if(Jj)break;case"keydown":case"keyup":Qv(ue,s,le)}var Ee;if(Xf)e:{switch(n){case"compositionstart":var _e="onCompositionStart";break e;case"compositionend":_e="onCompositionEnd";break e;case"compositionupdate":_e="onCompositionUpdate";break e}_e=void 0}else ds?Bv(n,s)&&(_e="onCompositionEnd"):n==="keydown"&&s.keyCode===229&&(_e="onCompositionStart");_e&&(Lv&&s.locale!=="ko"&&(ds||_e!=="onCompositionStart"?_e==="onCompositionEnd"&&ds&&(Ee=Mv()):(wa=le,Vf="value"in wa?wa.value:wa.textContent,ds=!0)),He=wu(J,_e),0<He.length&&(_e=new kv(_e,n,null,s,le),ue.push({event:_e,listeners:He}),Ee?_e.data=Ee:(Ee=Hv(s),Ee!==null&&(_e.data=Ee)))),(Ee=Vj?qj(n,s):Yj(n,s))&&(_e=wu(J,"onBeforeInput"),0<_e.length&&(He=new kv("onBeforeInput","beforeinput",null,s,le),ue.push({event:He,listeners:_e}),He.data=Ee)),z_(ue,n,J,s,le)}S0(ue,a)})}function sl(n,a,s){return{instance:n,listener:a,currentTarget:s}}function wu(n,a){for(var s=a+"Capture",c=[];n!==null;){var p=n,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=Ni(n,s),p!=null&&c.unshift(sl(n,p,y)),p=Ni(n,a),p!=null&&c.push(sl(n,p,y))),n.tag===3)return c;n=n.return}return[]}function Ls(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function N0(n,a,s,c,p){for(var y=a._reactName,j=[];s!==null&&s!==c;){var D=s,H=D.alternate,J=D.stateNode;if(D=D.tag,H!==null&&H===c)break;D!==5&&D!==26&&D!==27||J===null||(H=J,p?(J=Ni(s,y),J!=null&&j.unshift(sl(s,J,H))):p||(J=Ni(s,y),J!=null&&j.push(sl(s,J,H)))),s=s.return}j.length!==0&&n.push({event:a,listeners:j})}var B_=/\r\n?/g,H_=/\u0000|\uFFFD/g;function C0(n){return(typeof n=="string"?n:""+n).replace(B_,`
`).replace(H_,"")}function j0(n,a){return a=C0(a),C0(n)===a}function Su(){}function ot(n,a,s,c,p,y){switch(s){case"children":typeof c=="string"?a==="body"||a==="textarea"&&c===""||ls(n,c):(typeof c=="number"||typeof c=="bigint")&&a!=="body"&&ls(n,""+c);break;case"className":os(n,"class",c);break;case"tabIndex":os(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":os(n,s,c);break;case"style":Av(n,c,y);break;case"data":if(a!=="object"){os(n,"data",c);break}case"src":case"href":if(c===""&&(a!=="a"||s!=="href")){n.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(s);break}c=Rc(""+c),n.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){n.setAttribute(s,"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 y=="function"&&(s==="formAction"?(a!=="input"&&ot(n,a,"name",p.name,p,null),ot(n,a,"formEncType",p.formEncType,p,null),ot(n,a,"formMethod",p.formMethod,p,null),ot(n,a,"formTarget",p.formTarget,p,null)):(ot(n,a,"encType",p.encType,p,null),ot(n,a,"method",p.method,p,null),ot(n,a,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(s);break}c=Rc(""+c),n.setAttribute(s,c);break;case"onClick":c!=null&&(n.onclick=Su);break;case"onScroll":c!=null&&Ve("scroll",n);break;case"onScrollEnd":c!=null&&Ve("scrollend",n);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(o(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(o(60));n.innerHTML=s}}break;case"multiple":n.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":n.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){n.removeAttribute("xlink:href");break}s=Rc(""+c),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(s,""+c):n.removeAttribute(s);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":c&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(s,""):n.removeAttribute(s);break;case"capture":case"download":c===!0?n.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(s,c):n.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?n.setAttribute(s,c):n.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(s):n.setAttribute(s,c);break;case"popover":Ve("beforetoggle",n),Ve("toggle",n),as(n,"popover",c);break;case"xlinkActuate":Wn(n,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Wn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Wn(n,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Wn(n,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Wn(n,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Wn(n,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Wn(n,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Wn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Wn(n,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":as(n,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=gj.get(s)||s,as(n,s,c))}}function Sm(n,a,s,c,p,y){switch(s){case"style":Av(n,c,y);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(o(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(o(60));n.innerHTML=s}}break;case"children":typeof c=="string"?ls(n,c):(typeof c=="number"||typeof c=="bigint")&&ls(n,""+c);break;case"onScroll":c!=null&&Ve("scroll",n);break;case"onScrollEnd":c!=null&&Ve("scrollend",n);break;case"onClick":c!=null&&(n.onclick=Su);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ec.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),a=s.slice(2,p?s.length-7:void 0),y=n[Wt]||null,y=y!=null?y[s]:null,typeof y=="function"&&n.removeEventListener(a,y,p),typeof c=="function")){typeof y!="function"&&y!==null&&(s in n?n[s]=null:n.hasAttribute(s)&&n.removeAttribute(s)),n.addEventListener(a,c,p);break e}s in n?n[s]=c:c===!0?n.setAttribute(s,""):as(n,s,c)}}}function Gt(n,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",n),Ve("load",n);var c=!1,p=!1,y;for(y in s)if(s.hasOwnProperty(y)){var j=s[y];if(j!=null)switch(y){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:ot(n,a,y,j,s,null)}}p&&ot(n,a,"srcSet",s.srcSet,s,null),c&&ot(n,a,"src",s.src,s,null);return;case"input":Ve("invalid",n);var D=y=j=p=null,H=null,J=null;for(c in s)if(s.hasOwnProperty(c)){var le=s[c];if(le!=null)switch(c){case"name":p=le;break;case"type":j=le;break;case"checked":H=le;break;case"defaultChecked":J=le;break;case"value":y=le;break;case"defaultValue":D=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(o(137,a));break;default:ot(n,a,c,le,s,null)}}Nv(n,y,D,H,J,j,p,!1),Ac(n);return;case"select":Ve("invalid",n),c=j=y=null;for(p in s)if(s.hasOwnProperty(p)&&(D=s[p],D!=null))switch(p){case"value":y=D;break;case"defaultValue":j=D;break;case"multiple":c=D;default:ot(n,a,p,D,s,null)}a=y,s=j,n.multiple=!!c,a!=null?is(n,!!c,a,!1):s!=null&&is(n,!!c,s,!0);return;case"textarea":Ve("invalid",n),y=p=c=null;for(j in s)if(s.hasOwnProperty(j)&&(D=s[j],D!=null))switch(j){case"value":c=D;break;case"defaultValue":p=D;break;case"children":y=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(o(91));break;default:ot(n,a,j,D,s,null)}jv(n,c,p,y),Ac(n);return;case"option":for(H in s)if(s.hasOwnProperty(H)&&(c=s[H],c!=null))switch(H){case"selected":n.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:ot(n,a,H,c,s,null)}return;case"dialog":Ve("beforetoggle",n),Ve("toggle",n),Ve("cancel",n),Ve("close",n);break;case"iframe":case"object":Ve("load",n);break;case"video":case"audio":for(c=0;c<ol.length;c++)Ve(ol[c],n);break;case"image":Ve("error",n),Ve("load",n);break;case"details":Ve("toggle",n);break;case"embed":case"source":case"link":Ve("error",n),Ve("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in s)if(s.hasOwnProperty(J)&&(c=s[J],c!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:ot(n,a,J,c,s,null)}return;default:if(Uf(a)){for(le in s)s.hasOwnProperty(le)&&(c=s[le],c!==void 0&&Sm(n,a,le,c,s,void 0));return}}for(D in s)s.hasOwnProperty(D)&&(c=s[D],c!=null&&ot(n,a,D,c,s,null))}function $_(n,a,s,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,j=null,D=null,H=null,J=null,le=null;for(ne in s){var ue=s[ne];if(s.hasOwnProperty(ne)&&ue!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":H=ue;default:c.hasOwnProperty(ne)||ot(n,a,ne,null,c,ue)}}for(var ee in c){var ne=c[ee];if(ue=s[ee],c.hasOwnProperty(ee)&&(ne!=null||ue!=null))switch(ee){case"type":y=ne;break;case"name":p=ne;break;case"checked":J=ne;break;case"defaultChecked":le=ne;break;case"value":j=ne;break;case"defaultValue":D=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(o(137,a));break;default:ne!==ue&&ot(n,a,ee,ne,c,ue)}}Lf(n,j,D,H,J,le,y,p);return;case"select":ne=j=D=ee=null;for(y in s)if(H=s[y],s.hasOwnProperty(y)&&H!=null)switch(y){case"value":break;case"multiple":ne=H;default:c.hasOwnProperty(y)||ot(n,a,y,null,c,H)}for(p in c)if(y=c[p],H=s[p],c.hasOwnProperty(p)&&(y!=null||H!=null))switch(p){case"value":ee=y;break;case"defaultValue":D=y;break;case"multiple":j=y;default:y!==H&&ot(n,a,p,y,c,H)}a=D,s=j,c=ne,ee!=null?is(n,!!s,ee,!1):!!c!=!!s&&(a!=null?is(n,!!s,a,!0):is(n,!!s,s?[]:"",!1));return;case"textarea":ne=ee=null;for(D in s)if(p=s[D],s.hasOwnProperty(D)&&p!=null&&!c.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:ot(n,a,D,null,c,p)}for(j in c)if(p=c[j],y=s[j],c.hasOwnProperty(j)&&(p!=null||y!=null))switch(j){case"value":ee=p;break;case"defaultValue":ne=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(o(91));break;default:p!==y&&ot(n,a,j,p,c,y)}Cv(n,ee,ne);return;case"option":for(var Re in s)if(ee=s[Re],s.hasOwnProperty(Re)&&ee!=null&&!c.hasOwnProperty(Re))switch(Re){case"selected":n.selected=!1;break;default:ot(n,a,Re,null,c,ee)}for(H in c)if(ee=c[H],ne=s[H],c.hasOwnProperty(H)&&ee!==ne&&(ee!=null||ne!=null))switch(H){case"selected":n.selected=ee&&typeof ee!="function"&&typeof ee!="symbol";break;default:ot(n,a,H,ee,c,ne)}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 je in s)ee=s[je],s.hasOwnProperty(je)&&ee!=null&&!c.hasOwnProperty(je)&&ot(n,a,je,null,c,ee);for(J in c)if(ee=c[J],ne=s[J],c.hasOwnProperty(J)&&ee!==ne&&(ee!=null||ne!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(o(137,a));break;default:ot(n,a,J,ee,c,ne)}return;default:if(Uf(a)){for(var st in s)ee=s[st],s.hasOwnProperty(st)&&ee!==void 0&&!c.hasOwnProperty(st)&&Sm(n,a,st,void 0,c,ee);for(le in c)ee=c[le],ne=s[le],!c.hasOwnProperty(le)||ee===ne||ee===void 0&&ne===void 0||Sm(n,a,le,ee,c,ne);return}}for(var X in s)ee=s[X],s.hasOwnProperty(X)&&ee!=null&&!c.hasOwnProperty(X)&&ot(n,a,X,null,c,ee);for(ue in c)ee=c[ue],ne=s[ue],!c.hasOwnProperty(ue)||ee===ne||ee==null&&ne==null||ot(n,a,ue,ee,c,ne)}var Em=null,Nm=null;function Eu(n){return n.nodeType===9?n:n.ownerDocument}function _0(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function A0(n,a){if(n===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&a==="foreignObject"?0:n}function Cm(n,a){return n==="textarea"||n==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var jm=null;function I_(){var n=window.event;return n&&n.type==="popstate"?n===jm?!1:(jm=n,!0):(jm=null,!1)}var T0=typeof setTimeout=="function"?setTimeout:void 0,V_=typeof clearTimeout=="function"?clearTimeout:void 0,R0=typeof Promise=="function"?Promise:void 0,q_=typeof queueMicrotask=="function"?queueMicrotask:typeof R0<"u"?function(n){return R0.resolve(null).then(n).catch(Y_)}:T0;function Y_(n){setTimeout(function(){throw n})}function Pa(n){return n==="head"}function M0(n,a){var s=a,c=0,p=0;do{var y=s.nextSibling;if(n.removeChild(s),y&&y.nodeType===8)if(s=y.data,s==="/$"){if(0<c&&8>c){s=c;var j=n.ownerDocument;if(s&1&&il(j.documentElement),s&2&&il(j.body),s&4)for(s=j.head,il(s),j=s.firstChild;j;){var D=j.nextSibling,H=j.nodeName;j[uo]||H==="SCRIPT"||H==="STYLE"||H==="LINK"&&j.rel.toLowerCase()==="stylesheet"||s.removeChild(j),j=D}}if(p===0){n.removeChild(y),pl(a);return}p--}else s==="$"||s==="$?"||s==="$!"?p++:c=s.charCodeAt(0)-48;else c=0;s=y}while(s);pl(a)}function _m(n){var a=n.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var s=a;switch(a=a.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":_m(s),Si(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}n.removeChild(s)}}function G_(n,a,s,c){for(;n.nodeType===1;){var p=s;if(n.nodeName.toLowerCase()!==a.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[uo])switch(a){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(y=n.getAttribute("rel"),y==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(y!==p.rel||n.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||n.getAttribute("title")!==(p.title==null?null:p.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(y=n.getAttribute("src"),(y!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(a==="input"&&n.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===y)return n}else return n;if(n=Qn(n.nextSibling),n===null)break}return null}function F_(n,a,s){if(a==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=Qn(n.nextSibling),n===null))return null;return n}function Am(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState==="complete"}function X_(n,a){var s=n.ownerDocument;if(n.data!=="$?"||s.readyState==="complete")a();else{var c=function(){a(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),n._reactRetry=c}}function Qn(n){for(;n!=null;n=n.nextSibling){var a=n.nodeType;if(a===1||a===3)break;if(a===8){if(a=n.data,a==="$"||a==="$!"||a==="$?"||a==="F!"||a==="F")break;if(a==="/$")return null}}return n}var Tm=null;function D0(n){n=n.previousSibling;for(var a=0;n;){if(n.nodeType===8){var s=n.data;if(s==="$"||s==="$!"||s==="$?"){if(a===0)return n;a--}else s==="/$"&&a++}n=n.previousSibling}return null}function O0(n,a,s){switch(a=Eu(s),n){case"html":if(n=a.documentElement,!n)throw Error(o(452));return n;case"head":if(n=a.head,!n)throw Error(o(453));return n;case"body":if(n=a.body,!n)throw Error(o(454));return n;default:throw Error(o(451))}}function il(n){for(var a=n.attributes;a.length;)n.removeAttributeNode(a[0]);Si(n)}var $n=new Map,k0=new Set;function Nu(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Fr=$.d;$.d={f:W_,r:K_,D:Z_,C:Q_,L:J_,m:eA,X:nA,S:tA,M:rA};function W_(){var n=Fr.f(),a=pu();return n||a}function K_(n){var a=va(n);a!==null&&a.tag===5&&a.type==="form"?ex(a):Fr.r(n)}var Ps=typeof document>"u"?null:document;function z0(n,a,s){var c=Ps;if(c&&typeof a=="string"&&a){var p=kn(a);p='link[rel="'+n+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),k0.has(p)||(k0.add(p),n={rel:n,crossOrigin:s,href:a},c.querySelector(p)===null&&(a=c.createElement("link"),Gt(a,"link",n),jt(a),c.head.appendChild(a)))}}function Z_(n){Fr.D(n),z0("dns-prefetch",n,null)}function Q_(n,a){Fr.C(n,a),z0("preconnect",n,a)}function J_(n,a,s){Fr.L(n,a,s);var c=Ps;if(c&&n&&a){var p='link[rel="preload"][as="'+kn(a)+'"]';a==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+kn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+kn(s.imageSizes)+'"]')):p+='[href="'+kn(n)+'"]';var y=p;switch(a){case"style":y=Us(n);break;case"script":y=Bs(n)}$n.has(y)||(n=g({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:n,as:a},s),$n.set(y,n),c.querySelector(p)!==null||a==="style"&&c.querySelector(ll(y))||a==="script"&&c.querySelector(cl(y))||(a=c.createElement("link"),Gt(a,"link",n),jt(a),c.head.appendChild(a)))}}function eA(n,a){Fr.m(n,a);var s=Ps;if(s&&n){var c=a&&typeof a.as=="string"?a.as:"script",p='link[rel="modulepreload"][as="'+kn(c)+'"][href="'+kn(n)+'"]',y=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Bs(n)}if(!$n.has(y)&&(n=g({rel:"modulepreload",href:n},a),$n.set(y,n),s.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(cl(y)))return}c=s.createElement("link"),Gt(c,"link",n),jt(c),s.head.appendChild(c)}}}function tA(n,a,s){Fr.S(n,a,s);var c=Ps;if(c&&n){var p=ya(c).hoistableStyles,y=Us(n);a=a||"default";var j=p.get(y);if(!j){var D={loading:0,preload:null};if(j=c.querySelector(ll(y)))D.loading=5;else{n=g({rel:"stylesheet",href:n,"data-precedence":a},s),(s=$n.get(y))&&Rm(n,s);var H=j=c.createElement("link");jt(H),Gt(H,"link",n),H._p=new Promise(function(J,le){H.onload=J,H.onerror=le}),H.addEventListener("load",function(){D.loading|=1}),H.addEventListener("error",function(){D.loading|=2}),D.loading|=4,Cu(j,a,c)}j={type:"stylesheet",instance:j,count:1,state:D},p.set(y,j)}}}function nA(n,a){Fr.X(n,a);var s=Ps;if(s&&n){var c=ya(s).hoistableScripts,p=Bs(n),y=c.get(p);y||(y=s.querySelector(cl(p)),y||(n=g({src:n,async:!0},a),(a=$n.get(p))&&Mm(n,a),y=s.createElement("script"),jt(y),Gt(y,"link",n),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function rA(n,a){Fr.M(n,a);var s=Ps;if(s&&n){var c=ya(s).hoistableScripts,p=Bs(n),y=c.get(p);y||(y=s.querySelector(cl(p)),y||(n=g({src:n,async:!0,type:"module"},a),(a=$n.get(p))&&Mm(n,a),y=s.createElement("script"),jt(y),Gt(y,"link",n),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function L0(n,a,s,c){var p=(p=se.current)?Nu(p):null;if(!p)throw Error(o(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=Us(s.href),s=ya(p).hoistableStyles,c=s.get(a),c||(c={type:"style",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){n=Us(s.href);var y=ya(p).hoistableStyles,j=y.get(n);if(j||(p=p.ownerDocument||p,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(n,j),(y=p.querySelector(ll(n)))&&!y._p&&(j.instance=y,j.state.loading=5),$n.has(n)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},$n.set(n,s),y||aA(p,n,s,j.state))),a&&c===null)throw Error(o(528,""));return j}if(a&&c!==null)throw Error(o(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Bs(s),s=ya(p).hoistableScripts,c=s.get(a),c||(c={type:"script",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,n))}}function Us(n){return'href="'+kn(n)+'"'}function ll(n){return'link[rel="stylesheet"]['+n+"]"}function P0(n){return g({},n,{"data-precedence":n.precedence,precedence:null})}function aA(n,a,s,c){n.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=n.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),Gt(a,"link",s),jt(a),n.head.appendChild(a))}function Bs(n){return'[src="'+kn(n)+'"]'}function cl(n){return"script[async]"+n}function U0(n,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var c=n.querySelector('style[data-href~="'+kn(s.href)+'"]');if(c)return a.instance=c,jt(c),c;var p=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),jt(c),Gt(c,"style",p),Cu(c,s.precedence,n),a.instance=c;case"stylesheet":p=Us(s.href);var y=n.querySelector(ll(p));if(y)return a.state.loading|=4,a.instance=y,jt(y),y;c=P0(s),(p=$n.get(p))&&Rm(c,p),y=(n.ownerDocument||n).createElement("link"),jt(y);var j=y;return j._p=new Promise(function(D,H){j.onload=D,j.onerror=H}),Gt(y,"link",c),a.state.loading|=4,Cu(y,s.precedence,n),a.instance=y;case"script":return y=Bs(s.src),(p=n.querySelector(cl(y)))?(a.instance=p,jt(p),p):(c=s,(p=$n.get(y))&&(c=g({},s),Mm(c,p)),n=n.ownerDocument||n,p=n.createElement("script"),jt(p),Gt(p,"link",c),n.head.appendChild(p),a.instance=p);case"void":return null;default:throw Error(o(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(c=a.instance,a.state.loading|=4,Cu(c,s.precedence,n));return a.instance}function Cu(n,a,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,y=p,j=0;j<c.length;j++){var D=c[j];if(D.dataset.precedence===a)y=D;else if(y!==p)break}y?y.parentNode.insertBefore(n,y.nextSibling):(a=s.nodeType===9?s.head:s,a.insertBefore(n,a.firstChild))}function Rm(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.title==null&&(n.title=a.title)}function Mm(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.integrity==null&&(n.integrity=a.integrity)}var ju=null;function B0(n,a,s){if(ju===null){var c=new Map,p=ju=new Map;p.set(s,c)}else p=ju,c=p.get(s),c||(c=new Map,p.set(s,c));if(c.has(n))return c;for(c.set(n,null),s=s.getElementsByTagName(n),p=0;p<s.length;p++){var y=s[p];if(!(y[uo]||y[Lt]||n==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var j=y.getAttribute(a)||"";j=n+j;var D=c.get(j);D?D.push(y):c.set(j,[y])}}return c}function H0(n,a,s){n=n.ownerDocument||n,n.head.insertBefore(s,a==="title"?n.querySelector("head > title"):null)}function oA(n,a,s){if(s===1||a.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return n=a.disabled,typeof a.precedence=="string"&&n==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function $0(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}var ul=null;function sA(){}function iA(n,a,s){if(ul===null)throw Error(o(475));var c=ul;if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var p=Us(s.href),y=n.querySelector(ll(p));if(y){n=y._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(c.count++,c=_u.bind(c),n.then(c,c)),a.state.loading|=4,a.instance=y,jt(y);return}y=n.ownerDocument||n,s=P0(s),(p=$n.get(p))&&Rm(s,p),y=y.createElement("link"),jt(y);var j=y;j._p=new Promise(function(D,H){j.onload=D,j.onerror=H}),Gt(y,"link",s),a.instance=y}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(c.count++,a=_u.bind(c),n.addEventListener("load",a),n.addEventListener("error",a))}}function lA(){if(ul===null)throw Error(o(475));var n=ul;return n.stylesheets&&n.count===0&&Dm(n,n.stylesheets),0<n.count?function(a){var s=setTimeout(function(){if(n.stylesheets&&Dm(n,n.stylesheets),n.unsuspend){var c=n.unsuspend;n.unsuspend=null,c()}},6e4);return n.unsuspend=a,function(){n.unsuspend=null,clearTimeout(s)}}:null}function _u(){if(this.count--,this.count===0){if(this.stylesheets)Dm(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Au=null;function Dm(n,a){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Au=new Map,a.forEach(cA,n),Au=null,_u.call(n))}function cA(n,a){if(!(a.state.loading&4)){var s=Au.get(n);if(s)var c=s.get(null);else{s=new Map,Au.set(n,s);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var j=p[y];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(s.set(j.dataset.precedence,j),c=j)}c&&s.set(null,c)}p=a.instance,j=p.getAttribute("data-precedence"),y=s.get(j)||c,y===c&&s.set(null,p),s.set(j,p),this.count++,c=_u.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),y?y.parentNode.insertBefore(p,y.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),a.state.loading|=4}}var dl={$$typeof:A,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function uA(n,a,s,c,p,y,j,D){this.tag=1,this.containerInfo=n,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=co(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=co(0),this.hiddenUpdates=co(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function I0(n,a,s,c,p,y,j,D,H,J,le,ue){return n=new uA(n,a,s,j,D,H,J,ue),a=1,y===!0&&(a|=24),y=wn(3,null,null,a),n.current=y,y.stateNode=n,a=hh(),a.refCount++,n.pooledCache=a,a.refCount++,y.memoizedState={element:c,isDehydrated:s,cache:a},vh(y),n}function V0(n){return n?(n=gs,n):gs}function q0(n,a,s,c,p,y){p=V0(p),c.context===null?c.context=p:c.pendingContext=p,c=Na(a),c.payload={element:s},y=y===void 0?null:y,y!==null&&(c.callback=y),s=Ca(n,c,a),s!==null&&(jn(s,n,a),$i(s,n,a))}function Y0(n,a){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var s=n.retryLane;n.retryLane=s!==0&&s<a?s:a}}function Om(n,a){Y0(n,a),(n=n.alternate)&&Y0(n,a)}function G0(n){if(n.tag===13){var a=ps(n,67108864);a!==null&&jn(a,n,67108864),Om(n,67108864)}}var Tu=!0;function dA(n,a,s,c){var p=M.T;M.T=null;var y=$.p;try{$.p=2,km(n,a,s,c)}finally{$.p=y,M.T=p}}function fA(n,a,s,c){var p=M.T;M.T=null;var y=$.p;try{$.p=8,km(n,a,s,c)}finally{$.p=y,M.T=p}}function km(n,a,s,c){if(Tu){var p=zm(c);if(p===null)wm(n,a,c,Ru,s),X0(n,c);else if(mA(p,n,a,s,c))c.stopPropagation();else if(X0(n,c),a&4&&-1<hA.indexOf(n)){for(;p!==null;){var y=va(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var j=tn(y.pendingLanes);if(j!==0){var D=y;for(D.pendingLanes|=2,D.entangledLanes|=2;j;){var H=1<<31-Ct(j);D.entanglements[1]|=H,j&=~H}wr(y),(tt&6)===0&&(hu=he()+500,al(0))}}break;case 13:D=ps(y,2),D!==null&&jn(D,y,2),pu(),Om(y,2)}if(y=zm(c),y===null&&wm(n,a,c,Ru,s),y===p)break;p=y}p!==null&&c.stopPropagation()}else wm(n,a,c,null,s)}}function zm(n){return n=Hf(n),Lm(n)}var Ru=null;function Lm(n){if(Ru=null,n=Dr(n),n!==null){var a=l(n);if(a===null)n=null;else{var s=a.tag;if(s===13){if(n=u(a),n!==null)return n;n=null}else if(s===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;n=null}else a!==n&&(n=null)}}return Ru=n,null}function F0(n){switch(n){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(fe()){case Te:return 2;case qe:return 8;case Be:case on:return 32;case Rr:return 268435456;default:return 32}default:return 32}}var Pm=!1,Ua=null,Ba=null,Ha=null,fl=new Map,hl=new Map,$a=[],hA="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 X0(n,a){switch(n){case"focusin":case"focusout":Ua=null;break;case"dragenter":case"dragleave":Ba=null;break;case"mouseover":case"mouseout":Ha=null;break;case"pointerover":case"pointerout":fl.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":hl.delete(a.pointerId)}}function ml(n,a,s,c,p,y){return n===null||n.nativeEvent!==y?(n={blockedOn:a,domEventName:s,eventSystemFlags:c,nativeEvent:y,targetContainers:[p]},a!==null&&(a=va(a),a!==null&&G0(a)),n):(n.eventSystemFlags|=c,a=n.targetContainers,p!==null&&a.indexOf(p)===-1&&a.push(p),n)}function mA(n,a,s,c,p){switch(a){case"focusin":return Ua=ml(Ua,n,a,s,c,p),!0;case"dragenter":return Ba=ml(Ba,n,a,s,c,p),!0;case"mouseover":return Ha=ml(Ha,n,a,s,c,p),!0;case"pointerover":var y=p.pointerId;return fl.set(y,ml(fl.get(y)||null,n,a,s,c,p)),!0;case"gotpointercapture":return y=p.pointerId,hl.set(y,ml(hl.get(y)||null,n,a,s,c,p)),!0}return!1}function W0(n){var a=Dr(n.target);if(a!==null){var s=l(a);if(s!==null){if(a=s.tag,a===13){if(a=u(s),a!==null){n.blockedOn=a,Df(n.priority,function(){if(s.tag===13){var c=Cn();c=xi(c);var p=ps(s,c);p!==null&&jn(p,s,c),Om(s,c)}});return}}else if(a===3&&s.stateNode.current.memoizedState.isDehydrated){n.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Mu(n){if(n.blockedOn!==null)return!1;for(var a=n.targetContainers;0<a.length;){var s=zm(n.nativeEvent);if(s===null){s=n.nativeEvent;var c=new s.constructor(s.type,s);Bf=c,s.target.dispatchEvent(c),Bf=null}else return a=va(s),a!==null&&G0(a),n.blockedOn=s,!1;a.shift()}return!0}function K0(n,a,s){Mu(n)&&s.delete(a)}function pA(){Pm=!1,Ua!==null&&Mu(Ua)&&(Ua=null),Ba!==null&&Mu(Ba)&&(Ba=null),Ha!==null&&Mu(Ha)&&(Ha=null),fl.forEach(K0),hl.forEach(K0)}function Du(n,a){n.blockedOn===a&&(n.blockedOn=null,Pm||(Pm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,pA)))}var Ou=null;function Z0(n){Ou!==n&&(Ou=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ou===n&&(Ou=null);for(var a=0;a<n.length;a+=3){var s=n[a],c=n[a+1],p=n[a+2];if(typeof c!="function"){if(Lm(c||s)===null)continue;break}var y=va(s);y!==null&&(n.splice(a,3),a-=3,Lh(y,{pending:!0,data:p,method:s.method,action:c},c,p))}}))}function pl(n){function a(H){return Du(H,n)}Ua!==null&&Du(Ua,n),Ba!==null&&Du(Ba,n),Ha!==null&&Du(Ha,n),fl.forEach(a),hl.forEach(a);for(var s=0;s<$a.length;s++){var c=$a[s];c.blockedOn===n&&(c.blockedOn=null)}for(;0<$a.length&&(s=$a[0],s.blockedOn===null);)W0(s),s.blockedOn===null&&$a.shift();if(s=(n.ownerDocument||n).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var p=s[c],y=s[c+1],j=p[Wt]||null;if(typeof y=="function")j||Z0(s);else if(j){var D=null;if(y&&y.hasAttribute("formAction")){if(p=y,j=y[Wt]||null)D=j.formAction;else if(Lm(p)!==null)continue}else D=j.action;typeof D=="function"?s[c+1]=D:(s.splice(c,3),c-=3),Z0(s)}}}function Um(n){this._internalRoot=n}ku.prototype.render=Um.prototype.render=function(n){var a=this._internalRoot;if(a===null)throw Error(o(409));var s=a.current,c=Cn();q0(s,c,n,a,null,null)},ku.prototype.unmount=Um.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var a=n.containerInfo;q0(n.current,2,null,n,null,null),pu(),a[ga]=null}};function ku(n){this._internalRoot=n}ku.prototype.unstable_scheduleHydration=function(n){if(n){var a=bc();n={blockedOn:null,target:n,priority:a};for(var s=0;s<$a.length&&a!==0&&a<$a[s].priority;s++);$a.splice(s,0,n),s===0&&W0(n)}};var Q0=t.version;if(Q0!=="19.1.0")throw Error(o(527,Q0,"19.1.0"));$.findDOMNode=function(n){var a=n._reactInternals;if(a===void 0)throw typeof n.render=="function"?Error(o(188)):(n=Object.keys(n).join(","),Error(o(268,n)));return n=m(a),n=n!==null?h(n):null,n=n===null?null:n.stateNode,n};var gA={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zu.isDisabled&&zu.supportsFiber)try{yn=zu.inject(gA),bt=zu}catch{}}return vl.createRoot=function(n,a){if(!i(n))throw Error(o(299));var s=!1,c="",p=mx,y=px,j=gx,D=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(p=a.onUncaughtError),a.onCaughtError!==void 0&&(y=a.onCaughtError),a.onRecoverableError!==void 0&&(j=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(D=a.unstable_transitionCallbacks)),a=I0(n,1,!1,null,null,s,c,p,y,j,D,null),n[ga]=a.current,bm(n),new Um(a)},vl.hydrateRoot=function(n,a,s){if(!i(n))throw Error(o(299));var c=!1,p="",y=mx,j=px,D=gx,H=null,J=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(y=s.onUncaughtError),s.onCaughtError!==void 0&&(j=s.onCaughtError),s.onRecoverableError!==void 0&&(D=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&(H=s.unstable_transitionCallbacks),s.formState!==void 0&&(J=s.formState)),a=I0(n,1,!0,a,s??null,c,p,y,j,D,H,J),a.context=V0(null),s=a.current,c=Cn(),c=xi(c),p=Na(c),p.callback=null,Ca(s,p,c),s=c,a.current.lanes=s,pa(a,s),wr(a),n[ga]=a.current,bm(n),new ku(a)},vl.version="19.1.0",vl}var lb;function jA(){if(lb)return $m.exports;lb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),$m.exports=CA(),$m.exports}var _A=jA(),yl={},cb;function AA(){if(cb)return yl;cb=1,Object.defineProperty(yl,"__esModule",{value:!0}),yl.parse=u,yl.serialize=h;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,o=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,l=(()=>{const b=function(){};return b.prototype=Object.create(null),b})();function u(b,w){const E=new l,S=b.length;if(S<2)return E;const N=(w==null?void 0:w.decode)||g;let C=0;do{const T=b.indexOf("=",C);if(T===-1)break;const A=b.indexOf(";",C),_=A===-1?S:A;if(T>_){C=b.lastIndexOf(";",T-1)+1;continue}const O=f(b,C,T),L=m(b,T,O),B=b.slice(O,L);if(E[B]===void 0){let I=f(b,T+1,_),q=m(b,_,I);const Q=N(b.slice(I,q));E[B]=Q}C=_+1}while(C<S);return E}function f(b,w,E){do{const S=b.charCodeAt(w);if(S!==32&&S!==9)return w}while(++w<E);return E}function m(b,w,E){for(;w>E;){const S=b.charCodeAt(--w);if(S!==32&&S!==9)return w+1}return E}function h(b,w,E){const S=(E==null?void 0:E.encode)||encodeURIComponent;if(!e.test(b))throw new TypeError(`argument name is invalid: ${b}`);const N=S(w);if(!t.test(N))throw new TypeError(`argument val is invalid: ${w}`);let C=b+"="+N;if(!E)return C;if(E.maxAge!==void 0){if(!Number.isInteger(E.maxAge))throw new TypeError(`option maxAge is invalid: ${E.maxAge}`);C+="; Max-Age="+E.maxAge}if(E.domain){if(!r.test(E.domain))throw new TypeError(`option domain is invalid: ${E.domain}`);C+="; Domain="+E.domain}if(E.path){if(!o.test(E.path))throw new TypeError(`option path is invalid: ${E.path}`);C+="; Path="+E.path}if(E.expires){if(!v(E.expires)||!Number.isFinite(E.expires.valueOf()))throw new TypeError(`option expires is invalid: ${E.expires}`);C+="; Expires="+E.expires.toUTCString()}if(E.httpOnly&&(C+="; HttpOnly"),E.secure&&(C+="; Secure"),E.partitioned&&(C+="; Partitioned"),E.priority)switch(typeof E.priority=="string"?E.priority.toLowerCase():void 0){case"low":C+="; Priority=Low";break;case"medium":C+="; Priority=Medium";break;case"high":C+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${E.priority}`)}if(E.sameSite)switch(typeof E.sameSite=="string"?E.sameSite.toLowerCase():E.sameSite){case!0:case"strict":C+="; SameSite=Strict";break;case"lax":C+="; SameSite=Lax";break;case"none":C+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${E.sameSite}`)}return C}function g(b){if(b.indexOf("%")===-1)return b;try{return decodeURIComponent(b)}catch{return b}}function v(b){return i.call(b)==="[object Date]"}return yl}AA();var ub="popstate";function TA(e={}){function t(o,i){let{pathname:l,search:u,hash:f}=o.location;return Np("",{pathname:l,search:u,hash:f},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(o,i){return typeof i=="string"?i:Pl(i)}return MA(t,r,null,e)}function ht(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function lr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function RA(){return Math.random().toString(36).substring(2,10)}function db(e,t){return{usr:e.state,key:e.key,idx:t}}function Np(e,t,r=null,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?li(t):t,state:r,key:t&&t.key||o||RA()}}function Pl({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function li(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let o=e.indexOf("?");o>=0&&(t.search=e.substring(o),e=e.substring(0,o)),e&&(t.pathname=e)}return t}function MA(e,t,r,o={}){let{window:i=document.defaultView,v5Compat:l=!1}=o,u=i.history,f="POP",m=null,h=g();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function g(){return(u.state||{idx:null}).idx}function v(){f="POP";let N=g(),C=N==null?null:N-h;h=N,m&&m({action:f,location:S.location,delta:C})}function b(N,C){f="PUSH";let T=Np(S.location,N,C);h=g()+1;let A=db(T,h),_=S.createHref(T);try{u.pushState(A,"",_)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;i.location.assign(_)}l&&m&&m({action:f,location:S.location,delta:1})}function w(N,C){f="REPLACE";let T=Np(S.location,N,C);h=g();let A=db(T,h),_=S.createHref(T);u.replaceState(A,"",_),l&&m&&m({action:f,location:S.location,delta:0})}function E(N){return DA(N)}let S={get action(){return f},get location(){return e(i,u)},listen(N){if(m)throw new Error("A history only accepts one active listener");return i.addEventListener(ub,v),m=N,()=>{i.removeEventListener(ub,v),m=null}},createHref(N){return t(i,N)},createURL:E,encodeLocation(N){let C=E(N);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:b,replace:w,go(N){return u.go(N)}};return S}function DA(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),ht(r,"No window.location.(origin|href) available to create URL");let o=typeof e=="string"?e:Pl(e);return o=o.replace(/ $/,"%20"),!t&&o.startsWith("//")&&(o=r+o),new URL(o,r)}function mS(e,t,r="/"){return OA(e,t,r,!1)}function OA(e,t,r,o){let i=typeof t=="string"?li(t):t,l=ta(i.pathname||"/",r);if(l==null)return null;let u=pS(e);kA(u);let f=null;for(let m=0;f==null&&m<u.length;++m){let h=YA(l);f=VA(u[m],h,o)}return f}function pS(e,t=[],r=[],o=""){let i=(l,u,f)=>{let m={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};m.relativePath.startsWith("/")&&(ht(m.relativePath.startsWith(o),`Absolute route path "${m.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(o.length));let h=Qr([o,m.relativePath]),g=r.concat(m);l.children&&l.children.length>0&&(ht(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),pS(l.children,t,g,h)),!(l.path==null&&!l.index)&&t.push({path:h,score:$A(h,l.index),routesMeta:g})};return e.forEach((l,u)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))i(l,u);else for(let m of gS(l.path))i(l,u,m)}),t}function gS(e){let t=e.split("/");if(t.length===0)return[];let[r,...o]=t,i=r.endsWith("?"),l=r.replace(/\?$/,"");if(o.length===0)return i?[l,""]:[l];let u=gS(o.join("/")),f=[];return f.push(...u.map(m=>m===""?l:[l,m].join("/"))),i&&f.push(...u),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function kA(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:IA(t.routesMeta.map(o=>o.childrenIndex),r.routesMeta.map(o=>o.childrenIndex)))}var zA=/^:[\w-]+$/,LA=3,PA=2,UA=1,BA=10,HA=-2,fb=e=>e==="*";function $A(e,t){let r=e.split("/"),o=r.length;return r.some(fb)&&(o+=HA),t&&(o+=PA),r.filter(i=>!fb(i)).reduce((i,l)=>i+(zA.test(l)?LA:l===""?UA:BA),o)}function IA(e,t){return e.length===t.length&&e.slice(0,-1).every((o,i)=>o===t[i])?e[e.length-1]-t[t.length-1]:0}function VA(e,t,r=!1){let{routesMeta:o}=e,i={},l="/",u=[];for(let f=0;f<o.length;++f){let m=o[f],h=f===o.length-1,g=l==="/"?t:t.slice(l.length)||"/",v=vd({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},g),b=m.route;if(!v&&h&&r&&!o[o.length-1].route.index&&(v=vd({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},g)),!v)return null;Object.assign(i,v.params),u.push({params:i,pathname:Qr([l,v.pathname]),pathnameBase:WA(Qr([l,v.pathnameBase])),route:b}),v.pathnameBase!=="/"&&(l=Qr([l,v.pathnameBase]))}return u}function vd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,o]=qA(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let l=i[0],u=l.replace(/(.)\/+$/,"$1"),f=i.slice(1);return{params:o.reduce((h,{paramName:g,isOptional:v},b)=>{if(g==="*"){let E=f[b]||"";u=l.slice(0,l.length-E.length).replace(/(.)\/+$/,"$1")}const w=f[b];return v&&!w?h[g]=void 0:h[g]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:l,pathnameBase:u,pattern:e}}function qA(e,t=!1,r=!0){lr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let o=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,m)=>(o.push({paramName:f,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(o.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),o]}function YA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return lr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ta(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,o=e.charAt(r);return o&&o!=="/"?null:e.slice(r)||"/"}function GA(e,t="/"){let{pathname:r,search:o="",hash:i=""}=typeof e=="string"?li(e):e;return{pathname:r?r.startsWith("/")?r:FA(r,t):t,search:KA(o),hash:ZA(i)}}function FA(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Ym(e,t,r,o){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(o)}].  Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function XA(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function fg(e){let t=XA(e);return t.map((r,o)=>o===t.length-1?r.pathname:r.pathnameBase)}function hg(e,t,r,o=!1){let i;typeof e=="string"?i=li(e):(i={...e},ht(!i.pathname||!i.pathname.includes("?"),Ym("?","pathname","search",i)),ht(!i.pathname||!i.pathname.includes("#"),Ym("#","pathname","hash",i)),ht(!i.search||!i.search.includes("#"),Ym("#","search","hash",i)));let l=e===""||i.pathname==="",u=l?"/":i.pathname,f;if(u==null)f=r;else{let v=t.length-1;if(!o&&u.startsWith("..")){let b=u.split("/");for(;b[0]==="..";)b.shift(),v-=1;i.pathname=b.join("/")}f=v>=0?t[v]:"/"}let m=GA(i,f),h=u&&u!=="/"&&u.endsWith("/"),g=(l||u===".")&&r.endsWith("/");return!m.pathname.endsWith("/")&&(h||g)&&(m.pathname+="/"),m}var Qr=e=>e.join("/").replace(/\/\/+/g,"/"),WA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),KA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ZA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function QA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var vS=["POST","PUT","PATCH","DELETE"];new Set(vS);var JA=["GET",...vS];new Set(JA);var ci=x.createContext(null);ci.displayName="DataRouter";var Yd=x.createContext(null);Yd.displayName="DataRouterState";var yS=x.createContext({isTransitioning:!1});yS.displayName="ViewTransition";var eT=x.createContext(new Map);eT.displayName="Fetchers";var tT=x.createContext(null);tT.displayName="Await";var dr=x.createContext(null);dr.displayName="Navigation";var tc=x.createContext(null);tc.displayName="Location";var Yn=x.createContext({outlet:null,matches:[],isDataRoute:!1});Yn.displayName="Route";var mg=x.createContext(null);mg.displayName="RouteError";function nT(e,{relative:t}={}){ht(ui(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:o}=x.useContext(dr),{hash:i,pathname:l,search:u}=rc(e,{relative:t}),f=l;return r!=="/"&&(f=l==="/"?r:Qr([r,l])),o.createHref({pathname:f,search:u,hash:i})}function ui(){return x.useContext(tc)!=null}function fa(){return ht(ui(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(tc).location}var xS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function bS(e){x.useContext(dr).static||x.useLayoutEffect(e)}function rn(){let{isDataRoute:e}=x.useContext(Yn);return e?vT():rT()}function rT(){ht(ui(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(ci),{basename:t,navigator:r}=x.useContext(dr),{matches:o}=x.useContext(Yn),{pathname:i}=fa(),l=JSON.stringify(fg(o)),u=x.useRef(!1);return bS(()=>{u.current=!0}),x.useCallback((m,h={})=>{if(lr(u.current,xS),!u.current)return;if(typeof m=="number"){r.go(m);return}let g=hg(m,JSON.parse(l),i,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Qr([t,g.pathname])),(h.replace?r.replace:r.push)(g,h.state,h)},[t,r,l,i,e])}var aT=x.createContext(null);function oT(e){let t=x.useContext(Yn).outlet;return t&&x.createElement(aT.Provider,{value:e},t)}function nc(){let{matches:e}=x.useContext(Yn),t=e[e.length-1];return t?t.params:{}}function rc(e,{relative:t}={}){let{matches:r}=x.useContext(Yn),{pathname:o}=fa(),i=JSON.stringify(fg(r));return x.useMemo(()=>hg(e,JSON.parse(i),o,t==="path"),[e,i,o,t])}function sT(e,t){return wS(e,t)}function wS(e,t,r,o){var T;ht(ui(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i,static:l}=x.useContext(dr),{matches:u}=x.useContext(Yn),f=u[u.length-1],m=f?f.params:{},h=f?f.pathname:"/",g=f?f.pathnameBase:"/",v=f&&f.route;{let A=v&&v.path||"";SS(h,!v||A.endsWith("*")||A.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${A}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let b=fa(),w;if(t){let A=typeof t=="string"?li(t):t;ht(g==="/"||((T=A.pathname)==null?void 0:T.startsWith(g)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${A.pathname}" was given in the \`location\` prop.`),w=A}else w=b;let E=w.pathname||"/",S=E;if(g!=="/"){let A=g.replace(/^\//,"").split("/");S="/"+E.replace(/^\//,"").split("/").slice(A.length).join("/")}let N=!l&&r&&r.matches&&r.matches.length>0?r.matches:mS(e,{pathname:S});lr(v||N!=null,`No routes matched location "${w.pathname}${w.search}${w.hash}" `),lr(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.length-1].route.lazy!==void 0,`Matched leaf route at location "${w.pathname}${w.search}${w.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=dT(N&&N.map(A=>Object.assign({},A,{params:Object.assign({},m,A.params),pathname:Qr([g,i.encodeLocation?i.encodeLocation(A.pathname).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?g:Qr([g,i.encodeLocation?i.encodeLocation(A.pathnameBase).pathname:A.pathnameBase])})),u,r,o);return t&&C?x.createElement(tc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...w},navigationType:"POP"}},C):C}function iT(){let e=gT(),t=QA(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:o},l={padding:"2px 4px",backgroundColor:o},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:l},"ErrorBoundary")," or"," ",x.createElement("code",{style:l},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),r?x.createElement("pre",{style:i},r):null,u)}var lT=x.createElement(iT,null),cT=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?x.createElement(Yn.Provider,{value:this.props.routeContext},x.createElement(mg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function uT({routeContext:e,match:t,children:r}){let o=x.useContext(ci);return o&&o.static&&o.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(Yn.Provider,{value:e},r)}function dT(e,t=[],r=null,o=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,l=r==null?void 0:r.errors;if(l!=null){let m=i.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);ht(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,m+1))}let u=!1,f=-1;if(r)for(let m=0;m<i.length;m++){let h=i[m];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(f=m),h.route.id){let{loaderData:g,errors:v}=r,b=h.route.loader&&!g.hasOwnProperty(h.route.id)&&(!v||v[h.route.id]===void 0);if(h.route.lazy||b){u=!0,f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}return i.reduceRight((m,h,g)=>{let v,b=!1,w=null,E=null;r&&(v=l&&h.route.id?l[h.route.id]:void 0,w=h.route.errorElement||lT,u&&(f<0&&g===0?(SS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,E=null):f===g&&(b=!0,E=h.route.hydrateFallbackElement||null)));let S=t.concat(i.slice(0,g+1)),N=()=>{let C;return v?C=w:b?C=E:h.route.Component?C=x.createElement(h.route.Component,null):h.route.element?C=h.route.element:C=m,x.createElement(uT,{match:h,routeContext:{outlet:m,matches:S,isDataRoute:r!=null},children:C})};return r&&(h.route.ErrorBoundary||h.route.errorElement||g===0)?x.createElement(cT,{location:r.location,revalidation:r.revalidation,component:w,error:v,children:N(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):N()},null)}function pg(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function fT(e){let t=x.useContext(ci);return ht(t,pg(e)),t}function hT(e){let t=x.useContext(Yd);return ht(t,pg(e)),t}function mT(e){let t=x.useContext(Yn);return ht(t,pg(e)),t}function gg(e){let t=mT(e),r=t.matches[t.matches.length-1];return ht(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function pT(){return gg("useRouteId")}function gT(){var o;let e=x.useContext(mg),t=hT("useRouteError"),r=gg("useRouteError");return e!==void 0?e:(o=t.errors)==null?void 0:o[r]}function vT(){let{router:e}=fT("useNavigate"),t=gg("useNavigate"),r=x.useRef(!1);return bS(()=>{r.current=!0}),x.useCallback(async(i,l={})=>{lr(r.current,xS),r.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...l}))},[e,t])}var hb={};function SS(e,t,r){!t&&!hb[e]&&(hb[e]=!0,lr(!1,r))}x.memo(yT);function yT({routes:e,future:t,state:r}){return wS(e,void 0,r,t)}function ES({to:e,replace:t,state:r,relative:o}){ht(ui(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=x.useContext(dr);lr(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=x.useContext(Yn),{pathname:u}=fa(),f=rn(),m=hg(e,fg(l),u,o==="path"),h=JSON.stringify(m);return x.useEffect(()=>{f(JSON.parse(h),{replace:t,state:r,relative:o})},[f,h,o,t,r]),null}function xT(e){return oT(e.context)}function Ht(e){ht(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function bT({basename:e="/",children:t=null,location:r,navigationType:o="POP",navigator:i,static:l=!1}){ht(!ui(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),f=x.useMemo(()=>({basename:u,navigator:i,static:l,future:{}}),[u,i,l]);typeof r=="string"&&(r=li(r));let{pathname:m="/",search:h="",hash:g="",state:v=null,key:b="default"}=r,w=x.useMemo(()=>{let E=ta(m,u);return E==null?null:{location:{pathname:E,search:h,hash:g,state:v,key:b},navigationType:o}},[u,m,h,g,v,b,o]);return lr(w!=null,`<Router basename="${u}"> is not able to match the URL "${m}${h}${g}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:x.createElement(dr.Provider,{value:f},x.createElement(tc.Provider,{children:t,value:w}))}function wT({children:e,location:t}){return sT(Cp(e),t)}function Cp(e,t=[]){let r=[];return x.Children.forEach(e,(o,i)=>{if(!x.isValidElement(o))return;let l=[...t,i];if(o.type===x.Fragment){r.push.apply(r,Cp(o.props.children,l));return}ht(o.type===Ht,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ht(!o.props.index||!o.props.children,"An index route cannot have child routes.");let u={id:o.props.id||l.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(u.children=Cp(o.props.children,l)),r.push(u)}),r}var rd="get",ad="application/x-www-form-urlencoded";function Gd(e){return e!=null&&typeof e.tagName=="string"}function ST(e){return Gd(e)&&e.tagName.toLowerCase()==="button"}function ET(e){return Gd(e)&&e.tagName.toLowerCase()==="form"}function NT(e){return Gd(e)&&e.tagName.toLowerCase()==="input"}function CT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function jT(e,t){return e.button===0&&(!t||t==="_self")&&!CT(e)}var Lu=null;function _T(){if(Lu===null)try{new FormData(document.createElement("form"),0),Lu=!1}catch{Lu=!0}return Lu}var AT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Gm(e){return e!=null&&!AT.has(e)?(lr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ad}"`),null):e}function TT(e,t){let r,o,i,l,u;if(ET(e)){let f=e.getAttribute("action");o=f?ta(f,t):null,r=e.getAttribute("method")||rd,i=Gm(e.getAttribute("enctype"))||ad,l=new FormData(e)}else if(ST(e)||NT(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||f.getAttribute("action");if(o=m?ta(m,t):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||rd,i=Gm(e.getAttribute("formenctype"))||Gm(f.getAttribute("enctype"))||ad,l=new FormData(f,e),!_T()){let{name:h,type:g,value:v}=e;if(g==="image"){let b=h?`${h}.`:"";l.append(`${b}x`,"0"),l.append(`${b}y`,"0")}else h&&l.append(h,v)}}else{if(Gd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=rd,o=null,i=ad,u=e}return l&&i==="text/plain"&&(u=l,l=void 0),{action:o,method:r.toLowerCase(),encType:i,formData:l,body:u}}function vg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function RT(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function MT(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function DT(e,t,r){let o=await Promise.all(e.map(async i=>{let l=t.routes[i.route.id];if(l){let u=await RT(l,r);return u.links?u.links():[]}return[]}));return LT(o.flat(1).filter(MT).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function mb(e,t,r,o,i,l){let u=(m,h)=>r[h]?m.route.id!==r[h].route.id:!0,f=(m,h)=>{var g;return r[h].pathname!==m.pathname||((g=r[h].route.path)==null?void 0:g.endsWith("*"))&&r[h].params["*"]!==m.params["*"]};return l==="assets"?t.filter((m,h)=>u(m,h)||f(m,h)):l==="data"?t.filter((m,h)=>{var v;let g=o.routes[m.route.id];if(!g||!g.hasLoader)return!1;if(u(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((v=r[0])==null?void 0:v.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function OT(e,t,{includeHydrateFallback:r}={}){return kT(e.map(o=>{let i=t.routes[o.route.id];if(!i)return[];let l=[i.module];return i.clientActionModule&&(l=l.concat(i.clientActionModule)),i.clientLoaderModule&&(l=l.concat(i.clientLoaderModule)),r&&i.hydrateFallbackModule&&(l=l.concat(i.hydrateFallbackModule)),i.imports&&(l=l.concat(i.imports)),l}).flat(1))}function kT(e){return[...new Set(e)]}function zT(e){let t={},r=Object.keys(e).sort();for(let o of r)t[o]=e[o];return t}function LT(e,t){let r=new Set;return new Set(t),e.reduce((o,i)=>{let l=JSON.stringify(zT(i));return r.has(l)||(r.add(l),o.push({key:l,link:i})),o},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var PT=new Set([100,101,204,205]);function UT(e,t){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname="_root.data":t&&ta(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.data`:r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}function NS(){let e=x.useContext(ci);return vg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function BT(){let e=x.useContext(Yd);return vg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var yg=x.createContext(void 0);yg.displayName="FrameworkContext";function CS(){let e=x.useContext(yg);return vg(e,"You must render this element inside a <HydratedRouter> element"),e}function HT(e,t){let r=x.useContext(yg),[o,i]=x.useState(!1),[l,u]=x.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:g,onTouchStart:v}=t,b=x.useRef(null);x.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let S=C=>{C.forEach(T=>{u(T.isIntersecting)})},N=new IntersectionObserver(S,{threshold:.5});return b.current&&N.observe(b.current),()=>{N.disconnect()}}},[e]),x.useEffect(()=>{if(o){let S=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(S)}}},[o]);let w=()=>{i(!0)},E=()=>{i(!1),u(!1)};return r?e!=="intent"?[l,b,{}]:[l,b,{onFocus:xl(f,w),onBlur:xl(m,E),onMouseEnter:xl(h,w),onMouseLeave:xl(g,E),onTouchStart:xl(v,w)}]:[!1,b,{}]}function xl(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function $T({page:e,...t}){let{router:r}=NS(),o=x.useMemo(()=>mS(r.routes,e,r.basename),[r.routes,e,r.basename]);return o?x.createElement(VT,{page:e,matches:o,...t}):null}function IT(e){let{manifest:t,routeModules:r}=CS(),[o,i]=x.useState([]);return x.useEffect(()=>{let l=!1;return DT(e,t,r).then(u=>{l||i(u)}),()=>{l=!0}},[e,t,r]),o}function VT({page:e,matches:t,...r}){let o=fa(),{manifest:i,routeModules:l}=CS(),{basename:u}=NS(),{loaderData:f,matches:m}=BT(),h=x.useMemo(()=>mb(e,t,m,i,o,"data"),[e,t,m,i,o]),g=x.useMemo(()=>mb(e,t,m,i,o,"assets"),[e,t,m,i,o]),v=x.useMemo(()=>{if(e===o.pathname+o.search+o.hash)return[];let E=new Set,S=!1;if(t.forEach(C=>{var A;let T=i.routes[C.route.id];!T||!T.hasLoader||(!h.some(_=>_.route.id===C.route.id)&&C.route.id in f&&((A=l[C.route.id])!=null&&A.shouldRevalidate)||T.hasClientLoader?S=!0:E.add(C.route.id))}),E.size===0)return[];let N=UT(e,u);return S&&E.size>0&&N.searchParams.set("_routes",t.filter(C=>E.has(C.route.id)).map(C=>C.route.id).join(",")),[N.pathname+N.search]},[u,f,o,i,h,t,e,l]),b=x.useMemo(()=>OT(g,i),[g,i]),w=IT(g);return x.createElement(x.Fragment,null,v.map(E=>x.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...r})),b.map(E=>x.createElement("link",{key:E,rel:"modulepreload",href:E,...r})),w.map(({key:E,link:S})=>x.createElement("link",{key:E,...S})))}function qT(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var jS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{jS&&(window.__reactRouterVersion="7.6.0")}catch{}function YT({basename:e,children:t,window:r}){let o=x.useRef();o.current==null&&(o.current=TA({window:r,v5Compat:!0}));let i=o.current,[l,u]=x.useState({action:i.action,location:i.location}),f=x.useCallback(m=>{x.startTransition(()=>u(m))},[u]);return x.useLayoutEffect(()=>i.listen(f),[i,f]),x.createElement(bT,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i})}var _S=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wa=x.forwardRef(function({onClick:t,discover:r="render",prefetch:o="none",relative:i,reloadDocument:l,replace:u,state:f,target:m,to:h,preventScrollReset:g,viewTransition:v,...b},w){let{basename:E}=x.useContext(dr),S=typeof h=="string"&&_S.test(h),N,C=!1;if(typeof h=="string"&&S&&(N=h,jS))try{let q=new URL(window.location.href),Q=h.startsWith("//")?new URL(q.protocol+h):new URL(h),te=ta(Q.pathname,E);Q.origin===q.origin&&te!=null?h=te+Q.search+Q.hash:C=!0}catch{lr(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let T=nT(h,{relative:i}),[A,_,O]=HT(o,b),L=WT(h,{replace:u,state:f,target:m,preventScrollReset:g,relative:i,viewTransition:v});function B(q){t&&t(q),q.defaultPrevented||L(q)}let I=x.createElement("a",{...b,...O,href:N||T,onClick:C||l?t:B,ref:qT(w,_),target:m,"data-discover":!S&&r==="render"?"true":void 0});return A&&!S?x.createElement(x.Fragment,null,I,x.createElement($T,{page:T})):I});Wa.displayName="Link";var GT=x.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:o="",end:i=!1,style:l,to:u,viewTransition:f,children:m,...h},g){let v=rc(u,{relative:h.relative}),b=fa(),w=x.useContext(Yd),{navigator:E,basename:S}=x.useContext(dr),N=w!=null&&eR(v)&&f===!0,C=E.encodeLocation?E.encodeLocation(v).pathname:v.pathname,T=b.pathname,A=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;r||(T=T.toLowerCase(),A=A?A.toLowerCase():null,C=C.toLowerCase()),A&&S&&(A=ta(A,S)||A);const _=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let O=T===C||!i&&T.startsWith(C)&&T.charAt(_)==="/",L=A!=null&&(A===C||!i&&A.startsWith(C)&&A.charAt(C.length)==="/"),B={isActive:O,isPending:L,isTransitioning:N},I=O?t:void 0,q;typeof o=="function"?q=o(B):q=[o,O?"active":null,L?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let Q=typeof l=="function"?l(B):l;return x.createElement(Wa,{...h,"aria-current":I,className:q,ref:g,style:Q,to:u,viewTransition:f},typeof m=="function"?m(B):m)});GT.displayName="NavLink";var FT=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:o,replace:i,state:l,method:u=rd,action:f,onSubmit:m,relative:h,preventScrollReset:g,viewTransition:v,...b},w)=>{let E=QT(),S=JT(f,{relative:h}),N=u.toLowerCase()==="get"?"get":"post",C=typeof f=="string"&&_S.test(f),T=A=>{if(m&&m(A),A.defaultPrevented)return;A.preventDefault();let _=A.nativeEvent.submitter,O=(_==null?void 0:_.getAttribute("formmethod"))||u;E(_||A.currentTarget,{fetcherKey:t,method:O,navigate:r,replace:i,state:l,relative:h,preventScrollReset:g,viewTransition:v})};return x.createElement("form",{ref:w,method:N,action:S,onSubmit:o?m:T,...b,"data-discover":!C&&e==="render"?"true":void 0})});FT.displayName="Form";function XT(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function AS(e){let t=x.useContext(ci);return ht(t,XT(e)),t}function WT(e,{target:t,replace:r,state:o,preventScrollReset:i,relative:l,viewTransition:u}={}){let f=rn(),m=fa(),h=rc(e,{relative:l});return x.useCallback(g=>{if(jT(g,t)){g.preventDefault();let v=r!==void 0?r:Pl(m)===Pl(h);f(e,{replace:v,state:o,preventScrollReset:i,relative:l,viewTransition:u})}},[m,f,h,r,o,t,e,i,l,u])}var KT=0,ZT=()=>`__${String(++KT)}__`;function QT(){let{router:e}=AS("useSubmit"),{basename:t}=x.useContext(dr),r=pT();return x.useCallback(async(o,i={})=>{let{action:l,method:u,encType:f,formData:m,body:h}=TT(o,t);if(i.navigate===!1){let g=i.fetcherKey||ZT();await e.fetch(g,r,i.action||l,{preventScrollReset:i.preventScrollReset,formData:m,body:h,formMethod:i.method||u,formEncType:i.encType||f,flushSync:i.flushSync})}else await e.navigate(i.action||l,{preventScrollReset:i.preventScrollReset,formData:m,body:h,formMethod:i.method||u,formEncType:i.encType||f,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,r])}function JT(e,{relative:t}={}){let{basename:r}=x.useContext(dr),o=x.useContext(Yn);ht(o,"useFormAction must be used inside a RouteContext");let[i]=o.matches.slice(-1),l={...rc(e||".",{relative:t})},u=fa();if(e==null){l.search=u.search;let f=new URLSearchParams(l.search),m=f.getAll("index");if(m.some(g=>g==="")){f.delete("index"),m.filter(v=>v).forEach(v=>f.append("index",v));let g=f.toString();l.search=g?`?${g}`:""}}return(!e||e===".")&&i.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(l.pathname=l.pathname==="/"?r:Qr([r,l.pathname])),Pl(l)}function eR(e,t={}){let r=x.useContext(yS);ht(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=AS("useViewTransitionState"),i=rc(e,{relative:t.relative});if(!r.isTransitioning)return!1;let l=ta(r.currentLocation.pathname,o)||r.currentLocation.pathname,u=ta(r.nextLocation.pathname,o)||r.nextLocation.pathname;return vd(i.pathname,u)!=null||vd(i.pathname,l)!=null}[...PT];function tR(){return d.jsx(ES,{to:"/dashboard"})}function ve(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function nR(e,t){const r=x.createContext(t),o=l=>{const{children:u,...f}=l,m=x.useMemo(()=>f,Object.values(f));return d.jsx(r.Provider,{value:m,children:u})};o.displayName=e+"Provider";function i(l){const u=x.useContext(r);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[o,i]}function fr(e,t=[]){let r=[];function o(l,u){const f=x.createContext(u),m=r.length;r=[...r,u];const h=v=>{var C;const{scope:b,children:w,...E}=v,S=((C=b==null?void 0:b[e])==null?void 0:C[m])||f,N=x.useMemo(()=>E,Object.values(E));return d.jsx(S.Provider,{value:N,children:w})};h.displayName=l+"Provider";function g(v,b){var S;const w=((S=b==null?void 0:b[e])==null?void 0:S[m])||f,E=x.useContext(w);if(E)return E;if(u!==void 0)return u;throw new Error(`\`${v}\` must be used within \`${l}\``)}return[h,g]}const i=()=>{const l=r.map(u=>x.createContext(u));return function(f){const m=(f==null?void 0:f[e])||l;return x.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return i.scopeName=e,[o,rR(i,...t)]}function rR(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(l){const u=o.reduce((f,{useScope:m,scopeName:h})=>{const v=m(l)[`__scope${h}`];return{...f,...v}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}function pb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xg(...e){return t=>{let r=!1;const o=e.map(i=>{const l=pb(i,t);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let i=0;i<o.length;i++){const l=o[i];typeof l=="function"?l():pb(e[i],null)}}}}function Ye(...e){return x.useCallback(xg(...e),e)}function Ho(e){const t=aR(e),r=x.forwardRef((o,i)=>{const{children:l,...u}=o,f=x.Children.toArray(l),m=f.find(sR);if(m){const h=m.props.children,g=f.map(v=>v===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:v);return d.jsx(t,{...u,ref:i,children:x.isValidElement(h)?x.cloneElement(h,void 0,g):null})}return d.jsx(t,{...u,ref:i,children:l})});return r.displayName=`${e}.Slot`,r}var TS=Ho("Slot");function aR(e){const t=x.forwardRef((r,o)=>{const{children:i,...l}=r,u=x.isValidElement(i)?lR(i):void 0,f=Ye(u,o);if(x.isValidElement(i)){const m=iR(l,i.props);return i.type!==x.Fragment&&(m.ref=f),x.cloneElement(i,m)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oR=Symbol("radix.slottable");function sR(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oR}function iR(e,t){const r={...t};for(const o in t){const i=e[o],l=t[o];/^on[A-Z]/.test(o)?i&&l?r[o]=(...f)=>{const m=l(...f);return i(...f),m}:i&&(r[o]=i):o==="style"?r[o]={...i,...l}:o==="className"&&(r[o]=[i,l].filter(Boolean).join(" "))}return{...e,...r}}function lR(e){var o,i;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function bg(e){const t=e+"CollectionProvider",[r,o]=fr(t),[i,l]=r(t,{collectionRef:{current:null},itemMap:new Map}),u=S=>{const{scope:N,children:C}=S,T=ae.useRef(null),A=ae.useRef(new Map).current;return d.jsx(i,{scope:N,itemMap:A,collectionRef:T,children:C})};u.displayName=t;const f=e+"CollectionSlot",m=Ho(f),h=ae.forwardRef((S,N)=>{const{scope:C,children:T}=S,A=l(f,C),_=Ye(N,A.collectionRef);return d.jsx(m,{ref:_,children:T})});h.displayName=f;const g=e+"CollectionItemSlot",v="data-radix-collection-item",b=Ho(g),w=ae.forwardRef((S,N)=>{const{scope:C,children:T,...A}=S,_=ae.useRef(null),O=Ye(N,_),L=l(g,C);return ae.useEffect(()=>(L.itemMap.set(_,{ref:_,...A}),()=>void L.itemMap.delete(_))),d.jsx(b,{[v]:"",ref:O,children:T})});w.displayName=g;function E(S){const N=l(e+"CollectionConsumer",S);return ae.useCallback(()=>{const T=N.collectionRef.current;if(!T)return[];const A=Array.from(T.querySelectorAll(`[${v}]`));return Array.from(N.itemMap.values()).sort((L,B)=>A.indexOf(L.ref.current)-A.indexOf(B.ref.current))},[N.collectionRef,N.itemMap])}return[{Provider:u,Slot:h,ItemSlot:w},E,o]}var Rt=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},cR=fS[" useId ".trim().toString()]||(()=>{}),uR=0;function Er(e){const[t,r]=x.useState(cR());return Rt(()=>{r(o=>o??String(uR++))},[e]),e||(t?`radix-${t}`:"")}var ac=hS();const dR=dg(ac);var fR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ae=fR.reduce((e,t)=>{const r=Ho(`Primitive.${t}`),o=x.forwardRef((i,l)=>{const{asChild:u,...f}=i,m=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...f,ref:l})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function RS(e,t){e&&ac.flushSync(()=>e.dispatchEvent(t))}function $t(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>{var o;return(o=t.current)==null?void 0:o.call(t,...r)},[])}var hR=fS[" useInsertionEffect ".trim().toString()]||Rt;function $o({prop:e,defaultProp:t,onChange:r=()=>{},caller:o}){const[i,l,u]=mR({defaultProp:t,onChange:r}),f=e!==void 0,m=f?e:i;{const g=x.useRef(e!==void 0);x.useEffect(()=>{const v=g.current;v!==f&&console.warn(`${o} is changing from ${v?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=f},[f,o])}const h=x.useCallback(g=>{var v;if(f){const b=pR(g)?g(e):g;b!==e&&((v=u.current)==null||v.call(u,b))}else l(g)},[f,e,l,u]);return[m,h]}function mR({defaultProp:e,onChange:t}){const[r,o]=x.useState(e),i=x.useRef(r),l=x.useRef(t);return hR(()=>{l.current=t},[t]),x.useEffect(()=>{var u;i.current!==r&&((u=l.current)==null||u.call(l,r),i.current=r)},[r,i]),[r,o,l]}function pR(e){return typeof e=="function"}var gR=x.createContext(void 0);function oc(e){const t=x.useContext(gR);return e||t||"ltr"}var Fm="rovingFocusGroup.onEntryFocus",vR={bubbles:!1,cancelable:!0},sc="RovingFocusGroup",[jp,MS,yR]=bg(sc),[xR,Fd]=fr(sc,[yR]),[bR,wR]=xR(sc),DS=x.forwardRef((e,t)=>d.jsx(jp.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(jp.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(SR,{...e,ref:t})})}));DS.displayName=sc;var SR=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:i=!1,dir:l,currentTabStopId:u,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:m,onEntryFocus:h,preventScrollOnEntryFocus:g=!1,...v}=e,b=x.useRef(null),w=Ye(t,b),E=oc(l),[S,N]=$o({prop:u,defaultProp:f??null,onChange:m,caller:sc}),[C,T]=x.useState(!1),A=$t(h),_=MS(r),O=x.useRef(!1),[L,B]=x.useState(0);return x.useEffect(()=>{const I=b.current;if(I)return I.addEventListener(Fm,A),()=>I.removeEventListener(Fm,A)},[A]),d.jsx(bR,{scope:r,orientation:o,dir:E,loop:i,currentTabStopId:S,onItemFocus:x.useCallback(I=>N(I),[N]),onItemShiftTab:x.useCallback(()=>T(!0),[]),onFocusableItemAdd:x.useCallback(()=>B(I=>I+1),[]),onFocusableItemRemove:x.useCallback(()=>B(I=>I-1),[]),children:d.jsx(Ae.div,{tabIndex:C||L===0?-1:0,"data-orientation":o,...v,ref:w,style:{outline:"none",...e.style},onMouseDown:ve(e.onMouseDown,()=>{O.current=!0}),onFocus:ve(e.onFocus,I=>{const q=!O.current;if(I.target===I.currentTarget&&q&&!C){const Q=new CustomEvent(Fm,vR);if(I.currentTarget.dispatchEvent(Q),!Q.defaultPrevented){const te=_().filter(M=>M.focusable),P=te.find(M=>M.active),W=te.find(M=>M.id===S),Y=[P,W,...te].filter(Boolean).map(M=>M.ref.current);zS(Y,g)}}O.current=!1}),onBlur:ve(e.onBlur,()=>T(!1))})})}),OS="RovingFocusGroupItem",kS=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:i=!1,tabStopId:l,children:u,...f}=e,m=Er(),h=l||m,g=wR(OS,r),v=g.currentTabStopId===h,b=MS(r),{onFocusableItemAdd:w,onFocusableItemRemove:E,currentTabStopId:S}=g;return x.useEffect(()=>{if(o)return w(),()=>E()},[o,w,E]),d.jsx(jp.ItemSlot,{scope:r,id:h,focusable:o,active:i,children:d.jsx(Ae.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...f,ref:t,onMouseDown:ve(e.onMouseDown,N=>{o?g.onItemFocus(h):N.preventDefault()}),onFocus:ve(e.onFocus,()=>g.onItemFocus(h)),onKeyDown:ve(e.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){g.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const C=CR(N,g.orientation,g.dir);if(C!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let A=b().filter(_=>_.focusable).map(_=>_.ref.current);if(C==="last")A.reverse();else if(C==="prev"||C==="next"){C==="prev"&&A.reverse();const _=A.indexOf(N.currentTarget);A=g.loop?jR(A,_+1):A.slice(_+1)}setTimeout(()=>zS(A))}}),children:typeof u=="function"?u({isCurrentTabStop:v,hasTabStop:S!=null}):u})})});kS.displayName=OS;var ER={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function NR(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function CR(e,t,r){const o=NR(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return ER[o]}function zS(e,t=!1){const r=document.activeElement;for(const o of e)if(o===r||(o.focus({preventScroll:t}),document.activeElement!==r))return}function jR(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var LS=DS,PS=kS;function _R(e,t){return x.useReducer((r,o)=>t[r][o]??r,e)}var vn=e=>{const{present:t,children:r}=e,o=AR(t),i=typeof r=="function"?r({present:o.isPresent}):x.Children.only(r),l=Ye(o.ref,TR(i));return typeof r=="function"||o.isPresent?x.cloneElement(i,{ref:l}):null};vn.displayName="Presence";function AR(e){const[t,r]=x.useState(),o=x.useRef(null),i=x.useRef(e),l=x.useRef("none"),u=e?"mounted":"unmounted",[f,m]=_R(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=Pu(o.current);l.current=f==="mounted"?h:"none"},[f]),Rt(()=>{const h=o.current,g=i.current;if(g!==e){const b=l.current,w=Pu(h);e?m("MOUNT"):w==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(g&&b!==w?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,m]),Rt(()=>{if(t){let h;const g=t.ownerDocument.defaultView??window,v=w=>{const S=Pu(o.current).includes(w.animationName);if(w.target===t&&S&&(m("ANIMATION_END"),!i.current)){const N=t.style.animationFillMode;t.style.animationFillMode="forwards",h=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=N)})}},b=w=>{w.target===t&&(l.current=Pu(o.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{g.clearTimeout(h),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:x.useCallback(h=>{o.current=h?getComputedStyle(h):null,r(h)},[])}}function Pu(e){return(e==null?void 0:e.animationName)||"none"}function TR(e){var o,i;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Xd="Tabs",[RR,WI]=fr(Xd,[Fd]),US=Fd(),[MR,wg]=RR(Xd),BS=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,onValueChange:i,defaultValue:l,orientation:u="horizontal",dir:f,activationMode:m="automatic",...h}=e,g=oc(f),[v,b]=$o({prop:o,onChange:i,defaultProp:l??"",caller:Xd});return d.jsx(MR,{scope:r,baseId:Er(),value:v,onValueChange:b,orientation:u,dir:g,activationMode:m,children:d.jsx(Ae.div,{dir:g,"data-orientation":u,...h,ref:t})})});BS.displayName=Xd;var HS="TabsList",$S=x.forwardRef((e,t)=>{const{__scopeTabs:r,loop:o=!0,...i}=e,l=wg(HS,r),u=US(r);return d.jsx(LS,{asChild:!0,...u,orientation:l.orientation,dir:l.dir,loop:o,children:d.jsx(Ae.div,{role:"tablist","aria-orientation":l.orientation,...i,ref:t})})});$S.displayName=HS;var IS="TabsTrigger",VS=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,disabled:i=!1,...l}=e,u=wg(IS,r),f=US(r),m=GS(u.baseId,o),h=FS(u.baseId,o),g=o===u.value;return d.jsx(PS,{asChild:!0,...f,focusable:!i,active:g,children:d.jsx(Ae.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":h,"data-state":g?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:m,...l,ref:t,onMouseDown:ve(e.onMouseDown,v=>{!i&&v.button===0&&v.ctrlKey===!1?u.onValueChange(o):v.preventDefault()}),onKeyDown:ve(e.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&u.onValueChange(o)}),onFocus:ve(e.onFocus,()=>{const v=u.activationMode!=="manual";!g&&!i&&v&&u.onValueChange(o)})})})});VS.displayName=IS;var qS="TabsContent",YS=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,forceMount:i,children:l,...u}=e,f=wg(qS,r),m=GS(f.baseId,o),h=FS(f.baseId,o),g=o===f.value,v=x.useRef(g);return x.useEffect(()=>{const b=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(b)},[]),d.jsx(vn,{present:i||g,children:({present:b})=>d.jsx(Ae.div,{"data-state":g?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":m,hidden:!b,id:h,tabIndex:0,...u,ref:t,style:{...e.style,animationDuration:v.current?"0s":void 0},children:b&&l})})});YS.displayName=qS;function GS(e,t){return`${e}-trigger-${t}`}function FS(e,t){return`${e}-content-${t}`}var DR=BS,OR=$S,kR=VS,zR=YS;function XS(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=XS(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function WS(){for(var e,t,r=0,o="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=XS(e))&&(o&&(o+=" "),o+=t);return o}const Sg="-",LR=e=>{const t=UR(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:u=>{const f=u.split(Sg);return f[0]===""&&f.length!==1&&f.shift(),KS(f,t)||PR(u)},getConflictingClassGroupIds:(u,f)=>{const m=r[u]||[];return f&&o[u]?[...m,...o[u]]:m}}},KS=(e,t)=>{var u;if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),i=o?KS(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;const l=e.join(Sg);return(u=t.validators.find(({validator:f})=>f(l)))==null?void 0:u.classGroupId},gb=/^\[(.+)\]$/,PR=e=>{if(gb.test(e)){const t=gb.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},UR=e=>{const{theme:t,classGroups:r}=e,o={nextPart:new Map,validators:[]};for(const i in r)_p(r[i],o,i,t);return o},_p=(e,t,r,o)=>{e.forEach(i=>{if(typeof i=="string"){const l=i===""?t:vb(t,i);l.classGroupId=r;return}if(typeof i=="function"){if(BR(i)){_p(i(o),t,r,o);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([l,u])=>{_p(u,vb(t,l),r,o)})})},vb=(e,t)=>{let r=e;return t.split(Sg).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},BR=e=>e.isThemeGetter,HR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const i=(l,u)=>{r.set(l,u),t++,t>e&&(t=0,o=r,r=new Map)};return{get(l){let u=r.get(l);if(u!==void 0)return u;if((u=o.get(l))!==void 0)return i(l,u),u},set(l,u){r.has(l)?r.set(l,u):i(l,u)}}},Ap="!",Tp=":",$R=Tp.length,IR=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=i=>{const l=[];let u=0,f=0,m=0,h;for(let E=0;E<i.length;E++){let S=i[E];if(u===0&&f===0){if(S===Tp){l.push(i.slice(m,E)),m=E+$R;continue}if(S==="/"){h=E;continue}}S==="["?u++:S==="]"?u--:S==="("?f++:S===")"&&f--}const g=l.length===0?i:i.substring(m),v=VR(g),b=v!==g,w=h&&h>m?h-m:void 0;return{modifiers:l,hasImportantModifier:b,baseClassName:v,maybePostfixModifierPosition:w}};if(t){const i=t+Tp,l=o;o=u=>u.startsWith(i)?l(u.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:u,maybePostfixModifierPosition:void 0}}if(r){const i=o;o=l=>r({className:l,parseClassName:i})}return o},VR=e=>e.endsWith(Ap)?e.substring(0,e.length-1):e.startsWith(Ap)?e.substring(1):e,qR=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const i=[];let l=[];return o.forEach(u=>{u[0]==="["||t[u]?(i.push(...l.sort(),u),l=[]):l.push(u)}),i.push(...l.sort()),i}},YR=e=>({cache:HR(e.cacheSize),parseClassName:IR(e),sortModifiers:qR(e),...LR(e)}),GR=/\s+/,FR=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:i,sortModifiers:l}=t,u=[],f=e.trim().split(GR);let m="";for(let h=f.length-1;h>=0;h-=1){const g=f[h],{isExternal:v,modifiers:b,hasImportantModifier:w,baseClassName:E,maybePostfixModifierPosition:S}=r(g);if(v){m=g+(m.length>0?" "+m:m);continue}let N=!!S,C=o(N?E.substring(0,S):E);if(!C){if(!N){m=g+(m.length>0?" "+m:m);continue}if(C=o(E),!C){m=g+(m.length>0?" "+m:m);continue}N=!1}const T=l(b).join(":"),A=w?T+Ap:T,_=A+C;if(u.includes(_))continue;u.push(_);const O=i(C,N);for(let L=0;L<O.length;++L){const B=O[L];u.push(A+B)}m=g+(m.length>0?" "+m:m)}return m};function XR(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=ZS(t))&&(o&&(o+=" "),o+=r);return o}const ZS=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=ZS(e[o]))&&(r&&(r+=" "),r+=t);return r};function WR(e,...t){let r,o,i,l=u;function u(m){const h=t.reduce((g,v)=>v(g),e());return r=YR(h),o=r.cache.get,i=r.cache.set,l=f,f(m)}function f(m){const h=o(m);if(h)return h;const g=FR(m,r);return i(m,g),g}return function(){return l(XR.apply(null,arguments))}}const Ot=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},QS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,JS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,KR=/^\d+\/\d+$/,ZR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QR=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,JR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,eM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Hs=e=>KR.test(e),Pe=e=>!!e&&!Number.isNaN(Number(e)),Va=e=>!!e&&Number.isInteger(Number(e)),Xm=e=>e.endsWith("%")&&Pe(e.slice(0,-1)),Xr=e=>ZR.test(e),nM=()=>!0,rM=e=>QR.test(e)&&!JR.test(e),e1=()=>!1,aM=e=>eM.test(e),oM=e=>tM.test(e),sM=e=>!xe(e)&&!be(e),iM=e=>di(e,r1,e1),xe=e=>QS.test(e),Ro=e=>di(e,a1,rM),Wm=e=>di(e,fM,Pe),yb=e=>di(e,t1,e1),lM=e=>di(e,n1,oM),Uu=e=>di(e,o1,aM),be=e=>JS.test(e),bl=e=>fi(e,a1),cM=e=>fi(e,hM),xb=e=>fi(e,t1),uM=e=>fi(e,r1),dM=e=>fi(e,n1),Bu=e=>fi(e,o1,!0),di=(e,t,r)=>{const o=QS.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},fi=(e,t,r=!1)=>{const o=JS.exec(e);return o?o[1]?t(o[1]):r:!1},t1=e=>e==="position"||e==="percentage",n1=e=>e==="image"||e==="url",r1=e=>e==="length"||e==="size"||e==="bg-size",a1=e=>e==="length",fM=e=>e==="number",hM=e=>e==="family-name",o1=e=>e==="shadow",mM=()=>{const e=Ot("color"),t=Ot("font"),r=Ot("text"),o=Ot("font-weight"),i=Ot("tracking"),l=Ot("leading"),u=Ot("breakpoint"),f=Ot("container"),m=Ot("spacing"),h=Ot("radius"),g=Ot("shadow"),v=Ot("inset-shadow"),b=Ot("text-shadow"),w=Ot("drop-shadow"),E=Ot("blur"),S=Ot("perspective"),N=Ot("aspect"),C=Ot("ease"),T=Ot("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[..._(),be,xe],L=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto","contain","none"],I=()=>[be,xe,m],q=()=>[Hs,"full","auto",...I()],Q=()=>[Va,"none","subgrid",be,xe],te=()=>["auto",{span:["full",Va,be,xe]},Va,be,xe],P=()=>[Va,"auto",be,xe],W=()=>["auto","min","max","fr",be,xe],k=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...I()],$=()=>[Hs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],U=()=>[e,be,xe],z=()=>[..._(),xb,yb,{position:[be,xe]}],R=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",uM,iM,{size:[be,xe]}],F=()=>[Xm,bl,Ro],K=()=>["","none","full",h,be,xe],re=()=>["",Pe,bl,Ro],de=()=>["solid","dashed","dotted","double"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[Pe,Xm,xb,yb],me=()=>["","none",E,be,xe],pe=()=>["none",Pe,be,xe],ge=()=>["none",Pe,be,xe],Se=()=>[Pe,be,xe],we=()=>[Hs,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Xr],breakpoint:[Xr],color:[nM],container:[Xr],"drop-shadow":[Xr],ease:["in","out","in-out"],font:[sM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Xr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Xr],shadow:[Xr],spacing:["px",Pe],text:[Xr],"text-shadow":[Xr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Hs,xe,be,N]}],container:["container"],columns:[{columns:[Pe,xe,be,f]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:O()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:q()}],"inset-x":[{"inset-x":q()}],"inset-y":[{"inset-y":q()}],start:[{start:q()}],end:[{end:q()}],top:[{top:q()}],right:[{right:q()}],bottom:[{bottom:q()}],left:[{left:q()}],visibility:["visible","invisible","collapse"],z:[{z:[Va,"auto",be,xe]}],basis:[{basis:[Hs,"full","auto",f,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Pe,Hs,"auto","initial","none",xe]}],grow:[{grow:["",Pe,be,xe]}],shrink:[{shrink:["",Pe,be,xe]}],order:[{order:[Va,"first","last","none",be,xe]}],"grid-cols":[{"grid-cols":Q()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":Q()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...k(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...k()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],w:[{w:[f,"screen",...$()]}],"min-w":[{"min-w":[f,"screen","none",...$()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...$()]}],h:[{h:["screen",...$()]}],"min-h":[{"min-h":["screen","none",...$()]}],"max-h":[{"max-h":["screen",...$()]}],"font-size":[{text:["base",r,bl,Ro]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,be,Wm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xm,xe]}],"font-family":[{font:[cM,xe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,be,xe]}],"line-clamp":[{"line-clamp":[Pe,"none",be,Wm]}],leading:[{leading:[l,...I()]}],"list-image":[{"list-image":["none",be,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Pe,"from-font","auto",be,Ro]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Pe,"auto",be,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",be,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Va,be,xe],radial:["",be,xe],conic:[Va,be,xe]},dM,lM]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Pe,be,xe]}],"outline-w":[{outline:["",Pe,bl,Ro]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",g,Bu,Uu]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",v,Bu,Uu]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Pe,Ro]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",b,Bu,Uu]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Pe,be,xe]}],"mix-blend":[{"mix-blend":[...se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[be,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[Pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,xe]}],filter:[{filter:["","none",be,xe]}],blur:[{blur:me()}],brightness:[{brightness:[Pe,be,xe]}],contrast:[{contrast:[Pe,be,xe]}],"drop-shadow":[{"drop-shadow":["","none",w,Bu,Uu]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Pe,be,xe]}],"hue-rotate":[{"hue-rotate":[Pe,be,xe]}],invert:[{invert:["",Pe,be,xe]}],saturate:[{saturate:[Pe,be,xe]}],sepia:[{sepia:["",Pe,be,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",be,xe]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[Pe,be,xe]}],"backdrop-contrast":[{"backdrop-contrast":[Pe,be,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Pe,be,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pe,be,xe]}],"backdrop-invert":[{"backdrop-invert":["",Pe,be,xe]}],"backdrop-opacity":[{"backdrop-opacity":[Pe,be,xe]}],"backdrop-saturate":[{"backdrop-saturate":[Pe,be,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",Pe,be,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Pe,"initial",be,xe]}],ease:[{ease:["linear","initial",C,be,xe]}],delay:[{delay:[Pe,be,xe]}],animate:[{animate:["none",T,be,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,be,xe]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[be,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:we()}],"translate-x":[{"translate-x":we()}],"translate-y":[{"translate-y":we()}],"translate-z":[{"translate-z":we()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",be,xe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",be,xe]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Pe,bl,Ro,Wm]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},pM=WR(mM);function Me(...e){return pM(WS(e))}function Wd({className:e,...t}){return d.jsx(DR,{"data-slot":"tabs",className:Me("flex flex-col gap-2",e),...t})}function Kd({className:e,...t}){return d.jsx(OR,{"data-slot":"tabs-list",className:Me("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Io({className:e,...t}){return d.jsx(kR,{"data-slot":"tabs-trigger",className:Me("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Vo({className:e,...t}){return d.jsx(zR,{"data-slot":"tabs-content",className:Me("flex-1 outline-none",e),...t})}function Et({className:e,...t}){return d.jsx("div",{"data-slot":"card",className:Me("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function fn({className:e,...t}){return d.jsx("div",{"data-slot":"card-header",className:Me("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function hn({className:e,...t}){return d.jsx("div",{"data-slot":"card-title",className:Me("leading-none font-semibold",e),...t})}function qo({className:e,...t}){return d.jsx("div",{"data-slot":"card-description",className:Me("text-muted-foreground text-sm",e),...t})}function Nt({className:e,...t}){return d.jsx("div",{"data-slot":"card-content",className:Me("px-6",e),...t})}function hi({className:e,...t}){return d.jsx("div",{"data-slot":"card-footer",className:Me("flex items-center px-6 [.border-t]:pt-6",e),...t})}function Qa({className:e,...t}){return d.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:d.jsx("table",{"data-slot":"table",className:Me("w-full caption-bottom text-sm",e),...t})})}function Ja({className:e,...t}){return d.jsx("thead",{"data-slot":"table-header",className:Me("[&_tr]:border-b",e),...t})}function eo({className:e,...t}){return d.jsx("tbody",{"data-slot":"table-body",className:Me("[&_tr:last-child]:border-0",e),...t})}function yt({className:e,...t}){return d.jsx("tr",{"data-slot":"table-row",className:Me("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Ue({className:e,...t}){return d.jsx("th",{"data-slot":"table-head",className:Me("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function De({className:e,...t}){return d.jsx("td",{"data-slot":"table-cell",className:Me("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Rp(e,[t,r]){return Math.min(r,Math.max(t,e))}function gM(e,t=globalThis==null?void 0:globalThis.document){const r=$t(e);x.useEffect(()=>{const o=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var vM="DismissableLayer",Mp="dismissableLayer.update",yM="dismissableLayer.pointerDownOutside",xM="dismissableLayer.focusOutside",bb,s1=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Zd=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:l,onInteractOutside:u,onDismiss:f,...m}=e,h=x.useContext(s1),[g,v]=x.useState(null),b=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=x.useState({}),E=Ye(t,B=>v(B)),S=Array.from(h.layers),[N]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=S.indexOf(N),T=g?S.indexOf(g):-1,A=h.layersWithOutsidePointerEventsDisabled.size>0,_=T>=C,O=SM(B=>{const I=B.target,q=[...h.branches].some(Q=>Q.contains(I));!_||q||(i==null||i(B),u==null||u(B),B.defaultPrevented||f==null||f())},b),L=EM(B=>{const I=B.target;[...h.branches].some(Q=>Q.contains(I))||(l==null||l(B),u==null||u(B),B.defaultPrevented||f==null||f())},b);return gM(B=>{T===h.layers.size-1&&(o==null||o(B),!B.defaultPrevented&&f&&(B.preventDefault(),f()))},b),x.useEffect(()=>{if(g)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(bb=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),wb(),()=>{r&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=bb)}},[g,b,r,h]),x.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),wb())},[g,h]),x.useEffect(()=>{const B=()=>w({});return document.addEventListener(Mp,B),()=>document.removeEventListener(Mp,B)},[]),d.jsx(Ae.div,{...m,ref:E,style:{pointerEvents:A?_?"auto":"none":void 0,...e.style},onFocusCapture:ve(e.onFocusCapture,L.onFocusCapture),onBlurCapture:ve(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:ve(e.onPointerDownCapture,O.onPointerDownCapture)})});Zd.displayName=vM;var bM="DismissableLayerBranch",wM=x.forwardRef((e,t)=>{const r=x.useContext(s1),o=x.useRef(null),i=Ye(t,o);return x.useEffect(()=>{const l=o.current;if(l)return r.branches.add(l),()=>{r.branches.delete(l)}},[r.branches]),d.jsx(Ae.div,{...e,ref:i})});wM.displayName=bM;function SM(e,t=globalThis==null?void 0:globalThis.document){const r=$t(e),o=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const l=f=>{if(f.target&&!o.current){let m=function(){i1(yM,r,h,{discrete:!0})};const h={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=m,t.addEventListener("click",i.current,{once:!0})):m()}else t.removeEventListener("click",i.current);o.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",l),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function EM(e,t=globalThis==null?void 0:globalThis.document){const r=$t(e),o=x.useRef(!1);return x.useEffect(()=>{const i=l=>{l.target&&!o.current&&i1(xM,r,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function wb(){const e=new CustomEvent(Mp);document.dispatchEvent(e)}function i1(e,t,r,{discrete:o}){const i=r.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),o?RS(i,l):i.dispatchEvent(l)}var Km=0;function Eg(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Sb()),document.body.insertAdjacentElement("beforeend",e[1]??Sb()),Km++,()=>{Km===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Km--}},[])}function Sb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Zm="focusScope.autoFocusOnMount",Qm="focusScope.autoFocusOnUnmount",Eb={bubbles:!1,cancelable:!0},NM="FocusScope",Qd=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:l,...u}=e,[f,m]=x.useState(null),h=$t(i),g=$t(l),v=x.useRef(null),b=Ye(t,S=>m(S)),w=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(o){let S=function(A){if(w.paused||!f)return;const _=A.target;f.contains(_)?v.current=_:Ga(v.current,{select:!0})},N=function(A){if(w.paused||!f)return;const _=A.relatedTarget;_!==null&&(f.contains(_)||Ga(v.current,{select:!0}))},C=function(A){if(document.activeElement===document.body)for(const O of A)O.removedNodes.length>0&&Ga(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",N);const T=new MutationObserver(C);return f&&T.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",N),T.disconnect()}}},[o,f,w.paused]),x.useEffect(()=>{if(f){Cb.add(w);const S=document.activeElement;if(!f.contains(S)){const C=new CustomEvent(Zm,Eb);f.addEventListener(Zm,h),f.dispatchEvent(C),C.defaultPrevented||(CM(RM(l1(f)),{select:!0}),document.activeElement===S&&Ga(f))}return()=>{f.removeEventListener(Zm,h),setTimeout(()=>{const C=new CustomEvent(Qm,Eb);f.addEventListener(Qm,g),f.dispatchEvent(C),C.defaultPrevented||Ga(S??document.body,{select:!0}),f.removeEventListener(Qm,g),Cb.remove(w)},0)}}},[f,h,g,w]);const E=x.useCallback(S=>{if(!r&&!o||w.paused)return;const N=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,C=document.activeElement;if(N&&C){const T=S.currentTarget,[A,_]=jM(T);A&&_?!S.shiftKey&&C===_?(S.preventDefault(),r&&Ga(A,{select:!0})):S.shiftKey&&C===A&&(S.preventDefault(),r&&Ga(_,{select:!0})):C===T&&S.preventDefault()}},[r,o,w.paused]);return d.jsx(Ae.div,{tabIndex:-1,...u,ref:b,onKeyDown:E})});Qd.displayName=NM;function CM(e,{select:t=!1}={}){const r=document.activeElement;for(const o of e)if(Ga(o,{select:t}),document.activeElement!==r)return}function jM(e){const t=l1(e),r=Nb(t,e),o=Nb(t.reverse(),e);return[r,o]}function l1(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const i=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||i?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Nb(e,t){for(const r of e)if(!_M(r,{upTo:t}))return r}function _M(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function AM(e){return e instanceof HTMLInputElement&&"select"in e}function Ga(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&AM(e)&&t&&e.select()}}var Cb=TM();function TM(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=jb(e,t),e.unshift(t)},remove(t){var r;e=jb(e,t),(r=e[0])==null||r.resume()}}}function jb(e,t){const r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function RM(e){return e.filter(t=>t.tagName!=="A")}const MM=["top","right","bottom","left"],to=Math.min,_n=Math.max,yd=Math.round,Hu=Math.floor,Nr=e=>({x:e,y:e}),DM={left:"right",right:"left",bottom:"top",top:"bottom"},OM={start:"end",end:"start"};function Dp(e,t,r){return _n(e,to(t,r))}function na(e,t){return typeof e=="function"?e(t):e}function ra(e){return e.split("-")[0]}function mi(e){return e.split("-")[1]}function Ng(e){return e==="x"?"y":"x"}function Cg(e){return e==="y"?"height":"width"}function Jr(e){return["top","bottom"].includes(ra(e))?"y":"x"}function jg(e){return Ng(Jr(e))}function kM(e,t,r){r===void 0&&(r=!1);const o=mi(e),i=jg(e),l=Cg(i);let u=i==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(u=xd(u)),[u,xd(u)]}function zM(e){const t=xd(e);return[Op(e),t,Op(t)]}function Op(e){return e.replace(/start|end/g,t=>OM[t])}function LM(e,t,r){const o=["left","right"],i=["right","left"],l=["top","bottom"],u=["bottom","top"];switch(e){case"top":case"bottom":return r?t?i:o:t?o:i;case"left":case"right":return t?l:u;default:return[]}}function PM(e,t,r,o){const i=mi(e);let l=LM(ra(e),r==="start",o);return i&&(l=l.map(u=>u+"-"+i),t&&(l=l.concat(l.map(Op)))),l}function xd(e){return e.replace(/left|right|bottom|top/g,t=>DM[t])}function UM(e){return{top:0,right:0,bottom:0,left:0,...e}}function c1(e){return typeof e!="number"?UM(e):{top:e,right:e,bottom:e,left:e}}function bd(e){const{x:t,y:r,width:o,height:i}=e;return{width:o,height:i,top:r,left:t,right:t+o,bottom:r+i,x:t,y:r}}function _b(e,t,r){let{reference:o,floating:i}=e;const l=Jr(t),u=jg(t),f=Cg(u),m=ra(t),h=l==="y",g=o.x+o.width/2-i.width/2,v=o.y+o.height/2-i.height/2,b=o[f]/2-i[f]/2;let w;switch(m){case"top":w={x:g,y:o.y-i.height};break;case"bottom":w={x:g,y:o.y+o.height};break;case"right":w={x:o.x+o.width,y:v};break;case"left":w={x:o.x-i.width,y:v};break;default:w={x:o.x,y:o.y}}switch(mi(t)){case"start":w[u]-=b*(r&&h?-1:1);break;case"end":w[u]+=b*(r&&h?-1:1);break}return w}const BM=async(e,t,r)=>{const{placement:o="bottom",strategy:i="absolute",middleware:l=[],platform:u}=r,f=l.filter(Boolean),m=await(u.isRTL==null?void 0:u.isRTL(t));let h=await u.getElementRects({reference:e,floating:t,strategy:i}),{x:g,y:v}=_b(h,o,m),b=o,w={},E=0;for(let S=0;S<f.length;S++){const{name:N,fn:C}=f[S],{x:T,y:A,data:_,reset:O}=await C({x:g,y:v,initialPlacement:o,placement:b,strategy:i,middlewareData:w,rects:h,platform:u,elements:{reference:e,floating:t}});g=T??g,v=A??v,w={...w,[N]:{...w[N],..._}},O&&E<=50&&(E++,typeof O=="object"&&(O.placement&&(b=O.placement),O.rects&&(h=O.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:g,y:v}=_b(h,b,m)),S=-1)}return{x:g,y:v,placement:b,strategy:i,middlewareData:w}};async function Ul(e,t){var r;t===void 0&&(t={});const{x:o,y:i,platform:l,rects:u,elements:f,strategy:m}=e,{boundary:h="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:b=!1,padding:w=0}=na(t,e),E=c1(w),N=f[b?v==="floating"?"reference":"floating":v],C=bd(await l.getClippingRect({element:(r=await(l.isElement==null?void 0:l.isElement(N)))==null||r?N:N.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(f.floating)),boundary:h,rootBoundary:g,strategy:m})),T=v==="floating"?{x:o,y:i,width:u.floating.width,height:u.floating.height}:u.reference,A=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f.floating)),_=await(l.isElement==null?void 0:l.isElement(A))?await(l.getScale==null?void 0:l.getScale(A))||{x:1,y:1}:{x:1,y:1},O=bd(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:T,offsetParent:A,strategy:m}):T);return{top:(C.top-O.top+E.top)/_.y,bottom:(O.bottom-C.bottom+E.bottom)/_.y,left:(C.left-O.left+E.left)/_.x,right:(O.right-C.right+E.right)/_.x}}const HM=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:o,placement:i,rects:l,platform:u,elements:f,middlewareData:m}=t,{element:h,padding:g=0}=na(e,t)||{};if(h==null)return{};const v=c1(g),b={x:r,y:o},w=jg(i),E=Cg(w),S=await u.getDimensions(h),N=w==="y",C=N?"top":"left",T=N?"bottom":"right",A=N?"clientHeight":"clientWidth",_=l.reference[E]+l.reference[w]-b[w]-l.floating[E],O=b[w]-l.reference[w],L=await(u.getOffsetParent==null?void 0:u.getOffsetParent(h));let B=L?L[A]:0;(!B||!await(u.isElement==null?void 0:u.isElement(L)))&&(B=f.floating[A]||l.floating[E]);const I=_/2-O/2,q=B/2-S[E]/2-1,Q=to(v[C],q),te=to(v[T],q),P=Q,W=B-S[E]-te,k=B/2-S[E]/2+I,Y=Dp(P,k,W),M=!m.arrow&&mi(i)!=null&&k!==Y&&l.reference[E]/2-(k<P?Q:te)-S[E]/2<0,$=M?k<P?k-P:k-W:0;return{[w]:b[w]+$,data:{[w]:Y,centerOffset:k-Y-$,...M&&{alignmentOffset:$}},reset:M}}}),$M=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,o;const{placement:i,middlewareData:l,rects:u,initialPlacement:f,platform:m,elements:h}=t,{mainAxis:g=!0,crossAxis:v=!0,fallbackPlacements:b,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:S=!0,...N}=na(e,t);if((r=l.arrow)!=null&&r.alignmentOffset)return{};const C=ra(i),T=Jr(f),A=ra(f)===f,_=await(m.isRTL==null?void 0:m.isRTL(h.floating)),O=b||(A||!S?[xd(f)]:zM(f)),L=E!=="none";!b&&L&&O.push(...PM(f,S,E,_));const B=[f,...O],I=await Ul(t,N),q=[];let Q=((o=l.flip)==null?void 0:o.overflows)||[];if(g&&q.push(I[C]),v){const Y=kM(i,u,_);q.push(I[Y[0]],I[Y[1]])}if(Q=[...Q,{placement:i,overflows:q}],!q.every(Y=>Y<=0)){var te,P;const Y=(((te=l.flip)==null?void 0:te.index)||0)+1,M=B[Y];if(M){var W;const U=v==="alignment"?T!==Jr(M):!1,z=((W=Q[0])==null?void 0:W.overflows[0])>0;if(!U||z)return{data:{index:Y,overflows:Q},reset:{placement:M}}}let $=(P=Q.filter(U=>U.overflows[0]<=0).sort((U,z)=>U.overflows[1]-z.overflows[1])[0])==null?void 0:P.placement;if(!$)switch(w){case"bestFit":{var k;const U=(k=Q.filter(z=>{if(L){const R=Jr(z.placement);return R===T||R==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(R=>R>0).reduce((R,V)=>R+V,0)]).sort((z,R)=>z[1]-R[1])[0])==null?void 0:k[0];U&&($=U);break}case"initialPlacement":$=f;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function Ab(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Tb(e){return MM.some(t=>e[t]>=0)}const IM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:o="referenceHidden",...i}=na(e,t);switch(o){case"referenceHidden":{const l=await Ul(t,{...i,elementContext:"reference"}),u=Ab(l,r.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:Tb(u)}}}case"escaped":{const l=await Ul(t,{...i,altBoundary:!0}),u=Ab(l,r.floating);return{data:{escapedOffsets:u,escaped:Tb(u)}}}default:return{}}}}};async function VM(e,t){const{placement:r,platform:o,elements:i}=e,l=await(o.isRTL==null?void 0:o.isRTL(i.floating)),u=ra(r),f=mi(r),m=Jr(r)==="y",h=["left","top"].includes(u)?-1:1,g=l&&m?-1:1,v=na(t,e);let{mainAxis:b,crossAxis:w,alignmentAxis:E}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof E=="number"&&(w=f==="end"?E*-1:E),m?{x:w*g,y:b*h}:{x:b*h,y:w*g}}const qM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,o;const{x:i,y:l,placement:u,middlewareData:f}=t,m=await VM(t,e);return u===((r=f.offset)==null?void 0:r.placement)&&(o=f.arrow)!=null&&o.alignmentOffset?{}:{x:i+m.x,y:l+m.y,data:{...m,placement:u}}}}},YM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:o,placement:i}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:f={fn:N=>{let{x:C,y:T}=N;return{x:C,y:T}}},...m}=na(e,t),h={x:r,y:o},g=await Ul(t,m),v=Jr(ra(i)),b=Ng(v);let w=h[b],E=h[v];if(l){const N=b==="y"?"top":"left",C=b==="y"?"bottom":"right",T=w+g[N],A=w-g[C];w=Dp(T,w,A)}if(u){const N=v==="y"?"top":"left",C=v==="y"?"bottom":"right",T=E+g[N],A=E-g[C];E=Dp(T,E,A)}const S=f.fn({...t,[b]:w,[v]:E});return{...S,data:{x:S.x-r,y:S.y-o,enabled:{[b]:l,[v]:u}}}}}},GM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:o,placement:i,rects:l,middlewareData:u}=t,{offset:f=0,mainAxis:m=!0,crossAxis:h=!0}=na(e,t),g={x:r,y:o},v=Jr(i),b=Ng(v);let w=g[b],E=g[v];const S=na(f,t),N=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(m){const A=b==="y"?"height":"width",_=l.reference[b]-l.floating[A]+N.mainAxis,O=l.reference[b]+l.reference[A]-N.mainAxis;w<_?w=_:w>O&&(w=O)}if(h){var C,T;const A=b==="y"?"width":"height",_=["top","left"].includes(ra(i)),O=l.reference[v]-l.floating[A]+(_&&((C=u.offset)==null?void 0:C[v])||0)+(_?0:N.crossAxis),L=l.reference[v]+l.reference[A]+(_?0:((T=u.offset)==null?void 0:T[v])||0)-(_?N.crossAxis:0);E<O?E=O:E>L&&(E=L)}return{[b]:w,[v]:E}}}},FM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,o;const{placement:i,rects:l,platform:u,elements:f}=t,{apply:m=()=>{},...h}=na(e,t),g=await Ul(t,h),v=ra(i),b=mi(i),w=Jr(i)==="y",{width:E,height:S}=l.floating;let N,C;v==="top"||v==="bottom"?(N=v,C=b===(await(u.isRTL==null?void 0:u.isRTL(f.floating))?"start":"end")?"left":"right"):(C=v,N=b==="end"?"top":"bottom");const T=S-g.top-g.bottom,A=E-g.left-g.right,_=to(S-g[N],T),O=to(E-g[C],A),L=!t.middlewareData.shift;let B=_,I=O;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(I=A),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(B=T),L&&!b){const Q=_n(g.left,0),te=_n(g.right,0),P=_n(g.top,0),W=_n(g.bottom,0);w?I=E-2*(Q!==0||te!==0?Q+te:_n(g.left,g.right)):B=S-2*(P!==0||W!==0?P+W:_n(g.top,g.bottom))}await m({...t,availableWidth:I,availableHeight:B});const q=await u.getDimensions(f.floating);return E!==q.width||S!==q.height?{reset:{rects:!0}}:{}}}};function Jd(){return typeof window<"u"}function pi(e){return u1(e)?(e.nodeName||"").toLowerCase():"#document"}function An(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _r(e){var t;return(t=(u1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function u1(e){return Jd()?e instanceof Node||e instanceof An(e).Node:!1}function cr(e){return Jd()?e instanceof Element||e instanceof An(e).Element:!1}function jr(e){return Jd()?e instanceof HTMLElement||e instanceof An(e).HTMLElement:!1}function Rb(e){return!Jd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof An(e).ShadowRoot}function ic(e){const{overflow:t,overflowX:r,overflowY:o,display:i}=ur(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&!["inline","contents"].includes(i)}function XM(e){return["table","td","th"].includes(pi(e))}function ef(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function _g(e){const t=Ag(),r=cr(e)?ur(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>r[o]?r[o]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(r.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(r.contain||"").includes(o))}function WM(e){let t=no(e);for(;jr(t)&&!ni(t);){if(_g(t))return t;if(ef(t))return null;t=no(t)}return null}function Ag(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ni(e){return["html","body","#document"].includes(pi(e))}function ur(e){return An(e).getComputedStyle(e)}function tf(e){return cr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function no(e){if(pi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Rb(e)&&e.host||_r(e);return Rb(t)?t.host:t}function d1(e){const t=no(e);return ni(t)?e.ownerDocument?e.ownerDocument.body:e.body:jr(t)&&ic(t)?t:d1(t)}function Bl(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=d1(e),l=i===((o=e.ownerDocument)==null?void 0:o.body),u=An(i);if(l){const f=kp(u);return t.concat(u,u.visualViewport||[],ic(i)?i:[],f&&r?Bl(f):[])}return t.concat(i,Bl(i,[],r))}function kp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function f1(e){const t=ur(e);let r=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=jr(e),l=i?e.offsetWidth:r,u=i?e.offsetHeight:o,f=yd(r)!==l||yd(o)!==u;return f&&(r=l,o=u),{width:r,height:o,$:f}}function Tg(e){return cr(e)?e:e.contextElement}function Zs(e){const t=Tg(e);if(!jr(t))return Nr(1);const r=t.getBoundingClientRect(),{width:o,height:i,$:l}=f1(t);let u=(l?yd(r.width):r.width)/o,f=(l?yd(r.height):r.height)/i;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const KM=Nr(0);function h1(e){const t=An(e);return!Ag()||!t.visualViewport?KM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZM(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==An(e)?!1:t}function Yo(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),l=Tg(e);let u=Nr(1);t&&(o?cr(o)&&(u=Zs(o)):u=Zs(e));const f=ZM(l,r,o)?h1(l):Nr(0);let m=(i.left+f.x)/u.x,h=(i.top+f.y)/u.y,g=i.width/u.x,v=i.height/u.y;if(l){const b=An(l),w=o&&cr(o)?An(o):o;let E=b,S=kp(E);for(;S&&o&&w!==E;){const N=Zs(S),C=S.getBoundingClientRect(),T=ur(S),A=C.left+(S.clientLeft+parseFloat(T.paddingLeft))*N.x,_=C.top+(S.clientTop+parseFloat(T.paddingTop))*N.y;m*=N.x,h*=N.y,g*=N.x,v*=N.y,m+=A,h+=_,E=An(S),S=kp(E)}}return bd({width:g,height:v,x:m,y:h})}function Rg(e,t){const r=tf(e).scrollLeft;return t?t.left+r:Yo(_r(e)).left+r}function m1(e,t,r){r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=o.left+t.scrollLeft-(r?0:Rg(e,o)),l=o.top+t.scrollTop;return{x:i,y:l}}function QM(e){let{elements:t,rect:r,offsetParent:o,strategy:i}=e;const l=i==="fixed",u=_r(o),f=t?ef(t.floating):!1;if(o===u||f&&l)return r;let m={scrollLeft:0,scrollTop:0},h=Nr(1);const g=Nr(0),v=jr(o);if((v||!v&&!l)&&((pi(o)!=="body"||ic(u))&&(m=tf(o)),jr(o))){const w=Yo(o);h=Zs(o),g.x=w.x+o.clientLeft,g.y=w.y+o.clientTop}const b=u&&!v&&!l?m1(u,m,!0):Nr(0);return{width:r.width*h.x,height:r.height*h.y,x:r.x*h.x-m.scrollLeft*h.x+g.x+b.x,y:r.y*h.y-m.scrollTop*h.y+g.y+b.y}}function JM(e){return Array.from(e.getClientRects())}function eD(e){const t=_r(e),r=tf(e),o=e.ownerDocument.body,i=_n(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),l=_n(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let u=-r.scrollLeft+Rg(e);const f=-r.scrollTop;return ur(o).direction==="rtl"&&(u+=_n(t.clientWidth,o.clientWidth)-i),{width:i,height:l,x:u,y:f}}function tD(e,t){const r=An(e),o=_r(e),i=r.visualViewport;let l=o.clientWidth,u=o.clientHeight,f=0,m=0;if(i){l=i.width,u=i.height;const h=Ag();(!h||h&&t==="fixed")&&(f=i.offsetLeft,m=i.offsetTop)}return{width:l,height:u,x:f,y:m}}function nD(e,t){const r=Yo(e,!0,t==="fixed"),o=r.top+e.clientTop,i=r.left+e.clientLeft,l=jr(e)?Zs(e):Nr(1),u=e.clientWidth*l.x,f=e.clientHeight*l.y,m=i*l.x,h=o*l.y;return{width:u,height:f,x:m,y:h}}function Mb(e,t,r){let o;if(t==="viewport")o=tD(e,r);else if(t==="document")o=eD(_r(e));else if(cr(t))o=nD(t,r);else{const i=h1(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return bd(o)}function p1(e,t){const r=no(e);return r===t||!cr(r)||ni(r)?!1:ur(r).position==="fixed"||p1(r,t)}function rD(e,t){const r=t.get(e);if(r)return r;let o=Bl(e,[],!1).filter(f=>cr(f)&&pi(f)!=="body"),i=null;const l=ur(e).position==="fixed";let u=l?no(e):e;for(;cr(u)&&!ni(u);){const f=ur(u),m=_g(u);!m&&f.position==="fixed"&&(i=null),(l?!m&&!i:!m&&f.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ic(u)&&!m&&p1(e,u))?o=o.filter(g=>g!==u):i=f,u=no(u)}return t.set(e,o),o}function aD(e){let{element:t,boundary:r,rootBoundary:o,strategy:i}=e;const u=[...r==="clippingAncestors"?ef(t)?[]:rD(t,this._c):[].concat(r),o],f=u[0],m=u.reduce((h,g)=>{const v=Mb(t,g,i);return h.top=_n(v.top,h.top),h.right=to(v.right,h.right),h.bottom=to(v.bottom,h.bottom),h.left=_n(v.left,h.left),h},Mb(t,f,i));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function oD(e){const{width:t,height:r}=f1(e);return{width:t,height:r}}function sD(e,t,r){const o=jr(t),i=_r(t),l=r==="fixed",u=Yo(e,!0,l,t);let f={scrollLeft:0,scrollTop:0};const m=Nr(0);function h(){m.x=Rg(i)}if(o||!o&&!l)if((pi(t)!=="body"||ic(i))&&(f=tf(t)),o){const w=Yo(t,!0,l,t);m.x=w.x+t.clientLeft,m.y=w.y+t.clientTop}else i&&h();l&&!o&&i&&h();const g=i&&!o&&!l?m1(i,f):Nr(0),v=u.left+f.scrollLeft-m.x-g.x,b=u.top+f.scrollTop-m.y-g.y;return{x:v,y:b,width:u.width,height:u.height}}function Jm(e){return ur(e).position==="static"}function Db(e,t){if(!jr(e)||ur(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return _r(e)===r&&(r=r.ownerDocument.body),r}function g1(e,t){const r=An(e);if(ef(e))return r;if(!jr(e)){let i=no(e);for(;i&&!ni(i);){if(cr(i)&&!Jm(i))return i;i=no(i)}return r}let o=Db(e,t);for(;o&&XM(o)&&Jm(o);)o=Db(o,t);return o&&ni(o)&&Jm(o)&&!_g(o)?r:o||WM(e)||r}const iD=async function(e){const t=this.getOffsetParent||g1,r=this.getDimensions,o=await r(e.floating);return{reference:sD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function lD(e){return ur(e).direction==="rtl"}const cD={convertOffsetParentRelativeRectToViewportRelativeRect:QM,getDocumentElement:_r,getClippingRect:aD,getOffsetParent:g1,getElementRects:iD,getClientRects:JM,getDimensions:oD,getScale:Zs,isElement:cr,isRTL:lD};function v1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uD(e,t){let r=null,o;const i=_r(e);function l(){var f;clearTimeout(o),(f=r)==null||f.disconnect(),r=null}function u(f,m){f===void 0&&(f=!1),m===void 0&&(m=1),l();const h=e.getBoundingClientRect(),{left:g,top:v,width:b,height:w}=h;if(f||t(),!b||!w)return;const E=Hu(v),S=Hu(i.clientWidth-(g+b)),N=Hu(i.clientHeight-(v+w)),C=Hu(g),A={rootMargin:-E+"px "+-S+"px "+-N+"px "+-C+"px",threshold:_n(0,to(1,m))||1};let _=!0;function O(L){const B=L[0].intersectionRatio;if(B!==m){if(!_)return u();B?u(!1,B):o=setTimeout(()=>{u(!1,1e-7)},1e3)}B===1&&!v1(h,e.getBoundingClientRect())&&u(),_=!1}try{r=new IntersectionObserver(O,{...A,root:i.ownerDocument})}catch{r=new IntersectionObserver(O,A)}r.observe(e)}return u(!0),l}function dD(e,t,r,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:m=!1}=o,h=Tg(e),g=i||l?[...h?Bl(h):[],...Bl(t)]:[];g.forEach(C=>{i&&C.addEventListener("scroll",r,{passive:!0}),l&&C.addEventListener("resize",r)});const v=h&&f?uD(h,r):null;let b=-1,w=null;u&&(w=new ResizeObserver(C=>{let[T]=C;T&&T.target===h&&w&&(w.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var A;(A=w)==null||A.observe(t)})),r()}),h&&!m&&w.observe(h),w.observe(t));let E,S=m?Yo(e):null;m&&N();function N(){const C=Yo(e);S&&!v1(S,C)&&r(),S=C,E=requestAnimationFrame(N)}return r(),()=>{var C;g.forEach(T=>{i&&T.removeEventListener("scroll",r),l&&T.removeEventListener("resize",r)}),v==null||v(),(C=w)==null||C.disconnect(),w=null,m&&cancelAnimationFrame(E)}}const fD=qM,hD=YM,mD=$M,pD=FM,gD=IM,Ob=HM,vD=GM,yD=(e,t,r)=>{const o=new Map,i={platform:cD,...r},l={...i.platform,_c:o};return BM(e,t,{...i,platform:l})};var od=typeof document<"u"?x.useLayoutEffect:x.useEffect;function wd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,o,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(o=r;o--!==0;)if(!wd(e[o],t[o]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(t,i[o]))return!1;for(o=r;o--!==0;){const l=i[o];if(!(l==="_owner"&&e.$$typeof)&&!wd(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function y1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kb(e,t){const r=y1(e);return Math.round(t*r)/r}function ep(e){const t=x.useRef(e);return od(()=>{t.current=e}),t}function xD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:u}={},transform:f=!0,whileElementsMounted:m,open:h}=e,[g,v]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[b,w]=x.useState(o);wd(b,o)||w(o);const[E,S]=x.useState(null),[N,C]=x.useState(null),T=x.useCallback(U=>{U!==L.current&&(L.current=U,S(U))},[]),A=x.useCallback(U=>{U!==B.current&&(B.current=U,C(U))},[]),_=l||E,O=u||N,L=x.useRef(null),B=x.useRef(null),I=x.useRef(g),q=m!=null,Q=ep(m),te=ep(i),P=ep(h),W=x.useCallback(()=>{if(!L.current||!B.current)return;const U={placement:t,strategy:r,middleware:b};te.current&&(U.platform=te.current),yD(L.current,B.current,U).then(z=>{const R={...z,isPositioned:P.current!==!1};k.current&&!wd(I.current,R)&&(I.current=R,ac.flushSync(()=>{v(R)}))})},[b,t,r,te,P]);od(()=>{h===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,v(U=>({...U,isPositioned:!1})))},[h]);const k=x.useRef(!1);od(()=>(k.current=!0,()=>{k.current=!1}),[]),od(()=>{if(_&&(L.current=_),O&&(B.current=O),_&&O){if(Q.current)return Q.current(_,O,W);W()}},[_,O,W,Q,q]);const Y=x.useMemo(()=>({reference:L,floating:B,setReference:T,setFloating:A}),[T,A]),M=x.useMemo(()=>({reference:_,floating:O}),[_,O]),$=x.useMemo(()=>{const U={position:r,left:0,top:0};if(!M.floating)return U;const z=kb(M.floating,g.x),R=kb(M.floating,g.y);return f?{...U,transform:"translate("+z+"px, "+R+"px)",...y1(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:z,top:R}},[r,f,M.floating,g.x,g.y]);return x.useMemo(()=>({...g,update:W,refs:Y,elements:M,floatingStyles:$}),[g,W,Y,M,$])}const bD=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:o,padding:i}=typeof e=="function"?e(r):e;return o&&t(o)?o.current!=null?Ob({element:o.current,padding:i}).fn(r):{}:o?Ob({element:o,padding:i}).fn(r):{}}}},wD=(e,t)=>({...fD(e),options:[e,t]}),SD=(e,t)=>({...hD(e),options:[e,t]}),ED=(e,t)=>({...vD(e),options:[e,t]}),ND=(e,t)=>({...mD(e),options:[e,t]}),CD=(e,t)=>({...pD(e),options:[e,t]}),jD=(e,t)=>({...gD(e),options:[e,t]}),_D=(e,t)=>({...bD(e),options:[e,t]});var AD="Arrow",x1=x.forwardRef((e,t)=>{const{children:r,width:o=10,height:i=5,...l}=e;return d.jsx(Ae.svg,{...l,ref:t,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});x1.displayName=AD;var TD=x1;function b1(e){const[t,r]=x.useState(void 0);return Rt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const l=i[0];let u,f;if("borderBoxSize"in l){const m=l.borderBoxSize,h=Array.isArray(m)?m[0]:m;u=h.inlineSize,f=h.blockSize}else u=e.offsetWidth,f=e.offsetHeight;r({width:u,height:f})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}var Mg="Popper",[w1,nf]=fr(Mg),[RD,S1]=w1(Mg),E1=e=>{const{__scopePopper:t,children:r}=e,[o,i]=x.useState(null);return d.jsx(RD,{scope:t,anchor:o,onAnchorChange:i,children:r})};E1.displayName=Mg;var N1="PopperAnchor",C1=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:o,...i}=e,l=S1(N1,r),u=x.useRef(null),f=Ye(t,u);return x.useEffect(()=>{l.onAnchorChange((o==null?void 0:o.current)||u.current)}),o?null:d.jsx(Ae.div,{...i,ref:f})});C1.displayName=N1;var Dg="PopperContent",[MD,DD]=w1(Dg),j1=x.forwardRef((e,t)=>{var ie,me,pe,ge,Se,we;const{__scopePopper:r,side:o="bottom",sideOffset:i=0,align:l="center",alignOffset:u=0,arrowPadding:f=0,avoidCollisions:m=!0,collisionBoundary:h=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:b=!1,updatePositionStrategy:w="optimized",onPlaced:E,...S}=e,N=S1(Dg,r),[C,T]=x.useState(null),A=Ye(t,Ge=>T(Ge)),[_,O]=x.useState(null),L=b1(_),B=(L==null?void 0:L.width)??0,I=(L==null?void 0:L.height)??0,q=o+(l!=="center"?"-"+l:""),Q=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},te=Array.isArray(h)?h:[h],P=te.length>0,W={padding:Q,boundary:te.filter(kD),altBoundary:P},{refs:k,floatingStyles:Y,placement:M,isPositioned:$,middlewareData:U}=xD({strategy:"fixed",placement:q,whileElementsMounted:(...Ge)=>dD(...Ge,{animationFrame:w==="always"}),elements:{reference:N.anchor},middleware:[wD({mainAxis:i+I,alignmentAxis:u}),m&&SD({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?ED():void 0,...W}),m&&ND({...W}),CD({...W,apply:({elements:Ge,rects:Ke,availableWidth:Je,availableHeight:mt})=>{const{width:he,height:fe}=Ke.reference,Te=Ge.floating.style;Te.setProperty("--radix-popper-available-width",`${Je}px`),Te.setProperty("--radix-popper-available-height",`${mt}px`),Te.setProperty("--radix-popper-anchor-width",`${he}px`),Te.setProperty("--radix-popper-anchor-height",`${fe}px`)}}),_&&_D({element:_,padding:f}),zD({arrowWidth:B,arrowHeight:I}),b&&jD({strategy:"referenceHidden",...W})]}),[z,R]=T1(M),V=$t(E);Rt(()=>{$&&(V==null||V())},[$,V]);const F=(ie=U.arrow)==null?void 0:ie.x,K=(me=U.arrow)==null?void 0:me.y,re=((pe=U.arrow)==null?void 0:pe.centerOffset)!==0,[de,se]=x.useState();return Rt(()=>{C&&se(window.getComputedStyle(C).zIndex)},[C]),d.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:$?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[(ge=U.transformOrigin)==null?void 0:ge.x,(Se=U.transformOrigin)==null?void 0:Se.y].join(" "),...((we=U.hide)==null?void 0:we.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(MD,{scope:r,placedSide:z,onArrowChange:O,arrowX:F,arrowY:K,shouldHideArrow:re,children:d.jsx(Ae.div,{"data-side":z,"data-align":R,...S,ref:A,style:{...S.style,animation:$?void 0:"none"}})})})});j1.displayName=Dg;var _1="PopperArrow",OD={top:"bottom",right:"left",bottom:"top",left:"right"},A1=x.forwardRef(function(t,r){const{__scopePopper:o,...i}=t,l=DD(_1,o),u=OD[l.placedSide];return d.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:d.jsx(TD,{...i,ref:r,style:{...i.style,display:"block"}})})});A1.displayName=_1;function kD(e){return e!==null}var zD=e=>({name:"transformOrigin",options:e,fn(t){var N,C,T;const{placement:r,rects:o,middlewareData:i}=t,u=((N=i.arrow)==null?void 0:N.centerOffset)!==0,f=u?0:e.arrowWidth,m=u?0:e.arrowHeight,[h,g]=T1(r),v={start:"0%",center:"50%",end:"100%"}[g],b=(((C=i.arrow)==null?void 0:C.x)??0)+f/2,w=(((T=i.arrow)==null?void 0:T.y)??0)+m/2;let E="",S="";return h==="bottom"?(E=u?v:`${b}px`,S=`${-m}px`):h==="top"?(E=u?v:`${b}px`,S=`${o.floating.height+m}px`):h==="right"?(E=`${-m}px`,S=u?v:`${w}px`):h==="left"&&(E=`${o.floating.width+m}px`,S=u?v:`${w}px`),{data:{x:E,y:S}}}});function T1(e){const[t,r="center"]=e.split("-");return[t,r]}var R1=E1,M1=C1,D1=j1,O1=A1,LD="Portal",rf=x.forwardRef((e,t)=>{var f;const{container:r,...o}=e,[i,l]=x.useState(!1);Rt(()=>l(!0),[]);const u=r||i&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?dR.createPortal(d.jsx(Ae.div,{...o,ref:t}),u):null});rf.displayName=LD;function k1(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var z1=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),PD="VisuallyHidden",UD=x.forwardRef((e,t)=>d.jsx(Ae.span,{...e,ref:t,style:{...z1,...e.style}}));UD.displayName=PD;var BD=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$s=new WeakMap,$u=new WeakMap,Iu={},tp=0,L1=function(e){return e&&(e.host||L1(e.parentNode))},HD=function(e,t){return t.map(function(r){if(e.contains(r))return r;var o=L1(r);return o&&e.contains(o)?o:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},$D=function(e,t,r,o){var i=HD(t,Array.isArray(e)?e:[e]);Iu[r]||(Iu[r]=new WeakMap);var l=Iu[r],u=[],f=new Set,m=new Set(i),h=function(v){!v||f.has(v)||(f.add(v),h(v.parentNode))};i.forEach(h);var g=function(v){!v||m.has(v)||Array.prototype.forEach.call(v.children,function(b){if(f.has(b))g(b);else try{var w=b.getAttribute(o),E=w!==null&&w!=="false",S=($s.get(b)||0)+1,N=(l.get(b)||0)+1;$s.set(b,S),l.set(b,N),u.push(b),S===1&&E&&$u.set(b,!0),N===1&&b.setAttribute(r,"true"),E||b.setAttribute(o,"true")}catch(C){console.error("aria-hidden: cannot operate on ",b,C)}})};return g(t),f.clear(),tp++,function(){u.forEach(function(v){var b=$s.get(v)-1,w=l.get(v)-1;$s.set(v,b),l.set(v,w),b||($u.has(v)||v.removeAttribute(o),$u.delete(v)),w||v.removeAttribute(r)}),tp--,tp||($s=new WeakMap,$s=new WeakMap,$u=new WeakMap,Iu={})}},Og=function(e,t,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),i=BD(e);return i?(o.push.apply(o,Array.from(i.querySelectorAll("[aria-live]"))),$D(o,i,r,"aria-hidden")):function(){return null}},Tt=function(){return Tt=Object.assign||function(t){for(var r,o=1,i=arguments.length;o<i;o++){r=arguments[o];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(t[l]=r[l])}return t},Tt.apply(this,arguments)};function P1(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]]);return r}function zl(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Oo(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var o=r.call(e),i,l=[],u;try{for(;(t===void 0||t-- >0)&&!(i=o.next()).done;)l.push(i.value)}catch(f){u={error:f}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(u)throw u.error}}return l}function Ll(e,t,r){if(r||arguments.length===2)for(var o=0,i=t.length,l;o<i;o++)(l||!(o in t))&&(l||(l=Array.prototype.slice.call(t,0,o)),l[o]=t[o]);return e.concat(l||Array.prototype.slice.call(t))}var sd="right-scroll-bar-position",id="width-before-scroll-bar",ID="with-scroll-bars-hidden",VD="--removed-body-scroll-bar-size";function np(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function qD(e,t){var r=x.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(o){var i=r.value;i!==o&&(r.value=o,r.callback(o,i))}}}})[0];return r.callback=t,r.facade}var YD=typeof window<"u"?x.useLayoutEffect:x.useEffect,zb=new WeakMap;function GD(e,t){var r=qD(null,function(o){return e.forEach(function(i){return np(i,o)})});return YD(function(){var o=zb.get(r);if(o){var i=new Set(o),l=new Set(e),u=r.current;i.forEach(function(f){l.has(f)||np(f,null)}),l.forEach(function(f){i.has(f)||np(f,u)})}zb.set(r,e)},[e]),r}function FD(e){return e}function XD(e,t){t===void 0&&(t=FD);var r=[],o=!1,i={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(l){var u=t(l,o);return r.push(u),function(){r=r.filter(function(f){return f!==u})}},assignSyncMedium:function(l){for(o=!0;r.length;){var u=r;r=[],u.forEach(l)}r={push:function(f){return l(f)},filter:function(){return r}}},assignMedium:function(l){o=!0;var u=[];if(r.length){var f=r;r=[],f.forEach(l),u=r}var m=function(){var g=u;u=[],g.forEach(l)},h=function(){return Promise.resolve().then(m)};h(),r={push:function(g){u.push(g),h()},filter:function(g){return u=u.filter(g),r}}}};return i}function WD(e){e===void 0&&(e={});var t=XD(null);return t.options=Tt({async:!0,ssr:!1},e),t}var U1=function(e){var t=e.sideCar,r=P1(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return x.createElement(o,Tt({},r))};U1.isSideCarExport=!0;function KD(e,t){return e.useMedium(t),U1}var B1=WD(),rp=function(){},af=x.forwardRef(function(e,t){var r=x.useRef(null),o=x.useState({onScrollCapture:rp,onWheelCapture:rp,onTouchMoveCapture:rp}),i=o[0],l=o[1],u=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,g=e.enabled,v=e.shards,b=e.sideCar,w=e.noIsolation,E=e.inert,S=e.allowPinchZoom,N=e.as,C=N===void 0?"div":N,T=e.gapMode,A=P1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=b,O=GD([r,t]),L=Tt(Tt({},A),i);return x.createElement(x.Fragment,null,g&&x.createElement(_,{sideCar:B1,removeScrollBar:h,shards:v,noIsolation:w,inert:E,setCallbacks:l,allowPinchZoom:!!S,lockRef:r,gapMode:T}),u?x.cloneElement(x.Children.only(f),Tt(Tt({},L),{ref:O})):x.createElement(C,Tt({},L,{className:m,ref:O}),f))});af.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};af.classNames={fullWidth:id,zeroRight:sd};var ZD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function QD(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ZD();return t&&e.setAttribute("nonce",t),e}function JD(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function eO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var tO=function(){var e=0,t=null;return{add:function(r){e==0&&(t=QD())&&(JD(t,r),eO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nO=function(){var e=tO();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},H1=function(){var e=nO(),t=function(r){var o=r.styles,i=r.dynamic;return e(o,i),null};return t},rO={left:0,top:0,right:0,gap:0},ap=function(e){return parseInt(e||"",10)||0},aO=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[ap(r),ap(o),ap(i)]},oO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rO;var t=aO(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}},sO=H1(),Qs="data-scroll-locked",iO=function(e,t,r,o){var i=e.left,l=e.top,u=e.right,f=e.gap;return r===void 0&&(r="margin"),`
  .`.concat(ID,` {
   overflow: hidden `).concat(o,`;
   padding-right: `).concat(f,"px ").concat(o,`;
  }
  body[`).concat(Qs,`] {
    overflow: hidden `).concat(o,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(o,";"),r==="margin"&&`
    padding-left: `.concat(i,`px;
    padding-top: `).concat(l,`px;
    padding-right: `).concat(u,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(f,"px ").concat(o,`;
    `),r==="padding"&&"padding-right: ".concat(f,"px ").concat(o,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(sd,` {
    right: `).concat(f,"px ").concat(o,`;
  }
  
  .`).concat(id,` {
    margin-right: `).concat(f,"px ").concat(o,`;
  }
  
  .`).concat(sd," .").concat(sd,` {
    right: 0 `).concat(o,`;
  }
  
  .`).concat(id," .").concat(id,` {
    margin-right: 0 `).concat(o,`;
  }
  
  body[`).concat(Qs,`] {
    `).concat(VD,": ").concat(f,`px;
  }
`)},Lb=function(){var e=parseInt(document.body.getAttribute(Qs)||"0",10);return isFinite(e)?e:0},lO=function(){x.useEffect(function(){return document.body.setAttribute(Qs,(Lb()+1).toString()),function(){var e=Lb()-1;e<=0?document.body.removeAttribute(Qs):document.body.setAttribute(Qs,e.toString())}},[])},cO=function(e){var t=e.noRelative,r=e.noImportant,o=e.gapMode,i=o===void 0?"margin":o;lO();var l=x.useMemo(function(){return oO(i)},[i]);return x.createElement(sO,{styles:iO(l,!t,i,r?"":"!important")})},zp=!1;if(typeof window<"u")try{var Vu=Object.defineProperty({},"passive",{get:function(){return zp=!0,!0}});window.addEventListener("test",Vu,Vu),window.removeEventListener("test",Vu,Vu)}catch{zp=!1}var Is=zp?{passive:!1}:!1,uO=function(e){return e.tagName==="TEXTAREA"},$1=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!uO(e)&&r[t]==="visible")},dO=function(e){return $1(e,"overflowY")},fO=function(e){return $1(e,"overflowX")},Pb=function(e,t){var r=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var i=I1(e,o);if(i){var l=V1(e,o),u=l[1],f=l[2];if(u>f)return!0}o=o.parentNode}while(o&&o!==r.body);return!1},hO=function(e){var t=e.scrollTop,r=e.scrollHeight,o=e.clientHeight;return[t,r,o]},mO=function(e){var t=e.scrollLeft,r=e.scrollWidth,o=e.clientWidth;return[t,r,o]},I1=function(e,t){return e==="v"?dO(t):fO(t)},V1=function(e,t){return e==="v"?hO(t):mO(t)},pO=function(e,t){return e==="h"&&t==="rtl"?-1:1},gO=function(e,t,r,o,i){var l=pO(e,window.getComputedStyle(t).direction),u=l*o,f=r.target,m=t.contains(f),h=!1,g=u>0,v=0,b=0;do{var w=V1(e,f),E=w[0],S=w[1],N=w[2],C=S-N-l*E;(E||C)&&I1(e,f)&&(v+=C,b+=E),f instanceof ShadowRoot?f=f.host:f=f.parentNode}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(g&&Math.abs(v)<1||!g&&Math.abs(b)<1)&&(h=!0),h},qu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ub=function(e){return[e.deltaX,e.deltaY]},Bb=function(e){return e&&"current"in e?e.current:e},vO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yO=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},xO=0,Vs=[];function bO(e){var t=x.useRef([]),r=x.useRef([0,0]),o=x.useRef(),i=x.useState(xO++)[0],l=x.useState(H1)[0],u=x.useRef(e);x.useEffect(function(){u.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=Ll([e.lockRef.current],(e.shards||[]).map(Bb),!0).filter(Boolean);return S.forEach(function(N){return N.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var f=x.useCallback(function(S,N){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!u.current.allowPinchZoom;var C=qu(S),T=r.current,A="deltaX"in S?S.deltaX:T[0]-C[0],_="deltaY"in S?S.deltaY:T[1]-C[1],O,L=S.target,B=Math.abs(A)>Math.abs(_)?"h":"v";if("touches"in S&&B==="h"&&L.type==="range")return!1;var I=Pb(B,L);if(!I)return!0;if(I?O=B:(O=B==="v"?"h":"v",I=Pb(B,L)),!I)return!1;if(!o.current&&"changedTouches"in S&&(A||_)&&(o.current=O),!O)return!0;var q=o.current||O;return gO(q,N,S,q==="h"?A:_)},[]),m=x.useCallback(function(S){var N=S;if(!(!Vs.length||Vs[Vs.length-1]!==l)){var C="deltaY"in N?Ub(N):qu(N),T=t.current.filter(function(O){return O.name===N.type&&(O.target===N.target||N.target===O.shadowParent)&&vO(O.delta,C)})[0];if(T&&T.should){N.cancelable&&N.preventDefault();return}if(!T){var A=(u.current.shards||[]).map(Bb).filter(Boolean).filter(function(O){return O.contains(N.target)}),_=A.length>0?f(N,A[0]):!u.current.noIsolation;_&&N.cancelable&&N.preventDefault()}}},[]),h=x.useCallback(function(S,N,C,T){var A={name:S,delta:N,target:C,should:T,shadowParent:wO(C)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(_){return _!==A})},1)},[]),g=x.useCallback(function(S){r.current=qu(S),o.current=void 0},[]),v=x.useCallback(function(S){h(S.type,Ub(S),S.target,f(S,e.lockRef.current))},[]),b=x.useCallback(function(S){h(S.type,qu(S),S.target,f(S,e.lockRef.current))},[]);x.useEffect(function(){return Vs.push(l),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:b}),document.addEventListener("wheel",m,Is),document.addEventListener("touchmove",m,Is),document.addEventListener("touchstart",g,Is),function(){Vs=Vs.filter(function(S){return S!==l}),document.removeEventListener("wheel",m,Is),document.removeEventListener("touchmove",m,Is),document.removeEventListener("touchstart",g,Is)}},[]);var w=e.removeScrollBar,E=e.inert;return x.createElement(x.Fragment,null,E?x.createElement(l,{styles:yO(i)}):null,w?x.createElement(cO,{gapMode:e.gapMode}):null)}function wO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const SO=KD(B1,bO);var of=x.forwardRef(function(e,t){return x.createElement(af,Tt({},e,{ref:t,sideCar:SO}))});of.classNames=af.classNames;var EO=[" ","Enter","ArrowUp","ArrowDown"],NO=[" ","Enter"],Go="Select",[sf,lf,CO]=bg(Go),[gi,KI]=fr(Go,[CO,nf]),cf=nf(),[jO,oo]=gi(Go),[_O,AO]=gi(Go),q1=e=>{const{__scopeSelect:t,children:r,open:o,defaultOpen:i,onOpenChange:l,value:u,defaultValue:f,onValueChange:m,dir:h,name:g,autoComplete:v,disabled:b,required:w,form:E}=e,S=cf(t),[N,C]=x.useState(null),[T,A]=x.useState(null),[_,O]=x.useState(!1),L=oc(h),[B,I]=$o({prop:o,defaultProp:i??!1,onChange:l,caller:Go}),[q,Q]=$o({prop:u,defaultProp:f,onChange:m,caller:Go}),te=x.useRef(null),P=N?E||!!N.closest("form"):!0,[W,k]=x.useState(new Set),Y=Array.from(W).map(M=>M.props.value).join(";");return d.jsx(R1,{...S,children:d.jsxs(jO,{required:w,scope:t,trigger:N,onTriggerChange:C,valueNode:T,onValueNodeChange:A,valueNodeHasChildren:_,onValueNodeHasChildrenChange:O,contentId:Er(),value:q,onValueChange:Q,open:B,onOpenChange:I,dir:L,triggerPointerDownPosRef:te,disabled:b,children:[d.jsx(sf.Provider,{scope:t,children:d.jsx(_O,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(M=>{k($=>new Set($).add(M))},[]),onNativeOptionRemove:x.useCallback(M=>{k($=>{const U=new Set($);return U.delete(M),U})},[]),children:r})}),P?d.jsxs(fE,{"aria-hidden":!0,required:w,tabIndex:-1,name:g,autoComplete:v,value:q,onChange:M=>Q(M.target.value),disabled:b,form:E,children:[q===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},Y):null]})})};q1.displayName=Go;var Y1="SelectTrigger",G1=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:o=!1,...i}=e,l=cf(r),u=oo(Y1,r),f=u.disabled||o,m=Ye(t,u.onTriggerChange),h=lf(r),g=x.useRef("touch"),[v,b,w]=mE(S=>{const N=h().filter(A=>!A.disabled),C=N.find(A=>A.value===u.value),T=pE(N,S,C);T!==void 0&&u.onValueChange(T.value)}),E=S=>{f||(u.onOpenChange(!0),w()),S&&(u.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return d.jsx(M1,{asChild:!0,...l,children:d.jsx(Ae.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":hE(u.value)?"":void 0,...i,ref:m,onClick:ve(i.onClick,S=>{S.currentTarget.focus(),g.current!=="mouse"&&E(S)}),onPointerDown:ve(i.onPointerDown,S=>{g.current=S.pointerType;const N=S.target;N.hasPointerCapture(S.pointerId)&&N.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(E(S),S.preventDefault())}),onKeyDown:ve(i.onKeyDown,S=>{const N=v.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&b(S.key),!(N&&S.key===" ")&&EO.includes(S.key)&&(E(),S.preventDefault())})})})});G1.displayName=Y1;var F1="SelectValue",X1=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:o,style:i,children:l,placeholder:u="",...f}=e,m=oo(F1,r),{onValueNodeHasChildrenChange:h}=m,g=l!==void 0,v=Ye(t,m.onValueNodeChange);return Rt(()=>{h(g)},[h,g]),d.jsx(Ae.span,{...f,ref:v,style:{pointerEvents:"none"},children:hE(m.value)?d.jsx(d.Fragment,{children:u}):l})});X1.displayName=F1;var TO="SelectIcon",W1=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:o,...i}=e;return d.jsx(Ae.span,{"aria-hidden":!0,...i,ref:t,children:o||"▼"})});W1.displayName=TO;var RO="SelectPortal",K1=e=>d.jsx(rf,{asChild:!0,...e});K1.displayName=RO;var Fo="SelectContent",Z1=x.forwardRef((e,t)=>{const r=oo(Fo,e.__scopeSelect),[o,i]=x.useState();if(Rt(()=>{i(new DocumentFragment)},[]),!r.open){const l=o;return l?ac.createPortal(d.jsx(Q1,{scope:e.__scopeSelect,children:d.jsx(sf.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),l):null}return d.jsx(J1,{...e,ref:t})});Z1.displayName=Fo;var Jn=10,[Q1,so]=gi(Fo),MO="SelectContentImpl",DO=Ho("SelectContent.RemoveScroll"),J1=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:l,onPointerDownOutside:u,side:f,sideOffset:m,align:h,alignOffset:g,arrowPadding:v,collisionBoundary:b,collisionPadding:w,sticky:E,hideWhenDetached:S,avoidCollisions:N,...C}=e,T=oo(Fo,r),[A,_]=x.useState(null),[O,L]=x.useState(null),B=Ye(t,ie=>_(ie)),[I,q]=x.useState(null),[Q,te]=x.useState(null),P=lf(r),[W,k]=x.useState(!1),Y=x.useRef(!1);x.useEffect(()=>{if(A)return Og(A)},[A]),Eg();const M=x.useCallback(ie=>{const[me,...pe]=P().map(we=>we.ref.current),[ge]=pe.slice(-1),Se=document.activeElement;for(const we of ie)if(we===Se||(we==null||we.scrollIntoView({block:"nearest"}),we===me&&O&&(O.scrollTop=0),we===ge&&O&&(O.scrollTop=O.scrollHeight),we==null||we.focus(),document.activeElement!==Se))return},[P,O]),$=x.useCallback(()=>M([I,A]),[M,I,A]);x.useEffect(()=>{W&&$()},[W,$]);const{onOpenChange:U,triggerPointerDownPosRef:z}=T;x.useEffect(()=>{if(A){let ie={x:0,y:0};const me=ge=>{var Se,we;ie={x:Math.abs(Math.round(ge.pageX)-(((Se=z.current)==null?void 0:Se.x)??0)),y:Math.abs(Math.round(ge.pageY)-(((we=z.current)==null?void 0:we.y)??0))}},pe=ge=>{ie.x<=10&&ie.y<=10?ge.preventDefault():A.contains(ge.target)||U(!1),document.removeEventListener("pointermove",me),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",pe,{capture:!0})}}},[A,U,z]),x.useEffect(()=>{const ie=()=>U(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[U]);const[R,V]=mE(ie=>{const me=P().filter(Se=>!Se.disabled),pe=me.find(Se=>Se.ref.current===document.activeElement),ge=pE(me,ie,pe);ge&&setTimeout(()=>ge.ref.current.focus())}),F=x.useCallback((ie,me,pe)=>{const ge=!Y.current&&!pe;(T.value!==void 0&&T.value===me||ge)&&(q(ie),ge&&(Y.current=!0))},[T.value]),K=x.useCallback(()=>A==null?void 0:A.focus(),[A]),re=x.useCallback((ie,me,pe)=>{const ge=!Y.current&&!pe;(T.value!==void 0&&T.value===me||ge)&&te(ie)},[T.value]),de=o==="popper"?Lp:eE,se=de===Lp?{side:f,sideOffset:m,align:h,alignOffset:g,arrowPadding:v,collisionBoundary:b,collisionPadding:w,sticky:E,hideWhenDetached:S,avoidCollisions:N}:{};return d.jsx(Q1,{scope:r,content:A,viewport:O,onViewportChange:L,itemRefCallback:F,selectedItem:I,onItemLeave:K,itemTextRefCallback:re,focusSelectedItem:$,selectedItemText:Q,position:o,isPositioned:W,searchRef:R,children:d.jsx(of,{as:DO,allowPinchZoom:!0,children:d.jsx(Qd,{asChild:!0,trapped:T.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:ve(i,ie=>{var me;(me=T.trigger)==null||me.focus({preventScroll:!0}),ie.preventDefault()}),children:d.jsx(Zd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:d.jsx(de,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:ie=>ie.preventDefault(),...C,...se,onPlaced:()=>k(!0),ref:B,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:ve(C.onKeyDown,ie=>{const me=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!me&&ie.key.length===1&&V(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let ge=P().filter(Se=>!Se.disabled).map(Se=>Se.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(ge=ge.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Se=ie.target,we=ge.indexOf(Se);ge=ge.slice(we+1)}setTimeout(()=>M(ge)),ie.preventDefault()}})})})})})})});J1.displayName=MO;var OO="SelectItemAlignedPosition",eE=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:o,...i}=e,l=oo(Fo,r),u=so(Fo,r),[f,m]=x.useState(null),[h,g]=x.useState(null),v=Ye(t,B=>g(B)),b=lf(r),w=x.useRef(!1),E=x.useRef(!0),{viewport:S,selectedItem:N,selectedItemText:C,focusSelectedItem:T}=u,A=x.useCallback(()=>{if(l.trigger&&l.valueNode&&f&&h&&S&&N&&C){const B=l.trigger.getBoundingClientRect(),I=h.getBoundingClientRect(),q=l.valueNode.getBoundingClientRect(),Q=C.getBoundingClientRect();if(l.dir!=="rtl"){const Se=Q.left-I.left,we=q.left-Se,Ge=B.left-we,Ke=B.width+Ge,Je=Math.max(Ke,I.width),mt=window.innerWidth-Jn,he=Rp(we,[Jn,Math.max(Jn,mt-Je)]);f.style.minWidth=Ke+"px",f.style.left=he+"px"}else{const Se=I.right-Q.right,we=window.innerWidth-q.right-Se,Ge=window.innerWidth-B.right-we,Ke=B.width+Ge,Je=Math.max(Ke,I.width),mt=window.innerWidth-Jn,he=Rp(we,[Jn,Math.max(Jn,mt-Je)]);f.style.minWidth=Ke+"px",f.style.right=he+"px"}const te=b(),P=window.innerHeight-Jn*2,W=S.scrollHeight,k=window.getComputedStyle(h),Y=parseInt(k.borderTopWidth,10),M=parseInt(k.paddingTop,10),$=parseInt(k.borderBottomWidth,10),U=parseInt(k.paddingBottom,10),z=Y+M+W+U+$,R=Math.min(N.offsetHeight*5,z),V=window.getComputedStyle(S),F=parseInt(V.paddingTop,10),K=parseInt(V.paddingBottom,10),re=B.top+B.height/2-Jn,de=P-re,se=N.offsetHeight/2,ie=N.offsetTop+se,me=Y+M+ie,pe=z-me;if(me<=re){const Se=te.length>0&&N===te[te.length-1].ref.current;f.style.bottom="0px";const we=h.clientHeight-S.offsetTop-S.offsetHeight,Ge=Math.max(de,se+(Se?K:0)+we+$),Ke=me+Ge;f.style.height=Ke+"px"}else{const Se=te.length>0&&N===te[0].ref.current;f.style.top="0px";const Ge=Math.max(re,Y+S.offsetTop+(Se?F:0)+se)+pe;f.style.height=Ge+"px",S.scrollTop=me-re+S.offsetTop}f.style.margin=`${Jn}px 0`,f.style.minHeight=R+"px",f.style.maxHeight=P+"px",o==null||o(),requestAnimationFrame(()=>w.current=!0)}},[b,l.trigger,l.valueNode,f,h,S,N,C,l.dir,o]);Rt(()=>A(),[A]);const[_,O]=x.useState();Rt(()=>{h&&O(window.getComputedStyle(h).zIndex)},[h]);const L=x.useCallback(B=>{B&&E.current===!0&&(A(),T==null||T(),E.current=!1)},[A,T]);return d.jsx(zO,{scope:r,contentWrapper:f,shouldExpandOnScrollRef:w,onScrollButtonChange:L,children:d.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:d.jsx(Ae.div,{...i,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});eE.displayName=OO;var kO="SelectPopperPosition",Lp=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:o="start",collisionPadding:i=Jn,...l}=e,u=cf(r);return d.jsx(D1,{...u,...l,ref:t,align:o,collisionPadding:i,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Lp.displayName=kO;var[zO,kg]=gi(Fo,{}),Pp="SelectViewport",tE=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:o,...i}=e,l=so(Pp,r),u=kg(Pp,r),f=Ye(t,l.onViewportChange),m=x.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(sf.Slot,{scope:r,children:d.jsx(Ae.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ve(i.onScroll,h=>{const g=h.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:b}=u;if(b!=null&&b.current&&v){const w=Math.abs(m.current-g.scrollTop);if(w>0){const E=window.innerHeight-Jn*2,S=parseFloat(v.style.minHeight),N=parseFloat(v.style.height),C=Math.max(S,N);if(C<E){const T=C+w,A=Math.min(E,T),_=T-A;v.style.height=A+"px",v.style.bottom==="0px"&&(g.scrollTop=_>0?_:0,v.style.justifyContent="flex-end")}}}m.current=g.scrollTop})})})]})});tE.displayName=Pp;var nE="SelectGroup",[LO,PO]=gi(nE),UO=x.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,i=Er();return d.jsx(LO,{scope:r,id:i,children:d.jsx(Ae.div,{role:"group","aria-labelledby":i,...o,ref:t})})});UO.displayName=nE;var rE="SelectLabel",BO=x.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,i=PO(rE,r);return d.jsx(Ae.div,{id:i.id,...o,ref:t})});BO.displayName=rE;var Sd="SelectItem",[HO,aE]=gi(Sd),oE=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:o,disabled:i=!1,textValue:l,...u}=e,f=oo(Sd,r),m=so(Sd,r),h=f.value===o,[g,v]=x.useState(l??""),[b,w]=x.useState(!1),E=Ye(t,T=>{var A;return(A=m.itemRefCallback)==null?void 0:A.call(m,T,o,i)}),S=Er(),N=x.useRef("touch"),C=()=>{i||(f.onValueChange(o),f.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(HO,{scope:r,value:o,disabled:i,textId:S,isSelected:h,onItemTextChange:x.useCallback(T=>{v(A=>A||((T==null?void 0:T.textContent)??"").trim())},[]),children:d.jsx(sf.ItemSlot,{scope:r,value:o,disabled:i,textValue:g,children:d.jsx(Ae.div,{role:"option","aria-labelledby":S,"data-highlighted":b?"":void 0,"aria-selected":h&&b,"data-state":h?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...u,ref:E,onFocus:ve(u.onFocus,()=>w(!0)),onBlur:ve(u.onBlur,()=>w(!1)),onClick:ve(u.onClick,()=>{N.current!=="mouse"&&C()}),onPointerUp:ve(u.onPointerUp,()=>{N.current==="mouse"&&C()}),onPointerDown:ve(u.onPointerDown,T=>{N.current=T.pointerType}),onPointerMove:ve(u.onPointerMove,T=>{var A;N.current=T.pointerType,i?(A=m.onItemLeave)==null||A.call(m):N.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ve(u.onPointerLeave,T=>{var A;T.currentTarget===document.activeElement&&((A=m.onItemLeave)==null||A.call(m))}),onKeyDown:ve(u.onKeyDown,T=>{var _;((_=m.searchRef)==null?void 0:_.current)!==""&&T.key===" "||(NO.includes(T.key)&&C(),T.key===" "&&T.preventDefault())})})})})});oE.displayName=Sd;var Tl="SelectItemText",sE=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:o,style:i,...l}=e,u=oo(Tl,r),f=so(Tl,r),m=aE(Tl,r),h=AO(Tl,r),[g,v]=x.useState(null),b=Ye(t,C=>v(C),m.onItemTextChange,C=>{var T;return(T=f.itemTextRefCallback)==null?void 0:T.call(f,C,m.value,m.disabled)}),w=g==null?void 0:g.textContent,E=x.useMemo(()=>d.jsx("option",{value:m.value,disabled:m.disabled,children:w},m.value),[m.disabled,m.value,w]),{onNativeOptionAdd:S,onNativeOptionRemove:N}=h;return Rt(()=>(S(E),()=>N(E)),[S,N,E]),d.jsxs(d.Fragment,{children:[d.jsx(Ae.span,{id:m.textId,...l,ref:b}),m.isSelected&&u.valueNode&&!u.valueNodeHasChildren?ac.createPortal(l.children,u.valueNode):null]})});sE.displayName=Tl;var iE="SelectItemIndicator",lE=x.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return aE(iE,r).isSelected?d.jsx(Ae.span,{"aria-hidden":!0,...o,ref:t}):null});lE.displayName=iE;var Up="SelectScrollUpButton",cE=x.forwardRef((e,t)=>{const r=so(Up,e.__scopeSelect),o=kg(Up,e.__scopeSelect),[i,l]=x.useState(!1),u=Ye(t,o.onScrollButtonChange);return Rt(()=>{if(r.viewport&&r.isPositioned){let f=function(){const h=m.scrollTop>0;l(h)};const m=r.viewport;return f(),m.addEventListener("scroll",f),()=>m.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),i?d.jsx(dE,{...e,ref:u,onAutoScroll:()=>{const{viewport:f,selectedItem:m}=r;f&&m&&(f.scrollTop=f.scrollTop-m.offsetHeight)}}):null});cE.displayName=Up;var Bp="SelectScrollDownButton",uE=x.forwardRef((e,t)=>{const r=so(Bp,e.__scopeSelect),o=kg(Bp,e.__scopeSelect),[i,l]=x.useState(!1),u=Ye(t,o.onScrollButtonChange);return Rt(()=>{if(r.viewport&&r.isPositioned){let f=function(){const h=m.scrollHeight-m.clientHeight,g=Math.ceil(m.scrollTop)<h;l(g)};const m=r.viewport;return f(),m.addEventListener("scroll",f),()=>m.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),i?d.jsx(dE,{...e,ref:u,onAutoScroll:()=>{const{viewport:f,selectedItem:m}=r;f&&m&&(f.scrollTop=f.scrollTop+m.offsetHeight)}}):null});uE.displayName=Bp;var dE=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:o,...i}=e,l=so("SelectScrollButton",r),u=x.useRef(null),f=lf(r),m=x.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return x.useEffect(()=>()=>m(),[m]),Rt(()=>{var g;const h=f().find(v=>v.ref.current===document.activeElement);(g=h==null?void 0:h.ref.current)==null||g.scrollIntoView({block:"nearest"})},[f]),d.jsx(Ae.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ve(i.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(o,50))}),onPointerMove:ve(i.onPointerMove,()=>{var h;(h=l.onItemLeave)==null||h.call(l),u.current===null&&(u.current=window.setInterval(o,50))}),onPointerLeave:ve(i.onPointerLeave,()=>{m()})})}),$O="SelectSeparator",IO=x.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return d.jsx(Ae.div,{"aria-hidden":!0,...o,ref:t})});IO.displayName=$O;var Hp="SelectArrow",VO=x.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,i=cf(r),l=oo(Hp,r),u=so(Hp,r);return l.open&&u.position==="popper"?d.jsx(O1,{...i,...o,ref:t}):null});VO.displayName=Hp;var qO="SelectBubbleInput",fE=x.forwardRef(({__scopeSelect:e,value:t,...r},o)=>{const i=x.useRef(null),l=Ye(o,i),u=k1(t);return x.useEffect(()=>{const f=i.current;if(!f)return;const m=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(m,"value").set;if(u!==t&&g){const v=new Event("change",{bubbles:!0});g.call(f,t),f.dispatchEvent(v)}},[u,t]),d.jsx(Ae.select,{...r,style:{...z1,...r.style},ref:l,defaultValue:t})});fE.displayName=qO;function hE(e){return e===""||e===void 0}function mE(e){const t=$t(e),r=x.useRef(""),o=x.useRef(0),i=x.useCallback(u=>{const f=r.current+u;t(f),function m(h){r.current=h,window.clearTimeout(o.current),h!==""&&(o.current=window.setTimeout(()=>m(""),1e3))}(f)},[t]),l=x.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,i,l]}function pE(e,t,r){const i=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,l=r?e.indexOf(r):-1;let u=YO(e,Math.max(l,0));i.length===1&&(u=u.filter(h=>h!==r));const m=u.find(h=>h.textValue.toLowerCase().startsWith(i.toLowerCase()));return m!==r?m:void 0}function YO(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var GO=q1,FO=G1,XO=X1,WO=W1,KO=K1,ZO=Z1,QO=tE,JO=oE,ek=sE,tk=lE,nk=cE,rk=uE;/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ak=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ok=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,o)=>o?o.toUpperCase():r.toLowerCase()),Hb=e=>{const t=ok(e);return t.charAt(0).toUpperCase()+t.slice(1)},gE=(...e)=>e.filter((t,r,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===r).join(" ").trim(),sk=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var ik={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lk=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:i="",children:l,iconNode:u,...f},m)=>x.createElement("svg",{ref:m,...ik,width:t,height:t,stroke:e,strokeWidth:o?Number(r)*24/Number(t):r,className:gE("lucide",i),...!l&&!sk(f)&&{"aria-hidden":"true"},...f},[...u.map(([h,g])=>x.createElement(h,g)),...Array.isArray(l)?l:[l]]));/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ze=(e,t)=>{const r=x.forwardRef(({className:o,...i},l)=>x.createElement(lk,{ref:l,iconNode:t,className:gE(`lucide-${ak(Hb(e))}`,`lucide-${e}`,o),...i}));return r.displayName=Hb(e),r};/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ck=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],uk=ze("activity",ck);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dk=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],lc=ze("arrow-left",dk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fk=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vE=ze("check",fk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hk=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],yE=ze("chevron-down",hk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mk=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],pk=ze("chevron-up",mk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ed=ze("circle-alert",gk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vk=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Nd=ze("circle-check-big",vk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],xk=ze("circle-plus",yk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],xE=ze("circle-x",bk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],nr=ze("clock",wk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Sk=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],Ek=ze("code",Sk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Nk=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Ck=ze("database",Nk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jk=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],_k=ze("file-text",jk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ak=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Tk=ze("funnel",Ak);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Rk=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],bE=ze("git-branch",Rk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Mk=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Dk=ze("history",Mk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ok=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],op=ze("info",Ok);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kk=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],zk=ze("key",kk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Lk=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Pk=ze("layout-dashboard",Lk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Uk=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],zg=ze("log-out",Uk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bk=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Hk=ze("mail",Bk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $k=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],Ik=ze("menu",$k);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vk=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],qk=ze("message-square",Vk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yk=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],wE=ze("network",Yk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gk=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],$b=ze("octagon-alert",Gk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fk=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Xk=ze("play",Fk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wk=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Hl=ze("plus",Wk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Kk=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],SE=ze("save",Kk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zk=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],es=ze("search",Zk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qk=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],$l=ze("server",Qk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Jk=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],e4=ze("shield-check",Jk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const t4=[["path",{d:"M5 8V5c0-1 1-2 2-2h10c1 0 2 1 2 2v3",key:"1pi83i"}],["path",{d:"M19 16v3c0 1-1 2-2 2H7c-1 0-2-1-2-2v-3",key:"ido5k7"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],n4=ze("square-split-vertical",t4);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const r4=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],EE=ze("terminal",r4);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const a4=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Xo=ze("trash-2",a4);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const o4=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ib=ze("triangle-alert",o4);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const s4=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Cd=ze("user",s4);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const i4=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],cc=ze("users",i4);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const l4=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],c4=ze("webhook",l4);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const u4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],NE=ze("x",u4);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const d4=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],CE=ze("zap",d4);function rr({...e}){return d.jsx(GO,{"data-slot":"select",...e})}function ar({...e}){return d.jsx(XO,{"data-slot":"select-value",...e})}function or({className:e,size:t="default",children:r,...o}){return d.jsxs(FO,{"data-slot":"select-trigger","data-size":t,className:Me("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[r,d.jsx(WO,{asChild:!0,children:d.jsx(yE,{className:"size-4 opacity-50"})})]})}function sr({className:e,children:t,position:r="popper",...o}){return d.jsx(KO,{children:d.jsxs(ZO,{"data-slot":"select-content",className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...o,children:[d.jsx(f4,{}),d.jsx(QO,{className:Me("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),d.jsx(h4,{})]})})}function ct({className:e,children:t,...r}){return d.jsxs(JO,{"data-slot":"select-item",className:Me("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(tk,{children:d.jsx(vE,{className:"size-4"})})}),d.jsx(ek,{children:t})]})}function f4({className:e,...t}){return d.jsx(nk,{"data-slot":"select-scroll-up-button",className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(pk,{className:"size-4"})})}function h4({className:e,...t}){return d.jsx(rk,{"data-slot":"select-scroll-down-button",className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(yE,{className:"size-4"})})}function We({className:e,type:t,...r}){return d.jsx("input",{type:t,"data-slot":"input",className:Me("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}function jE(e,t){return function(){return e.apply(t,arguments)}}const{toString:m4}=Object.prototype,{getPrototypeOf:Lg}=Object,{iterator:uf,toStringTag:_E}=Symbol,df=(e=>t=>{const r=m4.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),hr=e=>(e=e.toLowerCase(),t=>df(t)===e),ff=e=>t=>typeof t===e,{isArray:vi}=Array,Il=ff("undefined");function p4(e){return e!==null&&!Il(e)&&e.constructor!==null&&!Il(e.constructor)&&pn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const AE=hr("ArrayBuffer");function g4(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&AE(e.buffer),t}const v4=ff("string"),pn=ff("function"),TE=ff("number"),hf=e=>e!==null&&typeof e=="object",y4=e=>e===!0||e===!1,ld=e=>{if(df(e)!=="object")return!1;const t=Lg(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(_E in e)&&!(uf in e)},x4=hr("Date"),b4=hr("File"),w4=hr("Blob"),S4=hr("FileList"),E4=e=>hf(e)&&pn(e.pipe),N4=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||pn(e.append)&&((t=df(e))==="formdata"||t==="object"&&pn(e.toString)&&e.toString()==="[object FormData]"))},C4=hr("URLSearchParams"),[j4,_4,A4,T4]=["ReadableStream","Request","Response","Headers"].map(hr),R4=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function uc(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let o,i;if(typeof e!="object"&&(e=[e]),vi(e))for(o=0,i=e.length;o<i;o++)t.call(null,e[o],o,e);else{const l=r?Object.getOwnPropertyNames(e):Object.keys(e),u=l.length;let f;for(o=0;o<u;o++)f=l[o],t.call(null,e[f],f,e)}}function RE(e,t){t=t.toLowerCase();const r=Object.keys(e);let o=r.length,i;for(;o-- >0;)if(i=r[o],t===i.toLowerCase())return i;return null}const ko=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ME=e=>!Il(e)&&e!==ko;function $p(){const{caseless:e}=ME(this)&&this||{},t={},r=(o,i)=>{const l=e&&RE(t,i)||i;ld(t[l])&&ld(o)?t[l]=$p(t[l],o):ld(o)?t[l]=$p({},o):vi(o)?t[l]=o.slice():t[l]=o};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&uc(arguments[o],r);return t}const M4=(e,t,r,{allOwnKeys:o}={})=>(uc(t,(i,l)=>{r&&pn(i)?e[l]=jE(i,r):e[l]=i},{allOwnKeys:o}),e),D4=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),O4=(e,t,r,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},k4=(e,t,r,o)=>{let i,l,u;const f={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),l=i.length;l-- >0;)u=i[l],(!o||o(u,e,t))&&!f[u]&&(t[u]=e[u],f[u]=!0);e=r!==!1&&Lg(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},z4=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const o=e.indexOf(t,r);return o!==-1&&o===r},L4=e=>{if(!e)return null;if(vi(e))return e;let t=e.length;if(!TE(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},P4=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Lg(Uint8Array)),U4=(e,t)=>{const o=(e&&e[uf]).call(e);let i;for(;(i=o.next())&&!i.done;){const l=i.value;t.call(e,l[0],l[1])}},B4=(e,t)=>{let r;const o=[];for(;(r=e.exec(t))!==null;)o.push(r);return o},H4=hr("HTMLFormElement"),$4=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,o,i){return o.toUpperCase()+i}),Vb=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),I4=hr("RegExp"),DE=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),o={};uc(r,(i,l)=>{let u;(u=t(i,l,e))!==!1&&(o[l]=u||i)}),Object.defineProperties(e,o)},V4=e=>{DE(e,(t,r)=>{if(pn(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const o=e[r];if(pn(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},q4=(e,t)=>{const r={},o=i=>{i.forEach(l=>{r[l]=!0})};return vi(e)?o(e):o(String(e).split(t)),r},Y4=()=>{},G4=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function F4(e){return!!(e&&pn(e.append)&&e[_E]==="FormData"&&e[uf])}const X4=e=>{const t=new Array(10),r=(o,i)=>{if(hf(o)){if(t.indexOf(o)>=0)return;if(!("toJSON"in o)){t[i]=o;const l=vi(o)?[]:{};return uc(o,(u,f)=>{const m=r(u,i+1);!Il(m)&&(l[f]=m)}),t[i]=void 0,l}}return o};return r(e,0)},W4=hr("AsyncFunction"),K4=e=>e&&(hf(e)||pn(e))&&pn(e.then)&&pn(e.catch),OE=((e,t)=>e?setImmediate:t?((r,o)=>(ko.addEventListener("message",({source:i,data:l})=>{i===ko&&l===r&&o.length&&o.shift()()},!1),i=>{o.push(i),ko.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",pn(ko.postMessage)),Z4=typeof queueMicrotask<"u"?queueMicrotask.bind(ko):typeof process<"u"&&process.nextTick||OE,Q4=e=>e!=null&&pn(e[uf]),oe={isArray:vi,isArrayBuffer:AE,isBuffer:p4,isFormData:N4,isArrayBufferView:g4,isString:v4,isNumber:TE,isBoolean:y4,isObject:hf,isPlainObject:ld,isReadableStream:j4,isRequest:_4,isResponse:A4,isHeaders:T4,isUndefined:Il,isDate:x4,isFile:b4,isBlob:w4,isRegExp:I4,isFunction:pn,isStream:E4,isURLSearchParams:C4,isTypedArray:P4,isFileList:S4,forEach:uc,merge:$p,extend:M4,trim:R4,stripBOM:D4,inherits:O4,toFlatObject:k4,kindOf:df,kindOfTest:hr,endsWith:z4,toArray:L4,forEachEntry:U4,matchAll:B4,isHTMLForm:H4,hasOwnProperty:Vb,hasOwnProp:Vb,reduceDescriptors:DE,freezeMethods:V4,toObjectSet:q4,toCamelCase:$4,noop:Y4,toFiniteNumber:G4,findKey:RE,global:ko,isContextDefined:ME,isSpecCompliantForm:F4,toJSONObject:X4,isAsyncFn:W4,isThenable:K4,setImmediate:OE,asap:Z4,isIterable:Q4};function Oe(e,t,r,o,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),o&&(this.request=o),i&&(this.response=i,this.status=i.status?i.status:null)}oe.inherits(Oe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:oe.toJSONObject(this.config),code:this.code,status:this.status}}});const kE=Oe.prototype,zE={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{zE[e]={value:e}});Object.defineProperties(Oe,zE);Object.defineProperty(kE,"isAxiosError",{value:!0});Oe.from=(e,t,r,o,i,l)=>{const u=Object.create(kE);return oe.toFlatObject(e,u,function(m){return m!==Error.prototype},f=>f!=="isAxiosError"),Oe.call(u,e.message,t,r,o,i),u.cause=e,u.name=e.name,l&&Object.assign(u,l),u};const J4=null;function Ip(e){return oe.isPlainObject(e)||oe.isArray(e)}function LE(e){return oe.endsWith(e,"[]")?e.slice(0,-2):e}function qb(e,t,r){return e?e.concat(t).map(function(i,l){return i=LE(i),!r&&l?"["+i+"]":i}).join(r?".":""):t}function e3(e){return oe.isArray(e)&&!e.some(Ip)}const t3=oe.toFlatObject(oe,{},null,function(t){return/^is[A-Z]/.test(t)});function mf(e,t,r){if(!oe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=oe.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,N){return!oe.isUndefined(N[S])});const o=r.metaTokens,i=r.visitor||g,l=r.dots,u=r.indexes,m=(r.Blob||typeof Blob<"u"&&Blob)&&oe.isSpecCompliantForm(t);if(!oe.isFunction(i))throw new TypeError("visitor must be a function");function h(E){if(E===null)return"";if(oe.isDate(E))return E.toISOString();if(!m&&oe.isBlob(E))throw new Oe("Blob is not supported. Use a Buffer instead.");return oe.isArrayBuffer(E)||oe.isTypedArray(E)?m&&typeof Blob=="function"?new Blob([E]):Buffer.from(E):E}function g(E,S,N){let C=E;if(E&&!N&&typeof E=="object"){if(oe.endsWith(S,"{}"))S=o?S:S.slice(0,-2),E=JSON.stringify(E);else if(oe.isArray(E)&&e3(E)||(oe.isFileList(E)||oe.endsWith(S,"[]"))&&(C=oe.toArray(E)))return S=LE(S),C.forEach(function(A,_){!(oe.isUndefined(A)||A===null)&&t.append(u===!0?qb([S],_,l):u===null?S:S+"[]",h(A))}),!1}return Ip(E)?!0:(t.append(qb(N,S,l),h(E)),!1)}const v=[],b=Object.assign(t3,{defaultVisitor:g,convertValue:h,isVisitable:Ip});function w(E,S){if(!oe.isUndefined(E)){if(v.indexOf(E)!==-1)throw Error("Circular reference detected in "+S.join("."));v.push(E),oe.forEach(E,function(C,T){(!(oe.isUndefined(C)||C===null)&&i.call(t,C,oe.isString(T)?T.trim():T,S,b))===!0&&w(C,S?S.concat(T):[T])}),v.pop()}}if(!oe.isObject(e))throw new TypeError("data must be an object");return w(e),t}function Yb(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function Pg(e,t){this._pairs=[],e&&mf(e,this,t)}const PE=Pg.prototype;PE.append=function(t,r){this._pairs.push([t,r])};PE.toString=function(t){const r=t?function(o){return t.call(this,o,Yb)}:Yb;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function n3(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function UE(e,t,r){if(!t)return e;const o=r&&r.encode||n3;oe.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let l;if(i?l=i(t,r):l=oe.isURLSearchParams(t)?t.toString():new Pg(t,r).toString(o),l){const u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class Gb{constructor(){this.handlers=[]}use(t,r,o){return this.handlers.push({fulfilled:t,rejected:r,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){oe.forEach(this.handlers,function(o){o!==null&&t(o)})}}const BE={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},r3=typeof URLSearchParams<"u"?URLSearchParams:Pg,a3=typeof FormData<"u"?FormData:null,o3=typeof Blob<"u"?Blob:null,s3={isBrowser:!0,classes:{URLSearchParams:r3,FormData:a3,Blob:o3},protocols:["http","https","file","blob","url","data"]},Ug=typeof window<"u"&&typeof document<"u",Vp=typeof navigator=="object"&&navigator||void 0,i3=Ug&&(!Vp||["ReactNative","NativeScript","NS"].indexOf(Vp.product)<0),l3=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",c3=Ug&&window.location.href||"http://localhost",u3=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ug,hasStandardBrowserEnv:i3,hasStandardBrowserWebWorkerEnv:l3,navigator:Vp,origin:c3},Symbol.toStringTag,{value:"Module"})),Qt={...u3,...s3};function d3(e,t){return mf(e,new Qt.classes.URLSearchParams,Object.assign({visitor:function(r,o,i,l){return Qt.isNode&&oe.isBuffer(r)?(this.append(o,r.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)}},t))}function f3(e){return oe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function h3(e){const t={},r=Object.keys(e);let o;const i=r.length;let l;for(o=0;o<i;o++)l=r[o],t[l]=e[l];return t}function HE(e){function t(r,o,i,l){let u=r[l++];if(u==="__proto__")return!0;const f=Number.isFinite(+u),m=l>=r.length;return u=!u&&oe.isArray(i)?i.length:u,m?(oe.hasOwnProp(i,u)?i[u]=[i[u],o]:i[u]=o,!f):((!i[u]||!oe.isObject(i[u]))&&(i[u]=[]),t(r,o,i[u],l)&&oe.isArray(i[u])&&(i[u]=h3(i[u])),!f)}if(oe.isFormData(e)&&oe.isFunction(e.entries)){const r={};return oe.forEachEntry(e,(o,i)=>{t(f3(o),i,r,0)}),r}return null}function m3(e,t,r){if(oe.isString(e))try{return(t||JSON.parse)(e),oe.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(r||JSON.stringify)(e)}const dc={transitional:BE,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const o=r.getContentType()||"",i=o.indexOf("application/json")>-1,l=oe.isObject(t);if(l&&oe.isHTMLForm(t)&&(t=new FormData(t)),oe.isFormData(t))return i?JSON.stringify(HE(t)):t;if(oe.isArrayBuffer(t)||oe.isBuffer(t)||oe.isStream(t)||oe.isFile(t)||oe.isBlob(t)||oe.isReadableStream(t))return t;if(oe.isArrayBufferView(t))return t.buffer;if(oe.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let f;if(l){if(o.indexOf("application/x-www-form-urlencoded")>-1)return d3(t,this.formSerializer).toString();if((f=oe.isFileList(t))||o.indexOf("multipart/form-data")>-1){const m=this.env&&this.env.FormData;return mf(f?{"files[]":t}:t,m&&new m,this.formSerializer)}}return l||i?(r.setContentType("application/json",!1),m3(t)):t}],transformResponse:[function(t){const r=this.transitional||dc.transitional,o=r&&r.forcedJSONParsing,i=this.responseType==="json";if(oe.isResponse(t)||oe.isReadableStream(t))return t;if(t&&oe.isString(t)&&(o&&!this.responseType||i)){const u=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(f){if(u)throw f.name==="SyntaxError"?Oe.from(f,Oe.ERR_BAD_RESPONSE,this,null,this.response):f}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Qt.classes.FormData,Blob:Qt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};oe.forEach(["delete","get","head","post","put","patch"],e=>{dc.headers[e]={}});const p3=oe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),g3=e=>{const t={};let r,o,i;return e&&e.split(`
`).forEach(function(u){i=u.indexOf(":"),r=u.substring(0,i).trim().toLowerCase(),o=u.substring(i+1).trim(),!(!r||t[r]&&p3[r])&&(r==="set-cookie"?t[r]?t[r].push(o):t[r]=[o]:t[r]=t[r]?t[r]+", "+o:o)}),t},Fb=Symbol("internals");function wl(e){return e&&String(e).trim().toLowerCase()}function cd(e){return e===!1||e==null?e:oe.isArray(e)?e.map(cd):String(e)}function v3(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=r.exec(e);)t[o[1]]=o[2];return t}const y3=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function sp(e,t,r,o,i){if(oe.isFunction(o))return o.call(this,t,r);if(i&&(t=r),!!oe.isString(t)){if(oe.isString(o))return t.indexOf(o)!==-1;if(oe.isRegExp(o))return o.test(t)}}function x3(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,o)=>r.toUpperCase()+o)}function b3(e,t){const r=oe.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+r,{value:function(i,l,u){return this[o].call(this,t,i,l,u)},configurable:!0})})}let gn=class{constructor(t){t&&this.set(t)}set(t,r,o){const i=this;function l(f,m,h){const g=wl(m);if(!g)throw new Error("header name must be a non-empty string");const v=oe.findKey(i,g);(!v||i[v]===void 0||h===!0||h===void 0&&i[v]!==!1)&&(i[v||m]=cd(f))}const u=(f,m)=>oe.forEach(f,(h,g)=>l(h,g,m));if(oe.isPlainObject(t)||t instanceof this.constructor)u(t,r);else if(oe.isString(t)&&(t=t.trim())&&!y3(t))u(g3(t),r);else if(oe.isObject(t)&&oe.isIterable(t)){let f={},m,h;for(const g of t){if(!oe.isArray(g))throw TypeError("Object iterator must return a key-value pair");f[h=g[0]]=(m=f[h])?oe.isArray(m)?[...m,g[1]]:[m,g[1]]:g[1]}u(f,r)}else t!=null&&l(r,t,o);return this}get(t,r){if(t=wl(t),t){const o=oe.findKey(this,t);if(o){const i=this[o];if(!r)return i;if(r===!0)return v3(i);if(oe.isFunction(r))return r.call(this,i,o);if(oe.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=wl(t),t){const o=oe.findKey(this,t);return!!(o&&this[o]!==void 0&&(!r||sp(this,this[o],o,r)))}return!1}delete(t,r){const o=this;let i=!1;function l(u){if(u=wl(u),u){const f=oe.findKey(o,u);f&&(!r||sp(o,o[f],f,r))&&(delete o[f],i=!0)}}return oe.isArray(t)?t.forEach(l):l(t),i}clear(t){const r=Object.keys(this);let o=r.length,i=!1;for(;o--;){const l=r[o];(!t||sp(this,this[l],l,t,!0))&&(delete this[l],i=!0)}return i}normalize(t){const r=this,o={};return oe.forEach(this,(i,l)=>{const u=oe.findKey(o,l);if(u){r[u]=cd(i),delete r[l];return}const f=t?x3(l):String(l).trim();f!==l&&delete r[l],r[f]=cd(i),o[f]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return oe.forEach(this,(o,i)=>{o!=null&&o!==!1&&(r[i]=t&&oe.isArray(o)?o.join(", "):o)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const o=new this(t);return r.forEach(i=>o.set(i)),o}static accessor(t){const o=(this[Fb]=this[Fb]={accessors:{}}).accessors,i=this.prototype;function l(u){const f=wl(u);o[f]||(b3(i,u),o[f]=!0)}return oe.isArray(t)?t.forEach(l):l(t),this}};gn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);oe.reduceDescriptors(gn.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[r]=o}}});oe.freezeMethods(gn);function ip(e,t){const r=this||dc,o=t||r,i=gn.from(o.headers);let l=o.data;return oe.forEach(e,function(f){l=f.call(r,l,i.normalize(),t?t.status:void 0)}),i.normalize(),l}function $E(e){return!!(e&&e.__CANCEL__)}function yi(e,t,r){Oe.call(this,e??"canceled",Oe.ERR_CANCELED,t,r),this.name="CanceledError"}oe.inherits(yi,Oe,{__CANCEL__:!0});function IE(e,t,r){const o=r.config.validateStatus;!r.status||!o||o(r.status)?e(r):t(new Oe("Request failed with status code "+r.status,[Oe.ERR_BAD_REQUEST,Oe.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function w3(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function S3(e,t){e=e||10;const r=new Array(e),o=new Array(e);let i=0,l=0,u;return t=t!==void 0?t:1e3,function(m){const h=Date.now(),g=o[l];u||(u=h),r[i]=m,o[i]=h;let v=l,b=0;for(;v!==i;)b+=r[v++],v=v%e;if(i=(i+1)%e,i===l&&(l=(l+1)%e),h-u<t)return;const w=g&&h-g;return w?Math.round(b*1e3/w):void 0}}function E3(e,t){let r=0,o=1e3/t,i,l;const u=(h,g=Date.now())=>{r=g,i=null,l&&(clearTimeout(l),l=null),e.apply(null,h)};return[(...h)=>{const g=Date.now(),v=g-r;v>=o?u(h,g):(i=h,l||(l=setTimeout(()=>{l=null,u(i)},o-v)))},()=>i&&u(i)]}const jd=(e,t,r=3)=>{let o=0;const i=S3(50,250);return E3(l=>{const u=l.loaded,f=l.lengthComputable?l.total:void 0,m=u-o,h=i(m),g=u<=f;o=u;const v={loaded:u,total:f,progress:f?u/f:void 0,bytes:m,rate:h||void 0,estimated:h&&f&&g?(f-u)/h:void 0,event:l,lengthComputable:f!=null,[t?"download":"upload"]:!0};e(v)},r)},Xb=(e,t)=>{const r=e!=null;return[o=>t[0]({lengthComputable:r,total:e,loaded:o}),t[1]]},Wb=e=>(...t)=>oe.asap(()=>e(...t)),N3=Qt.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Qt.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Qt.origin),Qt.navigator&&/(msie|trident)/i.test(Qt.navigator.userAgent)):()=>!0,C3=Qt.hasStandardBrowserEnv?{write(e,t,r,o,i,l){const u=[e+"="+encodeURIComponent(t)];oe.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),oe.isString(o)&&u.push("path="+o),oe.isString(i)&&u.push("domain="+i),l===!0&&u.push("secure"),document.cookie=u.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function j3(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function _3(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function VE(e,t,r){let o=!j3(t);return e&&(o||r==!1)?_3(e,t):t}const Kb=e=>e instanceof gn?{...e}:e;function Wo(e,t){t=t||{};const r={};function o(h,g,v,b){return oe.isPlainObject(h)&&oe.isPlainObject(g)?oe.merge.call({caseless:b},h,g):oe.isPlainObject(g)?oe.merge({},g):oe.isArray(g)?g.slice():g}function i(h,g,v,b){if(oe.isUndefined(g)){if(!oe.isUndefined(h))return o(void 0,h,v,b)}else return o(h,g,v,b)}function l(h,g){if(!oe.isUndefined(g))return o(void 0,g)}function u(h,g){if(oe.isUndefined(g)){if(!oe.isUndefined(h))return o(void 0,h)}else return o(void 0,g)}function f(h,g,v){if(v in t)return o(h,g);if(v in e)return o(void 0,h)}const m={url:l,method:l,data:l,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:f,headers:(h,g,v)=>i(Kb(h),Kb(g),v,!0)};return oe.forEach(Object.keys(Object.assign({},e,t)),function(g){const v=m[g]||i,b=v(e[g],t[g],g);oe.isUndefined(b)&&v!==f||(r[g]=b)}),r}const qE=e=>{const t=Wo({},e);let{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:l,headers:u,auth:f}=t;t.headers=u=gn.from(u),t.url=UE(VE(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),f&&u.set("Authorization","Basic "+btoa((f.username||"")+":"+(f.password?unescape(encodeURIComponent(f.password)):"")));let m;if(oe.isFormData(r)){if(Qt.hasStandardBrowserEnv||Qt.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if((m=u.getContentType())!==!1){const[h,...g]=m?m.split(";").map(v=>v.trim()).filter(Boolean):[];u.setContentType([h||"multipart/form-data",...g].join("; "))}}if(Qt.hasStandardBrowserEnv&&(o&&oe.isFunction(o)&&(o=o(t)),o||o!==!1&&N3(t.url))){const h=i&&l&&C3.read(l);h&&u.set(i,h)}return t},A3=typeof XMLHttpRequest<"u",T3=A3&&function(e){return new Promise(function(r,o){const i=qE(e);let l=i.data;const u=gn.from(i.headers).normalize();let{responseType:f,onUploadProgress:m,onDownloadProgress:h}=i,g,v,b,w,E;function S(){w&&w(),E&&E(),i.cancelToken&&i.cancelToken.unsubscribe(g),i.signal&&i.signal.removeEventListener("abort",g)}let N=new XMLHttpRequest;N.open(i.method.toUpperCase(),i.url,!0),N.timeout=i.timeout;function C(){if(!N)return;const A=gn.from("getAllResponseHeaders"in N&&N.getAllResponseHeaders()),O={data:!f||f==="text"||f==="json"?N.responseText:N.response,status:N.status,statusText:N.statusText,headers:A,config:e,request:N};IE(function(B){r(B),S()},function(B){o(B),S()},O),N=null}"onloadend"in N?N.onloadend=C:N.onreadystatechange=function(){!N||N.readyState!==4||N.status===0&&!(N.responseURL&&N.responseURL.indexOf("file:")===0)||setTimeout(C)},N.onabort=function(){N&&(o(new Oe("Request aborted",Oe.ECONNABORTED,e,N)),N=null)},N.onerror=function(){o(new Oe("Network Error",Oe.ERR_NETWORK,e,N)),N=null},N.ontimeout=function(){let _=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const O=i.transitional||BE;i.timeoutErrorMessage&&(_=i.timeoutErrorMessage),o(new Oe(_,O.clarifyTimeoutError?Oe.ETIMEDOUT:Oe.ECONNABORTED,e,N)),N=null},l===void 0&&u.setContentType(null),"setRequestHeader"in N&&oe.forEach(u.toJSON(),function(_,O){N.setRequestHeader(O,_)}),oe.isUndefined(i.withCredentials)||(N.withCredentials=!!i.withCredentials),f&&f!=="json"&&(N.responseType=i.responseType),h&&([b,E]=jd(h,!0),N.addEventListener("progress",b)),m&&N.upload&&([v,w]=jd(m),N.upload.addEventListener("progress",v),N.upload.addEventListener("loadend",w)),(i.cancelToken||i.signal)&&(g=A=>{N&&(o(!A||A.type?new yi(null,e,N):A),N.abort(),N=null)},i.cancelToken&&i.cancelToken.subscribe(g),i.signal&&(i.signal.aborted?g():i.signal.addEventListener("abort",g)));const T=w3(i.url);if(T&&Qt.protocols.indexOf(T)===-1){o(new Oe("Unsupported protocol "+T+":",Oe.ERR_BAD_REQUEST,e));return}N.send(l||null)})},R3=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let o=new AbortController,i;const l=function(h){if(!i){i=!0,f();const g=h instanceof Error?h:this.reason;o.abort(g instanceof Oe?g:new yi(g instanceof Error?g.message:g))}};let u=t&&setTimeout(()=>{u=null,l(new Oe(`timeout ${t} of ms exceeded`,Oe.ETIMEDOUT))},t);const f=()=>{e&&(u&&clearTimeout(u),u=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(l):h.removeEventListener("abort",l)}),e=null)};e.forEach(h=>h.addEventListener("abort",l));const{signal:m}=o;return m.unsubscribe=()=>oe.asap(f),m}},M3=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let o=0,i;for(;o<r;)i=o+t,yield e.slice(o,i),o=i},D3=async function*(e,t){for await(const r of O3(e))yield*M3(r,t)},O3=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:o}=await t.read();if(r)break;yield o}}finally{await t.cancel()}},Zb=(e,t,r,o)=>{const i=D3(e,t);let l=0,u,f=m=>{u||(u=!0,o&&o(m))};return new ReadableStream({async pull(m){try{const{done:h,value:g}=await i.next();if(h){f(),m.close();return}let v=g.byteLength;if(r){let b=l+=v;r(b)}m.enqueue(new Uint8Array(g))}catch(h){throw f(h),h}},cancel(m){return f(m),i.return()}},{highWaterMark:2})},pf=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",YE=pf&&typeof ReadableStream=="function",k3=pf&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),GE=(e,...t)=>{try{return!!e(...t)}catch{return!1}},z3=YE&&GE(()=>{let e=!1;const t=new Request(Qt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Qb=64*1024,qp=YE&&GE(()=>oe.isReadableStream(new Response("").body)),_d={stream:qp&&(e=>e.body)};pf&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!_d[t]&&(_d[t]=oe.isFunction(e[t])?r=>r[t]():(r,o)=>{throw new Oe(`Response type '${t}' is not supported`,Oe.ERR_NOT_SUPPORT,o)})})})(new Response);const L3=async e=>{if(e==null)return 0;if(oe.isBlob(e))return e.size;if(oe.isSpecCompliantForm(e))return(await new Request(Qt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(oe.isArrayBufferView(e)||oe.isArrayBuffer(e))return e.byteLength;if(oe.isURLSearchParams(e)&&(e=e+""),oe.isString(e))return(await k3(e)).byteLength},P3=async(e,t)=>{const r=oe.toFiniteNumber(e.getContentLength());return r??L3(t)},U3=pf&&(async e=>{let{url:t,method:r,data:o,signal:i,cancelToken:l,timeout:u,onDownloadProgress:f,onUploadProgress:m,responseType:h,headers:g,withCredentials:v="same-origin",fetchOptions:b}=qE(e);h=h?(h+"").toLowerCase():"text";let w=R3([i,l&&l.toAbortSignal()],u),E;const S=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let N;try{if(m&&z3&&r!=="get"&&r!=="head"&&(N=await P3(g,o))!==0){let O=new Request(t,{method:"POST",body:o,duplex:"half"}),L;if(oe.isFormData(o)&&(L=O.headers.get("content-type"))&&g.setContentType(L),O.body){const[B,I]=Xb(N,jd(Wb(m)));o=Zb(O.body,Qb,B,I)}}oe.isString(v)||(v=v?"include":"omit");const C="credentials"in Request.prototype;E=new Request(t,{...b,signal:w,method:r.toUpperCase(),headers:g.normalize().toJSON(),body:o,duplex:"half",credentials:C?v:void 0});let T=await fetch(E);const A=qp&&(h==="stream"||h==="response");if(qp&&(f||A&&S)){const O={};["status","statusText","headers"].forEach(q=>{O[q]=T[q]});const L=oe.toFiniteNumber(T.headers.get("content-length")),[B,I]=f&&Xb(L,jd(Wb(f),!0))||[];T=new Response(Zb(T.body,Qb,B,()=>{I&&I(),S&&S()}),O)}h=h||"text";let _=await _d[oe.findKey(_d,h)||"text"](T,e);return!A&&S&&S(),await new Promise((O,L)=>{IE(O,L,{data:_,headers:gn.from(T.headers),status:T.status,statusText:T.statusText,config:e,request:E})})}catch(C){throw S&&S(),C&&C.name==="TypeError"&&/Load failed|fetch/i.test(C.message)?Object.assign(new Oe("Network Error",Oe.ERR_NETWORK,e,E),{cause:C.cause||C}):Oe.from(C,C&&C.code,e,E)}}),Yp={http:J4,xhr:T3,fetch:U3};oe.forEach(Yp,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Jb=e=>`- ${e}`,B3=e=>oe.isFunction(e)||e===null||e===!1,FE={getAdapter:e=>{e=oe.isArray(e)?e:[e];const{length:t}=e;let r,o;const i={};for(let l=0;l<t;l++){r=e[l];let u;if(o=r,!B3(r)&&(o=Yp[(u=String(r)).toLowerCase()],o===void 0))throw new Oe(`Unknown adapter '${u}'`);if(o)break;i[u||"#"+l]=o}if(!o){const l=Object.entries(i).map(([f,m])=>`adapter ${f} `+(m===!1?"is not supported by the environment":"is not available in the build"));let u=t?l.length>1?`since :
`+l.map(Jb).join(`
`):" "+Jb(l[0]):"as no adapter specified";throw new Oe("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return o},adapters:Yp};function lp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yi(null,e)}function ew(e){return lp(e),e.headers=gn.from(e.headers),e.data=ip.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),FE.getAdapter(e.adapter||dc.adapter)(e).then(function(o){return lp(e),o.data=ip.call(e,e.transformResponse,o),o.headers=gn.from(o.headers),o},function(o){return $E(o)||(lp(e),o&&o.response&&(o.response.data=ip.call(e,e.transformResponse,o.response),o.response.headers=gn.from(o.response.headers))),Promise.reject(o)})}const XE="1.9.0",gf={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{gf[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const tw={};gf.transitional=function(t,r,o){function i(l,u){return"[Axios v"+XE+"] Transitional option '"+l+"'"+u+(o?". "+o:"")}return(l,u,f)=>{if(t===!1)throw new Oe(i(u," has been removed"+(r?" in "+r:"")),Oe.ERR_DEPRECATED);return r&&!tw[u]&&(tw[u]=!0,console.warn(i(u," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(l,u,f):!0}};gf.spelling=function(t){return(r,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function H3(e,t,r){if(typeof e!="object")throw new Oe("options must be an object",Oe.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let i=o.length;for(;i-- >0;){const l=o[i],u=t[l];if(u){const f=e[l],m=f===void 0||u(f,l,e);if(m!==!0)throw new Oe("option "+l+" must be "+m,Oe.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Oe("Unknown option "+l,Oe.ERR_BAD_OPTION)}}const ud={assertOptions:H3,validators:gf},Sr=ud.validators;let Po=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Gb,response:new Gb}}async request(t,r){try{return await this._request(t,r)}catch(o){if(o instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const l=i.stack?i.stack.replace(/^.+\n/,""):"";try{o.stack?l&&!String(o.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(o.stack+=`
`+l):o.stack=l}catch{}}throw o}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Wo(this.defaults,r);const{transitional:o,paramsSerializer:i,headers:l}=r;o!==void 0&&ud.assertOptions(o,{silentJSONParsing:Sr.transitional(Sr.boolean),forcedJSONParsing:Sr.transitional(Sr.boolean),clarifyTimeoutError:Sr.transitional(Sr.boolean)},!1),i!=null&&(oe.isFunction(i)?r.paramsSerializer={serialize:i}:ud.assertOptions(i,{encode:Sr.function,serialize:Sr.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),ud.assertOptions(r,{baseUrl:Sr.spelling("baseURL"),withXsrfToken:Sr.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let u=l&&oe.merge(l.common,l[r.method]);l&&oe.forEach(["delete","get","head","post","put","patch","common"],E=>{delete l[E]}),r.headers=gn.concat(u,l);const f=[];let m=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(r)===!1||(m=m&&S.synchronous,f.unshift(S.fulfilled,S.rejected))});const h=[];this.interceptors.response.forEach(function(S){h.push(S.fulfilled,S.rejected)});let g,v=0,b;if(!m){const E=[ew.bind(this),void 0];for(E.unshift.apply(E,f),E.push.apply(E,h),b=E.length,g=Promise.resolve(r);v<b;)g=g.then(E[v++],E[v++]);return g}b=f.length;let w=r;for(v=0;v<b;){const E=f[v++],S=f[v++];try{w=E(w)}catch(N){S.call(this,N);break}}try{g=ew.call(this,w)}catch(E){return Promise.reject(E)}for(v=0,b=h.length;v<b;)g=g.then(h[v++],h[v++]);return g}getUri(t){t=Wo(this.defaults,t);const r=VE(t.baseURL,t.url,t.allowAbsoluteUrls);return UE(r,t.params,t.paramsSerializer)}};oe.forEach(["delete","get","head","options"],function(t){Po.prototype[t]=function(r,o){return this.request(Wo(o||{},{method:t,url:r,data:(o||{}).data}))}});oe.forEach(["post","put","patch"],function(t){function r(o){return function(l,u,f){return this.request(Wo(f||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:l,data:u}))}}Po.prototype[t]=r(),Po.prototype[t+"Form"]=r(!0)});let $3=class WE{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(l){r=l});const o=this;this.promise.then(i=>{if(!o._listeners)return;let l=o._listeners.length;for(;l-- >0;)o._listeners[l](i);o._listeners=null}),this.promise.then=i=>{let l;const u=new Promise(f=>{o.subscribe(f),l=f}).then(i);return u.cancel=function(){o.unsubscribe(l)},u},t(function(l,u,f){o.reason||(o.reason=new yi(l,u,f),r(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=o=>{t.abort(o)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new WE(function(i){t=i}),cancel:t}}};function I3(e){return function(r){return e.apply(null,r)}}function V3(e){return oe.isObject(e)&&e.isAxiosError===!0}const Gp={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Gp).forEach(([e,t])=>{Gp[t]=e});function KE(e){const t=new Po(e),r=jE(Po.prototype.request,t);return oe.extend(r,Po.prototype,t,{allOwnKeys:!0}),oe.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return KE(Wo(e,i))},r}const Qe=KE(dc);Qe.Axios=Po;Qe.CanceledError=yi;Qe.CancelToken=$3;Qe.isCancel=$E;Qe.VERSION=XE;Qe.toFormData=mf;Qe.AxiosError=Oe;Qe.Cancel=Qe.CanceledError;Qe.all=function(t){return Promise.all(t)};Qe.spread=I3;Qe.isAxiosError=V3;Qe.mergeConfig=Wo;Qe.AxiosHeaders=gn;Qe.formToJSON=e=>HE(oe.isHTMLForm(e)?new FormData(e):e);Qe.getAdapter=FE.getAdapter;Qe.HttpStatusCode=Gp;Qe.default=Qe;const{Axios:JI,AxiosError:e9,CanceledError:t9,isCancel:n9,CancelToken:r9,VERSION:a9,all:o9,Cancel:s9,isAxiosError:i9,spread:l9,toFormData:c9,AxiosHeaders:q3,HttpStatusCode:u9,formToJSON:d9,getAdapter:f9,mergeConfig:h9}=Qe;function Y3(e){return e.toLowerCase()}var G3=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],F3=/[^A-Z0-9]+/gi;function Bg(e,t){t===void 0&&(t={});for(var r=t.splitRegexp,o=r===void 0?G3:r,i=t.stripRegexp,l=i===void 0?F3:i,u=t.transform,f=u===void 0?Y3:u,m=t.delimiter,h=m===void 0?" ":m,g=nw(nw(e,o,"$1\0$2"),l,"\0"),v=0,b=g.length;g.charAt(v)==="\0";)v++;for(;g.charAt(b-1)==="\0";)b--;return g.slice(v,b).split("\0").map(f).join(h)}function nw(e,t,r){return t instanceof RegExp?e.replace(t,r):t.reduce(function(o,i){return o.replace(i,r)},e)}function ZE(e,t){var r=e.charAt(0),o=e.substr(1).toLowerCase();return t>0&&r>="0"&&r<="9"?"_"+r+o:""+r.toUpperCase()+o}function X3(e,t){return t===void 0&&(t={}),Bg(e,Tt({delimiter:"",transform:ZE},t))}function W3(e,t){return t===0?e.toLowerCase():ZE(e,t)}function K3(e,t){return t===void 0&&(t={}),X3(e,Tt({transform:W3},t))}function Z3(e,t){return t===void 0&&(t={}),Bg(e,Tt({delimiter:"."},t))}function Q3(e,t){return t===void 0&&(t={}),Z3(e,Tt({delimiter:"_"},t))}function J3(e){return e.charAt(0).toUpperCase()+e.substr(1)}function ez(e){return J3(e.toLowerCase())}function tz(e,t){return t===void 0&&(t={}),Bg(e,Tt({delimiter:" ",transform:ez},t))}function nz(e,t){return t===void 0&&(t={}),tz(e,Tt({delimiter:"-"},t))}var rz=function(e,t){return function(r,o){return e(r,Tt(Tt({},t),o))}},az=function(e,t){var r=typeof t=="function"?t:function(o){return t.includes(o)};return function(o,i){return r(o,i)?o:e(o,i)}},dd=function(e){return typeof URLSearchParams<"u"&&e instanceof URLSearchParams},Ws=function(e){return typeof FormData<"u"&&e instanceof FormData},QE=function(e){if(e==null)return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype},oz=function(e){return Array.isArray(e)||QE(e)||Ws(e)||dd(e)},rw=function(e){return e==null?!1:e instanceof q3},JE={snake:Q3,camel:K3,header:nz},eN=function(e,t,r){var o,i,l,u,f,m;if(!oz(e))return e;if((Ws(e)||dd(e))&&(!e.entries||r&&!e.delete)){var h=Ws(e)?"FormData":"URLSearchParams",g=Ws(e)?"https://github.com/jimmywarting/FormData":"https://github.com/jerrybendy/url-search-params-polyfill";return typeof navigator<"u"&&navigator.product==="ReactNative"?console.warn("Be careful that ".concat(h," cannot be transformed on React Native. If you intentionally implemented, ignore this kind of warning: https://facebook.github.io/react-native/docs/debugging.html")):(e.entries||console.warn("You must use polyfill of ".concat(h,".prototype.entries() on Internet Explorer or Safari: ").concat(g)),r&&!e.delete&&console.warn("You must use polyfill of ".concat(h,".prototype.delete() on Internet Explorer or Safari: ").concat(g))),e}var v=Object.getPrototypeOf(e),b=r?e:v?new v.constructor:Object.create(null),w;if(Ws(e)||dd(e)){if(w=e.entries(),r){w=Ll([],Oo(w),!1);try{for(var E=zl(w),S=E.next();!S.done;S=E.next()){var N=Oo(S.value,1),C=N[0];e.delete(C)}}catch(q){o={error:q}}finally{try{S&&!S.done&&(i=E.return)&&i.call(E)}finally{if(o)throw o.error}}}}else if(w=Object.entries(e),r&&!Array.isArray(e))try{for(var T=zl(w),A=T.next();!A.done;A=T.next()){var _=Oo(A.value,1),C=_[0];delete e[C]}}catch(q){l={error:q}}finally{try{A&&!A.done&&(u=T.return)&&u.call(T)}finally{if(l)throw l.error}}try{for(var O=zl(w),L=O.next();!L.done;L=O.next()){var B=Oo(L.value,2),C=B[0],I=B[1];Ws(b)||dd(b)?b.append(t(C),I):C!=="__proto__"&&(b[Array.isArray(e)?Number(C):t("".concat(C))]=eN(I,t,r))}}catch(q){f={error:q}}finally{try{L&&!L.done&&(m=O.return)&&m.call(O)}finally{if(f)throw f.error}}return b},sz=function(e,t,r){return t=rz(t,Tt({stripRegexp:/[^A-Z0-9[\]]+/gi},r==null?void 0:r.caseOptions)),r!=null&&r.preservedKeys&&(t=az(t,r.preservedKeys)),eN(e,t,(r==null?void 0:r.overwrite)||!1)},iz=function(e){return function(t,r){return sz(t,e,r)}},lz=function(e,t){return iz(JE[e])},Hg=function(e){var t,r,o=Object.keys(JE),i={};try{for(var l=zl(o),u=l.next();!u.done;u=l.next()){var f=u.value;i[f]=lz(f,e)}}catch(m){t={error:m}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return i},cz=function(e){var t=Hg(void 0).snake;return function(r){return r.params&&(r.params=t(r.params,e)),r}},uz=function(e){var t=Hg(void 0),r=t.snake,o=t.header;return function(i,l){return tN(l,o,e,["common","delete","get","head","post","put","patch"]),r(i,e)}},dz=function(e){var t=Hg(void 0).camel;return function(r,o){return tN(o,t,e),t(r,e)}},tN=function(e,t,r,o){var i,l,u,f;if(!(!QE(e)&&!rw(e)))try{for(var m=zl(Object.entries(e)),h=m.next();!h.done;h=m.next()){var g=Oo(h.value,2),v=g[0],b=g[1];t(b,Tt({overwrite:!0},r)),!(o||[]).includes(v)&&(rw(e)?(e.delete(v),e.set(Object.keys(t((u={},u[v]=null,u),r))[0],b,!0)):(delete e[v],e[Object.keys(t((f={},f[v]=null,f),r))[0]]=b))}}catch(w){i={error:w}}finally{try{h&&!h.done&&(l=m.return)&&l.call(m)}finally{if(i)throw i.error}}},Gn=function(e,t){var r,o,i;return e.defaults.transformRequest=Ll([((r=void 0)===null||r===void 0?void 0:r.requestTransformer)||uz(t)],Oo(Array.isArray(e.defaults.transformRequest)?e.defaults.transformRequest:e.defaults.transformRequest!==void 0?[e.defaults.transformRequest]:[]),!1),e.defaults.transformResponse=Ll(Ll([],Oo(Array.isArray(e.defaults.transformResponse)?e.defaults.transformResponse:e.defaults.transformResponse!==void 0?[e.defaults.transformResponse]:[]),!1),[((o=void 0)===null||o===void 0?void 0:o.responseTransformer)||dz(t)],!1),e.interceptors.request.use(((i=void 0)===null||i===void 0?void 0:i.requestInterceptor)||cz(t)),e};class Rl extends Error{}Rl.prototype.name="InvalidTokenError";function fz(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,r)=>{let o=r.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}function hz(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return fz(t)}catch{return atob(t)}}function mz(e,t){if(typeof e!="string")throw new Rl("Invalid token specified: must be a string");t||(t={});const r=t.header===!0?0:1,o=e.split(".")[r];if(typeof o!="string")throw new Rl(`Invalid token specified: missing part #${r+1}`);let i;try{i=hz(o)}catch(l){throw new Rl(`Invalid token specified: invalid base64 for part #${r+1} (${l.message})`)}try{return JSON.parse(i)}catch(l){throw new Rl(`Invalid token specified: invalid json for part #${r+1} (${l.message})`)}}const pz="http://localhost:8000/api",gz=e=>{localStorage.setItem("auth_token",e)},Tn=()=>typeof window<"u"?localStorage.getItem("auth_token"):null,vz=()=>{localStorage.removeItem("auth_token")},yz=async(e,t,r)=>{const i=await fetch(`${pz}/auth/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,email:t,password:r,role:"operator"})});if(!i.ok){const l=await i.json();throw new Error(l.message||"Registration failed")}return await i.json()},xz=async(e,t)=>{const r=new FormData,o="http://localhost:8000/api",i=Gn(Qe.create());r.append("username",e),r.append("password",t);const l=await fetch(`${o}/auth/jwt/login`,{method:"POST",body:r});if(!l.ok){const m=await l.json();throw new Error(m.message||"Login failed")}const u=await l.json(),{data:f}=await i.get(`${o}/users/me`,{headers:{Authorization:`Bearer ${u.access_token}`}});return localStorage.setItem("user",JSON.stringify(f)),console.log(u),console.log(f),gz(u.access_token),u};function bz(){const[e,t]=x.useState([]),[r,o]=x.useState(""),i="http://localhost:8000/api",l=Tn(),u=Gn(Qe.create());x.useEffect(()=>{(async()=>{const{data:g}=await u.get(`${i}/users`,{headers:{Authorization:`Bearer ${l}`}});t(g)})()},[]),x.useEffect(()=>{e.length>0&&localStorage.setItem("users",JSON.stringify(e))},[e]);const f=async(h,g)=>{await u.patch(`${i}/users/${h}`,{role:g},{headers:{Authorization:`Bearer ${l}`}}),t(e.map(v=>v.id===h?{...v,role:g}:v))},m=e.filter(h=>h.name.toLowerCase().includes(r.toLowerCase())||h.email.toLowerCase().includes(r.toLowerCase()));return d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"flex items-center justify-between",children:d.jsxs("div",{className:"relative w-64",children:[d.jsx(es,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),d.jsx(We,{placeholder:"Search users...",className:"pl-8",value:r,onChange:h=>o(h.target.value)})]})}),d.jsx("div",{className:"rounded-md border",children:d.jsxs(Qa,{children:[d.jsx(Ja,{children:d.jsxs(yt,{children:[d.jsx(Ue,{children:"Name"}),d.jsx(Ue,{children:"Email"}),d.jsx(Ue,{children:"Role"})]})}),d.jsx(eo,{children:m.length>0?m.map(h=>d.jsxs(yt,{children:[d.jsx(De,{className:"font-medium",children:h.name}),d.jsx(De,{children:h.email}),h.isSuperuser?d.jsx(De,{className:"text-orange-600",children:"Superuser"}):d.jsx(De,{children:d.jsxs(rr,{value:h.role,onValueChange:g=>f(h.id,g),children:[d.jsx(or,{className:"w-[130px]",children:d.jsx(ar,{placeholder:"Select role"})}),d.jsxs(sr,{children:[d.jsx(ct,{value:"operator",className:"text-fuchsia-600",children:"Operator"}),d.jsx(ct,{value:"admin",className:"text-blue-600",children:"Admin"})]})]})})]},h.id)):d.jsx(yt,{children:d.jsx(De,{colSpan:4,className:"text-center py-4",children:"No users found"})})})]})})]})}const aw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ow=WS,$g=(e,t)=>r=>{var o;if((t==null?void 0:t.variants)==null)return ow(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:l}=t,u=Object.keys(i).map(h=>{const g=r==null?void 0:r[h],v=l==null?void 0:l[h];if(g===null)return null;const b=aw(g)||aw(v);return i[h][b]}),f=r&&Object.entries(r).reduce((h,g)=>{let[v,b]=g;return b===void 0||(h[v]=b),h},{}),m=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((h,g)=>{let{class:v,className:b,...w}=g;return Object.entries(w).every(E=>{let[S,N]=E;return Array.isArray(N)?N.includes({...l,...f}[S]):{...l,...f}[S]===N})?[...h,v,b]:h},[]);return ow(e,u,m,r==null?void 0:r.class,r==null?void 0:r.className)},wz=$g("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Ne({className:e,variant:t,size:r,asChild:o=!1,...i}){const l=o?TS:"button";return d.jsx(l,{"data-slot":"button",className:Me(wz({variant:t,size:r,className:e})),...i})}var vf="Dialog",[nN,m9]=fr(vf),[Sz,mr]=nN(vf),rN=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:i,onOpenChange:l,modal:u=!0}=e,f=x.useRef(null),m=x.useRef(null),[h,g]=$o({prop:o,defaultProp:i??!1,onChange:l,caller:vf});return d.jsx(Sz,{scope:t,triggerRef:f,contentRef:m,contentId:Er(),titleId:Er(),descriptionId:Er(),open:h,onOpenChange:g,onOpenToggle:x.useCallback(()=>g(v=>!v),[g]),modal:u,children:r})};rN.displayName=vf;var aN="DialogTrigger",oN=x.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,i=mr(aN,r),l=Ye(t,i.triggerRef);return d.jsx(Ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":qg(i.open),...o,ref:l,onClick:ve(e.onClick,i.onOpenToggle)})});oN.displayName=aN;var Ig="DialogPortal",[Ez,sN]=nN(Ig,{forceMount:void 0}),iN=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:i}=e,l=mr(Ig,t);return d.jsx(Ez,{scope:t,forceMount:r,children:x.Children.map(o,u=>d.jsx(vn,{present:r||l.open,children:d.jsx(rf,{asChild:!0,container:i,children:u})}))})};iN.displayName=Ig;var Ad="DialogOverlay",lN=x.forwardRef((e,t)=>{const r=sN(Ad,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,l=mr(Ad,e.__scopeDialog);return l.modal?d.jsx(vn,{present:o||l.open,children:d.jsx(Cz,{...i,ref:t})}):null});lN.displayName=Ad;var Nz=Ho("DialogOverlay.RemoveScroll"),Cz=x.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,i=mr(Ad,r);return d.jsx(of,{as:Nz,allowPinchZoom:!0,shards:[i.contentRef],children:d.jsx(Ae.div,{"data-state":qg(i.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Ko="DialogContent",cN=x.forwardRef((e,t)=>{const r=sN(Ko,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,l=mr(Ko,e.__scopeDialog);return d.jsx(vn,{present:o||l.open,children:l.modal?d.jsx(jz,{...i,ref:t}):d.jsx(_z,{...i,ref:t})})});cN.displayName=Ko;var jz=x.forwardRef((e,t)=>{const r=mr(Ko,e.__scopeDialog),o=x.useRef(null),i=Ye(t,r.contentRef,o);return x.useEffect(()=>{const l=o.current;if(l)return Og(l)},[]),d.jsx(uN,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ve(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:ve(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&l.preventDefault()}),onFocusOutside:ve(e.onFocusOutside,l=>l.preventDefault())})}),_z=x.forwardRef((e,t)=>{const r=mr(Ko,e.__scopeDialog),o=x.useRef(!1),i=x.useRef(!1);return d.jsx(uN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var u,f;(u=e.onCloseAutoFocus)==null||u.call(e,l),l.defaultPrevented||(o.current||(f=r.triggerRef.current)==null||f.focus(),l.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:l=>{var m,h;(m=e.onInteractOutside)==null||m.call(e,l),l.defaultPrevented||(o.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=l.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})}),uN=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:l,...u}=e,f=mr(Ko,r),m=x.useRef(null),h=Ye(t,m);return Eg(),d.jsxs(d.Fragment,{children:[d.jsx(Qd,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:l,children:d.jsx(Zd,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":qg(f.open),...u,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(Az,{titleId:f.titleId}),d.jsx(Rz,{contentRef:m,descriptionId:f.descriptionId})]})]})}),Vg="DialogTitle",dN=x.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,i=mr(Vg,r);return d.jsx(Ae.h2,{id:i.titleId,...o,ref:t})});dN.displayName=Vg;var fN="DialogDescription",hN=x.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,i=mr(fN,r);return d.jsx(Ae.p,{id:i.descriptionId,...o,ref:t})});hN.displayName=fN;var mN="DialogClose",pN=x.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,i=mr(mN,r);return d.jsx(Ae.button,{type:"button",...o,ref:t,onClick:ve(e.onClick,()=>i.onOpenChange(!1))})});pN.displayName=mN;function qg(e){return e?"open":"closed"}var gN="DialogTitleWarning",[p9,vN]=nR(gN,{contentName:Ko,titleName:Vg,docsSlug:"dialog"}),Az=({titleId:e})=>{const t=vN(gN),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Tz="DialogDescriptionWarning",Rz=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${vN(Tz).contentName}}.`;return x.useEffect(()=>{var l;const i=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},yN=rN,xN=oN,bN=iN,wN=lN,SN=cN,Mz=dN,Dz=hN,Yg=pN;function aa({...e}){return d.jsx(yN,{"data-slot":"dialog",...e})}function ro({...e}){return d.jsx(xN,{"data-slot":"dialog-trigger",...e})}function Oz({...e}){return d.jsx(bN,{"data-slot":"dialog-portal",...e})}function Yu({...e}){return d.jsx(Yg,{"data-slot":"dialog-close",...e})}function kz({className:e,...t}){return d.jsx(wN,{"data-slot":"dialog-overlay",className:Me("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function oa({className:e,children:t,...r}){return d.jsxs(Oz,{"data-slot":"dialog-portal",children:[d.jsx(kz,{}),d.jsxs(SN,{"data-slot":"dialog-content",className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,d.jsxs(Yg,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[d.jsx(NE,{}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function sa({className:e,...t}){return d.jsx("div",{"data-slot":"dialog-header",className:Me("flex flex-col gap-2 text-center sm:text-left",e),...t})}function ao({className:e,...t}){return d.jsx("div",{"data-slot":"dialog-footer",className:Me("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function ia({className:e,...t}){return d.jsx(Mz,{"data-slot":"dialog-title",className:Me("text-lg leading-none font-semibold",e),...t})}function Zo({className:e,...t}){return d.jsx(Dz,{"data-slot":"dialog-description",className:Me("text-muted-foreground text-sm",e),...t})}var zz="Label",EN=x.forwardRef((e,t)=>d.jsx(Ae.label,{...e,ref:t,onMouseDown:r=>{var i;r.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));EN.displayName=zz;var Lz=EN;function Xe({className:e,...t}){return d.jsx(Lz,{"data-slot":"label",className:Me("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var yf="Checkbox",[Pz,g9]=fr(yf),[Uz,Gg]=Pz(yf);function Bz(e){const{__scopeCheckbox:t,checked:r,children:o,defaultChecked:i,disabled:l,form:u,name:f,onCheckedChange:m,required:h,value:g="on",internal_do_not_use_render:v}=e,[b,w]=$o({prop:r,defaultProp:i??!1,onChange:m,caller:yf}),[E,S]=x.useState(null),[N,C]=x.useState(null),T=x.useRef(!1),A=E?!!u||!!E.closest("form"):!0,_={checked:b,disabled:l,setChecked:w,control:E,setControl:S,name:f,form:u,value:g,hasConsumerStoppedPropagationRef:T,required:h,defaultChecked:Ka(i)?!1:i,isFormControl:A,bubbleInput:N,setBubbleInput:C};return d.jsx(Uz,{scope:t,..._,children:Hz(v)?v(_):o})}var NN="CheckboxTrigger",CN=x.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...o},i)=>{const{control:l,value:u,disabled:f,checked:m,required:h,setControl:g,setChecked:v,hasConsumerStoppedPropagationRef:b,isFormControl:w,bubbleInput:E}=Gg(NN,e),S=Ye(i,g),N=x.useRef(m);return x.useEffect(()=>{const C=l==null?void 0:l.form;if(C){const T=()=>v(N.current);return C.addEventListener("reset",T),()=>C.removeEventListener("reset",T)}},[l,v]),d.jsx(Ae.button,{type:"button",role:"checkbox","aria-checked":Ka(m)?"mixed":m,"aria-required":h,"data-state":MN(m),"data-disabled":f?"":void 0,disabled:f,value:u,...o,ref:S,onKeyDown:ve(t,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:ve(r,C=>{v(T=>Ka(T)?!0:!T),E&&w&&(b.current=C.isPropagationStopped(),b.current||C.stopPropagation())})})});CN.displayName=NN;var jN=x.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:o,checked:i,defaultChecked:l,required:u,disabled:f,value:m,onCheckedChange:h,form:g,...v}=e;return d.jsx(Bz,{__scopeCheckbox:r,checked:i,defaultChecked:l,disabled:f,required:u,onCheckedChange:h,name:o,form:g,value:m,internal_do_not_use_render:({isFormControl:b})=>d.jsxs(d.Fragment,{children:[d.jsx(CN,{...v,ref:t,__scopeCheckbox:r}),b&&d.jsx(RN,{__scopeCheckbox:r})]})})});jN.displayName=yf;var _N="CheckboxIndicator",AN=x.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:o,...i}=e,l=Gg(_N,r);return d.jsx(vn,{present:o||Ka(l.checked)||l.checked===!0,children:d.jsx(Ae.span,{"data-state":MN(l.checked),"data-disabled":l.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});AN.displayName=_N;var TN="CheckboxBubbleInput",RN=x.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:o,hasConsumerStoppedPropagationRef:i,checked:l,defaultChecked:u,required:f,disabled:m,name:h,value:g,form:v,bubbleInput:b,setBubbleInput:w}=Gg(TN,e),E=Ye(r,w),S=k1(l),N=b1(o);x.useEffect(()=>{const T=b;if(!T)return;const A=window.HTMLInputElement.prototype,O=Object.getOwnPropertyDescriptor(A,"checked").set,L=!i.current;if(S!==l&&O){const B=new Event("click",{bubbles:L});T.indeterminate=Ka(l),O.call(T,Ka(l)?!1:l),T.dispatchEvent(B)}},[b,S,l,i]);const C=x.useRef(Ka(l)?!1:l);return d.jsx(Ae.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??C.current,required:f,disabled:m,name:h,value:g,form:v,...t,tabIndex:-1,ref:E,style:{...t.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});RN.displayName=TN;function Hz(e){return typeof e=="function"}function Ka(e){return e==="indeterminate"}function MN(e){return Ka(e)?"indeterminate":e?"checked":"unchecked"}function $z({className:e,...t}){return d.jsx(jN,{"data-slot":"checkbox",className:Me("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:d.jsx(AN,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:d.jsx(vE,{className:"size-3.5"})})})}function Iz(){const[e,t]=x.useState([]),[r,o]=x.useState([]),[i,l]=x.useState(""),[u,f]=x.useState({groupId:"",description:""}),[m,h]=x.useState(null),[g,v]=x.useState([]),b="http://localhost:8000/api",w=Tn(),E=Gn(Qe.create());x.useEffect(()=>{(async()=>{const{data:B}=await E.get(`${b}/groups`,{headers:{Authorization:`Bearer ${w}`}});t(B)})();const L=localStorage.getItem("users");L&&o(JSON.parse(L))},[]),x.useEffect(()=>{e.length>0&&localStorage.setItem("groups",JSON.stringify(e))},[e]);const S=async()=>{const{data:O}=await E.post(`${b}/groups`,u,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${w}`}});console.log(O),t([...e,O]),f({groupId:"",description:""})},N=async O=>{await E.delete(`${b}/groups/${O}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${w}`}}),t(e.filter(L=>L.groupId!==O))},C=O=>{h(O),v([...O.members])},T=async()=>{if(m){const{data:O}=await E.post(`${b}/groups/${m.groupId}/users`,{users:g},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${w}`}}),L=O.members;t(e.map(B=>B.groupId===m.groupId?{...B,members:L}:B)),console.log("Groups are:"),console.log(e),h(null)}},A=O=>{g.includes(O)?v(g.filter(L=>L!==O)):v([...g,O])};console.log(e);const _=e.filter(O=>O.groupId.toLowerCase().includes(i.toLowerCase())||O.description.toLowerCase().includes(i.toLowerCase()));return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"relative w-64",children:[d.jsx(es,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),d.jsx(We,{placeholder:"Search groups...",className:"pl-8",value:i,onChange:O=>l(O.target.value)})]}),d.jsxs(aa,{children:[d.jsx(ro,{asChild:!0,children:d.jsxs(Ne,{children:[d.jsx(xk,{className:"mr-2 h-4 w-4"}),"Create Group"]})}),d.jsxs(oa,{children:[d.jsx(sa,{children:d.jsx(ia,{children:"Create New Group"})}),d.jsxs("div",{className:"grid gap-4 py-4",children:[d.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[d.jsx(Xe,{htmlFor:"name",className:"text-right",children:"Group ID"}),d.jsx(We,{id:"name",value:u.groupId,onChange:O=>f({...u,groupId:O.target.value}),className:"col-span-3"})]}),d.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[d.jsx(Xe,{htmlFor:"description",className:"text-right",children:"Description"}),d.jsx(We,{id:"description",value:u.description,onChange:O=>f({...u,description:O.target.value}),className:"col-span-3"})]})]}),d.jsxs(ao,{children:[d.jsx(Yu,{asChild:!0,children:d.jsx(Ne,{type:"button",variant:"outline",children:"Cancel"})}),d.jsx(Yu,{asChild:!0,children:d.jsx(Ne,{type:"button",onClick:S,children:"Create"})})]})]})]})]}),d.jsx("div",{className:"rounded-md border",children:d.jsxs(Qa,{children:[d.jsx(Ja,{children:d.jsxs(yt,{children:[d.jsx(Ue,{children:"Group ID"}),d.jsx(Ue,{children:"Description"}),d.jsx(Ue,{children:"Members"}),d.jsx(Ue,{className:"w-[150px]",children:"Actions"})]})}),d.jsx(eo,{children:_.length>0?_.map(O=>d.jsxs(yt,{children:[d.jsx(De,{className:"font-medium",children:O.groupId}),d.jsx(De,{children:O.description}),d.jsx(De,{children:O.members.length}),d.jsx(De,{children:d.jsxs("div",{className:"flex space-x-2",children:[d.jsxs(aa,{children:[d.jsx(ro,{asChild:!0,children:d.jsxs(Ne,{variant:"outline",size:"sm",onClick:()=>C(O),children:[d.jsx(cc,{className:"h-4 w-4 mr-1"}),"Members"]})}),d.jsxs(oa,{className:"max-w-md",children:[d.jsx(sa,{children:d.jsx(ia,{children:"Manage Group Members"})}),d.jsx("div",{className:"py-4",children:d.jsxs(Et,{children:[d.jsxs(fn,{children:[d.jsx(hn,{children:"Users"}),d.jsx(qo,{children:"Select users to add to this group"})]}),d.jsx(Nt,{children:d.jsx("div",{className:"max-h-[300px] overflow-y-auto space-y-2",children:r.map(L=>d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx($z,{id:`user-${L.id}`,checked:g.includes(L.id),onCheckedChange:()=>A(L.id)}),d.jsxs(Xe,{htmlFor:`user-${L.id}`,children:[L.name," (",L.email,")"]})]},L.id))})})]})}),d.jsxs(ao,{children:[d.jsx(Yu,{asChild:!0,children:d.jsx(Ne,{type:"button",variant:"outline",children:"Cancel"})}),d.jsx(Yu,{asChild:!0,children:d.jsx(Ne,{type:"button",onClick:T,children:"Save"})})]})]})]}),d.jsx(Ne,{variant:"ghost",size:"sm",onClick:()=>N(O.groupId),children:d.jsx(Xo,{className:"h-4 w-4 text-red-500"})})]})})]},O.groupId)):d.jsx(yt,{children:d.jsx(De,{colSpan:4,className:"text-center py-4",children:"No groups found"})})})]})})]})}var Fp=["Enter"," "],Vz=["ArrowDown","PageUp","Home"],DN=["ArrowUp","PageDown","End"],qz=[...Vz,...DN],Yz={ltr:[...Fp,"ArrowRight"],rtl:[...Fp,"ArrowLeft"]},Gz={ltr:["ArrowLeft"],rtl:["ArrowRight"]},fc="Menu",[Vl,Fz,Xz]=bg(fc),[ts,ON]=fr(fc,[Xz,nf,Fd]),xf=nf(),kN=Fd(),[Wz,ns]=ts(fc),[Kz,hc]=ts(fc),zN=e=>{const{__scopeMenu:t,open:r=!1,children:o,dir:i,onOpenChange:l,modal:u=!0}=e,f=xf(t),[m,h]=x.useState(null),g=x.useRef(!1),v=$t(l),b=oc(i);return x.useEffect(()=>{const w=()=>{g.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>g.current=!1;return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),d.jsx(R1,{...f,children:d.jsx(Wz,{scope:t,open:r,onOpenChange:v,content:m,onContentChange:h,children:d.jsx(Kz,{scope:t,onClose:x.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:g,dir:b,modal:u,children:o})})})};zN.displayName=fc;var Zz="MenuAnchor",Fg=x.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e,i=xf(r);return d.jsx(M1,{...i,...o,ref:t})});Fg.displayName=Zz;var Xg="MenuPortal",[Qz,LN]=ts(Xg,{forceMount:void 0}),PN=e=>{const{__scopeMenu:t,forceMount:r,children:o,container:i}=e,l=ns(Xg,t);return d.jsx(Qz,{scope:t,forceMount:r,children:d.jsx(vn,{present:r||l.open,children:d.jsx(rf,{asChild:!0,container:i,children:o})})})};PN.displayName=Xg;var qn="MenuContent",[Jz,Wg]=ts(qn),UN=x.forwardRef((e,t)=>{const r=LN(qn,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,l=ns(qn,e.__scopeMenu),u=hc(qn,e.__scopeMenu);return d.jsx(Vl.Provider,{scope:e.__scopeMenu,children:d.jsx(vn,{present:o||l.open,children:d.jsx(Vl.Slot,{scope:e.__scopeMenu,children:u.modal?d.jsx(eL,{...i,ref:t}):d.jsx(tL,{...i,ref:t})})})})}),eL=x.forwardRef((e,t)=>{const r=ns(qn,e.__scopeMenu),o=x.useRef(null),i=Ye(t,o);return x.useEffect(()=>{const l=o.current;if(l)return Og(l)},[]),d.jsx(Kg,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ve(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),tL=x.forwardRef((e,t)=>{const r=ns(qn,e.__scopeMenu);return d.jsx(Kg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),nL=Ho("MenuContent.ScrollLock"),Kg=x.forwardRef((e,t)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:f,onEntryFocus:m,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:b,onDismiss:w,disableOutsideScroll:E,...S}=e,N=ns(qn,r),C=hc(qn,r),T=xf(r),A=kN(r),_=Fz(r),[O,L]=x.useState(null),B=x.useRef(null),I=Ye(t,B,N.onContentChange),q=x.useRef(0),Q=x.useRef(""),te=x.useRef(0),P=x.useRef(null),W=x.useRef("right"),k=x.useRef(0),Y=E?of:x.Fragment,M=E?{as:nL,allowPinchZoom:!0}:void 0,$=z=>{var ie,me;const R=Q.current+z,V=_().filter(pe=>!pe.disabled),F=document.activeElement,K=(ie=V.find(pe=>pe.ref.current===F))==null?void 0:ie.textValue,re=V.map(pe=>pe.textValue),de=mL(re,R,K),se=(me=V.find(pe=>pe.textValue===de))==null?void 0:me.ref.current;(function pe(ge){Q.current=ge,window.clearTimeout(q.current),ge!==""&&(q.current=window.setTimeout(()=>pe(""),1e3))})(R),se&&setTimeout(()=>se.focus())};x.useEffect(()=>()=>window.clearTimeout(q.current),[]),Eg();const U=x.useCallback(z=>{var V,F;return W.current===((V=P.current)==null?void 0:V.side)&&gL(z,(F=P.current)==null?void 0:F.area)},[]);return d.jsx(Jz,{scope:r,searchRef:Q,onItemEnter:x.useCallback(z=>{U(z)&&z.preventDefault()},[U]),onItemLeave:x.useCallback(z=>{var R;U(z)||((R=B.current)==null||R.focus(),L(null))},[U]),onTriggerLeave:x.useCallback(z=>{U(z)&&z.preventDefault()},[U]),pointerGraceTimerRef:te,onPointerGraceIntentChange:x.useCallback(z=>{P.current=z},[]),children:d.jsx(Y,{...M,children:d.jsx(Qd,{asChild:!0,trapped:i,onMountAutoFocus:ve(l,z=>{var R;z.preventDefault(),(R=B.current)==null||R.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:d.jsx(Zd,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:b,onDismiss:w,children:d.jsx(LS,{asChild:!0,...A,dir:C.dir,orientation:"vertical",loop:o,currentTabStopId:O,onCurrentTabStopIdChange:L,onEntryFocus:ve(m,z=>{C.isUsingKeyboardRef.current||z.preventDefault()}),preventScrollOnEntryFocus:!0,children:d.jsx(D1,{role:"menu","aria-orientation":"vertical","data-state":eC(N.open),"data-radix-menu-content":"",dir:C.dir,...T,...S,ref:I,style:{outline:"none",...S.style},onKeyDown:ve(S.onKeyDown,z=>{const V=z.target.closest("[data-radix-menu-content]")===z.currentTarget,F=z.ctrlKey||z.altKey||z.metaKey,K=z.key.length===1;V&&(z.key==="Tab"&&z.preventDefault(),!F&&K&&$(z.key));const re=B.current;if(z.target!==re||!qz.includes(z.key))return;z.preventDefault();const se=_().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);DN.includes(z.key)&&se.reverse(),fL(se)}),onBlur:ve(e.onBlur,z=>{z.currentTarget.contains(z.target)||(window.clearTimeout(q.current),Q.current="")}),onPointerMove:ve(e.onPointerMove,ql(z=>{const R=z.target,V=k.current!==z.clientX;if(z.currentTarget.contains(R)&&V){const F=z.clientX>k.current?"right":"left";W.current=F,k.current=z.clientX}}))})})})})})})});UN.displayName=qn;var rL="MenuGroup",Zg=x.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return d.jsx(Ae.div,{role:"group",...o,ref:t})});Zg.displayName=rL;var aL="MenuLabel",BN=x.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return d.jsx(Ae.div,{...o,ref:t})});BN.displayName=aL;var Td="MenuItem",sw="menu.itemSelect",bf=x.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:o,...i}=e,l=x.useRef(null),u=hc(Td,e.__scopeMenu),f=Wg(Td,e.__scopeMenu),m=Ye(t,l),h=x.useRef(!1),g=()=>{const v=l.current;if(!r&&v){const b=new CustomEvent(sw,{bubbles:!0,cancelable:!0});v.addEventListener(sw,w=>o==null?void 0:o(w),{once:!0}),RS(v,b),b.defaultPrevented?h.current=!1:u.onClose()}};return d.jsx(HN,{...i,ref:m,disabled:r,onClick:ve(e.onClick,g),onPointerDown:v=>{var b;(b=e.onPointerDown)==null||b.call(e,v),h.current=!0},onPointerUp:ve(e.onPointerUp,v=>{var b;h.current||(b=v.currentTarget)==null||b.click()}),onKeyDown:ve(e.onKeyDown,v=>{const b=f.searchRef.current!=="";r||b&&v.key===" "||Fp.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});bf.displayName=Td;var HN=x.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:o=!1,textValue:i,...l}=e,u=Wg(Td,r),f=kN(r),m=x.useRef(null),h=Ye(t,m),[g,v]=x.useState(!1),[b,w]=x.useState("");return x.useEffect(()=>{const E=m.current;E&&w((E.textContent??"").trim())},[l.children]),d.jsx(Vl.ItemSlot,{scope:r,disabled:o,textValue:i??b,children:d.jsx(PS,{asChild:!0,...f,focusable:!o,children:d.jsx(Ae.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...l,ref:h,onPointerMove:ve(e.onPointerMove,ql(E=>{o?u.onItemLeave(E):(u.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ve(e.onPointerLeave,ql(E=>u.onItemLeave(E))),onFocus:ve(e.onFocus,()=>v(!0)),onBlur:ve(e.onBlur,()=>v(!1))})})})}),oL="MenuCheckboxItem",$N=x.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:o,...i}=e;return d.jsx(GN,{scope:e.__scopeMenu,checked:r,children:d.jsx(bf,{role:"menuitemcheckbox","aria-checked":Rd(r)?"mixed":r,...i,ref:t,"data-state":Jg(r),onSelect:ve(i.onSelect,()=>o==null?void 0:o(Rd(r)?!0:!r),{checkForDefaultPrevented:!1})})})});$N.displayName=oL;var IN="MenuRadioGroup",[sL,iL]=ts(IN,{value:void 0,onValueChange:()=>{}}),VN=x.forwardRef((e,t)=>{const{value:r,onValueChange:o,...i}=e,l=$t(o);return d.jsx(sL,{scope:e.__scopeMenu,value:r,onValueChange:l,children:d.jsx(Zg,{...i,ref:t})})});VN.displayName=IN;var qN="MenuRadioItem",YN=x.forwardRef((e,t)=>{const{value:r,...o}=e,i=iL(qN,e.__scopeMenu),l=r===i.value;return d.jsx(GN,{scope:e.__scopeMenu,checked:l,children:d.jsx(bf,{role:"menuitemradio","aria-checked":l,...o,ref:t,"data-state":Jg(l),onSelect:ve(o.onSelect,()=>{var u;return(u=i.onValueChange)==null?void 0:u.call(i,r)},{checkForDefaultPrevented:!1})})})});YN.displayName=qN;var Qg="MenuItemIndicator",[GN,lL]=ts(Qg,{checked:!1}),FN=x.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:o,...i}=e,l=lL(Qg,r);return d.jsx(vn,{present:o||Rd(l.checked)||l.checked===!0,children:d.jsx(Ae.span,{...i,ref:t,"data-state":Jg(l.checked)})})});FN.displayName=Qg;var cL="MenuSeparator",XN=x.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return d.jsx(Ae.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});XN.displayName=cL;var uL="MenuArrow",WN=x.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e,i=xf(r);return d.jsx(O1,{...i,...o,ref:t})});WN.displayName=uL;var dL="MenuSub",[v9,KN]=ts(dL),Ml="MenuSubTrigger",ZN=x.forwardRef((e,t)=>{const r=ns(Ml,e.__scopeMenu),o=hc(Ml,e.__scopeMenu),i=KN(Ml,e.__scopeMenu),l=Wg(Ml,e.__scopeMenu),u=x.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:m}=l,h={__scopeMenu:e.__scopeMenu},g=x.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return x.useEffect(()=>g,[g]),x.useEffect(()=>{const v=f.current;return()=>{window.clearTimeout(v),m(null)}},[f,m]),d.jsx(Fg,{asChild:!0,...h,children:d.jsx(HN,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":eC(r.open),...e,ref:xg(t,i.onTriggerChange),onClick:v=>{var b;(b=e.onClick)==null||b.call(e,v),!(e.disabled||v.defaultPrevented)&&(v.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ve(e.onPointerMove,ql(v=>{l.onItemEnter(v),!v.defaultPrevented&&!e.disabled&&!r.open&&!u.current&&(l.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{r.onOpenChange(!0),g()},100))})),onPointerLeave:ve(e.onPointerLeave,ql(v=>{var w,E;g();const b=(w=r.content)==null?void 0:w.getBoundingClientRect();if(b){const S=(E=r.content)==null?void 0:E.dataset.side,N=S==="right",C=N?-5:5,T=b[N?"left":"right"],A=b[N?"right":"left"];l.onPointerGraceIntentChange({area:[{x:v.clientX+C,y:v.clientY},{x:T,y:b.top},{x:A,y:b.top},{x:A,y:b.bottom},{x:T,y:b.bottom}],side:S}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(v),v.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:ve(e.onKeyDown,v=>{var w;const b=l.searchRef.current!=="";e.disabled||b&&v.key===" "||Yz[o.dir].includes(v.key)&&(r.onOpenChange(!0),(w=r.content)==null||w.focus(),v.preventDefault())})})})});ZN.displayName=Ml;var QN="MenuSubContent",JN=x.forwardRef((e,t)=>{const r=LN(qn,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,l=ns(qn,e.__scopeMenu),u=hc(qn,e.__scopeMenu),f=KN(QN,e.__scopeMenu),m=x.useRef(null),h=Ye(t,m);return d.jsx(Vl.Provider,{scope:e.__scopeMenu,children:d.jsx(vn,{present:o||l.open,children:d.jsx(Vl.Slot,{scope:e.__scopeMenu,children:d.jsx(Kg,{id:f.contentId,"aria-labelledby":f.triggerId,...i,ref:h,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var v;u.isUsingKeyboardRef.current&&((v=m.current)==null||v.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:ve(e.onFocusOutside,g=>{g.target!==f.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:ve(e.onEscapeKeyDown,g=>{u.onClose(),g.preventDefault()}),onKeyDown:ve(e.onKeyDown,g=>{var w;const v=g.currentTarget.contains(g.target),b=Gz[u.dir].includes(g.key);v&&b&&(l.onOpenChange(!1),(w=f.trigger)==null||w.focus(),g.preventDefault())})})})})})});JN.displayName=QN;function eC(e){return e?"open":"closed"}function Rd(e){return e==="indeterminate"}function Jg(e){return Rd(e)?"indeterminate":e?"checked":"unchecked"}function fL(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function hL(e,t){return e.map((r,o)=>e[(t+o)%e.length])}function mL(e,t,r){const i=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,l=r?e.indexOf(r):-1;let u=hL(e,Math.max(l,0));i.length===1&&(u=u.filter(h=>h!==r));const m=u.find(h=>h.toLowerCase().startsWith(i.toLowerCase()));return m!==r?m:void 0}function pL(e,t){const{x:r,y:o}=e;let i=!1;for(let l=0,u=t.length-1;l<t.length;u=l++){const f=t[l],m=t[u],h=f.x,g=f.y,v=m.x,b=m.y;g>o!=b>o&&r<(v-h)*(o-g)/(b-g)+h&&(i=!i)}return i}function gL(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return pL(r,t)}function ql(e){return t=>t.pointerType==="mouse"?e(t):void 0}var vL=zN,yL=Fg,xL=PN,bL=UN,wL=Zg,SL=BN,EL=bf,NL=$N,CL=VN,jL=YN,_L=FN,AL=XN,TL=WN,RL=ZN,ML=JN,wf="DropdownMenu",[DL,y9]=fr(wf,[ON]),an=ON(),[OL,tC]=DL(wf),nC=e=>{const{__scopeDropdownMenu:t,children:r,dir:o,open:i,defaultOpen:l,onOpenChange:u,modal:f=!0}=e,m=an(t),h=x.useRef(null),[g,v]=$o({prop:i,defaultProp:l??!1,onChange:u,caller:wf});return d.jsx(OL,{scope:t,triggerId:Er(),triggerRef:h,contentId:Er(),open:g,onOpenChange:v,onOpenToggle:x.useCallback(()=>v(b=>!b),[v]),modal:f,children:d.jsx(vL,{...m,open:g,onOpenChange:v,dir:o,modal:f,children:r})})};nC.displayName=wf;var rC="DropdownMenuTrigger",aC=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...i}=e,l=tC(rC,r),u=an(r);return d.jsx(yL,{asChild:!0,...u,children:d.jsx(Ae.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:xg(t,l.triggerRef),onPointerDown:ve(e.onPointerDown,f=>{!o&&f.button===0&&f.ctrlKey===!1&&(l.onOpenToggle(),l.open||f.preventDefault())}),onKeyDown:ve(e.onKeyDown,f=>{o||(["Enter"," "].includes(f.key)&&l.onOpenToggle(),f.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});aC.displayName=rC;var kL="DropdownMenuPortal",oC=e=>{const{__scopeDropdownMenu:t,...r}=e,o=an(t);return d.jsx(xL,{...o,...r})};oC.displayName=kL;var sC="DropdownMenuContent",iC=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=tC(sC,r),l=an(r),u=x.useRef(!1);return d.jsx(bL,{id:i.contentId,"aria-labelledby":i.triggerId,...l,...o,ref:t,onCloseAutoFocus:ve(e.onCloseAutoFocus,f=>{var m;u.current||(m=i.triggerRef.current)==null||m.focus(),u.current=!1,f.preventDefault()}),onInteractOutside:ve(e.onInteractOutside,f=>{const m=f.detail.originalEvent,h=m.button===0&&m.ctrlKey===!0,g=m.button===2||h;(!i.modal||g)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});iC.displayName=sC;var zL="DropdownMenuGroup",LL=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=an(r);return d.jsx(wL,{...i,...o,ref:t})});LL.displayName=zL;var PL="DropdownMenuLabel",lC=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=an(r);return d.jsx(SL,{...i,...o,ref:t})});lC.displayName=PL;var UL="DropdownMenuItem",cC=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=an(r);return d.jsx(EL,{...i,...o,ref:t})});cC.displayName=UL;var BL="DropdownMenuCheckboxItem",HL=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=an(r);return d.jsx(NL,{...i,...o,ref:t})});HL.displayName=BL;var $L="DropdownMenuRadioGroup",IL=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=an(r);return d.jsx(CL,{...i,...o,ref:t})});IL.displayName=$L;var VL="DropdownMenuRadioItem",qL=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=an(r);return d.jsx(jL,{...i,...o,ref:t})});qL.displayName=VL;var YL="DropdownMenuItemIndicator",GL=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=an(r);return d.jsx(_L,{...i,...o,ref:t})});GL.displayName=YL;var FL="DropdownMenuSeparator",uC=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=an(r);return d.jsx(AL,{...i,...o,ref:t})});uC.displayName=FL;var XL="DropdownMenuArrow",WL=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=an(r);return d.jsx(TL,{...i,...o,ref:t})});WL.displayName=XL;var KL="DropdownMenuSubTrigger",ZL=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=an(r);return d.jsx(RL,{...i,...o,ref:t})});ZL.displayName=KL;var QL="DropdownMenuSubContent",JL=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=an(r);return d.jsx(ML,{...i,...o,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});JL.displayName=QL;var e5=nC,t5=aC,n5=oC,r5=iC,a5=lC,o5=cC,s5=uC;function dC({...e}){return d.jsx(e5,{"data-slot":"dropdown-menu",...e})}function i5({...e}){return d.jsx(t5,{"data-slot":"dropdown-menu-trigger",...e})}function l5({className:e,sideOffset:t=4,...r}){return d.jsx(n5,{children:d.jsx(r5,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...r})})}function iw({className:e,inset:t,variant:r="default",...o}){return d.jsx(o5,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:Me("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o})}function c5({className:e,inset:t,...r}){return d.jsx(a5,{"data-slot":"dropdown-menu-label","data-inset":t,className:Me("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r})}function lw({className:e,...t}){return d.jsx(s5,{"data-slot":"dropdown-menu-separator",className:Me("bg-border -mx-1 my-1 h-px",e),...t})}function u5({...e}){return d.jsx(yN,{"data-slot":"sheet",...e})}function d5({...e}){return d.jsx(xN,{"data-slot":"sheet-trigger",...e})}function f5({...e}){return d.jsx(bN,{"data-slot":"sheet-portal",...e})}function h5({className:e,...t}){return d.jsx(wN,{"data-slot":"sheet-overlay",className:Me("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function m5({className:e,children:t,side:r="right",...o}){return d.jsxs(f5,{children:[d.jsx(h5,{}),d.jsxs(SN,{"data-slot":"sheet-content",className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...o,children:[t,d.jsxs(Yg,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[d.jsx(NE,{className:"size-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Jt({children:e}){const t=rn(),r=fa().pathname,o=[{name:"Dashboard",href:"/dashboard",icon:Pk},{name:"Devices",href:"/devices",icon:$l},{name:"Groups",href:"/groups",icon:cc},{name:"Executions",href:"/executions",icon:uk},{name:"Profile",href:"/profile",icon:Cd}],i=localStorage.getItem("user");i&&JSON.parse(i).isSuperuser&&o.push({name:"Superuser",href:"/admin",icon:e4});const l=()=>{vz(),t("/login")};return d.jsxs("div",{className:"flex min-h-screen flex-col",children:[d.jsxs("header",{className:"sticky top-0 z-50 flex h-16 items-center gap-4 border-b bg-background px-4 md:px-6",children:[d.jsx("div",{className:"flex items-center gap-2",children:d.jsx(Wa,{to:"/dashboard",className:"flex items-center gap-2 font-semibold",children:d.jsx("span",{className:"hidden md:inline-block",children:"Formica"})})}),d.jsxs(u5,{children:[d.jsx(d5,{asChild:!0,children:d.jsxs(Ne,{variant:"outline",size:"icon",className:"md:hidden",children:[d.jsx(Ik,{className:"h-5 w-5"}),d.jsx("span",{className:"sr-only",children:"Toggle menu"})]})}),d.jsx(m5,{side:"left",children:d.jsx("div",{className:"grid gap-2 py-6",children:o.map(u=>d.jsxs(Wa,{to:u.href,className:`flex items-center gap-2 rounded-lg px-3 py-2 text-sm transition-all hover:text-primary ${r===u.href?"bg-muted font-medium":"text-muted-foreground"}`,children:[d.jsx(u.icon,{className:"h-4 w-4"}),u.name]},u.name))})})]}),d.jsx("nav",{className:"hidden md:flex md:flex-1 md:items-center md:gap-4 md:px-4",children:o.map(u=>d.jsxs(Wa,{to:u.href,className:`flex items-center gap-2 rounded-lg px-3 py-2 text-sm transition-all hover:text-primary ${r===u.href||u.href!=="/"&&(r!=null&&r.startsWith(u.href))?"bg-muted font-medium":"text-muted-foreground"}`,children:[d.jsx(u.icon,{className:"h-4 w-4"}),u.name]},u.name))}),d.jsx("div",{className:"ml-auto flex items-center gap-2",children:d.jsxs(dC,{children:[d.jsx(i5,{asChild:!0,children:d.jsxs(Ne,{variant:"ghost",size:"icon",className:"rounded-full",children:[d.jsx("img",{src:"/placeholder.svg?height=32&width=32",alt:"Avatar",className:"rounded-full",height:"32",width:"32"}),d.jsx("span",{className:"sr-only",children:"Toggle user menu"})]})}),d.jsxs(l5,{align:"end",children:[d.jsx(c5,{children:"My Account"}),d.jsx(lw,{}),d.jsx(iw,{asChild:!0,children:d.jsxs(Wa,{to:"/profile",children:[d.jsx(Cd,{className:"mr-2 h-4 w-4"}),"Profile"]})}),d.jsx(lw,{}),d.jsxs(iw,{onClick:l,children:[d.jsx(zg,{className:"mr-2 h-4 w-4"}),"Log out"]})]})]})})]}),d.jsx("main",{className:"flex-1",children:e})]})}function p5(){const[e,t]=x.useState("users");return d.jsx(Jt,{children:d.jsxs("div",{className:"container mx-auto py-6",children:[d.jsx("h1",{className:"text-3xl font-bold mb-6",children:"Superuser Dashboard"}),d.jsxs(Wd,{defaultValue:"users",value:e,onValueChange:t,className:"w-full",children:[d.jsxs(Kd,{className:"grid w-full max-w-md grid-cols-2",children:[d.jsx(Io,{value:"users",children:"Users"}),d.jsx(Io,{value:"groups",children:"Groups"})]}),d.jsx(Vo,{value:"users",className:"mt-6",children:d.jsxs(Et,{children:[d.jsxs(fn,{children:[d.jsx(hn,{children:"User Management"}),d.jsx(qo,{children:"Manage user accounts and roles"})]}),d.jsx(Nt,{children:d.jsx(bz,{})})]})}),d.jsx(Vo,{value:"groups",className:"mt-6",children:d.jsxs(Et,{children:[d.jsxs(fn,{children:[d.jsx(hn,{children:"Group Management"}),d.jsx(qo,{children:"Create and manage groups and assign users"})]}),d.jsx(Nt,{children:d.jsx(Iz,{})})]})})]})]})})}function g5(){return d.jsx(p5,{})}function Ft(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,o;r<e.length;r++)(o=Ft(e[r]))!==""&&(t+=(t&&" ")+o);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}var cp={exports:{}},up={},dp={exports:{}},fp={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var cw;function v5(){if(cw)return fp;cw=1;var e=ec();function t(v,b){return v===b&&(v!==0||1/v===1/b)||v!==v&&b!==b}var r=typeof Object.is=="function"?Object.is:t,o=e.useState,i=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function f(v,b){var w=b(),E=o({inst:{value:w,getSnapshot:b}}),S=E[0].inst,N=E[1];return l(function(){S.value=w,S.getSnapshot=b,m(S)&&N({inst:S})},[v,w,b]),i(function(){return m(S)&&N({inst:S}),v(function(){m(S)&&N({inst:S})})},[v]),u(w),w}function m(v){var b=v.getSnapshot;v=v.value;try{var w=b();return!r(v,w)}catch{return!0}}function h(v,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return fp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,fp}var uw;function fC(){return uw||(uw=1,dp.exports=v5()),dp.exports}/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var dw;function y5(){if(dw)return up;dw=1;var e=ec(),t=fC();function r(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var o=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,f=e.useMemo,m=e.useDebugValue;return up.useSyncExternalStoreWithSelector=function(h,g,v,b,w){var E=l(null);if(E.current===null){var S={hasValue:!1,value:null};E.current=S}else S=E.current;E=f(function(){function C(L){if(!T){if(T=!0,A=L,L=b(L),w!==void 0&&S.hasValue){var B=S.value;if(w(B,L))return _=B}return _=L}if(B=_,o(A,L))return B;var I=b(L);return w!==void 0&&w(B,I)?(A=L,B):(A=L,_=I)}var T=!1,A,_,O=v===void 0?null:v;return[function(){return C(g())},O===null?void 0:function(){return C(O())}]},[g,v,b,w]);var N=i(h,E[0],E[1]);return u(function(){S.hasValue=!0,S.value=N},[N]),m(N),N},up}var fw;function x5(){return fw||(fw=1,cp.exports=y5()),cp.exports}var b5=x5();const w5=dg(b5),S5={},hw=e=>{let t;const r=new Set,o=(g,v)=>{const b=typeof g=="function"?g(t):g;if(!Object.is(b,t)){const w=t;t=v??(typeof b!="object"||b===null)?b:Object.assign({},t,b),r.forEach(E=>E(t,w))}},i=()=>t,m={setState:o,getState:i,getInitialState:()=>h,subscribe:g=>(r.add(g),()=>r.delete(g)),destroy:()=>{(S5?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},h=t=e(o,i,m);return m},E5=e=>e?hw(e):hw,{useDebugValue:N5}=ae,{useSyncExternalStoreWithSelector:C5}=w5,j5=e=>e;function hC(e,t=j5,r){const o=C5(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return N5(o),o}const mw=(e,t)=>{const r=E5(e),o=(i,l=t)=>hC(r,i,l);return Object.assign(o,r),o},_5=(e,t)=>e?mw(e,t):mw;function It(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,i]of e)if(!Object.is(i,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const o of r)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}var A5={value:()=>{}};function Sf(){for(var e=0,t=arguments.length,r={},o;e<t;++e){if(!(o=arguments[e]+"")||o in r||/[\s.]/.test(o))throw new Error("illegal type: "+o);r[o]=[]}return new fd(r)}function fd(e){this._=e}function T5(e,t){return e.trim().split(/^|\s+/).map(function(r){var o="",i=r.indexOf(".");if(i>=0&&(o=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:o}})}fd.prototype=Sf.prototype={constructor:fd,on:function(e,t){var r=this._,o=T5(e+"",r),i,l=-1,u=o.length;if(arguments.length<2){for(;++l<u;)if((i=(e=o[l]).type)&&(i=R5(r[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<u;)if(i=(e=o[l]).type)r[i]=pw(r[i],e.name,t);else if(t==null)for(i in r)r[i]=pw(r[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new fd(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var r=new Array(i),o=0,i,l;o<i;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],o=0,i=l.length;o<i;++o)l[o].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],i=0,l=o.length;i<l;++i)o[i].value.apply(t,r)}};function R5(e,t){for(var r=0,o=e.length,i;r<o;++r)if((i=e[r]).name===t)return i.value}function pw(e,t,r){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=A5,e=e.slice(0,o).concat(e.slice(o+1));break}return r!=null&&e.push({name:t,value:r}),e}var Xp="http://www.w3.org/1999/xhtml";const gw={svg:"http://www.w3.org/2000/svg",xhtml:Xp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ef(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),gw.hasOwnProperty(t)?{space:gw[t],local:e}:e}function M5(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Xp&&t.documentElement.namespaceURI===Xp?t.createElement(e):t.createElementNS(r,e)}}function D5(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mC(e){var t=Ef(e);return(t.local?D5:M5)(t)}function O5(){}function ev(e){return e==null?O5:function(){return this.querySelector(e)}}function k5(e){typeof e!="function"&&(e=ev(e));for(var t=this._groups,r=t.length,o=new Array(r),i=0;i<r;++i)for(var l=t[i],u=l.length,f=o[i]=new Array(u),m,h,g=0;g<u;++g)(m=l[g])&&(h=e.call(m,m.__data__,g,l))&&("__data__"in m&&(h.__data__=m.__data__),f[g]=h);return new Rn(o,this._parents)}function z5(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function L5(){return[]}function pC(e){return e==null?L5:function(){return this.querySelectorAll(e)}}function P5(e){return function(){return z5(e.apply(this,arguments))}}function U5(e){typeof e=="function"?e=P5(e):e=pC(e);for(var t=this._groups,r=t.length,o=[],i=[],l=0;l<r;++l)for(var u=t[l],f=u.length,m,h=0;h<f;++h)(m=u[h])&&(o.push(e.call(m,m.__data__,h,u)),i.push(m));return new Rn(o,i)}function gC(e){return function(){return this.matches(e)}}function vC(e){return function(t){return t.matches(e)}}var B5=Array.prototype.find;function H5(e){return function(){return B5.call(this.children,e)}}function $5(){return this.firstElementChild}function I5(e){return this.select(e==null?$5:H5(typeof e=="function"?e:vC(e)))}var V5=Array.prototype.filter;function q5(){return Array.from(this.children)}function Y5(e){return function(){return V5.call(this.children,e)}}function G5(e){return this.selectAll(e==null?q5:Y5(typeof e=="function"?e:vC(e)))}function F5(e){typeof e!="function"&&(e=gC(e));for(var t=this._groups,r=t.length,o=new Array(r),i=0;i<r;++i)for(var l=t[i],u=l.length,f=o[i]=[],m,h=0;h<u;++h)(m=l[h])&&e.call(m,m.__data__,h,l)&&f.push(m);return new Rn(o,this._parents)}function yC(e){return new Array(e.length)}function X5(){return new Rn(this._enter||this._groups.map(yC),this._parents)}function Md(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Md.prototype={constructor:Md,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function W5(e){return function(){return e}}function K5(e,t,r,o,i,l){for(var u=0,f,m=t.length,h=l.length;u<h;++u)(f=t[u])?(f.__data__=l[u],o[u]=f):r[u]=new Md(e,l[u]);for(;u<m;++u)(f=t[u])&&(i[u]=f)}function Z5(e,t,r,o,i,l,u){var f,m,h=new Map,g=t.length,v=l.length,b=new Array(g),w;for(f=0;f<g;++f)(m=t[f])&&(b[f]=w=u.call(m,m.__data__,f,t)+"",h.has(w)?i[f]=m:h.set(w,m));for(f=0;f<v;++f)w=u.call(e,l[f],f,l)+"",(m=h.get(w))?(o[f]=m,m.__data__=l[f],h.delete(w)):r[f]=new Md(e,l[f]);for(f=0;f<g;++f)(m=t[f])&&h.get(b[f])===m&&(i[f]=m)}function Q5(e){return e.__data__}function J5(e,t){if(!arguments.length)return Array.from(this,Q5);var r=t?Z5:K5,o=this._parents,i=this._groups;typeof e!="function"&&(e=W5(e));for(var l=i.length,u=new Array(l),f=new Array(l),m=new Array(l),h=0;h<l;++h){var g=o[h],v=i[h],b=v.length,w=e6(e.call(g,g&&g.__data__,h,o)),E=w.length,S=f[h]=new Array(E),N=u[h]=new Array(E),C=m[h]=new Array(b);r(g,v,S,N,C,w,t);for(var T=0,A=0,_,O;T<E;++T)if(_=S[T]){for(T>=A&&(A=T+1);!(O=N[A])&&++A<E;);_._next=O||null}}return u=new Rn(u,o),u._enter=f,u._exit=m,u}function e6(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function t6(){return new Rn(this._exit||this._groups.map(yC),this._parents)}function n6(e,t,r){var o=this.enter(),i=this,l=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?l.remove():r(l),o&&i?o.merge(i).order():i}function r6(e){for(var t=e.selection?e.selection():e,r=this._groups,o=t._groups,i=r.length,l=o.length,u=Math.min(i,l),f=new Array(i),m=0;m<u;++m)for(var h=r[m],g=o[m],v=h.length,b=f[m]=new Array(v),w,E=0;E<v;++E)(w=h[E]||g[E])&&(b[E]=w);for(;m<i;++m)f[m]=r[m];return new Rn(f,this._parents)}function a6(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var o=e[t],i=o.length-1,l=o[i],u;--i>=0;)(u=o[i])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function o6(e){e||(e=s6);function t(v,b){return v&&b?e(v.__data__,b.__data__):!v-!b}for(var r=this._groups,o=r.length,i=new Array(o),l=0;l<o;++l){for(var u=r[l],f=u.length,m=i[l]=new Array(f),h,g=0;g<f;++g)(h=u[g])&&(m[g]=h);m.sort(t)}return new Rn(i,this._parents).order()}function s6(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function i6(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function l6(){return Array.from(this)}function c6(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var o=e[t],i=0,l=o.length;i<l;++i){var u=o[i];if(u)return u}return null}function u6(){let e=0;for(const t of this)++e;return e}function d6(){return!this.node()}function f6(e){for(var t=this._groups,r=0,o=t.length;r<o;++r)for(var i=t[r],l=0,u=i.length,f;l<u;++l)(f=i[l])&&e.call(f,f.__data__,l,i);return this}function h6(e){return function(){this.removeAttribute(e)}}function m6(e){return function(){this.removeAttributeNS(e.space,e.local)}}function p6(e,t){return function(){this.setAttribute(e,t)}}function g6(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function v6(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function y6(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function x6(e,t){var r=Ef(e);if(arguments.length<2){var o=this.node();return r.local?o.getAttributeNS(r.space,r.local):o.getAttribute(r)}return this.each((t==null?r.local?m6:h6:typeof t=="function"?r.local?y6:v6:r.local?g6:p6)(r,t))}function xC(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function b6(e){return function(){this.style.removeProperty(e)}}function w6(e,t,r){return function(){this.style.setProperty(e,t,r)}}function S6(e,t,r){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,r)}}function E6(e,t,r){return arguments.length>1?this.each((t==null?b6:typeof t=="function"?S6:w6)(e,t,r??"")):ri(this.node(),e)}function ri(e,t){return e.style.getPropertyValue(t)||xC(e).getComputedStyle(e,null).getPropertyValue(t)}function N6(e){return function(){delete this[e]}}function C6(e,t){return function(){this[e]=t}}function j6(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function _6(e,t){return arguments.length>1?this.each((t==null?N6:typeof t=="function"?j6:C6)(e,t)):this.node()[e]}function bC(e){return e.trim().split(/^|\s+/)}function tv(e){return e.classList||new wC(e)}function wC(e){this._node=e,this._names=bC(e.getAttribute("class")||"")}wC.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function SC(e,t){for(var r=tv(e),o=-1,i=t.length;++o<i;)r.add(t[o])}function EC(e,t){for(var r=tv(e),o=-1,i=t.length;++o<i;)r.remove(t[o])}function A6(e){return function(){SC(this,e)}}function T6(e){return function(){EC(this,e)}}function R6(e,t){return function(){(t.apply(this,arguments)?SC:EC)(this,e)}}function M6(e,t){var r=bC(e+"");if(arguments.length<2){for(var o=tv(this.node()),i=-1,l=r.length;++i<l;)if(!o.contains(r[i]))return!1;return!0}return this.each((typeof t=="function"?R6:t?A6:T6)(r,t))}function D6(){this.textContent=""}function O6(e){return function(){this.textContent=e}}function k6(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function z6(e){return arguments.length?this.each(e==null?D6:(typeof e=="function"?k6:O6)(e)):this.node().textContent}function L6(){this.innerHTML=""}function P6(e){return function(){this.innerHTML=e}}function U6(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function B6(e){return arguments.length?this.each(e==null?L6:(typeof e=="function"?U6:P6)(e)):this.node().innerHTML}function H6(){this.nextSibling&&this.parentNode.appendChild(this)}function $6(){return this.each(H6)}function I6(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function V6(){return this.each(I6)}function q6(e){var t=typeof e=="function"?e:mC(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Y6(){return null}function G6(e,t){var r=typeof e=="function"?e:mC(e),o=t==null?Y6:typeof t=="function"?t:ev(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),o.apply(this,arguments)||null)})}function F6(){var e=this.parentNode;e&&e.removeChild(this)}function X6(){return this.each(F6)}function W6(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function K6(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Z6(e){return this.select(e?K6:W6)}function Q6(e){return arguments.length?this.property("__data__",e):this.node().__data__}function J6(e){return function(t){e.call(this,t,this.__data__)}}function eP(e){return e.trim().split(/^|\s+/).map(function(t){var r="",o=t.indexOf(".");return o>=0&&(r=t.slice(o+1),t=t.slice(0,o)),{type:t,name:r}})}function tP(e){return function(){var t=this.__on;if(t){for(var r=0,o=-1,i=t.length,l;r<i;++r)l=t[r],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++o]=l;++o?t.length=o:delete this.__on}}}function nP(e,t,r){return function(){var o=this.__on,i,l=J6(t);if(o){for(var u=0,f=o.length;u<f;++u)if((i=o[u]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=l,i.options=r),i.value=t;return}}this.addEventListener(e.type,l,r),i={type:e.type,name:e.name,value:t,listener:l,options:r},o?o.push(i):this.__on=[i]}}function rP(e,t,r){var o=eP(e+""),i,l=o.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var m=0,h=f.length,g;m<h;++m)for(i=0,g=f[m];i<l;++i)if((u=o[i]).type===g.type&&u.name===g.name)return g.value}return}for(f=t?nP:tP,i=0;i<l;++i)this.each(f(o[i],t,r));return this}function NC(e,t,r){var o=xC(e),i=o.CustomEvent;typeof i=="function"?i=new i(t,r):(i=o.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function aP(e,t){return function(){return NC(this,e,t)}}function oP(e,t){return function(){return NC(this,e,t.apply(this,arguments))}}function sP(e,t){return this.each((typeof t=="function"?oP:aP)(e,t))}function*iP(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var o=e[t],i=0,l=o.length,u;i<l;++i)(u=o[i])&&(yield u)}var CC=[null];function Rn(e,t){this._groups=e,this._parents=t}function mc(){return new Rn([[document.documentElement]],CC)}function lP(){return this}Rn.prototype=mc.prototype={constructor:Rn,select:k5,selectAll:U5,selectChild:I5,selectChildren:G5,filter:F5,data:J5,enter:X5,exit:t6,join:n6,merge:r6,selection:lP,order:a6,sort:o6,call:i6,nodes:l6,node:c6,size:u6,empty:d6,each:f6,attr:x6,style:E6,property:_6,classed:M6,text:z6,html:B6,raise:$6,lower:V6,append:q6,insert:G6,remove:X6,clone:Z6,datum:Q6,on:rP,dispatch:sP,[Symbol.iterator]:iP};function In(e){return typeof e=="string"?new Rn([[document.querySelector(e)]],[document.documentElement]):new Rn([[e]],CC)}function cP(e){let t;for(;t=e.sourceEvent;)e=t;return e}function er(e,t){if(e=cP(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var o=r.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const uP={passive:!1},Yl={capture:!0,passive:!1};function hp(e){e.stopImmediatePropagation()}function Js(e){e.preventDefault(),e.stopImmediatePropagation()}function jC(e){var t=e.document.documentElement,r=In(e).on("dragstart.drag",Js,Yl);"onselectstart"in t?r.on("selectstart.drag",Js,Yl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function _C(e,t){var r=e.document.documentElement,o=In(e).on("dragstart.drag",null);t&&(o.on("click.drag",Js,Yl),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in r?o.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const Gu=e=>()=>e;function Wp(e,{sourceEvent:t,subject:r,target:o,identifier:i,active:l,x:u,y:f,dx:m,dy:h,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:m,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:g}})}Wp.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function dP(e){return!e.ctrlKey&&!e.button}function fP(){return this.parentNode}function hP(e,t){return t??{x:e.x,y:e.y}}function mP(){return navigator.maxTouchPoints||"ontouchstart"in this}function pP(){var e=dP,t=fP,r=hP,o=mP,i={},l=Sf("start","drag","end"),u=0,f,m,h,g,v=0;function b(_){_.on("mousedown.drag",w).filter(o).on("touchstart.drag",N).on("touchmove.drag",C,uP).on("touchend.drag touchcancel.drag",T).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(_,O){if(!(g||!e.call(this,_,O))){var L=A(this,t.call(this,_,O),_,O,"mouse");L&&(In(_.view).on("mousemove.drag",E,Yl).on("mouseup.drag",S,Yl),jC(_.view),hp(_),h=!1,f=_.clientX,m=_.clientY,L("start",_))}}function E(_){if(Js(_),!h){var O=_.clientX-f,L=_.clientY-m;h=O*O+L*L>v}i.mouse("drag",_)}function S(_){In(_.view).on("mousemove.drag mouseup.drag",null),_C(_.view,h),Js(_),i.mouse("end",_)}function N(_,O){if(e.call(this,_,O)){var L=_.changedTouches,B=t.call(this,_,O),I=L.length,q,Q;for(q=0;q<I;++q)(Q=A(this,B,_,O,L[q].identifier,L[q]))&&(hp(_),Q("start",_,L[q]))}}function C(_){var O=_.changedTouches,L=O.length,B,I;for(B=0;B<L;++B)(I=i[O[B].identifier])&&(Js(_),I("drag",_,O[B]))}function T(_){var O=_.changedTouches,L=O.length,B,I;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),B=0;B<L;++B)(I=i[O[B].identifier])&&(hp(_),I("end",_,O[B]))}function A(_,O,L,B,I,q){var Q=l.copy(),te=er(q||L,O),P,W,k;if((k=r.call(_,new Wp("beforestart",{sourceEvent:L,target:b,identifier:I,active:u,x:te[0],y:te[1],dx:0,dy:0,dispatch:Q}),B))!=null)return P=k.x-te[0]||0,W=k.y-te[1]||0,function Y(M,$,U){var z=te,R;switch(M){case"start":i[I]=Y,R=u++;break;case"end":delete i[I],--u;case"drag":te=er(U||$,O),R=u;break}Q.call(M,_,new Wp(M,{sourceEvent:$,subject:k,target:b,identifier:I,active:R,x:te[0]+P,y:te[1]+W,dx:te[0]-z[0],dy:te[1]-z[1],dispatch:Q}),B)}}return b.filter=function(_){return arguments.length?(e=typeof _=="function"?_:Gu(!!_),b):e},b.container=function(_){return arguments.length?(t=typeof _=="function"?_:Gu(_),b):t},b.subject=function(_){return arguments.length?(r=typeof _=="function"?_:Gu(_),b):r},b.touchable=function(_){return arguments.length?(o=typeof _=="function"?_:Gu(!!_),b):o},b.on=function(){var _=l.on.apply(l,arguments);return _===l?b:_},b.clickDistance=function(_){return arguments.length?(v=(_=+_)*_,b):Math.sqrt(v)},b}function nv(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function AC(e,t){var r=Object.create(e.prototype);for(var o in t)r[o]=t[o];return r}function pc(){}var Gl=.7,Dd=1/Gl,ei="\\s*([+-]?\\d+)\\s*",Fl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Cr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gP=/^#([0-9a-f]{3,8})$/,vP=new RegExp(`^rgb\\(${ei},${ei},${ei}\\)$`),yP=new RegExp(`^rgb\\(${Cr},${Cr},${Cr}\\)$`),xP=new RegExp(`^rgba\\(${ei},${ei},${ei},${Fl}\\)$`),bP=new RegExp(`^rgba\\(${Cr},${Cr},${Cr},${Fl}\\)$`),wP=new RegExp(`^hsl\\(${Fl},${Cr},${Cr}\\)$`),SP=new RegExp(`^hsla\\(${Fl},${Cr},${Cr},${Fl}\\)$`),vw={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};nv(pc,Xl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:yw,formatHex:yw,formatHex8:EP,formatHsl:NP,formatRgb:xw,toString:xw});function yw(){return this.rgb().formatHex()}function EP(){return this.rgb().formatHex8()}function NP(){return TC(this).formatHsl()}function xw(){return this.rgb().formatRgb()}function Xl(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=gP.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?bw(t):r===3?new mn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Fu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Fu(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=vP.exec(e))?new mn(t[1],t[2],t[3],1):(t=yP.exec(e))?new mn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=xP.exec(e))?Fu(t[1],t[2],t[3],t[4]):(t=bP.exec(e))?Fu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=wP.exec(e))?Ew(t[1],t[2]/100,t[3]/100,1):(t=SP.exec(e))?Ew(t[1],t[2]/100,t[3]/100,t[4]):vw.hasOwnProperty(e)?bw(vw[e]):e==="transparent"?new mn(NaN,NaN,NaN,0):null}function bw(e){return new mn(e>>16&255,e>>8&255,e&255,1)}function Fu(e,t,r,o){return o<=0&&(e=t=r=NaN),new mn(e,t,r,o)}function CP(e){return e instanceof pc||(e=Xl(e)),e?(e=e.rgb(),new mn(e.r,e.g,e.b,e.opacity)):new mn}function Kp(e,t,r,o){return arguments.length===1?CP(e):new mn(e,t,r,o??1)}function mn(e,t,r,o){this.r=+e,this.g=+t,this.b=+r,this.opacity=+o}nv(mn,Kp,AC(pc,{brighter(e){return e=e==null?Dd:Math.pow(Dd,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Gl:Math.pow(Gl,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new mn(Uo(this.r),Uo(this.g),Uo(this.b),Od(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ww,formatHex:ww,formatHex8:jP,formatRgb:Sw,toString:Sw}));function ww(){return`#${zo(this.r)}${zo(this.g)}${zo(this.b)}`}function jP(){return`#${zo(this.r)}${zo(this.g)}${zo(this.b)}${zo((isNaN(this.opacity)?1:this.opacity)*255)}`}function Sw(){const e=Od(this.opacity);return`${e===1?"rgb(":"rgba("}${Uo(this.r)}, ${Uo(this.g)}, ${Uo(this.b)}${e===1?")":`, ${e})`}`}function Od(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Uo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zo(e){return e=Uo(e),(e<16?"0":"")+e.toString(16)}function Ew(e,t,r,o){return o<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new tr(e,t,r,o)}function TC(e){if(e instanceof tr)return new tr(e.h,e.s,e.l,e.opacity);if(e instanceof pc||(e=Xl(e)),!e)return new tr;if(e instanceof tr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,o=e.b/255,i=Math.min(t,r,o),l=Math.max(t,r,o),u=NaN,f=l-i,m=(l+i)/2;return f?(t===l?u=(r-o)/f+(r<o)*6:r===l?u=(o-t)/f+2:u=(t-r)/f+4,f/=m<.5?l+i:2-l-i,u*=60):f=m>0&&m<1?0:u,new tr(u,f,m,e.opacity)}function _P(e,t,r,o){return arguments.length===1?TC(e):new tr(e,t,r,o??1)}function tr(e,t,r,o){this.h=+e,this.s=+t,this.l=+r,this.opacity=+o}nv(tr,_P,AC(pc,{brighter(e){return e=e==null?Dd:Math.pow(Dd,e),new tr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Gl:Math.pow(Gl,e),new tr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,o=r+(r<.5?r:1-r)*t,i=2*r-o;return new mn(mp(e>=240?e-240:e+120,i,o),mp(e,i,o),mp(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new tr(Nw(this.h),Xu(this.s),Xu(this.l),Od(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Od(this.opacity);return`${e===1?"hsl(":"hsla("}${Nw(this.h)}, ${Xu(this.s)*100}%, ${Xu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Nw(e){return e=(e||0)%360,e<0?e+360:e}function Xu(e){return Math.max(0,Math.min(1,e||0))}function mp(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const RC=e=>()=>e;function AP(e,t){return function(r){return e+r*t}}function TP(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(o){return Math.pow(e+o*t,r)}}function RP(e){return(e=+e)==1?MC:function(t,r){return r-t?TP(t,r,e):RC(isNaN(t)?r:t)}}function MC(e,t){var r=t-e;return r?AP(e,r):RC(isNaN(e)?t:e)}const Cw=function e(t){var r=RP(t);function o(i,l){var u=r((i=Kp(i)).r,(l=Kp(l)).r),f=r(i.g,l.g),m=r(i.b,l.b),h=MC(i.opacity,l.opacity);return function(g){return i.r=u(g),i.g=f(g),i.b=m(g),i.opacity=h(g),i+""}}return o.gamma=e,o}(1);function Fa(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var Zp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pp=new RegExp(Zp.source,"g");function MP(e){return function(){return e}}function DP(e){return function(t){return e(t)+""}}function OP(e,t){var r=Zp.lastIndex=pp.lastIndex=0,o,i,l,u=-1,f=[],m=[];for(e=e+"",t=t+"";(o=Zp.exec(e))&&(i=pp.exec(t));)(l=i.index)>r&&(l=t.slice(r,l),f[u]?f[u]+=l:f[++u]=l),(o=o[0])===(i=i[0])?f[u]?f[u]+=i:f[++u]=i:(f[++u]=null,m.push({i:u,x:Fa(o,i)})),r=pp.lastIndex;return r<t.length&&(l=t.slice(r),f[u]?f[u]+=l:f[++u]=l),f.length<2?m[0]?DP(m[0].x):MP(t):(t=m.length,function(h){for(var g=0,v;g<t;++g)f[(v=m[g]).i]=v.x(h);return f.join("")})}var jw=180/Math.PI,Qp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function DC(e,t,r,o,i,l){var u,f,m;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(m=e*r+t*o)&&(r-=e*m,o-=t*m),(f=Math.sqrt(r*r+o*o))&&(r/=f,o/=f,m/=f),e*o<t*r&&(e=-e,t=-t,m=-m,u=-u),{translateX:i,translateY:l,rotate:Math.atan2(t,e)*jw,skewX:Math.atan(m)*jw,scaleX:u,scaleY:f}}var Wu;function kP(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Qp:DC(t.a,t.b,t.c,t.d,t.e,t.f)}function zP(e){return e==null||(Wu||(Wu=document.createElementNS("http://www.w3.org/2000/svg","g")),Wu.setAttribute("transform",e),!(e=Wu.transform.baseVal.consolidate()))?Qp:(e=e.matrix,DC(e.a,e.b,e.c,e.d,e.e,e.f))}function OC(e,t,r,o){function i(h){return h.length?h.pop()+" ":""}function l(h,g,v,b,w,E){if(h!==v||g!==b){var S=w.push("translate(",null,t,null,r);E.push({i:S-4,x:Fa(h,v)},{i:S-2,x:Fa(g,b)})}else(v||b)&&w.push("translate("+v+t+b+r)}function u(h,g,v,b){h!==g?(h-g>180?g+=360:g-h>180&&(h+=360),b.push({i:v.push(i(v)+"rotate(",null,o)-2,x:Fa(h,g)})):g&&v.push(i(v)+"rotate("+g+o)}function f(h,g,v,b){h!==g?b.push({i:v.push(i(v)+"skewX(",null,o)-2,x:Fa(h,g)}):g&&v.push(i(v)+"skewX("+g+o)}function m(h,g,v,b,w,E){if(h!==v||g!==b){var S=w.push(i(w)+"scale(",null,",",null,")");E.push({i:S-4,x:Fa(h,v)},{i:S-2,x:Fa(g,b)})}else(v!==1||b!==1)&&w.push(i(w)+"scale("+v+","+b+")")}return function(h,g){var v=[],b=[];return h=e(h),g=e(g),l(h.translateX,h.translateY,g.translateX,g.translateY,v,b),u(h.rotate,g.rotate,v,b),f(h.skewX,g.skewX,v,b),m(h.scaleX,h.scaleY,g.scaleX,g.scaleY,v,b),h=g=null,function(w){for(var E=-1,S=b.length,N;++E<S;)v[(N=b[E]).i]=N.x(w);return v.join("")}}}var LP=OC(kP,"px, ","px)","deg)"),PP=OC(zP,", ",")",")"),UP=1e-12;function _w(e){return((e=Math.exp(e))+1/e)/2}function BP(e){return((e=Math.exp(e))-1/e)/2}function HP(e){return((e=Math.exp(2*e))-1)/(e+1)}const $P=function e(t,r,o){function i(l,u){var f=l[0],m=l[1],h=l[2],g=u[0],v=u[1],b=u[2],w=g-f,E=v-m,S=w*w+E*E,N,C;if(S<UP)C=Math.log(b/h)/t,N=function(B){return[f+B*w,m+B*E,h*Math.exp(t*B*C)]};else{var T=Math.sqrt(S),A=(b*b-h*h+o*S)/(2*h*r*T),_=(b*b-h*h-o*S)/(2*b*r*T),O=Math.log(Math.sqrt(A*A+1)-A),L=Math.log(Math.sqrt(_*_+1)-_);C=(L-O)/t,N=function(B){var I=B*C,q=_w(O),Q=h/(r*T)*(q*HP(t*I+O)-BP(O));return[f+Q*w,m+Q*E,h*q/_w(t*I+O)]}}return N.duration=C*1e3*t/Math.SQRT2,N}return i.rho=function(l){var u=Math.max(.001,+l),f=u*u,m=f*f;return e(u,f,m)},i}(Math.SQRT2,2,4);var ai=0,Dl=0,Sl=0,kC=1e3,kd,Ol,zd=0,Qo=0,Nf=0,Wl=typeof performance=="object"&&performance.now?performance:Date,zC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function rv(){return Qo||(zC(IP),Qo=Wl.now()+Nf)}function IP(){Qo=0}function Ld(){this._call=this._time=this._next=null}Ld.prototype=LC.prototype={constructor:Ld,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?rv():+r)+(t==null?0:+t),!this._next&&Ol!==this&&(Ol?Ol._next=this:kd=this,Ol=this),this._call=e,this._time=r,Jp()},stop:function(){this._call&&(this._call=null,this._time=1/0,Jp())}};function LC(e,t,r){var o=new Ld;return o.restart(e,t,r),o}function VP(){rv(),++ai;for(var e=kd,t;e;)(t=Qo-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ai}function Aw(){Qo=(zd=Wl.now())+Nf,ai=Dl=0;try{VP()}finally{ai=0,YP(),Qo=0}}function qP(){var e=Wl.now(),t=e-zd;t>kC&&(Nf-=t,zd=e)}function YP(){for(var e,t=kd,r,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:kd=r);Ol=e,Jp(o)}function Jp(e){if(!ai){Dl&&(Dl=clearTimeout(Dl));var t=e-Qo;t>24?(e<1/0&&(Dl=setTimeout(Aw,e-Wl.now()-Nf)),Sl&&(Sl=clearInterval(Sl))):(Sl||(zd=Wl.now(),Sl=setInterval(qP,kC)),ai=1,zC(Aw))}}function Tw(e,t,r){var o=new Ld;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,r),o}var GP=Sf("start","end","cancel","interrupt"),FP=[],PC=0,Rw=1,eg=2,hd=3,Mw=4,tg=5,md=6;function Cf(e,t,r,o,i,l){var u=e.__transition;if(!u)e.__transition={};else if(r in u)return;XP(e,r,{name:t,index:o,group:i,on:GP,tween:FP,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:PC})}function av(e,t){var r=pr(e,t);if(r.state>PC)throw new Error("too late; already scheduled");return r}function Ar(e,t){var r=pr(e,t);if(r.state>hd)throw new Error("too late; already running");return r}function pr(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function XP(e,t,r){var o=e.__transition,i;o[t]=r,r.timer=LC(l,0,r.time);function l(h){r.state=Rw,r.timer.restart(u,r.delay,r.time),r.delay<=h&&u(h-r.delay)}function u(h){var g,v,b,w;if(r.state!==Rw)return m();for(g in o)if(w=o[g],w.name===r.name){if(w.state===hd)return Tw(u);w.state===Mw?(w.state=md,w.timer.stop(),w.on.call("interrupt",e,e.__data__,w.index,w.group),delete o[g]):+g<t&&(w.state=md,w.timer.stop(),w.on.call("cancel",e,e.__data__,w.index,w.group),delete o[g])}if(Tw(function(){r.state===hd&&(r.state=Mw,r.timer.restart(f,r.delay,r.time),f(h))}),r.state=eg,r.on.call("start",e,e.__data__,r.index,r.group),r.state===eg){for(r.state=hd,i=new Array(b=r.tween.length),g=0,v=-1;g<b;++g)(w=r.tween[g].value.call(e,e.__data__,r.index,r.group))&&(i[++v]=w);i.length=v+1}}function f(h){for(var g=h<r.duration?r.ease.call(null,h/r.duration):(r.timer.restart(m),r.state=tg,1),v=-1,b=i.length;++v<b;)i[v].call(e,g);r.state===tg&&(r.on.call("end",e,e.__data__,r.index,r.group),m())}function m(){r.state=md,r.timer.stop(),delete o[t];for(var h in o)return;delete e.__transition}}function pd(e,t){var r=e.__transition,o,i,l=!0,u;if(r){t=t==null?null:t+"";for(u in r){if((o=r[u]).name!==t){l=!1;continue}i=o.state>eg&&o.state<tg,o.state=md,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete r[u]}l&&delete e.__transition}}function WP(e){return this.each(function(){pd(this,e)})}function KP(e,t){var r,o;return function(){var i=Ar(this,e),l=i.tween;if(l!==r){o=r=l;for(var u=0,f=o.length;u<f;++u)if(o[u].name===t){o=o.slice(),o.splice(u,1);break}}i.tween=o}}function ZP(e,t,r){var o,i;if(typeof r!="function")throw new Error;return function(){var l=Ar(this,e),u=l.tween;if(u!==o){i=(o=u).slice();for(var f={name:t,value:r},m=0,h=i.length;m<h;++m)if(i[m].name===t){i[m]=f;break}m===h&&i.push(f)}l.tween=i}}function QP(e,t){var r=this._id;if(e+="",arguments.length<2){for(var o=pr(this.node(),r).tween,i=0,l=o.length,u;i<l;++i)if((u=o[i]).name===e)return u.value;return null}return this.each((t==null?KP:ZP)(r,e,t))}function ov(e,t,r){var o=e._id;return e.each(function(){var i=Ar(this,o);(i.value||(i.value={}))[t]=r.apply(this,arguments)}),function(i){return pr(i,o).value[t]}}function UC(e,t){var r;return(typeof t=="number"?Fa:t instanceof Xl?Cw:(r=Xl(t))?(t=r,Cw):OP)(e,t)}function JP(e){return function(){this.removeAttribute(e)}}function e8(e){return function(){this.removeAttributeNS(e.space,e.local)}}function t8(e,t,r){var o,i=r+"",l;return function(){var u=this.getAttribute(e);return u===i?null:u===o?l:l=t(o=u,r)}}function n8(e,t,r){var o,i=r+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===i?null:u===o?l:l=t(o=u,r)}}function r8(e,t,r){var o,i,l;return function(){var u,f=r(this),m;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),m=f+"",u===m?null:u===o&&m===i?l:(i=m,l=t(o=u,f)))}}function a8(e,t,r){var o,i,l;return function(){var u,f=r(this),m;return f==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),m=f+"",u===m?null:u===o&&m===i?l:(i=m,l=t(o=u,f)))}}function o8(e,t){var r=Ef(e),o=r==="transform"?PP:UC;return this.attrTween(e,typeof t=="function"?(r.local?a8:r8)(r,o,ov(this,"attr."+e,t)):t==null?(r.local?e8:JP)(r):(r.local?n8:t8)(r,o,t))}function s8(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function i8(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function l8(e,t){var r,o;function i(){var l=t.apply(this,arguments);return l!==o&&(r=(o=l)&&i8(e,l)),r}return i._value=t,i}function c8(e,t){var r,o;function i(){var l=t.apply(this,arguments);return l!==o&&(r=(o=l)&&s8(e,l)),r}return i._value=t,i}function u8(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var o=Ef(e);return this.tween(r,(o.local?l8:c8)(o,t))}function d8(e,t){return function(){av(this,e).delay=+t.apply(this,arguments)}}function f8(e,t){return t=+t,function(){av(this,e).delay=t}}function h8(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?d8:f8)(t,e)):pr(this.node(),t).delay}function m8(e,t){return function(){Ar(this,e).duration=+t.apply(this,arguments)}}function p8(e,t){return t=+t,function(){Ar(this,e).duration=t}}function g8(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?m8:p8)(t,e)):pr(this.node(),t).duration}function v8(e,t){if(typeof t!="function")throw new Error;return function(){Ar(this,e).ease=t}}function y8(e){var t=this._id;return arguments.length?this.each(v8(t,e)):pr(this.node(),t).ease}function x8(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Ar(this,e).ease=r}}function b8(e){if(typeof e!="function")throw new Error;return this.each(x8(this._id,e))}function w8(e){typeof e!="function"&&(e=gC(e));for(var t=this._groups,r=t.length,o=new Array(r),i=0;i<r;++i)for(var l=t[i],u=l.length,f=o[i]=[],m,h=0;h<u;++h)(m=l[h])&&e.call(m,m.__data__,h,l)&&f.push(m);return new la(o,this._parents,this._name,this._id)}function S8(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,o=t.length,i=r.length,l=Math.min(o,i),u=new Array(o),f=0;f<l;++f)for(var m=t[f],h=r[f],g=m.length,v=u[f]=new Array(g),b,w=0;w<g;++w)(b=m[w]||h[w])&&(v[w]=b);for(;f<o;++f)u[f]=t[f];return new la(u,this._parents,this._name,this._id)}function E8(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function N8(e,t,r){var o,i,l=E8(t)?av:Ar;return function(){var u=l(this,e),f=u.on;f!==o&&(i=(o=f).copy()).on(t,r),u.on=i}}function C8(e,t){var r=this._id;return arguments.length<2?pr(this.node(),r).on.on(e):this.each(N8(r,e,t))}function j8(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function _8(){return this.on("end.remove",j8(this._id))}function A8(e){var t=this._name,r=this._id;typeof e!="function"&&(e=ev(e));for(var o=this._groups,i=o.length,l=new Array(i),u=0;u<i;++u)for(var f=o[u],m=f.length,h=l[u]=new Array(m),g,v,b=0;b<m;++b)(g=f[b])&&(v=e.call(g,g.__data__,b,f))&&("__data__"in g&&(v.__data__=g.__data__),h[b]=v,Cf(h[b],t,r,b,h,pr(g,r)));return new la(l,this._parents,t,r)}function T8(e){var t=this._name,r=this._id;typeof e!="function"&&(e=pC(e));for(var o=this._groups,i=o.length,l=[],u=[],f=0;f<i;++f)for(var m=o[f],h=m.length,g,v=0;v<h;++v)if(g=m[v]){for(var b=e.call(g,g.__data__,v,m),w,E=pr(g,r),S=0,N=b.length;S<N;++S)(w=b[S])&&Cf(w,t,r,S,b,E);l.push(b),u.push(g)}return new la(l,u,t,r)}var R8=mc.prototype.constructor;function M8(){return new R8(this._groups,this._parents)}function D8(e,t){var r,o,i;return function(){var l=ri(this,e),u=(this.style.removeProperty(e),ri(this,e));return l===u?null:l===r&&u===o?i:i=t(r=l,o=u)}}function BC(e){return function(){this.style.removeProperty(e)}}function O8(e,t,r){var o,i=r+"",l;return function(){var u=ri(this,e);return u===i?null:u===o?l:l=t(o=u,r)}}function k8(e,t,r){var o,i,l;return function(){var u=ri(this,e),f=r(this),m=f+"";return f==null&&(m=f=(this.style.removeProperty(e),ri(this,e))),u===m?null:u===o&&m===i?l:(i=m,l=t(o=u,f))}}function z8(e,t){var r,o,i,l="style."+t,u="end."+l,f;return function(){var m=Ar(this,e),h=m.on,g=m.value[l]==null?f||(f=BC(t)):void 0;(h!==r||i!==g)&&(o=(r=h).copy()).on(u,i=g),m.on=o}}function L8(e,t,r){var o=(e+="")=="transform"?LP:UC;return t==null?this.styleTween(e,D8(e,o)).on("end.style."+e,BC(e)):typeof t=="function"?this.styleTween(e,k8(e,o,ov(this,"style."+e,t))).each(z8(this._id,e)):this.styleTween(e,O8(e,o,t),r).on("end.style."+e,null)}function P8(e,t,r){return function(o){this.style.setProperty(e,t.call(this,o),r)}}function U8(e,t,r){var o,i;function l(){var u=t.apply(this,arguments);return u!==i&&(o=(i=u)&&P8(e,u,r)),o}return l._value=t,l}function B8(e,t,r){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,U8(e,t,r??""))}function H8(e){return function(){this.textContent=e}}function $8(e){return function(){var t=e(this);this.textContent=t??""}}function I8(e){return this.tween("text",typeof e=="function"?$8(ov(this,"text",e)):H8(e==null?"":e+""))}function V8(e){return function(t){this.textContent=e.call(this,t)}}function q8(e){var t,r;function o(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&V8(i)),t}return o._value=e,o}function Y8(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,q8(e))}function G8(){for(var e=this._name,t=this._id,r=HC(),o=this._groups,i=o.length,l=0;l<i;++l)for(var u=o[l],f=u.length,m,h=0;h<f;++h)if(m=u[h]){var g=pr(m,t);Cf(m,e,r,h,u,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new la(o,this._parents,e,r)}function F8(){var e,t,r=this,o=r._id,i=r.size();return new Promise(function(l,u){var f={value:u},m={value:function(){--i===0&&l()}};r.each(function(){var h=Ar(this,o),g=h.on;g!==e&&(t=(e=g).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(m)),h.on=t}),i===0&&l()})}var X8=0;function la(e,t,r,o){this._groups=e,this._parents=t,this._name=r,this._id=o}function HC(){return++X8}var Wr=mc.prototype;la.prototype={constructor:la,select:A8,selectAll:T8,selectChild:Wr.selectChild,selectChildren:Wr.selectChildren,filter:w8,merge:S8,selection:M8,transition:G8,call:Wr.call,nodes:Wr.nodes,node:Wr.node,size:Wr.size,empty:Wr.empty,each:Wr.each,on:C8,attr:o8,attrTween:u8,style:L8,styleTween:B8,text:I8,textTween:Y8,remove:_8,tween:QP,delay:h8,duration:g8,ease:y8,easeVarying:b8,end:F8,[Symbol.iterator]:Wr[Symbol.iterator]};function W8(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var K8={time:null,delay:0,duration:250,ease:W8};function Z8(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function Q8(e){var t,r;e instanceof la?(t=e._id,e=e._name):(t=HC(),(r=K8).time=rv(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,l=0;l<i;++l)for(var u=o[l],f=u.length,m,h=0;h<f;++h)(m=u[h])&&Cf(m,e,t,h,u,r||Z8(m,t));return new la(o,this._parents,e,t)}mc.prototype.interrupt=WP;mc.prototype.transition=Q8;const Ku=e=>()=>e;function J8(e,{sourceEvent:t,target:r,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function Zr(e,t,r){this.k=e,this.x=t,this.y=r}Zr.prototype={constructor:Zr,scale:function(e){return e===1?this:new Zr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Zr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ea=new Zr(1,0,0);Zr.prototype;function gp(e){e.stopImmediatePropagation()}function El(e){e.preventDefault(),e.stopImmediatePropagation()}function eU(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function tU(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Dw(){return this.__zoom||ea}function nU(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function rU(){return navigator.maxTouchPoints||"ontouchstart"in this}function aU(e,t,r){var o=e.invertX(t[0][0])-r[0][0],i=e.invertX(t[1][0])-r[1][0],l=e.invertY(t[0][1])-r[0][1],u=e.invertY(t[1][1])-r[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function $C(){var e=eU,t=tU,r=aU,o=nU,i=rU,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,m=$P,h=Sf("start","zoom","end"),g,v,b,w=500,E=150,S=0,N=10;function C(k){k.property("__zoom",Dw).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",q).on("dblclick.zoom",Q).filter(i).on("touchstart.zoom",te).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(k,Y,M,$){var U=k.selection?k.selection():k;U.property("__zoom",Dw),k!==U?O(k,Y,M,$):U.interrupt().each(function(){L(this,arguments).event($).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},C.scaleBy=function(k,Y,M,$){C.scaleTo(k,function(){var U=this.__zoom.k,z=typeof Y=="function"?Y.apply(this,arguments):Y;return U*z},M,$)},C.scaleTo=function(k,Y,M,$){C.transform(k,function(){var U=t.apply(this,arguments),z=this.__zoom,R=M==null?_(U):typeof M=="function"?M.apply(this,arguments):M,V=z.invert(R),F=typeof Y=="function"?Y.apply(this,arguments):Y;return r(A(T(z,F),R,V),U,u)},M,$)},C.translateBy=function(k,Y,M,$){C.transform(k,function(){return r(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),u)},null,$)},C.translateTo=function(k,Y,M,$,U){C.transform(k,function(){var z=t.apply(this,arguments),R=this.__zoom,V=$==null?_(z):typeof $=="function"?$.apply(this,arguments):$;return r(ea.translate(V[0],V[1]).scale(R.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof M=="function"?-M.apply(this,arguments):-M),z,u)},$,U)};function T(k,Y){return Y=Math.max(l[0],Math.min(l[1],Y)),Y===k.k?k:new Zr(Y,k.x,k.y)}function A(k,Y,M){var $=Y[0]-M[0]*k.k,U=Y[1]-M[1]*k.k;return $===k.x&&U===k.y?k:new Zr(k.k,$,U)}function _(k){return[(+k[0][0]+ +k[1][0])/2,(+k[0][1]+ +k[1][1])/2]}function O(k,Y,M,$){k.on("start.zoom",function(){L(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event($).end()}).tween("zoom",function(){var U=this,z=arguments,R=L(U,z).event($),V=t.apply(U,z),F=M==null?_(V):typeof M=="function"?M.apply(U,z):M,K=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),re=U.__zoom,de=typeof Y=="function"?Y.apply(U,z):Y,se=m(re.invert(F).concat(K/re.k),de.invert(F).concat(K/de.k));return function(ie){if(ie===1)ie=de;else{var me=se(ie),pe=K/me[2];ie=new Zr(pe,F[0]-me[0]*pe,F[1]-me[1]*pe)}R.zoom(null,ie)}})}function L(k,Y,M){return!M&&k.__zooming||new B(k,Y)}function B(k,Y){this.that=k,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=t.apply(k,Y),this.taps=0}B.prototype={event:function(k){return k&&(this.sourceEvent=k),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(k,Y){return this.mouse&&k!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&k!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&k!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(k){var Y=In(this.that).datum();h.call(k,this.that,new J8(k,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:h}),Y)}};function I(k,...Y){if(!e.apply(this,arguments))return;var M=L(this,Y).event(k),$=this.__zoom,U=Math.max(l[0],Math.min(l[1],$.k*Math.pow(2,o.apply(this,arguments)))),z=er(k);if(M.wheel)(M.mouse[0][0]!==z[0]||M.mouse[0][1]!==z[1])&&(M.mouse[1]=$.invert(M.mouse[0]=z)),clearTimeout(M.wheel);else{if($.k===U)return;M.mouse=[z,$.invert(z)],pd(this),M.start()}El(k),M.wheel=setTimeout(R,E),M.zoom("mouse",r(A(T($,U),M.mouse[0],M.mouse[1]),M.extent,u));function R(){M.wheel=null,M.end()}}function q(k,...Y){if(b||!e.apply(this,arguments))return;var M=k.currentTarget,$=L(this,Y,!0).event(k),U=In(k.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",K,!0),z=er(k,M),R=k.clientX,V=k.clientY;jC(k.view),gp(k),$.mouse=[z,this.__zoom.invert(z)],pd(this),$.start();function F(re){if(El(re),!$.moved){var de=re.clientX-R,se=re.clientY-V;$.moved=de*de+se*se>S}$.event(re).zoom("mouse",r(A($.that.__zoom,$.mouse[0]=er(re,M),$.mouse[1]),$.extent,u))}function K(re){U.on("mousemove.zoom mouseup.zoom",null),_C(re.view,$.moved),El(re),$.event(re).end()}}function Q(k,...Y){if(e.apply(this,arguments)){var M=this.__zoom,$=er(k.changedTouches?k.changedTouches[0]:k,this),U=M.invert($),z=M.k*(k.shiftKey?.5:2),R=r(A(T(M,z),$,U),t.apply(this,Y),u);El(k),f>0?In(this).transition().duration(f).call(O,R,$,k):In(this).call(C.transform,R,$,k)}}function te(k,...Y){if(e.apply(this,arguments)){var M=k.touches,$=M.length,U=L(this,Y,k.changedTouches.length===$).event(k),z,R,V,F;for(gp(k),R=0;R<$;++R)V=M[R],F=er(V,this),F=[F,this.__zoom.invert(F),V.identifier],U.touch0?!U.touch1&&U.touch0[2]!==F[2]&&(U.touch1=F,U.taps=0):(U.touch0=F,z=!0,U.taps=1+!!g);g&&(g=clearTimeout(g)),z&&(U.taps<2&&(v=F[0],g=setTimeout(function(){g=null},w)),pd(this),U.start())}}function P(k,...Y){if(this.__zooming){var M=L(this,Y).event(k),$=k.changedTouches,U=$.length,z,R,V,F;for(El(k),z=0;z<U;++z)R=$[z],V=er(R,this),M.touch0&&M.touch0[2]===R.identifier?M.touch0[0]=V:M.touch1&&M.touch1[2]===R.identifier&&(M.touch1[0]=V);if(R=M.that.__zoom,M.touch1){var K=M.touch0[0],re=M.touch0[1],de=M.touch1[0],se=M.touch1[1],ie=(ie=de[0]-K[0])*ie+(ie=de[1]-K[1])*ie,me=(me=se[0]-re[0])*me+(me=se[1]-re[1])*me;R=T(R,Math.sqrt(ie/me)),V=[(K[0]+de[0])/2,(K[1]+de[1])/2],F=[(re[0]+se[0])/2,(re[1]+se[1])/2]}else if(M.touch0)V=M.touch0[0],F=M.touch0[1];else return;M.zoom("touch",r(A(R,V,F),M.extent,u))}}function W(k,...Y){if(this.__zooming){var M=L(this,Y).event(k),$=k.changedTouches,U=$.length,z,R;for(gp(k),b&&clearTimeout(b),b=setTimeout(function(){b=null},w),z=0;z<U;++z)R=$[z],M.touch0&&M.touch0[2]===R.identifier?delete M.touch0:M.touch1&&M.touch1[2]===R.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(R=er(R,this),Math.hypot(v[0]-R[0],v[1]-R[1])<N)){var V=In(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return C.wheelDelta=function(k){return arguments.length?(o=typeof k=="function"?k:Ku(+k),C):o},C.filter=function(k){return arguments.length?(e=typeof k=="function"?k:Ku(!!k),C):e},C.touchable=function(k){return arguments.length?(i=typeof k=="function"?k:Ku(!!k),C):i},C.extent=function(k){return arguments.length?(t=typeof k=="function"?k:Ku([[+k[0][0],+k[0][1]],[+k[1][0],+k[1][1]]]),C):t},C.scaleExtent=function(k){return arguments.length?(l[0]=+k[0],l[1]=+k[1],C):[l[0],l[1]]},C.translateExtent=function(k){return arguments.length?(u[0][0]=+k[0][0],u[1][0]=+k[1][0],u[0][1]=+k[0][1],u[1][1]=+k[1][1],C):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},C.constrain=function(k){return arguments.length?(r=k,C):r},C.duration=function(k){return arguments.length?(f=+k,C):f},C.interpolate=function(k){return arguments.length?(m=k,C):m},C.on=function(){var k=h.on.apply(h,arguments);return k===h?C:k},C.clickDistance=function(k){return arguments.length?(S=(k=+k)*k,C):Math.sqrt(S)},C.tapDistance=function(k){return arguments.length?(N=+k,C):N},C}const jf=x.createContext(null),oU=jf.Provider,ca={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},IC=ca.error001();function dt(e,t){const r=x.useContext(jf);if(r===null)throw new Error(IC);return hC(r,e,t)}const kt=()=>{const e=x.useContext(jf);if(e===null)throw new Error(IC);return x.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},sU=e=>e.userSelectionActive?"none":"all";function sv({position:e,children:t,className:r,style:o,...i}){const l=dt(sU),u=`${e}`.split("-");return ae.createElement("div",{className:Ft(["react-flow__panel",r,...u]),style:{...o,pointerEvents:l},...i},t)}function iU({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:ae.createElement(sv,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},ae.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const lU=({x:e,y:t,label:r,labelStyle:o={},labelShowBg:i=!0,labelBgStyle:l={},labelBgPadding:u=[2,4],labelBgBorderRadius:f=2,children:m,className:h,...g})=>{const v=x.useRef(null),[b,w]=x.useState({x:0,y:0,width:0,height:0}),E=Ft(["react-flow__edge-textwrapper",h]);return x.useEffect(()=>{if(v.current){const S=v.current.getBBox();w({x:S.x,y:S.y,width:S.width,height:S.height})}},[r]),typeof r>"u"||!r?null:ae.createElement("g",{transform:`translate(${e-b.width/2} ${t-b.height/2})`,className:E,visibility:b.width?"visible":"hidden",...g},i&&ae.createElement("rect",{width:b.width+2*u[0],x:-u[0],y:-u[1],height:b.height+2*u[1],className:"react-flow__edge-textbg",style:l,rx:f,ry:f}),ae.createElement("text",{className:"react-flow__edge-text",y:b.height/2,dy:"0.3em",ref:v,style:o},r),m)};var cU=x.memo(lU);const iv=e=>({width:e.offsetWidth,height:e.offsetHeight}),oi=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),lv=(e={x:0,y:0},t)=>({x:oi(e.x,t[0][0],t[1][0]),y:oi(e.y,t[0][1],t[1][1])}),Ow=(e,t,r)=>e<t?oi(Math.abs(e-t),1,50)/50:e>r?-oi(Math.abs(e-r),1,50)/50:0,VC=(e,t)=>{const r=Ow(e.x,35,t.width-35)*20,o=Ow(e.y,35,t.height-35)*20;return[r,o]},qC=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},YC=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Kl=({x:e,y:t,width:r,height:o})=>({x:e,y:t,x2:e+r,y2:t+o}),GC=({x:e,y:t,x2:r,y2:o})=>({x:e,y:t,width:r-e,height:o-t}),kw=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),uU=(e,t)=>GC(YC(Kl(e),Kl(t))),ng=(e,t)=>{const r=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(r*o)},dU=e=>Vn(e.width)&&Vn(e.height)&&Vn(e.x)&&Vn(e.y),Vn=e=>!isNaN(e)&&isFinite(e),xt=Symbol.for("internals"),FC=["Enter"," ","Escape"],fU=(e,t)=>{},hU=e=>"nativeEvent"in e;function rg(e){var i,l;const t=hU(e)?e.nativeEvent:e,r=((l=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:l[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(r==null?void 0:r.nodeName)||(r==null?void 0:r.hasAttribute("contenteditable"))||!!(r!=null&&r.closest(".nokey"))}const XC=e=>"clientX"in e,Za=(e,t)=>{var l,u;const r=XC(e),o=r?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,i=r?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:o-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},Pd=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},gc=({id:e,path:t,labelX:r,labelY:o,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:b,interactionWidth:w=20})=>ae.createElement(ae.Fragment,null,ae.createElement("path",{id:e,style:g,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:v,markerStart:b}),w&&ae.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:w,className:"react-flow__edge-interaction"}),i&&Vn(r)&&Vn(o)?ae.createElement(cU,{x:r,y:o,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:h}):null);gc.displayName="BaseEdge";function Nl(e,t,r){return r===void 0?r:o=>{const i=t().edges.find(l=>l.id===e);i&&r(o,{...i})}}function WC({sourceX:e,sourceY:t,targetX:r,targetY:o}){const i=Math.abs(r-e)/2,l=r<e?r+i:r-i,u=Math.abs(o-t)/2,f=o<t?o+u:o-u;return[l,f,i,u]}function KC({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:i,sourceControlY:l,targetControlX:u,targetControlY:f}){const m=e*.125+i*.375+u*.375+r*.125,h=t*.125+l*.375+f*.375+o*.125,g=Math.abs(m-e),v=Math.abs(h-t);return[m,h,g,v]}var Jo;(function(e){e.Strict="strict",e.Loose="loose"})(Jo||(Jo={}));var Lo;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Lo||(Lo={}));var Zl;(function(e){e.Partial="partial",e.Full="full"})(Zl||(Zl={}));var Kr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Kr||(Kr={}));var Ud;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ud||(Ud={}));var Ce;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ce||(Ce={}));function zw({pos:e,x1:t,y1:r,x2:o,y2:i}){return e===Ce.Left||e===Ce.Right?[.5*(t+o),r]:[t,.5*(r+i)]}function ZC({sourceX:e,sourceY:t,sourcePosition:r=Ce.Bottom,targetX:o,targetY:i,targetPosition:l=Ce.Top}){const[u,f]=zw({pos:r,x1:e,y1:t,x2:o,y2:i}),[m,h]=zw({pos:l,x1:o,y1:i,x2:e,y2:t}),[g,v,b,w]=KC({sourceX:e,sourceY:t,targetX:o,targetY:i,sourceControlX:u,sourceControlY:f,targetControlX:m,targetControlY:h});return[`M${e},${t} C${u},${f} ${m},${h} ${o},${i}`,g,v,b,w]}const cv=x.memo(({sourceX:e,sourceY:t,targetX:r,targetY:o,sourcePosition:i=Ce.Bottom,targetPosition:l=Ce.Top,label:u,labelStyle:f,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:E,interactionWidth:S})=>{const[N,C,T]=ZC({sourceX:e,sourceY:t,sourcePosition:i,targetX:r,targetY:o,targetPosition:l});return ae.createElement(gc,{path:N,labelX:C,labelY:T,label:u,labelStyle:f,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:E,interactionWidth:S})});cv.displayName="SimpleBezierEdge";const Lw={[Ce.Left]:{x:-1,y:0},[Ce.Right]:{x:1,y:0},[Ce.Top]:{x:0,y:-1},[Ce.Bottom]:{x:0,y:1}},mU=({source:e,sourcePosition:t=Ce.Bottom,target:r})=>t===Ce.Left||t===Ce.Right?e.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},Pw=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function pU({source:e,sourcePosition:t=Ce.Bottom,target:r,targetPosition:o=Ce.Top,center:i,offset:l}){const u=Lw[t],f=Lw[o],m={x:e.x+u.x*l,y:e.y+u.y*l},h={x:r.x+f.x*l,y:r.y+f.y*l},g=mU({source:m,sourcePosition:t,target:h}),v=g.x!==0?"x":"y",b=g[v];let w=[],E,S;const N={x:0,y:0},C={x:0,y:0},[T,A,_,O]=WC({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(u[v]*f[v]===-1){E=i.x??T,S=i.y??A;const B=[{x:E,y:m.y},{x:E,y:h.y}],I=[{x:m.x,y:S},{x:h.x,y:S}];u[v]===b?w=v==="x"?B:I:w=v==="x"?I:B}else{const B=[{x:m.x,y:h.y}],I=[{x:h.x,y:m.y}];if(v==="x"?w=u.x===b?I:B:w=u.y===b?B:I,t===o){const W=Math.abs(e[v]-r[v]);if(W<=l){const k=Math.min(l-1,l-W);u[v]===b?N[v]=(m[v]>e[v]?-1:1)*k:C[v]=(h[v]>r[v]?-1:1)*k}}if(t!==o){const W=v==="x"?"y":"x",k=u[v]===f[W],Y=m[W]>h[W],M=m[W]<h[W];(u[v]===1&&(!k&&Y||k&&M)||u[v]!==1&&(!k&&M||k&&Y))&&(w=v==="x"?B:I)}const q={x:m.x+N.x,y:m.y+N.y},Q={x:h.x+C.x,y:h.y+C.y},te=Math.max(Math.abs(q.x-w[0].x),Math.abs(Q.x-w[0].x)),P=Math.max(Math.abs(q.y-w[0].y),Math.abs(Q.y-w[0].y));te>=P?(E=(q.x+Q.x)/2,S=w[0].y):(E=w[0].x,S=(q.y+Q.y)/2)}return[[e,{x:m.x+N.x,y:m.y+N.y},...w,{x:h.x+C.x,y:h.y+C.y},r],E,S,_,O]}function gU(e,t,r,o){const i=Math.min(Pw(e,t)/2,Pw(t,r)/2,o),{x:l,y:u}=t;if(e.x===l&&l===r.x||e.y===u&&u===r.y)return`L${l} ${u}`;if(e.y===u){const h=e.x<r.x?-1:1,g=e.y<r.y?1:-1;return`L ${l+i*h},${u}Q ${l},${u} ${l},${u+i*g}`}const f=e.x<r.x?1:-1,m=e.y<r.y?-1:1;return`L ${l},${u+i*m}Q ${l},${u} ${l+i*f},${u}`}function ag({sourceX:e,sourceY:t,sourcePosition:r=Ce.Bottom,targetX:o,targetY:i,targetPosition:l=Ce.Top,borderRadius:u=5,centerX:f,centerY:m,offset:h=20}){const[g,v,b,w,E]=pU({source:{x:e,y:t},sourcePosition:r,target:{x:o,y:i},targetPosition:l,center:{x:f,y:m},offset:h});return[g.reduce((N,C,T)=>{let A="";return T>0&&T<g.length-1?A=gU(g[T-1],C,g[T+1],u):A=`${T===0?"M":"L"}${C.x} ${C.y}`,N+=A,N},""),v,b,w,E]}const _f=x.memo(({sourceX:e,sourceY:t,targetX:r,targetY:o,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:h,style:g,sourcePosition:v=Ce.Bottom,targetPosition:b=Ce.Top,markerEnd:w,markerStart:E,pathOptions:S,interactionWidth:N})=>{const[C,T,A]=ag({sourceX:e,sourceY:t,sourcePosition:v,targetX:r,targetY:o,targetPosition:b,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset});return ae.createElement(gc,{path:C,labelX:T,labelY:A,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:w,markerStart:E,interactionWidth:N})});_f.displayName="SmoothStepEdge";const uv=x.memo(e=>{var t;return ae.createElement(_f,{...e,pathOptions:x.useMemo(()=>{var r;return{borderRadius:0,offset:(r=e.pathOptions)==null?void 0:r.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});uv.displayName="StepEdge";function vU({sourceX:e,sourceY:t,targetX:r,targetY:o}){const[i,l,u,f]=WC({sourceX:e,sourceY:t,targetX:r,targetY:o});return[`M ${e},${t}L ${r},${o}`,i,l,u,f]}const dv=x.memo(({sourceX:e,sourceY:t,targetX:r,targetY:o,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:b,interactionWidth:w})=>{const[E,S,N]=vU({sourceX:e,sourceY:t,targetX:r,targetY:o});return ae.createElement(gc,{path:E,labelX:S,labelY:N,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:b,interactionWidth:w})});dv.displayName="StraightEdge";function Zu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Uw({pos:e,x1:t,y1:r,x2:o,y2:i,c:l}){switch(e){case Ce.Left:return[t-Zu(t-o,l),r];case Ce.Right:return[t+Zu(o-t,l),r];case Ce.Top:return[t,r-Zu(r-i,l)];case Ce.Bottom:return[t,r+Zu(i-r,l)]}}function QC({sourceX:e,sourceY:t,sourcePosition:r=Ce.Bottom,targetX:o,targetY:i,targetPosition:l=Ce.Top,curvature:u=.25}){const[f,m]=Uw({pos:r,x1:e,y1:t,x2:o,y2:i,c:u}),[h,g]=Uw({pos:l,x1:o,y1:i,x2:e,y2:t,c:u}),[v,b,w,E]=KC({sourceX:e,sourceY:t,targetX:o,targetY:i,sourceControlX:f,sourceControlY:m,targetControlX:h,targetControlY:g});return[`M${e},${t} C${f},${m} ${h},${g} ${o},${i}`,v,b,w,E]}const Bd=x.memo(({sourceX:e,sourceY:t,targetX:r,targetY:o,sourcePosition:i=Ce.Bottom,targetPosition:l=Ce.Top,label:u,labelStyle:f,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:E,pathOptions:S,interactionWidth:N})=>{const[C,T,A]=QC({sourceX:e,sourceY:t,sourcePosition:i,targetX:r,targetY:o,targetPosition:l,curvature:S==null?void 0:S.curvature});return ae.createElement(gc,{path:C,labelX:T,labelY:A,label:u,labelStyle:f,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:E,interactionWidth:N})});Bd.displayName="BezierEdge";const fv=x.createContext(null),yU=fv.Provider;fv.Consumer;const xU=()=>x.useContext(fv),bU=e=>"id"in e&&"source"in e&&"target"in e,wU=({source:e,sourceHandle:t,target:r,targetHandle:o})=>`reactflow__edge-${e}${t||""}-${r}${o||""}`,og=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`,SU=(e,t)=>t.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),JC=(e,t)=>{if(!e.source||!e.target)return t;let r;return bU(e)?r={...e}:r={...e,id:wU(e)},SU(r,t)?t:t.concat(r)},sg=({x:e,y:t},[r,o,i],l,[u,f])=>{const m={x:(e-r)/i,y:(t-o)/i};return l?{x:u*Math.round(m.x/u),y:f*Math.round(m.y/f)}:m},e2=({x:e,y:t},[r,o,i])=>({x:e*i+r,y:t*i+o}),Bo=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const r=(e.width??0)*t[0],o=(e.height??0)*t[1],i={x:e.position.x-r,y:e.position.y-o};return{...i,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-r,y:e.positionAbsolute.y-o}:i}},Af=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((o,i)=>{const{x:l,y:u}=Bo(i,t).positionAbsolute;return YC(o,Kl({x:l,y:u,width:i.width||0,height:i.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return GC(r)},t2=(e,t,[r,o,i]=[0,0,1],l=!1,u=!1,f=[0,0])=>{const m={x:(t.x-r)/i,y:(t.y-o)/i,width:t.width/i,height:t.height/i},h=[];return e.forEach(g=>{const{width:v,height:b,selectable:w=!0,hidden:E=!1}=g;if(u&&!w||E)return!1;const{positionAbsolute:S}=Bo(g,f),N={x:S.x,y:S.y,width:v||0,height:b||0},C=ng(m,N),T=typeof v>"u"||typeof b>"u"||v===null||b===null,A=l&&C>0,_=(v||0)*(b||0);(T||A||C>=_||g.dragging)&&h.push(g)}),h},n2=(e,t)=>{const r=e.map(o=>o.id);return t.filter(o=>r.includes(o.source)||r.includes(o.target))},r2=(e,t,r,o,i,l=.1)=>{const u=t/(e.width*(1+l)),f=r/(e.height*(1+l)),m=Math.min(u,f),h=oi(m,o,i),g=e.x+e.width/2,v=e.y+e.height/2,b=t/2-g*h,w=r/2-v*h;return{x:b,y:w,zoom:h}},Mo=(e,t=0)=>e.transition().duration(t);function Bw(e,t,r,o){return(t[r]||[]).reduce((i,l)=>{var u,f;return`${e.id}-${l.id}-${r}`!==o&&i.push({id:l.id||null,type:r,nodeId:e.id,x:(((u=e.positionAbsolute)==null?void 0:u.x)??0)+l.x+l.width/2,y:(((f=e.positionAbsolute)==null?void 0:f.y)??0)+l.y+l.height/2}),i},[])}function EU(e,t,r,o,i,l){const{x:u,y:f}=Za(e),h=t.elementsFromPoint(u,f).find(E=>E.classList.contains("react-flow__handle"));if(h){const E=h.getAttribute("data-nodeid");if(E){const S=hv(void 0,h),N=h.getAttribute("data-handleid"),C=l({nodeId:E,id:N,type:S});if(C){const T=i.find(A=>A.nodeId===E&&A.type===S&&A.id===N);return{handle:{id:N,type:S,nodeId:E,x:(T==null?void 0:T.x)||r.x,y:(T==null?void 0:T.y)||r.y},validHandleResult:C}}}}let g=[],v=1/0;if(i.forEach(E=>{const S=Math.sqrt((E.x-r.x)**2+(E.y-r.y)**2);if(S<=o){const N=l(E);S<=v&&(S<v?g=[{handle:E,validHandleResult:N}]:S===v&&g.push({handle:E,validHandleResult:N}),v=S)}}),!g.length)return{handle:null,validHandleResult:a2()};if(g.length===1)return g[0];const b=g.some(({validHandleResult:E})=>E.isValid),w=g.some(({handle:E})=>E.type==="target");return g.find(({handle:E,validHandleResult:S})=>w?E.type==="target":b?S.isValid:!0)||g[0]}const NU={source:null,target:null,sourceHandle:null,targetHandle:null},a2=()=>({handleDomNode:null,isValid:!1,connection:NU,endHandle:null});function o2(e,t,r,o,i,l,u){const f=i==="target",m=u.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),h={...a2(),handleDomNode:m};if(m){const g=hv(void 0,m),v=m.getAttribute("data-nodeid"),b=m.getAttribute("data-handleid"),w=m.classList.contains("connectable"),E=m.classList.contains("connectableend"),S={source:f?v:r,sourceHandle:f?b:o,target:f?r:v,targetHandle:f?o:b};h.connection=S,w&&E&&(t===Jo.Strict?f&&g==="source"||!f&&g==="target":v!==r||b!==o)&&(h.endHandle={nodeId:v,handleId:b,type:g},h.isValid=l(S))}return h}function CU({nodes:e,nodeId:t,handleId:r,handleType:o}){return e.reduce((i,l)=>{if(l[xt]){const{handleBounds:u}=l[xt];let f=[],m=[];u&&(f=Bw(l,u,"source",`${t}-${r}-${o}`),m=Bw(l,u,"target",`${t}-${r}-${o}`)),i.push(...f,...m)}return i},[])}function hv(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function vp(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function jU(e,t){let r=null;return t?r="valid":e&&!t&&(r="invalid"),r}function s2({event:e,handleId:t,nodeId:r,onConnect:o,isTarget:i,getState:l,setState:u,isValidConnection:f,edgeUpdaterType:m,onReconnectEnd:h}){const g=qC(e.target),{connectionMode:v,domNode:b,autoPanOnConnect:w,connectionRadius:E,onConnectStart:S,panBy:N,getNodes:C,cancelConnection:T}=l();let A=0,_;const{x:O,y:L}=Za(e),B=g==null?void 0:g.elementFromPoint(O,L),I=hv(m,B),q=b==null?void 0:b.getBoundingClientRect();if(!q||!I)return;let Q,te=Za(e,q),P=!1,W=null,k=!1,Y=null;const M=CU({nodes:C(),nodeId:r,handleId:t,handleType:I}),$=()=>{if(!w)return;const[R,V]=VC(te,q);N({x:R,y:V}),A=requestAnimationFrame($)};u({connectionPosition:te,connectionStatus:null,connectionNodeId:r,connectionHandleId:t,connectionHandleType:I,connectionStartHandle:{nodeId:r,handleId:t,type:I},connectionEndHandle:null}),S==null||S(e,{nodeId:r,handleId:t,handleType:I});function U(R){const{transform:V}=l();te=Za(R,q);const{handle:F,validHandleResult:K}=EU(R,g,sg(te,V,!1,[1,1]),E,M,re=>o2(re,v,r,t,i?"target":"source",f,g));if(_=F,P||($(),P=!0),Y=K.handleDomNode,W=K.connection,k=K.isValid,u({connectionPosition:_&&k?e2({x:_.x,y:_.y},V):te,connectionStatus:jU(!!_,k),connectionEndHandle:K.endHandle}),!_&&!k&&!Y)return vp(Q);W.source!==W.target&&Y&&(vp(Q),Q=Y,Y.classList.add("connecting","react-flow__handle-connecting"),Y.classList.toggle("valid",k),Y.classList.toggle("react-flow__handle-valid",k))}function z(R){var V,F;(_||Y)&&W&&k&&(o==null||o(W)),(F=(V=l()).onConnectEnd)==null||F.call(V,R),m&&(h==null||h(R)),vp(Q),T(),cancelAnimationFrame(A),P=!1,k=!1,W=null,Y=null,g.removeEventListener("mousemove",U),g.removeEventListener("mouseup",z),g.removeEventListener("touchmove",U),g.removeEventListener("touchend",z)}g.addEventListener("mousemove",U),g.addEventListener("mouseup",z),g.addEventListener("touchmove",U),g.addEventListener("touchend",z)}const Hw=()=>!0,_U=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),AU=(e,t,r)=>o=>{const{connectionStartHandle:i,connectionEndHandle:l,connectionClickStartHandle:u}=o;return{connecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===r||(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.handleId)===t&&(l==null?void 0:l.type)===r,clickConnecting:(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.handleId)===t&&(u==null?void 0:u.type)===r}},i2=x.forwardRef(({type:e="source",position:t=Ce.Top,isValidConnection:r,isConnectable:o=!0,isConnectableStart:i=!0,isConnectableEnd:l=!0,id:u,onConnect:f,children:m,className:h,onMouseDown:g,onTouchStart:v,...b},w)=>{var q,Q;const E=u||null,S=e==="target",N=kt(),C=xU(),{connectOnClick:T,noPanClassName:A}=dt(_U,It),{connecting:_,clickConnecting:O}=dt(AU(C,E,e),It);C||(Q=(q=N.getState()).onError)==null||Q.call(q,"010",ca.error010());const L=te=>{const{defaultEdgeOptions:P,onConnect:W,hasDefaultEdges:k}=N.getState(),Y={...P,...te};if(k){const{edges:M,setEdges:$}=N.getState();$(JC(Y,M))}W==null||W(Y),f==null||f(Y)},B=te=>{if(!C)return;const P=XC(te);i&&(P&&te.button===0||!P)&&s2({event:te,handleId:E,nodeId:C,onConnect:L,isTarget:S,getState:N.getState,setState:N.setState,isValidConnection:r||N.getState().isValidConnection||Hw}),P?g==null||g(te):v==null||v(te)},I=te=>{const{onClickConnectStart:P,onClickConnectEnd:W,connectionClickStartHandle:k,connectionMode:Y,isValidConnection:M}=N.getState();if(!C||!k&&!i)return;if(!k){P==null||P(te,{nodeId:C,handleId:E,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:C,type:e,handleId:E}});return}const $=qC(te.target),U=r||M||Hw,{connection:z,isValid:R}=o2({nodeId:C,id:E,type:e},Y,k.nodeId,k.handleId||null,k.type,U,$);R&&L(z),W==null||W(te),N.setState({connectionClickStartHandle:null})};return ae.createElement("div",{"data-handleid":E,"data-nodeid":C,"data-handlepos":t,"data-id":`${C}-${E}-${e}`,className:Ft(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",A,h,{source:!S,target:S,connectable:o,connectablestart:i,connectableend:l,connecting:O,connectionindicator:o&&(i&&!_||l&&_)}]),onMouseDown:B,onTouchStart:B,onClick:T?I:void 0,ref:w,...b},m)});i2.displayName="Handle";var si=x.memo(i2);const l2=({data:e,isConnectable:t,targetPosition:r=Ce.Top,sourcePosition:o=Ce.Bottom})=>ae.createElement(ae.Fragment,null,ae.createElement(si,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label,ae.createElement(si,{type:"source",position:o,isConnectable:t}));l2.displayName="DefaultNode";var ig=x.memo(l2);const c2=({data:e,isConnectable:t,sourcePosition:r=Ce.Bottom})=>ae.createElement(ae.Fragment,null,e==null?void 0:e.label,ae.createElement(si,{type:"source",position:r,isConnectable:t}));c2.displayName="InputNode";var u2=x.memo(c2);const d2=({data:e,isConnectable:t,targetPosition:r=Ce.Top})=>ae.createElement(ae.Fragment,null,ae.createElement(si,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label);d2.displayName="OutputNode";var f2=x.memo(d2);const mv=()=>null;mv.displayName="GroupNode";const TU=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),Qu=e=>e.id;function RU(e,t){return It(e.selectedNodes.map(Qu),t.selectedNodes.map(Qu))&&It(e.selectedEdges.map(Qu),t.selectedEdges.map(Qu))}const h2=x.memo(({onSelectionChange:e})=>{const t=kt(),{selectedNodes:r,selectedEdges:o}=dt(TU,RU);return x.useEffect(()=>{const i={nodes:r,edges:o};e==null||e(i),t.getState().onSelectionChange.forEach(l=>l(i))},[r,o,e]),null});h2.displayName="SelectionListener";const MU=e=>!!e.onSelectionChange;function DU({onSelectionChange:e}){const t=dt(MU);return e||t?ae.createElement(h2,{onSelectionChange:e}):null}const OU=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function qs(e,t){x.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function $e(e,t,r){x.useEffect(()=>{typeof t<"u"&&r({[e]:t})},[t])}const kU=({nodes:e,edges:t,defaultNodes:r,defaultEdges:o,onConnect:i,onConnectStart:l,onConnectEnd:u,onClickConnectStart:f,onClickConnectEnd:m,nodesDraggable:h,nodesConnectable:g,nodesFocusable:v,edgesFocusable:b,edgesUpdatable:w,elevateNodesOnSelect:E,minZoom:S,maxZoom:N,nodeExtent:C,onNodesChange:T,onEdgesChange:A,elementsSelectable:_,connectionMode:O,snapGrid:L,snapToGrid:B,translateExtent:I,connectOnClick:q,defaultEdgeOptions:Q,fitView:te,fitViewOptions:P,onNodesDelete:W,onEdgesDelete:k,onNodeDrag:Y,onNodeDragStart:M,onNodeDragStop:$,onSelectionDrag:U,onSelectionDragStart:z,onSelectionDragStop:R,noPanClassName:V,nodeOrigin:F,rfId:K,autoPanOnConnect:re,autoPanOnNodeDrag:de,onError:se,connectionRadius:ie,isValidConnection:me,nodeDragThreshold:pe})=>{const{setNodes:ge,setEdges:Se,setDefaultNodesAndEdges:we,setMinZoom:Ge,setMaxZoom:Ke,setTranslateExtent:Je,setNodeExtent:mt,reset:he}=dt(OU,It),fe=kt();return x.useEffect(()=>{const Te=o==null?void 0:o.map(qe=>({...qe,...Q}));return we(r,Te),()=>{he()}},[]),$e("defaultEdgeOptions",Q,fe.setState),$e("connectionMode",O,fe.setState),$e("onConnect",i,fe.setState),$e("onConnectStart",l,fe.setState),$e("onConnectEnd",u,fe.setState),$e("onClickConnectStart",f,fe.setState),$e("onClickConnectEnd",m,fe.setState),$e("nodesDraggable",h,fe.setState),$e("nodesConnectable",g,fe.setState),$e("nodesFocusable",v,fe.setState),$e("edgesFocusable",b,fe.setState),$e("edgesUpdatable",w,fe.setState),$e("elementsSelectable",_,fe.setState),$e("elevateNodesOnSelect",E,fe.setState),$e("snapToGrid",B,fe.setState),$e("snapGrid",L,fe.setState),$e("onNodesChange",T,fe.setState),$e("onEdgesChange",A,fe.setState),$e("connectOnClick",q,fe.setState),$e("fitViewOnInit",te,fe.setState),$e("fitViewOnInitOptions",P,fe.setState),$e("onNodesDelete",W,fe.setState),$e("onEdgesDelete",k,fe.setState),$e("onNodeDrag",Y,fe.setState),$e("onNodeDragStart",M,fe.setState),$e("onNodeDragStop",$,fe.setState),$e("onSelectionDrag",U,fe.setState),$e("onSelectionDragStart",z,fe.setState),$e("onSelectionDragStop",R,fe.setState),$e("noPanClassName",V,fe.setState),$e("nodeOrigin",F,fe.setState),$e("rfId",K,fe.setState),$e("autoPanOnConnect",re,fe.setState),$e("autoPanOnNodeDrag",de,fe.setState),$e("onError",se,fe.setState),$e("connectionRadius",ie,fe.setState),$e("isValidConnection",me,fe.setState),$e("nodeDragThreshold",pe,fe.setState),qs(e,ge),qs(t,Se),qs(S,Ge),qs(N,Ke),qs(I,Je),qs(C,mt),null},$w={display:"none"},zU={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},m2="react-flow__node-desc",p2="react-flow__edge-desc",LU="react-flow__aria-live",PU=e=>e.ariaLiveMessage;function UU({rfId:e}){const t=dt(PU);return ae.createElement("div",{id:`${LU}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:zU},t)}function BU({rfId:e,disableKeyboardA11y:t}){return ae.createElement(ae.Fragment,null,ae.createElement("div",{id:`${m2}-${e}`,style:$w},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),ae.createElement("div",{id:`${p2}-${e}`,style:$w},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&ae.createElement(UU,{rfId:e}))}var Ql=(e=null,t={actInsideInputWithModifier:!0})=>{const[r,o]=x.useState(!1),i=x.useRef(!1),l=x.useRef(new Set([])),[u,f]=x.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(v=>typeof v=="string").map(v=>v.split("+")),g=h.reduce((v,b)=>v.concat(...b),[]);return[h,g]}return[[],[]]},[e]);return x.useEffect(()=>{const m=typeof document<"u"?document:null,h=(t==null?void 0:t.target)||m;if(e!==null){const g=w=>{if(i.current=w.ctrlKey||w.metaKey||w.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&rg(w))return!1;const S=Vw(w.code,f);l.current.add(w[S]),Iw(u,l.current,!1)&&(w.preventDefault(),o(!0))},v=w=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&rg(w))return!1;const S=Vw(w.code,f);Iw(u,l.current,!0)?(o(!1),l.current.clear()):l.current.delete(w[S]),w.key==="Meta"&&l.current.clear(),i.current=!1},b=()=>{l.current.clear(),o(!1)};return h==null||h.addEventListener("keydown",g),h==null||h.addEventListener("keyup",v),window.addEventListener("blur",b),()=>{h==null||h.removeEventListener("keydown",g),h==null||h.removeEventListener("keyup",v),window.removeEventListener("blur",b)}}},[e,o]),r};function Iw(e,t,r){return e.filter(o=>r||o.length===t.size).some(o=>o.every(i=>t.has(i)))}function Vw(e,t){return t.includes(e)?"code":"key"}function g2(e,t,r,o){var f,m;const i=e.parentNode||e.parentId;if(!i)return r;const l=t.get(i),u=Bo(l,o);return g2(l,t,{x:(r.x??0)+u.x,y:(r.y??0)+u.y,z:(((f=l[xt])==null?void 0:f.z)??0)>(r.z??0)?((m=l[xt])==null?void 0:m.z)??0:r.z??0},o)}function v2(e,t,r){e.forEach(o=>{var l;const i=o.parentNode||o.parentId;if(i&&!e.has(i))throw new Error(`Parent node ${i} not found`);if(i||r!=null&&r[o.id]){const{x:u,y:f,z:m}=g2(o,e,{...o.position,z:((l=o[xt])==null?void 0:l.z)??0},t);o.positionAbsolute={x:u,y:f},o[xt].z=m,r!=null&&r[o.id]&&(o[xt].isParent=!0)}})}function yp(e,t,r,o){const i=new Map,l={},u=o?1e3:0;return e.forEach(f=>{var w;const m=(Vn(f.zIndex)?f.zIndex:0)+(f.selected?u:0),h=t.get(f.id),g={...f,positionAbsolute:{x:f.position.x,y:f.position.y}},v=f.parentNode||f.parentId;v&&(l[v]=!0);const b=(h==null?void 0:h.type)&&(h==null?void 0:h.type)!==f.type;Object.defineProperty(g,xt,{enumerable:!1,value:{handleBounds:b||(w=h==null?void 0:h[xt])==null?void 0:w.handleBounds,z:m}}),i.set(f.id,g)}),v2(i,r,l),i}function y2(e,t={}){const{getNodes:r,width:o,height:i,minZoom:l,maxZoom:u,d3Zoom:f,d3Selection:m,fitViewOnInitDone:h,fitViewOnInit:g,nodeOrigin:v}=e(),b=t.initial&&!h&&g;if(f&&m&&(b||!t.initial)){const E=r().filter(N=>{var T;const C=t.includeHiddenNodes?N.width&&N.height:!N.hidden;return(T=t.nodes)!=null&&T.length?C&&t.nodes.some(A=>A.id===N.id):C}),S=E.every(N=>N.width&&N.height);if(E.length>0&&S){const N=Af(E,v),{x:C,y:T,zoom:A}=r2(N,o,i,t.minZoom??l,t.maxZoom??u,t.padding??.1),_=ea.translate(C,T).scale(A);return typeof t.duration=="number"&&t.duration>0?f.transform(Mo(m,t.duration),_):f.transform(m,_),!0}}return!1}function HU(e,t){return e.forEach(r=>{const o=t.get(r.id);o&&t.set(o.id,{...o,[xt]:o[xt],selected:r.selected})}),new Map(t)}function $U(e,t){return t.map(r=>{const o=e.find(i=>i.id===r.id);return o&&(r.selected=o.selected),r})}function Ju({changedNodes:e,changedEdges:t,get:r,set:o}){const{nodeInternals:i,edges:l,onNodesChange:u,onEdgesChange:f,hasDefaultNodes:m,hasDefaultEdges:h}=r();e!=null&&e.length&&(m&&o({nodeInternals:HU(e,i)}),u==null||u(e)),t!=null&&t.length&&(h&&o({edges:$U(t,l)}),f==null||f(t))}const Ys=()=>{},IU={zoomIn:Ys,zoomOut:Ys,zoomTo:Ys,getZoom:()=>1,setViewport:Ys,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Ys,fitBounds:Ys,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},VU=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),qU=()=>{const e=kt(),{d3Zoom:t,d3Selection:r}=dt(VU,It);return x.useMemo(()=>r&&t?{zoomIn:i=>t.scaleBy(Mo(r,i==null?void 0:i.duration),1.2),zoomOut:i=>t.scaleBy(Mo(r,i==null?void 0:i.duration),1/1.2),zoomTo:(i,l)=>t.scaleTo(Mo(r,l==null?void 0:l.duration),i),getZoom:()=>e.getState().transform[2],setViewport:(i,l)=>{const[u,f,m]=e.getState().transform,h=ea.translate(i.x??u,i.y??f).scale(i.zoom??m);t.transform(Mo(r,l==null?void 0:l.duration),h)},getViewport:()=>{const[i,l,u]=e.getState().transform;return{x:i,y:l,zoom:u}},fitView:i=>y2(e.getState,i),setCenter:(i,l,u)=>{const{width:f,height:m,maxZoom:h}=e.getState(),g=typeof(u==null?void 0:u.zoom)<"u"?u.zoom:h,v=f/2-i*g,b=m/2-l*g,w=ea.translate(v,b).scale(g);t.transform(Mo(r,u==null?void 0:u.duration),w)},fitBounds:(i,l)=>{const{width:u,height:f,minZoom:m,maxZoom:h}=e.getState(),{x:g,y:v,zoom:b}=r2(i,u,f,m,h,(l==null?void 0:l.padding)??.1),w=ea.translate(g,v).scale(b);t.transform(Mo(r,l==null?void 0:l.duration),w)},project:i=>{const{transform:l,snapToGrid:u,snapGrid:f}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),sg(i,l,u,f)},screenToFlowPosition:i=>{const{transform:l,snapToGrid:u,snapGrid:f,domNode:m}=e.getState();if(!m)return i;const{x:h,y:g}=m.getBoundingClientRect(),v={x:i.x-h,y:i.y-g};return sg(v,l,u,f)},flowToScreenPosition:i=>{const{transform:l,domNode:u}=e.getState();if(!u)return i;const{x:f,y:m}=u.getBoundingClientRect(),h=e2(i,l);return{x:h.x+f,y:h.y+m}},viewportInitialized:!0}:IU,[t,r])};function pv(){const e=qU(),t=kt(),r=x.useCallback(()=>t.getState().getNodes().map(S=>({...S})),[]),o=x.useCallback(S=>t.getState().nodeInternals.get(S),[]),i=x.useCallback(()=>{const{edges:S=[]}=t.getState();return S.map(N=>({...N}))},[]),l=x.useCallback(S=>{const{edges:N=[]}=t.getState();return N.find(C=>C.id===S)},[]),u=x.useCallback(S=>{const{getNodes:N,setNodes:C,hasDefaultNodes:T,onNodesChange:A}=t.getState(),_=N(),O=typeof S=="function"?S(_):S;if(T)C(O);else if(A){const L=O.length===0?_.map(B=>({type:"remove",id:B.id})):O.map(B=>({item:B,type:"reset"}));A(L)}},[]),f=x.useCallback(S=>{const{edges:N=[],setEdges:C,hasDefaultEdges:T,onEdgesChange:A}=t.getState(),_=typeof S=="function"?S(N):S;if(T)C(_);else if(A){const O=_.length===0?N.map(L=>({type:"remove",id:L.id})):_.map(L=>({item:L,type:"reset"}));A(O)}},[]),m=x.useCallback(S=>{const N=Array.isArray(S)?S:[S],{getNodes:C,setNodes:T,hasDefaultNodes:A,onNodesChange:_}=t.getState();if(A){const L=[...C(),...N];T(L)}else if(_){const O=N.map(L=>({item:L,type:"add"}));_(O)}},[]),h=x.useCallback(S=>{const N=Array.isArray(S)?S:[S],{edges:C=[],setEdges:T,hasDefaultEdges:A,onEdgesChange:_}=t.getState();if(A)T([...C,...N]);else if(_){const O=N.map(L=>({item:L,type:"add"}));_(O)}},[]),g=x.useCallback(()=>{const{getNodes:S,edges:N=[],transform:C}=t.getState(),[T,A,_]=C;return{nodes:S().map(O=>({...O})),edges:N.map(O=>({...O})),viewport:{x:T,y:A,zoom:_}}},[]),v=x.useCallback(({nodes:S,edges:N})=>{const{nodeInternals:C,getNodes:T,edges:A,hasDefaultNodes:_,hasDefaultEdges:O,onNodesDelete:L,onEdgesDelete:B,onNodesChange:I,onEdgesChange:q}=t.getState(),Q=(S||[]).map(Y=>Y.id),te=(N||[]).map(Y=>Y.id),P=T().reduce((Y,M)=>{const $=M.parentNode||M.parentId,U=!Q.includes(M.id)&&$&&Y.find(R=>R.id===$);return(typeof M.deletable=="boolean"?M.deletable:!0)&&(Q.includes(M.id)||U)&&Y.push(M),Y},[]),W=A.filter(Y=>typeof Y.deletable=="boolean"?Y.deletable:!0),k=W.filter(Y=>te.includes(Y.id));if(P||k){const Y=n2(P,W),M=[...k,...Y],$=M.reduce((U,z)=>(U.includes(z.id)||U.push(z.id),U),[]);if((O||_)&&(O&&t.setState({edges:A.filter(U=>!$.includes(U.id))}),_&&(P.forEach(U=>{C.delete(U.id)}),t.setState({nodeInternals:new Map(C)}))),$.length>0&&(B==null||B(M),q&&q($.map(U=>({id:U,type:"remove"})))),P.length>0&&(L==null||L(P),I)){const U=P.map(z=>({id:z.id,type:"remove"}));I(U)}}},[]),b=x.useCallback(S=>{const N=dU(S),C=N?null:t.getState().nodeInternals.get(S.id);return!N&&!C?[null,null,N]:[N?S:kw(C),C,N]},[]),w=x.useCallback((S,N=!0,C)=>{const[T,A,_]=b(S);return T?(C||t.getState().getNodes()).filter(O=>{if(!_&&(O.id===A.id||!O.positionAbsolute))return!1;const L=kw(O),B=ng(L,T);return N&&B>0||B>=T.width*T.height}):[]},[]),E=x.useCallback((S,N,C=!0)=>{const[T]=b(S);if(!T)return!1;const A=ng(T,N);return C&&A>0||A>=T.width*T.height},[]);return x.useMemo(()=>({...e,getNodes:r,getNode:o,getEdges:i,getEdge:l,setNodes:u,setEdges:f,addNodes:m,addEdges:h,toObject:g,deleteElements:v,getIntersectingNodes:w,isNodeIntersecting:E}),[e,r,o,i,l,u,f,m,h,g,v,w,E])}const YU={actInsideInputWithModifier:!1};var GU=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const r=kt(),{deleteElements:o}=pv(),i=Ql(e,YU),l=Ql(t);x.useEffect(()=>{if(i){const{edges:u,getNodes:f}=r.getState(),m=f().filter(g=>g.selected),h=u.filter(g=>g.selected);o({nodes:m,edges:h}),r.setState({nodesSelectionActive:!1})}},[i]),x.useEffect(()=>{r.setState({multiSelectionActive:l})},[l])};function FU(e){const t=kt();x.useEffect(()=>{let r;const o=()=>{var l,u;if(!e.current)return;const i=iv(e.current);(i.height===0||i.width===0)&&((u=(l=t.getState()).onError)==null||u.call(l,"004",ca.error004())),t.setState({width:i.width||500,height:i.height||500})};return o(),window.addEventListener("resize",o),e.current&&(r=new ResizeObserver(()=>o()),r.observe(e.current)),()=>{window.removeEventListener("resize",o),r&&e.current&&r.unobserve(e.current)}},[])}const gv={position:"absolute",width:"100%",height:"100%",top:0,left:0},XU=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,ed=e=>({x:e.x,y:e.y,zoom:e.k}),Gs=(e,t)=>e.target.closest(`.${t}`),qw=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Yw=e=>{const t=e.ctrlKey&&Pd()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},WU=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),KU=({onMove:e,onMoveStart:t,onMoveEnd:r,onPaneContextMenu:o,zoomOnScroll:i=!0,zoomOnPinch:l=!0,panOnScroll:u=!1,panOnScrollSpeed:f=.5,panOnScrollMode:m=Lo.Free,zoomOnDoubleClick:h=!0,elementsSelectable:g,panOnDrag:v=!0,defaultViewport:b,translateExtent:w,minZoom:E,maxZoom:S,zoomActivationKeyCode:N,preventScrolling:C=!0,children:T,noWheelClassName:A,noPanClassName:_})=>{const O=x.useRef(),L=kt(),B=x.useRef(!1),I=x.useRef(!1),q=x.useRef(null),Q=x.useRef({x:0,y:0,zoom:0}),{d3Zoom:te,d3Selection:P,d3ZoomHandler:W,userSelectionActive:k}=dt(WU,It),Y=Ql(N),M=x.useRef(0),$=x.useRef(!1),U=x.useRef();return FU(q),x.useEffect(()=>{if(q.current){const z=q.current.getBoundingClientRect(),R=$C().scaleExtent([E,S]).translateExtent(w),V=In(q.current).call(R),F=ea.translate(b.x,b.y).scale(oi(b.zoom,E,S)),K=[[0,0],[z.width,z.height]],re=R.constrain()(F,K,w);R.transform(V,re),R.wheelDelta(Yw),L.setState({d3Zoom:R,d3Selection:V,d3ZoomHandler:V.on("wheel.zoom"),transform:[re.x,re.y,re.k],domNode:q.current.closest(".react-flow")})}},[]),x.useEffect(()=>{P&&te&&(u&&!Y&&!k?P.on("wheel.zoom",z=>{if(Gs(z,A))return!1;z.preventDefault(),z.stopImmediatePropagation();const R=P.property("__zoom").k||1;if(z.ctrlKey&&l){const me=er(z),pe=Yw(z),ge=R*Math.pow(2,pe);te.scaleTo(P,ge,me,z);return}const V=z.deltaMode===1?20:1;let F=m===Lo.Vertical?0:z.deltaX*V,K=m===Lo.Horizontal?0:z.deltaY*V;!Pd()&&z.shiftKey&&m!==Lo.Vertical&&(F=z.deltaY*V,K=0),te.translateBy(P,-(F/R)*f,-(K/R)*f,{internal:!0});const re=ed(P.property("__zoom")),{onViewportChangeStart:de,onViewportChange:se,onViewportChangeEnd:ie}=L.getState();clearTimeout(U.current),$.current||($.current=!0,t==null||t(z,re),de==null||de(re)),$.current&&(e==null||e(z,re),se==null||se(re),U.current=setTimeout(()=>{r==null||r(z,re),ie==null||ie(re),$.current=!1},150))},{passive:!1}):typeof W<"u"&&P.on("wheel.zoom",function(z,R){if(!C&&z.type==="wheel"&&!z.ctrlKey||Gs(z,A))return null;z.preventDefault(),W.call(this,z,R)},{passive:!1}))},[k,u,m,P,te,W,Y,l,C,A,t,e,r]),x.useEffect(()=>{te&&te.on("start",z=>{var F,K;if(!z.sourceEvent||z.sourceEvent.internal)return null;M.current=(F=z.sourceEvent)==null?void 0:F.button;const{onViewportChangeStart:R}=L.getState(),V=ed(z.transform);B.current=!0,Q.current=V,((K=z.sourceEvent)==null?void 0:K.type)==="mousedown"&&L.setState({paneDragging:!0}),R==null||R(V),t==null||t(z.sourceEvent,V)})},[te,t]),x.useEffect(()=>{te&&(k&&!B.current?te.on("zoom",null):k||te.on("zoom",z=>{var V;const{onViewportChange:R}=L.getState();if(L.setState({transform:[z.transform.x,z.transform.y,z.transform.k]}),I.current=!!(o&&qw(v,M.current??0)),(e||R)&&!((V=z.sourceEvent)!=null&&V.internal)){const F=ed(z.transform);R==null||R(F),e==null||e(z.sourceEvent,F)}}))},[k,te,e,v,o]),x.useEffect(()=>{te&&te.on("end",z=>{if(!z.sourceEvent||z.sourceEvent.internal)return null;const{onViewportChangeEnd:R}=L.getState();if(B.current=!1,L.setState({paneDragging:!1}),o&&qw(v,M.current??0)&&!I.current&&o(z.sourceEvent),I.current=!1,(r||R)&&XU(Q.current,z.transform)){const V=ed(z.transform);Q.current=V,clearTimeout(O.current),O.current=setTimeout(()=>{R==null||R(V),r==null||r(z.sourceEvent,V)},u?150:0)}})},[te,u,v,r,o]),x.useEffect(()=>{te&&te.filter(z=>{const R=Y||i,V=l&&z.ctrlKey;if((v===!0||Array.isArray(v)&&v.includes(1))&&z.button===1&&z.type==="mousedown"&&(Gs(z,"react-flow__node")||Gs(z,"react-flow__edge")))return!0;if(!v&&!R&&!u&&!h&&!l||k||!h&&z.type==="dblclick"||Gs(z,A)&&z.type==="wheel"||Gs(z,_)&&(z.type!=="wheel"||u&&z.type==="wheel"&&!Y)||!l&&z.ctrlKey&&z.type==="wheel"||!R&&!u&&!V&&z.type==="wheel"||!v&&(z.type==="mousedown"||z.type==="touchstart")||Array.isArray(v)&&!v.includes(z.button)&&z.type==="mousedown")return!1;const F=Array.isArray(v)&&v.includes(z.button)||!z.button||z.button<=1;return(!z.ctrlKey||z.type==="wheel")&&F})},[k,te,i,l,u,h,v,g,Y]),ae.createElement("div",{className:"react-flow__renderer",ref:q,style:gv},T)},ZU=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function QU(){const{userSelectionActive:e,userSelectionRect:t}=dt(ZU,It);return e&&t?ae.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function Gw(e,t){const r=t.parentNode||t.parentId,o=e.find(i=>i.id===r);if(o){const i=t.position.x+t.width-o.width,l=t.position.y+t.height-o.height;if(i>0||l>0||t.position.x<0||t.position.y<0){if(o.style={...o.style},o.style.width=o.style.width??o.width,o.style.height=o.style.height??o.height,i>0&&(o.style.width+=i),l>0&&(o.style.height+=l),t.position.x<0){const u=Math.abs(t.position.x);o.position.x=o.position.x-u,o.style.width+=u,t.position.x=0}if(t.position.y<0){const u=Math.abs(t.position.y);o.position.y=o.position.y-u,o.style.height+=u,t.position.y=0}o.width=o.style.width,o.height=o.style.height}}}function x2(e,t){if(e.some(o=>o.type==="reset"))return e.filter(o=>o.type==="reset").map(o=>o.item);const r=e.filter(o=>o.type==="add").map(o=>o.item);return t.reduce((o,i)=>{const l=e.filter(f=>f.id===i.id);if(l.length===0)return o.push(i),o;const u={...i};for(const f of l)if(f)switch(f.type){case"select":{u.selected=f.selected;break}case"position":{typeof f.position<"u"&&(u.position=f.position),typeof f.positionAbsolute<"u"&&(u.positionAbsolute=f.positionAbsolute),typeof f.dragging<"u"&&(u.dragging=f.dragging),u.expandParent&&Gw(o,u);break}case"dimensions":{typeof f.dimensions<"u"&&(u.width=f.dimensions.width,u.height=f.dimensions.height),typeof f.updateStyle<"u"&&(u.style={...u.style||{},...f.dimensions}),typeof f.resizing=="boolean"&&(u.resizing=f.resizing),u.expandParent&&Gw(o,u);break}case"remove":return o}return o.push(u),o},r)}function b2(e,t){return x2(e,t)}function JU(e,t){return x2(e,t)}const Xa=(e,t)=>({id:e,type:"select",selected:t});function Ks(e,t){return e.reduce((r,o)=>{const i=t.includes(o.id);return!o.selected&&i?(o.selected=!0,r.push(Xa(o.id,!0))):o.selected&&!i&&(o.selected=!1,r.push(Xa(o.id,!1))),r},[])}const xp=(e,t)=>r=>{r.target===t.current&&(e==null||e(r))},eB=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),w2=x.memo(({isSelecting:e,selectionMode:t=Zl.Full,panOnDrag:r,onSelectionStart:o,onSelectionEnd:i,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:f,onPaneMouseEnter:m,onPaneMouseMove:h,onPaneMouseLeave:g,children:v})=>{const b=x.useRef(null),w=kt(),E=x.useRef(0),S=x.useRef(0),N=x.useRef(),{userSelectionActive:C,elementsSelectable:T,dragging:A}=dt(eB,It),_=()=>{w.setState({userSelectionActive:!1,userSelectionRect:null}),E.current=0,S.current=0},O=W=>{l==null||l(W),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},L=W=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){W.preventDefault();return}u==null||u(W)},B=f?W=>f(W):void 0,I=W=>{const{resetSelectedElements:k,domNode:Y}=w.getState();if(N.current=Y==null?void 0:Y.getBoundingClientRect(),!T||!e||W.button!==0||W.target!==b.current||!N.current)return;const{x:M,y:$}=Za(W,N.current);k(),w.setState({userSelectionRect:{width:0,height:0,startX:M,startY:$,x:M,y:$}}),o==null||o(W)},q=W=>{const{userSelectionRect:k,nodeInternals:Y,edges:M,transform:$,onNodesChange:U,onEdgesChange:z,nodeOrigin:R,getNodes:V}=w.getState();if(!e||!N.current||!k)return;w.setState({userSelectionActive:!0,nodesSelectionActive:!1});const F=Za(W,N.current),K=k.startX??0,re=k.startY??0,de={...k,x:F.x<K?F.x:K,y:F.y<re?F.y:re,width:Math.abs(F.x-K),height:Math.abs(F.y-re)},se=V(),ie=t2(Y,de,$,t===Zl.Partial,!0,R),me=n2(ie,M).map(ge=>ge.id),pe=ie.map(ge=>ge.id);if(E.current!==pe.length){E.current=pe.length;const ge=Ks(se,pe);ge.length&&(U==null||U(ge))}if(S.current!==me.length){S.current=me.length;const ge=Ks(M,me);ge.length&&(z==null||z(ge))}w.setState({userSelectionRect:de})},Q=W=>{if(W.button!==0)return;const{userSelectionRect:k}=w.getState();!C&&k&&W.target===b.current&&(O==null||O(W)),w.setState({nodesSelectionActive:E.current>0}),_(),i==null||i(W)},te=W=>{C&&(w.setState({nodesSelectionActive:E.current>0}),i==null||i(W)),_()},P=T&&(e||C);return ae.createElement("div",{className:Ft(["react-flow__pane",{dragging:A,selection:e}]),onClick:P?void 0:xp(O,b),onContextMenu:xp(L,b),onWheel:xp(B,b),onMouseEnter:P?void 0:m,onMouseDown:P?I:void 0,onMouseMove:P?q:h,onMouseUp:P?Q:void 0,onMouseLeave:P?te:g,ref:b,style:gv},v,ae.createElement(QU,null))});w2.displayName="Pane";function S2(e,t){const r=e.parentNode||e.parentId;if(!r)return!1;const o=t.get(r);return o?o.selected?!0:S2(o,t):!1}function Fw(e,t,r){let o=e;do{if(o!=null&&o.matches(t))return!0;if(o===r.current)return!1;o=o.parentElement}while(o);return!1}function tB(e,t,r,o){return Array.from(e.values()).filter(i=>(i.selected||i.id===o)&&(!i.parentNode||i.parentId||!S2(i,e))&&(i.draggable||t&&typeof i.draggable>"u")).map(i=>{var l,u;return{id:i.id,position:i.position||{x:0,y:0},positionAbsolute:i.positionAbsolute||{x:0,y:0},distance:{x:r.x-(((l=i.positionAbsolute)==null?void 0:l.x)??0),y:r.y-(((u=i.positionAbsolute)==null?void 0:u.y)??0)},delta:{x:0,y:0},extent:i.extent,parentNode:i.parentNode||i.parentId,parentId:i.parentNode||i.parentId,width:i.width,height:i.height,expandParent:i.expandParent}})}function nB(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function E2(e,t,r,o,i=[0,0],l){const u=nB(e,e.extent||o);let f=u;const m=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(m&&e.width&&e.height){const v=r.get(m),{x:b,y:w}=Bo(v,i).positionAbsolute;f=v&&Vn(b)&&Vn(w)&&Vn(v.width)&&Vn(v.height)?[[b+e.width*i[0],w+e.height*i[1]],[b+v.width-e.width+e.width*i[0],w+v.height-e.height+e.height*i[1]]]:f}else l==null||l("005",ca.error005()),f=u;else if(e.extent&&m&&e.extent!=="parent"){const v=r.get(m),{x:b,y:w}=Bo(v,i).positionAbsolute;f=[[e.extent[0][0]+b,e.extent[0][1]+w],[e.extent[1][0]+b,e.extent[1][1]+w]]}let h={x:0,y:0};if(m){const v=r.get(m);h=Bo(v,i).positionAbsolute}const g=f&&f!=="parent"?lv(t,f):t;return{position:{x:g.x-h.x,y:g.y-h.y},positionAbsolute:g}}function bp({nodeId:e,dragItems:t,nodeInternals:r}){const o=t.map(i=>({...r.get(i.id),position:i.position,positionAbsolute:i.positionAbsolute}));return[e?o.find(i=>i.id===e):o[0],o]}const Xw=(e,t,r,o)=>{const i=t.querySelectorAll(e);if(!i||!i.length)return null;const l=Array.from(i),u=t.getBoundingClientRect(),f={x:u.width*o[0],y:u.height*o[1]};return l.map(m=>{const h=m.getBoundingClientRect();return{id:m.getAttribute("data-handleid"),position:m.getAttribute("data-handlepos"),x:(h.left-u.left-f.x)/r,y:(h.top-u.top-f.y)/r,...iv(m)}})};function Cl(e,t,r){return r===void 0?r:o=>{const i=t().nodeInternals.get(e);i&&r(o,{...i})}}function lg({id:e,store:t,unselect:r=!1,nodeRef:o}){const{addSelectedNodes:i,unselectNodesAndEdges:l,multiSelectionActive:u,nodeInternals:f,onError:m}=t.getState(),h=f.get(e);if(!h){m==null||m("012",ca.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(r||h.selected&&u)&&(l({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var g;return(g=o==null?void 0:o.current)==null?void 0:g.blur()})):i([e])}function rB(){const e=kt();return x.useCallback(({sourceEvent:r})=>{const{transform:o,snapGrid:i,snapToGrid:l}=e.getState(),u=r.touches?r.touches[0].clientX:r.clientX,f=r.touches?r.touches[0].clientY:r.clientY,m={x:(u-o[0])/o[2],y:(f-o[1])/o[2]};return{xSnapped:l?i[0]*Math.round(m.x/i[0]):m.x,ySnapped:l?i[1]*Math.round(m.y/i[1]):m.y,...m}},[])}function wp(e){return(t,r,o)=>e==null?void 0:e(t,o)}function N2({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:o,nodeId:i,isSelectable:l,selectNodesOnDrag:u}){const f=kt(),[m,h]=x.useState(!1),g=x.useRef([]),v=x.useRef({x:null,y:null}),b=x.useRef(0),w=x.useRef(null),E=x.useRef({x:0,y:0}),S=x.useRef(null),N=x.useRef(!1),C=x.useRef(!1),T=x.useRef(!1),A=rB();return x.useEffect(()=>{if(e!=null&&e.current){const _=In(e.current),O=({x:I,y:q})=>{const{nodeInternals:Q,onNodeDrag:te,onSelectionDrag:P,updateNodePositions:W,nodeExtent:k,snapGrid:Y,snapToGrid:M,nodeOrigin:$,onError:U}=f.getState();v.current={x:I,y:q};let z=!1,R={x:0,y:0,x2:0,y2:0};if(g.current.length>1&&k){const F=Af(g.current,$);R=Kl(F)}if(g.current=g.current.map(F=>{const K={x:I-F.distance.x,y:q-F.distance.y};M&&(K.x=Y[0]*Math.round(K.x/Y[0]),K.y=Y[1]*Math.round(K.y/Y[1]));const re=[[k[0][0],k[0][1]],[k[1][0],k[1][1]]];g.current.length>1&&k&&!F.extent&&(re[0][0]=F.positionAbsolute.x-R.x+k[0][0],re[1][0]=F.positionAbsolute.x+(F.width??0)-R.x2+k[1][0],re[0][1]=F.positionAbsolute.y-R.y+k[0][1],re[1][1]=F.positionAbsolute.y+(F.height??0)-R.y2+k[1][1]);const de=E2(F,K,Q,re,$,U);return z=z||F.position.x!==de.position.x||F.position.y!==de.position.y,F.position=de.position,F.positionAbsolute=de.positionAbsolute,F}),!z)return;W(g.current,!0,!0),h(!0);const V=i?te:wp(P);if(V&&S.current){const[F,K]=bp({nodeId:i,dragItems:g.current,nodeInternals:Q});V(S.current,F,K)}},L=()=>{if(!w.current)return;const[I,q]=VC(E.current,w.current);if(I!==0||q!==0){const{transform:Q,panBy:te}=f.getState();v.current.x=(v.current.x??0)-I/Q[2],v.current.y=(v.current.y??0)-q/Q[2],te({x:I,y:q})&&O(v.current)}b.current=requestAnimationFrame(L)},B=I=>{var $;const{nodeInternals:q,multiSelectionActive:Q,nodesDraggable:te,unselectNodesAndEdges:P,onNodeDragStart:W,onSelectionDragStart:k}=f.getState();C.current=!0;const Y=i?W:wp(k);(!u||!l)&&!Q&&i&&(($=q.get(i))!=null&&$.selected||P()),i&&l&&u&&lg({id:i,store:f,nodeRef:e});const M=A(I);if(v.current=M,g.current=tB(q,te,M,i),Y&&g.current){const[U,z]=bp({nodeId:i,dragItems:g.current,nodeInternals:q});Y(I.sourceEvent,U,z)}};if(t)_.on(".drag",null);else{const I=pP().on("start",q=>{const{domNode:Q,nodeDragThreshold:te}=f.getState();te===0&&B(q),T.current=!1;const P=A(q);v.current=P,w.current=(Q==null?void 0:Q.getBoundingClientRect())||null,E.current=Za(q.sourceEvent,w.current)}).on("drag",q=>{var W,k;const Q=A(q),{autoPanOnNodeDrag:te,nodeDragThreshold:P}=f.getState();if(q.sourceEvent.type==="touchmove"&&q.sourceEvent.touches.length>1&&(T.current=!0),!T.current){if(!N.current&&C.current&&te&&(N.current=!0,L()),!C.current){const Y=Q.xSnapped-(((W=v==null?void 0:v.current)==null?void 0:W.x)??0),M=Q.ySnapped-(((k=v==null?void 0:v.current)==null?void 0:k.y)??0);Math.sqrt(Y*Y+M*M)>P&&B(q)}(v.current.x!==Q.xSnapped||v.current.y!==Q.ySnapped)&&g.current&&C.current&&(S.current=q.sourceEvent,E.current=Za(q.sourceEvent,w.current),O(Q))}}).on("end",q=>{if(!(!C.current||T.current)&&(h(!1),N.current=!1,C.current=!1,cancelAnimationFrame(b.current),g.current)){const{updateNodePositions:Q,nodeInternals:te,onNodeDragStop:P,onSelectionDragStop:W}=f.getState(),k=i?P:wp(W);if(Q(g.current,!1,!1),k){const[Y,M]=bp({nodeId:i,dragItems:g.current,nodeInternals:te});k(q.sourceEvent,Y,M)}}}).filter(q=>{const Q=q.target;return!q.button&&(!r||!Fw(Q,`.${r}`,e))&&(!o||Fw(Q,o,e))});return _.call(I),()=>{_.on(".drag",null)}}}},[e,t,r,o,l,f,i,u,A]),m}function C2(){const e=kt();return x.useCallback(r=>{const{nodeInternals:o,nodeExtent:i,updateNodePositions:l,getNodes:u,snapToGrid:f,snapGrid:m,onError:h,nodesDraggable:g}=e.getState(),v=u().filter(T=>T.selected&&(T.draggable||g&&typeof T.draggable>"u")),b=f?m[0]:5,w=f?m[1]:5,E=r.isShiftPressed?4:1,S=r.x*b*E,N=r.y*w*E,C=v.map(T=>{if(T.positionAbsolute){const A={x:T.positionAbsolute.x+S,y:T.positionAbsolute.y+N};f&&(A.x=m[0]*Math.round(A.x/m[0]),A.y=m[1]*Math.round(A.y/m[1]));const{positionAbsolute:_,position:O}=E2(T,A,o,i,void 0,h);T.position=O,T.positionAbsolute=_}return T});l(C,!0,!1)},[])}const ti={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var jl=e=>{const t=({id:r,type:o,data:i,xPos:l,yPos:u,xPosOrigin:f,yPosOrigin:m,selected:h,onClick:g,onMouseEnter:v,onMouseMove:b,onMouseLeave:w,onContextMenu:E,onDoubleClick:S,style:N,className:C,isDraggable:T,isSelectable:A,isConnectable:_,isFocusable:O,selectNodesOnDrag:L,sourcePosition:B,targetPosition:I,hidden:q,resizeObserver:Q,dragHandle:te,zIndex:P,isParent:W,noDragClassName:k,noPanClassName:Y,initialized:M,disableKeyboardA11y:$,ariaLabel:U,rfId:z,hasHandleBounds:R})=>{const V=kt(),F=x.useRef(null),K=x.useRef(null),re=x.useRef(B),de=x.useRef(I),se=x.useRef(o),ie=A||T||g||v||b||w,me=C2(),pe=Cl(r,V.getState,v),ge=Cl(r,V.getState,b),Se=Cl(r,V.getState,w),we=Cl(r,V.getState,E),Ge=Cl(r,V.getState,S),Ke=he=>{const{nodeDragThreshold:fe}=V.getState();if(A&&(!L||!T||fe>0)&&lg({id:r,store:V,nodeRef:F}),g){const Te=V.getState().nodeInternals.get(r);Te&&g(he,{...Te})}},Je=he=>{if(!rg(he)&&!$)if(FC.includes(he.key)&&A){const fe=he.key==="Escape";lg({id:r,store:V,unselect:fe,nodeRef:F})}else T&&h&&Object.prototype.hasOwnProperty.call(ti,he.key)&&(V.setState({ariaLiveMessage:`Moved selected node ${he.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~l}, y: ${~~u}`}),me({x:ti[he.key].x,y:ti[he.key].y,isShiftPressed:he.shiftKey}))};x.useEffect(()=>()=>{K.current&&(Q==null||Q.unobserve(K.current),K.current=null)},[]),x.useEffect(()=>{if(F.current&&!q){const he=F.current;(!M||!R||K.current!==he)&&(K.current&&(Q==null||Q.unobserve(K.current)),Q==null||Q.observe(he),K.current=he)}},[q,M,R]),x.useEffect(()=>{const he=se.current!==o,fe=re.current!==B,Te=de.current!==I;F.current&&(he||fe||Te)&&(he&&(se.current=o),fe&&(re.current=B),Te&&(de.current=I),V.getState().updateNodeDimensions([{id:r,nodeElement:F.current,forceUpdate:!0}]))},[r,o,B,I]);const mt=N2({nodeRef:F,disabled:q||!T,noDragClassName:k,handleSelector:te,nodeId:r,isSelectable:A,selectNodesOnDrag:L});return q?null:ae.createElement("div",{className:Ft(["react-flow__node",`react-flow__node-${o}`,{[Y]:T},C,{selected:h,selectable:A,parent:W,dragging:mt}]),ref:F,style:{zIndex:P,transform:`translate(${f}px,${m}px)`,pointerEvents:ie?"all":"none",visibility:M?"visible":"hidden",...N},"data-id":r,"data-testid":`rf__node-${r}`,onMouseEnter:pe,onMouseMove:ge,onMouseLeave:Se,onContextMenu:we,onClick:Ke,onDoubleClick:Ge,onKeyDown:O?Je:void 0,tabIndex:O?0:void 0,role:O?"button":void 0,"aria-describedby":$?void 0:`${m2}-${z}`,"aria-label":U},ae.createElement(yU,{value:r},ae.createElement(e,{id:r,data:i,type:o,xPos:l,yPos:u,selected:h,isConnectable:_,sourcePosition:B,targetPosition:I,dragging:mt,dragHandle:te,zIndex:P})))};return t.displayName="NodeWrapper",x.memo(t)};const aB=e=>{const t=e.getNodes().filter(r=>r.selected);return{...Af(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function oB({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const o=kt(),{width:i,height:l,x:u,y:f,transformString:m,userSelectionActive:h}=dt(aB,It),g=C2(),v=x.useRef(null);if(x.useEffect(()=>{var E;r||(E=v.current)==null||E.focus({preventScroll:!0})},[r]),N2({nodeRef:v}),h||!i||!l)return null;const b=e?E=>{const S=o.getState().getNodes().filter(N=>N.selected);e(E,S)}:void 0,w=E=>{Object.prototype.hasOwnProperty.call(ti,E.key)&&g({x:ti[E.key].x,y:ti[E.key].y,isShiftPressed:E.shiftKey})};return ae.createElement("div",{className:Ft(["react-flow__nodesselection","react-flow__container",t]),style:{transform:m}},ae.createElement("div",{ref:v,className:"react-flow__nodesselection-rect",onContextMenu:b,tabIndex:r?void 0:-1,onKeyDown:r?void 0:w,style:{width:i,height:l,top:f,left:u}}))}var sB=x.memo(oB);const iB=e=>e.nodesSelectionActive,j2=({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:l,onPaneScroll:u,deleteKeyCode:f,onMove:m,onMoveStart:h,onMoveEnd:g,selectionKeyCode:v,selectionOnDrag:b,selectionMode:w,onSelectionStart:E,onSelectionEnd:S,multiSelectionKeyCode:N,panActivationKeyCode:C,zoomActivationKeyCode:T,elementsSelectable:A,zoomOnScroll:_,zoomOnPinch:O,panOnScroll:L,panOnScrollSpeed:B,panOnScrollMode:I,zoomOnDoubleClick:q,panOnDrag:Q,defaultViewport:te,translateExtent:P,minZoom:W,maxZoom:k,preventScrolling:Y,onSelectionContextMenu:M,noWheelClassName:$,noPanClassName:U,disableKeyboardA11y:z})=>{const R=dt(iB),V=Ql(v),F=Ql(C),K=F||Q,re=F||L,de=V||b&&K!==!0;return GU({deleteKeyCode:f,multiSelectionKeyCode:N}),ae.createElement(KU,{onMove:m,onMoveStart:h,onMoveEnd:g,onPaneContextMenu:l,elementsSelectable:A,zoomOnScroll:_,zoomOnPinch:O,panOnScroll:re,panOnScrollSpeed:B,panOnScrollMode:I,zoomOnDoubleClick:q,panOnDrag:!V&&K,defaultViewport:te,translateExtent:P,minZoom:W,maxZoom:k,zoomActivationKeyCode:T,preventScrolling:Y,noWheelClassName:$,noPanClassName:U},ae.createElement(w2,{onSelectionStart:E,onSelectionEnd:S,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:l,onPaneScroll:u,panOnDrag:K,isSelecting:!!de,selectionMode:w},e,R&&ae.createElement(sB,{onSelectionContextMenu:M,noPanClassName:U,disableKeyboardA11y:z})))};j2.displayName="FlowRenderer";var lB=x.memo(j2);function cB(e){return dt(x.useCallback(r=>e?t2(r.nodeInternals,{x:0,y:0,width:r.width,height:r.height},r.transform,!0):r.getNodes(),[e]))}function uB(e){const t={input:jl(e.input||u2),default:jl(e.default||ig),output:jl(e.output||f2),group:jl(e.group||mv)},r={},o=Object.keys(e).filter(i=>!["input","default","output","group"].includes(i)).reduce((i,l)=>(i[l]=jl(e[l]||ig),i),r);return{...t,...o}}const dB=({x:e,y:t,width:r,height:o,origin:i})=>!r||!o?{x:e,y:t}:i[0]<0||i[1]<0||i[0]>1||i[1]>1?{x:e,y:t}:{x:e-r*i[0],y:t-o*i[1]},fB=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),_2=e=>{const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:o,elementsSelectable:i,updateNodeDimensions:l,onError:u}=dt(fB,It),f=cB(e.onlyRenderVisibleElements),m=x.useRef(),h=x.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const g=new ResizeObserver(v=>{const b=v.map(w=>({id:w.target.getAttribute("data-id"),nodeElement:w.target,forceUpdate:!0}));l(b)});return m.current=g,g},[]);return x.useEffect(()=>()=>{var g;(g=m==null?void 0:m.current)==null||g.disconnect()},[]),ae.createElement("div",{className:"react-flow__nodes",style:gv},f.map(g=>{var O,L,B;let v=g.type||"default";e.nodeTypes[v]||(u==null||u("003",ca.error003(v)),v="default");const b=e.nodeTypes[v]||e.nodeTypes.default,w=!!(g.draggable||t&&typeof g.draggable>"u"),E=!!(g.selectable||i&&typeof g.selectable>"u"),S=!!(g.connectable||r&&typeof g.connectable>"u"),N=!!(g.focusable||o&&typeof g.focusable>"u"),C=e.nodeExtent?lv(g.positionAbsolute,e.nodeExtent):g.positionAbsolute,T=(C==null?void 0:C.x)??0,A=(C==null?void 0:C.y)??0,_=dB({x:T,y:A,width:g.width??0,height:g.height??0,origin:e.nodeOrigin});return ae.createElement(b,{key:g.id,id:g.id,className:g.className,style:g.style,type:v,data:g.data,sourcePosition:g.sourcePosition||Ce.Bottom,targetPosition:g.targetPosition||Ce.Top,hidden:g.hidden,xPos:T,yPos:A,xPosOrigin:_.x,yPosOrigin:_.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!g.selected,isDraggable:w,isSelectable:E,isConnectable:S,isFocusable:N,resizeObserver:h,dragHandle:g.dragHandle,zIndex:((O=g[xt])==null?void 0:O.z)??0,isParent:!!((L=g[xt])!=null&&L.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!g.width&&!!g.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:g.ariaLabel,hasHandleBounds:!!((B=g[xt])!=null&&B.handleBounds)})}))};_2.displayName="NodeRenderer";var hB=x.memo(_2);const mB=(e,t,r)=>r===Ce.Left?e-t:r===Ce.Right?e+t:e,pB=(e,t,r)=>r===Ce.Top?e-t:r===Ce.Bottom?e+t:e,Ww="react-flow__edgeupdater",Kw=({position:e,centerX:t,centerY:r,radius:o=10,onMouseDown:i,onMouseEnter:l,onMouseOut:u,type:f})=>ae.createElement("circle",{onMouseDown:i,onMouseEnter:l,onMouseOut:u,className:Ft([Ww,`${Ww}-${f}`]),cx:mB(t,o,e),cy:pB(r,o,e),r:o,stroke:"transparent",fill:"transparent"}),gB=()=>!0;var Fs=e=>{const t=({id:r,className:o,type:i,data:l,onClick:u,onEdgeDoubleClick:f,selected:m,animated:h,label:g,labelStyle:v,labelShowBg:b,labelBgStyle:w,labelBgPadding:E,labelBgBorderRadius:S,style:N,source:C,target:T,sourceX:A,sourceY:_,targetX:O,targetY:L,sourcePosition:B,targetPosition:I,elementsSelectable:q,hidden:Q,sourceHandleId:te,targetHandleId:P,onContextMenu:W,onMouseEnter:k,onMouseMove:Y,onMouseLeave:M,reconnectRadius:$,onReconnect:U,onReconnectStart:z,onReconnectEnd:R,markerEnd:V,markerStart:F,rfId:K,ariaLabel:re,isFocusable:de,isReconnectable:se,pathOptions:ie,interactionWidth:me,disableKeyboardA11y:pe})=>{const ge=x.useRef(null),[Se,we]=x.useState(!1),[Ge,Ke]=x.useState(!1),Je=kt(),mt=x.useMemo(()=>`url('#${og(F,K)}')`,[F,K]),he=x.useMemo(()=>`url('#${og(V,K)}')`,[V,K]);if(Q)return null;const fe=zt=>{var Xt;const{edges:xn,addSelectedEdges:Mn,unselectNodesAndEdges:Dn,multiSelectionActive:tn}=Je.getState(),sn=xn.find(lo=>lo.id===r);sn&&(q&&(Je.setState({nodesSelectionActive:!1}),sn.selected&&tn?(Dn({nodes:[],edges:[sn]}),(Xt=ge.current)==null||Xt.blur()):Mn([r])),u&&u(zt,sn))},Te=Nl(r,Je.getState,f),qe=Nl(r,Je.getState,W),Be=Nl(r,Je.getState,k),on=Nl(r,Je.getState,Y),Rr=Nl(r,Je.getState,M),Xn=(zt,xn)=>{if(zt.button!==0)return;const{edges:Mn,isValidConnection:Dn}=Je.getState(),tn=xn?T:C,sn=(xn?P:te)||null,Xt=xn?"target":"source",lo=Dn||gB,rs=xn,ma=Mn.find(Mr=>Mr.id===r);Ke(!0),z==null||z(zt,ma,Xt);const co=Mr=>{Ke(!1),R==null||R(Mr,ma,Xt)};s2({event:zt,handleId:sn,nodeId:tn,onConnect:Mr=>U==null?void 0:U(ma,Mr),isTarget:rs,getState:Je.getState,setState:Je.setState,isValidConnection:lo,edgeUpdaterType:Xt,onReconnectEnd:co})},ha=zt=>Xn(zt,!0),yn=zt=>Xn(zt,!1),bt=()=>we(!0),en=()=>we(!1),Ct=!q&&!u,io=zt=>{var xn;if(!pe&&FC.includes(zt.key)&&q){const{unselectNodesAndEdges:Mn,addSelectedEdges:Dn,edges:tn}=Je.getState();zt.key==="Escape"?((xn=ge.current)==null||xn.blur(),Mn({edges:[tn.find(Xt=>Xt.id===r)]})):Dn([r])}};return ae.createElement("g",{className:Ft(["react-flow__edge",`react-flow__edge-${i}`,o,{selected:m,animated:h,inactive:Ct,updating:Se}]),onClick:fe,onDoubleClick:Te,onContextMenu:qe,onMouseEnter:Be,onMouseMove:on,onMouseLeave:Rr,onKeyDown:de?io:void 0,tabIndex:de?0:void 0,role:de?"button":"img","data-testid":`rf__edge-${r}`,"aria-label":re===null?void 0:re||`Edge from ${C} to ${T}`,"aria-describedby":de?`${p2}-${K}`:void 0,ref:ge},!Ge&&ae.createElement(e,{id:r,source:C,target:T,selected:m,animated:h,label:g,labelStyle:v,labelShowBg:b,labelBgStyle:w,labelBgPadding:E,labelBgBorderRadius:S,data:l,style:N,sourceX:A,sourceY:_,targetX:O,targetY:L,sourcePosition:B,targetPosition:I,sourceHandleId:te,targetHandleId:P,markerStart:mt,markerEnd:he,pathOptions:ie,interactionWidth:me}),se&&ae.createElement(ae.Fragment,null,(se==="source"||se===!0)&&ae.createElement(Kw,{position:B,centerX:A,centerY:_,radius:$,onMouseDown:ha,onMouseEnter:bt,onMouseOut:en,type:"source"}),(se==="target"||se===!0)&&ae.createElement(Kw,{position:I,centerX:O,centerY:L,radius:$,onMouseDown:yn,onMouseEnter:bt,onMouseOut:en,type:"target"})))};return t.displayName="EdgeWrapper",x.memo(t)};function vB(e){const t={default:Fs(e.default||Bd),straight:Fs(e.bezier||dv),step:Fs(e.step||uv),smoothstep:Fs(e.step||_f),simplebezier:Fs(e.simplebezier||cv)},r={},o=Object.keys(e).filter(i=>!["default","bezier"].includes(i)).reduce((i,l)=>(i[l]=Fs(e[l]||Bd),i),r);return{...t,...o}}function Zw(e,t,r=null){const o=((r==null?void 0:r.x)||0)+t.x,i=((r==null?void 0:r.y)||0)+t.y,l=(r==null?void 0:r.width)||t.width,u=(r==null?void 0:r.height)||t.height;switch(e){case Ce.Top:return{x:o+l/2,y:i};case Ce.Right:return{x:o+l,y:i+u/2};case Ce.Bottom:return{x:o+l/2,y:i+u};case Ce.Left:return{x:o,y:i+u/2}}}function Qw(e,t){return e?e.length===1||!t?e[0]:t&&e.find(r=>r.id===t)||null:null}const yB=(e,t,r,o,i,l)=>{const u=Zw(r,e,t),f=Zw(l,o,i);return{sourceX:u.x,sourceY:u.y,targetX:f.x,targetY:f.y}};function xB({sourcePos:e,targetPos:t,sourceWidth:r,sourceHeight:o,targetWidth:i,targetHeight:l,width:u,height:f,transform:m}){const h={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+r,t.x+i),y2:Math.max(e.y+o,t.y+l)};h.x===h.x2&&(h.x2+=1),h.y===h.y2&&(h.y2+=1);const g=Kl({x:(0-m[0])/m[2],y:(0-m[1])/m[2],width:u/m[2],height:f/m[2]}),v=Math.max(0,Math.min(g.x2,h.x2)-Math.max(g.x,h.x)),b=Math.max(0,Math.min(g.y2,h.y2)-Math.max(g.y,h.y));return Math.ceil(v*b)>0}function Jw(e){var o,i,l,u,f;const t=((o=e==null?void 0:e[xt])==null?void 0:o.handleBounds)||null,r=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.x)<"u"&&typeof((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.y)<"u";return[{x:((u=e==null?void 0:e.positionAbsolute)==null?void 0:u.x)||0,y:((f=e==null?void 0:e.positionAbsolute)==null?void 0:f.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!r]}const bB=[{level:0,isMaxLevel:!0,edges:[]}];function wB(e,t,r=!1){let o=-1;const i=e.reduce((u,f)=>{var g,v;const m=Vn(f.zIndex);let h=m?f.zIndex:0;if(r){const b=t.get(f.target),w=t.get(f.source),E=f.selected||(b==null?void 0:b.selected)||(w==null?void 0:w.selected),S=Math.max(((g=w==null?void 0:w[xt])==null?void 0:g.z)||0,((v=b==null?void 0:b[xt])==null?void 0:v.z)||0,1e3);h=(m?f.zIndex:0)+(E?S:0)}return u[h]?u[h].push(f):u[h]=[f],o=h>o?h:o,u},{}),l=Object.entries(i).map(([u,f])=>{const m=+u;return{edges:f,level:m,isMaxLevel:m===o}});return l.length===0?bB:l}function SB(e,t,r){const o=dt(x.useCallback(i=>e?i.edges.filter(l=>{const u=t.get(l.source),f=t.get(l.target);return(u==null?void 0:u.width)&&(u==null?void 0:u.height)&&(f==null?void 0:f.width)&&(f==null?void 0:f.height)&&xB({sourcePos:u.positionAbsolute||{x:0,y:0},targetPos:f.positionAbsolute||{x:0,y:0},sourceWidth:u.width,sourceHeight:u.height,targetWidth:f.width,targetHeight:f.height,width:i.width,height:i.height,transform:i.transform})}):i.edges,[e,t]));return wB(o,t,r)}const EB=({color:e="none",strokeWidth:t=1})=>ae.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),NB=({color:e="none",strokeWidth:t=1})=>ae.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),eS={[Ud.Arrow]:EB,[Ud.ArrowClosed]:NB};function CB(e){const t=kt();return x.useMemo(()=>{var i,l;return Object.prototype.hasOwnProperty.call(eS,e)?eS[e]:((l=(i=t.getState()).onError)==null||l.call(i,"009",ca.error009(e)),null)},[e])}const jB=({id:e,type:t,color:r,width:o=12.5,height:i=12.5,markerUnits:l="strokeWidth",strokeWidth:u,orient:f="auto-start-reverse"})=>{const m=CB(t);return m?ae.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:f,refX:"0",refY:"0"},ae.createElement(m,{color:r,strokeWidth:u})):null},_B=({defaultColor:e,rfId:t})=>r=>{const o=[];return r.edges.reduce((i,l)=>([l.markerStart,l.markerEnd].forEach(u=>{if(u&&typeof u=="object"){const f=og(u,t);o.includes(f)||(i.push({id:f,color:u.color||e,...u}),o.push(f))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))},A2=({defaultColor:e,rfId:t})=>{const r=dt(x.useCallback(_B({defaultColor:e,rfId:t}),[e,t]),(o,i)=>!(o.length!==i.length||o.some((l,u)=>l.id!==i[u].id)));return ae.createElement("defs",null,r.map(o=>ae.createElement(jB,{id:o.id,key:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient})))};A2.displayName="MarkerDefinitions";var AB=x.memo(A2);const TB=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),T2=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:r,rfId:o,edgeTypes:i,noPanClassName:l,onEdgeContextMenu:u,onEdgeMouseEnter:f,onEdgeMouseMove:m,onEdgeMouseLeave:h,onEdgeClick:g,onEdgeDoubleClick:v,onReconnect:b,onReconnectStart:w,onReconnectEnd:E,reconnectRadius:S,children:N,disableKeyboardA11y:C})=>{const{edgesFocusable:T,edgesUpdatable:A,elementsSelectable:_,width:O,height:L,connectionMode:B,nodeInternals:I,onError:q}=dt(TB,It),Q=SB(t,I,r);return O?ae.createElement(ae.Fragment,null,Q.map(({level:te,edges:P,isMaxLevel:W})=>ae.createElement("svg",{key:te,style:{zIndex:te},width:O,height:L,className:"react-flow__edges react-flow__container"},W&&ae.createElement(AB,{defaultColor:e,rfId:o}),ae.createElement("g",null,P.map(k=>{const[Y,M,$]=Jw(I.get(k.source)),[U,z,R]=Jw(I.get(k.target));if(!$||!R)return null;let V=k.type||"default";i[V]||(q==null||q("011",ca.error011(V)),V="default");const F=i[V]||i.default,K=B===Jo.Strict?z.target:(z.target??[]).concat(z.source??[]),re=Qw(M.source,k.sourceHandle),de=Qw(K,k.targetHandle),se=(re==null?void 0:re.position)||Ce.Bottom,ie=(de==null?void 0:de.position)||Ce.Top,me=!!(k.focusable||T&&typeof k.focusable>"u"),pe=k.reconnectable||k.updatable,ge=typeof b<"u"&&(pe||A&&typeof pe>"u");if(!re||!de)return q==null||q("008",ca.error008(re,k)),null;const{sourceX:Se,sourceY:we,targetX:Ge,targetY:Ke}=yB(Y,re,se,U,de,ie);return ae.createElement(F,{key:k.id,id:k.id,className:Ft([k.className,l]),type:V,data:k.data,selected:!!k.selected,animated:!!k.animated,hidden:!!k.hidden,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,style:k.style,source:k.source,target:k.target,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerEnd:k.markerEnd,markerStart:k.markerStart,sourceX:Se,sourceY:we,targetX:Ge,targetY:Ke,sourcePosition:se,targetPosition:ie,elementsSelectable:_,onContextMenu:u,onMouseEnter:f,onMouseMove:m,onMouseLeave:h,onClick:g,onEdgeDoubleClick:v,onReconnect:b,onReconnectStart:w,onReconnectEnd:E,reconnectRadius:S,rfId:o,ariaLabel:k.ariaLabel,isFocusable:me,isReconnectable:ge,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth,disableKeyboardA11y:C})})))),N):null};T2.displayName="EdgeRenderer";var RB=x.memo(T2);const MB=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function DB({children:e}){const t=dt(MB);return ae.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function OB(e){const t=pv(),r=x.useRef(!1);x.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const kB={[Ce.Left]:Ce.Right,[Ce.Right]:Ce.Left,[Ce.Top]:Ce.Bottom,[Ce.Bottom]:Ce.Top},R2=({nodeId:e,handleType:t,style:r,type:o=Kr.Bezier,CustomComponent:i,connectionStatus:l})=>{var L,B,I;const{fromNode:u,handleId:f,toX:m,toY:h,connectionMode:g}=dt(x.useCallback(q=>({fromNode:q.nodeInternals.get(e),handleId:q.connectionHandleId,toX:(q.connectionPosition.x-q.transform[0])/q.transform[2],toY:(q.connectionPosition.y-q.transform[1])/q.transform[2],connectionMode:q.connectionMode}),[e]),It),v=(L=u==null?void 0:u[xt])==null?void 0:L.handleBounds;let b=v==null?void 0:v[t];if(g===Jo.Loose&&(b=b||(v==null?void 0:v[t==="source"?"target":"source"])),!u||!b)return null;const w=f?b.find(q=>q.id===f):b[0],E=w?w.x+w.width/2:(u.width??0)/2,S=w?w.y+w.height/2:u.height??0,N=(((B=u.positionAbsolute)==null?void 0:B.x)??0)+E,C=(((I=u.positionAbsolute)==null?void 0:I.y)??0)+S,T=w==null?void 0:w.position,A=T?kB[T]:null;if(!T||!A)return null;if(i)return ae.createElement(i,{connectionLineType:o,connectionLineStyle:r,fromNode:u,fromHandle:w,fromX:N,fromY:C,toX:m,toY:h,fromPosition:T,toPosition:A,connectionStatus:l});let _="";const O={sourceX:N,sourceY:C,sourcePosition:T,targetX:m,targetY:h,targetPosition:A};return o===Kr.Bezier?[_]=QC(O):o===Kr.Step?[_]=ag({...O,borderRadius:0}):o===Kr.SmoothStep?[_]=ag(O):o===Kr.SimpleBezier?[_]=ZC(O):_=`M${N},${C} ${m},${h}`,ae.createElement("path",{d:_,fill:"none",className:"react-flow__connection-path",style:r})};R2.displayName="ConnectionLine";const zB=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function LB({containerStyle:e,style:t,type:r,component:o}){const{nodeId:i,handleType:l,nodesConnectable:u,width:f,height:m,connectionStatus:h}=dt(zB,It);return!(i&&l&&f&&u)?null:ae.createElement("svg",{style:e,width:f,height:m,className:"react-flow__edges react-flow__connectionline react-flow__container"},ae.createElement("g",{className:Ft(["react-flow__connection",h])},ae.createElement(R2,{nodeId:i,handleType:l,style:t,type:r,CustomComponent:o,connectionStatus:h})))}function tS(e,t){return x.useRef(null),kt(),x.useMemo(()=>t(e),[e])}const M2=({nodeTypes:e,edgeTypes:t,onMove:r,onMoveStart:o,onMoveEnd:i,onInit:l,onNodeClick:u,onEdgeClick:f,onNodeDoubleClick:m,onEdgeDoubleClick:h,onNodeMouseEnter:g,onNodeMouseMove:v,onNodeMouseLeave:b,onNodeContextMenu:w,onSelectionContextMenu:E,onSelectionStart:S,onSelectionEnd:N,connectionLineType:C,connectionLineStyle:T,connectionLineComponent:A,connectionLineContainerStyle:_,selectionKeyCode:O,selectionOnDrag:L,selectionMode:B,multiSelectionKeyCode:I,panActivationKeyCode:q,zoomActivationKeyCode:Q,deleteKeyCode:te,onlyRenderVisibleElements:P,elementsSelectable:W,selectNodesOnDrag:k,defaultViewport:Y,translateExtent:M,minZoom:$,maxZoom:U,preventScrolling:z,defaultMarkerColor:R,zoomOnScroll:V,zoomOnPinch:F,panOnScroll:K,panOnScrollSpeed:re,panOnScrollMode:de,zoomOnDoubleClick:se,panOnDrag:ie,onPaneClick:me,onPaneMouseEnter:pe,onPaneMouseMove:ge,onPaneMouseLeave:Se,onPaneScroll:we,onPaneContextMenu:Ge,onEdgeContextMenu:Ke,onEdgeMouseEnter:Je,onEdgeMouseMove:mt,onEdgeMouseLeave:he,onReconnect:fe,onReconnectStart:Te,onReconnectEnd:qe,reconnectRadius:Be,noDragClassName:on,noWheelClassName:Rr,noPanClassName:Xn,elevateEdgesOnSelect:ha,disableKeyboardA11y:yn,nodeOrigin:bt,nodeExtent:en,rfId:Ct})=>{const io=tS(e,uB),zt=tS(t,vB);return OB(l),ae.createElement(lB,{onPaneClick:me,onPaneMouseEnter:pe,onPaneMouseMove:ge,onPaneMouseLeave:Se,onPaneContextMenu:Ge,onPaneScroll:we,deleteKeyCode:te,selectionKeyCode:O,selectionOnDrag:L,selectionMode:B,onSelectionStart:S,onSelectionEnd:N,multiSelectionKeyCode:I,panActivationKeyCode:q,zoomActivationKeyCode:Q,elementsSelectable:W,onMove:r,onMoveStart:o,onMoveEnd:i,zoomOnScroll:V,zoomOnPinch:F,zoomOnDoubleClick:se,panOnScroll:K,panOnScrollSpeed:re,panOnScrollMode:de,panOnDrag:ie,defaultViewport:Y,translateExtent:M,minZoom:$,maxZoom:U,onSelectionContextMenu:E,preventScrolling:z,noDragClassName:on,noWheelClassName:Rr,noPanClassName:Xn,disableKeyboardA11y:yn},ae.createElement(DB,null,ae.createElement(RB,{edgeTypes:zt,onEdgeClick:f,onEdgeDoubleClick:h,onlyRenderVisibleElements:P,onEdgeContextMenu:Ke,onEdgeMouseEnter:Je,onEdgeMouseMove:mt,onEdgeMouseLeave:he,onReconnect:fe,onReconnectStart:Te,onReconnectEnd:qe,reconnectRadius:Be,defaultMarkerColor:R,noPanClassName:Xn,elevateEdgesOnSelect:!!ha,disableKeyboardA11y:yn,rfId:Ct},ae.createElement(LB,{style:T,type:C,component:A,containerStyle:_})),ae.createElement("div",{className:"react-flow__edgelabel-renderer"}),ae.createElement(hB,{nodeTypes:io,onNodeClick:u,onNodeDoubleClick:m,onNodeMouseEnter:g,onNodeMouseMove:v,onNodeMouseLeave:b,onNodeContextMenu:w,selectNodesOnDrag:k,onlyRenderVisibleElements:P,noPanClassName:Xn,noDragClassName:on,disableKeyboardA11y:yn,nodeOrigin:bt,nodeExtent:en,rfId:Ct})))};M2.displayName="GraphView";var PB=x.memo(M2);const cg=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],qa={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:cg,nodeExtent:cg,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Jo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:fU,isValidConnection:void 0},UB=()=>_5((e,t)=>({...qa,setNodes:r=>{const{nodeInternals:o,nodeOrigin:i,elevateNodesOnSelect:l}=t();e({nodeInternals:yp(r,o,i,l)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:r=>{const{defaultEdgeOptions:o={}}=t();e({edges:r.map(i=>({...o,...i}))})},setDefaultNodesAndEdges:(r,o)=>{const i=typeof r<"u",l=typeof o<"u",u=i?yp(r,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:u,edges:l?o:[],hasDefaultNodes:i,hasDefaultEdges:l})},updateNodeDimensions:r=>{const{onNodesChange:o,nodeInternals:i,fitViewOnInit:l,fitViewOnInitDone:u,fitViewOnInitOptions:f,domNode:m,nodeOrigin:h}=t(),g=m==null?void 0:m.querySelector(".react-flow__viewport");if(!g)return;const v=window.getComputedStyle(g),{m22:b}=new window.DOMMatrixReadOnly(v.transform),w=r.reduce((S,N)=>{const C=i.get(N.id);if(C!=null&&C.hidden)i.set(C.id,{...C,[xt]:{...C[xt],handleBounds:void 0}});else if(C){const T=iv(N.nodeElement);!!(T.width&&T.height&&(C.width!==T.width||C.height!==T.height||N.forceUpdate))&&(i.set(C.id,{...C,[xt]:{...C[xt],handleBounds:{source:Xw(".source",N.nodeElement,b,h),target:Xw(".target",N.nodeElement,b,h)}},...T}),S.push({id:C.id,type:"dimensions",dimensions:T}))}return S},[]);v2(i,h);const E=u||l&&!u&&y2(t,{initial:!0,...f});e({nodeInternals:new Map(i),fitViewOnInitDone:E}),(w==null?void 0:w.length)>0&&(o==null||o(w))},updateNodePositions:(r,o=!0,i=!1)=>{const{triggerNodeChanges:l}=t(),u=r.map(f=>{const m={id:f.id,type:"position",dragging:i};return o&&(m.positionAbsolute=f.positionAbsolute,m.position=f.position),m});l(u)},triggerNodeChanges:r=>{const{onNodesChange:o,nodeInternals:i,hasDefaultNodes:l,nodeOrigin:u,getNodes:f,elevateNodesOnSelect:m}=t();if(r!=null&&r.length){if(l){const h=b2(r,f()),g=yp(h,i,u,m);e({nodeInternals:g})}o==null||o(r)}},addSelectedNodes:r=>{const{multiSelectionActive:o,edges:i,getNodes:l}=t();let u,f=null;o?u=r.map(m=>Xa(m,!0)):(u=Ks(l(),r),f=Ks(i,[])),Ju({changedNodes:u,changedEdges:f,get:t,set:e})},addSelectedEdges:r=>{const{multiSelectionActive:o,edges:i,getNodes:l}=t();let u,f=null;o?u=r.map(m=>Xa(m,!0)):(u=Ks(i,r),f=Ks(l(),[])),Ju({changedNodes:f,changedEdges:u,get:t,set:e})},unselectNodesAndEdges:({nodes:r,edges:o}={})=>{const{edges:i,getNodes:l}=t(),u=r||l(),f=o||i,m=u.map(g=>(g.selected=!1,Xa(g.id,!1))),h=f.map(g=>Xa(g.id,!1));Ju({changedNodes:m,changedEdges:h,get:t,set:e})},setMinZoom:r=>{const{d3Zoom:o,maxZoom:i}=t();o==null||o.scaleExtent([r,i]),e({minZoom:r})},setMaxZoom:r=>{const{d3Zoom:o,minZoom:i}=t();o==null||o.scaleExtent([i,r]),e({maxZoom:r})},setTranslateExtent:r=>{var o;(o=t().d3Zoom)==null||o.translateExtent(r),e({translateExtent:r})},resetSelectedElements:()=>{const{edges:r,getNodes:o}=t(),l=o().filter(f=>f.selected).map(f=>Xa(f.id,!1)),u=r.filter(f=>f.selected).map(f=>Xa(f.id,!1));Ju({changedNodes:l,changedEdges:u,get:t,set:e})},setNodeExtent:r=>{const{nodeInternals:o}=t();o.forEach(i=>{i.positionAbsolute=lv(i.position,r)}),e({nodeExtent:r,nodeInternals:new Map(o)})},panBy:r=>{const{transform:o,width:i,height:l,d3Zoom:u,d3Selection:f,translateExtent:m}=t();if(!u||!f||!r.x&&!r.y)return!1;const h=ea.translate(o[0]+r.x,o[1]+r.y).scale(o[2]),g=[[0,0],[i,l]],v=u==null?void 0:u.constrain()(h,g,m);return u.transform(f,v),o[0]!==v.x||o[1]!==v.y||o[2]!==v.k},cancelConnection:()=>e({connectionNodeId:qa.connectionNodeId,connectionHandleId:qa.connectionHandleId,connectionHandleType:qa.connectionHandleType,connectionStatus:qa.connectionStatus,connectionStartHandle:qa.connectionStartHandle,connectionEndHandle:qa.connectionEndHandle}),reset:()=>e({...qa})}),Object.is),D2=({children:e})=>{const t=x.useRef(null);return t.current||(t.current=UB()),ae.createElement(oU,{value:t.current},e)};D2.displayName="ReactFlowProvider";const O2=({children:e})=>x.useContext(jf)?ae.createElement(ae.Fragment,null,e):ae.createElement(D2,null,e);O2.displayName="ReactFlowWrapper";const BB={input:u2,default:ig,output:f2,group:mv},HB={default:Bd,straight:dv,step:uv,smoothstep:_f,simplebezier:cv},$B=[0,0],IB=[15,15],VB={x:0,y:0,zoom:1},qB={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},k2=x.forwardRef(({nodes:e,edges:t,defaultNodes:r,defaultEdges:o,className:i,nodeTypes:l=BB,edgeTypes:u=HB,onNodeClick:f,onEdgeClick:m,onInit:h,onMove:g,onMoveStart:v,onMoveEnd:b,onConnect:w,onConnectStart:E,onConnectEnd:S,onClickConnectStart:N,onClickConnectEnd:C,onNodeMouseEnter:T,onNodeMouseMove:A,onNodeMouseLeave:_,onNodeContextMenu:O,onNodeDoubleClick:L,onNodeDragStart:B,onNodeDrag:I,onNodeDragStop:q,onNodesDelete:Q,onEdgesDelete:te,onSelectionChange:P,onSelectionDragStart:W,onSelectionDrag:k,onSelectionDragStop:Y,onSelectionContextMenu:M,onSelectionStart:$,onSelectionEnd:U,connectionMode:z=Jo.Strict,connectionLineType:R=Kr.Bezier,connectionLineStyle:V,connectionLineComponent:F,connectionLineContainerStyle:K,deleteKeyCode:re="Backspace",selectionKeyCode:de="Shift",selectionOnDrag:se=!1,selectionMode:ie=Zl.Full,panActivationKeyCode:me="Space",multiSelectionKeyCode:pe=Pd()?"Meta":"Control",zoomActivationKeyCode:ge=Pd()?"Meta":"Control",snapToGrid:Se=!1,snapGrid:we=IB,onlyRenderVisibleElements:Ge=!1,selectNodesOnDrag:Ke=!0,nodesDraggable:Je,nodesConnectable:mt,nodesFocusable:he,nodeOrigin:fe=$B,edgesFocusable:Te,edgesUpdatable:qe,elementsSelectable:Be,defaultViewport:on=VB,minZoom:Rr=.5,maxZoom:Xn=2,translateExtent:ha=cg,preventScrolling:yn=!0,nodeExtent:bt,defaultMarkerColor:en="#b1b1b7",zoomOnScroll:Ct=!0,zoomOnPinch:io=!0,panOnScroll:zt=!1,panOnScrollSpeed:xn=.5,panOnScrollMode:Mn=Lo.Free,zoomOnDoubleClick:Dn=!0,panOnDrag:tn=!0,onPaneClick:sn,onPaneMouseEnter:Xt,onPaneMouseMove:lo,onPaneMouseLeave:rs,onPaneScroll:ma,onPaneContextMenu:co,children:pa,onEdgeContextMenu:Mr,onEdgeDoubleClick:yc,onEdgeMouseEnter:xc,onEdgeMouseMove:xi,onEdgeMouseLeave:bi,onEdgeUpdate:bc,onEdgeUpdateStart:Df,onEdgeUpdateEnd:gr,onReconnect:Lt,onReconnectStart:Wt,onReconnectEnd:ga,reconnectRadius:wi=10,edgeUpdaterRadius:Of=10,onNodesChange:kf,onEdgesChange:wc,noDragClassName:uo="nodrag",noWheelClassName:Si="nowheel",noPanClassName:Dr="nopan",fitView:va=!1,fitViewOptions:fo,connectOnClick:ya=!0,attributionPosition:jt,proOptions:Sc,defaultEdgeOptions:Ec,elevateNodesOnSelect:Or=!0,elevateEdgesOnSelect:xa=!1,disableKeyboardA11y:Nc=!1,autoPanOnConnect:Cc=!0,autoPanOnNodeDrag:jc=!0,connectionRadius:zf=20,isValidConnection:as,onError:os,style:Wn,id:ss,nodeDragThreshold:_c,...ba},Ei)=>{const ho=ss||"1";return ae.createElement("div",{...ba,style:{...Wn,...qB},ref:Ei,className:Ft(["react-flow",i]),"data-testid":"rf__wrapper",id:ss},ae.createElement(O2,null,ae.createElement(PB,{onInit:h,onMove:g,onMoveStart:v,onMoveEnd:b,onNodeClick:f,onEdgeClick:m,onNodeMouseEnter:T,onNodeMouseMove:A,onNodeMouseLeave:_,onNodeContextMenu:O,onNodeDoubleClick:L,nodeTypes:l,edgeTypes:u,connectionLineType:R,connectionLineStyle:V,connectionLineComponent:F,connectionLineContainerStyle:K,selectionKeyCode:de,selectionOnDrag:se,selectionMode:ie,deleteKeyCode:re,multiSelectionKeyCode:pe,panActivationKeyCode:me,zoomActivationKeyCode:ge,onlyRenderVisibleElements:Ge,selectNodesOnDrag:Ke,defaultViewport:on,translateExtent:ha,minZoom:Rr,maxZoom:Xn,preventScrolling:yn,zoomOnScroll:Ct,zoomOnPinch:io,zoomOnDoubleClick:Dn,panOnScroll:zt,panOnScrollSpeed:xn,panOnScrollMode:Mn,panOnDrag:tn,onPaneClick:sn,onPaneMouseEnter:Xt,onPaneMouseMove:lo,onPaneMouseLeave:rs,onPaneScroll:ma,onPaneContextMenu:co,onSelectionContextMenu:M,onSelectionStart:$,onSelectionEnd:U,onEdgeContextMenu:Mr,onEdgeDoubleClick:yc,onEdgeMouseEnter:xc,onEdgeMouseMove:xi,onEdgeMouseLeave:bi,onReconnect:Lt??bc,onReconnectStart:Wt??Df,onReconnectEnd:ga??gr,reconnectRadius:wi??Of,defaultMarkerColor:en,noDragClassName:uo,noWheelClassName:Si,noPanClassName:Dr,elevateEdgesOnSelect:xa,rfId:ho,disableKeyboardA11y:Nc,nodeOrigin:fe,nodeExtent:bt}),ae.createElement(kU,{nodes:e,edges:t,defaultNodes:r,defaultEdges:o,onConnect:w,onConnectStart:E,onConnectEnd:S,onClickConnectStart:N,onClickConnectEnd:C,nodesDraggable:Je,nodesConnectable:mt,nodesFocusable:he,edgesFocusable:Te,edgesUpdatable:qe,elementsSelectable:Be,elevateNodesOnSelect:Or,minZoom:Rr,maxZoom:Xn,nodeExtent:bt,onNodesChange:kf,onEdgesChange:wc,snapToGrid:Se,snapGrid:we,connectionMode:z,translateExtent:ha,connectOnClick:ya,defaultEdgeOptions:Ec,fitView:va,fitViewOptions:fo,onNodesDelete:Q,onEdgesDelete:te,onNodeDragStart:B,onNodeDrag:I,onNodeDragStop:q,onSelectionDrag:k,onSelectionDragStart:W,onSelectionDragStop:Y,noPanClassName:Dr,nodeOrigin:fe,rfId:ho,autoPanOnConnect:Cc,autoPanOnNodeDrag:jc,onError:os,connectionRadius:zf,isValidConnection:as,nodeDragThreshold:_c}),ae.createElement(DU,{onSelectionChange:P}),pa,ae.createElement(iU,{proOptions:Sc,position:jt}),ae.createElement(BU,{rfId:ho,disableKeyboardA11y:Nc})))});k2.displayName="ReactFlow";function z2(e){return t=>{const[r,o]=x.useState(t),i=x.useCallback(l=>o(u=>e(l,u)),[]);return[r,o,i]}}const YB=z2(b2),GB=z2(JU),L2=({id:e,x:t,y:r,width:o,height:i,style:l,color:u,strokeColor:f,strokeWidth:m,className:h,borderRadius:g,shapeRendering:v,onClick:b,selected:w})=>{const{background:E,backgroundColor:S}=l||{},N=u||E||S;return ae.createElement("rect",{className:Ft(["react-flow__minimap-node",{selected:w},h]),x:t,y:r,rx:g,ry:g,width:o,height:i,fill:N,stroke:f,strokeWidth:m,shapeRendering:v,onClick:b?C=>b(C,e):void 0})};L2.displayName="MiniMapNode";var FB=x.memo(L2);const XB=e=>e.nodeOrigin,WB=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),Sp=e=>e instanceof Function?e:()=>e;function KB({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:r="",nodeBorderRadius:o=5,nodeStrokeWidth:i=2,nodeComponent:l=FB,onClick:u}){const f=dt(WB,It),m=dt(XB),h=Sp(t),g=Sp(e),v=Sp(r),b=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return ae.createElement(ae.Fragment,null,f.map(w=>{const{x:E,y:S}=Bo(w,m).positionAbsolute;return ae.createElement(l,{key:w.id,x:E,y:S,width:w.width,height:w.height,style:w.style,selected:w.selected,className:v(w),color:h(w),borderRadius:o,strokeColor:g(w),strokeWidth:i,shapeRendering:b,onClick:u,id:w.id})}))}var ZB=x.memo(KB);const QB=200,JB=150,eH=e=>{const t=e.getNodes(),r={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:r,boundingRect:t.length>0?uU(Af(t,e.nodeOrigin),r):r,rfId:e.rfId}},tH="react-flow__minimap-desc";function P2({style:e,className:t,nodeStrokeColor:r="transparent",nodeColor:o="#e2e2e2",nodeClassName:i="",nodeBorderRadius:l=5,nodeStrokeWidth:u=2,nodeComponent:f,maskColor:m="rgb(240, 240, 240, 0.6)",maskStrokeColor:h="none",maskStrokeWidth:g=1,position:v="bottom-right",onClick:b,onNodeClick:w,pannable:E=!1,zoomable:S=!1,ariaLabel:N="React Flow mini map",inversePan:C=!1,zoomStep:T=10,offsetScale:A=5}){const _=kt(),O=x.useRef(null),{boundingRect:L,viewBB:B,rfId:I}=dt(eH,It),q=(e==null?void 0:e.width)??QB,Q=(e==null?void 0:e.height)??JB,te=L.width/q,P=L.height/Q,W=Math.max(te,P),k=W*q,Y=W*Q,M=A*W,$=L.x-(k-L.width)/2-M,U=L.y-(Y-L.height)/2-M,z=k+M*2,R=Y+M*2,V=`${tH}-${I}`,F=x.useRef(0);F.current=W,x.useEffect(()=>{if(O.current){const de=In(O.current),se=pe=>{const{transform:ge,d3Selection:Se,d3Zoom:we}=_.getState();if(pe.sourceEvent.type!=="wheel"||!Se||!we)return;const Ge=-pe.sourceEvent.deltaY*(pe.sourceEvent.deltaMode===1?.05:pe.sourceEvent.deltaMode?1:.002)*T,Ke=ge[2]*Math.pow(2,Ge);we.scaleTo(Se,Ke)},ie=pe=>{const{transform:ge,d3Selection:Se,d3Zoom:we,translateExtent:Ge,width:Ke,height:Je}=_.getState();if(pe.sourceEvent.type!=="mousemove"||!Se||!we)return;const mt=F.current*Math.max(1,ge[2])*(C?-1:1),he={x:ge[0]-pe.sourceEvent.movementX*mt,y:ge[1]-pe.sourceEvent.movementY*mt},fe=[[0,0],[Ke,Je]],Te=ea.translate(he.x,he.y).scale(ge[2]),qe=we.constrain()(Te,fe,Ge);we.transform(Se,qe)},me=$C().on("zoom",E?ie:null).on("zoom.wheel",S?se:null);return de.call(me),()=>{de.on("zoom",null)}}},[E,S,C,T]);const K=b?de=>{const se=er(de);b(de,{x:se[0],y:se[1]})}:void 0,re=w?(de,se)=>{const ie=_.getState().nodeInternals.get(se);w(de,ie)}:void 0;return ae.createElement(sv,{position:v,style:e,className:Ft(["react-flow__minimap",t]),"data-testid":"rf__minimap"},ae.createElement("svg",{width:q,height:Q,viewBox:`${$} ${U} ${z} ${R}`,role:"img","aria-labelledby":V,ref:O,onClick:K},N&&ae.createElement("title",{id:V},N),ae.createElement(ZB,{onClick:re,nodeColor:o,nodeStrokeColor:r,nodeBorderRadius:l,nodeClassName:i,nodeStrokeWidth:u,nodeComponent:f}),ae.createElement("path",{className:"react-flow__minimap-mask",d:`M${$-M},${U-M}h${z+M*2}v${R+M*2}h${-z-M*2}z
        M${B.x},${B.y}h${B.width}v${B.height}h${-B.width}z`,fill:m,fillRule:"evenodd",stroke:h,strokeWidth:g,pointerEvents:"none"})))}P2.displayName="MiniMap";var nH=x.memo(P2);function rH(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},ae.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function aH(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},ae.createElement("path",{d:"M0 0h32v4.2H0z"}))}function oH(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},ae.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function sH(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ae.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function iH(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ae.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const kl=({children:e,className:t,...r})=>ae.createElement("button",{type:"button",className:Ft(["react-flow__controls-button",t]),...r},e);kl.displayName="ControlButton";const lH=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),U2=({style:e,showZoom:t=!0,showFitView:r=!0,showInteractive:o=!0,fitViewOptions:i,onZoomIn:l,onZoomOut:u,onFitView:f,onInteractiveChange:m,className:h,children:g,position:v="bottom-left"})=>{const b=kt(),[w,E]=x.useState(!1),{isInteractive:S,minZoomReached:N,maxZoomReached:C}=dt(lH,It),{zoomIn:T,zoomOut:A,fitView:_}=pv();if(x.useEffect(()=>{E(!0)},[]),!w)return null;const O=()=>{T(),l==null||l()},L=()=>{A(),u==null||u()},B=()=>{_(i),f==null||f()},I=()=>{b.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),m==null||m(!S)};return ae.createElement(sv,{className:Ft(["react-flow__controls",h]),position:v,style:e,"data-testid":"rf__controls"},t&&ae.createElement(ae.Fragment,null,ae.createElement(kl,{onClick:O,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:C},ae.createElement(rH,null)),ae.createElement(kl,{onClick:L,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:N},ae.createElement(aH,null))),r&&ae.createElement(kl,{className:"react-flow__controls-fitview",onClick:B,title:"fit view","aria-label":"fit view"},ae.createElement(oH,null)),o&&ae.createElement(kl,{className:"react-flow__controls-interactive",onClick:I,title:"toggle interactivity","aria-label":"toggle interactivity"},S?ae.createElement(iH,null):ae.createElement(sH,null)),g)};U2.displayName="Controls";var cH=x.memo(U2),ir;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ir||(ir={}));function uH({color:e,dimensions:t,lineWidth:r}){return ae.createElement("path",{stroke:e,strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function dH({color:e,radius:t}){return ae.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const fH={[ir.Dots]:"#91919a",[ir.Lines]:"#eee",[ir.Cross]:"#e2e2e2"},hH={[ir.Dots]:1,[ir.Lines]:1,[ir.Cross]:6},mH=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function B2({id:e,variant:t=ir.Dots,gap:r=20,size:o,lineWidth:i=1,offset:l=2,color:u,style:f,className:m}){const h=x.useRef(null),{transform:g,patternId:v}=dt(mH,It),b=u||fH[t],w=o||hH[t],E=t===ir.Dots,S=t===ir.Cross,N=Array.isArray(r)?r:[r,r],C=[N[0]*g[2]||1,N[1]*g[2]||1],T=w*g[2],A=S?[T,T]:C,_=E?[T/l,T/l]:[A[0]/l,A[1]/l];return ae.createElement("svg",{className:Ft(["react-flow__background",m]),style:{...f,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:h,"data-testid":"rf__background"},ae.createElement("pattern",{id:v+e,x:g[0]%C[0],y:g[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${_[0]},-${_[1]})`},E?ae.createElement(dH,{color:b,radius:T/l}):ae.createElement(uH,{dimensions:A,color:b,lineWidth:i})),ae.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${v+e})`}))}B2.displayName="Background";var pH=x.memo(B2);function ua({className:e,...t}){return d.jsx("textarea",{"data-slot":"textarea",className:Me("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}const gH=$g("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function ut({className:e,variant:t,asChild:r=!1,...o}){const i=r?TS:"span";return d.jsx(i,{"data-slot":"badge",className:Me(gH({variant:t}),e),...o})}function vH(){const e=rn(),[t,r]=x.useState([]),[o,i]=x.useState([]),[l,u]=x.useState(""),[f,m]=x.useState(!1),[h,g]=x.useState({flowId:"New Workflow",description:"Workflow description",groupId:"no-group"}),v="http://localhost:8000/api",b=Tn(),w=Gn(Qe.create()),E=localStorage.getItem("user"),S=E?JSON.parse(E):null;x.useEffect(()=>{Tn()===null&&e("/login"),(async()=>{try{const{data:O}=await w.get(`${v}/flows`,{headers:{Authorization:`Bearer ${b}`}});r(O);const{data:L}=await w.get(`${v}/groups`,{headers:{Authorization:`Bearer ${b}`}});i(L)}catch(O){console.log(O),e("/login")}})()},[]);const N=async()=>{const _={flowId:h.flowId,description:h.description,groupId:h.groupId},{data:O}=await w.post(`${v}/flows`,_,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`}}),L=[...t,O];r(L),g({flowId:"New Workflow",description:"Workflow description",groupId:"no-group"}),m(!1),e(`/workflow/${_.flowId}`)},C=async _=>{const O=t.filter(L=>L.flowId!==_);await w.delete(`${v}/flows/${_}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`}}),r(O)},T=_=>{if(!_)return"No Group";const O=o.find(L=>L.groupId===_);return O?O.groupId:"Unknown Group"},A=t.filter(_=>_.flowId.toLowerCase().includes(l.toLowerCase())||_.description.toLowerCase().includes(l.toLowerCase())||T(_.groupId).toLowerCase().includes(l.toLowerCase()));return d.jsx(Jt,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h1",{className:"text-2xl font-bold",children:"My Workflows"}),(S.isSuperuser||S.role==="admin")&&d.jsxs(aa,{open:f,onOpenChange:m,children:[d.jsx(ro,{asChild:!0,children:d.jsxs(Ne,{className:"flex items-center gap-2",children:[d.jsx(Hl,{className:"h-4 w-4"}),"Create Workflow"]})}),d.jsxs(oa,{children:[d.jsxs(sa,{children:[d.jsx(ia,{children:"Create New Workflow"}),d.jsx(Zo,{children:"Configure your new workflow before creating it."})]}),d.jsxs("div",{className:"grid gap-4 py-4",children:[d.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[d.jsx(Xe,{htmlFor:"name",className:"text-right",children:"Name"}),d.jsx(We,{id:"name",value:h.flowId,onChange:_=>g({...h,flowId:_.target.value}),className:"col-span-3"})]}),d.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[d.jsx(Xe,{htmlFor:"description",className:"text-right",children:"Description"}),d.jsx(ua,{id:"description",value:h.description,onChange:_=>g({...h,description:_.target.value}),className:"col-span-3"})]}),d.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[d.jsx(Xe,{htmlFor:"group",className:"text-right",children:"Group"}),d.jsxs(rr,{value:h.groupId,onValueChange:_=>g({...h,groupId:_}),children:[d.jsx(or,{className:"col-span-3",children:d.jsx(ar,{placeholder:"Select a group"})}),d.jsx(sr,{children:o.map(_=>d.jsx(ct,{value:_.groupId,children:_.groupId},_.groupId))})]})]})]}),d.jsxs(ao,{children:[d.jsx(Ne,{variant:"outline",onClick:()=>m(!1),children:"Cancel"}),d.jsx(Ne,{onClick:N,children:"Create Workflow"})]})]})]})]}),d.jsxs("div",{className:"relative",children:[d.jsx(es,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx(We,{placeholder:"Search workflows...",className:"pl-10",value:l,onChange:_=>u(_.target.value)})]}),d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:A.map(_=>d.jsxs(Et,{className:"overflow-hidden",children:[d.jsx("div",{className:"h-32 bg-muted flex items-center justify-center cursor-pointer",onClick:()=>e(`/workflow/${_.flowId}`),children:d.jsx("div",{className:"text-center",children:d.jsx("p",{className:"text-xs text-muted-foreground",children:"Click to edit"})})}),d.jsx(Nt,{className:"p-4",children:d.jsxs("div",{className:"flex justify-between items-start",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"font-medium truncate",children:_.flowId}),d.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:_.description})]}),d.jsx(Ne,{disabled:!S.isSuperuser&&S.role==="operator",variant:"ghost",size:"sm",onClick:()=>C(_.flowId),children:d.jsx(Xo,{className:"h-4 w-4 text-red-500"})})]})}),d.jsx(hi,{className:"p-4 pt-0 flex justify-between text-xs text-muted-foreground",children:d.jsxs("div",{className:"flex items-center",children:[d.jsx(cc,{className:"mr-1 h-3 w-3"}),d.jsx(ut,{variant:"outline",className:"ml-1 text-xs",children:T(_.groupId)})]})})]},_.flowId))}),A.length===0&&d.jsxs("div",{className:"text-center py-12",children:[d.jsx("p",{className:"text-muted-foreground",children:"No workflows found"}),l&&d.jsx(Ne,{variant:"link",onClick:()=>u(""),className:"mt-2",children:"Clear search"})]})]})})}function yH(){return d.jsx(vH,{})}function xH(){const e=rn(),[t,r]=x.useState([]),[o,i]=x.useState([]),[l,u]=x.useState(""),[f,m]=x.useState(!1),[h,g]=x.useState(!1),[v,b]=x.useState([]),w="http://localhost:8000/api",E=Tn(),S=Gn(Qe.create()),N=localStorage.getItem("user"),C=N?JSON.parse(N):null,[T,A]=x.useState({deviceId:"",ip:"",deviceType:"router",groupId:""}),[_,O]=x.useState({deviceId:"",connectionType:"ssh",description:"",username:"",password:"",port:22,priority:1,extra:{}});x.useEffect(()=>{const P=async()=>{const{data:Y}=await S.get(`${w}/devices`,{headers:{Authorization:`Bearer ${E}`}});r(Y)},W=async()=>{const{data:Y}=await S.get(`${w}/credentials`,{headers:{Authorization:`Bearer ${E}`}});i(Y)};P(),W(),(()=>{try{(async()=>{const{data:M}=await S.get(`${w}/groups`,{headers:{Authorization:`Bearer ${E}`}});b(M.map($=>$.groupId))})()}catch(Y){console.error("Error loading data:",Y)}})()},[]),console.log(t);const L=t.filter(P=>P.deviceId.toLowerCase().includes(l.toLowerCase())||P.ip.toLowerCase().includes(l.toLowerCase())||P.deviceType.toLowerCase().includes(l.toLowerCase())||P.groupId.toLowerCase().includes(l.toLowerCase()));console.log("filter:"),console.log(L);const B=o.filter(P=>P.deviceId.toLowerCase().includes(l.toLowerCase())||P.connectionType.toLowerCase().includes(l.toLowerCase())||P.description.toLowerCase().includes(l.toLowerCase())||P.username.toLowerCase().includes(l.toLowerCase())),I=async()=>{if(!T.deviceId||!T.ip)return;const P={deviceId:T.deviceId,ip:T.ip,deviceType:T.deviceType||"linux",groupId:T.groupId||"default"};console.log(P);const{data:W}=await S.post(`${w}/devices`,P,{headers:{Authorization:`Bearer ${E}`}}),k=[...t,W];r(k),localStorage.setItem("devices",JSON.stringify(k)),A({deviceId:"",ip:"",deviceType:"router"}),m(!1)},q=async()=>{if(!_.deviceId||!_.username||!_.password)return;const P={deviceId:_.deviceId,connectionType:_.connectionType||"ssh",description:_.description||"",username:_.username,password:_.password,port:_.port||22,priority:_.priority||1,extra:_.extra||{}},{data:W}=await S.post(`${w}/credentials`,P,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${E}`}}),k=[...o,W];i(k),localStorage.setItem("credentials",JSON.stringify(k)),O({deviceId:"",connectionType:"ssh",description:"",username:"",password:"",port:22,priority:1,extra:{}}),g(!1)},Q=async(P,W)=>{console.log("device_id"+W),await S.delete(`${w}/devices/${P}/${W}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${E}`}});const k=t.filter(M=>M.deviceId!==W);r(k),localStorage.setItem("devices",JSON.stringify(k));const Y=o.filter(M=>!t.find($=>$.deviceId===W&&$.deviceId===M.deviceId));i(Y),localStorage.setItem("credentials",JSON.stringify(Y))},te=async P=>{console.log("Deleting"),await S.delete(`${w}/credentials/${P}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${E}`}});const W=o.filter(k=>k.id!==P);i(W),localStorage.setItem("credentials",JSON.stringify(W))};return d.jsx(Jt,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold",children:"Devices & Credentials"}),d.jsx("p",{className:"text-muted-foreground",children:"Manage your network devices and access credentials"})]}),d.jsx("div",{className:"flex gap-2",children:d.jsxs(Ne,{variant:"outline",onClick:()=>e("/devices/sets"),className:"flex items-center gap-2",children:[d.jsx($l,{className:"h-4 w-4"}),"Device Sets"]})})]}),d.jsxs("div",{className:"relative",children:[d.jsx(es,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx(We,{placeholder:"Search devices and credentials...",className:"pl-10",value:l,onChange:P=>u(P.target.value)})]}),d.jsxs(Wd,{defaultValue:"devices",children:[d.jsxs(Kd,{className:"grid w-full grid-cols-2",children:[d.jsxs(Io,{value:"devices",className:"flex items-center gap-2",children:[d.jsx($l,{className:"h-4 w-4"}),"Devices"]}),d.jsxs(Io,{value:"credentials",className:"flex items-center gap-2",children:[d.jsx(zk,{className:"h-4 w-4"}),"Credentials"]})]}),d.jsxs(Vo,{value:"devices",className:"space-y-4 pt-4",children:[d.jsx("div",{className:"flex justify-end",children:(C.isSuperuser||C.role==="admin")&&d.jsxs(aa,{open:f,onOpenChange:m,children:[d.jsx(ro,{asChild:!0,children:d.jsxs(Ne,{className:"flex items-center gap-2",children:[d.jsx(Hl,{className:"h-4 w-4"}),"Add Device"]})}),d.jsxs(oa,{children:[d.jsxs(sa,{children:[d.jsx(ia,{children:"Add New Device"}),d.jsx(Zo,{children:"Enter the details for the new device."})]}),d.jsxs("div",{className:"space-y-4 py-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"device-id",children:"Device ID"}),d.jsx(We,{id:"device-id",value:T.deviceId,onChange:P=>A({...T,deviceId:P.target.value}),placeholder:"e.g., router-01"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"ip",children:"IP"}),d.jsx(We,{id:"ip",value:T.ip,onChange:P=>A({...T,ip:P.target.value}),placeholder:"e.g., 192.168.1.1"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"device-type",children:"Device Type"}),d.jsxs(rr,{value:T.deviceType,onValueChange:P=>A({...T,deviceType:P}),children:[d.jsx(or,{id:"device-type",children:d.jsx(ar,{placeholder:"Select device type"})}),d.jsxs(sr,{children:[d.jsx(ct,{value:"linux",children:"Linux"}),d.jsx(ct,{value:"huawei",children:"Huawei"}),d.jsx(ct,{value:"juniper",children:"Juniper"}),d.jsx(ct,{value:"gcom",children:"GCOM"})]})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"group",children:"Group"}),d.jsxs(rr,{value:T.groupId,onValueChange:P=>A({...T,groupId:P}),children:[d.jsx(or,{id:"group",children:d.jsx(ar,{placeholder:"Select group"})}),d.jsx(sr,{children:v.map(P=>d.jsx(ct,{value:P,children:P},P))})]})]})]}),d.jsxs(ao,{children:[d.jsx(Ne,{variant:"outline",onClick:()=>m(!1),children:"Cancel"}),d.jsx(Ne,{onClick:I,children:"Add Device"})]})]})]})}),d.jsx(Et,{children:d.jsx(Nt,{className:"p-0",children:d.jsxs(Qa,{children:[d.jsx(Ja,{children:d.jsxs(yt,{children:[d.jsx(Ue,{children:"Device ID"}),d.jsx(Ue,{children:"IP"}),d.jsx(Ue,{children:"Type"}),d.jsx(Ue,{children:"Group"}),d.jsx(Ue,{className:"w-[100px]",children:"Actions"})]})}),d.jsx(eo,{children:L.length===0?d.jsx(yt,{children:d.jsx(De,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"No devices found"})}):L.map(P=>d.jsxs(yt,{children:[d.jsx(De,{className:"font-medium",children:P.deviceId}),d.jsx(De,{children:P.ip}),d.jsx(De,{className:"capitalize",children:P.deviceType}),d.jsx(De,{children:P.groupId}),d.jsx(De,{children:d.jsx(dC,{children:d.jsx(Ne,{disabled:!C.isSuperuser&&C.role==="operator",variant:"ghost",size:"sm",onClick:()=>Q(P.groupId,P.deviceId),children:d.jsx(Xo,{className:"h-4 w-4 text-red-500"})})})})]},P.deviceId))})]})})})]}),d.jsxs(Vo,{value:"credentials",className:"space-y-4 pt-4",children:[d.jsx("div",{className:"flex justify-end",children:(C.isSuperuser||C.role==="admin")&&d.jsxs(aa,{open:h,onOpenChange:g,children:[d.jsx(ro,{asChild:!0,children:d.jsxs(Ne,{className:"flex items-center gap-2",children:[d.jsx(Hl,{className:"h-4 w-4"}),"Add Credential"]})}),d.jsxs(oa,{children:[d.jsxs(sa,{children:[d.jsx(ia,{children:"Add New Credential"}),d.jsx(Zo,{children:"Enter the access credentials for a device."})]}),d.jsxs("div",{className:"space-y-4 py-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"credential-device-id",children:"Device ID"}),d.jsxs(rr,{value:_.deviceId,onValueChange:P=>O({..._,deviceId:P}),children:[d.jsx(or,{id:"credential-device-id",children:d.jsx(ar,{placeholder:"Select device"})}),d.jsx(sr,{children:t.map(P=>d.jsxs(ct,{value:P.deviceId,children:[P.deviceId," (",P.ip,")"]},P.deviceId))})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"connection-type",children:"Connection Type"}),d.jsxs(rr,{value:_.connectionType,onValueChange:P=>O({..._,connectionType:P}),children:[d.jsx(or,{id:"connection-type",children:d.jsx(ar,{placeholder:"Select connection type"})}),d.jsxs(sr,{children:[d.jsx(ct,{value:"ssh",children:"SSH"}),d.jsx(ct,{value:"telnet",children:"Telnet"}),d.jsx(ct,{value:"http",children:"HTTP"}),d.jsx(ct,{value:"https",children:"HTTPS"}),d.jsx(ct,{value:"snmp",children:"SNMP"})]})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"description",children:"Description"}),d.jsx(We,{id:"description",value:_.description,onChange:P=>O({..._,description:P.target.value}),placeholder:"e.g., Admin SSH access"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"Username",children:"Username"}),d.jsx(We,{id:"username",value:_.username,onChange:P=>O({..._,username:P.target.value}),placeholder:"e.g., admin"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"password",children:"Password"}),d.jsx(We,{id:"password",type:"password",value:_.password,onChange:P=>O({..._,password:P.target.value}),placeholder:"Enter password"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"port",children:"Port"}),d.jsx(We,{id:"port",type:"number",value:_.port,onChange:P=>O({..._,port:Number.parseInt(P.target.value)})})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"priority",children:"Priority"}),d.jsx(We,{id:"priority",type:"number",value:_.priority,onChange:P=>O({..._,priority:Number.parseInt(P.target.value)})})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"extra",children:"Extra (JSON)"}),d.jsx(ua,{id:"extra",value:JSON.stringify(_.extra,null,2),onChange:P=>{try{const W=JSON.parse(P.target.value);O({..._,extra:W})}catch(W){console.log("error parsing extra field of credential"),console.log(W)}},placeholder:'{"key": "value"}',className:"font-mono"})]})]}),d.jsxs(ao,{children:[d.jsx(Ne,{variant:"outline",onClick:()=>g(!1),children:"Cancel"}),d.jsx(Ne,{onClick:q,children:"Add Credential"})]})]})]})}),d.jsx(Et,{children:d.jsx(Nt,{className:"p-0",children:d.jsxs(Qa,{children:[d.jsx(Ja,{children:d.jsxs(yt,{children:[d.jsx(Ue,{children:"Device ID"}),d.jsx(Ue,{children:"Type"}),d.jsx(Ue,{children:"Username"}),d.jsx(Ue,{children:"Description"}),d.jsx(Ue,{children:"Priority"}),d.jsx(Ue,{className:"w-[100px]",children:"Actions"})]})}),d.jsx(eo,{children:B.length===0?d.jsx(yt,{children:d.jsx(De,{colSpan:6,className:"text-center py-4 text-muted-foreground",children:"No credentials found"})}):B.map(P=>d.jsxs(yt,{children:[d.jsx(De,{className:"font-medium",children:P.deviceId}),d.jsx(De,{children:P.connectionType}),d.jsx(De,{children:P.username}),d.jsx(De,{children:P.description}),d.jsx(De,{children:P.priority}),d.jsx(De,{children:d.jsx(Ne,{disabled:!C.isSuperuser&&C.role==="operator",variant:"ghost",size:"sm",onClick:()=>te(P.id),children:d.jsx(Xo,{className:"h-4 w-4 text-red-500"})})})]},P.id))})]})})})]})]})]})})}function bH(){return d.jsx(xH,{})}function wH(){const e=rn(),[t,r]=x.useState([]),[o,i]=x.useState([]),[l,u]=x.useState([]),[f,m]=x.useState(""),[h,g]=x.useState(!1),[v,b]=x.useState(""),w="http://localhost:8000/api",E=Tn(),S=Gn(Qe.create()),N=localStorage.getItem("user"),C=N?JSON.parse(N):null,[T,A]=x.useState({deviceSetId:"",description:"",devices:[],groupId:""});x.useEffect(()=>{(async()=>{const W=async()=>{const{data:M}=await S.get(`${w}/device-sets`,{headers:{Authorization:`Bearer ${E}`}});r(M)},k=async()=>{const{data:M}=await S.get(`${w}/groups`,{headers:{Authorization:`Bearer ${E}`}});u(M)},Y=async()=>{const{data:M}=await S.get(`${w}/devices`,{headers:{Authorization:`Bearer ${E}`}});i(M)};k(),W(),Y()})()},[]);const _=t.filter(P=>P.deviceSetId.toLowerCase().includes(f.toLowerCase())||P.description.toLowerCase().includes(f.toLowerCase())),O=o.filter(P=>v?P.groupId===v:!0),L=P=>{if(console.log("Get group name:"+P),!P)return"No Group";const W=l.find(k=>k.groupId===P);return W?W.groupId:"Unknown Group"},B=P=>{b(P),A({...T,groupId:P,devices:[]})},I=async()=>{if(!T.deviceSetId)return;console.log(T);const{data:P}=await S.post(`${w}/device-sets`,T,{headers:{Authorization:`Bearer ${E}`}}),W=[...t,P];r(W),localStorage.setItem("device_sets",JSON.stringify(W)),A({deviceSetId:"",description:"",devices:[],groupId:""}),b(""),g(!1)},q=async P=>{await S.delete(`${w}/device_sets/${P}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${E}`}});const W=t.filter(k=>k.deviceSetId!==P);r(W),localStorage.setItem("device_sets",JSON.stringify(W))},Q=P=>{const W=T.devices||[],k=W.includes(P)?W.filter(Y=>Y!==P):[...W,P];A({...T,devices:k})},te=P=>{P||(A({description:"",devices:[],groupId:""}),b("")),g(P)};return d.jsx(Jt,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold",children:"Device Sets"}),d.jsx("p",{className:"text-muted-foreground",children:"Manage groups of devices for workflow execution"})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(Ne,{variant:"outline",onClick:()=>e("/devices"),className:"flex items-center gap-2",children:[d.jsx($l,{className:"h-4 w-4"}),"Devices"]}),(C.isSuperuser||C.role==="admin")&&d.jsxs(aa,{open:h,onOpenChange:te,children:[d.jsx(ro,{asChild:!0,children:d.jsxs(Ne,{className:"flex items-center gap-2",children:[d.jsx(Hl,{className:"h-4 w-4"}),"Create Device Set"]})}),d.jsxs(oa,{className:"max-w-md",children:[d.jsxs(sa,{children:[d.jsx(ia,{children:"Create Device Set"}),d.jsx(Zo,{children:"Group devices together for workflow execution."})]}),d.jsxs("div",{className:"space-y-4 py-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"set-name",children:"Device Set ID"}),d.jsx(We,{id:"set-name",value:T.deviceSetId,onChange:P=>A({...T,deviceSetId:P.target.value}),placeholder:"e.g., Production Servers"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"set-description",children:"Description"}),d.jsx(ua,{id:"set-description",value:T.description,onChange:P=>A({...T,description:P.target.value}),placeholder:"Describe this device set",rows:2})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"group",children:"Group"}),d.jsxs(rr,{value:v,onValueChange:B,children:[d.jsx(or,{id:"group",children:d.jsx(ar,{placeholder:"Select a group"})}),d.jsx(sr,{children:l.length===0?d.jsx(ct,{value:"no-groups",disabled:!0,children:"No groups available"}):l.map(P=>d.jsx(ct,{value:P.groupId,children:P.groupId},P.groupId))})]}),d.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Select a group to see available devices from that group"})]}),v&&d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{children:"Select Devices"}),d.jsx("div",{className:"border rounded-md p-2 max-h-60 overflow-y-auto",children:O.length===0?d.jsx("p",{className:"text-sm text-muted-foreground p-2",children:"No devices available in this group"}):d.jsx("div",{className:"space-y-2",children:O.map(P=>d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx("input",{type:"checkbox",id:`device-${P.deviceId}`,checked:(T.devices||[]).includes(P.deviceId),onChange:()=>Q(P.deviceId),className:"rounded border-gray-300"}),d.jsxs("label",{htmlFor:`device-${P.deviceId}`,className:"text-sm flex-1",children:[P.deviceId," (",P.host,")"]}),d.jsx(ut,{variant:"outline",className:"text-xs",children:P.deviceType})]},P.deviceId))})})]})]}),d.jsxs(ao,{children:[d.jsx(Ne,{variant:"outline",onClick:()=>g(!1),children:"Cancel"}),d.jsx(Ne,{onClick:I,disabled:!T.deviceSetId||!v||(T.devices||[]).length===0,children:"Create"})]})]})]})]})]}),d.jsxs("div",{className:"relative",children:[d.jsx(es,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx(We,{placeholder:"Search device sets...",className:"pl-10",value:f,onChange:P=>m(P.target.value)})]}),d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:_.map(P=>d.jsxs(Et,{className:"overflow-hidden",children:[d.jsx(fn,{className:"pb-2",children:d.jsxs("div",{className:"flex justify-between items-start",children:[d.jsx(hn,{className:"text-lg",children:P.deviceSetId}),d.jsx(Ne,{disabled:!C.isSuperuser&&C.role==="operator",variant:"ghost",size:"sm",onClick:()=>q(P.deviceSetId),children:d.jsx(Xo,{className:"h-4 w-4 text-red-500"})})]})}),d.jsxs(Nt,{className:"pb-2",children:[d.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:P.description}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[d.jsx(cc,{className:"h-4 w-4 text-muted-foreground"}),d.jsx(ut,{variant:"outline",className:"text-xs",children:L(P.groupId)})]}),d.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[d.jsx($l,{className:"h-4 w-4 text-muted-foreground"}),d.jsxs("span",{children:[P.devices.length," ",P.devices.length==1?"device":"devices"]})]})]})]}),d.jsx(hi,{className:"pt-2",children:d.jsx(Ne,{variant:"outline",size:"sm",className:"w-full",onClick:()=>e(`/devices/sets/${P.deviceSetId}`),children:"View Details"})})]},P.deviceSetId))}),_.length===0&&d.jsxs("div",{className:"text-center py-12",children:[d.jsx("p",{className:"text-muted-foreground",children:"No device sets found"}),f&&d.jsx(Ne,{variant:"link",onClick:()=>m(""),className:"mt-2",children:"Clear search"})]})]})})}function SH(){return d.jsx(wH,{})}function EH({deviceSetId:e}){const t=rn(),[r,o]=x.useState(null),[i,l]=x.useState([]),[u,f]=x.useState(!1),[m,h]=x.useState([]),g="http://localhost:8000/api",v=Tn(),b=Gn(Qe.create()),w=localStorage.getItem("user"),E=w?JSON.parse(w):null;x.useEffect(()=>{(async()=>{const{data:_}=await b.get(`${g}/device-sets/${e}`,{headers:{Authorization:`Bearer ${v}`}});o(_),h(_.devices);const O=await b.get(`${g}/devices`,{params:{groupId:_.groupId},headers:{Authorization:`Bearer ${v}`}});l(O.data)})()},[e,t]);const S=async()=>{if(r)try{const A=localStorage.getItem("device_sets");if(!A)return;await b.post(`${g}/device-sets/${e}/devices`,{devices:m},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${v}`}});const O=JSON.parse(A).map(L=>L.deviceSetId===e?{...L,devices:m}:L);localStorage.setItem("device_sets",JSON.stringify(O)),o({...r,devices:m}),f(!1)}catch(A){console.error("Error adding devices:",A)}},N=async A=>{if(!r)return;const _=r.devices.filter(L=>L!==A),O={...r,devices:_};await b.post(`${g}/device-sets/${e}/devices`,{devices:_},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${v}`}});try{const L=localStorage.getItem("device_sets");if(!L)return;const I=JSON.parse(L).map(q=>q.deviceSetId===e?O:q);localStorage.setItem("device_sets",JSON.stringify(I)),o(O),h(_)}catch(L){console.error("Error removing device:",L)}},C=A=>{h(_=>_.includes(A)?_.filter(O=>O!==A):[..._,A])};if(!r)return d.jsx(Jt,{children:d.jsx("div",{className:"container mx-auto py-6",children:d.jsx("p",{children:"Loading device set details..."})})});const T=i.filter(A=>r.devices.includes(A.deviceId));return d.jsx(Jt,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs(Ne,{variant:"ghost",size:"icon",onClick:()=>t("/devices/sets"),children:[d.jsx(lc,{className:"h-5 w-5"}),d.jsx("span",{className:"sr-only",children:"Back to device sets"})]}),d.jsx("div",{className:"flex-1",children:d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold",children:r.deviceSetId}),d.jsx("p",{className:"text-muted-foreground",children:r.description})]})})]}),d.jsx(Et,{children:d.jsxs(Nt,{className:"p-6",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsxs("h2",{className:"text-lg font-medium",children:["Devices (",r.devices.length,")"]}),(E.isSuperuser||E.role==="admin")&&d.jsxs(aa,{open:u,onOpenChange:f,children:[d.jsx(ro,{asChild:!0,children:d.jsxs(Ne,{size:"sm",className:"flex items-center gap-2",children:[d.jsx(Hl,{className:"h-4 w-4"}),"Add Devices"]})}),d.jsxs(oa,{children:[d.jsxs(sa,{children:[d.jsx(ia,{children:"Add Devices"}),d.jsx(Zo,{children:"Select devices to add to this device set."})]}),d.jsx("div",{className:"py-4",children:d.jsx("div",{className:"border rounded-md p-2 max-h-60 overflow-y-auto",children:i.length===0?d.jsx("p",{className:"text-sm text-muted-foreground p-2",children:"No devices available"}):d.jsx("div",{className:"space-y-2",children:i.map(A=>d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx("input",{type:"checkbox",id:`device-${A.deviceId}`,checked:m.includes(A.deviceId),onChange:()=>C(A.deviceId),className:"rounded border-gray-300"}),d.jsxs("label",{htmlFor:`device-${A.deviceId}`,className:"text-sm flex-1",children:[A.deviceId," (",A.ip,")"]}),d.jsx(ut,{variant:"outline",className:"text-xs",children:A.deviceType})]},A.deviceId))})})}),d.jsxs(ao,{children:[d.jsx(Ne,{variant:"outline",onClick:()=>f(!1),children:"Cancel"}),d.jsx(Ne,{onClick:S,children:"Save"})]})]})]})]}),d.jsxs(Qa,{children:[d.jsx(Ja,{children:d.jsxs(yt,{children:[d.jsx(Ue,{children:"Device ID"}),d.jsx(Ue,{children:"IP"}),d.jsx(Ue,{children:"Type"}),d.jsx(Ue,{children:"Group"}),d.jsx(Ue,{className:"w-[100px]",children:"Actions"})]})}),d.jsx(eo,{children:T.length===0?d.jsx(yt,{children:d.jsx(De,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"No devices in this set"})}):T.map(A=>d.jsxs(yt,{children:[d.jsx(De,{className:"font-medium",children:A.deviceId}),d.jsx(De,{children:A.ip}),d.jsx(De,{className:"capitalize",children:A.deviceType}),d.jsx(De,{children:A.groupId}),d.jsx(De,{children:d.jsxs(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>N(A.deviceId),disabled:!E.isSuperuser&&E.role==="operator",children:[d.jsx(Xo,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Remove"})]})})]},A.deviceId))})]})]})})]})})}function NH(){const e=nc();return d.jsx(EH,{deviceSetId:e.id})}const H2=6048e5,CH=864e5,td=43200,nS=1440,rS=Symbol.for("constructDateFrom");function da(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&rS in e?e[rS](t):e instanceof Date?new e.constructor(t):new Date(t)}function Vt(e,t){return da(t||e,e)}let jH={};function vc(){return jH}function Jl(e,t){var f,m,h,g;const r=vc(),o=(t==null?void 0:t.weekStartsOn)??((m=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((g=(h=r.locale)==null?void 0:h.options)==null?void 0:g.weekStartsOn)??0,i=Vt(e,t==null?void 0:t.in),l=i.getDay(),u=(l<o?7:0)+l-o;return i.setDate(i.getDate()-u),i.setHours(0,0,0,0),i}function Hd(e,t){return Jl(e,{...t,weekStartsOn:1})}function $2(e,t){const r=Vt(e,t==null?void 0:t.in),o=r.getFullYear(),i=da(r,0);i.setFullYear(o+1,0,4),i.setHours(0,0,0,0);const l=Hd(i),u=da(r,0);u.setFullYear(o,0,4),u.setHours(0,0,0,0);const f=Hd(u);return r.getTime()>=l.getTime()?o+1:r.getTime()>=f.getTime()?o:o-1}function $d(e){const t=Vt(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Tf(e,...t){const r=da.bind(null,t.find(o=>typeof o=="object"));return t.map(r)}function aS(e,t){const r=Vt(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function _H(e,t,r){const[o,i]=Tf(r==null?void 0:r.in,e,t),l=aS(o),u=aS(i),f=+l-$d(l),m=+u-$d(u);return Math.round((f-m)/CH)}function AH(e,t){const r=$2(e,t),o=da(e,0);return o.setFullYear(r,0,4),o.setHours(0,0,0,0),Hd(o)}function gd(e,t){const r=+Vt(e)-+Vt(t);return r<0?-1:r>0?1:r}function TH(e){return da(e,Date.now())}function RH(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function MH(e){return!(!RH(e)&&typeof e!="number"||isNaN(+Vt(e)))}function DH(e,t,r){const[o,i]=Tf(r==null?void 0:r.in,e,t),l=o.getFullYear()-i.getFullYear(),u=o.getMonth()-i.getMonth();return l*12+u}function OH(e){return t=>{const r=Math.trunc,o=r(t);return o===0?0:o}}function kH(e,t){return+Vt(e)-+Vt(t)}function zH(e,t){const r=Vt(e,t==null?void 0:t.in);return r.setHours(23,59,59,999),r}function LH(e,t){const r=Vt(e,t==null?void 0:t.in),o=r.getMonth();return r.setFullYear(r.getFullYear(),o+1,0),r.setHours(23,59,59,999),r}function PH(e,t){const r=Vt(e,t==null?void 0:t.in);return+zH(r,t)==+LH(r,t)}function UH(e,t,r){const[o,i,l]=Tf(r==null?void 0:r.in,e,e,t),u=gd(i,l),f=Math.abs(DH(i,l));if(f<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-u*f);let m=gd(i,l)===-u;PH(o)&&f===1&&gd(o,l)===1&&(m=!1);const h=u*(f-+m);return h===0?0:h}function BH(e,t,r){const o=kH(e,t)/1e3;return OH()(o)}function HH(e,t){const r=Vt(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const $H={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},IH=(e,t,r)=>{let o;const i=$H[e];return typeof i=="string"?o=i:t===1?o=i.one:o=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+o:o+" ago":o};function Ep(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const VH={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},qH={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},YH={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},GH={date:Ep({formats:VH,defaultWidth:"full"}),time:Ep({formats:qH,defaultWidth:"full"}),dateTime:Ep({formats:YH,defaultWidth:"full"})},FH={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},XH=(e,t,r,o)=>FH[e];function _l(e){return(t,r)=>{const o=r!=null&&r.context?String(r.context):"standalone";let i;if(o==="formatting"&&e.formattingValues){const u=e.defaultFormattingWidth||e.defaultWidth,f=r!=null&&r.width?String(r.width):u;i=e.formattingValues[f]||e.formattingValues[u]}else{const u=e.defaultWidth,f=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[f]||e.values[u]}const l=e.argumentCallback?e.argumentCallback(t):t;return i[l]}}const WH={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},KH={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ZH={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},QH={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},JH={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},e$={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},t$=(e,t)=>{const r=Number(e),o=r%100;if(o>20||o<10)switch(o%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},n$={ordinalNumber:t$,era:_l({values:WH,defaultWidth:"wide"}),quarter:_l({values:KH,defaultWidth:"wide",argumentCallback:e=>e-1}),month:_l({values:ZH,defaultWidth:"wide"}),day:_l({values:QH,defaultWidth:"wide"}),dayPeriod:_l({values:JH,defaultWidth:"wide",formattingValues:e$,defaultFormattingWidth:"wide"})};function Al(e){return(t,r={})=>{const o=r.width,i=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],l=t.match(i);if(!l)return null;const u=l[0],f=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],m=Array.isArray(f)?a$(f,v=>v.test(u)):r$(f,v=>v.test(u));let h;h=e.valueCallback?e.valueCallback(m):m,h=r.valueCallback?r.valueCallback(h):h;const g=t.slice(u.length);return{value:h,rest:g}}}function r$(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function a$(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function o$(e){return(t,r={})=>{const o=t.match(e.matchPattern);if(!o)return null;const i=o[0],l=t.match(e.parsePattern);if(!l)return null;let u=e.valueCallback?e.valueCallback(l[0]):l[0];u=r.valueCallback?r.valueCallback(u):u;const f=t.slice(i.length);return{value:u,rest:f}}}const s$=/^(\d+)(th|st|nd|rd)?/i,i$=/\d+/i,l$={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},c$={any:[/^b/i,/^(a|c)/i]},u$={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},d$={any:[/1/i,/2/i,/3/i,/4/i]},f$={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},h$={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},m$={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},p$={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},g$={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},v$={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},y$={ordinalNumber:o$({matchPattern:s$,parsePattern:i$,valueCallback:e=>parseInt(e,10)}),era:Al({matchPatterns:l$,defaultMatchWidth:"wide",parsePatterns:c$,defaultParseWidth:"any"}),quarter:Al({matchPatterns:u$,defaultMatchWidth:"wide",parsePatterns:d$,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Al({matchPatterns:f$,defaultMatchWidth:"wide",parsePatterns:h$,defaultParseWidth:"any"}),day:Al({matchPatterns:m$,defaultMatchWidth:"wide",parsePatterns:p$,defaultParseWidth:"any"}),dayPeriod:Al({matchPatterns:g$,defaultMatchWidth:"any",parsePatterns:v$,defaultParseWidth:"any"})},I2={code:"en-US",formatDistance:IH,formatLong:GH,formatRelative:XH,localize:n$,match:y$,options:{weekStartsOn:0,firstWeekContainsDate:1}};function x$(e,t){const r=Vt(e,t==null?void 0:t.in);return _H(r,HH(r))+1}function b$(e,t){const r=Vt(e,t==null?void 0:t.in),o=+Hd(r)-+AH(r);return Math.round(o/H2)+1}function V2(e,t){var g,v,b,w;const r=Vt(e,t==null?void 0:t.in),o=r.getFullYear(),i=vc(),l=(t==null?void 0:t.firstWeekContainsDate)??((v=(g=t==null?void 0:t.locale)==null?void 0:g.options)==null?void 0:v.firstWeekContainsDate)??i.firstWeekContainsDate??((w=(b=i.locale)==null?void 0:b.options)==null?void 0:w.firstWeekContainsDate)??1,u=da((t==null?void 0:t.in)||e,0);u.setFullYear(o+1,0,l),u.setHours(0,0,0,0);const f=Jl(u,t),m=da((t==null?void 0:t.in)||e,0);m.setFullYear(o,0,l),m.setHours(0,0,0,0);const h=Jl(m,t);return+r>=+f?o+1:+r>=+h?o:o-1}function w$(e,t){var f,m,h,g;const r=vc(),o=(t==null?void 0:t.firstWeekContainsDate)??((m=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??r.firstWeekContainsDate??((g=(h=r.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,i=V2(e,t),l=da((t==null?void 0:t.in)||e,0);return l.setFullYear(i,0,o),l.setHours(0,0,0,0),Jl(l,t)}function S$(e,t){const r=Vt(e,t==null?void 0:t.in),o=+Jl(r,t)-+w$(r,t);return Math.round(o/H2)+1}function rt(e,t){const r=e<0?"-":"",o=Math.abs(e).toString().padStart(t,"0");return r+o}const Ya={y(e,t){const r=e.getFullYear(),o=r>0?r:1-r;return rt(t==="yy"?o%100:o,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):rt(r+1,2)},d(e,t){return rt(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return rt(e.getHours()%12||12,t.length)},H(e,t){return rt(e.getHours(),t.length)},m(e,t){return rt(e.getMinutes(),t.length)},s(e,t){return rt(e.getSeconds(),t.length)},S(e,t){const r=t.length,o=e.getMilliseconds(),i=Math.trunc(o*Math.pow(10,r-3));return rt(i,t.length)}},Xs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},oS={G:function(e,t,r){const o=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(o,{width:"abbreviated"});case"GGGGG":return r.era(o,{width:"narrow"});case"GGGG":default:return r.era(o,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const o=e.getFullYear(),i=o>0?o:1-o;return r.ordinalNumber(i,{unit:"year"})}return Ya.y(e,t)},Y:function(e,t,r,o){const i=V2(e,o),l=i>0?i:1-i;if(t==="YY"){const u=l%100;return rt(u,2)}return t==="Yo"?r.ordinalNumber(l,{unit:"year"}):rt(l,t.length)},R:function(e,t){const r=$2(e);return rt(r,t.length)},u:function(e,t){const r=e.getFullYear();return rt(r,t.length)},Q:function(e,t,r){const o=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(o);case"QQ":return rt(o,2);case"Qo":return r.ordinalNumber(o,{unit:"quarter"});case"QQQ":return r.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(o,{width:"wide",context:"formatting"})}},q:function(e,t,r){const o=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(o);case"qq":return rt(o,2);case"qo":return r.ordinalNumber(o,{unit:"quarter"});case"qqq":return r.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(o,{width:"wide",context:"standalone"})}},M:function(e,t,r){const o=e.getMonth();switch(t){case"M":case"MM":return Ya.M(e,t);case"Mo":return r.ordinalNumber(o+1,{unit:"month"});case"MMM":return r.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(o,{width:"wide",context:"formatting"})}},L:function(e,t,r){const o=e.getMonth();switch(t){case"L":return String(o+1);case"LL":return rt(o+1,2);case"Lo":return r.ordinalNumber(o+1,{unit:"month"});case"LLL":return r.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(o,{width:"wide",context:"standalone"})}},w:function(e,t,r,o){const i=S$(e,o);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):rt(i,t.length)},I:function(e,t,r){const o=b$(e);return t==="Io"?r.ordinalNumber(o,{unit:"week"}):rt(o,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Ya.d(e,t)},D:function(e,t,r){const o=x$(e);return t==="Do"?r.ordinalNumber(o,{unit:"dayOfYear"}):rt(o,t.length)},E:function(e,t,r){const o=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(o,{width:"short",context:"formatting"});case"EEEE":default:return r.day(o,{width:"wide",context:"formatting"})}},e:function(e,t,r,o){const i=e.getDay(),l=(i-o.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return rt(l,2);case"eo":return r.ordinalNumber(l,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,o){const i=e.getDay(),l=(i-o.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return rt(l,t.length);case"co":return r.ordinalNumber(l,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const o=e.getDay(),i=o===0?7:o;switch(t){case"i":return String(i);case"ii":return rt(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(o,{width:"short",context:"formatting"});case"iiii":default:return r.day(o,{width:"wide",context:"formatting"})}},a:function(e,t,r){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const o=e.getHours();let i;switch(o===12?i=Xs.noon:o===0?i=Xs.midnight:i=o/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const o=e.getHours();let i;switch(o>=17?i=Xs.evening:o>=12?i=Xs.afternoon:o>=4?i=Xs.morning:i=Xs.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let o=e.getHours()%12;return o===0&&(o=12),r.ordinalNumber(o,{unit:"hour"})}return Ya.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Ya.H(e,t)},K:function(e,t,r){const o=e.getHours()%12;return t==="Ko"?r.ordinalNumber(o,{unit:"hour"}):rt(o,t.length)},k:function(e,t,r){let o=e.getHours();return o===0&&(o=24),t==="ko"?r.ordinalNumber(o,{unit:"hour"}):rt(o,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ya.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Ya.s(e,t)},S:function(e,t){return Ya.S(e,t)},X:function(e,t,r){const o=e.getTimezoneOffset();if(o===0)return"Z";switch(t){case"X":return iS(o);case"XXXX":case"XX":return Do(o);case"XXXXX":case"XXX":default:return Do(o,":")}},x:function(e,t,r){const o=e.getTimezoneOffset();switch(t){case"x":return iS(o);case"xxxx":case"xx":return Do(o);case"xxxxx":case"xxx":default:return Do(o,":")}},O:function(e,t,r){const o=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+sS(o,":");case"OOOO":default:return"GMT"+Do(o,":")}},z:function(e,t,r){const o=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+sS(o,":");case"zzzz":default:return"GMT"+Do(o,":")}},t:function(e,t,r){const o=Math.trunc(+e/1e3);return rt(o,t.length)},T:function(e,t,r){return rt(+e,t.length)}};function sS(e,t=""){const r=e>0?"-":"+",o=Math.abs(e),i=Math.trunc(o/60),l=o%60;return l===0?r+String(i):r+String(i)+t+rt(l,2)}function iS(e,t){return e%60===0?(e>0?"-":"+")+rt(Math.abs(e)/60,2):Do(e,t)}function Do(e,t=""){const r=e>0?"-":"+",o=Math.abs(e),i=rt(Math.trunc(o/60),2),l=rt(o%60,2);return r+i+t+l}const lS=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},q2=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},E$=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return lS(e,t);let l;switch(o){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"});break}return l.replace("{{date}}",lS(o,t)).replace("{{time}}",q2(i,t))},N$={p:q2,P:E$},C$=/^D+$/,j$=/^Y+$/,_$=["D","DD","YY","YYYY"];function A$(e){return C$.test(e)}function T$(e){return j$.test(e)}function R$(e,t,r){const o=M$(e,t,r);if(console.warn(o),_$.includes(e))throw new RangeError(o)}function M$(e,t,r){const o=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${o} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const D$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,O$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,k$=/^'([^]*?)'?$/,z$=/''/g,L$=/[a-zA-Z]/;function Id(e,t,r){var g,v,b,w;const o=vc(),i=o.locale??I2,l=o.firstWeekContainsDate??((v=(g=o.locale)==null?void 0:g.options)==null?void 0:v.firstWeekContainsDate)??1,u=o.weekStartsOn??((w=(b=o.locale)==null?void 0:b.options)==null?void 0:w.weekStartsOn)??0,f=Vt(e,r==null?void 0:r.in);if(!MH(f))throw new RangeError("Invalid time value");let m=t.match(O$).map(E=>{const S=E[0];if(S==="p"||S==="P"){const N=N$[S];return N(E,i.formatLong)}return E}).join("").match(D$).map(E=>{if(E==="''")return{isToken:!1,value:"'"};const S=E[0];if(S==="'")return{isToken:!1,value:P$(E)};if(oS[S])return{isToken:!0,value:E};if(S.match(L$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:E}});i.localize.preprocessor&&(m=i.localize.preprocessor(f,m));const h={firstWeekContainsDate:l,weekStartsOn:u,locale:i};return m.map(E=>{if(!E.isToken)return E.value;const S=E.value;(T$(S)||A$(S))&&R$(S,t,String(e));const N=oS[S[0]];return N(f,S,i.localize,h)}).join("")}function P$(e){const t=e.match(k$);return t?t[1].replace(z$,"'"):e}function U$(e,t,r){const o=vc(),i=(r==null?void 0:r.locale)??o.locale??I2,l=2520,u=gd(e,t);if(isNaN(u))throw new RangeError("Invalid time value");const f=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:u}),[m,h]=Tf(r==null?void 0:r.in,...u>0?[t,e]:[e,t]),g=BH(h,m),v=($d(h)-$d(m))/1e3,b=Math.round((g-v)/60);let w;if(b<2)return b===0?i.formatDistance("lessThanXMinutes",1,f):i.formatDistance("xMinutes",b,f);if(b<45)return i.formatDistance("xMinutes",b,f);if(b<90)return i.formatDistance("aboutXHours",1,f);if(b<nS){const E=Math.round(b/60);return i.formatDistance("aboutXHours",E,f)}else{if(b<l)return i.formatDistance("xDays",1,f);if(b<td){const E=Math.round(b/nS);return i.formatDistance("xDays",E,f)}else if(b<td*2)return w=Math.round(b/td),i.formatDistance("aboutXMonths",w,f)}if(w=UH(h,m),w<12){const E=Math.round(b/td);return i.formatDistance("xMonths",E,f)}else{const E=w%12,S=Math.trunc(w/12);return E<3?i.formatDistance("aboutXYears",S,f):E<9?i.formatDistance("overXYears",S,f):i.formatDistance("almostXYears",S+1,f)}}function ug(e,t){return U$(e,TH(e),t)}function B$(){const e=rn(),[t,r]=x.useState([]),[o,i]=x.useState(""),l="http://localhost:8000/api",u=Tn(),f=Gn(Qe.create());x.useEffect(()=>{(async()=>{const{data:b}=await f.get(`${l}/flow-runs`,{headers:{Authorization:`Bearer ${u}`}});r(b),localStorage.setItem("flowRuns",JSON.stringify(b))})()},[]);const m=t.filter(v=>v.flowId.toLowerCase().includes(o.toLowerCase())||v.deviceSetId.toLowerCase().includes(o.toLowerCase())||v.state.toLowerCase().includes(o.toLowerCase())),h=v=>{switch(console.log("status badge "+v),v){case"running":return d.jsx(ut,{className:"bg-blue-500",children:"Running"});case"finished":return d.jsx(ut,{className:"bg-green-500",children:"Completed"});case"submitted":return d.jsx(ut,{className:"bg-yellow-500",children:"Submitted"});default:return d.jsx(ut,{className:"bg-gray-500",children:"Unknown"})}},g=v=>{switch(v){case"running":return d.jsx(nr,{className:"h-4 w-4 text-blue-500"});case"finished":return d.jsx(Nd,{className:"h-4 w-4 text-green-500"});case"submitted":return d.jsx(nr,{className:"h-4 w-4 text-yellow-500"});default:return d.jsx(Ed,{className:"h-4 w-4 text-gray-500"})}};return d.jsx(Jt,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsx("div",{className:"flex items-center justify-between",children:d.jsx("h1",{className:"text-2xl font-bold",children:"Workflow FlowRuns"})}),d.jsxs("div",{className:"relative",children:[d.jsx(es,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx(We,{placeholder:"Search flowRuns...",className:"pl-10",value:o,onChange:v=>i(v.target.value)})]}),d.jsx(Et,{children:d.jsx(Nt,{className:"p-0",children:d.jsxs(Qa,{children:[d.jsx(Ja,{children:d.jsxs(yt,{children:[d.jsx(Ue,{children:"Status"}),d.jsx(Ue,{children:"Workflow"}),d.jsx(Ue,{children:"Device Set"}),d.jsx(Ue,{children:"Started"}),d.jsx(Ue,{children:"Duration"}),d.jsx(Ue,{children:"Devices"}),d.jsx(Ue,{className:"w-[100px]",children:"Actions"})]})}),d.jsx(eo,{children:m.length===0?d.jsx(yt,{children:d.jsx(De,{colSpan:7,className:"text-center py-4 text-muted-foreground",children:"No flowRuns found"})}):m.map(v=>d.jsxs(yt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>e(`/executions/${v.flowRunId}`),children:[d.jsx(De,{children:d.jsxs("div",{className:"flex items-center gap-2",children:[g(v.state),h(v.state)]})}),d.jsx(De,{className:"font-medium",children:v.flowId}),d.jsx(De,{children:v.deviceSetId}),d.jsxs(De,{children:[ug(new Date(v.startTime))," ago"]}),d.jsx(De,{children:v.endTime?`${Math.round((new Date(v.endTime).getTime()-new Date(v.startTime).getTime())/1e3/60)} min`:"Running..."}),d.jsxs(De,{children:[v.deviceRuns.length," device",v.deviceRuns.length!==1?"s":""]}),d.jsx(De,{children:d.jsx(Ne,{variant:"outline",size:"sm",onClick:b=>{b.stopPropagation(),e(`/executions/${v.flowRunId}`)},children:"View Details"})})]},v.flowRunId))})]})})})]})})}function H$(){return d.jsx(B$,{})}function $$({flowRunId:e}){const t=rn(),[r,o]=x.useState(null),[i,l]=x.useState({});x.useEffect(()=>{const g=()=>{try{const b=localStorage.getItem("flowRuns");if(!b){t("/executions");return}const E=JSON.parse(b).find(S=>S.flowRunId===e);E?o(E):t("/executions")}catch(b){console.error("Error loading flowRun:",b),t("/executions")}},v=()=>{try{const b=localStorage.getItem("devices");if(b){const w=JSON.parse(b),E={};w.forEach(S=>{E[S.device_id]=S}),l(E)}}catch(b){console.error("Error loading devices:",b)}};g(),v()},[e,t]);const u=g=>{switch(g){case"queued":return d.jsx(ut,{className:"bg-yellow-500",children:"Queued"});case"running":return d.jsx(ut,{className:"bg-blue-500",children:"Running"});case"success":return d.jsx(ut,{className:"bg-green-500",children:"Completed"});case"failed":return d.jsx(ut,{className:"bg-red-500",children:"Failed"});default:return d.jsx(ut,{className:"bg-gray-500",children:"Unknown"})}},f=g=>{switch(g){case"submitted":return d.jsx(ut,{className:"bg-yellow-500",children:"Submitted"});case"running":return d.jsx(ut,{className:"bg-blue-500",children:"Running"});case"finished":return d.jsx(ut,{className:"bg-green-500",children:"Finished"});default:return d.jsx(ut,{className:"bg-gray-500",children:"Unknown"})}},m=g=>{switch(console.log("status icon "+g),g){case"running":return d.jsx(nr,{className:"h-4 w-4 text-blue-500"});case"finished":return d.jsx(Nd,{className:"h-4 w-4 text-green-500"});case"submitted":return d.jsx(nr,{className:"h-4 w-4 text-yellow-500"});default:return d.jsx(Ed,{className:"h-4 w-4 text-gray-500"})}},h=g=>{switch(g){case"queued":return d.jsx(nr,{className:"h-4 w-4 text-yellow-500"});case"running":return d.jsx(nr,{className:"h-4 w-4 text-blue-500"});case"success":return d.jsx(Nd,{className:"h-4 w-4 text-green-500"});case"failed":return d.jsx(xE,{className:"h-4 w-4 text-red-500"});default:return d.jsx(Ed,{className:"h-4 w-4 text-gray-500"})}};return r?d.jsx(Jt,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs(Ne,{variant:"ghost",size:"icon",onClick:()=>t("/executions"),children:[d.jsx(lc,{className:"h-5 w-5"}),d.jsx("span",{className:"sr-only",children:"Back to flowRuns"})]}),d.jsxs("div",{className:"flex-1",children:[d.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[m(r.state),r.flowId,f(r.state)]}),d.jsxs("p",{className:"text-muted-foreground",children:["FlowRun started ",ug(new Date(r.startTime))," ago",r.endTime&&` and took ${Math.round((new Date(r.endTime).getTime()-new Date(r.startTime).getTime())/1e3/60)} minutes`]})]})]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[d.jsxs(Et,{children:[d.jsx(fn,{className:"pb-2",children:d.jsx(hn,{className:"text-sm font-medium",children:"Workflow"})}),d.jsxs(Nt,{children:[d.jsx("p",{children:r.flowId}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["ID: ",r.flowId]})]})]}),d.jsxs(Et,{children:[d.jsx(fn,{className:"pb-2",children:d.jsx(hn,{className:"text-sm font-medium",children:"Device Set"})}),d.jsxs(Nt,{children:[d.jsx("p",{children:r.deviceSetId}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["ID: ",r.deviceSetId]})]})]}),d.jsxs(Et,{children:[d.jsx(fn,{className:"pb-2",children:d.jsx(hn,{className:"text-sm font-medium",children:"Status"})}),d.jsxs(Nt,{children:[d.jsxs("div",{className:"flex items-center gap-2",children:[m(r.state),d.jsx("span",{children:r.state.charAt(0).toUpperCase()+r.state.slice(1)})]}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:[r.deviceRuns.filter(g=>g.state==="queued").length," queued,"," ",r.deviceRuns.filter(g=>g.state==="success").length," success,"," ",r.deviceRuns.filter(g=>g.state==="running").length," running,"," ",r.deviceRuns.filter(g=>g.state==="failed").length," failed"]})]})]}),d.jsxs(Et,{children:[d.jsx(fn,{className:"pb-2",children:d.jsx(hn,{className:"text-sm font-medium",children:"Parameters"})}),d.jsx(Nt,{children:r.args&&Object.keys(r.args).length>0?d.jsx("div",{className:"space-y-1",children:Object.entries(r.args).map(([g,v])=>d.jsxs("div",{className:"flex justify-between text-sm",children:[d.jsxs("span",{className:"font-medium",children:[g,":"]}),d.jsx("span",{className:"text-muted-foreground",children:typeof v=="boolean"?v?"Yes":"No":String(v)})]},g))}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"No parameters used"})})]})]}),d.jsxs(Et,{children:[d.jsx(fn,{children:d.jsx(hn,{children:"Device Runs"})}),d.jsx(Nt,{className:"p-0",children:r.deviceRuns.length===0?"No device runs found":d.jsxs(Qa,{children:[d.jsx(Ja,{children:d.jsxs(yt,{children:[d.jsx(Ue,{children:"Status"}),d.jsx(Ue,{children:"Device"}),d.jsx(Ue,{children:"Host"}),d.jsx(Ue,{children:"Started"}),d.jsx(Ue,{children:"Duration"}),d.jsx(Ue,{className:"w-[100px]",children:"Actions"})]})}),d.jsx(eo,{children:r.deviceRuns.map(g=>{var v;return d.jsxs(yt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>t(`/executions/${r==null?void 0:r.flowRunId}/${g.id}`),children:[d.jsx(De,{children:d.jsxs("div",{className:"flex items-center gap-2",children:[h(g.state),u(g.state)]})}),d.jsx(De,{className:"font-medium",children:g.deviceId}),d.jsx(De,{children:((v=i[g.deviceId])==null?void 0:v.host)||"Unknown"}),d.jsxs(De,{children:[ug(new Date(g.actualStartTime))," ago"]}),d.jsx(De,{children:g.endTime?`${Math.round((new Date(g.endTime).getTime()-new Date(g.actualStartTime).getTime())/1e3/60)} min`:"Running..."}),d.jsx(De,{children:d.jsx(Ne,{variant:"outline",size:"sm",onClick:b=>{b.stopPropagation(),t(`/executions/${r==null?void 0:r.flowRunId}/${g.id}`)},children:"View Logs"})})]},g.id)})})]})})]})]})}):d.jsx(Jt,{children:d.jsx("div",{className:"container mx-auto py-6",children:d.jsx("p",{children:"Loading flowRun details..."})})})}function I$(){const e=nc();return d.jsx($$,{flowRunId:e.id})}function V$({flowRunId:e,deviceRunId:t}){const r=rn(),[o,i]=x.useState(null),[l,u]=x.useState(null),[f,m]=x.useState(null);x.useEffect(()=>{(()=>{try{const w=localStorage.getItem("flowRuns");if(!w){r("/executions");return}const S=JSON.parse(w).find(T=>T.flowRunId===e);if(!S){r("/executions");return}i(S);const N=S.deviceRuns.find(T=>T.id.toString()===t);if(!N){r(`/executions/${e}`);return}u(N);const C=localStorage.getItem("devices");if(C){const A=JSON.parse(C).find(_=>_.device_id===N.deviceId);A&&m(A)}}catch(w){console.log(w),r("/login")}})()},[e,t,r]);const h=b=>{switch(b){case"queued":return d.jsx(ut,{className:"bg-yellow-500",children:"Queued"});case"running":return d.jsx(ut,{className:"bg-blue-500",children:"Running"});case"success":return d.jsx(ut,{className:"bg-green-500",children:"Success"});case"failed":return d.jsx(ut,{className:"bg-red-500",children:"Failed"});default:return d.jsx(ut,{className:"bg-gray-500",children:"Unknown"})}},g=b=>{switch(b){case"queued":return d.jsx(nr,{className:"h-4 w-4 text-yellow-500"});case"running":return d.jsx(nr,{className:"h-4 w-4 text-blue-500"});case"success":return d.jsx(Nd,{className:"h-4 w-4 text-green-500"});case"failed":return d.jsx(xE,{className:"h-4 w-4 text-red-500"});default:return d.jsx(Ed,{className:"h-4 w-4 text-gray-500"})}},v=b=>{switch(b){case"info":return d.jsx(op,{className:"h-4 w-4 text-blue-500"});case"warning":return d.jsx(Ib,{className:"h-4 w-4 text-yellow-500"});case"error":return d.jsx($b,{className:"h-4 w-4 text-red-500"});default:return d.jsx(op,{className:"h-4 w-4 text-gray-500"})}};return!o||!l?d.jsx(Jt,{children:d.jsx("div",{className:"container mx-auto py-6",children:d.jsx("p",{children:"Loading device run details..."})})}):d.jsx(Jt,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs(Ne,{variant:"ghost",size:"icon",onClick:()=>r(`/executions/${e}`),children:[d.jsx(lc,{className:"h-5 w-5"}),d.jsx("span",{className:"sr-only",children:"Back to flowRun"})]}),d.jsxs("div",{className:"flex-1",children:[d.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[g(l.state),l.deviceId,h(l.state)]}),d.jsx("p",{className:"text-muted-foreground",children:f?`${f.host} (${f.device_type})`:l.deviceId})]})]}),d.jsx(Et,{children:d.jsxs(Nt,{className:"p-6",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h2",{className:"text-lg font-medium",children:"Device Run Logs"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(op,{className:"h-4 w-4 text-blue-500"}),d.jsx("span",{className:"text-xs",children:"Info"})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(Ib,{className:"h-4 w-4 text-yellow-500"}),d.jsx("span",{className:"text-xs",children:"Warning"})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx($b,{className:"h-4 w-4 text-red-500"}),d.jsx("span",{className:"text-xs",children:"Error"})]})]})]}),d.jsxs("div",{className:"border rounded-md overflow-hidden",children:[d.jsx("div",{className:"bg-muted p-2 text-xs font-mono",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("span",{children:["Device: ",l.deviceId]}),d.jsxs("span",{children:["Started: ",Id(new Date(l.actualStartTime),"yyyy-MM-dd HH:mm:ss")]})]})}),d.jsxs("div",{className:"p-4 max-h-[500px] overflow-y-auto font-mono text-sm",children:[l.logs.map((b,w)=>d.jsxs("div",{className:`flex items-start gap-2 p-1 rounded ${b.level==="error"?"bg-red-50":b.level==="warning"?"bg-yellow-50":""}`,children:[d.jsx("div",{className:"pt-0.5",children:v(b.level)}),d.jsx("div",{className:"flex-1",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs text-muted-foreground"}),d.jsx("span",{children:b.message})]})})]},w)),l.state==="running"&&d.jsxs("div",{className:"flex items-center gap-2 p-1 animate-pulse",children:[d.jsx(nr,{className:"h-4 w-4 text-blue-500"}),d.jsx("span",{children:"FlowRun in progress..."})]})]}),d.jsx("div",{className:"bg-muted p-2 text-xs font-mono",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("span",{children:["Status: ",l.state.toUpperCase()]}),d.jsx("span",{children:l.endTime?`Ended: ${Id(new Date(l.endTime),"yyyy-MM-dd HH:mm:ss")}`:"Running..."})]})})]})]})})]})})}function q$(){const e=nc();return d.jsx(V$,{flowRunId:e.id,deviceRunId:e.deviceRunId})}function Y$(){const e=rn(),[t,r]=x.useState([]),[o,i]=x.useState(""),l="http://localhost:8000/api",u=Tn(),f=Gn(Qe.create());x.useEffect(()=>{(async()=>{const{data:g}=await f.get(`${l}/groups`,{headers:{Authorization:`Bearer ${u}`}});r(g),localStorage.setItem("groups",JSON.stringify(g))})()},[]);const m=t.filter(h=>h.groupId.toLowerCase().includes(o.toLowerCase())||h.description.toLowerCase().includes(o.toLowerCase()));return d.jsx(Jt,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsx("div",{className:"flex items-center justify-between",children:d.jsx("h1",{className:"text-2xl font-bold",children:"My Groups"})}),d.jsxs("div",{className:"relative",children:[d.jsx(es,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx(We,{placeholder:"Search groups...",className:"pl-10",value:o,onChange:h=>i(h.target.value)})]}),d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:m.map(h=>d.jsxs(Et,{className:"overflow-hidden",children:[d.jsx(fn,{className:"pb-2",children:d.jsx(hn,{className:"text-lg",children:h.groupId})}),d.jsxs(Nt,{className:"pb-2",children:[d.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:h.description}),d.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[d.jsx(cc,{className:"h-4 w-4 text-muted-foreground"}),d.jsxs("span",{children:[h.members.length," members"]})]})]}),d.jsxs(hi,{className:"flex justify-between items-center pt-2",children:[d.jsxs("div",{className:"flex gap-1",children:[h.members.some(g=>g.role==="admin")&&d.jsx(ut,{variant:"outline",className:"text-xs",children:"Admin"}),h.members.some(g=>g.role==="operator")&&d.jsx(ut,{variant:"outline",className:"text-xs",children:"Operator"})]}),d.jsx(Ne,{variant:"outline",size:"sm",onClick:()=>e(`/groups/${h.groupId}`),children:"View Details"})]})]},h.groupId))}),m.length===0&&d.jsxs("div",{className:"text-center py-12",children:[d.jsx("p",{className:"text-muted-foreground",children:"No groups found"}),o&&d.jsx(Ne,{variant:"link",onClick:()=>i(""),className:"mt-2",children:"Clear search"})]})]})})}function G$(){return d.jsx(Y$,{})}function F$({groupId:e}){const t=rn(),[r,o]=x.useState(null),[i,l]=x.useState([]),u="http://localhost:8000/api",f=Tn(),m=Gn(Qe.create());return x.useEffect(()=>{(()=>{try{(async()=>{const{data:v}=await m.get(`${u}/groups/${e}`,{headers:{Authorization:`Bearer ${f}`}});o(v);const{data:b}=await m.get(`${u}/groups/${e}/members`,{headers:{Authorization:`Bearer ${f}`}});l(b)})()}catch(g){console.error("Error loading group:",g),t("/groups")}})()},[e,t,f,m]),r?d.jsx(Jt,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs(Ne,{variant:"ghost",size:"icon",onClick:()=>t("/groups"),children:[d.jsx(lc,{className:"h-5 w-5"}),d.jsx("span",{className:"sr-only",children:"Back to groups"})]}),d.jsx("div",{className:"flex-1",children:d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold",children:r.groupId}),d.jsx("p",{className:"text-muted-foreground",children:r.description})]})})]}),d.jsx(Et,{children:d.jsxs(Nt,{className:"p-6",children:[d.jsx("div",{className:"flex items-center justify-between mb-4",children:d.jsxs("h2",{className:"text-lg font-medium",children:["Members (",r.members.length,")"]})}),d.jsxs(Qa,{children:[d.jsx(Ja,{children:d.jsxs(yt,{children:[d.jsx(Ue,{children:"Name"}),d.jsx(Ue,{children:"Email"}),d.jsx(Ue,{children:"Role"})]})}),d.jsx(eo,{children:i.map(h=>d.jsxs(yt,{children:[d.jsx(De,{className:"font-medium",children:h.name}),d.jsx(De,{children:h.email}),d.jsx(De,{children:d.jsx(ut,{variant:h.role==="admin"||h.isSuperuser?"default":"outline",children:h.isSuperuser?"Superuser":h.role==="admin"?"Administrator":"Operator"})})]},h.id))})]})]})})]})}):d.jsx(Jt,{children:d.jsx("div",{className:"container mx-auto py-6",children:d.jsx("p",{children:"Loading group details..."})})})}function X$(){const e=nc();return d.jsx(F$,{groupId:e.id})}const W$=$g("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function Y2({className:e,variant:t,...r}){return d.jsx("div",{"data-slot":"alert",role:"alert",className:Me(W$({variant:t}),e),...r})}function G2({className:e,...t}){return d.jsx("div",{"data-slot":"alert-description",className:Me("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function K$(){const e=rn(),[t,r]=x.useState(""),[o,i]=x.useState(""),[l,u]=x.useState(""),[f,m]=x.useState(!1),h=async g=>{g.preventDefault(),m(!0),u("");try{await xz(t,o),e("/dashboard")}catch(v){u(v instanceof Error?v.message:"Failed to login")}finally{m(!1)}};return d.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-50",children:d.jsxs(Et,{className:"w-full max-w-md",children:[d.jsxs(fn,{children:[d.jsx(hn,{className:"text-2xl",children:"Login"}),d.jsx(qo,{children:"Enter your credentials to access your account"})]}),d.jsxs("form",{onSubmit:h,children:[d.jsxs(Nt,{className:"space-y-4",children:[l&&d.jsx(Y2,{variant:"destructive",children:d.jsx(G2,{children:l})}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"email",children:"Email"}),d.jsx(We,{id:"email",type:"email",placeholder:"m@example.com",value:t,onChange:g=>r(g.target.value),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"password",children:"Password"}),d.jsx(We,{id:"password",type:"password",value:o,onChange:g=>i(g.target.value),required:!0})]})]}),d.jsxs(hi,{className:"flex flex-col space-y-4 mt-3",children:[d.jsx(Ne,{type:"submit",className:"w-full",disabled:f,children:f?"Logging in...":"Login"}),d.jsxs("div",{className:"text-center text-sm",children:["Don't have an account?"," ",d.jsx(Wa,{to:"/register",className:"text-primary hover:underline",children:"Register"})]})]})]})]})})}function Z$(){const e=rn(),[t,r]=x.useState(""),[o,i]=x.useState(""),[l,u]=x.useState(""),[f,m]=x.useState(""),[h,g]=x.useState(""),[v,b]=x.useState(!1),w=async E=>{if(E.preventDefault(),b(!0),g(""),l!==f){g("Passwords do not match"),b(!1);return}try{await yz(t,o,l),e("/login?registered=true")}catch(S){g(S instanceof Error?S.message:"Failed to register")}finally{b(!1)}};return d.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-50",children:d.jsxs(Et,{className:"w-full max-w-md",children:[d.jsxs(fn,{children:[d.jsx(hn,{className:"text-2xl",children:"Register"}),d.jsx(qo,{children:"Create a new account to get started"})]}),d.jsxs("form",{onSubmit:w,children:[d.jsxs(Nt,{className:"space-y-4",children:[h&&d.jsx(Y2,{variant:"destructive",children:d.jsx(G2,{children:h})}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"name",children:"Full Name"}),d.jsx(We,{id:"name",placeholder:"John Doe",value:t,onChange:E=>r(E.target.value),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"email",children:"Email"}),d.jsx(We,{id:"email",type:"email",placeholder:"m@example.com",value:o,onChange:E=>i(E.target.value),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"password",children:"Password"}),d.jsx(We,{id:"password",type:"password",value:l,onChange:E=>u(E.target.value),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"confirm-password",children:"Confirm Password"}),d.jsx(We,{id:"confirm-password",type:"password",value:f,onChange:E=>m(E.target.value),required:!0})]})]}),d.jsxs(hi,{className:"flex flex-col space-y-4 mt-3",children:[d.jsx(Ne,{type:"submit",className:"w-full",disabled:v,children:v?"Registering...":"Register"}),d.jsxs("div",{className:"text-center text-sm",children:["Already have an account?"," ",d.jsx(Wa,{to:"/login",className:"text-primary hover:underline",children:"Login"})]})]})]})]})})}var Q$=fC();function J$(){return Q$.useSyncExternalStore(eI,()=>!0,()=>!1)}function eI(){return()=>{}}var vv="Avatar",[tI,x9]=fr(vv),[nI,F2]=tI(vv),X2=x.forwardRef((e,t)=>{const{__scopeAvatar:r,...o}=e,[i,l]=x.useState("idle");return d.jsx(nI,{scope:r,imageLoadingStatus:i,onImageLoadingStatusChange:l,children:d.jsx(Ae.span,{...o,ref:t})})});X2.displayName=vv;var W2="AvatarImage",K2=x.forwardRef((e,t)=>{const{__scopeAvatar:r,src:o,onLoadingStatusChange:i=()=>{},...l}=e,u=F2(W2,r),f=rI(o,l),m=$t(h=>{i(h),u.onImageLoadingStatusChange(h)});return Rt(()=>{f!=="idle"&&m(f)},[f,m]),f==="loaded"?d.jsx(Ae.img,{...l,ref:t,src:o}):null});K2.displayName=W2;var Z2="AvatarFallback",Q2=x.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:o,...i}=e,l=F2(Z2,r),[u,f]=x.useState(o===void 0);return x.useEffect(()=>{if(o!==void 0){const m=window.setTimeout(()=>f(!0),o);return()=>window.clearTimeout(m)}},[o]),u&&l.imageLoadingStatus!=="loaded"?d.jsx(Ae.span,{...i,ref:t}):null});Q2.displayName=Z2;function cS(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function rI(e,{referrerPolicy:t,crossOrigin:r}){const o=J$(),i=x.useRef(null),l=o?(i.current||(i.current=new window.Image),i.current):null,[u,f]=x.useState(()=>cS(l,e));return Rt(()=>{f(cS(l,e))},[l,e]),Rt(()=>{const m=v=>()=>{f(v)};if(!l)return;const h=m("loaded"),g=m("error");return l.addEventListener("load",h),l.addEventListener("error",g),t&&(l.referrerPolicy=t),typeof r=="string"&&(l.crossOrigin=r),()=>{l.removeEventListener("load",h),l.removeEventListener("error",g)}},[l,r,t]),u}var aI=X2,oI=K2,sI=Q2;function iI({className:e,...t}){return d.jsx(aI,{"data-slot":"avatar",className:Me("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function lI({className:e,...t}){return d.jsx(oI,{"data-slot":"avatar-image",className:Me("aspect-square size-full",e),...t})}function cI({className:e,...t}){return d.jsx(sI,{"data-slot":"avatar-fallback",className:Me("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}function uI(){const e="http://localhost:8000/api",t=Tn(),r=Gn(Qe.create()),[o,i]=x.useState(null),[l,u]=x.useState({name:"",email:""});x.useEffect(()=>{(async()=>{const{data:g}=await r.get(`${e}/users/me`,{headers:{Authorization:`Bearer ${t}`}});i(g),u({name:g.name,email:g.email})})()},[]);const f=h=>{const{name:g,value:v}=h.target;u({...l,[g]:v})},m=async h=>{if(o===null){console.log("User is null");return}h.preventDefault(),await r.patch(`${e}/users/${o.id}`,{name:l.name,email:l.email},{headers:{Authorization:`Bearer ${t}`}}),i({...o,name:l.name,email:l.email}),alert("Profile updated successfully!")};return d.jsx(Jt,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsx("div",{className:"flex items-center justify-between",children:d.jsx("h1",{className:"text-2xl font-bold",children:"User Profile"})}),d.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[d.jsxs(Et,{className:"md:w-80",children:[d.jsxs(fn,{children:[d.jsx("div",{className:"flex justify-center",children:d.jsxs(iI,{className:"h-24 w-24",children:[d.jsx(lI,{src:"/placeholder.svg?height=96&width=96",alt:o==null?void 0:o.name}),d.jsx(cI,{children:o==null?void 0:o.name.split(" ").map(h=>h[0]).join("")})]})}),d.jsx(hn,{className:"text-center mt-2",children:o==null?void 0:o.name}),d.jsx(qo,{className:"text-center",children:o==null?void 0:o.email})]}),d.jsxs(Nt,{className:"space-y-2",children:[d.jsx("div",{className:"flex justify-center",children:d.jsxs(ut,{variant:"outline",className:"flex items-center gap-1",children:[d.jsx(Cd,{className:"h-3 w-3"}),o!=null&&o.isSuperuser?"Superuser":(o==null?void 0:o.role)==="admin"?"Administrator":"Operator"]})}),d.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["Member since ",new Date().getFullYear()-2]})]})]}),d.jsx("div",{className:"flex-1",children:d.jsxs(Wd,{defaultValue:"profile",className:"w-full",children:[d.jsx(Kd,{className:"grid w-full grid-cols-1",children:d.jsxs(Io,{value:"profile",className:"flex items-center gap-2",children:[d.jsx(Cd,{className:"h-4 w-4"}),"Profile"]})}),d.jsx(Vo,{value:"profile",className:"space-y-4 pt-4",children:d.jsx(Et,{children:d.jsxs("form",{onSubmit:m,children:[d.jsxs(fn,{children:[d.jsx(hn,{children:"Profile Information"}),d.jsx(qo,{children:"Update your account information"})]}),d.jsxs(Nt,{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"name",children:"Full Name"}),d.jsx(We,{id:"name",name:"name",value:l.name,onChange:f})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"email",children:"Email"}),d.jsx(We,{id:"email",name:"email",type:"email",value:l.email,onChange:f})]})]}),d.jsx(hi,{children:d.jsxs(Ne,{type:"submit",className:"flex items-center gap-2 mt-2",children:[d.jsx(SE,{className:"h-4 w-4"}),"Save Changes"]})})]})})})]})})]})]})})}function dI(){return d.jsx(uI,{})}function fI(){return d.jsx(Jt,{children:d.jsxs("div",{className:"container mx-auto py-6",children:[d.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Settings"}),d.jsx("div",{className:"bg-muted/50 p-12 rounded-lg text-center",children:d.jsx("p",{className:"text-muted-foreground",children:"Settings page (placeholder)"})})]})})}function hI(e,t){return x.useReducer((r,o)=>t[r][o]??r,e)}var yv="ScrollArea",[J2,b9]=fr(yv),[mI,Fn]=J2(yv),ej=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:o="hover",dir:i,scrollHideDelay:l=600,...u}=e,[f,m]=x.useState(null),[h,g]=x.useState(null),[v,b]=x.useState(null),[w,E]=x.useState(null),[S,N]=x.useState(null),[C,T]=x.useState(0),[A,_]=x.useState(0),[O,L]=x.useState(!1),[B,I]=x.useState(!1),q=Ye(t,te=>m(te)),Q=oc(i);return d.jsx(mI,{scope:r,type:o,dir:Q,scrollHideDelay:l,scrollArea:f,viewport:h,onViewportChange:g,content:v,onContentChange:b,scrollbarX:w,onScrollbarXChange:E,scrollbarXEnabled:O,onScrollbarXEnabledChange:L,scrollbarY:S,onScrollbarYChange:N,scrollbarYEnabled:B,onScrollbarYEnabledChange:I,onCornerWidthChange:T,onCornerHeightChange:_,children:d.jsx(Ae.div,{dir:Q,...u,ref:q,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":A+"px",...e.style}})})});ej.displayName=yv;var tj="ScrollAreaViewport",nj=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:o,nonce:i,...l}=e,u=Fn(tj,r),f=x.useRef(null),m=Ye(t,f,u.onViewportChange);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),d.jsx(Ae.div,{"data-radix-scroll-area-viewport":"",...l,ref:m,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...e.style},children:d.jsx("div",{ref:u.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});nj.displayName=tj;var Tr="ScrollAreaScrollbar",rj=x.forwardRef((e,t)=>{const{forceMount:r,...o}=e,i=Fn(Tr,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:u}=i,f=e.orientation==="horizontal";return x.useEffect(()=>(f?l(!0):u(!0),()=>{f?l(!1):u(!1)}),[f,l,u]),i.type==="hover"?d.jsx(pI,{...o,ref:t,forceMount:r}):i.type==="scroll"?d.jsx(gI,{...o,ref:t,forceMount:r}):i.type==="auto"?d.jsx(aj,{...o,ref:t,forceMount:r}):i.type==="always"?d.jsx(xv,{...o,ref:t}):null});rj.displayName=Tr;var pI=x.forwardRef((e,t)=>{const{forceMount:r,...o}=e,i=Fn(Tr,e.__scopeScrollArea),[l,u]=x.useState(!1);return x.useEffect(()=>{const f=i.scrollArea;let m=0;if(f){const h=()=>{window.clearTimeout(m),u(!0)},g=()=>{m=window.setTimeout(()=>u(!1),i.scrollHideDelay)};return f.addEventListener("pointerenter",h),f.addEventListener("pointerleave",g),()=>{window.clearTimeout(m),f.removeEventListener("pointerenter",h),f.removeEventListener("pointerleave",g)}}},[i.scrollArea,i.scrollHideDelay]),d.jsx(vn,{present:r||l,children:d.jsx(aj,{"data-state":l?"visible":"hidden",...o,ref:t})})}),gI=x.forwardRef((e,t)=>{const{forceMount:r,...o}=e,i=Fn(Tr,e.__scopeScrollArea),l=e.orientation==="horizontal",u=Mf(()=>m("SCROLL_END"),100),[f,m]=hI("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return x.useEffect(()=>{if(f==="idle"){const h=window.setTimeout(()=>m("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(h)}},[f,i.scrollHideDelay,m]),x.useEffect(()=>{const h=i.viewport,g=l?"scrollLeft":"scrollTop";if(h){let v=h[g];const b=()=>{const w=h[g];v!==w&&(m("SCROLL"),u()),v=w};return h.addEventListener("scroll",b),()=>h.removeEventListener("scroll",b)}},[i.viewport,l,m,u]),d.jsx(vn,{present:r||f!=="hidden",children:d.jsx(xv,{"data-state":f==="hidden"?"hidden":"visible",...o,ref:t,onPointerEnter:ve(e.onPointerEnter,()=>m("POINTER_ENTER")),onPointerLeave:ve(e.onPointerLeave,()=>m("POINTER_LEAVE"))})})}),aj=x.forwardRef((e,t)=>{const r=Fn(Tr,e.__scopeScrollArea),{forceMount:o,...i}=e,[l,u]=x.useState(!1),f=e.orientation==="horizontal",m=Mf(()=>{if(r.viewport){const h=r.viewport.offsetWidth<r.viewport.scrollWidth,g=r.viewport.offsetHeight<r.viewport.scrollHeight;u(f?h:g)}},10);return ii(r.viewport,m),ii(r.content,m),d.jsx(vn,{present:o||l,children:d.jsx(xv,{"data-state":l?"visible":"hidden",...i,ref:t})})}),xv=x.forwardRef((e,t)=>{const{orientation:r="vertical",...o}=e,i=Fn(Tr,e.__scopeScrollArea),l=x.useRef(null),u=x.useRef(0),[f,m]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=cj(f.viewport,f.content),g={...o,sizes:f,onSizesChange:m,hasThumb:h>0&&h<1,onThumbChange:b=>l.current=b,onThumbPointerUp:()=>u.current=0,onThumbPointerDown:b=>u.current=b};function v(b,w){return SI(b,u.current,f,w)}return r==="horizontal"?d.jsx(vI,{...g,ref:t,onThumbPositionChange:()=>{if(i.viewport&&l.current){const b=i.viewport.scrollLeft,w=uS(b,f,i.dir);l.current.style.transform=`translate3d(${w}px, 0, 0)`}},onWheelScroll:b=>{i.viewport&&(i.viewport.scrollLeft=b)},onDragScroll:b=>{i.viewport&&(i.viewport.scrollLeft=v(b,i.dir))}}):r==="vertical"?d.jsx(yI,{...g,ref:t,onThumbPositionChange:()=>{if(i.viewport&&l.current){const b=i.viewport.scrollTop,w=uS(b,f);l.current.style.transform=`translate3d(0, ${w}px, 0)`}},onWheelScroll:b=>{i.viewport&&(i.viewport.scrollTop=b)},onDragScroll:b=>{i.viewport&&(i.viewport.scrollTop=v(b))}}):null}),vI=x.forwardRef((e,t)=>{const{sizes:r,onSizesChange:o,...i}=e,l=Fn(Tr,e.__scopeScrollArea),[u,f]=x.useState(),m=x.useRef(null),h=Ye(t,m,l.onScrollbarXChange);return x.useEffect(()=>{m.current&&f(getComputedStyle(m.current))},[m]),d.jsx(sj,{"data-orientation":"horizontal",...i,ref:h,sizes:r,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Rf(r)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,v)=>{if(l.viewport){const b=l.viewport.scrollLeft+g.deltaX;e.onWheelScroll(b),dj(b,v)&&g.preventDefault()}},onResize:()=>{m.current&&l.viewport&&u&&o({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:m.current.clientWidth,paddingStart:qd(u.paddingLeft),paddingEnd:qd(u.paddingRight)}})}})}),yI=x.forwardRef((e,t)=>{const{sizes:r,onSizesChange:o,...i}=e,l=Fn(Tr,e.__scopeScrollArea),[u,f]=x.useState(),m=x.useRef(null),h=Ye(t,m,l.onScrollbarYChange);return x.useEffect(()=>{m.current&&f(getComputedStyle(m.current))},[m]),d.jsx(sj,{"data-orientation":"vertical",...i,ref:h,sizes:r,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Rf(r)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,v)=>{if(l.viewport){const b=l.viewport.scrollTop+g.deltaY;e.onWheelScroll(b),dj(b,v)&&g.preventDefault()}},onResize:()=>{m.current&&l.viewport&&u&&o({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:m.current.clientHeight,paddingStart:qd(u.paddingTop),paddingEnd:qd(u.paddingBottom)}})}})}),[xI,oj]=J2(Tr),sj=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:o,hasThumb:i,onThumbChange:l,onThumbPointerUp:u,onThumbPointerDown:f,onThumbPositionChange:m,onDragScroll:h,onWheelScroll:g,onResize:v,...b}=e,w=Fn(Tr,r),[E,S]=x.useState(null),N=Ye(t,q=>S(q)),C=x.useRef(null),T=x.useRef(""),A=w.viewport,_=o.content-o.viewport,O=$t(g),L=$t(m),B=Mf(v,10);function I(q){if(C.current){const Q=q.clientX-C.current.left,te=q.clientY-C.current.top;h({x:Q,y:te})}}return x.useEffect(()=>{const q=Q=>{const te=Q.target;(E==null?void 0:E.contains(te))&&O(Q,_)};return document.addEventListener("wheel",q,{passive:!1}),()=>document.removeEventListener("wheel",q,{passive:!1})},[A,E,_,O]),x.useEffect(L,[o,L]),ii(E,B),ii(w.content,B),d.jsx(xI,{scope:r,scrollbar:E,hasThumb:i,onThumbChange:$t(l),onThumbPointerUp:$t(u),onThumbPositionChange:L,onThumbPointerDown:$t(f),children:d.jsx(Ae.div,{...b,ref:N,style:{position:"absolute",...b.style},onPointerDown:ve(e.onPointerDown,q=>{q.button===0&&(q.target.setPointerCapture(q.pointerId),C.current=E.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",w.viewport&&(w.viewport.style.scrollBehavior="auto"),I(q))}),onPointerMove:ve(e.onPointerMove,I),onPointerUp:ve(e.onPointerUp,q=>{const Q=q.target;Q.hasPointerCapture(q.pointerId)&&Q.releasePointerCapture(q.pointerId),document.body.style.webkitUserSelect=T.current,w.viewport&&(w.viewport.style.scrollBehavior=""),C.current=null})})})}),Vd="ScrollAreaThumb",ij=x.forwardRef((e,t)=>{const{forceMount:r,...o}=e,i=oj(Vd,e.__scopeScrollArea);return d.jsx(vn,{present:r||i.hasThumb,children:d.jsx(bI,{ref:t,...o})})}),bI=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:o,...i}=e,l=Fn(Vd,r),u=oj(Vd,r),{onThumbPositionChange:f}=u,m=Ye(t,v=>u.onThumbChange(v)),h=x.useRef(void 0),g=Mf(()=>{h.current&&(h.current(),h.current=void 0)},100);return x.useEffect(()=>{const v=l.viewport;if(v){const b=()=>{if(g(),!h.current){const w=EI(v,f);h.current=w,f()}};return f(),v.addEventListener("scroll",b),()=>v.removeEventListener("scroll",b)}},[l.viewport,g,f]),d.jsx(Ae.div,{"data-state":u.hasThumb?"visible":"hidden",...i,ref:m,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:ve(e.onPointerDownCapture,v=>{const w=v.target.getBoundingClientRect(),E=v.clientX-w.left,S=v.clientY-w.top;u.onThumbPointerDown({x:E,y:S})}),onPointerUp:ve(e.onPointerUp,u.onThumbPointerUp)})});ij.displayName=Vd;var bv="ScrollAreaCorner",lj=x.forwardRef((e,t)=>{const r=Fn(bv,e.__scopeScrollArea),o=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&o?d.jsx(wI,{...e,ref:t}):null});lj.displayName=bv;var wI=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,...o}=e,i=Fn(bv,r),[l,u]=x.useState(0),[f,m]=x.useState(0),h=!!(l&&f);return ii(i.scrollbarX,()=>{var v;const g=((v=i.scrollbarX)==null?void 0:v.offsetHeight)||0;i.onCornerHeightChange(g),m(g)}),ii(i.scrollbarY,()=>{var v;const g=((v=i.scrollbarY)==null?void 0:v.offsetWidth)||0;i.onCornerWidthChange(g),u(g)}),h?d.jsx(Ae.div,{...o,ref:t,style:{width:l,height:f,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function qd(e){return e?parseInt(e,10):0}function cj(e,t){const r=e/t;return isNaN(r)?0:r}function Rf(e){const t=cj(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-r)*t;return Math.max(o,18)}function SI(e,t,r,o="ltr"){const i=Rf(r),l=i/2,u=t||l,f=i-u,m=r.scrollbar.paddingStart+u,h=r.scrollbar.size-r.scrollbar.paddingEnd-f,g=r.content-r.viewport,v=o==="ltr"?[0,g]:[g*-1,0];return uj([m,h],v)(e)}function uS(e,t,r="ltr"){const o=Rf(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=t.scrollbar.size-i,u=t.content-t.viewport,f=l-o,m=r==="ltr"?[0,u]:[u*-1,0],h=Rp(e,m);return uj([0,u],[0,f])(h)}function uj(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(r-e[0])}}function dj(e,t){return e>0&&e<t}var EI=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},o=0;return function i(){const l={left:e.scrollLeft,top:e.scrollTop},u=r.left!==l.left,f=r.top!==l.top;(u||f)&&t(),r=l,o=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(o)};function Mf(e,t){const r=$t(e),o=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(o.current),[]),x.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(r,t)},[r,t])}function ii(e,t){const r=$t(t);Rt(()=>{let o=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(r)});return i.observe(e),()=>{window.cancelAnimationFrame(o),i.unobserve(e)}}},[e,r])}var NI=ej,CI=nj,jI=lj;function _I({className:e,children:t,...r}){return d.jsxs(NI,{"data-slot":"scroll-area",className:Me("relative",e),...r,children:[d.jsx(CI,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),d.jsx(AI,{}),d.jsx(jI,{})]})}function AI({className:e,orientation:t="vertical",...r}){return d.jsx(rj,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Me("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...r,children:d.jsx(ij,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}const TI=[{name:"Operations",items:[{type:"operation",name:"Decision",icon:bE,description:"Route based on multiple conditions",inputs:[{id:"in-1",label:"Input"}],outputs:[{id:"out-1",label:"True"},{id:"out-2",label:"False"}],config:{condition:""}}]},{name:"Connection",items:[{type:"connection",name:"Connect",icon:wE,description:"Connect to a remote system",inputs:[{id:"in-1",label:"Input"}],outputs:[{id:"out-1",label:"Output"}],config:{connectionType:"SSH"}},{type:"connection",name:"Command",icon:EE,description:"Execute a command on connected system",inputs:[{id:"in-1",label:"Input"}],outputs:[{id:"out-1",label:"Output"}],config:{command:""}},{type:"connection",name:"Disconnect",icon:zg,description:"Disconnect from remote system",inputs:[{id:"in-1",label:"Input"}],outputs:[{id:"out-1",label:"Output"}],config:{}}]}];function RI({onAddNode:e}){return d.jsxs("div",{className:"w-64 border-r bg-muted/40",children:[d.jsxs("div",{className:"p-4 border-b",children:[d.jsx("h2",{className:"font-medium",children:"Nodes"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Drag nodes to the canvas"})]}),d.jsx(_I,{className:"h-[calc(100vh-10rem)]",children:d.jsx("div",{className:"p-4 space-y-6",children:TI.map(t=>d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-medium mb-2",children:t.name}),d.jsx("div",{className:"space-y-1",children:t.items.map(r=>d.jsxs(Ne,{variant:"ghost",className:"w-full justify-start text-sm px-2 py-1 h-auto",onClick:()=>e(r.type,{label:r.name,description:r.description,inputs:r.inputs,outputs:r.outputs,config:r.config}),children:[d.jsx(r.icon,{className:"h-4 w-4 mr-2"}),r.name]},r.name))})]},t.name))})})]})}const dS={trigger:CE,schedule:nr,webhook:c4,filter:Tk,split:n4,decision:bE,"send email":Hk,database:Ck,"http request":Ek,"send message":qk,"create document":_k,connect:wE,command:EE,disconnect:zg},MI=(e,t)=>{const r=t.toLowerCase();return dS[e]||dS[r]||CE},DI={trigger:"bg-amber-100 border-amber-300",operation:"bg-sky-100 border-sky-300",action:"bg-emerald-100 border-emerald-300",connection:"bg-purple-100 border-purple-300"},OI=({data:e,isConnectable:t})=>{const r=MI(e.type,e.label),o=DI[e.type]||"bg-gray-100 border-gray-300";return d.jsxs("div",{className:`rounded-md border-2 shadow-sm ${o} p-3 min-w-[180px]`,children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.jsx(r,{className:"h-5 w-5"}),d.jsx("div",{className:"font-medium text-sm",children:e.label})]}),e.inputs&&e.inputs.map((i,l)=>d.jsx(si,{type:"target",position:Ce.Left,id:i.id||`input-${l}`,className:"w-3 h-3 bg-blue-500",style:{top:30+l*20},isConnectable:t},i.id||`input-${l}`)),e.outputs&&e.outputs.map((i,l)=>d.jsx(si,{type:"source",position:Ce.Right,id:i.id||`output-${l}`,className:"w-3 h-3 bg-blue-500",style:{top:30+l*20},isConnectable:t},i.id||`output-${l}`)),e.description&&d.jsx("div",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},kI=x.memo(OI);function zI({config:e,updateConfig:t}){return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"email-to",className:"text-xs font-medium block",children:"To:"}),d.jsx(We,{id:"email-to",type:"email",value:e.to||"",onChange:r=>t("to",r.target.value),className:"h-8 text-xs",placeholder:"recipient@example.com"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"email-subject",className:"text-xs font-medium block",children:"Subject:"}),d.jsx(We,{id:"email-subject",type:"text",value:e.subject||"",onChange:r=>t("subject",r.target.value),className:"h-8 text-xs",placeholder:"Email subject"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"email-body",className:"text-xs font-medium block",children:"Body:"}),d.jsx(ua,{id:"email-body",value:e.body||"",onChange:r=>t("body",r.target.value),className:"text-xs min-h-[120px] resize-none",placeholder:"Email content..."})]})]})}function LI({config:e,updateConfig:t}){return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"request-url",className:"text-xs font-medium block",children:"URL:"}),d.jsx(We,{id:"request-url",type:"text",value:e.url||"",onChange:r=>t("url",r.target.value),className:"h-8 text-xs",placeholder:"https://api.example.com/endpoint"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"request-method",className:"text-xs font-medium block",children:"Method:"}),d.jsxs(rr,{value:e.method||"GET",onValueChange:r=>t("method",r),children:[d.jsx(or,{id:"request-method",className:"h-8 text-xs",children:d.jsx(ar,{placeholder:"Select method"})}),d.jsxs(sr,{children:[d.jsx(ct,{value:"GET",children:"GET"}),d.jsx(ct,{value:"POST",children:"POST"}),d.jsx(ct,{value:"PUT",children:"PUT"}),d.jsx(ct,{value:"DELETE",children:"DELETE"}),d.jsx(ct,{value:"PATCH",children:"PATCH"})]})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"request-headers",className:"text-xs font-medium block",children:"Headers (JSON):"}),d.jsx(ua,{id:"request-headers",value:e.headers||"",onChange:r=>t("headers",r.target.value),className:"text-xs min-h-[80px] resize-none",placeholder:'{"Content-Type": "application/json"}'})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"request-body",className:"text-xs font-medium block",children:"Body (JSON):"}),d.jsx(ua,{id:"request-body",value:e.body||"",onChange:r=>t("body",r.target.value),className:"text-xs min-h-[80px] resize-none",placeholder:'{"key": "value"}'})]})]})}function PI({config:e,updateConfig:t}){return d.jsx("div",{className:"space-y-3",children:d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"connect-type",className:"text-xs font-medium block",children:"Connection Type:"}),d.jsxs(rr,{value:e.connectionType||"SSH",onValueChange:r=>t("connectionType",r),children:[d.jsx(or,{id:"connect-type",className:"h-8 text-xs",children:d.jsx(ar,{placeholder:"Select connection type"})}),d.jsxs(sr,{children:[d.jsx(ct,{value:"ssh",children:"SSH"}),d.jsx(ct,{value:"telnet",children:"Telnet"})]})]})]})})}function UI({config:e,updateConfig:t}){const[r,o]=x.useState(e.command||""),i=l=>{const u=l.target.value;o(u),t("command",u)};return x.useEffect(()=>{e.command!==r&&o(e.command)},[e.command]),d.jsx("div",{className:"space-y-3",children:d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"command",className:"text-xs font-medium block",children:"Command:"}),d.jsx(ua,{id:"command",value:r,onChange:i,className:"text-xs min-h-[120px] resize-none font-mono",placeholder:"Enter command to execute"})]})})}function BI({config:e,updateConfig:t}){const[r,o]=x.useState(e.condition||""),i=l=>{const u=l.target.value;o(u),t("condition",u)};return x.useEffect(()=>{e.condition!==r&&o(e.condition)},[e.condition]),d.jsx("div",{className:"space-y-3",children:d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"condition",className:"text-xs font-medium block",children:"Condition:"}),d.jsx(ua,{id:"condition",value:r,onChange:i,className:"text-xs min-h-[120px] resize-none font-mono",placeholder:"Enter condition to execute"})]})})}function nd({config:e,updateConfig:t,fields:r}){return d.jsx("div",{className:"space-y-3",children:r.map(o=>d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Xe,{htmlFor:`field-${o.key}`,className:"text-xs",children:[o.label,":"]}),o.type==="textarea"?d.jsx(ua,{id:`field-${o.key}`,value:e[o.key]||"",onChange:i=>t(o.key,i.target.value),className:"text-xs min-h-[80px] resize-none",placeholder:o.placeholder}):d.jsx(We,{id:`field-${o.key}`,type:o.type,value:e[o.key]||"",onChange:i=>t(o.key,i.target.value),className:"h-8 text-xs",placeholder:o.placeholder})]},o.key))})}function HI(e,t,r,o){switch(t){case"Send Email":return d.jsx(zI,{config:r,updateConfig:o});case"HTTP Request":return d.jsx(LI,{config:r,updateConfig:o});case"Connect":return d.jsx(PI,{config:r,updateConfig:o});case"Command":return d.jsx(UI,{config:r,updateConfig:o});case"Decision":return d.jsx(BI,{config:r,updateConfig:o});case"Database":return d.jsx(nd,{config:r,updateConfig:o,fields:[{key:"operation",label:"Operation",type:"text",placeholder:"select, insert, update, delete"},{key:"query",label:"Query",type:"textarea",placeholder:"SELECT * FROM users"}]});case"Send Message":return d.jsx(nd,{config:r,updateConfig:o,fields:[{key:"channel",label:"Channel",type:"text",placeholder:"#general"},{key:"message",label:"Message",type:"textarea",placeholder:"Your message here"}]});case"Disconnect":return d.jsx("p",{className:"text-xs text-muted-foreground",children:"No configuration needed for this node."})}switch(e){case"trigger":return d.jsx(nd,{config:r,updateConfig:o,fields:[{key:"schedule",label:"Schedule",type:"text",placeholder:"0 * * * *"}]});case"operation":return d.jsx(nd,{config:r,updateConfig:o,fields:[{key:"condition",label:"Condition",type:"text",placeholder:"data.value > 10"}]});default:return d.jsx("p",{className:"text-xs text-muted-foreground",children:"This node type doesn't have configurable fields."})}}function $I({user:e,parameters:t,onChange:r}){const[o,i]=x.useState({name:""}),l=()=>{if(!o.name)return;const f={name:o.name};r([...t,f]),i({name:""})},u=f=>{r(t.filter(m=>m.name!==f))};return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("h3",{className:"text-sm font-medium",children:"Workflow Parameters"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Define parameters that can be set when executing this workflow."})]}),t.length>0&&d.jsx("div",{className:"space-y-4",children:t.map(f=>d.jsx("div",{className:"border rounded-md p-3 space-y-3",children:d.jsxs("div",{className:"flex justify-between items-start",children:[d.jsx("div",{className:"font-medium text-sm",children:f.name}),d.jsxs(Ne,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground",onClick:()=>u(f.name),children:[d.jsx(Xo,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Remove parameter"})]})]})},f.name))}),e!=null&&e.isSuperuser||(e==null?void 0:e.role)==="admin"?d.jsxs("div",{className:"border rounded-md p-3 space-y-3",children:[d.jsx("h4",{className:"text-sm font-medium",children:"Add Parameter"}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx(Xe,{htmlFor:"new-param-name",className:"text-xs",children:"Name"}),d.jsx(We,{id:"new-param-name",value:o.name||"",onChange:f=>i({...o,name:f.target.value}),className:"h-8 text-xs",placeholder:"e.g., apiKey, timeout, environment"})]}),d.jsx(Ne,{onClick:l,className:"w-full mt-2",disabled:!o.name,children:"Add Parameter"})]})]}):d.jsx("div",{children:"No parameters"})]})}function II({parameters:e,onChange:t}){const[r,o]=x.useState({});x.useEffect(()=>{const l={};e.forEach(u=>{l[u.name]=""}),o(l),t(l)},[e,t]);const i=(l,u)=>{const f={...r,[l]:u};o(f),t(f)};return e.length===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:"This workflow has no parameters."}):d.jsx("div",{className:"space-y-4",children:e.map(l=>d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"flex justify-between items-baseline",children:d.jsx(Xe,{htmlFor:`param-input-${l.name}`,className:"text-sm font-medium",children:l.name})}),d.jsx(We,{id:`param-input-${l.name}`,value:r[l.name]||"",onChange:u=>i(l.name,u.target.value),placeholder:`Enter ${l.name}`})]},l.name))})}const VI={customNode:kI};function qI({workflowId:e}){const t=rn(),[r,o,i]=YB([]),[l,u,f]=GB([]),[m,h]=x.useState(null),[g,v]=x.useState("New Workflow"),[b,w]=x.useState("Workflow description"),[E,S]=x.useState([]),[N,C]=x.useState(""),[T,A]=x.useState(!0),[_,O]=x.useState([]),[L,B]=x.useState(!1),[I,q]=x.useState(""),[Q,te]=x.useState(""),[P,W]=x.useState(!1),[k,Y]=x.useState(""),M="http://localhost:8000/api",$=Tn(),U=Gn(Qe.create()),[z,R]=x.useState([]),[V,F]=x.useState({}),[K,re]=x.useState("canvas"),de=localStorage.getItem("user"),se=de?JSON.parse(de):null;x.useEffect(()=>{(async()=>{try{const fe=async()=>{const{data:Be}=await U.get(`${M}/device-sets`,{headers:{Authorization:`Bearer ${$}`}});S(Be)},Te=async()=>{const{data:Be}=await U.get(`${M}/flow-versions`,{params:{flowId:e},headers:{Authorization:`Bearer ${$}`}});O(Be)};if(fe(),Te(),e==="new"){A(!1);return}const{data:qe}=await U.get(`${M}/flows/${e}`,{headers:{Authorization:`Bearer ${$}`}});v(qe.flowId),w(qe.description),o(qe.savedState.nodes),u(qe.savedState.edges),console.log("edges are:"),console.log(l)}catch(fe){console.error("Error loading data:",fe)}A(!1)})()},[e,o,u]);const ie=x.useCallback(he=>{u(fe=>JC({...he,type:"smoothstep",animated:!0},fe||[]))},[u]),me=x.useCallback((he,fe)=>{h(fe),te("")},[]),pe=x.useCallback((he,fe)=>{const Te={id:`node_${Date.now()}`,type:"customNode",position:{x:Math.random()*300+50,y:Math.random()*300+50},data:{...fe,type:he}};o(qe=>qe.concat(Te))},[o]),ge=x.useCallback((he,fe)=>!fe||fe.trim()===""?(te("Node ID cannot be empty"),!1):r.some(qe=>qe.id===fe&&qe.id!==he)?(te("Node ID already exists"),!1):(o(qe=>qe.map(Be=>Be.id===he?{...Be,id:fe}:Be)),u(qe=>(qe||[]).map(Be=>Be.source===he?{...Be,source:fe}:Be.target===he?{...Be,target:fe}:Be)),m&&m.id===he&&h({...m,id:fe}),te(""),!0),[r,o,u,m]),Se=x.useCallback(async()=>{try{const he={nodes:r,edges:l};localStorage.setItem(`workflow_data_${e}`,JSON.stringify(he)),console.log(JSON.stringify(he)),await U.patch(`${M}/flows/${e}`,{savedState:he},{headers:{Authorization:`Bearer ${$}`}});const fe=localStorage.getItem("workflows"),Te=fe?JSON.parse(fe):[],qe=new Date().toISOString(),Be=Te.findIndex(on=>on.id===e);if(Be>=0)Te[Be]={...Te[Be],name:g,description:b,deviceSetId:N,groupId:N,updatedAt:qe,nodeCount:r.length};else{const on={id:e==="new"?`workflow-${Date.now()}`:e,name:g,description:b,deviceSetId:N,groupId:N,createdAt:qe,updatedAt:qe,nodeCount:r.length};Te.push(on)}localStorage.setItem("workflows",JSON.stringify(Te)),alert("Workflow saved!")}catch(he){console.error("Error saving workflow:",he),alert("Failed to save workflow")}},[r,l,e,g,b,N]),we=x.useCallback(async()=>{try{const he=new Date().toISOString(),fe={flowId:e,version:I,createdAt:he,structure:{nodes:r,edges:l},parameters:z.map(qe=>qe.name)};await U.post(`${M}/flow-versions`,fe,{headers:{Authorization:`Bearer ${$}`}});const Te=[..._,fe];O(Te),localStorage.setItem(`workflow_versions_${e}`,JSON.stringify(Te)),q(""),B(!1)}catch(he){console.error("Error saving version:",he),alert("Failed to save version")}},[e,I,r,l,_,z]),Ge=x.useCallback(he=>{try{const fe=_.find(Te=>Te.version===he);if(!fe){alert("Version not found");return}o(fe.structure.nodes),u(fe.structure.edges),fe.parameters&&R(fe.parameters.map(Te=>({name:Te}))),B(!1)}catch(fe){console.error("Error loading version:",fe),alert("Failed to load version")}},[_,o,u]),Ke=x.useCallback(async he=>{if(!N){alert("Please select a device set before executing the workflow");return}try{const fe=_.find(Be=>Be.version===he);if(!fe){alert("Please select a valid workflow version to execute");return}if(!E.find(Be=>Be.deviceSetId===N)){alert("Selected device set not found");return}const qe={flowId:e,version:fe.version,description:"",runType:"manual",deviceSetId:N,args:V};await U.post(`${M}/flow-runs`,qe,{headers:{Authorization:`Bearer ${$}`}}),W(!1),alert(`Workflow version "${fe.version}" execution started!`),t("/executions")}catch(fe){console.error("Error executing workflow:",fe),alert("Failed to execute workflow")}},[e,N,E,_,t,V]),Je=x.useCallback(()=>{if(_.length===0){alert("Please save at least one version of the workflow before executing");return}Y(_[_.length-1].version),W(!0)},[_]),mt=x.useCallback((he,fe,Te)=>{o(qe=>qe.map(Be=>{if(Be.id===he){const on={...Be.data.config,[fe]:Te};return{...Be,data:{...Be.data,config:on}}}return Be}))},[o]);return T?d.jsx("div",{className:"flex items-center justify-center h-screen",children:"Loading..."}):d.jsxs("div",{className:"flex flex-col h-screen",children:[d.jsxs("div",{className:"border-b px-3 py-2 flex items-center gap-3",children:[d.jsxs(Ne,{variant:"ghost",size:"icon",onClick:()=>t("/dashboard"),className:"mr-1",children:[d.jsx(lc,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Back to dashboard"})]}),d.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[d.jsxs("div",{className:"flex-1",children:[d.jsx("h2",{className:"font-medium",children:g}),d.jsx("p",{className:"text-xs text-muted-foreground",children:b})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(rr,{value:N,onValueChange:C,children:[d.jsx(or,{className:"w-[180px] h-8 text-xs",children:d.jsx(ar,{placeholder:"Select device set"})}),d.jsx(sr,{children:E.length===0?d.jsx(ct,{value:"none",disabled:!0,children:"No device sets available"}):E.map(he=>d.jsxs(ct,{value:he.deviceSetId,children:[he.deviceSetId," (",he.devices.length," devices)"]},he.deviceSetId))})]}),d.jsxs(aa,{open:L,onOpenChange:B,children:[d.jsx(ro,{asChild:!0,children:d.jsxs(Ne,{variant:"outline",size:"sm",className:"flex items-center gap-1 h-8",children:[d.jsx(Dk,{className:"h-3 w-3"}),"Versions"]})}),d.jsxs(oa,{className:"sm:max-w-[500px]",children:[d.jsxs(sa,{children:[d.jsx(ia,{children:"Workflow Versions"}),d.jsx(Zo,{children:"Save a new version or load a previous version of this workflow."})]}),d.jsxs("div",{className:"py-4",children:[((se==null?void 0:se.isSuperuser)||(se==null?void 0:se.role)==="admin")&&d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"text-sm font-medium mb-2",children:"Save New Version"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(We,{placeholder:"Version name",value:I,onChange:he=>q(he.target.value),className:"flex-1",required:!0}),d.jsx(Ne,{onClick:we,children:"Save Version"})]})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-medium mb-2",children:"Previous Versions"}),_.length===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:"No saved versions yet."}):d.jsx("div",{className:"max-h-[300px] overflow-y-auto border rounded-md",children:_.slice().reverse().map(he=>d.jsxs("div",{className:"flex items-center justify-between p-3 border-b last:border-b-0 hover:bg-muted/50",children:[d.jsxs("div",{children:[d.jsx("div",{className:"font-medium",children:he.version}),d.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[d.jsx(nr,{className:"h-3 w-3"}),Id(new Date(he.createdAt),"MMM d, yyyy HH:mm")]})]}),d.jsx(Ne,{variant:"outline",size:"sm",onClick:()=>Ge(he.version),children:"Load"})]},he.version))})]})]})]})]}),d.jsxs(Ne,{onClick:Se,size:"sm",variant:"outline",className:"flex items-center gap-1 h-8",children:[d.jsx(SE,{className:"h-3 w-3"}),"Save"]}),d.jsxs(Ne,{onClick:Je,size:"sm",variant:"default",className:"flex items-center gap-1 h-8",disabled:!N||_.length===0,children:[d.jsx(Xk,{className:"h-3 w-3"}),"Run"]})]})]})]}),d.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[d.jsx(RI,{onAddNode:pe}),d.jsx("div",{className:"flex-1 h-full flex flex-col",children:d.jsxs(Wd,{value:K,onValueChange:re,className:"relative w-full h-full",children:[d.jsxs(Kd,{className:"absolute mx-2 mt-1 z-40",children:[d.jsx(Io,{value:"canvas",children:"Canvas"}),d.jsx(Io,{value:"parameters",children:"Parameters"})]}),d.jsx(Vo,{value:"canvas",className:"flex-1 h-full",children:d.jsxs(k2,{nodes:r,edges:l,onNodesChange:i,onEdgesChange:f,onConnect:ie,onNodeClick:me,nodeTypes:VI,connectionLineType:Kr.SmoothStep,fitView:!0,nodesDraggable:(se==null?void 0:se.isSuperuser)||(se==null?void 0:se.role)!=="operator",nodesConnectable:(se==null?void 0:se.isSuperuser)||(se==null?void 0:se.role)!=="operator",children:[d.jsx(pH,{}),d.jsx(cH,{}),d.jsx(nH,{})]})}),d.jsx(Vo,{value:"parameters",className:"flex-1 p-4 overflow-auto",children:d.jsx($I,{user:se,parameters:z,onChange:R})})]})}),m&&d.jsxs("div",{className:"w-80 border-l p-4 overflow-auto",children:[d.jsx("h3",{className:"font-medium mb-2",children:m.data.label}),d.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:m.data.description}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("h4",{className:"text-sm font-medium mb-1",children:"Node ID"}),d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx(We,{value:m.id,onChange:he=>ge(m.id,he.target.value),className:"h-8 text-xs"}),Q&&d.jsx("p",{className:"text-xs text-red-500",children:Q})]})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-sm font-medium mb-1",children:"Type"}),d.jsx("p",{className:"text-xs capitalize",children:m.data.type})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-sm font-medium mb-2",children:"Configuration"}),HI(m.data.type,m.data.label,m.data.config,(he,fe)=>mt(m.id,he,fe))]})]})]}),d.jsx(aa,{open:P,onOpenChange:W,children:d.jsxs(oa,{className:"max-w-md",children:[d.jsxs(sa,{children:[d.jsx(ia,{children:"Select Workflow Version to Run"}),d.jsx(Zo,{children:"Choose which saved version of the workflow you want to execute."})]}),d.jsxs("div",{className:"py-4 space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"version-select",children:"Workflow Version"}),d.jsxs(rr,{value:k,onValueChange:he=>{Y(he);const fe=_.find(Te=>Te.version===he);fe&&fe.parameters&&R(fe.parameters.map(Te=>({name:Te})))},children:[d.jsx(or,{id:"version-select",children:d.jsx(ar,{placeholder:"Select a version"})}),d.jsx(sr,{children:_.map(he=>d.jsxs(ct,{value:he.version,children:[he.version," (",Id(new Date(he.createdAt),"MMM d, yyyy HH:mm"),")"]},he.version))})]})]}),k&&d.jsxs("div",{className:"space-y-2",children:[d.jsx("h3",{className:"text-sm font-medium",children:"Parameters"}),d.jsx(II,{parameters:z,onChange:F})]})]}),d.jsxs(ao,{children:[d.jsx(Ne,{variant:"outline",onClick:()=>W(!1),children:"Cancel"}),d.jsx(Ne,{onClick:()=>Ke(k),disabled:!k||z.some(he=>!V[he.name]),children:"Execute Workflow"})]})]})})]})]})}function YI(){const e=nc();return d.jsx(qI,{workflowId:e.id})}const GI=()=>{const e=Tn();if(!e)return!1;try{const{exp:t}=mz(e);return console.log(t),console.log(Math.floor(Date.now()/1e3)),t>Math.floor(Date.now()/1e3)}catch{return!1}},FI=()=>GI()?d.jsx(xT,{}):d.jsx(ES,{to:"/login",replace:!0});function XI(){return d.jsx(YT,{children:d.jsxs(wT,{children:[d.jsx(Ht,{path:"/",element:d.jsx(tR,{})}),d.jsxs(Ht,{element:d.jsx(FI,{}),children:[d.jsx(Ht,{path:"/admin",element:d.jsx(g5,{})}),d.jsx(Ht,{path:"/dashboard",element:d.jsx(yH,{})}),d.jsx(Ht,{path:"/devices",element:d.jsx(bH,{})}),d.jsx(Ht,{path:"/devices/sets",element:d.jsx(SH,{})}),d.jsx(Ht,{path:"/devices/sets/:id",element:d.jsx(NH,{})}),d.jsx(Ht,{path:"/executions",element:d.jsx(H$,{})}),d.jsx(Ht,{path:"/executions/:id",element:d.jsx(I$,{})}),d.jsx(Ht,{path:"/executions/:id/:deviceRunId",element:d.jsx(q$,{})}),d.jsx(Ht,{path:"/groups",element:d.jsx(G$,{})}),d.jsx(Ht,{path:"/groups/:id",element:d.jsx(X$,{})}),d.jsx(Ht,{path:"/profile",element:d.jsx(dI,{})}),d.jsx(Ht,{path:"/settings",element:d.jsx(fI,{})}),d.jsx(Ht,{path:"/workflow/:id",element:d.jsx(YI,{})})]}),d.jsx(Ht,{path:"/login",element:d.jsx(K$,{})}),d.jsx(Ht,{path:"/register",element:d.jsx(Z$,{})})]})})}_A.createRoot(document.getElementById("root")).render(d.jsx(x.StrictMode,{children:d.jsx(XI,{})}));
