better-auth-studio 1.0.44-beta.2 → 1.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +55 -0
- package/dist/routes.js.map +1 -1
- package/package.json +1 -1
- package/public/assets/main-DU-GSRgS.js +698 -0
- package/public/index.html +1 -1
- package/public/assets/main-C1f3XUJZ.js +0 -693
|
@@ -1,693 +0,0 @@
|
|
|
1
|
-
function KC(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const r in s)if(r!=="default"&&!(r in e)){const i=Object.getOwnPropertyDescriptor(s,r);i&&Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:()=>s[r]})}}}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 r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();function jh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mw={exports:{}},Sh={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var JC=Symbol.for("react.transitional.element"),eE=Symbol.for("react.fragment");function Tw(e,t,n){var s=null;if(n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:JC,type:e,key:s,ref:t!==void 0?t:null,props:n}}Sh.Fragment=eE;Sh.jsx=Tw;Sh.jsxs=Tw;Mw.exports=Sh;var a=Mw.exports,Dw={exports:{}},Pe={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Tg=Symbol.for("react.transitional.element"),tE=Symbol.for("react.portal"),nE=Symbol.for("react.fragment"),sE=Symbol.for("react.strict_mode"),aE=Symbol.for("react.profiler"),rE=Symbol.for("react.consumer"),iE=Symbol.for("react.context"),oE=Symbol.for("react.forward_ref"),lE=Symbol.for("react.suspense"),cE=Symbol.for("react.memo"),_w=Symbol.for("react.lazy"),D0=Symbol.iterator;function dE(e){return e===null||typeof e!="object"?null:(e=D0&&e[D0]||e["@@iterator"],typeof e=="function"?e:null)}var Aw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ow=Object.assign,zw={};function Lo(e,t,n){this.props=e,this.context=t,this.refs=zw,this.updater=n||Aw}Lo.prototype.isReactComponent={};Lo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Lo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Rw(){}Rw.prototype=Lo.prototype;function Dg(e,t,n){this.props=e,this.context=t,this.refs=zw,this.updater=n||Aw}var _g=Dg.prototype=new Rw;_g.constructor=Dg;Ow(_g,Lo.prototype);_g.isPureReactComponent=!0;var _0=Array.isArray,wt={H:null,A:null,T:null,S:null,V:null},Uw=Object.prototype.hasOwnProperty;function Ag(e,t,n,s,r,i){return n=i.ref,{$$typeof:Tg,type:e,key:t,ref:n!==void 0?n:null,props:i}}function uE(e,t){return Ag(e.type,t,void 0,void 0,void 0,e.props)}function Og(e){return typeof e=="object"&&e!==null&&e.$$typeof===Tg}function hE(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var A0=/\/+/g;function _f(e,t){return typeof e=="object"&&e!==null&&e.key!=null?hE(""+e.key):t.toString(36)}function O0(){}function fE(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(O0,O0):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Oi(e,t,n,s,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Tg:case tE:o=!0;break;case _w:return o=e._init,Oi(o(e._payload),t,n,s,r)}}if(o)return r=r(e),o=s===""?"."+_f(e,0):s,_0(r)?(n="",o!=null&&(n=o.replace(A0,"$&/")+"/"),Oi(r,t,n,"",function(u){return u})):r!=null&&(Og(r)&&(r=uE(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(A0,"$&/")+"/")+o)),t.push(r)),1;o=0;var l=s===""?".":s+":";if(_0(e))for(var c=0;c<e.length;c++)s=e[c],i=l+_f(s,c),o+=Oi(s,t,n,i,r);else if(c=dE(e),typeof c=="function")for(e=c.call(e),c=0;!(s=e.next()).done;)s=s.value,i=l+_f(s,c++),o+=Oi(s,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return Oi(fE(e),t,n,s,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function hd(e,t,n){if(e==null)return e;var s=[],r=0;return Oi(e,s,"","",function(i){return t.call(n,i,r++)}),s}function mE(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var z0=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function xE(){}Pe.Children={map:hd,forEach:function(e,t,n){hd(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return hd(e,function(){t++}),t},toArray:function(e){return hd(e,function(t){return t})||[]},only:function(e){if(!Og(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Pe.Component=Lo;Pe.Fragment=nE;Pe.Profiler=aE;Pe.PureComponent=Dg;Pe.StrictMode=sE;Pe.Suspense=lE;Pe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=wt;Pe.__COMPILER_RUNTIME={__proto__:null,c:function(e){return wt.H.useMemoCache(e)}};Pe.cache=function(e){return function(){return e.apply(null,arguments)}};Pe.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var s=Ow({},e.props),r=e.key,i=void 0;if(t!=null)for(o in t.ref!==void 0&&(i=void 0),t.key!==void 0&&(r=""+t.key),t)!Uw.call(t,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&t.ref===void 0||(s[o]=t[o]);var o=arguments.length-2;if(o===1)s.children=n;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];s.children=l}return Ag(e.type,r,void 0,void 0,i,s)};Pe.createContext=function(e){return e={$$typeof:iE,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:rE,_context:e},e};Pe.createElement=function(e,t,n){var s,r={},i=null;if(t!=null)for(s in t.key!==void 0&&(i=""+t.key),t)Uw.call(t,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(r[s]=t[s]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];r.children=l}if(e&&e.defaultProps)for(s in o=e.defaultProps,o)r[s]===void 0&&(r[s]=o[s]);return Ag(e,i,void 0,void 0,null,r)};Pe.createRef=function(){return{current:null}};Pe.forwardRef=function(e){return{$$typeof:oE,render:e}};Pe.isValidElement=Og;Pe.lazy=function(e){return{$$typeof:_w,_payload:{_status:-1,_result:e},_init:mE}};Pe.memo=function(e,t){return{$$typeof:cE,type:e,compare:t===void 0?null:t}};Pe.startTransition=function(e){var t=wt.T,n={};wt.T=n;try{var s=e(),r=wt.S;r!==null&&r(n,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(xE,z0)}catch(i){z0(i)}finally{wt.T=t}};Pe.unstable_useCacheRefresh=function(){return wt.H.useCacheRefresh()};Pe.use=function(e){return wt.H.use(e)};Pe.useActionState=function(e,t,n){return wt.H.useActionState(e,t,n)};Pe.useCallback=function(e,t){return wt.H.useCallback(e,t)};Pe.useContext=function(e){return wt.H.useContext(e)};Pe.useDebugValue=function(){};Pe.useDeferredValue=function(e,t){return wt.H.useDeferredValue(e,t)};Pe.useEffect=function(e,t,n){var s=wt.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return s.useEffect(e,t)};Pe.useId=function(){return wt.H.useId()};Pe.useImperativeHandle=function(e,t,n){return wt.H.useImperativeHandle(e,t,n)};Pe.useInsertionEffect=function(e,t){return wt.H.useInsertionEffect(e,t)};Pe.useLayoutEffect=function(e,t){return wt.H.useLayoutEffect(e,t)};Pe.useMemo=function(e,t){return wt.H.useMemo(e,t)};Pe.useOptimistic=function(e,t){return wt.H.useOptimistic(e,t)};Pe.useReducer=function(e,t,n){return wt.H.useReducer(e,t,n)};Pe.useRef=function(e){return wt.H.useRef(e)};Pe.useState=function(e){return wt.H.useState(e)};Pe.useSyncExternalStore=function(e,t,n){return wt.H.useSyncExternalStore(e,t,n)};Pe.useTransition=function(){return wt.H.useTransition()};Pe.version="19.1.0";Dw.exports=Pe;var m=Dw.exports;const Q=jh(m),Ch=KC({__proto__:null,default:Q},[m]);var $w={exports:{}},Eh={},Lw={exports:{}},Pw={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(M,_){var E=M.length;M.push(_);e:for(;0<E;){var D=E-1>>>1,L=M[D];if(0<r(L,_))M[D]=_,M[E]=L,E=D;else break e}}function n(M){return M.length===0?null:M[0]}function s(M){if(M.length===0)return null;var _=M[0],E=M.pop();if(E!==_){M[0]=E;e:for(var D=0,L=M.length,W=L>>>1;D<W;){var R=2*(D+1)-1,H=M[R],q=R+1,X=M[q];if(0>r(H,E))q<L&&0>r(X,H)?(M[D]=X,M[q]=E,D=q):(M[D]=H,M[R]=E,D=R);else if(q<L&&0>r(X,E))M[D]=X,M[q]=E,D=q;else break e}}return _}function r(M,_){var E=M.sortIndex-_.sortIndex;return E!==0?E:M.id-_.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],h=1,d=null,f=3,x=!1,w=!1,v=!1,N=!1,g=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;function y(M){for(var _=n(u);_!==null;){if(_.callback===null)s(u);else if(_.startTime<=M)s(u),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(u)}}function j(M){if(v=!1,y(M),!w)if(n(c)!==null)w=!0,S||(S=!0,O());else{var _=n(u);_!==null&&z(j,_.startTime-M)}}var S=!1,C=-1,T=5,A=-1;function P(){return N?!0:!(e.unstable_now()-A<T)}function U(){if(N=!1,S){var M=e.unstable_now();A=M;var _=!0;try{e:{w=!1,v&&(v=!1,b(C),C=-1),x=!0;var E=f;try{t:{for(y(M),d=n(c);d!==null&&!(d.expirationTime>M&&P());){var D=d.callback;if(typeof D=="function"){d.callback=null,f=d.priorityLevel;var L=D(d.expirationTime<=M);if(M=e.unstable_now(),typeof L=="function"){d.callback=L,y(M),_=!0;break t}d===n(c)&&s(c),y(M)}else s(c);d=n(c)}if(d!==null)_=!0;else{var W=n(u);W!==null&&z(j,W.startTime-M),_=!1}}break e}finally{d=null,f=E,x=!1}_=void 0}}finally{_?O():S=!1}}}var O;if(typeof p=="function")O=function(){p(U)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,k=V.port2;V.port1.onmessage=U,O=function(){k.postMessage(null)}}else O=function(){g(U,0)};function z(M,_){C=g(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"):T=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(M){switch(f){case 1:case 2:case 3:var _=3;break;default:_=f}var E=f;f=_;try{return M()}finally{f=E}},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 E=f;f=M;try{return _()}finally{f=E}},e.unstable_scheduleCallback=function(M,_,E){var D=e.unstable_now();switch(typeof E=="object"&&E!==null?(E=E.delay,E=typeof E=="number"&&0<E?D+E:D):E=D,M){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=E+L,M={id:h++,callback:_,priorityLevel:M,startTime:E,expirationTime:L,sortIndex:-1},E>D?(M.sortIndex=E,t(u,M),n(c)===null&&M===n(u)&&(v?(b(C),C=-1):v=!0,z(j,E-D))):(M.sortIndex=L,t(c,M),w||x||(w=!0,S||(S=!0,O()))),M},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(M){var _=f;return function(){var E=f;f=_;try{return M.apply(this,arguments)}finally{f=E}}}})(Pw);Lw.exports=Pw;var gE=Lw.exports,Bw={exports:{}},hn={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var pE=m;function Hw(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function _a(){}var un={d:{f:_a,r:function(){throw Error(Hw(522))},D:_a,C:_a,L:_a,m:_a,X:_a,S:_a,M:_a},p:0,findDOMNode:null},vE=Symbol.for("react.portal");function bE(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:vE,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}var _l=pE.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function kh(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=un;hn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Hw(299));return bE(e,t,null,n)};hn.flushSync=function(e){var t=_l.T,n=un.p;try{if(_l.T=null,un.p=2,e)return e()}finally{_l.T=t,un.p=n,un.d.f()}};hn.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,un.d.C(e,t))};hn.prefetchDNS=function(e){typeof e=="string"&&un.d.D(e)};hn.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,s=kh(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?un.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:s,integrity:r,fetchPriority:i}):n==="script"&&un.d.X(e,{crossOrigin:s,integrity:r,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};hn.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=kh(t.as,t.crossOrigin);un.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&un.d.M(e)};hn.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,s=kh(n,t.crossOrigin);un.d.L(e,n,{crossOrigin:s,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};hn.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=kh(t.as,t.crossOrigin);un.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else un.d.m(e)};hn.requestFormReset=function(e){un.d.r(e)};hn.unstable_batchedUpdates=function(e,t){return e(t)};hn.useFormState=function(e,t,n){return _l.H.useFormState(e,t,n)};hn.useFormStatus=function(){return _l.H.useHostTransitionStatus()};hn.version="19.1.0";function Vw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vw)}catch(e){console.error(e)}}Vw(),Bw.exports=hn;var Mh=Bw.exports;const Yw=jh(Mh);/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var Vt=gE,Fw=m,yE=Mh;function ie(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Iw(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ec(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Ww(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function R0(e){if(Ec(e)!==e)throw Error(ie(188))}function wE(e){var t=e.alternate;if(!t){if(t=Ec(e),t===null)throw Error(ie(188));return t!==e?null:e}for(var n=e,s=t;;){var r=n.return;if(r===null)break;var i=r.alternate;if(i===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===n)return R0(r),e;if(i===s)return R0(r),t;i=i.sibling}throw Error(ie(188))}if(n.return!==s.return)n=r,s=i;else{for(var o=!1,l=r.child;l;){if(l===n){o=!0,n=r,s=i;break}if(l===s){o=!0,s=r,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,s=r;break}if(l===s){o=!0,s=i,n=r;break}l=l.sibling}if(!o)throw Error(ie(189))}}if(n.alternate!==s)throw Error(ie(190))}if(n.tag!==3)throw Error(ie(188));return n.stateNode.current===n?e:t}function qw(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=qw(e),t!==null)return t;e=e.sibling}return null}var pt=Object.assign,NE=Symbol.for("react.element"),fd=Symbol.for("react.transitional.element"),Sl=Symbol.for("react.portal"),Pi=Symbol.for("react.fragment"),Xw=Symbol.for("react.strict_mode"),Gm=Symbol.for("react.profiler"),jE=Symbol.for("react.provider"),Gw=Symbol.for("react.consumer"),ra=Symbol.for("react.context"),zg=Symbol.for("react.forward_ref"),Zm=Symbol.for("react.suspense"),Qm=Symbol.for("react.suspense_list"),Rg=Symbol.for("react.memo"),Va=Symbol.for("react.lazy"),Km=Symbol.for("react.activity"),SE=Symbol.for("react.memo_cache_sentinel"),U0=Symbol.iterator;function al(e){return e===null||typeof e!="object"?null:(e=U0&&e[U0]||e["@@iterator"],typeof e=="function"?e:null)}var CE=Symbol.for("react.client.reference");function Jm(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===CE?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Pi:return"Fragment";case Gm:return"Profiler";case Xw:return"StrictMode";case Zm:return"Suspense";case Qm:return"SuspenseList";case Km:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Sl:return"Portal";case ra:return(e.displayName||"Context")+".Provider";case Gw:return(e._context.displayName||"Context")+".Consumer";case zg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Rg:return t=e.displayName||null,t!==null?t:Jm(e.type)||"Memo";case Va:t=e._payload,e=e._init;try{return Jm(e(t))}catch{}}return null}var Cl=Array.isArray,Te=Fw.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,tt=yE.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Br={pending:!1,data:null,method:null,action:null},ex=[],Bi=-1;function Ws(e){return{current:e}}function Xt(e){0>Bi||(e.current=ex[Bi],ex[Bi]=null,Bi--)}function Nt(e,t){Bi++,ex[Bi]=e.current,e.current=t}var Ls=Ws(null),Gl=Ws(null),tr=Ws(null),yu=Ws(null);function wu(e,t){switch(Nt(tr,t),Nt(Gl,e),Nt(Ls,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hv(t),e=hj(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Xt(Ls),Nt(Ls,e)}function mo(){Xt(Ls),Xt(Gl),Xt(tr)}function tx(e){e.memoizedState!==null&&Nt(yu,e);var t=Ls.current,n=hj(t,e.type);t!==n&&(Nt(Gl,e),Nt(Ls,n))}function Nu(e){Gl.current===e&&(Xt(Ls),Xt(Gl)),yu.current===e&&(Xt(yu),rc._currentValue=Br)}var nx=Object.prototype.hasOwnProperty,Ug=Vt.unstable_scheduleCallback,Af=Vt.unstable_cancelCallback,EE=Vt.unstable_shouldYield,kE=Vt.unstable_requestPaint,Ps=Vt.unstable_now,ME=Vt.unstable_getCurrentPriorityLevel,Zw=Vt.unstable_ImmediatePriority,Qw=Vt.unstable_UserBlockingPriority,ju=Vt.unstable_NormalPriority,TE=Vt.unstable_LowPriority,Kw=Vt.unstable_IdlePriority,DE=Vt.log,_E=Vt.unstable_setDisableYieldValue,kc=null,Un=null;function Za(e){if(typeof DE=="function"&&_E(e),Un&&typeof Un.setStrictMode=="function")try{Un.setStrictMode(kc,e)}catch{}}var $n=Math.clz32?Math.clz32:zE,AE=Math.log,OE=Math.LN2;function zE(e){return e>>>=0,e===0?32:31-(AE(e)/OE|0)|0}var md=256,xd=4194304;function Dr(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Th(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=s&134217727;return l!==0?(s=l&~i,s!==0?r=Dr(s):(o&=l,o!==0?r=Dr(o):n||(n=l&~e,n!==0&&(r=Dr(n))))):(l=s&~i,l!==0?r=Dr(l):o!==0?r=Dr(o):n||(n=s&~e,n!==0&&(r=Dr(n)))),r===0?0:t!==0&&t!==r&&!(t&i)&&(i=r&-r,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:r}function Mc(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function RE(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Jw(){var e=md;return md<<=1,!(md&4194048)&&(md=256),e}function e1(){var e=xd;return xd<<=1,!(xd&62914560)&&(xd=4194304),e}function Of(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Tc(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function UE(e,t,n,s,r,i){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=o&~n;0<n;){var h=31-$n(n),d=1<<h;l[h]=0,c[h]=-1;var f=u[h];if(f!==null)for(u[h]=null,h=0;h<f.length;h++){var x=f[h];x!==null&&(x.lane&=-536870913)}n&=~d}s!==0&&t1(e,s,0),i!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=i&~(o&~t))}function t1(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-$n(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&4194090}function n1(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-$n(n),r=1<<s;r&t|e[s]&t&&(e[s]|=t),n&=~r}}function $g(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Lg(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function s1(){var e=tt.p;return e!==0?e:(e=window.event,e===void 0?32:Nj(e.type))}function $E(e,t){var n=tt.p;try{return tt.p=e,t()}finally{tt.p=n}}var yr=Math.random().toString(36).slice(2),rn="__reactFiber$"+yr,Nn="__reactProps$"+yr,Po="__reactContainer$"+yr,sx="__reactEvents$"+yr,LE="__reactListeners$"+yr,PE="__reactHandles$"+yr,$0="__reactResources$"+yr,Dc="__reactMarker$"+yr;function Pg(e){delete e[rn],delete e[Nn],delete e[sx],delete e[LE],delete e[PE]}function Hi(e){var t=e[rn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Po]||n[rn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Fv(e);e!==null;){if(n=e[rn])return n;e=Fv(e)}return t}e=n,n=e.parentNode}return null}function Bo(e){if(e=e[rn]||e[Po]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function El(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(ie(33))}function Ji(e){var t=e[$0];return t||(t=e[$0]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Wt(e){e[Dc]=!0}var a1=new Set,r1={};function mi(e,t){xo(e,t),xo(e+"Capture",t)}function xo(e,t){for(r1[e]=t,e=0;e<t.length;e++)a1.add(t[e])}var BE=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]*$"),L0={},P0={};function HE(e){return nx.call(P0,e)?!0:nx.call(L0,e)?!1:BE.test(e)?P0[e]=!0:(L0[e]=!0,!1)}function Zd(e,t,n){if(HE(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function gd(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Ks(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+s)}}var zf,B0;function zi(e){if(zf===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);zf=t&&t[1]||"",B0=-1<n.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+zf+e+B0}var Rf=!1;function Uf(e,t){if(!e||Rf)return"";Rf=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(x){var f=x}Reflect.construct(e,[],d)}else{try{d.call()}catch(x){f=x}e.call(d.prototype)}}else{try{throw Error()}catch(x){f=x}(d=e())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(x){if(x&&f&&typeof x.stack=="string")return[x.stack,f.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=s.DetermineComponentFrameRoot(),o=i[0],l=i[1];if(o&&l){var c=o.split(`
|
|
44
|
-
`),u=l.split(`
|
|
45
|
-
`);for(r=s=0;s<c.length&&!c[s].includes("DetermineComponentFrameRoot");)s++;for(;r<u.length&&!u[r].includes("DetermineComponentFrameRoot");)r++;if(s===c.length||r===u.length)for(s=c.length-1,r=u.length-1;1<=s&&0<=r&&c[s]!==u[r];)r--;for(;1<=s&&0<=r;s--,r--)if(c[s]!==u[r]){if(s!==1||r!==1)do if(s--,r--,0>r||c[s]!==u[r]){var h=`
|
|
46
|
-
`+c[s].replace(" at new "," at ");return e.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",e.displayName)),h}while(1<=s&&0<=r);break}}}finally{Rf=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?zi(n):""}function VE(e){switch(e.tag){case 26:case 27:case 5:return zi(e.type);case 16:return zi("Lazy");case 13:return zi("Suspense");case 19:return zi("SuspenseList");case 0:case 15:return Uf(e.type,!1);case 11:return Uf(e.type.render,!1);case 1:return Uf(e.type,!0);case 31:return zi("Activity");default:return""}}function H0(e){try{var t="";do t+=VE(e),e=e.return;while(e);return t}catch(n){return`
|
|
47
|
-
Error generating stack: `+n.message+`
|
|
48
|
-
`+n.stack}}function es(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function i1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function YE(e){var t=i1(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(o){s=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Su(e){e._valueTracker||(e._valueTracker=YE(e))}function o1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=i1(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Cu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var FE=/[\n"\\]/g;function ss(e){return e.replace(FE,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ax(e,t,n,s,r,i,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+es(t)):e.value!==""+es(t)&&(e.value=""+es(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?rx(e,o,es(t)):n!=null?rx(e,o,es(n)):s!=null&&e.removeAttribute("value"),r==null&&i!=null&&(e.defaultChecked=!!i),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+es(l):e.removeAttribute("name")}function l1(e,t,n,s,r,i,o,l){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null))return;n=n!=null?""+es(n):"",t=t!=null?""+es(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=l?e.checked:!!s,e.defaultChecked=!!s,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o)}function rx(e,t,n){t==="number"&&Cu(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function eo(e,t,n,s){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&s&&(e[n].defaultSelected=!0)}else{for(n=""+es(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function c1(e,t,n){if(t!=null&&(t=""+es(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+es(n):""}function d1(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(ie(92));if(Cl(s)){if(1<s.length)throw Error(ie(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=es(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s)}function go(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var IE=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 V0(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||IE.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function u1(e,t,n){if(t!=null&&typeof t!="object")throw Error(ie(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var r in t)s=t[r],t.hasOwnProperty(r)&&n[r]!==s&&V0(e,r,s)}else for(var i in t)t.hasOwnProperty(i)&&V0(e,i,t[i])}function Bg(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var WE=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"]]),qE=/^[\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 Qd(e){return qE.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var ix=null;function Hg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vi=null,to=null;function Y0(e){var t=Bo(e);if(t&&(e=t.stateNode)){var n=e[Nn]||null;e:switch(e=t.stateNode,t.type){case"input":if(ax(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+ss(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var r=s[Nn]||null;if(!r)throw Error(ie(90));ax(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&o1(s)}break e;case"textarea":c1(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&eo(e,!!n.multiple,t,!1)}}}var $f=!1;function h1(e,t,n){if($f)return e(t,n);$f=!0;try{var s=e(t);return s}finally{if($f=!1,(Vi!==null||to!==null)&&(Ph(),Vi&&(t=Vi,e=to,to=Vi=null,Y0(t),e)))for(t=0;t<e.length;t++)Y0(e[t])}}function Zl(e,t){var n=e.stateNode;if(n===null)return null;var s=n[Nn]||null;if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ie(231,t,typeof n));return n}var pa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ox=!1;if(pa)try{var rl={};Object.defineProperty(rl,"passive",{get:function(){ox=!0}}),window.addEventListener("test",rl,rl),window.removeEventListener("test",rl,rl)}catch{ox=!1}var Qa=null,Vg=null,Kd=null;function f1(){if(Kd)return Kd;var e,t=Vg,n=t.length,s,r="value"in Qa?Qa.value:Qa.textContent,i=r.length;for(e=0;e<n&&t[e]===r[e];e++);var o=n-e;for(s=1;s<=o&&t[n-s]===r[i-s];s++);return Kd=r.slice(e,1<s?1-s:void 0)}function Jd(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function pd(){return!0}function F0(){return!1}function jn(e){function t(n,s,r,i,o){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?pd:F0,this.isPropagationStopped=F0,this}return pt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=pd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=pd)},persist:function(){},isPersistent:pd}),t}var xi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dh=jn(xi),_c=pt({},xi,{view:0,detail:0}),XE=jn(_c),Lf,Pf,il,_h=pt({},_c,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yg,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==il&&(il&&e.type==="mousemove"?(Lf=e.screenX-il.screenX,Pf=e.screenY-il.screenY):Pf=Lf=0,il=e),Lf)},movementY:function(e){return"movementY"in e?e.movementY:Pf}}),I0=jn(_h),GE=pt({},_h,{dataTransfer:0}),ZE=jn(GE),QE=pt({},_c,{relatedTarget:0}),Bf=jn(QE),KE=pt({},xi,{animationName:0,elapsedTime:0,pseudoElement:0}),JE=jn(KE),e3=pt({},xi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),t3=jn(e3),n3=pt({},xi,{data:0}),W0=jn(n3),s3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a3={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"},r3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function i3(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=r3[e])?!!t[e]:!1}function Yg(){return i3}var o3=pt({},_c,{key:function(e){if(e.key){var t=s3[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Jd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?a3[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yg,charCode:function(e){return e.type==="keypress"?Jd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Jd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),l3=jn(o3),c3=pt({},_h,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),q0=jn(c3),d3=pt({},_c,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yg}),u3=jn(d3),h3=pt({},xi,{propertyName:0,elapsedTime:0,pseudoElement:0}),f3=jn(h3),m3=pt({},_h,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),x3=jn(m3),g3=pt({},xi,{newState:0,oldState:0}),p3=jn(g3),v3=[9,13,27,32],Fg=pa&&"CompositionEvent"in window,Al=null;pa&&"documentMode"in document&&(Al=document.documentMode);var b3=pa&&"TextEvent"in window&&!Al,m1=pa&&(!Fg||Al&&8<Al&&11>=Al),X0=" ",G0=!1;function x1(e,t){switch(e){case"keyup":return v3.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function g1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Yi=!1;function y3(e,t){switch(e){case"compositionend":return g1(t);case"keypress":return t.which!==32?null:(G0=!0,X0);case"textInput":return e=t.data,e===X0&&G0?null:e;default:return null}}function w3(e,t){if(Yi)return e==="compositionend"||!Fg&&x1(e,t)?(e=f1(),Kd=Vg=Qa=null,Yi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return m1&&t.locale!=="ko"?null:t.data;default:return null}}var N3={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 Z0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!N3[e.type]:t==="textarea"}function p1(e,t,n,s){Vi?to?to.push(s):to=[s]:Vi=s,t=Yu(t,"onChange"),0<t.length&&(n=new Dh("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Ol=null,Ql=null;function j3(e){cj(e,0)}function Ah(e){var t=El(e);if(o1(t))return e}function Q0(e,t){if(e==="change")return t}var v1=!1;if(pa){var Hf;if(pa){var Vf="oninput"in document;if(!Vf){var K0=document.createElement("div");K0.setAttribute("oninput","return;"),Vf=typeof K0.oninput=="function"}Hf=Vf}else Hf=!1;v1=Hf&&(!document.documentMode||9<document.documentMode)}function J0(){Ol&&(Ol.detachEvent("onpropertychange",b1),Ql=Ol=null)}function b1(e){if(e.propertyName==="value"&&Ah(Ql)){var t=[];p1(t,Ql,e,Hg(e)),h1(j3,t)}}function S3(e,t,n){e==="focusin"?(J0(),Ol=t,Ql=n,Ol.attachEvent("onpropertychange",b1)):e==="focusout"&&J0()}function C3(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ah(Ql)}function E3(e,t){if(e==="click")return Ah(t)}function k3(e,t){if(e==="input"||e==="change")return Ah(t)}function M3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Hn=typeof Object.is=="function"?Object.is:M3;function Kl(e,t){if(Hn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var r=n[s];if(!nx.call(t,r)||!Hn(e[r],t[r]))return!1}return!0}function ev(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tv(e,t){var n=ev(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ev(n)}}function y1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?y1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function w1(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Cu(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Cu(e.document)}return t}function Ig(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var T3=pa&&"documentMode"in document&&11>=document.documentMode,Fi=null,lx=null,zl=null,cx=!1;function nv(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cx||Fi==null||Fi!==Cu(s)||(s=Fi,"selectionStart"in s&&Ig(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),zl&&Kl(zl,s)||(zl=s,s=Yu(lx,"onSelect"),0<s.length&&(t=new Dh("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Fi)))}function Mr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ii={animationend:Mr("Animation","AnimationEnd"),animationiteration:Mr("Animation","AnimationIteration"),animationstart:Mr("Animation","AnimationStart"),transitionrun:Mr("Transition","TransitionRun"),transitionstart:Mr("Transition","TransitionStart"),transitioncancel:Mr("Transition","TransitionCancel"),transitionend:Mr("Transition","TransitionEnd")},Yf={},N1={};pa&&(N1=document.createElement("div").style,"AnimationEvent"in window||(delete Ii.animationend.animation,delete Ii.animationiteration.animation,delete Ii.animationstart.animation),"TransitionEvent"in window||delete Ii.transitionend.transition);function gi(e){if(Yf[e])return Yf[e];if(!Ii[e])return e;var t=Ii[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in N1)return Yf[e]=t[n];return e}var j1=gi("animationend"),S1=gi("animationiteration"),C1=gi("animationstart"),D3=gi("transitionrun"),_3=gi("transitionstart"),A3=gi("transitioncancel"),E1=gi("transitionend"),k1=new Map,dx="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(" ");dx.push("scrollEnd");function ys(e,t){k1.set(e,t),mi(t,[e])}var sv=new WeakMap;function as(e,t){if(typeof e=="object"&&e!==null){var n=sv.get(e);return n!==void 0?n:(t={value:e,source:t,stack:H0(t)},sv.set(e,t),t)}return{value:e,source:t,stack:H0(t)}}var Gn=[],Wi=0,Wg=0;function Oh(){for(var e=Wi,t=Wg=Wi=0;t<e;){var n=Gn[t];Gn[t++]=null;var s=Gn[t];Gn[t++]=null;var r=Gn[t];Gn[t++]=null;var i=Gn[t];if(Gn[t++]=null,s!==null&&r!==null){var o=s.pending;o===null?r.next=r:(r.next=o.next,o.next=r),s.pending=r}i!==0&&M1(n,r,i)}}function zh(e,t,n,s){Gn[Wi++]=e,Gn[Wi++]=t,Gn[Wi++]=n,Gn[Wi++]=s,Wg|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function qg(e,t,n,s){return zh(e,t,n,s),Eu(e)}function Ho(e,t){return zh(e,null,null,t),Eu(e)}function M1(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var r=!1,i=e.return;i!==null;)i.childLanes|=n,s=i.alternate,s!==null&&(s.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(r=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,r&&t!==null&&(r=31-$n(n),e=i.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=n|536870912),i):null}function Eu(e){if(50<Fl)throw Fl=0,_x=null,Error(ie(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var qi={};function O3(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function On(e,t,n,s){return new O3(e,t,n,s)}function Xg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ma(e,t){var n=e.alternate;return n===null?(n=On(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function T1(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function eu(e,t,n,s,r,i){var o=0;if(s=e,typeof e=="function")Xg(e)&&(o=1);else if(typeof e=="string")o=Rk(e,n,Ls.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Km:return e=On(31,n,t,r),e.elementType=Km,e.lanes=i,e;case Pi:return Hr(n.children,r,i,t);case Xw:o=8,r|=24;break;case Gm:return e=On(12,n,t,r|2),e.elementType=Gm,e.lanes=i,e;case Zm:return e=On(13,n,t,r),e.elementType=Zm,e.lanes=i,e;case Qm:return e=On(19,n,t,r),e.elementType=Qm,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case jE:case ra:o=10;break e;case Gw:o=9;break e;case zg:o=11;break e;case Rg:o=14;break e;case Va:o=16,s=null;break e}o=29,n=Error(ie(130,e===null?"null":typeof e,"")),s=null}return t=On(o,n,t,r),t.elementType=e,t.type=s,t.lanes=i,t}function Hr(e,t,n,s){return e=On(7,e,s,t),e.lanes=n,e}function Ff(e,t,n){return e=On(6,e,null,t),e.lanes=n,e}function If(e,t,n){return t=On(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Xi=[],Gi=0,ku=null,Mu=0,ts=[],ns=0,Vr=null,ia=1,oa="";function _r(e,t){Xi[Gi++]=Mu,Xi[Gi++]=ku,ku=e,Mu=t}function D1(e,t,n){ts[ns++]=ia,ts[ns++]=oa,ts[ns++]=Vr,Vr=e;var s=ia;e=oa;var r=32-$n(s)-1;s&=~(1<<r),n+=1;var i=32-$n(t)+r;if(30<i){var o=r-r%5;i=(s&(1<<o)-1).toString(32),s>>=o,r-=o,ia=1<<32-$n(t)+r|n<<r|s,oa=i+e}else ia=1<<i|n<<r|s,oa=e}function Gg(e){e.return!==null&&(_r(e,1),D1(e,1,0))}function Zg(e){for(;e===ku;)ku=Xi[--Gi],Xi[Gi]=null,Mu=Xi[--Gi],Xi[Gi]=null;for(;e===Vr;)Vr=ts[--ns],ts[ns]=null,oa=ts[--ns],ts[ns]=null,ia=ts[--ns],ts[ns]=null}var dn=null,Tt=null,et=!1,Yr=null,Os=!1,ux=Error(ie(519));function Jr(e){var t=Error(ie(418,""));throw Jl(as(t,e)),ux}function av(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[rn]=e,t[Nn]=s,n){case"dialog":Fe("cancel",t),Fe("close",t);break;case"iframe":case"object":case"embed":Fe("load",t);break;case"video":case"audio":for(n=0;n<nc.length;n++)Fe(nc[n],t);break;case"source":Fe("error",t);break;case"img":case"image":case"link":Fe("error",t),Fe("load",t);break;case"details":Fe("toggle",t);break;case"input":Fe("invalid",t),l1(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0),Su(t);break;case"select":Fe("invalid",t);break;case"textarea":Fe("invalid",t),d1(t,s.value,s.defaultValue,s.children),Su(t)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||uj(t.textContent,n)?(s.popover!=null&&(Fe("beforetoggle",t),Fe("toggle",t)),s.onScroll!=null&&Fe("scroll",t),s.onScrollEnd!=null&&Fe("scrollend",t),s.onClick!=null&&(t.onclick=Vh),t=!0):t=!1,t||Jr(e)}function rv(e){for(dn=e.return;dn;)switch(dn.tag){case 5:case 13:Os=!1;return;case 27:case 3:Os=!0;return;default:dn=dn.return}}function ol(e){if(e!==dn)return!1;if(!et)return rv(e),et=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||$x(e.type,e.memoizedProps)),n=!n),n&&Tt&&Jr(e),rv(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ie(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(n=e.data,n==="/$"){if(t===0){Tt=gs(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++;e=e.nextSibling}Tt=null}}else t===27?(t=Tt,wr(e.type)?(e=Bx,Bx=null,Tt=e):Tt=t):Tt=dn?gs(e.stateNode.nextSibling):null;return!0}function Ac(){Tt=dn=null,et=!1}function iv(){var e=Yr;return e!==null&&(vn===null?vn=e:vn.push.apply(vn,e),Yr=null),e}function Jl(e){Yr===null?Yr=[e]:Yr.push(e)}var hx=Ws(null),pi=null,la=null;function Ia(e,t,n){Nt(hx,t._currentValue),t._currentValue=n}function xa(e){e._currentValue=hx.current,Xt(hx)}function fx(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function mx(e,t,n,s){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var i=r.dependencies;if(i!==null){var o=r.child;i=i.firstContext;e:for(;i!==null;){var l=i;i=r;for(var c=0;c<t.length;c++)if(l.context===t[c]){i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),fx(i.return,n,e),s||(o=null);break e}i=l.next}}else if(r.tag===18){if(o=r.return,o===null)throw Error(ie(341));o.lanes|=n,i=o.alternate,i!==null&&(i.lanes|=n),fx(o,n,e),o=null}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===e){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}}function Oc(e,t,n,s){e=null;for(var r=t,i=!1;r!==null;){if(!i){if(r.flags&524288)i=!0;else if(r.flags&262144)break}if(r.tag===10){var o=r.alternate;if(o===null)throw Error(ie(387));if(o=o.memoizedProps,o!==null){var l=r.type;Hn(r.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(r===yu.current){if(o=r.alternate,o===null)throw Error(ie(387));o.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(rc):e=[rc])}r=r.return}e!==null&&mx(t,e,n,s),t.flags|=262144}function Tu(e){for(e=e.firstContext;e!==null;){if(!Hn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ei(e){pi=e,la=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function on(e){return _1(pi,e)}function vd(e,t){return pi===null&&ei(e),_1(e,t)}function _1(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},la===null){if(e===null)throw Error(ie(308));la=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else la=la.next=t;return n}var z3=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},R3=Vt.unstable_scheduleCallback,U3=Vt.unstable_NormalPriority,Pt={$$typeof:ra,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qg(){return{controller:new z3,data:new Map,refCount:0}}function zc(e){e.refCount--,e.refCount===0&&R3(U3,function(){e.controller.abort()})}var Rl=null,xx=0,po=0,no=null;function $3(e,t){if(Rl===null){var n=Rl=[];xx=0,po=yp(),no={status:"pending",value:void 0,then:function(s){n.push(s)}}}return xx++,t.then(ov,ov),t}function ov(){if(--xx===0&&Rl!==null){no!==null&&(no.status="fulfilled");var e=Rl;Rl=null,po=0,no=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function L3(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(s.status="rejected",s.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),s}var lv=Te.S;Te.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&$3(e,t),lv!==null&&lv(e,t)};var Fr=Ws(null);function Kg(){var e=Fr.current;return e!==null?e:ft.pooledCache}function tu(e,t){t===null?Nt(Fr,Fr.current):Nt(Fr,t.pool)}function A1(){var e=Kg();return e===null?null:{parent:Pt._currentValue,pool:e}}var Rc=Error(ie(460)),O1=Error(ie(474)),Rh=Error(ie(542)),gx={then:function(){}};function cv(e){return e=e.status,e==="fulfilled"||e==="rejected"}function bd(){}function z1(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(bd,bd),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,uv(e),e;default:if(typeof t.status=="string")t.then(bd,bd);else{if(e=ft,e!==null&&100<e.shellSuspendCounter)throw Error(ie(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=s}},function(s){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,uv(e),e}throw Ul=t,Rc}}var Ul=null;function dv(){if(Ul===null)throw Error(ie(459));var e=Ul;return Ul=null,e}function uv(e){if(e===Rc||e===Rh)throw Error(ie(483))}var Ya=!1;function Jg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function px(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function nr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function sr(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,it&2){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=Eu(e),M1(e,null,n),t}return zh(e,s,t,n),Eu(e)}function $l(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,n1(e,n)}}function Wf(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var r=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?r=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?r=i=t:i=i.next=t}else r=i=t;n={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var vx=!1;function Ll(){if(vx){var e=no;if(e!==null)throw e}}function Pl(e,t,n,s){vx=!1;var r=e.updateQueue;Ya=!1;var i=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==o&&(l===null?h.firstBaseUpdate=u:l.next=u,h.lastBaseUpdate=c))}if(i!==null){var d=r.baseState;o=0,h=u=c=null,l=i;do{var f=l.lane&-536870913,x=f!==l.lane;if(x?(Ge&f)===f:(s&f)===f){f!==0&&f===po&&(vx=!0),h!==null&&(h=h.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var w=e,v=l;f=t;var N=n;switch(v.tag){case 1:if(w=v.payload,typeof w=="function"){d=w.call(N,d,f);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=v.payload,f=typeof w=="function"?w.call(N,d,f):w,f==null)break e;d=pt({},d,f);break e;case 2:Ya=!0}}f=l.callback,f!==null&&(e.flags|=64,x&&(e.flags|=8192),x=r.callbacks,x===null?r.callbacks=[f]:x.push(f))}else x={lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(u=h=x,c=d):h=h.next=x,o|=f;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;x=l,l=x.next,x.next=null,r.lastBaseUpdate=x,r.shared.pending=null}}while(!0);h===null&&(c=d),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=h,i===null&&(r.shared.lanes=0),mr|=o,e.lanes=o,e.memoizedState=d}}function R1(e,t){if(typeof e!="function")throw Error(ie(191,e));e.call(t)}function U1(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)R1(n[e],t)}var vo=Ws(null),Du=Ws(0);function hv(e,t){e=ya,Nt(Du,e),Nt(vo,t),ya=e|t.baseLanes}function bx(){Nt(Du,ya),Nt(vo,vo.current)}function ep(){ya=Du.current,Xt(vo),Xt(Du)}var hr=0,Ve=null,lt=null,Ot=null,_u=!1,so=!1,ti=!1,Au=0,ec=0,ao=null,P3=0;function _t(){throw Error(ie(321))}function tp(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Hn(e[n],t[n]))return!1;return!0}function np(e,t,n,s,r,i){return hr=i,Ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Te.H=e===null||e.memoizedState===null?fN:mN,ti=!1,i=n(s,r),ti=!1,so&&(i=L1(t,n,s,r)),$1(e),i}function $1(e){Te.H=Ou;var t=lt!==null&<.next!==null;if(hr=0,Ot=lt=Ve=null,_u=!1,ec=0,ao=null,t)throw Error(ie(300));e===null||qt||(e=e.dependencies,e!==null&&Tu(e)&&(qt=!0))}function L1(e,t,n,s){Ve=e;var r=0;do{if(so&&(ao=null),ec=0,so=!1,25<=r)throw Error(ie(301));if(r+=1,Ot=lt=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}Te.H=W3,i=t(n,s)}while(so);return i}function B3(){var e=Te.H,t=e.useState()[0];return t=typeof t.then=="function"?Uc(t):t,e=e.useState()[0],(lt!==null?lt.memoizedState:null)!==e&&(Ve.flags|=1024),t}function sp(){var e=Au!==0;return Au=0,e}function ap(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function rp(e){if(_u){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_u=!1}hr=0,Ot=lt=Ve=null,so=!1,ec=Au=0,ao=null}function gn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ot===null?Ve.memoizedState=Ot=e:Ot=Ot.next=e,Ot}function zt(){if(lt===null){var e=Ve.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=Ot===null?Ve.memoizedState:Ot.next;if(t!==null)Ot=t,lt=e;else{if(e===null)throw Ve.alternate===null?Error(ie(467)):Error(ie(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Ot===null?Ve.memoizedState=Ot=e:Ot=Ot.next=e}return Ot}function ip(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Uc(e){var t=ec;return ec+=1,ao===null&&(ao=[]),e=z1(ao,e,t),t=Ve,(Ot===null?t.memoizedState:Ot.next)===null&&(t=t.alternate,Te.H=t===null||t.memoizedState===null?fN:mN),e}function Uh(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Uc(e);if(e.$$typeof===ra)return on(e)}throw Error(ie(438,String(e)))}function op(e){var t=null,n=Ve.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=Ve.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=ip(),Ve.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=SE;return t.index++,n}function va(e,t){return typeof t=="function"?t(e):t}function nu(e){var t=zt();return lp(t,lt,e)}function lp(e,t,n){var s=e.queue;if(s===null)throw Error(ie(311));s.lastRenderedReducer=n;var r=e.baseQueue,i=s.pending;if(i!==null){if(r!==null){var o=r.next;r.next=i.next,i.next=o}t.baseQueue=r=i,s.pending=null}if(i=e.baseState,r===null)e.memoizedState=i;else{t=r.next;var l=o=null,c=null,u=t,h=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(Ge&d)===d:(hr&d)===d){var f=u.revertLane;if(f===0)c!==null&&(c=c.next={lane:0,revertLane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===po&&(h=!0);else if((hr&f)===f){u=u.next,f===po&&(h=!0);continue}else d={lane:0,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=d,o=i):c=c.next=d,Ve.lanes|=f,mr|=f;d=u.action,ti&&n(i,d),i=u.hasEagerState?u.eagerState:n(i,d)}else f={lane:d,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=f,o=i):c=c.next=f,Ve.lanes|=d,mr|=d;u=u.next}while(u!==null&&u!==t);if(c===null?o=i:c.next=l,!Hn(i,e.memoizedState)&&(qt=!0,h&&(n=no,n!==null)))throw n;e.memoizedState=i,e.baseState=o,e.baseQueue=c,s.lastRenderedState=i}return r===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function qf(e){var t=zt(),n=t.queue;if(n===null)throw Error(ie(311));n.lastRenderedReducer=e;var s=n.dispatch,r=n.pending,i=t.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do i=e(i,o.action),o=o.next;while(o!==r);Hn(i,t.memoizedState)||(qt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,s]}function P1(e,t,n){var s=Ve,r=zt(),i=et;if(i){if(n===void 0)throw Error(ie(407));n=n()}else n=t();var o=!Hn((lt||r).memoizedState,n);o&&(r.memoizedState=n,qt=!0),r=r.queue;var l=V1.bind(null,s,r,e);if($c(2048,8,l,[e]),r.getSnapshot!==t||o||Ot!==null&&Ot.memoizedState.tag&1){if(s.flags|=2048,bo(9,$h(),H1.bind(null,s,r,n,t),null),ft===null)throw Error(ie(349));i||hr&124||B1(s,t,n)}return n}function B1(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ve.updateQueue,t===null?(t=ip(),Ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function H1(e,t,n,s){t.value=n,t.getSnapshot=s,Y1(t)&&F1(e)}function V1(e,t,n){return n(function(){Y1(t)&&F1(e)})}function Y1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Hn(e,n)}catch{return!0}}function F1(e){var t=Ho(e,2);t!==null&&Pn(t,e,2)}function yx(e){var t=gn();if(typeof e=="function"){var n=e;if(e=n(),ti){Za(!0);try{n()}finally{Za(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:e},t}function I1(e,t,n,s){return e.baseState=n,lp(e,lt,typeof s=="function"?s:va)}function H3(e,t,n,s,r){if(Lh(e))throw Error(ie(485));if(e=t.action,e!==null){var i={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){i.listeners.push(o)}};Te.T!==null?n(!0):i.isTransition=!1,s(i),n=t.pending,n===null?(i.next=t.pending=i,W1(t,i)):(i.next=n.next,t.pending=n.next=i)}}function W1(e,t){var n=t.action,s=t.payload,r=e.state;if(t.isTransition){var i=Te.T,o={};Te.T=o;try{var l=n(r,s),c=Te.S;c!==null&&c(o,l),fv(e,t,l)}catch(u){wx(e,t,u)}finally{Te.T=i}}else try{i=n(r,s),fv(e,t,i)}catch(u){wx(e,t,u)}}function fv(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){mv(e,t,s)},function(s){return wx(e,t,s)}):mv(e,t,n)}function mv(e,t,n){t.status="fulfilled",t.value=n,q1(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,W1(e,n)))}function wx(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,q1(t),t=t.next;while(t!==s)}e.action=null}function q1(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function X1(e,t){return t}function xv(e,t){if(et){var n=ft.formState;if(n!==null){e:{var s=Ve;if(et){if(Tt){t:{for(var r=Tt,i=Os;r.nodeType!==8;){if(!i){r=null;break t}if(r=gs(r.nextSibling),r===null){r=null;break t}}i=r.data,r=i==="F!"||i==="F"?r:null}if(r){Tt=gs(r.nextSibling),s=r.data==="F!";break e}}Jr(s)}s=!1}s&&(t=n[0])}}return n=gn(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:X1,lastRenderedState:t},n.queue=s,n=dN.bind(null,Ve,s),s.dispatch=n,s=yx(!1),i=hp.bind(null,Ve,!1,s.queue),s=gn(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,n=H3.bind(null,Ve,r,i,n),r.dispatch=n,s.memoizedState=e,[t,n,!1]}function gv(e){var t=zt();return G1(t,lt,e)}function G1(e,t,n){if(t=lp(e,t,X1)[0],e=nu(va)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Uc(t)}catch(o){throw o===Rc?Rh:o}else s=t;t=zt();var r=t.queue,i=r.dispatch;return n!==t.memoizedState&&(Ve.flags|=2048,bo(9,$h(),V3.bind(null,r,n),null)),[s,i,e]}function V3(e,t){e.action=t}function pv(e){var t=zt(),n=lt;if(n!==null)return G1(t,n,e);zt(),t=t.memoizedState,n=zt();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function bo(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=Ve.updateQueue,t===null&&(t=ip(),Ve.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function $h(){return{destroy:void 0,resource:void 0}}function Z1(){return zt().memoizedState}function su(e,t,n,s){var r=gn();s=s===void 0?null:s,Ve.flags|=e,r.memoizedState=bo(1|t,$h(),n,s)}function $c(e,t,n,s){var r=zt();s=s===void 0?null:s;var i=r.memoizedState.inst;lt!==null&&s!==null&&tp(s,lt.memoizedState.deps)?r.memoizedState=bo(t,i,n,s):(Ve.flags|=e,r.memoizedState=bo(1|t,i,n,s))}function vv(e,t){su(8390656,8,e,t)}function Q1(e,t){$c(2048,8,e,t)}function K1(e,t){return $c(4,2,e,t)}function J1(e,t){return $c(4,4,e,t)}function eN(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function tN(e,t,n){n=n!=null?n.concat([e]):null,$c(4,4,eN.bind(null,t,e),n)}function cp(){}function nN(e,t){var n=zt();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&tp(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function sN(e,t){var n=zt();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&tp(t,s[1]))return s[0];if(s=e(),ti){Za(!0);try{e()}finally{Za(!1)}}return n.memoizedState=[s,t],s}function dp(e,t,n){return n===void 0||hr&1073741824?e.memoizedState=t:(e.memoizedState=n,e=qN(),Ve.lanes|=e,mr|=e,n)}function aN(e,t,n,s){return Hn(n,t)?n:vo.current!==null?(e=dp(e,n,s),Hn(e,t)||(qt=!0),e):hr&42?(e=qN(),Ve.lanes|=e,mr|=e,t):(qt=!0,e.memoizedState=n)}function rN(e,t,n,s,r){var i=tt.p;tt.p=i!==0&&8>i?i:8;var o=Te.T,l={};Te.T=l,hp(e,!1,t,n);try{var c=r(),u=Te.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var h=L3(c,s);Bl(e,t,h,Ln(e))}else Bl(e,t,s,Ln(e))}catch(d){Bl(e,t,{then:function(){},status:"rejected",reason:d},Ln())}finally{tt.p=i,Te.T=o}}function Y3(){}function Nx(e,t,n,s){if(e.tag!==5)throw Error(ie(476));var r=iN(e).queue;rN(e,r,t,Br,n===null?Y3:function(){return oN(e),n(s)})}function iN(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Br,baseState:Br,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:Br},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function oN(e){var t=iN(e).next.queue;Bl(e,t,{},Ln())}function up(){return on(rc)}function lN(){return zt().memoizedState}function cN(){return zt().memoizedState}function F3(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ln();e=nr(n);var s=sr(t,e,n);s!==null&&(Pn(s,t,n),$l(s,t,n)),t={cache:Qg()},e.payload=t;return}t=t.return}}function I3(e,t,n){var s=Ln();n={lane:s,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},Lh(e)?uN(t,n):(n=qg(e,t,n,s),n!==null&&(Pn(n,e,s),hN(n,t,s)))}function dN(e,t,n){var s=Ln();Bl(e,t,n,s)}function Bl(e,t,n,s){var r={lane:s,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(Lh(e))uN(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,n);if(r.hasEagerState=!0,r.eagerState=l,Hn(l,o))return zh(e,t,r,0),ft===null&&Oh(),!1}catch{}finally{}if(n=qg(e,t,r,s),n!==null)return Pn(n,e,s),hN(n,t,s),!0}return!1}function hp(e,t,n,s){if(s={lane:2,revertLane:yp(),action:s,hasEagerState:!1,eagerState:null,next:null},Lh(e)){if(t)throw Error(ie(479))}else t=qg(e,n,s,2),t!==null&&Pn(t,e,2)}function Lh(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function uN(e,t){so=_u=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hN(e,t,n){if(n&4194048){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,n1(e,n)}}var Ou={readContext:on,use:Uh,useCallback:_t,useContext:_t,useEffect:_t,useImperativeHandle:_t,useLayoutEffect:_t,useInsertionEffect:_t,useMemo:_t,useReducer:_t,useRef:_t,useState:_t,useDebugValue:_t,useDeferredValue:_t,useTransition:_t,useSyncExternalStore:_t,useId:_t,useHostTransitionStatus:_t,useFormState:_t,useActionState:_t,useOptimistic:_t,useMemoCache:_t,useCacheRefresh:_t},fN={readContext:on,use:Uh,useCallback:function(e,t){return gn().memoizedState=[e,t===void 0?null:t],e},useContext:on,useEffect:vv,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,su(4194308,4,eN.bind(null,t,e),n)},useLayoutEffect:function(e,t){return su(4194308,4,e,t)},useInsertionEffect:function(e,t){su(4,2,e,t)},useMemo:function(e,t){var n=gn();t=t===void 0?null:t;var s=e();if(ti){Za(!0);try{e()}finally{Za(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=gn();if(n!==void 0){var r=n(t);if(ti){Za(!0);try{n(t)}finally{Za(!1)}}}else r=t;return s.memoizedState=s.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},s.queue=e,e=e.dispatch=I3.bind(null,Ve,e),[s.memoizedState,e]},useRef:function(e){var t=gn();return e={current:e},t.memoizedState=e},useState:function(e){e=yx(e);var t=e.queue,n=dN.bind(null,Ve,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:cp,useDeferredValue:function(e,t){var n=gn();return dp(n,e,t)},useTransition:function(){var e=yx(!1);return e=rN.bind(null,Ve,e.queue,!0,!1),gn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=Ve,r=gn();if(et){if(n===void 0)throw Error(ie(407));n=n()}else{if(n=t(),ft===null)throw Error(ie(349));Ge&124||B1(s,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,vv(V1.bind(null,s,i,e),[e]),s.flags|=2048,bo(9,$h(),H1.bind(null,s,i,n,t),null),n},useId:function(){var e=gn(),t=ft.identifierPrefix;if(et){var n=oa,s=ia;n=(s&~(1<<32-$n(s)-1)).toString(32)+n,t="«"+t+"R"+n,n=Au++,0<n&&(t+="H"+n.toString(32)),t+="»"}else n=P3++,t="«"+t+"r"+n.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:up,useFormState:xv,useActionState:xv,useOptimistic:function(e){var t=gn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=hp.bind(null,Ve,!0,n),n.dispatch=t,[e,t]},useMemoCache:op,useCacheRefresh:function(){return gn().memoizedState=F3.bind(null,Ve)}},mN={readContext:on,use:Uh,useCallback:nN,useContext:on,useEffect:Q1,useImperativeHandle:tN,useInsertionEffect:K1,useLayoutEffect:J1,useMemo:sN,useReducer:nu,useRef:Z1,useState:function(){return nu(va)},useDebugValue:cp,useDeferredValue:function(e,t){var n=zt();return aN(n,lt.memoizedState,e,t)},useTransition:function(){var e=nu(va)[0],t=zt().memoizedState;return[typeof e=="boolean"?e:Uc(e),t]},useSyncExternalStore:P1,useId:lN,useHostTransitionStatus:up,useFormState:gv,useActionState:gv,useOptimistic:function(e,t){var n=zt();return I1(n,lt,e,t)},useMemoCache:op,useCacheRefresh:cN},W3={readContext:on,use:Uh,useCallback:nN,useContext:on,useEffect:Q1,useImperativeHandle:tN,useInsertionEffect:K1,useLayoutEffect:J1,useMemo:sN,useReducer:qf,useRef:Z1,useState:function(){return qf(va)},useDebugValue:cp,useDeferredValue:function(e,t){var n=zt();return lt===null?dp(n,e,t):aN(n,lt.memoizedState,e,t)},useTransition:function(){var e=qf(va)[0],t=zt().memoizedState;return[typeof e=="boolean"?e:Uc(e),t]},useSyncExternalStore:P1,useId:lN,useHostTransitionStatus:up,useFormState:pv,useActionState:pv,useOptimistic:function(e,t){var n=zt();return lt!==null?I1(n,lt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:op,useCacheRefresh:cN},ro=null,tc=0;function yd(e){var t=tc;return tc+=1,ro===null&&(ro=[]),z1(ro,e,t)}function ll(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function wd(e,t){throw t.$$typeof===NE?Error(ie(525)):(e=Object.prototype.toString.call(t),Error(ie(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function bv(e){var t=e._init;return t(e._payload)}function xN(e){function t(g,b){if(e){var p=g.deletions;p===null?(g.deletions=[b],g.flags|=16):p.push(b)}}function n(g,b){if(!e)return null;for(;b!==null;)t(g,b),b=b.sibling;return null}function s(g){for(var b=new Map;g!==null;)g.key!==null?b.set(g.key,g):b.set(g.index,g),g=g.sibling;return b}function r(g,b){return g=ma(g,b),g.index=0,g.sibling=null,g}function i(g,b,p){return g.index=p,e?(p=g.alternate,p!==null?(p=p.index,p<b?(g.flags|=67108866,b):p):(g.flags|=67108866,b)):(g.flags|=1048576,b)}function o(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function l(g,b,p,y){return b===null||b.tag!==6?(b=Ff(p,g.mode,y),b.return=g,b):(b=r(b,p),b.return=g,b)}function c(g,b,p,y){var j=p.type;return j===Pi?h(g,b,p.props.children,y,p.key):b!==null&&(b.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Va&&bv(j)===b.type)?(b=r(b,p.props),ll(b,p),b.return=g,b):(b=eu(p.type,p.key,p.props,null,g.mode,y),ll(b,p),b.return=g,b)}function u(g,b,p,y){return b===null||b.tag!==4||b.stateNode.containerInfo!==p.containerInfo||b.stateNode.implementation!==p.implementation?(b=If(p,g.mode,y),b.return=g,b):(b=r(b,p.children||[]),b.return=g,b)}function h(g,b,p,y,j){return b===null||b.tag!==7?(b=Hr(p,g.mode,y,j),b.return=g,b):(b=r(b,p),b.return=g,b)}function d(g,b,p){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return b=Ff(""+b,g.mode,p),b.return=g,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case fd:return p=eu(b.type,b.key,b.props,null,g.mode,p),ll(p,b),p.return=g,p;case Sl:return b=If(b,g.mode,p),b.return=g,b;case Va:var y=b._init;return b=y(b._payload),d(g,b,p)}if(Cl(b)||al(b))return b=Hr(b,g.mode,p,null),b.return=g,b;if(typeof b.then=="function")return d(g,yd(b),p);if(b.$$typeof===ra)return d(g,vd(g,b),p);wd(g,b)}return null}function f(g,b,p,y){var j=b!==null?b.key:null;if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return j!==null?null:l(g,b,""+p,y);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case fd:return p.key===j?c(g,b,p,y):null;case Sl:return p.key===j?u(g,b,p,y):null;case Va:return j=p._init,p=j(p._payload),f(g,b,p,y)}if(Cl(p)||al(p))return j!==null?null:h(g,b,p,y,null);if(typeof p.then=="function")return f(g,b,yd(p),y);if(p.$$typeof===ra)return f(g,b,vd(g,p),y);wd(g,p)}return null}function x(g,b,p,y,j){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return g=g.get(p)||null,l(b,g,""+y,j);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case fd:return g=g.get(y.key===null?p:y.key)||null,c(b,g,y,j);case Sl:return g=g.get(y.key===null?p:y.key)||null,u(b,g,y,j);case Va:var S=y._init;return y=S(y._payload),x(g,b,p,y,j)}if(Cl(y)||al(y))return g=g.get(p)||null,h(b,g,y,j,null);if(typeof y.then=="function")return x(g,b,p,yd(y),j);if(y.$$typeof===ra)return x(g,b,p,vd(b,y),j);wd(b,y)}return null}function w(g,b,p,y){for(var j=null,S=null,C=b,T=b=0,A=null;C!==null&&T<p.length;T++){C.index>T?(A=C,C=null):A=C.sibling;var P=f(g,C,p[T],y);if(P===null){C===null&&(C=A);break}e&&C&&P.alternate===null&&t(g,C),b=i(P,b,T),S===null?j=P:S.sibling=P,S=P,C=A}if(T===p.length)return n(g,C),et&&_r(g,T),j;if(C===null){for(;T<p.length;T++)C=d(g,p[T],y),C!==null&&(b=i(C,b,T),S===null?j=C:S.sibling=C,S=C);return et&&_r(g,T),j}for(C=s(C);T<p.length;T++)A=x(C,g,T,p[T],y),A!==null&&(e&&A.alternate!==null&&C.delete(A.key===null?T:A.key),b=i(A,b,T),S===null?j=A:S.sibling=A,S=A);return e&&C.forEach(function(U){return t(g,U)}),et&&_r(g,T),j}function v(g,b,p,y){if(p==null)throw Error(ie(151));for(var j=null,S=null,C=b,T=b=0,A=null,P=p.next();C!==null&&!P.done;T++,P=p.next()){C.index>T?(A=C,C=null):A=C.sibling;var U=f(g,C,P.value,y);if(U===null){C===null&&(C=A);break}e&&C&&U.alternate===null&&t(g,C),b=i(U,b,T),S===null?j=U:S.sibling=U,S=U,C=A}if(P.done)return n(g,C),et&&_r(g,T),j;if(C===null){for(;!P.done;T++,P=p.next())P=d(g,P.value,y),P!==null&&(b=i(P,b,T),S===null?j=P:S.sibling=P,S=P);return et&&_r(g,T),j}for(C=s(C);!P.done;T++,P=p.next())P=x(C,g,T,P.value,y),P!==null&&(e&&P.alternate!==null&&C.delete(P.key===null?T:P.key),b=i(P,b,T),S===null?j=P:S.sibling=P,S=P);return e&&C.forEach(function(O){return t(g,O)}),et&&_r(g,T),j}function N(g,b,p,y){if(typeof p=="object"&&p!==null&&p.type===Pi&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case fd:e:{for(var j=p.key;b!==null;){if(b.key===j){if(j=p.type,j===Pi){if(b.tag===7){n(g,b.sibling),y=r(b,p.props.children),y.return=g,g=y;break e}}else if(b.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Va&&bv(j)===b.type){n(g,b.sibling),y=r(b,p.props),ll(y,p),y.return=g,g=y;break e}n(g,b);break}else t(g,b);b=b.sibling}p.type===Pi?(y=Hr(p.props.children,g.mode,y,p.key),y.return=g,g=y):(y=eu(p.type,p.key,p.props,null,g.mode,y),ll(y,p),y.return=g,g=y)}return o(g);case Sl:e:{for(j=p.key;b!==null;){if(b.key===j)if(b.tag===4&&b.stateNode.containerInfo===p.containerInfo&&b.stateNode.implementation===p.implementation){n(g,b.sibling),y=r(b,p.children||[]),y.return=g,g=y;break e}else{n(g,b);break}else t(g,b);b=b.sibling}y=If(p,g.mode,y),y.return=g,g=y}return o(g);case Va:return j=p._init,p=j(p._payload),N(g,b,p,y)}if(Cl(p))return w(g,b,p,y);if(al(p)){if(j=al(p),typeof j!="function")throw Error(ie(150));return p=j.call(p),v(g,b,p,y)}if(typeof p.then=="function")return N(g,b,yd(p),y);if(p.$$typeof===ra)return N(g,b,vd(g,p),y);wd(g,p)}return typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint"?(p=""+p,b!==null&&b.tag===6?(n(g,b.sibling),y=r(b,p),y.return=g,g=y):(n(g,b),y=Ff(p,g.mode,y),y.return=g,g=y),o(g)):n(g,b)}return function(g,b,p,y){try{tc=0;var j=N(g,b,p,y);return ro=null,j}catch(C){if(C===Rc||C===Rh)throw C;var S=On(29,C,null,g.mode);return S.lanes=y,S.return=g,S}finally{}}}var yo=xN(!0),gN=xN(!1),is=Ws(null),Bs=null;function Wa(e){var t=e.alternate;Nt(Ht,Ht.current&1),Nt(is,e),Bs===null&&(t===null||vo.current!==null||t.memoizedState!==null)&&(Bs=e)}function pN(e){if(e.tag===22){if(Nt(Ht,Ht.current),Nt(is,e),Bs===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Bs=e)}}else qa()}function qa(){Nt(Ht,Ht.current),Nt(is,is.current)}function ca(e){Xt(is),Bs===e&&(Bs=null),Xt(Ht)}var Ht=Ws(0);function zu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||Px(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Xf(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:pt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var jx={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Ln(),r=nr(s);r.payload=t,n!=null&&(r.callback=n),t=sr(e,r,s),t!==null&&(Pn(t,e,s),$l(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Ln(),r=nr(s);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=sr(e,r,s),t!==null&&(Pn(t,e,s),$l(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ln(),s=nr(n);s.tag=2,t!=null&&(s.callback=t),t=sr(e,s,n),t!==null&&(Pn(t,e,n),$l(t,e,n))}};function yv(e,t,n,s,r,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,i,o):t.prototype&&t.prototype.isPureReactComponent?!Kl(n,s)||!Kl(r,i):!0}function wv(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&jx.enqueueReplaceState(t,t.state,null)}function ni(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}if(e=e.defaultProps){n===t&&(n=pt({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}var Ru=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function vN(e){Ru(e)}function bN(e){console.error(e)}function yN(e){Ru(e)}function Uu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Nv(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Sx(e,t,n){return n=nr(n),n.tag=3,n.payload={element:null},n.callback=function(){Uu(e,t)},n}function wN(e){return e=nr(e),e.tag=3,e}function NN(e,t,n,s){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var i=s.value;e.payload=function(){return r(i)},e.callback=function(){Nv(t,n,s)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){Nv(t,n,s),typeof r!="function"&&(ar===null?ar=new Set([this]):ar.add(this));var l=s.stack;this.componentDidCatch(s.value,{componentStack:l!==null?l:""})})}function q3(e,t,n,s,r){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&Oc(t,n,r,!0),n=is.current,n!==null){switch(n.tag){case 13:return Bs===null?Ax():n.alternate===null&&Dt===0&&(Dt=3),n.flags&=-257,n.flags|=65536,n.lanes=r,s===gx?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),rm(e,s,r)),!1;case 22:return n.flags|=65536,s===gx?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),rm(e,s,r)),!1}throw Error(ie(435,n.tag))}return rm(e,s,r),Ax(),!1}if(et)return t=is.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==ux&&(e=Error(ie(422),{cause:s}),Jl(as(e,n)))):(s!==ux&&(t=Error(ie(423),{cause:s}),Jl(as(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,s=as(s,n),r=Sx(e.stateNode,s,r),Wf(e,r),Dt!==4&&(Dt=2)),!1;var i=Error(ie(520),{cause:s});if(i=as(i,n),Yl===null?Yl=[i]:Yl.push(i),Dt!==4&&(Dt=2),t===null)return!0;s=as(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=Sx(n.stateNode,s,e),Wf(n,e),!1;case 1:if(t=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(ar===null||!ar.has(i))))return n.flags|=65536,r&=-r,n.lanes|=r,r=wN(r),NN(r,e,n,s),Wf(n,r),!1}n=n.return}while(n!==null);return!1}var jN=Error(ie(461)),qt=!1;function Kt(e,t,n,s){t.child=e===null?gN(t,null,n,s):yo(t,e.child,n,s)}function jv(e,t,n,s,r){n=n.render;var i=t.ref;if("ref"in s){var o={};for(var l in s)l!=="ref"&&(o[l]=s[l])}else o=s;return ei(t),s=np(e,t,n,o,i,r),l=sp(),e!==null&&!qt?(ap(e,t,r),ba(e,t,r)):(et&&l&&Gg(t),t.flags|=1,Kt(e,t,s,r),t.child)}function Sv(e,t,n,s,r){if(e===null){var i=n.type;return typeof i=="function"&&!Xg(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,SN(e,t,i,s,r)):(e=eu(n.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!fp(e,r)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Kl,n(o,s)&&e.ref===t.ref)return ba(e,t,r)}return t.flags|=1,e=ma(i,s),e.ref=t.ref,e.return=t,t.child=e}function SN(e,t,n,s,r){if(e!==null){var i=e.memoizedProps;if(Kl(i,s)&&e.ref===t.ref)if(qt=!1,t.pendingProps=s=i,fp(e,r))e.flags&131072&&(qt=!0);else return t.lanes=e.lanes,ba(e,t,r)}return Cx(e,t,n,s,r)}function CN(e,t,n){var s=t.pendingProps,r=s.children,i=e!==null?e.memoizedState:null;if(s.mode==="hidden"){if(t.flags&128){if(s=i!==null?i.baseLanes|n:n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;t.childLanes=i&~s}else t.childLanes=0,t.child=null;return Cv(e,t,s,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&tu(t,i!==null?i.cachePool:null),i!==null?hv(t,i):bx(),pN(t);else return t.lanes=t.childLanes=536870912,Cv(e,t,i!==null?i.baseLanes|n:n,n)}else i!==null?(tu(t,i.cachePool),hv(t,i),qa(),t.memoizedState=null):(e!==null&&tu(t,null),bx(),qa());return Kt(e,t,r,n),t.child}function Cv(e,t,n,s){var r=Kg();return r=r===null?null:{parent:Pt._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&tu(t,null),bx(),pN(t),e!==null&&Oc(e,t,s,!0),null}function au(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(ie(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Cx(e,t,n,s,r){return ei(t),n=np(e,t,n,s,void 0,r),s=sp(),e!==null&&!qt?(ap(e,t,r),ba(e,t,r)):(et&&s&&Gg(t),t.flags|=1,Kt(e,t,n,r),t.child)}function Ev(e,t,n,s,r,i){return ei(t),t.updateQueue=null,n=L1(t,s,n,r),$1(e),s=sp(),e!==null&&!qt?(ap(e,t,i),ba(e,t,i)):(et&&s&&Gg(t),t.flags|=1,Kt(e,t,n,i),t.child)}function kv(e,t,n,s,r){if(ei(t),t.stateNode===null){var i=qi,o=n.contextType;typeof o=="object"&&o!==null&&(i=on(o)),i=new n(s,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=jx,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=s,i.state=t.memoizedState,i.refs={},Jg(t),o=n.contextType,i.context=typeof o=="object"&&o!==null?on(o):qi,i.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(Xf(t,n,o,s),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(o=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),o!==i.state&&jx.enqueueReplaceState(i,i.state,null),Pl(t,s,i,r),Ll(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){i=t.stateNode;var l=t.memoizedProps,c=ni(n,l);i.props=c;var u=i.context,h=n.contextType;o=qi,typeof h=="object"&&h!==null&&(o=on(h));var d=n.getDerivedStateFromProps;h=typeof d=="function"||typeof i.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,h||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l||u!==o)&&wv(t,i,s,o),Ya=!1;var f=t.memoizedState;i.state=f,Pl(t,s,i,r),Ll(),u=t.memoizedState,l||f!==u||Ya?(typeof d=="function"&&(Xf(t,n,d,s),u=t.memoizedState),(c=Ya||yv(t,n,c,s,f,u,o))?(h||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=u),i.props=s,i.state=u,i.context=o,s=c):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{i=t.stateNode,px(e,t),o=t.memoizedProps,h=ni(n,o),i.props=h,d=t.pendingProps,f=i.context,u=n.contextType,c=qi,typeof u=="object"&&u!==null&&(c=on(u)),l=n.getDerivedStateFromProps,(u=typeof l=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==d||f!==c)&&wv(t,i,s,c),Ya=!1,f=t.memoizedState,i.state=f,Pl(t,s,i,r),Ll();var x=t.memoizedState;o!==d||f!==x||Ya||e!==null&&e.dependencies!==null&&Tu(e.dependencies)?(typeof l=="function"&&(Xf(t,n,l,s),x=t.memoizedState),(h=Ya||yv(t,n,h,s,f,x,c)||e!==null&&e.dependencies!==null&&Tu(e.dependencies))?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(s,x,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(s,x,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=x),i.props=s,i.state=x,i.context=c,s=h):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),s=!1)}return i=s,au(e,t),s=(t.flags&128)!==0,i||s?(i=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&s?(t.child=yo(t,e.child,null,r),t.child=yo(t,null,n,r)):Kt(e,t,n,r),t.memoizedState=i.state,e=t.child):e=ba(e,t,r),e}function Mv(e,t,n,s){return Ac(),t.flags|=256,Kt(e,t,n,s),t.child}var Gf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zf(e){return{baseLanes:e,cachePool:A1()}}function Qf(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=rs),e}function EN(e,t,n){var s=t.pendingProps,r=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(Ht.current&2)!==0),o&&(r=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(et){if(r?Wa(t):qa(),et){var l=Tt,c;if(c=l){e:{for(c=l,l=Os;c.nodeType!==8;){if(!l){l=null;break e}if(c=gs(c.nextSibling),c===null){l=null;break e}}l=c}l!==null?(t.memoizedState={dehydrated:l,treeContext:Vr!==null?{id:ia,overflow:oa}:null,retryLane:536870912,hydrationErrors:null},c=On(18,null,null,0),c.stateNode=l,c.return=t,t.child=c,dn=t,Tt=null,c=!0):c=!1}c||Jr(t)}if(l=t.memoizedState,l!==null&&(l=l.dehydrated,l!==null))return Px(l)?t.lanes=32:t.lanes=536870912,null;ca(t)}return l=s.children,s=s.fallback,r?(qa(),r=t.mode,l=$u({mode:"hidden",children:l},r),s=Hr(s,r,n,null),l.return=t,s.return=t,l.sibling=s,t.child=l,r=t.child,r.memoizedState=Zf(n),r.childLanes=Qf(e,o,n),t.memoizedState=Gf,s):(Wa(t),Ex(t,l))}if(c=e.memoizedState,c!==null&&(l=c.dehydrated,l!==null)){if(i)t.flags&256?(Wa(t),t.flags&=-257,t=Kf(e,t,n)):t.memoizedState!==null?(qa(),t.child=e.child,t.flags|=128,t=null):(qa(),r=s.fallback,l=t.mode,s=$u({mode:"visible",children:s.children},l),r=Hr(r,l,n,null),r.flags|=2,s.return=t,r.return=t,s.sibling=r,t.child=s,yo(t,e.child,null,n),s=t.child,s.memoizedState=Zf(n),s.childLanes=Qf(e,o,n),t.memoizedState=Gf,t=r);else if(Wa(t),Px(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var u=o.dgst;o=u,s=Error(ie(419)),s.stack="",s.digest=o,Jl({value:s,source:null,stack:null}),t=Kf(e,t,n)}else if(qt||Oc(e,t,n,!1),o=(n&e.childLanes)!==0,qt||o){if(o=ft,o!==null&&(s=n&-n,s=s&42?1:$g(s),s=s&(o.suspendedLanes|n)?0:s,s!==0&&s!==c.retryLane))throw c.retryLane=s,Ho(e,s),Pn(o,e,s),jN;l.data==="$?"||Ax(),t=Kf(e,t,n)}else l.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,Tt=gs(l.nextSibling),dn=t,et=!0,Yr=null,Os=!1,e!==null&&(ts[ns++]=ia,ts[ns++]=oa,ts[ns++]=Vr,ia=e.id,oa=e.overflow,Vr=t),t=Ex(t,s.children),t.flags|=4096);return t}return r?(qa(),r=s.fallback,l=t.mode,c=e.child,u=c.sibling,s=ma(c,{mode:"hidden",children:s.children}),s.subtreeFlags=c.subtreeFlags&65011712,u!==null?r=ma(u,r):(r=Hr(r,l,n,null),r.flags|=2),r.return=t,s.return=t,s.sibling=r,t.child=s,s=r,r=t.child,l=e.child.memoizedState,l===null?l=Zf(n):(c=l.cachePool,c!==null?(u=Pt._currentValue,c=c.parent!==u?{parent:u,pool:u}:c):c=A1(),l={baseLanes:l.baseLanes|n,cachePool:c}),r.memoizedState=l,r.childLanes=Qf(e,o,n),t.memoizedState=Gf,s):(Wa(t),n=e.child,e=n.sibling,n=ma(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Ex(e,t){return t=$u({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function $u(e,t){return e=On(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Kf(e,t,n){return yo(t,e.child,null,n),e=Ex(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tv(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),fx(e.return,t,n)}function Jf(e,t,n,s,r){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=s,i.tail=n,i.tailMode=r)}function kN(e,t,n){var s=t.pendingProps,r=s.revealOrder,i=s.tail;if(Kt(e,t,s.children,n),s=Ht.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tv(e,n,t);else if(e.tag===19)Tv(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}switch(Nt(Ht,s),r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&zu(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Jf(t,!1,r,n,i);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&zu(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Jf(t,!0,n,null,i);break;case"together":Jf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ba(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),mr|=t.lanes,!(n&t.childLanes))if(e!==null){if(Oc(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(ie(153));if(t.child!==null){for(e=t.child,n=ma(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ma(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fp(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Tu(e)))}function X3(e,t,n){switch(t.tag){case 3:wu(t,t.stateNode.containerInfo),Ia(t,Pt,e.memoizedState.cache),Ac();break;case 27:case 5:tx(t);break;case 4:wu(t,t.stateNode.containerInfo);break;case 10:Ia(t,t.type,t.memoizedProps.value);break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Wa(t),t.flags|=128,null):n&t.child.childLanes?EN(e,t,n):(Wa(t),e=ba(e,t,n),e!==null?e.sibling:null);Wa(t);break;case 19:var r=(e.flags&128)!==0;if(s=(n&t.childLanes)!==0,s||(Oc(e,t,n,!1),s=(n&t.childLanes)!==0),r){if(s)return kN(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Nt(Ht,Ht.current),s)break;return null;case 22:case 23:return t.lanes=0,CN(e,t,n);case 24:Ia(t,Pt,e.memoizedState.cache)}return ba(e,t,n)}function MN(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)qt=!0;else{if(!fp(e,n)&&!(t.flags&128))return qt=!1,X3(e,t,n);qt=!!(e.flags&131072)}else qt=!1,et&&t.flags&1048576&&D1(t,Mu,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var s=t.elementType,r=s._init;if(s=r(s._payload),t.type=s,typeof s=="function")Xg(s)?(e=ni(s,e),t.tag=1,t=kv(null,t,s,e,n)):(t.tag=0,t=Cx(null,t,s,e,n));else{if(s!=null){if(r=s.$$typeof,r===zg){t.tag=11,t=jv(null,t,s,e,n);break e}else if(r===Rg){t.tag=14,t=Sv(null,t,s,e,n);break e}}throw t=Jm(s)||s,Error(ie(306,t,""))}}return t;case 0:return Cx(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,r=ni(s,t.pendingProps),kv(e,t,s,r,n);case 3:e:{if(wu(t,t.stateNode.containerInfo),e===null)throw Error(ie(387));s=t.pendingProps;var i=t.memoizedState;r=i.element,px(e,t),Pl(t,s,null,n);var o=t.memoizedState;if(s=o.cache,Ia(t,Pt,s),s!==i.cache&&mx(t,[Pt],n,!0),Ll(),s=o.element,i.isDehydrated)if(i={element:s,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Mv(e,t,s,n);break e}else if(s!==r){r=as(Error(ie(424)),t),Jl(r),t=Mv(e,t,s,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Tt=gs(e.firstChild),dn=t,et=!0,Yr=null,Os=!0,n=gN(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ac(),s===r){t=ba(e,t,n);break e}Kt(e,t,s,n)}t=t.child}return t;case 26:return au(e,t),e===null?(n=Wv(t.type,null,t.pendingProps,null))?t.memoizedState=n:et||(n=t.type,e=t.pendingProps,s=Fu(tr.current).createElement(n),s[rn]=t,s[Nn]=e,en(s,n,e),Wt(s),t.stateNode=s):t.memoizedState=Wv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return tx(t),e===null&&et&&(s=t.stateNode=mj(t.type,t.pendingProps,tr.current),dn=t,Os=!0,r=Tt,wr(t.type)?(Bx=r,Tt=gs(s.firstChild)):Tt=r),Kt(e,t,t.pendingProps.children,n),au(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&et&&((r=s=Tt)&&(s=Nk(s,t.type,t.pendingProps,Os),s!==null?(t.stateNode=s,dn=t,Tt=gs(s.firstChild),Os=!1,r=!0):r=!1),r||Jr(t)),tx(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,$x(r,i)?s=null:o!==null&&$x(r,o)&&(t.flags|=32),t.memoizedState!==null&&(r=np(e,t,B3,null,null,n),rc._currentValue=r),au(e,t),Kt(e,t,s,n),t.child;case 6:return e===null&&et&&((e=n=Tt)&&(n=jk(n,t.pendingProps,Os),n!==null?(t.stateNode=n,dn=t,Tt=null,e=!0):e=!1),e||Jr(t)),null;case 13:return EN(e,t,n);case 4:return wu(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=yo(t,null,s,n):Kt(e,t,s,n),t.child;case 11:return jv(e,t,t.type,t.pendingProps,n);case 7:return Kt(e,t,t.pendingProps,n),t.child;case 8:return Kt(e,t,t.pendingProps.children,n),t.child;case 12:return Kt(e,t,t.pendingProps.children,n),t.child;case 10:return s=t.pendingProps,Ia(t,t.type,s.value),Kt(e,t,s.children,n),t.child;case 9:return r=t.type._context,s=t.pendingProps.children,ei(t),r=on(r),s=s(r),t.flags|=1,Kt(e,t,s,n),t.child;case 14:return Sv(e,t,t.type,t.pendingProps,n);case 15:return SN(e,t,t.type,t.pendingProps,n);case 19:return kN(e,t,n);case 31:return s=t.pendingProps,n=t.mode,s={mode:s.mode,children:s.children},e===null?(n=$u(s,n),n.ref=t.ref,t.child=n,n.return=t,t=n):(n=ma(e.child,s),n.ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return CN(e,t,n);case 24:return ei(t),s=on(Pt),e===null?(r=Kg(),r===null&&(r=ft,i=Qg(),r.pooledCache=i,i.refCount++,i!==null&&(r.pooledCacheLanes|=n),r=i),t.memoizedState={parent:s,cache:r},Jg(t),Ia(t,Pt,r)):(e.lanes&n&&(px(e,t),Pl(t,null,null,n),Ll()),r=e.memoizedState,i=t.memoizedState,r.parent!==s?(r={parent:s,cache:s},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Ia(t,Pt,s)):(s=i.cache,Ia(t,Pt,s),s!==r.cache&&mx(t,[Pt],n,!0))),Kt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(ie(156,t.tag))}function Js(e){e.flags|=4}function Dv(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!pj(t)){if(t=is.current,t!==null&&((Ge&4194048)===Ge?Bs!==null:(Ge&62914560)!==Ge&&!(Ge&536870912)||t!==Bs))throw Ul=gx,O1;e.flags|=8192}}function Nd(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?e1():536870912,e.lanes|=t,wo|=t)}function cl(e,t){if(!et)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Ct(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags&65011712,s|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function G3(e,t,n){var s=t.pendingProps;switch(Zg(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ct(t),null;case 1:return Ct(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),xa(Pt),mo(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ol(t)?Js(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,iv())),Ct(t),null;case 26:return n=t.memoizedState,e===null?(Js(t),n!==null?(Ct(t),Dv(t,n)):(Ct(t),t.flags&=-16777217)):n?n!==e.memoizedState?(Js(t),Ct(t),Dv(t,n)):(Ct(t),t.flags&=-16777217):(e.memoizedProps!==s&&Js(t),Ct(t),t.flags&=-16777217),null;case 27:Nu(t),n=tr.current;var r=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Js(t);else{if(!s){if(t.stateNode===null)throw Error(ie(166));return Ct(t),null}e=Ls.current,ol(t)?av(t):(e=mj(r,s,n),t.stateNode=e,Js(t))}return Ct(t),null;case 5:if(Nu(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Js(t);else{if(!s){if(t.stateNode===null)throw Error(ie(166));return Ct(t),null}if(e=Ls.current,ol(t))av(t);else{switch(r=Fu(tr.current),e){case 1:e=r.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=r.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":e=r.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof s.is=="string"?r.createElement("select",{is:s.is}):r.createElement("select"),s.multiple?e.multiple=!0:s.size&&(e.size=s.size);break;default:e=typeof s.is=="string"?r.createElement(n,{is:s.is}):r.createElement(n)}}e[rn]=t,e[Nn]=s;e:for(r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}t.stateNode=e;e:switch(en(e,n,s),n){case"button":case"input":case"select":case"textarea":e=!!s.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Js(t)}}return Ct(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Js(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(ie(166));if(e=tr.current,ol(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,r=dn,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[rn]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||uj(e.nodeValue,n)),e||Jr(t)}else e=Fu(e).createTextNode(s),e[rn]=t,t.stateNode=e}return Ct(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=ol(t),s!==null&&s.dehydrated!==null){if(e===null){if(!r)throw Error(ie(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(ie(317));r[rn]=t}else Ac(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ct(t),r=!1}else r=iv(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(ca(t),t):(ca(t),null)}if(ca(t),t.flags&128)return t.lanes=n,t;if(n=s!==null,e=e!==null&&e.memoizedState!==null,n){s=t.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool);var i=null;s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==r&&(s.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),Nd(t,t.updateQueue),Ct(t),null;case 4:return mo(),e===null&&wp(t.stateNode.containerInfo),Ct(t),null;case 10:return xa(t.type),Ct(t),null;case 19:if(Xt(Ht),r=t.memoizedState,r===null)return Ct(t),null;if(s=(t.flags&128)!==0,i=r.rendering,i===null)if(s)cl(r,!1);else{if(Dt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=zu(e),i!==null){for(t.flags|=128,cl(r,!1),e=i.updateQueue,t.updateQueue=e,Nd(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)T1(n,e),n=n.sibling;return Nt(Ht,Ht.current&1|2),t.child}e=e.sibling}r.tail!==null&&Ps()>Pu&&(t.flags|=128,s=!0,cl(r,!1),t.lanes=4194304)}else{if(!s)if(e=zu(i),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Nd(t,e),cl(r,!0),r.tail===null&&r.tailMode==="hidden"&&!i.alternate&&!et)return Ct(t),null}else 2*Ps()-r.renderingStartTime>Pu&&n!==536870912&&(t.flags|=128,s=!0,cl(r,!1),t.lanes=4194304);r.isBackwards?(i.sibling=t.child,t.child=i):(e=r.last,e!==null?e.sibling=i:t.child=i,r.last=i)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=Ps(),t.sibling=null,e=Ht.current,Nt(Ht,s?e&1|2:e&1),t):(Ct(t),null);case 22:case 23:return ca(t),ep(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?n&536870912&&!(t.flags&128)&&(Ct(t),t.subtreeFlags&6&&(t.flags|=8192)):Ct(t),n=t.updateQueue,n!==null&&Nd(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&Xt(Fr),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),xa(Pt),Ct(t),null;case 25:return null;case 30:return null}throw Error(ie(156,t.tag))}function Z3(e,t){switch(Zg(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xa(Pt),mo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Nu(t),null;case 13:if(ca(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ie(340));Ac()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Xt(Ht),null;case 4:return mo(),null;case 10:return xa(t.type),null;case 22:case 23:return ca(t),ep(),e!==null&&Xt(Fr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return xa(Pt),null;case 25:return null;default:return null}}function TN(e,t){switch(Zg(t),t.tag){case 3:xa(Pt),mo();break;case 26:case 27:case 5:Nu(t);break;case 4:mo();break;case 13:ca(t);break;case 19:Xt(Ht);break;case 10:xa(t.type);break;case 22:case 23:ca(t),ep(),e!==null&&Xt(Fr);break;case 24:xa(Pt)}}function Lc(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var r=s.next;n=r;do{if((n.tag&e)===e){s=void 0;var i=n.create,o=n.inst;s=i(),o.destroy=s}n=n.next}while(n!==r)}}catch(l){ut(t,t.return,l)}}function fr(e,t,n){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var i=r.next;s=i;do{if((s.tag&e)===e){var o=s.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(h){ut(r,c,h)}}}s=s.next}while(s!==i)}}catch(h){ut(t,t.return,h)}}function DN(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{U1(t,n)}catch(s){ut(e,e.return,s)}}}function _N(e,t,n){n.props=ni(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){ut(e,t,s)}}function Hl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(r){ut(e,t,r)}}function Rs(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(r){ut(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){ut(e,t,r)}else n.current=null}function AN(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(r){ut(e,e.return,r)}}function em(e,t,n){try{var s=e.stateNode;pk(s,e.type,n,t),s[Nn]=t}catch(r){ut(e,e.return,r)}}function ON(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wr(e.type)||e.tag===4}function tm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ON(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&wr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function kx(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vh));else if(s!==4&&(s===27&&wr(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(kx(e,t,n),e=e.sibling;e!==null;)kx(e,t,n),e=e.sibling}function Lu(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&wr(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Lu(e,t,n),e=e.sibling;e!==null;)Lu(e,t,n),e=e.sibling}function zN(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);en(t,s,n),t[rn]=e,t[Nn]=n}catch(i){ut(e,e.return,i)}}var aa=!1,At=!1,nm=!1,_v=typeof WeakSet=="function"?WeakSet:Set,Ft=null;function Q3(e,t){if(e=e.containerInfo,Rx=Xu,e=w1(e),Ig(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var r=s.anchorOffset,i=s.focusNode;s=s.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,h=0,d=e,f=null;t:for(;;){for(var x;d!==n||r!==0&&d.nodeType!==3||(l=o+r),d!==i||s!==0&&d.nodeType!==3||(c=o+s),d.nodeType===3&&(o+=d.nodeValue.length),(x=d.firstChild)!==null;)f=d,d=x;for(;;){if(d===e)break t;if(f===n&&++u===r&&(l=o),f===i&&++h===s&&(c=o),(x=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=x}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ux={focusedElem:e,selectionRange:n},Xu=!1,Ft=t;Ft!==null;)if(t=Ft,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,Ft=e;else for(;Ft!==null;){switch(t=Ft,i=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&i!==null){e=void 0,n=t,r=i.memoizedProps,i=i.memoizedState,s=n.stateNode;try{var w=ni(n.type,r,n.elementType===n.type);e=s.getSnapshotBeforeUpdate(w,i),s.__reactInternalSnapshotBeforeUpdate=e}catch(v){ut(n,n.return,v)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Lx(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Lx(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(ie(163))}if(e=t.sibling,e!==null){e.return=t.return,Ft=e;break}Ft=t.return}}function RN(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:Aa(e,n),s&4&&Lc(5,n);break;case 1:if(Aa(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(o){ut(n,n.return,o)}else{var r=ni(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){ut(n,n.return,o)}}s&64&&DN(n),s&512&&Hl(n,n.return);break;case 3:if(Aa(e,n),s&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{U1(e,t)}catch(o){ut(n,n.return,o)}}break;case 27:t===null&&s&4&&zN(n);case 26:case 5:Aa(e,n),t===null&&s&4&&AN(n),s&512&&Hl(n,n.return);break;case 12:Aa(e,n);break;case 13:Aa(e,n),s&4&&LN(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ik.bind(null,n),Sk(e,n))));break;case 22:if(s=n.memoizedState!==null||aa,!s){t=t!==null&&t.memoizedState!==null||At,r=aa;var i=At;aa=s,(At=t)&&!i?Pa(e,n,(n.subtreeFlags&8772)!==0):Aa(e,n),aa=r,At=i}break;case 30:break;default:Aa(e,n)}}function UN(e){var t=e.alternate;t!==null&&(e.alternate=null,UN(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pg(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var bt=null,pn=!1;function ea(e,t,n){for(n=n.child;n!==null;)$N(e,t,n),n=n.sibling}function $N(e,t,n){if(Un&&typeof Un.onCommitFiberUnmount=="function")try{Un.onCommitFiberUnmount(kc,n)}catch{}switch(n.tag){case 26:At||Rs(n,t),ea(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:At||Rs(n,t);var s=bt,r=pn;wr(n.type)&&(bt=n.stateNode,pn=!1),ea(e,t,n),Il(n.stateNode),bt=s,pn=r;break;case 5:At||Rs(n,t);case 6:if(s=bt,r=pn,bt=null,ea(e,t,n),bt=s,pn=r,bt!==null)if(pn)try{(bt.nodeType===9?bt.body:bt.nodeName==="HTML"?bt.ownerDocument.body:bt).removeChild(n.stateNode)}catch(i){ut(n,t,i)}else try{bt.removeChild(n.stateNode)}catch(i){ut(n,t,i)}break;case 18:bt!==null&&(pn?(e=bt,Yv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),lc(e)):Yv(bt,n.stateNode));break;case 4:s=bt,r=pn,bt=n.stateNode.containerInfo,pn=!0,ea(e,t,n),bt=s,pn=r;break;case 0:case 11:case 14:case 15:At||fr(2,n,t),At||fr(4,n,t),ea(e,t,n);break;case 1:At||(Rs(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&_N(n,t,s)),ea(e,t,n);break;case 21:ea(e,t,n);break;case 22:At=(s=At)||n.memoizedState!==null,ea(e,t,n),At=s;break;default:ea(e,t,n)}}function LN(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{lc(e)}catch(n){ut(t,t.return,n)}}function K3(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new _v),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new _v),t;default:throw Error(ie(435,e.tag))}}function sm(e,t){var n=K3(e);t.forEach(function(s){var r=ok.bind(null,e,s);n.has(s)||(n.add(s),s.then(r,r))})}function Cn(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s],i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(wr(l.type)){bt=l.stateNode,pn=!1;break e}break;case 5:bt=l.stateNode,pn=!1;break e;case 3:case 4:bt=l.stateNode.containerInfo,pn=!0;break e}l=l.return}if(bt===null)throw Error(ie(160));$N(i,o,r),bt=null,pn=!1,i=r.alternate,i!==null&&(i.return=null),r.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)PN(t,e),t=t.sibling}var cs=null;function PN(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Cn(t,e),En(e),s&4&&(fr(3,e,e.return),Lc(3,e),fr(5,e,e.return));break;case 1:Cn(t,e),En(e),s&512&&(At||n===null||Rs(n,n.return)),s&64&&aa&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var r=cs;if(Cn(t,e),En(e),s&512&&(At||n===null||Rs(n,n.return)),s&4){var i=n!==null?n.memoizedState:null;if(s=e.memoizedState,n===null)if(s===null)if(e.stateNode===null){e:{s=e.type,n=e.memoizedProps,r=r.ownerDocument||r;t:switch(s){case"title":i=r.getElementsByTagName("title")[0],(!i||i[Dc]||i[rn]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=r.createElement(s),r.head.insertBefore(i,r.querySelector("head > title"))),en(i,s,n),i[rn]=e,Wt(i),s=i;break e;case"link":var o=Xv("link","href",r).get(s+(n.href||""));if(o){for(var l=0;l<o.length;l++)if(i=o[l],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(l,1);break t}}i=r.createElement(s),en(i,s,n),r.head.appendChild(i);break;case"meta":if(o=Xv("meta","content",r).get(s+(n.content||""))){for(l=0;l<o.length;l++)if(i=o[l],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(l,1);break t}}i=r.createElement(s),en(i,s,n),r.head.appendChild(i);break;default:throw Error(ie(468,s))}i[rn]=e,Wt(i),s=i}e.stateNode=s}else Gv(r,e.type,e.stateNode);else e.stateNode=qv(r,s,e.memoizedProps);else i!==s?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,s===null?Gv(r,e.type,e.stateNode):qv(r,s,e.memoizedProps)):s===null&&e.stateNode!==null&&em(e,e.memoizedProps,n.memoizedProps)}break;case 27:Cn(t,e),En(e),s&512&&(At||n===null||Rs(n,n.return)),n!==null&&s&4&&em(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Cn(t,e),En(e),s&512&&(At||n===null||Rs(n,n.return)),e.flags&32){r=e.stateNode;try{go(r,"")}catch(x){ut(e,e.return,x)}}s&4&&e.stateNode!=null&&(r=e.memoizedProps,em(e,r,n!==null?n.memoizedProps:r)),s&1024&&(nm=!0);break;case 6:if(Cn(t,e),En(e),s&4){if(e.stateNode===null)throw Error(ie(162));s=e.memoizedProps,n=e.stateNode;try{n.nodeValue=s}catch(x){ut(e,e.return,x)}}break;case 3:if(ou=null,r=cs,cs=Iu(t.containerInfo),Cn(t,e),cs=r,En(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{lc(t.containerInfo)}catch(x){ut(e,e.return,x)}nm&&(nm=!1,BN(e));break;case 4:s=cs,cs=Iu(e.stateNode.containerInfo),Cn(t,e),En(e),cs=s;break;case 12:Cn(t,e),En(e);break;case 13:Cn(t,e),En(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(vp=Ps()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,sm(e,s)));break;case 22:r=e.memoizedState!==null;var c=n!==null&&n.memoizedState!==null,u=aa,h=At;if(aa=u||r,At=h||c,Cn(t,e),At=h,aa=u,En(e),s&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(n===null||c||aa||At||Ar(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){c=n=t;try{if(i=c.stateNode,r)o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var d=c.memoizedProps.style,f=d!=null&&d.hasOwnProperty("display")?d.display:null;l.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(x){ut(c,c.return,x)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=r?"":c.memoizedProps}catch(x){ut(c,c.return,x)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,sm(e,n))));break;case 19:Cn(t,e),En(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,sm(e,s)));break;case 30:break;case 21:break;default:Cn(t,e),En(e)}}function En(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(ON(s)){n=s;break}s=s.return}if(n==null)throw Error(ie(160));switch(n.tag){case 27:var r=n.stateNode,i=tm(e);Lu(e,i,r);break;case 5:var o=n.stateNode;n.flags&32&&(go(o,""),n.flags&=-33);var l=tm(e);Lu(e,l,o);break;case 3:case 4:var c=n.stateNode.containerInfo,u=tm(e);kx(e,u,c);break;default:throw Error(ie(161))}}catch(h){ut(e,e.return,h)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function BN(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;BN(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Aa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)RN(e,t.alternate,t),t=t.sibling}function Ar(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:fr(4,t,t.return),Ar(t);break;case 1:Rs(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&_N(t,t.return,n),Ar(t);break;case 27:Il(t.stateNode);case 26:case 5:Rs(t,t.return),Ar(t);break;case 22:t.memoizedState===null&&Ar(t);break;case 30:Ar(t);break;default:Ar(t)}e=e.sibling}}function Pa(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,r=e,i=t,o=i.flags;switch(i.tag){case 0:case 11:case 15:Pa(r,i,n),Lc(4,i);break;case 1:if(Pa(r,i,n),s=i,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){ut(s,s.return,u)}if(s=i,r=s.updateQueue,r!==null){var l=s.stateNode;try{var c=r.shared.hiddenCallbacks;if(c!==null)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)R1(c[r],l)}catch(u){ut(s,s.return,u)}}n&&o&64&&DN(i),Hl(i,i.return);break;case 27:zN(i);case 26:case 5:Pa(r,i,n),n&&s===null&&o&4&&AN(i),Hl(i,i.return);break;case 12:Pa(r,i,n);break;case 13:Pa(r,i,n),n&&o&4&&LN(r,i);break;case 22:i.memoizedState===null&&Pa(r,i,n),Hl(i,i.return);break;case 30:break;default:Pa(r,i,n)}t=t.sibling}}function mp(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&zc(n))}function xp(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&zc(e))}function Es(e,t,n,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)HN(e,t,n,s),t=t.sibling}function HN(e,t,n,s){var r=t.flags;switch(t.tag){case 0:case 11:case 15:Es(e,t,n,s),r&2048&&Lc(9,t);break;case 1:Es(e,t,n,s);break;case 3:Es(e,t,n,s),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&zc(e)));break;case 12:if(r&2048){Es(e,t,n,s),e=t.stateNode;try{var i=t.memoizedProps,o=i.id,l=i.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){ut(t,t.return,c)}}else Es(e,t,n,s);break;case 13:Es(e,t,n,s);break;case 23:break;case 22:i=t.stateNode,o=t.alternate,t.memoizedState!==null?i._visibility&2?Es(e,t,n,s):Vl(e,t):i._visibility&2?Es(e,t,n,s):(i._visibility|=2,Ri(e,t,n,s,(t.subtreeFlags&10256)!==0)),r&2048&&mp(o,t);break;case 24:Es(e,t,n,s),r&2048&&xp(t.alternate,t);break;default:Es(e,t,n,s)}}function Ri(e,t,n,s,r){for(r=r&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var i=e,o=t,l=n,c=s,u=o.flags;switch(o.tag){case 0:case 11:case 15:Ri(i,o,l,c,r),Lc(8,o);break;case 23:break;case 22:var h=o.stateNode;o.memoizedState!==null?h._visibility&2?Ri(i,o,l,c,r):Vl(i,o):(h._visibility|=2,Ri(i,o,l,c,r)),r&&u&2048&&mp(o.alternate,o);break;case 24:Ri(i,o,l,c,r),r&&u&2048&&xp(o.alternate,o);break;default:Ri(i,o,l,c,r)}t=t.sibling}}function Vl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,r=s.flags;switch(s.tag){case 22:Vl(n,s),r&2048&&mp(s.alternate,s);break;case 24:Vl(n,s),r&2048&&xp(s.alternate,s);break;default:Vl(n,s)}t=t.sibling}}var kl=8192;function Ci(e){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)VN(e),e=e.sibling}function VN(e){switch(e.tag){case 26:Ci(e),e.flags&kl&&e.memoizedState!==null&&$k(cs,e.memoizedState,e.memoizedProps);break;case 5:Ci(e);break;case 3:case 4:var t=cs;cs=Iu(e.stateNode.containerInfo),Ci(e),cs=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=kl,kl=16777216,Ci(e),kl=t):Ci(e));break;default:Ci(e)}}function YN(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function dl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Ft=s,IN(s,e)}YN(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)FN(e),e=e.sibling}function FN(e){switch(e.tag){case 0:case 11:case 15:dl(e),e.flags&2048&&fr(9,e,e.return);break;case 3:dl(e);break;case 12:dl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ru(e)):dl(e);break;default:dl(e)}}function ru(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Ft=s,IN(s,e)}YN(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:fr(8,t,t.return),ru(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ru(t));break;default:ru(t)}e=e.sibling}}function IN(e,t){for(;Ft!==null;){var n=Ft;switch(n.tag){case 0:case 11:case 15:fr(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:zc(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,Ft=s;else e:for(n=e;Ft!==null;){s=Ft;var r=s.sibling,i=s.return;if(UN(s),s===n){Ft=null;break e}if(r!==null){r.return=i,Ft=r;break e}Ft=i}}}var J3={getCacheForType:function(e){var t=on(Pt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},ek=typeof WeakMap=="function"?WeakMap:Map,it=0,ft=null,Ie=null,Ge=0,rt=0,Mn=null,Ka=!1,Vo=!1,gp=!1,ya=0,Dt=0,mr=0,Ir=0,pp=0,rs=0,wo=0,Yl=null,vn=null,Mx=!1,vp=0,Pu=1/0,Bu=null,ar=null,Jt=0,rr=null,No=null,io=0,Tx=0,Dx=null,WN=null,Fl=0,_x=null;function Ln(){if(it&2&&Ge!==0)return Ge&-Ge;if(Te.T!==null){var e=po;return e!==0?e:yp()}return s1()}function qN(){rs===0&&(rs=!(Ge&536870912)||et?Jw():536870912);var e=is.current;return e!==null&&(e.flags|=32),rs}function Pn(e,t,n){(e===ft&&(rt===2||rt===9)||e.cancelPendingCommit!==null)&&(jo(e,0),Ja(e,Ge,rs,!1)),Tc(e,n),(!(it&2)||e!==ft)&&(e===ft&&(!(it&2)&&(Ir|=n),Dt===4&&Ja(e,Ge,rs,!1)),qs(e))}function XN(e,t,n){if(it&6)throw Error(ie(327));var s=!n&&(t&124)===0&&(t&e.expiredLanes)===0||Mc(e,t),r=s?sk(e,t):am(e,t,!0),i=s;do{if(r===0){Vo&&!s&&Ja(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!tk(n)){r=am(e,t,!1),i=!1;continue}if(r===2){if(i=t,e.errorRecoveryDisabledLanes&i)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var l=e;r=Yl;var c=l.current.memoizedState.isDehydrated;if(c&&(jo(l,o).flags|=256),o=am(l,o,!1),o!==2){if(gp&&!c){l.errorRecoveryDisabledLanes|=i,Ir|=i,r=4;break e}i=vn,vn=r,i!==null&&(vn===null?vn=i:vn.push.apply(vn,i))}r=o}if(i=!1,r!==2)continue}}if(r===1){jo(e,0),Ja(e,t,0,!0);break}e:{switch(s=e,i=r,i){case 0:case 1:throw Error(ie(345));case 4:if((t&4194048)!==t)break;case 6:Ja(s,t,rs,!Ka);break e;case 2:vn=null;break;case 3:case 5:break;default:throw Error(ie(329))}if((t&62914560)===t&&(r=vp+300-Ps(),10<r)){if(Ja(s,t,rs,!Ka),Th(s,0,!0)!==0)break e;s.timeoutHandle=fj(Av.bind(null,s,n,vn,Bu,Mx,t,rs,Ir,wo,Ka,i,2,-0,0),r);break e}Av(s,n,vn,Bu,Mx,t,rs,Ir,wo,Ka,i,0,-0,0)}}break}while(!0);qs(e)}function Av(e,t,n,s,r,i,o,l,c,u,h,d,f,x){if(e.timeoutHandle=-1,d=t.subtreeFlags,(d&8192||(d&16785408)===16785408)&&(ac={stylesheets:null,count:0,unsuspend:Uk},VN(t),d=Lk(),d!==null)){e.cancelPendingCommit=d(zv.bind(null,e,t,i,n,s,r,o,l,c,h,1,f,x)),Ja(e,i,o,!u);return}zv(e,t,i,n,s,r,o,l,c)}function tk(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var s=0;s<n.length;s++){var r=n[s],i=r.getSnapshot;r=r.value;try{if(!Hn(i(),r))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ja(e,t,n,s){t&=~pp,t&=~Ir,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var i=31-$n(r),o=1<<i;s[i]=-1,r&=~o}n!==0&&t1(e,n,t)}function Ph(){return it&6?!0:(Pc(0),!1)}function bp(){if(Ie!==null){if(rt===0)var e=Ie.return;else e=Ie,la=pi=null,rp(e),ro=null,tc=0,e=Ie;for(;e!==null;)TN(e.alternate,e),e=e.return;Ie=null}}function jo(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,bk(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),bp(),ft=e,Ie=n=ma(e.current,null),Ge=t,rt=0,Mn=null,Ka=!1,Vo=Mc(e,t),gp=!1,wo=rs=pp=Ir=mr=Dt=0,vn=Yl=null,Mx=!1,t&8&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var r=31-$n(s),i=1<<r;t|=e[r],s&=~i}return ya=t,Oh(),n}function GN(e,t){Ve=null,Te.H=Ou,t===Rc||t===Rh?(t=dv(),rt=3):t===O1?(t=dv(),rt=4):rt=t===jN?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Mn=t,Ie===null&&(Dt=1,Uu(e,as(t,e.current)))}function ZN(){var e=Te.H;return Te.H=Ou,e===null?Ou:e}function QN(){var e=Te.A;return Te.A=J3,e}function Ax(){Dt=4,Ka||(Ge&4194048)!==Ge&&is.current!==null||(Vo=!0),!(mr&134217727)&&!(Ir&134217727)||ft===null||Ja(ft,Ge,rs,!1)}function am(e,t,n){var s=it;it|=2;var r=ZN(),i=QN();(ft!==e||Ge!==t)&&(Bu=null,jo(e,t)),t=!1;var o=Dt;e:do try{if(rt!==0&&Ie!==null){var l=Ie,c=Mn;switch(rt){case 8:bp(),o=6;break e;case 3:case 2:case 9:case 6:is.current===null&&(t=!0);var u=rt;if(rt=0,Mn=null,Zi(e,l,c,u),n&&Vo){o=0;break e}break;default:u=rt,rt=0,Mn=null,Zi(e,l,c,u)}}nk(),o=Dt;break}catch(h){GN(e,h)}while(!0);return t&&e.shellSuspendCounter++,la=pi=null,it=s,Te.H=r,Te.A=i,Ie===null&&(ft=null,Ge=0,Oh()),o}function nk(){for(;Ie!==null;)KN(Ie)}function sk(e,t){var n=it;it|=2;var s=ZN(),r=QN();ft!==e||Ge!==t?(Bu=null,Pu=Ps()+500,jo(e,t)):Vo=Mc(e,t);e:do try{if(rt!==0&&Ie!==null){t=Ie;var i=Mn;t:switch(rt){case 1:rt=0,Mn=null,Zi(e,t,i,1);break;case 2:case 9:if(cv(i)){rt=0,Mn=null,Ov(t);break}t=function(){rt!==2&&rt!==9||ft!==e||(rt=7),qs(e)},i.then(t,t);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:cv(i)?(rt=0,Mn=null,Ov(t)):(rt=0,Mn=null,Zi(e,t,i,7));break;case 5:var o=null;switch(Ie.tag){case 26:o=Ie.memoizedState;case 5:case 27:var l=Ie;if(!o||pj(o)){rt=0,Mn=null;var c=l.sibling;if(c!==null)Ie=c;else{var u=l.return;u!==null?(Ie=u,Bh(u)):Ie=null}break t}}rt=0,Mn=null,Zi(e,t,i,5);break;case 6:rt=0,Mn=null,Zi(e,t,i,6);break;case 8:bp(),Dt=6;break e;default:throw Error(ie(462))}}ak();break}catch(h){GN(e,h)}while(!0);return la=pi=null,Te.H=s,Te.A=r,it=n,Ie!==null?0:(ft=null,Ge=0,Oh(),Dt)}function ak(){for(;Ie!==null&&!EE();)KN(Ie)}function KN(e){var t=MN(e.alternate,e,ya);e.memoizedProps=e.pendingProps,t===null?Bh(e):Ie=t}function Ov(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Ev(n,t,t.pendingProps,t.type,void 0,Ge);break;case 11:t=Ev(n,t,t.pendingProps,t.type.render,t.ref,Ge);break;case 5:rp(t);default:TN(n,t),t=Ie=T1(t,ya),t=MN(n,t,ya)}e.memoizedProps=e.pendingProps,t===null?Bh(e):Ie=t}function Zi(e,t,n,s){la=pi=null,rp(t),ro=null,tc=0;var r=t.return;try{if(q3(e,r,t,n,Ge)){Dt=1,Uu(e,as(n,e.current)),Ie=null;return}}catch(i){if(r!==null)throw Ie=r,i;Dt=1,Uu(e,as(n,e.current)),Ie=null;return}t.flags&32768?(et||s===1?e=!0:Vo||Ge&536870912?e=!1:(Ka=e=!0,(s===2||s===9||s===3||s===6)&&(s=is.current,s!==null&&s.tag===13&&(s.flags|=16384))),JN(t,e)):Bh(t)}function Bh(e){var t=e;do{if(t.flags&32768){JN(t,Ka);return}e=t.return;var n=G3(t.alternate,t,ya);if(n!==null){Ie=n;return}if(t=t.sibling,t!==null){Ie=t;return}Ie=t=e}while(t!==null);Dt===0&&(Dt=5)}function JN(e,t){do{var n=Z3(e.alternate,e);if(n!==null){n.flags&=32767,Ie=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ie=e;return}Ie=e=n}while(e!==null);Dt=6,Ie=null}function zv(e,t,n,s,r,i,o,l,c){e.cancelPendingCommit=null;do Hh();while(Jt!==0);if(it&6)throw Error(ie(327));if(t!==null){if(t===e.current)throw Error(ie(177));if(i=t.lanes|t.childLanes,i|=Wg,UE(e,n,i,o,l,c),e===ft&&(Ie=ft=null,Ge=0),No=t,rr=e,io=n,Tx=i,Dx=r,WN=s,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,lk(ju,function(){return aj(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,t.subtreeFlags&13878||s){s=Te.T,Te.T=null,r=tt.p,tt.p=2,o=it,it|=4;try{Q3(e,t,n)}finally{it=o,tt.p=r,Te.T=s}}Jt=1,ej(),tj(),nj()}}function ej(){if(Jt===1){Jt=0;var e=rr,t=No,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=Te.T,Te.T=null;var s=tt.p;tt.p=2;var r=it;it|=4;try{PN(t,e);var i=Ux,o=w1(e.containerInfo),l=i.focusedElem,c=i.selectionRange;if(o!==l&&l&&l.ownerDocument&&y1(l.ownerDocument.documentElement,l)){if(c!==null&&Ig(l)){var u=c.start,h=c.end;if(h===void 0&&(h=u),"selectionStart"in l)l.selectionStart=u,l.selectionEnd=Math.min(h,l.value.length);else{var d=l.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var x=f.getSelection(),w=l.textContent.length,v=Math.min(c.start,w),N=c.end===void 0?v:Math.min(c.end,w);!x.extend&&v>N&&(o=N,N=v,v=o);var g=tv(l,v),b=tv(l,N);if(g&&b&&(x.rangeCount!==1||x.anchorNode!==g.node||x.anchorOffset!==g.offset||x.focusNode!==b.node||x.focusOffset!==b.offset)){var p=d.createRange();p.setStart(g.node,g.offset),x.removeAllRanges(),v>N?(x.addRange(p),x.extend(b.node,b.offset)):(p.setEnd(b.node,b.offset),x.addRange(p))}}}}for(d=[],x=l;x=x.parentNode;)x.nodeType===1&&d.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<d.length;l++){var y=d[l];y.element.scrollLeft=y.left,y.element.scrollTop=y.top}}Xu=!!Rx,Ux=Rx=null}finally{it=r,tt.p=s,Te.T=n}}e.current=t,Jt=2}}function tj(){if(Jt===2){Jt=0;var e=rr,t=No,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=Te.T,Te.T=null;var s=tt.p;tt.p=2;var r=it;it|=4;try{RN(e,t.alternate,t)}finally{it=r,tt.p=s,Te.T=n}}Jt=3}}function nj(){if(Jt===4||Jt===3){Jt=0,kE();var e=rr,t=No,n=io,s=WN;t.subtreeFlags&10256||t.flags&10256?Jt=5:(Jt=0,No=rr=null,sj(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(ar=null),Lg(n),t=t.stateNode,Un&&typeof Un.onCommitFiberRoot=="function")try{Un.onCommitFiberRoot(kc,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=Te.T,r=tt.p,tt.p=2,Te.T=null;try{for(var i=e.onRecoverableError,o=0;o<s.length;o++){var l=s[o];i(l.value,{componentStack:l.stack})}}finally{Te.T=t,tt.p=r}}io&3&&Hh(),qs(e),r=e.pendingLanes,n&4194090&&r&42?e===_x?Fl++:(Fl=0,_x=e):Fl=0,Pc(0)}}function sj(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,zc(t)))}function Hh(e){return ej(),tj(),nj(),aj()}function aj(){if(Jt!==5)return!1;var e=rr,t=Tx;Tx=0;var n=Lg(io),s=Te.T,r=tt.p;try{tt.p=32>n?32:n,Te.T=null,n=Dx,Dx=null;var i=rr,o=io;if(Jt=0,No=rr=null,io=0,it&6)throw Error(ie(331));var l=it;if(it|=4,FN(i.current),HN(i,i.current,o,n),it=l,Pc(0,!1),Un&&typeof Un.onPostCommitFiberRoot=="function")try{Un.onPostCommitFiberRoot(kc,i)}catch{}return!0}finally{tt.p=r,Te.T=s,sj(e,t)}}function Rv(e,t,n){t=as(n,t),t=Sx(e.stateNode,t,2),e=sr(e,t,2),e!==null&&(Tc(e,2),qs(e))}function ut(e,t,n){if(e.tag===3)Rv(e,e,n);else for(;t!==null;){if(t.tag===3){Rv(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ar===null||!ar.has(s))){e=as(n,e),n=wN(2),s=sr(t,n,2),s!==null&&(NN(n,s,t,e),Tc(s,2),qs(s));break}}t=t.return}}function rm(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new ek;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(n)||(gp=!0,r.add(n),e=rk.bind(null,e,t,n),t.then(e,e))}function rk(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ft===e&&(Ge&n)===n&&(Dt===4||Dt===3&&(Ge&62914560)===Ge&&300>Ps()-vp?!(it&2)&&jo(e,0):pp|=n,wo===Ge&&(wo=0)),qs(e)}function rj(e,t){t===0&&(t=e1()),e=Ho(e,t),e!==null&&(Tc(e,t),qs(e))}function ik(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),rj(e,n)}function ok(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(ie(314))}s!==null&&s.delete(t),rj(e,n)}function lk(e,t){return Ug(e,t)}var Hu=null,Ui=null,Ox=!1,Vu=!1,im=!1,Wr=0;function qs(e){e!==Ui&&e.next===null&&(Ui===null?Hu=Ui=e:Ui=Ui.next=e),Vu=!0,Ox||(Ox=!0,dk())}function Pc(e,t){if(!im&&Vu){im=!0;do for(var n=!1,s=Hu;s!==null;){if(e!==0){var r=s.pendingLanes;if(r===0)var i=0;else{var o=s.suspendedLanes,l=s.pingedLanes;i=(1<<31-$n(42|e)+1)-1,i&=r&~(o&~l),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,Uv(s,i))}else i=Ge,i=Th(s,s===ft?i:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),!(i&3)||Mc(s,i)||(n=!0,Uv(s,i));s=s.next}while(n);im=!1}}function ck(){ij()}function ij(){Vu=Ox=!1;var e=0;Wr!==0&&(vk()&&(e=Wr),Wr=0);for(var t=Ps(),n=null,s=Hu;s!==null;){var r=s.next,i=oj(s,t);i===0?(s.next=null,n===null?Hu=r:n.next=r,r===null&&(Ui=n)):(n=s,(e!==0||i&3)&&(Vu=!0)),s=r}Pc(e)}function oj(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var o=31-$n(i),l=1<<o,c=r[o];c===-1?(!(l&n)||l&s)&&(r[o]=RE(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}if(t=ft,n=Ge,n=Th(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(rt===2||rt===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Af(s),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Mc(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&Af(s),Lg(n)){case 2:case 8:n=Qw;break;case 32:n=ju;break;case 268435456:n=Kw;break;default:n=ju}return s=lj.bind(null,e),n=Ug(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&Af(s),e.callbackPriority=2,e.callbackNode=null,2}function lj(e,t){if(Jt!==0&&Jt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hh()&&e.callbackNode!==n)return null;var s=Ge;return s=Th(e,e===ft?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(XN(e,s,t),oj(e,Ps()),e.callbackNode!=null&&e.callbackNode===n?lj.bind(null,e):null)}function Uv(e,t){if(Hh())return null;XN(e,t,!0)}function dk(){yk(function(){it&6?Ug(Zw,ck):ij()})}function yp(){return Wr===0&&(Wr=Jw()),Wr}function $v(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Qd(""+e)}function Lv(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function uk(e,t,n,s,r){if(t==="submit"&&n&&n.stateNode===r){var i=$v((r[Nn]||null).action),o=s.submitter;o&&(t=(t=o[Nn]||null)?$v(t.formAction):o.getAttribute("formAction"),t!==null&&(i=t,o=null));var l=new Dh("action","action",null,s,r);e.push({event:l,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Wr!==0){var c=o?Lv(r,o):new FormData(r);Nx(n,{pending:!0,data:c,method:r.method,action:i},null,c)}}else typeof i=="function"&&(l.preventDefault(),c=o?Lv(r,o):new FormData(r),Nx(n,{pending:!0,data:c,method:r.method,action:i},i,c))},currentTarget:r}]})}}for(var om=0;om<dx.length;om++){var lm=dx[om],hk=lm.toLowerCase(),fk=lm[0].toUpperCase()+lm.slice(1);ys(hk,"on"+fk)}ys(j1,"onAnimationEnd");ys(S1,"onAnimationIteration");ys(C1,"onAnimationStart");ys("dblclick","onDoubleClick");ys("focusin","onFocus");ys("focusout","onBlur");ys(D3,"onTransitionRun");ys(_3,"onTransitionStart");ys(A3,"onTransitionCancel");ys(E1,"onTransitionEnd");xo("onMouseEnter",["mouseout","mouseover"]);xo("onMouseLeave",["mouseout","mouseover"]);xo("onPointerEnter",["pointerout","pointerover"]);xo("onPointerLeave",["pointerout","pointerover"]);mi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));mi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));mi("onBeforeInput",["compositionend","keypress","textInput","paste"]);mi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));mi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));mi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nc="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(" "),mk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(nc));function cj(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],r=s.event;s=s.listeners;e:{var i=void 0;if(t)for(var o=s.length-1;0<=o;o--){var l=s[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&r.isPropagationStopped())break e;i=l,r.currentTarget=u;try{i(r)}catch(h){Ru(h)}r.currentTarget=null,i=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&r.isPropagationStopped())break e;i=l,r.currentTarget=u;try{i(r)}catch(h){Ru(h)}r.currentTarget=null,i=c}}}}function Fe(e,t){var n=t[sx];n===void 0&&(n=t[sx]=new Set);var s=e+"__bubble";n.has(s)||(dj(t,e,2,!1),n.add(s))}function cm(e,t,n){var s=0;t&&(s|=4),dj(n,e,s,t)}var jd="_reactListening"+Math.random().toString(36).slice(2);function wp(e){if(!e[jd]){e[jd]=!0,a1.forEach(function(n){n!=="selectionchange"&&(mk.has(n)||cm(n,!1,e),cm(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[jd]||(t[jd]=!0,cm("selectionchange",!1,t))}}function dj(e,t,n,s){switch(Nj(t)){case 2:var r=Hk;break;case 8:r=Vk;break;default:r=Cp}n=r.bind(null,t,n,e),r=void 0,!ox||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function dm(e,t,n,s,r){var i=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var l=s.stateNode.containerInfo;if(l===r)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===r)return;o=o.return}for(;l!==null;){if(o=Hi(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){s=i=o;continue e}l=l.parentNode}}s=s.return}h1(function(){var u=i,h=Hg(n),d=[];e:{var f=k1.get(e);if(f!==void 0){var x=Dh,w=e;switch(e){case"keypress":if(Jd(n)===0)break e;case"keydown":case"keyup":x=l3;break;case"focusin":w="focus",x=Bf;break;case"focusout":w="blur",x=Bf;break;case"beforeblur":case"afterblur":x=Bf;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=I0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=ZE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=u3;break;case j1:case S1:case C1:x=JE;break;case E1:x=f3;break;case"scroll":case"scrollend":x=XE;break;case"wheel":x=x3;break;case"copy":case"cut":case"paste":x=t3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=q0;break;case"toggle":case"beforetoggle":x=p3}var v=(t&4)!==0,N=!v&&(e==="scroll"||e==="scrollend"),g=v?f!==null?f+"Capture":null:f;v=[];for(var b=u,p;b!==null;){var y=b;if(p=y.stateNode,y=y.tag,y!==5&&y!==26&&y!==27||p===null||g===null||(y=Zl(b,g),y!=null&&v.push(sc(b,y,p))),N)break;b=b.return}0<v.length&&(f=new x(f,w,null,n,h),d.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",f&&n!==ix&&(w=n.relatedTarget||n.fromElement)&&(Hi(w)||w[Po]))break e;if((x||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,x?(w=n.relatedTarget||n.toElement,x=u,w=w?Hi(w):null,w!==null&&(N=Ec(w),v=w.tag,w!==N||v!==5&&v!==27&&v!==6)&&(w=null)):(x=null,w=u),x!==w)){if(v=I0,y="onMouseLeave",g="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(v=q0,y="onPointerLeave",g="onPointerEnter",b="pointer"),N=x==null?f:El(x),p=w==null?f:El(w),f=new v(y,b+"leave",x,n,h),f.target=N,f.relatedTarget=p,y=null,Hi(h)===u&&(v=new v(g,b+"enter",w,n,h),v.target=p,v.relatedTarget=N,y=v),N=y,x&&w)t:{for(v=x,g=w,b=0,p=v;p;p=Ei(p))b++;for(p=0,y=g;y;y=Ei(y))p++;for(;0<b-p;)v=Ei(v),b--;for(;0<p-b;)g=Ei(g),p--;for(;b--;){if(v===g||g!==null&&v===g.alternate)break t;v=Ei(v),g=Ei(g)}v=null}else v=null;x!==null&&Pv(d,f,x,v,!1),w!==null&&N!==null&&Pv(d,N,w,v,!0)}}e:{if(f=u?El(u):window,x=f.nodeName&&f.nodeName.toLowerCase(),x==="select"||x==="input"&&f.type==="file")var j=Q0;else if(Z0(f))if(v1)j=k3;else{j=C3;var S=S3}else x=f.nodeName,!x||x.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&Bg(u.elementType)&&(j=Q0):j=E3;if(j&&(j=j(e,u))){p1(d,j,n,h);break e}S&&S(e,f,u),e==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&rx(f,"number",f.value)}switch(S=u?El(u):window,e){case"focusin":(Z0(S)||S.contentEditable==="true")&&(Fi=S,lx=u,zl=null);break;case"focusout":zl=lx=Fi=null;break;case"mousedown":cx=!0;break;case"contextmenu":case"mouseup":case"dragend":cx=!1,nv(d,n,h);break;case"selectionchange":if(T3)break;case"keydown":case"keyup":nv(d,n,h)}var C;if(Fg)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else Yi?x1(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(m1&&n.locale!=="ko"&&(Yi||T!=="onCompositionStart"?T==="onCompositionEnd"&&Yi&&(C=f1()):(Qa=h,Vg="value"in Qa?Qa.value:Qa.textContent,Yi=!0)),S=Yu(u,T),0<S.length&&(T=new W0(T,e,null,n,h),d.push({event:T,listeners:S}),C?T.data=C:(C=g1(n),C!==null&&(T.data=C)))),(C=b3?y3(e,n):w3(e,n))&&(T=Yu(u,"onBeforeInput"),0<T.length&&(S=new W0("onBeforeInput","beforeinput",null,n,h),d.push({event:S,listeners:T}),S.data=C)),uk(d,e,u,n,h)}cj(d,t)})}function sc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Yu(e,t){for(var n=t+"Capture",s=[];e!==null;){var r=e,i=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||i===null||(r=Zl(e,n),r!=null&&s.unshift(sc(e,r,i)),r=Zl(e,t),r!=null&&s.push(sc(e,r,i))),e.tag===3)return s;e=e.return}return[]}function Ei(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Pv(e,t,n,s,r){for(var i=t._reactName,o=[];n!==null&&n!==s;){var l=n,c=l.alternate,u=l.stateNode;if(l=l.tag,c!==null&&c===s)break;l!==5&&l!==26&&l!==27||u===null||(c=u,r?(u=Zl(n,i),u!=null&&o.unshift(sc(n,u,c))):r||(u=Zl(n,i),u!=null&&o.push(sc(n,u,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var xk=/\r\n?/g,gk=/\u0000|\uFFFD/g;function Bv(e){return(typeof e=="string"?e:""+e).replace(xk,`
|
|
49
|
-
`).replace(gk,"")}function uj(e,t){return t=Bv(t),Bv(e)===t}function Vh(){}function ot(e,t,n,s,r,i){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||go(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&go(e,""+s);break;case"className":gd(e,"class",s);break;case"tabIndex":gd(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":gd(e,n,s);break;case"style":u1(e,s,i);break;case"data":if(t!=="object"){gd(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=Qd(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(n,"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 i=="function"&&(n==="formAction"?(t!=="input"&&ot(e,t,"name",r.name,r,null),ot(e,t,"formEncType",r.formEncType,r,null),ot(e,t,"formMethod",r.formMethod,r,null),ot(e,t,"formTarget",r.formTarget,r,null)):(ot(e,t,"encType",r.encType,r,null),ot(e,t,"method",r.method,r,null),ot(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=Qd(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=Vh);break;case"onScroll":s!=null&&Fe("scroll",e);break;case"onScrollEnd":s!=null&&Fe("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(ie(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(ie(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=Qd(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):e.removeAttribute(n);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":Fe("beforetoggle",e),Fe("toggle",e),Zd(e,"popover",s);break;case"xlinkActuate":Ks(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Ks(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Ks(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Ks(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Ks(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Ks(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Ks(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Ks(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Ks(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Zd(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=WE.get(n)||n,Zd(e,n,s))}}function zx(e,t,n,s,r,i){switch(n){case"style":u1(e,s,i);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(ie(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(ie(60));e.innerHTML=n}}break;case"children":typeof s=="string"?go(e,s):(typeof s=="number"||typeof s=="bigint")&&go(e,""+s);break;case"onScroll":s!=null&&Fe("scroll",e);break;case"onScrollEnd":s!=null&&Fe("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Vh);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!r1.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),t=n.slice(2,r?n.length-7:void 0),i=e[Nn]||null,i=i!=null?i[n]:null,typeof i=="function"&&e.removeEventListener(t,i,r),typeof s=="function")){typeof i!="function"&&i!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,s,r);break e}n in e?e[n]=s:s===!0?e.setAttribute(n,""):Zd(e,n,s)}}}function en(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",e),Fe("load",e);var s=!1,r=!1,i;for(i in n)if(n.hasOwnProperty(i)){var o=n[i];if(o!=null)switch(i){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(ie(137,t));default:ot(e,t,i,o,n,null)}}r&&ot(e,t,"srcSet",n.srcSet,n,null),s&&ot(e,t,"src",n.src,n,null);return;case"input":Fe("invalid",e);var l=i=o=r=null,c=null,u=null;for(s in n)if(n.hasOwnProperty(s)){var h=n[s];if(h!=null)switch(s){case"name":r=h;break;case"type":o=h;break;case"checked":c=h;break;case"defaultChecked":u=h;break;case"value":i=h;break;case"defaultValue":l=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(ie(137,t));break;default:ot(e,t,s,h,n,null)}}l1(e,i,l,c,u,o,r,!1),Su(e);return;case"select":Fe("invalid",e),s=o=i=null;for(r in n)if(n.hasOwnProperty(r)&&(l=n[r],l!=null))switch(r){case"value":i=l;break;case"defaultValue":o=l;break;case"multiple":s=l;default:ot(e,t,r,l,n,null)}t=i,n=o,e.multiple=!!s,t!=null?eo(e,!!s,t,!1):n!=null&&eo(e,!!s,n,!0);return;case"textarea":Fe("invalid",e),i=r=s=null;for(o in n)if(n.hasOwnProperty(o)&&(l=n[o],l!=null))switch(o){case"value":s=l;break;case"defaultValue":r=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(ie(91));break;default:ot(e,t,o,l,n,null)}d1(e,s,r,i),Su(e);return;case"option":for(c in n)if(n.hasOwnProperty(c)&&(s=n[c],s!=null))switch(c){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:ot(e,t,c,s,n,null)}return;case"dialog":Fe("beforetoggle",e),Fe("toggle",e),Fe("cancel",e),Fe("close",e);break;case"iframe":case"object":Fe("load",e);break;case"video":case"audio":for(s=0;s<nc.length;s++)Fe(nc[s],e);break;case"image":Fe("error",e),Fe("load",e);break;case"details":Fe("toggle",e);break;case"embed":case"source":case"link":Fe("error",e),Fe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&(s=n[u],s!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(ie(137,t));default:ot(e,t,u,s,n,null)}return;default:if(Bg(t)){for(h in n)n.hasOwnProperty(h)&&(s=n[h],s!==void 0&&zx(e,t,h,s,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(s=n[l],s!=null&&ot(e,t,l,s,n,null))}function pk(e,t,n,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,i=null,o=null,l=null,c=null,u=null,h=null;for(x in n){var d=n[x];if(n.hasOwnProperty(x)&&d!=null)switch(x){case"checked":break;case"value":break;case"defaultValue":c=d;default:s.hasOwnProperty(x)||ot(e,t,x,null,s,d)}}for(var f in s){var x=s[f];if(d=n[f],s.hasOwnProperty(f)&&(x!=null||d!=null))switch(f){case"type":i=x;break;case"name":r=x;break;case"checked":u=x;break;case"defaultChecked":h=x;break;case"value":o=x;break;case"defaultValue":l=x;break;case"children":case"dangerouslySetInnerHTML":if(x!=null)throw Error(ie(137,t));break;default:x!==d&&ot(e,t,f,x,s,d)}}ax(e,o,l,c,u,h,i,r);return;case"select":x=o=l=f=null;for(i in n)if(c=n[i],n.hasOwnProperty(i)&&c!=null)switch(i){case"value":break;case"multiple":x=c;default:s.hasOwnProperty(i)||ot(e,t,i,null,s,c)}for(r in s)if(i=s[r],c=n[r],s.hasOwnProperty(r)&&(i!=null||c!=null))switch(r){case"value":f=i;break;case"defaultValue":l=i;break;case"multiple":o=i;default:i!==c&&ot(e,t,r,i,s,c)}t=l,n=o,s=x,f!=null?eo(e,!!n,f,!1):!!s!=!!n&&(t!=null?eo(e,!!n,t,!0):eo(e,!!n,n?[]:"",!1));return;case"textarea":x=f=null;for(l in n)if(r=n[l],n.hasOwnProperty(l)&&r!=null&&!s.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:ot(e,t,l,null,s,r)}for(o in s)if(r=s[o],i=n[o],s.hasOwnProperty(o)&&(r!=null||i!=null))switch(o){case"value":f=r;break;case"defaultValue":x=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(ie(91));break;default:r!==i&&ot(e,t,o,r,s,i)}c1(e,f,x);return;case"option":for(var w in n)if(f=n[w],n.hasOwnProperty(w)&&f!=null&&!s.hasOwnProperty(w))switch(w){case"selected":e.selected=!1;break;default:ot(e,t,w,null,s,f)}for(c in s)if(f=s[c],x=n[c],s.hasOwnProperty(c)&&f!==x&&(f!=null||x!=null))switch(c){case"selected":e.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:ot(e,t,c,f,s,x)}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 v in n)f=n[v],n.hasOwnProperty(v)&&f!=null&&!s.hasOwnProperty(v)&&ot(e,t,v,null,s,f);for(u in s)if(f=s[u],x=n[u],s.hasOwnProperty(u)&&f!==x&&(f!=null||x!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(ie(137,t));break;default:ot(e,t,u,f,s,x)}return;default:if(Bg(t)){for(var N in n)f=n[N],n.hasOwnProperty(N)&&f!==void 0&&!s.hasOwnProperty(N)&&zx(e,t,N,void 0,s,f);for(h in s)f=s[h],x=n[h],!s.hasOwnProperty(h)||f===x||f===void 0&&x===void 0||zx(e,t,h,f,s,x);return}}for(var g in n)f=n[g],n.hasOwnProperty(g)&&f!=null&&!s.hasOwnProperty(g)&&ot(e,t,g,null,s,f);for(d in s)f=s[d],x=n[d],!s.hasOwnProperty(d)||f===x||f==null&&x==null||ot(e,t,d,f,s,x)}var Rx=null,Ux=null;function Fu(e){return e.nodeType===9?e:e.ownerDocument}function Hv(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function hj(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function $x(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var um=null;function vk(){var e=window.event;return e&&e.type==="popstate"?e===um?!1:(um=e,!0):(um=null,!1)}var fj=typeof setTimeout=="function"?setTimeout:void 0,bk=typeof clearTimeout=="function"?clearTimeout:void 0,Vv=typeof Promise=="function"?Promise:void 0,yk=typeof queueMicrotask=="function"?queueMicrotask:typeof Vv<"u"?function(e){return Vv.resolve(null).then(e).catch(wk)}:fj;function wk(e){setTimeout(function(){throw e})}function wr(e){return e==="head"}function Yv(e,t){var n=t,s=0,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(0<s&&8>s){n=s;var o=e.ownerDocument;if(n&1&&Il(o.documentElement),n&2&&Il(o.body),n&4)for(n=o.head,Il(n),o=n.firstChild;o;){var l=o.nextSibling,c=o.nodeName;o[Dc]||c==="SCRIPT"||c==="STYLE"||c==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=l}}if(r===0){e.removeChild(i),lc(t);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:s=n.charCodeAt(0)-48;else s=0;n=i}while(n);lc(t)}function Lx(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Lx(n),Pg(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Nk(e,t,n,s){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Dc])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=gs(e.nextSibling),e===null)break}return null}function jk(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=gs(e.nextSibling),e===null))return null;return e}function Px(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function Sk(e,t){var n=e.ownerDocument;if(e.data!=="$?"||n.readyState==="complete")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function gs(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var Bx=null;function Fv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}function mj(e,t,n){switch(t=Fu(n),e){case"html":if(e=t.documentElement,!e)throw Error(ie(452));return e;case"head":if(e=t.head,!e)throw Error(ie(453));return e;case"body":if(e=t.body,!e)throw Error(ie(454));return e;default:throw Error(ie(451))}}function Il(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pg(e)}var os=new Map,Iv=new Set;function Iu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Sa=tt.d;tt.d={f:Ck,r:Ek,D:kk,C:Mk,L:Tk,m:Dk,X:Ak,S:_k,M:Ok};function Ck(){var e=Sa.f(),t=Ph();return e||t}function Ek(e){var t=Bo(e);t!==null&&t.tag===5&&t.type==="form"?oN(t):Sa.r(e)}var Yo=typeof document>"u"?null:document;function xj(e,t,n){var s=Yo;if(s&&typeof t=="string"&&t){var r=ss(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Iv.has(r)||(Iv.add(r),e={rel:e,crossOrigin:n,href:t},s.querySelector(r)===null&&(t=s.createElement("link"),en(t,"link",e),Wt(t),s.head.appendChild(t)))}}function kk(e){Sa.D(e),xj("dns-prefetch",e,null)}function Mk(e,t){Sa.C(e,t),xj("preconnect",e,t)}function Tk(e,t,n){Sa.L(e,t,n);var s=Yo;if(s&&e&&t){var r='link[rel="preload"][as="'+ss(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+ss(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+ss(n.imageSizes)+'"]')):r+='[href="'+ss(e)+'"]';var i=r;switch(t){case"style":i=So(e);break;case"script":i=Fo(e)}os.has(i)||(e=pt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),os.set(i,e),s.querySelector(r)!==null||t==="style"&&s.querySelector(Bc(i))||t==="script"&&s.querySelector(Hc(i))||(t=s.createElement("link"),en(t,"link",e),Wt(t),s.head.appendChild(t)))}}function Dk(e,t){Sa.m(e,t);var n=Yo;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+ss(s)+'"][href="'+ss(e)+'"]',i=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Fo(e)}if(!os.has(i)&&(e=pt({rel:"modulepreload",href:e},t),os.set(i,e),n.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Hc(i)))return}s=n.createElement("link"),en(s,"link",e),Wt(s),n.head.appendChild(s)}}}function _k(e,t,n){Sa.S(e,t,n);var s=Yo;if(s&&e){var r=Ji(s).hoistableStyles,i=So(e);t=t||"default";var o=r.get(i);if(!o){var l={loading:0,preload:null};if(o=s.querySelector(Bc(i)))l.loading=5;else{e=pt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=os.get(i))&&Np(e,n);var c=o=s.createElement("link");Wt(c),en(c,"link",e),c._p=new Promise(function(u,h){c.onload=u,c.onerror=h}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,iu(o,t,s)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(i,o)}}}function Ak(e,t){Sa.X(e,t);var n=Yo;if(n&&e){var s=Ji(n).hoistableScripts,r=Fo(e),i=s.get(r);i||(i=n.querySelector(Hc(r)),i||(e=pt({src:e,async:!0},t),(t=os.get(r))&&jp(e,t),i=n.createElement("script"),Wt(i),en(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},s.set(r,i))}}function Ok(e,t){Sa.M(e,t);var n=Yo;if(n&&e){var s=Ji(n).hoistableScripts,r=Fo(e),i=s.get(r);i||(i=n.querySelector(Hc(r)),i||(e=pt({src:e,async:!0,type:"module"},t),(t=os.get(r))&&jp(e,t),i=n.createElement("script"),Wt(i),en(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},s.set(r,i))}}function Wv(e,t,n,s){var r=(r=tr.current)?Iu(r):null;if(!r)throw Error(ie(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=So(n.href),n=Ji(r).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=So(n.href);var i=Ji(r).hoistableStyles,o=i.get(e);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,o),(i=r.querySelector(Bc(e)))&&!i._p&&(o.instance=i,o.state.loading=5),os.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},os.set(e,n),i||zk(r,e,n,o.state))),t&&s===null)throw Error(ie(528,""));return o}if(t&&s!==null)throw Error(ie(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Fo(n),n=Ji(r).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(ie(444,e))}}function So(e){return'href="'+ss(e)+'"'}function Bc(e){return'link[rel="stylesheet"]['+e+"]"}function gj(e){return pt({},e,{"data-precedence":e.precedence,precedence:null})}function zk(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),en(t,"link",n),Wt(t),e.head.appendChild(t))}function Fo(e){return'[src="'+ss(e)+'"]'}function Hc(e){return"script[async]"+e}function qv(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+ss(n.href)+'"]');if(s)return t.instance=s,Wt(s),s;var r=pt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Wt(s),en(s,"style",r),iu(s,n.precedence,e),t.instance=s;case"stylesheet":r=So(n.href);var i=e.querySelector(Bc(r));if(i)return t.state.loading|=4,t.instance=i,Wt(i),i;s=gj(n),(r=os.get(r))&&Np(s,r),i=(e.ownerDocument||e).createElement("link"),Wt(i);var o=i;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),en(i,"link",s),t.state.loading|=4,iu(i,n.precedence,e),t.instance=i;case"script":return i=Fo(n.src),(r=e.querySelector(Hc(i)))?(t.instance=r,Wt(r),r):(s=n,(r=os.get(i))&&(s=pt({},n),jp(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),Wt(r),en(r,"link",s),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(ie(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(s=t.instance,t.state.loading|=4,iu(s,n.precedence,e));return t.instance}function iu(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,i=r,o=0;o<s.length;o++){var l=s[o];if(l.dataset.precedence===t)i=l;else if(i!==r)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Np(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function jp(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ou=null;function Xv(e,t,n){if(ou===null){var s=new Map,r=ou=new Map;r.set(n,s)}else r=ou,s=r.get(n),s||(s=new Map,r.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var i=n[r];if(!(i[Dc]||i[rn]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var o=i.getAttribute(t)||"";o=e+o;var l=s.get(o);l?l.push(i):s.set(o,[i])}}return s}function Gv(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Rk(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function pj(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var ac=null;function Uk(){}function $k(e,t,n){if(ac===null)throw Error(ie(475));var s=ac;if(t.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var r=So(n.href),i=e.querySelector(Bc(r));if(i){e=i._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(s.count++,s=Wu.bind(s),e.then(s,s)),t.state.loading|=4,t.instance=i,Wt(i);return}i=e.ownerDocument||e,n=gj(n),(r=os.get(r))&&Np(n,r),i=i.createElement("link"),Wt(i);var o=i;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),en(i,"link",n),t.instance=i}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(s.count++,t=Wu.bind(s),e.addEventListener("load",t),e.addEventListener("error",t))}}function Lk(){if(ac===null)throw Error(ie(475));var e=ac;return e.stylesheets&&e.count===0&&Hx(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&Hx(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}function Wu(){if(this.count--,this.count===0){if(this.stylesheets)Hx(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var qu=null;function Hx(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,qu=new Map,t.forEach(Pk,e),qu=null,Wu.call(e))}function Pk(e,t){if(!(t.state.loading&4)){var n=qu.get(e);if(n)var s=n.get(null);else{n=new Map,qu.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<r.length;i++){var o=r[i];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),s=o)}s&&n.set(null,s)}r=t.instance,o=r.getAttribute("data-precedence"),i=n.get(o)||s,i===s&&n.set(null,r),n.set(o,r),this.count++,s=Wu.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),i?i.parentNode.insertBefore(r,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var rc={$$typeof:ra,Provider:null,Consumer:null,_currentValue:Br,_currentValue2:Br,_threadCount:0};function Bk(e,t,n,s,r,i,o,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Of(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Of(0),this.hiddenUpdates=Of(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=i,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function vj(e,t,n,s,r,i,o,l,c,u,h,d){return e=new Bk(e,t,n,o,l,c,u,d),t=1,i===!0&&(t|=24),i=On(3,null,null,t),e.current=i,i.stateNode=e,t=Qg(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:s,isDehydrated:n,cache:t},Jg(i),e}function bj(e){return e?(e=qi,e):qi}function yj(e,t,n,s,r,i){r=bj(r),s.context===null?s.context=r:s.pendingContext=r,s=nr(t),s.payload={element:n},i=i===void 0?null:i,i!==null&&(s.callback=i),n=sr(e,s,t),n!==null&&(Pn(n,e,t),$l(n,e,t))}function Zv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Sp(e,t){Zv(e,t),(e=e.alternate)&&Zv(e,t)}function wj(e){if(e.tag===13){var t=Ho(e,67108864);t!==null&&Pn(t,e,67108864),Sp(e,67108864)}}var Xu=!0;function Hk(e,t,n,s){var r=Te.T;Te.T=null;var i=tt.p;try{tt.p=2,Cp(e,t,n,s)}finally{tt.p=i,Te.T=r}}function Vk(e,t,n,s){var r=Te.T;Te.T=null;var i=tt.p;try{tt.p=8,Cp(e,t,n,s)}finally{tt.p=i,Te.T=r}}function Cp(e,t,n,s){if(Xu){var r=Vx(s);if(r===null)dm(e,t,s,Gu,n),Qv(e,s);else if(Fk(r,e,t,n,s))s.stopPropagation();else if(Qv(e,s),t&4&&-1<Yk.indexOf(e)){for(;r!==null;){var i=Bo(r);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var o=Dr(i.pendingLanes);if(o!==0){var l=i;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-$n(o);l.entanglements[1]|=c,o&=~c}qs(i),!(it&6)&&(Pu=Ps()+500,Pc(0))}}break;case 13:l=Ho(i,2),l!==null&&Pn(l,i,2),Ph(),Sp(i,2)}if(i=Vx(s),i===null&&dm(e,t,s,Gu,n),i===r)break;r=i}r!==null&&s.stopPropagation()}else dm(e,t,s,null,n)}}function Vx(e){return e=Hg(e),Ep(e)}var Gu=null;function Ep(e){if(Gu=null,e=Hi(e),e!==null){var t=Ec(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=Ww(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Gu=e,null}function Nj(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ME()){case Zw:return 2;case Qw:return 8;case ju:case TE:return 32;case Kw:return 268435456;default:return 32}default:return 32}}var Yx=!1,ir=null,or=null,lr=null,ic=new Map,oc=new Map,Xa=[],Yk="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 Qv(e,t){switch(e){case"focusin":case"focusout":ir=null;break;case"dragenter":case"dragleave":or=null;break;case"mouseover":case"mouseout":lr=null;break;case"pointerover":case"pointerout":ic.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":oc.delete(t.pointerId)}}function ul(e,t,n,s,r,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:i,targetContainers:[r]},t!==null&&(t=Bo(t),t!==null&&wj(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function Fk(e,t,n,s,r){switch(t){case"focusin":return ir=ul(ir,e,t,n,s,r),!0;case"dragenter":return or=ul(or,e,t,n,s,r),!0;case"mouseover":return lr=ul(lr,e,t,n,s,r),!0;case"pointerover":var i=r.pointerId;return ic.set(i,ul(ic.get(i)||null,e,t,n,s,r)),!0;case"gotpointercapture":return i=r.pointerId,oc.set(i,ul(oc.get(i)||null,e,t,n,s,r)),!0}return!1}function jj(e){var t=Hi(e.target);if(t!==null){var n=Ec(t);if(n!==null){if(t=n.tag,t===13){if(t=Ww(n),t!==null){e.blockedOn=t,$E(e.priority,function(){if(n.tag===13){var s=Ln();s=$g(s);var r=Ho(n,s);r!==null&&Pn(r,n,s),Sp(n,s)}});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function lu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Vx(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);ix=s,n.target.dispatchEvent(s),ix=null}else return t=Bo(n),t!==null&&wj(t),e.blockedOn=n,!1;t.shift()}return!0}function Kv(e,t,n){lu(e)&&n.delete(t)}function Ik(){Yx=!1,ir!==null&&lu(ir)&&(ir=null),or!==null&&lu(or)&&(or=null),lr!==null&&lu(lr)&&(lr=null),ic.forEach(Kv),oc.forEach(Kv)}function Sd(e,t){e.blockedOn===t&&(e.blockedOn=null,Yx||(Yx=!0,Vt.unstable_scheduleCallback(Vt.unstable_NormalPriority,Ik)))}var Cd=null;function Jv(e){Cd!==e&&(Cd=e,Vt.unstable_scheduleCallback(Vt.unstable_NormalPriority,function(){Cd===e&&(Cd=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],r=e[t+2];if(typeof s!="function"){if(Ep(s||n)===null)continue;break}var i=Bo(n);i!==null&&(e.splice(t,3),t-=3,Nx(i,{pending:!0,data:r,method:n.method,action:s},s,r))}}))}function lc(e){function t(c){return Sd(c,e)}ir!==null&&Sd(ir,e),or!==null&&Sd(or,e),lr!==null&&Sd(lr,e),ic.forEach(t),oc.forEach(t);for(var n=0;n<Xa.length;n++){var s=Xa[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Xa.length&&(n=Xa[0],n.blockedOn===null);)jj(n),n.blockedOn===null&&Xa.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var r=n[s],i=n[s+1],o=r[Nn]||null;if(typeof i=="function")o||Jv(n);else if(o){var l=null;if(i&&i.hasAttribute("formAction")){if(r=i,o=i[Nn]||null)l=o.formAction;else if(Ep(r)!==null)continue}else l=o.action;typeof l=="function"?n[s+1]=l:(n.splice(s,3),s-=3),Jv(n)}}}function kp(e){this._internalRoot=e}Yh.prototype.render=kp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ie(409));var n=t.current,s=Ln();yj(n,s,e,t,null,null)};Yh.prototype.unmount=kp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;yj(e.current,2,null,e,null,null),Ph(),t[Po]=null}};function Yh(e){this._internalRoot=e}Yh.prototype.unstable_scheduleHydration=function(e){if(e){var t=s1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Xa.length&&t!==0&&t<Xa[n].priority;n++);Xa.splice(n,0,e),n===0&&jj(e)}};var eb=Fw.version;if(eb!=="19.1.0")throw Error(ie(527,eb,"19.1.0"));tt.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ie(188)):(e=Object.keys(e).join(","),Error(ie(268,e)));return e=wE(t),e=e!==null?qw(e):null,e=e===null?null:e.stateNode,e};var Wk={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:Te,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ed=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ed.isDisabled&&Ed.supportsFiber)try{kc=Ed.inject(Wk),Un=Ed}catch{}}Eh.createRoot=function(e,t){if(!Iw(e))throw Error(ie(299));var n=!1,s="",r=vN,i=bN,o=yN,l=null;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(l=t.unstable_transitionCallbacks)),t=vj(e,1,!1,null,null,n,s,r,i,o,l,null),e[Po]=t.current,wp(e),new kp(t)};Eh.hydrateRoot=function(e,t,n){if(!Iw(e))throw Error(ie(299));var s=!1,r="",i=vN,o=bN,l=yN,c=null,u=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(c=n.unstable_transitionCallbacks),n.formState!==void 0&&(u=n.formState)),t=vj(e,1,!0,t,n??null,s,r,i,o,l,c,u),t.context=bj(null),n=t.current,s=Ln(),s=$g(s),r=nr(s),r.callback=null,sr(n,r,s),n=s,t.current.lanes=n,Tc(t,n),qs(t),e[Po]=t.current,wp(e),new Yh(t)};Eh.version="19.1.0";function Sj(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Sj)}catch(e){console.error(e)}}Sj(),$w.exports=Eh;var qk=$w.exports;const Xk=jh(qk);/**
|
|
50
|
-
* @remix-run/router v1.23.1
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/function cc(){return cc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},cc.apply(this,arguments)}var er;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(er||(er={}));const tb="popstate";function Gk(e){e===void 0&&(e={});function t(s,r){let{pathname:i,search:o,hash:l}=s.location;return Fx("",{pathname:i,search:o,hash:l},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function n(s,r){return typeof r=="string"?r:Zu(r)}return Qk(t,n,null,e)}function Rt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Mp(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Zk(){return Math.random().toString(36).substr(2,8)}function nb(e,t){return{usr:e.state,key:e.key,idx:t}}function Fx(e,t,n,s){return n===void 0&&(n=null),cc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Io(t):t,{state:n,key:t&&t.key||s||Zk()})}function Zu(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function Io(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function Qk(e,t,n,s){s===void 0&&(s={});let{window:r=document.defaultView,v5Compat:i=!1}=s,o=r.history,l=er.Pop,c=null,u=h();u==null&&(u=0,o.replaceState(cc({},o.state,{idx:u}),""));function h(){return(o.state||{idx:null}).idx}function d(){l=er.Pop;let N=h(),g=N==null?null:N-u;u=N,c&&c({action:l,location:v.location,delta:g})}function f(N,g){l=er.Push;let b=Fx(v.location,N,g);u=h()+1;let p=nb(b,u),y=v.createHref(b);try{o.pushState(p,"",y)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;r.location.assign(y)}i&&c&&c({action:l,location:v.location,delta:1})}function x(N,g){l=er.Replace;let b=Fx(v.location,N,g);u=h();let p=nb(b,u),y=v.createHref(b);o.replaceState(p,"",y),i&&c&&c({action:l,location:v.location,delta:0})}function w(N){let g=r.location.origin!=="null"?r.location.origin:r.location.href,b=typeof N=="string"?N:Zu(N);return b=b.replace(/ $/,"%20"),Rt(g,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,g)}let v={get action(){return l},get location(){return e(r,o)},listen(N){if(c)throw new Error("A history only accepts one active listener");return r.addEventListener(tb,d),c=N,()=>{r.removeEventListener(tb,d),c=null}},createHref(N){return t(r,N)},createURL:w,encodeLocation(N){let g=w(N);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:x,go(N){return o.go(N)}};return v}var sb;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(sb||(sb={}));function Kk(e,t,n){return n===void 0&&(n="/"),Jk(e,t,n)}function Jk(e,t,n,s){let r=typeof t=="string"?Io(t):t,i=Tp(r.pathname||"/",n);if(i==null)return null;let o=Cj(e);eM(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=hM(i);l=cM(o[c],u)}return l}function Cj(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let r=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(Rt(c.relativePath.startsWith(s),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(s.length));let u=cr([s,c.relativePath]),h=n.concat(c);i.children&&i.children.length>0&&(Rt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Cj(i.children,t,h,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:oM(u,i.index),routesMeta:h})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))r(i,o);else for(let c of Ej(i.path))r(i,o,c)}),t}function Ej(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,r=n.endsWith("?"),i=n.replace(/\?$/,"");if(s.length===0)return r?[i,""]:[i];let o=Ej(s.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),r&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function eM(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:lM(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const tM=/^:[\w-]+$/,nM=3,sM=2,aM=1,rM=10,iM=-2,ab=e=>e==="*";function oM(e,t){let n=e.split("/"),s=n.length;return n.some(ab)&&(s+=iM),t&&(s+=sM),n.filter(r=>!ab(r)).reduce((r,i)=>r+(tM.test(i)?nM:i===""?aM:rM),s)}function lM(e,t){return e.length===t.length&&e.slice(0,-1).every((s,r)=>s===t[r])?e[e.length-1]-t[t.length-1]:0}function cM(e,t,n){let{routesMeta:s}=e,r={},i="/",o=[];for(let l=0;l<s.length;++l){let c=s[l],u=l===s.length-1,h=i==="/"?t:t.slice(i.length)||"/",d=dM({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},h),f=c.route;if(!d)return null;Object.assign(r,d.params),o.push({params:r,pathname:cr([i,d.pathname]),pathnameBase:pM(cr([i,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(i=cr([i,d.pathnameBase]))}return o}function dM(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=uM(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let i=r[0],o=i.replace(/(.)\/+$/,"$1"),l=r.slice(1);return{params:s.reduce((u,h,d)=>{let{paramName:f,isOptional:x}=h;if(f==="*"){let v=l[d]||"";o=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const w=l[d];return x&&!w?u[f]=void 0:u[f]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function uM(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Mp(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 s=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(s.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),s]}function hM(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Mp(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Tp(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}const fM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,mM=e=>fM.test(e);function xM(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:r=""}=typeof e=="string"?Io(e):e,i;if(n)if(mM(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),Mp(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=rb(n.substring(1),"/"):i=rb(n,t)}else i=t;return{pathname:i,search:vM(s),hash:bM(r)}}function rb(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function hm(e,t,n,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function gM(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function kj(e,t){let n=gM(e);return t?n.map((s,r)=>r===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function Mj(e,t,n,s){s===void 0&&(s=!1);let r;typeof e=="string"?r=Io(e):(r=cc({},e),Rt(!r.pathname||!r.pathname.includes("?"),hm("?","pathname","search",r)),Rt(!r.pathname||!r.pathname.includes("#"),hm("#","pathname","hash",r)),Rt(!r.search||!r.search.includes("#"),hm("#","search","hash",r)));let i=e===""||r.pathname==="",o=i?"/":r.pathname,l;if(o==null)l=n;else{let d=t.length-1;if(!s&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;r.pathname=f.join("/")}l=d>=0?t[d]:"/"}let c=xM(r,l),u=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||h)&&(c.pathname+="/"),c}const cr=e=>e.join("/").replace(/\/\/+/g,"/"),pM=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),vM=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,bM=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function yM(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Tj=["post","put","patch","delete"];new Set(Tj);const wM=["get",...Tj];new Set(wM);/**
|
|
59
|
-
* React Router v6.30.2
|
|
60
|
-
*
|
|
61
|
-
* Copyright (c) Remix Software Inc.
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the MIT license found in the
|
|
64
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
-
*
|
|
66
|
-
* @license MIT
|
|
67
|
-
*/function dc(){return dc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},dc.apply(this,arguments)}const Dp=m.createContext(null),NM=m.createContext(null),vi=m.createContext(null),Fh=m.createContext(null),Nr=m.createContext({outlet:null,matches:[],isDataRoute:!1}),Dj=m.createContext(null);function jM(e,t){let{relative:n}=t===void 0?{}:t;Vc()||Rt(!1);let{basename:s,navigator:r}=m.useContext(vi),{hash:i,pathname:o,search:l}=Aj(e,{relative:n}),c=o;return s!=="/"&&(c=o==="/"?s:cr([s,o])),r.createHref({pathname:c,search:l,hash:i})}function Vc(){return m.useContext(Fh)!=null}function Wo(){return Vc()||Rt(!1),m.useContext(Fh).location}function _j(e){m.useContext(vi).static||m.useLayoutEffect(e)}function ws(){let{isDataRoute:e}=m.useContext(Nr);return e?UM():SM()}function SM(){Vc()||Rt(!1);let e=m.useContext(Dp),{basename:t,future:n,navigator:s}=m.useContext(vi),{matches:r}=m.useContext(Nr),{pathname:i}=Wo(),o=JSON.stringify(kj(r,n.v7_relativeSplatPath)),l=m.useRef(!1);return _j(()=>{l.current=!0}),m.useCallback(function(u,h){if(h===void 0&&(h={}),!l.current)return;if(typeof u=="number"){s.go(u);return}let d=Mj(u,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:cr([t,d.pathname])),(h.replace?s.replace:s.push)(d,h.state,h)},[t,s,o,i,e])}function _p(){let{matches:e}=m.useContext(Nr),t=e[e.length-1];return t?t.params:{}}function Aj(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=m.useContext(vi),{matches:r}=m.useContext(Nr),{pathname:i}=Wo(),o=JSON.stringify(kj(r,s.v7_relativeSplatPath));return m.useMemo(()=>Mj(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function CM(e,t){return EM(e,t)}function EM(e,t,n,s){Vc()||Rt(!1);let{navigator:r}=m.useContext(vi),{matches:i}=m.useContext(Nr),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Wo(),h;if(t){var d;let N=typeof t=="string"?Io(t):t;c==="/"||(d=N.pathname)!=null&&d.startsWith(c)||Rt(!1),h=N}else h=u;let f=h.pathname||"/",x=f;if(c!=="/"){let N=c.replace(/^\//,"").split("/");x="/"+f.replace(/^\//,"").split("/").slice(N.length).join("/")}let w=Kk(e,{pathname:x}),v=_M(w&&w.map(N=>Object.assign({},N,{params:Object.assign({},l,N.params),pathname:cr([c,r.encodeLocation?r.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?c:cr([c,r.encodeLocation?r.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),i,n,s);return t&&v?m.createElement(Fh.Provider,{value:{location:dc({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:er.Pop}},v):v}function kM(){let e=RM(),t=yM(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:r},n):null,null)}const MM=m.createElement(kM,null);class TM extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?m.createElement(Nr.Provider,{value:this.props.routeContext},m.createElement(Dj.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function DM(e){let{routeContext:t,match:n,children:s}=e,r=m.useContext(Dp);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Nr.Provider,{value:t},s)}function _M(e,t,n,s){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=s)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(r=n)==null?void 0:r.errors;if(l!=null){let h=o.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);h>=0||Rt(!1),o=o.slice(0,Math.min(o.length,h+1))}let c=!1,u=-1;if(n&&s&&s.v7_partialHydration)for(let h=0;h<o.length;h++){let d=o[h];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=h),d.route.id){let{loaderData:f,errors:x}=n,w=d.route.loader&&f[d.route.id]===void 0&&(!x||x[d.route.id]===void 0);if(d.route.lazy||w){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((h,d,f)=>{let x,w=!1,v=null,N=null;n&&(x=l&&d.route.id?l[d.route.id]:void 0,v=d.route.errorElement||MM,c&&(u<0&&f===0?($M("route-fallback"),w=!0,N=null):u===f&&(w=!0,N=d.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,f+1)),b=()=>{let p;return x?p=v:w?p=N:d.route.Component?p=m.createElement(d.route.Component,null):d.route.element?p=d.route.element:p=h,m.createElement(DM,{match:d,routeContext:{outlet:h,matches:g,isDataRoute:n!=null},children:p})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?m.createElement(TM,{location:n.location,revalidation:n.revalidation,component:v,error:x,children:b(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):b()},null)}var Oj=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Oj||{}),zj=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(zj||{});function AM(e){let t=m.useContext(Dp);return t||Rt(!1),t}function OM(e){let t=m.useContext(NM);return t||Rt(!1),t}function zM(e){let t=m.useContext(Nr);return t||Rt(!1),t}function Rj(e){let t=zM(),n=t.matches[t.matches.length-1];return n.route.id||Rt(!1),n.route.id}function RM(){var e;let t=m.useContext(Dj),n=OM(),s=Rj();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function UM(){let{router:e}=AM(Oj.UseNavigateStable),t=Rj(zj.UseNavigateStable),n=m.useRef(!1);return _j(()=>{n.current=!0}),m.useCallback(function(r,i){i===void 0&&(i={}),n.current&&(typeof r=="number"?e.navigate(r):e.navigate(r,dc({fromRouteId:t},i)))},[e,t])}const ib={};function $M(e,t,n){ib[e]||(ib[e]=!0)}function LM(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function xn(e){Rt(!1)}function PM(e){let{basename:t="/",children:n=null,location:s,navigationType:r=er.Pop,navigator:i,static:o=!1,future:l}=e;Vc()&&Rt(!1);let c=t.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:c,navigator:i,static:o,future:dc({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof s=="string"&&(s=Io(s));let{pathname:h="/",search:d="",hash:f="",state:x=null,key:w="default"}=s,v=m.useMemo(()=>{let N=Tp(h,c);return N==null?null:{location:{pathname:N,search:d,hash:f,state:x,key:w},navigationType:r}},[c,h,d,f,x,w,r]);return v==null?null:m.createElement(vi.Provider,{value:u},m.createElement(Fh.Provider,{children:n,value:v}))}function BM(e){let{children:t,location:n}=e;return CM(Ix(t),n)}new Promise(()=>{});function Ix(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(s,r)=>{if(!m.isValidElement(s))return;let i=[...t,r];if(s.type===m.Fragment){n.push.apply(n,Ix(s.props.children,i));return}s.type!==xn&&Rt(!1),!s.props.index||!s.props.children||Rt(!1);let o={id:s.props.id||i.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=Ix(s.props.children,i)),n.push(o)}),n}/**
|
|
68
|
-
* React Router DOM v6.30.2
|
|
69
|
-
*
|
|
70
|
-
* Copyright (c) Remix Software Inc.
|
|
71
|
-
*
|
|
72
|
-
* This source code is licensed under the MIT license found in the
|
|
73
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
74
|
-
*
|
|
75
|
-
* @license MIT
|
|
76
|
-
*/function Wx(){return Wx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Wx.apply(this,arguments)}function HM(e,t){if(e==null)return{};var n={},s=Object.keys(e),r,i;for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}function VM(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function YM(e,t){return e.button===0&&(!t||t==="_self")&&!VM(e)}function qx(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(r=>[n,r]):[[n,s]])},[]))}function FM(e,t){let n=qx(e);return t&&t.forEach((s,r)=>{n.has(r)||t.getAll(r).forEach(i=>{n.append(r,i)})}),n}const IM=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],WM="6";try{window.__reactRouterVersion=WM}catch{}const qM="startTransition",ob=Ch[qM];function XM(e){let{basename:t,children:n,future:s,window:r}=e,i=m.useRef();i.current==null&&(i.current=Gk({window:r,v5Compat:!0}));let o=i.current,[l,c]=m.useState({action:o.action,location:o.location}),{v7_startTransition:u}=s||{},h=m.useCallback(d=>{u&&ob?ob(()=>c(d)):c(d)},[c,u]);return m.useLayoutEffect(()=>o.listen(h),[o,h]),m.useEffect(()=>LM(s),[s]),m.createElement(PM,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:s})}const GM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ZM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ap=m.forwardRef(function(t,n){let{onClick:s,relative:r,reloadDocument:i,replace:o,state:l,target:c,to:u,preventScrollReset:h,viewTransition:d}=t,f=HM(t,IM),{basename:x}=m.useContext(vi),w,v=!1;if(typeof u=="string"&&ZM.test(u)&&(w=u,GM))try{let p=new URL(window.location.href),y=u.startsWith("//")?new URL(p.protocol+u):new URL(u),j=Tp(y.pathname,x);y.origin===p.origin&&j!=null?u=j+y.search+y.hash:v=!0}catch{}let N=jM(u,{relative:r}),g=QM(u,{replace:o,state:l,target:c,preventScrollReset:h,relative:r,viewTransition:d});function b(p){s&&s(p),p.defaultPrevented||g(p)}return m.createElement("a",Wx({},f,{href:w||N,onClick:v||i?s:b,ref:n,target:c}))});var lb;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(lb||(lb={}));var cb;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(cb||(cb={}));function QM(e,t){let{target:n,replace:s,state:r,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=ws(),u=Wo(),h=Aj(e,{relative:o});return m.useCallback(d=>{if(YM(d,n)){d.preventDefault();let f=s!==void 0?s:Zu(u)===Zu(h);c(e,{replace:f,state:r,preventScrollReset:i,relative:o,viewTransition:l})}},[u,c,h,s,r,n,e,i,o,l])}function KM(e){let t=m.useRef(qx(e)),n=m.useRef(!1),s=Wo(),r=m.useMemo(()=>FM(s.search,n.current?null:t.current),[s.search]),i=ws(),o=m.useCallback((l,c)=>{const u=qx(typeof l=="function"?l(r):l);n.current=!0,i("?"+u,c)},[i,r]);return[r,o]}function JM(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const e5=e=>{switch(e){case"success":return s5;case"info":return r5;case"warning":return a5;case"error":return i5;default:return null}},t5=Array(12).fill(0),n5=({visible:e,className:t})=>Q.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Q.createElement("div",{className:"sonner-spinner"},t5.map((n,s)=>Q.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),s5=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),a5=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Q.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),r5=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),i5=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),o5=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Q.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Q.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),l5=()=>{const[e,t]=Q.useState(document.hidden);return Q.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Xx=1;class c5{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:s,...r}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Xx++,o=this.toasts.find(c=>c.id===i),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...t,id:i,title:s}),{...c,...t,id:i,dismissible:l,title:s}):c):this.addToast({title:s,...r,dismissible:l,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(s=>s({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let s;n.loading!==void 0&&(s=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const r=Promise.resolve(t instanceof Function?t():t);let i=s!==void 0,o;const l=r.then(async u=>{if(o=["resolve",u],Q.isValidElement(u))i=!1,this.create({id:s,type:"default",message:u});else if(u5(u)&&!u.ok){i=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,w=typeof d=="object"&&!Q.isValidElement(d)?d:{message:d};this.create({id:s,type:"error",description:f,...w})}else if(u instanceof Error){i=!1;const d=typeof n.error=="function"?await n.error(u):n.error,f=typeof n.description=="function"?await n.description(u):n.description,w=typeof d=="object"&&!Q.isValidElement(d)?d:{message:d};this.create({id:s,type:"error",description:f,...w})}else if(n.success!==void 0){i=!1;const d=typeof n.success=="function"?await n.success(u):n.success,f=typeof n.description=="function"?await n.description(u):n.description,w=typeof d=="object"&&!Q.isValidElement(d)?d:{message:d};this.create({id:s,type:"success",description:f,...w})}}).catch(async u=>{if(o=["reject",u],n.error!==void 0){i=!1;const h=typeof n.error=="function"?await n.error(u):n.error,d=typeof n.description=="function"?await n.description(u):n.description,x=typeof h=="object"&&!Q.isValidElement(h)?h:{message:h};this.create({id:s,type:"error",description:d,...x})}}).finally(()=>{i&&(this.dismiss(s),s=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((u,h)=>l.then(()=>o[0]==="reject"?h(o[1]):u(o[1])).catch(h));return typeof s!="string"&&typeof s!="number"?{unwrap:c}:Object.assign(s,{unwrap:c})},this.custom=(t,n)=>{const s=(n==null?void 0:n.id)||Xx++;return this.create({jsx:t(s),id:s,...n}),s},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const bn=new c5,d5=(e,t)=>{const n=(t==null?void 0:t.id)||Xx++;return bn.addToast({title:e,...t,id:n}),n},u5=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",h5=d5,f5=()=>bn.toasts,m5=()=>bn.getActiveToasts(),Y=Object.assign(h5,{success:bn.success,info:bn.info,warning:bn.warning,error:bn.error,custom:bn.custom,message:bn.message,promise:bn.promise,dismiss:bn.dismiss,loading:bn.loading},{getHistory:f5,getToasts:m5});JM("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function kd(e){return e.label!==void 0}const x5=3,g5="24px",p5="16px",db=4e3,v5=356,b5=14,y5=45,w5=200;function ks(...e){return e.filter(Boolean).join(" ")}function N5(e){const[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}const j5=e=>{var t,n,s,r,i,o,l,c,u;const{invert:h,toast:d,unstyled:f,interacting:x,setHeights:w,visibleToasts:v,heights:N,index:g,toasts:b,expanded:p,removeToast:y,defaultRichColors:j,closeButton:S,style:C,cancelButtonStyle:T,actionButtonStyle:A,className:P="",descriptionClassName:U="",duration:O,position:V,gap:k,expandByDefault:z,classNames:M,icons:_,closeButtonAriaLabel:E="Close toast"}=e,[D,L]=Q.useState(null),[W,R]=Q.useState(null),[H,q]=Q.useState(!1),[X,ne]=Q.useState(!1),[ae,J]=Q.useState(!1),[$,te]=Q.useState(!1),[K,B]=Q.useState(!1),[G,re]=Q.useState(0),[ce,ue]=Q.useState(0),ve=Q.useRef(d.duration||O||db),ze=Q.useRef(null),_e=Q.useRef(null),Mt=g===0,St=g+1<=v,Le=d.type,De=d.dismissible!==!1,nt=d.className||"",ht=d.descriptionClassName||"",vt=Q.useMemo(()=>N.findIndex(ee=>ee.toastId===d.id)||0,[N,d.id]),Gt=Q.useMemo(()=>{var ee;return(ee=d.closeButton)!=null?ee:S},[d.closeButton,S]),Yt=Q.useMemo(()=>d.duration||O||db,[d.duration,O]),se=Q.useRef(0),fe=Q.useRef(0),Re=Q.useRef(0),I=Q.useRef(null),[le,me]=V.split("-"),he=Q.useMemo(()=>N.reduce((ee,pe,He)=>He>=vt?ee:ee+pe.height,0),[N,vt]),Ue=l5(),Ae=d.invert||h,Oe=Le==="loading";fe.current=Q.useMemo(()=>vt*k+he,[vt,he]),Q.useEffect(()=>{ve.current=Yt},[Yt]),Q.useEffect(()=>{q(!0)},[]),Q.useEffect(()=>{const ee=_e.current;if(ee){const pe=ee.getBoundingClientRect().height;return ue(pe),w(He=>[{toastId:d.id,height:pe,position:d.position},...He]),()=>w(He=>He.filter(Je=>Je.toastId!==d.id))}},[w,d.id]),Q.useLayoutEffect(()=>{if(!H)return;const ee=_e.current,pe=ee.style.height;ee.style.height="auto";const He=ee.getBoundingClientRect().height;ee.style.height=pe,ue(He),w(Je=>Je.find(qe=>qe.toastId===d.id)?Je.map(qe=>qe.toastId===d.id?{...qe,height:He}:qe):[{toastId:d.id,height:He,position:d.position},...Je])},[H,d.title,d.description,w,d.id,d.jsx,d.action,d.cancel]);const we=Q.useCallback(()=>{ne(!0),re(fe.current),w(ee=>ee.filter(pe=>pe.toastId!==d.id)),setTimeout(()=>{y(d)},w5)},[d,y,w,fe]);Q.useEffect(()=>{if(d.promise&&Le==="loading"||d.duration===1/0||d.type==="loading")return;let ee;return p||x||Ue?(()=>{if(Re.current<se.current){const Je=new Date().getTime()-se.current;ve.current=ve.current-Je}Re.current=new Date().getTime()})():(()=>{ve.current!==1/0&&(se.current=new Date().getTime(),ee=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),we()},ve.current))})(),()=>clearTimeout(ee)},[p,x,d,Le,Ue,we]),Q.useEffect(()=>{d.delete&&(we(),d.onDismiss==null||d.onDismiss.call(d,d))},[we,d.delete]);function Be(){var ee;if(_!=null&&_.loading){var pe;return Q.createElement("div",{className:ks(M==null?void 0:M.loader,d==null||(pe=d.classNames)==null?void 0:pe.loader,"sonner-loader"),"data-visible":Le==="loading"},_.loading)}return Q.createElement(n5,{className:ks(M==null?void 0:M.loader,d==null||(ee=d.classNames)==null?void 0:ee.loader),visible:Le==="loading"})}const Ce=d.icon||(_==null?void 0:_[Le])||e5(Le);var We,Z;return Q.createElement("li",{tabIndex:0,ref:_e,className:ks(P,nt,M==null?void 0:M.toast,d==null||(t=d.classNames)==null?void 0:t.toast,M==null?void 0:M.default,M==null?void 0:M[Le],d==null||(n=d.classNames)==null?void 0:n[Le]),"data-sonner-toast":"","data-rich-colors":(We=d.richColors)!=null?We:j,"data-styled":!(d.jsx||d.unstyled||f),"data-mounted":H,"data-promise":!!d.promise,"data-swiped":K,"data-removed":X,"data-visible":St,"data-y-position":le,"data-x-position":me,"data-index":g,"data-front":Mt,"data-swiping":ae,"data-dismissible":De,"data-type":Le,"data-invert":Ae,"data-swipe-out":$,"data-swipe-direction":W,"data-expanded":!!(p||z&&H),"data-testid":d.testId,style:{"--index":g,"--toasts-before":g,"--z-index":b.length-g,"--offset":`${X?G:fe.current}px`,"--initial-height":z?"auto":`${ce}px`,...C,...d.style},onDragEnd:()=>{J(!1),L(null),I.current=null},onPointerDown:ee=>{ee.button!==2&&(Oe||!De||(ze.current=new Date,re(fe.current),ee.target.setPointerCapture(ee.pointerId),ee.target.tagName!=="BUTTON"&&(J(!0),I.current={x:ee.clientX,y:ee.clientY})))},onPointerUp:()=>{var ee,pe,He;if($||!De)return;I.current=null;const Je=Number(((ee=_e.current)==null?void 0:ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Qe=Number(((pe=_e.current)==null?void 0:pe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),qe=new Date().getTime()-((He=ze.current)==null?void 0:He.getTime()),Zt=D==="x"?Je:Qe,Ss=Math.abs(Zt)/qe;if(Math.abs(Zt)>=y5||Ss>.11){re(fe.current),d.onDismiss==null||d.onDismiss.call(d,d),R(D==="x"?Je>0?"right":"left":Qe>0?"down":"up"),we(),te(!0);return}else{var cn,Qt;(cn=_e.current)==null||cn.style.setProperty("--swipe-amount-x","0px"),(Qt=_e.current)==null||Qt.style.setProperty("--swipe-amount-y","0px")}B(!1),J(!1),L(null)},onPointerMove:ee=>{var pe,He,Je;if(!I.current||!De||((pe=window.getSelection())==null?void 0:pe.toString().length)>0)return;const qe=ee.clientY-I.current.y,Zt=ee.clientX-I.current.x;var Ss;const cn=(Ss=e.swipeDirections)!=null?Ss:N5(V);!D&&(Math.abs(Zt)>1||Math.abs(qe)>1)&&L(Math.abs(Zt)>Math.abs(qe)?"x":"y");let Qt={x:0,y:0};const yi=Sn=>1/(1.5+Math.abs(Sn)/20);if(D==="y"){if(cn.includes("top")||cn.includes("bottom"))if(cn.includes("top")&&qe<0||cn.includes("bottom")&&qe>0)Qt.y=qe;else{const Sn=qe*yi(qe);Qt.y=Math.abs(Sn)<Math.abs(qe)?Sn:qe}}else if(D==="x"&&(cn.includes("left")||cn.includes("right")))if(cn.includes("left")&&Zt<0||cn.includes("right")&&Zt>0)Qt.x=Zt;else{const Sn=Zt*yi(Zt);Qt.x=Math.abs(Sn)<Math.abs(Zt)?Sn:Zt}(Math.abs(Qt.x)>0||Math.abs(Qt.y)>0)&&B(!0),(He=_e.current)==null||He.style.setProperty("--swipe-amount-x",`${Qt.x}px`),(Je=_e.current)==null||Je.style.setProperty("--swipe-amount-y",`${Qt.y}px`)}},Gt&&!d.jsx&&Le!=="loading"?Q.createElement("button",{"aria-label":E,"data-disabled":Oe,"data-close-button":!0,onClick:Oe||!De?()=>{}:()=>{we(),d.onDismiss==null||d.onDismiss.call(d,d)},className:ks(M==null?void 0:M.closeButton,d==null||(s=d.classNames)==null?void 0:s.closeButton)},(Z=_==null?void 0:_.close)!=null?Z:o5):null,(Le||d.icon||d.promise)&&d.icon!==null&&((_==null?void 0:_[Le])!==null||d.icon)?Q.createElement("div",{"data-icon":"",className:ks(M==null?void 0:M.icon,d==null||(r=d.classNames)==null?void 0:r.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Be():null,d.type!=="loading"?Ce:null):null,Q.createElement("div",{"data-content":"",className:ks(M==null?void 0:M.content,d==null||(i=d.classNames)==null?void 0:i.content)},Q.createElement("div",{"data-title":"",className:ks(M==null?void 0:M.title,d==null||(o=d.classNames)==null?void 0:o.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Q.createElement("div",{"data-description":"",className:ks(U,ht,M==null?void 0:M.description,d==null||(l=d.classNames)==null?void 0:l.description)},typeof d.description=="function"?d.description():d.description):null),Q.isValidElement(d.cancel)?d.cancel:d.cancel&&kd(d.cancel)?Q.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||T,onClick:ee=>{kd(d.cancel)&&De&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,ee),we())},className:ks(M==null?void 0:M.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,Q.isValidElement(d.action)?d.action:d.action&&kd(d.action)?Q.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||A,onClick:ee=>{kd(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,ee),!ee.defaultPrevented&&we())},className:ks(M==null?void 0:M.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function ub(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function S5(e,t){const n={};return[e,t].forEach((s,r)=>{const i=r===1,o=i?"--mobile-offset":"--offset",l=i?p5:g5;function c(u){["top","right","bottom","left"].forEach(h=>{n[`${o}-${h}`]=typeof u=="number"?`${u}px`:u})}typeof s=="number"||typeof s=="string"?c(s):typeof s=="object"?["top","right","bottom","left"].forEach(u=>{s[u]===void 0?n[`${o}-${u}`]=l:n[`${o}-${u}`]=typeof s[u]=="number"?`${s[u]}px`:s[u]}):c(l)}),n}const C5=Q.forwardRef(function(t,n){const{id:s,invert:r,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:u,offset:h,mobileOffset:d,theme:f="light",richColors:x,duration:w,style:v,visibleToasts:N=x5,toastOptions:g,dir:b=ub(),gap:p=b5,icons:y,containerAriaLabel:j="Notifications"}=t,[S,C]=Q.useState([]),T=Q.useMemo(()=>s?S.filter(H=>H.toasterId===s):S.filter(H=>!H.toasterId),[S,s]),A=Q.useMemo(()=>Array.from(new Set([i].concat(T.filter(H=>H.position).map(H=>H.position)))),[T,i]),[P,U]=Q.useState([]),[O,V]=Q.useState(!1),[k,z]=Q.useState(!1),[M,_]=Q.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),E=Q.useRef(null),D=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=Q.useRef(null),W=Q.useRef(!1),R=Q.useCallback(H=>{C(q=>{var X;return(X=q.find(ne=>ne.id===H.id))!=null&&X.delete||bn.dismiss(H.id),q.filter(({id:ne})=>ne!==H.id)})},[]);return Q.useEffect(()=>bn.subscribe(H=>{if(H.dismiss){requestAnimationFrame(()=>{C(q=>q.map(X=>X.id===H.id?{...X,delete:!0}:X))});return}setTimeout(()=>{Yw.flushSync(()=>{C(q=>{const X=q.findIndex(ne=>ne.id===H.id);return X!==-1?[...q.slice(0,X),{...q[X],...H},...q.slice(X+1)]:[H,...q]})})})}),[S]),Q.useEffect(()=>{if(f!=="system"){_(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?_("dark"):_("light")),typeof window>"u")return;const H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:q})=>{_(q?"dark":"light")})}catch{H.addListener(({matches:X})=>{try{_(X?"dark":"light")}catch(ne){console.error(ne)}})}},[f]),Q.useEffect(()=>{S.length<=1&&V(!1)},[S]),Q.useEffect(()=>{const H=q=>{var X;if(o.every(J=>q[J]||q.code===J)){var ae;V(!0),(ae=E.current)==null||ae.focus()}q.code==="Escape"&&(document.activeElement===E.current||(X=E.current)!=null&&X.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[o]),Q.useEffect(()=>{if(E.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,W.current=!1)}},[E.current]),Q.createElement("section",{ref:n,"aria-label":`${j} ${D}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((H,q)=>{var X;const[ne,ae]=H.split("-");return T.length?Q.createElement("ol",{key:H,dir:b==="auto"?ub():b,tabIndex:-1,ref:E,className:u,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":ne,"data-x-position":ae,style:{"--front-toast-height":`${((X=P[0])==null?void 0:X.height)||0}px`,"--width":`${v5}px`,"--gap":`${p}px`,...v,...S5(h,d)},onBlur:J=>{W.current&&!J.currentTarget.contains(J.relatedTarget)&&(W.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||W.current||(W.current=!0,L.current=J.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{k||V(!1)},onDragEnd:()=>V(!1),onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||z(!0)},onPointerUp:()=>z(!1)},T.filter(J=>!J.position&&q===0||J.position===H).map((J,$)=>{var te,K;return Q.createElement(j5,{key:J.id,icons:y,index:$,toast:J,defaultRichColors:x,duration:(te=g==null?void 0:g.duration)!=null?te:w,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:N,closeButton:(K=g==null?void 0:g.closeButton)!=null?K:c,interacting:k,position:H,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,closeButtonAriaLabel:g==null?void 0:g.closeButtonAriaLabel,removeToast:R,toasts:T.filter(B=>B.position==J.position),heights:P.filter(B=>B.position==J.position),setHeights:U,expandByDefault:l,gap:p,expanded:O,swipeDirections:t.swipeDirections})})):null}))});function $t(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,s;n<e.length;n++)(s=$t(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var E5={value:()=>{}};function Ih(){for(var e=0,t=arguments.length,n={},s;e<t;++e){if(!(s=arguments[e]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new cu(n)}function cu(e){this._=e}function k5(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",r=n.indexOf(".");if(r>=0&&(s=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}cu.prototype=Ih.prototype={constructor:cu,on:function(e,t){var n=this._,s=k5(e+"",n),r,i=-1,o=s.length;if(arguments.length<2){for(;++i<o;)if((r=(e=s[i]).type)&&(r=M5(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<o;)if(r=(e=s[i]).type)n[r]=hb(n[r],e.name,t);else if(t==null)for(r in n)n[r]=hb(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new cu(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),s=0,r,i;s<r;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],s=0,r=i.length;s<r;++s)i[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)}};function M5(e,t){for(var n=0,s=e.length,r;n<s;++n)if((r=e[n]).name===t)return r.value}function hb(e,t,n){for(var s=0,r=e.length;s<r;++s)if(e[s].name===t){e[s]=E5,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var Gx="http://www.w3.org/1999/xhtml";const fb={svg:"http://www.w3.org/2000/svg",xhtml:Gx,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Wh(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),fb.hasOwnProperty(t)?{space:fb[t],local:e}:e}function T5(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Gx&&t.documentElement.namespaceURI===Gx?t.createElement(e):t.createElementNS(n,e)}}function D5(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Uj(e){var t=Wh(e);return(t.local?D5:T5)(t)}function _5(){}function Op(e){return e==null?_5:function(){return this.querySelector(e)}}function A5(e){typeof e!="function"&&(e=Op(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],o=i.length,l=s[r]=new Array(o),c,u,h=0;h<o;++h)(c=i[h])&&(u=e.call(c,c.__data__,h,i))&&("__data__"in c&&(u.__data__=c.__data__),l[h]=u);return new Vn(s,this._parents)}function O5(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function z5(){return[]}function $j(e){return e==null?z5:function(){return this.querySelectorAll(e)}}function R5(e){return function(){return O5(e.apply(this,arguments))}}function U5(e){typeof e=="function"?e=R5(e):e=$j(e);for(var t=this._groups,n=t.length,s=[],r=[],i=0;i<n;++i)for(var o=t[i],l=o.length,c,u=0;u<l;++u)(c=o[u])&&(s.push(e.call(c,c.__data__,u,o)),r.push(c));return new Vn(s,r)}function Lj(e){return function(){return this.matches(e)}}function Pj(e){return function(t){return t.matches(e)}}var $5=Array.prototype.find;function L5(e){return function(){return $5.call(this.children,e)}}function P5(){return this.firstElementChild}function B5(e){return this.select(e==null?P5:L5(typeof e=="function"?e:Pj(e)))}var H5=Array.prototype.filter;function V5(){return Array.from(this.children)}function Y5(e){return function(){return H5.call(this.children,e)}}function F5(e){return this.selectAll(e==null?V5:Y5(typeof e=="function"?e:Pj(e)))}function I5(e){typeof e!="function"&&(e=Lj(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],o=i.length,l=s[r]=[],c,u=0;u<o;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&l.push(c);return new Vn(s,this._parents)}function Bj(e){return new Array(e.length)}function W5(){return new Vn(this._enter||this._groups.map(Bj),this._parents)}function Qu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Qu.prototype={constructor:Qu,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 q5(e){return function(){return e}}function X5(e,t,n,s,r,i){for(var o=0,l,c=t.length,u=i.length;o<u;++o)(l=t[o])?(l.__data__=i[o],s[o]=l):n[o]=new Qu(e,i[o]);for(;o<c;++o)(l=t[o])&&(r[o]=l)}function G5(e,t,n,s,r,i,o){var l,c,u=new Map,h=t.length,d=i.length,f=new Array(h),x;for(l=0;l<h;++l)(c=t[l])&&(f[l]=x=o.call(c,c.__data__,l,t)+"",u.has(x)?r[l]=c:u.set(x,c));for(l=0;l<d;++l)x=o.call(e,i[l],l,i)+"",(c=u.get(x))?(s[l]=c,c.__data__=i[l],u.delete(x)):n[l]=new Qu(e,i[l]);for(l=0;l<h;++l)(c=t[l])&&u.get(f[l])===c&&(r[l]=c)}function Z5(e){return e.__data__}function Q5(e,t){if(!arguments.length)return Array.from(this,Z5);var n=t?G5:X5,s=this._parents,r=this._groups;typeof e!="function"&&(e=q5(e));for(var i=r.length,o=new Array(i),l=new Array(i),c=new Array(i),u=0;u<i;++u){var h=s[u],d=r[u],f=d.length,x=K5(e.call(h,h&&h.__data__,u,s)),w=x.length,v=l[u]=new Array(w),N=o[u]=new Array(w),g=c[u]=new Array(f);n(h,d,v,N,g,x,t);for(var b=0,p=0,y,j;b<w;++b)if(y=v[b]){for(b>=p&&(p=b+1);!(j=N[p])&&++p<w;);y._next=j||null}}return o=new Vn(o,s),o._enter=l,o._exit=c,o}function K5(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function J5(){return new Vn(this._exit||this._groups.map(Bj),this._parents)}function eT(e,t,n){var s=this.enter(),r=this,i=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),s&&r?s.merge(r).order():r}function tT(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,r=n.length,i=s.length,o=Math.min(r,i),l=new Array(r),c=0;c<o;++c)for(var u=n[c],h=s[c],d=u.length,f=l[c]=new Array(d),x,w=0;w<d;++w)(x=u[w]||h[w])&&(f[w]=x);for(;c<r;++c)l[c]=n[c];return new Vn(l,this._parents)}function nT(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],r=s.length-1,i=s[r],o;--r>=0;)(o=s[r])&&(i&&o.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(o,i),i=o);return this}function sT(e){e||(e=aT);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,s=n.length,r=new Array(s),i=0;i<s;++i){for(var o=n[i],l=o.length,c=r[i]=new Array(l),u,h=0;h<l;++h)(u=o[h])&&(c[h]=u);c.sort(t)}return new Vn(r,this._parents).order()}function aT(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function rT(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function iT(){return Array.from(this)}function oT(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length;r<i;++r){var o=s[r];if(o)return o}return null}function lT(){let e=0;for(const t of this)++e;return e}function cT(){return!this.node()}function dT(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var r=t[n],i=0,o=r.length,l;i<o;++i)(l=r[i])&&e.call(l,l.__data__,i,r);return this}function uT(e){return function(){this.removeAttribute(e)}}function hT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fT(e,t){return function(){this.setAttribute(e,t)}}function mT(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function xT(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function gT(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function pT(e,t){var n=Wh(e);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((t==null?n.local?hT:uT:typeof t=="function"?n.local?gT:xT:n.local?mT:fT)(n,t))}function Hj(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function vT(e){return function(){this.style.removeProperty(e)}}function bT(e,t,n){return function(){this.style.setProperty(e,t,n)}}function yT(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function wT(e,t,n){return arguments.length>1?this.each((t==null?vT:typeof t=="function"?yT:bT)(e,t,n??"")):Co(this.node(),e)}function Co(e,t){return e.style.getPropertyValue(t)||Hj(e).getComputedStyle(e,null).getPropertyValue(t)}function NT(e){return function(){delete this[e]}}function jT(e,t){return function(){this[e]=t}}function ST(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function CT(e,t){return arguments.length>1?this.each((t==null?NT:typeof t=="function"?ST:jT)(e,t)):this.node()[e]}function Vj(e){return e.trim().split(/^|\s+/)}function zp(e){return e.classList||new Yj(e)}function Yj(e){this._node=e,this._names=Vj(e.getAttribute("class")||"")}Yj.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 Fj(e,t){for(var n=zp(e),s=-1,r=t.length;++s<r;)n.add(t[s])}function Ij(e,t){for(var n=zp(e),s=-1,r=t.length;++s<r;)n.remove(t[s])}function ET(e){return function(){Fj(this,e)}}function kT(e){return function(){Ij(this,e)}}function MT(e,t){return function(){(t.apply(this,arguments)?Fj:Ij)(this,e)}}function TT(e,t){var n=Vj(e+"");if(arguments.length<2){for(var s=zp(this.node()),r=-1,i=n.length;++r<i;)if(!s.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?MT:t?ET:kT)(n,t))}function DT(){this.textContent=""}function _T(e){return function(){this.textContent=e}}function AT(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function OT(e){return arguments.length?this.each(e==null?DT:(typeof e=="function"?AT:_T)(e)):this.node().textContent}function zT(){this.innerHTML=""}function RT(e){return function(){this.innerHTML=e}}function UT(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function $T(e){return arguments.length?this.each(e==null?zT:(typeof e=="function"?UT:RT)(e)):this.node().innerHTML}function LT(){this.nextSibling&&this.parentNode.appendChild(this)}function PT(){return this.each(LT)}function BT(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function HT(){return this.each(BT)}function VT(e){var t=typeof e=="function"?e:Uj(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function YT(){return null}function FT(e,t){var n=typeof e=="function"?e:Uj(e),s=t==null?YT:typeof t=="function"?t:Op(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function IT(){var e=this.parentNode;e&&e.removeChild(this)}function WT(){return this.each(IT)}function qT(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function XT(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function GT(e){return this.select(e?XT:qT)}function ZT(e){return arguments.length?this.property("__data__",e):this.node().__data__}function QT(e){return function(t){e.call(this,t,this.__data__)}}function KT(e){return e.trim().split(/^|\s+/).map(function(t){var n="",s=t.indexOf(".");return s>=0&&(n=t.slice(s+1),t=t.slice(0,s)),{type:t,name:n}})}function JT(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++s]=i;++s?t.length=s:delete this.__on}}}function eD(e,t,n){return function(){var s=this.__on,r,i=QT(t);if(s){for(var o=0,l=s.length;o<l;++o)if((r=s[o]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},s?s.push(r):this.__on=[r]}}function tD(e,t,n){var s=KT(e+""),r,i=s.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,h;c<u;++c)for(r=0,h=l[c];r<i;++r)if((o=s[r]).type===h.type&&o.name===h.name)return h.value}return}for(l=t?eD:JT,r=0;r<i;++r)this.each(l(s[r],t,n));return this}function Wj(e,t,n){var s=Hj(e),r=s.CustomEvent;typeof r=="function"?r=new r(t,n):(r=s.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function nD(e,t){return function(){return Wj(this,e,t)}}function sD(e,t){return function(){return Wj(this,e,t.apply(this,arguments))}}function aD(e,t){return this.each((typeof t=="function"?sD:nD)(e,t))}function*rD(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length,o;r<i;++r)(o=s[r])&&(yield o)}var qj=[null];function Vn(e,t){this._groups=e,this._parents=t}function Yc(){return new Vn([[document.documentElement]],qj)}function iD(){return this}Vn.prototype=Yc.prototype={constructor:Vn,select:A5,selectAll:U5,selectChild:B5,selectChildren:F5,filter:I5,data:Q5,enter:W5,exit:J5,join:eT,merge:tT,selection:iD,order:nT,sort:sT,call:rT,nodes:iT,node:oT,size:lT,empty:cT,each:dT,attr:pT,style:wT,property:CT,classed:TT,text:OT,html:$T,raise:PT,lower:HT,append:VT,insert:FT,remove:WT,clone:GT,datum:ZT,on:tD,dispatch:aD,[Symbol.iterator]:rD};function zn(e){return typeof e=="string"?new Vn([[document.querySelector(e)]],[document.documentElement]):new Vn([[e]],qj)}function oD(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ds(e,t){if(e=oD(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const lD={passive:!1},uc={capture:!0,passive:!1};function fm(e){e.stopImmediatePropagation()}function oo(e){e.preventDefault(),e.stopImmediatePropagation()}function Xj(e){var t=e.document.documentElement,n=zn(e).on("dragstart.drag",oo,uc);"onselectstart"in t?n.on("selectstart.drag",oo,uc):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Gj(e,t){var n=e.document.documentElement,s=zn(e).on("dragstart.drag",null);t&&(s.on("click.drag",oo,uc),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Md=e=>()=>e;function Zx(e,{sourceEvent:t,subject:n,target:s,identifier:r,active:i,x:o,y:l,dx:c,dy:u,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:h}})}Zx.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function cD(e){return!e.ctrlKey&&!e.button}function dD(){return this.parentNode}function uD(e,t){return t??{x:e.x,y:e.y}}function hD(){return navigator.maxTouchPoints||"ontouchstart"in this}function Zj(){var e=cD,t=dD,n=uD,s=hD,r={},i=Ih("start","drag","end"),o=0,l,c,u,h,d=0;function f(y){y.on("mousedown.drag",x).filter(s).on("touchstart.drag",N).on("touchmove.drag",g,lD).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(y,j){if(!(h||!e.call(this,y,j))){var S=p(this,t.call(this,y,j),y,j,"mouse");S&&(zn(y.view).on("mousemove.drag",w,uc).on("mouseup.drag",v,uc),Xj(y.view),fm(y),u=!1,l=y.clientX,c=y.clientY,S("start",y))}}function w(y){if(oo(y),!u){var j=y.clientX-l,S=y.clientY-c;u=j*j+S*S>d}r.mouse("drag",y)}function v(y){zn(y.view).on("mousemove.drag mouseup.drag",null),Gj(y.view,u),oo(y),r.mouse("end",y)}function N(y,j){if(e.call(this,y,j)){var S=y.changedTouches,C=t.call(this,y,j),T=S.length,A,P;for(A=0;A<T;++A)(P=p(this,C,y,j,S[A].identifier,S[A]))&&(fm(y),P("start",y,S[A]))}}function g(y){var j=y.changedTouches,S=j.length,C,T;for(C=0;C<S;++C)(T=r[j[C].identifier])&&(oo(y),T("drag",y,j[C]))}function b(y){var j=y.changedTouches,S=j.length,C,T;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),C=0;C<S;++C)(T=r[j[C].identifier])&&(fm(y),T("end",y,j[C]))}function p(y,j,S,C,T,A){var P=i.copy(),U=ds(A||S,j),O,V,k;if((k=n.call(y,new Zx("beforestart",{sourceEvent:S,target:f,identifier:T,active:o,x:U[0],y:U[1],dx:0,dy:0,dispatch:P}),C))!=null)return O=k.x-U[0]||0,V=k.y-U[1]||0,function z(M,_,E){var D=U,L;switch(M){case"start":r[T]=z,L=o++;break;case"end":delete r[T],--o;case"drag":U=ds(E||_,j),L=o;break}P.call(M,y,new Zx(M,{sourceEvent:_,subject:k,target:f,identifier:T,active:L,x:U[0]+O,y:U[1]+V,dx:U[0]-D[0],dy:U[1]-D[1],dispatch:P}),C)}}return f.filter=function(y){return arguments.length?(e=typeof y=="function"?y:Md(!!y),f):e},f.container=function(y){return arguments.length?(t=typeof y=="function"?y:Md(y),f):t},f.subject=function(y){return arguments.length?(n=typeof y=="function"?y:Md(y),f):n},f.touchable=function(y){return arguments.length?(s=typeof y=="function"?y:Md(!!y),f):s},f.on=function(){var y=i.on.apply(i,arguments);return y===i?f:y},f.clickDistance=function(y){return arguments.length?(d=(y=+y)*y,f):Math.sqrt(d)},f}function Rp(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Qj(e,t){var n=Object.create(e.prototype);for(var s in t)n[s]=t[s];return n}function Fc(){}var hc=.7,Ku=1/hc,lo="\\s*([+-]?\\d+)\\s*",fc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fD=/^#([0-9a-f]{3,8})$/,mD=new RegExp(`^rgb\\(${lo},${lo},${lo}\\)$`),xD=new RegExp(`^rgb\\(${Hs},${Hs},${Hs}\\)$`),gD=new RegExp(`^rgba\\(${lo},${lo},${lo},${fc}\\)$`),pD=new RegExp(`^rgba\\(${Hs},${Hs},${Hs},${fc}\\)$`),vD=new RegExp(`^hsl\\(${fc},${Hs},${Hs}\\)$`),bD=new RegExp(`^hsla\\(${fc},${Hs},${Hs},${fc}\\)$`),mb={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};Rp(Fc,si,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xb,formatHex:xb,formatHex8:yD,formatHsl:wD,formatRgb:gb,toString:gb});function xb(){return this.rgb().formatHex()}function yD(){return this.rgb().formatHex8()}function wD(){return Kj(this).formatHsl()}function gb(){return this.rgb().formatRgb()}function si(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=fD.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?pb(t):n===3?new wn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Td(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Td(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=mD.exec(e))?new wn(t[1],t[2],t[3],1):(t=xD.exec(e))?new wn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gD.exec(e))?Td(t[1],t[2],t[3],t[4]):(t=pD.exec(e))?Td(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=vD.exec(e))?yb(t[1],t[2]/100,t[3]/100,1):(t=bD.exec(e))?yb(t[1],t[2]/100,t[3]/100,t[4]):mb.hasOwnProperty(e)?pb(mb[e]):e==="transparent"?new wn(NaN,NaN,NaN,0):null}function pb(e){return new wn(e>>16&255,e>>8&255,e&255,1)}function Td(e,t,n,s){return s<=0&&(e=t=n=NaN),new wn(e,t,n,s)}function ND(e){return e instanceof Fc||(e=si(e)),e?(e=e.rgb(),new wn(e.r,e.g,e.b,e.opacity)):new wn}function Qx(e,t,n,s){return arguments.length===1?ND(e):new wn(e,t,n,s??1)}function wn(e,t,n,s){this.r=+e,this.g=+t,this.b=+n,this.opacity=+s}Rp(wn,Qx,Qj(Fc,{brighter(e){return e=e==null?Ku:Math.pow(Ku,e),new wn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?hc:Math.pow(hc,e),new wn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new wn(qr(this.r),qr(this.g),qr(this.b),Ju(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:vb,formatHex:vb,formatHex8:jD,formatRgb:bb,toString:bb}));function vb(){return`#${$r(this.r)}${$r(this.g)}${$r(this.b)}`}function jD(){return`#${$r(this.r)}${$r(this.g)}${$r(this.b)}${$r((isNaN(this.opacity)?1:this.opacity)*255)}`}function bb(){const e=Ju(this.opacity);return`${e===1?"rgb(":"rgba("}${qr(this.r)}, ${qr(this.g)}, ${qr(this.b)}${e===1?")":`, ${e})`}`}function Ju(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $r(e){return e=qr(e),(e<16?"0":"")+e.toString(16)}function yb(e,t,n,s){return s<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new us(e,t,n,s)}function Kj(e){if(e instanceof us)return new us(e.h,e.s,e.l,e.opacity);if(e instanceof Fc||(e=si(e)),!e)return new us;if(e instanceof us)return e;e=e.rgb();var t=e.r/255,n=e.g/255,s=e.b/255,r=Math.min(t,n,s),i=Math.max(t,n,s),o=NaN,l=i-r,c=(i+r)/2;return l?(t===i?o=(n-s)/l+(n<s)*6:n===i?o=(s-t)/l+2:o=(t-n)/l+4,l/=c<.5?i+r:2-i-r,o*=60):l=c>0&&c<1?0:o,new us(o,l,c,e.opacity)}function SD(e,t,n,s){return arguments.length===1?Kj(e):new us(e,t,n,s??1)}function us(e,t,n,s){this.h=+e,this.s=+t,this.l=+n,this.opacity=+s}Rp(us,SD,Qj(Fc,{brighter(e){return e=e==null?Ku:Math.pow(Ku,e),new us(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?hc:Math.pow(hc,e),new us(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,s=n+(n<.5?n:1-n)*t,r=2*n-s;return new wn(mm(e>=240?e-240:e+120,r,s),mm(e,r,s),mm(e<120?e+240:e-120,r,s),this.opacity)},clamp(){return new us(wb(this.h),Dd(this.s),Dd(this.l),Ju(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=Ju(this.opacity);return`${e===1?"hsl(":"hsla("}${wb(this.h)}, ${Dd(this.s)*100}%, ${Dd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function wb(e){return e=(e||0)%360,e<0?e+360:e}function Dd(e){return Math.max(0,Math.min(1,e||0))}function mm(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Up=e=>()=>e;function CD(e,t){return function(n){return e+n*t}}function ED(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(s){return Math.pow(e+s*t,n)}}function kD(e){return(e=+e)==1?Jj:function(t,n){return n-t?ED(t,n,e):Up(isNaN(t)?n:t)}}function Jj(e,t){var n=t-e;return n?CD(e,n):Up(isNaN(e)?t:e)}const eh=function e(t){var n=kD(t);function s(r,i){var o=n((r=Qx(r)).r,(i=Qx(i)).r),l=n(r.g,i.g),c=n(r.b,i.b),u=Jj(r.opacity,i.opacity);return function(h){return r.r=o(h),r.g=l(h),r.b=c(h),r.opacity=u(h),r+""}}return s.gamma=e,s}(1);function MD(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,s=t.slice(),r;return function(i){for(r=0;r<n;++r)s[r]=e[r]*(1-i)+t[r]*i;return s}}function TD(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function DD(e,t){var n=t?t.length:0,s=e?Math.min(n,e.length):0,r=new Array(s),i=new Array(n),o;for(o=0;o<s;++o)r[o]=Wl(e[o],t[o]);for(;o<n;++o)i[o]=t[o];return function(l){for(o=0;o<s;++o)i[o]=r[o](l);return i}}function _D(e,t){var n=new Date;return e=+e,t=+t,function(s){return n.setTime(e*(1-s)+t*s),n}}function As(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function AD(e,t){var n={},s={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=Wl(e[r],t[r]):s[r]=t[r];return function(i){for(r in n)s[r]=n[r](i);return s}}var Kx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xm=new RegExp(Kx.source,"g");function OD(e){return function(){return e}}function zD(e){return function(t){return e(t)+""}}function e2(e,t){var n=Kx.lastIndex=xm.lastIndex=0,s,r,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(s=Kx.exec(e))&&(r=xm.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),l[o]?l[o]+=i:l[++o]=i),(s=s[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,c.push({i:o,x:As(s,r)})),n=xm.lastIndex;return n<t.length&&(i=t.slice(n),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?zD(c[0].x):OD(t):(t=c.length,function(u){for(var h=0,d;h<t;++h)l[(d=c[h]).i]=d.x(u);return l.join("")})}function Wl(e,t){var n=typeof t,s;return t==null||n==="boolean"?Up(t):(n==="number"?As:n==="string"?(s=si(t))?(t=s,eh):e2:t instanceof si?eh:t instanceof Date?_D:TD(t)?MD:Array.isArray(t)?DD:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?AD:As)(e,t)}var Nb=180/Math.PI,Jx={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function t2(e,t,n,s,r,i){var o,l,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*s)&&(n-=e*c,s-=t*c),(l=Math.sqrt(n*n+s*s))&&(n/=l,s/=l,c/=l),e*s<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*Nb,skewX:Math.atan(c)*Nb,scaleX:o,scaleY:l}}var _d;function RD(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Jx:t2(t.a,t.b,t.c,t.d,t.e,t.f)}function UD(e){return e==null||(_d||(_d=document.createElementNS("http://www.w3.org/2000/svg","g")),_d.setAttribute("transform",e),!(e=_d.transform.baseVal.consolidate()))?Jx:(e=e.matrix,t2(e.a,e.b,e.c,e.d,e.e,e.f))}function n2(e,t,n,s){function r(u){return u.length?u.pop()+" ":""}function i(u,h,d,f,x,w){if(u!==d||h!==f){var v=x.push("translate(",null,t,null,n);w.push({i:v-4,x:As(u,d)},{i:v-2,x:As(h,f)})}else(d||f)&&x.push("translate("+d+t+f+n)}function o(u,h,d,f){u!==h?(u-h>180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(r(d)+"rotate(",null,s)-2,x:As(u,h)})):h&&d.push(r(d)+"rotate("+h+s)}function l(u,h,d,f){u!==h?f.push({i:d.push(r(d)+"skewX(",null,s)-2,x:As(u,h)}):h&&d.push(r(d)+"skewX("+h+s)}function c(u,h,d,f,x,w){if(u!==d||h!==f){var v=x.push(r(x)+"scale(",null,",",null,")");w.push({i:v-4,x:As(u,d)},{i:v-2,x:As(h,f)})}else(d!==1||f!==1)&&x.push(r(x)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=e(u),h=e(h),i(u.translateX,u.translateY,h.translateX,h.translateY,d,f),o(u.rotate,h.rotate,d,f),l(u.skewX,h.skewX,d,f),c(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(x){for(var w=-1,v=f.length,N;++w<v;)d[(N=f[w]).i]=N.x(x);return d.join("")}}}var $D=n2(RD,"px, ","px)","deg)"),LD=n2(UD,", ",")",")"),PD=1e-12;function jb(e){return((e=Math.exp(e))+1/e)/2}function BD(e){return((e=Math.exp(e))-1/e)/2}function HD(e){return((e=Math.exp(2*e))-1)/(e+1)}const du=function e(t,n,s){function r(i,o){var l=i[0],c=i[1],u=i[2],h=o[0],d=o[1],f=o[2],x=h-l,w=d-c,v=x*x+w*w,N,g;if(v<PD)g=Math.log(f/u)/t,N=function(C){return[l+C*x,c+C*w,u*Math.exp(t*C*g)]};else{var b=Math.sqrt(v),p=(f*f-u*u+s*v)/(2*u*n*b),y=(f*f-u*u-s*v)/(2*f*n*b),j=Math.log(Math.sqrt(p*p+1)-p),S=Math.log(Math.sqrt(y*y+1)-y);g=(S-j)/t,N=function(C){var T=C*g,A=jb(j),P=u/(n*b)*(A*HD(t*T+j)-BD(j));return[l+P*x,c+P*w,u*A/jb(t*T+j)]}}return N.duration=g*1e3*t/Math.SQRT2,N}return r.rho=function(i){var o=Math.max(.001,+i),l=o*o,c=l*l;return e(o,l,c)},r}(Math.SQRT2,2,4);var Eo=0,Ml=0,hl=0,s2=1e3,th,Tl,nh=0,ai=0,qh=0,mc=typeof performance=="object"&&performance.now?performance:Date,a2=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $p(){return ai||(a2(VD),ai=mc.now()+qh)}function VD(){ai=0}function sh(){this._call=this._time=this._next=null}sh.prototype=r2.prototype={constructor:sh,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?$p():+n)+(t==null?0:+t),!this._next&&Tl!==this&&(Tl?Tl._next=this:th=this,Tl=this),this._call=e,this._time=n,eg()},stop:function(){this._call&&(this._call=null,this._time=1/0,eg())}};function r2(e,t,n){var s=new sh;return s.restart(e,t,n),s}function YD(){$p(),++Eo;for(var e=th,t;e;)(t=ai-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Eo}function Sb(){ai=(nh=mc.now())+qh,Eo=Ml=0;try{YD()}finally{Eo=0,ID(),ai=0}}function FD(){var e=mc.now(),t=e-nh;t>s2&&(qh-=t,nh=e)}function ID(){for(var e,t=th,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:th=n);Tl=e,eg(s)}function eg(e){if(!Eo){Ml&&(Ml=clearTimeout(Ml));var t=e-ai;t>24?(e<1/0&&(Ml=setTimeout(Sb,e-mc.now()-qh)),hl&&(hl=clearInterval(hl))):(hl||(nh=mc.now(),hl=setInterval(FD,s2)),Eo=1,a2(Sb))}}function Cb(e,t,n){var s=new sh;return t=t==null?0:+t,s.restart(r=>{s.stop(),e(r+t)},t,n),s}var WD=Ih("start","end","cancel","interrupt"),qD=[],i2=0,Eb=1,tg=2,uu=3,kb=4,ng=5,hu=6;function Xh(e,t,n,s,r,i){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;XD(e,n,{name:t,index:s,group:r,on:WD,tween:qD,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:i2})}function Lp(e,t){var n=Ns(e,t);if(n.state>i2)throw new Error("too late; already scheduled");return n}function Xs(e,t){var n=Ns(e,t);if(n.state>uu)throw new Error("too late; already running");return n}function Ns(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function XD(e,t,n){var s=e.__transition,r;s[t]=n,n.timer=r2(i,0,n.time);function i(u){n.state=Eb,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var h,d,f,x;if(n.state!==Eb)return c();for(h in s)if(x=s[h],x.name===n.name){if(x.state===uu)return Cb(o);x.state===kb?(x.state=hu,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete s[h]):+h<t&&(x.state=hu,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete s[h])}if(Cb(function(){n.state===uu&&(n.state=kb,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=tg,n.on.call("start",e,e.__data__,n.index,n.group),n.state===tg){for(n.state=uu,r=new Array(f=n.tween.length),h=0,d=-1;h<f;++h)(x=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=x);r.length=d+1}}function l(u){for(var h=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=ng,1),d=-1,f=r.length;++d<f;)r[d].call(e,h);n.state===ng&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=hu,n.timer.stop(),delete s[t];for(var u in s)return;delete e.__transition}}function fu(e,t){var n=e.__transition,s,r,i=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((s=n[o]).name!==t){i=!1;continue}r=s.state>tg&&s.state<ng,s.state=hu,s.timer.stop(),s.on.call(r?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[o]}i&&delete e.__transition}}function GD(e){return this.each(function(){fu(this,e)})}function ZD(e,t){var n,s;return function(){var r=Xs(this,e),i=r.tween;if(i!==n){s=n=i;for(var o=0,l=s.length;o<l;++o)if(s[o].name===t){s=s.slice(),s.splice(o,1);break}}r.tween=s}}function QD(e,t,n){var s,r;if(typeof n!="function")throw new Error;return function(){var i=Xs(this,e),o=i.tween;if(o!==s){r=(s=o).slice();for(var l={name:t,value:n},c=0,u=r.length;c<u;++c)if(r[c].name===t){r[c]=l;break}c===u&&r.push(l)}i.tween=r}}function KD(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=Ns(this.node(),n).tween,r=0,i=s.length,o;r<i;++r)if((o=s[r]).name===e)return o.value;return null}return this.each((t==null?ZD:QD)(n,e,t))}function Pp(e,t,n){var s=e._id;return e.each(function(){var r=Xs(this,s);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Ns(r,s).value[t]}}function o2(e,t){var n;return(typeof t=="number"?As:t instanceof si?eh:(n=si(t))?(t=n,eh):e2)(e,t)}function JD(e){return function(){this.removeAttribute(e)}}function e_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function t_(e,t,n){var s,r=n+"",i;return function(){var o=this.getAttribute(e);return o===r?null:o===s?i:i=t(s=o,n)}}function n_(e,t,n){var s,r=n+"",i;return function(){var o=this.getAttributeNS(e.space,e.local);return o===r?null:o===s?i:i=t(s=o,n)}}function s_(e,t,n){var s,r,i;return function(){var o,l=n(this),c;return l==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=l+"",o===c?null:o===s&&c===r?i:(r=c,i=t(s=o,l)))}}function a_(e,t,n){var s,r,i;return function(){var o,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=l+"",o===c?null:o===s&&c===r?i:(r=c,i=t(s=o,l)))}}function r_(e,t){var n=Wh(e),s=n==="transform"?LD:o2;return this.attrTween(e,typeof t=="function"?(n.local?a_:s_)(n,s,Pp(this,"attr."+e,t)):t==null?(n.local?e_:JD)(n):(n.local?n_:t_)(n,s,t))}function i_(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function o_(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function l_(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&o_(e,i)),n}return r._value=t,r}function c_(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&i_(e,i)),n}return r._value=t,r}function d_(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var s=Wh(e);return this.tween(n,(s.local?l_:c_)(s,t))}function u_(e,t){return function(){Lp(this,e).delay=+t.apply(this,arguments)}}function h_(e,t){return t=+t,function(){Lp(this,e).delay=t}}function f_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?u_:h_)(t,e)):Ns(this.node(),t).delay}function m_(e,t){return function(){Xs(this,e).duration=+t.apply(this,arguments)}}function x_(e,t){return t=+t,function(){Xs(this,e).duration=t}}function g_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?m_:x_)(t,e)):Ns(this.node(),t).duration}function p_(e,t){if(typeof t!="function")throw new Error;return function(){Xs(this,e).ease=t}}function v_(e){var t=this._id;return arguments.length?this.each(p_(t,e)):Ns(this.node(),t).ease}function b_(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Xs(this,e).ease=n}}function y_(e){if(typeof e!="function")throw new Error;return this.each(b_(this._id,e))}function w_(e){typeof e!="function"&&(e=Lj(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],o=i.length,l=s[r]=[],c,u=0;u<o;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&l.push(c);return new wa(s,this._parents,this._name,this._id)}function N_(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,r=n.length,i=Math.min(s,r),o=new Array(s),l=0;l<i;++l)for(var c=t[l],u=n[l],h=c.length,d=o[l]=new Array(h),f,x=0;x<h;++x)(f=c[x]||u[x])&&(d[x]=f);for(;l<s;++l)o[l]=t[l];return new wa(o,this._parents,this._name,this._id)}function j_(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function S_(e,t,n){var s,r,i=j_(t)?Lp:Xs;return function(){var o=i(this,e),l=o.on;l!==s&&(r=(s=l).copy()).on(t,n),o.on=r}}function C_(e,t){var n=this._id;return arguments.length<2?Ns(this.node(),n).on.on(e):this.each(S_(n,e,t))}function E_(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function k_(){return this.on("end.remove",E_(this._id))}function M_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Op(e));for(var s=this._groups,r=s.length,i=new Array(r),o=0;o<r;++o)for(var l=s[o],c=l.length,u=i[o]=new Array(c),h,d,f=0;f<c;++f)(h=l[f])&&(d=e.call(h,h.__data__,f,l))&&("__data__"in h&&(d.__data__=h.__data__),u[f]=d,Xh(u[f],t,n,f,u,Ns(h,n)));return new wa(i,this._parents,t,n)}function T_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=$j(e));for(var s=this._groups,r=s.length,i=[],o=[],l=0;l<r;++l)for(var c=s[l],u=c.length,h,d=0;d<u;++d)if(h=c[d]){for(var f=e.call(h,h.__data__,d,c),x,w=Ns(h,n),v=0,N=f.length;v<N;++v)(x=f[v])&&Xh(x,t,n,v,f,w);i.push(f),o.push(h)}return new wa(i,o,t,n)}var D_=Yc.prototype.constructor;function __(){return new D_(this._groups,this._parents)}function A_(e,t){var n,s,r;return function(){var i=Co(this,e),o=(this.style.removeProperty(e),Co(this,e));return i===o?null:i===n&&o===s?r:r=t(n=i,s=o)}}function l2(e){return function(){this.style.removeProperty(e)}}function O_(e,t,n){var s,r=n+"",i;return function(){var o=Co(this,e);return o===r?null:o===s?i:i=t(s=o,n)}}function z_(e,t,n){var s,r,i;return function(){var o=Co(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),Co(this,e))),o===c?null:o===s&&c===r?i:(r=c,i=t(s=o,l))}}function R_(e,t){var n,s,r,i="style."+t,o="end."+i,l;return function(){var c=Xs(this,e),u=c.on,h=c.value[i]==null?l||(l=l2(t)):void 0;(u!==n||r!==h)&&(s=(n=u).copy()).on(o,r=h),c.on=s}}function U_(e,t,n){var s=(e+="")=="transform"?$D:o2;return t==null?this.styleTween(e,A_(e,s)).on("end.style."+e,l2(e)):typeof t=="function"?this.styleTween(e,z_(e,s,Pp(this,"style."+e,t))).each(R_(this._id,e)):this.styleTween(e,O_(e,s,t),n).on("end.style."+e,null)}function $_(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function L_(e,t,n){var s,r;function i(){var o=t.apply(this,arguments);return o!==r&&(s=(r=o)&&$_(e,o,n)),s}return i._value=t,i}function P_(e,t,n){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,L_(e,t,n??""))}function B_(e){return function(){this.textContent=e}}function H_(e){return function(){var t=e(this);this.textContent=t??""}}function V_(e){return this.tween("text",typeof e=="function"?H_(Pp(this,"text",e)):B_(e==null?"":e+""))}function Y_(e){return function(t){this.textContent=e.call(this,t)}}function F_(e){var t,n;function s(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Y_(r)),t}return s._value=e,s}function I_(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,F_(e))}function W_(){for(var e=this._name,t=this._id,n=c2(),s=this._groups,r=s.length,i=0;i<r;++i)for(var o=s[i],l=o.length,c,u=0;u<l;++u)if(c=o[u]){var h=Ns(c,t);Xh(c,e,n,u,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new wa(s,this._parents,e,n)}function q_(){var e,t,n=this,s=n._id,r=n.size();return new Promise(function(i,o){var l={value:o},c={value:function(){--r===0&&i()}};n.each(function(){var u=Xs(this,s),h=u.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),u.on=t}),r===0&&i()})}var X_=0;function wa(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function c2(){return++X_}var ta=Yc.prototype;wa.prototype={constructor:wa,select:M_,selectAll:T_,selectChild:ta.selectChild,selectChildren:ta.selectChildren,filter:w_,merge:N_,selection:__,transition:W_,call:ta.call,nodes:ta.nodes,node:ta.node,size:ta.size,empty:ta.empty,each:ta.each,on:C_,attr:r_,attrTween:d_,style:U_,styleTween:P_,text:V_,textTween:I_,remove:k_,tween:KD,delay:f_,duration:g_,ease:v_,easeVarying:y_,end:q_,[Symbol.iterator]:ta[Symbol.iterator]};function G_(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Z_={time:null,delay:0,duration:250,ease:G_};function Q_(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function K_(e){var t,n;e instanceof wa?(t=e._id,e=e._name):(t=c2(),(n=Z_).time=$p(),e=e==null?null:e+"");for(var s=this._groups,r=s.length,i=0;i<r;++i)for(var o=s[i],l=o.length,c,u=0;u<l;++u)(c=o[u])&&Xh(c,e,t,u,o,n||Q_(c,t));return new wa(s,this._parents,e,t)}Yc.prototype.interrupt=GD;Yc.prototype.transition=K_;const Ad=e=>()=>e;function J_(e,{sourceEvent:t,target:n,transform:s,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:r}})}function da(e,t,n){this.k=e,this.x=t,this.y=n}da.prototype={constructor:da,scale:function(e){return e===1?this:new da(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new da(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Gh=new da(1,0,0);d2.prototype=da.prototype;function d2(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Gh;return e.__zoom}function gm(e){e.stopImmediatePropagation()}function fl(e){e.preventDefault(),e.stopImmediatePropagation()}function eA(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function tA(){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 Mb(){return this.__zoom||Gh}function nA(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function sA(){return navigator.maxTouchPoints||"ontouchstart"in this}function aA(e,t,n){var s=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o))}function u2(){var e=eA,t=tA,n=aA,s=nA,r=sA,i=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=du,u=Ih("start","zoom","end"),h,d,f,x=500,w=150,v=0,N=10;function g(k){k.property("__zoom",Mb).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",P).filter(r).on("touchstart.zoom",U).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",V).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(k,z,M,_){var E=k.selection?k.selection():k;E.property("__zoom",Mb),k!==E?j(k,z,M,_):E.interrupt().each(function(){S(this,arguments).event(_).start().zoom(null,typeof z=="function"?z.apply(this,arguments):z).end()})},g.scaleBy=function(k,z,M,_){g.scaleTo(k,function(){var E=this.__zoom.k,D=typeof z=="function"?z.apply(this,arguments):z;return E*D},M,_)},g.scaleTo=function(k,z,M,_){g.transform(k,function(){var E=t.apply(this,arguments),D=this.__zoom,L=M==null?y(E):typeof M=="function"?M.apply(this,arguments):M,W=D.invert(L),R=typeof z=="function"?z.apply(this,arguments):z;return n(p(b(D,R),L,W),E,o)},M,_)},g.translateBy=function(k,z,M,_){g.transform(k,function(){return n(this.__zoom.translate(typeof z=="function"?z.apply(this,arguments):z,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),o)},null,_)},g.translateTo=function(k,z,M,_,E){g.transform(k,function(){var D=t.apply(this,arguments),L=this.__zoom,W=_==null?y(D):typeof _=="function"?_.apply(this,arguments):_;return n(Gh.translate(W[0],W[1]).scale(L.k).translate(typeof z=="function"?-z.apply(this,arguments):-z,typeof M=="function"?-M.apply(this,arguments):-M),D,o)},_,E)};function b(k,z){return z=Math.max(i[0],Math.min(i[1],z)),z===k.k?k:new da(z,k.x,k.y)}function p(k,z,M){var _=z[0]-M[0]*k.k,E=z[1]-M[1]*k.k;return _===k.x&&E===k.y?k:new da(k.k,_,E)}function y(k){return[(+k[0][0]+ +k[1][0])/2,(+k[0][1]+ +k[1][1])/2]}function j(k,z,M,_){k.on("start.zoom",function(){S(this,arguments).event(_).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(_).end()}).tween("zoom",function(){var E=this,D=arguments,L=S(E,D).event(_),W=t.apply(E,D),R=M==null?y(W):typeof M=="function"?M.apply(E,D):M,H=Math.max(W[1][0]-W[0][0],W[1][1]-W[0][1]),q=E.__zoom,X=typeof z=="function"?z.apply(E,D):z,ne=c(q.invert(R).concat(H/q.k),X.invert(R).concat(H/X.k));return function(ae){if(ae===1)ae=X;else{var J=ne(ae),$=H/J[2];ae=new da($,R[0]-J[0]*$,R[1]-J[1]*$)}L.zoom(null,ae)}})}function S(k,z,M){return!M&&k.__zooming||new C(k,z)}function C(k,z){this.that=k,this.args=z,this.active=0,this.sourceEvent=null,this.extent=t.apply(k,z),this.taps=0}C.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,z){return this.mouse&&k!=="mouse"&&(this.mouse[1]=z.invert(this.mouse[0])),this.touch0&&k!=="touch"&&(this.touch0[1]=z.invert(this.touch0[0])),this.touch1&&k!=="touch"&&(this.touch1[1]=z.invert(this.touch1[0])),this.that.__zoom=z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(k){var z=zn(this.that).datum();u.call(k,this.that,new J_(k,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:u}),z)}};function T(k,...z){if(!e.apply(this,arguments))return;var M=S(this,z).event(k),_=this.__zoom,E=Math.max(i[0],Math.min(i[1],_.k*Math.pow(2,s.apply(this,arguments)))),D=ds(k);if(M.wheel)(M.mouse[0][0]!==D[0]||M.mouse[0][1]!==D[1])&&(M.mouse[1]=_.invert(M.mouse[0]=D)),clearTimeout(M.wheel);else{if(_.k===E)return;M.mouse=[D,_.invert(D)],fu(this),M.start()}fl(k),M.wheel=setTimeout(L,w),M.zoom("mouse",n(p(b(_,E),M.mouse[0],M.mouse[1]),M.extent,o));function L(){M.wheel=null,M.end()}}function A(k,...z){if(f||!e.apply(this,arguments))return;var M=k.currentTarget,_=S(this,z,!0).event(k),E=zn(k.view).on("mousemove.zoom",R,!0).on("mouseup.zoom",H,!0),D=ds(k,M),L=k.clientX,W=k.clientY;Xj(k.view),gm(k),_.mouse=[D,this.__zoom.invert(D)],fu(this),_.start();function R(q){if(fl(q),!_.moved){var X=q.clientX-L,ne=q.clientY-W;_.moved=X*X+ne*ne>v}_.event(q).zoom("mouse",n(p(_.that.__zoom,_.mouse[0]=ds(q,M),_.mouse[1]),_.extent,o))}function H(q){E.on("mousemove.zoom mouseup.zoom",null),Gj(q.view,_.moved),fl(q),_.event(q).end()}}function P(k,...z){if(e.apply(this,arguments)){var M=this.__zoom,_=ds(k.changedTouches?k.changedTouches[0]:k,this),E=M.invert(_),D=M.k*(k.shiftKey?.5:2),L=n(p(b(M,D),_,E),t.apply(this,z),o);fl(k),l>0?zn(this).transition().duration(l).call(j,L,_,k):zn(this).call(g.transform,L,_,k)}}function U(k,...z){if(e.apply(this,arguments)){var M=k.touches,_=M.length,E=S(this,z,k.changedTouches.length===_).event(k),D,L,W,R;for(gm(k),L=0;L<_;++L)W=M[L],R=ds(W,this),R=[R,this.__zoom.invert(R),W.identifier],E.touch0?!E.touch1&&E.touch0[2]!==R[2]&&(E.touch1=R,E.taps=0):(E.touch0=R,D=!0,E.taps=1+!!h);h&&(h=clearTimeout(h)),D&&(E.taps<2&&(d=R[0],h=setTimeout(function(){h=null},x)),fu(this),E.start())}}function O(k,...z){if(this.__zooming){var M=S(this,z).event(k),_=k.changedTouches,E=_.length,D,L,W,R;for(fl(k),D=0;D<E;++D)L=_[D],W=ds(L,this),M.touch0&&M.touch0[2]===L.identifier?M.touch0[0]=W:M.touch1&&M.touch1[2]===L.identifier&&(M.touch1[0]=W);if(L=M.that.__zoom,M.touch1){var H=M.touch0[0],q=M.touch0[1],X=M.touch1[0],ne=M.touch1[1],ae=(ae=X[0]-H[0])*ae+(ae=X[1]-H[1])*ae,J=(J=ne[0]-q[0])*J+(J=ne[1]-q[1])*J;L=b(L,Math.sqrt(ae/J)),W=[(H[0]+X[0])/2,(H[1]+X[1])/2],R=[(q[0]+ne[0])/2,(q[1]+ne[1])/2]}else if(M.touch0)W=M.touch0[0],R=M.touch0[1];else return;M.zoom("touch",n(p(L,W,R),M.extent,o))}}function V(k,...z){if(this.__zooming){var M=S(this,z).event(k),_=k.changedTouches,E=_.length,D,L;for(gm(k),f&&clearTimeout(f),f=setTimeout(function(){f=null},x),D=0;D<E;++D)L=_[D],M.touch0&&M.touch0[2]===L.identifier?delete M.touch0:M.touch1&&M.touch1[2]===L.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&&(L=ds(L,this),Math.hypot(d[0]-L[0],d[1]-L[1])<N)){var W=zn(this).on("dblclick.zoom");W&&W.apply(this,arguments)}}}return g.wheelDelta=function(k){return arguments.length?(s=typeof k=="function"?k:Ad(+k),g):s},g.filter=function(k){return arguments.length?(e=typeof k=="function"?k:Ad(!!k),g):e},g.touchable=function(k){return arguments.length?(r=typeof k=="function"?k:Ad(!!k),g):r},g.extent=function(k){return arguments.length?(t=typeof k=="function"?k:Ad([[+k[0][0],+k[0][1]],[+k[1][0],+k[1][1]]]),g):t},g.scaleExtent=function(k){return arguments.length?(i[0]=+k[0],i[1]=+k[1],g):[i[0],i[1]]},g.translateExtent=function(k){return arguments.length?(o[0][0]=+k[0][0],o[1][0]=+k[1][0],o[0][1]=+k[0][1],o[1][1]=+k[1][1],g):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},g.constrain=function(k){return arguments.length?(n=k,g):n},g.duration=function(k){return arguments.length?(l=+k,g):l},g.interpolate=function(k){return arguments.length?(c=k,g):c},g.on=function(){var k=u.on.apply(u,arguments);return k===u?g:k},g.clickDistance=function(k){return arguments.length?(v=(k=+k)*k,g):Math.sqrt(v)},g.tapDistance=function(k){return arguments.length?(N=+k,g):N},g}const Fs={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:s}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},xc=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],h2=["Enter"," ","Escape"],f2={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ko;(function(e){e.Strict="strict",e.Loose="loose"})(ko||(ko={}));var Xr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Xr||(Xr={}));var gc;(function(e){e.Partial="partial",e.Full="full"})(gc||(gc={}));const m2={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ga;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ga||(Ga={}));var ah;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ah||(ah={}));var Ee;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ee||(Ee={}));const Tb={[Ee.Left]:Ee.Right,[Ee.Right]:Ee.Left,[Ee.Top]:Ee.Bottom,[Ee.Bottom]:Ee.Top};function x2(e){return e===null?null:e?"valid":"invalid"}const g2=e=>"id"in e&&"source"in e&&"target"in e,rA=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Bp=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ic=(e,t=[0,0])=>{const{width:n,height:s}=Ca(e),r=e.origin??t,i=n*r[0],o=s*r[1];return{x:e.position.x-i,y:e.position.y-o}},iA=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((s,r)=>{const i=typeof r=="string";let o=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(o=i?t.nodeLookup.get(r):Bp(r)?r:t.nodeLookup.get(r.id));const l=o?rh(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Zh(s,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Qh(n)},Wc=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=Zh(n,rh(r)),s=!0)}),s?Qh(n):{x:0,y:0,width:0,height:0}},Hp=(e,t,[n,s,r]=[0,0,1],i=!1,o=!1)=>{const l={...Xc(t,[n,s,r]),width:t.width/r,height:t.height/r},c=[];for(const u of e.values()){const{measured:h,selectable:d=!0,hidden:f=!1}=u;if(o&&!d||f)continue;const x=h.width??u.width??u.initialWidth??null,w=h.height??u.height??u.initialHeight??null,v=pc(l,To(u)),N=(x??0)*(w??0),g=i&&v>0;(!u.internals.handleBounds||g||v>=N||u.dragging)&&c.push(u)}return c},oA=(e,t)=>{const n=new Set;return e.forEach(s=>{n.add(s.id)}),t.filter(s=>n.has(s.source)||n.has(s.target))};function lA(e,t){const n=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!s||s.has(r.id))&&n.set(r.id,r)}),n}async function cA({nodes:e,width:t,height:n,panZoom:s,minZoom:r,maxZoom:i},o){if(e.size===0)return Promise.resolve(!0);const l=lA(e,o),c=Wc(l),u=Vp(c,t,n,(o==null?void 0:o.minZoom)??r,(o==null?void 0:o.maxZoom)??i,(o==null?void 0:o.padding)??.1);return await s.setViewport(u,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),Promise.resolve(!0)}function p2({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:r,onError:i}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},h=o.origin??s;let d=o.extent||r;if(o.extent==="parent"&&!o.expandParent)if(!l)i==null||i("005",Fs.error005());else{const x=l.measured.width,w=l.measured.height;x&&w&&(d=[[c,u],[c+x,u+w]])}else l&&Do(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+u],[o.extent[1][0]+c,o.extent[1][1]+u]]);const f=Do(d)?ri(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(i==null||i("015",Fs.error015())),{position:{x:f.x-c+(o.measured.width??0)*h[0],y:f.y-u+(o.measured.height??0)*h[1]},positionAbsolute:f}}async function dA({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:r}){const i=new Set(e.map(f=>f.id)),o=[];for(const f of n){if(f.deletable===!1)continue;const x=i.has(f.id),w=!x&&f.parentId&&o.find(v=>v.id===f.parentId);(x||w)&&o.push(f)}const l=new Set(t.map(f=>f.id)),c=s.filter(f=>f.deletable!==!1),h=oA(o,c);for(const f of c)l.has(f.id)&&!h.find(w=>w.id===f.id)&&h.push(f);if(!r)return{edges:h,nodes:o};const d=await r({nodes:o,edges:h});return typeof d=="boolean"?d?{edges:h,nodes:o}:{edges:[],nodes:[]}:d}const Mo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ri=(e={x:0,y:0},t,n)=>({x:Mo(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Mo(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function v2(e,t,n){const{width:s,height:r}=Ca(n),{x:i,y:o}=n.internals.positionAbsolute;return ri(e,[[i,o],[i+s,o+r]],t)}const Db=(e,t,n)=>e<t?Mo(Math.abs(e-t),1,t)/t:e>n?-Mo(Math.abs(e-n),1,t)/t:0,b2=(e,t,n=15,s=40)=>{const r=Db(e.x,s,t.width-s)*n,i=Db(e.y,s,t.height-s)*n;return[r,i]},Zh=(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)}),sg=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),Qh=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),To=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=Bp(e)?e.internals.positionAbsolute:Ic(e,t);return{x:n,y:s,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},rh=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=Bp(e)?e.internals.positionAbsolute:Ic(e,t);return{x:n,y:s,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:s+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},y2=(e,t)=>Qh(Zh(sg(e),sg(t))),pc=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*s)},_b=e=>hs(e.width)&&hs(e.height)&&hs(e.x)&&hs(e.y),hs=e=>!isNaN(e)&&isFinite(e),uA=(e,t)=>{},qc=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Xc=({x:e,y:t},[n,s,r],i=!1,o=[1,1])=>{const l={x:(e-n)/r,y:(t-s)/r};return i?qc(l,o):l},ih=({x:e,y:t},[n,s,r])=>({x:e*r+n,y:t*r+s});function ki(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function hA(e,t,n){if(typeof e=="string"||typeof e=="number"){const s=ki(e,n),r=ki(e,t);return{top:s,right:r,bottom:s,left:r,x:r*2,y:s*2}}if(typeof e=="object"){const s=ki(e.top??e.y??0,n),r=ki(e.bottom??e.y??0,n),i=ki(e.left??e.x??0,t),o=ki(e.right??e.x??0,t);return{top:s,right:o,bottom:r,left:i,x:i+o,y:s+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function fA(e,t,n,s,r,i){const{x:o,y:l}=ih(e,[t,n,s]),{x:c,y:u}=ih({x:e.x+e.width,y:e.y+e.height},[t,n,s]),h=r-c,d=i-u;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(h),bottom:Math.floor(d)}}const Vp=(e,t,n,s,r,i)=>{const o=hA(i,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,u=Math.min(l,c),h=Mo(u,s,r),d=e.x+e.width/2,f=e.y+e.height/2,x=t/2-d*h,w=n/2-f*h,v=fA(e,x,w,h,t,n),N={left:Math.min(v.left-o.left,0),top:Math.min(v.top-o.top,0),right:Math.min(v.right-o.right,0),bottom:Math.min(v.bottom-o.bottom,0)};return{x:x-N.left+N.right,y:w-N.top+N.bottom,zoom:h}},vc=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Do(e){return e!=null&&e!=="parent"}function Ca(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function w2(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function N2(e,t={width:0,height:0},n,s,r){const i={...e},o=s.get(n);if(o){const l=o.origin||r;i.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function Ab(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function mA(){let e,t;return{promise:new Promise((s,r)=>{e=s,t=r}),resolve:e,reject:t}}function xA(e){return{...f2,...e||{}}}function ql(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:r}){const{x:i,y:o}=fs(e),l=Xc({x:i-((r==null?void 0:r.left)??0),y:o-((r==null?void 0:r.top)??0)},s),{x:c,y:u}=n?qc(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const Yp=e=>({width:e.offsetWidth,height:e.offsetHeight}),j2=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},gA=["INPUT","SELECT","TEXTAREA"];function S2(e){var s,r;const t=((r=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:gA.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const C2=e=>"clientX"in e,fs=(e,t)=>{var i,o;const n=C2(e),s=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,r=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},Ob=(e,t,n,s,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:r,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/s,y:(l.top-n.top)/s,...Yp(o)}})};function E2({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:r,sourceControlY:i,targetControlX:o,targetControlY:l}){const c=e*.125+r*.375+o*.375+n*.125,u=t*.125+i*.375+l*.375+s*.125,h=Math.abs(c-e),d=Math.abs(u-t);return[c,u,h,d]}function Od(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function zb({pos:e,x1:t,y1:n,x2:s,y2:r,c:i}){switch(e){case Ee.Left:return[t-Od(t-s,i),n];case Ee.Right:return[t+Od(s-t,i),n];case Ee.Top:return[t,n-Od(n-r,i)];case Ee.Bottom:return[t,n+Od(r-n,i)]}}function k2({sourceX:e,sourceY:t,sourcePosition:n=Ee.Bottom,targetX:s,targetY:r,targetPosition:i=Ee.Top,curvature:o=.25}){const[l,c]=zb({pos:n,x1:e,y1:t,x2:s,y2:r,c:o}),[u,h]=zb({pos:i,x1:s,y1:r,x2:e,y2:t,c:o}),[d,f,x,w]=E2({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:h});return[`M${e},${t} C${l},${c} ${u},${h} ${s},${r}`,d,f,x,w]}function M2({sourceX:e,sourceY:t,targetX:n,targetY:s}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,o=Math.abs(s-t)/2,l=s<t?s+o:s-o;return[i,l,r,o]}function pA({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s,elevateOnSelect:r=!1}){if(s!==void 0)return s;const i=r&&n?1e3:0,o=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return i+o}function vA({sourceNode:e,targetNode:t,width:n,height:s,transform:r}){const i=Zh(rh(e),rh(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const o={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:s/r[2]};return pc(o,Qh(i))>0}const bA=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,yA=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),T2=(e,t)=>{if(!e.source||!e.target)return t;let n;return g2(e)?n={...e}:n={...e,id:bA(e)},yA(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function D2({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[r,i,o,l]=M2({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,r,i,o,l]}const Rb={[Ee.Left]:{x:-1,y:0},[Ee.Right]:{x:1,y:0},[Ee.Top]:{x:0,y:-1},[Ee.Bottom]:{x:0,y:1}},wA=({source:e,sourcePosition:t=Ee.Bottom,target:n})=>t===Ee.Left||t===Ee.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Ub=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function NA({source:e,sourcePosition:t=Ee.Bottom,target:n,targetPosition:s=Ee.Top,center:r,offset:i,stepPosition:o}){const l=Rb[t],c=Rb[s],u={x:e.x+l.x*i,y:e.y+l.y*i},h={x:n.x+c.x*i,y:n.y+c.y*i},d=wA({source:u,sourcePosition:t,target:h}),f=d.x!==0?"x":"y",x=d[f];let w=[],v,N;const g={x:0,y:0},b={x:0,y:0},[,,p,y]=M2({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*c[f]===-1){f==="x"?(v=r.x??u.x+(h.x-u.x)*o,N=r.y??(u.y+h.y)/2):(v=r.x??(u.x+h.x)/2,N=r.y??u.y+(h.y-u.y)*o);const S=[{x:v,y:u.y},{x:v,y:h.y}],C=[{x:u.x,y:N},{x:h.x,y:N}];l[f]===x?w=f==="x"?S:C:w=f==="x"?C:S}else{const S=[{x:u.x,y:h.y}],C=[{x:h.x,y:u.y}];if(f==="x"?w=l.x===x?C:S:w=l.y===x?S:C,t===s){const O=Math.abs(e[f]-n[f]);if(O<=i){const V=Math.min(i-1,i-O);l[f]===x?g[f]=(u[f]>e[f]?-1:1)*V:b[f]=(h[f]>n[f]?-1:1)*V}}if(t!==s){const O=f==="x"?"y":"x",V=l[f]===c[O],k=u[O]>h[O],z=u[O]<h[O];(l[f]===1&&(!V&&k||V&&z)||l[f]!==1&&(!V&&z||V&&k))&&(w=f==="x"?S:C)}const T={x:u.x+g.x,y:u.y+g.y},A={x:h.x+b.x,y:h.y+b.y},P=Math.max(Math.abs(T.x-w[0].x),Math.abs(A.x-w[0].x)),U=Math.max(Math.abs(T.y-w[0].y),Math.abs(A.y-w[0].y));P>=U?(v=(T.x+A.x)/2,N=w[0].y):(v=w[0].x,N=(T.y+A.y)/2)}return[[e,{x:u.x+g.x,y:u.y+g.y},...w,{x:h.x+b.x,y:h.y+b.y},n],v,N,p,y]}function jA(e,t,n,s){const r=Math.min(Ub(e,t)/2,Ub(t,n)/2,s),{x:i,y:o}=t;if(e.x===i&&i===n.x||e.y===o&&o===n.y)return`L${i} ${o}`;if(e.y===o){const u=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${i+r*u},${o}Q ${i},${o} ${i},${o+r*h}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${o+r*c}Q ${i},${o} ${i+r*l},${o}`}function ag({sourceX:e,sourceY:t,sourcePosition:n=Ee.Bottom,targetX:s,targetY:r,targetPosition:i=Ee.Top,borderRadius:o=5,centerX:l,centerY:c,offset:u=20,stepPosition:h=.5}){const[d,f,x,w,v]=NA({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:r},targetPosition:i,center:{x:l,y:c},offset:u,stepPosition:h});return[d.reduce((g,b,p)=>{let y="";return p>0&&p<d.length-1?y=jA(d[p-1],b,d[p+1],o):y=`${p===0?"M":"L"}${b.x} ${b.y}`,g+=y,g},""),f,x,w,v]}function $b(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function SA(e){var d;const{sourceNode:t,targetNode:n}=e;if(!$b(t)||!$b(n))return null;const s=t.internals.handleBounds||Lb(t.handles),r=n.internals.handleBounds||Lb(n.handles),i=Pb((s==null?void 0:s.source)??[],e.sourceHandle),o=Pb(e.connectionMode===ko.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),e.targetHandle);if(!i||!o)return(d=e.onError)==null||d.call(e,"008",Fs.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||Ee.Bottom,c=(o==null?void 0:o.position)||Ee.Top,u=bc(t,i,l),h=bc(n,o,c);return{sourceX:u.x,sourceY:u.y,targetX:h.x,targetY:h.y,sourcePosition:l,targetPosition:c}}function Lb(e){if(!e)return null;const t=[],n=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?t.push(s):s.type==="target"&&n.push(s);return{source:t,target:n}}function bc(e,t,n=Ee.Left,s=!1){const r=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:l}=t??Ca(e);if(s)return{x:r+o/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case Ee.Top:return{x:r+o/2,y:i};case Ee.Right:return{x:r+o,y:i+l/2};case Ee.Bottom:return{x:r+o/2,y:i+l};case Ee.Left:return{x:r,y:i+l/2}}}function Pb(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function rg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function CA(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:r}){const i=new Set;return e.reduce((o,l)=>([l.markerStart||s,l.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=rg(c,t);i.has(u)||(o.push({id:u,color:c.color||n,...c}),i.add(u))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const _2=1e3,EA=10,Fp={nodeOrigin:[0,0],nodeExtent:xc,elevateNodesOnSelect:!0,defaults:{}},kA={...Fp,checkEquality:!0};function Ip(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function MA(e,t,n){const s=Ip(Fp,n);for(const r of e.values())if(r.parentId)Wp(r,e,t,s);else{const i=Ic(r,s.nodeOrigin),o=Do(r.extent)?r.extent:s.nodeExtent,l=ri(i,o,Ca(r));r.internals.positionAbsolute=l}}function TA(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],s=[];for(const r of e.handles){const i={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(i):r.type==="target"&&s.push(i)}return{source:n,target:s}}function ig(e,t,n,s){var u,h;const r=Ip(kA,s);let i={i:-1},o=e.length>0;const l=new Map(t),c=r!=null&&r.elevateNodesOnSelect?_2:0;t.clear(),n.clear();for(const d of e){let f=l.get(d.id);if(r.checkEquality&&d===(f==null?void 0:f.internals.userNode))t.set(d.id,f);else{const x=Ic(d,r.nodeOrigin),w=Do(d.extent)?d.extent:r.nodeExtent,v=ri(x,w,Ca(d));f={...r.defaults,...d,measured:{width:(u=d.measured)==null?void 0:u.width,height:(h=d.measured)==null?void 0:h.height},internals:{positionAbsolute:v,handleBounds:TA(d,f),z:A2(d,c),userNode:d}},t.set(d.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(o=!1),d.parentId&&Wp(f,t,n,s,i)}return o}function DA(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Wp(e,t,n,s,r){const{elevateNodesOnSelect:i,nodeOrigin:o,nodeExtent:l}=Ip(Fp,s),c=e.parentId,u=t.get(c);if(!u){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}DA(e,n),r&&!u.parentId&&u.internals.rootParentIndex===void 0&&(u.internals.rootParentIndex=++r.i,u.internals.z=u.internals.z+r.i*EA),r&&u.internals.rootParentIndex!==void 0&&(r.i=u.internals.rootParentIndex);const h=i?_2:0,{x:d,y:f,z:x}=_A(e,u,o,l,h),{positionAbsolute:w}=e.internals,v=d!==w.x||f!==w.y;(v||x!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:d,y:f}:w,z:x}})}function A2(e,t){return(hs(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function _A(e,t,n,s,r){const{x:i,y:o}=t.internals.positionAbsolute,l=Ca(e),c=Ic(e,n),u=Do(e.extent)?ri(c,e.extent,l):c;let h=ri({x:i+u.x,y:o+u.y},s,l);e.extent==="parent"&&(h=v2(h,l,t));const d=A2(e,r),f=t.internals.z??0;return{x:h.x,y:h.y,z:f>=d?f+1:d}}function qp(e,t,n,s=[0,0]){var o;const r=[],i=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((o=i.get(l.parentId))==null?void 0:o.expandedRect)??To(c),h=y2(u,l.rect);i.set(l.parentId,{expandedRect:h,parent:c})}return i.size>0&&i.forEach(({expandedRect:l,parent:c},u)=>{var p;const h=c.internals.positionAbsolute,d=Ca(c),f=c.origin??s,x=l.x<h.x?Math.round(Math.abs(h.x-l.x)):0,w=l.y<h.y?Math.round(Math.abs(h.y-l.y)):0,v=Math.max(d.width,Math.round(l.width)),N=Math.max(d.height,Math.round(l.height)),g=(v-d.width)*f[0],b=(N-d.height)*f[1];(x>0||w>0||g||b)&&(r.push({id:u,type:"position",position:{x:c.position.x-x+g,y:c.position.y-w+b}}),(p=n.get(u))==null||p.forEach(y=>{e.some(j=>j.id===y.id)||r.push({id:y.id,type:"position",position:{x:y.position.x+x,y:y.position.y+w}})})),(d.width<l.width||d.height<l.height||x||w)&&r.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:v+(x?f[0]*x-g:0),height:N+(w?f[1]*w-b:0)}})}),r}function AA(e,t,n,s,r,i){const o=s==null?void 0:s.querySelector(".xyflow__viewport");let l=!1;if(!o)return{changes:[],updatedInternals:l};const c=[],u=window.getComputedStyle(o),{m22:h}=new window.DOMMatrixReadOnly(u.transform),d=[];for(const f of e.values()){const x=t.get(f.id);if(!x)continue;if(x.hidden){t.set(x.id,{...x,internals:{...x.internals,handleBounds:void 0}}),l=!0;continue}const w=Yp(f.nodeElement),v=x.measured.width!==w.width||x.measured.height!==w.height;if(!!(w.width&&w.height&&(v||!x.internals.handleBounds||f.force))){const g=f.nodeElement.getBoundingClientRect(),b=Do(x.extent)?x.extent:i;let{positionAbsolute:p}=x.internals;x.parentId&&x.extent==="parent"?p=v2(p,w,t.get(x.parentId)):b&&(p=ri(p,b,w));const y={...x,measured:w,internals:{...x.internals,positionAbsolute:p,handleBounds:{source:Ob("source",f.nodeElement,g,h,x.id),target:Ob("target",f.nodeElement,g,h,x.id)}}};t.set(x.id,y),x.parentId&&Wp(y,t,n,{nodeOrigin:r}),l=!0,v&&(c.push({id:x.id,type:"dimensions",dimensions:w}),x.expandParent&&x.parentId&&d.push({id:x.id,parentId:x.parentId,rect:To(y,r)}))}}if(d.length>0){const f=qp(d,t,n,r);c.push(...f)}return{changes:c,updatedInternals:l}}async function OA({delta:e,panZoom:t,transform:n,translateExtent:s,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],s),l=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(l)}function Bb(e,t,n,s,r,i){let o=r;const l=s.get(o)||new Map;s.set(o,l.set(n,t)),o=`${r}-${e}`;const c=s.get(o)||new Map;if(s.set(o,c.set(n,t)),i){o=`${r}-${e}-${i}`;const u=s.get(o)||new Map;s.set(o,u.set(n,t))}}function O2(e,t,n){e.clear(),t.clear();for(const s of n){const{source:r,target:i,sourceHandle:o=null,targetHandle:l=null}=s,c={edgeId:s.id,source:r,target:i,sourceHandle:o,targetHandle:l},u=`${r}-${o}--${i}-${l}`,h=`${i}-${l}--${r}-${o}`;Bb("source",c,h,e,r,o),Bb("target",c,u,e,i,l),t.set(s.id,s)}}function z2(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:z2(n,t):!1}function Hb(e,t,n){var r;let s=e;do{if((r=s==null?void 0:s.matches)!=null&&r.call(s,t))return!0;if(s===n)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function zA(e,t,n,s){const r=new Map;for(const[i,o]of e)if((o.selected||o.id===s)&&(!o.parentId||!z2(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(i);l&&r.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return r}function pm({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){var o,l,c;const r=[];for(const[u,h]of t){const d=(o=n.get(u))==null?void 0:o.internals.userNode;d&&r.push({...d,position:h.position,dragging:s})}if(!e)return[r[0],r];const i=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((c=t.get(e))==null?void 0:c.position)||i.position,dragging:s}:r[0],r]}function RA({dragItems:e,snapGrid:t,x:n,y:s}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:s-r.distance.y},o=qc(i,t);return{x:o.x-i.x,y:o.y-i.y}}function UA({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:r}){let i={x:null,y:null},o=0,l=new Map,c=!1,u={x:0,y:0},h=null,d=!1,f=null,x=!1,w=!1,v=null;function N({noDragClassName:b,handleSelector:p,domNode:y,isSelectable:j,nodeId:S,nodeClickDistance:C=0}){f=zn(y);function T({x:O,y:V}){const{nodeLookup:k,nodeExtent:z,snapGrid:M,snapToGrid:_,nodeOrigin:E,onNodeDrag:D,onSelectionDrag:L,onError:W,updateNodePositions:R}=t();i={x:O,y:V};let H=!1;const q=l.size>1,X=q&&z?sg(Wc(l)):null,ne=q&&_?RA({dragItems:l,snapGrid:M,x:O,y:V}):null;for(const[ae,J]of l){if(!k.has(ae))continue;let $={x:O-J.distance.x,y:V-J.distance.y};_&&($=ne?{x:Math.round($.x+ne.x),y:Math.round($.y+ne.y)}:qc($,M));let te=null;if(q&&z&&!J.extent&&X){const{positionAbsolute:G}=J.internals,re=G.x-X.x+z[0][0],ce=G.x+J.measured.width-X.x2+z[1][0],ue=G.y-X.y+z[0][1],ve=G.y+J.measured.height-X.y2+z[1][1];te=[[re,ue],[ce,ve]]}const{position:K,positionAbsolute:B}=p2({nodeId:ae,nextPosition:$,nodeLookup:k,nodeExtent:te||z,nodeOrigin:E,onError:W});H=H||J.position.x!==K.x||J.position.y!==K.y,J.position=K,J.internals.positionAbsolute=B}if(w=w||H,!!H&&(R(l,!0),v&&(s||D||!S&&L))){const[ae,J]=pm({nodeId:S,dragItems:l,nodeLookup:k});s==null||s(v,l,ae,J),D==null||D(v,ae,J),S||L==null||L(v,J)}}async function A(){if(!h)return;const{transform:O,panBy:V,autoPanSpeed:k,autoPanOnNodeDrag:z}=t();if(!z){c=!1,cancelAnimationFrame(o);return}const[M,_]=b2(u,h,k);(M!==0||_!==0)&&(i.x=(i.x??0)-M/O[2],i.y=(i.y??0)-_/O[2],await V({x:M,y:_})&&T(i)),o=requestAnimationFrame(A)}function P(O){var q;const{nodeLookup:V,multiSelectionActive:k,nodesDraggable:z,transform:M,snapGrid:_,snapToGrid:E,selectNodesOnDrag:D,onNodeDragStart:L,onSelectionDragStart:W,unselectNodesAndEdges:R}=t();d=!0,(!D||!j)&&!k&&S&&((q=V.get(S))!=null&&q.selected||R()),j&&D&&S&&(e==null||e(S));const H=ql(O.sourceEvent,{transform:M,snapGrid:_,snapToGrid:E,containerBounds:h});if(i=H,l=zA(V,z,H,S),l.size>0&&(n||L||!S&&W)){const[X,ne]=pm({nodeId:S,dragItems:l,nodeLookup:V});n==null||n(O.sourceEvent,l,X,ne),L==null||L(O.sourceEvent,X,ne),S||W==null||W(O.sourceEvent,ne)}}const U=Zj().clickDistance(C).on("start",O=>{const{domNode:V,nodeDragThreshold:k,transform:z,snapGrid:M,snapToGrid:_}=t();h=(V==null?void 0:V.getBoundingClientRect())||null,x=!1,w=!1,v=O.sourceEvent,k===0&&P(O),i=ql(O.sourceEvent,{transform:z,snapGrid:M,snapToGrid:_,containerBounds:h}),u=fs(O.sourceEvent,h)}).on("drag",O=>{const{autoPanOnNodeDrag:V,transform:k,snapGrid:z,snapToGrid:M,nodeDragThreshold:_,nodeLookup:E}=t(),D=ql(O.sourceEvent,{transform:k,snapGrid:z,snapToGrid:M,containerBounds:h});if(v=O.sourceEvent,(O.sourceEvent.type==="touchmove"&&O.sourceEvent.touches.length>1||S&&!E.has(S))&&(x=!0),!x){if(!c&&V&&d&&(c=!0,A()),!d){const L=fs(O.sourceEvent,h),W=L.x-u.x,R=L.y-u.y;Math.sqrt(W*W+R*R)>_&&P(O)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&l&&d&&(u=fs(O.sourceEvent,h),T(D))}}).on("end",O=>{if(!(!d||x)&&(c=!1,d=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:V,updateNodePositions:k,onNodeDragStop:z,onSelectionDragStop:M}=t();if(w&&(k(l,!1),w=!1),r||z||!S&&M){const[_,E]=pm({nodeId:S,dragItems:l,nodeLookup:V,dragging:!1});r==null||r(O.sourceEvent,l,_,E),z==null||z(O.sourceEvent,_,E),S||M==null||M(O.sourceEvent,E)}}}).filter(O=>{const V=O.target;return!O.button&&(!b||!Hb(V,`.${b}`,y))&&(!p||Hb(V,p,y))});f.call(U)}function g(){f==null||f.on(".drag",null)}return{update:N,destroy:g}}function $A(e,t,n){const s=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())pc(r,To(i))>0&&s.push(i);return s}const LA=250;function PA(e,t,n,s){var l,c;let r=[],i=1/0;const o=$A(e,n,t+LA);for(const u of o){const h=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of h){if(s.nodeId===d.nodeId&&s.type===d.type&&s.id===d.id)continue;const{x:f,y:x}=bc(u,d,d.position,!0),w=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(x-e.y,2));w>t||(w<i?(r=[{...d,x:f,y:x}],i=w):w===i&&r.push({...d,x:f,y:x}))}}if(!r.length)return null;if(r.length>1){const u=s.type==="source"?"target":"source";return r.find(h=>h.type===u)??r[0]}return r[0]}function R2(e,t,n,s,r,i=!1){var u,h,d;const o=s.get(e);if(!o)return null;const l=r==="strict"?(u=o.internals.handleBounds)==null?void 0:u[t]:[...((h=o.internals.handleBounds)==null?void 0:h.source)??[],...((d=o.internals.handleBounds)==null?void 0:d.target)??[]],c=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return c&&i?{...c,...bc(o,c,c.position,!0)}:c}function U2(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function BA(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const $2=()=>!0;function HA(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:r,edgeUpdaterType:i,isTarget:o,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:h,flowId:d,panBy:f,cancelConnection:x,onConnectStart:w,onConnect:v,onConnectEnd:N,isValidConnection:g=$2,onReconnectEnd:b,updateConnection:p,getTransform:y,getFromHandle:j,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:T}){const A=j2(e.target);let P=0,U;const{x:O,y:V}=fs(e),k=U2(i,T),z=l==null?void 0:l.getBoundingClientRect();let M=!1;if(!z||!k)return;const _=R2(r,k,s,c,t);if(!_)return;let E=fs(e,z),D=!1,L=null,W=!1,R=null;function H(){if(!h||!z)return;const[K,B]=b2(E,z,S);f({x:K,y:B}),P=requestAnimationFrame(H)}const q={..._,nodeId:r,type:k,position:_.position},X=c.get(r);let ae={inProgress:!0,isValid:null,from:bc(X,q,Ee.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:X,to:E,toHandle:null,toPosition:Tb[q.position],toNode:null,pointer:E};function J(){M=!0,p(ae),w==null||w(e,{nodeId:r,handleId:s,handleType:k})}C===0&&J();function $(K){if(!M){const{x:ce,y:ue}=fs(K),ve=ce-O,ze=ue-V;if(!(ve*ve+ze*ze>C*C))return;J()}if(!j()||!q){te(K);return}const B=y();E=fs(K,z),U=PA(Xc(E,B,!1,[1,1]),n,c,q),D||(H(),D=!0);const G=L2(K,{handle:U,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:o?"target":"source",isValidConnection:g,doc:A,lib:u,flowId:d,nodeLookup:c});R=G.handleDomNode,L=G.connection,W=BA(!!U,G.isValid);const re={...ae,isValid:W,to:G.toHandle&&W?ih({x:G.toHandle.x,y:G.toHandle.y},B):E,toHandle:G.toHandle,toPosition:W&&G.toHandle?G.toHandle.position:Tb[q.position],toNode:G.toHandle?c.get(G.toHandle.nodeId):null,pointer:E};p(re),ae=re}function te(K){if(!("touches"in K&&K.touches.length>0)){if(M){(U||R)&&L&&W&&(v==null||v(L));const{inProgress:B,...G}=ae,re={...G,toPosition:ae.toHandle?ae.toPosition:null};N==null||N(K,re),i&&(b==null||b(K,re))}x(),cancelAnimationFrame(P),D=!1,W=!1,L=null,R=null,A.removeEventListener("mousemove",$),A.removeEventListener("mouseup",te),A.removeEventListener("touchmove",$),A.removeEventListener("touchend",te)}}A.addEventListener("mousemove",$),A.addEventListener("mouseup",te),A.addEventListener("touchmove",$),A.addEventListener("touchend",te)}function L2(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:i,doc:o,lib:l,flowId:c,isValidConnection:u=$2,nodeLookup:h}){const d=i==="target",f=t?o.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x,y:w}=fs(e),v=o.elementFromPoint(x,w),N=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:f,g={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const b=U2(void 0,N),p=N.getAttribute("data-nodeid"),y=N.getAttribute("data-handleid"),j=N.classList.contains("connectable"),S=N.classList.contains("connectableend");if(!p||!b)return g;const C={source:d?p:s,sourceHandle:d?y:r,target:d?s:p,targetHandle:d?r:y};g.connection=C;const A=j&&S&&(n===ko.Strict?d&&b==="source"||!d&&b==="target":p!==s||y!==r);g.isValid=A&&u(C),g.toHandle=R2(p,b,y,h,n,!0)}return g}const og={onPointerDown:HA,isValid:L2};function VA({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const r=zn(e);function i({translateExtent:l,width:c,height:u,zoomStep:h=1,pannable:d=!0,zoomable:f=!0,inversePan:x=!1}){const w=p=>{if(p.sourceEvent.type!=="wheel"||!t)return;const y=n(),j=p.sourceEvent.ctrlKey&&vc()?10:1,S=-p.sourceEvent.deltaY*(p.sourceEvent.deltaMode===1?.05:p.sourceEvent.deltaMode?1:.002)*h,C=y[2]*Math.pow(2,S*j);t.scaleTo(C)};let v=[0,0];const N=p=>{(p.sourceEvent.type==="mousedown"||p.sourceEvent.type==="touchstart")&&(v=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY])},g=p=>{const y=n();if(p.sourceEvent.type!=="mousemove"&&p.sourceEvent.type!=="touchmove"||!t)return;const j=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY],S=[j[0]-v[0],j[1]-v[1]];v=j;const C=s()*Math.max(y[2],Math.log(y[2]))*(x?-1:1),T={x:y[0]-S[0]*C,y:y[1]-S[1]*C},A=[[0,0],[c,u]];t.setViewportConstrained({x:T.x,y:T.y,zoom:y[2]},A,l)},b=u2().on("start",N).on("zoom",d?g:null).on("zoom.wheel",f?w:null);r.call(b,{})}function o(){r.on("zoom",null)}return{update:i,destroy:o,pointer:ds}}const Kh=e=>({x:e.x,y:e.y,zoom:e.k}),vm=({x:e,y:t,zoom:n})=>Gh.translate(e,t).scale(n),Qi=(e,t)=>e.target.closest(`.${t}`),P2=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),YA=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,bm=(e,t=0,n=YA,s=()=>{})=>{const r=typeof t=="number"&&t>0;return r||s(),r?e.transition().duration(t).ease(n).on("end",s):e},B2=e=>{const t=e.ctrlKey&&vc()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function FA({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return h=>{if(Qi(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(h.ctrlKey&&o){const N=ds(h),g=B2(h),b=d*Math.pow(2,g);s.scaleTo(n,b,N,h);return}const f=h.deltaMode===1?20:1;let x=r===Xr.Vertical?0:h.deltaX*f,w=r===Xr.Horizontal?0:h.deltaY*f;!vc()&&h.shiftKey&&r!==Xr.Vertical&&(x=h.deltaY*f,w=0),s.translateBy(n,-(x/d)*i,-(w/d)*i,{internal:!0});const v=Kh(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(h,v),e.panScrollTimeout=setTimeout(()=>{u==null||u(h,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(h,v))}}function IA({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,r){const i=s.type==="wheel",o=!t&&i&&!s.ctrlKey,l=Qi(s,e);if(s.ctrlKey&&i&&l&&s.preventDefault(),o||l)return null;s.preventDefault(),n.call(this,s,r)}}function WA({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var i,o,l;if((i=s.sourceEvent)!=null&&i.internal)return;const r=Kh(s.transform);e.mouseButton=((o=s.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((l=s.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(s.sourceEvent,r))}}function qA({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:r}){return i=>{var o,l;e.usedRightMouseButton=!!(n&&P2(t,e.mouseButton??0)),(o=i.sourceEvent)!=null&&o.sync||s([i.transform.x,i.transform.y,i.transform.k]),r&&!((l=i.sourceEvent)!=null&&l.internal)&&(r==null||r(i.sourceEvent,Kh(i.transform)))}}function XA({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:r,onPaneContextMenu:i}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&P2(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&i(o.sourceEvent),e.usedRightMouseButton=!1,s(!1),r)){const c=Kh(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(o.sourceEvent,c)},n?150:0)}}}function GA({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:h}){return d=>{var N;const f=e||t,x=n&&d.ctrlKey,w=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Qi(d,`${u}-flow__node`)||Qi(d,`${u}-flow__edge`)))return!0;if(!s&&!f&&!r&&!i&&!n||o||h&&!w||Qi(d,l)&&w||Qi(d,c)&&(!w||r&&w&&!e)||!n&&d.ctrlKey&&w)return!1;if(!n&&d.type==="touchstart"&&((N=d.touches)==null?void 0:N.length)>1)return d.preventDefault(),!1;if(!f&&!r&&!x&&w||!s&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(s)&&!s.includes(d.button)&&d.type==="mousedown")return!1;const v=Array.isArray(s)&&s.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||w)&&v}}function ZA({domNode:e,minZoom:t,maxZoom:n,translateExtent:s,viewport:r,onPanZoom:i,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),d=u2().scaleExtent([t,n]).translateExtent(s),f=zn(e).call(d);b({x:r.x,y:r.y,zoom:Mo(r.zoom,t,n)},[[0,0],[h.width,h.height]],s);const x=f.on("wheel.zoom"),w=f.on("dblclick.zoom");d.wheelDelta(B2);function v(U,O){return f?new Promise(V=>{d==null||d.interpolate((O==null?void 0:O.interpolate)==="linear"?Wl:du).transform(bm(f,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>V(!0)),U)}):Promise.resolve(!1)}function N({noWheelClassName:U,noPanClassName:O,onPaneContextMenu:V,userSelectionActive:k,panOnScroll:z,panOnDrag:M,panOnScrollMode:_,panOnScrollSpeed:E,preventScrolling:D,zoomOnPinch:L,zoomOnScroll:W,zoomOnDoubleClick:R,zoomActivationKeyPressed:H,lib:q,onTransformChange:X,connectionInProgress:ne,paneClickDistance:ae,selectionOnDrag:J}){k&&!u.isZoomingOrPanning&&g();const $=z&&!H&&!k;d.clickDistance(J?1/0:!hs(ae)||ae<0?0:ae);const te=$?FA({zoomPanValues:u,noWheelClassName:U,d3Selection:f,d3Zoom:d,panOnScrollMode:_,panOnScrollSpeed:E,zoomOnPinch:L,onPanZoomStart:o,onPanZoom:i,onPanZoomEnd:l}):IA({noWheelClassName:U,preventScrolling:D,d3ZoomHandler:x});if(f.on("wheel.zoom",te,{passive:!1}),!k){const B=WA({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:o});d.on("start",B);const G=qA({zoomPanValues:u,panOnDrag:M,onPaneContextMenu:!!V,onPanZoom:i,onTransformChange:X});d.on("zoom",G);const re=XA({zoomPanValues:u,panOnDrag:M,panOnScroll:z,onPaneContextMenu:V,onPanZoomEnd:l,onDraggingChange:c});d.on("end",re)}const K=GA({zoomActivationKeyPressed:H,panOnDrag:M,zoomOnScroll:W,panOnScroll:z,zoomOnDoubleClick:R,zoomOnPinch:L,userSelectionActive:k,noPanClassName:O,noWheelClassName:U,lib:q,connectionInProgress:ne});d.filter(K),R?f.on("dblclick.zoom",w):f.on("dblclick.zoom",null)}function g(){d.on("zoom",null)}async function b(U,O,V){const k=vm(U),z=d==null?void 0:d.constrain()(k,O,V);return z&&await v(z),new Promise(M=>M(z))}async function p(U,O){const V=vm(U);return await v(V,O),new Promise(k=>k(V))}function y(U){if(f){const O=vm(U),V=f.property("__zoom");(V.k!==U.zoom||V.x!==U.x||V.y!==U.y)&&(d==null||d.transform(f,O,null,{sync:!0}))}}function j(){const U=f?d2(f.node()):{x:0,y:0,k:1};return{x:U.x,y:U.y,zoom:U.k}}function S(U,O){return f?new Promise(V=>{d==null||d.interpolate((O==null?void 0:O.interpolate)==="linear"?Wl:du).scaleTo(bm(f,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>V(!0)),U)}):Promise.resolve(!1)}function C(U,O){return f?new Promise(V=>{d==null||d.interpolate((O==null?void 0:O.interpolate)==="linear"?Wl:du).scaleBy(bm(f,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>V(!0)),U)}):Promise.resolve(!1)}function T(U){d==null||d.scaleExtent(U)}function A(U){d==null||d.translateExtent(U)}function P(U){const O=!hs(U)||U<0?0:U;d==null||d.clickDistance(O)}return{update:N,destroy:g,setViewport:p,setViewportConstrained:b,getViewport:j,scaleTo:S,scaleBy:C,setScaleExtent:T,setTranslateExtent:A,syncViewport:y,setClickDistance:P}}var _o;(function(e){e.Line="line",e.Handle="handle"})(_o||(_o={}));function QA({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:r,affectsY:i}){const o=e-t,l=n-s,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&r&&(c[0]=c[0]*-1),l&&i&&(c[1]=c[1]*-1),c}function Vb(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:r}}function Oa(e,t){return Math.max(0,t-e)}function za(e,t){return Math.max(0,e-t)}function zd(e,t,n){return Math.max(0,t-e,e-n)}function Yb(e,t){return e?!t:t}function KA(e,t,n,s,r,i,o,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:h,isVertical:d}=t,f=h&&d,{xSnapped:x,ySnapped:w}=n,{minWidth:v,maxWidth:N,minHeight:g,maxHeight:b}=s,{x:p,y,width:j,height:S,aspectRatio:C}=e;let T=Math.floor(h?x-e.pointerX:0),A=Math.floor(d?w-e.pointerY:0);const P=j+(c?-T:T),U=S+(u?-A:A),O=-i[0]*j,V=-i[1]*S;let k=zd(P,v,N),z=zd(U,g,b);if(o){let E=0,D=0;c&&T<0?E=Oa(p+T+O,o[0][0]):!c&&T>0&&(E=za(p+P+O,o[1][0])),u&&A<0?D=Oa(y+A+V,o[0][1]):!u&&A>0&&(D=za(y+U+V,o[1][1])),k=Math.max(k,E),z=Math.max(z,D)}if(l){let E=0,D=0;c&&T>0?E=za(p+T,l[0][0]):!c&&T<0&&(E=Oa(p+P,l[1][0])),u&&A>0?D=za(y+A,l[0][1]):!u&&A<0&&(D=Oa(y+U,l[1][1])),k=Math.max(k,E),z=Math.max(z,D)}if(r){if(h){const E=zd(P/C,g,b)*C;if(k=Math.max(k,E),o){let D=0;!c&&!u||c&&!u&&f?D=za(y+V+P/C,o[1][1])*C:D=Oa(y+V+(c?T:-T)/C,o[0][1])*C,k=Math.max(k,D)}if(l){let D=0;!c&&!u||c&&!u&&f?D=Oa(y+P/C,l[1][1])*C:D=za(y+(c?T:-T)/C,l[0][1])*C,k=Math.max(k,D)}}if(d){const E=zd(U*C,v,N)/C;if(z=Math.max(z,E),o){let D=0;!c&&!u||u&&!c&&f?D=za(p+U*C+O,o[1][0])/C:D=Oa(p+(u?A:-A)*C+O,o[0][0])/C,z=Math.max(z,D)}if(l){let D=0;!c&&!u||u&&!c&&f?D=Oa(p+U*C,l[1][0])/C:D=za(p+(u?A:-A)*C,l[0][0])/C,z=Math.max(z,D)}}}A=A+(A<0?z:-z),T=T+(T<0?k:-k),r&&(f?P>U*C?A=(Yb(c,u)?-T:T)/C:T=(Yb(c,u)?-A:A)*C:h?(A=T/C,u=c):(T=A*C,c=u));const M=c?p+T:p,_=u?y+A:y;return{width:j+(c?-T:T),height:S+(u?-A:A),x:i[0]*T*(c?-1:1)+M,y:i[1]*A*(u?-1:1)+_}}const H2={width:0,height:0,x:0,y:0},JA={...H2,pointerX:0,pointerY:0,aspectRatio:1};function eO(e){return[[0,0],[e.measured.width,e.measured.height]]}function tO(e,t,n){const s=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,o=e.measured.height??0,l=n[0]*i,c=n[1]*o;return[[s-l,r-c],[s+i-l,r+o-c]]}function nO({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:r}){const i=zn(e);let o={controlDirection:Vb("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:h,keepAspectRatio:d,resizeDirection:f,onResizeStart:x,onResize:w,onResizeEnd:v,shouldResize:N}){let g={...H2},b={...JA};o={boundaries:h,resizeDirection:f,keepAspectRatio:d,controlDirection:Vb(u)};let p,y=null,j=[],S,C,T,A=!1;const P=Zj().on("start",U=>{const{nodeLookup:O,transform:V,snapGrid:k,snapToGrid:z,nodeOrigin:M,paneDomNode:_}=n();if(p=O.get(t),!p)return;y=(_==null?void 0:_.getBoundingClientRect())??null;const{xSnapped:E,ySnapped:D}=ql(U.sourceEvent,{transform:V,snapGrid:k,snapToGrid:z,containerBounds:y});g={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},b={...g,pointerX:E,pointerY:D,aspectRatio:g.width/g.height},S=void 0,p.parentId&&(p.extent==="parent"||p.expandParent)&&(S=O.get(p.parentId),C=S&&p.extent==="parent"?eO(S):void 0),j=[],T=void 0;for(const[L,W]of O)if(W.parentId===t&&(j.push({id:L,position:{...W.position},extent:W.extent}),W.extent==="parent"||W.expandParent)){const R=tO(W,p,W.origin??M);T?T=[[Math.min(R[0][0],T[0][0]),Math.min(R[0][1],T[0][1])],[Math.max(R[1][0],T[1][0]),Math.max(R[1][1],T[1][1])]]:T=R}x==null||x(U,{...g})}).on("drag",U=>{const{transform:O,snapGrid:V,snapToGrid:k,nodeOrigin:z}=n(),M=ql(U.sourceEvent,{transform:O,snapGrid:V,snapToGrid:k,containerBounds:y}),_=[];if(!p)return;const{x:E,y:D,width:L,height:W}=g,R={},H=p.origin??z,{width:q,height:X,x:ne,y:ae}=KA(b,o.controlDirection,M,o.boundaries,o.keepAspectRatio,H,C,T),J=q!==L,$=X!==W,te=ne!==E&&J,K=ae!==D&&$;if(!te&&!K&&!J&&!$)return;if((te||K||H[0]===1||H[1]===1)&&(R.x=te?ne:g.x,R.y=K?ae:g.y,g.x=R.x,g.y=R.y,j.length>0)){const ce=ne-E,ue=ae-D;for(const ve of j)ve.position={x:ve.position.x-ce+H[0]*(q-L),y:ve.position.y-ue+H[1]*(X-W)},_.push(ve)}if((J||$)&&(R.width=J&&(!o.resizeDirection||o.resizeDirection==="horizontal")?q:g.width,R.height=$&&(!o.resizeDirection||o.resizeDirection==="vertical")?X:g.height,g.width=R.width,g.height=R.height),S&&p.expandParent){const ce=H[0]*(R.width??0);R.x&&R.x<ce&&(g.x=ce,b.x=b.x-(R.x-ce));const ue=H[1]*(R.height??0);R.y&&R.y<ue&&(g.y=ue,b.y=b.y-(R.y-ue))}const B=QA({width:g.width,prevWidth:L,height:g.height,prevHeight:W,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),G={...g,direction:B};(N==null?void 0:N(U,G))!==!1&&(A=!0,w==null||w(U,G),s(R,_))}).on("end",U=>{A&&(v==null||v(U,{...g}),r==null||r({...g}),A=!1)});i.call(P)}function c(){i.on(".drag",null)}return{update:l,destroy:c}}var V2={exports:{}},Y2={},F2={exports:{}},I2={};/**
|
|
77
|
-
* @license React
|
|
78
|
-
* use-sync-external-store-shim.production.js
|
|
79
|
-
*
|
|
80
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
81
|
-
*
|
|
82
|
-
* This source code is licensed under the MIT license found in the
|
|
83
|
-
* LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/var Ao=m;function sO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var aO=typeof Object.is=="function"?Object.is:sO,rO=Ao.useState,iO=Ao.useEffect,oO=Ao.useLayoutEffect,lO=Ao.useDebugValue;function cO(e,t){var n=t(),s=rO({inst:{value:n,getSnapshot:t}}),r=s[0].inst,i=s[1];return oO(function(){r.value=n,r.getSnapshot=t,ym(r)&&i({inst:r})},[e,n,t]),iO(function(){return ym(r)&&i({inst:r}),e(function(){ym(r)&&i({inst:r})})},[e]),lO(n),n}function ym(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!aO(e,n)}catch{return!0}}function dO(e,t){return t()}var uO=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?dO:cO;I2.useSyncExternalStore=Ao.useSyncExternalStore!==void 0?Ao.useSyncExternalStore:uO;F2.exports=I2;var hO=F2.exports;/**
|
|
85
|
-
* @license React
|
|
86
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
87
|
-
*
|
|
88
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
89
|
-
*
|
|
90
|
-
* This source code is licensed under the MIT license found in the
|
|
91
|
-
* LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/var Jh=m,fO=hO;function mO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xO=typeof Object.is=="function"?Object.is:mO,gO=fO.useSyncExternalStore,pO=Jh.useRef,vO=Jh.useEffect,bO=Jh.useMemo,yO=Jh.useDebugValue;Y2.useSyncExternalStoreWithSelector=function(e,t,n,s,r){var i=pO(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=bO(function(){function c(x){if(!u){if(u=!0,h=x,x=s(x),r!==void 0&&o.hasValue){var w=o.value;if(r(w,x))return d=w}return d=x}if(w=d,xO(h,x))return w;var v=s(x);return r!==void 0&&r(w,v)?(h=x,w):(h=x,d=v)}var u=!1,h,d,f=n===void 0?null:n;return[function(){return c(t())},f===null?void 0:function(){return c(f())}]},[t,n,s,r]);var l=gO(e,i[0],i[1]);return vO(function(){o.hasValue=!0,o.value=l},[l]),yO(l),l};V2.exports=Y2;var wO=V2.exports;const NO=jh(wO),jO={},Fb=e=>{let t;const n=new Set,s=(h,d)=>{const f=typeof h=="function"?h(t):h;if(!Object.is(f,t)){const x=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(w=>w(t,x))}},r=()=>t,c={setState:s,getState:r,getInitialState:()=>u,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(jO?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(s,r,c);return c},SO=e=>e?Fb(e):Fb,{useDebugValue:CO}=Q,{useSyncExternalStoreWithSelector:EO}=NO,kO=e=>e;function W2(e,t=kO,n){const s=EO(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return CO(s),s}const Ib=(e,t)=>{const n=SO(e),s=(r,i=t)=>W2(n,r,i);return Object.assign(s,n),s},MO=(e,t)=>e?Ib(e,t):Ib;function kt(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[s,r]of e)if(!Object.is(r,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}const ef=m.createContext(null),TO=ef.Provider,q2=Fs.error001();function Ze(e,t){const n=m.useContext(ef);if(n===null)throw new Error(q2);return W2(n,e,t)}function jt(){const e=m.useContext(ef);if(e===null)throw new Error(q2);return m.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Wb={display:"none"},DO={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},X2="react-flow__node-desc",G2="react-flow__edge-desc",_O="react-flow__aria-live",AO=e=>e.ariaLiveMessage,OO=e=>e.ariaLabelConfig;function zO({rfId:e}){const t=Ze(AO);return a.jsx("div",{id:`${_O}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:DO,children:t})}function RO({rfId:e,disableKeyboardA11y:t}){const n=Ze(OO);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${X2}-${e}`,style:Wb,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${G2}-${e}`,style:Wb,children:n["edge.a11yDescription.default"]}),!t&&a.jsx(zO,{rfId:e})]})}const tf=m.forwardRef(({position:e="top-left",children:t,className:n,style:s,...r},i)=>{const o=`${e}`.split("-");return a.jsx("div",{className:$t(["react-flow__panel",n,...o]),style:s,ref:i,...r,children:t})});tf.displayName="Panel";function UO({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:a.jsx(tf,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:a.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const $O=e=>{const t=[],n=[];for(const[,s]of e.nodeLookup)s.selected&&t.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&n.push(s);return{selectedNodes:t,selectedEdges:n}},Rd=e=>e.id;function LO(e,t){return kt(e.selectedNodes.map(Rd),t.selectedNodes.map(Rd))&&kt(e.selectedEdges.map(Rd),t.selectedEdges.map(Rd))}function PO({onSelectionChange:e}){const t=jt(),{selectedNodes:n,selectedEdges:s}=Ze($O,LO);return m.useEffect(()=>{const r={nodes:n,edges:s};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,s,e]),null}const BO=e=>!!e.onSelectionChangeHandlers;function HO({onSelectionChange:e}){const t=Ze(BO);return e||t?a.jsx(PO,{onSelectionChange:e}):null}const Z2=[0,0],VO={x:0,y:0,zoom:1},YO=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig"],qb=[...YO,"rfId"],FO=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Xb={translateExtent:xc,nodeOrigin:Z2,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function IO(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=Ze(FO,kt),u=jt();m.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{h.current=Xb,l()}),[]);const h=m.useRef(Xb);return m.useEffect(()=>{for(const d of qb){const f=e[d],x=h.current[d];f!==x&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?s(f):d==="maxZoom"?r(f):d==="translateExtent"?i(f):d==="nodeExtent"?o(f):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:xA(f)}):d==="fitView"?u.setState({fitViewQueued:f}):d==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[d]:f})))}h.current=e},qb.map(d=>e[d])),null}function Gb(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function WO(e){var s;const[t,n]=m.useState(e==="system"?null:e);return m.useEffect(()=>{if(e!=="system"){n(e);return}const r=Gb(),i=()=>n(r!=null&&r.matches?"dark":"light");return i(),r==null||r.addEventListener("change",i),()=>{r==null||r.removeEventListener("change",i)}},[e]),t!==null?t:(s=Gb())!=null&&s.matches?"dark":"light"}const Zb=typeof document<"u"?document:null;function yc(e=null,t={target:Zb,actInsideInputWithModifier:!0}){const[n,s]=m.useState(!1),r=m.useRef(!1),i=m.useRef(new Set([])),[o,l]=m.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
|
|
93
|
-
`).replace(`
|
|
94
|
-
|
|
95
|
-
`,`
|
|
96
|
-
+`).split(`
|
|
97
|
-
`)),h=u.reduce((d,f)=>d.concat(...f),[]);return[u,h]}return[[],[]]},[e]);return m.useEffect(()=>{const c=(t==null?void 0:t.target)??Zb,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=x=>{var N,g;if(r.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!r.current||r.current&&!u)&&S2(x))return!1;const v=Kb(x.code,l);if(i.current.add(x[v]),Qb(o,i.current,!1)){const b=((g=(N=x.composedPath)==null?void 0:N.call(x))==null?void 0:g[0])||x.target,p=(b==null?void 0:b.nodeName)==="BUTTON"||(b==null?void 0:b.nodeName)==="A";t.preventDefault!==!1&&(r.current||!p)&&x.preventDefault(),s(!0)}},d=x=>{const w=Kb(x.code,l);Qb(o,i.current,!0)?(s(!1),i.current.clear()):i.current.delete(x[w]),x.key==="Meta"&&i.current.clear(),r.current=!1},f=()=>{i.current.clear(),s(!1)};return c==null||c.addEventListener("keydown",h),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{c==null||c.removeEventListener("keydown",h),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,s]),n}function Qb(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(r=>t.has(r)))}function Kb(e,t){return t.includes(e)?"code":"key"}const qO=()=>{const e=jt();return m.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,r,i],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??s,y:t.y??r,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},setCenter:async(t,n,s)=>e.getState().setCenter(t,n,s),fitBounds:async(t,n)=>{const{width:s,height:r,minZoom:i,maxZoom:o,panZoom:l}=e.getState(),c=Vp(t,s,r,i,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:s,snapGrid:r,snapToGrid:i,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},h=n.snapGrid??r,d=n.snapToGrid??i;return Xc(u,s,d,h)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:r,y:i}=s.getBoundingClientRect(),o=ih(t,n);return{x:o.x+r,y:o.y+i}}}),[])};function Q2(e,t){const n=[],s=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")s.set(i.id,[i]);else{const o=s.get(i.id);o?o.push(i):s.set(i.id,[i])}for(const i of t){const o=s.get(i.id);if(!o){n.push(i);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...i};for(const c of o)XO(c,l);n.push(l)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function XO(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function K2(e,t){return Q2(e,t)}function J2(e,t){return Q2(e,t)}function Or(e,t){return{id:e,type:"select",selected:t}}function Ki(e,t=new Set,n=!1){const s=[];for(const[r,i]of e){const o=t.has(r);!(i.selected===void 0&&!o)&&i.selected!==o&&(n&&(i.selected=o),s.push(Or(i.id,o)))}return s}function Jb({items:e=[],lookup:t}){var r;const n=[],s=new Map(e.map(i=>[i.id,i]));for(const[i,o]of e.entries()){const l=t.get(o.id),c=((r=l==null?void 0:l.internals)==null?void 0:r.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:i})}for(const[i]of t)s.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function ey(e){return{id:e.id,type:"remove"}}const ty=e=>rA(e),GO=e=>g2(e);function eS(e){return m.forwardRef(e)}const ZO=typeof window<"u"?m.useLayoutEffect:m.useEffect;function ny(e){const[t,n]=m.useState(BigInt(0)),[s]=m.useState(()=>QO(()=>n(r=>r+BigInt(1))));return ZO(()=>{const r=s.get();r.length&&(e(r),s.reset())},[t]),s}function QO(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const tS=m.createContext(null);function KO({children:e}){const t=jt(),n=m.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:h,onNodesChange:d,nodeLookup:f,fitViewQueued:x}=t.getState();let w=c;for(const N of l)w=typeof N=="function"?N(w):N;const v=Jb({items:w,lookup:f});h&&u(w),v.length>0?d==null||d(v):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:N,nodes:g,setNodes:b}=t.getState();N&&b(g)})},[]),s=ny(n),r=m.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:h,onEdgesChange:d,edgeLookup:f}=t.getState();let x=c;for(const w of l)x=typeof w=="function"?w(x):w;h?u(x):d&&d(Jb({items:x,lookup:f}))},[]),i=ny(r),o=m.useMemo(()=>({nodeQueue:s,edgeQueue:i}),[]);return a.jsx(tS.Provider,{value:o,children:e})}function JO(){const e=m.useContext(tS);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const e6=e=>!!e.panZoom;function Xp(){const e=qO(),t=jt(),n=JO(),s=Ze(e6),r=m.useMemo(()=>{const i=d=>t.getState().nodeLookup.get(d),o=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},c=d=>{var g,b;const{nodeLookup:f,nodeOrigin:x}=t.getState(),w=ty(d)?d:f.get(d.id),v=w.parentId?N2(w.position,w.measured,w.parentId,f,x):w.position,N={...w,position:v,width:((g=w.measured)==null?void 0:g.width)??w.width,height:((b=w.measured)==null?void 0:b.height)??w.height};return To(N)},u=(d,f,x={replace:!1})=>{o(w=>w.map(v=>{if(v.id===d){const N=typeof f=="function"?f(v):f;return x.replace&&ty(N)?N:{...v,...N}}return v}))},h=(d,f,x={replace:!1})=>{l(w=>w.map(v=>{if(v.id===d){const N=typeof f=="function"?f(v):f;return x.replace&&GO(N)?N:{...v,...N}}return v}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=i(d))==null?void 0:f.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:o,setEdges:l,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(x=>[...x,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(x=>[...x,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:x}=t.getState(),[w,v,N]=x;return{nodes:d.map(g=>({...g})),edges:f.map(g=>({...g})),viewport:{x:w,y:v,zoom:N}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:x,edges:w,onNodesDelete:v,onEdgesDelete:N,triggerNodeChanges:g,triggerEdgeChanges:b,onDelete:p,onBeforeDelete:y}=t.getState(),{nodes:j,edges:S}=await dA({nodesToRemove:d,edgesToRemove:f,nodes:x,edges:w,onBeforeDelete:y}),C=S.length>0,T=j.length>0;if(C){const A=S.map(ey);N==null||N(S),b(A)}if(T){const A=j.map(ey);v==null||v(j),g(A)}return(T||C)&&(p==null||p({nodes:j,edges:S})),{deletedNodes:j,deletedEdges:S}},getIntersectingNodes:(d,f=!0,x)=>{const w=_b(d),v=w?d:c(d),N=x!==void 0;return v?(x||t.getState().nodes).filter(g=>{const b=t.getState().nodeLookup.get(g.id);if(b&&!w&&(g.id===d.id||!b.internals.positionAbsolute))return!1;const p=To(N?g:b),y=pc(p,v);return f&&y>0||y>=p.width*p.height||y>=v.width*v.height}):[]},isNodeIntersecting:(d,f,x=!0)=>{const v=_b(d)?d:c(d);if(!v)return!1;const N=pc(v,f);return x&&N>0||N>=f.width*f.height||N>=v.width*v.height},updateNode:u,updateNodeData:(d,f,x={replace:!1})=>{u(d,w=>{const v=typeof f=="function"?f(w):f;return x.replace?{...w,data:v}:{...w,data:{...w.data,...v}}},x)},updateEdge:h,updateEdgeData:(d,f,x={replace:!1})=>{h(d,w=>{const v=typeof f=="function"?f(w):f;return x.replace?{...w,data:v}:{...w,data:{...w.data,...v}}},x)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:x}=t.getState();return iA(d,{nodeLookup:f,nodeOrigin:x})},getHandleConnections:({type:d,id:f,nodeId:x})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${x}-${d}${f?`-${f}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:d,handleId:f,nodeId:x})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${x}${d?f?`-${d}-${f}`:`-${d}`:""}`))==null?void 0:w.values())??[])},fitView:async d=>{const f=t.getState().fitViewResolver??mA();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(x=>[...x]),f.promise}}},[]);return m.useMemo(()=>({...r,...e,viewportInitialized:s}),[s])}const sy=e=>e.selected,t6=typeof window<"u"?window:void 0;function n6({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=jt(),{deleteElements:s}=Xp(),r=yc(e,{actInsideInputWithModifier:!1}),i=yc(t,{target:t6});m.useEffect(()=>{if(r){const{edges:o,nodes:l}=n.getState();s({nodes:l.filter(sy),edges:o.filter(sy)}),n.setState({nodesSelectionActive:!1})}},[r]),m.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function s6(e){const t=jt();m.useEffect(()=>{const n=()=>{var r,i,o,l;if(!e.current||!(((i=(r=e.current).checkVisibility)==null?void 0:i.call(r))??!0))return!1;const s=Yp(e.current);(s.height===0||s.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",Fs.error004())),t.setState({width:s.width||500,height:s.height||500})};if(e.current){n(),window.addEventListener("resize",n);const s=new ResizeObserver(()=>n());return s.observe(e.current),()=>{window.removeEventListener("resize",n),s&&e.current&&s.unobserve(e.current)}}},[])}const nf={position:"absolute",width:"100%",height:"100%",top:0,left:0},a6=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function r6({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=Xr.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:h,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:x=!0,children:w,noWheelClassName:v,noPanClassName:N,onViewportChange:g,isControlledViewport:b,paneClickDistance:p,selectionOnDrag:y}){const j=jt(),S=m.useRef(null),{userSelectionActive:C,lib:T,connectionInProgress:A}=Ze(a6,kt),P=yc(f),U=m.useRef();s6(S);const O=m.useCallback(V=>{g==null||g({x:V[0],y:V[1],zoom:V[2]}),b||j.setState({transform:V})},[g,b]);return m.useEffect(()=>{if(S.current){U.current=ZA({domNode:S.current,minZoom:h,maxZoom:d,translateExtent:u,viewport:c,onDraggingChange:M=>j.setState({paneDragging:M}),onPanZoomStart:(M,_)=>{const{onViewportChangeStart:E,onMoveStart:D}=j.getState();D==null||D(M,_),E==null||E(_)},onPanZoom:(M,_)=>{const{onViewportChange:E,onMove:D}=j.getState();D==null||D(M,_),E==null||E(_)},onPanZoomEnd:(M,_)=>{const{onViewportChangeEnd:E,onMoveEnd:D}=j.getState();D==null||D(M,_),E==null||E(_)}});const{x:V,y:k,zoom:z}=U.current.getViewport();return j.setState({panZoom:U.current,transform:[V,k,z],domNode:S.current.closest(".react-flow")}),()=>{var M;(M=U.current)==null||M.destroy()}}},[]),m.useEffect(()=>{var V;(V=U.current)==null||V.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:P,preventScrolling:x,noPanClassName:N,userSelectionActive:C,noWheelClassName:v,lib:T,onTransformChange:O,connectionInProgress:A,selectionOnDrag:y,paneClickDistance:p})},[e,t,n,s,r,i,o,l,P,x,N,C,v,T,O,A,y,p]),a.jsx("div",{className:"react-flow__renderer",ref:S,style:nf,children:w})}const i6=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function o6(){const{userSelectionActive:e,userSelectionRect:t}=Ze(i6,kt);return e&&t?a.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const wm=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},l6=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function c6({isSelecting:e,selectionKeyPressed:t,selectionMode:n=gc.Full,panOnDrag:s,paneClickDistance:r,selectionOnDrag:i,onSelectionStart:o,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:h,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:x,children:w}){const v=jt(),{userSelectionActive:N,elementsSelectable:g,dragging:b,connectionInProgress:p}=Ze(l6,kt),y=g&&(e||N),j=m.useRef(null),S=m.useRef(),C=m.useRef(new Set),T=m.useRef(new Set),A=m.useRef(!1),P=E=>{if(A.current||p){A.current=!1;return}c==null||c(E),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},U=E=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){E.preventDefault();return}u==null||u(E)},O=h?E=>h(E):void 0,V=E=>{A.current&&(E.stopPropagation(),A.current=!1)},k=E=>{var X,ne;const{domNode:D}=v.getState();if(S.current=D==null?void 0:D.getBoundingClientRect(),!S.current)return;const L=E.target===j.current;if(!L&&!!E.target.closest(".nokey")||!e||!(i&&L||t)||E.button!==0||!E.isPrimary)return;(ne=(X=E.target)==null?void 0:X.setPointerCapture)==null||ne.call(X,E.pointerId),A.current=!1;const{x:H,y:q}=fs(E.nativeEvent,S.current);v.setState({userSelectionRect:{width:0,height:0,startX:H,startY:q,x:H,y:q}}),L||(E.stopPropagation(),E.preventDefault())},z=E=>{const{userSelectionRect:D,transform:L,nodeLookup:W,edgeLookup:R,connectionLookup:H,triggerNodeChanges:q,triggerEdgeChanges:X,defaultEdgeOptions:ne,resetSelectedElements:ae}=v.getState();if(!S.current||!D)return;const{x:J,y:$}=fs(E.nativeEvent,S.current),{startX:te,startY:K}=D;if(!A.current){const ue=t?0:r;if(Math.hypot(J-te,$-K)<=ue)return;ae(),o==null||o(E)}A.current=!0;const B={startX:te,startY:K,x:J<te?J:te,y:$<K?$:K,width:Math.abs(J-te),height:Math.abs($-K)},G=C.current,re=T.current;C.current=new Set(Hp(W,B,L,n===gc.Partial,!0).map(ue=>ue.id)),T.current=new Set;const ce=(ne==null?void 0:ne.selectable)??!0;for(const ue of C.current){const ve=H.get(ue);if(ve)for(const{edgeId:ze}of ve.values()){const _e=R.get(ze);_e&&(_e.selectable??ce)&&T.current.add(ze)}}if(!Ab(G,C.current)){const ue=Ki(W,C.current,!0);q(ue)}if(!Ab(re,T.current)){const ue=Ki(R,T.current);X(ue)}v.setState({userSelectionRect:B,userSelectionActive:!0,nodesSelectionActive:!1})},M=E=>{var D,L;E.button===0&&((L=(D=E.target)==null?void 0:D.releasePointerCapture)==null||L.call(D,E.pointerId),!N&&E.target===j.current&&v.getState().userSelectionRect&&(P==null||P(E)),v.setState({userSelectionActive:!1,userSelectionRect:null}),A.current&&(l==null||l(E),v.setState({nodesSelectionActive:C.current.size>0})))},_=s===!0||Array.isArray(s)&&s.includes(0);return a.jsxs("div",{className:$t(["react-flow__pane",{draggable:_,dragging:b,selection:e}]),onClick:y?void 0:wm(P,j),onContextMenu:wm(U,j),onWheel:wm(O,j),onPointerEnter:y?void 0:d,onPointerMove:y?z:f,onPointerUp:y?M:void 0,onPointerDownCapture:y?k:void 0,onClickCapture:y?V:void 0,onPointerLeave:x,ref:j,style:nf,children:[w,a.jsx(o6,{})]})}function lg({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",Fs.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&o)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var h;return(h=s==null?void 0:s.current)==null?void 0:h.blur()})):r([e])}function nS({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:r,isSelectable:i,nodeClickDistance:o}){const l=jt(),[c,u]=m.useState(!1),h=m.useRef();return m.useEffect(()=>{h.current=UA({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{lg({id:d,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),m.useEffect(()=>{var d,f;if(t)(d=h.current)==null||d.destroy();else if(e.current)return(f=h.current)==null||f.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:o}),()=>{var x;(x=h.current)==null||x.destroy()}},[n,s,t,i,e,r]),c}const d6=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function sS(){const e=jt();return m.useCallback(n=>{const{nodeExtent:s,snapToGrid:r,snapGrid:i,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:h}=e.getState(),d=new Map,f=d6(o),x=r?i[0]:5,w=r?i[1]:5,v=n.direction.x*x*n.factor,N=n.direction.y*w*n.factor;for(const[,g]of u){if(!f(g))continue;let b={x:g.internals.positionAbsolute.x+v,y:g.internals.positionAbsolute.y+N};r&&(b=qc(b,i));const{position:p,positionAbsolute:y}=p2({nodeId:g.id,nextPosition:b,nodeLookup:u,nodeExtent:s,nodeOrigin:h,onError:l});g.position=p,g.internals.positionAbsolute=y,d.set(g.id,g)}c(d)},[])}const Gp=m.createContext(null),u6=Gp.Provider;Gp.Consumer;const aS=()=>m.useContext(Gp),h6=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),f6=(e,t,n)=>s=>{const{connectionClickStartHandle:r,connectionMode:i,connection:o}=s,{fromHandle:l,toHandle:c,isValid:u}=o,h=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:h,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:i===ko.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!r,valid:h&&u}};function m6({type:e="source",position:t=Ee.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:o,onConnect:l,children:c,className:u,onMouseDown:h,onTouchStart:d,...f},x){var z,M;const w=o||null,v=e==="target",N=jt(),g=aS(),{connectOnClick:b,noPanClassName:p,rfId:y}=Ze(h6,kt),{connectingFrom:j,connectingTo:S,clickConnecting:C,isPossibleEndHandle:T,connectionInProcess:A,clickConnectionInProcess:P,valid:U}=Ze(f6(g,w,e),kt);g||(M=(z=N.getState()).onError)==null||M.call(z,"010",Fs.error010());const O=_=>{const{defaultEdgeOptions:E,onConnect:D,hasDefaultEdges:L}=N.getState(),W={...E,..._};if(L){const{edges:R,setEdges:H}=N.getState();H(T2(W,R))}D==null||D(W),l==null||l(W)},V=_=>{if(!g)return;const E=C2(_.nativeEvent);if(r&&(E&&_.button===0||!E)){const D=N.getState();og.onPointerDown(_.nativeEvent,{handleDomNode:_.currentTarget,autoPanOnConnect:D.autoPanOnConnect,connectionMode:D.connectionMode,connectionRadius:D.connectionRadius,domNode:D.domNode,nodeLookup:D.nodeLookup,lib:D.lib,isTarget:v,handleId:w,nodeId:g,flowId:D.rfId,panBy:D.panBy,cancelConnection:D.cancelConnection,onConnectStart:D.onConnectStart,onConnectEnd:D.onConnectEnd,updateConnection:D.updateConnection,onConnect:O,isValidConnection:n||D.isValidConnection,getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:D.autoPanSpeed,dragThreshold:D.connectionDragThreshold})}E?h==null||h(_):d==null||d(_)},k=_=>{const{onClickConnectStart:E,onClickConnectEnd:D,connectionClickStartHandle:L,connectionMode:W,isValidConnection:R,lib:H,rfId:q,nodeLookup:X,connection:ne}=N.getState();if(!g||!L&&!r)return;if(!L){E==null||E(_.nativeEvent,{nodeId:g,handleId:w,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:g,type:e,id:w}});return}const ae=j2(_.target),J=n||R,{connection:$,isValid:te}=og.isValid(_.nativeEvent,{handle:{nodeId:g,id:w,type:e},connectionMode:W,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:J,flowId:q,doc:ae,lib:H,nodeLookup:X});te&&$&&O($);const K=structuredClone(ne);delete K.inProgress,K.toPosition=K.toHandle?K.toHandle.position:null,D==null||D(_,K),N.setState({connectionClickStartHandle:null})};return a.jsx("div",{"data-handleid":w,"data-nodeid":g,"data-handlepos":t,"data-id":`${y}-${g}-${w}-${e}`,className:$t(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",p,u,{source:!v,target:v,connectable:s,connectablestart:r,connectableend:i,clickconnecting:C,connectingfrom:j,connectingto:S,valid:U,connectionindicator:s&&(!A||T)&&(A||P?i:r)}]),onMouseDown:V,onTouchStart:V,onClick:b?k:void 0,ref:x,...f,children:c})}const Gr=m.memo(eS(m6));function x6({data:e,isConnectable:t,sourcePosition:n=Ee.Bottom}){return a.jsxs(a.Fragment,{children:[e==null?void 0:e.label,a.jsx(Gr,{type:"source",position:n,isConnectable:t})]})}function g6({data:e,isConnectable:t,targetPosition:n=Ee.Top,sourcePosition:s=Ee.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx(Gr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,a.jsx(Gr,{type:"source",position:s,isConnectable:t})]})}function p6(){return null}function v6({data:e,isConnectable:t,targetPosition:n=Ee.Top}){return a.jsxs(a.Fragment,{children:[a.jsx(Gr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const oh={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},ay={input:x6,default:g6,output:v6,group:p6};function b6(e){var t,n,s,r;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const y6=e=>{const{width:t,height:n,x:s,y:r}=Wc(e.nodeLookup,{filter:i=>!!i.selected});return{width:hs(t)?t:null,height:hs(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${r}px)`}};function w6({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=jt(),{width:r,height:i,transformString:o,userSelectionActive:l}=Ze(y6,kt),c=sS(),u=m.useRef(null);if(m.useEffect(()=>{var f;n||(f=u.current)==null||f.focus({preventScroll:!0})},[n]),nS({nodeRef:u}),l||!r||!i)return null;const h=e?f=>{const x=s.getState().nodes.filter(w=>w.selected);e(f,x)}:void 0,d=f=>{Object.prototype.hasOwnProperty.call(oh,f.key)&&(f.preventDefault(),c({direction:oh[f.key],factor:f.shiftKey?4:1}))};return a.jsx("div",{className:$t(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:a.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:r,height:i}})})}const ry=typeof window<"u"?window:void 0,N6=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function rS({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:h,selectionMode:d,onSelectionStart:f,onSelectionEnd:x,multiSelectionKeyCode:w,panActivationKeyCode:v,zoomActivationKeyCode:N,elementsSelectable:g,zoomOnScroll:b,zoomOnPinch:p,panOnScroll:y,panOnScrollSpeed:j,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:T,defaultViewport:A,translateExtent:P,minZoom:U,maxZoom:O,preventScrolling:V,onSelectionContextMenu:k,noWheelClassName:z,noPanClassName:M,disableKeyboardA11y:_,onViewportChange:E,isControlledViewport:D}){const{nodesSelectionActive:L,userSelectionActive:W}=Ze(N6),R=yc(u,{target:ry}),H=yc(v,{target:ry}),q=H||T,X=H||y,ne=h&&q!==!0,ae=R||W||ne;return n6({deleteKeyCode:c,multiSelectionKeyCode:w}),a.jsx(r6,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:b,zoomOnPinch:p,panOnScroll:X,panOnScrollSpeed:j,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!R&&q,defaultViewport:A,translateExtent:P,minZoom:U,maxZoom:O,zoomActivationKeyCode:N,preventScrolling:V,noWheelClassName:z,noPanClassName:M,onViewportChange:E,isControlledViewport:D,paneClickDistance:l,selectionOnDrag:ne,children:a.jsxs(c6,{onSelectionStart:f,onSelectionEnd:x,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:o,panOnDrag:q,isSelecting:!!ae,selectionMode:d,selectionKeyPressed:R,paneClickDistance:l,selectionOnDrag:ne,children:[e,L&&a.jsx(w6,{onSelectionContextMenu:k,noPanClassName:M,disableKeyboardA11y:_})]})})}rS.displayName="FlowRenderer";const j6=m.memo(rS),S6=e=>t=>e?Hp(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function C6(e){return Ze(m.useCallback(S6(e),[e]),kt)}const E6=e=>e.updateNodeInternals;function k6(){const e=Ze(E6),[t]=m.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");s.set(i,{id:i,nodeElement:r.target,force:!0})}),e(s)}));return m.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function M6({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const r=jt(),i=m.useRef(null),o=m.useRef(null),l=m.useRef(e.sourcePosition),c=m.useRef(e.targetPosition),u=m.useRef(t),h=n&&!!e.internals.handleBounds;return m.useEffect(()=>{i.current&&!e.hidden&&(!h||o.current!==i.current)&&(o.current&&(s==null||s.unobserve(o.current)),s==null||s.observe(i.current),o.current=i.current)},[h,e.hidden]),m.useEffect(()=>()=>{o.current&&(s==null||s.unobserve(o.current),o.current=null)},[]),m.useEffect(()=>{if(i.current){const d=u.current!==t,f=l.current!==e.sourcePosition,x=c.current!==e.targetPosition;(d||f||x)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function T6({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:r,onContextMenu:i,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:h,resizeObserver:d,noDragClassName:f,noPanClassName:x,disableKeyboardA11y:w,rfId:v,nodeTypes:N,nodeClickDistance:g,onError:b}){const{node:p,internals:y,isParent:j}=Ze(J=>{const $=J.nodeLookup.get(e),te=J.parentLookup.has(e);return{node:$,internals:$.internals,isParent:te}},kt);let S=p.type||"default",C=(N==null?void 0:N[S])||ay[S];C===void 0&&(b==null||b("003",Fs.error003(S)),S="default",C=(N==null?void 0:N.default)||ay.default);const T=!!(p.draggable||l&&typeof p.draggable>"u"),A=!!(p.selectable||c&&typeof p.selectable>"u"),P=!!(p.connectable||u&&typeof p.connectable>"u"),U=!!(p.focusable||h&&typeof p.focusable>"u"),O=jt(),V=w2(p),k=M6({node:p,nodeType:S,hasDimensions:V,resizeObserver:d}),z=nS({nodeRef:k,disabled:p.hidden||!T,noDragClassName:f,handleSelector:p.dragHandle,nodeId:e,isSelectable:A,nodeClickDistance:g}),M=sS();if(p.hidden)return null;const _=Ca(p),E=b6(p),D=A||T||t||n||s||r,L=n?J=>n(J,{...y.userNode}):void 0,W=s?J=>s(J,{...y.userNode}):void 0,R=r?J=>r(J,{...y.userNode}):void 0,H=i?J=>i(J,{...y.userNode}):void 0,q=o?J=>o(J,{...y.userNode}):void 0,X=J=>{const{selectNodesOnDrag:$,nodeDragThreshold:te}=O.getState();A&&(!$||!T||te>0)&&lg({id:e,store:O,nodeRef:k}),t&&t(J,{...y.userNode})},ne=J=>{if(!(S2(J.nativeEvent)||w)){if(h2.includes(J.key)&&A){const $=J.key==="Escape";lg({id:e,store:O,unselect:$,nodeRef:k})}else if(T&&p.selected&&Object.prototype.hasOwnProperty.call(oh,J.key)){J.preventDefault();const{ariaLabelConfig:$}=O.getState();O.setState({ariaLiveMessage:$["node.a11yDescription.ariaLiveMessage"]({direction:J.key.replace("Arrow","").toLowerCase(),x:~~y.positionAbsolute.x,y:~~y.positionAbsolute.y})}),M({direction:oh[J.key],factor:J.shiftKey?4:1})}}},ae=()=>{var re;if(w||!((re=k.current)!=null&&re.matches(":focus-visible")))return;const{transform:J,width:$,height:te,autoPanOnNodeFocus:K,setCenter:B}=O.getState();if(!K)return;Hp(new Map([[e,p]]),{x:0,y:0,width:$,height:te},J,!0).length>0||B(p.position.x+_.width/2,p.position.y+_.height/2,{zoom:J[2]})};return a.jsx("div",{className:$t(["react-flow__node",`react-flow__node-${S}`,{[x]:T},p.className,{selected:p.selected,selectable:A,parent:j,draggable:T,dragging:z}]),ref:k,style:{zIndex:y.z,transform:`translate(${y.positionAbsolute.x}px,${y.positionAbsolute.y}px)`,pointerEvents:D?"all":"none",visibility:V?"visible":"hidden",...p.style,...E},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:W,onMouseLeave:R,onContextMenu:H,onClick:X,onDoubleClick:q,onKeyDown:U?ne:void 0,tabIndex:U?0:void 0,onFocus:U?ae:void 0,role:p.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${X2}-${v}`,"aria-label":p.ariaLabel,...p.domAttributes,children:a.jsx(u6,{value:e,children:a.jsx(C,{id:e,data:p.data,type:S,positionAbsoluteX:y.positionAbsolute.x,positionAbsoluteY:y.positionAbsolute.y,selected:p.selected??!1,selectable:A,draggable:T,deletable:p.deletable??!0,isConnectable:P,sourcePosition:p.sourcePosition,targetPosition:p.targetPosition,dragging:z,dragHandle:p.dragHandle,zIndex:y.z,parentId:p.parentId,..._})})})}var D6=m.memo(T6);const _6=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function iS(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,onError:i}=Ze(_6,kt),o=C6(e.onlyRenderVisibleElements),l=k6();return a.jsx("div",{className:"react-flow__nodes",style:nf,children:o.map(c=>a.jsx(D6,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}iS.displayName="NodeRenderer";const A6=m.memo(iS);function O6(e){return Ze(m.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const s=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),o=n.nodeLookup.get(r.target);i&&o&&vA({sourceNode:i,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&s.push(r.id)}return s},[e]),kt)}const z6=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return a.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},R6=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return a.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},iy={[ah.Arrow]:z6,[ah.ArrowClosed]:R6};function U6(e){const t=jt();return m.useMemo(()=>{var r,i;return Object.prototype.hasOwnProperty.call(iy,e)?iy[e]:((i=(r=t.getState()).onError)==null||i.call(r,"009",Fs.error009(e)),null)},[e])}const $6=({id:e,type:t,color:n,width:s=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=U6(t);return c?a.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:a.jsx(c,{color:n,strokeWidth:o})}):null},oS=({defaultColor:e,rfId:t})=>{const n=Ze(i=>i.edges),s=Ze(i=>i.defaultEdgeOptions),r=m.useMemo(()=>CA(n,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[n,s,t,e]);return r.length?a.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:a.jsx("defs",{children:r.map(i=>a.jsx($6,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};oS.displayName="MarkerDefinitions";var L6=m.memo(oS);function lS({x:e,y:t,label:n,labelStyle:s,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...h}){const[d,f]=m.useState({x:1,y:0,width:0,height:0}),x=$t(["react-flow__edge-textwrapper",u]),w=m.useRef(null);return m.useEffect(()=>{if(w.current){const v=w.current.getBBox();f({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?a.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:x,visibility:d.width?"visible":"hidden",...h,children:[r&&a.jsx("rect",{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),a.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:w,style:s,children:n}),c]}):null}lS.displayName="EdgeText";const P6=m.memo(lS);function sf({path:e,labelX:t,labelY:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...h}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...h,d:e,fill:"none",className:$t(["react-flow__edge-path",h.className])}),u?a.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,s&&hs(t)&&hs(n)?a.jsx(P6,{x:t,y:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function oy({pos:e,x1:t,y1:n,x2:s,y2:r}){return e===Ee.Left||e===Ee.Right?[.5*(t+s),n]:[t,.5*(n+r)]}function cS({sourceX:e,sourceY:t,sourcePosition:n=Ee.Bottom,targetX:s,targetY:r,targetPosition:i=Ee.Top}){const[o,l]=oy({pos:n,x1:e,y1:t,x2:s,y2:r}),[c,u]=oy({pos:i,x1:s,y1:r,x2:e,y2:t}),[h,d,f,x]=E2({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${o},${l} ${c},${u} ${s},${r}`,h,d,f,x]}function dS(e){return m.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:o,targetPosition:l,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:w,markerEnd:v,markerStart:N,interactionWidth:g})=>{const[b,p,y]=cS({sourceX:n,sourceY:s,sourcePosition:o,targetX:r,targetY:i,targetPosition:l}),j=e.isInternal?void 0:t;return a.jsx(sf,{id:j,path:b,labelX:p,labelY:y,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:w,markerEnd:v,markerStart:N,interactionWidth:g})})}const B6=dS({isInternal:!1}),uS=dS({isInternal:!0});B6.displayName="SimpleBezierEdge";uS.displayName="SimpleBezierEdgeInternal";function hS(e){return m.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d,style:f,sourcePosition:x=Ee.Bottom,targetPosition:w=Ee.Top,markerEnd:v,markerStart:N,pathOptions:g,interactionWidth:b})=>{const[p,y,j]=ag({sourceX:n,sourceY:s,sourcePosition:x,targetX:r,targetY:i,targetPosition:w,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),S=e.isInternal?void 0:t;return a.jsx(sf,{id:S,path:p,labelX:y,labelY:j,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:v,markerStart:N,interactionWidth:b})})}const fS=hS({isInternal:!1}),mS=hS({isInternal:!0});fS.displayName="SmoothStepEdge";mS.displayName="SmoothStepEdgeInternal";function xS(e){return m.memo(({id:t,...n})=>{var r;const s=e.isInternal?void 0:t;return a.jsx(fS,{...n,id:s,pathOptions:m.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const H6=xS({isInternal:!1}),gS=xS({isInternal:!0});H6.displayName="StepEdge";gS.displayName="StepEdgeInternal";function pS(e){return m.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:w,interactionWidth:v})=>{const[N,g,b]=D2({sourceX:n,sourceY:s,targetX:r,targetY:i}),p=e.isInternal?void 0:t;return a.jsx(sf,{id:p,path:N,labelX:g,labelY:b,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:w,interactionWidth:v})})}const V6=pS({isInternal:!1}),vS=pS({isInternal:!0});V6.displayName="StraightEdge";vS.displayName="StraightEdgeInternal";function bS(e){return m.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:o=Ee.Bottom,targetPosition:l=Ee.Top,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:w,markerEnd:v,markerStart:N,pathOptions:g,interactionWidth:b})=>{const[p,y,j]=k2({sourceX:n,sourceY:s,sourcePosition:o,targetX:r,targetY:i,targetPosition:l,curvature:g==null?void 0:g.curvature}),S=e.isInternal?void 0:t;return a.jsx(sf,{id:S,path:p,labelX:y,labelY:j,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:w,markerEnd:v,markerStart:N,interactionWidth:b})})}const Y6=bS({isInternal:!1}),yS=bS({isInternal:!0});Y6.displayName="BezierEdge";yS.displayName="BezierEdgeInternal";const ly={default:yS,straight:vS,step:gS,smoothstep:mS,simplebezier:uS},cy={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},F6=(e,t,n)=>n===Ee.Left?e-t:n===Ee.Right?e+t:e,I6=(e,t,n)=>n===Ee.Top?e-t:n===Ee.Bottom?e+t:e,dy="react-flow__edgeupdater";function uy({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:r,onMouseEnter:i,onMouseOut:o,type:l}){return a.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:o,className:$t([dy,`${dy}-${l}`]),cx:F6(t,s,e),cy:I6(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function W6({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:r,targetX:i,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:h,onReconnectEnd:d,setReconnecting:f,setUpdateHover:x}){const w=jt(),v=(y,j)=>{if(y.button!==0)return;const{autoPanOnConnect:S,domNode:C,isValidConnection:T,connectionMode:A,connectionRadius:P,lib:U,onConnectStart:O,onConnectEnd:V,cancelConnection:k,nodeLookup:z,rfId:M,panBy:_,updateConnection:E}=w.getState(),D=j.type==="target",L=(H,q)=>{f(!1),d==null||d(H,n,j.type,q)},W=H=>u==null?void 0:u(n,H),R=(H,q)=>{f(!0),h==null||h(y,n,j.type),O==null||O(H,q)};og.onPointerDown(y.nativeEvent,{autoPanOnConnect:S,connectionMode:A,connectionRadius:P,domNode:C,handleId:j.id,nodeId:j.nodeId,nodeLookup:z,isTarget:D,edgeUpdaterType:j.type,lib:U,flowId:M,cancelConnection:k,panBy:_,isValidConnection:T,onConnect:W,onConnectStart:R,onConnectEnd:V,onReconnectEnd:L,updateConnection:E,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:y.currentTarget})},N=y=>v(y,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=y=>v(y,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),b=()=>x(!0),p=()=>x(!1);return a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(uy,{position:l,centerX:s,centerY:r,radius:t,onMouseDown:N,onMouseEnter:b,onMouseOut:p,type:"source"}),(e===!0||e==="target")&&a.jsx(uy,{position:c,centerX:i,centerY:o,radius:t,onMouseDown:g,onMouseEnter:b,onMouseOut:p,type:"target"})]})}function q6({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:r,onDoubleClick:i,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:x,rfId:w,edgeTypes:v,noPanClassName:N,onError:g,disableKeyboardA11y:b}){let p=Ze(B=>B.edgeLookup.get(e));const y=Ze(B=>B.defaultEdgeOptions);p=y?{...y,...p}:p;let j=p.type||"default",S=(v==null?void 0:v[j])||ly[j];S===void 0&&(g==null||g("011",Fs.error011(j)),j="default",S=(v==null?void 0:v.default)||ly.default);const C=!!(p.focusable||t&&typeof p.focusable>"u"),T=typeof d<"u"&&(p.reconnectable||n&&typeof p.reconnectable>"u"),A=!!(p.selectable||s&&typeof p.selectable>"u"),P=m.useRef(null),[U,O]=m.useState(!1),[V,k]=m.useState(!1),z=jt(),{zIndex:M,sourceX:_,sourceY:E,targetX:D,targetY:L,sourcePosition:W,targetPosition:R}=Ze(m.useCallback(B=>{const G=B.nodeLookup.get(p.source),re=B.nodeLookup.get(p.target);if(!G||!re)return{zIndex:p.zIndex,...cy};const ce=SA({id:e,sourceNode:G,targetNode:re,sourceHandle:p.sourceHandle||null,targetHandle:p.targetHandle||null,connectionMode:B.connectionMode,onError:g});return{zIndex:pA({selected:p.selected,zIndex:p.zIndex,sourceNode:G,targetNode:re,elevateOnSelect:B.elevateEdgesOnSelect}),...ce||cy}},[p.source,p.target,p.sourceHandle,p.targetHandle,p.selected,p.zIndex]),kt),H=m.useMemo(()=>p.markerStart?`url('#${rg(p.markerStart,w)}')`:void 0,[p.markerStart,w]),q=m.useMemo(()=>p.markerEnd?`url('#${rg(p.markerEnd,w)}')`:void 0,[p.markerEnd,w]);if(p.hidden||_===null||E===null||D===null||L===null)return null;const X=B=>{var ue;const{addSelectedEdges:G,unselectNodesAndEdges:re,multiSelectionActive:ce}=z.getState();A&&(z.setState({nodesSelectionActive:!1}),p.selected&&ce?(re({nodes:[],edges:[p]}),(ue=P.current)==null||ue.blur()):G([e])),r&&r(B,p)},ne=i?B=>{i(B,{...p})}:void 0,ae=o?B=>{o(B,{...p})}:void 0,J=l?B=>{l(B,{...p})}:void 0,$=c?B=>{c(B,{...p})}:void 0,te=u?B=>{u(B,{...p})}:void 0,K=B=>{var G;if(!b&&h2.includes(B.key)&&A){const{unselectNodesAndEdges:re,addSelectedEdges:ce}=z.getState();B.key==="Escape"?((G=P.current)==null||G.blur(),re({edges:[p]})):ce([e])}};return a.jsx("svg",{style:{zIndex:M},children:a.jsxs("g",{className:$t(["react-flow__edge",`react-flow__edge-${j}`,p.className,N,{selected:p.selected,animated:p.animated,inactive:!A&&!r,updating:U,selectable:A}]),onClick:X,onDoubleClick:ne,onContextMenu:ae,onMouseEnter:J,onMouseMove:$,onMouseLeave:te,onKeyDown:C?K:void 0,tabIndex:C?0:void 0,role:p.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":p.ariaLabel===null?void 0:p.ariaLabel||`Edge from ${p.source} to ${p.target}`,"aria-describedby":C?`${G2}-${w}`:void 0,ref:P,...p.domAttributes,children:[!V&&a.jsx(S,{id:e,source:p.source,target:p.target,type:p.type,selected:p.selected,animated:p.animated,selectable:A,deletable:p.deletable??!0,label:p.label,labelStyle:p.labelStyle,labelShowBg:p.labelShowBg,labelBgStyle:p.labelBgStyle,labelBgPadding:p.labelBgPadding,labelBgBorderRadius:p.labelBgBorderRadius,sourceX:_,sourceY:E,targetX:D,targetY:L,sourcePosition:W,targetPosition:R,data:p.data,style:p.style,sourceHandleId:p.sourceHandle,targetHandleId:p.targetHandle,markerStart:H,markerEnd:q,pathOptions:"pathOptions"in p?p.pathOptions:void 0,interactionWidth:p.interactionWidth}),T&&a.jsx(W6,{edge:p,isReconnectable:T,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:x,sourceX:_,sourceY:E,targetX:D,targetY:L,sourcePosition:W,targetPosition:R,setUpdateHover:O,setReconnecting:k})]})})}var X6=m.memo(q6);const G6=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function wS({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:r,onReconnect:i,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:h,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:x,onReconnectEnd:w,disableKeyboardA11y:v}){const{edgesFocusable:N,edgesReconnectable:g,elementsSelectable:b,onError:p}=Ze(G6,kt),y=O6(t);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(L6,{defaultColor:e,rfId:n}),y.map(j=>a.jsx(X6,{id:j,edgesFocusable:N,edgesReconnectable:g,elementsSelectable:b,noPanClassName:r,onReconnect:i,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:h,reconnectRadius:d,onDoubleClick:f,onReconnectStart:x,onReconnectEnd:w,rfId:n,onError:p,edgeTypes:s,disableKeyboardA11y:v},j))]})}wS.displayName="EdgeRenderer";const Z6=m.memo(wS),Q6=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function K6({children:e}){const t=Ze(Q6);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function J6(e){const t=Xp(),n=m.useRef(!1);m.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const ez=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function tz(e){const t=Ze(ez),n=jt();return m.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function nz(e){return e.connection.inProgress?{...e.connection,to:Xc(e.connection.to,e.transform)}:{...e.connection}}function sz(e){return nz}function az(e){const t=sz();return Ze(t,kt)}const rz=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function iz({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:r,width:i,height:o,isValid:l,inProgress:c}=Ze(rz,kt);return!(i&&r&&c)?null:a.jsx("svg",{style:e,width:i,height:o,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:$t(["react-flow__connection",x2(l)]),children:a.jsx(NS,{style:t,type:n,CustomComponent:s,isValid:l})})})}const NS=({style:e,type:t=Ga.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:r,from:i,fromNode:o,fromHandle:l,fromPosition:c,to:u,toNode:h,toHandle:d,toPosition:f,pointer:x}=az();if(!r)return;if(n)return a.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:f,connectionStatus:x2(s),toNode:h,toHandle:d,pointer:x});let w="";const v={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case Ga.Bezier:[w]=k2(v);break;case Ga.SimpleBezier:[w]=cS(v);break;case Ga.Step:[w]=ag({...v,borderRadius:0});break;case Ga.SmoothStep:[w]=ag(v);break;default:[w]=D2(v)}return a.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};NS.displayName="ConnectionLine";const oz={};function hy(e=oz){m.useRef(e),jt(),m.useEffect(()=>{},[e])}function lz(){jt(),m.useRef(!1),m.useEffect(()=>{},[])}function jS({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:x,connectionLineType:w,connectionLineStyle:v,connectionLineComponent:N,connectionLineContainerStyle:g,selectionKeyCode:b,selectionOnDrag:p,selectionMode:y,multiSelectionKeyCode:j,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:T,onlyRenderVisibleElements:A,elementsSelectable:P,defaultViewport:U,translateExtent:O,minZoom:V,maxZoom:k,preventScrolling:z,defaultMarkerColor:M,zoomOnScroll:_,zoomOnPinch:E,panOnScroll:D,panOnScrollSpeed:L,panOnScrollMode:W,zoomOnDoubleClick:R,panOnDrag:H,onPaneClick:q,onPaneMouseEnter:X,onPaneMouseMove:ne,onPaneMouseLeave:ae,onPaneScroll:J,onPaneContextMenu:$,paneClickDistance:te,nodeClickDistance:K,onEdgeContextMenu:B,onEdgeMouseEnter:G,onEdgeMouseMove:re,onEdgeMouseLeave:ce,reconnectRadius:ue,onReconnect:ve,onReconnectStart:ze,onReconnectEnd:_e,noDragClassName:Mt,noWheelClassName:St,noPanClassName:Le,disableKeyboardA11y:De,nodeExtent:nt,rfId:ht,viewport:vt,onViewportChange:Gt}){return hy(e),hy(t),lz(),J6(n),tz(vt),a.jsx(j6,{onPaneClick:q,onPaneMouseEnter:X,onPaneMouseMove:ne,onPaneMouseLeave:ae,onPaneContextMenu:$,onPaneScroll:J,paneClickDistance:te,deleteKeyCode:T,selectionKeyCode:b,selectionOnDrag:p,selectionMode:y,onSelectionStart:f,onSelectionEnd:x,multiSelectionKeyCode:j,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:P,zoomOnScroll:_,zoomOnPinch:E,zoomOnDoubleClick:R,panOnScroll:D,panOnScrollSpeed:L,panOnScrollMode:W,panOnDrag:H,defaultViewport:U,translateExtent:O,minZoom:V,maxZoom:k,onSelectionContextMenu:d,preventScrolling:z,noDragClassName:Mt,noWheelClassName:St,noPanClassName:Le,disableKeyboardA11y:De,onViewportChange:Gt,isControlledViewport:!!vt,children:a.jsxs(K6,{children:[a.jsx(Z6,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:o,onReconnect:ve,onReconnectStart:ze,onReconnectEnd:_e,onlyRenderVisibleElements:A,onEdgeContextMenu:B,onEdgeMouseEnter:G,onEdgeMouseMove:re,onEdgeMouseLeave:ce,reconnectRadius:ue,defaultMarkerColor:M,noPanClassName:Le,disableKeyboardA11y:De,rfId:ht}),a.jsx(iz,{style:v,type:w,component:N,containerStyle:g}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(A6,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,nodeClickDistance:K,onlyRenderVisibleElements:A,noPanClassName:Le,noDragClassName:Mt,disableKeyboardA11y:De,nodeExtent:nt,rfId:ht}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}jS.displayName="GraphView";const cz=m.memo(jS),fy=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:h,nodeExtent:d}={})=>{const f=new Map,x=new Map,w=new Map,v=new Map,N=s??t??[],g=n??e??[],b=h??[0,0],p=d??xc;O2(w,v,N);const y=ig(g,f,x,{nodeOrigin:b,nodeExtent:p,elevateNodesOnSelect:!1});let j=[0,0,1];if(o&&r&&i){const S=Wc(f,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))}),{x:C,y:T,zoom:A}=Vp(S,r,i,c,u,(l==null?void 0:l.padding)??.1);j=[C,T,A]}return{rfId:"1",width:r??0,height:i??0,transform:j,nodes:g,nodesInitialized:y,nodeLookup:f,parentLookup:x,edges:N,edgeLookup:v,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:xc,nodeExtent:p,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ko.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:b,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...m2},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:uA,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:f2}},dz=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:d})=>MO((f,x)=>{async function w(){const{nodeLookup:v,panZoom:N,fitViewOptions:g,fitViewResolver:b,width:p,height:y,minZoom:j,maxZoom:S}=x();N&&(await cA({nodes:v,width:p,height:y,panZoom:N,minZoom:j,maxZoom:S},g),b==null||b.resolve(!0),f({fitViewResolver:null}))}return{...fy({nodes:e,edges:t,width:r,height:i,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:d,defaultNodes:n,defaultEdges:s}),setNodes:v=>{const{nodeLookup:N,parentLookup:g,nodeOrigin:b,elevateNodesOnSelect:p,fitViewQueued:y}=x(),j=ig(v,N,g,{nodeOrigin:b,nodeExtent:d,elevateNodesOnSelect:p,checkEquality:!0});y&&j?(w(),f({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0})):f({nodes:v,nodesInitialized:j})},setEdges:v=>{const{connectionLookup:N,edgeLookup:g}=x();O2(N,g,v),f({edges:v})},setDefaultNodesAndEdges:(v,N)=>{if(v){const{setNodes:g}=x();g(v),f({hasDefaultNodes:!0})}if(N){const{setEdges:g}=x();g(N),f({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:N,nodeLookup:g,parentLookup:b,domNode:p,nodeOrigin:y,nodeExtent:j,debug:S,fitViewQueued:C}=x(),{changes:T,updatedInternals:A}=AA(v,g,b,p,y,j);A&&(MA(g,b,{nodeOrigin:y,nodeExtent:j}),C?(w(),f({fitViewQueued:!1,fitViewOptions:void 0})):f({}),(T==null?void 0:T.length)>0&&(S&&console.log("React Flow: trigger node changes",T),N==null||N(T)))},updateNodePositions:(v,N=!1)=>{const g=[],b=[],{nodeLookup:p,triggerNodeChanges:y}=x();for(const[j,S]of v){const C=p.get(j),T=!!(C!=null&&C.expandParent&&(C!=null&&C.parentId)&&(S!=null&&S.position)),A={id:j,type:"position",position:T?{x:Math.max(0,S.position.x),y:Math.max(0,S.position.y)}:S.position,dragging:N};T&&C.parentId&&g.push({id:j,parentId:C.parentId,rect:{...S.internals.positionAbsolute,width:S.measured.width??0,height:S.measured.height??0}}),b.push(A)}if(g.length>0){const{parentLookup:j,nodeOrigin:S}=x(),C=qp(g,p,j,S);b.push(...C)}y(b)},triggerNodeChanges:v=>{const{onNodesChange:N,setNodes:g,nodes:b,hasDefaultNodes:p,debug:y}=x();if(v!=null&&v.length){if(p){const j=K2(v,b);g(j)}y&&console.log("React Flow: trigger node changes",v),N==null||N(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:N,setEdges:g,edges:b,hasDefaultEdges:p,debug:y}=x();if(v!=null&&v.length){if(p){const j=J2(v,b);g(j)}y&&console.log("React Flow: trigger edge changes",v),N==null||N(v)}},addSelectedNodes:v=>{const{multiSelectionActive:N,edgeLookup:g,nodeLookup:b,triggerNodeChanges:p,triggerEdgeChanges:y}=x();if(N){const j=v.map(S=>Or(S,!0));p(j);return}p(Ki(b,new Set([...v]),!0)),y(Ki(g))},addSelectedEdges:v=>{const{multiSelectionActive:N,edgeLookup:g,nodeLookup:b,triggerNodeChanges:p,triggerEdgeChanges:y}=x();if(N){const j=v.map(S=>Or(S,!0));y(j);return}y(Ki(g,new Set([...v]))),p(Ki(b,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:N}={})=>{const{edges:g,nodes:b,nodeLookup:p,triggerNodeChanges:y,triggerEdgeChanges:j}=x(),S=v||b,C=N||g,T=S.map(P=>{const U=p.get(P.id);return U&&(U.selected=!1),Or(P.id,!1)}),A=C.map(P=>Or(P.id,!1));y(T),j(A)},setMinZoom:v=>{const{panZoom:N,maxZoom:g}=x();N==null||N.setScaleExtent([v,g]),f({minZoom:v})},setMaxZoom:v=>{const{panZoom:N,minZoom:g}=x();N==null||N.setScaleExtent([g,v]),f({maxZoom:v})},setTranslateExtent:v=>{var N;(N=x().panZoom)==null||N.setTranslateExtent(v),f({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:N,triggerNodeChanges:g,triggerEdgeChanges:b,elementsSelectable:p}=x();if(!p)return;const y=N.reduce((S,C)=>C.selected?[...S,Or(C.id,!1)]:S,[]),j=v.reduce((S,C)=>C.selected?[...S,Or(C.id,!1)]:S,[]);g(y),b(j)},setNodeExtent:v=>{const{nodes:N,nodeLookup:g,parentLookup:b,nodeOrigin:p,elevateNodesOnSelect:y,nodeExtent:j}=x();v[0][0]===j[0][0]&&v[0][1]===j[0][1]&&v[1][0]===j[1][0]&&v[1][1]===j[1][1]||(ig(N,g,b,{nodeOrigin:p,nodeExtent:v,elevateNodesOnSelect:y,checkEquality:!1}),f({nodeExtent:v}))},panBy:v=>{const{transform:N,width:g,height:b,panZoom:p,translateExtent:y}=x();return OA({delta:v,panZoom:p,transform:N,translateExtent:y,width:g,height:b})},setCenter:async(v,N,g)=>{const{width:b,height:p,maxZoom:y,panZoom:j}=x();if(!j)return Promise.resolve(!1);const S=typeof(g==null?void 0:g.zoom)<"u"?g.zoom:y;return await j.setViewport({x:b/2-v*S,y:p/2-N*S,zoom:S},{duration:g==null?void 0:g.duration,ease:g==null?void 0:g.ease,interpolate:g==null?void 0:g.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{f({connection:{...m2}})},updateConnection:v=>{f({connection:v})},reset:()=>f({...fy()})}},Object.is);function uz({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:r,initialHeight:i,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:h,nodeExtent:d,children:f}){const[x]=m.useState(()=>dz({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:u,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:h,nodeExtent:d}));return a.jsx(TO,{value:x,children:a.jsx(KO,{children:f})})}function hz({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:r,width:i,height:o,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:h,nodeOrigin:d,nodeExtent:f}){return m.useContext(ef)?a.jsx(a.Fragment,{children:e}):a.jsx(uz,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:r,initialWidth:i,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:h,nodeOrigin:d,nodeExtent:f,children:e})}const fz={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function mz({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:r,nodeTypes:i,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:h,onMoveStart:d,onMoveEnd:f,onConnect:x,onConnectStart:w,onConnectEnd:v,onClickConnectStart:N,onClickConnectEnd:g,onNodeMouseEnter:b,onNodeMouseMove:p,onNodeMouseLeave:y,onNodeContextMenu:j,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:T,onNodeDragStop:A,onNodesDelete:P,onEdgesDelete:U,onDelete:O,onSelectionChange:V,onSelectionDragStart:k,onSelectionDrag:z,onSelectionDragStop:M,onSelectionContextMenu:_,onSelectionStart:E,onSelectionEnd:D,onBeforeDelete:L,connectionMode:W,connectionLineType:R=Ga.Bezier,connectionLineStyle:H,connectionLineComponent:q,connectionLineContainerStyle:X,deleteKeyCode:ne="Backspace",selectionKeyCode:ae="Shift",selectionOnDrag:J=!1,selectionMode:$=gc.Full,panActivationKeyCode:te="Space",multiSelectionKeyCode:K=vc()?"Meta":"Control",zoomActivationKeyCode:B=vc()?"Meta":"Control",snapToGrid:G,snapGrid:re,onlyRenderVisibleElements:ce=!1,selectNodesOnDrag:ue,nodesDraggable:ve,autoPanOnNodeFocus:ze,nodesConnectable:_e,nodesFocusable:Mt,nodeOrigin:St=Z2,edgesFocusable:Le,edgesReconnectable:De,elementsSelectable:nt=!0,defaultViewport:ht=VO,minZoom:vt=.5,maxZoom:Gt=2,translateExtent:Yt=xc,preventScrolling:se=!0,nodeExtent:fe,defaultMarkerColor:Re="#b1b1b7",zoomOnScroll:I=!0,zoomOnPinch:le=!0,panOnScroll:me=!1,panOnScrollSpeed:he=.5,panOnScrollMode:Ue=Xr.Free,zoomOnDoubleClick:Ae=!0,panOnDrag:Oe=!0,onPaneClick:we,onPaneMouseEnter:Be,onPaneMouseMove:Ce,onPaneMouseLeave:We,onPaneScroll:Z,onPaneContextMenu:ee,paneClickDistance:pe=1,nodeClickDistance:He=0,children:Je,onReconnect:Qe,onReconnectStart:qe,onReconnectEnd:Zt,onEdgeContextMenu:Ss,onEdgeDoubleClick:cn,onEdgeMouseEnter:Qt,onEdgeMouseMove:yi,onEdgeMouseLeave:Sn,reconnectRadius:sd=10,onNodesChange:Qo,onEdgesChange:Ko,noDragClassName:jf="nodrag",noWheelClassName:Sf="nowheel",noPanClassName:Cr="nopan",fitView:Jo,fitViewOptions:ad,connectOnClick:wi,attributionPosition:Ni,proOptions:ji,defaultEdgeOptions:el,elevateNodesOnSelect:rd,elevateEdgesOnSelect:Ea,disableKeyboardA11y:Cs=!1,autoPanOnConnect:ka,autoPanOnNodeDrag:Si,autoPanSpeed:id,connectionRadius:Cf,isValidConnection:Ma,onError:Ta,style:tl,id:od,nodeDragThreshold:Ef,connectionDragThreshold:T0,viewport:ld,onViewportChange:mt,width:cd,height:dd,colorMode:kf="light",debug:nl,onScroll:Er,ariaLabelConfig:Mf,...Tf},ud){const de=od||"1",xe=WO(kf),ge=m.useCallback(oe=>{oe.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Er==null||Er(oe)},[Er]);return a.jsx("div",{"data-testid":"rf__wrapper",...Tf,onScroll:ge,style:{...tl,...fz},ref:ud,className:$t(["react-flow",r,xe]),id:od,role:"application",children:a.jsxs(hz,{nodes:e,edges:t,width:cd,height:dd,fitView:Jo,fitViewOptions:ad,minZoom:vt,maxZoom:Gt,nodeOrigin:St,nodeExtent:fe,children:[a.jsx(cz,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:b,onNodeMouseMove:p,onNodeMouseLeave:y,onNodeContextMenu:j,onNodeDoubleClick:S,nodeTypes:i,edgeTypes:o,connectionLineType:R,connectionLineStyle:H,connectionLineComponent:q,connectionLineContainerStyle:X,selectionKeyCode:ae,selectionOnDrag:J,selectionMode:$,deleteKeyCode:ne,multiSelectionKeyCode:K,panActivationKeyCode:te,zoomActivationKeyCode:B,onlyRenderVisibleElements:ce,defaultViewport:ht,translateExtent:Yt,minZoom:vt,maxZoom:Gt,preventScrolling:se,zoomOnScroll:I,zoomOnPinch:le,zoomOnDoubleClick:Ae,panOnScroll:me,panOnScrollSpeed:he,panOnScrollMode:Ue,panOnDrag:Oe,onPaneClick:we,onPaneMouseEnter:Be,onPaneMouseMove:Ce,onPaneMouseLeave:We,onPaneScroll:Z,onPaneContextMenu:ee,paneClickDistance:pe,nodeClickDistance:He,onSelectionContextMenu:_,onSelectionStart:E,onSelectionEnd:D,onReconnect:Qe,onReconnectStart:qe,onReconnectEnd:Zt,onEdgeContextMenu:Ss,onEdgeDoubleClick:cn,onEdgeMouseEnter:Qt,onEdgeMouseMove:yi,onEdgeMouseLeave:Sn,reconnectRadius:sd,defaultMarkerColor:Re,noDragClassName:jf,noWheelClassName:Sf,noPanClassName:Cr,rfId:de,disableKeyboardA11y:Cs,nodeExtent:fe,viewport:ld,onViewportChange:mt}),a.jsx(IO,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:x,onConnectStart:w,onConnectEnd:v,onClickConnectStart:N,onClickConnectEnd:g,nodesDraggable:ve,autoPanOnNodeFocus:ze,nodesConnectable:_e,nodesFocusable:Mt,edgesFocusable:Le,edgesReconnectable:De,elementsSelectable:nt,elevateNodesOnSelect:rd,elevateEdgesOnSelect:Ea,minZoom:vt,maxZoom:Gt,nodeExtent:fe,onNodesChange:Qo,onEdgesChange:Ko,snapToGrid:G,snapGrid:re,connectionMode:W,translateExtent:Yt,connectOnClick:wi,defaultEdgeOptions:el,fitView:Jo,fitViewOptions:ad,onNodesDelete:P,onEdgesDelete:U,onDelete:O,onNodeDragStart:C,onNodeDrag:T,onNodeDragStop:A,onSelectionDrag:z,onSelectionDragStart:k,onSelectionDragStop:M,onMove:h,onMoveStart:d,onMoveEnd:f,noPanClassName:Cr,nodeOrigin:St,rfId:de,autoPanOnConnect:ka,autoPanOnNodeDrag:Si,autoPanSpeed:id,onError:Ta,connectionRadius:Cf,isValidConnection:Ma,selectNodesOnDrag:ue,nodeDragThreshold:Ef,connectionDragThreshold:T0,onBeforeDelete:L,debug:nl,ariaLabelConfig:Mf}),a.jsx(HO,{onSelectionChange:V}),Je,a.jsx(UO,{proOptions:ji,position:Ni}),a.jsx(RO,{rfId:de,disableKeyboardA11y:Cs})]})})}var xz=eS(mz);function gz(e){const[t,n]=m.useState(e),s=m.useCallback(r=>n(i=>K2(r,i)),[]);return[t,n,s]}function pz(e){const[t,n]=m.useState(e),s=m.useCallback(r=>n(i=>J2(r,i)),[]);return[t,n,s]}function vz({dimensions:e,lineWidth:t,variant:n,className:s}){return a.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:$t(["react-flow__background-pattern",n,s])})}function bz({radius:e,className:t}){return a.jsx("circle",{cx:e,cy:e,r:e,className:$t(["react-flow__background-pattern","dots",t])})}var ga;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ga||(ga={}));const yz={[ga.Dots]:1,[ga.Lines]:1,[ga.Cross]:6},wz=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function SS({id:e,variant:t=ga.Dots,gap:n=20,size:s,lineWidth:r=1,offset:i=0,color:o,bgColor:l,style:c,className:u,patternClassName:h}){const d=m.useRef(null),{transform:f,patternId:x}=Ze(wz,kt),w=s||yz[t],v=t===ga.Dots,N=t===ga.Cross,g=Array.isArray(n)?n:[n,n],b=[g[0]*f[2]||1,g[1]*f[2]||1],p=w*f[2],y=Array.isArray(i)?i:[i,i],j=N?[p,p]:b,S=[y[0]*f[2]||1+j[0]/2,y[1]*f[2]||1+j[1]/2],C=`${x}${e||""}`;return a.jsxs("svg",{className:$t(["react-flow__background",u]),style:{...c,...nf,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:d,"data-testid":"rf__background",children:[a.jsx("pattern",{id:C,x:f[0]%b[0],y:f[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:v?a.jsx(bz,{radius:p/2,className:h}):a.jsx(vz,{dimensions:j,lineWidth:r,variant:t,className:h})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}SS.displayName="Background";const Nz=m.memo(SS);function jz(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:a.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Sz(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:a.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Cz(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:a.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Ez(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function kz(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Ud({children:e,className:t,...n}){return a.jsx("button",{type:"button",className:$t(["react-flow__controls-button",t]),...n,children:e})}const Mz=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function CS({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:u,children:h,position:d="bottom-left",orientation:f="vertical","aria-label":x}){const w=jt(),{isInteractive:v,minZoomReached:N,maxZoomReached:g,ariaLabelConfig:b}=Ze(Mz,kt),{zoomIn:p,zoomOut:y,fitView:j}=Xp(),S=()=>{p(),i==null||i()},C=()=>{y(),o==null||o()},T=()=>{j(r),l==null||l()},A=()=>{w.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),c==null||c(!v)},P=f==="horizontal"?"horizontal":"vertical";return a.jsxs(tf,{className:$t(["react-flow__controls",P,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":x??b["controls.ariaLabel"],children:[t&&a.jsxs(a.Fragment,{children:[a.jsx(Ud,{onClick:S,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:g,children:a.jsx(jz,{})}),a.jsx(Ud,{onClick:C,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:N,children:a.jsx(Sz,{})})]}),n&&a.jsx(Ud,{className:"react-flow__controls-fitview",onClick:T,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:a.jsx(Cz,{})}),s&&a.jsx(Ud,{className:"react-flow__controls-interactive",onClick:A,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:v?a.jsx(kz,{}):a.jsx(Ez,{})}),h]})}CS.displayName="Controls";const Tz=m.memo(CS);function Dz({id:e,x:t,y:n,width:s,height:r,style:i,color:o,strokeColor:l,strokeWidth:c,className:u,borderRadius:h,shapeRendering:d,selected:f,onClick:x}){const{background:w,backgroundColor:v}=i||{},N=o||w||v;return a.jsx("rect",{className:$t(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:h,ry:h,width:s,height:r,style:{fill:N,stroke:l,strokeWidth:c},shapeRendering:d,onClick:x?g=>x(g,e):void 0})}const _z=m.memo(Dz),Az=e=>e.nodes.map(t=>t.id),Nm=e=>e instanceof Function?e:()=>e;function Oz({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:r,nodeComponent:i=_z,onClick:o}){const l=Ze(Az,kt),c=Nm(t),u=Nm(e),h=Nm(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(f=>a.jsx(Rz,{id:f,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:h,nodeBorderRadius:s,nodeStrokeWidth:r,NodeComponent:i,onClick:o,shapeRendering:d},f))})}function zz({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:u,x:h,y:d,width:f,height:x}=Ze(w=>{const{internals:v}=w.nodeLookup.get(e),N=v.userNode,{x:g,y:b}=v.positionAbsolute,{width:p,height:y}=Ca(N);return{node:N,x:g,y:b,width:p,height:y}},kt);return!u||u.hidden||!w2(u)?null:a.jsx(l,{x:h,y:d,width:f,height:x,style:u.style,selected:!!u.selected,className:s(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:i,shapeRendering:o,onClick:c,id:u.id})}const Rz=m.memo(zz);var Uz=m.memo(Oz);const $z=200,Lz=150,Pz=e=>!e.hidden,Bz=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?y2(Wc(e.nodeLookup,{filter:Pz}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Hz="react-flow__minimap-desc";function ES({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:h,maskStrokeWidth:d,position:f="bottom-right",onClick:x,onNodeClick:w,pannable:v=!1,zoomable:N=!1,ariaLabel:g,inversePan:b,zoomStep:p=1,offsetScale:y=5}){const j=jt(),S=m.useRef(null),{boundingRect:C,viewBB:T,rfId:A,panZoom:P,translateExtent:U,flowWidth:O,flowHeight:V,ariaLabelConfig:k}=Ze(Bz,kt),z=(e==null?void 0:e.width)??$z,M=(e==null?void 0:e.height)??Lz,_=C.width/z,E=C.height/M,D=Math.max(_,E),L=D*z,W=D*M,R=y*D,H=C.x-(L-C.width)/2-R,q=C.y-(W-C.height)/2-R,X=L+R*2,ne=W+R*2,ae=`${Hz}-${A}`,J=m.useRef(0),$=m.useRef();J.current=D,m.useEffect(()=>{if(S.current&&P)return $.current=VA({domNode:S.current,panZoom:P,getTransform:()=>j.getState().transform,getViewScale:()=>J.current}),()=>{var G;(G=$.current)==null||G.destroy()}},[P]),m.useEffect(()=>{var G;(G=$.current)==null||G.update({translateExtent:U,width:O,height:V,inversePan:b,pannable:v,zoomStep:p,zoomable:N})},[v,N,b,p,U,O,V]);const te=x?G=>{var ue;const[re,ce]=((ue=$.current)==null?void 0:ue.pointer(G))||[0,0];x(G,{x:re,y:ce})}:void 0,K=w?m.useCallback((G,re)=>{const ce=j.getState().nodeLookup.get(re).internals.userNode;w(G,ce)},[]):void 0,B=g??k["minimap.ariaLabel"];return a.jsx(tf,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*D:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:$t(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:z,height:M,viewBox:`${H} ${q} ${X} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ae,ref:S,onClick:te,children:[B&&a.jsx("title",{id:ae,children:B}),a.jsx(Uz,{onClick:K,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:o,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${H-R},${q-R}h${X+R*2}v${ne+R*2}h${-X-R*2}z
|
|
98
|
-
M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ES.displayName="MiniMap";const Vz=m.memo(ES),Yz=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Fz={[_o.Line]:"right",[_o.Handle]:"bottom-right"};function Iz({nodeId:e,position:t,variant:n=_o.Handle,className:s,style:r=void 0,children:i,color:o,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:x=!0,shouldResize:w,onResizeStart:v,onResize:N,onResizeEnd:g}){const b=aS(),p=typeof e=="string"?e:b,y=jt(),j=m.useRef(null),S=n===_o.Handle,C=Ze(m.useCallback(Yz(S&&x),[S,x]),kt),T=m.useRef(null),A=t??Fz[n];m.useEffect(()=>{if(!(!j.current||!p))return T.current||(T.current=nO({domNode:j.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:U,transform:O,snapGrid:V,snapToGrid:k,nodeOrigin:z,domNode:M}=y.getState();return{nodeLookup:U,transform:O,snapGrid:V,snapToGrid:k,nodeOrigin:z,paneDomNode:M}},onChange:(U,O)=>{const{triggerNodeChanges:V,nodeLookup:k,parentLookup:z,nodeOrigin:M}=y.getState(),_=[],E={x:U.x,y:U.y},D=k.get(p);if(D&&D.expandParent&&D.parentId){const L=D.origin??M,W=U.width??D.measured.width??0,R=U.height??D.measured.height??0,H={id:D.id,parentId:D.parentId,rect:{width:W,height:R,...N2({x:U.x??D.position.x,y:U.y??D.position.y},{width:W,height:R},D.parentId,k,L)}},q=qp([H],k,z,M);_.push(...q),E.x=U.x?Math.max(L[0]*W,U.x):void 0,E.y=U.y?Math.max(L[1]*R,U.y):void 0}if(E.x!==void 0&&E.y!==void 0){const L={id:p,type:"position",position:{...E}};_.push(L)}if(U.width!==void 0&&U.height!==void 0){const W={id:p,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:U.width,height:U.height}};_.push(W)}for(const L of O){const W={...L,type:"position"};_.push(W)}V(_)},onEnd:({width:U,height:O})=>{const V={id:p,type:"dimensions",resizing:!1,dimensions:{width:U,height:O}};y.getState().triggerNodeChanges([V])}})),T.current.update({controlPosition:A,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:h},keepAspectRatio:d,resizeDirection:f,onResizeStart:v,onResize:N,onResizeEnd:g,shouldResize:w}),()=>{var U;(U=T.current)==null||U.destroy()}},[A,l,c,u,h,d,v,N,g,w]);const P=A.split("-");return a.jsx("div",{className:$t(["react-flow__resize-control","nodrag",...P,n,s]),ref:j,style:{...r,scale:C,...o&&{[S?"backgroundColor":"borderColor"]:o}},children:i})}m.memo(Iz);/**
|
|
99
|
-
* @license lucide-react v0.294.0 - ISC
|
|
100
|
-
*
|
|
101
|
-
* This source code is licensed under the ISC license.
|
|
102
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
-
*/var Wz={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"};/**
|
|
104
|
-
* @license lucide-react v0.294.0 - ISC
|
|
105
|
-
*
|
|
106
|
-
* This source code is licensed under the ISC license.
|
|
107
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
-
*/const qz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Se=(e,t)=>{const n=m.forwardRef(({color:s="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:l="",children:c,...u},h)=>m.createElement("svg",{ref:h,...Wz,width:r,height:r,stroke:s,strokeWidth:o?Number(i)*24/Number(r):i,className:["lucide",`lucide-${qz(e)}`,l].join(" "),...u},[...t.map(([d,f])=>m.createElement(d,f)),...Array.isArray(c)?c:[c]]));return n.displayName=`${e}`,n};/**
|
|
109
|
-
* @license lucide-react v0.294.0 - ISC
|
|
110
|
-
*
|
|
111
|
-
* This source code is licensed under the ISC license.
|
|
112
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
-
*/const Ms=Se("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
114
|
-
* @license lucide-react v0.294.0 - ISC
|
|
115
|
-
*
|
|
116
|
-
* This source code is licensed under the ISC license.
|
|
117
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
-
*/const Xz=Se("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
119
|
-
* @license lucide-react v0.294.0 - ISC
|
|
120
|
-
*
|
|
121
|
-
* This source code is licensed under the ISC license.
|
|
122
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
-
*/const Gz=Se("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
|
|
124
|
-
* @license lucide-react v0.294.0 - ISC
|
|
125
|
-
*
|
|
126
|
-
* This source code is licensed under the ISC license.
|
|
127
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
-
*/const $d=Se("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
|
129
|
-
* @license lucide-react v0.294.0 - ISC
|
|
130
|
-
*
|
|
131
|
-
* This source code is licensed under the ISC license.
|
|
132
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
-
*/const my=Se("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
134
|
-
* @license lucide-react v0.294.0 - ISC
|
|
135
|
-
*
|
|
136
|
-
* This source code is licensed under the ISC license.
|
|
137
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
-
*/const Zz=Se("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
|
|
139
|
-
* @license lucide-react v0.294.0 - ISC
|
|
140
|
-
*
|
|
141
|
-
* This source code is licensed under the ISC license.
|
|
142
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
-
*/const _s=Se("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
|
|
144
|
-
* @license lucide-react v0.294.0 - ISC
|
|
145
|
-
*
|
|
146
|
-
* This source code is licensed under the ISC license.
|
|
147
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
-
*/const lh=Se("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]);/**
|
|
149
|
-
* @license lucide-react v0.294.0 - ISC
|
|
150
|
-
*
|
|
151
|
-
* This source code is licensed under the ISC license.
|
|
152
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
-
*/const Lt=Se("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
154
|
-
* @license lucide-react v0.294.0 - ISC
|
|
155
|
-
*
|
|
156
|
-
* This source code is licensed under the ISC license.
|
|
157
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
-
*/const cg=Se("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
159
|
-
* @license lucide-react v0.294.0 - ISC
|
|
160
|
-
*
|
|
161
|
-
* This source code is licensed under the ISC license.
|
|
162
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
-
*/const af=Se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
164
|
-
* @license lucide-react v0.294.0 - ISC
|
|
165
|
-
*
|
|
166
|
-
* This source code is licensed under the ISC license.
|
|
167
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
-
*/const kS=Se("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
169
|
-
* @license lucide-react v0.294.0 - ISC
|
|
170
|
-
*
|
|
171
|
-
* This source code is licensed under the ISC license.
|
|
172
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
-
*/const Zp=Se("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
174
|
-
* @license lucide-react v0.294.0 - ISC
|
|
175
|
-
*
|
|
176
|
-
* This source code is licensed under the ISC license.
|
|
177
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
-
*/const Qz=Se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
179
|
-
* @license lucide-react v0.294.0 - ISC
|
|
180
|
-
*
|
|
181
|
-
* This source code is licensed under the ISC license.
|
|
182
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
-
*/const dg=Se("Clock1",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 14.5 8",key:"12zbmj"}]]);/**
|
|
184
|
-
* @license lucide-react v0.294.0 - ISC
|
|
185
|
-
*
|
|
186
|
-
* This source code is licensed under the ISC license.
|
|
187
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
-
*/const Ld=Se("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
189
|
-
* @license lucide-react v0.294.0 - ISC
|
|
190
|
-
*
|
|
191
|
-
* This source code is licensed under the ISC license.
|
|
192
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
-
*/const xy=Se("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
194
|
-
* @license lucide-react v0.294.0 - ISC
|
|
195
|
-
*
|
|
196
|
-
* This source code is licensed under the ISC license.
|
|
197
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
-
*/const gy=Se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
199
|
-
* @license lucide-react v0.294.0 - ISC
|
|
200
|
-
*
|
|
201
|
-
* This source code is licensed under the ISC license.
|
|
202
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
-
*/const yt=Se("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
204
|
-
* @license lucide-react v0.294.0 - ISC
|
|
205
|
-
*
|
|
206
|
-
* This source code is licensed under the ISC license.
|
|
207
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
-
*/const MS=Se("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
209
|
-
* @license lucide-react v0.294.0 - ISC
|
|
210
|
-
*
|
|
211
|
-
* This source code is licensed under the ISC license.
|
|
212
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
-
*/const Kz=Se("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
|
|
214
|
-
* @license lucide-react v0.294.0 - ISC
|
|
215
|
-
*
|
|
216
|
-
* This source code is licensed under the ISC license.
|
|
217
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
-
*/const Gc=Se("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
219
|
-
* @license lucide-react v0.294.0 - ISC
|
|
220
|
-
*
|
|
221
|
-
* This source code is licensed under the ISC license.
|
|
222
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
-
*/const Qp=Se("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
224
|
-
* @license lucide-react v0.294.0 - ISC
|
|
225
|
-
*
|
|
226
|
-
* This source code is licensed under the ISC license.
|
|
227
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
-
*/const Jz=Se("Fingerprint",[["path",{d:"M2 12C2 6.5 6.5 2 12 2a10 10 0 0 1 8 4",key:"1jc9o5"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12c0-.7.12-1.37.34-2",key:"1mxgy1"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2c0 .47 0 1.17-.02 2",key:"1fgabc"}]]);/**
|
|
229
|
-
* @license lucide-react v0.294.0 - ISC
|
|
230
|
-
*
|
|
231
|
-
* This source code is licensed under the ISC license.
|
|
232
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
-
*/const eR=Se("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
|
|
234
|
-
* @license lucide-react v0.294.0 - ISC
|
|
235
|
-
*
|
|
236
|
-
* This source code is licensed under the ISC license.
|
|
237
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
-
*/const nn=Se("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
239
|
-
* @license lucide-react v0.294.0 - ISC
|
|
240
|
-
*
|
|
241
|
-
* This source code is licensed under the ISC license.
|
|
242
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
-
*/const tR=Se("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
|
|
244
|
-
* @license lucide-react v0.294.0 - ISC
|
|
245
|
-
*
|
|
246
|
-
* This source code is licensed under the ISC license.
|
|
247
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
-
*/const Pd=Se("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
249
|
-
* @license lucide-react v0.294.0 - ISC
|
|
250
|
-
*
|
|
251
|
-
* This source code is licensed under the ISC license.
|
|
252
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
-
*/const ch=Se("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/**
|
|
254
|
-
* @license lucide-react v0.294.0 - ISC
|
|
255
|
-
*
|
|
256
|
-
* This source code is licensed under the ISC license.
|
|
257
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
-
*/const nR=Se("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
259
|
-
* @license lucide-react v0.294.0 - ISC
|
|
260
|
-
*
|
|
261
|
-
* This source code is licensed under the ISC license.
|
|
262
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
-
*/const Vs=Se("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]]);/**
|
|
264
|
-
* @license lucide-react v0.294.0 - ISC
|
|
265
|
-
*
|
|
266
|
-
* This source code is licensed under the ISC license.
|
|
267
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
-
*/const mu=Se("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
269
|
-
* @license lucide-react v0.294.0 - ISC
|
|
270
|
-
*
|
|
271
|
-
* This source code is licensed under the ISC license.
|
|
272
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
273
|
-
*/const dh=Se("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
|
|
274
|
-
* @license lucide-react v0.294.0 - ISC
|
|
275
|
-
*
|
|
276
|
-
* This source code is licensed under the ISC license.
|
|
277
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
-
*/const sR=Se("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
279
|
-
* @license lucide-react v0.294.0 - ISC
|
|
280
|
-
*
|
|
281
|
-
* This source code is licensed under the ISC license.
|
|
282
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
283
|
-
*/const aR=Se("MoreVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
|
|
284
|
-
* @license lucide-react v0.294.0 - ISC
|
|
285
|
-
*
|
|
286
|
-
* This source code is licensed under the ISC license.
|
|
287
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
-
*/const ii=Se("PenSquare",[["path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1qinfi"}],["path",{d:"M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4Z",key:"w2jsv5"}]]);/**
|
|
289
|
-
* @license lucide-react v0.294.0 - ISC
|
|
290
|
-
*
|
|
291
|
-
* This source code is licensed under the ISC license.
|
|
292
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
-
*/const dr=Se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
294
|
-
* @license lucide-react v0.294.0 - ISC
|
|
295
|
-
*
|
|
296
|
-
* This source code is licensed under the ISC license.
|
|
297
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
-
*/const py=Se("Puzzle",[["path",{d:"M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.077.877.528 1.073 1.01a2.5 2.5 0 1 0 3.259-3.259c-.482-.196-.933-.558-1.01-1.073-.05-.336.062-.676.303-.917l1.525-1.525A2.402 2.402 0 0 1 12 1.998c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.237 3.237c-.464.18-.894.527-.967 1.02Z",key:"i0oyt7"}]]);/**
|
|
299
|
-
* @license lucide-react v0.294.0 - ISC
|
|
300
|
-
*
|
|
301
|
-
* This source code is licensed under the ISC license.
|
|
302
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
-
*/const ug=Se("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
304
|
-
* @license lucide-react v0.294.0 - ISC
|
|
305
|
-
*
|
|
306
|
-
* This source code is licensed under the ISC license.
|
|
307
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
-
*/const oi=Se("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
309
|
-
* @license lucide-react v0.294.0 - ISC
|
|
310
|
-
*
|
|
311
|
-
* This source code is licensed under the ISC license.
|
|
312
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
-
*/const rR=Se("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
|
|
314
|
-
* @license lucide-react v0.294.0 - ISC
|
|
315
|
-
*
|
|
316
|
-
* This source code is licensed under the ISC license.
|
|
317
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
-
*/const co=Se("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
319
|
-
* @license lucide-react v0.294.0 - ISC
|
|
320
|
-
*
|
|
321
|
-
* This source code is licensed under the ISC license.
|
|
322
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
-
*/const kn=Se("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]);/**
|
|
324
|
-
* @license lucide-react v0.294.0 - ISC
|
|
325
|
-
*
|
|
326
|
-
* This source code is licensed under the ISC license.
|
|
327
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
-
*/const iR=Se("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
|
|
329
|
-
* @license lucide-react v0.294.0 - ISC
|
|
330
|
-
*
|
|
331
|
-
* This source code is licensed under the ISC license.
|
|
332
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
-
*/const oR=Se("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
334
|
-
* @license lucide-react v0.294.0 - ISC
|
|
335
|
-
*
|
|
336
|
-
* This source code is licensed under the ISC license.
|
|
337
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
338
|
-
*/const vy=Se("TestTube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5h0c-1.4 0-2.5-1.1-2.5-2.5V2",key:"187lwq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]);/**
|
|
339
|
-
* @license lucide-react v0.294.0 - ISC
|
|
340
|
-
*
|
|
341
|
-
* This source code is licensed under the ISC license.
|
|
342
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
-
*/const Kp=Se("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
344
|
-
* @license lucide-react v0.294.0 - ISC
|
|
345
|
-
*
|
|
346
|
-
* This source code is licensed under the ISC license.
|
|
347
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
348
|
-
*/const lR=Se("Trash",[["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"}]]);/**
|
|
349
|
-
* @license lucide-react v0.294.0 - ISC
|
|
350
|
-
*
|
|
351
|
-
* This source code is licensed under the ISC license.
|
|
352
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
-
*/const hg=Se("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
|
|
354
|
-
* @license lucide-react v0.294.0 - ISC
|
|
355
|
-
*
|
|
356
|
-
* This source code is licensed under the ISC license.
|
|
357
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
-
*/const by=Se("User",[["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"}]]);/**
|
|
359
|
-
* @license lucide-react v0.294.0 - ISC
|
|
360
|
-
*
|
|
361
|
-
* This source code is licensed under the ISC license.
|
|
362
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
363
|
-
*/const li=Se("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
364
|
-
* @license lucide-react v0.294.0 - ISC
|
|
365
|
-
*
|
|
366
|
-
* This source code is licensed under the ISC license.
|
|
367
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
368
|
-
*/const TS=Se("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
369
|
-
* @license lucide-react v0.294.0 - ISC
|
|
370
|
-
*
|
|
371
|
-
* This source code is licensed under the ISC license.
|
|
372
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
373
|
-
*/const Ur=Se("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
374
|
-
* @license lucide-react v0.294.0 - ISC
|
|
375
|
-
*
|
|
376
|
-
* This source code is licensed under the ISC license.
|
|
377
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
378
|
-
*/const It=Se("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
379
|
-
* @license lucide-react v0.294.0 - ISC
|
|
380
|
-
*
|
|
381
|
-
* This source code is licensed under the ISC license.
|
|
382
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
383
|
-
*/const jm=Se("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);function DS(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=DS(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function uh(){for(var e,t,n=0,s="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=DS(e))&&(s&&(s+=" "),s+=t);return s}const Jp="-",cR=e=>{const t=uR(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:o=>{const l=o.split(Jp);return l[0]===""&&l.length!==1&&l.shift(),_S(l,t)||dR(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&s[o]?[...c,...s[o]]:c}}},_S=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),r=s?_S(e.slice(1),s):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(Jp);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},yy=/^\[(.+)\]$/,dR=e=>{if(yy.test(e)){const t=yy.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},uR=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return fR(Object.entries(e.classGroups),n).forEach(([i,o])=>{fg(o,s,i,t)}),s},fg=(e,t,n,s)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:wy(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(hR(r)){fg(r(s),t,n,s);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,o])=>{fg(o,wy(t,i),n,s)})})},wy=(e,t)=>{let n=e;return t.split(Jp).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},hR=e=>e.isThemeGetter,fR=(e,t)=>t?e.map(([n,s])=>{const r=s.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[n,r]}):e,mR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const r=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,s=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=s.get(i))!==void 0)return r(i,o),o},set(i,o){n.has(i)?n.set(i,o):r(i,o)}}},AS="!",xR=e=>{const{separator:t,experimentalParseClassName:n}=e,s=t.length===1,r=t[0],i=t.length,o=l=>{const c=[];let u=0,h=0,d;for(let N=0;N<l.length;N++){let g=l[N];if(u===0){if(g===r&&(s||l.slice(N,N+i)===t)){c.push(l.slice(h,N)),h=N+i;continue}if(g==="/"){d=N;continue}}g==="["?u++:g==="]"&&u--}const f=c.length===0?l:l.substring(h),x=f.startsWith(AS),w=x?f.substring(1):f,v=d&&d>h?d-h:void 0;return{modifiers:c,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:o}):o},gR=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(s=>{s[0]==="["?(t.push(...n.sort(),s),n=[]):n.push(s)}),t.push(...n.sort()),t},pR=e=>({cache:mR(e.cacheSize),parseClassName:xR(e),...cR(e)}),vR=/\s+/,bR=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:r}=t,i=[],o=e.trim().split(vR);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:h,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:x}=n(u);let w=!!x,v=s(w?f.substring(0,x):f);if(!v){if(!w){l=u+(l.length>0?" "+l:l);continue}if(v=s(f),!v){l=u+(l.length>0?" "+l:l);continue}w=!1}const N=gR(h).join(":"),g=d?N+AS:N,b=g+v;if(i.includes(b))continue;i.push(b);const p=r(v,w);for(let y=0;y<p.length;++y){const j=p[y];i.push(g+j)}l=u+(l.length>0?" "+l:l)}return l};function yR(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=OS(t))&&(s&&(s+=" "),s+=n);return s}const OS=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=OS(e[s]))&&(n&&(n+=" "),n+=t);return n};function wR(e,...t){let n,s,r,i=o;function o(c){const u=t.reduce((h,d)=>d(h),e());return n=pR(u),s=n.cache.get,r=n.cache.set,i=l,l(c)}function l(c){const u=s(c);if(u)return u;const h=bR(c,n);return r(c,h),h}return function(){return i(yR.apply(null,arguments))}}const xt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},zS=/^\[(?:([a-z-]+):)?(.+)\]$/i,NR=/^\d+\/\d+$/,jR=new Set(["px","full","screen"]),SR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,CR=/\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$/,ER=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,kR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,MR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,na=e=>uo(e)||jR.has(e)||NR.test(e),Ra=e=>qo(e,"length",UR),uo=e=>!!e&&!Number.isNaN(Number(e)),Sm=e=>qo(e,"number",uo),ml=e=>!!e&&Number.isInteger(Number(e)),TR=e=>e.endsWith("%")&&uo(e.slice(0,-1)),$e=e=>zS.test(e),Ua=e=>SR.test(e),DR=new Set(["length","size","percentage"]),_R=e=>qo(e,DR,RS),AR=e=>qo(e,"position",RS),OR=new Set(["image","url"]),zR=e=>qo(e,OR,LR),RR=e=>qo(e,"",$R),xl=()=>!0,qo=(e,t,n)=>{const s=zS.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},UR=e=>CR.test(e)&&!ER.test(e),RS=()=>!1,$R=e=>kR.test(e),LR=e=>MR.test(e),PR=()=>{const e=xt("colors"),t=xt("spacing"),n=xt("blur"),s=xt("brightness"),r=xt("borderColor"),i=xt("borderRadius"),o=xt("borderSpacing"),l=xt("borderWidth"),c=xt("contrast"),u=xt("grayscale"),h=xt("hueRotate"),d=xt("invert"),f=xt("gap"),x=xt("gradientColorStops"),w=xt("gradientColorStopPositions"),v=xt("inset"),N=xt("margin"),g=xt("opacity"),b=xt("padding"),p=xt("saturate"),y=xt("scale"),j=xt("sepia"),S=xt("skew"),C=xt("space"),T=xt("translate"),A=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",$e,t],O=()=>[$e,t],V=()=>["",na,Ra],k=()=>["auto",uo,$e],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],_=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],E=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",$e],L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>[uo,$e];return{cacheSize:500,separator:":",theme:{colors:[xl],spacing:[na,Ra],blur:["none","",Ua,$e],brightness:W(),borderColor:[e],borderRadius:["none","","full",Ua,$e],borderSpacing:O(),borderWidth:V(),contrast:W(),grayscale:D(),hueRotate:W(),invert:D(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[TR,Ra],inset:U(),margin:U(),opacity:W(),padding:O(),saturate:W(),scale:W(),sepia:D(),skew:W(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",$e]}],container:["container"],columns:[{columns:[Ua]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...z(),$e]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ml,$e]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$e]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",ml,$e]}],"grid-cols":[{"grid-cols":[xl]}],"col-start-end":[{col:["auto",{span:["full",ml,$e]},$e]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[xl]}],"row-start-end":[{row:["auto",{span:[ml,$e]},$e]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$e]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...E()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...E(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...E(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[N]}],mx:[{mx:[N]}],my:[{my:[N]}],ms:[{ms:[N]}],me:[{me:[N]}],mt:[{mt:[N]}],mr:[{mr:[N]}],mb:[{mb:[N]}],ml:[{ml:[N]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$e,t]}],"min-w":[{"min-w":[$e,t,"min","max","fit"]}],"max-w":[{"max-w":[$e,t,"none","full","min","max","fit","prose",{screen:[Ua]},Ua]}],h:[{h:[$e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ua,Ra]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Sm]}],"font-family":[{font:[xl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",$e]}],"line-clamp":[{"line-clamp":["none",uo,Sm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",na,$e]}],"list-image":[{"list-image":["none",$e]}],"list-style-type":[{list:["none","disc","decimal",$e]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",na,Ra]}],"underline-offset":[{"underline-offset":["auto",na,$e]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...z(),AR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",_R]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},zR]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:M()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...M()]}],"outline-offset":[{"outline-offset":[na,$e]}],"outline-w":[{outline:[na,Ra]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[na,Ra]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ua,RR]}],"shadow-color":[{shadow:[xl]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[..._(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":_()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Ua,$e]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[p]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[p]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$e]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",$e]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",$e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[ml,$e]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$e]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",$e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[na,Ra,Sm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},BR=wR(PR);function Me(...e){return BR(uh(e))}function Bt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Ny(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xr(...e){return t=>{let n=!1;const s=e.map(r=>{const i=Ny(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r<s.length;r++){const i=s[r];typeof i=="function"?i():Ny(e[r],null)}}}}function Fn(...e){return m.useCallback(xr(...e),e)}function HR(e,t){const n=m.createContext(t),s=i=>{const{children:o,...l}=i,c=m.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:o})};s.displayName=e+"Provider";function r(i){const o=m.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[s,r]}function rf(e,t=[]){let n=[];function s(i,o){const l=m.createContext(o),c=n.length;n=[...n,o];const u=d=>{var g;const{scope:f,children:x,...w}=d,v=((g=f==null?void 0:f[e])==null?void 0:g[c])||l,N=m.useMemo(()=>w,Object.values(w));return a.jsx(v.Provider,{value:N,children:x})};u.displayName=i+"Provider";function h(d,f){var v;const x=((v=f==null?void 0:f[e])==null?void 0:v[c])||l,w=m.useContext(x);if(w)return w;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,h]}const r=()=>{const i=n.map(o=>m.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return r.scopeName=e,[s,VR(r,...t)]}function VR(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const o=s.reduce((l,{useScope:c,scopeName:u})=>{const d=c(i)[`__scope${u}`];return{...l,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function e0(e){const t=YR(e),n=m.forwardRef((s,r)=>{const{children:i,...o}=s,l=m.Children.toArray(i),c=l.find(IR);if(c){const u=c.props.children,h=l.map(d=>d===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...o,ref:r,children:m.isValidElement(u)?m.cloneElement(u,void 0,h):null})}return a.jsx(t,{...o,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function YR(e){const t=m.forwardRef((n,s)=>{const{children:r,...i}=n;if(m.isValidElement(r)){const o=qR(r),l=WR(i,r.props);return r.type!==m.Fragment&&(l.ref=s?xr(s,o):o),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var US=Symbol("radix.slottable");function FR(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=US,t}function IR(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===US}function WR(e,t){const n={...t};for(const s in t){const r=e[s],i=t[s];/^on[A-Z]/.test(s)?r&&i?n[s]=(...l)=>{const c=i(...l);return r(...l),c}:r&&(n[s]=r):s==="style"?n[s]={...r,...i}:s==="className"&&(n[s]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function qR(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var XR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ln=XR.reduce((e,t)=>{const n=e0(`Primitive.${t}`),s=m.forwardRef((r,i)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function GR(e,t){e&&Mh.flushSync(()=>e.dispatchEvent(t))}function Oo(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function ZR(e,t=globalThis==null?void 0:globalThis.document){const n=Oo(e);m.useEffect(()=>{const s=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var QR="DismissableLayer",mg="dismissableLayer.update",KR="dismissableLayer.pointerDownOutside",JR="dismissableLayer.focusOutside",jy,$S=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),of=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,u=m.useContext($S),[h,d]=m.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=m.useState({}),w=Fn(t,C=>d(C)),v=Array.from(u.layers),[N]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(N),b=h?v.indexOf(h):-1,p=u.layersWithOutsidePointerEventsDisabled.size>0,y=b>=g,j=n8(C=>{const T=C.target,A=[...u.branches].some(P=>P.contains(T));!y||A||(r==null||r(C),o==null||o(C),C.defaultPrevented||l==null||l())},f),S=s8(C=>{const T=C.target;[...u.branches].some(P=>P.contains(T))||(i==null||i(C),o==null||o(C),C.defaultPrevented||l==null||l())},f);return ZR(C=>{b===u.layers.size-1&&(s==null||s(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},f),m.useEffect(()=>{if(h)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(jy=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(h)),u.layers.add(h),Sy(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=jy)}},[h,f,n,u]),m.useEffect(()=>()=>{h&&(u.layers.delete(h),u.layersWithOutsidePointerEventsDisabled.delete(h),Sy())},[h,u]),m.useEffect(()=>{const C=()=>x({});return document.addEventListener(mg,C),()=>document.removeEventListener(mg,C)},[]),a.jsx(ln.div,{...c,ref:w,style:{pointerEvents:p?y?"auto":"none":void 0,...e.style},onFocusCapture:Bt(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Bt(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Bt(e.onPointerDownCapture,j.onPointerDownCapture)})});of.displayName=QR;var e8="DismissableLayerBranch",t8=m.forwardRef((e,t)=>{const n=m.useContext($S),s=m.useRef(null),r=Fn(t,s);return m.useEffect(()=>{const i=s.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),a.jsx(ln.div,{...e,ref:r})});t8.displayName=e8;function n8(e,t=globalThis==null?void 0:globalThis.document){const n=Oo(e),s=m.useRef(!1),r=m.useRef(()=>{});return m.useEffect(()=>{const i=l=>{if(l.target&&!s.current){let c=function(){LS(KR,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=c,t.addEventListener("click",r.current,{once:!0})):c()}else t.removeEventListener("click",r.current);s.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function s8(e,t=globalThis==null?void 0:globalThis.document){const n=Oo(e),s=m.useRef(!1);return m.useEffect(()=>{const r=i=>{i.target&&!s.current&&LS(JR,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Sy(){const e=new CustomEvent(mg);document.dispatchEvent(e)}function LS(e,t,n,{discrete:s}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),s?GR(r,i):r.dispatchEvent(i)}var gr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},a8=Ch[" useId ".trim().toString()]||(()=>{}),r8=0;function ps(e){const[t,n]=m.useState(a8());return gr(()=>{n(s=>s??String(r8++))},[e]),e||(t?`radix-${t}`:"")}const i8=["top","right","bottom","left"],pr=Math.min,_n=Math.max,hh=Math.round,Bd=Math.floor,Ys=e=>({x:e,y:e}),o8={left:"right",right:"left",bottom:"top",top:"bottom"},l8={start:"end",end:"start"};function xg(e,t,n){return _n(e,pr(t,n))}function Na(e,t){return typeof e=="function"?e(t):e}function ja(e){return e.split("-")[0]}function Xo(e){return e.split("-")[1]}function t0(e){return e==="x"?"y":"x"}function n0(e){return e==="y"?"height":"width"}const c8=new Set(["top","bottom"]);function Us(e){return c8.has(ja(e))?"y":"x"}function s0(e){return t0(Us(e))}function d8(e,t,n){n===void 0&&(n=!1);const s=Xo(e),r=s0(e),i=n0(r);let o=r==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=fh(o)),[o,fh(o)]}function u8(e){const t=fh(e);return[gg(e),t,gg(t)]}function gg(e){return e.replace(/start|end/g,t=>l8[t])}const Cy=["left","right"],Ey=["right","left"],h8=["top","bottom"],f8=["bottom","top"];function m8(e,t,n){switch(e){case"top":case"bottom":return n?t?Ey:Cy:t?Cy:Ey;case"left":case"right":return t?h8:f8;default:return[]}}function x8(e,t,n,s){const r=Xo(e);let i=m8(ja(e),n==="start",s);return r&&(i=i.map(o=>o+"-"+r),t&&(i=i.concat(i.map(gg)))),i}function fh(e){return e.replace(/left|right|bottom|top/g,t=>o8[t])}function g8(e){return{top:0,right:0,bottom:0,left:0,...e}}function PS(e){return typeof e!="number"?g8(e):{top:e,right:e,bottom:e,left:e}}function mh(e){const{x:t,y:n,width:s,height:r}=e;return{width:s,height:r,top:n,left:t,right:t+s,bottom:n+r,x:t,y:n}}function ky(e,t,n){let{reference:s,floating:r}=e;const i=Us(t),o=s0(t),l=n0(o),c=ja(t),u=i==="y",h=s.x+s.width/2-r.width/2,d=s.y+s.height/2-r.height/2,f=s[l]/2-r[l]/2;let x;switch(c){case"top":x={x:h,y:s.y-r.height};break;case"bottom":x={x:h,y:s.y+s.height};break;case"right":x={x:s.x+s.width,y:d};break;case"left":x={x:s.x-r.width,y:d};break;default:x={x:s.x,y:s.y}}switch(Xo(t)){case"start":x[o]-=f*(n&&u?-1:1);break;case"end":x[o]+=f*(n&&u?-1:1);break}return x}const p8=async(e,t,n)=>{const{placement:s="bottom",strategy:r="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:h,y:d}=ky(u,s,c),f=s,x={},w=0;for(let v=0;v<l.length;v++){const{name:N,fn:g}=l[v],{x:b,y:p,data:y,reset:j}=await g({x:h,y:d,initialPlacement:s,placement:f,strategy:r,middlewareData:x,rects:u,platform:o,elements:{reference:e,floating:t}});h=b??h,d=p??d,x={...x,[N]:{...x[N],...y}},j&&w<=50&&(w++,typeof j=="object"&&(j.placement&&(f=j.placement),j.rects&&(u=j.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:r}):j.rects),{x:h,y:d}=ky(u,f,c)),v=-1)}return{x:h,y:d,placement:f,strategy:r,middlewareData:x}};async function wc(e,t){var n;t===void 0&&(t={});const{x:s,y:r,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:x=0}=Na(t,e),w=PS(x),N=l[f?d==="floating"?"reference":"floating":d],g=mh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(N)))==null||n?N:N.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:h,strategy:c})),b=d==="floating"?{x:s,y:r,width:o.floating.width,height:o.floating.height}:o.reference,p=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),y=await(i.isElement==null?void 0:i.isElement(p))?await(i.getScale==null?void 0:i.getScale(p))||{x:1,y:1}:{x:1,y:1},j=mh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:p,strategy:c}):b);return{top:(g.top-j.top+w.top)/y.y,bottom:(j.bottom-g.bottom+w.bottom)/y.y,left:(g.left-j.left+w.left)/y.x,right:(j.right-g.right+w.right)/y.x}}const v8=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:r,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:h=0}=Na(e,t)||{};if(u==null)return{};const d=PS(h),f={x:n,y:s},x=s0(r),w=n0(x),v=await o.getDimensions(u),N=x==="y",g=N?"top":"left",b=N?"bottom":"right",p=N?"clientHeight":"clientWidth",y=i.reference[w]+i.reference[x]-f[x]-i.floating[w],j=f[x]-i.reference[x],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let C=S?S[p]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=l.floating[p]||i.floating[w]);const T=y/2-j/2,A=C/2-v[w]/2-1,P=pr(d[g],A),U=pr(d[b],A),O=P,V=C-v[w]-U,k=C/2-v[w]/2+T,z=xg(O,k,V),M=!c.arrow&&Xo(r)!=null&&k!==z&&i.reference[w]/2-(k<O?P:U)-v[w]/2<0,_=M?k<O?k-O:k-V:0;return{[x]:f[x]+_,data:{[x]:z,centerOffset:k-z-_,...M&&{alignmentOffset:_}},reset:M}}}),b8=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:r,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:v=!0,...N}=Na(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=ja(r),b=Us(l),p=ja(l)===l,y=await(c.isRTL==null?void 0:c.isRTL(u.floating)),j=f||(p||!v?[fh(l)]:u8(l)),S=w!=="none";!f&&S&&j.push(...x8(l,v,w,y));const C=[l,...j],T=await wc(t,N),A=[];let P=((s=i.flip)==null?void 0:s.overflows)||[];if(h&&A.push(T[g]),d){const k=d8(r,o,y);A.push(T[k[0]],T[k[1]])}if(P=[...P,{placement:r,overflows:A}],!A.every(k=>k<=0)){var U,O;const k=(((U=i.flip)==null?void 0:U.index)||0)+1,z=C[k];if(z&&(!(d==="alignment"?b!==Us(z):!1)||P.every(E=>Us(E.placement)===b?E.overflows[0]>0:!0)))return{data:{index:k,overflows:P},reset:{placement:z}};let M=(O=P.filter(_=>_.overflows[0]<=0).sort((_,E)=>_.overflows[1]-E.overflows[1])[0])==null?void 0:O.placement;if(!M)switch(x){case"bestFit":{var V;const _=(V=P.filter(E=>{if(S){const D=Us(E.placement);return D===b||D==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(D=>D>0).reduce((D,L)=>D+L,0)]).sort((E,D)=>E[1]-D[1])[0])==null?void 0:V[0];_&&(M=_);break}case"initialPlacement":M=l;break}if(r!==M)return{reset:{placement:M}}}return{}}}};function My(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ty(e){return i8.some(t=>e[t]>=0)}const y8=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:s="referenceHidden",...r}=Na(e,t);switch(s){case"referenceHidden":{const i=await wc(t,{...r,elementContext:"reference"}),o=My(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Ty(o)}}}case"escaped":{const i=await wc(t,{...r,altBoundary:!0}),o=My(i,n.floating);return{data:{escapedOffsets:o,escaped:Ty(o)}}}default:return{}}}}},BS=new Set(["left","top"]);async function w8(e,t){const{placement:n,platform:s,elements:r}=e,i=await(s.isRTL==null?void 0:s.isRTL(r.floating)),o=ja(n),l=Xo(n),c=Us(n)==="y",u=BS.has(o)?-1:1,h=i&&c?-1:1,d=Na(t,e);let{mainAxis:f,crossAxis:x,alignmentAxis:w}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof w=="number"&&(x=l==="end"?w*-1:w),c?{x:x*h,y:f*u}:{x:f*u,y:x*h}}const N8=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:r,y:i,placement:o,middlewareData:l}=t,c=await w8(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:o}}}}},j8=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:r}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:N=>{let{x:g,y:b}=N;return{x:g,y:b}}},...c}=Na(e,t),u={x:n,y:s},h=await wc(t,c),d=Us(ja(r)),f=t0(d);let x=u[f],w=u[d];if(i){const N=f==="y"?"top":"left",g=f==="y"?"bottom":"right",b=x+h[N],p=x-h[g];x=xg(b,x,p)}if(o){const N=d==="y"?"top":"left",g=d==="y"?"bottom":"right",b=w+h[N],p=w-h[g];w=xg(b,w,p)}const v=l.fn({...t,[f]:x,[d]:w});return{...v,data:{x:v.x-n,y:v.y-s,enabled:{[f]:i,[d]:o}}}}}},S8=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:r,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Na(e,t),h={x:n,y:s},d=Us(r),f=t0(d);let x=h[f],w=h[d];const v=Na(l,t),N=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const p=f==="y"?"height":"width",y=i.reference[f]-i.floating[p]+N.mainAxis,j=i.reference[f]+i.reference[p]-N.mainAxis;x<y?x=y:x>j&&(x=j)}if(u){var g,b;const p=f==="y"?"width":"height",y=BS.has(ja(r)),j=i.reference[d]-i.floating[p]+(y&&((g=o.offset)==null?void 0:g[d])||0)+(y?0:N.crossAxis),S=i.reference[d]+i.reference[p]+(y?0:((b=o.offset)==null?void 0:b[d])||0)-(y?N.crossAxis:0);w<j?w=j:w>S&&(w=S)}return{[f]:x,[d]:w}}}},C8=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:r,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...u}=Na(e,t),h=await wc(t,u),d=ja(r),f=Xo(r),x=Us(r)==="y",{width:w,height:v}=i.floating;let N,g;d==="top"||d==="bottom"?(N=d,g=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(g=d,N=f==="end"?"top":"bottom");const b=v-h.top-h.bottom,p=w-h.left-h.right,y=pr(v-h[N],b),j=pr(w-h[g],p),S=!t.middlewareData.shift;let C=y,T=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=p),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(C=b),S&&!f){const P=_n(h.left,0),U=_n(h.right,0),O=_n(h.top,0),V=_n(h.bottom,0);x?T=w-2*(P!==0||U!==0?P+U:_n(h.left,h.right)):C=v-2*(O!==0||V!==0?O+V:_n(h.top,h.bottom))}await c({...t,availableWidth:T,availableHeight:C});const A=await o.getDimensions(l.floating);return w!==A.width||v!==A.height?{reset:{rects:!0}}:{}}}};function lf(){return typeof window<"u"}function Go(e){return HS(e)?(e.nodeName||"").toLowerCase():"#document"}function Bn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Gs(e){var t;return(t=(HS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function HS(e){return lf()?e instanceof Node||e instanceof Bn(e).Node:!1}function vs(e){return lf()?e instanceof Element||e instanceof Bn(e).Element:!1}function Is(e){return lf()?e instanceof HTMLElement||e instanceof Bn(e).HTMLElement:!1}function Dy(e){return!lf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Bn(e).ShadowRoot}const E8=new Set(["inline","contents"]);function Zc(e){const{overflow:t,overflowX:n,overflowY:s,display:r}=bs(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!E8.has(r)}const k8=new Set(["table","td","th"]);function M8(e){return k8.has(Go(e))}const T8=[":popover-open",":modal"];function cf(e){return T8.some(t=>{try{return e.matches(t)}catch{return!1}})}const D8=["transform","translate","scale","rotate","perspective"],_8=["transform","translate","scale","rotate","perspective","filter"],A8=["paint","layout","strict","content"];function a0(e){const t=r0(),n=vs(e)?bs(e):e;return D8.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||_8.some(s=>(n.willChange||"").includes(s))||A8.some(s=>(n.contain||"").includes(s))}function O8(e){let t=vr(e);for(;Is(t)&&!zo(t);){if(a0(t))return t;if(cf(t))return null;t=vr(t)}return null}function r0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const z8=new Set(["html","body","#document"]);function zo(e){return z8.has(Go(e))}function bs(e){return Bn(e).getComputedStyle(e)}function df(e){return vs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vr(e){if(Go(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Dy(e)&&e.host||Gs(e);return Dy(t)?t.host:t}function VS(e){const t=vr(e);return zo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Is(t)&&Zc(t)?t:VS(t)}function Nc(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=VS(e),i=r===((s=e.ownerDocument)==null?void 0:s.body),o=Bn(r);if(i){const l=pg(o);return t.concat(o,o.visualViewport||[],Zc(r)?r:[],l&&n?Nc(l):[])}return t.concat(r,Nc(r,[],n))}function pg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function YS(e){const t=bs(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const r=Is(e),i=r?e.offsetWidth:n,o=r?e.offsetHeight:s,l=hh(n)!==i||hh(s)!==o;return l&&(n=i,s=o),{width:n,height:s,$:l}}function i0(e){return vs(e)?e:e.contextElement}function ho(e){const t=i0(e);if(!Is(t))return Ys(1);const n=t.getBoundingClientRect(),{width:s,height:r,$:i}=YS(t);let o=(i?hh(n.width):n.width)/s,l=(i?hh(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const R8=Ys(0);function FS(e){const t=Bn(e);return!r0()||!t.visualViewport?R8:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function U8(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Bn(e)?!1:t}function ci(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=i0(e);let o=Ys(1);t&&(s?vs(s)&&(o=ho(s)):o=ho(e));const l=U8(i,n,s)?FS(i):Ys(0);let c=(r.left+l.x)/o.x,u=(r.top+l.y)/o.y,h=r.width/o.x,d=r.height/o.y;if(i){const f=Bn(i),x=s&&vs(s)?Bn(s):s;let w=f,v=pg(w);for(;v&&s&&x!==w;){const N=ho(v),g=v.getBoundingClientRect(),b=bs(v),p=g.left+(v.clientLeft+parseFloat(b.paddingLeft))*N.x,y=g.top+(v.clientTop+parseFloat(b.paddingTop))*N.y;c*=N.x,u*=N.y,h*=N.x,d*=N.y,c+=p,u+=y,w=Bn(v),v=pg(w)}}return mh({width:h,height:d,x:c,y:u})}function uf(e,t){const n=df(e).scrollLeft;return t?t.left+n:ci(Gs(e)).left+n}function IS(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-uf(e,n),r=n.top+t.scrollTop;return{x:s,y:r}}function $8(e){let{elements:t,rect:n,offsetParent:s,strategy:r}=e;const i=r==="fixed",o=Gs(s),l=t?cf(t.floating):!1;if(s===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Ys(1);const h=Ys(0),d=Is(s);if((d||!d&&!i)&&((Go(s)!=="body"||Zc(o))&&(c=df(s)),Is(s))){const x=ci(s);u=ho(s),h.x=x.x+s.clientLeft,h.y=x.y+s.clientTop}const f=o&&!d&&!i?IS(o,c):Ys(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+h.x+f.x,y:n.y*u.y-c.scrollTop*u.y+h.y+f.y}}function L8(e){return Array.from(e.getClientRects())}function P8(e){const t=Gs(e),n=df(e),s=e.ownerDocument.body,r=_n(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),i=_n(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let o=-n.scrollLeft+uf(e);const l=-n.scrollTop;return bs(s).direction==="rtl"&&(o+=_n(t.clientWidth,s.clientWidth)-r),{width:r,height:i,x:o,y:l}}const _y=25;function B8(e,t){const n=Bn(e),s=Gs(e),r=n.visualViewport;let i=s.clientWidth,o=s.clientHeight,l=0,c=0;if(r){i=r.width,o=r.height;const h=r0();(!h||h&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const u=uf(s);if(u<=0){const h=s.ownerDocument,d=h.body,f=getComputedStyle(d),x=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,w=Math.abs(s.clientWidth-d.clientWidth-x);w<=_y&&(i-=w)}else u<=_y&&(i+=u);return{width:i,height:o,x:l,y:c}}const H8=new Set(["absolute","fixed"]);function V8(e,t){const n=ci(e,!0,t==="fixed"),s=n.top+e.clientTop,r=n.left+e.clientLeft,i=Is(e)?ho(e):Ys(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=r*i.x,u=s*i.y;return{width:o,height:l,x:c,y:u}}function Ay(e,t,n){let s;if(t==="viewport")s=B8(e,n);else if(t==="document")s=P8(Gs(e));else if(vs(t))s=V8(t,n);else{const r=FS(e);s={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return mh(s)}function WS(e,t){const n=vr(e);return n===t||!vs(n)||zo(n)?!1:bs(n).position==="fixed"||WS(n,t)}function Y8(e,t){const n=t.get(e);if(n)return n;let s=Nc(e,[],!1).filter(l=>vs(l)&&Go(l)!=="body"),r=null;const i=bs(e).position==="fixed";let o=i?vr(e):e;for(;vs(o)&&!zo(o);){const l=bs(o),c=a0(o);!c&&l.position==="fixed"&&(r=null),(i?!c&&!r:!c&&l.position==="static"&&!!r&&H8.has(r.position)||Zc(o)&&!c&&WS(e,o))?s=s.filter(h=>h!==o):r=l,o=vr(o)}return t.set(e,s),s}function F8(e){let{element:t,boundary:n,rootBoundary:s,strategy:r}=e;const o=[...n==="clippingAncestors"?cf(t)?[]:Y8(t,this._c):[].concat(n),s],l=o[0],c=o.reduce((u,h)=>{const d=Ay(t,h,r);return u.top=_n(d.top,u.top),u.right=pr(d.right,u.right),u.bottom=pr(d.bottom,u.bottom),u.left=_n(d.left,u.left),u},Ay(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function I8(e){const{width:t,height:n}=YS(e);return{width:t,height:n}}function W8(e,t,n){const s=Is(t),r=Gs(t),i=n==="fixed",o=ci(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Ys(0);function u(){c.x=uf(r)}if(s||!s&&!i)if((Go(t)!=="body"||Zc(r))&&(l=df(t)),s){const x=ci(t,!0,i,t);c.x=x.x+t.clientLeft,c.y=x.y+t.clientTop}else r&&u();i&&!s&&r&&u();const h=r&&!s&&!i?IS(r,l):Ys(0),d=o.left+l.scrollLeft-c.x-h.x,f=o.top+l.scrollTop-c.y-h.y;return{x:d,y:f,width:o.width,height:o.height}}function Cm(e){return bs(e).position==="static"}function Oy(e,t){if(!Is(e)||bs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Gs(e)===n&&(n=n.ownerDocument.body),n}function qS(e,t){const n=Bn(e);if(cf(e))return n;if(!Is(e)){let r=vr(e);for(;r&&!zo(r);){if(vs(r)&&!Cm(r))return r;r=vr(r)}return n}let s=Oy(e,t);for(;s&&M8(s)&&Cm(s);)s=Oy(s,t);return s&&zo(s)&&Cm(s)&&!a0(s)?n:s||O8(e)||n}const q8=async function(e){const t=this.getOffsetParent||qS,n=this.getDimensions,s=await n(e.floating);return{reference:W8(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function X8(e){return bs(e).direction==="rtl"}const G8={convertOffsetParentRelativeRectToViewportRelativeRect:$8,getDocumentElement:Gs,getClippingRect:F8,getOffsetParent:qS,getElementRects:q8,getClientRects:L8,getDimensions:I8,getScale:ho,isElement:vs,isRTL:X8};function XS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Z8(e,t){let n=null,s;const r=Gs(e);function i(){var l;clearTimeout(s),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:h,top:d,width:f,height:x}=u;if(l||t(),!f||!x)return;const w=Bd(d),v=Bd(r.clientWidth-(h+f)),N=Bd(r.clientHeight-(d+x)),g=Bd(h),p={rootMargin:-w+"px "+-v+"px "+-N+"px "+-g+"px",threshold:_n(0,pr(1,c))||1};let y=!0;function j(S){const C=S[0].intersectionRatio;if(C!==c){if(!y)return o();C?o(!1,C):s=setTimeout(()=>{o(!1,1e-7)},1e3)}C===1&&!XS(u,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(j,{...p,root:r.ownerDocument})}catch{n=new IntersectionObserver(j,p)}n.observe(e)}return o(!0),i}function Q8(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,u=i0(e),h=r||i?[...u?Nc(u):[],...Nc(t)]:[];h.forEach(g=>{r&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const d=u&&l?Z8(u,n):null;let f=-1,x=null;o&&(x=new ResizeObserver(g=>{let[b]=g;b&&b.target===u&&x&&(x.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var p;(p=x)==null||p.observe(t)})),n()}),u&&!c&&x.observe(u),x.observe(t));let w,v=c?ci(e):null;c&&N();function N(){const g=ci(e);v&&!XS(v,g)&&n(),v=g,w=requestAnimationFrame(N)}return n(),()=>{var g;h.forEach(b=>{r&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d==null||d(),(g=x)==null||g.disconnect(),x=null,c&&cancelAnimationFrame(w)}}const K8=N8,J8=j8,e7=b8,t7=C8,n7=y8,zy=v8,s7=S8,a7=(e,t,n)=>{const s=new Map,r={platform:G8,...n},i={...r.platform,_c:s};return p8(e,t,{...r,platform:i})};var r7=typeof document<"u",i7=function(){},xu=r7?m.useLayoutEffect:i7;function xh(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 n,s,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!xh(e[s],t[s]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,r[s]))return!1;for(s=n;s--!==0;){const i=r[s];if(!(i==="_owner"&&e.$$typeof)&&!xh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function GS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ry(e,t){const n=GS(e);return Math.round(t*n)/n}function Em(e){const t=m.useRef(e);return xu(()=>{t.current=e}),t}function o7(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:r,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[h,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,x]=m.useState(s);xh(f,s)||x(s);const[w,v]=m.useState(null),[N,g]=m.useState(null),b=m.useCallback(E=>{E!==S.current&&(S.current=E,v(E))},[]),p=m.useCallback(E=>{E!==C.current&&(C.current=E,g(E))},[]),y=i||w,j=o||N,S=m.useRef(null),C=m.useRef(null),T=m.useRef(h),A=c!=null,P=Em(c),U=Em(r),O=Em(u),V=m.useCallback(()=>{if(!S.current||!C.current)return;const E={placement:t,strategy:n,middleware:f};U.current&&(E.platform=U.current),a7(S.current,C.current,E).then(D=>{const L={...D,isPositioned:O.current!==!1};k.current&&!xh(T.current,L)&&(T.current=L,Mh.flushSync(()=>{d(L)}))})},[f,t,n,U,O]);xu(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(E=>({...E,isPositioned:!1})))},[u]);const k=m.useRef(!1);xu(()=>(k.current=!0,()=>{k.current=!1}),[]),xu(()=>{if(y&&(S.current=y),j&&(C.current=j),y&&j){if(P.current)return P.current(y,j,V);V()}},[y,j,V,P,A]);const z=m.useMemo(()=>({reference:S,floating:C,setReference:b,setFloating:p}),[b,p]),M=m.useMemo(()=>({reference:y,floating:j}),[y,j]),_=m.useMemo(()=>{const E={position:n,left:0,top:0};if(!M.floating)return E;const D=Ry(M.floating,h.x),L=Ry(M.floating,h.y);return l?{...E,transform:"translate("+D+"px, "+L+"px)",...GS(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:L}},[n,l,M.floating,h.x,h.y]);return m.useMemo(()=>({...h,update:V,refs:z,elements:M,floatingStyles:_}),[h,V,z,M,_])}const l7=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:r}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?zy({element:s.current,padding:r}).fn(n):{}:s?zy({element:s,padding:r}).fn(n):{}}}},c7=(e,t)=>({...K8(e),options:[e,t]}),d7=(e,t)=>({...J8(e),options:[e,t]}),u7=(e,t)=>({...s7(e),options:[e,t]}),h7=(e,t)=>({...e7(e),options:[e,t]}),f7=(e,t)=>({...t7(e),options:[e,t]}),m7=(e,t)=>({...n7(e),options:[e,t]}),x7=(e,t)=>({...l7(e),options:[e,t]});var g7="Arrow",ZS=m.forwardRef((e,t)=>{const{children:n,width:s=10,height:r=5,...i}=e;return a.jsx(ln.svg,{...i,ref:t,width:s,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});ZS.displayName=g7;var p7=ZS;function v7(e){const[t,n]=m.useState(void 0);return gr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}var o0="Popper",[QS,hf]=rf(o0),[b7,KS]=QS(o0),JS=e=>{const{__scopePopper:t,children:n}=e,[s,r]=m.useState(null);return a.jsx(b7,{scope:t,anchor:s,onAnchorChange:r,children:n})};JS.displayName=o0;var e4="PopperAnchor",t4=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:s,...r}=e,i=KS(e4,n),o=m.useRef(null),l=Fn(t,o),c=m.useRef(null);return m.useEffect(()=>{const u=c.current;c.current=(s==null?void 0:s.current)||o.current,u!==c.current&&i.onAnchorChange(c.current)}),s?null:a.jsx(ln.div,{...r,ref:l})});t4.displayName=e4;var l0="PopperContent",[y7,w7]=QS(l0),n4=m.forwardRef((e,t)=>{var ae,J,$,te,K,B;const{__scopePopper:n,side:s="bottom",sideOffset:r=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:h=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:x="optimized",onPlaced:w,...v}=e,N=KS(l0,n),[g,b]=m.useState(null),p=Fn(t,G=>b(G)),[y,j]=m.useState(null),S=v7(y),C=(S==null?void 0:S.width)??0,T=(S==null?void 0:S.height)??0,A=s+(i!=="center"?"-"+i:""),P=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},U=Array.isArray(u)?u:[u],O=U.length>0,V={padding:P,boundary:U.filter(j7),altBoundary:O},{refs:k,floatingStyles:z,placement:M,isPositioned:_,middlewareData:E}=o7({strategy:"fixed",placement:A,whileElementsMounted:(...G)=>Q8(...G,{animationFrame:x==="always"}),elements:{reference:N.anchor},middleware:[c7({mainAxis:r+T,alignmentAxis:o}),c&&d7({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?u7():void 0,...V}),c&&h7({...V}),f7({...V,apply:({elements:G,rects:re,availableWidth:ce,availableHeight:ue})=>{const{width:ve,height:ze}=re.reference,_e=G.floating.style;_e.setProperty("--radix-popper-available-width",`${ce}px`),_e.setProperty("--radix-popper-available-height",`${ue}px`),_e.setProperty("--radix-popper-anchor-width",`${ve}px`),_e.setProperty("--radix-popper-anchor-height",`${ze}px`)}}),y&&x7({element:y,padding:l}),S7({arrowWidth:C,arrowHeight:T}),f&&m7({strategy:"referenceHidden",...V})]}),[D,L]=r4(M),W=Oo(w);gr(()=>{_&&(W==null||W())},[_,W]);const R=(ae=E.arrow)==null?void 0:ae.x,H=(J=E.arrow)==null?void 0:J.y,q=(($=E.arrow)==null?void 0:$.centerOffset)!==0,[X,ne]=m.useState();return gr(()=>{g&&ne(window.getComputedStyle(g).zIndex)},[g]),a.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:_?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(te=E.transformOrigin)==null?void 0:te.x,(K=E.transformOrigin)==null?void 0:K.y].join(" "),...((B=E.hide)==null?void 0:B.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(y7,{scope:n,placedSide:D,onArrowChange:j,arrowX:R,arrowY:H,shouldHideArrow:q,children:a.jsx(ln.div,{"data-side":D,"data-align":L,...v,ref:p,style:{...v.style,animation:_?void 0:"none"}})})})});n4.displayName=l0;var s4="PopperArrow",N7={top:"bottom",right:"left",bottom:"top",left:"right"},a4=m.forwardRef(function(t,n){const{__scopePopper:s,...r}=t,i=w7(s4,s),o=N7[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(p7,{...r,ref:n,style:{...r.style,display:"block"}})})});a4.displayName=s4;function j7(e){return e!==null}var S7=e=>({name:"transformOrigin",options:e,fn(t){var N,g,b;const{placement:n,rects:s,middlewareData:r}=t,o=((N=r.arrow)==null?void 0:N.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,h]=r4(n),d={start:"0%",center:"50%",end:"100%"}[h],f=(((g=r.arrow)==null?void 0:g.x)??0)+l/2,x=(((b=r.arrow)==null?void 0:b.y)??0)+c/2;let w="",v="";return u==="bottom"?(w=o?d:`${f}px`,v=`${-c}px`):u==="top"?(w=o?d:`${f}px`,v=`${s.floating.height+c}px`):u==="right"?(w=`${-c}px`,v=o?d:`${x}px`):u==="left"&&(w=`${s.floating.width+c}px`,v=o?d:`${x}px`),{data:{x:w,y:v}}}});function r4(e){const[t,n="center"]=e.split("-");return[t,n]}var i4=JS,c0=t4,o4=n4,l4=a4,C7="Portal",d0=m.forwardRef((e,t)=>{var l;const{container:n,...s}=e,[r,i]=m.useState(!1);gr(()=>i(!0),[]);const o=n||r&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?Yw.createPortal(a.jsx(ln.div,{...s,ref:t}),o):null});d0.displayName=C7;function E7(e,t){return m.useReducer((n,s)=>t[n][s]??n,e)}var bi=e=>{const{present:t,children:n}=e,s=k7(t),r=typeof n=="function"?n({present:s.isPresent}):m.Children.only(n),i=Fn(s.ref,M7(r));return typeof n=="function"||s.isPresent?m.cloneElement(r,{ref:i}):null};bi.displayName="Presence";function k7(e){const[t,n]=m.useState(),s=m.useRef(null),r=m.useRef(e),i=m.useRef("none"),o=e?"mounted":"unmounted",[l,c]=E7(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=Hd(s.current);i.current=l==="mounted"?u:"none"},[l]),gr(()=>{const u=s.current,h=r.current;if(h!==e){const f=i.current,x=Hd(u);e?c("MOUNT"):x==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(h&&f!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),gr(()=>{if(t){let u;const h=t.ownerDocument.defaultView??window,d=x=>{const v=Hd(s.current).includes(CSS.escape(x.animationName));if(x.target===t&&v&&(c("ANIMATION_END"),!r.current)){const N=t.style.animationFillMode;t.style.animationFillMode="forwards",u=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=N)})}},f=x=>{x.target===t&&(i.current=Hd(s.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{h.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(u=>{s.current=u?getComputedStyle(u):null,n(u)},[])}}function Hd(e){return(e==null?void 0:e.animationName)||"none"}function M7(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var T7=Ch[" useInsertionEffect ".trim().toString()]||gr;function u0({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[r,i,o]=D7({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r;{const h=m.useRef(e!==void 0);m.useEffect(()=>{const d=h.current;d!==l&&console.warn(`${s} is changing from ${d?"controlled":"uncontrolled"} to ${l?"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.`),h.current=l},[l,s])}const u=m.useCallback(h=>{var d;if(l){const f=_7(h)?h(e):h;f!==e&&((d=o.current)==null||d.call(o,f))}else i(h)},[l,e,i,o]);return[c,u]}function D7({defaultProp:e,onChange:t}){const[n,s]=m.useState(e),r=m.useRef(n),i=m.useRef(t);return T7(()=>{i.current=t},[t]),m.useEffect(()=>{var o;r.current!==n&&((o=i.current)==null||o.call(i,n),r.current=n)},[n,r]),[n,s,i]}function _7(e){return typeof e=="function"}var A7=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"}),O7="VisuallyHidden",c4=m.forwardRef((e,t)=>a.jsx(ln.span,{...e,ref:t,style:{...A7,...e.style}}));c4.displayName=O7;var z7=c4,[ff]=rf("Tooltip",[hf]),mf=hf(),d4="TooltipProvider",R7=700,vg="tooltip.open",[U7,h0]=ff(d4),u4=e=>{const{__scopeTooltip:t,delayDuration:n=R7,skipDelayDuration:s=300,disableHoverableContent:r=!1,children:i}=e,o=m.useRef(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(U7,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,s)},[s]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:i})};u4.displayName=d4;var jc="Tooltip",[$7,xf]=ff(jc),h4=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:r,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=h0(jc,e.__scopeTooltip),u=mf(t),[h,d]=m.useState(null),f=ps(),x=m.useRef(0),w=o??c.disableHoverableContent,v=l??c.delayDuration,N=m.useRef(!1),[g,b]=u0({prop:s,defaultProp:r??!1,onChange:C=>{C?(c.onOpen(),document.dispatchEvent(new CustomEvent(vg))):c.onClose(),i==null||i(C)},caller:jc}),p=m.useMemo(()=>g?N.current?"delayed-open":"instant-open":"closed",[g]),y=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,N.current=!1,b(!0)},[b]),j=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,b(!1)},[b]),S=m.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{N.current=!0,b(!0),x.current=0},v)},[v,b]);return m.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),a.jsx(i4,{...u,children:a.jsx($7,{scope:t,contentId:f,open:g,stateAttribute:p,trigger:h,onTriggerChange:d,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?S():y()},[c.isOpenDelayedRef,S,y]),onTriggerLeave:m.useCallback(()=>{w?j():(window.clearTimeout(x.current),x.current=0)},[j,w]),onOpen:y,onClose:j,disableHoverableContent:w,children:n})})};h4.displayName=jc;var bg="TooltipTrigger",f4=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=xf(bg,n),i=h0(bg,n),o=mf(n),l=m.useRef(null),c=Fn(t,l,r.onTriggerChange),u=m.useRef(!1),h=m.useRef(!1),d=m.useCallback(()=>u.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),a.jsx(c0,{asChild:!0,...o,children:a.jsx(ln.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...s,ref:c,onPointerMove:Bt(e.onPointerMove,f=>{f.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),h.current=!0)}),onPointerLeave:Bt(e.onPointerLeave,()=>{r.onTriggerLeave(),h.current=!1}),onPointerDown:Bt(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Bt(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:Bt(e.onBlur,r.onClose),onClick:Bt(e.onClick,r.onClose)})})});f4.displayName=bg;var L7="TooltipPortal",[iV,P7]=ff(L7,{forceMount:void 0}),Ro="TooltipContent",m4=m.forwardRef((e,t)=>{const n=P7(Ro,e.__scopeTooltip),{forceMount:s=n.forceMount,side:r="top",...i}=e,o=xf(Ro,e.__scopeTooltip);return a.jsx(bi,{present:s||o.open,children:o.disableHoverableContent?a.jsx(x4,{side:r,...i,ref:t}):a.jsx(B7,{side:r,...i,ref:t})})}),B7=m.forwardRef((e,t)=>{const n=xf(Ro,e.__scopeTooltip),s=h0(Ro,e.__scopeTooltip),r=m.useRef(null),i=Fn(t,r),[o,l]=m.useState(null),{trigger:c,onClose:u}=n,h=r.current,{onPointerInTransitChange:d}=s,f=m.useCallback(()=>{l(null),d(!1)},[d]),x=m.useCallback((w,v)=>{const N=w.currentTarget,g={x:w.clientX,y:w.clientY},b=I7(g,N.getBoundingClientRect()),p=W7(g,b),y=q7(v.getBoundingClientRect()),j=G7([...p,...y]);l(j),d(!0)},[d]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&h){const w=N=>x(N,h),v=N=>x(N,c);return c.addEventListener("pointerleave",w),h.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",w),h.removeEventListener("pointerleave",v)}}},[c,h,x,f]),m.useEffect(()=>{if(o){const w=v=>{const N=v.target,g={x:v.clientX,y:v.clientY},b=(c==null?void 0:c.contains(N))||(h==null?void 0:h.contains(N)),p=!X7(g,o);b?f():p&&(f(),u())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[c,h,o,u,f]),a.jsx(x4,{...e,ref:i})}),[H7,V7]=ff(jc,{isInside:!1}),Y7=FR("TooltipContent"),x4=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=xf(Ro,n),u=mf(n),{onClose:h}=c;return m.useEffect(()=>(document.addEventListener(vg,h),()=>document.removeEventListener(vg,h)),[h]),m.useEffect(()=>{if(c.trigger){const d=f=>{const x=f.target;x!=null&&x.contains(c.trigger)&&h()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,h]),a.jsx(of,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:h,children:a.jsxs(o4,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(Y7,{children:s}),a.jsx(H7,{scope:n,isInside:!0,children:a.jsx(z7,{id:c.contentId,role:"tooltip",children:r||s})})]})})});m4.displayName=Ro;var g4="TooltipArrow",F7=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=mf(n);return V7(g4,n).isInside?null:a.jsx(l4,{...r,...s,ref:t})});F7.displayName=g4;function I7(e,t){const n=Math.abs(t.top-e.y),s=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,s,r,i)){case i:return"left";case r:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function W7(e,t,n=5){const s=[];switch(t){case"top":s.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":s.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":s.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":s.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return s}function q7(e){const{top:t,right:n,bottom:s,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:s},{x:r,y:s}]}function X7(e,t){const{x:n,y:s}=e;let r=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],u=l.x,h=l.y,d=c.x,f=c.y;h>s!=f>s&&n<(d-u)*(s-h)/(f-h)+u&&(r=!r)}return r}function G7(e){const t=e.slice();return t.sort((n,s)=>n.x<s.x?-1:n.x>s.x?1:n.y<s.y?-1:n.y>s.y?1:0),Z7(t)}function Z7(e){if(e.length<=1)return e.slice();const t=[];for(let s=0;s<e.length;s++){const r=e[s];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(r.y-o.y)>=(i.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let s=e.length-1;s>=0;s--){const r=e[s];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(r.y-o.y)>=(i.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Q7=u4,K7=h4,J7=f4,p4=m4;const km=Q7,Mm=K7,Tm=J7,gu=m.forwardRef(({className:e,sideOffset:t=4,...n},s)=>a.jsx(p4,{ref:s,sideOffset:t,className:Me("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...n}));gu.displayName=p4.displayName;const e9=320,t9=32,n9=e=>({core:"text-slate-300",organization:"text-blue-300",teams:"text-green-300",twoFactor:"text-purple-300",apiKey:"text-orange-300",passkey:"text-pink-300"})[e]||"text-gray-300",yg=({data:e,targetPosition:t,sourcePosition:n})=>{const s=e,[r,i]=m.useState(!1),[o,l]=m.useState(!1),c="!h-2 !w-2 !min-w-0 !min-h-0 !cursor-grab !border-0 opacity-0 hover:opacity-100 transition-opacity",u=n9(s.plugin||"core");return s.isForeign?a.jsx("div",{className:"relative",children:a.jsxs("div",{className:"text-xs px-3 py-2 border border-gray-600 bg-gray-800 text-gray-200 flex gap-2 items-center rounded-md shadow-lg",id:`${s.name}-foreign-key`,children:[a.jsx(yt,{size:12,className:"text-gray-400"}),a.jsx("span",{className:"font-medium",children:s.displayName||s.name}),t&&a.jsx(Gr,{type:"target",id:s.name,position:t,className:Me(c)})]})}):a.jsx("div",{className:"relative",children:a.jsxs("div",{className:Me("border border-gray-700 overflow-hidden shadow-xl bg-gray-900 rounded-lg","hover:border-gray-600 transition-colors duration-200"),style:{width:e9},id:`${s.name}-schema-node`,children:[a.jsxs("div",{className:Me("px-4 py-3 bg-black border-b border-gray-700 flex items-center justify-between","cursor-pointer select-none"),onClick:()=>i(!r),children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(yt,{size:16,className:"text-white"}),a.jsx("span",{className:"text-white font-semibold text-sm",children:s.displayName||s.name})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:h=>{h.stopPropagation(),l(!o)},className:"p-1 hover:bg-gray-800 rounded transition-colors",children:o?a.jsx(Kz,{size:12,className:"text-gray-400"}):a.jsx(Gc,{size:12,className:"text-gray-400"})}),r?a.jsx(Zp,{size:14,className:"text-gray-400"}):a.jsx(af,{size:14,className:"text-gray-400"})]})]}),!r&&a.jsx("div",{className:"max-h-96 bg-black overflow-y-auto",children:s.columns.map(h=>a.jsxs("div",{className:Me("relative flex items-center overflow-x-hidden px-4 py-2 text-xs","bg-black/30 hover:bg-black/40 transition-colors duration-150","border-b border-white/20 last:border-b-0"),style:{minHeight:t9},children:[a.jsxs("div",{className:"flex items-center gap-1 mr-3 min-w-[40px]",children:[h.isPrimary&&a.jsx(km,{delayDuration:100,children:a.jsxs(Mm,{children:[a.jsx(Tm,{asChild:!0,children:a.jsx(ch,{size:10,className:"text-yellow-400 flex-shrink-0"})}),a.jsx(gu,{className:"bg-black border-gray-600 text-white text-xs",children:"Primary Key"})]})}),h.isUnique&&!h.isPrimary&&a.jsx(km,{delayDuration:100,children:a.jsxs(Mm,{children:[a.jsx(Tm,{asChild:!0,children:a.jsx(Jz,{size:10,className:"text-green-400 flex-shrink-0"})}),a.jsx(gu,{className:"bg-black border-gray-600 text-white text-xs",children:"Unique"})]})}),h.isIdentity&&a.jsx(km,{delayDuration:100,children:a.jsxs(Mm,{children:[a.jsx(Tm,{asChild:!0,children:a.jsx(tR,{size:10,className:"text-blue-400 flex-shrink-0"})}),a.jsx(gu,{className:"bg-black border-gray-600 text-white text-xs",children:"Identity"})]})})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[!h.isNullable&&a.jsx("span",{className:"text-red-400 text-xs",children:"*"}),a.jsx("span",{className:"text-white font-medium truncate",children:h.name}),a.jsx("span",{className:"text-gray-400 font-mono text-xs",children:h.format})]}),o&&h.description&&a.jsx("div",{className:"text-gray-500 text-xs mt-1 truncate",children:h.description})]}),a.jsx("div",{className:"ml-2",children:a.jsx("span",{className:Me("px-2 py-1 rounded text-xs font-medium",u),children:h.plugin})}),a.jsx(Gr,{type:"target",id:h.id,position:t||"left",className:Me(c,"!left-[-8px] !top-1/2 !transform !-translate-y-1/2"),style:{background:"#1f2937",border:"2px solid #374151",left:"-8px",top:"50%",transform:"translateY(-50%)",boxShadow:"0 0 0 2px rgba(0, 0, 0, 0.3)"}}),a.jsx(Gr,{type:"source",id:h.id,position:n||"right",className:Me(c,"!right-[-8px] !top-1/2 !transform !-translate-y-1/2"),style:{background:"#1f2937",border:"2px solid #374151",right:"-8px",top:"50%",transform:"translateY(-50%)",boxShadow:"0 0 0 2px rgba(0, 0, 0, 0.3)"}})]},h.id))}),s.relationships&&s.relationships.length>0&&a.jsx("div",{className:"px-4 py-2 bg-gray-800 border-t border-gray-700",children:a.jsxs("span",{className:"text-xs text-gray-400",children:[s.relationships.length," relationship",s.relationships.length!==1?"s":""]})})]})})},s9={id:"demo-user-table",name:"user",displayName:"User",isForeign:!1,plugin:"core",columns:[{id:"user-id",isPrimary:!0,isNullable:!1,isUnique:!0,isIdentity:!1,name:"id",format:"string",plugin:"core",description:"Unique user identifier"},{id:"user-name",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"name",format:"string",plugin:"core",description:"User display name"},{id:"user-email",isPrimary:!1,isNullable:!1,isUnique:!0,isIdentity:!1,name:"email",format:"string",plugin:"core",description:"User email address"},{id:"user-emailVerified",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"emailVerified",format:"boolean",plugin:"core",description:"Email verification status"},{id:"user-image",isPrimary:!1,isNullable:!0,isUnique:!1,isIdentity:!1,name:"image",format:"string",plugin:"core",description:"User profile image URL"},{id:"user-createdAt",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"createdAt",format:"date",plugin:"core",description:"Account creation timestamp"}],relationships:[{type:"one-to-many",target:"session",field:"userId"},{type:"one-to-many",target:"account",field:"userId"}]},a9={id:"demo-organization-table",name:"organization",displayName:"Organization",isForeign:!1,plugin:"organization",columns:[{id:"org-id",isPrimary:!0,isNullable:!1,isUnique:!0,isIdentity:!1,name:"id",format:"string",plugin:"organization",description:"Unique organization identifier"},{id:"org-name",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"name",format:"string",plugin:"organization",description:"Organization name"},{id:"org-slug",isPrimary:!1,isNullable:!1,isUnique:!0,isIdentity:!1,name:"slug",format:"string",plugin:"organization",description:"Organization URL slug"}],relationships:[{type:"one-to-many",target:"member",field:"organizationId"}]};function r9(){return a.jsx("div",{className:"min-h-screen bg-black p-8",children:a.jsxs("div",{className:"max-w-6xl mx-auto",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx("h1",{className:"text-3xl font-light text-white mb-4",children:"Database Schema Node Demo"}),a.jsx("p",{className:"text-gray-400",children:"Enhanced database schema nodes with dark mode theming, collapsible views, and detailed tooltips."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl text-white mb-4",children:"Core User Table"}),a.jsx(yg,{data:s9,targetPosition:"left",sourcePosition:"right"})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl text-white mb-4",children:"Organization Plugin Table"}),a.jsx(yg,{data:a9,targetPosition:"left",sourcePosition:"right"})]})]}),a.jsxs("div",{className:"mt-12 p-6 bg-gray-900 rounded-lg border border-gray-700",children:[a.jsx("h3",{className:"text-lg text-white mb-4",children:"Features"}),a.jsxs("ul",{className:"space-y-2 text-gray-300",children:[a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Dark Mode Optimized:"})," Designed specifically for dark themes"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Collapsible Views:"})," Click the header to collapse/expand table contents"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Detail Toggle:"})," Show/hide column descriptions with the eye icon"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Plugin Badges:"})," Color-coded plugin indicators"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Interactive Icons:"})," Hover tooltips for primary keys, unique constraints, etc."]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Relationship Counter:"})," Shows number of relationships in footer"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Connection Handles:"})," Invisible handles for React Flow connections"]})]})]})]})})}const v4=m.createContext(void 0);function i9({children:e}){const[t,n]=m.useState({users:0,organizations:0,sessions:0,teams:0}),[s,r]=m.useState(!0),i=m.useCallback(async()=>{try{const c=await(await fetch("/api/counts")).json();n(c)}catch{}finally{r(!1)}},[]),o=m.useCallback(async()=>{r(!0),await i()},[i]);return m.useEffect(()=>{i()},[i]),a.jsx(v4.Provider,{value:{counts:t,loading:s,refetchCounts:o},children:e})}function gf(){const e=m.useContext(v4);if(e===void 0)throw new Error("useCounts must be used within a CountsProvider");return e}function b4(e,t){const n=m.useRef(null),s=m.useRef(null),r=m.useRef(0),i=m.useRef(!1),o=m.useRef(e),l=m.useRef(t==null?void 0:t.onStatusChange),c=(t==null?void 0:t.maxReconnectAttempts)??5;m.useEffect(()=>{o.current=e},[e]),m.useEffect(()=>{l.current=t==null?void 0:t.onStatusChange},[t==null?void 0:t.onStatusChange]),m.useEffect(()=>{let u=!1;const h=()=>{var d;try{(d=l.current)==null||d.call(l,"connecting");const x=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`;n.current=new WebSocket(x),n.current.onopen=()=>{var w;r.current=0,i.current=!0,(w=l.current)==null||w.call(l,"open"),s.current&&(clearTimeout(s.current),s.current=null)},n.current.onmessage=w=>{try{const v=JSON.parse(w.data);o.current&&o.current(v)}catch{}},n.current.onclose=w=>{var v,N,g,b;if(!u){if(!i.current&&(w.code===1006||w.code===1001)){(v=l.current)==null||v.call(l,"unavailable");return}if((N=l.current)==null||N.call(l,"closed"),r.current<c){r.current++;const p=Math.min(1e3*2**r.current,1e4);(g=l.current)==null||g.call(l,"reconnecting"),s.current=setTimeout(()=>{h()},p)}else(b=l.current)==null||b.call(l,"unavailable")}},n.current.onerror=w=>{var v;(v=l.current)==null||v.call(l,"error")}}catch{}};return h(),()=>{u=!0,n.current&&n.current.close(),s.current&&clearTimeout(s.current)}},[c])}var Uy=1,o9=.9,l9=.8,c9=.17,Dm=.1,_m=.999,d9=.9999,u9=.99,h9=/[\\\/_+.#"@\[\(\{&]/,f9=/[\\\/_+.#"@\[\(\{&]/g,m9=/[\s-]/,y4=/[\s-]/g;function wg(e,t,n,s,r,i,o){if(i===t.length)return r===e.length?Uy:u9;var l=`${r},${i}`;if(o[l]!==void 0)return o[l];for(var c=s.charAt(i),u=n.indexOf(c,r),h=0,d,f,x,w;u>=0;)d=wg(e,t,n,s,u+1,i+1,o),d>h&&(u===r?d*=Uy:h9.test(e.charAt(u-1))?(d*=l9,x=e.slice(r,u-1).match(f9),x&&r>0&&(d*=Math.pow(_m,x.length))):m9.test(e.charAt(u-1))?(d*=o9,w=e.slice(r,u-1).match(y4),w&&r>0&&(d*=Math.pow(_m,w.length))):(d*=c9,r>0&&(d*=Math.pow(_m,u-r))),e.charAt(u)!==t.charAt(i)&&(d*=d9)),(d<Dm&&n.charAt(u-1)===s.charAt(i+1)||s.charAt(i+1)===s.charAt(i)&&n.charAt(u-1)!==s.charAt(i))&&(f=wg(e,t,n,s,u+1,i+2,o),f*Dm>d&&(d=f*Dm)),d>h&&(h=d),u=n.indexOf(c,u+1);return o[l]=h,h}function $y(e){return e.toLowerCase().replace(y4," ")}function x9(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,wg(e,t,$y(e),$y(t),0,0,{})}var Am="focusScope.autoFocusOnMount",Om="focusScope.autoFocusOnUnmount",Ly={bubbles:!1,cancelable:!0},g9="FocusScope",f0=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...o}=e,[l,c]=m.useState(null),u=Oo(r),h=Oo(i),d=m.useRef(null),f=Fn(t,v=>c(v)),x=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(s){let v=function(p){if(x.paused||!l)return;const y=p.target;l.contains(y)?d.current=y:Ba(d.current,{select:!0})},N=function(p){if(x.paused||!l)return;const y=p.relatedTarget;y!==null&&(l.contains(y)||Ba(d.current,{select:!0}))},g=function(p){if(document.activeElement===document.body)for(const j of p)j.removedNodes.length>0&&Ba(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",N);const b=new MutationObserver(g);return l&&b.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",N),b.disconnect()}}},[s,l,x.paused]),m.useEffect(()=>{if(l){By.add(x);const v=document.activeElement;if(!l.contains(v)){const g=new CustomEvent(Am,Ly);l.addEventListener(Am,u),l.dispatchEvent(g),g.defaultPrevented||(p9(N9(w4(l)),{select:!0}),document.activeElement===v&&Ba(l))}return()=>{l.removeEventListener(Am,u),setTimeout(()=>{const g=new CustomEvent(Om,Ly);l.addEventListener(Om,h),l.dispatchEvent(g),g.defaultPrevented||Ba(v??document.body,{select:!0}),l.removeEventListener(Om,h),By.remove(x)},0)}}},[l,u,h,x]);const w=m.useCallback(v=>{if(!n&&!s||x.paused)return;const N=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,g=document.activeElement;if(N&&g){const b=v.currentTarget,[p,y]=v9(b);p&&y?!v.shiftKey&&g===y?(v.preventDefault(),n&&Ba(p,{select:!0})):v.shiftKey&&g===p&&(v.preventDefault(),n&&Ba(y,{select:!0})):g===b&&v.preventDefault()}},[n,s,x.paused]);return a.jsx(ln.div,{tabIndex:-1,...o,ref:f,onKeyDown:w})});f0.displayName=g9;function p9(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(Ba(s,{select:t}),document.activeElement!==n)return}function v9(e){const t=w4(e),n=Py(t,e),s=Py(t.reverse(),e);return[n,s]}function w4(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const r=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||r?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Py(e,t){for(const n of e)if(!b9(n,{upTo:t}))return n}function b9(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 y9(e){return e instanceof HTMLInputElement&&"select"in e}function Ba(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&y9(e)&&t&&e.select()}}var By=w9();function w9(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Hy(e,t),e.unshift(t)},remove(t){var n;e=Hy(e,t),(n=e[0])==null||n.resume()}}}function Hy(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function N9(e){return e.filter(t=>t.tagName!=="A")}var zm=0;function N4(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Vy()),document.body.insertAdjacentElement("beforeend",e[1]??Vy()),zm++,()=>{zm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),zm--}},[])}function Vy(){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 zs=function(){return zs=Object.assign||function(t){for(var n,s=1,r=arguments.length;s<r;s++){n=arguments[s];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},zs.apply(this,arguments)};function j4(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]]);return n}function j9(e,t,n){if(n||arguments.length===2)for(var s=0,r=t.length,i;s<r;s++)(i||!(s in t))&&(i||(i=Array.prototype.slice.call(t,0,s)),i[s]=t[s]);return e.concat(i||Array.prototype.slice.call(t))}var pu="right-scroll-bar-position",vu="width-before-scroll-bar",S9="with-scroll-bars-hidden",C9="--removed-body-scroll-bar-size";function Rm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function E9(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var r=n.value;r!==s&&(n.value=s,n.callback(s,r))}}}})[0];return n.callback=t,n.facade}var k9=typeof window<"u"?m.useLayoutEffect:m.useEffect,Yy=new WeakMap;function M9(e,t){var n=E9(null,function(s){return e.forEach(function(r){return Rm(r,s)})});return k9(function(){var s=Yy.get(n);if(s){var r=new Set(s),i=new Set(e),o=n.current;r.forEach(function(l){i.has(l)||Rm(l,null)}),i.forEach(function(l){r.has(l)||Rm(l,o)})}Yy.set(n,e)},[e]),n}function T9(e){return e}function D9(e,t){t===void 0&&(t=T9);var n=[],s=!1,r={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,s);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(s=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){s=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var h=o;o=[],h.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(h){o.push(h),u()},filter:function(h){return o=o.filter(h),n}}}};return r}function _9(e){e===void 0&&(e={});var t=D9(null);return t.options=zs({async:!0,ssr:!1},e),t}var S4=function(e){var t=e.sideCar,n=j4(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return m.createElement(s,zs({},n))};S4.isSideCarExport=!0;function A9(e,t){return e.useMedium(t),S4}var C4=_9(),Um=function(){},pf=m.forwardRef(function(e,t){var n=m.useRef(null),s=m.useState({onScrollCapture:Um,onWheelCapture:Um,onTouchMoveCapture:Um}),r=s[0],i=s[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,h=e.enabled,d=e.shards,f=e.sideCar,x=e.noRelative,w=e.noIsolation,v=e.inert,N=e.allowPinchZoom,g=e.as,b=g===void 0?"div":g,p=e.gapMode,y=j4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=f,S=M9([n,t]),C=zs(zs({},y),r);return m.createElement(m.Fragment,null,h&&m.createElement(j,{sideCar:C4,removeScrollBar:u,shards:d,noRelative:x,noIsolation:w,inert:v,setCallbacks:i,allowPinchZoom:!!N,lockRef:n,gapMode:p}),o?m.cloneElement(m.Children.only(l),zs(zs({},C),{ref:S})):m.createElement(b,zs({},C,{className:c,ref:S}),l))});pf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};pf.classNames={fullWidth:vu,zeroRight:pu};var O9=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function z9(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=O9();return t&&e.setAttribute("nonce",t),e}function R9(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function U9(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var $9=function(){var e=0,t=null;return{add:function(n){e==0&&(t=z9())&&(R9(t,n),U9(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},L9=function(){var e=$9();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},E4=function(){var e=L9(),t=function(n){var s=n.styles,r=n.dynamic;return e(s,r),null};return t},P9={left:0,top:0,right:0,gap:0},$m=function(e){return parseInt(e||"",10)||0},B9=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[$m(n),$m(s),$m(r)]},H9=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return P9;var t=B9(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-n+t[2]-t[0])}},V9=E4(),fo="data-scroll-locked",Y9=function(e,t,n,s){var r=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
384
|
-
.`.concat(S9,` {
|
|
385
|
-
overflow: hidden `).concat(s,`;
|
|
386
|
-
padding-right: `).concat(l,"px ").concat(s,`;
|
|
387
|
-
}
|
|
388
|
-
body[`).concat(fo,`] {
|
|
389
|
-
overflow: hidden `).concat(s,`;
|
|
390
|
-
overscroll-behavior: contain;
|
|
391
|
-
`).concat([t&&"position: relative ".concat(s,";"),n==="margin"&&`
|
|
392
|
-
padding-left: `.concat(r,`px;
|
|
393
|
-
padding-top: `).concat(i,`px;
|
|
394
|
-
padding-right: `).concat(o,`px;
|
|
395
|
-
margin-left:0;
|
|
396
|
-
margin-top:0;
|
|
397
|
-
margin-right: `).concat(l,"px ").concat(s,`;
|
|
398
|
-
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
.`).concat(pu,` {
|
|
402
|
-
right: `).concat(l,"px ").concat(s,`;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
.`).concat(vu,` {
|
|
406
|
-
margin-right: `).concat(l,"px ").concat(s,`;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
.`).concat(pu," .").concat(pu,` {
|
|
410
|
-
right: 0 `).concat(s,`;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
.`).concat(vu," .").concat(vu,` {
|
|
414
|
-
margin-right: 0 `).concat(s,`;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
body[`).concat(fo,`] {
|
|
418
|
-
`).concat(C9,": ").concat(l,`px;
|
|
419
|
-
}
|
|
420
|
-
`)},Fy=function(){var e=parseInt(document.body.getAttribute(fo)||"0",10);return isFinite(e)?e:0},F9=function(){m.useEffect(function(){return document.body.setAttribute(fo,(Fy()+1).toString()),function(){var e=Fy()-1;e<=0?document.body.removeAttribute(fo):document.body.setAttribute(fo,e.toString())}},[])},I9=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,r=s===void 0?"margin":s;F9();var i=m.useMemo(function(){return H9(r)},[r]);return m.createElement(V9,{styles:Y9(i,!t,r,n?"":"!important")})},Ng=!1;if(typeof window<"u")try{var Vd=Object.defineProperty({},"passive",{get:function(){return Ng=!0,!0}});window.addEventListener("test",Vd,Vd),window.removeEventListener("test",Vd,Vd)}catch{Ng=!1}var Mi=Ng?{passive:!1}:!1,W9=function(e){return e.tagName==="TEXTAREA"},k4=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!W9(e)&&n[t]==="visible")},q9=function(e){return k4(e,"overflowY")},X9=function(e){return k4(e,"overflowX")},Iy=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var r=M4(e,s);if(r){var i=T4(e,s),o=i[1],l=i[2];if(o>l)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},G9=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},Z9=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},M4=function(e,t){return e==="v"?q9(t):X9(t)},T4=function(e,t){return e==="v"?G9(t):Z9(t)},Q9=function(e,t){return e==="h"&&t==="rtl"?-1:1},K9=function(e,t,n,s,r){var i=Q9(e,window.getComputedStyle(t).direction),o=i*s,l=n.target,c=t.contains(l),u=!1,h=o>0,d=0,f=0;do{if(!l)break;var x=T4(e,l),w=x[0],v=x[1],N=x[2],g=v-N-i*w;(w||g)&&M4(e,l)&&(d+=g,f+=w);var b=l.parentNode;l=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(h&&Math.abs(d)<1||!h&&Math.abs(f)<1)&&(u=!0),u},Yd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Wy=function(e){return[e.deltaX,e.deltaY]},qy=function(e){return e&&"current"in e?e.current:e},J9=function(e,t){return e[0]===t[0]&&e[1]===t[1]},eU=function(e){return`
|
|
421
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
422
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
423
|
-
`)},tU=0,Ti=[];function nU(e){var t=m.useRef([]),n=m.useRef([0,0]),s=m.useRef(),r=m.useState(tU++)[0],i=m.useState(E4)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var v=j9([e.lockRef.current],(e.shards||[]).map(qy),!0).filter(Boolean);return v.forEach(function(N){return N.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),v.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(v,N){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var g=Yd(v),b=n.current,p="deltaX"in v?v.deltaX:b[0]-g[0],y="deltaY"in v?v.deltaY:b[1]-g[1],j,S=v.target,C=Math.abs(p)>Math.abs(y)?"h":"v";if("touches"in v&&C==="h"&&S.type==="range")return!1;var T=Iy(C,S);if(!T)return!0;if(T?j=C:(j=C==="v"?"h":"v",T=Iy(C,S)),!T)return!1;if(!s.current&&"changedTouches"in v&&(p||y)&&(s.current=j),!j)return!0;var A=s.current||j;return K9(A,N,v,A==="h"?p:y)},[]),c=m.useCallback(function(v){var N=v;if(!(!Ti.length||Ti[Ti.length-1]!==i)){var g="deltaY"in N?Wy(N):Yd(N),b=t.current.filter(function(j){return j.name===N.type&&(j.target===N.target||N.target===j.shadowParent)&&J9(j.delta,g)})[0];if(b&&b.should){N.cancelable&&N.preventDefault();return}if(!b){var p=(o.current.shards||[]).map(qy).filter(Boolean).filter(function(j){return j.contains(N.target)}),y=p.length>0?l(N,p[0]):!o.current.noIsolation;y&&N.cancelable&&N.preventDefault()}}},[]),u=m.useCallback(function(v,N,g,b){var p={name:v,delta:N,target:g,should:b,shadowParent:sU(g)};t.current.push(p),setTimeout(function(){t.current=t.current.filter(function(y){return y!==p})},1)},[]),h=m.useCallback(function(v){n.current=Yd(v),s.current=void 0},[]),d=m.useCallback(function(v){u(v.type,Wy(v),v.target,l(v,e.lockRef.current))},[]),f=m.useCallback(function(v){u(v.type,Yd(v),v.target,l(v,e.lockRef.current))},[]);m.useEffect(function(){return Ti.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Mi),document.addEventListener("touchmove",c,Mi),document.addEventListener("touchstart",h,Mi),function(){Ti=Ti.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Mi),document.removeEventListener("touchmove",c,Mi),document.removeEventListener("touchstart",h,Mi)}},[]);var x=e.removeScrollBar,w=e.inert;return m.createElement(m.Fragment,null,w?m.createElement(i,{styles:eU(r)}):null,x?m.createElement(I9,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function sU(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const aU=A9(C4,nU);var m0=m.forwardRef(function(e,t){return m.createElement(pf,zs({},e,{ref:t,sideCar:aU}))});m0.classNames=pf.classNames;var rU=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Di=new WeakMap,Fd=new WeakMap,Id={},Lm=0,D4=function(e){return e&&(e.host||D4(e.parentNode))},iU=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=D4(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},oU=function(e,t,n,s){var r=iU(t,Array.isArray(e)?e:[e]);Id[n]||(Id[n]=new WeakMap);var i=Id[n],o=[],l=new Set,c=new Set(r),u=function(d){!d||l.has(d)||(l.add(d),u(d.parentNode))};r.forEach(u);var h=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(l.has(f))h(f);else try{var x=f.getAttribute(s),w=x!==null&&x!=="false",v=(Di.get(f)||0)+1,N=(i.get(f)||0)+1;Di.set(f,v),i.set(f,N),o.push(f),v===1&&w&&Fd.set(f,!0),N===1&&f.setAttribute(n,"true"),w||f.setAttribute(s,"true")}catch(g){console.error("aria-hidden: cannot operate on ",f,g)}})};return h(t),l.clear(),Lm++,function(){o.forEach(function(d){var f=Di.get(d)-1,x=i.get(d)-1;Di.set(d,f),i.set(d,x),f||(Fd.has(d)||d.removeAttribute(s),Fd.delete(d)),x||d.removeAttribute(n)}),Lm--,Lm||(Di=new WeakMap,Di=new WeakMap,Fd=new WeakMap,Id={})}},_4=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),r=rU(e);return r?(s.push.apply(s,Array.from(r.querySelectorAll("[aria-live], script"))),oU(s,r,n,"aria-hidden")):function(){return null}},vf="Dialog",[A4]=rf(vf),[lU,js]=A4(vf),O4=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:r,onOpenChange:i,modal:o=!0}=e,l=m.useRef(null),c=m.useRef(null),[u,h]=u0({prop:s,defaultProp:r??!1,onChange:i,caller:vf});return a.jsx(lU,{scope:t,triggerRef:l,contentRef:c,contentId:ps(),titleId:ps(),descriptionId:ps(),open:u,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(d=>!d),[h]),modal:o,children:n})};O4.displayName=vf;var z4="DialogTrigger",cU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=js(z4,n),i=Fn(t,r.triggerRef);return a.jsx(ln.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":p0(r.open),...s,ref:i,onClick:Bt(e.onClick,r.onOpenToggle)})});cU.displayName=z4;var x0="DialogPortal",[dU,R4]=A4(x0,{forceMount:void 0}),U4=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:r}=e,i=js(x0,t);return a.jsx(dU,{scope:t,forceMount:n,children:m.Children.map(s,o=>a.jsx(bi,{present:n||i.open,children:a.jsx(d0,{asChild:!0,container:r,children:o})}))})};U4.displayName=x0;var gh="DialogOverlay",$4=m.forwardRef((e,t)=>{const n=R4(gh,e.__scopeDialog),{forceMount:s=n.forceMount,...r}=e,i=js(gh,e.__scopeDialog);return i.modal?a.jsx(bi,{present:s||i.open,children:a.jsx(hU,{...r,ref:t})}):null});$4.displayName=gh;var uU=e0("DialogOverlay.RemoveScroll"),hU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=js(gh,n);return a.jsx(m0,{as:uU,allowPinchZoom:!0,shards:[r.contentRef],children:a.jsx(ln.div,{"data-state":p0(r.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),di="DialogContent",L4=m.forwardRef((e,t)=>{const n=R4(di,e.__scopeDialog),{forceMount:s=n.forceMount,...r}=e,i=js(di,e.__scopeDialog);return a.jsx(bi,{present:s||i.open,children:i.modal?a.jsx(fU,{...r,ref:t}):a.jsx(mU,{...r,ref:t})})});L4.displayName=di;var fU=m.forwardRef((e,t)=>{const n=js(di,e.__scopeDialog),s=m.useRef(null),r=Fn(t,n.contentRef,s);return m.useEffect(()=>{const i=s.current;if(i)return _4(i)},[]),a.jsx(P4,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Bt(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Bt(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:Bt(e.onFocusOutside,i=>i.preventDefault())})}),mU=m.forwardRef((e,t)=>{const n=js(di,e.__scopeDialog),s=m.useRef(!1),r=m.useRef(!1);return a.jsx(P4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),s.current=!1,r.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),P4=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:r,onCloseAutoFocus:i,...o}=e,l=js(di,n),c=m.useRef(null),u=Fn(t,c);return N4(),a.jsxs(a.Fragment,{children:[a.jsx(f0,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:r,onUnmountAutoFocus:i,children:a.jsx(of,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":p0(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(vU,{titleId:l.titleId}),a.jsx(yU,{contentRef:c,descriptionId:l.descriptionId})]})]})}),g0="DialogTitle",xU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=js(g0,n);return a.jsx(ln.h2,{id:r.titleId,...s,ref:t})});xU.displayName=g0;var B4="DialogDescription",gU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=js(B4,n);return a.jsx(ln.p,{id:r.descriptionId,...s,ref:t})});gU.displayName=B4;var H4="DialogClose",pU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=js(H4,n);return a.jsx(ln.button,{type:"button",...s,ref:t,onClick:Bt(e.onClick,()=>r.onOpenChange(!1))})});pU.displayName=H4;function p0(e){return e?"open":"closed"}var V4="DialogTitleWarning",[oV,Y4]=HR(V4,{contentName:di,titleName:g0,docsSlug:"dialog"}),vU=({titleId:e})=>{const t=Y4(V4),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
424
|
-
|
|
425
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
426
|
-
|
|
427
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},bU="DialogDescriptionWarning",yU=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Y4(bU).contentName}}.`;return m.useEffect(()=>{var i;const r=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},wU=O4,NU=U4,jU=$4,SU=L4,CU=Symbol.for("react.lazy"),ph=Ch[" use ".trim().toString()];function EU(e){return typeof e=="object"&&e!==null&&"then"in e}function F4(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===CU&&"_payload"in e&&EU(e._payload)}function I4(e){const t=MU(e),n=m.forwardRef((s,r)=>{let{children:i,...o}=s;F4(i)&&typeof ph=="function"&&(i=ph(i._payload));const l=m.Children.toArray(i),c=l.find(DU);if(c){const u=c.props.children,h=l.map(d=>d===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...o,ref:r,children:m.isValidElement(u)?m.cloneElement(u,void 0,h):null})}return a.jsx(t,{...o,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var kU=I4("Slot");function MU(e){const t=m.forwardRef((n,s)=>{let{children:r,...i}=n;if(F4(r)&&typeof ph=="function"&&(r=ph(r._payload)),m.isValidElement(r)){const o=AU(r),l=_U(i,r.props);return r.type!==m.Fragment&&(l.ref=s?xr(s,o):o),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var TU=Symbol("radix.slottable");function DU(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TU}function _U(e,t){const n={...t};for(const s in t){const r=e[s],i=t[s];/^on[A-Z]/.test(s)?r&&i?n[s]=(...l)=>{const c=i(...l);return r(...l),c}:r&&(n[s]=r):s==="style"?n[s]={...r,...i}:s==="className"&&(n[s]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function AU(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var OU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],jr=OU.reduce((e,t)=>{const n=I4(`Primitive.${t}`),s=m.forwardRef((r,i)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),gl='[cmdk-group=""]',Pm='[cmdk-group-items=""]',zU='[cmdk-group-heading=""]',W4='[cmdk-item=""]',Xy=`${W4}:not([aria-disabled="true"])`,jg="cmdk-item-select",$i="data-value",RU=(e,t,n)=>x9(e,t,n),q4=m.createContext(void 0),Qc=()=>m.useContext(q4),X4=m.createContext(void 0),v0=()=>m.useContext(X4),G4=m.createContext(void 0),Z4=m.forwardRef((e,t)=>{let n=Li(()=>{var R,H;return{search:"",value:(H=(R=e.value)!=null?R:e.defaultValue)!=null?H:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=Li(()=>new Set),r=Li(()=>new Map),i=Li(()=>new Map),o=Li(()=>new Set),l=Q4(e),{label:c,children:u,value:h,onValueChange:d,filter:f,shouldFilter:x,loop:w,disablePointerSelection:v=!1,vimBindings:N=!0,...g}=e,b=ps(),p=ps(),y=ps(),j=m.useRef(null),S=WU();ui(()=>{if(h!==void 0){let R=h.trim();n.current.value=R,C.emit()}},[h]),ui(()=>{S(6,V)},[]);let C=m.useMemo(()=>({subscribe:R=>(o.current.add(R),()=>o.current.delete(R)),snapshot:()=>n.current,setState:(R,H,q)=>{var X,ne,ae,J;if(!Object.is(n.current[R],H)){if(n.current[R]=H,R==="search")O(),P(),S(1,U);else if(R==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let $=document.getElementById(y);$?$.focus():(X=document.getElementById(b))==null||X.focus()}if(S(7,()=>{var $;n.current.selectedItemId=($=k())==null?void 0:$.id,C.emit()}),q||S(5,V),((ne=l.current)==null?void 0:ne.value)!==void 0){let $=H??"";(J=(ae=l.current).onValueChange)==null||J.call(ae,$);return}}C.emit()}},emit:()=>{o.current.forEach(R=>R())}}),[]),T=m.useMemo(()=>({value:(R,H,q)=>{var X;H!==((X=i.current.get(R))==null?void 0:X.value)&&(i.current.set(R,{value:H,keywords:q}),n.current.filtered.items.set(R,A(H,q)),S(2,()=>{P(),C.emit()}))},item:(R,H)=>(s.current.add(R),H&&(r.current.has(H)?r.current.get(H).add(R):r.current.set(H,new Set([R]))),S(3,()=>{O(),P(),n.current.value||U(),C.emit()}),()=>{i.current.delete(R),s.current.delete(R),n.current.filtered.items.delete(R);let q=k();S(4,()=>{O(),(q==null?void 0:q.getAttribute("id"))===R&&U(),C.emit()})}),group:R=>(r.current.has(R)||r.current.set(R,new Set),()=>{i.current.delete(R),r.current.delete(R)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:y,labelId:p,listInnerRef:j}),[]);function A(R,H){var q,X;let ne=(X=(q=l.current)==null?void 0:q.filter)!=null?X:RU;return R?ne(R,n.current.search,H):0}function P(){if(!n.current.search||l.current.shouldFilter===!1)return;let R=n.current.filtered.items,H=[];n.current.filtered.groups.forEach(X=>{let ne=r.current.get(X),ae=0;ne.forEach(J=>{let $=R.get(J);ae=Math.max($,ae)}),H.push([X,ae])});let q=j.current;z().sort((X,ne)=>{var ae,J;let $=X.getAttribute("id"),te=ne.getAttribute("id");return((ae=R.get(te))!=null?ae:0)-((J=R.get($))!=null?J:0)}).forEach(X=>{let ne=X.closest(Pm);ne?ne.appendChild(X.parentElement===ne?X:X.closest(`${Pm} > *`)):q.appendChild(X.parentElement===q?X:X.closest(`${Pm} > *`))}),H.sort((X,ne)=>ne[1]-X[1]).forEach(X=>{var ne;let ae=(ne=j.current)==null?void 0:ne.querySelector(`${gl}[${$i}="${encodeURIComponent(X[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function U(){let R=z().find(q=>q.getAttribute("aria-disabled")!=="true"),H=R==null?void 0:R.getAttribute($i);C.setState("value",H||void 0)}function O(){var R,H,q,X;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=s.current.size;return}n.current.filtered.groups=new Set;let ne=0;for(let ae of s.current){let J=(H=(R=i.current.get(ae))==null?void 0:R.value)!=null?H:"",$=(X=(q=i.current.get(ae))==null?void 0:q.keywords)!=null?X:[],te=A(J,$);n.current.filtered.items.set(ae,te),te>0&&ne++}for(let[ae,J]of r.current)for(let $ of J)if(n.current.filtered.items.get($)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=ne}function V(){var R,H,q;let X=k();X&&(((R=X.parentElement)==null?void 0:R.firstChild)===X&&((q=(H=X.closest(gl))==null?void 0:H.querySelector(zU))==null||q.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function k(){var R;return(R=j.current)==null?void 0:R.querySelector(`${W4}[aria-selected="true"]`)}function z(){var R;return Array.from(((R=j.current)==null?void 0:R.querySelectorAll(Xy))||[])}function M(R){let H=z()[R];H&&C.setState("value",H.getAttribute($i))}function _(R){var H;let q=k(),X=z(),ne=X.findIndex(J=>J===q),ae=X[ne+R];(H=l.current)!=null&&H.loop&&(ae=ne+R<0?X[X.length-1]:ne+R===X.length?X[0]:X[ne+R]),ae&&C.setState("value",ae.getAttribute($i))}function E(R){let H=k(),q=H==null?void 0:H.closest(gl),X;for(;q&&!X;)q=R>0?FU(q,gl):IU(q,gl),X=q==null?void 0:q.querySelector(Xy);X?C.setState("value",X.getAttribute($i)):_(R)}let D=()=>M(z().length-1),L=R=>{R.preventDefault(),R.metaKey?D():R.altKey?E(1):_(1)},W=R=>{R.preventDefault(),R.metaKey?M(0):R.altKey?E(-1):_(-1)};return m.createElement(jr.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:R=>{var H;(H=g.onKeyDown)==null||H.call(g,R);let q=R.nativeEvent.isComposing||R.keyCode===229;if(!(R.defaultPrevented||q))switch(R.key){case"n":case"j":{N&&R.ctrlKey&&L(R);break}case"ArrowDown":{L(R);break}case"p":case"k":{N&&R.ctrlKey&&W(R);break}case"ArrowUp":{W(R);break}case"Home":{R.preventDefault(),M(0);break}case"End":{R.preventDefault(),D();break}case"Enter":{R.preventDefault();let X=k();if(X){let ne=new Event(jg);X.dispatchEvent(ne)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:XU},c),bf(e,R=>m.createElement(X4.Provider,{value:C},m.createElement(q4.Provider,{value:T},R))))}),UU=m.forwardRef((e,t)=>{var n,s;let r=ps(),i=m.useRef(null),o=m.useContext(G4),l=Qc(),c=Q4(e),u=(s=(n=c.current)==null?void 0:n.forceMount)!=null?s:o==null?void 0:o.forceMount;ui(()=>{if(!u)return l.item(r,o==null?void 0:o.id)},[u]);let h=K4(r,i,[e.value,e.children,i],e.keywords),d=v0(),f=br(S=>S.value&&S.value===h.current),x=br(S=>u||l.filter()===!1?!0:S.search?S.filtered.items.get(r)>0:!0);m.useEffect(()=>{let S=i.current;if(!(!S||e.disabled))return S.addEventListener(jg,w),()=>S.removeEventListener(jg,w)},[x,e.onSelect,e.disabled]);function w(){var S,C;v(),(C=(S=c.current).onSelect)==null||C.call(S,h.current)}function v(){d.setState("value",h.current,!0)}if(!x)return null;let{disabled:N,value:g,onSelect:b,forceMount:p,keywords:y,...j}=e;return m.createElement(jr.div,{ref:xr(i,t),...j,id:r,"cmdk-item":"",role:"option","aria-disabled":!!N,"aria-selected":!!f,"data-disabled":!!N,"data-selected":!!f,onPointerMove:N||l.getDisablePointerSelection()?void 0:v,onClick:N?void 0:w},e.children)}),$U=m.forwardRef((e,t)=>{let{heading:n,children:s,forceMount:r,...i}=e,o=ps(),l=m.useRef(null),c=m.useRef(null),u=ps(),h=Qc(),d=br(x=>r||h.filter()===!1?!0:x.search?x.filtered.groups.has(o):!0);ui(()=>h.group(o),[]),K4(o,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:o,forceMount:r}),[r]);return m.createElement(jr.div,{ref:xr(l,t),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),bf(e,x=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},m.createElement(G4.Provider,{value:f},x))))}),LU=m.forwardRef((e,t)=>{let{alwaysRender:n,...s}=e,r=m.useRef(null),i=br(o=>!o.search);return!n&&!i?null:m.createElement(jr.div,{ref:xr(r,t),...s,"cmdk-separator":"",role:"separator"})}),PU=m.forwardRef((e,t)=>{let{onValueChange:n,...s}=e,r=e.value!=null,i=v0(),o=br(u=>u.search),l=br(u=>u.selectedItemId),c=Qc();return m.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),m.createElement(jr.input,{ref:t,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:r?e.value:o,onChange:u=>{r||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),BU=m.forwardRef((e,t)=>{let{children:n,label:s="Suggestions",...r}=e,i=m.useRef(null),o=m.useRef(null),l=br(u=>u.selectedItemId),c=Qc();return m.useEffect(()=>{if(o.current&&i.current){let u=o.current,h=i.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let x=u.offsetHeight;h.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return f.observe(u),()=>{cancelAnimationFrame(d),f.unobserve(u)}}},[]),m.createElement(jr.div,{ref:xr(i,t),...r,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":s,id:c.listId},bf(e,u=>m.createElement("div",{ref:xr(o,c.listInnerRef),"cmdk-list-sizer":""},u)))}),HU=m.forwardRef((e,t)=>{let{open:n,onOpenChange:s,overlayClassName:r,contentClassName:i,container:o,...l}=e;return m.createElement(wU,{open:n,onOpenChange:s},m.createElement(NU,{container:o},m.createElement(jU,{"cmdk-overlay":"",className:r}),m.createElement(SU,{"aria-label":e.label,"cmdk-dialog":"",className:i},m.createElement(Z4,{ref:t,...l}))))}),VU=m.forwardRef((e,t)=>br(n=>n.filtered.count===0)?m.createElement(jr.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),YU=m.forwardRef((e,t)=>{let{progress:n,children:s,label:r="Loading...",...i}=e;return m.createElement(jr.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r},bf(e,o=>m.createElement("div",{"aria-hidden":!0},o)))}),pl=Object.assign(Z4,{List:BU,Item:UU,Input:PU,Group:$U,Separator:LU,Dialog:HU,Empty:VU,Loading:YU});function FU(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function IU(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Q4(e){let t=m.useRef(e);return ui(()=>{t.current=e}),t}var ui=typeof window>"u"?m.useEffect:m.useLayoutEffect;function Li(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function br(e){let t=v0(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function K4(e,t,n,s=[]){let r=m.useRef(),i=Qc();return ui(()=>{var o;let l=(()=>{var u;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(u=h.current.textContent)==null?void 0:u.trim():r.current}})(),c=s.map(u=>u.trim());i.value(e,l,c),(o=t.current)==null||o.setAttribute($i,l),r.current=l}),r}var WU=()=>{let[e,t]=m.useState(),n=Li(()=>new Map);return ui(()=>{n.current.forEach(s=>s()),n.current=new Map},[e]),(s,r)=>{n.current.set(s,r),t({})}};function qU(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function bf({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(qU(t),{ref:t.ref},n(t.props.children)):n(t)}var XU={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function GU({isOpen:e,onClose:t}){const n=ws(),[s,r]=m.useState(""),[i,o]=m.useState(null);m.useEffect(()=>{(async()=>{try{const x=await(await fetch("/api/plugins")).json();o(x)}catch{}})()},[]);const l=d=>i!=null&&i.plugins?i.plugins.some(f=>f.id===d):!1,h=[{id:"users",title:"Users",description:"Manage users and their accounts",icon:li,action:()=>n("/users"),category:"Navigation",keywords:["user","account","profile"]},{id:"organizations",title:"Organizations",description:"Manage organizations and teams",icon:_s,action:()=>n("/organizations"),category:"Navigation",keywords:["org","company","team"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"},{id:"sessions",title:"Sessions",description:"View active user sessions",icon:my,action:()=>n("/sessions"),category:"Navigation",keywords:["session","login","active"]},{id:"tools",title:"Tools",description:"View tools and utilities",icon:TS,action:()=>n("/tools"),category:"Navigation",keywords:["utilities","tools"]},{id:"database",title:"Database",description:"View database and schema",icon:yt,disabled:!0,action:()=>n("/database"),category:"Navigation",keywords:["database","schema"]},{id:"settings",title:"Settings",description:"Configure Better Auth Studio",icon:co,action:()=>n("/settings"),category:"Navigation",keywords:["config","setup","preferences"]},{id:"dashboard",title:"Dashboard",description:"View overview and statistics",icon:my,action:()=>n("/"),category:"Navigation",keywords:["overview","stats","home"]},{id:"create-user",title:"Create User",description:"Add a new user to the system",icon:hg,action:()=>n("/users"),category:"Actions",keywords:["add","new","register"]},{id:"create-organization",title:"Create Organization",description:"Create a new organization",icon:dr,action:()=>n("/organizations"),category:"Actions",keywords:["add","new","org"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"},{id:"invite-user",title:"Invite User",description:"Send invitation to join organization",icon:dh,action:()=>n("/organizations"),category:"Actions",keywords:["invite","email","send"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"}].filter(d=>{var x;const f=s.toLowerCase();return d.title.toLowerCase().includes(f)||d.description.toLowerCase().includes(f)||((x=d.keywords)==null?void 0:x.some(w=>w.toLowerCase().includes(f)))}).reduce((d,f)=>(d[f.category]||(d[f.category]=[]),d[f.category].push(f),d),{});return m.useEffect(()=>{const d=f=>{(f.metaKey||f.ctrlKey)&&f.key==="k"&&f.preventDefault()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[]),m.useEffect(()=>{const d=f=>{f.key==="Escape"&&t()};if(e)return document.body.style.overflow="hidden",document.addEventListener("keydown",d),()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",d)}},[e,t]),e?a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-start justify-center pt-[20vh] z-50 overflow-hidden",onClick:t,children:a.jsx("div",{className:"bg-black/90 overflow-hidden border border-white/10 rounded-none w-full max-w-2xl mx-4",onClick:d=>d.stopPropagation(),children:a.jsxs(pl,{className:"p-2",children:[a.jsxs("div",{className:"flex items-center border-b border-dashed border-white/10 px-3 pb-3",children:[a.jsx(oi,{className:"w-4 h-4 text-gray-400 mr-3"}),a.jsx(pl.Input,{value:s,onValueChange:r,placeholder:"Search for actions, pages, or commands...",className:"flex-1 placeholder:text-xs bg-transparent text-white placeholder-gray-400 outline-none",autoFocus:!0}),a.jsx("kbd",{className:"hidden sm:inline-flex items-center px-2 py-1 text-xs text-gray-400 border border-dashed border-white/20 rounded-sm",children:"ESC"})]}),a.jsx(pl.List,{className:"max-h-96 overflow-y-auto p-2",children:Object.keys(h).length===0?a.jsxs("div",{className:"text-center py-8 text-gray-400",children:[a.jsx(oi,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),a.jsx("p",{children:"No results found"}),a.jsx("p",{className:"text-sm",children:"Try a different search term"})]}):Object.entries(h).map(([d,f])=>a.jsx(pl.Group,{heading:d,className:"text-xs text-gray-400 font-medium mb-4 px-2",children:f.map(x=>{const w=x.icon,v=x.disabled;return a.jsxs(pl.Item,{value:x.id,disabled:v,onSelect:()=>{v||(x.action(),t())},className:`flex items-center space-x-3 px-0 py-2 rounded-none transition-colors relative ${v?"opacity-40 cursor-not-allowed blur-[0.5px]":"hover:bg-white/5 cursor-pointer"}`,children:[a.jsx(w,{className:"w-4 h-4 text-white"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"text-white text-[13px] font-light flex items-center gap-2",children:[x.title,v&&a.jsx(mu,{className:"w-3 h-3 text-yellow-500"})]}),a.jsx("div",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:v?x.disabledMessage:x.description})]}),!v&&a.jsx(Xz,{className:"w-4 h-4 text-gray-400"})]},x.id)})},d))}),a.jsx("div",{className:"border-t border-dashed border-white/10 px-3 py-2 text-xs text-gray-400",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{children:["Press"," ",a.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"↑↓"})," ","to navigate"]}),a.jsxs("span",{children:["Press"," ",a.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"Enter"})," ","to select"]})]})})]})})}):null}const ZU={connecting:{label:"Connecting",textClass:"text-amber-200 border-amber-400/40",dotClass:"bg-amber-300",animate:"animate-pulse"},watching:{label:"Watching",textClass:"text-emerald-200 border-emerald-400/40",dotClass:"bg-emerald-300"},refreshing:{label:"Refreshing",textClass:"text-amber-200 border-amber-400/40",dotClass:"bg-amber-300",animate:"animate-pulse"},up_to_date:{label:"Up-to-date",textClass:"text-emerald-200 border-emerald-400/40",dotClass:"bg-emerald-300"},error:{label:"Reload Failed",textClass:"text-red-200 border-red-500/50",dotClass:"bg-red-400",animate:"animate-pulse"},unavailable:{label:"Watch Off",textClass:"text-gray-300 border-gray-500/40",dotClass:"bg-gray-400"},reconnecting:{label:"Reconnecting",textClass:"text-amber-200 border-amber-400/40",dotClass:"bg-amber-300",animate:"animate-pulse"}};function QU(e){switch(e){case"refreshing":return"refreshing";case"error":return"error";case"up_to_date":case"watching":return"up_to_date";default:return"watching"}}function KU({children:e}){const t=Wo(),{counts:n,loading:s}=gf(),r=ws(),[i,o]=m.useState(!1),[l,c]=m.useState("v1.0.0"),[u,h]=m.useState({status:"connecting"}),d=m.useRef(!1),f=m.useRef(null),x=m.useRef(!1),w=()=>{f.current&&(clearTimeout(f.current),f.current=null)},v=()=>{w(),f.current=setTimeout(()=>{d.current=!1,h(y=>({...y,status:"up_to_date",updatedAt:Date.now()}))},4e3)};m.useEffect(()=>{const y=j=>{(j.metaKey||j.ctrlKey)&&j.key==="k"&&(j.preventDefault(),o(!0))};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[]),m.useEffect(()=>((async()=>{var j;try{const C=await(await fetch("/api/config")).json();(j=C.studio)!=null&&j.version&&c(`v${C.studio.version}`)}catch{}})(),()=>{w()}),[]);const N=()=>{d.current=!1,x.current=!1,w(),h(y=>({...y,status:"refreshing",updatedAt:Date.now()})),window.location.reload()};b4(y=>{if(y.type==="studio_status"){const j=QU(y.status);j==="up_to_date"&&(d.current=!1,w()),h(S=>({status:j,fileName:y.fileName||S.fileName,updatedAt:y.updatedAt||Date.now()}));return}if(y.type==="config_change_detected"){d.current=!0,v(),h(j=>({...j,status:"refreshing",fileName:y.fileName||j.fileName,updatedAt:Date.now()})),x.current||(x.current=!0,setTimeout(()=>{N()},200));return}if(y.type==="config_changed"){d.current=!1,w(),h(j=>({...j,status:"up_to_date",fileName:y.fileName||j.fileName,updatedAt:y.changedAt||Date.now()}));return}y.type==="connected"&&(d.current=!1,w(),h(j=>({...j,status:"up_to_date",updatedAt:Date.now()})))},{onStatusChange:y=>{h(j=>{if(j.status==="refreshing"&&y!=="unavailable"&&y!=="open")return j;switch(y){case"connecting":return{...j,status:"connecting"};case"open":return w(),d.current?j:{...j,status:"watching",updatedAt:Date.now()};case"reconnecting":case"closed":return{...j,status:"reconnecting"};case"error":return{...j,status:"error"};case"unavailable":return d.current=!1,w(),{...j,status:"unavailable"};default:return j}})}});const g=ZU[u.status],b=y=>y>=1e3?`${(y/1e3).toFixed(1).replace(/\.0$/,"")}k`:y.toString(),p=[{name:"Dashboard",href:"/",icon:nR},{name:"Users",href:"/users",icon:li,badge:s?"...":b(n.users)},{name:"Organizations",href:"/organizations",icon:_s,badge:s?"...":b(n.organizations)},{name:"Database",href:"/database",icon:yt},{name:"Tools",href:"/tools",icon:TS},{name:"Settings",href:"/settings",icon:co}];return a.jsxs("div",{className:"min-h-screen bg-black",children:[a.jsx("div",{className:"bg-black/70 border-b border-white/15",children:a.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[a.jsx("div",{className:"w-7 h-7 border border-dashed border-white/20 rounded-lg flex items-center justify-center",children:a.jsx("span",{className:"text-black font-bold text-md",children:"⚡"})}),a.jsx("div",{className:"mb-0 cursor-pointer",onClick:()=>r("/"),children:a.jsxs("h1",{className:"text-md inline-flex mb-0 items-start font-light font-mono uppercase text-white gap-2",children:["Better-Auth Studio",a.jsxs("sup",{className:"text-xs text-gray-400 ml-1 mt-0 flex items-center space-x-2",children:[a.jsxs("span",{className:"inline-flex items-center",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 lowercase font-mono text-xs",children:l}),a.jsx("span",{className:"ml-1",children:"]"})]}),a.jsxs("span",{className:`inline-flex items-center rounded border px-1.5 py-0.5 font-normal uppercase tracking-wide text-[9px] ${g.textClass} ${g.animate??""}`,children:[a.jsx("span",{className:`mr-1 h-1.5 w-1.5 rounded-full ${g.dotClass}`}),g.label]}),a.jsx("button",{type:"button",onClick:N,"aria-label":"Hard refresh studio",className:"ml-1 inline-flex items-center rounded border border-dashed border-white/20 p-0.5 text-white/70 transition hover:text-white hover:border-white/50",children:a.jsx(ug,{className:"h-3.5 w-3.5"})})]})]})})]})}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(oi,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx("input",{type:"text",placeholder:"Search...",onClick:()=>o(!0),className:"pl-10 pr-4 py-2 bg-black border rounded-none border-gray-600 text-white border-dashed border-white/20 focus:ring-2 focus:ring-white focus:border-transparent transition-colors placeholder-gray-400 cursor-pointer",readOnly:!0}),a.jsx("kbd",{className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-xs text-gray-400 border border-dashed border-white/10 rounded-sm px-1.5 py-0.5",children:"⌘ K"})]}),a.jsxs("a",{href:"https://better-auth.com/docs",target:"_blank",rel:"noopener",className:"group flex items-center",children:[a.jsx("span",{className:"text-white/70 text-xs mr-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-sm uppercase",children:"Docs"}),a.jsx("span",{className:"text-white/70 text-xs ml-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"]"})]}),a.jsxs("a",{href:"https://better-auth.com/support",target:"_blank",rel:"noopener",className:"group flex items-center",children:[a.jsx("span",{className:"text-white/70 text-xs mr-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-sm uppercase",children:"Support"}),a.jsx("span",{className:"text-white/70 text-xs ml-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"]"})]})]})]})}),a.jsx("div",{className:"bg-black/50 border-b border-white/10",children:a.jsx("div",{className:"px-6",children:a.jsx("nav",{className:"flex space-x-8",children:p.map(y=>{const j=t.pathname===y.href;return a.jsxs(Ap,{to:y.href,className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${j?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(y.icon,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:[y.name,y.badge&&a.jsxs("sup",{className:"text-xs text-gray-500 ml-1",children:[a.jsx("span",{className:"mr-0.5",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:y.badge}),a.jsx("span",{className:"ml-0.5",children:"]"})]})]})]},y.name)})})})}),a.jsx("div",{className:"flex-1 p-0",children:e}),a.jsx(GU,{isOpen:i,onClose:()=>o(!1)})]})}function vh(e){"@babel/helpers - typeof";return vh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vh(e)}function hi(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function fn(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Zs(e){fn(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||vh(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function JU(e,t){fn(2,arguments);var n=Zs(e).getTime(),s=hi(t);return new Date(n+s)}var e$={};function yf(){return e$}function t$(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function n$(e){return fn(1,arguments),e instanceof Date||vh(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function s$(e){if(fn(1,arguments),!n$(e)&&typeof e!="number")return!1;var t=Zs(e);return!isNaN(Number(t))}function a$(e,t){fn(2,arguments);var n=hi(t);return JU(e,-n)}var r$=864e5;function i$(e){fn(1,arguments);var t=Zs(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var s=t.getTime(),r=n-s;return Math.floor(r/r$)+1}function bh(e){fn(1,arguments);var t=1,n=Zs(e),s=n.getUTCDay(),r=(s<t?7:0)+s-t;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n}function J4(e){fn(1,arguments);var t=Zs(e),n=t.getUTCFullYear(),s=new Date(0);s.setUTCFullYear(n+1,0,4),s.setUTCHours(0,0,0,0);var r=bh(s),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var o=bh(i);return t.getTime()>=r.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function o$(e){fn(1,arguments);var t=J4(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var s=bh(n);return s}var l$=6048e5;function c$(e){fn(1,arguments);var t=Zs(e),n=bh(t).getTime()-o$(t).getTime();return Math.round(n/l$)+1}function yh(e,t){var n,s,r,i,o,l,c,u;fn(1,arguments);var h=yf(),d=hi((n=(s=(r=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&r!==void 0?r:h.weekStartsOn)!==null&&s!==void 0?s:(c=h.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Zs(e),x=f.getUTCDay(),w=(x<d?7:0)+x-d;return f.setUTCDate(f.getUTCDate()-w),f.setUTCHours(0,0,0,0),f}function eC(e,t){var n,s,r,i,o,l,c,u;fn(1,arguments);var h=Zs(e),d=h.getUTCFullYear(),f=yf(),x=hi((n=(s=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&r!==void 0?r:f.firstWeekContainsDate)!==null&&s!==void 0?s:(c=f.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(x>=1&&x<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=new Date(0);w.setUTCFullYear(d+1,0,x),w.setUTCHours(0,0,0,0);var v=yh(w,t),N=new Date(0);N.setUTCFullYear(d,0,x),N.setUTCHours(0,0,0,0);var g=yh(N,t);return h.getTime()>=v.getTime()?d+1:h.getTime()>=g.getTime()?d:d-1}function d$(e,t){var n,s,r,i,o,l,c,u;fn(1,arguments);var h=yf(),d=hi((n=(s=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&r!==void 0?r:h.firstWeekContainsDate)!==null&&s!==void 0?s:(c=h.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1),f=eC(e,t),x=new Date(0);x.setUTCFullYear(f,0,d),x.setUTCHours(0,0,0,0);var w=yh(x,t);return w}var u$=6048e5;function h$(e,t){fn(1,arguments);var n=Zs(e),s=yh(n,t).getTime()-d$(n,t).getTime();return Math.round(s/u$)+1}function st(e,t){for(var n=e<0?"-":"",s=Math.abs(e).toString();s.length<t;)s="0"+s;return n+s}var $a={y:function(t,n){var s=t.getUTCFullYear(),r=s>0?s:1-s;return st(n==="yy"?r%100:r,n.length)},M:function(t,n){var s=t.getUTCMonth();return n==="M"?String(s+1):st(s+1,2)},d:function(t,n){return st(t.getUTCDate(),n.length)},a:function(t,n){var s=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];case"aaaa":default:return s==="am"?"a.m.":"p.m."}},h:function(t,n){return st(t.getUTCHours()%12||12,n.length)},H:function(t,n){return st(t.getUTCHours(),n.length)},m:function(t,n){return st(t.getUTCMinutes(),n.length)},s:function(t,n){return st(t.getUTCSeconds(),n.length)},S:function(t,n){var s=n.length,r=t.getUTCMilliseconds(),i=Math.floor(r*Math.pow(10,s-3));return st(i,n.length)}},_i={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},f$={G:function(t,n,s){var r=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})}},y:function(t,n,s){if(n==="yo"){var r=t.getUTCFullYear(),i=r>0?r:1-r;return s.ordinalNumber(i,{unit:"year"})}return $a.y(t,n)},Y:function(t,n,s,r){var i=eC(t,r),o=i>0?i:1-i;if(n==="YY"){var l=o%100;return st(l,2)}return n==="Yo"?s.ordinalNumber(o,{unit:"year"}):st(o,n.length)},R:function(t,n){var s=J4(t);return st(s,n.length)},u:function(t,n){var s=t.getUTCFullYear();return st(s,n.length)},Q:function(t,n,s){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return st(r,2);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,s){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return st(r,2);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,s){var r=t.getUTCMonth();switch(n){case"M":case"MM":return $a.M(t,n);case"Mo":return s.ordinalNumber(r+1,{unit:"month"});case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,s){var r=t.getUTCMonth();switch(n){case"L":return String(r+1);case"LL":return st(r+1,2);case"Lo":return s.ordinalNumber(r+1,{unit:"month"});case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,s,r){var i=h$(t,r);return n==="wo"?s.ordinalNumber(i,{unit:"week"}):st(i,n.length)},I:function(t,n,s){var r=c$(t);return n==="Io"?s.ordinalNumber(r,{unit:"week"}):st(r,n.length)},d:function(t,n,s){return n==="do"?s.ordinalNumber(t.getUTCDate(),{unit:"date"}):$a.d(t,n)},D:function(t,n,s){var r=i$(t);return n==="Do"?s.ordinalNumber(r,{unit:"dayOfYear"}):st(r,n.length)},E:function(t,n,s){var r=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})}},e:function(t,n,s,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return st(o,2);case"eo":return s.ordinalNumber(o,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});case"eeee":default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,s,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return st(o,n.length);case"co":return s.ordinalNumber(o,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});case"cccc":default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,s){var r=t.getUTCDay(),i=r===0?7:r;switch(n){case"i":return String(i);case"ii":return st(i,n.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(r,{width:"short",context:"formatting"});case"iiii":default:return s.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,s){var r=t.getUTCHours(),i=r/12>=1?"pm":"am";switch(n){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,s){var r=t.getUTCHours(),i;switch(r===12?i=_i.noon:r===0?i=_i.midnight:i=r/12>=1?"pm":"am",n){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,s){var r=t.getUTCHours(),i;switch(r>=17?i=_i.evening:r>=12?i=_i.afternoon:r>=4?i=_i.morning:i=_i.night,n){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,s){if(n==="ho"){var r=t.getUTCHours()%12;return r===0&&(r=12),s.ordinalNumber(r,{unit:"hour"})}return $a.h(t,n)},H:function(t,n,s){return n==="Ho"?s.ordinalNumber(t.getUTCHours(),{unit:"hour"}):$a.H(t,n)},K:function(t,n,s){var r=t.getUTCHours()%12;return n==="Ko"?s.ordinalNumber(r,{unit:"hour"}):st(r,n.length)},k:function(t,n,s){var r=t.getUTCHours();return r===0&&(r=24),n==="ko"?s.ordinalNumber(r,{unit:"hour"}):st(r,n.length)},m:function(t,n,s){return n==="mo"?s.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):$a.m(t,n)},s:function(t,n,s){return n==="so"?s.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):$a.s(t,n)},S:function(t,n){return $a.S(t,n)},X:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return Zy(o);case"XXXX":case"XX":return zr(o);case"XXXXX":case"XXX":default:return zr(o,":")}},x:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();switch(n){case"x":return Zy(o);case"xxxx":case"xx":return zr(o);case"xxxxx":case"xxx":default:return zr(o,":")}},O:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+Gy(o,":");case"OOOO":default:return"GMT"+zr(o,":")}},z:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+Gy(o,":");case"zzzz":default:return"GMT"+zr(o,":")}},t:function(t,n,s,r){var i=r._originalDate||t,o=Math.floor(i.getTime()/1e3);return st(o,n.length)},T:function(t,n,s,r){var i=r._originalDate||t,o=i.getTime();return st(o,n.length)}};function Gy(e,t){var n=e>0?"-":"+",s=Math.abs(e),r=Math.floor(s/60),i=s%60;if(i===0)return n+String(r);var o=t;return n+String(r)+o+st(i,2)}function Zy(e,t){if(e%60===0){var n=e>0?"-":"+";return n+st(Math.abs(e)/60,2)}return zr(e,t)}function zr(e,t){var n=t||"",s=e>0?"-":"+",r=Math.abs(e),i=st(Math.floor(r/60),2),o=st(r%60,2);return s+i+n+o}var Qy=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},tC=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},m$=function(t,n){var s=t.match(/(P+)(p+)?/)||[],r=s[1],i=s[2];if(!i)return Qy(t,n);var o;switch(r){case"P":o=n.dateTime({width:"short"});break;case"PP":o=n.dateTime({width:"medium"});break;case"PPP":o=n.dateTime({width:"long"});break;case"PPPP":default:o=n.dateTime({width:"full"});break}return o.replace("{{date}}",Qy(r,n)).replace("{{time}}",tC(i,n))},x$={p:tC,P:m$},g$=["D","DD"],p$=["YY","YYYY"];function v$(e){return g$.indexOf(e)!==-1}function b$(e){return p$.indexOf(e)!==-1}function Ky(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var y$={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"}},w$=function(t,n,s){var r,i=y$[t];return typeof i=="string"?r=i:n===1?r=i.one:r=i.other.replace("{{count}}",n.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+r:r+" ago":r};function Bm(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,s=e.formats[n]||e.formats[e.defaultWidth];return s}}var N$={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},j$={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},S$={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},C$={date:Bm({formats:N$,defaultWidth:"full"}),time:Bm({formats:j$,defaultWidth:"full"}),dateTime:Bm({formats:S$,defaultWidth:"full"})},E$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},k$=function(t,n,s,r){return E$[t]};function vl(e){return function(t,n){var s=n!=null&&n.context?String(n.context):"standalone",r;if(s==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):i;r=e.formattingValues[o]||e.formattingValues[i]}else{var l=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[c]||e.values[l]}var u=e.argumentCallback?e.argumentCallback(t):t;return r[u]}}var M$={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},T$={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},D$={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"]},_$={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"]},A$={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"}},O$={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"}},z$=function(t,n){var s=Number(t),r=s%100;if(r>20||r<10)switch(r%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},R$={ordinalNumber:z$,era:vl({values:M$,defaultWidth:"wide"}),quarter:vl({values:T$,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:vl({values:D$,defaultWidth:"wide"}),day:vl({values:_$,defaultWidth:"wide"}),dayPeriod:vl({values:A$,defaultWidth:"wide",formattingValues:O$,defaultFormattingWidth:"wide"})};function bl(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.width,r=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],i=t.match(r);if(!i)return null;var o=i[0],l=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?$$(l,function(d){return d.test(o)}):U$(l,function(d){return d.test(o)}),u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;var h=t.slice(o.length);return{value:u,rest:h}}}function U$(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function $$(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function L$(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=t.match(e.matchPattern);if(!s)return null;var r=s[0],i=t.match(e.parsePattern);if(!i)return null;var o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;var l=t.slice(r.length);return{value:o,rest:l}}}var P$=/^(\d+)(th|st|nd|rd)?/i,B$=/\d+/i,H$={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},V$={any:[/^b/i,/^(a|c)/i]},Y$={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},F$={any:[/1/i,/2/i,/3/i,/4/i]},I$={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},W$={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]},q$={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},X$={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},Z$={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}},Q$={ordinalNumber:L$({matchPattern:P$,parsePattern:B$,valueCallback:function(t){return parseInt(t,10)}}),era:bl({matchPatterns:H$,defaultMatchWidth:"wide",parsePatterns:V$,defaultParseWidth:"any"}),quarter:bl({matchPatterns:Y$,defaultMatchWidth:"wide",parsePatterns:F$,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:bl({matchPatterns:I$,defaultMatchWidth:"wide",parsePatterns:W$,defaultParseWidth:"any"}),day:bl({matchPatterns:q$,defaultMatchWidth:"wide",parsePatterns:X$,defaultParseWidth:"any"}),dayPeriod:bl({matchPatterns:G$,defaultMatchWidth:"any",parsePatterns:Z$,defaultParseWidth:"any"})},K$={code:"en-US",formatDistance:w$,formatLong:C$,formatRelative:k$,localize:R$,match:Q$,options:{weekStartsOn:0,firstWeekContainsDate:1}},J$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,eL=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,tL=/^'([^]*?)'?$/,nL=/''/g,sL=/[a-zA-Z]/;function Zn(e,t,n){var s,r,i,o,l,c,u,h,d,f,x,w,v,N;fn(2,arguments);var g=String(t),b=yf(),p=(s=(r=void 0)!==null&&r!==void 0?r:b.locale)!==null&&s!==void 0?s:K$,y=hi((i=(o=(l=(c=void 0)!==null&&c!==void 0?c:void 0)!==null&&l!==void 0?l:b.firstWeekContainsDate)!==null&&o!==void 0?o:(u=b.locale)===null||u===void 0||(h=u.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(y>=1&&y<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=hi((d=(f=(x=(w=void 0)!==null&&w!==void 0?w:void 0)!==null&&x!==void 0?x:b.weekStartsOn)!==null&&f!==void 0?f:(v=b.locale)===null||v===void 0||(N=v.options)===null||N===void 0?void 0:N.weekStartsOn)!==null&&d!==void 0?d:0);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!p.localize)throw new RangeError("locale must contain localize property");if(!p.formatLong)throw new RangeError("locale must contain formatLong property");var S=Zs(e);if(!s$(S))throw new RangeError("Invalid time value");var C=t$(S),T=a$(S,C),A={firstWeekContainsDate:y,weekStartsOn:j,locale:p,_originalDate:S},P=g.match(eL).map(function(U){var O=U[0];if(O==="p"||O==="P"){var V=x$[O];return V(U,p.formatLong)}return U}).join("").match(J$).map(function(U){if(U==="''")return"'";var O=U[0];if(O==="'")return aL(U);var V=f$[O];if(V)return b$(U)&&Ky(U,t,String(e)),v$(U)&&Ky(U,t,String(e)),V(T,U,p.localize,A);if(O.match(sL))throw new RangeError("Format string contains an unescaped latin alphabet character `"+O+"`");return U}).join("");return P}function aL(e){var t=e.match(tL);return t?t[1].replace(nL,"'"):e}const Jy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ew=uh,nC=(e,t)=>n=>{var s;if((t==null?void 0:t.variants)==null)return ew(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:i}=t,o=Object.keys(r).map(u=>{const h=n==null?void 0:n[u],d=i==null?void 0:i[u];if(h===null)return null;const f=Jy(h)||Jy(d);return r[u][f]}),l=n&&Object.entries(n).reduce((u,h)=>{let[d,f]=h;return f===void 0||(u[d]=f),u},{}),c=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((u,h)=>{let{class:d,className:f,...x}=h;return Object.entries(x).every(w=>{let[v,N]=w;return Array.isArray(N)?N.includes({...i,...l}[v]):{...i,...l}[v]===N})?[...u,d,f]:u},[]);return ew(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},Sg=nC("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),F=m.forwardRef(({className:e,variant:t,size:n,asChild:s=!1,...r},i)=>{const o=s?kU:"button";return a.jsx(o,{className:Me(Sg({variant:t,size:n,className:e})),ref:i,...r})});F.displayName="Button";function rL(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const Hm={},Dl={};function Lr(e,t){try{const s=(Hm[e]||(Hm[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return s in Dl?Dl[s]:tw(s,s.split(":"))}catch{if(e in Dl)return Dl[e];const n=e==null?void 0:e.match(iL);return n?tw(e,n.slice(1)):NaN}}const iL=/([+-]\d\d):?(\d\d)?/;function tw(e,t){const n=+(t[0]||0),s=+(t[1]||0),r=+(t[2]||0)/60;return Dl[e]=n*60+s>0?n*60+s+r:n*60-s-r}class $s extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Lr(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),sC(this),Cg(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new $s(...n,t):new $s(Date.now(),t)}withTimeZone(t){return new $s(+this,t)}getTimezoneOffset(){const t=-Lr(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Cg(this),+this}[Symbol.for("constructDateFrom")](t){return new $s(+new Date(t),this.timeZone)}}const nw=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!nw.test(e))return;const t=e.replace(nw,"$1UTC");$s.prototype[t]&&(e.startsWith("get")?$s.prototype[e]=function(){return this.internal[t]()}:($s.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),oL(this),+this},$s.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Cg(this),+this}))});function Cg(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Lr(e.timeZone,e)*60))}function oL(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),sC(e)}function sC(e){const t=Lr(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),s=new Date(+e);s.setUTCHours(s.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),i=-new Date(+s).getTimezoneOffset(),o=r-i,l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const c=r-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const u=new Date(+e);u.setUTCSeconds(0);const h=r>0?u.getSeconds():(u.getSeconds()-60)%60,d=Math.round(-(Lr(e.timeZone,e)*60))%60;(d||h)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+d),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+d+h));const f=Lr(e.timeZone,e),x=f>0?Math.floor(f):Math.ceil(f),v=-new Date(+e).getTimezoneOffset()-x,N=x!==n,g=v-c;if(N&&g){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+g);const b=Lr(e.timeZone,e),p=b>0?Math.floor(b):Math.ceil(b),y=x-p;y&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+y),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+y))}}class sn extends $s{static tz(t,...n){return n.length?new sn(...n,t):new sn(Date.now(),t)}toISOString(){const[t,n,s]=this.tzComponents(),r=`${t}${n}:${s}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,s,r]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${s} ${n} ${r}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,s,r]=this.tzComponents();return`${t} GMT${n}${s}${r} (${rL(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",s=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),r=String(Math.abs(t)%60).padStart(2,"0");return[n,s,r]}withTimeZone(t){return new sn(+this,t)}[Symbol.for("constructDateFrom")](t){return new sn(+new Date(t),this.timeZone)}}const aC=6048e5,lL=864e5,sw=Symbol.for("constructDateFrom");function Ut(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&sw in e?e[sw](t):e instanceof Date?new e.constructor(t):new Date(t)}function ct(e,t){return Ut(t||e,e)}function rC(e,t,n){const s=ct(e,n==null?void 0:n.in);return isNaN(t)?Ut(e,NaN):(t&&s.setDate(s.getDate()+t),s)}function iC(e,t,n){const s=ct(e,n==null?void 0:n.in);if(isNaN(t))return Ut(e,NaN);if(!t)return s;const r=s.getDate(),i=Ut(e,s.getTime());i.setMonth(s.getMonth()+t+1,0);const o=i.getDate();return r>=o?i:(s.setFullYear(i.getFullYear(),i.getMonth(),r),s)}let cL={};function Kc(){return cL}function Uo(e,t){var l,c,u,h;const n=Kc(),s=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.weekStartsOn)??0,r=ct(e,t==null?void 0:t.in),i=r.getDay(),o=(i<s?7:0)+i-s;return r.setDate(r.getDate()-o),r.setHours(0,0,0,0),r}function Sc(e,t){return Uo(e,{...t,weekStartsOn:1})}function oC(e,t){const n=ct(e,t==null?void 0:t.in),s=n.getFullYear(),r=Ut(n,0);r.setFullYear(s+1,0,4),r.setHours(0,0,0,0);const i=Sc(r),o=Ut(n,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const l=Sc(o);return n.getTime()>=i.getTime()?s+1:n.getTime()>=l.getTime()?s:s-1}function aw(e){const t=ct(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Zo(e,...t){const n=Ut.bind(null,t.find(s=>typeof s=="object"));return t.map(n)}function Cc(e,t){const n=ct(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function lC(e,t,n){const[s,r]=Zo(n==null?void 0:n.in,e,t),i=Cc(s),o=Cc(r),l=+i-aw(i),c=+o-aw(o);return Math.round((l-c)/lL)}function dL(e,t){const n=oC(e,t),s=Ut(e,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),Sc(s)}function uL(e,t,n){return rC(e,t*7,n)}function hL(e,t,n){return iC(e,t*12,n)}function fL(e,t){let n,s=t==null?void 0:t.in;return e.forEach(r=>{!s&&typeof r=="object"&&(s=Ut.bind(null,r));const i=ct(r,s);(!n||n<i||isNaN(+i))&&(n=i)}),Ut(s,n||NaN)}function mL(e,t){let n,s=t==null?void 0:t.in;return e.forEach(r=>{!s&&typeof r=="object"&&(s=Ut.bind(null,r));const i=ct(r,s);(!n||n>i||isNaN(+i))&&(n=i)}),Ut(s,n||NaN)}function xL(e,t,n){const[s,r]=Zo(n==null?void 0:n.in,e,t);return+Cc(s)==+Cc(r)}function cC(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function gL(e){return!(!cC(e)&&typeof e!="number"||isNaN(+ct(e)))}function pL(e,t,n){const[s,r]=Zo(n==null?void 0:n.in,e,t),i=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return i*12+o}function vL(e,t){const n=ct(e,t==null?void 0:t.in),s=n.getMonth();return n.setFullYear(n.getFullYear(),s+1,0),n.setHours(23,59,59,999),n}function dC(e,t){const[n,s]=Zo(e,t.start,t.end);return{start:n,end:s}}function bL(e,t){const{start:n,end:s}=dC(t==null?void 0:t.in,e);let r=+n>+s;const i=r?+n:+s,o=r?s:n;o.setHours(0,0,0,0),o.setDate(1);let l=1;const c=[];for(;+o<=i;)c.push(Ut(n,o)),o.setMonth(o.getMonth()+l);return r?c.reverse():c}function yL(e,t){const n=ct(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function wL(e,t){const n=ct(e,t==null?void 0:t.in),s=n.getFullYear();return n.setFullYear(s+1,0,0),n.setHours(23,59,59,999),n}function uC(e,t){const n=ct(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function NL(e,t){const{start:n,end:s}=dC(t==null?void 0:t.in,e);let r=+n>+s;const i=r?+n:+s,o=r?s:n;o.setHours(0,0,0,0),o.setMonth(0,1);let l=1;const c=[];for(;+o<=i;)c.push(Ut(n,o)),o.setFullYear(o.getFullYear()+l);return r?c.reverse():c}function hC(e,t){var l,c,u,h;const n=Kc(),s=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.weekStartsOn)??0,r=ct(e,t==null?void 0:t.in),i=r.getDay(),o=(i<s?-7:0)+6-(i-s);return r.setDate(r.getDate()+o),r.setHours(23,59,59,999),r}function jL(e,t){return hC(e,{...t,weekStartsOn:1})}const SL={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"}},CL=(e,t,n)=>{let s;const r=SL[e];return typeof r=="string"?s=r:t===1?s=r.one:s=r.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+s:s+" ago":s};function Vm(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const EL={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},kL={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ML={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},TL={date:Vm({formats:EL,defaultWidth:"full"}),time:Vm({formats:kL,defaultWidth:"full"}),dateTime:Vm({formats:ML,defaultWidth:"full"})},DL={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_L=(e,t,n,s)=>DL[e];function yl(e){return(t,n)=>{const s=n!=null&&n.context?String(n.context):"standalone";let r;if(s==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;r=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return r[i]}}const AL={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},OL={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},zL={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"]},RL={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"]},UL={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"}},$L={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"}},LL=(e,t)=>{const n=Number(e),s=n%100;if(s>20||s<10)switch(s%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},PL={ordinalNumber:LL,era:yl({values:AL,defaultWidth:"wide"}),quarter:yl({values:OL,defaultWidth:"wide",argumentCallback:e=>e-1}),month:yl({values:zL,defaultWidth:"wide"}),day:yl({values:RL,defaultWidth:"wide"}),dayPeriod:yl({values:UL,defaultWidth:"wide",formattingValues:$L,defaultFormattingWidth:"wide"})};function wl(e){return(t,n={})=>{const s=n.width,r=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],i=t.match(r);if(!i)return null;const o=i[0],l=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?HL(l,d=>d.test(o)):BL(l,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const h=t.slice(o.length);return{value:u,rest:h}}}function BL(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function HL(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function VL(e){return(t,n={})=>{const s=t.match(e.matchPattern);if(!s)return null;const r=s[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const l=t.slice(r.length);return{value:o,rest:l}}}const YL=/^(\d+)(th|st|nd|rd)?/i,FL=/\d+/i,IL={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},WL={any:[/^b/i,/^(a|c)/i]},qL={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},XL={any:[/1/i,/2/i,/3/i,/4/i]},GL={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},ZL={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]},QL={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},KL={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]},JL={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},eP={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}},tP={ordinalNumber:VL({matchPattern:YL,parsePattern:FL,valueCallback:e=>parseInt(e,10)}),era:wl({matchPatterns:IL,defaultMatchWidth:"wide",parsePatterns:WL,defaultParseWidth:"any"}),quarter:wl({matchPatterns:qL,defaultMatchWidth:"wide",parsePatterns:XL,defaultParseWidth:"any",valueCallback:e=>e+1}),month:wl({matchPatterns:GL,defaultMatchWidth:"wide",parsePatterns:ZL,defaultParseWidth:"any"}),day:wl({matchPatterns:QL,defaultMatchWidth:"wide",parsePatterns:KL,defaultParseWidth:"any"}),dayPeriod:wl({matchPatterns:JL,defaultMatchWidth:"any",parsePatterns:eP,defaultParseWidth:"any"})},b0={code:"en-US",formatDistance:CL,formatLong:TL,formatRelative:_L,localize:PL,match:tP,options:{weekStartsOn:0,firstWeekContainsDate:1}};function nP(e,t){const n=ct(e,t==null?void 0:t.in);return lC(n,uC(n))+1}function fC(e,t){const n=ct(e,t==null?void 0:t.in),s=+Sc(n)-+dL(n);return Math.round(s/aC)+1}function mC(e,t){var h,d,f,x;const n=ct(e,t==null?void 0:t.in),s=n.getFullYear(),r=Kc(),i=(t==null?void 0:t.firstWeekContainsDate)??((d=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((x=(f=r.locale)==null?void 0:f.options)==null?void 0:x.firstWeekContainsDate)??1,o=Ut((t==null?void 0:t.in)||e,0);o.setFullYear(s+1,0,i),o.setHours(0,0,0,0);const l=Uo(o,t),c=Ut((t==null?void 0:t.in)||e,0);c.setFullYear(s,0,i),c.setHours(0,0,0,0);const u=Uo(c,t);return+n>=+l?s+1:+n>=+u?s:s-1}function sP(e,t){var l,c,u,h;const n=Kc(),s=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??1,r=mC(e,t),i=Ut((t==null?void 0:t.in)||e,0);return i.setFullYear(r,0,s),i.setHours(0,0,0,0),Uo(i,t)}function xC(e,t){const n=ct(e,t==null?void 0:t.in),s=+Uo(n,t)-+sP(n,t);return Math.round(s/aC)+1}function at(e,t){const n=e<0?"-":"",s=Math.abs(e).toString().padStart(t,"0");return n+s}const La={y(e,t){const n=e.getFullYear(),s=n>0?n:1-n;return at(t==="yy"?s%100:s,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):at(n+1,2)},d(e,t){return at(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return at(e.getHours()%12||12,t.length)},H(e,t){return at(e.getHours(),t.length)},m(e,t){return at(e.getMinutes(),t.length)},s(e,t){return at(e.getSeconds(),t.length)},S(e,t){const n=t.length,s=e.getMilliseconds(),r=Math.trunc(s*Math.pow(10,n-3));return at(r,t.length)}},Ai={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},rw={G:function(e,t,n){const s=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});case"GGGG":default:return n.era(s,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const s=e.getFullYear(),r=s>0?s:1-s;return n.ordinalNumber(r,{unit:"year"})}return La.y(e,t)},Y:function(e,t,n,s){const r=mC(e,s),i=r>0?r:1-r;if(t==="YY"){const o=i%100;return at(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):at(i,t.length)},R:function(e,t){const n=oC(e);return at(n,t.length)},u:function(e,t){const n=e.getFullYear();return at(n,t.length)},Q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(s);case"QQ":return at(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(s);case"qq":return at(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(e,t,n){const s=e.getMonth();switch(t){case"M":case"MM":return La.M(e,t);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(e,t,n){const s=e.getMonth();switch(t){case"L":return String(s+1);case"LL":return at(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(e,t,n,s){const r=xC(e,s);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):at(r,t.length)},I:function(e,t,n){const s=fC(e);return t==="Io"?n.ordinalNumber(s,{unit:"week"}):at(s,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):La.d(e,t)},D:function(e,t,n){const s=nP(e);return t==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):at(s,t.length)},E:function(e,t,n){const s=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});case"EEEE":default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(e,t,n,s){const r=e.getDay(),i=(r-s.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return at(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,s){const r=e.getDay(),i=(r-s.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return at(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const s=e.getDay(),r=s===0?7:s;switch(t){case"i":return String(r);case"ii":return at(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});case"iiii":default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const s=e.getHours();let r;switch(s===12?r=Ai.noon:s===0?r=Ai.midnight:r=s/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const s=e.getHours();let r;switch(s>=17?r=Ai.evening:s>=12?r=Ai.afternoon:s>=4?r=Ai.morning:r=Ai.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let s=e.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return La.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):La.H(e,t)},K:function(e,t,n){const s=e.getHours()%12;return t==="Ko"?n.ordinalNumber(s,{unit:"hour"}):at(s,t.length)},k:function(e,t,n){let s=e.getHours();return s===0&&(s=24),t==="ko"?n.ordinalNumber(s,{unit:"hour"}):at(s,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):La.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):La.s(e,t)},S:function(e,t){return La.S(e,t)},X:function(e,t,n){const s=e.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return ow(s);case"XXXX":case"XX":return Rr(s);case"XXXXX":case"XXX":default:return Rr(s,":")}},x:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"x":return ow(s);case"xxxx":case"xx":return Rr(s);case"xxxxx":case"xxx":default:return Rr(s,":")}},O:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+iw(s,":");case"OOOO":default:return"GMT"+Rr(s,":")}},z:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+iw(s,":");case"zzzz":default:return"GMT"+Rr(s,":")}},t:function(e,t,n){const s=Math.trunc(+e/1e3);return at(s,t.length)},T:function(e,t,n){return at(+e,t.length)}};function iw(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),r=Math.trunc(s/60),i=s%60;return i===0?n+String(r):n+String(r)+t+at(i,2)}function ow(e,t){return e%60===0?(e>0?"-":"+")+at(Math.abs(e)/60,2):Rr(e,t)}function Rr(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),r=at(Math.trunc(s/60),2),i=at(s%60,2);return n+r+t+i}const lw=(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"})}},gC=(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"})}},aP=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return lw(e,t);let i;switch(s){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",lw(s,t)).replace("{{time}}",gC(r,t))},rP={p:gC,P:aP},iP=/^D+$/,oP=/^Y+$/,lP=["D","DD","YY","YYYY"];function cP(e){return iP.test(e)}function dP(e){return oP.test(e)}function uP(e,t,n){const s=hP(e,t,n);if(console.warn(s),lP.includes(e))throw new RangeError(s)}function hP(e,t,n){const s=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const fP=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,mP=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xP=/^'([^]*?)'?$/,gP=/''/g,pP=/[a-zA-Z]/;function vP(e,t,n){var h,d,f,x,w,v,N,g;const s=Kc(),r=(n==null?void 0:n.locale)??s.locale??b0,i=(n==null?void 0:n.firstWeekContainsDate)??((d=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((x=(f=s.locale)==null?void 0:f.options)==null?void 0:x.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((v=(w=n==null?void 0:n.locale)==null?void 0:w.options)==null?void 0:v.weekStartsOn)??s.weekStartsOn??((g=(N=s.locale)==null?void 0:N.options)==null?void 0:g.weekStartsOn)??0,l=ct(e,n==null?void 0:n.in);if(!gL(l))throw new RangeError("Invalid time value");let c=t.match(mP).map(b=>{const p=b[0];if(p==="p"||p==="P"){const y=rP[p];return y(b,r.formatLong)}return b}).join("").match(fP).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const p=b[0];if(p==="'")return{isToken:!1,value:bP(b)};if(rw[p])return{isToken:!0,value:b};if(p.match(pP))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:b}});r.localize.preprocessor&&(c=r.localize.preprocessor(l,c));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:r};return c.map(b=>{if(!b.isToken)return b.value;const p=b.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&dP(p)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&cP(p))&&uP(p,t,String(e));const y=rw[p[0]];return y(l,p,r.localize,u)}).join("")}function bP(e){const t=e.match(xP);return t?t[1].replace(gP,"'"):e}function yP(e,t){const n=ct(e,t==null?void 0:t.in),s=n.getFullYear(),r=n.getMonth(),i=Ut(n,0);return i.setFullYear(s,r+1,0),i.setHours(0,0,0,0),i.getDate()}function wP(e,t){return ct(e,t==null?void 0:t.in).getMonth()}function NP(e,t){return ct(e,t==null?void 0:t.in).getFullYear()}function jP(e,t){return+ct(e)>+ct(t)}function SP(e,t){return+ct(e)<+ct(t)}function CP(e,t,n){const[s,r]=Zo(n==null?void 0:n.in,e,t);return s.getFullYear()===r.getFullYear()&&s.getMonth()===r.getMonth()}function EP(e,t,n){const[s,r]=Zo(n==null?void 0:n.in,e,t);return s.getFullYear()===r.getFullYear()}function kP(e,t,n){const s=ct(e,n==null?void 0:n.in),r=s.getFullYear(),i=s.getDate(),o=Ut(e,0);o.setFullYear(r,t,15),o.setHours(0,0,0,0);const l=yP(o);return s.setMonth(t,Math.min(i,l)),s}function MP(e,t,n){const s=ct(e,n==null?void 0:n.in);return isNaN(+s)?Ut(e,NaN):(s.setFullYear(t),s)}const cw=5,TP=4;function DP(e,t){const n=t.startOfMonth(e),s=n.getDay()>0?n.getDay():7,r=t.addDays(e,-s+1),i=t.addDays(r,cw*7-1);return t.getMonth(e)===t.getMonth(i)?cw:TP}function pC(e,t){const n=t.startOfMonth(e),s=n.getDay();return s===1?n:s===0?t.addDays(n,-1*6):t.addDays(n,-1*(s-1))}function _P(e,t){const n=pC(e,t),s=DP(e,t);return t.addDays(n,s*7-1)}class Yn{constructor(t,n){this.Date=Date,this.today=()=>{var s;return(s=this.overrides)!=null&&s.today?this.overrides.today():this.options.timeZone?sn.tz(this.options.timeZone):new this.Date},this.newDate=(s,r,i)=>{var o;return(o=this.overrides)!=null&&o.newDate?this.overrides.newDate(s,r,i):this.options.timeZone?new sn(s,r,i,this.options.timeZone):new Date(s,r,i)},this.addDays=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(s,r):rC(s,r)},this.addMonths=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(s,r):iC(s,r)},this.addWeeks=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(s,r):uL(s,r)},this.addYears=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(s,r):hL(s,r)},this.differenceInCalendarDays=(s,r)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(s,r):lC(s,r)},this.differenceInCalendarMonths=(s,r)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(s,r):pL(s,r)},this.eachMonthOfInterval=s=>{var r;return(r=this.overrides)!=null&&r.eachMonthOfInterval?this.overrides.eachMonthOfInterval(s):bL(s)},this.eachYearOfInterval=s=>{var l;const r=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(s):NL(s),i=new Set(r.map(c=>this.getYear(c)));if(i.size===r.length)return r;const o=[];return i.forEach(c=>{o.push(new Date(c,0,1))}),o},this.endOfBroadcastWeek=s=>{var r;return(r=this.overrides)!=null&&r.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(s):_P(s,this)},this.endOfISOWeek=s=>{var r;return(r=this.overrides)!=null&&r.endOfISOWeek?this.overrides.endOfISOWeek(s):jL(s)},this.endOfMonth=s=>{var r;return(r=this.overrides)!=null&&r.endOfMonth?this.overrides.endOfMonth(s):vL(s)},this.endOfWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(s,r):hC(s,this.options)},this.endOfYear=s=>{var r;return(r=this.overrides)!=null&&r.endOfYear?this.overrides.endOfYear(s):wL(s)},this.format=(s,r,i)=>{var l;const o=(l=this.overrides)!=null&&l.format?this.overrides.format(s,r,this.options):vP(s,r,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(o):o},this.getISOWeek=s=>{var r;return(r=this.overrides)!=null&&r.getISOWeek?this.overrides.getISOWeek(s):fC(s)},this.getMonth=(s,r)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(s,this.options):wP(s,this.options)},this.getYear=(s,r)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(s,this.options):NP(s,this.options)},this.getWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(s,this.options):xC(s,this.options)},this.isAfter=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(s,r):jP(s,r)},this.isBefore=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(s,r):SP(s,r)},this.isDate=s=>{var r;return(r=this.overrides)!=null&&r.isDate?this.overrides.isDate(s):cC(s)},this.isSameDay=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(s,r):xL(s,r)},this.isSameMonth=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(s,r):CP(s,r)},this.isSameYear=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(s,r):EP(s,r)},this.max=s=>{var r;return(r=this.overrides)!=null&&r.max?this.overrides.max(s):fL(s)},this.min=s=>{var r;return(r=this.overrides)!=null&&r.min?this.overrides.min(s):mL(s)},this.setMonth=(s,r)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(s,r):kP(s,r)},this.setYear=(s,r)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(s,r):MP(s,r)},this.startOfBroadcastWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(s,this):pC(s,this)},this.startOfDay=s=>{var r;return(r=this.overrides)!=null&&r.startOfDay?this.overrides.startOfDay(s):Cc(s)},this.startOfISOWeek=s=>{var r;return(r=this.overrides)!=null&&r.startOfISOWeek?this.overrides.startOfISOWeek(s):Sc(s)},this.startOfMonth=s=>{var r;return(r=this.overrides)!=null&&r.startOfMonth?this.overrides.startOfMonth(s):yL(s)},this.startOfWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(s,this.options):Uo(s,this.options)},this.startOfYear=s=>{var r;return(r=this.overrides)!=null&&r.startOfYear?this.overrides.startOfYear(s):uC(s)},this.options={locale:b0,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),s={};for(let r=0;r<10;r++)s[r.toString()]=n.format(r);return s}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,s=>n[s]||s)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&Yn.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:s,numerals:r}=this.options,i=n==null?void 0:n.code;if(i&&Yn.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:s,numberingSystem:r}).format(t)}catch{}const o=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,o)}}Yn.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Qs=new Yn;class vC{constructor(t,n,s=Qs){this.date=t,this.displayMonth=n,this.outside=!!(n&&!s.isSameMonth(t,n)),this.dateLib=s}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class AP{constructor(t,n){this.date=t,this.weeks=n}}class OP{constructor(t,n){this.days=n,this.weekNumber=t}}function zP(e){return Q.createElement("button",{...e})}function RP(e){return Q.createElement("span",{...e})}function UP(e){const{size:t=24,orientation:n="left",className:s}=e;return Q.createElement("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&Q.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&Q.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&Q.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&Q.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function $P(e){const{day:t,modifiers:n,...s}=e;return Q.createElement("td",{...s})}function LP(e){const{day:t,modifiers:n,...s}=e,r=Q.useRef(null);return Q.useEffect(()=>{var i;n.focused&&((i=r.current)==null||i.focus())},[n.focused]),Q.createElement("button",{ref:r,...s})}var je;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(je||(je={}));var Et;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Et||(Et={}));var ms;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(ms||(ms={}));var Tn;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(Tn||(Tn={}));function PP(e){const{options:t,className:n,components:s,classNames:r,...i}=e,o=[r[je.Dropdown],n].join(" "),l=t==null?void 0:t.find(({value:c})=>c===i.value);return Q.createElement("span",{"data-disabled":i.disabled,className:r[je.DropdownRoot]},Q.createElement(s.Select,{className:o,...i},t==null?void 0:t.map(({value:c,label:u,disabled:h})=>Q.createElement(s.Option,{key:c,value:c,disabled:h},u))),Q.createElement("span",{className:r[je.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,Q.createElement(s.Chevron,{orientation:"down",size:18,className:r[je.Chevron]})))}function BP(e){return Q.createElement("div",{...e})}function HP(e){return Q.createElement("div",{...e})}function VP(e){const{calendarMonth:t,displayIndex:n,...s}=e;return Q.createElement("div",{...s},e.children)}function YP(e){const{calendarMonth:t,displayIndex:n,...s}=e;return Q.createElement("div",{...s})}function FP(e){return Q.createElement("table",{...e})}function IP(e){return Q.createElement("div",{...e})}const bC=m.createContext(void 0);function Jc(){const e=m.useContext(bC);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function WP(e){const{components:t}=Jc();return Q.createElement(t.Dropdown,{...e})}function qP(e){const{onPreviousClick:t,onNextClick:n,previousMonth:s,nextMonth:r,...i}=e,{components:o,classNames:l,labels:{labelPrevious:c,labelNext:u}}=Jc(),h=m.useCallback(f=>{r&&(n==null||n(f))},[r,n]),d=m.useCallback(f=>{s&&(t==null||t(f))},[s,t]);return Q.createElement("nav",{...i},Q.createElement(o.PreviousMonthButton,{type:"button",className:l[je.PreviousMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":c(s),onClick:d},Q.createElement(o.Chevron,{disabled:s?void 0:!0,className:l[je.Chevron],orientation:"left"})),Q.createElement(o.NextMonthButton,{type:"button",className:l[je.NextMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":u(r),onClick:h},Q.createElement(o.Chevron,{disabled:r?void 0:!0,orientation:"right",className:l[je.Chevron]})))}function XP(e){const{components:t}=Jc();return Q.createElement(t.Button,{...e})}function GP(e){return Q.createElement("option",{...e})}function ZP(e){const{components:t}=Jc();return Q.createElement(t.Button,{...e})}function QP(e){const{rootRef:t,...n}=e;return Q.createElement("div",{...n,ref:t})}function KP(e){return Q.createElement("select",{...e})}function JP(e){const{week:t,...n}=e;return Q.createElement("tr",{...n})}function eB(e){return Q.createElement("th",{...e})}function tB(e){return Q.createElement("thead",{"aria-hidden":!0},Q.createElement("tr",{...e}))}function nB(e){const{week:t,...n}=e;return Q.createElement("th",{...n})}function sB(e){return Q.createElement("th",{...e})}function aB(e){return Q.createElement("tbody",{...e})}function rB(e){const{components:t}=Jc();return Q.createElement(t.Dropdown,{...e})}const iB=Object.freeze(Object.defineProperty({__proto__:null,Button:zP,CaptionLabel:RP,Chevron:UP,Day:$P,DayButton:LP,Dropdown:PP,DropdownNav:BP,Footer:HP,Month:VP,MonthCaption:YP,MonthGrid:FP,Months:IP,MonthsDropdown:WP,Nav:qP,NextMonthButton:XP,Option:GP,PreviousMonthButton:ZP,Root:QP,Select:KP,Week:JP,WeekNumber:nB,WeekNumberHeader:sB,Weekday:eB,Weekdays:tB,Weeks:aB,YearsDropdown:rB},Symbol.toStringTag,{value:"Module"}));function ua(e,t,n=!1,s=Qs){let{from:r,to:i}=e;const{differenceInCalendarDays:o,isSameDay:l}=s;return r&&i?(o(i,r)<0&&([r,i]=[i,r]),o(t,r)>=(n?1:0)&&o(i,t)>=(n?1:0)):!n&&i?l(i,t):!n&&r?l(r,t):!1}function yC(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function y0(e){return!!(e&&typeof e=="object"&&"from"in e)}function wC(e){return!!(e&&typeof e=="object"&&"after"in e)}function NC(e){return!!(e&&typeof e=="object"&&"before"in e)}function jC(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function SC(e,t){return Array.isArray(e)&&e.every(t.isDate)}function ha(e,t,n=Qs){const s=Array.isArray(t)?t:[t],{isSameDay:r,differenceInCalendarDays:i,isAfter:o}=n;return s.some(l=>{if(typeof l=="boolean")return l;if(n.isDate(l))return r(e,l);if(SC(l,n))return l.includes(e);if(y0(l))return ua(l,e,!1,n);if(jC(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(yC(l)){const c=i(l.before,e),u=i(l.after,e),h=c>0,d=u<0;return o(l.before,l.after)?d&&h:h||d}return wC(l)?i(e,l.after)>0:NC(l)?i(l.before,e)>0:typeof l=="function"?l(e):!1})}function oB(e,t,n,s,r){const{disabled:i,hidden:o,modifiers:l,showOutsideDays:c,broadcastCalendar:u,today:h}=t,{isSameDay:d,isSameMonth:f,startOfMonth:x,isBefore:w,endOfMonth:v,isAfter:N}=r,g=n&&x(n),b=s&&v(s),p={[Et.focused]:[],[Et.outside]:[],[Et.disabled]:[],[Et.hidden]:[],[Et.today]:[]},y={};for(const j of e){const{date:S,displayMonth:C}=j,T=!!(C&&!f(S,C)),A=!!(g&&w(S,g)),P=!!(b&&N(S,b)),U=!!(i&&ha(S,i,r)),O=!!(o&&ha(S,o,r))||A||P||!u&&!c&&T||u&&c===!1&&T,V=d(S,h??r.today());T&&p.outside.push(j),U&&p.disabled.push(j),O&&p.hidden.push(j),V&&p.today.push(j),l&&Object.keys(l).forEach(k=>{const z=l==null?void 0:l[k];z&&ha(S,z,r)&&(y[k]?y[k].push(j):y[k]=[j])})}return j=>{const S={[Et.focused]:!1,[Et.disabled]:!1,[Et.hidden]:!1,[Et.outside]:!1,[Et.today]:!1},C={};for(const T in p){const A=p[T];S[T]=A.some(P=>P===j)}for(const T in y)C[T]=y[T].some(A=>A===j);return{...S,...C}}}function lB(e,t,n={}){return Object.entries(e).filter(([,r])=>r===!0).reduce((r,[i])=>(n[i]?r.push(n[i]):t[Et[i]]?r.push(t[Et[i]]):t[ms[i]]&&r.push(t[ms[i]]),r),[t[je.Day]])}function cB(e){return{...iB,...e}}function dB(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,s])=>{n.startsWith("data-")&&(t[n]=s)}),t}function w0(){const e={};for(const t in je)e[je[t]]=`rdp-${je[t]}`;for(const t in Et)e[Et[t]]=`rdp-${Et[t]}`;for(const t in ms)e[ms[t]]=`rdp-${ms[t]}`;for(const t in Tn)e[Tn[t]]=`rdp-${Tn[t]}`;return e}function CC(e,t,n){return(n??new Yn(t)).formatMonthYear(e)}const uB=CC;function hB(e,t,n){return(n??new Yn(t)).format(e,"d")}function fB(e,t=Qs){return t.format(e,"LLLL")}function mB(e,t,n){return(n??new Yn(t)).format(e,"cccccc")}function xB(e,t=Qs){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function gB(){return""}function EC(e,t=Qs){return t.format(e,"yyyy")}const pB=EC,vB=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:CC,formatDay:hB,formatMonthCaption:uB,formatMonthDropdown:fB,formatWeekNumber:xB,formatWeekNumberHeader:gB,formatWeekdayName:mB,formatYearCaption:pB,formatYearDropdown:EC},Symbol.toStringTag,{value:"Module"}));function bB(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...vB,...e}}function yB(e,t,n,s,r){const{startOfMonth:i,startOfYear:o,endOfYear:l,eachMonthOfInterval:c,getMonth:u}=r;return c({start:o(e),end:l(e)}).map(f=>{const x=s.formatMonthDropdown(f,r),w=u(f),v=t&&f<i(t)||n&&f>i(n)||!1;return{value:w,label:x,disabled:v}})}function wB(e,t={},n={}){let s={...t==null?void 0:t[je.Day]};return Object.entries(e).filter(([,r])=>r===!0).forEach(([r])=>{s={...s,...n==null?void 0:n[r]}}),s}function NB(e,t,n){const s=e.today(),r=t?e.startOfISOWeek(s):e.startOfWeek(s),i=[];for(let o=0;o<7;o++){const l=e.addDays(r,o);i.push(l)}return i}function jB(e,t,n,s,r=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:o,eachYearOfInterval:l,getYear:c}=s,u=i(e),h=o(t),d=l({start:u,end:h});return r&&d.reverse(),d.map(f=>{const x=n.formatYearDropdown(f,s);return{value:c(f),label:x,disabled:!1}})}function kC(e,t,n,s){let r=(s??new Yn(n)).format(e,"PPPP");return t.today&&(r=`Today, ${r}`),t.selected&&(r=`${r}, selected`),r}const SB=kC;function MC(e,t,n){return(n??new Yn(t)).formatMonthYear(e)}const CB=MC;function EB(e,t,n,s){let r=(s??new Yn(n)).format(e,"PPPP");return t!=null&&t.today&&(r=`Today, ${r}`),r}function kB(e){return"Choose the Month"}function MB(){return""}function TB(e){return"Go to the Next Month"}function DB(e){return"Go to the Previous Month"}function _B(e,t,n){return(n??new Yn(t)).format(e,"cccc")}function AB(e,t){return`Week ${e}`}function OB(e){return"Week Number"}function zB(e){return"Choose the Year"}const RB=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:CB,labelDay:SB,labelDayButton:kC,labelGrid:MC,labelGridcell:EB,labelMonthDropdown:kB,labelNav:MB,labelNext:TB,labelPrevious:DB,labelWeekNumber:AB,labelWeekNumberHeader:OB,labelWeekday:_B,labelYearDropdown:zB},Symbol.toStringTag,{value:"Module"})),ed=e=>e instanceof HTMLElement?e:null,Ym=e=>[...e.querySelectorAll("[data-animated-month]")??[]],UB=e=>ed(e.querySelector("[data-animated-month]")),Fm=e=>ed(e.querySelector("[data-animated-caption]")),Im=e=>ed(e.querySelector("[data-animated-weeks]")),$B=e=>ed(e.querySelector("[data-animated-nav]")),LB=e=>ed(e.querySelector("[data-animated-weekdays]"));function PB(e,t,{classNames:n,months:s,focused:r,dateLib:i}){const o=m.useRef(null),l=m.useRef(s),c=m.useRef(!1);m.useLayoutEffect(()=>{const u=l.current;if(l.current=s,!t||!e.current||!(e.current instanceof HTMLElement)||s.length===0||u.length===0||s.length!==u.length)return;const h=i.isSameMonth(s[0].date,u[0].date),d=i.isAfter(s[0].date,u[0].date),f=d?n[Tn.caption_after_enter]:n[Tn.caption_before_enter],x=d?n[Tn.weeks_after_enter]:n[Tn.weeks_before_enter],w=o.current,v=e.current.cloneNode(!0);if(v instanceof HTMLElement?(Ym(v).forEach(p=>{if(!(p instanceof HTMLElement))return;const y=UB(p);y&&p.contains(y)&&p.removeChild(y);const j=Fm(p);j&&j.classList.remove(f);const S=Im(p);S&&S.classList.remove(x)}),o.current=v):o.current=null,c.current||h||r)return;const N=w instanceof HTMLElement?Ym(w):[],g=Ym(e.current);if(g!=null&&g.every(b=>b instanceof HTMLElement)&&N&&N.every(b=>b instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const b=$B(e.current);b&&(b.style.zIndex="1"),g.forEach((p,y)=>{const j=N[y];if(!j)return;p.style.position="relative",p.style.overflow="hidden";const S=Fm(p);S&&S.classList.add(f);const C=Im(p);C&&C.classList.add(x);const T=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),b&&(b.style.zIndex=""),S&&S.classList.remove(f),C&&C.classList.remove(x),p.style.position="",p.style.overflow="",p.contains(j)&&p.removeChild(j)};j.style.pointerEvents="none",j.style.position="absolute",j.style.overflow="hidden",j.setAttribute("aria-hidden","true");const A=LB(j);A&&(A.style.opacity="0");const P=Fm(j);P&&(P.classList.add(d?n[Tn.caption_before_exit]:n[Tn.caption_after_exit]),P.addEventListener("animationend",T));const U=Im(j);U&&U.classList.add(d?n[Tn.weeks_before_exit]:n[Tn.weeks_after_exit]),p.insertBefore(j,p.firstChild)})}})}function BB(e,t,n,s){const r=e[0],i=e[e.length-1],{ISOWeek:o,fixedWeeks:l,broadcastCalendar:c}=n??{},{addDays:u,differenceInCalendarDays:h,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:x,endOfMonth:w,endOfWeek:v,isAfter:N,startOfBroadcastWeek:g,startOfISOWeek:b,startOfWeek:p}=s,y=c?g(r,s):o?b(r):p(r),j=c?f(i):o?x(w(i)):v(w(i)),S=h(j,y),C=d(i,r)+1,T=[];for(let U=0;U<=S;U++){const O=u(y,U);if(t&&N(O,t))break;T.push(O)}const P=(c?35:42)*C;if(l&&T.length<P){const U=P-T.length;for(let O=0;O<U;O++){const V=u(T[T.length-1],1);T.push(V)}}return T}function HB(e){const t=[];return e.reduce((n,s)=>{const r=s.weeks.reduce((i,o)=>i.concat(o.days.slice()),t.slice());return n.concat(r.slice())},t.slice())}function VB(e,t,n,s){const{numberOfMonths:r=1}=n,i=[];for(let o=0;o<r;o++){const l=s.addMonths(e,o);if(t&&l>t)break;i.push(l)}return i}function dw(e,t,n,s){const{month:r,defaultMonth:i,today:o=s.today(),numberOfMonths:l=1}=e;let c=r||i||o;const{differenceInCalendarMonths:u,addMonths:h,startOfMonth:d}=s;if(n&&u(n,c)<l-1){const f=-1*(l-1);c=h(n,f)}return t&&u(c,t)<0&&(c=t),d(c)}function YB(e,t,n,s){const{addDays:r,endOfBroadcastWeek:i,endOfISOWeek:o,endOfMonth:l,endOfWeek:c,getISOWeek:u,getWeek:h,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:x}=s,w=e.reduce((v,N)=>{const g=n.broadcastCalendar?d(N,s):n.ISOWeek?f(N):x(N),b=n.broadcastCalendar?i(N):n.ISOWeek?o(l(N)):c(l(N)),p=t.filter(C=>C>=g&&C<=b),y=n.broadcastCalendar?35:42;if(n.fixedWeeks&&p.length<y){const C=t.filter(T=>{const A=y-p.length;return T>b&&T<=r(b,A)});p.push(...C)}const j=p.reduce((C,T)=>{const A=n.ISOWeek?u(T):h(T),P=C.find(O=>O.weekNumber===A),U=new vC(T,N,s);return P?P.days.push(U):C.push(new OP(A,[U])),C},[]),S=new AP(N,j);return v.push(S),v},[]);return n.reverseMonths?w.reverse():w}function FB(e,t){let{startMonth:n,endMonth:s}=e;const{startOfYear:r,startOfDay:i,startOfMonth:o,endOfMonth:l,addYears:c,endOfYear:u,newDate:h,today:d}=t,{fromYear:f,toYear:x,fromMonth:w,toMonth:v}=e;!n&&w&&(n=w),!n&&f&&(n=t.newDate(f,0,1)),!s&&v&&(s=v),!s&&x&&(s=h(x,11,31));const N=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=o(n):f?n=h(f,0,1):!n&&N&&(n=r(c(e.today??d(),-100))),s?s=l(s):x?s=h(x,11,31):!s&&N&&(s=u(e.today??d())),[n&&i(n),s&&i(s)]}function IB(e,t,n,s){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:i=1}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=s,u=r?i:1,h=o(e);if(!t)return l(h,u);if(!(c(t,e)<i))return l(h,u)}function WB(e,t,n,s){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:i}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=s,u=r?i??1:1,h=o(e);if(!t)return l(h,-u);if(!(c(h,t)<=0))return l(h,-u)}function qB(e){const t=[];return e.reduce((n,s)=>n.concat(s.weeks.slice()),t.slice())}function wf(e,t){const[n,s]=m.useState(e);return[t===void 0?n:t,s]}function XB(e,t){const[n,s]=FB(e,t),{startOfMonth:r,endOfMonth:i}=t,o=dw(e,n,s,t),[l,c]=wf(o,e.month?o:void 0);m.useEffect(()=>{const S=dw(e,n,s,t);c(S)},[e.timeZone]);const u=VB(l,s,e,t),h=BB(u,e.endMonth?i(e.endMonth):void 0,e,t),d=YB(u,h,e,t),f=qB(d),x=HB(d),w=WB(l,n,e,t),v=IB(l,s,e,t),{disableNavigation:N,onMonthChange:g}=e,b=S=>f.some(C=>C.days.some(T=>T.isEqualTo(S))),p=S=>{if(N)return;let C=r(S);n&&C<r(n)&&(C=r(n)),s&&C>r(s)&&(C=r(s)),c(C),g==null||g(C)};return{months:d,weeks:f,days:x,navStart:n,navEnd:s,previousMonth:w,nextMonth:v,goToMonth:p,goToDay:S=>{b(S)||p(S.date)}}}var Ds;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Ds||(Ds={}));function uw(e){return!e[Et.disabled]&&!e[Et.hidden]&&!e[Et.outside]}function GB(e,t,n,s){let r,i=-1;for(const o of e){const l=t(o);uw(l)&&(l[Et.focused]&&i<Ds.FocusedModifier?(r=o,i=Ds.FocusedModifier):s!=null&&s.isEqualTo(o)&&i<Ds.LastFocused?(r=o,i=Ds.LastFocused):n(o.date)&&i<Ds.Selected?(r=o,i=Ds.Selected):l[Et.today]&&i<Ds.Today&&(r=o,i=Ds.Today))}return r||(r=e.find(o=>uw(t(o)))),r}function ZB(e,t,n,s,r,i,o){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:u,addMonths:h,addWeeks:d,addYears:f,endOfBroadcastWeek:x,endOfISOWeek:w,endOfWeek:v,max:N,min:g,startOfBroadcastWeek:b,startOfISOWeek:p,startOfWeek:y}=o;let S={day:u,week:d,month:h,year:f,startOfWeek:C=>c?b(C,o):l?p(C):y(C),endOfWeek:C=>c?x(C):l?w(C):v(C)}[e](n,t==="after"?1:-1);return t==="before"&&s?S=N([s,S]):t==="after"&&r&&(S=g([r,S])),S}function TC(e,t,n,s,r,i,o,l=0){if(l>365)return;const c=ZB(e,t,n.date,s,r,i,o),u=!!(i.disabled&&ha(c,i.disabled,o)),h=!!(i.hidden&&ha(c,i.hidden,o)),d=c,f=new vC(c,d,o);return!u&&!h?f:TC(e,t,f,s,r,i,o,l+1)}function QB(e,t,n,s,r){const{autoFocus:i}=e,[o,l]=m.useState(),c=GB(t.days,n,s||(()=>!1),o),[u,h]=m.useState(i?c:void 0);return{isFocusTarget:v=>!!(c!=null&&c.isEqualTo(v)),setFocused:h,focused:u,blur:()=>{l(u),h(void 0)},moveFocus:(v,N)=>{if(!u)return;const g=TC(v,N,u,t.navStart,t.navEnd,e,r);g&&(e.disableNavigation&&!t.days.some(p=>p.isEqualTo(g))||(t.goToDay(g),h(g)))}}}function KB(e,t){const{selected:n,required:s,onSelect:r}=e,[i,o]=wf(n,r?n:void 0),l=r?n:i,{isSameDay:c}=t,u=x=>(l==null?void 0:l.some(w=>c(w,x)))??!1,{min:h,max:d}=e;return{selected:l,select:(x,w,v)=>{let N=[...l??[]];if(u(x)){if((l==null?void 0:l.length)===h||s&&(l==null?void 0:l.length)===1)return;N=l==null?void 0:l.filter(g=>!c(g,x))}else(l==null?void 0:l.length)===d?N=[x]:N=[...N,x];return r||o(N),r==null||r(N,x,w,v),N},isSelected:u}}function JB(e,t,n=0,s=0,r=!1,i=Qs){const{from:o,to:l}=t||{},{isSameDay:c,isAfter:u,isBefore:h}=i;let d;if(!o&&!l)d={from:e,to:n>0?void 0:e};else if(o&&!l)c(o,e)?n===0?d={from:o,to:e}:r?d={from:o,to:void 0}:d=void 0:h(e,o)?d={from:e,to:o}:d={from:o,to:e};else if(o&&l)if(c(o,e)&&c(l,e))r?d={from:o,to:l}:d=void 0;else if(c(o,e))d={from:o,to:n>0?void 0:e};else if(c(l,e))d={from:e,to:n>0?void 0:e};else if(h(e,o))d={from:e,to:l};else if(u(e,o))d={from:o,to:e};else if(u(e,l))d={from:o,to:e};else throw new Error("Invalid range");if(d!=null&&d.from&&(d!=null&&d.to)){const f=i.differenceInCalendarDays(d.to,d.from);s>0&&f>s?d={from:e,to:void 0}:n>1&&f<n&&(d={from:e,to:void 0})}return d}function eH(e,t,n=Qs){const s=Array.isArray(t)?t:[t];let r=e.from;const i=n.differenceInCalendarDays(e.to,e.from),o=Math.min(i,6);for(let l=0;l<=o;l++){if(s.includes(r.getDay()))return!0;r=n.addDays(r,1)}return!1}function hw(e,t,n=Qs){return ua(e,t.from,!1,n)||ua(e,t.to,!1,n)||ua(t,e.from,!1,n)||ua(t,e.to,!1,n)}function tH(e,t,n=Qs){const s=Array.isArray(t)?t:[t];if(s.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:n.isDate(l)?ua(e,l,!1,n):SC(l,n)?l.some(c=>ua(e,c,!1,n)):y0(l)?l.from&&l.to?hw(e,{from:l.from,to:l.to},n):!1:jC(l)?eH(e,l.dayOfWeek,n):yC(l)?n.isAfter(l.before,l.after)?hw(e,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):ha(e.from,l,n)||ha(e.to,l,n):wC(l)||NC(l)?ha(e.from,l,n)||ha(e.to,l,n):!1))return!0;const o=s.filter(l=>typeof l=="function");if(o.length){let l=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let u=0;u<=c;u++){if(o.some(h=>h(l)))return!0;l=n.addDays(l,1)}}return!1}function nH(e,t){const{disabled:n,excludeDisabled:s,selected:r,required:i,onSelect:o}=e,[l,c]=wf(r,o?r:void 0),u=o?r:l;return{selected:u,select:(f,x,w)=>{const{min:v,max:N}=e,g=f?JB(f,u,v,N,i,t):void 0;return s&&n&&(g!=null&&g.from)&&g.to&&tH({from:g.from,to:g.to},n,t)&&(g.from=f,g.to=void 0),o||c(g),o==null||o(g,f,x,w),g},isSelected:f=>u&&ua(u,f,!1,t)}}function sH(e,t){const{selected:n,required:s,onSelect:r}=e,[i,o]=wf(n,r?n:void 0),l=r?n:i,{isSameDay:c}=t;return{selected:l,select:(d,f,x)=>{let w=d;return!s&&l&&l&&c(d,l)&&(w=void 0),r||o(w),r==null||r(w,d,f,x),w},isSelected:d=>l?c(l,d):!1}}function aH(e,t){const n=sH(e,t),s=KB(e,t),r=nH(e,t);switch(e.mode){case"single":return n;case"multiple":return s;case"range":return r;default:return}}function rH(e){var Oe;let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new sn(t.today,t.timeZone)),t.month&&(t.month=new sn(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new sn(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new sn(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new sn(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new sn(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=(Oe=t.selected)==null?void 0:Oe.map(we=>new sn(we,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new sn(t.selected.from,t.timeZone):void 0,to:t.selected.to?new sn(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:s,labels:r,dateLib:i,locale:o,classNames:l}=m.useMemo(()=>{const we={...b0,...t.locale};return{dateLib:new Yn({locale:we,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:cB(t.components),formatters:bB(t.formatters),labels:{...RB,...t.labels},locale:we,classNames:{...w0(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:c,mode:u,navLayout:h,numberOfMonths:d=1,onDayBlur:f,onDayClick:x,onDayFocus:w,onDayKeyDown:v,onDayMouseEnter:N,onDayMouseLeave:g,onNextClick:b,onPrevClick:p,showWeekNumber:y,styles:j}=t,{formatCaption:S,formatDay:C,formatMonthDropdown:T,formatWeekNumber:A,formatWeekNumberHeader:P,formatWeekdayName:U,formatYearDropdown:O}=s,V=XB(t,i),{days:k,months:z,navStart:M,navEnd:_,previousMonth:E,nextMonth:D,goToMonth:L}=V,W=oB(k,t,M,_,i),{isSelected:R,select:H,selected:q}=aH(t,i)??{},{blur:X,focused:ne,isFocusTarget:ae,moveFocus:J,setFocused:$}=QB(t,V,W,R??(()=>!1),i),{labelDayButton:te,labelGridcell:K,labelGrid:B,labelMonthDropdown:G,labelNav:re,labelPrevious:ce,labelNext:ue,labelWeekday:ve,labelWeekNumber:ze,labelWeekNumberHeader:_e,labelYearDropdown:Mt}=r,St=m.useMemo(()=>NB(i,t.ISOWeek),[i,t.ISOWeek]),Le=u!==void 0||x!==void 0,De=m.useCallback(()=>{E&&(L(E),p==null||p(E))},[E,L,p]),nt=m.useCallback(()=>{D&&(L(D),b==null||b(D))},[L,D,b]),ht=m.useCallback((we,Be)=>Ce=>{Ce.preventDefault(),Ce.stopPropagation(),$(we),H==null||H(we.date,Be,Ce),x==null||x(we.date,Be,Ce)},[H,x,$]),vt=m.useCallback((we,Be)=>Ce=>{$(we),w==null||w(we.date,Be,Ce)},[w,$]),Gt=m.useCallback((we,Be)=>Ce=>{X(),f==null||f(we.date,Be,Ce)},[X,f]),Yt=m.useCallback((we,Be)=>Ce=>{const We={ArrowLeft:[Ce.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[Ce.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[Ce.shiftKey?"year":"week","after"],ArrowUp:[Ce.shiftKey?"year":"week","before"],PageUp:[Ce.shiftKey?"year":"month","before"],PageDown:[Ce.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(We[Ce.key]){Ce.preventDefault(),Ce.stopPropagation();const[Z,ee]=We[Ce.key];J(Z,ee)}v==null||v(we.date,Be,Ce)},[J,v,t.dir]),se=m.useCallback((we,Be)=>Ce=>{N==null||N(we.date,Be,Ce)},[N]),fe=m.useCallback((we,Be)=>Ce=>{g==null||g(we.date,Be,Ce)},[g]),Re=m.useCallback(we=>Be=>{const Ce=Number(Be.target.value),We=i.setMonth(i.startOfMonth(we),Ce);L(We)},[i,L]),I=m.useCallback(we=>Be=>{const Ce=Number(Be.target.value),We=i.setYear(i.startOfMonth(we),Ce);L(We)},[i,L]),{className:le,style:me}=m.useMemo(()=>({className:[l[je.Root],t.className].filter(Boolean).join(" "),style:{...j==null?void 0:j[je.Root],...t.style}}),[l,t.className,t.style,j]),he=dB(t),Ue=m.useRef(null);PB(Ue,!!t.animate,{classNames:l,months:z,focused:ne,dateLib:i});const Ae={dayPickerProps:t,selected:q,select:H,isSelected:R,months:z,nextMonth:D,previousMonth:E,goToMonth:L,getModifiers:W,components:n,classNames:l,styles:j,labels:r,formatters:s};return Q.createElement(bC.Provider,{value:Ae},Q.createElement(n.Root,{rootRef:t.animate?Ue:void 0,className:le,style:me,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...he},Q.createElement(n.Months,{className:l[je.Months],style:j==null?void 0:j[je.Months]},!t.hideNavigation&&!h&&Q.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[je.Nav],style:j==null?void 0:j[je.Nav],"aria-label":re(),onPreviousClick:De,onNextClick:nt,previousMonth:E,nextMonth:D}),z.map((we,Be)=>Q.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:l[je.Month],style:j==null?void 0:j[je.Month],key:Be,displayIndex:Be,calendarMonth:we},h==="around"&&!t.hideNavigation&&Be===0&&Q.createElement(n.PreviousMonthButton,{type:"button",className:l[je.PreviousMonthButton],tabIndex:E?void 0:-1,"aria-disabled":E?void 0:!0,"aria-label":ce(E),onClick:De,"data-animated-button":t.animate?"true":void 0},Q.createElement(n.Chevron,{disabled:E?void 0:!0,className:l[je.Chevron],orientation:t.dir==="rtl"?"right":"left"})),Q.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:l[je.MonthCaption],style:j==null?void 0:j[je.MonthCaption],calendarMonth:we,displayIndex:Be},c!=null&&c.startsWith("dropdown")?Q.createElement(n.DropdownNav,{className:l[je.Dropdowns],style:j==null?void 0:j[je.Dropdowns]},(()=>{const Ce=c==="dropdown"||c==="dropdown-months"?Q.createElement(n.MonthsDropdown,{key:"month",className:l[je.MonthsDropdown],"aria-label":G(),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:Re(we.date),options:yB(we.date,M,_,s,i),style:j==null?void 0:j[je.Dropdown],value:i.getMonth(we.date)}):Q.createElement("span",{key:"month"},T(we.date,i)),We=c==="dropdown"||c==="dropdown-years"?Q.createElement(n.YearsDropdown,{key:"year",className:l[je.YearsDropdown],"aria-label":Mt(i.options),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:I(we.date),options:jB(M,_,s,i,!!t.reverseYears),style:j==null?void 0:j[je.Dropdown],value:i.getYear(we.date)}):Q.createElement("span",{key:"year"},O(we.date,i));return i.getMonthYearOrder()==="year-first"?[We,Ce]:[Ce,We]})(),Q.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},S(we.date,i.options,i))):Q.createElement(n.CaptionLabel,{className:l[je.CaptionLabel],role:"status","aria-live":"polite"},S(we.date,i.options,i))),h==="around"&&!t.hideNavigation&&Be===d-1&&Q.createElement(n.NextMonthButton,{type:"button",className:l[je.NextMonthButton],tabIndex:D?void 0:-1,"aria-disabled":D?void 0:!0,"aria-label":ue(D),onClick:nt,"data-animated-button":t.animate?"true":void 0},Q.createElement(n.Chevron,{disabled:D?void 0:!0,className:l[je.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Be===d-1&&h==="after"&&!t.hideNavigation&&Q.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[je.Nav],style:j==null?void 0:j[je.Nav],"aria-label":re(),onPreviousClick:De,onNextClick:nt,previousMonth:E,nextMonth:D}),Q.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":B(we.date,i.options,i)||void 0,className:l[je.MonthGrid],style:j==null?void 0:j[je.MonthGrid]},!t.hideWeekdays&&Q.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:l[je.Weekdays],style:j==null?void 0:j[je.Weekdays]},y&&Q.createElement(n.WeekNumberHeader,{"aria-label":_e(i.options),className:l[je.WeekNumberHeader],style:j==null?void 0:j[je.WeekNumberHeader],scope:"col"},P()),St.map(Ce=>Q.createElement(n.Weekday,{"aria-label":ve(Ce,i.options,i),className:l[je.Weekday],key:String(Ce),style:j==null?void 0:j[je.Weekday],scope:"col"},U(Ce,i.options,i)))),Q.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:l[je.Weeks],style:j==null?void 0:j[je.Weeks]},we.weeks.map(Ce=>Q.createElement(n.Week,{className:l[je.Week],key:Ce.weekNumber,style:j==null?void 0:j[je.Week],week:Ce},y&&Q.createElement(n.WeekNumber,{week:Ce,style:j==null?void 0:j[je.WeekNumber],"aria-label":ze(Ce.weekNumber,{locale:o}),className:l[je.WeekNumber],scope:"row",role:"rowheader"},A(Ce.weekNumber,i)),Ce.days.map(We=>{const{date:Z}=We,ee=W(We);if(ee[Et.focused]=!ee.hidden&&!!(ne!=null&&ne.isEqualTo(We)),ee[ms.selected]=(R==null?void 0:R(Z))||ee.selected,y0(q)){const{from:Qe,to:qe}=q;ee[ms.range_start]=!!(Qe&&qe&&i.isSameDay(Z,Qe)),ee[ms.range_end]=!!(Qe&&qe&&i.isSameDay(Z,qe)),ee[ms.range_middle]=ua(q,Z,!0,i)}const pe=wB(ee,j,t.modifiersStyles),He=lB(ee,l,t.modifiersClassNames),Je=!Le&&!ee.hidden?K(Z,ee,i.options,i):void 0;return Q.createElement(n.Day,{key:`${i.format(Z,"yyyy-MM-dd")}_${i.format(We.displayMonth,"yyyy-MM")}`,day:We,modifiers:ee,className:He.join(" "),style:pe,role:"gridcell","aria-selected":ee.selected||void 0,"aria-label":Je,"data-day":i.format(Z,"yyyy-MM-dd"),"data-month":We.outside?i.format(Z,"yyyy-MM"):void 0,"data-selected":ee.selected||void 0,"data-disabled":ee.disabled||void 0,"data-hidden":ee.hidden||void 0,"data-outside":We.outside||void 0,"data-focused":ee.focused||void 0,"data-today":ee.today||void 0},!ee.hidden&&Le?Q.createElement(n.DayButton,{className:l[je.DayButton],style:j==null?void 0:j[je.DayButton],type:"button",day:We,modifiers:ee,disabled:ee.disabled||void 0,tabIndex:ae(We)?0:-1,"aria-label":te(Z,ee,i.options,i),onClick:ht(We,ee),onBlur:Gt(We,ee),onFocus:vt(We,ee),onKeyDown:Yt(We,ee),onMouseEnter:se(We,ee),onMouseLeave:fe(We,ee)},C(Z,i.options,i)):!ee.hidden&&C(We.date,i.options,i))})))))))),t.footer&&Q.createElement(n.Footer,{className:l[je.Footer],style:j==null?void 0:j[je.Footer],role:"status","aria-live":"polite"},t.footer)))}function Qn({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:s="label",buttonVariant:r="ghost",formatters:i,components:o,...l}){const c=w0();return a.jsx(rH,{showOutsideDays:n,className:Me("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:s,formatters:{formatMonthDropdown:u=>u.toLocaleString("default",{month:"short"}),...i},classNames:{root:Me("w-fit",c.root),months:Me("relative flex flex-col gap-4 md:flex-row",c.months),month:Me("flex w-full flex-col gap-4",c.month),nav:Me("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:Me(Sg({variant:r}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:Me(Sg({variant:r}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:Me("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:Me("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:Me("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",c.dropdown_root),dropdown:Me("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:Me("select-none font-medium",s==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:Me("flex",c.weekdays),weekday:Me("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:Me("mt-2 flex w-full",c.week),week_number_header:Me("w-[--cell-size] select-none",c.week_number_header),week_number:Me("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:Me("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",c.day),range_start:Me("bg-accent rounded-l-md",c.range_start),range_middle:Me("rounded-none",c.range_middle),range_end:Me("bg-accent rounded-r-md",c.range_end),today:Me("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:Me("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:Me("text-muted-foreground opacity-50",c.disabled),hidden:Me("invisible",c.hidden),...t},components:{Root:({className:u,rootRef:h,...d})=>a.jsx("div",{"data-slot":"calendar",ref:h,className:Me(u),...d}),Chevron:({className:u,orientation:h,...d})=>h==="left"?a.jsx(kS,{className:Me("size-4",u),...d}):h==="right"?a.jsx(Zp,{className:Me("size-4",u),...d}):a.jsx(af,{className:Me("size-4",u),...d}),DayButton:iH,WeekNumber:({children:u,...h})=>a.jsx("td",{...h,children:a.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:u})}),...o},...l})}function iH({className:e,day:t,modifiers:n,...s}){const r=w0(),i=m.useRef(null);return m.useEffect(()=>{var o;n.focused&&((o=i.current)==null||o.focus())},[n.focused]),a.jsx(F,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:Me("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",r.day,e),...s})}var Nf="Popover",[DC]=rf(Nf,[hf]),td=hf(),[oH,Sr]=DC(Nf),_C=e=>{const{__scopePopover:t,children:n,open:s,defaultOpen:r,onOpenChange:i,modal:o=!1}=e,l=td(t),c=m.useRef(null),[u,h]=m.useState(!1),[d,f]=u0({prop:s,defaultProp:r??!1,onChange:i,caller:Nf});return a.jsx(i4,{...l,children:a.jsx(oH,{scope:t,contentId:ps(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(x=>!x),[f]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>h(!0),[]),onCustomAnchorRemove:m.useCallback(()=>h(!1),[]),modal:o,children:n})})};_C.displayName=Nf;var AC="PopoverAnchor",lH=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=Sr(AC,n),i=td(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=r;return m.useEffect(()=>(o(),()=>l()),[o,l]),a.jsx(c0,{...i,...s,ref:t})});lH.displayName=AC;var OC="PopoverTrigger",zC=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=Sr(OC,n),i=td(n),o=Fn(t,r.triggerRef),l=a.jsx(ln.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":PC(r.open),...s,ref:o,onClick:Bt(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?l:a.jsx(c0,{asChild:!0,...i,children:l})});zC.displayName=OC;var N0="PopoverPortal",[cH,dH]=DC(N0,{forceMount:void 0}),RC=e=>{const{__scopePopover:t,forceMount:n,children:s,container:r}=e,i=Sr(N0,t);return a.jsx(cH,{scope:t,forceMount:n,children:a.jsx(bi,{present:n||i.open,children:a.jsx(d0,{asChild:!0,container:r,children:s})})})};RC.displayName=N0;var $o="PopoverContent",UC=m.forwardRef((e,t)=>{const n=dH($o,e.__scopePopover),{forceMount:s=n.forceMount,...r}=e,i=Sr($o,e.__scopePopover);return a.jsx(bi,{present:s||i.open,children:i.modal?a.jsx(hH,{...r,ref:t}):a.jsx(fH,{...r,ref:t})})});UC.displayName=$o;var uH=e0("PopoverContent.RemoveScroll"),hH=m.forwardRef((e,t)=>{const n=Sr($o,e.__scopePopover),s=m.useRef(null),r=Fn(t,s),i=m.useRef(!1);return m.useEffect(()=>{const o=s.current;if(o)return _4(o)},[]),a.jsx(m0,{as:uH,allowPinchZoom:!0,children:a.jsx($C,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Bt(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Bt(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Bt(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),fH=m.forwardRef((e,t)=>{const n=Sr($o,e.__scopePopover),s=m.useRef(!1),r=m.useRef(!1);return a.jsx($C,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),s.current=!1,r.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),$C=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:s,onOpenAutoFocus:r,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:h,...d}=e,f=Sr($o,n),x=td(n);return N4(),a.jsx(f0,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:r,onUnmountAutoFocus:i,children:a.jsx(of,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:a.jsx(o4,{"data-state":PC(f.open),role:"dialog",id:f.contentId,...x,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),LC="PopoverClose",mH=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=Sr(LC,n);return a.jsx(ln.button,{type:"button",...s,ref:t,onClick:Bt(e.onClick,()=>r.onOpenChange(!1))})});mH.displayName=LC;var xH="PopoverArrow",gH=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=td(n);return a.jsx(l4,{...r,...s,ref:t})});gH.displayName=xH;function PC(e){return e?"open":"closed"}var pH=_C,vH=zC,bH=RC,BC=UC;const Kn=pH,Jn=vH,Dn=m.forwardRef(({className:e,align:t="start",sideOffset:n=4,...s},r)=>a.jsx(bH,{children:a.jsx(BC,{ref:r,align:t,sideOffset:n,className:Me("z-50 w-auto p-0 rounded-lg border border-white/20 bg-black text-white shadow-lg outline-none 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",e),...s})}));Dn.displayName=BC.displayName;const fw=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M20 3H2v14h8v2H8v2h8v-2h-2v-2h8V3h-2zm-6 12H4V5h16v10h-6z",fill:"currentColor"})}),Wd=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M7 8H5v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2V8h-2v2h-2v2h-2v2h-2v-2H9v-2H7V8z",fill:"currentColor"})}),yH=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})}),ls=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2h2v2h4v18H3V4h4V2h2v2h6V2zM9 6H5v2h14V6H9zm-4 4v10h14V10H5zm2 2h8v2H7v-2zm4 6v-2H7v2h4z",fill:"currentColor"})}),wH=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M2 2h14v4h6v16H2V2zm18 6h-4v2h2v2h-2v2h2v2h-2v2h2v2h2V8zm-6-4H4v16h2v-2h6v2h2V4zM6 6h2v2H6V6zm6 0h-2v2h2V6zm-6 4h2v2H6v-2zm6 0h-2v2h2v-2zm-6 4h2v2H6v-2zm6 0h-2v2h2v-2z",fill:"currentColor"})}),NH=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M20 11v2H8v2H6v-2H4v-2h2V9h2v2h12zM10 7H8v2h2V7zm0 0h2V5h-2v2zm0 10H8v-2h2v2zm0 0h2v2h-2v-2z",fill:"currentColor"})}),Fa=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M4 11v2h12v2h2v-2h2v-2h-2V9h-2v2H4zm10-4h2v2h-2V7zm0 0h-2V5h2v2zm0 10h2v-2h-2v2zm0 0h-2v2h2v-2z",fill:"currentColor"})}),jH=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M3 3h18v18H3V3zm16 2H5v14h14V5zM7 12h2v5H7v-5zm10-5h-2v10h2V7zm-6 3h2v2h-2v-2zm2 4h-2v3h2v-3z",fill:"currentColor"})}),sa=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M22 4H2v16h20V4zM4 18V6h16v12H4zM8 8H6v2h2v2h2v2h4v-2h2v-2h2V8h-2v2h-2v2h-4v-2H8V8z",fill:"currentColor"})}),HC=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M6 2h8v2H6V2zM4 6V4h2v2H4zm0 8H2V6h2v8zm2 2H4v-2h2v2zm8 0v2H6v-2h8zm2-2h-2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm0-8h2v8h-2V6zm0 0V4h-2v2h2z",fill:"currentColor"})}),qd=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h12v2H6v4h12v-4h2v6H4v-6z",fill:"currentColor"})}),dt=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M11 0H5v2H3v6h2v2h6V8H5V2h6V0zm0 2h2v6h-2V2zM0 14h2v4h12v2H0v-6zm2 0h12v-2H2v2zm14 0h-2v6h2v-6zM15 0h4v2h-4V0zm4 8h-4v2h4V8zm0-6h2v6h-2V2zm5 12h-2v4h-4v2h6v-6zm-6-2h4v2h-4v-2z",fill:"currentColor"})}),an=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M5 5h2v2H5V5zm4 4H7V7h2v2zm2 2H9V9h2v2zm2 0h-2v2H9v2H7v2H5v2h2v-2h2v-2h2v-2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm2-2v2h-2V9h2zm2-2v2h-2V7h2zm0 0V5h2v2h-2z",fill:"currentColor"})}),VC=({className:e="",size:t=24})=>a.jsx(dg,{size:t,className:Me(e,"w-4 h-4")}),fa=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M2 4h20v4H2V4zm18 2v2H4V6h16zm0 6H2v4h18v-4zm-2 2v2H4v-2h14zM2 16h20v4H2v-4zm18 2v2H4v-2h16z",fill:"currentColor"})}),SH=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 4c2.21 0 4 1.79 4 4s-1.79 4-4 4-4-1.79-4-4 1.79-4 4-4zm0 6c1.38 0 2.5-1.12 2.5-2.5S13.38 11.5 12 11.5 9.5 12.62 9.5 14 10.62 16.5 12 16.5z",fill:"currentColor"})}),mw=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm10-4h-2v2h2v-2z",fill:"currentColor"})}),Xl=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm12-6h-2v2h2v2h2v-2h-2v-2z",fill:"currentColor"})}),Wm=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8 0-1.57.46-3.03 1.24-4.26L16.26 18.76C15.03 19.54 13.57 20 12 20zm6.76-3.74L7.74 5.24C8.97 4.46 10.43 4 12 4c4.41 0 8 3.59 8 8 0 1.57-.46 3.03-1.24 4.26z",fill:"currentColor"})}),Pr=e=>a.jsx(Vs,{...e,className:"w-4 h-4 animate-spin"}),CH=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M6 2h12v2H6V2zm0 2v16h12V4H6zm8 2H10v2h4V6zm-4 4h4v8h-4v-8z",fill:"currentColor"})}),EH=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M8 4h2v4h4V4h2v4h4v2h-4v4h4v2h-4v4h-2v-4H8v4H6v-4H2v-2h4V8H2V6h4V4zm2 6v4h4v-4h-4z",fill:"currentColor"})}),An=({className:e="",size:t=24})=>a.jsx(wH,{className:e,size:t}),xw=({className:e="",size:t=24})=>a.jsx(jH,{className:e,size:t}),Eg=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M4 2h12v2H4v12H2V2h2zm4 4h12v16H8V6zm2 2v12h8V8h-8z",fill:"currentColor"})}),YC=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2h2v2h-2V2zm-2 4H8v2H6v2h2v2h2v-2h2V8h-2V6zm6 0h-2v2h2V6zm2 0h2v2h-2V6zm-6 8h-2v-2h2v2zm-4 0H6v-2h2v2zm-4 0H2v-2h2v2zm8 4h-2v-2h2v2zm4 0h2v-2h-2v2zm-6 2h2v2h-2v-2zm4 0h2v2h-2v-2z",fill:"currentColor"})}),kH=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2h2v2h-2V2zm-2 4h6v2h-2v6h-2V8H8V6zm-4 8h12v2H4v-2zm0 4h12v2H4v-2z",fill:"currentColor"})}),bu=({className:e="",size:t=24})=>a.jsx(lR,{className:Me(e,"w-4 h-4"),size:t}),gw=({className:e="",size:t=24})=>a.jsx(rR,{className:Me(e,"w-4 h-4"),size:t}),j0=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-5l6-6-1.41-1.41L11 12.17l-2.59-2.58L7 10.59l4 4z",fill:"currentColor"})}),pw=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 1h2v8h8v4h-2v-2h-8V5h-2V1zM8 7V5h2v2H8zM6 9V7h2v2H6zm-2 2V9h2v2H4zm10 8v2h-2v2h-2v-8H2v-4h2v2h8v6h2zm2-2v2h-2v-2h2zm2-2v2h-2v-2h2zm0 0h2v-2h-2v2z",fill:"currentColor"})}),ur=(e,t,n)=>{const s=document.createElement(e),[r,i]=Array.isArray(t)?[void 0,t]:[t,n];return r&&Object.assign(s,r),i==null||i.forEach(o=>s.appendChild(o)),s},MH=(e,t)=>{var n;return t==="left"?e.offsetLeft:(((n=e.offsetParent instanceof HTMLElement?e.offsetParent:null)==null?void 0:n.offsetWidth)??0)-e.offsetWidth-e.offsetLeft},TH=e=>e.offsetWidth>0&&e.offsetHeight>0,DH=(e,t)=>{!customElements.get(e)&&customElements.define(e,t)};function _H(e,t,{reverse:n=!1}={}){const s=e.length;for(let r=n?s-1:0;n?r>=0:r<s;n?r--:r++)t(e[r],r)}function AH(e,t,n,s){const r=t.formatToParts(e);n&&r.unshift({type:"prefix",value:n}),s&&r.push({type:"suffix",value:s});const i=[],o=[],l=[],c=[],u={},h=v=>`${v}:${u[v]=(u[v]??-1)+1}`;let d="",f=!1,x=!1;for(const v of r){d+=v.value;const N=v.type==="minusSign"||v.type==="plusSign"?"sign":v.type;N==="integer"?(f=!0,o.push(...v.value.split("").map(g=>({type:N,value:parseInt(g)})))):N==="group"?o.push({type:N,value:v.value}):N==="decimal"?(x=!0,l.push({type:N,value:v.value,key:h(N)})):N==="fraction"?l.push(...v.value.split("").map(g=>({type:N,value:parseInt(g),key:h(N),pos:-1-u[N]}))):(f||x?c:i).push({type:N,value:v.value,key:h(N)})}const w=[];for(let v=o.length-1;v>=0;v--){const N=o[v];w.unshift(N.type==="integer"?{...N,key:h(N.type),pos:u[N.type]}:{...N,key:h(N.type)})}return{pre:i,integer:w,fraction:l,post:c,valueAsString:d,value:typeof e=="string"?parseFloat(e):e}}const OH=String.raw,zH=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),RH=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),vw=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,wh="--_number-flow-d-opacity",S0="--_number-flow-d-width",Nh="--_number-flow-dx",C0="--_number-flow-d",UH=(()=>{try{return CSS.registerProperty({name:wh,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:Nh,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:S0,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:C0,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),$H="var(--number-flow-char-height, 1em)",Ha="var(--number-flow-mask-height, 0.25em)",bw=`calc(${Ha} / 2)`,kg="var(--number-flow-mask-width, 0.5em)",Tr=`calc(${kg} / var(--scale-x))`,Xd="#000 0, transparent 71%",yw=OH`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${$H} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${S0}) / var(--width));transform:translateX(var(${Nh})) scaleX(var(--scale-x));margin:0 calc(-1 * ${kg});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${Tr},#000 calc(100% - ${Tr}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${Ha},#000 calc(100% - ${Ha}),transparent 100% ),radial-gradient(at bottom right,${Xd}),radial-gradient(at bottom left,${Xd}),radial-gradient(at top left,${Xd}),radial-gradient(at top right,${Xd});-webkit-mask-size:100% calc(100% - ${Ha} * 2),calc(100% - ${Tr} * 2) 100%,${Tr} ${Ha},${Tr} ${Ha},${Tr} ${Ha},${Tr} ${Ha};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${bw} ${kg};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${Nh})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${C0})}.digit__num,.number .section::after{padding:${bw} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${wh}))}`,LH=HTMLElement,PH=RH&&zH&&UH;let Gd;class FC extends LH{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...n}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,n)}get animated(){return this._animated}set animated(t){var n;this.animated!==t&&(this._animated=t,(n=this.shadowRoot)==null||n.getAnimations().forEach(s=>s.finish()))}set data(t){var n;if(t==null)return;const{pre:s,integer:r,fraction:i,post:o,value:l}=t;if(this.created){const c=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(c.value,l):this.trend,this.computedAnimated=PH&&this._animated&&(!this.respectMotionPreference||!(vw!=null&&vw.matches))&&TH(this),(n=this.plugins)==null||n.forEach(u=>{var h;return(h=u.onUpdate)==null?void 0:h.call(u,t,c,this)}),this.batched||this.willUpdate(),this._pre.update(s),this._num.update({integer:r,fraction:i}),this._post.update(o),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)Gd||(Gd=new CSSStyleSheet,Gd.replaceSync(yw)),this.shadowRoot.adoptedStyleSheets=[Gd];else{const c=document.createElement("style");c.textContent=yw,this.shadowRoot.appendChild(c)}this._pre=new Nw(this,s,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new BH(this,r,i),this.shadowRoot.appendChild(this._num.el),this._post=new Nw(this,o,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(n=>n.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}}FC.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(e,t)=>Math.sign(t-e),respectMotionPreference:!0,plugins:void 0,digits:void 0};class BH{constructor(t,n,s,{className:r,...i}={}){this.flow=t,this._integer=new ww(t,n,{justify:"right",part:"integer"}),this._fraction=new ww(t,s,{justify:"left",part:"fraction"}),this._inner=ur("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=ur("span",{...i,part:"number",className:`number ${r??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:n}){this._integer.update(t),this._fraction.update(n)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const n=this._prevLeft-t.left,s=this.el.offsetWidth,r=this._prevWidth-s;this.el.style.setProperty("--width",String(s)),this.el.animate({[Nh]:[`${n}px`,"0px"],[S0]:[r,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class IC{constructor(t,n,{justify:s,className:r,...i},o){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=s;const l=n.map(c=>this.addChar(c).el);this.el=ur("span",{...i,className:`section section--justify-${s} ${r??""}`},o?o(l):l)}addChar(t,{startDigitsAtZero:n=!1,...s}={}){const r=t.type==="integer"||t.type==="fraction"?new qC(this,t.type,n?0:t.value,t.pos,{...s,onRemove:this.onCharRemove(t.key)}):new HH(this,t.type,t.value,{...s,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,r),r}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(n=>{n.el.style.top=`${n.el.offsetTop}px`,n.el.style[this.justify]=`${MH(n.el,this.justify)}px`}),t.forEach(n=>{n.el.setAttribute("inert",""),n.present=!1})}addNewAndUpdateExisting(t){const n=new Map,s=new Map,r=this.justify==="left",i=r?"prepend":"append";if(_H(t,o=>{let l;this.children.has(o.key)?(l=this.children.get(o.key),s.set(o,l),this.unpop(l),l.present=!0):(l=this.addChar(o,{startDigitsAtZero:!0,animateIn:!0}),n.set(o,l)),this.el[i](l.el)},{reverse:r}),this.flow.computedAnimated){const o=this.el.getBoundingClientRect();n.forEach(l=>{l.willUpdate(o)})}n.forEach((o,l)=>{o.update(l.value)}),s.forEach((o,l)=>{o.update(l.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(n=>n.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(r=>r.didUpdate(t));const n=t[this.justify],s=this._prevOffset-n;s&&this.children.size&&this.el.animate({transform:[`translateX(${s}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class ww extends IC{update(t){const n=new Map;this.children.forEach((s,r)=>{t.find(i=>i.key===r)||n.set(r,s),this.unpop(s)}),this.addNewAndUpdateExisting(t),n.forEach(s=>{s instanceof qC&&s.update(0)}),this.pop(n)}}class Nw extends IC{update(t){const n=new Map;this.children.forEach((s,r)=>{t.find(i=>i.key===r)||n.set(r,s)}),this.pop(n),this.addNewAndUpdateExisting(t)}}class Mg{constructor(t,n,{onRemove:s,animateIn:r=!1}={}){this.flow=t,this.el=n,this._present=!0,this._remove=()=>{var i;this.el.remove(),(i=this._onRemove)==null||i.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&r&&this.el.animate({[wh]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=s}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[wh]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class WC extends Mg{constructor(t,n,s,r){super(t.flow,s,r),this.section=t,this.value=n,this.el=s}}class qC extends WC{constructor(t,n,s,r,i){var o,l;const c=(((l=(o=t.flow.digits)==null?void 0:o[r])==null?void 0:l.max)??9)+1,u=Array.from({length:c}).map((d,f)=>{const x=ur("span",{className:"digit__num"},[document.createTextNode(String(f))]);return f!==s&&x.setAttribute("inert",""),x.style.setProperty("--n",String(f)),x}),h=ur("span",{part:`digit ${n}-digit`,className:"digit"},u);h.style.setProperty("--current",String(s)),h.style.setProperty("--length",String(c)),super(t,s,h,i),this.pos=r,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=u,this.length=c}willUpdate(t){const n=this.el.getBoundingClientRect();this._prevValue=this.value;const s=n[this.section.justify]-t[this.section.justify],r=n.width/2;this._prevCenter=this.section.justify==="left"?s+r:s-r}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((n,s)=>s===t?n.removeAttribute("inert"):n.setAttribute("inert","")),this.value=t}didUpdate(t){const n=this.el.getBoundingClientRect(),s=n[this.section.justify]-t[this.section.justify],r=n.width/2,i=this.section.justify==="left"?s+r:s-r,o=this._prevCenter-i;o&&this.el.animate({transform:[`translateX(${o}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const l=this.getDelta();l&&(this.el.classList.add("is-spinning"),this.el.animate({[C0]:[-l,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const r of this.flow.plugins){const i=(t=r.getDelta)==null?void 0:t.call(r,this.value,this._prevValue,this);if(i!=null)return i}const n=this.value-this._prevValue,s=this.flow.computedTrend||Math.sign(n);return s<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:s>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:n}}class HH extends WC{constructor(t,n,s,r){const i=ur("span",{className:"symbol__value",textContent:s});super(t,s,ur("span",{part:`symbol ${n}`,className:"symbol"},[i]),r),this.type=n,this._children=new Map,this._onChildRemove=o=>()=>{this._children.delete(o)},this._children.set(s,new Mg(this.flow,i,{onRemove:this._onChildRemove(s)}))}willUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect();this._prevOffset=n[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const n=this._children.get(this.value);n&&(n.present=!1);const s=this._children.get(t);if(s)s.present=!0;else{const r=ur("span",{className:"symbol__value",textContent:t});this.el.appendChild(r),this._children.set(t,new Mg(this.flow,r,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],s=this._prevOffset-n;s&&this.el.animate({transform:[`translateX(${s}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}var kw;const VH=parseInt((kw=m.version.match(/^(\d+)\./))==null?void 0:kw[1]),E0=VH>=19,YH=["data","digits"];class k0 extends FC{attributeChangedCallback(t,n,s){this[t]=JSON.parse(s)}}k0.observedAttributes=E0?[]:YH;DH("number-flow-react",k0);const qm={},jw=E0?e=>e:JSON.stringify;function Sw(e){const{transformTiming:t,spinTiming:n,opacityTiming:s,animated:r,respectMotionPreference:i,trend:o,plugins:l,...c}=e;return[{transformTiming:t,spinTiming:n,opacityTiming:s,animated:r,respectMotionPreference:i,trend:o,plugins:l},c]}class FH extends m.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[n]=Sw(this.props);Object.entries(n).forEach(([s,r])=>{this.el[s]=r??k0.defaultProps[s]}),t!=null&&t.onAnimationsStart&&this.el.removeEventListener("animationsstart",t.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),t!=null&&t.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",t.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),E0&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(t){var n;if(this.updateProperties(t),t.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>{var s;return(s=this.props.group)==null?void 0:s.didUpdate()};if(!this.props.isolate)return(n=this.el)==null||n.willUpdate(),()=>{var s;return(s=this.el)==null?void 0:s.didUpdate()}}return null}componentDidUpdate(t,n,s){s==null||s()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:n,className:s,data:r,willChange:i,isolate:o,group:l,digits:c,onAnimationsStart:u,onAnimationsFinish:h,...d}]=Sw(this.props);return m.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":i?"":void 0,class:s,...d,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:jw(c),data:jw(r)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const IH=m.forwardRef(function({value:t,locales:n,format:s,prefix:r,suffix:i,...o},l){m.useImperativeHandle(l,()=>c.current,[]);const c=m.useRef(),u=m.useContext(WH);u==null||u.useRegister(c);const h=m.useMemo(()=>n?JSON.stringify(n):"",[n]),d=m.useMemo(()=>s?JSON.stringify(s):"",[s]),f=m.useMemo(()=>{var w;const x=qm[w=`${h}:${d}`]??(qm[w]=new Intl.NumberFormat(n,s));return AH(t,x,r,i)},[t,h,d,r,i]);return m.createElement(FH,{...o,group:u,data:f,innerRef:c})}),WH=m.createContext(void 0),qH={notation:"compact",maximumFractionDigits:1};function xs({value:e,loading:t=!1,className:n,prefix:s,suffix:r,format:i,trend:o,fallback:l="…"}){const c=m.useMemo(()=>{if(e==null)return 0;const d=Number(e);return Number.isFinite(d)?d:0},[e]);if(t)return a.jsxs("span",{className:uh("inline-flex items-baseline",n),children:[s,l,r]});const u=IH,h=typeof o=="boolean"?o?1:0:o;return a.jsxs("span",{className:uh("inline-flex",n),children:[s,a.jsx(u,{value:c,format:i??qH,trend:h,className:"inline-flex"}),r]})}function Rn({id:e,label:t="ID",className:n="",variant:s="inline"}){const[r,i]=m.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(e),i(!0),Y.success("Copied to clipboard"),setTimeout(()=>i(!1),2e3)}catch{Y.error("Failed to copy to clipboard")}};return s==="detail"?a.jsxs("div",{className:`flex justify-between items-center ${n}`,children:[a.jsxs("span",{className:"text-gray-400",children:[t,":"]}),a.jsxs("button",{onClick:o,className:"flex items-center gap-2 text-white text-sm hover:text-white/80 transition-colors group",title:"Click to copy",children:[a.jsx("span",{className:"font-mono",children:e}),r?a.jsx(cg,{className:"w-3 h-3 text-green-500"}):a.jsx(gy,{className:"w-3 h-3 text-gray-400 group-hover:text-white transition-colors"})]})]}):s==="subscript"?a.jsxs("sup",{onClick:o,className:`text-xs text-gray-500 ml-2 cursor-pointer hover:text-white transition-colors inline-flex items-center gap-1 ${n}`,title:"Click to copy User ID",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsxs("span",{className:"text-white/80 font-mono text-xs",children:[e.slice(0,8),"..."]}),a.jsx("span",{className:"ml-1",children:"]"})]}):a.jsxs("button",{onClick:o,className:`flex items-center gap-1.5 text-sm text-gray-400 hover:text-white transition-colors group ${n}`,title:"Click to copy",children:[a.jsxs("span",{children:[t,":"]}),a.jsx("span",{className:"font-mono",children:e}),r?a.jsx(cg,{className:"w-3 h-3 text-green-500"}):a.jsx(gy,{className:"w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity"})]})}function fi({title:e="Seeding Terminal",lines:t,isRunning:n=!1,className:s="",defaultCollapsed:r=!1}){const[i,o]=m.useState(r),l=m.useRef(null);m.useEffect(()=>{const d=l.current;!d||i||d.scrollTo({top:d.scrollHeight,behavior:"smooth"})},[i]);const c=d=>{switch(d.type){case"success":return a.jsx(Lt,{className:"w-3 h-3 text-green-400"});case"error":return a.jsx(Ur,{className:"w-3 h-3 text-red-400"});case"progress":return d.status==="running"?a.jsx(Vs,{className:"w-3 h-3 text-blue-400 animate-spin"}):d.status==="completed"?a.jsx(Lt,{className:"w-3 h-3 text-green-400"}):d.status==="failed"?a.jsx(Ur,{className:"w-3 h-3 text-red-400"}):a.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"});default:return a.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"})}},u=d=>{switch(d.type){case"success":return"text-green-400";case"error":return"text-red-400";case"progress":return d.status==="running"?"text-blue-400":d.status==="completed"?"text-green-400":d.status==="failed"?"text-red-400":"text-gray-400";default:return"text-gray-300"}},h=d=>d.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+d.getMilliseconds().toString().padStart(3,"0");return a.jsxs("div",{className:`bg-black/90 border border-dashed border-white/20 rounded-none font-mono text-xs ${s}`,children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-dashed border-white/10",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(oR,{className:"w-3 h-3 text-green-400"}),a.jsx("span",{className:"text-green-400 font-medium text-xs",children:e})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[n&&a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full animate-pulse"}),a.jsx("span",{className:"text-green-400 text-xs",children:"RUNNING"})]}),a.jsxs("div",{className:"text-gray-400 text-xs",children:[t.length," / ",t.length]}),a.jsx("button",{onClick:()=>o(!i),className:"text-gray-400 hover:text-white transition-colors",children:i?a.jsx(af,{className:"w-3 h-3"}):a.jsx(Qz,{className:"w-3 h-3"})})]})]}),!i&&a.jsxs("div",{ref:l,className:"p-3 space-y-0.5 h-56 overflow-y-auto",children:[t.length===0?a.jsxs("div",{className:"text-gray-500 italic text-xs",children:[a.jsx("span",{className:"text-green-400",children:"$"})," Waiting for operations..."]}):t.map(d=>a.jsxs("div",{className:`flex items-start space-x-3 py-1 ${u(d)} text-xs`,children:[a.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(d.timestamp)}),a.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),a.jsx("div",{className:"flex-shrink-0 mt-0.5",children:c(d)}),a.jsx("span",{className:"flex-1 min-w-0 break-words",children:d.message})]},d.id)),n&&a.jsxs("div",{className:"flex items-start space-x-3 py-1 text-green-400 text-xs",children:[a.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(new Date)}),a.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),a.jsx("div",{className:"w-3 h-3 flex-shrink-0 mt-0.5"}),a.jsx("span",{className:"flex-1 flex items-center",children:a.jsx("span",{className:"animate-pulse",children:"█"})})]})]}),!i&&a.jsx("div",{className:"px-3 py-1.5 border-t border-dashed border-white/10 bg-black/50",children:a.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("span",{children:["Status: ",n?"Active":"Idle"]}),a.jsxs("span",{children:["Lines: ",t.length]})]}),a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full"}),a.jsx("span",{children:"Better Auth Studio"})]})]})})]})}const XC=document.createElement("style");XC.textContent=`
|
|
428
|
-
@keyframes fadeIn {
|
|
429
|
-
from {
|
|
430
|
-
opacity: 0;
|
|
431
|
-
transform: translateX(-10px);
|
|
432
|
-
}
|
|
433
|
-
to {
|
|
434
|
-
opacity: 1;
|
|
435
|
-
transform: translateX(0);
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
.animate-fadeIn {
|
|
440
|
-
animation: fadeIn 0.3s ease-out forwards;
|
|
441
|
-
}
|
|
442
|
-
`;document.head.appendChild(XC);const Ye=m.forwardRef(({className:e,type:t,...n},s)=>a.jsx("input",{type:t,className:`flex h-10 w-full border border-dashed border-white/20 bg-black/30 px-3 py-2 text-sm text-white placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-white focus:border-white/40 disabled:cursor-not-allowed disabled:opacity-50 rounded-none ${e}`,ref:s,...n}));Ye.displayName="Input";const Ke=m.forwardRef(({className:e,...t},n)=>a.jsx("label",{className:`text-sm font-light text-white ${e}`,ref:n,...t}));Ke.displayName="Label";function GC({currentPage:e,totalPages:t,onPageChange:n,totalItems:s,startIndex:r,endIndex:i}){const o=()=>{const u=[],h=[];for(let d=Math.max(2,e-2);d<=Math.min(t-1,e+2);d++)u.push(d);return e-2>2?h.push(1,"..."):h.push(1),h.push(...u),e+2<t-1?h.push("...",t):t>1&&h.push(t),h};if(t<=1)return null;const l=o();return a.jsxs("div",{className:"flex items-center justify-between mt-6",children:[a.jsxs("div",{className:"text-sm text-gray-400",children:["Showing ",r+1," to ",Math.min(i,s)," of ",s," items"]}),a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>n(e-1),disabled:e===1,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(kS,{className:"w-4 h-4"}),"Previous"]}),l.map((c,u)=>{if(c==="...")return a.jsx(F,{variant:"outline",size:"sm",disabled:!0,className:"border border-dashed border-white/20 text-white rounded-none",children:a.jsx(sR,{className:"w-4 h-4"})},`dots-${u}`);const h=c,d=e===h;return a.jsx(F,{variant:d?"default":"outline",size:"sm",onClick:()=>n(h),className:d?"bg-white text-black rounded-none":"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:h},h)}),a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>n(e+1),disabled:e===t,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:["Next",a.jsx(Zp,{className:"w-4 h-4"})]})]})]})}const nd=m.createContext({isOpen:!1,setIsOpen:()=>{}}),Zr=m.forwardRef(({className:e,value:t,onValueChange:n,children:s,...r},i)=>{const[o,l]=m.useState(!1);return a.jsx(nd.Provider,{value:{value:t,onValueChange:n,isOpen:o,setIsOpen:l},children:a.jsx("div",{ref:i,className:`relative ${e}`,...r,children:s})})});Zr.displayName="Select";const Qr=m.forwardRef(({className:e,children:t,...n},s)=>{const{isOpen:r,setIsOpen:i}=m.useContext(nd);return a.jsxs("button",{ref:s,type:"button",className:`flex h-10 w-full items-center justify-between border bg-black/30 px-3 py-2 text-sm text-white focus:outline-none focus:ring-1 focus:ring-white focus:border-white/40 disabled:cursor-not-allowed disabled:opacity-50 rounded-none ${e}`,onClick:()=>i(!r),...n,children:[t,a.jsx(af,{className:`h-4 w-4 text-gray-400 transition-transform ${r?"rotate-180":""}`})]})});Qr.displayName="SelectTrigger";const M0=m.forwardRef(({className:e,placeholder:t,...n},s)=>{const{value:r}=m.useContext(nd);return a.jsx("span",{ref:s,className:`text-sm text-white ${e}`,...n,children:r||t})});M0.displayName="SelectValue";const Kr=m.forwardRef(({className:e,children:t,...n},s)=>{const{isOpen:r}=m.useContext(nd);return r?a.jsx("div",{ref:s,className:`absolute top-full left-0 right-0 z-50 mt-1 border border-dashed border-white/20 bg-black/90 rounded-none shadow-lg ${e}`,...n,children:t}):null});Kr.displayName="SelectContent";const yn=m.forwardRef(({className:e,children:t,value:n,...s},r)=>{const{onValueChange:i,setIsOpen:o}=m.useContext(nd);return a.jsx("div",{ref:r,className:`px-3 py-2 text-sm text-white hover:bg-white/10 cursor-pointer ${e}`,onClick:()=>{i==null||i(n),o(!1)},...s,children:t})});yn.displayName="SelectItem";function ZC(){const e=ws(),{counts:t,refetchCounts:n}=gf(),[s,r]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(null),[u,h]=m.useState(""),[d,f]=m.useState("all"),[x,w]=m.useState([]),[v,N]=m.useState(1),[g]=m.useState(20),[b,p]=m.useState(!1),[y,j]=m.useState(!1),[S,C]=m.useState(!1),[T,A]=m.useState(!1),[P,U]=m.useState(!1),[O,V]=m.useState(!1),[k,z]=m.useState(null),[M,_]=m.useState([]),[E,D]=m.useState(!1),[L,W]=m.useState({name:"",slug:""}),[R,H]=m.useState({name:"",slug:""});m.useEffect(()=>{$()},[]);const q=se=>se.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),X=se=>{const fe=q(se);W({name:se,slug:fe})},ne=se=>{W(fe=>({...fe,slug:q(se)}))},ae=se=>{const fe=q(se);H({name:se,slug:fe})},J=se=>{H(fe=>({...fe,slug:q(se)}))},$=async()=>{try{const fe=await(await fetch("/api/plugins")).json(),Re=(fe==null?void 0:fe.plugins).find(I=>I.id==="organization");c({enabled:!!Re,availablePlugins:(fe==null?void 0:fe.plugins).map(I=>I.id),configPath:fe.configPath,organizationPlugin:(fe==null?void 0:fe.plugins).find(I=>I.id==="organization")}),Re?await te():o(!1)}catch(se){console.error("Failed to check plugin status:",se),c({enabled:!1,error:"Failed to check plugin status"}),o(!1)}},te=async()=>{try{const fe=await(await fetch("/api/organizations?limit=10000")).json();console.log({lenght:fe.organizations.length}),r(fe.organizations||[])}catch(se){console.error("Failed to fetch organizations:",se),Y.error("Failed to fetch organizations")}finally{o(!1)}},K=async se=>{_([]),D(!0),_([{id:"start",type:"info",message:`Starting organization seeding process for ${se} organizations...`,timestamp:new Date}]);try{const Re=await(await fetch("/api/seed/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:se})})).json();if(Re.success){const I=Re.results.map((me,he)=>me.success?{id:`org-${he}`,type:"progress",message:`Creating organization: ${me.organization.name} (${me.organization.slug})`,timestamp:new Date,status:"completed"}:{id:`org-${he}`,type:"error",message:`Failed to create organization ${he+1}: ${me.error}`,timestamp:new Date});_(me=>[...me,...I]);const le=Re.results.filter(me=>me.success).length;_(me=>[...me,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${le}/${se} organizations successfully`,timestamp:new Date}]),await te(),await n()}else _(I=>[...I,{id:"error",type:"error",message:`❌ Seeding failed: ${Re.error||"Unknown error"}`,timestamp:new Date}])}catch(fe){_(Re=>[...Re,{id:"error",type:"error",message:`❌ Network error: ${fe}`,timestamp:new Date}])}finally{D(!1)}},B=se=>{z(se),U(!0)},G=se=>{z(se),H({name:se.name,slug:se.slug}),C(!0)},re=se=>{z(se),A(!0)},ce=async()=>{if(!L.name){Y.error("Please fill in the organization name");return}const se=Y.loading("Creating organization...");try{const Re=await(await fetch("/api/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:L.name,slug:L.slug})})).json();Re.success?(await te(),p(!1),W({name:"",slug:""}),Y.success("Organization created successfully!",{id:se})):Y.error(`Error creating organization: ${Re.error||"Unknown error"}`,{id:se})}catch(fe){console.error("Error creating organization:",fe),Y.error("Error creating organization",{id:se})}},ue=async()=>{if(!k){Y.error("No organization selected");return}if(!R.name){Y.error("Please fill in the organization name");return}const se=Y.loading("Updating organization...");try{const Re=await(await fetch(`/api/organizations/${k.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:R.name,slug:R.slug})})).json();Re.success?(await te(),C(!1),z(null),H({name:"",slug:""}),Y.success("Organization updated successfully!",{id:se})):Y.error(`Error updating organization: ${Re.error||"Unknown error"}`,{id:se})}catch(fe){console.error("Error updating organization:",fe),Y.error("Error updating organization",{id:se})}},ve=async()=>{if(!k){Y.error("No organization selected");return}const se=Y.loading("Deleting organization...");try{const Re=await(await fetch(`/api/organizations/${k.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();Re.success?(await te(),await n(),A(!1),z(null),Y.success("Organization deleted successfully!",{id:se})):Y.error(`Error deleting organization: ${Re.error||"Unknown error"}`,{id:se})}catch(fe){console.error("Error deleting organization:",fe),Y.error("Error deleting organization",{id:se})}},ze=()=>{if(s.length===0){Y.error("No organizations to export");return}const se=["ID","Name","Slug","Created At","Updated At"],fe=s.map(he=>[he.id,he.name||"",he.slug||"",new Date(he.createdAt).toLocaleString(),new Date(he.updatedAt).toLocaleString()]),Re=[se.join(","),...fe.map(he=>he.map(Ue=>`"${Ue}"`).join(","))].join(`
|
|
443
|
-
`),I=new Blob([Re],{type:"text/csv;charset=utf-8;"}),le=document.createElement("a"),me=URL.createObjectURL(I);le.setAttribute("href",me),le.setAttribute("download",`organizations-export-${new Date().toISOString().split("T")[0]}.csv`),le.style.visibility="hidden",document.body.appendChild(le),le.click(),document.body.removeChild(le),Y.success(`Exported ${s.length} organizations to CSV`)},_e=se=>{x.some(fe=>fe.type===se)||w([...x,{type:se}])},Mt=se=>{w(x.filter(fe=>fe.type!==se))},St=()=>{w([])},Le=(se,fe)=>{w(Re=>Re.map(I=>I.type===se?{...I,dateRange:fe}:I))},De=s.filter(se=>{const fe=se.name.toLowerCase().includes(u.toLowerCase())||se.slug.toLowerCase().includes(u.toLowerCase());if(x.length===0)return fe;const Re=x.every(I=>{var le,me,he,Ue;switch(I.type){case"createdAt":{if(!((le=I.dateRange)!=null&&le.from)&&!((me=I.dateRange)!=null&&me.to))return!0;const Ae=new Date(se.createdAt);return!((he=I.dateRange)!=null&&he.from&&I.dateRange.from>Ae||(Ue=I.dateRange)!=null&&Ue.to&&I.dateRange.to<Ae)}default:return!0}});return fe&&Re}),nt=Math.ceil(De.length/g),ht=(v-1)*g,vt=ht+g,Gt=De.slice(ht,vt),Yt=se=>{N(se)};return i?a.jsx("div",{className:"flex min-h-screen items-center justify-center h-full",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(Vs,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading organizations..."})]})}):l&&!l.enabled?a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl text-white font-light",children:"Organizations"}),a.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your application organizations"})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx(_s,{className:"w-12 h-12 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Organization Plugin Required"}),a.jsx("p",{className:"text-gray-300 mb-6",children:"To use Organizations in Better Auth Studio, you need to enable the organization plugin in your Better Auth configuration."}),a.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[a.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),a.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:a.jsxs("li",{children:["Import the plugin in your auth configuration file",l.configPath&&a.jsxs("span",{className:"text-gray-400",children:[" (",l.configPath,")"]}),":"]})}),a.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:a.jsxs("pre",{className:"text-sm text-gray-300",children:[a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"export const"})," ",a.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",a.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",a.jsx("br",{}),a.jsxs("span",{className:"text-yellow-300 pl-12",children:["organization(",")"]}),a.jsx("br",{}),a.jsx("span",{className:"pl-10",children:"]"})," ",a.jsx("br",{}),"}",") ",a.jsx("br",{})]})}),a.jsx("div",{className:"mt-4",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"2. Do migrations to create the organizations table"})}),a.jsx("div",{className:"mt-2",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),l.availablePlugins&&l.availablePlugins.length>0&&a.jsx("div",{className:"mb-4",children:a.jsxs("p",{className:"text-gray-400 text-sm",children:["Currently enabled plugins: ",l.availablePlugins.join(", ")]})}),a.jsx(F,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),a.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",a.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Organizations",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:a.jsx(xs,{value:t.organizations??0,className:"text-white font-mono text-sm",prefix:a.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),a.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your organizations and teams"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:ze,children:[a.jsx(MS,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),a.jsxs(F,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>V(!0),children:[a.jsx(yt,{className:"w-4 h-4 mr-2"}),"Seed"]}),a.jsxs(F,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>p(!0),children:[a.jsx(dr,{className:"w-4 h-4 mr-2"}),"Add Organization"]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(oi,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Ye,{placeholder:"Search organizations...",value:u,onChange:se=>h(se.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs(Zr,{value:"",onValueChange:_e,children:[a.jsx(Qr,{className:"w-[180px]",children:a.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[a.jsx(dr,{className:"w-4 h-4"}),a.jsx("span",{children:"Add Filter"})]})}),a.jsx(Kr,{children:!x.some(se=>se.type==="createdAt")&&a.jsx(yn,{value:"createdAt",children:"Created Date"})})]})}),x.length>0&&a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx(F,{onClick:St,children:"Clear all"})})]}),x.length>0&&a.jsx("div",{className:"space-y-3",children:a.jsx("div",{className:"flex flex-wrap gap-3",children:x.map(se=>{var fe,Re,I,le;return a.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 bg-white/10 border border-white/20 rounded-sm",children:[a.jsx(Qp,{className:"w-3 h-3 text-white"}),se.type==="createdAt"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Created:"}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(lh,{className:"mr-1 h-3 w-3"}),(fe=se.dateRange)!=null&&fe.from?Zn(se.dateRange.from,"MMM dd yyyy"):"From"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:(Re=se.dateRange)==null?void 0:Re.from,onSelect:me=>{var he;return Le("createdAt",{from:me,to:(he=se.dateRange)==null?void 0:he.to})},initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(lh,{className:"mr-1 h-3 w-3"}),(I=se.dateRange)!=null&&I.to?Zn(se.dateRange.to,"MMM dd yyyy"):"To"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:(le=se.dateRange)==null?void 0:le.to,onSelect:me=>{var he;return Le("createdAt",{from:(he=se.dateRange)==null?void 0:he.from,to:me})},initialFocus:!0,disabled:me=>{var he;return(he=se.dateRange)!=null&&he.from?me<se.dateRange.from:!1},className:"rounded-none"})})]})]}),a.jsx("button",{onClick:()=>Mt(se.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:a.jsx(It,{className:"w-3 h-3 text-white"})})]},se.type)})})})]}),a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Organization"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Slug"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:De.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"py-12 px-4 text-center",children:a.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(_s,{className:"w-8 h-8 text-white/50"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium text-lg",children:"No organizations found"}),a.jsx("p",{className:"text-gray-400 text-sm mt-1",children:u||d!=="all"?"Try adjusting your search or filter criteria":"Get started by creating your first organization"})]}),!u&&d==="all"&&a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{onClick:()=>p(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[a.jsx(dr,{className:"w-4 h-4 mr-2"}),"Create Organization"]}),a.jsxs(F,{onClick:()=>V(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(yt,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):Gt.map(se=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>e(`/organizations/${se.id}`),children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(_s,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:se.name}),a.jsx(Rn,{id:se.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:se.slug}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:a.jsxs("div",{className:"flex flex-col",children:[new Date(se.createdAt).toLocaleDateString(),a.jsx("p",{className:"text-xs",children:new Date(se.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]})}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx(F,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:fe=>{fe.stopPropagation(),B(se)},children:a.jsx(Gc,{className:"w-4 h-4"})}),a.jsx(F,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:fe=>{fe.stopPropagation(),G(se)},children:a.jsx(ii,{className:"w-4 h-4"})}),a.jsx(F,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:fe=>{fe.stopPropagation(),re(se)},children:a.jsx(Kp,{className:"w-4 h-4"})})]})})]},se.id))})]})}),a.jsx(GC,{currentPage:v,totalPages:nt,onPageChange:Yt,totalItems:De.length,startIndex:ht,endIndex:vt})]}),O&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"overflow-x-hidden bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[a.jsx("span",{className:"text-white/50 mr-2",children:"["}),a.jsx(_s,{className:"inline mr-2 w-3.5 h-3.5 text-white"}),a.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Organizations"}),a.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>V(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(It,{className:"w-4 h-4"})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Ke,{htmlFor:"organization-count",className:"text-sm text-gray-400 font-light",children:"Number of organizations"}),a.jsx(Ye,{id:"organization-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var fe;const se=parseInt(((fe=document.getElementById("organization-count"))==null?void 0:fe.value)||"5",10);K(se)},disabled:E,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:E?a.jsxs(a.Fragment,{children:[a.jsx(Vs,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(yt,{className:"w-3 h-3 mr-2"}),"Seed Organizations"]})})]})}),M.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(fi,{title:"Organization Seeding Terminal",lines:M,isRunning:E,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),a.jsx("div",{className:"flex justify-end mt-6 pt-6",children:a.jsx(F,{variant:"outline",onClick:()=>V(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create Organization"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>p(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(It,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Ye,{id:"create-name",value:L.name,onChange:se=>X(se.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"create-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),a.jsx(Ye,{id:"create-slug",value:L.slug,onChange:se=>ne(se.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{p(!1),W({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:ce,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),S&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:se=>{se.target===se.currentTarget&&(C(!1),z(null),H({name:"",slug:""}))},children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",onClick:se=>se.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Organization"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{C(!1),z(null),H({name:"",slug:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(It,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(_s,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.slug})]})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Ye,{id:"edit-name",value:R.name,onChange:se=>ae(se.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"edit-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),a.jsx(Ye,{id:"edit-slug",value:R.slug,onChange:se=>J(se.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{C(!1),H({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:ue,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),T&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Organization"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>A(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(It,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(_s,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.slug})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this organization? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>A(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:ve,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),P&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Organization Details"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>U(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(It,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(_s,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.slug})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Rn,{id:k.id,variant:"detail"}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Created:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(k.createdAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Updated:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(k.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(F,{onClick:()=>U(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function QC(){const e=ws(),{counts:t,refetchCounts:n}=gf(),[s,r]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(""),[u,h]=m.useState([]),[d,f]=m.useState(1),[x]=m.useState(20),[w,v]=m.useState(!1),[N,g]=m.useState(!1),[b,p]=m.useState(!1),[y,j]=m.useState(!1),[S,C]=m.useState(!1),[T,A]=m.useState(!1),[P,U]=m.useState(!1),[O,V]=m.useState(!1),[k,z]=m.useState(null),[M,_]=m.useState(null),[E,D]=m.useState(""),[L,W]=m.useState(),[R,H]=m.useState(!1),[q,X]=m.useState([]),[ne,ae]=m.useState(!1),J=m.useCallback(async()=>{try{const le=await(await fetch("/api/users?limit=10000")).json();r(le.users||[])}catch{}finally{o(!1)}},[]),$=m.useCallback(async()=>{try{const le=await(await fetch("/api/admin/status")).json();H(le.enabled)}catch{H(!1)}},[]);m.useEffect(()=>{J(),$();const I=()=>{M&&_(null)};return document.addEventListener("click",I),()=>document.removeEventListener("click",I)},[M,$,J]);const te=async I=>{X([]),ae(!0),X([{id:"start",type:"info",message:`Starting user seeding process for ${I} users...`,timestamp:new Date}]);try{const me=await(await fetch("/api/seed/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:I})})).json();if(me.success){const he=me.results.map((Ae,Oe)=>Ae.success?{id:`user-${Oe}`,type:"progress",message:`Creating user: ${Ae.user.name} (${Ae.user.email})`,timestamp:new Date,status:"completed"}:{id:`user-${Oe}`,type:"error",message:`Failed to create user ${Oe+1}: ${Ae.error}`,timestamp:new Date});X(Ae=>[...Ae,...he]);const Ue=me.results.filter(Ae=>Ae.success).length;X(Ae=>[...Ae,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${Ue}/${I} users successfully`,timestamp:new Date}]),await J(),await n()}else X(he=>[...he,{id:"error",type:"error",message:`❌ Seeding failed: ${me.error||"Unknown error"}`,timestamp:new Date}])}catch(le){X(me=>[...me,{id:"error",type:"error",message:`❌ Network error: ${le}`,timestamp:new Date}])}finally{ae(!1)}},K=I=>{z(I),j(!0)},B=I=>{z(I),g(!0)},G=I=>{z(I),p(!0)},re=async()=>{var Ue,Ae,Oe;const I=(Ue=document.getElementById("create-name"))==null?void 0:Ue.value,le=(Ae=document.getElementById("create-email"))==null?void 0:Ae.value,me=(Oe=document.getElementById("create-password"))==null?void 0:Oe.value;if(!I||!le||!me){Y.error("Please fill in all fields");return}const he=Y.loading("Creating user...");try{const Be=await(await fetch("/api/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:I,email:le,password:me})})).json();Be.success?(await J(),v(!1),document.getElementById("create-name").value="",document.getElementById("create-email").value="",document.getElementById("create-password").value="",Y.success("User created successfully!",{id:he})):Y.error(`Error creating user: ${Be.error||"Unknown error"}`,{id:he})}catch{Y.error("Error creating user",{id:he})}},ce=async()=>{var he,Ue;if(!k){Y.error("No user selected");return}const I=(he=document.getElementById("edit-name"))==null?void 0:he.value,le=(Ue=document.getElementById("edit-email"))==null?void 0:Ue.value;if(!I||!le){Y.error("Please fill in all fields");return}const me=Y.loading("Updating user...");try{const Oe=await(await fetch(`/api/users/${k.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:I,email:le})})).json();Oe.success?(await J(),g(!1),z(null),Y.success("User updated successfully!",{id:me})):Y.error(`Error updating user: ${Oe.error||"Unknown error"}`,{id:me})}catch{Y.error("Error updating user",{id:me})}},ue=async()=>{if(!k){Y.error("No user selected");return}const I=Y.loading("Deleting user...");try{const me=await(await fetch(`/api/users/${k.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();me.success?(await J(),await n(),p(!1),z(null),Y.success("User deleted successfully!",{id:I})):Y.error(`Error deleting user: ${me.error||"Unknown error"}`,{id:I})}catch{Y.error("Error deleting user",{id:I})}},ve=async()=>{if(!k)return;if(!R){Y.error("Admin plugin is not enabled");return}const I=Y.loading("Banning user...");try{const le=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:k.id,banReason:E||"No reason provided",banExpiresIn:L})}),me=await le.json();le.ok?(Y.success("User banned successfully!",{id:I}),A(!1),D(""),W(void 0),z(null),_(null),J()):Y.error(`Error banning user: ${me.error||me.message||"Unknown error"}`,{id:I})}catch{Y.error("Error banning user",{id:I})}},ze=async()=>{if(!k)return;if(!R){Y.error("Admin plugin is not enabled");return}const I=Y.loading("Unbanning user...");try{const le=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:k.id})}),me=await le.json();le.ok?(Y.success("User unbanned successfully!",{id:I}),U(!1),z(null),_(null),J()):Y.error(`Error unbanning user: ${me.error||me.message||"Unknown error"}`,{id:I})}catch{Y.error("Error unbanning user",{id:I})}},_e=async()=>{var me;if(!k){Y.error("No user selected");return}const I=(me=document.getElementById("update-password"))==null?void 0:me.value;if(!I){Y.error("Please enter a new password");return}const le=Y.loading("Updating password...");try{const he=await fetch(`/api/users/${k.id}/password`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:I})}),Ue=await he.json();he.ok&&Ue.success?(Y.success("Password updated successfully!",{id:le}),V(!1),z(null),document.getElementById("update-password").value=""):Y.error(`Error updating password: ${Ue.error||"Unknown error"}`,{id:le})}catch{Y.error("Error updating password",{id:le})}},Mt=()=>{if(s.length===0){Y.error("No users to export");return}const I=["ID","Name","Email","Email Verified","Created At","Updated At"],le=s.map(Oe=>[Oe.id,Oe.name||"",Oe.email||"",!!Oe.emailVerified,new Date(Oe.createdAt).toLocaleString(),new Date(Oe.updatedAt).toLocaleString()]),me=[I.join(","),...le.map(Oe=>Oe.map(we=>`"${we}"`).join(","))].join(`
|
|
444
|
-
`),he=new Blob([me],{type:"text/csv;charset=utf-8;"}),Ue=document.createElement("a"),Ae=URL.createObjectURL(he);Ue.setAttribute("href",Ae),Ue.setAttribute("download",`users-export-${new Date().toISOString().split("T")[0]}.csv`),Ue.style.visibility="hidden",document.body.appendChild(Ue),Ue.click(),document.body.removeChild(Ue),Y.success(`Exported ${s.length} users to CSV`)},St=I=>{u.some(me=>me.type===I)||(h(me=>[...me,{type:I}]),f(1))},Le=I=>{h(le=>le.filter(me=>me.type!==I)),f(1)},De=(I,le)=>{h(me=>me.map(he=>he.type===I?{...he,value:le}:he))},nt=(I,le)=>{h(me=>me.map(he=>he.type===I?{...he,dateRange:le}:he))},ht=s.filter(I=>{const le=I.name.toLowerCase().includes(l.toLowerCase())||I.email.toLowerCase().includes(l.toLowerCase());if(u.length===0)return le;const me=u.every(he=>{var Ue,Ae,Oe,we,Be;switch(he.type){case"emailVerified":return he.value===void 0?!0:I.emailVerified===(he.value==="true");case"banned":return he.value===void 0?!0:I.banned===(he.value==="true");case"active":return I.banned!==!0;case"createdAt":{if(!((Ue=he.dateRange)!=null&&Ue.from)&&!((Ae=he.dateRange)!=null&&Ae.to))return!0;const Ce=new Date(I.createdAt);return!((Oe=he.dateRange)!=null&&Oe.from&&he.dateRange.from>Ce||(we=he.dateRange)!=null&&we.to&&he.dateRange.to<Ce)}case"role":return he.value?(Be=I.role)==null?void 0:Be.toLowerCase().includes(he.value.toLowerCase()):!0;default:return!0}});return le&&me}),vt=s.filter(I=>I.banned).length,Gt=Math.ceil(ht.length/x),Yt=(d-1)*x,se=Yt+x,fe=ht.slice(Yt,se),Re=I=>{f(I)};return i?a.jsx("div",{className:"flex min-h-screen items-center justify-center h-full",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(Vs,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading users..."})]})}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Users",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:a.jsx(xs,{value:t.users??0,className:"text-white font-mono text-sm",prefix:a.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),a.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your application users"}),a.jsx("div",{className:"flex items-center space-x-4 mt-2",children:vt>0&&a.jsxs("span",{className:"text-sm text-red-400 flex items-center space-x-1",children:[a.jsx($d,{className:"w-3 h-3"}),a.jsxs("span",{children:[vt," Banned"]})]})})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:Mt,children:[a.jsx(MS,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),a.jsxs(F,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>C(!0),children:[a.jsx(yt,{className:"w-4 h-4 mr-2"}),"Seed"]}),a.jsxs(F,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>v(!0),children:[a.jsx(hg,{className:"w-4 h-4 mr-2"}),"Add User"]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(oi,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Ye,{placeholder:"Search users...",value:l,onChange:I=>c(I.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs(Zr,{value:"",onValueChange:St,children:[a.jsx(Qr,{className:"w-[180px]",children:a.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[a.jsx(dr,{className:"w-4 h-4"}),a.jsx("span",{children:"Add Filter"})]})}),a.jsxs(Kr,{children:[!u.some(I=>I.type==="emailVerified")&&a.jsx(yn,{value:"emailVerified",children:"Email Verified"}),!u.some(I=>I.type==="banned")&&a.jsx(yn,{value:"banned",children:"Banned Status"}),!u.some(I=>I.type==="createdAt")&&a.jsx(yn,{value:"createdAt",children:"Created Date"}),!u.some(I=>I.type==="role")&&a.jsx(yn,{value:"role",children:"Role"})]})]})}),u.length>0&&a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx(F,{onClick:()=>h([]),className:"",children:"Clear all"})})]}),u.length>0&&a.jsx("div",{className:"space-y-3",children:a.jsx("div",{className:"flex flex-wrap gap-3",children:u.map(I=>{var le,me,he,Ue;return a.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 bg-white/10 border border-white/20 rounded-sm",children:[a.jsx(Qp,{className:"w-3 h-3 text-white"}),I.type==="emailVerified"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Email Verified:"}),a.jsxs(Zr,{value:I.value||"",onValueChange:Ae=>De("emailVerified",Ae),children:[a.jsx(Qr,{className:"h-7 w-24 text-xs",children:a.jsx("span",{children:I.value==="true"?"True":I.value==="false"?"False":"Select"})}),a.jsxs(Kr,{children:[a.jsx(yn,{value:"true",children:"True"}),a.jsx(yn,{value:"false",children:"False"})]})]})]}),I.type==="banned"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Banned:"}),a.jsxs(Zr,{value:I.value||"",onValueChange:Ae=>De("banned",Ae),children:[a.jsx(Qr,{className:"h-7 w-24 text-xs",children:a.jsx("span",{children:I.value==="true"?"Yes":I.value==="false"?"No":"Select"})}),a.jsxs(Kr,{children:[a.jsx(yn,{value:"true",children:"Yes"}),a.jsx(yn,{value:"false",children:"No"})]})]})]}),I.type==="createdAt"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Created:"}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(lh,{className:"mr-1 h-3 w-3"}),(le=I.dateRange)!=null&&le.from?Zn(I.dateRange.from,"MMM dd yyyy"):"From"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:(me=I.dateRange)==null?void 0:me.from,onSelect:Ae=>{var Oe;return nt("createdAt",{from:Ae,to:(Oe=I.dateRange)==null?void 0:Oe.to})},initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(lh,{className:"mr-1 h-3 w-3"}),(he=I.dateRange)!=null&&he.to?Zn(I.dateRange.to,"MMM dd yyyy"):"To"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:(Ue=I.dateRange)==null?void 0:Ue.to,onSelect:Ae=>{var Oe;return nt("createdAt",{from:(Oe=I.dateRange)==null?void 0:Oe.from,to:Ae})},initialFocus:!0,disabled:Ae=>{var Oe;return(Oe=I.dateRange)!=null&&Oe.from?Ae<I.dateRange.from:!1},className:"rounded-none"})})]})]}),I.type==="role"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Role:"}),a.jsx(Ye,{type:"text",value:I.value||"",onChange:Ae=>De("role",Ae.target.value),className:"h-7 w-32 text-xs bg-black border-white/20 text-white",placeholder:"Enter role..."})]}),a.jsx("button",{onClick:()=>Le(I.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:a.jsx(It,{className:"w-3 h-3 text-white"})})]},I.type)})})})]}),a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"overflow-x-auto overflow-y-hidden",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:fe.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"py-12 px-4 text-center",children:a.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(li,{className:"w-8 h-8 text-white/50"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium text-lg",children:"No users found"}),a.jsx("p",{className:"text-gray-400 text-sm mt-1",children:l||u.length>0?"Try adjusting your search or filter criteria":"Get started by creating your first user or seeding some data"})]}),!l&&u.length===0&&a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{onClick:()=>v(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[a.jsx(hg,{className:"w-4 h-4 mr-2"}),"Create User"]}),a.jsxs(F,{onClick:()=>C(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(yt,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):fe.map(I=>a.jsxs("tr",{className:`border-b border-dashed hover:bg-white/5 cursor-pointer ${I.banned?"border-red-500/30 bg-red-500/5":"border-white/5"}`,onClick:()=>e(`/users/${I.id}`),children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"relative",children:[a.jsx("img",{src:I.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${I.id}`,alt:I.name,className:`w-10 h-10 rounded-none border border-dashed ${I.banned?"border-red-400/50 opacity-60":"border-white/20"}`}),I.banned&&a.jsx("div",{className:"absolute -top-1 -right-1 bg-red-500 rounded-full p-0.5",children:a.jsx($d,{className:"w-3 h-3 text-white"})})]}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"text-white font-light",children:I.name}),I.banned&&a.jsx("span",{className:"px-2 py-0.5 text-[10px] font-semibold bg-red-500/20 border border-red-500/50 text-red-400 rounded-sm uppercase tracking-wide",children:"Banned"})]}),a.jsx("div",{className:"text-sm text-gray-400 mt-0.5",children:I.email})]})]})}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[I.emailVerified?a.jsx(cg,{className:"w-4 h-4 text-green-400"}):a.jsx(dh,{className:"w-4 h-4 text-yellow-400"}),a.jsx("span",{className:"text-sm text-gray-400",children:I.emailVerified?"Verified":"Not Verified"})]})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:a.jsxs("div",{className:"flex flex-col",children:[new Date(I.createdAt).toLocaleDateString(),a.jsx("p",{className:"text-xs",children:new Date(I.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]})}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"relative flex items-center justify-end",children:[a.jsx(F,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:le=>{le.stopPropagation(),_(M===I.id?null:I.id)},children:a.jsx(aR,{className:"w-4 h-4"})}),M===I.id&&a.jsxs("div",{className:"absolute z-[999] right-0 top-full mt-1 w-48 bg-black border border-white/20 rounded-none shadow-lg",onClick:le=>le.stopPropagation(),children:[a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),_(null),K(I)},children:[a.jsx(Gc,{className:"w-4 h-4"}),a.jsx("span",{children:"View"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),_(null),B(I)},children:[a.jsx(ii,{className:"w-4 h-4"}),a.jsx("span",{children:"Edit User"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),_(null),z(I),V(!0)},children:[a.jsx(kn,{className:"w-4 h-4"}),a.jsx("span",{children:"Update Password"})]}),R&&(I.banned?a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-green-400 hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),z(I),U(!0),_(null)},children:[a.jsx($d,{className:"w-4 h-4"}),a.jsx("span",{children:"Unban User"})]}):a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-yellow-400 hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),z(I),A(!0),_(null)},children:[a.jsx($d,{className:"w-4 h-4"}),a.jsx("span",{children:"Ban User"})]})),a.jsx("div",{className:"border-t border-white/10 my-1"}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-red-400 hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),_(null),G(I)},children:[a.jsx(Kp,{className:"w-4 h-4"}),a.jsx("span",{children:"Delete User"})]})]})]})})]},I.id))})]})}),a.jsx(GC,{currentPage:d,totalPages:Gt,onPageChange:Re,totalItems:ht.length,startIndex:Yt,endIndex:se})]}),S&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"overflow-x-hidden bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[a.jsx("span",{className:"text-white/50 mr-2",children:"["}),a.jsx(li,{className:"inline mr-2 w-3 h-3 text-white"}),a.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed User"}),a.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>C(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(It,{className:"w-4 h-4"})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center space-x-2"}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Ke,{htmlFor:"user-count",className:"text-sm text-gray-400 font-light",children:"Number of users"}),a.jsx(Ye,{id:"user-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var le;const I=parseInt(((le=document.getElementById("user-count"))==null?void 0:le.value)||"5",10);te(I)},disabled:ne,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:ne?a.jsxs(a.Fragment,{children:[a.jsx(Vs,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(yt,{className:"w-3 h-3 mr-2"}),"Seed Users"]})})]})]}),q.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(fi,{title:"User Seeding Terminal",lines:q,isRunning:ne,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),a.jsx("div",{className:"flex justify-end mt-6 pt-6",children:a.jsx(F,{variant:"outline",onClick:()=>C(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),w&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-white/10 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create User"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(It,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Ye,{id:"create-name",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"create-email",className:"text-sm text-gray-400 font-light",children:"Email"}),a.jsx(Ye,{id:"create-email",type:"email",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"create-password",className:"text-sm text-gray-400 font-light",children:"Password"}),a.jsx(Ye,{id:"create-password",type:"password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>v(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:re,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),N&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(It,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:k.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.id}`,alt:k.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.email})]})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Ye,{id:"edit-name",defaultValue:k.name,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"edit-email",className:"text-sm text-gray-400 font-light",children:"Email"}),a.jsx(Ye,{id:"edit-email",type:"email",defaultValue:k.email,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>g(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:ce,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),b&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete User"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>p(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(It,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:k.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.id}`,alt:k.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.email})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this user? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>p(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:ue,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),y&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"User Details"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(It,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:k.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.id}`,alt:k.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.email})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Rn,{id:k.id,variant:"detail"}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Email Verified:"}),a.jsx("span",{className:"text-white text-sm",children:k.emailVerified?"Yes":"No"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Created:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(k.createdAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Updated:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(k.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(F,{onClick:()=>j(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})}),T&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),a.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",a.jsx("strong",{children:k.name})," from accessing the system."]}),a.jsxs("div",{className:"space-y-4 mb-6",children:[a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),a.jsx(Ye,{id:"banReason",value:E,onChange:I=>D(I.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),a.jsx(Ye,{id:"banExpires",type:"number",value:L||"",onChange:I=>W(I.target.value?Number(I.target.value):void 0),placeholder:"Leave empty for permanent ban",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(F,{variant:"outline",onClick:()=>{A(!1),D(""),W(void 0),z(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:ve,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),P&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-dashed border-green-400/50 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),a.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",a.jsx("strong",{children:k.name}),"? This will restore their access to the system."]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(F,{variant:"outline",onClick:()=>{U(!1),z(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:ze,className:"bg-green-600 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),O&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Update Password"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{V(!1),z(null),document.getElementById("update-password").value=""},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(It,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:k.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.id}`,alt:k.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.email})]})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"update-password",className:"text-sm text-gray-400 font-light",children:"New Password"}),a.jsx(Ye,{id:"update-password",type:"password",placeholder:"Enter new password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{V(!1),z(null),document.getElementById("update-password").value=""},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:_e,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Password"})]})]})})]})}const Nl=[{id:"signups",label:"Signups",analyticsKey:"newUsers",barClass:"bg-white/25 border border-white/10",dotClass:"bg-white/25"},{id:"logins",label:"Logins",analyticsKey:"activeUsers",barClass:"bg-white/20 border border-white/10",dotClass:"bg-white/20"},{id:"organizations",label:"Organizations",analyticsKey:"organizations",barClass:"bg-white/15 border border-white/10",dotClass:"bg-white/15"},{id:"teams",label:"Teams",analyticsKey:"teams",barClass:"bg-white/10 border border-white/10",dotClass:"bg-white/10"},{id:"sessions",label:"Sessions",analyticsKey:"sessions",barClass:"bg-white/5 border border-white/10",dotClass:"bg-white/5"}];function XH(){const[e]=m.useState("overview"),[t,n]=m.useState(!1),[s,r]=m.useState(0),[i,o]=m.useState(0),[l,c]=m.useState("1D"),[u,h]=m.useState("1D"),[d,f]=m.useState(null),[x,w]=m.useState(!1),[v,N]=m.useState("Daily"),[g,b]=m.useState("Daily"),[p,y]=m.useState("Daily"),[j,S]=m.useState("Daily"),[C,T]=m.useState(!1),[A,P]=m.useState(!1),[U,O]=m.useState(!1),[V,k]=m.useState(!1),[z,M]=m.useState(null),[_,E]=m.useState(null),[D,L]=m.useState(null),[W,R]=m.useState(null),[H,q]=m.useState(null),[X,ne]=m.useState(void 0),[ae,J]=m.useState(void 0),[$,te]=m.useState(void 0),[K,B]=m.useState(void 0),[G,re]=m.useState(void 0),[ce,ue]=m.useState(void 0),[ve,ze]=m.useState(void 0),[_e,Mt]=m.useState(void 0),[St,Le]=m.useState([]),[De,nt]=m.useState([]),[ht,vt]=m.useState(0),[Gt,Yt]=m.useState([]),[se,fe]=m.useState([]),[Re,I]=m.useState(0),[le,me]=m.useState(0),[he,Ue]=m.useState(0),[Ae,Oe]=m.useState(0),[we,Be]=m.useState(0),[Ce,We]=m.useState(!1),[Z,ee]=m.useState(!1),[pe,He]=m.useState({signups:[],logins:[],organizations:[],teams:[],sessions:[]}),[Je,Qe]=m.useState([]),[qe,Zt]=m.useState(!1),[Ss,cn]=m.useState(0),[Qt,yi]=m.useState(0),[Sn,sd]=m.useState(0),[Qo,Ko]=m.useState(0),[jf,Sf]=m.useState(0),[Cr,Jo]=m.useState([]),[ad,wi]=m.useState(0),[Ni,ji]=m.useState(0),[el,rd]=m.useState(0),{counts:Ea,loading:Cs}=gf(),ka=ws(),Si=["Daily","Weekly","Monthly","Yearly","Custom"],id={Daily:"1D",Weekly:"1W",Monthly:"1M",Yearly:"1Y",Custom:"Custom"},Cf=m.useMemo(()=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}),[]),Ma=de=>de==null?"...":Cf.format(Number(de)),Ta=de=>de==null?"...":Number(de).toLocaleString(),tl=m.useMemo(()=>Nl.reduce((de,xe)=>(de[xe.id]=(pe[xe.id]||[]).reduce((ge,oe)=>ge+oe,0),de),{}),[pe]),od=m.useMemo(()=>Object.values(tl).reduce((de,xe)=>de+xe,0),[tl]),Ef=(de,xe)=>{const ge=de.currentTarget.getBoundingClientRect();R(xe),q({x:ge.left+ge.width/2,y:ge.top})},ld=(()=>{const de=[];return z!=null&&z.isOutdated?de.push({id:"version-check",title:`Update Better-Auth to v${z.latest}`,severity:"high",date:new Date().toISOString().split("T")[0],description:"Your current version is outdated. Update to the latest version to get the latest security fixes, features, and improvements. Run: `pnpm install better-auth@latest`",affectedComponents:["All Components"],status:"pending",cve:""}):z&&de.push({id:"version-check",title:"Better-Auth is Up to date",severity:"low",date:new Date().toISOString().split("T")[0],description:"You are running the latest version of better-auth. Great job keeping your dependencies up to date!",affectedComponents:["All Components"],status:"applied",cve:""}),de.push(),de.push({id:"3",title:"Rate Limiting Configuration",severity:"medium",date:new Date().toISOString().split("T")[0],description:"Configure rate limiting for authentication endpoints to prevent brute force attacks. Better-auth provides built-in rate limiting middleware.",affectedComponents:["Auth Endpoints"],status:"pending"}),de})(),mt=m.useCallback(async(de,xe,ge,oe)=>{try{const ye=new URLSearchParams({type:de,period:xe});return ge&&ye.append("from",ge.toISOString()),oe&&ye.append("to",oe.toISOString()),await(await fetch(`/api/analytics?${ye.toString()}`)).json()}catch{return null}},[]);m.useEffect(()=>{(async()=>{try{const ge=await(await fetch("/api/users/all")).json();ge!=null&&ge.success&&ge.users&&Jo(ge.users)}catch{Jo([])}})()},[]),m.useEffect(()=>{(async()=>{try{const ge=await(await fetch("/api/stats")).json();ge&&r(ge.activeUsers||0)}catch{r(0)}})()},[]),m.useEffect(()=>{(async()=>{const xe=await mt("users",l,X,ae);xe&&(Le(xe.data||[]),nt(xe.labels||[]),vt(xe.percentageChange||0))})()},[l,X,ae,mt]),m.useEffect(()=>{if(Cr.length===0){wi(0),ji(0);return}const de=new Date;let xe,ge=de,oe,ye;if(g==="Custom"){if(!$||!K){wi(0),ji(0);return}xe=new Date($),ge=new Date(K),ge.setHours(23,59,59,999);const tn=ge.getTime()-xe.getTime();ye=new Date(xe.getTime()-1),oe=new Date(ye.getTime()-tn)}else switch(g){case"Daily":xe=new Date(de),xe.setHours(0,0,0,0),ye=new Date(xe.getTime()-1),oe=new Date(ye.getTime()-24*60*60*1e3);break;case"Weekly":xe=new Date(de),xe.setDate(de.getDate()-de.getDay()),xe.setHours(0,0,0,0),ye=new Date(xe.getTime()-1),oe=new Date(ye.getTime()-7*24*60*60*1e3);break;case"Monthly":xe=new Date(de.getFullYear(),de.getMonth(),1),xe.setHours(0,0,0,0),ye=new Date(xe.getTime()-1),oe=new Date(de.getFullYear(),de.getMonth()-1,1),oe.setHours(0,0,0,0);break;case"Yearly":xe=new Date(de.getFullYear(),0,1),xe.setHours(0,0,0,0),ye=new Date(xe.getTime()-1),oe=new Date(de.getFullYear()-1,0,1),oe.setHours(0,0,0,0);break;default:wi(0),ji(0);return}const ke=Cr.filter(tn=>{if(!tn.createdAt)return!1;const Da=new Date(tn.createdAt);return Da>=xe&&Da<=ge}),Ne=Cr.filter(tn=>{if(!tn.createdAt)return!1;const Da=new Date(tn.createdAt);return Da>=oe&&Da<=ye}),be=ke.length,Xe=Ne.length;let mn=0;Xe>0?mn=(be-Xe)/Xe*100:be>0&&(mn=100),wi(be),ji(mn)},[Cr,g,$,K]),m.useEffect(()=>{(async()=>{if(!(u==="Custom"&&(!$||!K))){Zt(!0);try{const[xe,ge,oe,ye,ke]=await Promise.all([mt("newUsers",u,$,K),mt("activeUsers",u,$,K),mt("organizations",u,$,K),mt("teams",u,$,K),mt("sessions",u,$,K)]);xe&&(Yt(xe.data||[]),fe(xe.labels||[])),He({signups:(xe==null?void 0:xe.data)||[],logins:(ge==null?void 0:ge.data)||[],organizations:(oe==null?void 0:oe.data)||[],teams:(ye==null?void 0:ye.data)||[],sessions:(ke==null?void 0:ke.data)||[]}),Qe((xe==null?void 0:xe.labels)||(ge==null?void 0:ge.labels)||(oe==null?void 0:oe.labels)||(ye==null?void 0:ye.labels)||(ke==null?void 0:ke.labels)||[])}finally{Zt(!1)}}})()},[u,$,K,mt]),m.useEffect(()=>{(async()=>{const xe=await mt("activeUsers","1D");xe&&I(xe.percentageChange||0)})()},[mt]),m.useEffect(()=>{},[Ea.organizations,Ea.teams,Cs]),m.useEffect(()=>{(async()=>{const xe=id[p]||"1D",ge=xe==="Custom";if(!(ge&&(!G||!ce))){We(!0);try{const oe=await mt("organizations",xe,ge?G:void 0,ge?ce:void 0);oe&&(Oe(oe.total||0),me(oe.percentageChange||0))}catch{Oe(0),me(0)}finally{We(!1)}}})()},[p,G,ce,mt]),m.useEffect(()=>{(async()=>{const xe=id[j]||"1D",ge=xe==="Custom";if(!(ge&&(!ve||!_e))){ee(!0);try{const oe=await mt("teams",xe,ge?ve:void 0,ge?_e:void 0);oe&&(Be(oe.total||0),Ue(oe.percentageChange||0))}catch{Be(0),Ue(0)}finally{ee(!1)}}})()},[j,ve,_e,mt]),m.useEffect(()=>{(async()=>{const xe=await mt("users","1D");xe&&cn(xe.percentageChange||0);const ge=await mt("organizations","1D");ge&&yi(ge.percentageChange||0);const oe=await mt("activeUsers","1D");oe&&sd(oe.percentageChange||0);const[ye,ke,Ne,be,Xe]=await Promise.all([mt("newUsers","1D"),mt("activeUsers","1D"),mt("organizations","1D"),mt("teams","1D"),mt("sessions","1D")]);ye?(o(ye.total||0),rd(ye.percentageChange||0)):(o(0),rd(0));const tn=[(ye==null?void 0:ye.total)||0,(ke==null?void 0:ke.total)||0,(Ne==null?void 0:Ne.total)||0,(be==null?void 0:be.total)||0,(Xe==null?void 0:Xe.total)||0].reduce((kr,Df)=>kr+Df,0);Sf(tn);const sl=[(ye==null?void 0:ye.previousTotal)||0,(ke==null?void 0:ke.previousTotal)||0,(Ne==null?void 0:Ne.previousTotal)||0,(be==null?void 0:be.previousTotal)||0,(Xe==null?void 0:Xe.previousTotal)||0].reduce((kr,Df)=>kr+Df,0);if(sl>0){const kr=(tn-sl)/sl*100;Ko(kr)}else tn>0?Ko(100):Ko(0)})()},[mt]),m.useEffect(()=>{(async()=>{try{const ge=await(await fetch("/api/version-check")).json();ge&&M({current:ge.current||"1.0.0",latest:ge.latest||"1.0.0",isOutdated:ge.isOutdated||!1})}catch{try{const ye=(await(await fetch("/api/package-info")).json()).betterAuthVersion||"1.0.0",ke="1.5.0";M({current:ye,latest:ke,isOutdated:ye!==ke})}catch{M({current:"1.0.0",latest:"1.5.0",isOutdated:!0})}}})()},[]);const cd=de=>{switch(de){case"critical":return"bg-white/10 text-white border-white/20";case"high":return"bg-white/10 text-white border-white/20";case"medium":return"bg-white/10 text-gray-300 border-white/20";case"low":return"bg-white/10 text-gray-400 border-white/20";default:return"bg-white/10 text-gray-400 border-white/20"}},dd=de=>{switch(de){case"applied":return"bg-white/10 text-white border-white/20";case"scheduled":return"bg-white/10 text-gray-300 border-white/20";case"pending":return"bg-white/10 text-gray-400 border-white/20";default:return"bg-white/10 text-gray-400 border-white/20"}},kf=de=>{f(de),w(!0)},nl=()=>{w(!1),setTimeout(()=>f(null),300)},Er=(de,xe="users")=>{const ge=xe==="users"?De:se,ye={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[de]||7;if(ge&&ge.length>0&&ge.length===ye)return de==="1D"?ge.filter((Ne,be)=>be%4===0).map(Ne=>{const be=parseInt(Ne.replace("h",""),10);return be===0?"12am":be<12?`${be}am`:be===12?"12pm":`${be-12}pm`}):de==="1W"?ge.map(Ne=>Ne.length>3?Ne.substring(0,3):Ne):de==="1M"?ge.map(Ne=>{const be=Ne.split(" ");return be.length>=2?be[1]:Ne}):de==="1Y"||de==="3M"||de==="6M"?ge.map(Ne=>Ne.length>3?Ne.substring(0,3):Ne):ge.map(Ne=>Ne.length>3?Ne.substring(0,3):Ne);const ke=new Date;switch(de){case"1D":return["12am","4am","8am","12pm","4pm","8pm"];case"1W":return Array.from({length:7},(Ne,be)=>new Date(ke.getTime()-(6-be)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"short"}));case"1M":return Array.from({length:30},(Ne,be)=>new Date(ke.getTime()-(29-be)*24*60*60*1e3).getDate().toString());case"3M":return Array.from({length:3},(Ne,be)=>new Date(ke.getFullYear(),ke.getMonth()-(2-be),1).toLocaleDateString("en-US",{month:"short"}));case"6M":return Array.from({length:6},(Ne,be)=>new Date(ke.getFullYear(),ke.getMonth()-(5-be),1).toLocaleDateString("en-US",{month:"short"}));case"1Y":return Array.from({length:12},(Ne,be)=>new Date(ke.getFullYear(),ke.getMonth()-(11-be),1).toLocaleDateString("en-US",{month:"short"}));case"ALL":return Array.from({length:7},(Ne,be)=>new Date(ke.getFullYear(),ke.getMonth()-(6-be),1).toLocaleDateString("en-US",{month:"short"}));default:return["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]}},Mf=(de,xe="users")=>{const ge=xe==="users"?De:se,ye={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[de]||7;if(ge&&ge.length>0&&ge.length===ye)return de==="1D"?ge.map(Ne=>{const be=parseInt(Ne.replace("h",""),10);return be===0?"12am":be<12?`${be}am`:be===12?"12pm":`${be-12}pm`}):de==="1Y"||de==="3M"||de==="6M"?ge.map(Ne=>{const be=["January","February","March","April","May","June","July","August","September","October","November","December"],mn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].indexOf(Ne);return mn!==-1?be[mn]:Ne}):ge;const ke=new Date;switch(de){case"1D":return Array.from({length:24},(Ne,be)=>{const Xe=new Date;return Xe.setHours(be,0,0,0),Xe.toLocaleTimeString("en-US",{hour:"numeric",hour12:!0})});case"1W":return Array.from({length:7},(Ne,be)=>new Date(ke.getTime()-(6-be)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"long"}));case"1M":return Array.from({length:30},(Ne,be)=>{const Xe=new Date(ke.getTime()-(29-be)*24*60*60*1e3),mn=Xe.toLocaleDateString("en-US",{month:"short"}),tn=Xe.getDate();return`${mn} ${tn}`});case"3M":return Array.from({length:3},(Ne,be)=>new Date(ke.getFullYear(),ke.getMonth()-(2-be),1).toLocaleDateString("en-US",{month:"long"}));case"6M":return Array.from({length:6},(Ne,be)=>new Date(ke.getFullYear(),ke.getMonth()-(5-be),1).toLocaleDateString("en-US",{month:"long"}));case"1Y":return Array.from({length:12},(Ne,be)=>new Date(ke.getFullYear(),ke.getMonth()-(11-be),1).toLocaleDateString("en-US",{month:"long"}));case"ALL":return Array.from({length:7},(Ne,be)=>new Date(ke.getFullYear(),ke.getMonth()-(6-be),1).toLocaleDateString("en-US",{month:"long"}));default:return["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}},Tf=(de,xe="users")=>{const ge=xe==="users"?St:Gt,ye={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[de]||7;if(!ge||ge.length===0)return Array(ye).fill(0);const ke=[...ge];for(;ke.length<ye;)ke.push(0);const Ne=ke.slice(0,ye),be=Math.max(...Ne,1);return Ne.map(Xe=>Xe/be*100)},ud=()=>{const de=Je.length>0?Je:Er(u,"users"),xe=de.map((oe,ye)=>Nl.reduce((ke,Ne)=>{var be;return ke+(((be=pe[Ne.id])==null?void 0:be[ye])??0)},0)),ge=Math.max(...xe,1);return a.jsxs("div",{className:"space-y-6 min-h-screen h-full mt-5 flex-1 overflow-y-hidden overflow-x-hidden px-0",children:[a.jsx("div",{className:"px-6 overflow-hidden",children:a.jsxs("div",{className:"flex items-center justify-between gap-8 py-4 px-6 bg-white/5 border border-white/10 rounded-none overflow-x-auto relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(dt,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Users"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Cs?"...":Ma(Ea.users)}),a.jsxs("div",{className:`flex items-center gap-1 ${Ss>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${Ss<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Ss).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(An,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Organizations"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Cs?"...":Ma(Ea.organizations)}),a.jsxs("div",{className:`flex items-center gap-1 ${Qt>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${Qt<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Qt).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(pw,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Sessions"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Cs?"...":Ma(Ea.sessions)}),a.jsxs("div",{className:`flex items-center gap-1 ${Sn>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${Sn<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Sn).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(xw,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Activity Hits"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Cs?"...":Ma(jf??0)}),a.jsxs("div",{className:`flex items-center gap-1 ${Qo>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${Qo<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Qo).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(dt,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"New Users"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Cs?"...":Ma(i??0)}),a.jsxs("div",{className:`flex items-center gap-1 ${el>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${el<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(el).toFixed(1),"%"]})]})]})]})]})}),a.jsxs("div",{className:"px-6 pb-10 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"TOTAL USER"}),a.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","6M","1Y"].map(oe=>a.jsx("button",{onClick:()=>c(oe),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${l===oe?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:oe},oe))})]}),a.jsxs("div",{className:"flex justify-between items-end mb-6",children:[a.jsx("p",{className:"text-4xl text-white font-light",children:Cs?"...":Ma(Ea.users)}),a.jsxs("div",{className:"flex items-center gap-1 px-2 py-1",children:[a.jsx("svg",{className:`w-3 h-3 ${ht>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${ht>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(ht).toFixed(1),"%"]})]})]}),a.jsxs("div",{className:"space-y-2 relative",children:[a.jsxs("div",{className:"h-32 relative",children:[a.jsx("svg",{className:"w-full h-full absolute inset-0",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:a.jsx("defs",{children:a.jsxs("linearGradient",{id:"usersBarGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[a.jsx("stop",{offset:"0%",style:{stopColor:"rgba(255, 255, 255, 0.3)",stopOpacity:1}}),a.jsx("stop",{offset:"100%",style:{stopColor:"rgba(255, 255, 255, 0.05)",stopOpacity:1}})]})})}),a.jsx("div",{className:"h-32 flex items-end justify-between space-x-1 relative z-10",children:Tf(l,"users").map((oe,ye)=>{const ke=_===ye;return a.jsx("div",{className:"flex-1 transition-all duration-200 ease-out relative cursor-pointer group",style:{height:`${oe}%`,background:"url(#usersBarGradient)"},onMouseEnter:Ne=>{const be=Ne.currentTarget.getBoundingClientRect(),Xe=be.left+be.width/2,mn=be.top,tn=150,Da=60,sl=Math.max(tn/2,Math.min(window.innerWidth-tn/2,Xe)),kr=Math.max(Da+10,Math.min(window.innerHeight-10,mn));E(ye),L({x:sl,y:kr})},onMouseLeave:()=>{E(null),L(null)},children:a.jsx("div",{className:"w-full h-full",style:{background:"linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05))",opacity:ke?1:.8}})},ye)})}),_!==null&&D&&a.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${D.x}px`,top:`${D.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:a.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg whitespace-nowrap",children:[a.jsx("div",{className:"text-xs text-gray-400 mb-1 font-mono uppercase",children:Mf(l,"users")[_]}),a.jsxs("div",{className:"text-sm text-white font-sans font-medium",children:[St[_]!==void 0?St[_].toLocaleString():"0"," ",a.jsx("span",{className:"font-mono text-xs text-gray-400",children:"users"})]})]})})]}),a.jsx("div",{className:`flex justify-between ${l==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:Er(l,"users").map((oe,ye)=>a.jsx("span",{className:"flex-1 text-center truncate",children:oe},ye))})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"Activity Hits"}),a.jsx("p",{className:"text-4xl text-white font-light mt-1",children:qe?"...":Ta(od)}),a.jsx("p",{className:"text-xs text-gray-400",children:"Tracked events in selected period"})]}),a.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","1M","3M","6M","1Y","ALL"].map(oe=>a.jsx("button",{onClick:()=>h(oe),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${u===oe?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:oe},oe))})]}),a.jsxs("div",{className:"space-y-2 relative",children:[a.jsx("div",{className:"h-40 flex items-end gap-1",children:de.map((oe,ye)=>{const ke=xe[ye]||0;return a.jsx("div",{className:"flex-1 flex flex-col justify-end gap-[1px] h-full cursor-pointer",onMouseEnter:Ne=>Ef(Ne,ye),onMouseLeave:()=>{R(null),q(null)},children:Nl.map(Ne=>{var mn;const be=((mn=pe[Ne.id])==null?void 0:mn[ye])??0,Xe=ke===0||ge===0?0:Math.max(be/ge*100,be>0?4:0);return a.jsx("div",{className:`w-full ${Ne.barClass}`,style:{height:`${Xe}%`}},`${Ne.id}-${ye}`)})},`${oe}-${ye}`)})}),qe&&a.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm flex items-center justify-center text-xs uppercase text-gray-400 pointer-events-none",children:"Loading activity..."}),W!==null&&H&&a.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${H.x}px`,top:`${H.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:a.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg min-w-[180px]",children:[a.jsx("div",{className:"text-xs text-gray-400 mb-2 font-mono uppercase",children:de[W]||`Bucket ${W+1}`}),a.jsx("div",{className:"space-y-1",children:Nl.map(oe=>{var ye;return a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[a.jsx("span",{className:`w-2 h-2 rounded-sm ${oe.dotClass}`}),oe.label]}),a.jsx("span",{className:"text-white font-medium",children:((ye=pe[oe.id])==null?void 0:ye[W])??0})]},oe.id)})})]})}),a.jsx("div",{className:`flex justify-between ${u==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:de.map((oe,ye)=>a.jsx("span",{className:"flex-1 text-center truncate",children:oe},ye))}),a.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-3 mt-4 pt-4 border-t border-white/10",children:Nl.map(oe=>a.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`w-2 h-2 rounded-sm ${oe.dotClass}`}),oe.label]}),a.jsx("span",{className:"text-white font-medium",children:qe?"...":Ta(tl[oe.id]||0)})]},oe.id))})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"space-y-4 overflow-x-hidden",children:[a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>T(!C),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(Wd,{className:"w-3 h-3"}),a.jsx("span",{children:v})]}),C&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Si.map(oe=>a.jsx("button",{onClick:()=>{N(oe),T(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:oe},oe))})]}),v==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),X?Zn(X,"MMM dd yyyy"):"From"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:X,onSelect:ne,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),ae?Zn(ae,"MMM dd yyyy"):"To"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:ae,onSelect:J,initialFocus:!0,disabled:oe=>X?oe<X:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Active Users"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Users with active session in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:Ta(s)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 border-white/5 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${Re>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${Re>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(Re).toFixed(1),"%"]})]})})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>P(!A),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(Wd,{className:"w-3 h-3"}),a.jsx("span",{children:g})]}),A&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Si.map(oe=>a.jsx("button",{onClick:()=>{b(oe),P(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:oe},oe))})]}),g==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),$?Zn($,"MMM dd yyyy"):"From"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:$,onSelect:te,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),K?Zn(K,"MMM dd yyyy"):"To"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:K,onSelect:B,initialFocus:!0,disabled:oe=>$?oe<$:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"New Users"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Newly registered Users in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:Ta(ad)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${Ni>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",style:Ni<0?{transform:"rotate(180deg)"}:{},children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${Ni>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(Ni).toFixed(1),"%"]})]})})]})]})]}),a.jsxs("div",{className:"space-y-4 overflow-x-hidden",children:[a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>O(!U),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(Wd,{className:"w-3 h-3"}),a.jsx("span",{children:p})]}),U&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Si.map(oe=>a.jsx("button",{onClick:()=>{y(oe),O(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:oe},oe))})]}),p==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),G?Zn(G,"MMM dd yyyy"):"From"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:G,onSelect:re,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),ce?Zn(ce,"MMM dd yyyy"):"To"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:ce,onSelect:ue,initialFocus:!0,disabled:oe=>G?oe<G:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Organizations"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total organizations in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:Ce?"...":Ta(Ae)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${le>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${le>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(le).toFixed(1),"%"]})]})})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>k(!V),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(Wd,{className:"w-3 h-3"}),a.jsx("span",{children:j})]}),V&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Si.map(oe=>a.jsx("button",{onClick:()=>{S(oe),k(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:oe},oe))})]}),j==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),ve?Zn(ve,"MMM dd yyyy"):"From"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:ve,onSelect:ze,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),_e?Zn(_e,"MMM dd yyyy"):"To"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:_e,onSelect:Mt,initialFocus:!0,disabled:oe=>ve?oe<ve:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Teams"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total teams in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:Z?"...":Ta(we)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${he>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${he>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(he).toFixed(1),"%"]})]})})]})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pt-4 overflow-hidden relative rounded-none flex flex-col",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(kn,{className:"w-4 h-4 text-white/60"}),a.jsx("h4",{className:"text-xs text-gray-400 uppercase font-mono font-light",children:"Security Insights"})]})}),a.jsx("hr",{className:"-mx-10 -mt-1 border-white/10"}),a.jsxs("div",{className:"space-y-3 overflow-y-auto custom-scrollbar max-h-[400px]",children:[ld.length===0&&a.jsx("div",{className:"text-sm flex items-center justify-center text-gray-400",children:a.jsxs("div",{className:"flex mt-5 items-center justify-center",children:[a.jsx(kn,{className:"w-4 h-4 text-gray-400 mr-2"}),a.jsx("p",{className:"text-center",children:"No security insights found"})]})}),ld.map((oe,ye)=>a.jsx("div",{onClick:()=>kf(oe),className:"group py-2 border-b border-white/5 cursor-pointer transition-all duration-200 hover:border-white/20",style:{animation:`slideIn 0.3s ease-out ${ye*.1}s both`},children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"flex items-center gap-2 mb-1.5",children:a.jsx("span",{className:"text-sm text-white/90 font-light truncate group-hover:text-white transition-colors",children:oe.title})}),a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm uppercase font-mono ${cd(oe.severity)}`,children:oe.severity}),a.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm capitalize font-mono ${dd(oe.status)}`,children:oe.status})]})]}),a.jsx(Gz,{className:"w-3.5 h-3.5 text-gray-500 group-hover:text-white transition-all flex-shrink-0 mt-0.5"})]})},oe.id))]})]})]})]})]})};return a.jsxs("div",{className:"h-screen bg-black text-white overflow-hidden flex flex-col",style:{overflowX:"hidden"},children:[a.jsx("div",{className:"flex-1 overflow-hidden",children:e==="overview"?ud():e==="users"?a.jsx(QC,{}):e==="organizations"?a.jsx(ZC,{}):ud()}),t&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-3xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(pw,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-lg text-white font-light",children:"Quick Actions"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("button",{onClick:()=>{n(!1),ka("/users")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(dt,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"View All Users"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Manage user accounts"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),ka("/organizations")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(An,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"View Organizations"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Manage organizations"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),ka("/sessions")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(xw,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"View Sessions"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Monitor active sessions"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),ka("/database")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(fa,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"Database Schema"}),a.jsx("p",{className:"text-sm text-gray-400",children:"View schema visualizer"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),ka("/settings")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(YC,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"Settings"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Configure system"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),ka("/users")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(HC,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"Search Users"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Find specific users"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]})]}),a.jsx("div",{className:"mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-400",children:[a.jsx("span",{children:"Tip: Press Ctrl+K or Cmd+K for command palette"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:"Close"})]})})]})}),x&&d&&a.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-50 flex items-center justify-center p-4",style:{animation:"fadeIn 0.3s ease-out"},onClick:nl,children:a.jsxs("div",{className:"bg-black border border-white/20 rounded-none max-w-2xl w-full max-h-[80vh] overflow-y-auto",style:{animation:"slideUp 0.3s ease-out"},onClick:de=>de.stopPropagation(),children:[a.jsx("div",{className:"sticky top-0 bg-black border-b border-white/10 p-6 z-10",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx(kn,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light",children:d.title})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsxs("span",{className:`text-xs px-2 py-1 border rounded-none uppercase font-medium ${cd(d.severity)}`,children:[d.severity," Severity"]}),a.jsx("span",{className:`text-xs px-2 py-1 border rounded-none capitalize ${dd(d.status)}`,children:d.status}),d.cve&&a.jsx("span",{className:"text-xs text-gray-400 font-mono bg-white/5 px-2 py-1 border border-white/10 rounded-none",children:d.cve})]})]}),a.jsx("button",{onClick:nl,className:"p-2 hover:bg-white/10 transition-colors rounded-none",children:a.jsx(an,{className:"w-5 h-5 text-gray-400 hover:text-white"})})]})}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Release Date"}),a.jsx("p",{className:"text-white",children:new Date(d.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Description"}),d.description.includes("npm install")?a.jsxs("div",{children:[a.jsx("p",{className:"text-white leading-relaxed mb-3",children:d.description.split("Run:")[0]}),a.jsx("div",{className:"relative group",children:a.jsx("div",{className:"bg-black border border-white/20 rounded-none p-3 font-mono text-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("code",{children:[a.jsx("span",{className:"text-green-400",children:"$"})," ",a.jsx("span",{className:"text-cyan-400",children:"npm"})," ",a.jsx("span",{className:"text-yellow-400",children:"install"})," ",a.jsx("span",{className:"text-white",children:"better-auth@latest"})]}),a.jsx("button",{onClick:()=>{navigator.clipboard.writeText("npm install better-auth@latest"),Y.success("Command copied to clipboard")},className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 hover:bg-white/10 rounded",title:"Copy command",children:a.jsx(Eg,{className:"w-4 h-4 text-gray-400 hover:text-white"})})]})})})]}):a.jsx("p",{className:"text-white leading-relaxed",children:d.description})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-3",children:"Affected Components"}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:d.affectedComponents.map((de,xe)=>a.jsxs("div",{className:"flex items-center gap-2 p-3 bg-white/5 border border-white/10 rounded-none",style:{animation:`slideIn 0.3s ease-out ${xe*.1}s both`},children:[a.jsx("div",{className:"w-2 h-2 bg-white rounded-none flex-shrink-0"}),a.jsx("span",{className:"text-sm text-white",children:de})]},xe))})]}),a.jsx("div",{className:"p-4 bg-white/5 border border-white/10 rounded-none",children:a.jsxs("div",{className:"flex items-start gap-3",children:[d.status==="applied"&&a.jsxs(a.Fragment,{children:[a.jsx(j0,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Patch Applied"}),a.jsx("p",{className:"text-xs text-gray-400",children:"This security patch has been successfully applied to your system."})]})]}),d.status==="scheduled"&&a.jsxs(a.Fragment,{children:[a.jsx(VC,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Scheduled"}),a.jsx("p",{className:"text-xs text-gray-400",children:"This patch is scheduled for deployment in the next maintenance window."})]})]}),d.status==="pending"&&a.jsxs(a.Fragment,{children:[a.jsx(kH,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Action Required"}),a.jsx("p",{className:"text-xs text-gray-400",children:"This patch is pending review and requires manual approval before deployment."})]})]})]})}),a.jsx("div",{className:"flex items-center justify-end gap-3 pt-4 border-t border-white/10",children:a.jsx(F,{variant:"ghost",onClick:nl,className:"text-gray-400 hover:text-white rounded-none",children:"Close"})})]})]})}),a.jsx("style",{children:`
|
|
445
|
-
@keyframes fadeIn {
|
|
446
|
-
from {
|
|
447
|
-
opacity: 0;
|
|
448
|
-
}
|
|
449
|
-
to {
|
|
450
|
-
opacity: 1;
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
@keyframes slideUp {
|
|
455
|
-
from {
|
|
456
|
-
opacity: 0;
|
|
457
|
-
transform: translateY(20px);
|
|
458
|
-
}
|
|
459
|
-
to {
|
|
460
|
-
opacity: 1;
|
|
461
|
-
transform: translateY(0);
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
@keyframes slideIn {
|
|
466
|
-
from {
|
|
467
|
-
opacity: 0;
|
|
468
|
-
transform: translateX(-10px);
|
|
469
|
-
}
|
|
470
|
-
to {
|
|
471
|
-
opacity: 1;
|
|
472
|
-
transform: translateX(0);
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
.custom-scrollbar::-webkit-scrollbar {
|
|
477
|
-
width: 6px;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
.custom-scrollbar::-webkit-scrollbar-track {
|
|
481
|
-
background: rgba(255, 255, 255, 0.05);
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
.custom-scrollbar::-webkit-scrollbar-thumb {
|
|
485
|
-
background: rgba(255, 255, 255, 0.2);
|
|
486
|
-
border-radius: 3px;
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
|
|
490
|
-
background: rgba(255, 255, 255, 0.3);
|
|
491
|
-
}
|
|
492
|
-
`})]})}const In=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Me("rounded-lg border border-gray-700 bg-gray-900 text-white shadow-sm",e),...t}));In.displayName="Card";const Wn=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Wn.displayName="CardHeader";const qn=m.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:Me("text-2xl font-semibold leading-none tracking-tight text-white",e),...t}));qn.displayName="CardTitle";const Ts=m.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:Me("text-sm text-gray-300",e),...t}));Ts.displayName="CardDescription";const Xn=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));Xn.displayName="CardContent";const GH=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));GH.displayName="CardFooter";const ZH={databaseSchemaNode:yg},Cw=[{name:"organization",displayName:"Organization",description:"Multi-tenant organization support",color:"bg-blue-500"},{name:"teams",displayName:"Teams",description:"Team management within organizations",color:"bg-green-500"},{name:"twoFactor",displayName:"Two Factor",description:"Two-factor authentication support",color:"bg-purple-500"},{name:"apiKey",displayName:"API Key",description:"API key authentication",color:"bg-orange-500"},{name:"passkey",displayName:"Passkey",description:"WebAuthn passkey support",color:"bg-pink-500"}];function QH(){const[e,t]=m.useState(null),[n,s]=m.useState(!0),[r,i]=m.useState(null),[o,l]=m.useState([]),[c,u]=m.useState([]),[h,d,f]=gz([]),[x,w,v]=pz([]),N=m.useCallback(S=>{const C=Cw.find(T=>T.name===S);return(C==null?void 0:C.color)||"bg-gray-500"},[]),g=m.useCallback((S,C,T)=>{if(S==="user"||S==="session"||S==="account"||S==="verification")return"core";for(const A of T)if(S===A||S.includes(A))return A;return"core"},[]),b=m.useCallback(async()=>{try{const C=await(await fetch("/api/plugins")).json();if(C.plugins&&Array.isArray(C.plugins)){const T=C.plugins.map(A=>({name:A.id,displayName:A.name||A.id,description:A.description||`${A.id} plugin for Better Auth`,color:N(A.id)}));u(T),l(T.map(A=>A.name))}}catch{u(Cw),l(["organization"])}},[N]),p=m.useCallback(async S=>{try{s(!0);const C=S.length>0?`?plugins=${S.join(",")}`:"",A=await(await fetch(`/api/database/schema${C}`)).json();A.success?t(A.schema):i(A.error||"Failed to fetch schema")}catch{i("Failed to fetch database schema")}finally{s(!1)}},[]);m.useEffect(()=>{b()},[b]),m.useEffect(()=>{o.length>0&&p(o)},[o,p]),m.useEffect(()=>{if(!e)return;const S=[],C=[];e.tables.forEach((T,A)=>{const P=T.fields.map(U=>({id:`${T.name}-${U.name}`,isPrimary:U.primaryKey||!1,isNullable:!U.required,isUnique:U.unique||!1,isIdentity:!1,name:U.name,format:U.type,plugin:g(T.name,U.name,o)}));S.push({id:T.name,type:"databaseSchemaNode",position:{x:A%3*380,y:Math.floor(A/3)*320},data:{name:T.name,displayName:T.displayName,isForeign:!1,plugin:g(T.name,"",o),columns:P.map(U=>{var O;return{...U,description:((O=T.fields.find(V=>V.name===U.name))==null?void 0:O.description)||""}}),relationships:T.relationships}})}),e.tables.forEach(T=>{T.relationships.forEach(A=>{if(A.type==="many-to-one")return;const P=T.name,U=A.target,O=S.find(k=>k.id===P),V=S.find(k=>k.id===U);if(O&&V){const k=A.type==="one-to-one"?"1:1":"1:N";C.push({id:`${P}-${U}-${A.field}`,source:P,target:U,type:"smoothstep",animated:!1,style:{stroke:"#6b7280",strokeWidth:2,strokeDasharray:"0"},label:k,labelStyle:{fontSize:"11px",fill:"#9ca3af",fontWeight:"500"},labelBgStyle:{fill:"rgba(0, 0, 0, 0.9)",fillOpacity:1,borderRadius:4},markerEnd:{type:"arrowclosed",color:"#6b7280",width:12,height:12}})}})}),d(S),w(C)},[e,o,d,w,g]);const y=m.useCallback(S=>w(C=>T2(S,C)),[w]);if(n)return a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"animate-pulse",children:[a.jsx("div",{className:"h-8 bg-gray-700 rounded w-1/3 mb-6"}),a.jsx("div",{className:"h-96 bg-gray-700 rounded"})]}),a.jsx("div",{className:"text-center text-gray-500 dark:text-gray-400 mt-4",children:"Loading plugins and schema..."})]});if(r)return a.jsx("div",{className:"p-6",children:a.jsxs("div",{className:"bg-red-900/20 border border-red-500/20 rounded-none p-6",children:[a.jsx("h2",{className:"text-xl font-semibold text-red-400 mb-2",children:"Error Loading Schema"}),a.jsx("p",{className:"text-gray-300",children:r})]})});const j=a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-1",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(yt,{className:"w-6 h-6 text-white"}),a.jsx("h1",{className:"text-2xl font-light text-white",children:"Schema Visualizer"})]})}),a.jsx("p",{className:"text-gray-400",children:"Visualize your Better Auth database schema with interactive tables and relationships."})]}),a.jsxs("div",{className:"flex-1 grid grid-cols-4 gap-6",children:[a.jsxs("div",{className:"col-span-1",children:[a.jsxs(In,{className:"rounded-none bg-black h-fit shadow-sm",children:[a.jsx(Wn,{children:a.jsxs(qn,{className:"font-light text-xl text-white flex items-center space-x-2",children:[a.jsx(co,{className:"w-5 h-5"}),a.jsx("span",{children:"Plugins"})]})}),a.jsx(Xn,{className:"space-y-3",children:c.length>0?c.map(S=>a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:`w-3 h-3 rounded-full ${S.color}`}),a.jsx("label",{htmlFor:S.name,className:"text-sm font-medium text-white cursor-pointer",children:S.displayName.slice(0,1).toUpperCase()+S.displayName.slice(1).replace("-"," ")})]},S.name)):a.jsx("div",{className:"text-sm text-white/70",children:"No plugins detected in configuration"})})]}),e&&a.jsxs(In,{className:"rounded-none bg-black mt-4 shadow-sm",children:[a.jsx(Wn,{children:a.jsx(qn,{className:"text-white text-sm",children:"Schema Info"})}),a.jsxs(Xn,{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-white/70",children:"Tables:"}),a.jsx("span",{className:"text-white",children:e.tables.length})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-white/70",children:"Relationships:"}),a.jsx("span",{className:"text-white",children:e.tables.reduce((S,C)=>S+C.relationships.length,0)})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-white/70",children:"Available Plugins:"}),a.jsx("span",{className:"text-white",children:c.length})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-white/70",children:"Selected Plugins:"}),a.jsx("span",{className:"text-white",children:o.length})]})]})]})]}),a.jsx("div",{className:"col-span-3",children:a.jsx("div",{className:"h-full bg-black border border-gray-700 rounded-lg overflow-hidden shadow-xl",children:a.jsxs(xz,{nodes:h,edges:x,onNodesChange:f,onEdgesChange:v,onConnect:y,nodeTypes:ZH,fitView:!0,fitViewOptions:{padding:.1,includeHiddenNodes:!1},className:"bg-black",connectionLineType:"smoothstep",defaultEdgeOptions:{style:{stroke:"#6b7280",strokeWidth:2},animated:!1,type:"smoothstep"},nodesDraggable:!0,nodesConnectable:!1,elementsSelectable:!0,children:[a.jsx(Tz,{className:"bg-gray-900 border-gray-700 [&>button]:bg-gray-800 [&>button]:border-gray-600 [&>button]:text-white [&>button:hover]:bg-gray-700"}),a.jsx(Vz,{className:"bg-gray-900 border-gray-700",nodeColor:S=>{var C;return(C=S.data)!=null&&C.isForeign?"#374151":"#1f2937"},maskColor:"rgba(0, 0, 0, 0.9)"}),a.jsx(Nz,{variant:ga.Dots,gap:20,size:1,color:"#374151"})]})})})]})]});return a.jsxs("div",{className:"overflow-hidden p-6 h-[90vh] flex flex-col opacity-70 bg-black relative",children:[a.jsxs("div",{className:"absolute inset-0 z-50 flex items-center justify-center pointer-events-none",children:[a.jsx("div",{className:"absolute inset-0 backdrop-blur-sm",style:{WebkitBackdropFilter:"blur(8px)",backdropFilter:"blur(8px)"}}),a.jsxs("div",{className:"relative -mt-6 bg-black/50 border border-dashed border-white/20 rounded-none p-12 max-w-2xl mx-6 text-center pointer-events-auto",children:[a.jsx("div",{className:"flex items-center justify-center mb-4",children:a.jsxs("div",{className:"relative",children:[a.jsx(yt,{className:"w-16 h-16 text-white opacity-50"}),a.jsx(iR,{className:"w-8 h-8 text-white opacity-80 absolute -top-2 -right-2 animate-pulse"})]})}),a.jsx("h2",{className:"text-3xl font-mono uppercase font-light text-white mb-3",children:"Coming Soon"}),a.jsx("p",{className:"text-lg text-gray-300 font-light mb-6 leading-relaxed",children:"We will be having this feature soon. This feature will allow you to explore your Better Auth database structure with beautiful, interactive graphs showing all tables, relationships, and data flow."}),a.jsxs("div",{className:"flex items-center justify-center space-x-6 text-sm text-gray-400",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),a.jsx("span",{children:"Interactive Tables"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),a.jsx("span",{children:"Relationship Mapping"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-2 h-2 bg-purple-500 rounded-full"}),a.jsx("span",{children:"Real-time Updates"})]})]})]})]}),a.jsx("div",{className:"blur-sm opacity-50 pointer-events-none",children:j})]})}const KH=nC("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-white text-black hover:bg-white",secondary:"border-transparent bg-gray-800 text-white hover:bg-gray-800 border border-gray-600",destructive:"border-transparent bg-red-500 text-white hover:bg-red-600",outline:"text-gray-300 border-gray-600",success:"border-transparent bg-green-900 text-green-300",warning:"border-transparent bg-yellow-900 text-yellow-300",error:"border-transparent bg-red-900 text-red-300",info:"border-transparent bg-gray-800 text-white border border-gray-600"}},defaultVariants:{variant:"default"}});function gt({className:e,variant:t,...n}){return a.jsx("div",{className:Me(KH({variant:t}),e),...n})}function JH(){const{orgId:e}=_p(),t=ws(),[n,s]=m.useState(null),[r,i]=m.useState([]),[o,l]=m.useState([]),[c,u]=m.useState([]),[h,d]=m.useState(!0),[f,x]=m.useState("details"),[w,v]=m.useState(!1),[N,g]=m.useState(!1),[b,p]=m.useState(!1),[y,j]=m.useState(!1),[S,C]=m.useState(!1),[T,A]=m.useState(!1),[P,U]=m.useState(!1),[O,V]=m.useState(!1),[k,z]=m.useState(!1),[M,_]=m.useState(null),[E,D]=m.useState({name:"",slug:""}),[L,W]=m.useState(""),[R,H]=m.useState(""),[q,X]=m.useState([]),[ne,ae]=m.useState({name:""}),[J,$]=m.useState(!1),[te,K]=m.useState([]),[B,G]=m.useState(!1),[re,ce]=m.useState([]),[ue,ve]=m.useState(!1);m.useEffect(()=>{e&&(_e(),St(),Mt(),De(),nt(),Le())},[e]),m.useEffect(()=>{w&&e&&Le()},[]),m.useEffect(()=>{f==="members"&&e&&nt()},[f,e]),m.useEffect(()=>{f==="invitations"&&e&&De()},[f,e]);const ze=Z=>{ae({name:Z})},_e=async()=>{try{const ee=await(await fetch(`/api/organizations/${e}`)).json();ee.success&&ee.organization||ee.organization?s(ee.organization):Y.error("Organization not found")}catch(Z){console.error("Failed to fetch organization:",Z),Y.error("Failed to load organization")}finally{d(!1)}},Mt=async()=>{try{const ee=await(await fetch("/api/plugins/teams/status")).json();v(ee.enabled)}catch(Z){console.error("Failed to check teams status:",Z),v(!1)}},St=async()=>{try{const ee=await(await fetch("/api/plugins/organization/status")).json();g(ee.enabled)}catch(Z){console.error("Failed to check organization status:",Z),g(!1)}},Le=async()=>{try{const ee=await(await fetch(`/api/organizations/${e}/teams`)).json();ee.success&&i(ee.teams||[])}catch(Z){console.error("Failed to fetch teams:",Z),Y.error("Failed to load teams")}},De=async()=>{try{const ee=await(await fetch(`/api/organizations/${e}/invitations`)).json();ee.success&&l(ee.invitations||[])}catch(Z){console.error("Failed to fetch invitations:",Z),Y.error("Failed to load invitations")}},nt=async()=>{try{const ee=await(await fetch(`/api/organizations/${e}/members`)).json();ee.success&&u(ee.members||[])}catch(Z){console.error("Failed to fetch members:",Z),Y.error("Failed to load members")}},ht=async Z=>{K([]),G(!0),K([{id:"start",type:"info",message:`Starting member seeding process for ${Z} members...`,timestamp:new Date}]);try{const pe=await(await fetch(`/api/organizations/${e}/seed-members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:Z})})).json();if(pe.success){const He=pe.results.map((Qe,qe)=>Qe.success?{id:`member-${qe}`,type:"progress",message:`Adding member: ${Qe.member.user.name} (${Qe.member.user.email})`,timestamp:new Date,status:"completed"}:{id:`member-${qe}`,type:"error",message:`Failed to add member ${qe+1}: ${Qe.error}`,timestamp:new Date});K(Qe=>[...Qe,...He]);const Je=pe.results.filter(Qe=>Qe.success).length;K(Qe=>[...Qe,{id:"complete",type:"success",message:`✅ Seeding completed! Added ${Je}/${Z} members successfully`,timestamp:new Date}]),await nt(),Y.success(`Successfully added ${Je} members!`)}else K(He=>[...He,{id:"error",type:"error",message:`❌ Seeding failed: ${pe.error||"Unknown error"}`,timestamp:new Date}]),Y.error(pe.error||"Failed to seed members")}catch(ee){K(pe=>[...pe,{id:"error",type:"error",message:`❌ Network error: ${ee}`,timestamp:new Date}]),Y.error("Failed to seed members")}finally{G(!1)}},vt=async Z=>{ce([]),ve(!0),ce([{id:"start",type:"info",message:`Starting team seeding process for ${Z} teams...`,timestamp:new Date}]);try{const pe=await(await fetch(`/api/organizations/${e}/seed-teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:Z})})).json();if(pe.success){const He=pe.results.map((Qe,qe)=>Qe.success?{id:`team-${qe}`,type:"progress",message:`Creating team: ${Qe.team.name}`,timestamp:new Date,status:"completed"}:{id:`team-${qe}`,type:"error",message:`Failed to create team ${qe+1}: ${Qe.error}`,timestamp:new Date});ce(Qe=>[...Qe,...He]);const Je=pe.results.filter(Qe=>Qe.success).length;ce(Qe=>[...Qe,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${Je}/${Z} teams successfully`,timestamp:new Date}]),await Le(),Y.success(`Successfully created ${Je} teams!`)}else ce(He=>[...He,{id:"error",type:"error",message:`❌ Seeding failed: ${pe.error||"Unknown error"}`,timestamp:new Date}]),Y.error(pe.error||"Failed to seed teams")}catch(ee){ce(pe=>[...pe,{id:"error",type:"error",message:`❌ Network error: ${ee}`,timestamp:new Date}]),Y.error("Failed to seed teams")}finally{ve(!1)}},Gt=async()=>{try{const ee=await(await fetch("/api/users/all")).json();ee.success&&X(ee.users||[])}catch(Z){console.error("Failed to fetch users:",Z)}},Yt=Z=>Z.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),se=()=>{n&&(D({name:n.name,slug:n.slug}),z(!0))},fe=Z=>{const ee=Yt(Z);D({name:Z,slug:ee})},Re=Z=>{D(ee=>({...ee,slug:Yt(Z)}))},I=async()=>{if(!n){Y.error("No organization selected");return}if(!E.name){Y.error("Please fill in the organization name");return}const Z=Y.loading("Updating organization...");try{const pe=await(await fetch(`/api/organizations/${n.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E.name,slug:E.slug})})).json();pe.success?(await _e(),z(!1),D({name:"",slug:""}),Y.success("Organization updated successfully!",{id:Z})):Y.error(`Error updating organization: ${pe.error||"Unknown error"}`,{id:Z})}catch(ee){console.error("Error updating organization:",ee),Y.error("Error updating organization",{id:Z})}},le=()=>{Gt(),p(!0)},me=async()=>{if(!L){Y.error("Please enter an email address");return}if(!R){Y.error("Please select an inviter");return}$(!0);const Z=Y.loading("Sending invitation...");try{const pe=await(await fetch(`/api/organizations/${e}/invitations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:L,role:"member",inviterId:R})})).json();pe.success?(await De(),p(!1),W(""),H(""),Y.success("Invitation sent successfully!",{id:Z})):Y.error(`Error sending invitation: ${pe.error||"Unknown error"}`,{id:Z})}catch(ee){console.error("Error sending invitation:",ee),Y.error("Error sending invitation",{id:Z})}finally{$(!1)}},he=async Z=>{const ee=Y.loading("Cancelling invitation...");try{const He=await(await fetch(`/api/invitations/${Z}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();He.success?(await De(),Y.success("Invitation cancelled successfully!",{id:ee})):Y.error(`Error cancelling invitation: ${He.error||"Unknown error"}`,{id:ee})}catch(pe){console.error("Error cancelling invitation:",pe),Y.error("Error cancelling invitation",{id:ee})}},Ue=async(Z,ee)=>{const pe=Y.loading("Resending invitation...");try{const Je=await(await fetch(`/api/invitations/${Z}/resend`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();Je.success?(await De(),Y.success(`Invitation resent to ${ee}!`,{id:pe})):Y.error(`Error resending invitation: ${Je.error||"Unknown error"}`,{id:pe})}catch(He){console.error("Error resending invitation:",He),Y.error("Error resending invitation",{id:pe})}},Ae=async(Z,ee)=>{const pe=Y.loading(`Removing ${ee}...`);try{const Je=await(await fetch(`/api/members/${Z}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();Je.success?(await nt(),Y.success(`${ee} removed from organization!`,{id:pe})):Y.error(`Error removing member: ${Je.error||"Unknown error"}`,{id:pe})}catch(He){console.error("Error removing member:",He),Y.error("Error removing member",{id:pe})}},Oe=async()=>{if(!ne.name){Y.error("Please enter a team name");return}const Z=Y.loading("Creating team...");try{const pe=await(await fetch(`/api/organizations/${e}/teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ne.name,organizationId:e})})).json();pe.success?(await Le(),A(!1),ae({name:""}),Y.success("Team created successfully!",{id:Z})):Y.error(`Error creating team: ${pe.error||"Unknown error"}`,{id:Z})}catch(ee){console.error("Error creating team:",ee),Y.error("Error creating team",{id:Z})}},we=async()=>{if(!M||!ne.name){Y.error("Please enter a team name");return}const Z=Y.loading("Updating team...");try{const pe=await(await fetch(`/api/teams/${M.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ne.name})})).json();pe.success?(await Le(),U(!1),_(null),ae({name:""}),Y.success("Team updated successfully!",{id:Z})):Y.error(`Error updating team: ${pe.error||"Unknown error"}`,{id:Z})}catch(ee){console.error("Error updating team:",ee),Y.error("Error updating team",{id:Z})}},Be=async()=>{if(!M){Y.error("No team selected");return}const Z=Y.loading("Deleting team...");try{const pe=await(await fetch(`/api/teams/${M.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();pe.success?(await Le(),V(!1),_(null),Y.success("Team deleted successfully!",{id:Z})):Y.error(`Error deleting team: ${pe.error||"Unknown error"}`,{id:Z})}catch(ee){console.error("Error deleting team:",ee),Y.error("Error deleting team",{id:Z})}},Ce=Z=>{_(Z),ae({name:Z.name}),U(!0)},We=Z=>{_(Z),V(!0)};return h?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(Pr,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading organization details..."})]})}):n?a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>t("/organizations"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["orgs /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:e})]})})}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{onClick:()=>j(!0),className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[a.jsx(dt,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),a.jsxs(F,{onClick:le,className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[a.jsx(sa,{className:"w-4 h-4 mr-2"}),"Invite User"]}),a.jsxs(F,{onClick:se,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(ii,{className:"w-4 h-4 mr-2"}),"Edit Organization"]})]})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(An,{className:"w-6 h-6 text-white"})}),a.jsx("div",{children:a.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[n.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:n.slug}),a.jsx("span",{className:"ml-1",children:"]"})]})]})})]}),a.jsx("div",{className:"border-b border-white/10",children:a.jsxs("nav",{className:"flex space-x-8",children:[a.jsxs("button",{onClick:()=>x("details"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(An,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Details",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:0,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),a.jsxs("button",{onClick:()=>x("members"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(dt,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Members",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:c.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),a.jsxs("button",{onClick:()=>x("invitations"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="invitations"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(sa,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Invitations",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:o.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),a.jsxs("button",{onClick:()=>x("teams"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="teams"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(dt,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Teams",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:r.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),f==="details"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[a.jsx("h3",{className:"text-lg text-white font-light mb-4",children:"Organization Information"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),a.jsx("p",{className:"text-white font-sans mt-1",children:n.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Slug"}),a.jsx("p",{className:"text-white font-mono mt-1",children:n.slug})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),a.jsx("p",{className:"text-white font-sans mt-1",children:new Date(n.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(dt,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:c.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(dt,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Teams"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(sa,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:o.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Invitations"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ls,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:Math.ceil((new Date().getTime()-new Date(n.createdAt).getTime())/(1e3*60*60*24))}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})})]})]}),f==="teams"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Teams",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:r.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-xs font-light",children:"Manage teams within this organization"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{onClick:()=>C(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(fa,{className:"w-4 h-4 mr-2"}),"Seed Teams"]}),a.jsxs(F,{onClick:()=>A(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Xl,{className:"w-4 h-4 mr-2"}),"Create Team"]})]})]}),w?r.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Team"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Members"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:r.map(Z=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>t(`/organizations/${e}/teams/${Z.id}`),children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(dt,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:Z.name}),a.jsx(Rn,{id:Z.id,label:"Team ID"})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:Z.memberCount||0}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(Z.createdAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:ee=>{ee.stopPropagation(),Ce(Z)},children:[a.jsx(ii,{className:"w-4 h-4 mr-1"}),"Edit"]}),a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:ee=>{ee.stopPropagation(),We(Z)},children:[a.jsx(bu,{className:"w-4 h-4 mr-1"}),"Delete"]})]})})]},Z.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(dt,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Teams Yet"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Create your first team to start organizing members within this organization."}),a.jsxs(F,{onClick:()=>A(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Xl,{className:"w-4 h-4 mr-2"}),"Create First Team"]})]})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx(dt,{className:"w-12 h-12 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Teams Feature Required"}),a.jsx("p",{className:"text-gray-300 mb-6",children:"To use Teams in Better Auth Studio, you need to enable the teams feature in your organization plugin configuration."}),a.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[a.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),a.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:a.jsx("li",{children:"Update your auth configuration file to enable teams:"})}),a.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:a.jsxs("pre",{className:"text-sm text-gray-300",children:[a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"export const"})," ",a.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",a.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",a.jsx("br",{}),a.jsx("span",{className:"text-yellow-300 pl-12",children:"organization"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-16",children:"teams"}),": ","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-yellow-300 pl-20",children:"enabled"}),":"," ",a.jsx("span",{className:"text-blue-400",children:"true"})," ",a.jsx("br",{}),a.jsx("span",{className:"pl-16",children:"}"})," ",a.jsx("br",{}),a.jsx("span",{className:"pl-12",children:"})"})," ",a.jsx("br",{}),a.jsx("span",{className:"pl-10",children:"]"})," ",a.jsx("br",{}),"}",") ",a.jsx("br",{})]})}),a.jsx("div",{className:"mt-4",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"2. Run migrations to create the teams table"})}),a.jsx("div",{className:"mt-2",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),a.jsx(F,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),a.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",a.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]}),f==="members"&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Members",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:c.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage organization members and their roles"})]})}),c.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:c.map(Z=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:Z.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${Z.user.id}`,alt:Z.user.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:Z.user.name}),a.jsx(Rn,{id:Z.user.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:Z.user.email}),a.jsx("td",{className:"py-4 px-4",children:a.jsx(gt,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed rounded-none border-blue-500/30 text-blue-400/70 capitalize",children:Z.role})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(Z.joinedAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsx("div",{className:"flex items-center justify-end space-x-2",children:a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>Ae(Z.id,Z.user.name),children:[a.jsx(bu,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},Z.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(dt,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Invite users or seed members from existing users to get started."}),a.jsxs("div",{className:"flex items-center justify-center space-x-3",children:[a.jsxs(F,{onClick:()=>j(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(dt,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),a.jsxs(F,{onClick:le,className:"bg-white text-white hover:bg-white/90 bg-transparent border border-white/20 rounded-none",children:[a.jsx(sa,{className:"w-4 h-4 mr-2"}),"Invite User"]})]})]})})]}),f==="invitations"&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Invitations",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:o.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage pending invitations to this organization"})]})}),o.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:o.map(Z=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(sa,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:Z.email}),a.jsxs("div",{className:"text-sm text-gray-400",children:["Expires on"," ",new Date(Z.expiresAt).toLocaleDateString("en-US",{month:"short",year:"numeric",day:"numeric"})]})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white capitalize",children:Z.role}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs(gt,{variant:"secondary",className:`text-xs font-normal rounded-none border-dashed flex items-center gap-1 w-fit ${Z.status==="pending"?"bg-yellow-900/10 border border-yellow-500/30 text-yellow-400/70":Z.status==="accepted"?"bg-green-900/10 border border-green-500/30 text-green-400/70":"bg-red-900/10 border border-red-500/30 text-red-400/70"}`,children:[Z.status==="pending"&&a.jsx(VC,{className:"w-3 h-3"}),Z.status==="accepted"&&a.jsx(j0,{className:"w-3 h-3"}),Z.status==="expired"&&a.jsx(an,{className:"w-3 h-3"}),Z.status]})}),a.jsxs("td",{className:"py-4 px-4 text-sm text-gray-400",children:[new Date(Z.expiresAt).toLocaleDateString(),a.jsx("br",{}),a.jsx("span",{className:"text-xs text-gray-400",children:new Date(Z.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>Ue(Z.id,Z.email),children:[a.jsx(gw,{className:"w-4 h-4 mr-1"}),"Resend"]}),a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>he(Z.id),children:[a.jsx(bu,{className:"w-4 h-4 mr-1"}),"Cancel"]})]})})]},Z.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(sa,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Invitations"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Start inviting users to join this organization."}),a.jsxs(F,{onClick:le,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(sa,{className:"w-4 h-4 mr-2"}),"Send First Invitation"]})]})})]}),b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Invite User"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{p(!1),W(""),H("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"invite-email",className:"text-sm text-gray-400 font-light",children:"Email Address"}),a.jsx(Ye,{id:"invite-email",type:"email",value:L,onChange:Z=>W(Z.target.value),placeholder:"user@example.com",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"inviter-select",className:"text-sm text-gray-400 font-light",children:"Inviter"}),a.jsxs(Zr,{value:R,onValueChange:H,children:[a.jsx(Qr,{children:a.jsx(M0,{placeholder:"Select an inviter..."})}),a.jsx(Kr,{children:q.map(Z=>a.jsx(yn,{value:Z.id,children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("img",{src:Z.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${Z.id}`,alt:Z.name,className:"w-6 h-6 rounded-none border border-dashed border-white/20"}),a.jsxs("span",{children:[Z.name," (",Z.email,")"]})]})},Z.id))})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{p(!1),W(""),H("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsxs(F,{onClick:me,disabled:J,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[J?a.jsx(Pr,{className:"w-3 h-3 mr-2 animate-spin"}):a.jsx(gw,{className:"w-4 h-4 mr-2"}),J?"Sending...":"Send Invitation"]})]})]})}),T&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create Team"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{A(!1),ae({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Ye,{id:"team-name",value:ne.name,onChange:Z=>ze(Z.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{A(!1),ae({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:Oe,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create Team"})]})]})}),P&&M&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{U(!1),ae({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(dt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:M.name}),a.jsx(Rn,{id:M.id,label:"Team ID",variant:"detail"})]})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Ye,{id:"edit-team-name",value:ne.name,onChange:Z=>ze(Z.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{U(!1),ae({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:we,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})}),O&&M&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Team"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>V(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(dt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:M.name}),a.jsx(Rn,{id:M.id,label:"Team ID",variant:"detail"})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this team? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>V(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:Be,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete Team"})]})]})}),y&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Members"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(dt,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Add Members from Existing Users"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Ke,{htmlFor:"member-count",className:"text-sm text-gray-400 font-light",children:"Number of members to add"}),a.jsx(Ye,{id:"member-count",type:"number",min:"1",max:"50",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var ee;const Z=parseInt(((ee=document.getElementById("member-count"))==null?void 0:ee.value)||"5");ht(Z)},disabled:B,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:B?a.jsxs(a.Fragment,{children:[a.jsx(Pr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(dt,{className:"w-3 h-3 mr-2"}),"Seed Members"]})})]})]}),te.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(fi,{title:"Member Seeding Terminal",lines:te,isRunning:B,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsx(F,{variant:"outline",onClick:()=>j(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),S&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Teams"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>C(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(An,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Create Teams"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Ke,{htmlFor:"team-count",className:"text-sm text-gray-400 font-light",children:"Number of teams to create"}),a.jsx(Ye,{id:"team-count",type:"number",min:"1",max:"20",defaultValue:"3",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var ee;const Z=parseInt(((ee=document.getElementById("team-count"))==null?void 0:ee.value)||"3");vt(Z)},disabled:ue,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:ue?a.jsxs(a.Fragment,{children:[a.jsx(Pr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(An,{className:"w-3 h-3 mr-2"}),"Seed Teams"]})})]})]}),re.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(fi,{title:"Team Seeding Terminal",lines:re,isRunning:ue,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsx(F,{variant:"outline",onClick:()=>C(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),k&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:Z=>{Z.target===Z.currentTarget&&(z(!1),D({name:"",slug:""}))},children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",onClick:Z=>Z.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Organization"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{z(!1),D({name:"",slug:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(An,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:n.name}),a.jsx("div",{className:"text-sm text-gray-400",children:n.slug})]})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Ye,{id:"edit-name",value:E.name,onChange:Z=>fe(Z.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"edit-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),a.jsx(Ye,{id:"edit-slug",value:E.slug,onChange:Z=>Re(Z.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{z(!1),D({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:I,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx(Ap,{to:"/organizations",children:a.jsxs(F,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(NH,{className:"w-4 h-4 mr-2"}),"Back to Organizations"]})})}),a.jsx("br",{}),a.jsxs("div",{className:"text-center py-12",children:[a.jsx(An,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Organization Not Found"}),a.jsx("p",{className:"text-gray-400",children:"The organization you're looking for doesn't exist."})]})]})}function eV(){const[e,t]=m.useState([]),[n,s]=m.useState(!0),[r,i]=m.useState(""),[o,l]=m.useState("all"),[c,u]=m.useState(!1),[h,d]=m.useState(!1),[f,x]=m.useState(!1),[w,v]=m.useState(!1),[N,g]=m.useState(!1),[b,p]=m.useState(null),[y,j]=m.useState([]),[S,C]=m.useState(!1),T=m.useCallback(async()=>{try{const D=await(await fetch("/api/sessions")).json();t(D.sessions||[])}catch{}finally{s(!1)}},[]);m.useEffect(()=>{T()},[T]);const A=async E=>{j([]),C(!0),j([{id:"start",type:"info",message:`Starting session seeding process for ${E} sessions...`,timestamp:new Date}]);try{const L=await(await fetch("/api/seed/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:E})})).json();if(L.success){const W=L.results.map((H,q)=>H.success?{id:`session-${q}`,type:"progress",message:`Creating session: ${H.session.id}`,timestamp:new Date,status:"completed"}:{id:`session-${q}`,type:"error",message:`Failed to create session ${q+1}: ${H.error}`,timestamp:new Date});j(H=>[...H,...W]);const R=L.results.filter(H=>H.success).length;j(H=>[...H,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${R}/${E} sessions successfully`,timestamp:new Date}]),await T()}else j(W=>[...W,{id:"error",type:"error",message:`❌ Seeding failed: ${L.error||"Unknown error"}`,timestamp:new Date}])}catch(D){j(L=>[...L,{id:"error",type:"error",message:`❌ Network error: ${D}`,timestamp:new Date}])}finally{C(!1)}},P=async E=>{j([]),C(!0),j([{id:"start",type:"info",message:`Starting account seeding process for ${E} accounts...`,timestamp:new Date}]);try{const L=await(await fetch("/api/seed/accounts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:E})})).json();if(L.success){const W=L.results.map((H,q)=>H.success?{id:`account-${q}`,type:"progress",message:`Creating account: ${H.account.provider}`,timestamp:new Date,status:"completed"}:{id:`account-${q}`,type:"error",message:`Failed to create account ${q+1}: ${H.error}`,timestamp:new Date});j(H=>[...H,...W]);const R=L.results.filter(H=>H.success).length;j(H=>[...H,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${R}/${E} accounts successfully`,timestamp:new Date}]),await T()}else j(W=>[...W,{id:"error",type:"error",message:`❌ Seeding failed: ${L.error||"Unknown error"}`,timestamp:new Date}])}catch(D){j(L=>[...L,{id:"error",type:"error",message:`❌ Network error: ${D}`,timestamp:new Date}])}finally{C(!1)}},U=E=>{p(E),v(!0)},O=E=>{p(E),d(!0)},V=E=>{p(E),x(!0)},k=async E=>{u(!1)},z=async E=>{d(!1)},M=async()=>{x(!1)},_=e.filter(E=>{const D=E.id.toLowerCase().includes(r.toLowerCase())||E.userId.toLowerCase().includes(r.toLowerCase()),L=o==="all"||o==="active"&&new Date(E.expiresAt)>new Date||o==="expired"&&new Date(E.expiresAt)<=new Date;return D&&L});return n?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(Vs,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading sessions..."})]})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Sessions",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-sm",children:e.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light",children:"Manage user sessions and accounts"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>g(!0),children:[a.jsx(yt,{className:"w-4 h-4 mr-2"}),"Seed"]}),a.jsxs(F,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>u(!0),children:[a.jsx(dr,{className:"w-4 h-4 mr-2"}),"Add Session"]})]})]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(oi,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Ye,{placeholder:"Search sessions...",value:r,onChange:E=>i(E.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Qp,{className:"w-4 h-4 text-gray-400"}),a.jsxs(Zr,{value:o,onValueChange:l,children:[a.jsx(Qr,{children:a.jsx(M0,{})}),a.jsxs(Kr,{children:[a.jsx(yn,{value:"all",children:"All"}),a.jsx(yn,{value:"active",children:"Active"}),a.jsx(yn,{value:"expired",children:"Expired"})]})]})]})]}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Session"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User ID"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:_.map(E=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(yt,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",E.id.slice(0,8),"..."]}),a.jsx(Rn,{id:E.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:E.userId}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[new Date(E.expiresAt)>new Date?a.jsx("div",{className:"w-2 h-2 bg-green-400 rounded-full"}):a.jsx("div",{className:"w-2 h-2 bg-red-400 rounded-full"}),a.jsx("span",{className:"text-sm text-gray-400",children:new Date(E.expiresAt)>new Date?"Active":"Expired"})]})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(E.expiresAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx(F,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>U(E),children:a.jsx(Gc,{className:"w-4 h-4"})}),a.jsx(F,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>O(E),children:a.jsx(ii,{className:"w-4 h-4"})}),a.jsx(F,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:()=>V(E),children:a.jsx(Kp,{className:"w-4 h-4"})})]})})]},E.id))})]})})}),N&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Data"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(It,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(yt,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Seed Sessions"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Ke,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),a.jsx(Ye,{id:"session-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var D;const E=parseInt(((D=document.getElementById("session-count"))==null?void 0:D.value)||"5",10);A(E)},disabled:S,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:S?a.jsxs(a.Fragment,{children:[a.jsx(Vs,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(yt,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(by,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Seed Accounts"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Ke,{htmlFor:"account-count",className:"text-sm text-gray-400 font-light",children:"Number of accounts"}),a.jsx(Ye,{id:"account-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var D;const E=parseInt(((D=document.getElementById("account-count"))==null?void 0:D.value)||"5",10);P(E)},disabled:S,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:S?a.jsxs(a.Fragment,{children:[a.jsx(Vs,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(by,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]})]}),y.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(fi,{title:"Session Seeding Terminal",lines:y,isRunning:S,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsx(F,{variant:"outline",onClick:()=>g(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),c&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create Session"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>u(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(It,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"create-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),a.jsx(Ye,{id:"create-user-id",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"create-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),a.jsx(Ye,{id:"create-expires",type:"datetime-local",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>u(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:()=>k(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),h&&b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Session"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>d(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(It,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(yt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",b.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:b.userId})]})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"edit-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),a.jsx(Ye,{id:"edit-user-id",defaultValue:b.userId,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"edit-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),a.jsx(Ye,{id:"edit-expires",type:"datetime-local",defaultValue:new Date(b.expiresAt).toISOString().slice(0,16),className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>d(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:()=>z(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),f&&b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Session"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(It,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(yt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",b.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:b.userId})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this session? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>x(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:M,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),w&&b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Session Details"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(It,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(yt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",b.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:b.userId})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Rn,{id:b.id,variant:"detail"}),a.jsx(Rn,{id:b.userId,label:"User ID",variant:"detail"}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Status:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(b.expiresAt)>new Date?"Active":"Expired"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Expires:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(b.expiresAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Created:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(b.createdAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Updated:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(b.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(F,{onClick:()=>v(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function tV(){var b,p,y,j,S,C,T,A,P,U,O,V,k,z,M,_,E,D,L,W,R,H,q,X,ne,ae,J,$,te;const[e,t]=m.useState(null),[n,s]=m.useState(null),[r,i]=m.useState(null),[o,l]=m.useState(null),[c,u]=m.useState(!0),[h,d]=m.useState(null);b4(K=>{K.type==="config_changed"?setTimeout(()=>{f(),x(),w(),v()},500):K.type});const f=m.useCallback(async()=>{var K;try{const G=await(await fetch("/api/config")).json();(K=G.studio)!=null&&K.version&&d(`v${G.studio.version}`),t(G)}catch{}finally{u(!1)}},[]),x=m.useCallback(async()=>{try{const B=await(await fetch("/api/health")).json();s(B.system||{studioVersion:h||"v1.0.0",nodeVersion:process.version,platform:navigator.platform,uptime:"2h 15m"})}catch{s({studioVersion:h||"v1.0.0",nodeVersion:"v18.0.0",platform:"macOS",uptime:"2h 15m"})}},[h]),w=m.useCallback(async()=>{try{const B=await(await fetch("/api/plugins")).json();i(B)}catch{i({plugins:[],configPath:null,totalPlugins:0,error:"Failed to fetch plugins"})}},[]),v=m.useCallback(async()=>{try{const B=await(await fetch("/api/db")).json();l(B)}catch{l({success:!1,name:"unknown",version:"unknown",dialect:"unknown",adapter:"unknown",displayName:"Unknown",autoDetected:!1,message:"Failed to fetch database info"})}},[]),N=K=>{switch(K==null?void 0:K.toLowerCase()){case"postgresql":case"postgres":return a.jsxs(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Lt,{className:"w-3 h-3"}),"Connected"]});case"mysql":return a.jsxs(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Lt,{className:"w-3 h-3"}),"Connected"]});case"sqlite":return a.jsxs(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Pd,{className:"w-3 h-3"}),"Local"]});default:return a.jsxs(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Ms,{className:"w-3 h-3"}),"Unknown"]})}};m.useEffect(()=>{f(),x(),w(),v()},[f,v,w,x]);const g=K=>{switch(K.toLowerCase()){case"google":return a.jsx(nn,{className:"w-5 h-5 text-white"});case"github":return a.jsx(kn,{className:"w-5 h-5 text-white"});case"discord":return a.jsx(nn,{className:"w-5 h-5 text-white"});case"twitter":return a.jsx(nn,{className:"w-5 h-5 text-white"});default:return a.jsx(nn,{className:"w-5 h-5 text-white"})}};return c?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white"})}):a.jsxs("div",{className:"space-y-8 animate-fade-in",children:[a.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Settings"}),a.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Configure your Better Auth application"})]})}),a.jsx("hr",{className:"w-full border-white/15 h-px"}),a.jsx("hr",{className:"w-full border-white/15 h-px"}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 p-5",children:[a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(co,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Application"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Basic application configuration"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"space-y-0 px-0 pb-0 border-b-none",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(nn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"App Name"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application display name"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.appName)||"Better Auth"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ch,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base URL"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application base URL"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-mono font-medium text-white",children:(e==null?void 0:e.baseURL)||"http://localhost:3000"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(mu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base Path"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auth API base path"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-mono font-medium text-white",children:(e==null?void 0:e.basePath)||"/api/auth"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secret"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Encryption secret"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.secret)==="Configured"?"Configured":"Not set"})})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(yt,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Database"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Database connection and configuration"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"space-y-0 px-0 pb-0 border-b-none",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(yt,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:(o==null?void 0:o.displayName)||((b=e==null?void 0:e.database)==null?void 0:b.type)&&((p=e==null?void 0:e.database)==null?void 0:p.type.charAt(0).toUpperCase())+((y=e==null?void 0:e.database)==null?void 0:y.type.slice(1))||"Unknown"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database Type"})]})]}),((o==null?void 0:o.name)||((j=e==null?void 0:e.database)==null?void 0:j.type))&&N((o==null?void 0:o.name)||((S=e==null?void 0:e.database)==null?void 0:S.type)||"")]}),((o==null?void 0:o.dialect)||((C=e==null?void 0:e.database)==null?void 0:C.dialect))&&(o==null?void 0:o.dialect)!=="unknown"&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(yt,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Dialect"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database dialect"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:((T=e==null?void 0:e.database)==null?void 0:T.dialect)||(o==null?void 0:o.dialect)})})]}),((A=e==null?void 0:e.database)==null?void 0:A.url)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ch,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Connection URL"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database connection string"})]})]}),a.jsxs(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Lt,{className:"w-3 h-3"}),"Configured"]})]}),((P=e==null?void 0:e.database)==null?void 0:P.casing)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(co,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Casing"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Table name casing"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white capitalize",children:e.database.casing})})]}),(e==null?void 0:e.database)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ug,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Debug Logs"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database debug logging"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:e.database.debugLogs?a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Lt,{className:"w-3 h-3"}),"Disabled"]})})]}),!(o!=null&&o.success)&&!(e!=null&&e.database)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ms,{className:"w-5 h-5 text-yellow-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"No Database Detected"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:(o==null?void 0:o.message)||"No supported database packages found"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"Unknown"})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(kn,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Providers"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Configured authentication providers"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsx(Xn,{className:"p-0",children:e!=null&&e.socialProviders&&e.socialProviders.length>0?e.socialProviders.map((K,B)=>a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[g(K.type),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white capitalize",children:K.type}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:K.clientId?"Configured":"Not configured"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:K.clientId?a.jsxs(a.Fragment,{children:[a.jsx(Lt,{className:"w-3 h-3"}),"Active"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Setup Required"]})})]},B)):a.jsxs("div",{className:"text-center py-8",children:[a.jsx(kn,{className:"w-8 h-8 text-white mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-400",children:"No providers configured"})]})})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(dh,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Email & Password"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Email authentication settings"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(dh,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Authentication"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow users to sign up with email"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(U=e==null?void 0:e.emailAndPassword)!=null&&U.enabled?a.jsxs(a.Fragment,{children:[a.jsx(Lt,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ur,{className:"w-3 h-3"}),"Disabled"]})})]}),((O=e==null?void 0:e.emailAndPassword)==null?void 0:O.enabled)&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(li,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Sign Up"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow new user registration"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(V=e==null?void 0:e.emailAndPassword)!=null&&V.disableSignUp?a.jsxs(a.Fragment,{children:[a.jsx(Ur,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Lt,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Verification"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Require email verification"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(k=e==null?void 0:e.emailAndPassword)!=null&&k.requireEmailVerification?a.jsxs(a.Fragment,{children:[a.jsx(Lt,{className:"w-3 h-3"}),"Required"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Optional"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(mu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Password Length"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Min/Max password length"})]})]}),a.jsx("div",{className:"text-right",children:a.jsxs("p",{className:"text-sm font-medium text-white",children:[((z=e==null?void 0:e.emailAndPassword)==null?void 0:z.minPasswordLength)||8," -"," ",((M=e==null?void 0:e.emailAndPassword)==null?void 0:M.maxPasswordLength)||128]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(jm,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Auto Sign In"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto sign in after registration"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(_=e==null?void 0:e.emailAndPassword)!=null&&_.autoSignIn?a.jsxs(a.Fragment,{children:[a.jsx(Lt,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Disabled"]})})]})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(Ld,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Session"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Session management settings"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ld,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Duration"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"How long sessions last"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(E=e==null?void 0:e.session)!=null&&E.expiresIn?`${Math.floor(e.session.expiresIn/(60*60*24))} days`:"7 days"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Default"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ug,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Update Age"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Session refresh interval"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:(D=e==null?void 0:e.session)!=null&&D.updateAge?`${Math.floor(e.session.updateAge/(60*60))} hours`:"24 hours"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(jm,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Refresh"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto refresh sessions"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(L=e==null?void 0:e.session)!=null&&L.disableSessionRefresh?a.jsxs(a.Fragment,{children:[a.jsx(Ur,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Lt,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(yt,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Store in Database"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Store sessions in database"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(W=e==null?void 0:e.session)!=null&&W.storeSessionInDatabase?a.jsxs(a.Fragment,{children:[a.jsx(Lt,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Pd,{className:"w-3 h-3"}),"Secondary Storage"]})})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(kn,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Rate Limiting"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"API rate limiting configuration"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limiting"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Enable rate limiting"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(R=e==null?void 0:e.rateLimit)!=null&&R.enabled?a.jsxs(a.Fragment,{children:[a.jsx(Lt,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Disabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ld,{className:"w-5 h-5 text-red-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limit Window"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Time window for rate limiting"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(H=e==null?void 0:e.rateLimit)!=null&&H.window?`${e.rateLimit.window} seconds`:"10 seconds"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Window"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Max Requests"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Maximum requests per window"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:((q=e==null?void 0:e.rateLimit)==null?void 0:q.max)||100}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Requests"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(yt,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Storage"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Rate limit storage type"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white capitalize",children:((X=e==null?void 0:e.rateLimit)==null?void 0:X.storage)||"memory"})})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(co,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Advanced"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Advanced configuration options"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(mu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secure Cookies"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Use secure cookies"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(ne=e==null?void 0:e.advanced)!=null&&ne.useSecureCookies?a.jsxs(a.Fragment,{children:[a.jsx(Lt,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Disabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"CSRF Check"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"CSRF protection"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(ae=e==null?void 0:e.advanced)!=null&&ae.disableCSRFCheck?a.jsxs(a.Fragment,{children:[a.jsx(Ur,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Lt,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Gc,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"IP Tracking"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Track IP addresses"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:($=(J=e==null?void 0:e.advanced)==null?void 0:J.ipAddress)!=null&&$.disableIpTracking?a.jsxs(a.Fragment,{children:[a.jsx(Ur,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Lt,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Zz,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Telemetry"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Usage analytics"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(te=e==null?void 0:e.telemetry)!=null&&te.enabled?a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Lt,{className:"w-3 h-3"}),"Disabled"]})})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(Pd,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"System Info"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Better Auth Studio system information"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(jm,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Studio Version"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Better Auth Studio"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:h||"v1.0.0"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Latest"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Pd,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Node.js Version"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Runtime environment"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.nodeVersion)||"v18.0.0"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Current"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(nn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Platform"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Operating system"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.platform)||"macOS"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"System"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ld,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Uptime"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Service uptime"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.uptime)||"2h 15m"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Running"})]})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none lg:col-span-2",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(py,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Plugins"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Better Auth plugins enabled in your configuration"]})]}),a.jsxs("div",{className:"pr-6",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(r==null?void 0:r.totalPlugins)||0}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Active"})]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsx(Xn,{className:"space-y-0 px-0 pb-0 border-b-none",children:r!=null&&r.plugins&&r.plugins.length>0?a.jsxs(a.Fragment,{children:[r.plugins.map((K,B)=>a.jsxs("div",{className:`flex items-center justify-between p-3 px-5 ${B<r.plugins.length-1?"border-b border-white/15":""}`,children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(py,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:K.name.slice(0,1).toUpperCase()+K.name.slice(1).replace("-"," ")}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:K.description})]})]}),a.jsx("div",{className:"text-right flex items-center space-x-2",children:a.jsxs(gt,{variant:"secondary",className:"text-xs bg-green-900/50 border border-dashed rounded-none border-green-500/30 text-green-400 flex items-center gap-1",children:[a.jsx(Lt,{className:"w-3 h-3"}),"Enabled"]})})]},K.id)),r.configPath&&a.jsx("div",{className:"p-4 px-5 bg-black/30 border-t border-white/10",children:a.jsxs("p",{className:"text-xs text-gray-400",children:["Config file:"," ",a.jsx("span",{className:"text-white font-mono",children:r.configPath})]})})]}):a.jsxs("div",{className:"flex items-center justify-between p-4 px-5",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ms,{className:"w-5 h-5 text-yellow-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"No Plugins Enabled"}),a.jsx("p",{className:"text-xs text-gray-400",children:(r==null?void 0:r.error)||"No plugins are currently configured in your Better Auth setup"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"None"})]})})]})]})]})}function Ew(){var M,_;const{orgId:e,teamId:t}=_p(),n=ws(),[s,r]=m.useState(null),[i,o]=m.useState([]),[l,c]=m.useState(!0),[u,h]=m.useState("details"),[d,f]=m.useState(!1),[x,w]=m.useState(!1),[v,N]=m.useState(""),[g,b]=m.useState([]),[p,y]=m.useState([]),[j,S]=m.useState({name:""}),C=m.useCallback(async()=>{if(t)try{const D=await(await fetch(`/api/teams/${t}`)).json();D.success&&D.team?(r(D.team),S({name:D.team.name})):D.team?(r(D.team),S({name:D.team.name})):Y.error("Team not found")}catch{Y.error("Failed to load team")}finally{c(!1)}},[t]),T=m.useCallback(async()=>{if(t)try{const D=await(await fetch(`/api/teams/${t}/members`)).json();D.success&&o(D.members||[])}catch{Y.error("Failed to load team members")}},[t]),A=async()=>{try{const D=await(await fetch("/api/users?limit=10000")).json(),L=i.map(R=>R.userId),W=(D.users||[]).filter(R=>!L.includes(R.id));b(W)}catch{Y.error("Failed to load users")}};m.useEffect(()=>{t&&(C(),T())},[t,C,T]);const P=async()=>{if(!j.name){Y.error("Please enter a team name");return}const E=Y.loading("Updating team...");try{const L=await(await fetch(`/api/teams/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:j.name})})).json();L.success?(await C(),w(!1),Y.success("Team updated successfully!",{id:E})):Y.error(`Error updating team: ${L.error||"Unknown error"}`,{id:E})}catch{Y.error("Error updating team",{id:E})}},U=async()=>{if(p.length===0){Y.error("Please select at least one user");return}const E=Y.loading(`Adding ${p.length} members...`);try{const L=await(await fetch(`/api/teams/${t}/members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userIds:p})})).json();L.success?(await T(),f(!1),y([]),N(""),Y.success(`Successfully added ${p.length} members!`,{id:E})):Y.error(`Error adding members: ${L.error||"Unknown error"}`,{id:E})}catch{Y.error("Error adding members",{id:E})}},O=async(E,D)=>{const L=Y.loading(`Removing ${D}...`);try{const R=await(await fetch(`/api/team-members/${E}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();R.success?(await T(),Y.success(`${D} removed from team!`,{id:L})):Y.error(`Error removing member: ${R.error||"Unknown error"}`,{id:L})}catch{Y.error("Error removing team member",{id:L})}},V=()=>{A(),f(!0)},k=E=>{y(D=>D.includes(E)?D.filter(L=>L!==E):[...D,E])},z=g.filter(E=>E.name.toLowerCase().includes(v.toLowerCase())||E.email.toLowerCase().includes(v.toLowerCase()));return l?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(Pr,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading team details..."})]})}):s?a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>n(`/organizations/${s.organizationId}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{onClick:V,className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(Xl,{className:"w-4 h-4 mr-2"}),"Add Members"]}),a.jsxs(F,{onClick:()=>w(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(ii,{className:"w-4 h-4 mr-2"}),"Edit Team"]})]})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(dt,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[s.name,t&&a.jsx(Rn,{id:t,variant:"subscript"})]}),a.jsx("div",{className:"flex items-center space-x-2 mt-1",children:s.organization&&a.jsxs(Ap,{to:`/organizations/${s.organizationId}`,className:"text-gray-400 hover:text-white text-sm font-sans",children:[a.jsx(An,{className:"w-4 h-4 inline mr-1"}),s.organization.name]})})]})]}),a.jsx("div",{className:"border-b border-white/10",children:a.jsxs("nav",{className:"flex space-x-8",children:[a.jsxs("button",{onClick:()=>h("details"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${u==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(dt,{className:"w-4 h-4"}),a.jsx("span",{children:"Details"})]}),a.jsxs("button",{onClick:()=>h("members"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${u==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(dt,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Members",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:i.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),u==="details"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[a.jsx("h3",{className:"text-lg text-white font-light mb-4",children:"Team Information"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),a.jsx("p",{className:"text-white font-sans mt-1",children:s.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"}),a.jsx("p",{className:"text-white font-sans mt-1",children:((M=s.organization)==null?void 0:M.name)||"Unknown"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),a.jsx("p",{className:"text-white font-sans mt-1",children:new Date(s.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Last Updated"}),a.jsx("p",{className:"text-white font-sans mt-1",children:new Date(s.updatedAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(dt,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:i.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ls,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:Math.ceil((Date.now()-new Date(s.createdAt).getTime())/(1e3*60*60*24))}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(An,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:"1"}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"})]})]})})]})]}),u==="members"&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Team Members",a.jsx(xs,{value:i.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage members of this team"})]})}),i.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:i.map(E=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:E.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.user.id}`,alt:E.user.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:E.user.name}),a.jsx(Rn,{id:E.user.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:E.user.email}),a.jsx("td",{className:"py-4 px-4",children:a.jsx(gt,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed border-blue-500/30 text-blue-400/70 rounded-none capitalize",children:E.role})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(E.joinedAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsx("div",{className:"flex items-center justify-end space-x-2",children:a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>O(E.id,E.user.name),children:[a.jsx(bu,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},E.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(dt,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Add members to this team to get started."}),a.jsxs(F,{onClick:V,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Xl,{className:"w-4 h-4 mr-2"}),"Add First Members"]})]})})]}),d&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Add Team Members"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{f(!1),y([]),N("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(HC,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Ye,{placeholder:"Search users by name or email...",value:v,onChange:E=>N(E.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),p.length>0&&a.jsx("div",{className:"bg-blue-900/20 border border-blue-500/30 rounded-none p-3",children:a.jsxs("p",{className:"text-blue-400 text-sm",children:[p.length," user",p.length!==1?"s":""," selected"]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none max-h-96 overflow-y-auto",children:z.length>0?a.jsx("div",{className:"divide-y divide-white/5",children:z.map(E=>a.jsxs("div",{className:`flex items-center space-x-3 p-4 cursor-pointer hover:bg-white/5 ${p.includes(E.id)?"bg-blue-900/20":""}`,onClick:()=>k(E.id),children:[a.jsx("input",{type:"checkbox",checked:p.includes(E.id),onChange:()=>k(E.id),className:"rounded border-gray-300"}),a.jsx("img",{src:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-white font-light",children:E.name}),a.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]},E.id))}):a.jsx("div",{className:"p-8 text-center",children:a.jsx("p",{className:"text-gray-400",children:"No users found matching your search."})})})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{f(!1),y([]),N("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsxs(F,{onClick:U,disabled:p.length===0,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[a.jsx(Xl,{className:"w-4 h-4 mr-2"}),"Add ",p.length," Member",p.length!==1?"s":""]})]})]})}),x&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>w(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(dt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:s.name}),a.jsx("div",{className:"text-sm text-gray-400",children:(_=s.organization)==null?void 0:_.name})]})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Ye,{id:"edit-team-name",value:j.name,onChange:E=>S({name:E.target.value}),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>w(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:P,disabled:j.name===s.name,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>n(`/organizations/${e}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),a.jsxs("div",{className:"text-center py-12",children:[a.jsx(dt,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Team Not Found"}),a.jsx("p",{className:"text-gray-400",children:"The team you're looking for doesn't exist."})]})]})}function nV(){const e=ws(),[t,n]=m.useState([]),[s,r]=m.useState(!0),[i,o]=m.useState(null),[l,c]=m.useState(""),[u,h]=m.useState("all"),[d,f]=m.useState(1),[x]=m.useState(20);m.useEffect(()=>{w()},[]);const w=async()=>{try{const S=await(await fetch("/api/plugins")).json(),C=(S==null?void 0:S.plugins).find(T=>T.id==="teams");o({enabled:!!C,availablePlugins:(S==null?void 0:S.plugins).map(T=>T.id),configPath:S.configPath,teamsPlugin:(S==null?void 0:S.plugins).find(T=>T.id==="teams")}),C?await v():r(!1)}catch(j){console.error("Failed to check teams plugin status:",j),o({enabled:!1,error:"Failed to check plugin status"}),r(!1)}},v=async()=>{try{const S=await(await fetch("/api/teams")).json();S.success&&n(S.teams||[])}catch(j){console.error("Failed to fetch teams:",j),Y.error("Failed to load teams")}finally{r(!1)}},N=t.filter(j=>{var C;const S=j.name.toLowerCase().includes(l.toLowerCase())||((C=j.organization)==null?void 0:C.name.toLowerCase().includes(l.toLowerCase()));if(u==="all")return S;if(u==="recent"){const T=new Date;return T.setDate(T.getDate()-7),S&&new Date(j.createdAt)>T}return S}),g=d*x,b=g-x,p=N.slice(b,g),y=Math.ceil(N.length/x);return s?a.jsx("div",{className:"flex items-center justify-center min-h-screen",children:a.jsx(Vs,{className:"w-8 h-8 animate-spin text-white"})}):i!=null&&i.enabled?a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Teams",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:a.jsx(xs,{value:N.length,className:"text-white font-mono text-sm",prefix:a.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),a.jsxs("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light flex items-baseline gap-1",children:[a.jsx(xs,{value:N.length,className:"text-white font-mono text-sm",format:{notation:"standard",maximumFractionDigits:0}}),a.jsxs("span",{children:["team",N.length!==1?"s":""," found"]})]})]}),a.jsx("div",{className:"flex items-center space-x-3",children:a.jsxs(F,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[a.jsx(dr,{className:"w-4 h-4 mr-2"}),"Create Team"]})})]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"relative flex-1 max-w-md",children:[a.jsx(oi,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Ye,{type:"text",placeholder:"Search teams...",value:l,onChange:j=>c(j.target.value),className:"pl-10 bg-black border-dashed border-white/20 text-white placeholder-gray-400 focus:ring-2 focus:ring-white focus:border-transparent"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(F,{variant:u==="all"?"default":"outline",size:"sm",onClick:()=>h("all"),className:u==="all"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"All"}),a.jsx(F,{variant:u==="recent"?"default":"outline",size:"sm",onClick:()=>h("recent"),className:u==="recent"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"Recent"})]})]}),p.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(li,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-light text-white mb-2",children:"No teams found"}),a.jsx("p",{className:"text-gray-400 mb-6",children:l?"Try adjusting your search terms":"Get started by creating your first team"}),!l&&a.jsxs(F,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[a.jsx(dr,{className:"w-4 h-4 mr-2"}),"Create Team"]})]}):a.jsx("div",{className:"grid gap-4",children:p.map(j=>{var S;return a.jsx("div",{className:"bg-black/30 border border-white/15 rounded-none p-4 hover:bg-black/40 transition-colors cursor-pointer",onClick:()=>e(`/teams/${j.id}`),children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-10 h-10 bg-white/10 rounded-none flex items-center justify-center",children:a.jsx(li,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium",children:j.name}),a.jsxs("p",{className:"text-gray-400 text-sm",children:[(S=j.organization)==null?void 0:S.name," • ",j.memberCount||0," members"]})]})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx(gt,{variant:"secondary",className:"text-xs bg-green-900/50 border border-dashed rounded-none border-green-500/30 text-green-400",children:"Active"})})]})},j.id)})}),y>1&&a.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[a.jsx(F,{variant:"outline",size:"sm",onClick:()=>f(Math.max(1,d-1)),disabled:d===1,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Previous"}),a.jsxs("span",{className:"text-gray-400 text-sm",children:["Page ",d," of ",y]}),a.jsx(F,{variant:"outline",size:"sm",onClick:()=>f(Math.min(y,d+1)),disabled:d===y,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Next"})]})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl text-white font-light",children:"Teams"}),a.jsx("p",{className:"text-gray-400 mt-1",children:"Manage your application organizations"})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx(_s,{className:"w-12 h-12 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Organization Plugin Required"}),a.jsx("p",{className:"text-gray-300 mb-6",children:"To use Organizations in Better Auth Studio, you need to enable the organization plugin in your Better Auth configuration."}),a.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[a.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),a.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:a.jsxs("li",{children:["Import the plugin in your auth configuration file",(i==null?void 0:i.configPath)&&a.jsxs("span",{className:"text-gray-400",children:[" (",i.configPath,")"]}),":"]})}),a.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:a.jsxs("pre",{className:"text-sm text-gray-300",children:[a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"export const"})," ",a.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",a.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",a.jsx("br",{}),a.jsxs("span",{className:"text-yellow-300 pl-12",children:["organization(",")"]}),a.jsx("br",{}),a.jsx("span",{className:"pl-10",children:"]"})," ",a.jsx("br",{}),"}",") ",a.jsx("br",{})]})}),a.jsx("div",{className:"mt-4",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"2. Do migrations to create the organizations table"})}),a.jsx("div",{className:"mt-2",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),(i==null?void 0:i.availablePlugins)&&i.availablePlugins.length>0&&a.jsx("div",{className:"mb-4",children:a.jsxs("p",{className:"text-gray-400 text-sm",children:["Currently enabled plugins: ",i.availablePlugins.join(", ")]})}),a.jsx(F,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),a.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",a.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]})}const Xm=`// Example custom migration script
|
|
493
|
-
import { migrateUser } from '@better-auth/migration';
|
|
494
|
-
|
|
495
|
-
async function run() {
|
|
496
|
-
const legacyUsers = await fetchLegacyUsers();
|
|
497
|
-
|
|
498
|
-
for (const user of legacyUsers) {
|
|
499
|
-
await migrateUser({
|
|
500
|
-
email: user.email,
|
|
501
|
-
passwordHash: user.passwordHash,
|
|
502
|
-
metadata: user.metadata,
|
|
503
|
-
});
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
return {
|
|
507
|
-
migrated: legacyUsers.length,
|
|
508
|
-
timestamp: new Date().toISOString(),
|
|
509
|
-
};
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
run().then(console.log).catch(console.error);`,jl=[{id:"clerk",name:"Clerk",description:"Clerk Migration guide",docs:"https://better-auth.com/docs/migrations/clerk",logo:a.jsx("svg",{width:"1em",height:"1em",role:"img",stroke:"currentColor",fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",id:"Clerk--Streamline-Simple-Icons",children:a.jsx("path",{d:"m21.47 20.829 -2.881 -2.881a0.572 0.572 0 0 0 -0.7 -0.084 6.854 6.854 0 0 1 -7.081 0 0.576 0.576 0 0 0 -0.7 0.084l-2.881 2.881a0.576 0.576 0 0 0 -0.103 0.69 0.57 0.57 0 0 0 0.166 0.186 12 12 0 0 0 14.113 0 0.58 0.58 0 0 0 0.239 -0.423 0.576 0.576 0 0 0 -0.172 -0.453Zm0.002 -17.668 -2.88 2.88a0.569 0.569 0 0 1 -0.701 0.084A6.857 6.857 0 0 0 8.724 8.08a6.862 6.862 0 0 0 -1.222 3.692 6.86 6.86 0 0 0 0.978 3.764 0.573 0.573 0 0 1 -0.083 0.699l-2.881 2.88a0.567 0.567 0 0 1 -0.864 -0.063A11.993 11.993 0 0 1 6.771 2.7a11.99 11.99 0 0 1 14.637 -0.405 0.566 0.566 0 0 1 0.232 0.418 0.57 0.57 0 0 1 -0.168 0.448Zm-7.118 12.261a3.427 3.427 0 1 0 0 -6.854 3.427 3.427 0 0 0 0 6.854Z",fill:"#000000","stroke-width":"1"})}),highlights:["Downloads Clerk CSV export and REST API data.","Migrates passwords, totp secrets, and external accounts.","Respects Better Auth plugins (admin, username, phone-number, two-factor)."],script:`import 'dotenv/config';
|
|
513
|
-
import { generateRandomString, symmetricEncrypt } from "better-auth/crypto";
|
|
514
|
-
import { clerkClient } from '@clerk/clerk-sdk-node';
|
|
515
|
-
import { auth } from "@/lib/auth";
|
|
516
|
-
import * as fs from "node:fs/promises";
|
|
517
|
-
|
|
518
|
-
function getCSVData(csv: string) {
|
|
519
|
-
const lines = csv.split('\\n').filter(line => line.trim());
|
|
520
|
-
const headers = lines[0]?.split(',').map(header => header.trim()) || [];
|
|
521
|
-
const jsonData = lines.slice(1).map(line => {
|
|
522
|
-
const values = line.split(',').map(value => value.trim());
|
|
523
|
-
return headers.reduce((obj, header, index) => {
|
|
524
|
-
obj[header] = values[index] || '';
|
|
525
|
-
return obj;
|
|
526
|
-
}, {} as Record<string, string>);
|
|
527
|
-
});
|
|
528
|
-
return jsonData as Array<{
|
|
529
|
-
id: string;
|
|
530
|
-
first_name: string;
|
|
531
|
-
last_name: string;
|
|
532
|
-
username: string;
|
|
533
|
-
primary_email_address: string;
|
|
534
|
-
primary_phone_number: string;
|
|
535
|
-
verified_email_addresses: string;
|
|
536
|
-
unverified_email_addresses: string;
|
|
537
|
-
verified_phone_numbers: string;
|
|
538
|
-
unverified_phone_numbers: string;
|
|
539
|
-
totp_secret: string;
|
|
540
|
-
password_digest: string;
|
|
541
|
-
password_hasher: string;
|
|
542
|
-
}>;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
async function getClerkUsers(totalUsers: number) {
|
|
546
|
-
const clerkUsers: any[] = [];
|
|
547
|
-
for (let i = 0; i < totalUsers; i += 500) {
|
|
548
|
-
const response = await fetch(\`https://api.clerk.com/v1/users?offset=\${i}&limit=500\`, {
|
|
549
|
-
headers: { Authorization: \`Bearer \${process.env.CLERK_SECRET_KEY}\` },
|
|
550
|
-
});
|
|
551
|
-
if (!response.ok) throw new Error(\`Failed to fetch users: \${response.statusText}\`);
|
|
552
|
-
clerkUsers.push(...((await response.json()) as any));
|
|
553
|
-
}
|
|
554
|
-
return clerkUsers;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
export async function generateBackupCodes(secret: string) {
|
|
558
|
-
const backupCodes = Array.from({ length: 10 })
|
|
559
|
-
.map(() => generateRandomString(10, "a-z", "0-9", "A-Z"))
|
|
560
|
-
.map(code => \`\${code.slice(0,5)}-\${code.slice(5)}\`);
|
|
561
|
-
return symmetricEncrypt({ data: JSON.stringify(backupCodes), key: secret });
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
function safeDateConversion(timestamp?: number): Date {
|
|
565
|
-
if (!timestamp) return new Date();
|
|
566
|
-
const date = new Date(timestamp);
|
|
567
|
-
if (isNaN(date.getTime())) return new Date();
|
|
568
|
-
const year = date.getFullYear();
|
|
569
|
-
if (year < 2000 || year > 2100) return new Date();
|
|
570
|
-
return date;
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
async function migrateFromClerk() {
|
|
574
|
-
const exportedUserCSV = await fs.readFile("exported_users.csv", "utf-8");
|
|
575
|
-
const jsonData = getCSVData(exportedUserCSV);
|
|
576
|
-
const clerkUsers = await getClerkUsers(jsonData.length);
|
|
577
|
-
|
|
578
|
-
const ctx = await auth.$context;
|
|
579
|
-
const isAdminEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "admin");
|
|
580
|
-
const isTwoFactorEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "two-factor");
|
|
581
|
-
const isUsernameEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "username");
|
|
582
|
-
const isPhoneNumberEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "phone-number");
|
|
583
|
-
|
|
584
|
-
for (const user of jsonData) {
|
|
585
|
-
const {
|
|
586
|
-
id,
|
|
587
|
-
first_name,
|
|
588
|
-
last_name,
|
|
589
|
-
username,
|
|
590
|
-
primary_email_address,
|
|
591
|
-
primary_phone_number,
|
|
592
|
-
verified_email_addresses,
|
|
593
|
-
verified_phone_numbers,
|
|
594
|
-
totp_secret,
|
|
595
|
-
password_digest,
|
|
596
|
-
} = user;
|
|
597
|
-
|
|
598
|
-
const clerkUser = clerkUsers.find((item) => item?.id === id);
|
|
599
|
-
|
|
600
|
-
const createdUser = await ctx.adapter.create({
|
|
601
|
-
model: "user",
|
|
602
|
-
data: {
|
|
603
|
-
id,
|
|
604
|
-
email: primary_email_address,
|
|
605
|
-
emailVerified: verified_email_addresses.length > 0,
|
|
606
|
-
name: \`\${first_name} \${last_name}\`,
|
|
607
|
-
image: clerkUser?.image_url,
|
|
608
|
-
createdAt: safeDateConversion(clerkUser?.created_at),
|
|
609
|
-
updatedAt: safeDateConversion(clerkUser?.updated_at),
|
|
610
|
-
...(isTwoFactorEnabled ? { twoFactorEnabled: clerkUser?.two_factor_enabled } : {}),
|
|
611
|
-
...(isAdminEnabled ? {
|
|
612
|
-
banned: clerkUser?.banned,
|
|
613
|
-
banExpiresAt: clerkUser?.lockout_expires_in_seconds,
|
|
614
|
-
role: "user",
|
|
615
|
-
} : {}),
|
|
616
|
-
...(isUsernameEnabled ? { username } : {}),
|
|
617
|
-
...(isPhoneNumberEnabled ? {
|
|
618
|
-
phoneNumber: primary_phone_number,
|
|
619
|
-
phoneNumberVerified: verified_phone_numbers.length > 0,
|
|
620
|
-
} : {}),
|
|
621
|
-
},
|
|
622
|
-
forceAllowId: true,
|
|
623
|
-
}).catch(async () => {
|
|
624
|
-
return await ctx.adapter.findOne({
|
|
625
|
-
model: 'user',
|
|
626
|
-
where: [{ field: 'id', value: id }],
|
|
627
|
-
});
|
|
628
|
-
});
|
|
629
|
-
|
|
630
|
-
const externalAccounts = clerkUser?.external_accounts ?? [];
|
|
631
|
-
for (const externalAccount of externalAccounts) {
|
|
632
|
-
const {
|
|
633
|
-
id: externalId,
|
|
634
|
-
provider,
|
|
635
|
-
provider_user_id,
|
|
636
|
-
approved_scopes,
|
|
637
|
-
created_at,
|
|
638
|
-
updated_at,
|
|
639
|
-
} = externalAccount;
|
|
640
|
-
|
|
641
|
-
if (provider === 'credential') {
|
|
642
|
-
await ctx.adapter.create({
|
|
643
|
-
model: 'account',
|
|
644
|
-
data: {
|
|
645
|
-
id: externalId,
|
|
646
|
-
providerId: provider,
|
|
647
|
-
accountId: provider_user_id,
|
|
648
|
-
scope: approved_scopes,
|
|
649
|
-
userId: createdUser?.id,
|
|
650
|
-
createdAt: safeDateConversion(created_at),
|
|
651
|
-
updatedAt: safeDateConversion(updated_at),
|
|
652
|
-
password: password_digest,
|
|
653
|
-
},
|
|
654
|
-
});
|
|
655
|
-
} else {
|
|
656
|
-
await ctx.adapter.create({
|
|
657
|
-
model: 'account',
|
|
658
|
-
data: {
|
|
659
|
-
id: externalId,
|
|
660
|
-
providerId: provider.replace('oauth_', ''),
|
|
661
|
-
accountId: provider_user_id,
|
|
662
|
-
scope: approved_scopes,
|
|
663
|
-
userId: createdUser?.id,
|
|
664
|
-
createdAt: safeDateConversion(created_at),
|
|
665
|
-
updatedAt: safeDateConversion(updated_at),
|
|
666
|
-
},
|
|
667
|
-
forceAllowId: true,
|
|
668
|
-
});
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
if (isTwoFactorEnabled && totp_secret) {
|
|
673
|
-
await ctx.adapter.create({
|
|
674
|
-
model: 'twoFactor',
|
|
675
|
-
data: {
|
|
676
|
-
userId: createdUser?.id,
|
|
677
|
-
secret: totp_secret,
|
|
678
|
-
backupCodes: await generateBackupCodes(totp_secret),
|
|
679
|
-
},
|
|
680
|
-
});
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
migrateFromClerk()
|
|
686
|
-
.then(() => {
|
|
687
|
-
console.log('Migration completed');
|
|
688
|
-
process.exit(0);
|
|
689
|
-
})
|
|
690
|
-
.catch((error) => {
|
|
691
|
-
console.error('Migration failed:', error);
|
|
692
|
-
process.exit(1);
|
|
693
|
-
});`},{id:"supabase",name:"Supabase",description:"Supabase Migration guide",docs:"https://better-auth.com/docs/migrations/supabase",logo:"",highlights:["Exports Supabase auth.users and auth.identities.","Preserves password hashes and metadata fields.","Supports incremental re-runs with idempotent operations."],disabled:!0},{id:"auth0",name:"Auth0",description:"Auth0 Migration guide",docs:"https://better-auth.com/docs/migrations/auth0",logo:"",highlights:["Uses Auth0 Management API bulk exports.","Keeps password hashes compatible with Better Auth adapters.","Migrates applications and roles to Better Auth format."],disabled:!0},{id:"nextauth",name:"NextAuth.js",description:"NextAuth.js Migration guide",docs:"https://better-auth.com/docs/migrations/nextauth",logo:"",highlights:["Reads users/accounts from your existing NextAuth database.","Moves refresh tokens and OAuth profiles into Better Auth.","Supports Prisma, MySQL, and Postgres NextAuth adapters."],disabled:!0},{id:"custom",name:"Custom Script",description:"Custom Migration guide",docs:"https://better-auth.com/docs/migrations/custom",highlights:["Use Better Auth SDK helpers to insert users safely.","Supports dry-run mode to validate before committing.","Perfect for bespoke data sources or ETL pipelines."],custom:!0}];function sV(){const[e,t]=KM(),[n,s]=m.useState(null),[r,i]=m.useState([]),[o,l]=m.useState(!1),[c,u]=m.useState(!1),[h,d]=m.useState([]),[f,x]=m.useState(""),[w,v]=m.useState(!1),[N,g]=m.useState(""),[b,p]=m.useState(Xm),y=($,te,K,B)=>{i(G=>[...G,{id:B??`log-${Date.now()}-${Math.random()}`,type:$,message:te,timestamp:new Date,status:K}])},j=m.useRef(new Set),S=m.useRef(new Set),C=m.useRef(new Map),T=m.useRef(null),A=()=>jl.find($=>!$.disabled)??jl[0],P=jl.find($=>$.id===N)??A();m.useEffect(()=>{g(w?$=>{var te;return $||((te=A())==null?void 0:te.id)||""}:"")},[w,A]);const U=$=>{g($),$!=="custom"&&p(Xm)},O=async $=>{try{await navigator.clipboard.writeText($),Y.success("Copied to clipboard")}catch{Y.error("Failed to copy to clipboard")}},V=$=>{switch($.toLowerCase()){case"github":return a.jsx(eR,{className:"w-5 h-5 text-white"});case"google":return a.jsx(nn,{className:"w-5 h-5 text-white"});case"discord":return a.jsx(nn,{className:"w-5 h-5 text-white"});case"twitter":case"x":return a.jsx(nn,{className:"w-5 h-5 text-white"});case"facebook":return a.jsx(nn,{className:"w-5 h-5 text-white"});case"apple":return a.jsx(nn,{className:"w-5 h-5 text-white"});default:return a.jsx(nn,{className:"w-5 h-5 text-white"})}},k=()=>{T.current&&!T.current.closed&&T.current.close(),T.current=null},z=($,te,K,B,G)=>{let re=C.current.get($);re||(re=new Map,C.current.set($,re));const ce=re.get(K);if(ce){i(ve=>ve.map(ze=>ze.id===ce?{...ze,type:te,message:B,status:G,timestamp:new Date}:ze));return}const ue=`session-${$}-${K}-${Date.now()}`;re.set(K,ue),y(te,B,G,ue)},M=($,te,K=0)=>{j.current.has($)||j.current.add($),fetch(`/api/tools/oauth/status?testSessionId=${encodeURIComponent($)}`).then(G=>G.json()).then(G=>{if(G.hasResult){j.current.delete($),_(G.result);return}if(K+1>=15){j.current.delete($),z($,"error","timeout","⌛ Timed out waiting for account creation. Check Better Auth logs.","failed"),k(),s(null),Y.error("OAuth test timed out waiting for account creation");return}setTimeout(()=>M($,te,K+1),2e3)}).catch(G=>{K+1<15?setTimeout(()=>M($,te,K+1),2e3):(j.current.delete($),z($,"error","poll-error",`⚠️ Failed to check OAuth status: ${G}`,"failed"),k(),s(null),Y.error("Failed to check OAuth status"))})},_=$=>{l(!0);const te=$.testSessionId;if($.success){if(S.current.has(te)&&$.userInfo)return;if(z(te,"success","waiting","✅ Verified with Better Auth.","completed"),$.userInfo){S.current.add(te);const K=[$.userInfo.name?`👤 ${$.userInfo.name}`:null,$.userInfo.email?`✉️ ${$.userInfo.email}`:null].filter(Boolean).join(" | "),B=K?`✅ ${$.provider} OAuth succeeded — ${K}`:`✅ ${$.provider} OAuth succeeded!`;z(te,"success","completed",B,"completed"),Y.success(`OAuth test for ${$.provider} passed!`),k(),s(null),C.current.delete(te)}else z(te,"progress","await-finalize","⌛ OAuth flow finished. Waiting for Better Auth to finalize account...","running"),j.current.has(te)||(j.current.add(te),M(te,$.provider))}else{if(S.current.has(te))return;z(te,"error","waiting","❌ Verification failed with Better Auth.","failed");const K=$.error?` — ${$.error}`:"";z(te,"error","failed",`❌ ${$.provider} OAuth failed${K}`,"failed"),Y.error(`OAuth test for ${$.provider} failed`),k(),s(null),C.current.delete(te)}$.success||(S.current.add(te),C.current.delete(te)),sessionStorage.removeItem("oauth_test_session"),sessionStorage.removeItem(`oauth_test_result_${te}`)};m.useEffect(()=>{const $=e.get("oauth_test_result");if($)try{const te=JSON.parse(decodeURIComponent($));l(!0),_(te),t({})}catch{}},[e,t,_]),m.useEffect(()=>{(async()=>{try{const K=await(await fetch("/api/tools/oauth/providers")).json();K.success&&K.providers&&d(K.providers.filter(B=>B.enabled))}catch{}})()},[]);const E=async()=>{if(h.length===0){Y.error("No OAuth providers configured"),y("error","❌ No OAuth providers found in configuration","failed"),y("info","💡 Please configure at least one OAuth provider in your Better Auth config","failed");return}u(!0)},D=async $=>{u(!1),x(""),s("test-oauth"),l(!0),i([]),y("info",`🔍 Testing ${$} OAuth...`,"running");const te=new Date().toISOString();try{y("progress","📡 Contacting Better Auth...","running");const B=await(await fetch("/api/tools/oauth/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:$})})).json();if(B.success&&B.startUrl){C.current.delete(B.testSessionId),z(B.testSessionId,"progress","popup-open",`🌐 Opening ${B.provider} OAuth popup...`,"running");const G={testSessionId:B.testSessionId,provider:B.provider,providerId:$,startTime:te};S.current.delete(B.testSessionId),sessionStorage.setItem("oauth_test_session",JSON.stringify(G));const re=600,ce=700,ue=(window.screen.width-re)/2,ve=(window.screen.height-ce)/2,ze=window.open(B.startUrl,"oauth-test",`width=${re},height=${ce},left=${ue},top=${ve},scrollbars=yes,resizable=yes`);if(!ze){y("error","❌ Failed to open OAuth window. Please allow popups for this site.","failed"),y("error","💡 Check your browser popup blocker settings","failed"),Y.error("Failed to open OAuth window. Please allow popups."),s(null);return}T.current=ze;let _e=!1;const Mt=De=>{if(De.origin===window.location.origin){if(De.data&&De.data.type==="oauth_test_state"){if(De.data.status==="redirect")j.current.has(G.testSessionId)||M(G.testSessionId,G.provider);else if(De.data.status==="error"){_e=!0;const nt=sessionStorage.getItem("oauth_test_session");let ht=B.provider;if(nt)try{ht=JSON.parse(nt).provider||ht}catch{}_({success:!1,provider:ht,testSessionId:De.data.testSessionId,error:De.data.error||"Failed to start OAuth test"}),window.removeEventListener("message",Mt),clearInterval(St),clearTimeout(Le),k()}return}if(De.data&&De.data.type==="oauth_test_result"){window.removeEventListener("message",Mt),clearInterval(St),clearTimeout(Le),_e=!0;const nt=De.data.result;_(nt),j.current.has(nt.testSessionId)||M(nt.testSessionId,nt.provider),k()}}};window.addEventListener("message",Mt);const St=setInterval(()=>{ze.closed&&(clearInterval(St),clearTimeout(Le),window.removeEventListener("message",Mt),!sessionStorage.getItem(`oauth_test_result_${G.testSessionId}`)&&!_e&&(_e=!0,M(G.testSessionId,G.provider)))},500),Le=setTimeout(()=>{ze.closed||(clearInterval(St),window.removeEventListener("message",Mt),k(),_e||(_e=!0),y("error","❌ OAuth test timed out after 5 minutes","failed"),y("error","💡 Possible reasons:","failed"),y("error"," • Authentication took too long","failed"),y("error"," • Provider is not responding","failed"),y("error"," • Network connectivity issues","failed"),Y.error("OAuth test timed out"),s(null))},5*60*1e3)}else y("error",`❌ Failed to initiate OAuth test: ${B.error||"Unknown error"}`,"failed"),B.details&&y("error",`💡 Details: ${JSON.stringify(B.details)}`,"failed"),B.cause&&y("error",`💡 Cause: ${B.cause}`,"failed"),Y.error(B.error||"Failed to start OAuth test"),s(null)}catch(K){y("error",`❌ Network error: ${K}`,"failed"),Y.error("Failed to start OAuth test"),s(null)}},L=()=>{v(!0)},W=async($,te)=>{const K=jl.find(G=>G.id===$);if(!K){Y.error("Unknown migration provider");return}if(K.disabled){Y.info(`${K.name} migration is coming soon`);return}v(!1),s("run-migration"),l(!0),i([]);const B=G=>new Promise(re=>setTimeout(re,G));try{if(y("info",`🚀 Preparing ${K.name} migration...`,"running"),K.highlights)for(const ce of K.highlights)await B(350),y("progress",ce,"running");y("progress","📡 Sending migration payload to server...","running");const re=await(await fetch("/api/tools/migrations/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:K.id,script:K.custom?te:K.script})})).json();if(re.success)y("progress","🚀 Migration job acknowledged. Follow server logs for live progress.","running"),y("success",`✅ ${K.name} migration request accepted.`,"completed"),re.message&&y("info",re.message,"completed"),Y.success(`${K.name} migration flow completed`);else throw new Error(re.error||"Migration request failed")}catch(G){y("error",`❌ Migration failed: ${G}`,"failed"),Y.error("Migration failed")}finally{s(null)}},ne=[{id:"test-oauth",name:"Test OAuth",description:"Test OAuth provider connections",icon:nn,action:E,category:"oauth"},{id:"run-migration",name:"Run Migration",description:"Run database migrations",icon:fa,action:L,category:"database"},{id:"test-db",name:"Test Database",description:"Test database connection",icon:fa,action:async()=>{s("test-db"),l(!0),i([]),y("info","Testing database connection...","running");try{const te=await(await fetch("/api/database/test")).json();await new Promise(K=>setTimeout(K,1e3)),y("progress","Checking on database con!","running"),te.success?(y("success","✅ Database connection successful!","completed"),te.result&&Array.isArray(te.result)&&te.result.length>0&&(y("info","📄 Sample user record (first row):","completed"),y("info",JSON.stringify(te.result[0],null,2),"completed")),Y.success("Database connection test successful")):(y("error",`❌ Database connection failed: ${te.error||"Unknown error"}`,"failed"),Y.error("Database connection test failed"))}catch($){y("error",`❌ Network error: ${$}`,"failed"),Y.error("Failed to test database connection")}finally{s(null)}},category:"database"},{id:"validate-config",name:"Validate Config",description:"Validate Better Auth configuration",icon:j0,action:async()=>{s("validate-config"),l(!0),i([]),y("info","Validating Better Auth configuration...","running");try{await new Promise($=>setTimeout($,500)),y("progress","Checking database connection...","running"),await new Promise($=>setTimeout($,500)),y("progress","Validating plugins configuration...","running"),await new Promise($=>setTimeout($,500)),y("success","✅ Configuration is valid!","completed"),Y.success("Configuration validated successfully")}catch($){y("error",`❌ Configuration validation failed: ${$}`,"failed"),Y.error("Configuration validation failed")}finally{s(null)}},category:"utilities"},{id:"generate-api-key",name:"Generate API Key",description:"Generate a new API key",icon:ch,action:async()=>{s("generate-api-key"),l(!0),i([]),y("info","Generating new API key...","running");try{const te=await(await fetch("/api/tools/generate-api-key",{method:"POST",headers:{"Content-Type":"application/json"}})).json();te.success&&te.apiKey?(y("success","✅ API key generated successfully!","completed"),y("info",`API Key: ${te.apiKey}`,"completed"),Y.success("API key generated successfully")):(y("error",`❌ Failed to generate API key: ${te.error||"Unknown error"}`,"failed"),Y.error("Failed to generate API key"))}catch($){y("error",`❌ Network error: ${$}`,"failed"),Y.error("Failed to generate API key")}finally{s(null)}},category:"utilities"},{id:"health-check",name:"Health Check",description:"Run system health check",icon:vy,action:async()=>{s("health-check"),l(!0),i([]),y("info","Running system health check...","running");try{await new Promise($=>setTimeout($,500)),y("progress","Checking API endpoints...","running"),await new Promise($=>setTimeout($,500)),y("progress","Checking database health...","running"),await new Promise($=>setTimeout($,500)),y("progress","Checking plugins status...","running"),await new Promise($=>setTimeout($,500)),y("success","✅ System health check passed!","completed"),Y.success("System health check passed")}catch($){y("error",`❌ Health check failed: ${$}`,"failed"),Y.error("Health check failed")}finally{s(null)}},category:"testing"}],J=[{id:"oauth",name:"OAuth",icon:nn},{id:"database",name:"Database",icon:fa},{id:"testing",name:"Testing",icon:vy},{id:"utilities",name:"Utilities",icon:YC}].map($=>({...$,tools:ne.filter(te=>te.category===$.id)}));return a.jsxs("div",{className:"space-y-8 bg-black w-full min-h-screen",children:[a.jsxs("div",{className:"w-full flex flex-col",children:[a.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:a.jsxs("div",{className:"pb-8",children:[a.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Tools"}),a.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Utility tools for managing and testing your Better Auth setup"})]})}),a.jsxs("div",{className:"flex flex-col items-center space-y-8",children:[a.jsx("hr",{className:"w-full border-white/15 h-px"}),a.jsx("hr",{className:"w-full border-white/15 h-px"})]}),o&&r.length>0&&a.jsxs("div",{className:"mb-6 p-6 gap-8",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 tracking-wider",children:"Tool Output"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>l(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsx(fi,{title:"Tool Execution Logs",lines:r,isRunning:n!==null,className:"w-full",defaultCollapsed:!1})]}),a.jsx("div",{className:"space-y-8 p-6 gap-8",children:J.map($=>a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx($.icon,{className:"w-5 h-5 text-white"}),a.jsx("h2",{className:"text-lg font-light text-white uppercase tracking-wider",children:$.name})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:$.tools.map(te=>{const K=te.icon,B=n===te.id;return a.jsxs("button",{onClick:()=>te.action(),disabled:te.id!=="test-oauth"&&te.id!=="test-db"||B||n!==null,className:`relative flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none transition-colors text-left group ${te.id!=="test-oauth"&&te.id!=="test-db"?"opacity-60 cursor-not-allowed":"hover:bg-black/50 disabled:opacity-50 disabled:cursor-not-allowed"}`,children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:B?a.jsx(Pr,{className:"w-6 h-6 text-white animate-spin"}):a.jsx(K,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:te.name}),a.jsxs("p",{className:"text-xs uppercase font-mono flex items-center text-gray-400",children:[a.jsx(yH,{className:"w-4 h-4 mr-2"}),te.description]})]}),te.id!=="test-oauth"&&te.id!=="test-db"&&a.jsx("span",{className:"absolute top-2 right-3 text-[10px] font-mono uppercase tracking-[0.2em] text-white/60",children:"Coming Soon"}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]},te.id)})})]},$.id))})]}),c&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-8 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(nn,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light",children:"Select OAuth Provider"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{u(!1),x("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-5 h-5"})})]}),a.jsx("div",{className:"space-y-4",children:h.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(nn,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-400 mb-2 text-lg",children:"No OAuth providers configured"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Please configure OAuth providers in your Better Auth configuration"})]}):a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-gray-400 mb-4 uppercase font-mono",children:["Available Providers (",h.length,")"]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 max-h-96 overflow-y-auto",children:h.map($=>a.jsxs("button",{onClick:()=>{x($.id),setTimeout(()=>{D($.id)},100)},className:`w-full flex items-center space-x-4 p-4 border rounded-none transition-all text-left group ${f===$.id?"border-white/50 bg-white/10":"border-dashed border-white/20 hover:bg-white/5 hover:border-white/30"}`,children:[a.jsx("div",{className:"flex-shrink-0",children:V($.id)}),a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx("p",{className:"text-white uppercase font-mono font-light text-base",children:$.name||$.id})}),a.jsx(Fa,{className:`w-5 h-5 transition-colors flex-shrink-0 ${f===$.id?"text-white":"text-gray-400 group-hover:text-white"}`})]},$.id))}),a.jsx("p",{className:"text-xs text-gray-500 mt-4 font-mono uppercase",children:"Click on a provider to start the OAuth test"})]})}),a.jsx("div",{className:"flex justify-end space-x-3 mt-8 pt-6 border-t border-dashed border-white/10",children:a.jsx(F,{variant:"outline",onClick:()=>{u(!1),x("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"})})]})}),w&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/95 border border-dashed border-white/20 p-8 w-full max-w-5xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(fa,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Select Migration"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[a.jsx("div",{className:"space-y-3",children:jl.map($=>{const te=(P==null?void 0:P.id)===$.id;return a.jsxs("button",{onClick:()=>U($.id),disabled:$.disabled,className:`w-full flex items-center space-x-3 p-4 border transition-colors rounded-none text-left ${$.disabled?"border-dashed border-white/10 bg-black/30 cursor-not-allowed opacity-60":te?"border-white/60 bg-white/10":"border-dashed border-white/20 hover:bg-white/5 hover:border-white/40"}`,children:[a.jsx("div",{className:"flex-shrink-0 w-10 h-10 bg-white/10 flex items-center justify-center",children:$.logo?$.logo:a.jsx(xy,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-white uppercase font-mono text-sm",children:$.name}),a.jsx("p",{className:"text-xs uppercase text-gray-400 font-mono mt-1 truncate",children:$.description})]}),$.disabled&&a.jsx("span",{className:"text-[10px] font-mono text-gray-400 uppercase",children:"Coming Soon"})]},$.id)})}),a.jsxs("div",{className:"md:col-span-2 space-y-4",children:[a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/10 flex items-center justify-center",children:P.logo?P.logo:a.jsx(xy,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"text-white -mb-2 text-lg font-light uppercase tracking-wider",children:P.name}),a.jsx("p",{className:"text-sm mt-0 text-gray-400 uppercase font-mono leading-relaxed",children:P.description}),a.jsx("div",{className:"flex items-center space-x-2",children:P.docs&&a.jsx(F,{variant:"ghost",size:"sm",asChild:!0,className:"rounded-none border border-dashed",children:a.jsx("a",{href:P.docs,target:"_blank",rel:"noreferrer",children:"View Docs"})})})]})]}),P.highlights&&a.jsx("ul",{className:"space-y-2 text-xs text-gray-300 font-mono bg-black/40 border border-white/10 p-4",children:P.highlights.map($=>a.jsxs("li",{className:"flex items-start space-x-2",children:[a.jsx("span",{className:"text-white/60 mt-0.5",children:"•"}),a.jsx("span",{children:$})]},$))}),P.disabled?a.jsxs("div",{className:"space-y-4 text-gray-400 font-mono text-xs",children:[a.jsx("p",{children:"This migration provider is coming soon."}),a.jsxs("p",{children:["Subscribe to updates at"," ",a.jsx("a",{href:"https://better-auth.com",target:"_blank",rel:"noreferrer",className:"text-white underline",children:"better-auth.com"}),"."]})]}):P.custom?a.jsxs("div",{className:"space-y-3",children:[a.jsx("label",{className:"text-xs uppercase font-mono text-gray-400",children:"Custom Migration Script"}),a.jsx("textarea",{value:b,onChange:$=>p($.target.value),className:"w-full h-64 bg-black/70 border border-white/10 text-xs text-gray-200 font-mono p-3 rounded-none focus:outline-none focus:ring-0"}),a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx(F,{variant:"outline",size:"sm",className:"rounded-none",onClick:()=>p(Xm),children:"Reset"}),a.jsxs(F,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>O(b),children:[a.jsx(Eg,{className:"w-4 h-4"}),"Copy Script"]}),a.jsx(F,{className:"rounded-none",onClick:()=>W("custom",b),children:"Run Custom Script"})]})]}):a.jsxs("div",{className:"space-y-3",children:[P.script&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between text-xs uppercase font-mono text-gray-400",children:[a.jsx("span",{children:"Migration Script Preview"}),a.jsxs(F,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>O(P.script),children:[a.jsx(Eg,{className:"w-4 h-4"}),"Copy Script"]})]}),a.jsx("pre",{className:"bg-black/70 border border-white/10 text-[11px] text-green-200 font-mono p-4 overflow-auto leading-relaxed h-64",children:a.jsx("code",{children:P.script})})]}),a.jsx("div",{className:"flex items-center justify-end space-x-2",children:a.jsxs(F,{className:"rounded-none",onClick:()=>W(P.id),children:["Run ",P.name," Migration"]})})]})]})]})]})})]})}function aV(){const{userId:e}=_p(),t=ws(),[n,s]=m.useState(null),[r,i]=m.useState([]),[o,l]=m.useState([]),[c,u]=m.useState([]),[h,d]=m.useState(!0),[f,x]=m.useState("details"),[w,v]=m.useState(!1),[N,g]=m.useState(!1),[b,p]=m.useState(!1),[y,j]=m.useState(!1),[S,C]=m.useState(""),[T,A]=m.useState(),[P,U]=m.useState(!1),[O,V]=m.useState([]),[k,z]=m.useState(!1),[M,_]=m.useState({}),E=m.useRef({}),D=m.useCallback(async()=>{try{const G=await(await fetch("/api/admin/status")).json();U(G.enabled)}catch{U(!1)}},[]),L=m.useCallback(async B=>{try{const G=await fetch("/api/geo/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ipAddress:B})});if(G.ok){const re=await G.json();if(re.success&&re.location)return re.location}return null}catch{return null}},[]),W=m.useCallback(async B=>{const G=B.filter(ue=>!E.current[ue.id]);if(G.length===0)return;const re=await Promise.all(G.map(async ue=>{const ve=await L(ue.ipAddress);return ve?{sessionId:ue.id,location:ve}:null})),ce={};re.forEach(ue=>{ue&&(ce[ue.sessionId]=ue.location)}),Object.keys(ce).length>0&&(E.current={...E.current,...ce},_(E.current))},[L]),R=B=>{if(!B)return"🌍";const G=B.toUpperCase().split("").map(re=>127397+re.charCodeAt(0));return String.fromCodePoint(...G)},H=m.useCallback(async()=>{try{const B=await fetch(`/api/users/${e}`);if(B.ok){const G=await B.json();s(G.user)}else Y.error("Failed to fetch user details"),t("/users")}catch{Y.error("Failed to fetch user details"),t("/users")}finally{d(!1)}},[e,t]),q=m.useCallback(async()=>{try{const[B,G,re]=await Promise.all([fetch(`/api/users/${e}/organizations`),fetch(`/api/users/${e}/teams`),fetch(`/api/users/${e}/sessions`)]);if(B.ok){const ce=await B.json();i(ce.memberships||[])}if(G.ok){const ce=await G.json();l(ce.memberships||[])}if(re.ok){const ue=(await re.json()).sessions||[];u(ue),W(ue)}}catch{}},[e,W]),X=async()=>{var ce,ue;if(!n)return;const B=(ce=document.getElementById("edit-name"))==null?void 0:ce.value,G=(ue=document.getElementById("edit-email"))==null?void 0:ue.value;if(!B||!G){Y.error("Please fill in all fields");return}const re=Y.loading("Updating user...");try{const ze=await(await fetch(`/api/users/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:B,email:G})})).json();ze.success?(s({...n,name:B,email:G}),v(!1),Y.success("User updated successfully!",{id:re})):Y.error(`Error updating user: ${ze.error||"Unknown error"}`,{id:re})}catch{Y.error("Error updating user",{id:re})}},ne=async()=>{if(!n)return;if(!P){Y.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use ban functionality.");return}const B=Y.loading("Banning user...");try{const G=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,banReason:S||"No reason provided",banExpiresIn:T})}),re=await G.json();G.ok?(Y.success("User banned successfully!",{id:B}),g(!1),C(""),A(void 0),H()):G.status===403?Y.error("You do not have permission to ban users. Admin role required.",{id:B}):re.adminPluginEnabled&&re.instructions?Y.error(`${re.error}`,{id:B,duration:6e3,description:`Use: ${re.instructions.example}`}):Y.error(`Error banning user: ${re.error||re.message||"Unknown error"}`,{id:B})}catch{Y.error("Error banning user",{id:B})}},ae=async()=>{if(!n)return;if(!P){Y.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use unban functionality.");return}const B=Y.loading("Unbanning user...");try{const G=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})}),re=await G.json();G.ok?(Y.success("User unbanned successfully!",{id:B}),p(!1),H()):G.status===403?Y.error("You do not have permission to unban users. Admin role required.",{id:B}):re.adminPluginEnabled&&re.instructions?Y.error(`${re.error}`,{id:B,duration:6e3,description:`Use: ${re.instructions.example}`}):Y.error(`Error unbanning user: ${re.error||re.message||"Unknown error"}`,{id:B})}catch{Y.error("Error unbanning user",{id:B})}},J=async B=>{const G=Y.loading("Removing user from organization...");try{const ce=await(await fetch(`/api/organizations/members/${B}`,{method:"DELETE"})).json();ce.success?(i(ue=>ue.filter(ve=>ve.id!==B)),Y.success("User removed from organization!",{id:G})):Y.error(`Error removing user: ${ce.error||"Unknown error"}`,{id:G})}catch{Y.error("Error removing user from organization",{id:G})}},$=async B=>{const G=Y.loading("Removing user from team...");try{const ce=await(await fetch(`/api/teams/members/${B}`,{method:"DELETE"})).json();ce.success?(l(ue=>ue.filter(ve=>ve.id!==B)),Y.success("User removed from team!",{id:G})):Y.error(`Error removing user: ${ce.error||"Unknown error"}`,{id:G})}catch{Y.error("Error removing user from team",{id:G})}},te=async B=>{const G=Y.loading("Deleting session...");try{const ce=await(await fetch(`/api/sessions/${B}`,{method:"DELETE"})).json();ce.success?(u(ue=>ue.filter(ve=>ve.id!==B)),Y.success("Session deleted successfully!",{id:G})):Y.error(`Error deleting session: ${ce.error||"Unknown error"}`,{id:G})}catch{Y.error("Error deleting session",{id:G})}};m.useEffect(()=>{e&&(H(),q(),D())},[e,D,H,q]);const K=async(B=3)=>{if(e){V([]),z(!0),V([{id:"start",type:"info",message:`Starting session seeding process for ${B} sessions...`,timestamp:new Date}]);try{const re=await(await fetch(`/api/users/${e}/seed-sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:B})})).json();if(re.success){const ce=re.results.map((ve,ze)=>ve.success?{id:`session-${ze}`,type:"progress",message:`Creating session ${ze+1}: ${ve.session.token.substring(0,20)}... from ${ve.session.ipAddress}`,timestamp:new Date,status:"completed"}:{id:`session-${ze}`,type:"error",message:`Failed to create session ${ze+1}: ${ve.error}`,timestamp:new Date});V(ve=>[...ve,...ce]);const ue=re.results.filter(ve=>ve.success).length;V(ve=>[...ve,{id:"complete",type:"success",message:`✅ Session seeding completed! Created ${ue}/${B} sessions successfully`,timestamp:new Date}]),q()}else V(ce=>[...ce,{id:"error",type:"error",message:`❌ Session seeding failed: ${re.error||"Unknown error"}`,timestamp:new Date}])}catch(G){V(re=>[...re,{id:"error",type:"error",message:`❌ Network error: ${G}`,timestamp:new Date}])}finally{z(!1)}}};return h?a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"Loading user details..."})}):n?a.jsxs("div",{className:"space-y-6 p-6 bg-black w-full",children:[a.jsxs("div",{className:"w-full flex flex-col",children:[a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>t("/users"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["users /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:n.id})]})}),a.jsx("div",{className:"mb-8 mt-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-16 h-16 bg-gray-800 border border-dashed border-white/20 flex items-center justify-center",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):a.jsx(qd,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("h1",{className:"text-3xl font-light text-white inline-flex items-center",children:[n.name,a.jsx(Rn,{id:n.id,variant:"subscript"}),n.banned&&a.jsx("sup",{className:"ml-2 px-2 pt-2 pb-2 -mt-1 py-0.5 text-[10px] font-mono uppercase border border-dashed border-red-500/30 bg-red-500/10 text-red-400/80 rounded-none",children:"Banned"})]}),a.jsx("p",{className:"text-gray-400 font-mono text-sm",children:n.email}),a.jsx("div",{className:"flex items-center space-x-2 mt-2",children:n.role&&a.jsxs("div",{className:"flex items-center space-x-1 px-2 py-1 rounded-sm text-xs font-mono bg-purple-500/20 text-purple-400",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-purple-500"}),a.jsx("span",{children:n.role})]})})]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs(F,{variant:"outline",onClick:()=>v(!0),className:"border border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(ii,{className:"w-4 h-4 mr-2"}),"Edit User"]}),n.banned?a.jsxs(F,{variant:"outline",onClick:()=>p(!0),className:"border border-green-400/20 text-green-400 hover:bg-green-400/10 rounded-none",disabled:!P,children:[a.jsx(Wm,{className:"w-4 h-4 mr-2"}),"Unban User"]}):a.jsxs(F,{variant:"outline",onClick:()=>g(!0),className:"border border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",disabled:!P,children:[a.jsx(Wm,{className:"w-4 h-4 mr-2"}),"Ban User"]})]})]})}),a.jsxs("div",{className:"border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"border-b border-dashed border-white/10",children:a.jsx("nav",{className:"flex space-x-8 px-6",children:[{id:"details",name:"Details",icon:qd},{id:"organizations",name:"Organizations",icon:An,count:r.length},{id:"teams",name:"Teams",icon:dt,count:o.length},{id:"sessions",name:"Sessions",icon:dg,count:c.length}].map(B=>a.jsxs("button",{onClick:()=>x(B.id),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${f===B.id?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[a.jsx(B.icon,{className:"w-4 h-4 text-white/90"}),a.jsxs("span",{className:"inline-flex items-start",children:[a.jsx("span",{className:"",children:B.name}),B.count!==void 0&&a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:B.count,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]},B.id))})}),a.jsxs("div",{className:"p-6",children:[f==="details"&&a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"BASIC INFORMATION"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(qd,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),a.jsx("div",{className:"text-white font-sans text-sm",children:n.name.toLowerCase().replace(/\s+/g,"")})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(sa,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Email"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.email})]})]}),n.username&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(EH,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.username})]})]}),n.phoneNumber&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(CH,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Phone"}),a.jsx("div",{className:"text-white font-mono text-sm",children:"+251 91 234 5678"})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(ls,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Member Since"}),a.jsx("div",{className:"text-white font-mono text-sm",children:new Date(n.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})})]})]})]})]}),a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"SECURITY"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/5 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(sa,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Email Verification"})})]}),a.jsx("div",{className:`px-2 rounded-none py-1 text-xs font-mono ${n.emailVerified?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.emailVerified?"Verified":"Unverified"})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/5 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(fa,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Two-Factor Authentication"})})]}),a.jsx("div",{className:`px-2 rounded-none py-1 text-xs font-mono ${n.twoFactorEnabled?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.twoFactorEnabled?"Enabled":"Disabled"})]})]})]})]}),f==="organizations"&&a.jsx("div",{className:"space-y-4",children:r.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(An,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Organizations"}),a.jsx("p",{className:"text-gray-400",children:"This user is not a member of any organizations."})]}):a.jsx("div",{className:"grid gap-4",children:r.map(B=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:B.organization.image?a.jsx("img",{src:B.organization.image,alt:B.organization.name,className:"w-12 h-12 object-cover"}):a.jsx(An,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[B.organization.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:B.organization.slug}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in ",B.organization.slug]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(B.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(B.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>J(B.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(mw,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},B.id))})}),f==="teams"&&a.jsx("div",{className:"space-y-4",children:o.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(dt,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Teams"}),a.jsx("p",{className:"text-gray-400",children:"This user is not a member of any teams."})]}):a.jsx("div",{className:"grid gap-4",children:o.map(B=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(dt,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[B.team.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:B.team.organizationSlug||B.team.organizationName}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in"," ",B.team.organizationSlug||B.team.organizationName]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(B.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(B.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>$(B.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(mw,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},B.id))})}),f==="sessions"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-medium text-white",children:"Sessions"}),a.jsx("p",{className:"text-gray-400 text-sm",children:"Manage user authentication sessions"})]}),a.jsxs(F,{variant:"outline",onClick:()=>{V([]),z(!1),j(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(fa,{className:"w-4 h-4 mr-2"}),"Seed Sessions"]})]}),c.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(dg,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Sessions"}),a.jsx("p",{className:"text-gray-400",children:"This user has no active sessions."})]}):a.jsx("div",{className:"grid gap-4",children:c.map(B=>{var G,re,ce,ue;return a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(fw,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:["Session ",B.id.substring(0,8),"...",a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:B.ipAddress}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[a.jsx(SH,{className:"w-3.5 h-3.5 text-gray-400"}),a.jsxs("span",{className:"text-gray-400 uppercase font-mono text-xs",children:[((G=M[B.id])==null?void 0:G.city)||"...",","," ",((re=M[B.id])==null?void 0:re.country)||"..."]}),((ce=M[B.id])==null?void 0:ce.countryCode)&&a.jsx("span",{className:"text-xs ml-1",children:R((ue=M[B.id])==null?void 0:ue.countryCode)})]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Expires:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(B.expiresAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(B.expiresAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>te(B.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(Wm,{className:"w-4 h-4 mr-1"}),"Revoke"]})})]},B.id)})})]})]})]})]}),w&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 rounded-none p-6 w-full max-w-md",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:"×"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-black/80 border border-dashed border-white/20 flex items-center justify-center",children:n!=null&&n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):a.jsx(qd,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-medium",children:n==null?void 0:n.name}),a.jsx("p",{className:"text-gray-400 text-sm",children:n==null?void 0:n.email})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Name"}),a.jsx("input",{id:"edit-name",type:"text",defaultValue:(n==null?void 0:n.name)||"",className:"w-full px-3 py-2 bg-gray-800 border border-dashed border-white/20 rounded-none text-white placeholder-gray-400 focus:outline-none focus:border-white/50"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Email"}),a.jsx("input",{id:"edit-email",type:"email",defaultValue:(n==null?void 0:n.email)||"",className:"w-full px-3 py-2 bg-gray-800 border border-dashed border-white/20 rounded-none text-white placeholder-gray-400 focus:outline-none focus:border-white/50"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>v(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:X,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),N&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),a.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",a.jsx("strong",{children:n.name})," from accessing the system."]}),a.jsxs("div",{className:"space-y-4 mb-6",children:[a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),a.jsx(Ye,{id:"banReason",value:S,onChange:B=>C(B.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Ke,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),a.jsx(Ye,{id:"banExpires",type:"number",value:T||"",onChange:B=>A(B.target.value?Number(B.target.value):void 0),placeholder:"Leave empty for permanent ban",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(F,{variant:"outline",onClick:()=>{g(!1),C(""),A(void 0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:ne,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-green-400/20 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),a.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",a.jsx("strong",{children:n.name}),"? This will restore their access to the system."]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(F,{variant:"outline",onClick:()=>p(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:ae,className:"bg-green-400 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),y&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"overflow-x-hidden bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[a.jsx("span",{className:"text-white/50 mr-2",children:"["}),a.jsx(fw,{className:"inline mr-2 w-3 h-3 text-white"}),a.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Sessions"}),a.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Ke,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),a.jsx(Ye,{id:"session-count",type:"number",min:"1",max:"50",defaultValue:"3",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var G;const B=parseInt(((G=document.getElementById("session-count"))==null?void 0:G.value)||"3",10);K(B)},disabled:k,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:k?a.jsxs(a.Fragment,{children:[a.jsx(Pr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(fa,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})}),O.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(fi,{title:"Session Seeding Terminal",lines:O,isRunning:k,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),a.jsx("div",{className:"flex justify-end mt-6 pt-6",children:a.jsx(F,{variant:"outline",onClick:()=>j(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})})]}):a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"User not found"})})}function rV(){return a.jsx(i9,{children:a.jsxs(XM,{children:[a.jsx(KU,{children:a.jsxs(BM,{children:[a.jsx(xn,{path:"/",element:a.jsx(XH,{})}),a.jsx(xn,{path:"/users",element:a.jsx(QC,{})}),a.jsx(xn,{path:"/users/:userId",element:a.jsx(aV,{})}),a.jsx(xn,{path:"/organizations",element:a.jsx(ZC,{})}),a.jsx(xn,{path:"/organizations/:orgId",element:a.jsx(JH,{})}),a.jsx(xn,{path:"/teams",element:a.jsx(nV,{})}),a.jsx(xn,{path:"/teams/:teamId",element:a.jsx(Ew,{})}),a.jsx(xn,{path:"/organizations/:orgId/teams/:teamId",element:a.jsx(Ew,{})}),a.jsx(xn,{path:"/sessions",element:a.jsx(eV,{})}),a.jsx(xn,{path:"/database",element:a.jsx(QH,{})}),a.jsx(xn,{path:"/database/demo",element:a.jsx(r9,{})}),a.jsx(xn,{path:"/tools",element:a.jsx(sV,{})}),a.jsx(xn,{path:"/settings",element:a.jsx(tV,{})})]})}),a.jsx(C5,{className:"rounded-none border-dashed border-white/20",theme:"dark",position:"top-right",richColors:!0,toastOptions:{style:{border:"dashed 1px #ffffff20",borderRadius:"0"},className:"font-mono uppercase"},closeButton:!0})]})})}Xk.createRoot(document.getElementById("root")).render(a.jsx(Q.StrictMode,{children:a.jsx(rV,{})}));
|