better-auth-studio 1.0.26-beta.7 → 1.0.27
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/README.md +2 -2
- package/dist/auth-adapter.d.ts +1 -1
- package/dist/auth-adapter.d.ts.map +1 -1
- package/dist/auth-adapter.js +70 -107
- package/dist/auth-adapter.js.map +1 -1
- package/dist/cli.js +23 -34
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -8
- package/dist/config.js.map +1 -1
- package/dist/data.d.ts +1 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +21 -40
- package/dist/data.js.map +1 -1
- package/dist/geo-service.d.ts.map +1 -1
- package/dist/geo-service.js +10 -15
- package/dist/geo-service.js.map +1 -1
- package/dist/get-tsconfig-info.d.ts.map +1 -1
- package/dist/get-tsconfig-info.js +3 -4
- package/dist/get-tsconfig-info.js.map +1 -1
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +403 -273
- package/dist/routes.js.map +1 -1
- package/dist/studio.d.ts.map +1 -1
- package/dist/studio.js +13 -17
- package/dist/studio.js.map +1 -1
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/database-detection.d.ts +20 -0
- package/dist/utils/database-detection.d.ts.map +1 -0
- package/dist/utils/database-detection.js +143 -0
- package/dist/utils/database-detection.js.map +1 -0
- package/dist/utils/package-json.d.ts +8 -0
- package/dist/utils/package-json.d.ts.map +1 -0
- package/dist/utils/package-json.js +63 -0
- package/dist/utils/package-json.js.map +1 -0
- package/package.json +3 -2
- package/public/assets/main-DWecCRCR.js +405 -0
- package/public/assets/main-FzP6n_gH.css +1 -0
- package/public/index.html +2 -2
- package/public/assets/main-6TIapMhx.css +0 -1
- package/public/assets/main-BUBnw2oe.js +0 -405
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
function Mj(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function mh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var k0={exports:{}},Wc={},S0={exports:{}},Ee={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var _o=Symbol.for("react.element"),_j=Symbol.for("react.portal"),Pj=Symbol.for("react.fragment"),Dj=Symbol.for("react.strict_mode"),Tj=Symbol.for("react.profiler"),Oj=Symbol.for("react.provider"),Aj=Symbol.for("react.context"),Rj=Symbol.for("react.forward_ref"),Ij=Symbol.for("react.suspense"),zj=Symbol.for("react.memo"),$j=Symbol.for("react.lazy"),cp=Symbol.iterator;function Lj(e){return e===null||typeof e!="object"?null:(e=cp&&e[cp]||e["@@iterator"],typeof e=="function"?e:null)}var C0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E0=Object.assign,M0={};function ni(e,t,n){this.props=e,this.context=t,this.refs=M0,this.updater=n||C0}ni.prototype.isReactComponent={};ni.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ni.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function _0(){}_0.prototype=ni.prototype;function ph(e,t,n){this.props=e,this.context=t,this.refs=M0,this.updater=n||C0}var xh=ph.prototype=new _0;xh.constructor=ph;E0(xh,ni.prototype);xh.isPureReactComponent=!0;var dp=Array.isArray,P0=Object.prototype.hasOwnProperty,gh={current:null},D0={key:!0,ref:!0,__self:!0,__source:!0};function T0(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)P0.call(t,r)&&!D0.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];s.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:_o,type:e,key:i,ref:o,props:s,_owner:gh.current}}function Fj(e,t){return{$$typeof:_o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function yh(e){return typeof e=="object"&&e!==null&&e.$$typeof===_o}function Bj(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var up=/\/+/g;function Id(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Bj(""+e.key):t.toString(36)}function Tl(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case _o:case _j:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+Id(o,0):r,dp(s)?(n="",e!=null&&(n=e.replace(up,"$&/")+"/"),Tl(s,t,n,"",function(d){return d})):s!=null&&(yh(s)&&(s=Fj(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(up,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",dp(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+Id(i,l);o+=Tl(i,t,n,c,s)}else if(c=Lj(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+Id(i,l++),o+=Tl(i,t,n,c,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Jo(e,t,n){if(e==null)return e;var r=[],s=0;return Tl(e,r,"","",function(i){return t.call(n,i,s++)}),r}function Wj(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 Ft={current:null},Ol={transition:null},Uj={ReactCurrentDispatcher:Ft,ReactCurrentBatchConfig:Ol,ReactCurrentOwner:gh};function O0(){throw Error("act(...) is not supported in production builds of React.")}Ee.Children={map:Jo,forEach:function(e,t,n){Jo(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Jo(e,function(){t++}),t},toArray:function(e){return Jo(e,function(t){return t})||[]},only:function(e){if(!yh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ee.Component=ni;Ee.Fragment=Pj;Ee.Profiler=Tj;Ee.PureComponent=ph;Ee.StrictMode=Dj;Ee.Suspense=Ij;Ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Uj;Ee.act=O0;Ee.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=E0({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=gh.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)P0.call(t,c)&&!D0.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var d=0;d<c;d++)l[d]=arguments[d+2];r.children=l}return{$$typeof:_o,type:e.type,key:s,ref:i,props:r,_owner:o}};Ee.createContext=function(e){return e={$$typeof:Aj,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Oj,_context:e},e.Consumer=e};Ee.createElement=T0;Ee.createFactory=function(e){var t=T0.bind(null,e);return t.type=e,t};Ee.createRef=function(){return{current:null}};Ee.forwardRef=function(e){return{$$typeof:Rj,render:e}};Ee.isValidElement=yh;Ee.lazy=function(e){return{$$typeof:$j,_payload:{_status:-1,_result:e},_init:Wj}};Ee.memo=function(e,t){return{$$typeof:zj,type:e,compare:t===void 0?null:t}};Ee.startTransition=function(e){var t=Ol.transition;Ol.transition={};try{e()}finally{Ol.transition=t}};Ee.unstable_act=O0;Ee.useCallback=function(e,t){return Ft.current.useCallback(e,t)};Ee.useContext=function(e){return Ft.current.useContext(e)};Ee.useDebugValue=function(){};Ee.useDeferredValue=function(e){return Ft.current.useDeferredValue(e)};Ee.useEffect=function(e,t){return Ft.current.useEffect(e,t)};Ee.useId=function(){return Ft.current.useId()};Ee.useImperativeHandle=function(e,t,n){return Ft.current.useImperativeHandle(e,t,n)};Ee.useInsertionEffect=function(e,t){return Ft.current.useInsertionEffect(e,t)};Ee.useLayoutEffect=function(e,t){return Ft.current.useLayoutEffect(e,t)};Ee.useMemo=function(e,t){return Ft.current.useMemo(e,t)};Ee.useReducer=function(e,t,n){return Ft.current.useReducer(e,t,n)};Ee.useRef=function(e){return Ft.current.useRef(e)};Ee.useState=function(e){return Ft.current.useState(e)};Ee.useSyncExternalStore=function(e,t,n){return Ft.current.useSyncExternalStore(e,t,n)};Ee.useTransition=function(){return Ft.current.useTransition()};Ee.version="18.3.1";S0.exports=Ee;var p=S0.exports;const Y=mh(p),vh=Mj({__proto__:null,default:Y},[p]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Vj=p,Hj=Symbol.for("react.element"),Yj=Symbol.for("react.fragment"),Xj=Object.prototype.hasOwnProperty,qj=Vj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Gj={key:!0,ref:!0,__self:!0,__source:!0};function A0(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Xj.call(t,r)&&!Gj.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:Hj,type:e,key:i,ref:o,props:s,_owner:qj.current}}Wc.Fragment=Yj;Wc.jsx=A0;Wc.jsxs=A0;k0.exports=Wc;var a=k0.exports,Bu={},R0={exports:{}},dn={},I0={exports:{}},z0={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(C,_){var R=C.length;C.push(_);e:for(;0<R;){var B=R-1>>>1,T=C[B];if(0<s(T,_))C[B]=_,C[R]=T,R=B;else break e}}function n(C){return C.length===0?null:C[0]}function r(C){if(C.length===0)return null;var _=C[0],R=C.pop();if(R!==_){C[0]=R;e:for(var B=0,T=C.length,F=T>>>1;B<F;){var H=2*(B+1)-1,X=C[H],J=H+1,ee=C[J];if(0>s(X,R))J<T&&0>s(ee,X)?(C[B]=ee,C[J]=R,B=J):(C[B]=X,C[H]=R,B=H);else if(J<T&&0>s(ee,R))C[B]=ee,C[J]=R,B=J;else break e}}return _}function s(C,_){var R=C.sortIndex-_.sortIndex;return R!==0?R:C.id-_.id}if(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=[],d=[],f=1,u=null,h=3,m=!1,w=!1,y=!1,b=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(C){for(var _=n(d);_!==null;){if(_.callback===null)r(d);else if(_.startTime<=C)r(d),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(d)}}function j(C){if(y=!1,x(C),!w)if(n(c)!==null)w=!0,D(N);else{var _=n(d);_!==null&&P(j,_.startTime-C)}}function N(C,_){w=!1,y&&(y=!1,g(M),M=-1),m=!0;var R=h;try{for(x(_),u=n(c);u!==null&&(!(u.expirationTime>_)||C&&!A());){var B=u.callback;if(typeof B=="function"){u.callback=null,h=u.priorityLevel;var T=B(u.expirationTime<=_);_=e.unstable_now(),typeof T=="function"?u.callback=T:u===n(c)&&r(c),x(_)}else r(c);u=n(c)}if(u!==null)var F=!0;else{var H=n(d);H!==null&&P(j,H.startTime-_),F=!1}return F}finally{u=null,h=R,m=!1}}var k=!1,S=null,M=-1,z=5,$=-1;function A(){return!(e.unstable_now()-$<z)}function O(){if(S!==null){var C=e.unstable_now();$=C;var _=!0;try{_=S(!0,C)}finally{_?L():(k=!1,S=null)}}else k=!1}var L;if(typeof v=="function")L=function(){v(O)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,I=E.port2;E.port1.onmessage=O,L=function(){I.postMessage(null)}}else L=function(){b(O,0)};function D(C){S=C,k||(k=!0,L())}function P(C,_){M=b(function(){C(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(C){C.callback=null},e.unstable_continueExecution=function(){w||m||(w=!0,D(N))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(C){switch(h){case 1:case 2:case 3:var _=3;break;default:_=h}var R=h;h=_;try{return C()}finally{h=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,_){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var R=h;h=C;try{return _()}finally{h=R}},e.unstable_scheduleCallback=function(C,_,R){var B=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?B+R:B):R=B,C){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=R+T,C={id:f++,callback:_,priorityLevel:C,startTime:R,expirationTime:T,sortIndex:-1},R>B?(C.sortIndex=R,t(d,C),n(c)===null&&C===n(d)&&(y?(g(M),M=-1):y=!0,P(j,R-B))):(C.sortIndex=T,t(c,C),w||m||(w=!0,D(N))),C},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(C){var _=h;return function(){var R=h;h=_;try{return C.apply(this,arguments)}finally{h=R}}}})(z0);I0.exports=z0;var Kj=I0.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Qj=p,on=Kj;function re(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var $0=new Set,Yi={};function qs(e,t){Ra(e,t),Ra(e+"Capture",t)}function Ra(e,t){for(Yi[e]=t,e=0;e<t.length;e++)$0.add(t[e])}var br=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wu=Object.prototype.hasOwnProperty,Zj=/^[: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]*$/,fp={},hp={};function Jj(e){return Wu.call(hp,e)?!0:Wu.call(fp,e)?!1:Zj.test(e)?hp[e]=!0:(fp[e]=!0,!1)}function ek(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function tk(e,t,n,r){if(t===null||typeof t>"u"||ek(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Bt(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var _t={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){_t[e]=new Bt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];_t[t]=new Bt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){_t[e]=new Bt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_t[e]=new Bt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){_t[e]=new Bt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){_t[e]=new Bt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){_t[e]=new Bt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){_t[e]=new Bt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){_t[e]=new Bt(e,5,!1,e.toLowerCase(),null,!1,!1)});var wh=/[\-:]([a-z])/g;function bh(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(wh,bh);_t[t]=new Bt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(wh,bh);_t[t]=new Bt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(wh,bh);_t[t]=new Bt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){_t[e]=new Bt(e,1,!1,e.toLowerCase(),null,!1,!1)});_t.xlinkHref=new Bt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){_t[e]=new Bt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Nh(e,t,n,r){var s=_t.hasOwnProperty(t)?_t[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(tk(t,n,s,r)&&(n=null),r||s===null?Jj(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Mr=Qj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,el=Symbol.for("react.element"),ca=Symbol.for("react.portal"),da=Symbol.for("react.fragment"),jh=Symbol.for("react.strict_mode"),Uu=Symbol.for("react.profiler"),L0=Symbol.for("react.provider"),F0=Symbol.for("react.context"),kh=Symbol.for("react.forward_ref"),Vu=Symbol.for("react.suspense"),Hu=Symbol.for("react.suspense_list"),Sh=Symbol.for("react.memo"),zr=Symbol.for("react.lazy"),B0=Symbol.for("react.offscreen"),mp=Symbol.iterator;function di(e){return e===null||typeof e!="object"?null:(e=mp&&e[mp]||e["@@iterator"],typeof e=="function"?e:null)}var rt=Object.assign,zd;function Ei(e){if(zd===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);zd=t&&t[1]||""}return`
|
|
34
|
+
`+zd+e}var $d=!1;function Ld(e,t){if(!e||$d)return"";$d=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var s=d.stack.split(`
|
|
35
|
+
`),i=r.stack.split(`
|
|
36
|
+
`),o=s.length-1,l=i.length-1;1<=o&&0<=l&&s[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(s[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||s[o]!==i[l]){var c=`
|
|
37
|
+
`+s[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{$d=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ei(e):""}function nk(e){switch(e.tag){case 5:return Ei(e.type);case 16:return Ei("Lazy");case 13:return Ei("Suspense");case 19:return Ei("SuspenseList");case 0:case 2:case 15:return e=Ld(e.type,!1),e;case 11:return e=Ld(e.type.render,!1),e;case 1:return e=Ld(e.type,!0),e;default:return""}}function Yu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case da:return"Fragment";case ca:return"Portal";case Uu:return"Profiler";case jh:return"StrictMode";case Vu:return"Suspense";case Hu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case F0:return(e.displayName||"Context")+".Consumer";case L0:return(e._context.displayName||"Context")+".Provider";case kh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Sh:return t=e.displayName||null,t!==null?t:Yu(e.type)||"Memo";case zr:t=e._payload,e=e._init;try{return Yu(e(t))}catch{}}return null}function rk(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Yu(t);case 8:return t===jh?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function as(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function W0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sk(e){var t=W0(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function tl(e){e._valueTracker||(e._valueTracker=sk(e))}function U0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=W0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ec(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Xu(e,t){var n=t.checked;return rt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function pp(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=as(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function V0(e,t){t=t.checked,t!=null&&Nh(e,"checked",t,!1)}function qu(e,t){V0(e,t);var n=as(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Gu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Gu(e,t.type,as(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function xp(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Gu(e,t,n){(t!=="number"||ec(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Mi=Array.isArray;function ja(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+as(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Ku(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(re(91));return rt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function gp(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(re(92));if(Mi(n)){if(1<n.length)throw Error(re(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:as(n)}}function H0(e,t){var n=as(t.value),r=as(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function yp(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Y0(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Qu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Y0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var nl,X0=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(nl=nl||document.createElement("div"),nl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=nl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ai={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ak=["Webkit","ms","Moz","O"];Object.keys(Ai).forEach(function(e){ak.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ai[t]=Ai[e]})});function q0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ai.hasOwnProperty(e)&&Ai[e]?(""+t).trim():t+"px"}function G0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=q0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var ik=rt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Zu(e,t){if(t){if(ik[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(re(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(re(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(re(61))}if(t.style!=null&&typeof t.style!="object")throw Error(re(62))}}function Ju(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ef=null;function Ch(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tf=null,ka=null,Sa=null;function vp(e){if(e=To(e)){if(typeof tf!="function")throw Error(re(280));var t=e.stateNode;t&&(t=Xc(t),tf(e.stateNode,e.type,t))}}function K0(e){ka?Sa?Sa.push(e):Sa=[e]:ka=e}function Q0(){if(ka){var e=ka,t=Sa;if(Sa=ka=null,vp(e),t)for(e=0;e<t.length;e++)vp(t[e])}}function Z0(e,t){return e(t)}function J0(){}var Fd=!1;function ey(e,t,n){if(Fd)return e(t,n);Fd=!0;try{return Z0(e,t,n)}finally{Fd=!1,(ka!==null||Sa!==null)&&(J0(),Q0())}}function qi(e,t){var n=e.stateNode;if(n===null)return null;var r=Xc(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(re(231,t,typeof n));return n}var nf=!1;if(br)try{var ui={};Object.defineProperty(ui,"passive",{get:function(){nf=!0}}),window.addEventListener("test",ui,ui),window.removeEventListener("test",ui,ui)}catch{nf=!1}function ok(e,t,n,r,s,i,o,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(f){this.onError(f)}}var Ri=!1,tc=null,nc=!1,rf=null,lk={onError:function(e){Ri=!0,tc=e}};function ck(e,t,n,r,s,i,o,l,c){Ri=!1,tc=null,ok.apply(lk,arguments)}function dk(e,t,n,r,s,i,o,l,c){if(ck.apply(this,arguments),Ri){if(Ri){var d=tc;Ri=!1,tc=null}else throw Error(re(198));nc||(nc=!0,rf=d)}}function Gs(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 ty(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 wp(e){if(Gs(e)!==e)throw Error(re(188))}function uk(e){var t=e.alternate;if(!t){if(t=Gs(e),t===null)throw Error(re(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return wp(s),e;if(i===r)return wp(s),t;i=i.sibling}throw Error(re(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,l=s.child;l;){if(l===n){o=!0,n=s,r=i;break}if(l===r){o=!0,r=s,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,r=s;break}if(l===r){o=!0,r=i,n=s;break}l=l.sibling}if(!o)throw Error(re(189))}}if(n.alternate!==r)throw Error(re(190))}if(n.tag!==3)throw Error(re(188));return n.stateNode.current===n?e:t}function ny(e){return e=uk(e),e!==null?ry(e):null}function ry(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ry(e);if(t!==null)return t;e=e.sibling}return null}var sy=on.unstable_scheduleCallback,bp=on.unstable_cancelCallback,fk=on.unstable_shouldYield,hk=on.unstable_requestPaint,ot=on.unstable_now,mk=on.unstable_getCurrentPriorityLevel,Eh=on.unstable_ImmediatePriority,ay=on.unstable_UserBlockingPriority,rc=on.unstable_NormalPriority,pk=on.unstable_LowPriority,iy=on.unstable_IdlePriority,Uc=null,Qn=null;function xk(e){if(Qn&&typeof Qn.onCommitFiberRoot=="function")try{Qn.onCommitFiberRoot(Uc,e,void 0,(e.current.flags&128)===128)}catch{}}var Dn=Math.clz32?Math.clz32:vk,gk=Math.log,yk=Math.LN2;function vk(e){return e>>>=0,e===0?32:31-(gk(e)/yk|0)|0}var rl=64,sl=4194304;function _i(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function sc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~s;l!==0?r=_i(l):(i&=o,i!==0&&(r=_i(i)))}else o=n&~s,o!==0?r=_i(o):i!==0&&(r=_i(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Dn(t),s=1<<n,r|=e[n],t&=~s;return r}function wk(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bk(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-Dn(i),l=1<<o,c=s[o];c===-1?(!(l&n)||l&r)&&(s[o]=wk(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function sf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function oy(){var e=rl;return rl<<=1,!(rl&4194240)&&(rl=64),e}function Bd(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Po(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Dn(t),e[t]=n}function Nk(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-Dn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function Mh(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Dn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var $e=0;function ly(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var cy,_h,dy,uy,fy,af=!1,al=[],Yr=null,Xr=null,qr=null,Gi=new Map,Ki=new Map,Lr=[],jk="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Np(e,t){switch(e){case"focusin":case"focusout":Yr=null;break;case"dragenter":case"dragleave":Xr=null;break;case"mouseover":case"mouseout":qr=null;break;case"pointerover":case"pointerout":Gi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ki.delete(t.pointerId)}}function fi(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=To(t),t!==null&&_h(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function kk(e,t,n,r,s){switch(t){case"focusin":return Yr=fi(Yr,e,t,n,r,s),!0;case"dragenter":return Xr=fi(Xr,e,t,n,r,s),!0;case"mouseover":return qr=fi(qr,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return Gi.set(i,fi(Gi.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,Ki.set(i,fi(Ki.get(i)||null,e,t,n,r,s)),!0}return!1}function hy(e){var t=js(e.target);if(t!==null){var n=Gs(t);if(n!==null){if(t=n.tag,t===13){if(t=ty(n),t!==null){e.blockedOn=t,fy(e.priority,function(){dy(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Al(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=of(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ef=r,n.target.dispatchEvent(r),ef=null}else return t=To(n),t!==null&&_h(t),e.blockedOn=n,!1;t.shift()}return!0}function jp(e,t,n){Al(e)&&n.delete(t)}function Sk(){af=!1,Yr!==null&&Al(Yr)&&(Yr=null),Xr!==null&&Al(Xr)&&(Xr=null),qr!==null&&Al(qr)&&(qr=null),Gi.forEach(jp),Ki.forEach(jp)}function hi(e,t){e.blockedOn===t&&(e.blockedOn=null,af||(af=!0,on.unstable_scheduleCallback(on.unstable_NormalPriority,Sk)))}function Qi(e){function t(s){return hi(s,e)}if(0<al.length){hi(al[0],e);for(var n=1;n<al.length;n++){var r=al[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Yr!==null&&hi(Yr,e),Xr!==null&&hi(Xr,e),qr!==null&&hi(qr,e),Gi.forEach(t),Ki.forEach(t),n=0;n<Lr.length;n++)r=Lr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Lr.length&&(n=Lr[0],n.blockedOn===null);)hy(n),n.blockedOn===null&&Lr.shift()}var Ca=Mr.ReactCurrentBatchConfig,ac=!0;function Ck(e,t,n,r){var s=$e,i=Ca.transition;Ca.transition=null;try{$e=1,Ph(e,t,n,r)}finally{$e=s,Ca.transition=i}}function Ek(e,t,n,r){var s=$e,i=Ca.transition;Ca.transition=null;try{$e=4,Ph(e,t,n,r)}finally{$e=s,Ca.transition=i}}function Ph(e,t,n,r){if(ac){var s=of(e,t,n,r);if(s===null)Qd(e,t,r,ic,n),Np(e,r);else if(kk(s,e,t,n,r))r.stopPropagation();else if(Np(e,r),t&4&&-1<jk.indexOf(e)){for(;s!==null;){var i=To(s);if(i!==null&&cy(i),i=of(e,t,n,r),i===null&&Qd(e,t,r,ic,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Qd(e,t,r,null,n)}}var ic=null;function of(e,t,n,r){if(ic=null,e=Ch(r),e=js(e),e!==null)if(t=Gs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ty(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 ic=e,null}function my(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(mk()){case Eh:return 1;case ay:return 4;case rc:case pk:return 16;case iy:return 536870912;default:return 16}default:return 16}}var Wr=null,Dh=null,Rl=null;function py(){if(Rl)return Rl;var e,t=Dh,n=t.length,r,s="value"in Wr?Wr.value:Wr.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return Rl=s.slice(e,1<r?1-r:void 0)}function Il(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 il(){return!0}function kp(){return!1}function un(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,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)?il:kp,this.isPropagationStopped=kp,this}return rt(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=il)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=il)},persist:function(){},isPersistent:il}),t}var ri={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Th=un(ri),Do=rt({},ri,{view:0,detail:0}),Mk=un(Do),Wd,Ud,mi,Vc=rt({},Do,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Oh,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!==mi&&(mi&&e.type==="mousemove"?(Wd=e.screenX-mi.screenX,Ud=e.screenY-mi.screenY):Ud=Wd=0,mi=e),Wd)},movementY:function(e){return"movementY"in e?e.movementY:Ud}}),Sp=un(Vc),_k=rt({},Vc,{dataTransfer:0}),Pk=un(_k),Dk=rt({},Do,{relatedTarget:0}),Vd=un(Dk),Tk=rt({},ri,{animationName:0,elapsedTime:0,pseudoElement:0}),Ok=un(Tk),Ak=rt({},ri,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Rk=un(Ak),Ik=rt({},ri,{data:0}),Cp=un(Ik),zk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$k={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"},Lk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fk(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Lk[e])?!!t[e]:!1}function Oh(){return Fk}var Bk=rt({},Do,{key:function(e){if(e.key){var t=zk[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Il(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$k[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Oh,charCode:function(e){return e.type==="keypress"?Il(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Il(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Wk=un(Bk),Uk=rt({},Vc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ep=un(Uk),Vk=rt({},Do,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Oh}),Hk=un(Vk),Yk=rt({},ri,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xk=un(Yk),qk=rt({},Vc,{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}),Gk=un(qk),Kk=[9,13,27,32],Ah=br&&"CompositionEvent"in window,Ii=null;br&&"documentMode"in document&&(Ii=document.documentMode);var Qk=br&&"TextEvent"in window&&!Ii,xy=br&&(!Ah||Ii&&8<Ii&&11>=Ii),Mp=" ",_p=!1;function gy(e,t){switch(e){case"keyup":return Kk.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yy(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ua=!1;function Zk(e,t){switch(e){case"compositionend":return yy(t);case"keypress":return t.which!==32?null:(_p=!0,Mp);case"textInput":return e=t.data,e===Mp&&_p?null:e;default:return null}}function Jk(e,t){if(ua)return e==="compositionend"||!Ah&&gy(e,t)?(e=py(),Rl=Dh=Wr=null,ua=!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 xy&&t.locale!=="ko"?null:t.data;default:return null}}var e2={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 Pp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!e2[e.type]:t==="textarea"}function vy(e,t,n,r){K0(r),t=oc(t,"onChange"),0<t.length&&(n=new Th("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var zi=null,Zi=null;function t2(e){Py(e,0)}function Hc(e){var t=ma(e);if(U0(t))return e}function n2(e,t){if(e==="change")return t}var wy=!1;if(br){var Hd;if(br){var Yd="oninput"in document;if(!Yd){var Dp=document.createElement("div");Dp.setAttribute("oninput","return;"),Yd=typeof Dp.oninput=="function"}Hd=Yd}else Hd=!1;wy=Hd&&(!document.documentMode||9<document.documentMode)}function Tp(){zi&&(zi.detachEvent("onpropertychange",by),Zi=zi=null)}function by(e){if(e.propertyName==="value"&&Hc(Zi)){var t=[];vy(t,Zi,e,Ch(e)),ey(t2,t)}}function r2(e,t,n){e==="focusin"?(Tp(),zi=t,Zi=n,zi.attachEvent("onpropertychange",by)):e==="focusout"&&Tp()}function s2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Hc(Zi)}function a2(e,t){if(e==="click")return Hc(t)}function i2(e,t){if(e==="input"||e==="change")return Hc(t)}function o2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var An=typeof Object.is=="function"?Object.is:o2;function Ji(e,t){if(An(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!Wu.call(t,s)||!An(e[s],t[s]))return!1}return!0}function Op(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ap(e,t){var n=Op(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Op(n)}}function Ny(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ny(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jy(){for(var e=window,t=ec();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ec(e.document)}return t}function Rh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function l2(e){var t=jy(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ny(n.ownerDocument.documentElement,n)){if(r!==null&&Rh(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Ap(n,i);var o=Ap(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var c2=br&&"documentMode"in document&&11>=document.documentMode,fa=null,lf=null,$i=null,cf=!1;function Rp(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cf||fa==null||fa!==ec(r)||(r=fa,"selectionStart"in r&&Rh(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),$i&&Ji($i,r)||($i=r,r=oc(lf,"onSelect"),0<r.length&&(t=new Th("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=fa)))}function ol(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ha={animationend:ol("Animation","AnimationEnd"),animationiteration:ol("Animation","AnimationIteration"),animationstart:ol("Animation","AnimationStart"),transitionend:ol("Transition","TransitionEnd")},Xd={},ky={};br&&(ky=document.createElement("div").style,"AnimationEvent"in window||(delete ha.animationend.animation,delete ha.animationiteration.animation,delete ha.animationstart.animation),"TransitionEvent"in window||delete ha.transitionend.transition);function Yc(e){if(Xd[e])return Xd[e];if(!ha[e])return e;var t=ha[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ky)return Xd[e]=t[n];return e}var Sy=Yc("animationend"),Cy=Yc("animationiteration"),Ey=Yc("animationstart"),My=Yc("transitionend"),_y=new Map,Ip="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function fs(e,t){_y.set(e,t),qs(t,[e])}for(var qd=0;qd<Ip.length;qd++){var Gd=Ip[qd],d2=Gd.toLowerCase(),u2=Gd[0].toUpperCase()+Gd.slice(1);fs(d2,"on"+u2)}fs(Sy,"onAnimationEnd");fs(Cy,"onAnimationIteration");fs(Ey,"onAnimationStart");fs("dblclick","onDoubleClick");fs("focusin","onFocus");fs("focusout","onBlur");fs(My,"onTransitionEnd");Ra("onMouseEnter",["mouseout","mouseover"]);Ra("onMouseLeave",["mouseout","mouseover"]);Ra("onPointerEnter",["pointerout","pointerover"]);Ra("onPointerLeave",["pointerout","pointerover"]);qs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));qs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));qs("onBeforeInput",["compositionend","keypress","textInput","paste"]);qs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));qs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));qs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pi="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(" "),f2=new Set("cancel close invalid load scroll toggle".split(" ").concat(Pi));function zp(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,dk(r,t,void 0,e),e.currentTarget=null}function Py(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==i&&s.isPropagationStopped())break e;zp(s,l,d),i=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,d=l.currentTarget,l=l.listener,c!==i&&s.isPropagationStopped())break e;zp(s,l,d),i=c}}}if(nc)throw e=rf,nc=!1,rf=null,e}function He(e,t){var n=t[mf];n===void 0&&(n=t[mf]=new Set);var r=e+"__bubble";n.has(r)||(Dy(t,e,2,!1),n.add(r))}function Kd(e,t,n){var r=0;t&&(r|=4),Dy(n,e,r,t)}var ll="_reactListening"+Math.random().toString(36).slice(2);function eo(e){if(!e[ll]){e[ll]=!0,$0.forEach(function(n){n!=="selectionchange"&&(f2.has(n)||Kd(n,!1,e),Kd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ll]||(t[ll]=!0,Kd("selectionchange",!1,t))}}function Dy(e,t,n,r){switch(my(t)){case 1:var s=Ck;break;case 4:s=Ek;break;default:s=Ph}n=s.bind(null,t,n,e),s=void 0,!nf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Qd(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;o=o.return}for(;l!==null;){if(o=js(l),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}l=l.parentNode}}r=r.return}ey(function(){var d=i,f=Ch(n),u=[];e:{var h=_y.get(e);if(h!==void 0){var m=Th,w=e;switch(e){case"keypress":if(Il(n)===0)break e;case"keydown":case"keyup":m=Wk;break;case"focusin":w="focus",m=Vd;break;case"focusout":w="blur",m=Vd;break;case"beforeblur":case"afterblur":m=Vd;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":m=Sp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Pk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=Hk;break;case Sy:case Cy:case Ey:m=Ok;break;case My:m=Xk;break;case"scroll":m=Mk;break;case"wheel":m=Gk;break;case"copy":case"cut":case"paste":m=Rk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Ep}var y=(t&4)!==0,b=!y&&e==="scroll",g=y?h!==null?h+"Capture":null:h;y=[];for(var v=d,x;v!==null;){x=v;var j=x.stateNode;if(x.tag===5&&j!==null&&(x=j,g!==null&&(j=qi(v,g),j!=null&&y.push(to(v,j,x)))),b)break;v=v.return}0<y.length&&(h=new m(h,w,null,n,f),u.push({event:h,listeners:y}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==ef&&(w=n.relatedTarget||n.fromElement)&&(js(w)||w[Nr]))break e;if((m||h)&&(h=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,m?(w=n.relatedTarget||n.toElement,m=d,w=w?js(w):null,w!==null&&(b=Gs(w),w!==b||w.tag!==5&&w.tag!==6)&&(w=null)):(m=null,w=d),m!==w)){if(y=Sp,j="onMouseLeave",g="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(y=Ep,j="onPointerLeave",g="onPointerEnter",v="pointer"),b=m==null?h:ma(m),x=w==null?h:ma(w),h=new y(j,v+"leave",m,n,f),h.target=b,h.relatedTarget=x,j=null,js(f)===d&&(y=new y(g,v+"enter",w,n,f),y.target=x,y.relatedTarget=b,j=y),b=j,m&&w)t:{for(y=m,g=w,v=0,x=y;x;x=ea(x))v++;for(x=0,j=g;j;j=ea(j))x++;for(;0<v-x;)y=ea(y),v--;for(;0<x-v;)g=ea(g),x--;for(;v--;){if(y===g||g!==null&&y===g.alternate)break t;y=ea(y),g=ea(g)}y=null}else y=null;m!==null&&$p(u,h,m,y,!1),w!==null&&b!==null&&$p(u,b,w,y,!0)}}e:{if(h=d?ma(d):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var N=n2;else if(Pp(h))if(wy)N=i2;else{N=s2;var k=r2}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(N=a2);if(N&&(N=N(e,d))){vy(u,N,n,f);break e}k&&k(e,h,d),e==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&Gu(h,"number",h.value)}switch(k=d?ma(d):window,e){case"focusin":(Pp(k)||k.contentEditable==="true")&&(fa=k,lf=d,$i=null);break;case"focusout":$i=lf=fa=null;break;case"mousedown":cf=!0;break;case"contextmenu":case"mouseup":case"dragend":cf=!1,Rp(u,n,f);break;case"selectionchange":if(c2)break;case"keydown":case"keyup":Rp(u,n,f)}var S;if(Ah)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else ua?gy(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(xy&&n.locale!=="ko"&&(ua||M!=="onCompositionStart"?M==="onCompositionEnd"&&ua&&(S=py()):(Wr=f,Dh="value"in Wr?Wr.value:Wr.textContent,ua=!0)),k=oc(d,M),0<k.length&&(M=new Cp(M,e,null,n,f),u.push({event:M,listeners:k}),S?M.data=S:(S=yy(n),S!==null&&(M.data=S)))),(S=Qk?Zk(e,n):Jk(e,n))&&(d=oc(d,"onBeforeInput"),0<d.length&&(f=new Cp("onBeforeInput","beforeinput",null,n,f),u.push({event:f,listeners:d}),f.data=S))}Py(u,t)})}function to(e,t,n){return{instance:e,listener:t,currentTarget:n}}function oc(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=qi(e,n),i!=null&&r.unshift(to(e,i,s)),i=qi(e,t),i!=null&&r.push(to(e,i,s))),e=e.return}return r}function ea(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function $p(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var l=n,c=l.alternate,d=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&d!==null&&(l=d,s?(c=qi(n,i),c!=null&&o.unshift(to(n,c,l))):s||(c=qi(n,i),c!=null&&o.push(to(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var h2=/\r\n?/g,m2=/\u0000|\uFFFD/g;function Lp(e){return(typeof e=="string"?e:""+e).replace(h2,`
|
|
38
|
+
`).replace(m2,"")}function cl(e,t,n){if(t=Lp(t),Lp(e)!==t&&n)throw Error(re(425))}function lc(){}var df=null,uf=null;function ff(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var hf=typeof setTimeout=="function"?setTimeout:void 0,p2=typeof clearTimeout=="function"?clearTimeout:void 0,Fp=typeof Promise=="function"?Promise:void 0,x2=typeof queueMicrotask=="function"?queueMicrotask:typeof Fp<"u"?function(e){return Fp.resolve(null).then(e).catch(g2)}:hf;function g2(e){setTimeout(function(){throw e})}function Zd(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Qi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Qi(t)}function Gr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Bp(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}var si=Math.random().toString(36).slice(2),Xn="__reactFiber$"+si,no="__reactProps$"+si,Nr="__reactContainer$"+si,mf="__reactEvents$"+si,y2="__reactListeners$"+si,v2="__reactHandles$"+si;function js(e){var t=e[Xn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Nr]||n[Xn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Bp(e);e!==null;){if(n=e[Xn])return n;e=Bp(e)}return t}e=n,n=e.parentNode}return null}function To(e){return e=e[Xn]||e[Nr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ma(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(re(33))}function Xc(e){return e[no]||null}var pf=[],pa=-1;function hs(e){return{current:e}}function Ye(e){0>pa||(e.current=pf[pa],pf[pa]=null,pa--)}function We(e,t){pa++,pf[pa]=e.current,e.current=t}var is={},It=hs(is),Xt=hs(!1),Rs=is;function Ia(e,t){var n=e.type.contextTypes;if(!n)return is;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function qt(e){return e=e.childContextTypes,e!=null}function cc(){Ye(Xt),Ye(It)}function Wp(e,t,n){if(It.current!==is)throw Error(re(168));We(It,t),We(Xt,n)}function Ty(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(re(108,rk(e)||"Unknown",s));return rt({},n,r)}function dc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||is,Rs=It.current,We(It,e),We(Xt,Xt.current),!0}function Up(e,t,n){var r=e.stateNode;if(!r)throw Error(re(169));n?(e=Ty(e,t,Rs),r.__reactInternalMemoizedMergedChildContext=e,Ye(Xt),Ye(It),We(It,e)):Ye(Xt),We(Xt,n)}var ur=null,qc=!1,Jd=!1;function Oy(e){ur===null?ur=[e]:ur.push(e)}function w2(e){qc=!0,Oy(e)}function ms(){if(!Jd&&ur!==null){Jd=!0;var e=0,t=$e;try{var n=ur;for($e=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ur=null,qc=!1}catch(s){throw ur!==null&&(ur=ur.slice(e+1)),sy(Eh,ms),s}finally{$e=t,Jd=!1}}return null}var xa=[],ga=0,uc=null,fc=0,xn=[],gn=0,Is=null,fr=1,hr="";function gs(e,t){xa[ga++]=fc,xa[ga++]=uc,uc=e,fc=t}function Ay(e,t,n){xn[gn++]=fr,xn[gn++]=hr,xn[gn++]=Is,Is=e;var r=fr;e=hr;var s=32-Dn(r)-1;r&=~(1<<s),n+=1;var i=32-Dn(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,fr=1<<32-Dn(t)+s|n<<s|r,hr=i+e}else fr=1<<i|n<<s|r,hr=e}function Ih(e){e.return!==null&&(gs(e,1),Ay(e,1,0))}function zh(e){for(;e===uc;)uc=xa[--ga],xa[ga]=null,fc=xa[--ga],xa[ga]=null;for(;e===Is;)Is=xn[--gn],xn[gn]=null,hr=xn[--gn],xn[gn]=null,fr=xn[--gn],xn[gn]=null}var sn=null,rn=null,qe=!1,Cn=null;function Ry(e,t){var n=yn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Vp(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,sn=e,rn=Gr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,sn=e,rn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Is!==null?{id:fr,overflow:hr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=yn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,sn=e,rn=null,!0):!1;default:return!1}}function xf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function gf(e){if(qe){var t=rn;if(t){var n=t;if(!Vp(e,t)){if(xf(e))throw Error(re(418));t=Gr(n.nextSibling);var r=sn;t&&Vp(e,t)?Ry(r,n):(e.flags=e.flags&-4097|2,qe=!1,sn=e)}}else{if(xf(e))throw Error(re(418));e.flags=e.flags&-4097|2,qe=!1,sn=e}}}function Hp(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;sn=e}function dl(e){if(e!==sn)return!1;if(!qe)return Hp(e),qe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ff(e.type,e.memoizedProps)),t&&(t=rn)){if(xf(e))throw Iy(),Error(re(418));for(;t;)Ry(e,t),t=Gr(t.nextSibling)}if(Hp(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(re(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){rn=Gr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}rn=null}}else rn=sn?Gr(e.stateNode.nextSibling):null;return!0}function Iy(){for(var e=rn;e;)e=Gr(e.nextSibling)}function za(){rn=sn=null,qe=!1}function $h(e){Cn===null?Cn=[e]:Cn.push(e)}var b2=Mr.ReactCurrentBatchConfig;function pi(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(re(309));var r=n.stateNode}if(!r)throw Error(re(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=s.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(re(284));if(!n._owner)throw Error(re(290,e))}return e}function ul(e,t){throw e=Object.prototype.toString.call(t),Error(re(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Yp(e){var t=e._init;return t(e._payload)}function zy(e){function t(g,v){if(e){var x=g.deletions;x===null?(g.deletions=[v],g.flags|=16):x.push(v)}}function n(g,v){if(!e)return null;for(;v!==null;)t(g,v),v=v.sibling;return null}function r(g,v){for(g=new Map;v!==null;)v.key!==null?g.set(v.key,v):g.set(v.index,v),v=v.sibling;return g}function s(g,v){return g=Jr(g,v),g.index=0,g.sibling=null,g}function i(g,v,x){return g.index=x,e?(x=g.alternate,x!==null?(x=x.index,x<v?(g.flags|=2,v):x):(g.flags|=2,v)):(g.flags|=1048576,v)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,v,x,j){return v===null||v.tag!==6?(v=iu(x,g.mode,j),v.return=g,v):(v=s(v,x),v.return=g,v)}function c(g,v,x,j){var N=x.type;return N===da?f(g,v,x.props.children,j,x.key):v!==null&&(v.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===zr&&Yp(N)===v.type)?(j=s(v,x.props),j.ref=pi(g,v,x),j.return=g,j):(j=Ul(x.type,x.key,x.props,null,g.mode,j),j.ref=pi(g,v,x),j.return=g,j)}function d(g,v,x,j){return v===null||v.tag!==4||v.stateNode.containerInfo!==x.containerInfo||v.stateNode.implementation!==x.implementation?(v=ou(x,g.mode,j),v.return=g,v):(v=s(v,x.children||[]),v.return=g,v)}function f(g,v,x,j,N){return v===null||v.tag!==7?(v=_s(x,g.mode,j,N),v.return=g,v):(v=s(v,x),v.return=g,v)}function u(g,v,x){if(typeof v=="string"&&v!==""||typeof v=="number")return v=iu(""+v,g.mode,x),v.return=g,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case el:return x=Ul(v.type,v.key,v.props,null,g.mode,x),x.ref=pi(g,null,v),x.return=g,x;case ca:return v=ou(v,g.mode,x),v.return=g,v;case zr:var j=v._init;return u(g,j(v._payload),x)}if(Mi(v)||di(v))return v=_s(v,g.mode,x,null),v.return=g,v;ul(g,v)}return null}function h(g,v,x,j){var N=v!==null?v.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return N!==null?null:l(g,v,""+x,j);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case el:return x.key===N?c(g,v,x,j):null;case ca:return x.key===N?d(g,v,x,j):null;case zr:return N=x._init,h(g,v,N(x._payload),j)}if(Mi(x)||di(x))return N!==null?null:f(g,v,x,j,null);ul(g,x)}return null}function m(g,v,x,j,N){if(typeof j=="string"&&j!==""||typeof j=="number")return g=g.get(x)||null,l(v,g,""+j,N);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case el:return g=g.get(j.key===null?x:j.key)||null,c(v,g,j,N);case ca:return g=g.get(j.key===null?x:j.key)||null,d(v,g,j,N);case zr:var k=j._init;return m(g,v,x,k(j._payload),N)}if(Mi(j)||di(j))return g=g.get(x)||null,f(v,g,j,N,null);ul(v,j)}return null}function w(g,v,x,j){for(var N=null,k=null,S=v,M=v=0,z=null;S!==null&&M<x.length;M++){S.index>M?(z=S,S=null):z=S.sibling;var $=h(g,S,x[M],j);if($===null){S===null&&(S=z);break}e&&S&&$.alternate===null&&t(g,S),v=i($,v,M),k===null?N=$:k.sibling=$,k=$,S=z}if(M===x.length)return n(g,S),qe&&gs(g,M),N;if(S===null){for(;M<x.length;M++)S=u(g,x[M],j),S!==null&&(v=i(S,v,M),k===null?N=S:k.sibling=S,k=S);return qe&&gs(g,M),N}for(S=r(g,S);M<x.length;M++)z=m(S,g,M,x[M],j),z!==null&&(e&&z.alternate!==null&&S.delete(z.key===null?M:z.key),v=i(z,v,M),k===null?N=z:k.sibling=z,k=z);return e&&S.forEach(function(A){return t(g,A)}),qe&&gs(g,M),N}function y(g,v,x,j){var N=di(x);if(typeof N!="function")throw Error(re(150));if(x=N.call(x),x==null)throw Error(re(151));for(var k=N=null,S=v,M=v=0,z=null,$=x.next();S!==null&&!$.done;M++,$=x.next()){S.index>M?(z=S,S=null):z=S.sibling;var A=h(g,S,$.value,j);if(A===null){S===null&&(S=z);break}e&&S&&A.alternate===null&&t(g,S),v=i(A,v,M),k===null?N=A:k.sibling=A,k=A,S=z}if($.done)return n(g,S),qe&&gs(g,M),N;if(S===null){for(;!$.done;M++,$=x.next())$=u(g,$.value,j),$!==null&&(v=i($,v,M),k===null?N=$:k.sibling=$,k=$);return qe&&gs(g,M),N}for(S=r(g,S);!$.done;M++,$=x.next())$=m(S,g,M,$.value,j),$!==null&&(e&&$.alternate!==null&&S.delete($.key===null?M:$.key),v=i($,v,M),k===null?N=$:k.sibling=$,k=$);return e&&S.forEach(function(O){return t(g,O)}),qe&&gs(g,M),N}function b(g,v,x,j){if(typeof x=="object"&&x!==null&&x.type===da&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case el:e:{for(var N=x.key,k=v;k!==null;){if(k.key===N){if(N=x.type,N===da){if(k.tag===7){n(g,k.sibling),v=s(k,x.props.children),v.return=g,g=v;break e}}else if(k.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===zr&&Yp(N)===k.type){n(g,k.sibling),v=s(k,x.props),v.ref=pi(g,k,x),v.return=g,g=v;break e}n(g,k);break}else t(g,k);k=k.sibling}x.type===da?(v=_s(x.props.children,g.mode,j,x.key),v.return=g,g=v):(j=Ul(x.type,x.key,x.props,null,g.mode,j),j.ref=pi(g,v,x),j.return=g,g=j)}return o(g);case ca:e:{for(k=x.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(g,v.sibling),v=s(v,x.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else t(g,v);v=v.sibling}v=ou(x,g.mode,j),v.return=g,g=v}return o(g);case zr:return k=x._init,b(g,v,k(x._payload),j)}if(Mi(x))return w(g,v,x,j);if(di(x))return y(g,v,x,j);ul(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(g,v.sibling),v=s(v,x),v.return=g,g=v):(n(g,v),v=iu(x,g.mode,j),v.return=g,g=v),o(g)):n(g,v)}return b}var $a=zy(!0),$y=zy(!1),hc=hs(null),mc=null,ya=null,Lh=null;function Fh(){Lh=ya=mc=null}function Bh(e){var t=hc.current;Ye(hc),e._currentValue=t}function yf(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ea(e,t){mc=e,Lh=ya=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ht=!0),e.firstContext=null)}function wn(e){var t=e._currentValue;if(Lh!==e)if(e={context:e,memoizedValue:t,next:null},ya===null){if(mc===null)throw Error(re(308));ya=e,mc.dependencies={lanes:0,firstContext:e}}else ya=ya.next=e;return t}var ks=null;function Wh(e){ks===null?ks=[e]:ks.push(e)}function Ly(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Wh(t)):(n.next=s.next,s.next=n),t.interleaved=n,jr(e,r)}function jr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var $r=!1;function Uh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fy(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function vr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Kr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Te&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,jr(e,n)}return s=r.interleaved,s===null?(t.next=t,Wh(r)):(t.next=s.next,s.next=t),r.interleaved=t,jr(e,n)}function zl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mh(e,n)}}function Xp(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function pc(e,t,n,r){var s=e.updateQueue;$r=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,d=c.next;c.next=null,o===null?i=d:o.next=d,o=c;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==o&&(l===null?f.firstBaseUpdate=d:l.next=d,f.lastBaseUpdate=c))}if(i!==null){var u=s.baseState;o=0,f=d=c=null,l=i;do{var h=l.lane,m=l.eventTime;if((r&h)===h){f!==null&&(f=f.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=e,y=l;switch(h=t,m=n,y.tag){case 1:if(w=y.payload,typeof w=="function"){u=w.call(m,u,h);break e}u=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=y.payload,h=typeof w=="function"?w.call(m,u,h):w,h==null)break e;u=rt({},u,h);break e;case 2:$r=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(d=f=m,c=u):f=f.next=m,o|=h;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;h=l,l=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(f===null&&(c=u),s.baseState=c,s.firstBaseUpdate=d,s.lastBaseUpdate=f,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);$s|=o,e.lanes=o,e.memoizedState=u}}function qp(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(re(191,s));s.call(r)}}}var Oo={},Zn=hs(Oo),ro=hs(Oo),so=hs(Oo);function Ss(e){if(e===Oo)throw Error(re(174));return e}function Vh(e,t){switch(We(so,t),We(ro,e),We(Zn,Oo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Qu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Qu(t,e)}Ye(Zn),We(Zn,t)}function La(){Ye(Zn),Ye(ro),Ye(so)}function By(e){Ss(so.current);var t=Ss(Zn.current),n=Qu(t,e.type);t!==n&&(We(ro,e),We(Zn,n))}function Hh(e){ro.current===e&&(Ye(Zn),Ye(ro))}var tt=hs(0);function xc(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==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var eu=[];function Yh(){for(var e=0;e<eu.length;e++)eu[e]._workInProgressVersionPrimary=null;eu.length=0}var $l=Mr.ReactCurrentDispatcher,tu=Mr.ReactCurrentBatchConfig,zs=0,nt=null,gt=null,bt=null,gc=!1,Li=!1,ao=0,N2=0;function Dt(){throw Error(re(321))}function Xh(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!An(e[n],t[n]))return!1;return!0}function qh(e,t,n,r,s,i){if(zs=i,nt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,$l.current=e===null||e.memoizedState===null?C2:E2,e=n(r,s),Li){i=0;do{if(Li=!1,ao=0,25<=i)throw Error(re(301));i+=1,bt=gt=null,t.updateQueue=null,$l.current=M2,e=n(r,s)}while(Li)}if($l.current=yc,t=gt!==null&>.next!==null,zs=0,bt=gt=nt=null,gc=!1,t)throw Error(re(300));return e}function Gh(){var e=ao!==0;return ao=0,e}function Vn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?nt.memoizedState=bt=e:bt=bt.next=e,bt}function bn(){if(gt===null){var e=nt.alternate;e=e!==null?e.memoizedState:null}else e=gt.next;var t=bt===null?nt.memoizedState:bt.next;if(t!==null)bt=t,gt=e;else{if(e===null)throw Error(re(310));gt=e,e={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},bt===null?nt.memoizedState=bt=e:bt=bt.next=e}return bt}function io(e,t){return typeof t=="function"?t(e):t}function nu(e){var t=bn(),n=t.queue;if(n===null)throw Error(re(311));n.lastRenderedReducer=e;var r=gt,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var l=o=null,c=null,d=i;do{var f=d.lane;if((zs&f)===f)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var u={lane:f,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=u,o=r):c=c.next=u,nt.lanes|=f,$s|=f}d=d.next}while(d!==null&&d!==i);c===null?o=r:c.next=l,An(r,t.memoizedState)||(Ht=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,nt.lanes|=i,$s|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ru(e){var t=bn(),n=t.queue;if(n===null)throw Error(re(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);An(i,t.memoizedState)||(Ht=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Wy(){}function Uy(e,t){var n=nt,r=bn(),s=t(),i=!An(r.memoizedState,s);if(i&&(r.memoizedState=s,Ht=!0),r=r.queue,Kh(Yy.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||bt!==null&&bt.memoizedState.tag&1){if(n.flags|=2048,oo(9,Hy.bind(null,n,r,s,t),void 0,null),Nt===null)throw Error(re(349));zs&30||Vy(n,t,s)}return s}function Vy(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=nt.updateQueue,t===null?(t={lastEffect:null,stores:null},nt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Hy(e,t,n,r){t.value=n,t.getSnapshot=r,Xy(t)&&qy(e)}function Yy(e,t,n){return n(function(){Xy(t)&&qy(e)})}function Xy(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!An(e,n)}catch{return!0}}function qy(e){var t=jr(e,1);t!==null&&Tn(t,e,1,-1)}function Gp(e){var t=Vn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:io,lastRenderedState:e},t.queue=e,e=e.dispatch=S2.bind(null,nt,e),[t.memoizedState,e]}function oo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=nt.updateQueue,t===null?(t={lastEffect:null,stores:null},nt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Gy(){return bn().memoizedState}function Ll(e,t,n,r){var s=Vn();nt.flags|=e,s.memoizedState=oo(1|t,n,void 0,r===void 0?null:r)}function Gc(e,t,n,r){var s=bn();r=r===void 0?null:r;var i=void 0;if(gt!==null){var o=gt.memoizedState;if(i=o.destroy,r!==null&&Xh(r,o.deps)){s.memoizedState=oo(t,n,i,r);return}}nt.flags|=e,s.memoizedState=oo(1|t,n,i,r)}function Kp(e,t){return Ll(8390656,8,e,t)}function Kh(e,t){return Gc(2048,8,e,t)}function Ky(e,t){return Gc(4,2,e,t)}function Qy(e,t){return Gc(4,4,e,t)}function Zy(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Jy(e,t,n){return n=n!=null?n.concat([e]):null,Gc(4,4,Zy.bind(null,t,e),n)}function Qh(){}function ev(e,t){var n=bn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Xh(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function tv(e,t){var n=bn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Xh(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function nv(e,t,n){return zs&21?(An(n,t)||(n=oy(),nt.lanes|=n,$s|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ht=!0),e.memoizedState=n)}function j2(e,t){var n=$e;$e=n!==0&&4>n?n:4,e(!0);var r=tu.transition;tu.transition={};try{e(!1),t()}finally{$e=n,tu.transition=r}}function rv(){return bn().memoizedState}function k2(e,t,n){var r=Zr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},sv(e))av(t,n);else if(n=Ly(e,t,n,r),n!==null){var s=Lt();Tn(n,e,r,s),iv(n,t,r)}}function S2(e,t,n){var r=Zr(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(sv(e))av(t,s);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(s.hasEagerState=!0,s.eagerState=l,An(l,o)){var c=t.interleaved;c===null?(s.next=s,Wh(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=Ly(e,t,s,r),n!==null&&(s=Lt(),Tn(n,e,r,s),iv(n,t,r))}}function sv(e){var t=e.alternate;return e===nt||t!==null&&t===nt}function av(e,t){Li=gc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function iv(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mh(e,n)}}var yc={readContext:wn,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useInsertionEffect:Dt,useLayoutEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useMutableSource:Dt,useSyncExternalStore:Dt,useId:Dt,unstable_isNewReconciler:!1},C2={readContext:wn,useCallback:function(e,t){return Vn().memoizedState=[e,t===void 0?null:t],e},useContext:wn,useEffect:Kp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ll(4194308,4,Zy.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ll(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ll(4,2,e,t)},useMemo:function(e,t){var n=Vn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Vn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=k2.bind(null,nt,e),[r.memoizedState,e]},useRef:function(e){var t=Vn();return e={current:e},t.memoizedState=e},useState:Gp,useDebugValue:Qh,useDeferredValue:function(e){return Vn().memoizedState=e},useTransition:function(){var e=Gp(!1),t=e[0];return e=j2.bind(null,e[1]),Vn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=nt,s=Vn();if(qe){if(n===void 0)throw Error(re(407));n=n()}else{if(n=t(),Nt===null)throw Error(re(349));zs&30||Vy(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Kp(Yy.bind(null,r,i,e),[e]),r.flags|=2048,oo(9,Hy.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Vn(),t=Nt.identifierPrefix;if(qe){var n=hr,r=fr;n=(r&~(1<<32-Dn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ao++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=N2++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},E2={readContext:wn,useCallback:ev,useContext:wn,useEffect:Kh,useImperativeHandle:Jy,useInsertionEffect:Ky,useLayoutEffect:Qy,useMemo:tv,useReducer:nu,useRef:Gy,useState:function(){return nu(io)},useDebugValue:Qh,useDeferredValue:function(e){var t=bn();return nv(t,gt.memoizedState,e)},useTransition:function(){var e=nu(io)[0],t=bn().memoizedState;return[e,t]},useMutableSource:Wy,useSyncExternalStore:Uy,useId:rv,unstable_isNewReconciler:!1},M2={readContext:wn,useCallback:ev,useContext:wn,useEffect:Kh,useImperativeHandle:Jy,useInsertionEffect:Ky,useLayoutEffect:Qy,useMemo:tv,useReducer:ru,useRef:Gy,useState:function(){return ru(io)},useDebugValue:Qh,useDeferredValue:function(e){var t=bn();return gt===null?t.memoizedState=e:nv(t,gt.memoizedState,e)},useTransition:function(){var e=ru(io)[0],t=bn().memoizedState;return[e,t]},useMutableSource:Wy,useSyncExternalStore:Uy,useId:rv,unstable_isNewReconciler:!1};function jn(e,t){if(e&&e.defaultProps){t=rt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function vf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:rt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Kc={isMounted:function(e){return(e=e._reactInternals)?Gs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Lt(),s=Zr(e),i=vr(r,s);i.payload=t,n!=null&&(i.callback=n),t=Kr(e,i,s),t!==null&&(Tn(t,e,s,r),zl(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Lt(),s=Zr(e),i=vr(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Kr(e,i,s),t!==null&&(Tn(t,e,s,r),zl(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Lt(),r=Zr(e),s=vr(n,r);s.tag=2,t!=null&&(s.callback=t),t=Kr(e,s,r),t!==null&&(Tn(t,e,r,n),zl(t,e,r))}};function Qp(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Ji(n,r)||!Ji(s,i):!0}function ov(e,t,n){var r=!1,s=is,i=t.contextType;return typeof i=="object"&&i!==null?i=wn(i):(s=qt(t)?Rs:It.current,r=t.contextTypes,i=(r=r!=null)?Ia(e,s):is),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Kc,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function Zp(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Kc.enqueueReplaceState(t,t.state,null)}function wf(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Uh(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=wn(i):(i=qt(t)?Rs:It.current,s.context=Ia(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(vf(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Kc.enqueueReplaceState(s,s.state,null),pc(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Fa(e,t){try{var n="",r=t;do n+=nk(r),r=r.return;while(r);var s=n}catch(i){s=`
|
|
39
|
+
Error generating stack: `+i.message+`
|
|
40
|
+
`+i.stack}return{value:e,source:t,stack:s,digest:null}}function su(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function bf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var _2=typeof WeakMap=="function"?WeakMap:Map;function lv(e,t,n){n=vr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){wc||(wc=!0,Df=r),bf(e,t)},n}function cv(e,t,n){n=vr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){bf(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){bf(e,t),typeof r!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Jp(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new _2;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=U2.bind(null,e,t,n),t.then(e,e))}function ex(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function tx(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=vr(-1,1),t.tag=2,Kr(n,t,1))),n.lanes|=1),e)}var P2=Mr.ReactCurrentOwner,Ht=!1;function $t(e,t,n,r){t.child=e===null?$y(t,null,n,r):$a(t,e.child,n,r)}function nx(e,t,n,r,s){n=n.render;var i=t.ref;return Ea(t,s),r=qh(e,t,n,r,i,s),n=Gh(),e!==null&&!Ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,kr(e,t,s)):(qe&&n&&Ih(t),t.flags|=1,$t(e,t,r,s),t.child)}function rx(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!am(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,dv(e,t,i,r,s)):(e=Ul(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ji,n(o,r)&&e.ref===t.ref)return kr(e,t,s)}return t.flags|=1,e=Jr(i,r),e.ref=t.ref,e.return=t,t.child=e}function dv(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(Ji(i,r)&&e.ref===t.ref)if(Ht=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(Ht=!0);else return t.lanes=e.lanes,kr(e,t,s)}return Nf(e,t,n,r,s)}function uv(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},We(wa,Jt),Jt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,We(wa,Jt),Jt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,We(wa,Jt),Jt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,We(wa,Jt),Jt|=r;return $t(e,t,s,n),t.child}function fv(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Nf(e,t,n,r,s){var i=qt(n)?Rs:It.current;return i=Ia(t,i),Ea(t,s),n=qh(e,t,n,r,i,s),r=Gh(),e!==null&&!Ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,kr(e,t,s)):(qe&&r&&Ih(t),t.flags|=1,$t(e,t,n,s),t.child)}function sx(e,t,n,r,s){if(qt(n)){var i=!0;dc(t)}else i=!1;if(Ea(t,s),t.stateNode===null)Fl(e,t),ov(t,n,r),wf(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,d=n.contextType;typeof d=="object"&&d!==null?d=wn(d):(d=qt(n)?Rs:It.current,d=Ia(t,d));var f=n.getDerivedStateFromProps,u=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||c!==d)&&Zp(t,o,r,d),$r=!1;var h=t.memoizedState;o.state=h,pc(t,r,o,s),c=t.memoizedState,l!==r||h!==c||Xt.current||$r?(typeof f=="function"&&(vf(t,n,f,r),c=t.memoizedState),(l=$r||Qp(t,n,l,r,h,c,d))?(u||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=d,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Fy(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:jn(t.type,l),o.props=d,u=t.pendingProps,h=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=wn(c):(c=qt(n)?Rs:It.current,c=Ia(t,c));var m=n.getDerivedStateFromProps;(f=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==u||h!==c)&&Zp(t,o,r,c),$r=!1,h=t.memoizedState,o.state=h,pc(t,r,o,s);var w=t.memoizedState;l!==u||h!==w||Xt.current||$r?(typeof m=="function"&&(vf(t,n,m,r),w=t.memoizedState),(d=$r||Qp(t,n,d,r,h,w,c)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,w,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,w,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=w),o.props=r,o.state=w,o.context=c,r=d):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return jf(e,t,n,r,i,s)}function jf(e,t,n,r,s,i){fv(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&Up(t,n,!1),kr(e,t,i);r=t.stateNode,P2.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=$a(t,e.child,null,i),t.child=$a(t,null,l,i)):$t(e,t,l,i),t.memoizedState=r.state,s&&Up(t,n,!0),t.child}function hv(e){var t=e.stateNode;t.pendingContext?Wp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Wp(e,t.context,!1),Vh(e,t.containerInfo)}function ax(e,t,n,r,s){return za(),$h(s),t.flags|=256,$t(e,t,n,r),t.child}var kf={dehydrated:null,treeContext:null,retryLane:0};function Sf(e){return{baseLanes:e,cachePool:null,transitions:null}}function mv(e,t,n){var r=t.pendingProps,s=tt.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),We(tt,s&1),e===null)return gf(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Jc(o,r,0,null),e=_s(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Sf(n),t.memoizedState=kf,e):Zh(t,o));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return D2(e,t,o,r,l,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Jr(s,c),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?i=Jr(l,i):(i=_s(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?Sf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=kf,r}return i=e.child,e=i.sibling,r=Jr(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Zh(e,t){return t=Jc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function fl(e,t,n,r){return r!==null&&$h(r),$a(t,e.child,null,n),e=Zh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function D2(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=su(Error(re(422))),fl(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=Jc({mode:"visible",children:r.children},s,0,null),i=_s(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&$a(t,e.child,null,o),t.child.memoizedState=Sf(o),t.memoizedState=kf,i);if(!(t.mode&1))return fl(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(re(419)),r=su(i,r,void 0),fl(e,t,o,r)}if(l=(o&e.childLanes)!==0,Ht||l){if(r=Nt,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,jr(e,s),Tn(r,e,s,-1))}return sm(),r=su(Error(re(421))),fl(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=V2.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,rn=Gr(s.nextSibling),sn=t,qe=!0,Cn=null,e!==null&&(xn[gn++]=fr,xn[gn++]=hr,xn[gn++]=Is,fr=e.id,hr=e.overflow,Is=t),t=Zh(t,r.children),t.flags|=4096,t)}function ix(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),yf(e.return,t,n)}function au(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function pv(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if($t(e,t,r.children,n),r=tt.current,r&2)r=r&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&&ix(e,n,t);else if(e.tag===19)ix(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}r&=1}if(We(tt,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&xc(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),au(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&xc(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}au(t,!0,n,null,i);break;case"together":au(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Fl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function kr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),$s|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(re(153));if(t.child!==null){for(e=t.child,n=Jr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Jr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function T2(e,t,n){switch(t.tag){case 3:hv(t),za();break;case 5:By(t);break;case 1:qt(t.type)&&dc(t);break;case 4:Vh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;We(hc,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(We(tt,tt.current&1),t.flags|=128,null):n&t.child.childLanes?mv(e,t,n):(We(tt,tt.current&1),e=kr(e,t,n),e!==null?e.sibling:null);We(tt,tt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return pv(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),We(tt,tt.current),r)break;return null;case 22:case 23:return t.lanes=0,uv(e,t,n)}return kr(e,t,n)}var xv,Cf,gv,yv;xv=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Cf=function(){};gv=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Ss(Zn.current);var i=null;switch(n){case"input":s=Xu(e,s),r=Xu(e,r),i=[];break;case"select":s=rt({},s,{value:void 0}),r=rt({},r,{value:void 0}),i=[];break;case"textarea":s=Ku(e,s),r=Ku(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=lc)}Zu(n,r);var o;n=null;for(d in s)if(!r.hasOwnProperty(d)&&s.hasOwnProperty(d)&&s[d]!=null)if(d==="style"){var l=s[d];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Yi.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in r){var c=r[d];if(l=s!=null?s[d]:void 0,r.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(i||(i=[]),i.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Yi.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&He("scroll",e),i||l===c||(i=[])):(i=i||[]).push(d,c))}n&&(i=i||[]).push("style",n);var d=i;(t.updateQueue=d)&&(t.flags|=4)}};yv=function(e,t,n,r){n!==r&&(t.flags|=4)};function xi(e,t){if(!qe)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function O2(e,t,n){var r=t.pendingProps;switch(zh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tt(t),null;case 1:return qt(t.type)&&cc(),Tt(t),null;case 3:return r=t.stateNode,La(),Ye(Xt),Ye(It),Yh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(dl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Cn!==null&&(Af(Cn),Cn=null))),Cf(e,t),Tt(t),null;case 5:Hh(t);var s=Ss(so.current);if(n=t.type,e!==null&&t.stateNode!=null)gv(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(re(166));return Tt(t),null}if(e=Ss(Zn.current),dl(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Xn]=t,r[no]=i,e=(t.mode&1)!==0,n){case"dialog":He("cancel",r),He("close",r);break;case"iframe":case"object":case"embed":He("load",r);break;case"video":case"audio":for(s=0;s<Pi.length;s++)He(Pi[s],r);break;case"source":He("error",r);break;case"img":case"image":case"link":He("error",r),He("load",r);break;case"details":He("toggle",r);break;case"input":pp(r,i),He("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},He("invalid",r);break;case"textarea":gp(r,i),He("invalid",r)}Zu(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&cl(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&cl(r.textContent,l,e),s=["children",""+l]):Yi.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&He("scroll",r)}switch(n){case"input":tl(r),xp(r,i,!0);break;case"textarea":tl(r),yp(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=lc)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Y0(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Xn]=t,e[no]=r,xv(e,t,!1,!1),t.stateNode=e;e:{switch(o=Ju(n,r),n){case"dialog":He("cancel",e),He("close",e),s=r;break;case"iframe":case"object":case"embed":He("load",e),s=r;break;case"video":case"audio":for(s=0;s<Pi.length;s++)He(Pi[s],e);s=r;break;case"source":He("error",e),s=r;break;case"img":case"image":case"link":He("error",e),He("load",e),s=r;break;case"details":He("toggle",e),s=r;break;case"input":pp(e,r),s=Xu(e,r),He("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=rt({},r,{value:void 0}),He("invalid",e);break;case"textarea":gp(e,r),s=Ku(e,r),He("invalid",e);break;default:s=r}Zu(n,s),l=s;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?G0(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&X0(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Xi(e,c):typeof c=="number"&&Xi(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Yi.hasOwnProperty(i)?c!=null&&i==="onScroll"&&He("scroll",e):c!=null&&Nh(e,i,c,o))}switch(n){case"input":tl(e),xp(e,r,!1);break;case"textarea":tl(e),yp(e);break;case"option":r.value!=null&&e.setAttribute("value",""+as(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?ja(e,!!r.multiple,i,!1):r.defaultValue!=null&&ja(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=lc)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Tt(t),null;case 6:if(e&&t.stateNode!=null)yv(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(re(166));if(n=Ss(so.current),Ss(Zn.current),dl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Xn]=t,(i=r.nodeValue!==n)&&(e=sn,e!==null))switch(e.tag){case 3:cl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&cl(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Xn]=t,t.stateNode=r}return Tt(t),null;case 13:if(Ye(tt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(qe&&rn!==null&&t.mode&1&&!(t.flags&128))Iy(),za(),t.flags|=98560,i=!1;else if(i=dl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(re(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(re(317));i[Xn]=t}else za(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Tt(t),i=!1}else Cn!==null&&(Af(Cn),Cn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||tt.current&1?vt===0&&(vt=3):sm())),t.updateQueue!==null&&(t.flags|=4),Tt(t),null);case 4:return La(),Cf(e,t),e===null&&eo(t.stateNode.containerInfo),Tt(t),null;case 10:return Bh(t.type._context),Tt(t),null;case 17:return qt(t.type)&&cc(),Tt(t),null;case 19:if(Ye(tt),i=t.memoizedState,i===null)return Tt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)xi(i,!1);else{if(vt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=xc(e),o!==null){for(t.flags|=128,xi(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return We(tt,tt.current&1|2),t.child}e=e.sibling}i.tail!==null&&ot()>Ba&&(t.flags|=128,r=!0,xi(i,!1),t.lanes=4194304)}else{if(!r)if(e=xc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),xi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!qe)return Tt(t),null}else 2*ot()-i.renderingStartTime>Ba&&n!==1073741824&&(t.flags|=128,r=!0,xi(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ot(),t.sibling=null,n=tt.current,We(tt,r?n&1|2:n&1),t):(Tt(t),null);case 22:case 23:return rm(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Jt&1073741824&&(Tt(t),t.subtreeFlags&6&&(t.flags|=8192)):Tt(t),null;case 24:return null;case 25:return null}throw Error(re(156,t.tag))}function A2(e,t){switch(zh(t),t.tag){case 1:return qt(t.type)&&cc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return La(),Ye(Xt),Ye(It),Yh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Hh(t),null;case 13:if(Ye(tt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(re(340));za()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ye(tt),null;case 4:return La(),null;case 10:return Bh(t.type._context),null;case 22:case 23:return rm(),null;case 24:return null;default:return null}}var hl=!1,At=!1,R2=typeof WeakSet=="function"?WeakSet:Set,ue=null;function va(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){at(e,t,r)}else n.current=null}function Ef(e,t,n){try{n()}catch(r){at(e,t,r)}}var ox=!1;function I2(e,t){if(df=ac,e=jy(),Rh(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,d=0,f=0,u=e,h=null;t:for(;;){for(var m;u!==n||s!==0&&u.nodeType!==3||(l=o+s),u!==i||r!==0&&u.nodeType!==3||(c=o+r),u.nodeType===3&&(o+=u.nodeValue.length),(m=u.firstChild)!==null;)h=u,u=m;for(;;){if(u===e)break t;if(h===n&&++d===s&&(l=o),h===i&&++f===r&&(c=o),(m=u.nextSibling)!==null)break;u=h,h=u.parentNode}u=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(uf={focusedElem:e,selectionRange:n},ac=!1,ue=t;ue!==null;)if(t=ue,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ue=e;else for(;ue!==null;){t=ue;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var y=w.memoizedProps,b=w.memoizedState,g=t.stateNode,v=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:jn(t.type,y),b);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(re(163))}}catch(j){at(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,ue=e;break}ue=t.return}return w=ox,ox=!1,w}function Fi(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Ef(t,n,i)}s=s.next}while(s!==r)}}function Qc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Mf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function vv(e){var t=e.alternate;t!==null&&(e.alternate=null,vv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xn],delete t[no],delete t[mf],delete t[y2],delete t[v2])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function wv(e){return e.tag===5||e.tag===3||e.tag===4}function lx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||wv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function _f(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=lc));else if(r!==4&&(e=e.child,e!==null))for(_f(e,t,n),e=e.sibling;e!==null;)_f(e,t,n),e=e.sibling}function Pf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Pf(e,t,n),e=e.sibling;e!==null;)Pf(e,t,n),e=e.sibling}var kt=null,kn=!1;function Pr(e,t,n){for(n=n.child;n!==null;)bv(e,t,n),n=n.sibling}function bv(e,t,n){if(Qn&&typeof Qn.onCommitFiberUnmount=="function")try{Qn.onCommitFiberUnmount(Uc,n)}catch{}switch(n.tag){case 5:At||va(n,t);case 6:var r=kt,s=kn;kt=null,Pr(e,t,n),kt=r,kn=s,kt!==null&&(kn?(e=kt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):kt.removeChild(n.stateNode));break;case 18:kt!==null&&(kn?(e=kt,n=n.stateNode,e.nodeType===8?Zd(e.parentNode,n):e.nodeType===1&&Zd(e,n),Qi(e)):Zd(kt,n.stateNode));break;case 4:r=kt,s=kn,kt=n.stateNode.containerInfo,kn=!0,Pr(e,t,n),kt=r,kn=s;break;case 0:case 11:case 14:case 15:if(!At&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Ef(n,t,o),s=s.next}while(s!==r)}Pr(e,t,n);break;case 1:if(!At&&(va(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){at(n,t,l)}Pr(e,t,n);break;case 21:Pr(e,t,n);break;case 22:n.mode&1?(At=(r=At)||n.memoizedState!==null,Pr(e,t,n),At=r):Pr(e,t,n);break;default:Pr(e,t,n)}}function cx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new R2),t.forEach(function(r){var s=H2.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Nn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:kt=l.stateNode,kn=!1;break e;case 3:kt=l.stateNode.containerInfo,kn=!0;break e;case 4:kt=l.stateNode.containerInfo,kn=!0;break e}l=l.return}if(kt===null)throw Error(re(160));bv(i,o,s),kt=null,kn=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(d){at(s,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Nv(t,e),t=t.sibling}function Nv(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Nn(t,e),Fn(e),r&4){try{Fi(3,e,e.return),Qc(3,e)}catch(y){at(e,e.return,y)}try{Fi(5,e,e.return)}catch(y){at(e,e.return,y)}}break;case 1:Nn(t,e),Fn(e),r&512&&n!==null&&va(n,n.return);break;case 5:if(Nn(t,e),Fn(e),r&512&&n!==null&&va(n,n.return),e.flags&32){var s=e.stateNode;try{Xi(s,"")}catch(y){at(e,e.return,y)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&V0(s,i),Ju(l,o);var d=Ju(l,i);for(o=0;o<c.length;o+=2){var f=c[o],u=c[o+1];f==="style"?G0(s,u):f==="dangerouslySetInnerHTML"?X0(s,u):f==="children"?Xi(s,u):Nh(s,f,u,d)}switch(l){case"input":qu(s,i);break;case"textarea":H0(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?ja(s,!!i.multiple,m,!1):h!==!!i.multiple&&(i.defaultValue!=null?ja(s,!!i.multiple,i.defaultValue,!0):ja(s,!!i.multiple,i.multiple?[]:"",!1))}s[no]=i}catch(y){at(e,e.return,y)}}break;case 6:if(Nn(t,e),Fn(e),r&4){if(e.stateNode===null)throw Error(re(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(y){at(e,e.return,y)}}break;case 3:if(Nn(t,e),Fn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Qi(t.containerInfo)}catch(y){at(e,e.return,y)}break;case 4:Nn(t,e),Fn(e);break;case 13:Nn(t,e),Fn(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(tm=ot())),r&4&&cx(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(At=(d=At)||f,Nn(t,e),At=d):Nn(t,e),Fn(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!f&&e.mode&1)for(ue=e,f=e.child;f!==null;){for(u=ue=f;ue!==null;){switch(h=ue,m=h.child,h.tag){case 0:case 11:case 14:case 15:Fi(4,h,h.return);break;case 1:va(h,h.return);var w=h.stateNode;if(typeof w.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(y){at(r,n,y)}}break;case 5:va(h,h.return);break;case 22:if(h.memoizedState!==null){ux(u);continue}}m!==null?(m.return=h,ue=m):ux(u)}f=f.sibling}e:for(f=null,u=e;;){if(u.tag===5){if(f===null){f=u;try{s=u.stateNode,d?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=u.stateNode,c=u.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=q0("display",o))}catch(y){at(e,e.return,y)}}}else if(u.tag===6){if(f===null)try{u.stateNode.nodeValue=d?"":u.memoizedProps}catch(y){at(e,e.return,y)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;f===u&&(f=null),u=u.return}f===u&&(f=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:Nn(t,e),Fn(e),r&4&&cx(e);break;case 21:break;default:Nn(t,e),Fn(e)}}function Fn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(wv(n)){var r=n;break e}n=n.return}throw Error(re(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Xi(s,""),r.flags&=-33);var i=lx(e);Pf(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,l=lx(e);_f(e,l,o);break;default:throw Error(re(161))}}catch(c){at(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function z2(e,t,n){ue=e,jv(e)}function jv(e,t,n){for(var r=(e.mode&1)!==0;ue!==null;){var s=ue,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||hl;if(!o){var l=s.alternate,c=l!==null&&l.memoizedState!==null||At;l=hl;var d=At;if(hl=o,(At=c)&&!d)for(ue=s;ue!==null;)o=ue,c=o.child,o.tag===22&&o.memoizedState!==null?fx(s):c!==null?(c.return=o,ue=c):fx(s);for(;i!==null;)ue=i,jv(i),i=i.sibling;ue=s,hl=l,At=d}dx(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,ue=i):dx(e)}}function dx(e){for(;ue!==null;){var t=ue;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:At||Qc(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!At)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:jn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&qp(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}qp(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var f=d.memoizedState;if(f!==null){var u=f.dehydrated;u!==null&&Qi(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(re(163))}At||t.flags&512&&Mf(t)}catch(h){at(t,t.return,h)}}if(t===e){ue=null;break}if(n=t.sibling,n!==null){n.return=t.return,ue=n;break}ue=t.return}}function ux(e){for(;ue!==null;){var t=ue;if(t===e){ue=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ue=n;break}ue=t.return}}function fx(e){for(;ue!==null;){var t=ue;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Qc(4,t)}catch(c){at(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(c){at(t,s,c)}}var i=t.return;try{Mf(t)}catch(c){at(t,i,c)}break;case 5:var o=t.return;try{Mf(t)}catch(c){at(t,o,c)}}}catch(c){at(t,t.return,c)}if(t===e){ue=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ue=l;break}ue=t.return}}var $2=Math.ceil,vc=Mr.ReactCurrentDispatcher,Jh=Mr.ReactCurrentOwner,vn=Mr.ReactCurrentBatchConfig,Te=0,Nt=null,ft=null,Mt=0,Jt=0,wa=hs(0),vt=0,lo=null,$s=0,Zc=0,em=0,Bi=null,Vt=null,tm=0,Ba=1/0,dr=null,wc=!1,Df=null,Qr=null,ml=!1,Ur=null,bc=0,Wi=0,Tf=null,Bl=-1,Wl=0;function Lt(){return Te&6?ot():Bl!==-1?Bl:Bl=ot()}function Zr(e){return e.mode&1?Te&2&&Mt!==0?Mt&-Mt:b2.transition!==null?(Wl===0&&(Wl=oy()),Wl):(e=$e,e!==0||(e=window.event,e=e===void 0?16:my(e.type)),e):1}function Tn(e,t,n,r){if(50<Wi)throw Wi=0,Tf=null,Error(re(185));Po(e,n,r),(!(Te&2)||e!==Nt)&&(e===Nt&&(!(Te&2)&&(Zc|=n),vt===4&&Fr(e,Mt)),Gt(e,r),n===1&&Te===0&&!(t.mode&1)&&(Ba=ot()+500,qc&&ms()))}function Gt(e,t){var n=e.callbackNode;bk(e,t);var r=sc(e,e===Nt?Mt:0);if(r===0)n!==null&&bp(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&bp(n),t===1)e.tag===0?w2(hx.bind(null,e)):Oy(hx.bind(null,e)),x2(function(){!(Te&6)&&ms()}),n=null;else{switch(ly(r)){case 1:n=Eh;break;case 4:n=ay;break;case 16:n=rc;break;case 536870912:n=iy;break;default:n=rc}n=Dv(n,kv.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function kv(e,t){if(Bl=-1,Wl=0,Te&6)throw Error(re(327));var n=e.callbackNode;if(Ma()&&e.callbackNode!==n)return null;var r=sc(e,e===Nt?Mt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Nc(e,r);else{t=r;var s=Te;Te|=2;var i=Cv();(Nt!==e||Mt!==t)&&(dr=null,Ba=ot()+500,Ms(e,t));do try{B2();break}catch(l){Sv(e,l)}while(!0);Fh(),vc.current=i,Te=s,ft!==null?t=0:(Nt=null,Mt=0,t=vt)}if(t!==0){if(t===2&&(s=sf(e),s!==0&&(r=s,t=Of(e,s))),t===1)throw n=lo,Ms(e,0),Fr(e,r),Gt(e,ot()),n;if(t===6)Fr(e,r);else{if(s=e.current.alternate,!(r&30)&&!L2(s)&&(t=Nc(e,r),t===2&&(i=sf(e),i!==0&&(r=i,t=Of(e,i))),t===1))throw n=lo,Ms(e,0),Fr(e,r),Gt(e,ot()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(re(345));case 2:ys(e,Vt,dr);break;case 3:if(Fr(e,r),(r&130023424)===r&&(t=tm+500-ot(),10<t)){if(sc(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Lt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=hf(ys.bind(null,e,Vt,dr),t);break}ys(e,Vt,dr);break;case 4:if(Fr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-Dn(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=ot()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*$2(r/1960))-r,10<r){e.timeoutHandle=hf(ys.bind(null,e,Vt,dr),r);break}ys(e,Vt,dr);break;case 5:ys(e,Vt,dr);break;default:throw Error(re(329))}}}return Gt(e,ot()),e.callbackNode===n?kv.bind(null,e):null}function Of(e,t){var n=Bi;return e.current.memoizedState.isDehydrated&&(Ms(e,t).flags|=256),e=Nc(e,t),e!==2&&(t=Vt,Vt=n,t!==null&&Af(t)),e}function Af(e){Vt===null?Vt=e:Vt.push.apply(Vt,e)}function L2(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!An(i(),s))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 Fr(e,t){for(t&=~em,t&=~Zc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Dn(t),r=1<<n;e[n]=-1,t&=~r}}function hx(e){if(Te&6)throw Error(re(327));Ma();var t=sc(e,0);if(!(t&1))return Gt(e,ot()),null;var n=Nc(e,t);if(e.tag!==0&&n===2){var r=sf(e);r!==0&&(t=r,n=Of(e,r))}if(n===1)throw n=lo,Ms(e,0),Fr(e,t),Gt(e,ot()),n;if(n===6)throw Error(re(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ys(e,Vt,dr),Gt(e,ot()),null}function nm(e,t){var n=Te;Te|=1;try{return e(t)}finally{Te=n,Te===0&&(Ba=ot()+500,qc&&ms())}}function Ls(e){Ur!==null&&Ur.tag===0&&!(Te&6)&&Ma();var t=Te;Te|=1;var n=vn.transition,r=$e;try{if(vn.transition=null,$e=1,e)return e()}finally{$e=r,vn.transition=n,Te=t,!(Te&6)&&ms()}}function rm(){Jt=wa.current,Ye(wa)}function Ms(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,p2(n)),ft!==null)for(n=ft.return;n!==null;){var r=n;switch(zh(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&cc();break;case 3:La(),Ye(Xt),Ye(It),Yh();break;case 5:Hh(r);break;case 4:La();break;case 13:Ye(tt);break;case 19:Ye(tt);break;case 10:Bh(r.type._context);break;case 22:case 23:rm()}n=n.return}if(Nt=e,ft=e=Jr(e.current,null),Mt=Jt=t,vt=0,lo=null,em=Zc=$s=0,Vt=Bi=null,ks!==null){for(t=0;t<ks.length;t++)if(n=ks[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}ks=null}return e}function Sv(e,t){do{var n=ft;try{if(Fh(),$l.current=yc,gc){for(var r=nt.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}gc=!1}if(zs=0,bt=gt=nt=null,Li=!1,ao=0,Jh.current=null,n===null||n.return===null){vt=1,lo=t,ft=null;break}e:{var i=e,o=n.return,l=n,c=t;if(t=Mt,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,f=l,u=f.tag;if(!(f.mode&1)&&(u===0||u===11||u===15)){var h=f.alternate;h?(f.updateQueue=h.updateQueue,f.memoizedState=h.memoizedState,f.lanes=h.lanes):(f.updateQueue=null,f.memoizedState=null)}var m=ex(o);if(m!==null){m.flags&=-257,tx(m,o,l,i,t),m.mode&1&&Jp(i,d,t),t=m,c=d;var w=t.updateQueue;if(w===null){var y=new Set;y.add(c),t.updateQueue=y}else w.add(c);break e}else{if(!(t&1)){Jp(i,d,t),sm();break e}c=Error(re(426))}}else if(qe&&l.mode&1){var b=ex(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),tx(b,o,l,i,t),$h(Fa(c,l));break e}}i=c=Fa(c,l),vt!==4&&(vt=2),Bi===null?Bi=[i]:Bi.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=lv(i,c,t);Xp(i,g);break e;case 1:l=c;var v=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof v.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Qr===null||!Qr.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var j=cv(i,l,t);Xp(i,j);break e}}i=i.return}while(i!==null)}Mv(n)}catch(N){t=N,ft===n&&n!==null&&(ft=n=n.return);continue}break}while(!0)}function Cv(){var e=vc.current;return vc.current=yc,e===null?yc:e}function sm(){(vt===0||vt===3||vt===2)&&(vt=4),Nt===null||!($s&268435455)&&!(Zc&268435455)||Fr(Nt,Mt)}function Nc(e,t){var n=Te;Te|=2;var r=Cv();(Nt!==e||Mt!==t)&&(dr=null,Ms(e,t));do try{F2();break}catch(s){Sv(e,s)}while(!0);if(Fh(),Te=n,vc.current=r,ft!==null)throw Error(re(261));return Nt=null,Mt=0,vt}function F2(){for(;ft!==null;)Ev(ft)}function B2(){for(;ft!==null&&!fk();)Ev(ft)}function Ev(e){var t=Pv(e.alternate,e,Jt);e.memoizedProps=e.pendingProps,t===null?Mv(e):ft=t,Jh.current=null}function Mv(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=A2(n,t),n!==null){n.flags&=32767,ft=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{vt=6,ft=null;return}}else if(n=O2(n,t,Jt),n!==null){ft=n;return}if(t=t.sibling,t!==null){ft=t;return}ft=t=e}while(t!==null);vt===0&&(vt=5)}function ys(e,t,n){var r=$e,s=vn.transition;try{vn.transition=null,$e=1,W2(e,t,n,r)}finally{vn.transition=s,$e=r}return null}function W2(e,t,n,r){do Ma();while(Ur!==null);if(Te&6)throw Error(re(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(re(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(Nk(e,i),e===Nt&&(ft=Nt=null,Mt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ml||(ml=!0,Dv(rc,function(){return Ma(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=vn.transition,vn.transition=null;var o=$e;$e=1;var l=Te;Te|=4,Jh.current=null,I2(e,n),Nv(n,e),l2(uf),ac=!!df,uf=df=null,e.current=n,z2(n),hk(),Te=l,$e=o,vn.transition=i}else e.current=n;if(ml&&(ml=!1,Ur=e,bc=s),i=e.pendingLanes,i===0&&(Qr=null),xk(n.stateNode),Gt(e,ot()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(wc)throw wc=!1,e=Df,Df=null,e;return bc&1&&e.tag!==0&&Ma(),i=e.pendingLanes,i&1?e===Tf?Wi++:(Wi=0,Tf=e):Wi=0,ms(),null}function Ma(){if(Ur!==null){var e=ly(bc),t=vn.transition,n=$e;try{if(vn.transition=null,$e=16>e?16:e,Ur===null)var r=!1;else{if(e=Ur,Ur=null,bc=0,Te&6)throw Error(re(331));var s=Te;for(Te|=4,ue=e.current;ue!==null;){var i=ue,o=i.child;if(ue.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(ue=d;ue!==null;){var f=ue;switch(f.tag){case 0:case 11:case 15:Fi(8,f,i)}var u=f.child;if(u!==null)u.return=f,ue=u;else for(;ue!==null;){f=ue;var h=f.sibling,m=f.return;if(vv(f),f===d){ue=null;break}if(h!==null){h.return=m,ue=h;break}ue=m}}}var w=i.alternate;if(w!==null){var y=w.child;if(y!==null){w.child=null;do{var b=y.sibling;y.sibling=null,y=b}while(y!==null)}}ue=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,ue=o;else e:for(;ue!==null;){if(i=ue,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Fi(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,ue=g;break e}ue=i.return}}var v=e.current;for(ue=v;ue!==null;){o=ue;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,ue=x;else e:for(o=v;ue!==null;){if(l=ue,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Qc(9,l)}}catch(N){at(l,l.return,N)}if(l===o){ue=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,ue=j;break e}ue=l.return}}if(Te=s,ms(),Qn&&typeof Qn.onPostCommitFiberRoot=="function")try{Qn.onPostCommitFiberRoot(Uc,e)}catch{}r=!0}return r}finally{$e=n,vn.transition=t}}return!1}function mx(e,t,n){t=Fa(n,t),t=lv(e,t,1),e=Kr(e,t,1),t=Lt(),e!==null&&(Po(e,1,t),Gt(e,t))}function at(e,t,n){if(e.tag===3)mx(e,e,n);else for(;t!==null;){if(t.tag===3){mx(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Qr===null||!Qr.has(r))){e=Fa(n,e),e=cv(t,e,1),t=Kr(t,e,1),e=Lt(),t!==null&&(Po(t,1,e),Gt(t,e));break}}t=t.return}}function U2(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Lt(),e.pingedLanes|=e.suspendedLanes&n,Nt===e&&(Mt&n)===n&&(vt===4||vt===3&&(Mt&130023424)===Mt&&500>ot()-tm?Ms(e,0):em|=n),Gt(e,t)}function _v(e,t){t===0&&(e.mode&1?(t=sl,sl<<=1,!(sl&130023424)&&(sl=4194304)):t=1);var n=Lt();e=jr(e,t),e!==null&&(Po(e,t,n),Gt(e,n))}function V2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_v(e,n)}function H2(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(re(314))}r!==null&&r.delete(t),_v(e,n)}var Pv;Pv=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Xt.current)Ht=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ht=!1,T2(e,t,n);Ht=!!(e.flags&131072)}else Ht=!1,qe&&t.flags&1048576&&Ay(t,fc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Fl(e,t),e=t.pendingProps;var s=Ia(t,It.current);Ea(t,n),s=qh(null,t,r,e,s,n);var i=Gh();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,qt(r)?(i=!0,dc(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Uh(t),s.updater=Kc,t.stateNode=s,s._reactInternals=t,wf(t,r,e,n),t=jf(null,t,r,!0,i,n)):(t.tag=0,qe&&i&&Ih(t),$t(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Fl(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=X2(r),e=jn(r,e),s){case 0:t=Nf(null,t,r,e,n);break e;case 1:t=sx(null,t,r,e,n);break e;case 11:t=nx(null,t,r,e,n);break e;case 14:t=rx(null,t,r,jn(r.type,e),n);break e}throw Error(re(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:jn(r,s),Nf(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:jn(r,s),sx(e,t,r,s,n);case 3:e:{if(hv(t),e===null)throw Error(re(387));r=t.pendingProps,i=t.memoizedState,s=i.element,Fy(e,t),pc(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Fa(Error(re(423)),t),t=ax(e,t,r,n,s);break e}else if(r!==s){s=Fa(Error(re(424)),t),t=ax(e,t,r,n,s);break e}else for(rn=Gr(t.stateNode.containerInfo.firstChild),sn=t,qe=!0,Cn=null,n=$y(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(za(),r===s){t=kr(e,t,n);break e}$t(e,t,r,n)}t=t.child}return t;case 5:return By(t),e===null&&gf(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,ff(r,s)?o=null:i!==null&&ff(r,i)&&(t.flags|=32),fv(e,t),$t(e,t,o,n),t.child;case 6:return e===null&&gf(t),null;case 13:return mv(e,t,n);case 4:return Vh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=$a(t,null,r,n):$t(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:jn(r,s),nx(e,t,r,s,n);case 7:return $t(e,t,t.pendingProps,n),t.child;case 8:return $t(e,t,t.pendingProps.children,n),t.child;case 12:return $t(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,We(hc,r._currentValue),r._currentValue=o,i!==null)if(An(i.value,o)){if(i.children===s.children&&!Xt.current){t=kr(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=vr(-1,n&-n),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var f=d.pending;f===null?c.next=c:(c.next=f.next,f.next=c),d.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),yf(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(re(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),yf(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}$t(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Ea(t,n),s=wn(s),r=r(s),t.flags|=1,$t(e,t,r,n),t.child;case 14:return r=t.type,s=jn(r,t.pendingProps),s=jn(r.type,s),rx(e,t,r,s,n);case 15:return dv(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:jn(r,s),Fl(e,t),t.tag=1,qt(r)?(e=!0,dc(t)):e=!1,Ea(t,n),ov(t,r,s),wf(t,r,s,n),jf(null,t,r,!0,e,n);case 19:return pv(e,t,n);case 22:return uv(e,t,n)}throw Error(re(156,t.tag))};function Dv(e,t){return sy(e,t)}function Y2(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yn(e,t,n,r){return new Y2(e,t,n,r)}function am(e){return e=e.prototype,!(!e||!e.isReactComponent)}function X2(e){if(typeof e=="function")return am(e)?1:0;if(e!=null){if(e=e.$$typeof,e===kh)return 11;if(e===Sh)return 14}return 2}function Jr(e,t){var n=e.alternate;return n===null?(n=yn(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&14680064,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}function Ul(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")am(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case da:return _s(n.children,s,i,t);case jh:o=8,s|=8;break;case Uu:return e=yn(12,n,t,s|2),e.elementType=Uu,e.lanes=i,e;case Vu:return e=yn(13,n,t,s),e.elementType=Vu,e.lanes=i,e;case Hu:return e=yn(19,n,t,s),e.elementType=Hu,e.lanes=i,e;case B0:return Jc(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case L0:o=10;break e;case F0:o=9;break e;case kh:o=11;break e;case Sh:o=14;break e;case zr:o=16,r=null;break e}throw Error(re(130,e==null?e:typeof e,""))}return t=yn(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function _s(e,t,n,r){return e=yn(7,e,r,t),e.lanes=n,e}function Jc(e,t,n,r){return e=yn(22,e,r,t),e.elementType=B0,e.lanes=n,e.stateNode={isHidden:!1},e}function iu(e,t,n){return e=yn(6,e,null,t),e.lanes=n,e}function ou(e,t,n){return t=yn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function q2(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bd(0),this.expirationTimes=Bd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bd(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function im(e,t,n,r,s,i,o,l,c){return e=new q2(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=yn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Uh(i),e}function G2(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ca,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Tv(e){if(!e)return is;e=e._reactInternals;e:{if(Gs(e)!==e||e.tag!==1)throw Error(re(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(qt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(re(171))}if(e.tag===1){var n=e.type;if(qt(n))return Ty(e,n,t)}return t}function Ov(e,t,n,r,s,i,o,l,c){return e=im(n,r,!0,e,s,i,o,l,c),e.context=Tv(null),n=e.current,r=Lt(),s=Zr(n),i=vr(r,s),i.callback=t??null,Kr(n,i,s),e.current.lanes=s,Po(e,s,r),Gt(e,r),e}function ed(e,t,n,r){var s=t.current,i=Lt(),o=Zr(s);return n=Tv(n),t.context===null?t.context=n:t.pendingContext=n,t=vr(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Kr(s,t,o),e!==null&&(Tn(e,s,o,i),zl(e,s,o)),o}function jc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function px(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function om(e,t){px(e,t),(e=e.alternate)&&px(e,t)}function K2(){return null}var Av=typeof reportError=="function"?reportError:function(e){console.error(e)};function lm(e){this._internalRoot=e}td.prototype.render=lm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(re(409));ed(e,t,null,null)};td.prototype.unmount=lm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ls(function(){ed(null,e,null,null)}),t[Nr]=null}};function td(e){this._internalRoot=e}td.prototype.unstable_scheduleHydration=function(e){if(e){var t=uy();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Lr.length&&t!==0&&t<Lr[n].priority;n++);Lr.splice(n,0,e),n===0&&hy(e)}};function cm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function nd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function xx(){}function Q2(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var d=jc(o);i.call(d)}}var o=Ov(t,r,e,0,null,!1,!1,"",xx);return e._reactRootContainer=o,e[Nr]=o.current,eo(e.nodeType===8?e.parentNode:e),Ls(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var d=jc(c);l.call(d)}}var c=im(e,0,!1,null,null,!1,!1,"",xx);return e._reactRootContainer=c,e[Nr]=c.current,eo(e.nodeType===8?e.parentNode:e),Ls(function(){ed(t,c,n,r)}),c}function rd(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var l=s;s=function(){var c=jc(o);l.call(c)}}ed(t,o,e,s)}else o=Q2(n,t,e,s,r);return jc(o)}cy=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=_i(t.pendingLanes);n!==0&&(Mh(t,n|1),Gt(t,ot()),!(Te&6)&&(Ba=ot()+500,ms()))}break;case 13:Ls(function(){var r=jr(e,1);if(r!==null){var s=Lt();Tn(r,e,1,s)}}),om(e,1)}};_h=function(e){if(e.tag===13){var t=jr(e,134217728);if(t!==null){var n=Lt();Tn(t,e,134217728,n)}om(e,134217728)}};dy=function(e){if(e.tag===13){var t=Zr(e),n=jr(e,t);if(n!==null){var r=Lt();Tn(n,e,t,r)}om(e,t)}};uy=function(){return $e};fy=function(e,t){var n=$e;try{return $e=e,t()}finally{$e=n}};tf=function(e,t,n){switch(t){case"input":if(qu(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Xc(r);if(!s)throw Error(re(90));U0(r),qu(r,s)}}}break;case"textarea":H0(e,n);break;case"select":t=n.value,t!=null&&ja(e,!!n.multiple,t,!1)}};Z0=nm;J0=Ls;var Z2={usingClientEntryPoint:!1,Events:[To,ma,Xc,K0,Q0,nm]},gi={findFiberByHostInstance:js,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},J2={bundleType:gi.bundleType,version:gi.version,rendererPackageName:gi.rendererPackageName,rendererConfig:gi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Mr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ny(e),e===null?null:e.stateNode},findFiberByHostInstance:gi.findFiberByHostInstance||K2,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pl.isDisabled&&pl.supportsFiber)try{Uc=pl.inject(J2),Qn=pl}catch{}}dn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z2;dn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!cm(t))throw Error(re(200));return G2(e,t,null,n)};dn.createRoot=function(e,t){if(!cm(e))throw Error(re(299));var n=!1,r="",s=Av;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=im(e,1,!1,null,null,n,!1,r,s),e[Nr]=t.current,eo(e.nodeType===8?e.parentNode:e),new lm(t)};dn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(re(188)):(e=Object.keys(e).join(","),Error(re(268,e)));return e=ny(t),e=e===null?null:e.stateNode,e};dn.flushSync=function(e){return Ls(e)};dn.hydrate=function(e,t,n){if(!nd(t))throw Error(re(200));return rd(null,e,t,!0,n)};dn.hydrateRoot=function(e,t,n){if(!cm(e))throw Error(re(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=Av;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Ov(t,null,e,1,n??null,s,!1,i,o),e[Nr]=t.current,eo(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new td(t)};dn.render=function(e,t,n){if(!nd(t))throw Error(re(200));return rd(null,e,t,!1,n)};dn.unmountComponentAtNode=function(e){if(!nd(e))throw Error(re(40));return e._reactRootContainer?(Ls(function(){rd(null,null,e,!1,function(){e._reactRootContainer=null,e[Nr]=null})}),!0):!1};dn.unstable_batchedUpdates=nm;dn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!nd(n))throw Error(re(200));if(e==null||e._reactInternals===void 0)throw Error(re(38));return rd(e,t,n,!1,r)};dn.version="18.3.1-next-f1338f8080-20240426";function Rv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Rv)}catch(e){console.error(e)}}Rv(),R0.exports=dn;var sd=R0.exports;const Iv=mh(sd);var gx=sd;Bu.createRoot=gx.createRoot,Bu.hydrateRoot=gx.hydrateRoot;/**
|
|
41
|
+
* @remix-run/router v1.23.0
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/function co(){return co=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},co.apply(this,arguments)}var Vr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Vr||(Vr={}));const yx="popstate";function eS(e){e===void 0&&(e={});function t(r,s){let{pathname:i,search:o,hash:l}=r.location;return Rf("",{pathname:i,search:o,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:kc(s)}return nS(t,n,null,e)}function ht(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function zv(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function tS(){return Math.random().toString(36).substr(2,8)}function vx(e,t){return{usr:e.state,key:e.key,idx:t}}function Rf(e,t,n,r){return n===void 0&&(n=null),co({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ai(t):t,{state:n,key:t&&t.key||r||tS()})}function kc(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function ai(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function nS(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,l=Vr.Pop,c=null,d=f();d==null&&(d=0,o.replaceState(co({},o.state,{idx:d}),""));function f(){return(o.state||{idx:null}).idx}function u(){l=Vr.Pop;let b=f(),g=b==null?null:b-d;d=b,c&&c({action:l,location:y.location,delta:g})}function h(b,g){l=Vr.Push;let v=Rf(y.location,b,g);d=f()+1;let x=vx(v,d),j=y.createHref(v);try{o.pushState(x,"",j)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;s.location.assign(j)}i&&c&&c({action:l,location:y.location,delta:1})}function m(b,g){l=Vr.Replace;let v=Rf(y.location,b,g);d=f();let x=vx(v,d),j=y.createHref(v);o.replaceState(x,"",j),i&&c&&c({action:l,location:y.location,delta:0})}function w(b){let g=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof b=="string"?b:kc(b);return v=v.replace(/ $/,"%20"),ht(g,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,g)}let y={get action(){return l},get location(){return e(s,o)},listen(b){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(yx,u),c=b,()=>{s.removeEventListener(yx,u),c=null}},createHref(b){return t(s,b)},createURL:w,encodeLocation(b){let g=w(b);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:h,replace:m,go(b){return o.go(b)}};return y}var wx;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(wx||(wx={}));function rS(e,t,n){return n===void 0&&(n="/"),sS(e,t,n)}function sS(e,t,n,r){let s=typeof t=="string"?ai(t):t,i=dm(s.pathname||"/",n);if(i==null)return null;let o=$v(e);aS(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=gS(i);l=mS(o[c],d)}return l}function $v(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(ht(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=es([r,c.relativePath]),f=n.concat(c);i.children&&i.children.length>0&&(ht(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),$v(i.children,t,f,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:fS(d,i.index),routesMeta:f})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))s(i,o);else for(let c of Lv(i.path))s(i,o,c)}),t}function Lv(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=Lv(r.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),s&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function aS(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:hS(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const iS=/^:[\w-]+$/,oS=3,lS=2,cS=1,dS=10,uS=-2,bx=e=>e==="*";function fS(e,t){let n=e.split("/"),r=n.length;return n.some(bx)&&(r+=uS),t&&(r+=lS),n.filter(s=>!bx(s)).reduce((s,i)=>s+(iS.test(i)?oS:i===""?cS:dS),r)}function hS(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function mS(e,t,n){let{routesMeta:r}=e,s={},i="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],d=l===r.length-1,f=i==="/"?t:t.slice(i.length)||"/",u=pS({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},f),h=c.route;if(!u)return null;Object.assign(s,u.params),o.push({params:s,pathname:es([i,u.pathname]),pathnameBase:bS(es([i,u.pathnameBase])),route:h}),u.pathnameBase!=="/"&&(i=es([i,u.pathnameBase]))}return o}function pS(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=xS(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((d,f,u)=>{let{paramName:h,isOptional:m}=f;if(h==="*"){let y=l[u]||"";o=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const w=l[u];return m&&!w?d[h]=void 0:d[h]=(w||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:e}}function xS(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),zv(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function gS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return zv(!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 dm(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function yS(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?ai(e):e;return{pathname:n?n.startsWith("/")?n:vS(n,t):t,search:NS(r),hash:jS(s)}}function vS(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function lu(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function wS(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Fv(e,t){let n=wS(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Bv(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=ai(e):(s=co({},e),ht(!s.pathname||!s.pathname.includes("?"),lu("?","pathname","search",s)),ht(!s.pathname||!s.pathname.includes("#"),lu("#","pathname","hash",s)),ht(!s.search||!s.search.includes("#"),lu("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,l;if(o==null)l=n;else{let u=t.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),u-=1;s.pathname=h.join("/")}l=u>=0?t[u]:"/"}let c=yS(s,l),d=o&&o!=="/"&&o.endsWith("/"),f=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||f)&&(c.pathname+="/"),c}const es=e=>e.join("/").replace(/\/\/+/g,"/"),bS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),NS=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,jS=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function kS(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Wv=["post","put","patch","delete"];new Set(Wv);const SS=["get",...Wv];new Set(SS);/**
|
|
50
|
+
* React Router v6.30.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 uo(){return uo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uo.apply(this,arguments)}const um=p.createContext(null),CS=p.createContext(null),Ks=p.createContext(null),ad=p.createContext(null),ps=p.createContext({outlet:null,matches:[],isDataRoute:!1}),Uv=p.createContext(null);function ES(e,t){let{relative:n}=t===void 0?{}:t;Ao()||ht(!1);let{basename:r,navigator:s}=p.useContext(Ks),{hash:i,pathname:o,search:l}=Hv(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:es([r,o])),s.createHref({pathname:c,search:l,hash:i})}function Ao(){return p.useContext(ad)!=null}function Ro(){return Ao()||ht(!1),p.useContext(ad).location}function Vv(e){p.useContext(Ks).static||p.useLayoutEffect(e)}function Qs(){let{isDataRoute:e}=p.useContext(ps);return e?FS():MS()}function MS(){Ao()||ht(!1);let e=p.useContext(um),{basename:t,future:n,navigator:r}=p.useContext(Ks),{matches:s}=p.useContext(ps),{pathname:i}=Ro(),o=JSON.stringify(Fv(s,n.v7_relativeSplatPath)),l=p.useRef(!1);return Vv(()=>{l.current=!0}),p.useCallback(function(d,f){if(f===void 0&&(f={}),!l.current)return;if(typeof d=="number"){r.go(d);return}let u=Bv(d,JSON.parse(o),i,f.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:es([t,u.pathname])),(f.replace?r.replace:r.push)(u,f.state,f)},[t,r,o,i,e])}function fm(){let{matches:e}=p.useContext(ps),t=e[e.length-1];return t?t.params:{}}function Hv(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=p.useContext(Ks),{matches:s}=p.useContext(ps),{pathname:i}=Ro(),o=JSON.stringify(Fv(s,r.v7_relativeSplatPath));return p.useMemo(()=>Bv(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function _S(e,t){return PS(e,t)}function PS(e,t,n,r){Ao()||ht(!1);let{navigator:s}=p.useContext(Ks),{matches:i}=p.useContext(ps),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let d=Ro(),f;if(t){var u;let b=typeof t=="string"?ai(t):t;c==="/"||(u=b.pathname)!=null&&u.startsWith(c)||ht(!1),f=b}else f=d;let h=f.pathname||"/",m=h;if(c!=="/"){let b=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(b.length).join("/")}let w=rS(e,{pathname:m}),y=RS(w&&w.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:es([c,s.encodeLocation?s.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:es([c,s.encodeLocation?s.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,n,r);return t&&y?p.createElement(ad.Provider,{value:{location:uo({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Vr.Pop}},y):y}function DS(){let e=LS(),t=kS(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:s},n):null,null)}const TS=p.createElement(DS,null);class OS extends p.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?p.createElement(ps.Provider,{value:this.props.routeContext},p.createElement(Uv.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function AS(e){let{routeContext:t,match:n,children:r}=e,s=p.useContext(um);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(ps.Provider,{value:t},r)}function RS(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(s=n)==null?void 0:s.errors;if(l!=null){let f=o.findIndex(u=>u.route.id&&(l==null?void 0:l[u.route.id])!==void 0);f>=0||ht(!1),o=o.slice(0,Math.min(o.length,f+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f<o.length;f++){let u=o[f];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(d=f),u.route.id){let{loaderData:h,errors:m}=n,w=u.route.loader&&h[u.route.id]===void 0&&(!m||m[u.route.id]===void 0);if(u.route.lazy||w){c=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((f,u,h)=>{let m,w=!1,y=null,b=null;n&&(m=l&&u.route.id?l[u.route.id]:void 0,y=u.route.errorElement||TS,c&&(d<0&&h===0?(BS("route-fallback"),w=!0,b=null):d===h&&(w=!0,b=u.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,h+1)),v=()=>{let x;return m?x=y:w?x=b:u.route.Component?x=p.createElement(u.route.Component,null):u.route.element?x=u.route.element:x=f,p.createElement(AS,{match:u,routeContext:{outlet:f,matches:g,isDataRoute:n!=null},children:x})};return n&&(u.route.ErrorBoundary||u.route.errorElement||h===0)?p.createElement(OS,{location:n.location,revalidation:n.revalidation,component:y,error:m,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()},null)}var Yv=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Yv||{}),Xv=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}(Xv||{});function IS(e){let t=p.useContext(um);return t||ht(!1),t}function zS(e){let t=p.useContext(CS);return t||ht(!1),t}function $S(e){let t=p.useContext(ps);return t||ht(!1),t}function qv(e){let t=$S(),n=t.matches[t.matches.length-1];return n.route.id||ht(!1),n.route.id}function LS(){var e;let t=p.useContext(Uv),n=zS(),r=qv();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function FS(){let{router:e}=IS(Yv.UseNavigateStable),t=qv(Xv.UseNavigateStable),n=p.useRef(!1);return Vv(()=>{n.current=!0}),p.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,uo({fromRouteId:t},i)))},[e,t])}const Nx={};function BS(e,t,n){Nx[e]||(Nx[e]=!0)}function WS(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Zt(e){ht(!1)}function US(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Vr.Pop,navigator:i,static:o=!1,future:l}=e;Ao()&&ht(!1);let c=t.replace(/^\/*/,"/"),d=p.useMemo(()=>({basename:c,navigator:i,static:o,future:uo({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof r=="string"&&(r=ai(r));let{pathname:f="/",search:u="",hash:h="",state:m=null,key:w="default"}=r,y=p.useMemo(()=>{let b=dm(f,c);return b==null?null:{location:{pathname:b,search:u,hash:h,state:m,key:w},navigationType:s}},[c,f,u,h,m,w,s]);return y==null?null:p.createElement(Ks.Provider,{value:d},p.createElement(ad.Provider,{children:n,value:y}))}function VS(e){let{children:t,location:n}=e;return _S(If(t),n)}new Promise(()=>{});function If(e,t){t===void 0&&(t=[]);let n=[];return p.Children.forEach(e,(r,s)=>{if(!p.isValidElement(r))return;let i=[...t,s];if(r.type===p.Fragment){n.push.apply(n,If(r.props.children,i));return}r.type!==Zt&&ht(!1),!r.props.index||!r.props.children||ht(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=If(r.props.children,i)),n.push(o)}),n}/**
|
|
59
|
+
* React Router DOM v6.30.1
|
|
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 zf(){return zf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zf.apply(this,arguments)}function HS(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function YS(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function XS(e,t){return e.button===0&&(!t||t==="_self")&&!YS(e)}const qS=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],GS="6";try{window.__reactRouterVersion=GS}catch{}const KS="startTransition",jx=vh[KS];function QS(e){let{basename:t,children:n,future:r,window:s}=e,i=p.useRef();i.current==null&&(i.current=eS({window:s,v5Compat:!0}));let o=i.current,[l,c]=p.useState({action:o.action,location:o.location}),{v7_startTransition:d}=r||{},f=p.useCallback(u=>{d&&jx?jx(()=>c(u)):c(u)},[c,d]);return p.useLayoutEffect(()=>o.listen(f),[o,f]),p.useEffect(()=>WS(r),[r]),p.createElement(US,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const ZS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",JS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_a=p.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:l,target:c,to:d,preventScrollReset:f,viewTransition:u}=t,h=HS(t,qS),{basename:m}=p.useContext(Ks),w,y=!1;if(typeof d=="string"&&JS.test(d)&&(w=d,ZS))try{let x=new URL(window.location.href),j=d.startsWith("//")?new URL(x.protocol+d):new URL(d),N=dm(j.pathname,m);j.origin===x.origin&&N!=null?d=N+j.search+j.hash:y=!0}catch{}let b=ES(d,{relative:s}),g=eC(d,{replace:o,state:l,target:c,preventScrollReset:f,relative:s,viewTransition:u});function v(x){r&&r(x),x.defaultPrevented||g(x)}return p.createElement("a",zf({},h,{href:w||b,onClick:y||i?r:v,ref:n,target:c}))});var kx;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(kx||(kx={}));var Sx;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Sx||(Sx={}));function eC(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=Qs(),d=Ro(),f=Hv(e,{relative:o});return p.useCallback(u=>{if(XS(u,n)){u.preventDefault();let h=r!==void 0?r:kc(d)===kc(f);c(e,{replace:h,state:s,preventScrollReset:i,relative:o,viewTransition:l})}},[d,c,f,r,s,n,e,i,o,l])}function tC(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 nC=e=>{switch(e){case"success":return aC;case"info":return oC;case"warning":return iC;case"error":return lC;default:return null}},rC=Array(12).fill(0),sC=({visible:e,className:t})=>Y.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Y.createElement("div",{className:"sonner-spinner"},rC.map((n,r)=>Y.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),aC=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),iC=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Y.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"})),oC=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),lC=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),cC=Y.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"},Y.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Y.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),dC=()=>{const[e,t]=Y.useState(document.hidden);return Y.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let $f=1;class uC{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:r,...s}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:$f++,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:r}),{...c,...t,id:i,dismissible:l,title:r}):c):this.addToast({title:r,...s,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(r=>r({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 r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,o;const l=s.then(async d=>{if(o=["resolve",d],Y.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(hC(d)&&!d.ok){i=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,h=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof u=="object"&&!Y.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:h,...w})}else if(d instanceof Error){i=!1;const u=typeof n.error=="function"?await n.error(d):n.error,h=typeof n.description=="function"?await n.description(d):n.description,w=typeof u=="object"&&!Y.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:h,...w})}else if(n.success!==void 0){i=!1;const u=typeof n.success=="function"?await n.success(d):n.success,h=typeof n.description=="function"?await n.description(d):n.description,w=typeof u=="object"&&!Y.isValidElement(u)?u:{message:u};this.create({id:r,type:"success",description:h,...w})}}).catch(async d=>{if(o=["reject",d],n.error!==void 0){i=!1;const f=typeof n.error=="function"?await n.error(d):n.error,u=typeof n.description=="function"?await n.description(d):n.description,m=typeof f=="object"&&!Y.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:u,...m})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,f)=>l.then(()=>o[0]==="reject"?f(o[1]):d(o[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||$f++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ut=new uC,fC=(e,t)=>{const n=(t==null?void 0:t.id)||$f++;return Ut.addToast({title:e,...t,id:n}),n},hC=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",mC=fC,pC=()=>Ut.toasts,xC=()=>Ut.getActiveToasts(),q=Object.assign(mC,{success:Ut.success,info:Ut.info,warning:Ut.warning,error:Ut.error,custom:Ut.custom,message:Ut.message,promise:Ut.promise,dismiss:Ut.dismiss,loading:Ut.loading},{getHistory:pC,getToasts:xC});tC("[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 xl(e){return e.label!==void 0}const gC=3,yC="24px",vC="16px",Cx=4e3,wC=356,bC=14,NC=45,jC=200;function Bn(...e){return e.filter(Boolean).join(" ")}function kC(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const SC=e=>{var t,n,r,s,i,o,l,c,d;const{invert:f,toast:u,unstyled:h,interacting:m,setHeights:w,visibleToasts:y,heights:b,index:g,toasts:v,expanded:x,removeToast:j,defaultRichColors:N,closeButton:k,style:S,cancelButtonStyle:M,actionButtonStyle:z,className:$="",descriptionClassName:A="",duration:O,position:L,gap:E,expandByDefault:I,classNames:D,icons:P,closeButtonAriaLabel:C="Close toast"}=e,[_,R]=Y.useState(null),[B,T]=Y.useState(null),[F,H]=Y.useState(!1),[X,J]=Y.useState(!1),[ee,K]=Y.useState(!1),[ne,me]=Y.useState(!1),[W,Q]=Y.useState(!1),[Z,ae]=Y.useState(0),[fe,pe]=Y.useState(0),Se=Y.useRef(u.duration||O||Cx),Xe=Y.useRef(null),Pe=Y.useRef(null),lt=g===0,Pt=g+1<=y,Ae=u.type,Qe=u.dismissible!==!1,xt=u.className||"",zt=u.descriptionClassName||"",te=Y.useMemo(()=>b.findIndex(ie=>ie.toastId===u.id)||0,[b,u.id]),oe=Y.useMemo(()=>{var ie;return(ie=u.closeButton)!=null?ie:k},[u.closeButton,k]),V=Y.useMemo(()=>u.duration||O||Cx,[u.duration,O]),se=Y.useRef(0),he=Y.useRef(0),de=Y.useRef(0),be=Y.useRef(null),[Ie,G]=L.split("-"),le=Y.useMemo(()=>b.reduce((ie,Ze,dt)=>dt>=te?ie:ie+Ze.height,0),[b,te]),ge=dC(),Ue=u.invert||f,ct=Ae==="loading";he.current=Y.useMemo(()=>te*E+le,[te,le]),Y.useEffect(()=>{Se.current=V},[V]),Y.useEffect(()=>{H(!0)},[]),Y.useEffect(()=>{const ie=Pe.current;if(ie){const Ze=ie.getBoundingClientRect().height;return pe(Ze),w(dt=>[{toastId:u.id,height:Ze,position:u.position},...dt]),()=>w(dt=>dt.filter(jt=>jt.toastId!==u.id))}},[w,u.id]),Y.useLayoutEffect(()=>{if(!F)return;const ie=Pe.current,Ze=ie.style.height;ie.style.height="auto";const dt=ie.getBoundingClientRect().height;ie.style.height=Ze,pe(dt),w(jt=>jt.find(Je=>Je.toastId===u.id)?jt.map(Je=>Je.toastId===u.id?{...Je,height:dt}:Je):[{toastId:u.id,height:dt,position:u.position},...jt])},[F,u.title,u.description,w,u.id,u.jsx,u.action,u.cancel]);const ce=Y.useCallback(()=>{J(!0),ae(he.current),w(ie=>ie.filter(Ze=>Ze.toastId!==u.id)),setTimeout(()=>{j(u)},jC)},[u,j,w,he]);Y.useEffect(()=>{if(u.promise&&Ae==="loading"||u.duration===1/0||u.type==="loading")return;let ie;return x||m||ge?(()=>{if(de.current<se.current){const jt=new Date().getTime()-se.current;Se.current=Se.current-jt}de.current=new Date().getTime()})():(()=>{Se.current!==1/0&&(se.current=new Date().getTime(),ie=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),ce()},Se.current))})(),()=>clearTimeout(ie)},[x,m,u,Ae,ge,ce]),Y.useEffect(()=>{u.delete&&(ce(),u.onDismiss==null||u.onDismiss.call(u,u))},[ce,u.delete]);function Me(){var ie;if(P!=null&&P.loading){var Ze;return Y.createElement("div",{className:Bn(D==null?void 0:D.loader,u==null||(Ze=u.classNames)==null?void 0:Ze.loader,"sonner-loader"),"data-visible":Ae==="loading"},P.loading)}return Y.createElement(sC,{className:Bn(D==null?void 0:D.loader,u==null||(ie=u.classNames)==null?void 0:ie.loader),visible:Ae==="loading"})}const Ne=u.icon||(P==null?void 0:P[Ae])||nC(Ae);var Re,wt;return Y.createElement("li",{tabIndex:0,ref:Pe,className:Bn($,xt,D==null?void 0:D.toast,u==null||(t=u.classNames)==null?void 0:t.toast,D==null?void 0:D.default,D==null?void 0:D[Ae],u==null||(n=u.classNames)==null?void 0:n[Ae]),"data-sonner-toast":"","data-rich-colors":(Re=u.richColors)!=null?Re:N,"data-styled":!(u.jsx||u.unstyled||h),"data-mounted":F,"data-promise":!!u.promise,"data-swiped":W,"data-removed":X,"data-visible":Pt,"data-y-position":Ie,"data-x-position":G,"data-index":g,"data-front":lt,"data-swiping":ee,"data-dismissible":Qe,"data-type":Ae,"data-invert":Ue,"data-swipe-out":ne,"data-swipe-direction":B,"data-expanded":!!(x||I&&F),"data-testid":u.testId,style:{"--index":g,"--toasts-before":g,"--z-index":v.length-g,"--offset":`${X?Z:he.current}px`,"--initial-height":I?"auto":`${fe}px`,...S,...u.style},onDragEnd:()=>{K(!1),R(null),be.current=null},onPointerDown:ie=>{ie.button!==2&&(ct||!Qe||(Xe.current=new Date,ae(he.current),ie.target.setPointerCapture(ie.pointerId),ie.target.tagName!=="BUTTON"&&(K(!0),be.current={x:ie.clientX,y:ie.clientY})))},onPointerUp:()=>{var ie,Ze,dt;if(ne||!Qe)return;be.current=null;const jt=Number(((ie=Pe.current)==null?void 0:ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ln=Number(((Ze=Pe.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Je=new Date().getTime()-((dt=Xe.current)==null?void 0:dt.getTime()),Wt=_==="x"?jt:Ln,Js=Math.abs(Wt)/Je;if(Math.abs(Wt)>=NC||Js>.11){ae(he.current),u.onDismiss==null||u.onDismiss.call(u,u),T(_==="x"?jt>0?"right":"left":Ln>0?"down":"up"),ce(),me(!0);return}else{var Kt,Qt;(Kt=Pe.current)==null||Kt.style.setProperty("--swipe-amount-x","0px"),(Qt=Pe.current)==null||Qt.style.setProperty("--swipe-amount-y","0px")}Q(!1),K(!1),R(null)},onPointerMove:ie=>{var Ze,dt,jt;if(!be.current||!Qe||((Ze=window.getSelection())==null?void 0:Ze.toString().length)>0)return;const Je=ie.clientY-be.current.y,Wt=ie.clientX-be.current.x;var Js;const Kt=(Js=e.swipeDirections)!=null?Js:kC(L);!_&&(Math.abs(Wt)>1||Math.abs(Je)>1)&&R(Math.abs(Wt)>Math.abs(Je)?"x":"y");let Qt={x:0,y:0};const Qo=ir=>1/(1.5+Math.abs(ir)/20);if(_==="y"){if(Kt.includes("top")||Kt.includes("bottom"))if(Kt.includes("top")&&Je<0||Kt.includes("bottom")&&Je>0)Qt.y=Je;else{const ir=Je*Qo(Je);Qt.y=Math.abs(ir)<Math.abs(Je)?ir:Je}}else if(_==="x"&&(Kt.includes("left")||Kt.includes("right")))if(Kt.includes("left")&&Wt<0||Kt.includes("right")&&Wt>0)Qt.x=Wt;else{const ir=Wt*Qo(Wt);Qt.x=Math.abs(ir)<Math.abs(Wt)?ir:Wt}(Math.abs(Qt.x)>0||Math.abs(Qt.y)>0)&&Q(!0),(dt=Pe.current)==null||dt.style.setProperty("--swipe-amount-x",`${Qt.x}px`),(jt=Pe.current)==null||jt.style.setProperty("--swipe-amount-y",`${Qt.y}px`)}},oe&&!u.jsx&&Ae!=="loading"?Y.createElement("button",{"aria-label":C,"data-disabled":ct,"data-close-button":!0,onClick:ct||!Qe?()=>{}:()=>{ce(),u.onDismiss==null||u.onDismiss.call(u,u)},className:Bn(D==null?void 0:D.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(wt=P==null?void 0:P.close)!=null?wt:cC):null,(Ae||u.icon||u.promise)&&u.icon!==null&&((P==null?void 0:P[Ae])!==null||u.icon)?Y.createElement("div",{"data-icon":"",className:Bn(D==null?void 0:D.icon,u==null||(s=u.classNames)==null?void 0:s.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||Me():null,u.type!=="loading"?Ne:null):null,Y.createElement("div",{"data-content":"",className:Bn(D==null?void 0:D.content,u==null||(i=u.classNames)==null?void 0:i.content)},Y.createElement("div",{"data-title":"",className:Bn(D==null?void 0:D.title,u==null||(o=u.classNames)==null?void 0:o.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?Y.createElement("div",{"data-description":"",className:Bn(A,zt,D==null?void 0:D.description,u==null||(l=u.classNames)==null?void 0:l.description)},typeof u.description=="function"?u.description():u.description):null),Y.isValidElement(u.cancel)?u.cancel:u.cancel&&xl(u.cancel)?Y.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||M,onClick:ie=>{xl(u.cancel)&&Qe&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,ie),ce())},className:Bn(D==null?void 0:D.cancelButton,u==null||(c=u.classNames)==null?void 0:c.cancelButton)},u.cancel.label):null,Y.isValidElement(u.action)?u.action:u.action&&xl(u.action)?Y.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||z,onClick:ie=>{xl(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,ie),!ie.defaultPrevented&&ce())},className:Bn(D==null?void 0:D.actionButton,u==null||(d=u.classNames)==null?void 0:d.actionButton)},u.action.label):null)};function Ex(){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 CC(e,t){const n={};return[e,t].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",l=i?vC:yC;function c(d){["top","right","bottom","left"].forEach(f=>{n[`${o}-${f}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}const EC=Y.forwardRef(function(t,n){const{id:r,invert:s,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:d,offset:f,mobileOffset:u,theme:h="light",richColors:m,duration:w,style:y,visibleToasts:b=gC,toastOptions:g,dir:v=Ex(),gap:x=bC,icons:j,containerAriaLabel:N="Notifications"}=t,[k,S]=Y.useState([]),M=Y.useMemo(()=>r?k.filter(F=>F.toasterId===r):k.filter(F=>!F.toasterId),[k,r]),z=Y.useMemo(()=>Array.from(new Set([i].concat(M.filter(F=>F.position).map(F=>F.position)))),[M,i]),[$,A]=Y.useState([]),[O,L]=Y.useState(!1),[E,I]=Y.useState(!1),[D,P]=Y.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),C=Y.useRef(null),_=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=Y.useRef(null),B=Y.useRef(!1),T=Y.useCallback(F=>{S(H=>{var X;return(X=H.find(J=>J.id===F.id))!=null&&X.delete||Ut.dismiss(F.id),H.filter(({id:J})=>J!==F.id)})},[]);return Y.useEffect(()=>Ut.subscribe(F=>{if(F.dismiss){requestAnimationFrame(()=>{S(H=>H.map(X=>X.id===F.id?{...X,delete:!0}:X))});return}setTimeout(()=>{Iv.flushSync(()=>{S(H=>{const X=H.findIndex(J=>J.id===F.id);return X!==-1?[...H.slice(0,X),{...H[X],...F},...H.slice(X+1)]:[F,...H]})})})}),[k]),Y.useEffect(()=>{if(h!=="system"){P(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?P("dark"):P("light")),typeof window>"u")return;const F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:H})=>{P(H?"dark":"light")})}catch{F.addListener(({matches:X})=>{try{P(X?"dark":"light")}catch(J){console.error(J)}})}},[h]),Y.useEffect(()=>{k.length<=1&&L(!1)},[k]),Y.useEffect(()=>{const F=H=>{var X;if(o.every(K=>H[K]||H.code===K)){var ee;L(!0),(ee=C.current)==null||ee.focus()}H.code==="Escape"&&(document.activeElement===C.current||(X=C.current)!=null&&X.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[o]),Y.useEffect(()=>{if(C.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,B.current=!1)}},[C.current]),Y.createElement("section",{ref:n,"aria-label":`${N} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},z.map((F,H)=>{var X;const[J,ee]=F.split("-");return M.length?Y.createElement("ol",{key:F,dir:v==="auto"?Ex():v,tabIndex:-1,ref:C,className:d,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":J,"data-x-position":ee,style:{"--front-toast-height":`${((X=$[0])==null?void 0:X.height)||0}px`,"--width":`${wC}px`,"--gap":`${x}px`,...y,...CC(f,u)},onBlur:K=>{B.current&&!K.currentTarget.contains(K.relatedTarget)&&(B.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||B.current||(B.current=!0,R.current=K.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{E||L(!1)},onDragEnd:()=>L(!1),onPointerDown:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},M.filter(K=>!K.position&&H===0||K.position===F).map((K,ne)=>{var me,W;return Y.createElement(SC,{key:K.id,icons:j,index:ne,toast:K,defaultRichColors:m,duration:(me=g==null?void 0:g.duration)!=null?me:w,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:s,visibleToasts:b,closeButton:(W=g==null?void 0:g.closeButton)!=null?W:c,interacting:E,position:F,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:T,toasts:M.filter(Q=>Q.position==K.position),heights:$.filter(Q=>Q.position==K.position),setHeights:A,expandByDefault:l,gap:x,expanded:O,swipeDirections:t.swipeDirections})})):null}))});/**
|
|
68
|
+
* @license lucide-react v0.294.0 - ISC
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the ISC license.
|
|
71
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
+
*/var MC={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"};/**
|
|
73
|
+
* @license lucide-react v0.294.0 - ISC
|
|
74
|
+
*
|
|
75
|
+
* This source code is licensed under the ISC license.
|
|
76
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
+
*/const _C=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),ve=(e,t)=>{const n=p.forwardRef(({color:r="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:l="",children:c,...d},f)=>p.createElement("svg",{ref:f,...MC,width:s,height:s,stroke:r,strokeWidth:o?Number(i)*24/Number(s):i,className:["lucide",`lucide-${_C(e)}`,l].join(" "),...d},[...t.map(([u,h])=>p.createElement(u,h)),...Array.isArray(c)?c:[c]]));return n.displayName=`${e}`,n};/**
|
|
78
|
+
* @license lucide-react v0.294.0 - ISC
|
|
79
|
+
*
|
|
80
|
+
* This source code is licensed under the ISC license.
|
|
81
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
+
*/const Wn=ve("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"}]]);/**
|
|
83
|
+
* @license lucide-react v0.294.0 - ISC
|
|
84
|
+
*
|
|
85
|
+
* This source code is licensed under the ISC license.
|
|
86
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
+
*/const fo=ve("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
88
|
+
* @license lucide-react v0.294.0 - ISC
|
|
89
|
+
*
|
|
90
|
+
* This source code is licensed under the ISC license.
|
|
91
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
+
*/const ia=ve("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
93
|
+
* @license lucide-react v0.294.0 - ISC
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the ISC license.
|
|
96
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/const Hr=ve("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
|
98
|
+
* @license lucide-react v0.294.0 - ISC
|
|
99
|
+
*
|
|
100
|
+
* This source code is licensed under the ISC license.
|
|
101
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
+
*/const Lf=ve("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"}]]);/**
|
|
103
|
+
* @license lucide-react v0.294.0 - ISC
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the ISC license.
|
|
106
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
+
*/const PC=ve("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"}]]);/**
|
|
108
|
+
* @license lucide-react v0.294.0 - ISC
|
|
109
|
+
*
|
|
110
|
+
* This source code is licensed under the ISC license.
|
|
111
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
+
*/const it=ve("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"}]]);/**
|
|
113
|
+
* @license lucide-react v0.294.0 - ISC
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the ISC license.
|
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
+
*/const Sc=ve("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"}]]);/**
|
|
118
|
+
* @license lucide-react v0.294.0 - ISC
|
|
119
|
+
*
|
|
120
|
+
* This source code is licensed under the ISC license.
|
|
121
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
+
*/const ut=ve("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"}]]);/**
|
|
123
|
+
* @license lucide-react v0.294.0 - ISC
|
|
124
|
+
*
|
|
125
|
+
* This source code is licensed under the ISC license.
|
|
126
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
+
*/const DC=ve("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
128
|
+
* @license lucide-react v0.294.0 - ISC
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the ISC license.
|
|
131
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/const Io=ve("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
133
|
+
* @license lucide-react v0.294.0 - ISC
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the ISC license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/const Gv=ve("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
138
|
+
* @license lucide-react v0.294.0 - ISC
|
|
139
|
+
*
|
|
140
|
+
* This source code is licensed under the ISC license.
|
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
+
*/const hm=ve("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
143
|
+
* @license lucide-react v0.294.0 - ISC
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the ISC license.
|
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/const TC=ve("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
148
|
+
* @license lucide-react v0.294.0 - ISC
|
|
149
|
+
*
|
|
150
|
+
* This source code is licensed under the ISC license.
|
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
+
*/const mr=ve("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
153
|
+
* @license lucide-react v0.294.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/const Be=ve("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"}]]);/**
|
|
158
|
+
* @license lucide-react v0.294.0 - ISC
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the ISC license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/const Kv=ve("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"}]]);/**
|
|
163
|
+
* @license lucide-react v0.294.0 - ISC
|
|
164
|
+
*
|
|
165
|
+
* This source code is licensed under the ISC license.
|
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
+
*/const OC=ve("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"}]]);/**
|
|
168
|
+
* @license lucide-react v0.294.0 - ISC
|
|
169
|
+
*
|
|
170
|
+
* This source code is licensed under the ISC license.
|
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
+
*/const zo=ve("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"}]]);/**
|
|
173
|
+
* @license lucide-react v0.294.0 - ISC
|
|
174
|
+
*
|
|
175
|
+
* This source code is licensed under the ISC license.
|
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
+
*/const mm=ve("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
178
|
+
* @license lucide-react v0.294.0 - ISC
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the ISC license.
|
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/const AC=ve("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"}]]);/**
|
|
183
|
+
* @license lucide-react v0.294.0 - ISC
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the ISC license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/const vs=ve("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"}]]);/**
|
|
188
|
+
* @license lucide-react v0.294.0 - ISC
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the ISC license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/const RC=ve("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"}]]);/**
|
|
193
|
+
* @license lucide-react v0.294.0 - ISC
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the ISC license.
|
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/const yi=ve("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
198
|
+
* @license lucide-react v0.294.0 - ISC
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the ISC license.
|
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
+
*/const Ff=ve("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"}]]);/**
|
|
203
|
+
* @license lucide-react v0.294.0 - ISC
|
|
204
|
+
*
|
|
205
|
+
* This source code is licensed under the ISC license.
|
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
+
*/const IC=ve("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"}]]);/**
|
|
208
|
+
* @license lucide-react v0.294.0 - ISC
|
|
209
|
+
*
|
|
210
|
+
* This source code is licensed under the ISC license.
|
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
+
*/const Rt=ve("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"}]]);/**
|
|
213
|
+
* @license lucide-react v0.294.0 - ISC
|
|
214
|
+
*
|
|
215
|
+
* This source code is licensed under the ISC license.
|
|
216
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
+
*/const cu=ve("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"}]]);/**
|
|
218
|
+
* @license lucide-react v0.294.0 - ISC
|
|
219
|
+
*
|
|
220
|
+
* This source code is licensed under the ISC license.
|
|
221
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
+
*/const pn=ve("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"}]]);/**
|
|
223
|
+
* @license lucide-react v0.294.0 - ISC
|
|
224
|
+
*
|
|
225
|
+
* This source code is licensed under the ISC license.
|
|
226
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
+
*/const zC=ve("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
228
|
+
* @license lucide-react v0.294.0 - ISC
|
|
229
|
+
*
|
|
230
|
+
* This source code is licensed under the ISC license.
|
|
231
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
+
*/const $C=ve("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"}]]);/**
|
|
233
|
+
* @license lucide-react v0.294.0 - ISC
|
|
234
|
+
*
|
|
235
|
+
* This source code is licensed under the ISC license.
|
|
236
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
+
*/const LC=ve("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"}]]);/**
|
|
238
|
+
* @license lucide-react v0.294.0 - ISC
|
|
239
|
+
*
|
|
240
|
+
* This source code is licensed under the ISC license.
|
|
241
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
+
*/const Fs=ve("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"}]]);/**
|
|
243
|
+
* @license lucide-react v0.294.0 - ISC
|
|
244
|
+
*
|
|
245
|
+
* This source code is licensed under the ISC license.
|
|
246
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
+
*/const pr=ve("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
248
|
+
* @license lucide-react v0.294.0 - ISC
|
|
249
|
+
*
|
|
250
|
+
* This source code is licensed under the ISC license.
|
|
251
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
+
*/const Mx=ve("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"}]]);/**
|
|
253
|
+
* @license lucide-react v0.294.0 - ISC
|
|
254
|
+
*
|
|
255
|
+
* This source code is licensed under the ISC license.
|
|
256
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
+
*/const _x=ve("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"}]]);/**
|
|
258
|
+
* @license lucide-react v0.294.0 - ISC
|
|
259
|
+
*
|
|
260
|
+
* This source code is licensed under the ISC license.
|
|
261
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
+
*/const os=ve("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
263
|
+
* @license lucide-react v0.294.0 - ISC
|
|
264
|
+
*
|
|
265
|
+
* This source code is licensed under the ISC license.
|
|
266
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
+
*/const Px=ve("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
|
|
268
|
+
* @license lucide-react v0.294.0 - ISC
|
|
269
|
+
*
|
|
270
|
+
* This source code is licensed under the ISC license.
|
|
271
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
+
*/const Ps=ve("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"}]]);/**
|
|
273
|
+
* @license lucide-react v0.294.0 - ISC
|
|
274
|
+
*
|
|
275
|
+
* This source code is licensed under the ISC license.
|
|
276
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
+
*/const or=ve("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]);/**
|
|
278
|
+
* @license lucide-react v0.294.0 - ISC
|
|
279
|
+
*
|
|
280
|
+
* This source code is licensed under the ISC license.
|
|
281
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
+
*/const FC=ve("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
283
|
+
* @license lucide-react v0.294.0 - ISC
|
|
284
|
+
*
|
|
285
|
+
* This source code is licensed under the ISC license.
|
|
286
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
+
*/const Ds=ve("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"}]]);/**
|
|
288
|
+
* @license lucide-react v0.294.0 - ISC
|
|
289
|
+
*
|
|
290
|
+
* This source code is licensed under the ISC license.
|
|
291
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
+
*/const Dx=ve("UserMinus",[["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:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
|
|
293
|
+
* @license lucide-react v0.294.0 - ISC
|
|
294
|
+
*
|
|
295
|
+
* This source code is licensed under the ISC license.
|
|
296
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
+
*/const ts=ve("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"}]]);/**
|
|
298
|
+
* @license lucide-react v0.294.0 - ISC
|
|
299
|
+
*
|
|
300
|
+
* This source code is licensed under the ISC license.
|
|
301
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
+
*/const Ui=ve("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"}]]);/**
|
|
303
|
+
* @license lucide-react v0.294.0 - ISC
|
|
304
|
+
*
|
|
305
|
+
* This source code is licensed under the ISC license.
|
|
306
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
+
*/const Oe=ve("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"}]]);/**
|
|
308
|
+
* @license lucide-react v0.294.0 - ISC
|
|
309
|
+
*
|
|
310
|
+
* This source code is licensed under the ISC license.
|
|
311
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
+
*/const Ns=ve("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"}]]);/**
|
|
313
|
+
* @license lucide-react v0.294.0 - ISC
|
|
314
|
+
*
|
|
315
|
+
* This source code is licensed under the ISC license.
|
|
316
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
+
*/const Fe=ve("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
318
|
+
* @license lucide-react v0.294.0 - ISC
|
|
319
|
+
*
|
|
320
|
+
* This source code is licensed under the ISC license.
|
|
321
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
+
*/const Vl=ve("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),Qv=p.createContext(void 0);function BC({children:e}){const[t,n]=p.useState({users:0,organizations:0,sessions:0,teams:0}),[r,s]=p.useState(!0),i=p.useCallback(async()=>{try{const c=await(await fetch("/api/counts")).json();n(c)}catch{}finally{s(!1)}},[]),o=p.useCallback(async()=>{s(!0),await i()},[i]);return p.useEffect(()=>{i()},[i]),a.jsx(Qv.Provider,{value:{counts:t,loading:r,refetchCounts:o},children:e})}function pm(){const e=p.useContext(Qv);if(e===void 0)throw new Error("useCounts must be used within a CountsProvider");return e}var Tx=1,WC=.9,UC=.8,VC=.17,du=.1,uu=.999,HC=.9999,YC=.99,XC=/[\\\/_+.#"@\[\(\{&]/,qC=/[\\\/_+.#"@\[\(\{&]/g,GC=/[\s-]/,Zv=/[\s-]/g;function Bf(e,t,n,r,s,i,o){if(i===t.length)return s===e.length?Tx:YC;var l=`${s},${i}`;if(o[l]!==void 0)return o[l];for(var c=r.charAt(i),d=n.indexOf(c,s),f=0,u,h,m,w;d>=0;)u=Bf(e,t,n,r,d+1,i+1,o),u>f&&(d===s?u*=Tx:XC.test(e.charAt(d-1))?(u*=UC,m=e.slice(s,d-1).match(qC),m&&s>0&&(u*=Math.pow(uu,m.length))):GC.test(e.charAt(d-1))?(u*=WC,w=e.slice(s,d-1).match(Zv),w&&s>0&&(u*=Math.pow(uu,w.length))):(u*=VC,s>0&&(u*=Math.pow(uu,d-s))),e.charAt(d)!==t.charAt(i)&&(u*=HC)),(u<du&&n.charAt(d-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(d-1)!==r.charAt(i))&&(h=Bf(e,t,n,r,d+1,i+2,o),h*du>u&&(u=h*du)),u>f&&(f=u),d=n.indexOf(c,d+1);return o[l]=f,f}function Ox(e){return e.toLowerCase().replace(Zv," ")}function KC(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Bf(e,t,Ox(e),Ox(t),0,0,{})}function yt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function Ax(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Bs(...e){return t=>{let n=!1;const r=e.map(s=>{const i=Ax(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():Ax(e[s],null)}}}}function fn(...e){return p.useCallback(Bs(...e),e)}function QC(e,t){const n=p.createContext(t),r=i=>{const{children:o,...l}=i,c=p.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function s(i){const o=p.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function id(e,t=[]){let n=[];function r(i,o){const l=p.createContext(o),c=n.length;n=[...n,o];const d=u=>{var g;const{scope:h,children:m,...w}=u,y=((g=h==null?void 0:h[e])==null?void 0:g[c])||l,b=p.useMemo(()=>w,Object.values(w));return a.jsx(y.Provider,{value:b,children:m})};d.displayName=i+"Provider";function f(u,h){var y;const m=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,w=p.useContext(m);if(w)return w;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[d,f]}const s=()=>{const i=n.map(o=>p.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,ZC(s,...t)]}function ZC(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((l,{useScope:c,scopeName:d})=>{const u=c(i)[`__scope${d}`];return{...l,...u}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var ls=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},JC=vh[" useId ".trim().toString()]||(()=>{}),eE=0;function On(e){const[t,n]=p.useState(JC());return ls(()=>{n(r=>r??String(eE++))},[e]),t?`radix-${t}`:""}var tE=vh[" useInsertionEffect ".trim().toString()]||ls;function xm({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,o]=nE({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:s;{const f=p.useRef(e!==void 0);p.useEffect(()=>{const u=f.current;u!==l&&console.warn(`${r} is changing from ${u?"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.`),f.current=l},[l,r])}const d=p.useCallback(f=>{var u;if(l){const h=rE(f)?f(e):f;h!==e&&((u=o.current)==null||u.call(o,h))}else i(f)},[l,e,i,o]);return[c,d]}function nE({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),s=p.useRef(n),i=p.useRef(t);return tE(()=>{i.current=t},[t]),p.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}function rE(e){return typeof e=="function"}function od(e){const t=aE(e),n=p.forwardRef((r,s)=>{const{children:i,...o}=r,l=p.Children.toArray(i),c=l.find(oE);if(c){const d=c.props.children,f=l.map(u=>u===c?p.Children.count(d)>1?p.Children.only(null):p.isValidElement(d)?d.props.children:null:u);return a.jsx(t,{...o,ref:s,children:p.isValidElement(d)?p.cloneElement(d,void 0,f):null})}return a.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var sE=od("Slot");function aE(e){const t=p.forwardRef((n,r)=>{const{children:s,...i}=n;if(p.isValidElement(s)){const o=cE(s),l=lE(i,s.props);return s.type!==p.Fragment&&(l.ref=r?Bs(r,o):o),p.cloneElement(s,l)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Jv=Symbol("radix.slottable");function iE(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Jv,t}function oE(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Jv}function lE(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function cE(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var dE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ge=dE.reduce((e,t)=>{const n=od(`Primitive.${t}`),r=p.forwardRef((s,i)=>{const{asChild:o,...l}=s,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function uE(e,t){e&&sd.flushSync(()=>e.dispatchEvent(t))}function Wa(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function fE(e,t=globalThis==null?void 0:globalThis.document){const n=Wa(e);p.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var hE="DismissableLayer",Wf="dismissableLayer.update",mE="dismissableLayer.pointerDownOutside",pE="dismissableLayer.focusOutside",Rx,ew=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ld=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,d=p.useContext(ew),[f,u]=p.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=p.useState({}),w=fn(t,S=>u(S)),y=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),g=y.indexOf(b),v=f?y.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,j=v>=g,N=yE(S=>{const M=S.target,z=[...d.branches].some($=>$.contains(M));!j||z||(s==null||s(S),o==null||o(S),S.defaultPrevented||l==null||l())},h),k=vE(S=>{const M=S.target;[...d.branches].some($=>$.contains(M))||(i==null||i(S),o==null||o(S),S.defaultPrevented||l==null||l())},h);return fE(S=>{v===d.layers.size-1&&(r==null||r(S),!S.defaultPrevented&&l&&(S.preventDefault(),l()))},h),p.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Rx=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Ix(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Rx)}},[f,h,n,d]),p.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Ix())},[f,d]),p.useEffect(()=>{const S=()=>m({});return document.addEventListener(Wf,S),()=>document.removeEventListener(Wf,S)},[]),a.jsx(Ge.div,{...c,ref:w,style:{pointerEvents:x?j?"auto":"none":void 0,...e.style},onFocusCapture:yt(e.onFocusCapture,k.onFocusCapture),onBlurCapture:yt(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:yt(e.onPointerDownCapture,N.onPointerDownCapture)})});ld.displayName=hE;var xE="DismissableLayerBranch",gE=p.forwardRef((e,t)=>{const n=p.useContext(ew),r=p.useRef(null),s=fn(t,r);return p.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),a.jsx(Ge.div,{...e,ref:s})});gE.displayName=xE;function yE(e,t=globalThis==null?void 0:globalThis.document){const n=Wa(e),r=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let c=function(){tw(mE,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function vE(e,t=globalThis==null?void 0:globalThis.document){const n=Wa(e),r=p.useRef(!1);return p.useEffect(()=>{const s=i=>{i.target&&!r.current&&tw(pE,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ix(){const e=new CustomEvent(Wf);document.dispatchEvent(e)}function tw(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?uE(s,i):s.dispatchEvent(i)}var fu="focusScope.autoFocusOnMount",hu="focusScope.autoFocusOnUnmount",zx={bubbles:!1,cancelable:!0},wE="FocusScope",gm=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[l,c]=p.useState(null),d=Wa(s),f=Wa(i),u=p.useRef(null),h=fn(t,y=>c(y)),m=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let y=function(x){if(m.paused||!l)return;const j=x.target;l.contains(j)?u.current=j:Ir(u.current,{select:!0})},b=function(x){if(m.paused||!l)return;const j=x.relatedTarget;j!==null&&(l.contains(j)||Ir(u.current,{select:!0}))},g=function(x){if(document.activeElement===document.body)for(const N of x)N.removedNodes.length>0&&Ir(l)};document.addEventListener("focusin",y),document.addEventListener("focusout",b);const v=new MutationObserver(g);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",b),v.disconnect()}}},[r,l,m.paused]),p.useEffect(()=>{if(l){Lx.add(m);const y=document.activeElement;if(!l.contains(y)){const g=new CustomEvent(fu,zx);l.addEventListener(fu,d),l.dispatchEvent(g),g.defaultPrevented||(bE(CE(nw(l)),{select:!0}),document.activeElement===y&&Ir(l))}return()=>{l.removeEventListener(fu,d),setTimeout(()=>{const g=new CustomEvent(hu,zx);l.addEventListener(hu,f),l.dispatchEvent(g),g.defaultPrevented||Ir(y??document.body,{select:!0}),l.removeEventListener(hu,f),Lx.remove(m)},0)}}},[l,d,f,m]);const w=p.useCallback(y=>{if(!n&&!r||m.paused)return;const b=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,g=document.activeElement;if(b&&g){const v=y.currentTarget,[x,j]=NE(v);x&&j?!y.shiftKey&&g===j?(y.preventDefault(),n&&Ir(x,{select:!0})):y.shiftKey&&g===x&&(y.preventDefault(),n&&Ir(j,{select:!0})):g===v&&y.preventDefault()}},[n,r,m.paused]);return a.jsx(Ge.div,{tabIndex:-1,...o,ref:h,onKeyDown:w})});gm.displayName=wE;function bE(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ir(r,{select:t}),document.activeElement!==n)return}function NE(e){const t=nw(e),n=$x(t,e),r=$x(t.reverse(),e);return[n,r]}function nw(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $x(e,t){for(const n of e)if(!jE(n,{upTo:t}))return n}function jE(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 kE(e){return e instanceof HTMLInputElement&&"select"in e}function Ir(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&kE(e)&&t&&e.select()}}var Lx=SE();function SE(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Fx(e,t),e.unshift(t)},remove(t){var n;e=Fx(e,t),(n=e[0])==null||n.resume()}}}function Fx(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function CE(e){return e.filter(t=>t.tagName!=="A")}var EE="Portal",ym=p.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,i]=p.useState(!1);ls(()=>i(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?Iv.createPortal(a.jsx(Ge.div,{...r,ref:t}),o):null});ym.displayName=EE;function ME(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var Zs=e=>{const{present:t,children:n}=e,r=_E(t),s=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),i=fn(r.ref,PE(s));return typeof n=="function"||r.isPresent?p.cloneElement(s,{ref:i}):null};Zs.displayName="Presence";function _E(e){const[t,n]=p.useState(),r=p.useRef(null),s=p.useRef(e),i=p.useRef("none"),o=e?"mounted":"unmounted",[l,c]=ME(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const d=gl(r.current);i.current=l==="mounted"?d:"none"},[l]),ls(()=>{const d=r.current,f=s.current;if(f!==e){const h=i.current,m=gl(d);e?c("MOUNT"):m==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(f&&h!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),ls(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,u=m=>{const y=gl(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&y&&(c("ANIMATION_END"),!s.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=m=>{m.target===t&&(i.current=gl(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:p.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function gl(e){return(e==null?void 0:e.animationName)||"none"}function PE(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mu=0;function rw(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Bx()),document.body.insertAdjacentElement("beforeend",e[1]??Bx()),mu++,()=>{mu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),mu--}},[])}function Bx(){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 qn=function(){return qn=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},qn.apply(this,arguments)};function sw(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function DE(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Hl="right-scroll-bar-position",Yl="width-before-scroll-bar",TE="with-scroll-bars-hidden",OE="--removed-body-scroll-bar-size";function pu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function AE(e,t){var n=p.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var RE=typeof window<"u"?p.useLayoutEffect:p.useEffect,Wx=new WeakMap;function IE(e,t){var n=AE(null,function(r){return e.forEach(function(s){return pu(s,r)})});return RE(function(){var r=Wx.get(n);if(r){var s=new Set(r),i=new Set(e),o=n.current;s.forEach(function(l){i.has(l)||pu(l,null)}),i.forEach(function(l){s.has(l)||pu(l,o)})}Wx.set(n,e)},[e]),n}function zE(e){return e}function $E(e,t){t===void 0&&(t=zE);var n=[],r=!1,s={read:function(){if(r)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,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var f=o;o=[],f.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){o.push(f),d()},filter:function(f){return o=o.filter(f),n}}}};return s}function LE(e){e===void 0&&(e={});var t=$E(null);return t.options=qn({async:!0,ssr:!1},e),t}var aw=function(e){var t=e.sideCar,n=sw(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,qn({},n))};aw.isSideCarExport=!0;function FE(e,t){return e.useMedium(t),aw}var iw=LE(),xu=function(){},cd=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:xu,onWheelCapture:xu,onTouchMoveCapture:xu}),s=r[0],i=r[1],o=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,u=e.shards,h=e.sideCar,m=e.noRelative,w=e.noIsolation,y=e.inert,b=e.allowPinchZoom,g=e.as,v=g===void 0?"div":g,x=e.gapMode,j=sw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=h,k=IE([n,t]),S=qn(qn({},j),s);return p.createElement(p.Fragment,null,f&&p.createElement(N,{sideCar:iw,removeScrollBar:d,shards:u,noRelative:m,noIsolation:w,inert:y,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:x}),o?p.cloneElement(p.Children.only(l),qn(qn({},S),{ref:k})):p.createElement(v,qn({},S,{className:c,ref:k}),l))});cd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};cd.classNames={fullWidth:Yl,zeroRight:Hl};var BE=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function WE(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=BE();return t&&e.setAttribute("nonce",t),e}function UE(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function VE(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var HE=function(){var e=0,t=null;return{add:function(n){e==0&&(t=WE())&&(UE(t,n),VE(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},YE=function(){var e=HE();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ow=function(){var e=YE(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},XE={left:0,top:0,right:0,gap:0},gu=function(e){return parseInt(e||"",10)||0},qE=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[gu(n),gu(r),gu(s)]},GE=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return XE;var t=qE(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},KE=ow(),Pa="data-scroll-locked",QE=function(e,t,n,r){var s=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
323
|
+
.`.concat(TE,` {
|
|
324
|
+
overflow: hidden `).concat(r,`;
|
|
325
|
+
padding-right: `).concat(l,"px ").concat(r,`;
|
|
326
|
+
}
|
|
327
|
+
body[`).concat(Pa,`] {
|
|
328
|
+
overflow: hidden `).concat(r,`;
|
|
329
|
+
overscroll-behavior: contain;
|
|
330
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
331
|
+
padding-left: `.concat(s,`px;
|
|
332
|
+
padding-top: `).concat(i,`px;
|
|
333
|
+
padding-right: `).concat(o,`px;
|
|
334
|
+
margin-left:0;
|
|
335
|
+
margin-top:0;
|
|
336
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
337
|
+
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.`).concat(Hl,` {
|
|
341
|
+
right: `).concat(l,"px ").concat(r,`;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.`).concat(Yl,` {
|
|
345
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.`).concat(Hl," .").concat(Hl,` {
|
|
349
|
+
right: 0 `).concat(r,`;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.`).concat(Yl," .").concat(Yl,` {
|
|
353
|
+
margin-right: 0 `).concat(r,`;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
body[`).concat(Pa,`] {
|
|
357
|
+
`).concat(OE,": ").concat(l,`px;
|
|
358
|
+
}
|
|
359
|
+
`)},Ux=function(){var e=parseInt(document.body.getAttribute(Pa)||"0",10);return isFinite(e)?e:0},ZE=function(){p.useEffect(function(){return document.body.setAttribute(Pa,(Ux()+1).toString()),function(){var e=Ux()-1;e<=0?document.body.removeAttribute(Pa):document.body.setAttribute(Pa,e.toString())}},[])},JE=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;ZE();var i=p.useMemo(function(){return GE(s)},[s]);return p.createElement(KE,{styles:QE(i,!t,s,n?"":"!important")})},Uf=!1;if(typeof window<"u")try{var yl=Object.defineProperty({},"passive",{get:function(){return Uf=!0,!0}});window.addEventListener("test",yl,yl),window.removeEventListener("test",yl,yl)}catch{Uf=!1}var ta=Uf?{passive:!1}:!1,e4=function(e){return e.tagName==="TEXTAREA"},lw=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!e4(e)&&n[t]==="visible")},t4=function(e){return lw(e,"overflowY")},n4=function(e){return lw(e,"overflowX")},Vx=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=cw(e,r);if(s){var i=dw(e,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},r4=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},s4=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},cw=function(e,t){return e==="v"?t4(t):n4(t)},dw=function(e,t){return e==="v"?r4(t):s4(t)},a4=function(e,t){return e==="h"&&t==="rtl"?-1:1},i4=function(e,t,n,r,s){var i=a4(e,window.getComputedStyle(t).direction),o=i*r,l=n.target,c=t.contains(l),d=!1,f=o>0,u=0,h=0;do{if(!l)break;var m=dw(e,l),w=m[0],y=m[1],b=m[2],g=y-b-i*w;(w||g)&&cw(e,l)&&(u+=g,h+=w);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(f&&Math.abs(u)<1||!f&&Math.abs(h)<1)&&(d=!0),d},vl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Hx=function(e){return[e.deltaX,e.deltaY]},Yx=function(e){return e&&"current"in e?e.current:e},o4=function(e,t){return e[0]===t[0]&&e[1]===t[1]},l4=function(e){return`
|
|
360
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
361
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
362
|
+
`)},c4=0,na=[];function d4(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),s=p.useState(c4++)[0],i=p.useState(ow)[0],o=p.useRef(e);p.useEffect(function(){o.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var y=DE([e.lockRef.current],(e.shards||[]).map(Yx),!0).filter(Boolean);return y.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(y,b){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!o.current.allowPinchZoom;var g=vl(y),v=n.current,x="deltaX"in y?y.deltaX:v[0]-g[0],j="deltaY"in y?y.deltaY:v[1]-g[1],N,k=y.target,S=Math.abs(x)>Math.abs(j)?"h":"v";if("touches"in y&&S==="h"&&k.type==="range")return!1;var M=Vx(S,k);if(!M)return!0;if(M?N=S:(N=S==="v"?"h":"v",M=Vx(S,k)),!M)return!1;if(!r.current&&"changedTouches"in y&&(x||j)&&(r.current=N),!N)return!0;var z=r.current||N;return i4(z,b,y,z==="h"?x:j)},[]),c=p.useCallback(function(y){var b=y;if(!(!na.length||na[na.length-1]!==i)){var g="deltaY"in b?Hx(b):vl(b),v=t.current.filter(function(N){return N.name===b.type&&(N.target===b.target||b.target===N.shadowParent)&&o4(N.delta,g)})[0];if(v&&v.should){b.cancelable&&b.preventDefault();return}if(!v){var x=(o.current.shards||[]).map(Yx).filter(Boolean).filter(function(N){return N.contains(b.target)}),j=x.length>0?l(b,x[0]):!o.current.noIsolation;j&&b.cancelable&&b.preventDefault()}}},[]),d=p.useCallback(function(y,b,g,v){var x={name:y,delta:b,target:g,should:v,shadowParent:u4(g)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(j){return j!==x})},1)},[]),f=p.useCallback(function(y){n.current=vl(y),r.current=void 0},[]),u=p.useCallback(function(y){d(y.type,Hx(y),y.target,l(y,e.lockRef.current))},[]),h=p.useCallback(function(y){d(y.type,vl(y),y.target,l(y,e.lockRef.current))},[]);p.useEffect(function(){return na.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:h}),document.addEventListener("wheel",c,ta),document.addEventListener("touchmove",c,ta),document.addEventListener("touchstart",f,ta),function(){na=na.filter(function(y){return y!==i}),document.removeEventListener("wheel",c,ta),document.removeEventListener("touchmove",c,ta),document.removeEventListener("touchstart",f,ta)}},[]);var m=e.removeScrollBar,w=e.inert;return p.createElement(p.Fragment,null,w?p.createElement(i,{styles:l4(s)}):null,m?p.createElement(JE,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function u4(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const f4=FE(iw,d4);var vm=p.forwardRef(function(e,t){return p.createElement(cd,qn({},e,{ref:t,sideCar:f4}))});vm.classNames=cd.classNames;var h4=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ra=new WeakMap,wl=new WeakMap,bl={},yu=0,uw=function(e){return e&&(e.host||uw(e.parentNode))},m4=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=uw(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},p4=function(e,t,n,r){var s=m4(t,Array.isArray(e)?e:[e]);bl[n]||(bl[n]=new WeakMap);var i=bl[n],o=[],l=new Set,c=new Set(s),d=function(u){!u||l.has(u)||(l.add(u),d(u.parentNode))};s.forEach(d);var f=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(h){if(l.has(h))f(h);else try{var m=h.getAttribute(r),w=m!==null&&m!=="false",y=(ra.get(h)||0)+1,b=(i.get(h)||0)+1;ra.set(h,y),i.set(h,b),o.push(h),y===1&&w&&wl.set(h,!0),b===1&&h.setAttribute(n,"true"),w||h.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",h,g)}})};return f(t),l.clear(),yu++,function(){o.forEach(function(u){var h=ra.get(u)-1,m=i.get(u)-1;ra.set(u,h),i.set(u,m),h||(wl.has(u)||u.removeAttribute(r),wl.delete(u)),m||u.removeAttribute(n)}),yu--,yu||(ra=new WeakMap,ra=new WeakMap,wl=new WeakMap,bl={})}},fw=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=h4(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),p4(r,s,n,"aria-hidden")):function(){return null}},dd="Dialog",[hw]=id(dd),[x4,zn]=hw(dd),mw=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,l=p.useRef(null),c=p.useRef(null),[d,f]=xm({prop:r,defaultProp:s??!1,onChange:i,caller:dd});return a.jsx(x4,{scope:t,triggerRef:l,contentRef:c,contentId:On(),titleId:On(),descriptionId:On(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(u=>!u),[f]),modal:o,children:n})};mw.displayName=dd;var pw="DialogTrigger",g4=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=zn(pw,n),i=fn(t,s.triggerRef);return a.jsx(Ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Nm(s.open),...r,ref:i,onClick:yt(e.onClick,s.onOpenToggle)})});g4.displayName=pw;var wm="DialogPortal",[y4,xw]=hw(wm,{forceMount:void 0}),gw=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=zn(wm,t);return a.jsx(y4,{scope:t,forceMount:n,children:p.Children.map(r,o=>a.jsx(Zs,{present:n||i.open,children:a.jsx(ym,{asChild:!0,container:s,children:o})}))})};gw.displayName=wm;var Cc="DialogOverlay",yw=p.forwardRef((e,t)=>{const n=xw(Cc,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=zn(Cc,e.__scopeDialog);return i.modal?a.jsx(Zs,{present:r||i.open,children:a.jsx(w4,{...s,ref:t})}):null});yw.displayName=Cc;var v4=od("DialogOverlay.RemoveScroll"),w4=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=zn(Cc,n);return a.jsx(vm,{as:v4,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(Ge.div,{"data-state":Nm(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ws="DialogContent",vw=p.forwardRef((e,t)=>{const n=xw(Ws,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=zn(Ws,e.__scopeDialog);return a.jsx(Zs,{present:r||i.open,children:i.modal?a.jsx(b4,{...s,ref:t}):a.jsx(N4,{...s,ref:t})})});vw.displayName=Ws;var b4=p.forwardRef((e,t)=>{const n=zn(Ws,e.__scopeDialog),r=p.useRef(null),s=fn(t,n.contentRef,r);return p.useEffect(()=>{const i=r.current;if(i)return fw(i)},[]),a.jsx(ww,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yt(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:yt(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:yt(e.onFocusOutside,i=>i.preventDefault())})}),N4=p.forwardRef((e,t)=>{const n=zn(Ws,e.__scopeDialog),r=p.useRef(!1),s=p.useRef(!1);return a.jsx(ww,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),ww=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=e,l=zn(Ws,n),c=p.useRef(null),d=fn(t,c);return rw(),a.jsxs(a.Fragment,{children:[a.jsx(gm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(ld,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Nm(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(C4,{titleId:l.titleId}),a.jsx(M4,{contentRef:c,descriptionId:l.descriptionId})]})]})}),bm="DialogTitle",j4=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=zn(bm,n);return a.jsx(Ge.h2,{id:s.titleId,...r,ref:t})});j4.displayName=bm;var bw="DialogDescription",k4=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=zn(bw,n);return a.jsx(Ge.p,{id:s.descriptionId,...r,ref:t})});k4.displayName=bw;var Nw="DialogClose",S4=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=zn(Nw,n);return a.jsx(Ge.button,{type:"button",...r,ref:t,onClick:yt(e.onClick,()=>s.onOpenChange(!1))})});S4.displayName=Nw;function Nm(e){return e?"open":"closed"}var jw="DialogTitleWarning",[g$,kw]=QC(jw,{contentName:Ws,titleName:bm,docsSlug:"dialog"}),C4=({titleId:e})=>{const t=kw(jw),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
363
|
+
|
|
364
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
365
|
+
|
|
366
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},E4="DialogDescriptionWarning",M4=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${kw(E4).contentName}}.`;return p.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},_4=mw,P4=gw,D4=yw,T4=vw,vi='[cmdk-group=""]',vu='[cmdk-group-items=""]',O4='[cmdk-group-heading=""]',Sw='[cmdk-item=""]',Xx=`${Sw}:not([aria-disabled="true"])`,Vf="cmdk-item-select",oa="data-value",A4=(e,t,n)=>KC(e,t,n),Cw=p.createContext(void 0),$o=()=>p.useContext(Cw),Ew=p.createContext(void 0),jm=()=>p.useContext(Ew),Mw=p.createContext(void 0),_w=p.forwardRef((e,t)=>{let n=la(()=>{var T,F;return{search:"",value:(F=(T=e.value)!=null?T:e.defaultValue)!=null?F:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=la(()=>new Set),s=la(()=>new Map),i=la(()=>new Map),o=la(()=>new Set),l=Pw(e),{label:c,children:d,value:f,onValueChange:u,filter:h,shouldFilter:m,loop:w,disablePointerSelection:y=!1,vimBindings:b=!0,...g}=e,v=On(),x=On(),j=On(),N=p.useRef(null),k=H4();Us(()=>{if(f!==void 0){let T=f.trim();n.current.value=T,S.emit()}},[f]),Us(()=>{k(6,L)},[]);let S=p.useMemo(()=>({subscribe:T=>(o.current.add(T),()=>o.current.delete(T)),snapshot:()=>n.current,setState:(T,F,H)=>{var X,J,ee,K;if(!Object.is(n.current[T],F)){if(n.current[T]=F,T==="search")O(),$(),k(1,A);else if(T==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ne=document.getElementById(j);ne?ne.focus():(X=document.getElementById(v))==null||X.focus()}if(k(7,()=>{var ne;n.current.selectedItemId=(ne=E())==null?void 0:ne.id,S.emit()}),H||k(5,L),((J=l.current)==null?void 0:J.value)!==void 0){let ne=F??"";(K=(ee=l.current).onValueChange)==null||K.call(ee,ne);return}}S.emit()}},emit:()=>{o.current.forEach(T=>T())}}),[]),M=p.useMemo(()=>({value:(T,F,H)=>{var X;F!==((X=i.current.get(T))==null?void 0:X.value)&&(i.current.set(T,{value:F,keywords:H}),n.current.filtered.items.set(T,z(F,H)),k(2,()=>{$(),S.emit()}))},item:(T,F)=>(r.current.add(T),F&&(s.current.has(F)?s.current.get(F).add(T):s.current.set(F,new Set([T]))),k(3,()=>{O(),$(),n.current.value||A(),S.emit()}),()=>{i.current.delete(T),r.current.delete(T),n.current.filtered.items.delete(T);let H=E();k(4,()=>{O(),(H==null?void 0:H.getAttribute("id"))===T&&A(),S.emit()})}),group:T=>(s.current.has(T)||s.current.set(T,new Set),()=>{i.current.delete(T),s.current.delete(T)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:v,inputId:j,labelId:x,listInnerRef:N}),[]);function z(T,F){var H,X;let J=(X=(H=l.current)==null?void 0:H.filter)!=null?X:A4;return T?J(T,n.current.search,F):0}function $(){if(!n.current.search||l.current.shouldFilter===!1)return;let T=n.current.filtered.items,F=[];n.current.filtered.groups.forEach(X=>{let J=s.current.get(X),ee=0;J.forEach(K=>{let ne=T.get(K);ee=Math.max(ne,ee)}),F.push([X,ee])});let H=N.current;I().sort((X,J)=>{var ee,K;let ne=X.getAttribute("id"),me=J.getAttribute("id");return((ee=T.get(me))!=null?ee:0)-((K=T.get(ne))!=null?K:0)}).forEach(X=>{let J=X.closest(vu);J?J.appendChild(X.parentElement===J?X:X.closest(`${vu} > *`)):H.appendChild(X.parentElement===H?X:X.closest(`${vu} > *`))}),F.sort((X,J)=>J[1]-X[1]).forEach(X=>{var J;let ee=(J=N.current)==null?void 0:J.querySelector(`${vi}[${oa}="${encodeURIComponent(X[0])}"]`);ee==null||ee.parentElement.appendChild(ee)})}function A(){let T=I().find(H=>H.getAttribute("aria-disabled")!=="true"),F=T==null?void 0:T.getAttribute(oa);S.setState("value",F||void 0)}function O(){var T,F,H,X;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let J=0;for(let ee of r.current){let K=(F=(T=i.current.get(ee))==null?void 0:T.value)!=null?F:"",ne=(X=(H=i.current.get(ee))==null?void 0:H.keywords)!=null?X:[],me=z(K,ne);n.current.filtered.items.set(ee,me),me>0&&J++}for(let[ee,K]of s.current)for(let ne of K)if(n.current.filtered.items.get(ne)>0){n.current.filtered.groups.add(ee);break}n.current.filtered.count=J}function L(){var T,F,H;let X=E();X&&(((T=X.parentElement)==null?void 0:T.firstChild)===X&&((H=(F=X.closest(vi))==null?void 0:F.querySelector(O4))==null||H.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function E(){var T;return(T=N.current)==null?void 0:T.querySelector(`${Sw}[aria-selected="true"]`)}function I(){var T;return Array.from(((T=N.current)==null?void 0:T.querySelectorAll(Xx))||[])}function D(T){let F=I()[T];F&&S.setState("value",F.getAttribute(oa))}function P(T){var F;let H=E(),X=I(),J=X.findIndex(K=>K===H),ee=X[J+T];(F=l.current)!=null&&F.loop&&(ee=J+T<0?X[X.length-1]:J+T===X.length?X[0]:X[J+T]),ee&&S.setState("value",ee.getAttribute(oa))}function C(T){let F=E(),H=F==null?void 0:F.closest(vi),X;for(;H&&!X;)H=T>0?U4(H,vi):V4(H,vi),X=H==null?void 0:H.querySelector(Xx);X?S.setState("value",X.getAttribute(oa)):P(T)}let _=()=>D(I().length-1),R=T=>{T.preventDefault(),T.metaKey?_():T.altKey?C(1):P(1)},B=T=>{T.preventDefault(),T.metaKey?D(0):T.altKey?C(-1):P(-1)};return p.createElement(Ge.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:T=>{var F;(F=g.onKeyDown)==null||F.call(g,T);let H=T.nativeEvent.isComposing||T.keyCode===229;if(!(T.defaultPrevented||H))switch(T.key){case"n":case"j":{b&&T.ctrlKey&&R(T);break}case"ArrowDown":{R(T);break}case"p":case"k":{b&&T.ctrlKey&&B(T);break}case"ArrowUp":{B(T);break}case"Home":{T.preventDefault(),D(0);break}case"End":{T.preventDefault(),_();break}case"Enter":{T.preventDefault();let X=E();if(X){let J=new Event(Vf);X.dispatchEvent(J)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:X4},c),ud(e,T=>p.createElement(Ew.Provider,{value:S},p.createElement(Cw.Provider,{value:M},T))))}),R4=p.forwardRef((e,t)=>{var n,r;let s=On(),i=p.useRef(null),o=p.useContext(Mw),l=$o(),c=Pw(e),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;Us(()=>{if(!d)return l.item(s,o==null?void 0:o.id)},[d]);let f=Dw(s,i,[e.value,e.children,i],e.keywords),u=jm(),h=cs(k=>k.value&&k.value===f.current),m=cs(k=>d||l.filter()===!1?!0:k.search?k.filtered.items.get(s)>0:!0);p.useEffect(()=>{let k=i.current;if(!(!k||e.disabled))return k.addEventListener(Vf,w),()=>k.removeEventListener(Vf,w)},[m,e.onSelect,e.disabled]);function w(){var k,S;y(),(S=(k=c.current).onSelect)==null||S.call(k,f.current)}function y(){u.setState("value",f.current,!0)}if(!m)return null;let{disabled:b,value:g,onSelect:v,forceMount:x,keywords:j,...N}=e;return p.createElement(Ge.div,{ref:Bs(i,t),...N,id:s,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!h,"data-disabled":!!b,"data-selected":!!h,onPointerMove:b||l.getDisablePointerSelection()?void 0:y,onClick:b?void 0:w},e.children)}),I4=p.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...i}=e,o=On(),l=p.useRef(null),c=p.useRef(null),d=On(),f=$o(),u=cs(m=>s||f.filter()===!1?!0:m.search?m.filtered.groups.has(o):!0);Us(()=>f.group(o),[]),Dw(o,l,[e.value,e.heading,c]);let h=p.useMemo(()=>({id:o,forceMount:s}),[s]);return p.createElement(Ge.div,{ref:Bs(l,t),...i,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&p.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),ud(e,m=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},p.createElement(Mw.Provider,{value:h},m))))}),z4=p.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=p.useRef(null),i=cs(o=>!o.search);return!n&&!i?null:p.createElement(Ge.div,{ref:Bs(s,t),...r,"cmdk-separator":"",role:"separator"})}),$4=p.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,i=jm(),o=cs(d=>d.search),l=cs(d=>d.selectedItemId),c=$o();return p.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),p.createElement(Ge.input,{ref:t,...r,"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:s?e.value:o,onChange:d=>{s||i.setState("search",d.target.value),n==null||n(d.target.value)}})}),L4=p.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,i=p.useRef(null),o=p.useRef(null),l=cs(d=>d.selectedItemId),c=$o();return p.useEffect(()=>{if(o.current&&i.current){let d=o.current,f=i.current,u,h=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let m=d.offsetHeight;f.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(d),()=>{cancelAnimationFrame(u),h.unobserve(d)}}},[]),p.createElement(Ge.div,{ref:Bs(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},ud(e,d=>p.createElement("div",{ref:Bs(o,c.listInnerRef),"cmdk-list-sizer":""},d)))}),F4=p.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:o,...l}=e;return p.createElement(_4,{open:n,onOpenChange:r},p.createElement(P4,{container:o},p.createElement(D4,{"cmdk-overlay":"",className:s}),p.createElement(T4,{"aria-label":e.label,"cmdk-dialog":"",className:i},p.createElement(_w,{ref:t,...l}))))}),B4=p.forwardRef((e,t)=>cs(n=>n.filtered.count===0)?p.createElement(Ge.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),W4=p.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...i}=e;return p.createElement(Ge.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},ud(e,o=>p.createElement("div",{"aria-hidden":!0},o)))}),wi=Object.assign(_w,{List:L4,Item:R4,Input:$4,Group:I4,Separator:z4,Dialog:F4,Empty:B4,Loading:W4});function U4(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function V4(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Pw(e){let t=p.useRef(e);return Us(()=>{t.current=e}),t}var Us=typeof window>"u"?p.useEffect:p.useLayoutEffect;function la(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function cs(e){let t=jm(),n=()=>e(t.snapshot());return p.useSyncExternalStore(t.subscribe,n,n)}function Dw(e,t,n,r=[]){let s=p.useRef(),i=$o();return Us(()=>{var o;let l=(()=>{var d;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(d=f.current.textContent)==null?void 0:d.trim():s.current}})(),c=r.map(d=>d.trim());i.value(e,l,c),(o=t.current)==null||o.setAttribute(oa,l),s.current=l}),s}var H4=()=>{let[e,t]=p.useState(),n=la(()=>new Map);return Us(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function Y4(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function ud({asChild:e,children:t},n){return e&&p.isValidElement(t)?p.cloneElement(Y4(t),{ref:t.ref},n(t.props.children)):n(t)}var X4={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function q4({isOpen:e,onClose:t}){const n=Qs(),[r,s]=p.useState(""),l=[{id:"users",title:"Users",description:"Manage users and their accounts",icon:Oe,action:()=>n("/users"),category:"Navigation",keywords:["user","account","profile"]},{id:"organizations",title:"Organizations",description:"Manage organizations and teams",icon:it,action:()=>n("/organizations"),category:"Navigation",keywords:["org","company","team"]},{id:"sessions",title:"Sessions",description:"View active user sessions",icon:Lf,action:()=>n("/sessions"),category:"Navigation",keywords:["session","login","active"]},{id:"settings",title:"Settings",description:"Configure Better Auth Studio",icon:Ps,action:()=>n("/settings"),category:"Navigation",keywords:["config","setup","preferences"]},{id:"dashboard",title:"Dashboard",description:"View overview and statistics",icon:Lf,action:()=>n("/"),category:"Navigation",keywords:["overview","stats","home"]},{id:"create-user",title:"Create User",description:"Add a new user to the system",icon:ts,action:()=>n("/users"),category:"Actions",keywords:["add","new","register"]},{id:"create-organization",title:"Create Organization",description:"Create a new organization",icon:pr,action:()=>n("/organizations"),category:"Actions",keywords:["add","new","org"]},{id:"invite-user",title:"Invite User",description:"Send invitation to join organization",icon:pn,action:()=>n("/organizations"),category:"Actions",keywords:["invite","email","send"]}].filter(c=>{var f;const d=r.toLowerCase();return c.title.toLowerCase().includes(d)||c.description.toLowerCase().includes(d)||((f=c.keywords)==null?void 0:f.some(u=>u.toLowerCase().includes(d)))}).reduce((c,d)=>(c[d.category]||(c[d.category]=[]),c[d.category].push(d),c),{});return p.useEffect(()=>{const c=d=>{(d.metaKey||d.ctrlKey)&&d.key==="k"&&d.preventDefault()};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[]),p.useEffect(()=>{const c=d=>{d.key==="Escape"&&t()};if(e)return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[e,t]),e?a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-start justify-center pt-[20vh] z-50",children:a.jsx("div",{className:"bg-black/90 border border-dashed border-white/20 rounded-none w-full max-w-2xl mx-4",children:a.jsxs(wi,{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(os,{className:"w-4 h-4 text-gray-400 mr-3"}),a.jsx(wi.Input,{value:r,onValueChange:s,placeholder:"Search for actions, pages, or commands...",className:"flex-1 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(wi.List,{className:"max-h-96 overflow-y-auto p-2",children:Object.keys(l).length===0?a.jsxs("div",{className:"text-center py-8 text-gray-400",children:[a.jsx(os,{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(l).map(([c,d])=>a.jsx("div",{className:"mb-4",children:a.jsx(wi.Group,{heading:c,className:"text-xs text-gray-400 font-medium mb-2 px-2",children:d.map(f=>{const u=f.icon;return a.jsxs(wi.Item,{value:f.id,onSelect:()=>{f.action(),t()},className:"flex items-center space-x-3 px-3 py-2 rounded-none hover:bg-white/5 cursor-pointer transition-colors",children:[a.jsx(u,{className:"w-4 h-4 text-white"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-white font-light",children:f.title}),a.jsx("div",{className:"text-sm text-gray-400",children:f.description})]}),a.jsx(ia,{className:"w-4 h-4 text-gray-400"})]},f.id)})})},c))}),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}function Tw(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Tw(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ow(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Tw(e))&&(r&&(r+=" "),r+=t);return r}const qx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Gx=Ow,Aw=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Gx(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(d=>{const f=n==null?void 0:n[d],u=i==null?void 0:i[d];if(f===null)return null;const h=qx(f)||qx(u);return s[d][h]}),l=n&&Object.entries(n).reduce((d,f)=>{let[u,h]=f;return h===void 0||(d[u]=h),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:u,className:h,...m}=f;return Object.entries(m).every(w=>{let[y,b]=w;return Array.isArray(b)?b.includes({...i,...l}[y]):{...i,...l}[y]===b})?[...d,u,h]:d},[]);return Gx(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},km="-",G4=e=>{const t=Q4(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(km);return l[0]===""&&l.length!==1&&l.shift(),Rw(l,t)||K4(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&r[o]?[...c,...r[o]]:c}}},Rw=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Rw(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(km);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},Kx=/^\[(.+)\]$/,K4=e=>{if(Kx.test(e)){const t=Kx.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Q4=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return J4(Object.entries(e.classGroups),n).forEach(([i,o])=>{Hf(o,r,i,t)}),r},Hf=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:Qx(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(Z4(s)){Hf(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{Hf(o,Qx(t,i),n,r)})})},Qx=(e,t)=>{let n=e;return t.split(km).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Z4=e=>e.isThemeGetter,J4=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[n,s]}):e,e3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},Iw="!",t3=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=l=>{const c=[];let d=0,f=0,u;for(let b=0;b<l.length;b++){let g=l[b];if(d===0){if(g===s&&(r||l.slice(b,b+i)===t)){c.push(l.slice(f,b)),f=b+i;continue}if(g==="/"){u=b;continue}}g==="["?d++:g==="]"&&d--}const h=c.length===0?l:l.substring(f),m=h.startsWith(Iw),w=m?h.substring(1):h,y=u&&u>f?u-f:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:w,maybePostfixModifierPosition:y}};return n?l=>n({className:l,parseClassName:o}):o},n3=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},r3=e=>({cache:e3(e.cacheSize),parseClassName:t3(e),...G4(e)}),s3=/\s+/,a3=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(s3);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:f,hasImportantModifier:u,baseClassName:h,maybePostfixModifierPosition:m}=n(d);let w=!!m,y=r(w?h.substring(0,m):h);if(!y){if(!w){l=d+(l.length>0?" "+l:l);continue}if(y=r(h),!y){l=d+(l.length>0?" "+l:l);continue}w=!1}const b=n3(f).join(":"),g=u?b+Iw:b,v=g+y;if(i.includes(v))continue;i.push(v);const x=s(y,w);for(let j=0;j<x.length;++j){const N=x[j];i.push(g+N)}l=d+(l.length>0?" "+l:l)}return l};function i3(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=zw(t))&&(r&&(r+=" "),r+=n);return r}const zw=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=zw(e[r]))&&(n&&(n+=" "),n+=t);return n};function o3(e,...t){let n,r,s,i=o;function o(c){const d=t.reduce((f,u)=>u(f),e());return n=r3(d),r=n.cache.get,s=n.cache.set,i=l,l(c)}function l(c){const d=r(c);if(d)return d;const f=a3(c,n);return s(c,f),f}return function(){return i(i3.apply(null,arguments))}}const Ve=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},$w=/^\[(?:([a-z-]+):)?(.+)\]$/i,l3=/^\d+\/\d+$/,c3=new Set(["px","full","screen"]),d3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,u3=/\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$/,f3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,h3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,m3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,lr=e=>Da(e)||c3.has(e)||l3.test(e),Dr=e=>ii(e,"length",N3),Da=e=>!!e&&!Number.isNaN(Number(e)),wu=e=>ii(e,"number",Da),bi=e=>!!e&&Number.isInteger(Number(e)),p3=e=>e.endsWith("%")&&Da(e.slice(0,-1)),ke=e=>$w.test(e),Tr=e=>d3.test(e),x3=new Set(["length","size","percentage"]),g3=e=>ii(e,x3,Lw),y3=e=>ii(e,"position",Lw),v3=new Set(["image","url"]),w3=e=>ii(e,v3,k3),b3=e=>ii(e,"",j3),Ni=()=>!0,ii=(e,t,n)=>{const r=$w.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},N3=e=>u3.test(e)&&!f3.test(e),Lw=()=>!1,j3=e=>h3.test(e),k3=e=>m3.test(e),S3=()=>{const e=Ve("colors"),t=Ve("spacing"),n=Ve("blur"),r=Ve("brightness"),s=Ve("borderColor"),i=Ve("borderRadius"),o=Ve("borderSpacing"),l=Ve("borderWidth"),c=Ve("contrast"),d=Ve("grayscale"),f=Ve("hueRotate"),u=Ve("invert"),h=Ve("gap"),m=Ve("gradientColorStops"),w=Ve("gradientColorStopPositions"),y=Ve("inset"),b=Ve("margin"),g=Ve("opacity"),v=Ve("padding"),x=Ve("saturate"),j=Ve("scale"),N=Ve("sepia"),k=Ve("skew"),S=Ve("space"),M=Ve("translate"),z=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",ke,t],O=()=>[ke,t],L=()=>["",lr,Dr],E=()=>["auto",Da,ke],I=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],P=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],C=()=>["start","end","center","between","around","evenly","stretch"],_=()=>["","0",ke],R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Da,ke];return{cacheSize:500,separator:":",theme:{colors:[Ni],spacing:[lr,Dr],blur:["none","",Tr,ke],brightness:B(),borderColor:[e],borderRadius:["none","","full",Tr,ke],borderSpacing:O(),borderWidth:L(),contrast:B(),grayscale:_(),hueRotate:B(),invert:_(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[p3,Dr],inset:A(),margin:A(),opacity:B(),padding:O(),saturate:B(),scale:B(),sepia:_(),skew:B(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",ke]}],container:["container"],columns:[{columns:[Tr]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:[...I(),ke]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",bi,ke]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ke]}],grow:[{grow:_()}],shrink:[{shrink:_()}],order:[{order:["first","last","none",bi,ke]}],"grid-cols":[{"grid-cols":[Ni]}],"col-start-end":[{col:["auto",{span:["full",bi,ke]},ke]}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":[Ni]}],"row-start-end":[{row:["auto",{span:[bi,ke]},ke]}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ke]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ke]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...C()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...C(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...C(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ke,t]}],"min-w":[{"min-w":[ke,t,"min","max","fit"]}],"max-w":[{"max-w":[ke,t,"none","full","min","max","fit","prose",{screen:[Tr]},Tr]}],h:[{h:[ke,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ke,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ke,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ke,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Tr,Dr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",wu]}],"font-family":[{font:[Ni]}],"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",ke]}],"line-clamp":[{"line-clamp":["none",Da,wu]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",lr,ke]}],"list-image":[{"list-image":["none",ke]}],"list-style-type":[{list:["none","disc","decimal",ke]}],"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:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",lr,Dr]}],"underline-offset":[{"underline-offset":["auto",lr,ke]}],"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",ke]}],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",ke]}],"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:[...I(),y3]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",g3]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},w3]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],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:[...D(),"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:D()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...D()]}],"outline-offset":[{"outline-offset":[lr,ke]}],"outline-w":[{outline:[lr,Dr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[lr,Dr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Tr,b3]}],"shadow-color":[{shadow:[Ni]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...P(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":P()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Tr,ke]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[u]}],saturate:[{saturate:[x]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"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",ke]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",ke]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",ke]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[bi,ke]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ke]}],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",ke]}],"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",ke]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[lr,Dr,wu]}],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"]}}},C3=o3(S3);function we(...e){return C3(Ow(e))}const E3=Aw("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 je({className:e,variant:t,...n}){return a.jsx("div",{className:we(E3({variant:t}),e),...n})}const Yf=Aw("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"}}),U=p.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},i)=>{const o=r?sE:"button";return a.jsx(o,{className:we(Yf({variant:t,size:n,className:e})),ref:i,...s})});U.displayName="Button";function M3({children:e}){const t=Ro(),{counts:n,loading:r}=pm(),[s,i]=p.useState(!1),[o,l]=p.useState("v1.0.0");p.useEffect(()=>{const f=u=>{(u.metaKey||u.ctrlKey)&&u.key==="k"&&(u.preventDefault(),i(!0))};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[]),p.useEffect(()=>{(async()=>{var u;try{const m=await(await fetch("/api/config")).json();(u=m.studio)!=null&&u.version&&l(`v${m.studio.version}`)}catch{}})()},[]);const c=f=>f>=1e3?`${(f/1e3).toFixed(1).replace(/\.0$/,"")}k`:f.toString(),d=[{name:"Dashboard",href:"/",icon:IC},{name:"Users",href:"/users",icon:Oe,badge:r?"...":c(n.users)},{name:"Organizations",href:"/organizations",icon:it,badge:r?"...":c(n.organizations)},{name:"Database",href:"/database",icon:Be},{name:"Settings",href:"/settings",icon:Ps}];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-center space-x-2",children:[a.jsx("div",{className:"w-8 h-8 bg-white rounded-lg flex items-center justify-center",children:a.jsx("span",{className:"text-black font-bold text-lg",children:"⚡"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-bold text-white",children:"Better Auth Studio"}),a.jsx("p",{className:"text-xs text-gray-300",children:o})]})]})}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(os,{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:()=>i(!0),className:"pl-10 pr-4 py-2 bg-black border rounded-none border-gray-600 text-white border-dashed 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/20 rounded-sm px-1.5 py-0.5",children:"⌘K"})]}),a.jsx("a",{href:"https://better-auth.com/docs",target:"_blank",rel:"noopener",children:a.jsx(U,{variant:"ghost",className:"text-gray-300 bg-transparent hover:bg-transparent hover:bg-gray-900 border-dashed",children:"Docs"})}),a.jsx("a",{href:"https://better-auth.com/support",target:"_blank",rel:"noopener",children:a.jsx(U,{variant:"ghost",className:"text-gray-300 bg-transparent hover:bg-transparent hover:bg-gray-900 border-dashed",children:"Support"})})]})]})}),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:d.map(f=>{const u=t.pathname===f.href;return a.jsxs(_a,{to:f.href,className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${u?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(f.icon,{className:"w-4 h-4"}),a.jsx("span",{children:f.name}),f.badge&&a.jsx(je,{variant:"secondary",className:"text-xs bg-white/10 border border-white/20 rounded-sm",children:f.badge})]},f.name)})})})}),a.jsx("div",{className:"flex-1 p-0",children:e}),a.jsx(q4,{isOpen:s,onClose:()=>i(!1)})]})}const St=p.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:we("rounded-lg border border-gray-700 bg-gray-900 text-white shadow-sm",e),...t}));St.displayName="Card";const hn=p.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:we("flex flex-col space-y-1.5 p-6",e),...t}));hn.displayName="CardHeader";const mn=p.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:we("text-2xl font-semibold leading-none tracking-tight text-white",e),...t}));mn.displayName="CardTitle";const Un=p.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:we("text-sm text-gray-300",e),...t}));Un.displayName="CardDescription";const Ct=p.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:we("p-6 pt-0",e),...t}));Ct.displayName="CardContent";const _3=p.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:we("flex items-center p-6 pt-0",e),...t}));_3.displayName="CardFooter";function Ua({title:e="Seeding Terminal",lines:t,isRunning:n=!1,className:r="",defaultCollapsed:s=!1}){const[i,o]=p.useState(s),l=f=>{switch(f.type){case"success":return a.jsx(ut,{className:"w-3 h-3 text-green-400"});case"error":return a.jsx(Ns,{className:"w-3 h-3 text-red-400"});case"progress":return f.status==="running"?a.jsx(Rt,{className:"w-3 h-3 text-blue-400 animate-spin"}):f.status==="completed"?a.jsx(ut,{className:"w-3 h-3 text-green-400"}):f.status==="failed"?a.jsx(Ns,{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"})}},c=f=>{switch(f.type){case"success":return"text-green-400";case"error":return"text-red-400";case"progress":return f.status==="running"?"text-blue-400":f.status==="completed"?"text-green-400":f.status==="failed"?"text-red-400":"text-gray-400";default:return"text-gray-300"}},d=f=>f.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+f.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 ${r}`,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(FC,{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(Io,{className:"w-3 h-3"}):a.jsx(TC,{className:"w-3 h-3"})})]})]}),!i&&a.jsxs("div",{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(f=>a.jsxs("div",{className:`flex items-start space-x-3 py-1 ${c(f)} text-xs`,children:[a.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:d(f.timestamp)}),a.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),a.jsx("div",{className:"flex-shrink-0 mt-0.5",children:l(f)}),a.jsx("span",{className:"flex-1 min-w-0 break-words",children:f.message})]},f.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:d(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 Fw=document.createElement("style");Fw.textContent=`
|
|
367
|
+
@keyframes fadeIn {
|
|
368
|
+
from {
|
|
369
|
+
opacity: 0;
|
|
370
|
+
transform: translateX(-10px);
|
|
371
|
+
}
|
|
372
|
+
to {
|
|
373
|
+
opacity: 1;
|
|
374
|
+
transform: translateX(0);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.animate-fadeIn {
|
|
379
|
+
animation: fadeIn 0.3s ease-out forwards;
|
|
380
|
+
}
|
|
381
|
+
`;document.head.appendChild(Fw);const Ce=p.forwardRef(({className:e,type:t,...n},r)=>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:r,...n}));Ce.displayName="Input";const De=p.forwardRef(({className:e,...t},n)=>a.jsx("label",{className:`text-sm font-light text-white ${e}`,ref:n,...t}));De.displayName="Label";function Bw({currentPage:e,totalPages:t,onPageChange:n,totalItems:r,startIndex:s,endIndex:i}){const o=()=>{const d=[],f=[];for(let u=Math.max(2,e-2);u<=Math.min(t-1,e+2);u++)d.push(u);return e-2>2?f.push(1,"..."):f.push(1),f.push(...d),e+2<t-1?f.push("...",t):t>1&&f.push(t),f};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 ",s+1," to ",Math.min(i,r)," of ",r," items"]}),a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsxs(U,{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(Gv,{className:"w-4 h-4"}),"Previous"]}),l.map((c,d)=>{if(c==="...")return a.jsx(U,{variant:"outline",size:"sm",disabled:!0,className:"border border-dashed border-white/20 text-white rounded-none",children:a.jsx($C,{className:"w-4 h-4"})},`dots-${d}`);const f=c,u=e===f;return a.jsx(U,{variant:u?"default":"outline",size:"sm",onClick:()=>n(f),className:u?"bg-white text-black rounded-none":"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:f},f)}),a.jsxs(U,{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(hm,{className:"w-4 h-4"})]})]})]})}const Lo=p.createContext({isOpen:!1,setIsOpen:()=>{}}),ns=p.forwardRef(({className:e,value:t,onValueChange:n,children:r,...s},i)=>{const[o,l]=p.useState(!1);return a.jsx(Lo.Provider,{value:{value:t,onValueChange:n,isOpen:o,setIsOpen:l},children:a.jsx("div",{ref:i,className:`relative ${e}`,...s,children:r})})});ns.displayName="Select";const rs=p.forwardRef(({className:e,children:t,...n},r)=>{const{isOpen:s,setIsOpen:i}=p.useContext(Lo);return a.jsxs("button",{ref:r,type:"button",className:`flex h-10 w-full items-center justify-between border border-dashed border-white/20 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(!s),...n,children:[t,a.jsx(Io,{className:`h-4 w-4 text-gray-400 transition-transform ${s?"rotate-180":""}`})]})});rs.displayName="SelectTrigger";const ho=p.forwardRef(({className:e,placeholder:t,...n},r)=>{const{value:s}=p.useContext(Lo);return a.jsx("span",{ref:r,className:`text-sm text-white ${e}`,...n,children:s||t})});ho.displayName="SelectValue";const ss=p.forwardRef(({className:e,children:t,...n},r)=>{const{isOpen:s}=p.useContext(Lo);return s?a.jsx("div",{ref:r,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});ss.displayName="SelectContent";const Et=p.forwardRef(({className:e,children:t,value:n,...r},s)=>{const{onValueChange:i,setIsOpen:o}=p.useContext(Lo);return a.jsx("div",{ref:s,className:`px-3 py-2 text-sm text-white hover:bg-white/10 cursor-pointer ${e}`,onClick:()=>{i==null||i(n),o(!1)},...r,children:t})});Et.displayName="SelectItem";function Ww(){const e=Qs(),{refetchCounts:t}=pm(),[n,r]=p.useState([]),[s,i]=p.useState(!0),[o,l]=p.useState(null),[c,d]=p.useState(""),[f,u]=p.useState("all"),[h,m]=p.useState(1),[w]=p.useState(20),[y,b]=p.useState(!1),[g,v]=p.useState(!1),[x,j]=p.useState(!1),[N,k]=p.useState(!1),[S,M]=p.useState(!1),[z,$]=p.useState(!1),[A,O]=p.useState(null),[L,E]=p.useState([]),[I,D]=p.useState(!1),[P,C]=p.useState({name:"",slug:""}),[_,R]=p.useState({name:"",organizationId:""}),[B,T]=p.useState({name:"",slug:""});p.useEffect(()=>{K()},[]);const F=te=>te.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),H=te=>{const oe=F(te);C({name:te,slug:oe})},X=te=>{C(oe=>({...oe,slug:F(te)}))},J=te=>{const oe=F(te);T({name:te,slug:oe})},ee=te=>{T(oe=>({...oe,slug:F(te)}))},K=async()=>{try{const oe=await(await fetch("/api/plugins")).json(),V=(oe==null?void 0:oe.plugins).find(se=>se.id==="organization");l({enabled:!!V,availablePlugins:(oe==null?void 0:oe.plugins).map(se=>se.id),configPath:oe.configPath,organizationPlugin:(oe==null?void 0:oe.plugins).find(se=>se.id==="organization")}),V?await ne():i(!1)}catch(te){console.error("Failed to check plugin status:",te),l({enabled:!1,error:"Failed to check plugin status"}),i(!1)}},ne=async()=>{try{const oe=await(await fetch("/api/organizations?limit=10000")).json();console.log({lenght:oe.organizations.length}),r(oe.organizations||[])}catch(te){console.error("Failed to fetch organizations:",te),q.error("Failed to fetch organizations")}finally{i(!1)}},me=async te=>{E([]),D(!0),E([{id:"start",type:"info",message:`Starting organization seeding process for ${te} organizations...`,timestamp:new Date}]);try{const V=await(await fetch("/api/seed/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:te})})).json();if(V.success){const se=V.results.map((de,be)=>de.success?{id:`org-${be}`,type:"progress",message:`Creating organization: ${de.organization.name} (${de.organization.slug})`,timestamp:new Date,status:"completed"}:{id:`org-${be}`,type:"error",message:`Failed to create organization ${be+1}: ${de.error}`,timestamp:new Date});E(de=>[...de,...se]);const he=V.results.filter(de=>de.success).length;E(de=>[...de,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${he}/${te} organizations successfully`,timestamp:new Date}]),await ne(),await t()}else E(se=>[...se,{id:"error",type:"error",message:`❌ Seeding failed: ${V.error||"Unknown error"}`,timestamp:new Date}])}catch(oe){E(V=>[...V,{id:"error",type:"error",message:`❌ Network error: ${oe}`,timestamp:new Date}])}finally{D(!1)}},W=async te=>{E([]),D(!0),E([{id:"start",type:"info",message:`Starting team seeding process for ${te} teams...`,timestamp:new Date}]);try{const V=await(await fetch("/api/seed/teams",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:te})})).json();if(V.success){const se=V.results.map((de,be)=>de.success?{id:`team-${be}`,type:"progress",message:`Creating team: ${de.team.name}`,timestamp:new Date,status:"completed"}:{id:`team-${be}`,type:"error",message:`Failed to create team ${be+1}: ${de.error}`,timestamp:new Date});E(de=>[...de,...se]);const he=V.results.filter(de=>de.success).length;E(de=>[...de,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${he}/${te} teams successfully`,timestamp:new Date}]),await ne(),await t()}else E(se=>[...se,{id:"error",type:"error",message:`❌ Seeding failed: ${V.error||"Unknown error"}`,timestamp:new Date}])}catch(oe){E(V=>[...V,{id:"error",type:"error",message:`❌ Network error: ${oe}`,timestamp:new Date}])}finally{D(!1)}},Q=te=>{O(te),M(!0)},Z=te=>{O(te),T({name:te.name,slug:te.slug}),j(!0)},ae=te=>{O(te),k(!0)},fe=async()=>{if(!P.name){q.error("Please fill in the organization name");return}const te=q.loading("Creating organization...");try{const V=await(await fetch("/api/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:P.name,slug:P.slug})})).json();V.success?(await ne(),b(!1),C({name:"",slug:""}),q.success("Organization created successfully!",{id:te})):q.error(`Error creating organization: ${V.error||"Unknown error"}`,{id:te})}catch(oe){console.error("Error creating organization:",oe),q.error("Error creating organization",{id:te})}},pe=async()=>{if(!_.name){q.error("Please fill in the team name");return}if(!_.organizationId){q.error("Please select an organization");return}const te=q.loading("Creating team...");try{const V=await(await fetch("/api/teams",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:_.name,organizationId:_.organizationId})})).json();V.success?(v(!1),R({name:"",organizationId:""}),q.success("Team created successfully!",{id:te})):q.error(`Error creating team: ${V.error||"Unknown error"}`,{id:te})}catch(oe){console.error("Error creating team:",oe),q.error("Error creating team",{id:te})}},Se=async()=>{if(!A){q.error("No organization selected");return}if(!B.name){q.error("Please fill in the organization name");return}const te=q.loading("Updating organization...");try{const V=await(await fetch(`/api/organizations/${A.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:B.name,slug:B.slug})})).json();V.success?(await ne(),j(!1),O(null),T({name:"",slug:""}),q.success("Organization updated successfully!",{id:te})):q.error(`Error updating organization: ${V.error||"Unknown error"}`,{id:te})}catch(oe){console.error("Error updating organization:",oe),q.error("Error updating organization",{id:te})}},Xe=async()=>{if(!A){q.error("No organization selected");return}const te=q.loading("Deleting organization...");try{const V=await(await fetch(`/api/organizations/${A.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();V.success?(await ne(),await t(),k(!1),O(null),q.success("Organization deleted successfully!",{id:te})):q.error(`Error deleting organization: ${V.error||"Unknown error"}`,{id:te})}catch(oe){console.error("Error deleting organization:",oe),q.error("Error deleting organization",{id:te})}},Pe=()=>{if(n.length===0){q.error("No organizations to export");return}const te=["ID","Name","Slug","Created At","Updated At"],oe=n.map(be=>[be.id,be.name||"",be.slug||"",new Date(be.createdAt).toLocaleString(),new Date(be.updatedAt).toLocaleString()]),V=[te.join(","),...oe.map(be=>be.map(Ie=>`"${Ie}"`).join(","))].join(`
|
|
382
|
+
`),se=new Blob([V],{type:"text/csv;charset=utf-8;"}),he=document.createElement("a"),de=URL.createObjectURL(se);he.setAttribute("href",de),he.setAttribute("download",`organizations-export-${new Date().toISOString().split("T")[0]}.csv`),he.style.visibility="hidden",document.body.appendChild(he),he.click(),document.body.removeChild(he),q.success(`Exported ${n.length} organizations to CSV`)},lt=n.filter(te=>{var se;const oe=te.name.toLowerCase().includes(c.toLowerCase())||te.slug.toLowerCase().includes(c.toLowerCase()),V=f==="all"||((se=te.metadata)==null?void 0:se.status)===f;return oe&&V}),Pt=Math.ceil(lt.length/w),Ae=(h-1)*w,Qe=Ae+w,xt=lt.slice(Ae,Qe),zt=te=>{m(te)};return s?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(Rt,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading organizations..."})]})}):o&&!o.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 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(it,{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",o.configPath&&a.jsxs("span",{className:"text-gray-400",children:[" (",o.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"})})]}),o.availablePlugins&&o.availablePlugins.length>0&&a.jsx("div",{className:"mb-4",children:a.jsxs("p",{className:"text-gray-400 text-sm",children:["Currently enabled plugins: ",o.availablePlugins.join(", ")]})}),a.jsx(U,{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 text-white font-light",children:["Organizations (",n.length,")"]}),a.jsx("p",{className:"text-gray-400 mt-1",children:"Manage your organizations and teams"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(U,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:Pe,children:[a.jsx(Kv,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),a.jsxs(U,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>$(!0),children:[a.jsx(Be,{className:"w-4 h-4 mr-2"}),"Seed"]}),a.jsxs(U,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>v(!0),children:[a.jsx(pr,{className:"w-4 h-4 mr-2"}),"Create Team"]}),a.jsxs(U,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>b(!0),children:[a.jsx(pr,{className:"w-4 h-4 mr-2"}),"Add Organization"]})]})]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(os,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Ce,{placeholder:"Search organizations...",value:c,onChange:te=>d(te.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(mm,{className:"w-4 h-4 text-gray-400"}),a.jsxs(ns,{value:f,onValueChange:u,children:[a.jsx(rs,{children:a.jsx(ho,{})}),a.jsxs(ss,{children:[a.jsx(Et,{value:"all",children:"All"}),a.jsx(Et,{value:"active",children:"Active"}),a.jsx(Et,{value:"inactive",children:"Inactive"})]})]})]})]}),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:lt.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(it,{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:c||f!=="all"?"Try adjusting your search or filter criteria":"Get started by creating your first organization"})]}),!c&&f==="all"&&a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(U,{onClick:()=>b(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[a.jsx(pr,{className:"w-4 h-4 mr-2"}),"Create Organization"]}),a.jsxs(U,{onClick:()=>$(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(Be,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):xt.map(te=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>e(`/organizations/${te.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(it,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:te.name}),a.jsxs("div",{className:"text-sm text-gray-400",children:["ID: ",te.id]})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:te.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(te.createdAt).toLocaleDateString(),a.jsx("p",{className:"text-xs",children:new Date(te.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(U,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:oe=>{oe.stopPropagation(),Q(te)},children:a.jsx(zo,{className:"w-4 h-4"})}),a.jsx(U,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:oe=>{oe.stopPropagation(),Z(te)},children:a.jsx(Fs,{className:"w-4 h-4"})}),a.jsx(U,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:oe=>{oe.stopPropagation(),ae(te)},children:a.jsx(Ds,{className:"w-4 h-4"})})]})})]},te.id))})]})}),a.jsx(Bw,{currentPage:h,totalPages:Pt,onPageChange:zt,totalItems:lt.length,startIndex:Ae,endIndex:Qe})]}),z&&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(U,{variant:"ghost",size:"sm",onClick:()=>$(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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(it,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Seed Organizations"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(De,{htmlFor:"organization-count",className:"text-sm text-gray-400 font-light",children:"Number of organizations"}),a.jsx(Ce,{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(U,{onClick:()=>{var oe;const te=parseInt(((oe=document.getElementById("organization-count"))==null?void 0:oe.value)||"5");me(te)},disabled:I,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:I?a.jsxs(a.Fragment,{children:[a.jsx(Rt,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Be,{className:"w-3 h-3 mr-2"}),"Seed Organizations"]})})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(pr,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Seed Teams"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(De,{htmlFor:"team-count",className:"text-sm text-gray-400 font-light",children:"Number of teams"}),a.jsx(Ce,{id:"team-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(U,{onClick:()=>{var oe;const te=parseInt(((oe=document.getElementById("team-count"))==null?void 0:oe.value)||"5");W(te)},disabled:I,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:I?a.jsxs(a.Fragment,{children:[a.jsx(Rt,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Be,{className:"w-3 h-3 mr-2"}),"Seed Teams"]})})]})]}),L.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(Ua,{title:"Organization Seeding Terminal",lines:L,isRunning:I,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(U,{variant:"outline",onClick:()=>$(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),g&&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(U,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(De,{htmlFor:"team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Ce,{id:"team-name",value:_.name,onChange:te=>R(oe=>({...oe,name:te.target.value})),placeholder:"Enter team name",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(De,{htmlFor:"team-organization",className:"text-sm text-gray-400 font-light",children:"Organization"}),a.jsxs(ns,{value:_.organizationId,onValueChange:te=>R(oe=>({...oe,organizationId:te})),children:[a.jsx(rs,{className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:a.jsx(ho,{placeholder:"Select organization"})}),a.jsx(ss,{children:n.map(te=>a.jsx(Et,{value:te.id,children:te.name},te.id))})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(U,{variant:"outline",onClick:()=>{v(!1),R({name:"",organizationId:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:pe,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),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-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(U,{variant:"ghost",size:"sm",onClick:()=>b(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(De,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Ce,{id:"create-name",value:P.name,onChange:te=>H(te.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(De,{htmlFor:"create-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),a.jsx(Ce,{id:"create-slug",value:P.slug,onChange:te=>X(te.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(U,{variant:"outline",onClick:()=>{b(!1),C({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:fe,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),x&&A&&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 Organization"}),a.jsx(U,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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(it,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:A.name}),a.jsx("div",{className:"text-sm text-gray-400",children:A.slug})]})]}),a.jsxs("div",{children:[a.jsx(De,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Ce,{id:"edit-name",value:B.name,onChange:te=>J(te.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(De,{htmlFor:"edit-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),a.jsx(Ce,{id:"edit-slug",value:B.slug,onChange:te=>ee(te.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(U,{variant:"outline",onClick:()=>{j(!1),T({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:Se,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),N&&A&&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(U,{variant:"ghost",size:"sm",onClick:()=>k(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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(it,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:A.name}),a.jsx("div",{className:"text-sm text-gray-400",children:A.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(U,{variant:"outline",onClick:()=>k(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:Xe,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),S&&A&&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(U,{variant:"ghost",size:"sm",onClick:()=>M(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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(it,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:A.name}),a.jsx("div",{className:"text-sm text-gray-400",children:A.slug})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"ID:"}),a.jsx("span",{className:"text-white text-sm",children:A.id})]}),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(A.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(A.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(U,{onClick:()=>M(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function P3(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 bu={},Di={};function Cs(e,t){try{const r=(bu[e]||(bu[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in Di?Di[r]:Zx(r,r.split(":"))}catch{if(e in Di)return Di[e];const n=e==null?void 0:e.match(D3);return n?Zx(e,n.slice(1)):NaN}}const D3=/([+-]\d\d):?(\d\d)?/;function Zx(e,t){const n=+(t[0]||0),r=+(t[1]||0),s=+(t[2]||0)/60;return Di[e]=n*60+r>0?n*60+r+s:n*60-r-s}class Gn extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Cs(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)),Uw(this),Xf(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new Gn(...n,t):new Gn(Date.now(),t)}withTimeZone(t){return new Gn(+this,t)}getTimezoneOffset(){const t=-Cs(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Xf(this),+this}[Symbol.for("constructDateFrom")](t){return new Gn(+new Date(t),this.timeZone)}}const Jx=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Jx.test(e))return;const t=e.replace(Jx,"$1UTC");Gn.prototype[t]&&(e.startsWith("get")?Gn.prototype[e]=function(){return this.internal[t]()}:(Gn.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),T3(this),+this},Gn.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Xf(this),+this}))});function Xf(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Cs(e.timeZone,e)*60))}function T3(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()),Uw(e)}function Uw(e){const t=Cs(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const s=-new Date(+e).getTimezoneOffset(),i=-new Date(+r).getTimezoneOffset(),o=s-i,l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const c=s-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const d=new Date(+e);d.setUTCSeconds(0);const f=s>0?d.getSeconds():(d.getSeconds()-60)%60,u=Math.round(-(Cs(e.timeZone,e)*60))%60;(u||f)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+f));const h=Cs(e.timeZone,e),m=h>0?Math.floor(h):Math.ceil(h),y=-new Date(+e).getTimezoneOffset()-m,b=m!==n,g=y-c;if(b&&g){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+g);const v=Cs(e.timeZone,e),x=v>0?Math.floor(v):Math.ceil(v),j=m-x;j&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+j),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+j))}}class Ot extends Gn{static tz(t,...n){return n.length?new Ot(...n,t):new Ot(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),s=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+s}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,s]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${s}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,s]=this.tzComponents();return`${t} GMT${n}${r}${s} (${P3(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?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),s=String(Math.abs(t)%60).padStart(2,"0");return[n,r,s]}withTimeZone(t){return new Ot(+this,t)}[Symbol.for("constructDateFrom")](t){return new Ot(+new Date(t),this.timeZone)}}const Vw=6048e5,O3=864e5,eg=Symbol.for("constructDateFrom");function mt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&eg in e?e[eg](t):e instanceof Date?new e.constructor(t):new Date(t)}function Le(e,t){return mt(t||e,e)}function Hw(e,t,n){const r=Le(e,n==null?void 0:n.in);return isNaN(t)?mt(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Yw(e,t,n){const r=Le(e,n==null?void 0:n.in);if(isNaN(t))return mt(e,NaN);if(!t)return r;const s=r.getDate(),i=mt(e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const o=i.getDate();return s>=o?i:(r.setFullYear(i.getFullYear(),i.getMonth(),s),r)}let A3={};function Fo(){return A3}function Va(e,t){var l,c,d,f;const n=Fo(),r=(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??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,s=Le(e,t==null?void 0:t.in),i=s.getDay(),o=(i<r?7:0)+i-r;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function mo(e,t){return Va(e,{...t,weekStartsOn:1})}function Xw(e,t){const n=Le(e,t==null?void 0:t.in),r=n.getFullYear(),s=mt(n,0);s.setFullYear(r+1,0,4),s.setHours(0,0,0,0);const i=mo(s),o=mt(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const l=mo(o);return n.getTime()>=i.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function tg(e){const t=Le(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 oi(e,...t){const n=mt.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function po(e,t){const n=Le(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function qw(e,t,n){const[r,s]=oi(n==null?void 0:n.in,e,t),i=po(r),o=po(s),l=+i-tg(i),c=+o-tg(o);return Math.round((l-c)/O3)}function R3(e,t){const n=Xw(e,t),r=mt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),mo(r)}function I3(e,t,n){return Hw(e,t*7,n)}function z3(e,t,n){return Yw(e,t*12,n)}function $3(e,t){let n,r=t==null?void 0:t.in;return e.forEach(s=>{!r&&typeof s=="object"&&(r=mt.bind(null,s));const i=Le(s,r);(!n||n<i||isNaN(+i))&&(n=i)}),mt(r,n||NaN)}function L3(e,t){let n,r=t==null?void 0:t.in;return e.forEach(s=>{!r&&typeof s=="object"&&(r=mt.bind(null,s));const i=Le(s,r);(!n||n>i||isNaN(+i))&&(n=i)}),mt(r,n||NaN)}function F3(e,t,n){const[r,s]=oi(n==null?void 0:n.in,e,t);return+po(r)==+po(s)}function Gw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function B3(e){return!(!Gw(e)&&typeof e!="number"||isNaN(+Le(e)))}function W3(e,t,n){const[r,s]=oi(n==null?void 0:n.in,e,t),i=r.getFullYear()-s.getFullYear(),o=r.getMonth()-s.getMonth();return i*12+o}function U3(e,t){const n=Le(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Kw(e,t){const[n,r]=oi(e,t.start,t.end);return{start:n,end:r}}function V3(e,t){const{start:n,end:r}=Kw(t==null?void 0:t.in,e);let s=+n>+r;const i=s?+n:+r,o=s?r:n;o.setHours(0,0,0,0),o.setDate(1);let l=1;const c=[];for(;+o<=i;)c.push(mt(n,o)),o.setMonth(o.getMonth()+l);return s?c.reverse():c}function H3(e,t){const n=Le(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Y3(e,t){const n=Le(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function Qw(e,t){const n=Le(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function X3(e,t){const{start:n,end:r}=Kw(t==null?void 0:t.in,e);let s=+n>+r;const i=s?+n:+r,o=s?r:n;o.setHours(0,0,0,0),o.setMonth(0,1);let l=1;const c=[];for(;+o<=i;)c.push(mt(n,o)),o.setFullYear(o.getFullYear()+l);return s?c.reverse():c}function Zw(e,t){var l,c,d,f;const n=Fo(),r=(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??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,s=Le(e,t==null?void 0:t.in),i=s.getDay(),o=(i<r?-7:0)+6-(i-r);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function q3(e,t){return Zw(e,{...t,weekStartsOn:1})}const G3={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"}},K3=(e,t,n)=>{let r;const s=G3[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Nu(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Q3={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Z3={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},J3={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},eM={date:Nu({formats:Q3,defaultWidth:"full"}),time:Nu({formats:Z3,defaultWidth:"full"}),dateTime:Nu({formats:J3,defaultWidth:"full"})},tM={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},nM=(e,t,n,r)=>tM[e];function ji(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;s=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return s[i]}}const rM={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},sM={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},aM={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"]},iM={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"]},oM={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"}},lM={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"}},cM=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},dM={ordinalNumber:cM,era:ji({values:rM,defaultWidth:"wide"}),quarter:ji({values:sM,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ji({values:aM,defaultWidth:"wide"}),day:ji({values:iM,defaultWidth:"wide"}),dayPeriod:ji({values:oM,defaultWidth:"wide",formattingValues:lM,defaultFormattingWidth:"wide"})};function ki(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;const o=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?fM(l,u=>u.test(o)):uM(l,u=>u.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const f=t.slice(o.length);return{value:d,rest:f}}}function uM(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function fM(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function hM(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[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(s.length);return{value:o,rest:l}}}const mM=/^(\d+)(th|st|nd|rd)?/i,pM=/\d+/i,xM={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},gM={any:[/^b/i,/^(a|c)/i]},yM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vM={any:[/1/i,/2/i,/3/i,/4/i]},wM={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},bM={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]},NM={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},jM={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]},kM={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},SM={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}},CM={ordinalNumber:hM({matchPattern:mM,parsePattern:pM,valueCallback:e=>parseInt(e,10)}),era:ki({matchPatterns:xM,defaultMatchWidth:"wide",parsePatterns:gM,defaultParseWidth:"any"}),quarter:ki({matchPatterns:yM,defaultMatchWidth:"wide",parsePatterns:vM,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ki({matchPatterns:wM,defaultMatchWidth:"wide",parsePatterns:bM,defaultParseWidth:"any"}),day:ki({matchPatterns:NM,defaultMatchWidth:"wide",parsePatterns:jM,defaultParseWidth:"any"}),dayPeriod:ki({matchPatterns:kM,defaultMatchWidth:"any",parsePatterns:SM,defaultParseWidth:"any"})},Sm={code:"en-US",formatDistance:K3,formatLong:eM,formatRelative:nM,localize:dM,match:CM,options:{weekStartsOn:0,firstWeekContainsDate:1}};function EM(e,t){const n=Le(e,t==null?void 0:t.in);return qw(n,Qw(n))+1}function Jw(e,t){const n=Le(e,t==null?void 0:t.in),r=+mo(n)-+R3(n);return Math.round(r/Vw)+1}function eb(e,t){var f,u,h,m;const n=Le(e,t==null?void 0:t.in),r=n.getFullYear(),s=Fo(),i=(t==null?void 0:t.firstWeekContainsDate)??((u=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:u.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(h=s.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,o=mt((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const l=Va(o,t),c=mt((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const d=Va(c,t);return+n>=+l?r+1:+n>=+d?r:r-1}function MM(e,t){var l,c,d,f;const n=Fo(),r=(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??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,s=eb(e,t),i=mt((t==null?void 0:t.in)||e,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),Va(i,t)}function tb(e,t){const n=Le(e,t==null?void 0:t.in),r=+Va(n,t)-+MM(n,t);return Math.round(r/Vw)+1}function ze(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Or={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ze(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ze(n+1,2)},d(e,t){return ze(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 ze(e.getHours()%12||12,t.length)},H(e,t){return ze(e.getHours(),t.length)},m(e,t){return ze(e.getMinutes(),t.length)},s(e,t){return ze(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return ze(s,t.length)}},sa={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ng={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Or.y(e,t)},Y:function(e,t,n,r){const s=eb(e,r),i=s>0?s:1-s;if(t==="YY"){const o=i%100;return ze(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):ze(i,t.length)},R:function(e,t){const n=Xw(e);return ze(n,t.length)},u:function(e,t){const n=e.getFullYear();return ze(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ze(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ze(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Or.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return ze(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const s=tb(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):ze(s,t.length)},I:function(e,t,n){const r=Jw(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):ze(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Or.d(e,t)},D:function(e,t,n){const r=EM(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ze(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":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"})}},e:function(e,t,n,r){const s=e.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return ze(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});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"})}},c:function(e,t,n,r){const s=e.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return ze(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return ze(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let s;switch(r===12?s=sa.noon:r===0?s=sa.midnight:s=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let s;switch(r>=17?s=sa.evening:r>=12?s=sa.afternoon:r>=4?s=sa.morning:s=sa.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Or.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Or.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ze(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):ze(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Or.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Or.s(e,t)},S:function(e,t){return Or.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return sg(r);case"XXXX":case"XX":return ws(r);case"XXXXX":case"XXX":default:return ws(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return sg(r);case"xxxx":case"xx":return ws(r);case"xxxxx":case"xxx":default:return ws(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+rg(r,":");case"OOOO":default:return"GMT"+ws(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+rg(r,":");case"zzzz":default:return"GMT"+ws(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return ze(r,t.length)},T:function(e,t,n){return ze(+e,t.length)}};function rg(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+t+ze(i,2)}function sg(e,t){return e%60===0?(e>0?"-":"+")+ze(Math.abs(e)/60,2):ws(e,t)}function ws(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=ze(Math.trunc(r/60),2),i=ze(r%60,2);return n+s+t+i}const ag=(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"})}},nb=(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"})}},_M=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return ag(e,t);let i;switch(r){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}}",ag(r,t)).replace("{{time}}",nb(s,t))},PM={p:nb,P:_M},DM=/^D+$/,TM=/^Y+$/,OM=["D","DD","YY","YYYY"];function AM(e){return DM.test(e)}function RM(e){return TM.test(e)}function IM(e,t,n){const r=zM(e,t,n);if(console.warn(r),OM.includes(e))throw new RangeError(r)}function zM(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $M=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,LM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,FM=/^'([^]*?)'?$/,BM=/''/g,WM=/[a-zA-Z]/;function UM(e,t,n){var f,u,h,m,w,y,b,g;const r=Fo(),s=(n==null?void 0:n.locale)??r.locale??Sm,i=(n==null?void 0:n.firstWeekContainsDate)??((u=(f=n==null?void 0:n.locale)==null?void 0:f.options)==null?void 0:u.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((y=(w=n==null?void 0:n.locale)==null?void 0:w.options)==null?void 0:y.weekStartsOn)??r.weekStartsOn??((g=(b=r.locale)==null?void 0:b.options)==null?void 0:g.weekStartsOn)??0,l=Le(e,n==null?void 0:n.in);if(!B3(l))throw new RangeError("Invalid time value");let c=t.match(LM).map(v=>{const x=v[0];if(x==="p"||x==="P"){const j=PM[x];return j(v,s.formatLong)}return v}).join("").match($M).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const x=v[0];if(x==="'")return{isToken:!1,value:VM(v)};if(ng[x])return{isToken:!0,value:v};if(x.match(WM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:v}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:s};return c.map(v=>{if(!v.isToken)return v.value;const x=v.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&RM(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&AM(x))&&IM(x,t,String(e));const j=ng[x[0]];return j(l,x,s.localize,d)}).join("")}function VM(e){const t=e.match(FM);return t?t[1].replace(BM,"'"):e}function HM(e,t){const n=Le(e,t==null?void 0:t.in),r=n.getFullYear(),s=n.getMonth(),i=mt(n,0);return i.setFullYear(r,s+1,0),i.setHours(0,0,0,0),i.getDate()}function YM(e,t){return Le(e,t==null?void 0:t.in).getMonth()}function XM(e,t){return Le(e,t==null?void 0:t.in).getFullYear()}function qM(e,t){return+Le(e)>+Le(t)}function GM(e,t){return+Le(e)<+Le(t)}function KM(e,t,n){const[r,s]=oi(n==null?void 0:n.in,e,t);return r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()}function QM(e,t,n){const[r,s]=oi(n==null?void 0:n.in,e,t);return r.getFullYear()===s.getFullYear()}function ZM(e,t,n){const r=Le(e,n==null?void 0:n.in),s=r.getFullYear(),i=r.getDate(),o=mt(e,0);o.setFullYear(s,t,15),o.setHours(0,0,0,0);const l=HM(o);return r.setMonth(t,Math.min(i,l)),r}function JM(e,t,n){const r=Le(e,n==null?void 0:n.in);return isNaN(+r)?mt(e,NaN):(r.setFullYear(t),r)}const ig=5,e_=4;function t_(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,s=t.addDays(e,-r+1),i=t.addDays(s,ig*7-1);return t.getMonth(e)===t.getMonth(i)?ig:e_}function rb(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-1*6):t.addDays(n,-1*(r-1))}function n_(e,t){const n=rb(e,t),r=t_(e,t);return t.addDays(n,r*7-1)}class ln{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?Ot.tz(this.options.timeZone):new this.Date},this.newDate=(r,s,i)=>{var o;return(o=this.overrides)!=null&&o.newDate?this.overrides.newDate(r,s,i):this.options.timeZone?new Ot(r,s,i,this.options.timeZone):new Date(r,s,i)},this.addDays=(r,s)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(r,s):Hw(r,s)},this.addMonths=(r,s)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(r,s):Yw(r,s)},this.addWeeks=(r,s)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(r,s):I3(r,s)},this.addYears=(r,s)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(r,s):z3(r,s)},this.differenceInCalendarDays=(r,s)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,s):qw(r,s)},this.differenceInCalendarMonths=(r,s)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,s):W3(r,s)},this.eachMonthOfInterval=r=>{var s;return(s=this.overrides)!=null&&s.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):V3(r)},this.eachYearOfInterval=r=>{var l;const s=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(r):X3(r),i=new Set(s.map(c=>this.getYear(c)));if(i.size===s.length)return s;const o=[];return i.forEach(c=>{o.push(new Date(c,0,1))}),o},this.endOfBroadcastWeek=r=>{var s;return(s=this.overrides)!=null&&s.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):n_(r,this)},this.endOfISOWeek=r=>{var s;return(s=this.overrides)!=null&&s.endOfISOWeek?this.overrides.endOfISOWeek(r):q3(r)},this.endOfMonth=r=>{var s;return(s=this.overrides)!=null&&s.endOfMonth?this.overrides.endOfMonth(r):U3(r)},this.endOfWeek=(r,s)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(r,s):Zw(r,this.options)},this.endOfYear=r=>{var s;return(s=this.overrides)!=null&&s.endOfYear?this.overrides.endOfYear(r):Y3(r)},this.format=(r,s,i)=>{var l;const o=(l=this.overrides)!=null&&l.format?this.overrides.format(r,s,this.options):UM(r,s,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(o):o},this.getISOWeek=r=>{var s;return(s=this.overrides)!=null&&s.getISOWeek?this.overrides.getISOWeek(r):Jw(r)},this.getMonth=(r,s)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(r,this.options):YM(r,this.options)},this.getYear=(r,s)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(r,this.options):XM(r,this.options)},this.getWeek=(r,s)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(r,this.options):tb(r,this.options)},this.isAfter=(r,s)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(r,s):qM(r,s)},this.isBefore=(r,s)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(r,s):GM(r,s)},this.isDate=r=>{var s;return(s=this.overrides)!=null&&s.isDate?this.overrides.isDate(r):Gw(r)},this.isSameDay=(r,s)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(r,s):F3(r,s)},this.isSameMonth=(r,s)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(r,s):KM(r,s)},this.isSameYear=(r,s)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(r,s):QM(r,s)},this.max=r=>{var s;return(s=this.overrides)!=null&&s.max?this.overrides.max(r):$3(r)},this.min=r=>{var s;return(s=this.overrides)!=null&&s.min?this.overrides.min(r):L3(r)},this.setMonth=(r,s)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(r,s):ZM(r,s)},this.setYear=(r,s)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(r,s):JM(r,s)},this.startOfBroadcastWeek=(r,s)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):rb(r,this)},this.startOfDay=r=>{var s;return(s=this.overrides)!=null&&s.startOfDay?this.overrides.startOfDay(r):po(r)},this.startOfISOWeek=r=>{var s;return(s=this.overrides)!=null&&s.startOfISOWeek?this.overrides.startOfISOWeek(r):mo(r)},this.startOfMonth=r=>{var s;return(s=this.overrides)!=null&&s.startOfMonth?this.overrides.startOfMonth(r):H3(r)},this.startOfWeek=(r,s)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(r,this.options):Va(r,this.options)},this.startOfYear=r=>{var s;return(s=this.overrides)!=null&&s.startOfYear?this.overrides.startOfYear(r):Qw(r)},this.options={locale:Sm,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let s=0;s<10;s++)r[s.toString()]=n.format(s);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&ln.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:s}=this.options,i=n==null?void 0:n.code;if(i&&ln.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:r,numberingSystem:s}).format(t)}catch{}const o=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,o)}}ln.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 rr=new ln;class sb{constructor(t,n,r=rr){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class r_{constructor(t,n){this.date=t,this.weeks=n}}class s_{constructor(t,n){this.days=n,this.weekNumber=t}}function a_(e){return Y.createElement("button",{...e})}function i_(e){return Y.createElement("span",{...e})}function o_(e){const{size:t=24,orientation:n="left",className:r}=e;return Y.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&Y.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&Y.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&Y.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&Y.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function l_(e){const{day:t,modifiers:n,...r}=e;return Y.createElement("td",{...r})}function c_(e){const{day:t,modifiers:n,...r}=e,s=Y.useRef(null);return Y.useEffect(()=>{var i;n.focused&&((i=s.current)==null||i.focus())},[n.focused]),Y.createElement("button",{ref:s,...r})}var xe;(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"})(xe||(xe={}));var et;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(et||(et={}));var Mn;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Mn||(Mn={}));var en;(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"})(en||(en={}));function d_(e){const{options:t,className:n,components:r,classNames:s,...i}=e,o=[s[xe.Dropdown],n].join(" "),l=t==null?void 0:t.find(({value:c})=>c===i.value);return Y.createElement("span",{"data-disabled":i.disabled,className:s[xe.DropdownRoot]},Y.createElement(r.Select,{className:o,...i},t==null?void 0:t.map(({value:c,label:d,disabled:f})=>Y.createElement(r.Option,{key:c,value:c,disabled:f},d))),Y.createElement("span",{className:s[xe.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,Y.createElement(r.Chevron,{orientation:"down",size:18,className:s[xe.Chevron]})))}function u_(e){return Y.createElement("div",{...e})}function f_(e){return Y.createElement("div",{...e})}function h_(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Y.createElement("div",{...r},e.children)}function m_(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Y.createElement("div",{...r})}function p_(e){return Y.createElement("table",{...e})}function x_(e){return Y.createElement("div",{...e})}const ab=p.createContext(void 0);function Bo(){const e=p.useContext(ab);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function g_(e){const{components:t}=Bo();return Y.createElement(t.Dropdown,{...e})}function y_(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:s,...i}=e,{components:o,classNames:l,labels:{labelPrevious:c,labelNext:d}}=Bo(),f=p.useCallback(h=>{s&&(n==null||n(h))},[s,n]),u=p.useCallback(h=>{r&&(t==null||t(h))},[r,t]);return Y.createElement("nav",{...i},Y.createElement(o.PreviousMonthButton,{type:"button",className:l[xe.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:u},Y.createElement(o.Chevron,{disabled:r?void 0:!0,className:l[xe.Chevron],orientation:"left"})),Y.createElement(o.NextMonthButton,{type:"button",className:l[xe.NextMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":d(s),onClick:f},Y.createElement(o.Chevron,{disabled:s?void 0:!0,orientation:"right",className:l[xe.Chevron]})))}function v_(e){const{components:t}=Bo();return Y.createElement(t.Button,{...e})}function w_(e){return Y.createElement("option",{...e})}function b_(e){const{components:t}=Bo();return Y.createElement(t.Button,{...e})}function N_(e){const{rootRef:t,...n}=e;return Y.createElement("div",{...n,ref:t})}function j_(e){return Y.createElement("select",{...e})}function k_(e){const{week:t,...n}=e;return Y.createElement("tr",{...n})}function S_(e){return Y.createElement("th",{...e})}function C_(e){return Y.createElement("thead",{"aria-hidden":!0},Y.createElement("tr",{...e}))}function E_(e){const{week:t,...n}=e;return Y.createElement("th",{...n})}function M_(e){return Y.createElement("th",{...e})}function __(e){return Y.createElement("tbody",{...e})}function P_(e){const{components:t}=Bo();return Y.createElement(t.Dropdown,{...e})}const D_=Object.freeze(Object.defineProperty({__proto__:null,Button:a_,CaptionLabel:i_,Chevron:o_,Day:l_,DayButton:c_,Dropdown:d_,DropdownNav:u_,Footer:f_,Month:h_,MonthCaption:m_,MonthGrid:p_,Months:x_,MonthsDropdown:g_,Nav:y_,NextMonthButton:v_,Option:w_,PreviousMonthButton:b_,Root:N_,Select:j_,Week:k_,WeekNumber:E_,WeekNumberHeader:M_,Weekday:S_,Weekdays:C_,Weeks:__,YearsDropdown:P_},Symbol.toStringTag,{value:"Module"}));function xr(e,t,n=!1,r=rr){let{from:s,to:i}=e;const{differenceInCalendarDays:o,isSameDay:l}=r;return s&&i?(o(i,s)<0&&([s,i]=[i,s]),o(t,s)>=(n?1:0)&&o(i,t)>=(n?1:0)):!n&&i?l(i,t):!n&&s?l(s,t):!1}function ib(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Cm(e){return!!(e&&typeof e=="object"&&"from"in e)}function ob(e){return!!(e&&typeof e=="object"&&"after"in e)}function lb(e){return!!(e&&typeof e=="object"&&"before"in e)}function cb(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function db(e,t){return Array.isArray(e)&&e.every(t.isDate)}function gr(e,t,n=rr){const r=Array.isArray(t)?t:[t],{isSameDay:s,differenceInCalendarDays:i,isAfter:o}=n;return r.some(l=>{if(typeof l=="boolean")return l;if(n.isDate(l))return s(e,l);if(db(l,n))return l.includes(e);if(Cm(l))return xr(l,e,!1,n);if(cb(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(ib(l)){const c=i(l.before,e),d=i(l.after,e),f=c>0,u=d<0;return o(l.before,l.after)?u&&f:f||u}return ob(l)?i(e,l.after)>0:lb(l)?i(l.before,e)>0:typeof l=="function"?l(e):!1})}function T_(e,t,n,r,s){const{disabled:i,hidden:o,modifiers:l,showOutsideDays:c,broadcastCalendar:d,today:f}=t,{isSameDay:u,isSameMonth:h,startOfMonth:m,isBefore:w,endOfMonth:y,isAfter:b}=s,g=n&&m(n),v=r&&y(r),x={[et.focused]:[],[et.outside]:[],[et.disabled]:[],[et.hidden]:[],[et.today]:[]},j={};for(const N of e){const{date:k,displayMonth:S}=N,M=!!(S&&!h(k,S)),z=!!(g&&w(k,g)),$=!!(v&&b(k,v)),A=!!(i&&gr(k,i,s)),O=!!(o&&gr(k,o,s))||z||$||!d&&!c&&M||d&&c===!1&&M,L=u(k,f??s.today());M&&x.outside.push(N),A&&x.disabled.push(N),O&&x.hidden.push(N),L&&x.today.push(N),l&&Object.keys(l).forEach(E=>{const I=l==null?void 0:l[E];I&&gr(k,I,s)&&(j[E]?j[E].push(N):j[E]=[N])})}return N=>{const k={[et.focused]:!1,[et.disabled]:!1,[et.hidden]:!1,[et.outside]:!1,[et.today]:!1},S={};for(const M in x){const z=x[M];k[M]=z.some($=>$===N)}for(const M in j)S[M]=j[M].some(z=>z===N);return{...k,...S}}}function O_(e,t,n={}){return Object.entries(e).filter(([,s])=>s===!0).reduce((s,[i])=>(n[i]?s.push(n[i]):t[et[i]]?s.push(t[et[i]]):t[Mn[i]]&&s.push(t[Mn[i]]),s),[t[xe.Day]])}function A_(e){return{...D_,...e}}function R_(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,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function Em(){const e={};for(const t in xe)e[xe[t]]=`rdp-${xe[t]}`;for(const t in et)e[et[t]]=`rdp-${et[t]}`;for(const t in Mn)e[Mn[t]]=`rdp-${Mn[t]}`;for(const t in en)e[en[t]]=`rdp-${en[t]}`;return e}function ub(e,t,n){return(n??new ln(t)).formatMonthYear(e)}const I_=ub;function z_(e,t,n){return(n??new ln(t)).format(e,"d")}function $_(e,t=rr){return t.format(e,"LLLL")}function L_(e,t,n){return(n??new ln(t)).format(e,"cccccc")}function F_(e,t=rr){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function B_(){return""}function fb(e,t=rr){return t.format(e,"yyyy")}const W_=fb,U_=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:ub,formatDay:z_,formatMonthCaption:I_,formatMonthDropdown:$_,formatWeekNumber:F_,formatWeekNumberHeader:B_,formatWeekdayName:L_,formatYearCaption:W_,formatYearDropdown:fb},Symbol.toStringTag,{value:"Module"}));function V_(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...U_,...e}}function H_(e,t,n,r,s){const{startOfMonth:i,startOfYear:o,endOfYear:l,eachMonthOfInterval:c,getMonth:d}=s;return c({start:o(e),end:l(e)}).map(h=>{const m=r.formatMonthDropdown(h,s),w=d(h),y=t&&h<i(t)||n&&h>i(n)||!1;return{value:w,label:m,disabled:y}})}function Y_(e,t={},n={}){let r={...t==null?void 0:t[xe.Day]};return Object.entries(e).filter(([,s])=>s===!0).forEach(([s])=>{r={...r,...n==null?void 0:n[s]}}),r}function X_(e,t,n){const r=e.today(),s=t?e.startOfISOWeek(r):e.startOfWeek(r),i=[];for(let o=0;o<7;o++){const l=e.addDays(s,o);i.push(l)}return i}function q_(e,t,n,r,s=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:o,eachYearOfInterval:l,getYear:c}=r,d=i(e),f=o(t),u=l({start:d,end:f});return s&&u.reverse(),u.map(h=>{const m=n.formatYearDropdown(h,r);return{value:c(h),label:m,disabled:!1}})}function hb(e,t,n,r){let s=(r??new ln(n)).format(e,"PPPP");return t.today&&(s=`Today, ${s}`),t.selected&&(s=`${s}, selected`),s}const G_=hb;function mb(e,t,n){return(n??new ln(t)).formatMonthYear(e)}const K_=mb;function Q_(e,t,n,r){let s=(r??new ln(n)).format(e,"PPPP");return t!=null&&t.today&&(s=`Today, ${s}`),s}function Z_(e){return"Choose the Month"}function J_(){return""}function eP(e){return"Go to the Next Month"}function tP(e){return"Go to the Previous Month"}function nP(e,t,n){return(n??new ln(t)).format(e,"cccc")}function rP(e,t){return`Week ${e}`}function sP(e){return"Week Number"}function aP(e){return"Choose the Year"}const iP=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:K_,labelDay:G_,labelDayButton:hb,labelGrid:mb,labelGridcell:Q_,labelMonthDropdown:Z_,labelNav:J_,labelNext:eP,labelPrevious:tP,labelWeekNumber:rP,labelWeekNumberHeader:sP,labelWeekday:nP,labelYearDropdown:aP},Symbol.toStringTag,{value:"Module"})),Wo=e=>e instanceof HTMLElement?e:null,ju=e=>[...e.querySelectorAll("[data-animated-month]")??[]],oP=e=>Wo(e.querySelector("[data-animated-month]")),ku=e=>Wo(e.querySelector("[data-animated-caption]")),Su=e=>Wo(e.querySelector("[data-animated-weeks]")),lP=e=>Wo(e.querySelector("[data-animated-nav]")),cP=e=>Wo(e.querySelector("[data-animated-weekdays]"));function dP(e,t,{classNames:n,months:r,focused:s,dateLib:i}){const o=p.useRef(null),l=p.useRef(r),c=p.useRef(!1);p.useLayoutEffect(()=>{const d=l.current;if(l.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||d.length===0||r.length!==d.length)return;const f=i.isSameMonth(r[0].date,d[0].date),u=i.isAfter(r[0].date,d[0].date),h=u?n[en.caption_after_enter]:n[en.caption_before_enter],m=u?n[en.weeks_after_enter]:n[en.weeks_before_enter],w=o.current,y=e.current.cloneNode(!0);if(y instanceof HTMLElement?(ju(y).forEach(x=>{if(!(x instanceof HTMLElement))return;const j=oP(x);j&&x.contains(j)&&x.removeChild(j);const N=ku(x);N&&N.classList.remove(h);const k=Su(x);k&&k.classList.remove(m)}),o.current=y):o.current=null,c.current||f||s)return;const b=w instanceof HTMLElement?ju(w):[],g=ju(e.current);if(g!=null&&g.every(v=>v instanceof HTMLElement)&&b&&b.every(v=>v instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const v=lP(e.current);v&&(v.style.zIndex="1"),g.forEach((x,j)=>{const N=b[j];if(!N)return;x.style.position="relative",x.style.overflow="hidden";const k=ku(x);k&&k.classList.add(h);const S=Su(x);S&&S.classList.add(m);const M=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),v&&(v.style.zIndex=""),k&&k.classList.remove(h),S&&S.classList.remove(m),x.style.position="",x.style.overflow="",x.contains(N)&&x.removeChild(N)};N.style.pointerEvents="none",N.style.position="absolute",N.style.overflow="hidden",N.setAttribute("aria-hidden","true");const z=cP(N);z&&(z.style.opacity="0");const $=ku(N);$&&($.classList.add(u?n[en.caption_before_exit]:n[en.caption_after_exit]),$.addEventListener("animationend",M));const A=Su(N);A&&A.classList.add(u?n[en.weeks_before_exit]:n[en.weeks_after_exit]),x.insertBefore(N,x.firstChild)})}})}function uP(e,t,n,r){const s=e[0],i=e[e.length-1],{ISOWeek:o,fixedWeeks:l,broadcastCalendar:c}=n??{},{addDays:d,differenceInCalendarDays:f,differenceInCalendarMonths:u,endOfBroadcastWeek:h,endOfISOWeek:m,endOfMonth:w,endOfWeek:y,isAfter:b,startOfBroadcastWeek:g,startOfISOWeek:v,startOfWeek:x}=r,j=c?g(s,r):o?v(s):x(s),N=c?h(i):o?m(w(i)):y(w(i)),k=f(N,j),S=u(i,s)+1,M=[];for(let A=0;A<=k;A++){const O=d(j,A);if(t&&b(O,t))break;M.push(O)}const $=(c?35:42)*S;if(l&&M.length<$){const A=$-M.length;for(let O=0;O<A;O++){const L=d(M[M.length-1],1);M.push(L)}}return M}function fP(e){const t=[];return e.reduce((n,r)=>{const s=r.weeks.reduce((i,o)=>i.concat(o.days.slice()),t.slice());return n.concat(s.slice())},t.slice())}function hP(e,t,n,r){const{numberOfMonths:s=1}=n,i=[];for(let o=0;o<s;o++){const l=r.addMonths(e,o);if(t&&l>t)break;i.push(l)}return i}function og(e,t,n,r){const{month:s,defaultMonth:i,today:o=r.today(),numberOfMonths:l=1}=e;let c=s||i||o;const{differenceInCalendarMonths:d,addMonths:f,startOfMonth:u}=r;if(n&&d(n,c)<l-1){const h=-1*(l-1);c=f(n,h)}return t&&d(c,t)<0&&(c=t),u(c)}function mP(e,t,n,r){const{addDays:s,endOfBroadcastWeek:i,endOfISOWeek:o,endOfMonth:l,endOfWeek:c,getISOWeek:d,getWeek:f,startOfBroadcastWeek:u,startOfISOWeek:h,startOfWeek:m}=r,w=e.reduce((y,b)=>{const g=n.broadcastCalendar?u(b,r):n.ISOWeek?h(b):m(b),v=n.broadcastCalendar?i(b):n.ISOWeek?o(l(b)):c(l(b)),x=t.filter(S=>S>=g&&S<=v),j=n.broadcastCalendar?35:42;if(n.fixedWeeks&&x.length<j){const S=t.filter(M=>{const z=j-x.length;return M>v&&M<=s(v,z)});x.push(...S)}const N=x.reduce((S,M)=>{const z=n.ISOWeek?d(M):f(M),$=S.find(O=>O.weekNumber===z),A=new sb(M,b,r);return $?$.days.push(A):S.push(new s_(z,[A])),S},[]),k=new r_(b,N);return y.push(k),y},[]);return n.reverseMonths?w.reverse():w}function pP(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:s,startOfDay:i,startOfMonth:o,endOfMonth:l,addYears:c,endOfYear:d,newDate:f,today:u}=t,{fromYear:h,toYear:m,fromMonth:w,toMonth:y}=e;!n&&w&&(n=w),!n&&h&&(n=t.newDate(h,0,1)),!r&&y&&(r=y),!r&&m&&(r=f(m,11,31));const b=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=o(n):h?n=f(h,0,1):!n&&b&&(n=s(c(e.today??u(),-100))),r?r=l(r):m?r=f(m,11,31):!r&&b&&(r=d(e.today??u())),[n&&i(n),r&&i(r)]}function xP(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i=1}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=r,d=s?i:1,f=o(e);if(!t)return l(f,d);if(!(c(t,e)<i))return l(f,d)}function gP(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=r,d=s?i??1:1,f=o(e);if(!t)return l(f,-d);if(!(c(f,t)<=0))return l(f,-d)}function yP(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function fd(e,t){const[n,r]=p.useState(e);return[t===void 0?n:t,r]}function vP(e,t){const[n,r]=pP(e,t),{startOfMonth:s,endOfMonth:i}=t,o=og(e,n,r,t),[l,c]=fd(o,e.month?o:void 0);p.useEffect(()=>{const k=og(e,n,r,t);c(k)},[e.timeZone]);const d=hP(l,r,e,t),f=uP(d,e.endMonth?i(e.endMonth):void 0,e,t),u=mP(d,f,e,t),h=yP(u),m=fP(u),w=gP(l,n,e,t),y=xP(l,r,e,t),{disableNavigation:b,onMonthChange:g}=e,v=k=>h.some(S=>S.days.some(M=>M.isEqualTo(k))),x=k=>{if(b)return;let S=s(k);n&&S<s(n)&&(S=s(n)),r&&S>s(r)&&(S=s(r)),c(S),g==null||g(S)};return{months:u,weeks:h,days:m,navStart:n,navEnd:r,previousMonth:w,nextMonth:y,goToMonth:x,goToDay:k=>{v(k)||x(k.date)}}}var Hn;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Hn||(Hn={}));function lg(e){return!e[et.disabled]&&!e[et.hidden]&&!e[et.outside]}function wP(e,t,n,r){let s,i=-1;for(const o of e){const l=t(o);lg(l)&&(l[et.focused]&&i<Hn.FocusedModifier?(s=o,i=Hn.FocusedModifier):r!=null&&r.isEqualTo(o)&&i<Hn.LastFocused?(s=o,i=Hn.LastFocused):n(o.date)&&i<Hn.Selected?(s=o,i=Hn.Selected):l[et.today]&&i<Hn.Today&&(s=o,i=Hn.Today))}return s||(s=e.find(o=>lg(t(o)))),s}function bP(e,t,n,r,s,i,o){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:d,addMonths:f,addWeeks:u,addYears:h,endOfBroadcastWeek:m,endOfISOWeek:w,endOfWeek:y,max:b,min:g,startOfBroadcastWeek:v,startOfISOWeek:x,startOfWeek:j}=o;let k={day:d,week:u,month:f,year:h,startOfWeek:S=>c?v(S,o):l?x(S):j(S),endOfWeek:S=>c?m(S):l?w(S):y(S)}[e](n,t==="after"?1:-1);return t==="before"&&r?k=b([r,k]):t==="after"&&s&&(k=g([s,k])),k}function pb(e,t,n,r,s,i,o,l=0){if(l>365)return;const c=bP(e,t,n.date,r,s,i,o),d=!!(i.disabled&&gr(c,i.disabled,o)),f=!!(i.hidden&&gr(c,i.hidden,o)),u=c,h=new sb(c,u,o);return!d&&!f?h:pb(e,t,h,r,s,i,o,l+1)}function NP(e,t,n,r,s){const{autoFocus:i}=e,[o,l]=p.useState(),c=wP(t.days,n,r||(()=>!1),o),[d,f]=p.useState(i?c:void 0);return{isFocusTarget:y=>!!(c!=null&&c.isEqualTo(y)),setFocused:f,focused:d,blur:()=>{l(d),f(void 0)},moveFocus:(y,b)=>{if(!d)return;const g=pb(y,b,d,t.navStart,t.navEnd,e,s);g&&(e.disableNavigation&&!t.days.some(x=>x.isEqualTo(g))||(t.goToDay(g),f(g)))}}}function jP(e,t){const{selected:n,required:r,onSelect:s}=e,[i,o]=fd(n,s?n:void 0),l=s?n:i,{isSameDay:c}=t,d=m=>(l==null?void 0:l.some(w=>c(w,m)))??!1,{min:f,max:u}=e;return{selected:l,select:(m,w,y)=>{let b=[...l??[]];if(d(m)){if((l==null?void 0:l.length)===f||r&&(l==null?void 0:l.length)===1)return;b=l==null?void 0:l.filter(g=>!c(g,m))}else(l==null?void 0:l.length)===u?b=[m]:b=[...b,m];return s||o(b),s==null||s(b,m,w,y),b},isSelected:d}}function kP(e,t,n=0,r=0,s=!1,i=rr){const{from:o,to:l}=t||{},{isSameDay:c,isAfter:d,isBefore:f}=i;let u;if(!o&&!l)u={from:e,to:n>0?void 0:e};else if(o&&!l)c(o,e)?n===0?u={from:o,to:e}:s?u={from:o,to:void 0}:u=void 0:f(e,o)?u={from:e,to:o}:u={from:o,to:e};else if(o&&l)if(c(o,e)&&c(l,e))s?u={from:o,to:l}:u=void 0;else if(c(o,e))u={from:o,to:n>0?void 0:e};else if(c(l,e))u={from:e,to:n>0?void 0:e};else if(f(e,o))u={from:e,to:l};else if(d(e,o))u={from:o,to:e};else if(d(e,l))u={from:o,to:e};else throw new Error("Invalid range");if(u!=null&&u.from&&(u!=null&&u.to)){const h=i.differenceInCalendarDays(u.to,u.from);r>0&&h>r?u={from:e,to:void 0}:n>1&&h<n&&(u={from:e,to:void 0})}return u}function SP(e,t,n=rr){const r=Array.isArray(t)?t:[t];let s=e.from;const i=n.differenceInCalendarDays(e.to,e.from),o=Math.min(i,6);for(let l=0;l<=o;l++){if(r.includes(s.getDay()))return!0;s=n.addDays(s,1)}return!1}function cg(e,t,n=rr){return xr(e,t.from,!1,n)||xr(e,t.to,!1,n)||xr(t,e.from,!1,n)||xr(t,e.to,!1,n)}function CP(e,t,n=rr){const r=Array.isArray(t)?t:[t];if(r.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:n.isDate(l)?xr(e,l,!1,n):db(l,n)?l.some(c=>xr(e,c,!1,n)):Cm(l)?l.from&&l.to?cg(e,{from:l.from,to:l.to},n):!1:cb(l)?SP(e,l.dayOfWeek,n):ib(l)?n.isAfter(l.before,l.after)?cg(e,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):gr(e.from,l,n)||gr(e.to,l,n):ob(l)||lb(l)?gr(e.from,l,n)||gr(e.to,l,n):!1))return!0;const o=r.filter(l=>typeof l=="function");if(o.length){let l=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let d=0;d<=c;d++){if(o.some(f=>f(l)))return!0;l=n.addDays(l,1)}}return!1}function EP(e,t){const{disabled:n,excludeDisabled:r,selected:s,required:i,onSelect:o}=e,[l,c]=fd(s,o?s:void 0),d=o?s:l;return{selected:d,select:(h,m,w)=>{const{min:y,max:b}=e,g=h?kP(h,d,y,b,i,t):void 0;return r&&n&&(g!=null&&g.from)&&g.to&&CP({from:g.from,to:g.to},n,t)&&(g.from=h,g.to=void 0),o||c(g),o==null||o(g,h,m,w),g},isSelected:h=>d&&xr(d,h,!1,t)}}function MP(e,t){const{selected:n,required:r,onSelect:s}=e,[i,o]=fd(n,s?n:void 0),l=s?n:i,{isSameDay:c}=t;return{selected:l,select:(u,h,m)=>{let w=u;return!r&&l&&l&&c(u,l)&&(w=void 0),s||o(w),s==null||s(w,u,h,m),w},isSelected:u=>l?c(l,u):!1}}function _P(e,t){const n=MP(e,t),r=jP(e,t),s=EP(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return s;default:return}}function PP(e){var ct;let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new Ot(t.today,t.timeZone)),t.month&&(t.month=new Ot(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new Ot(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new Ot(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new Ot(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new Ot(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=(ct=t.selected)==null?void 0:ct.map(ce=>new Ot(ce,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new Ot(t.selected.from,t.timeZone):void 0,to:t.selected.to?new Ot(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:r,labels:s,dateLib:i,locale:o,classNames:l}=p.useMemo(()=>{const ce={...Sm,...t.locale};return{dateLib:new ln({locale:ce,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:A_(t.components),formatters:V_(t.formatters),labels:{...iP,...t.labels},locale:ce,classNames:{...Em(),...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:d,navLayout:f,numberOfMonths:u=1,onDayBlur:h,onDayClick:m,onDayFocus:w,onDayKeyDown:y,onDayMouseEnter:b,onDayMouseLeave:g,onNextClick:v,onPrevClick:x,showWeekNumber:j,styles:N}=t,{formatCaption:k,formatDay:S,formatMonthDropdown:M,formatWeekNumber:z,formatWeekNumberHeader:$,formatWeekdayName:A,formatYearDropdown:O}=r,L=vP(t,i),{days:E,months:I,navStart:D,navEnd:P,previousMonth:C,nextMonth:_,goToMonth:R}=L,B=T_(E,t,D,P,i),{isSelected:T,select:F,selected:H}=_P(t,i)??{},{blur:X,focused:J,isFocusTarget:ee,moveFocus:K,setFocused:ne}=NP(t,L,B,T??(()=>!1),i),{labelDayButton:me,labelGridcell:W,labelGrid:Q,labelMonthDropdown:Z,labelNav:ae,labelPrevious:fe,labelNext:pe,labelWeekday:Se,labelWeekNumber:Xe,labelWeekNumberHeader:Pe,labelYearDropdown:lt}=s,Pt=p.useMemo(()=>X_(i,t.ISOWeek),[i,t.ISOWeek]),Ae=d!==void 0||m!==void 0,Qe=p.useCallback(()=>{C&&(R(C),x==null||x(C))},[C,R,x]),xt=p.useCallback(()=>{_&&(R(_),v==null||v(_))},[R,_,v]),zt=p.useCallback((ce,Me)=>Ne=>{Ne.preventDefault(),Ne.stopPropagation(),ne(ce),F==null||F(ce.date,Me,Ne),m==null||m(ce.date,Me,Ne)},[F,m,ne]),te=p.useCallback((ce,Me)=>Ne=>{ne(ce),w==null||w(ce.date,Me,Ne)},[w,ne]),oe=p.useCallback((ce,Me)=>Ne=>{X(),h==null||h(ce.date,Me,Ne)},[X,h]),V=p.useCallback((ce,Me)=>Ne=>{const Re={ArrowLeft:[Ne.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[Ne.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[Ne.shiftKey?"year":"week","after"],ArrowUp:[Ne.shiftKey?"year":"week","before"],PageUp:[Ne.shiftKey?"year":"month","before"],PageDown:[Ne.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Re[Ne.key]){Ne.preventDefault(),Ne.stopPropagation();const[wt,ie]=Re[Ne.key];K(wt,ie)}y==null||y(ce.date,Me,Ne)},[K,y,t.dir]),se=p.useCallback((ce,Me)=>Ne=>{b==null||b(ce.date,Me,Ne)},[b]),he=p.useCallback((ce,Me)=>Ne=>{g==null||g(ce.date,Me,Ne)},[g]),de=p.useCallback(ce=>Me=>{const Ne=Number(Me.target.value),Re=i.setMonth(i.startOfMonth(ce),Ne);R(Re)},[i,R]),be=p.useCallback(ce=>Me=>{const Ne=Number(Me.target.value),Re=i.setYear(i.startOfMonth(ce),Ne);R(Re)},[i,R]),{className:Ie,style:G}=p.useMemo(()=>({className:[l[xe.Root],t.className].filter(Boolean).join(" "),style:{...N==null?void 0:N[xe.Root],...t.style}}),[l,t.className,t.style,N]),le=R_(t),ge=p.useRef(null);dP(ge,!!t.animate,{classNames:l,months:I,focused:J,dateLib:i});const Ue={dayPickerProps:t,selected:H,select:F,isSelected:T,months:I,nextMonth:_,previousMonth:C,goToMonth:R,getModifiers:B,components:n,classNames:l,styles:N,labels:s,formatters:r};return Y.createElement(ab.Provider,{value:Ue},Y.createElement(n.Root,{rootRef:t.animate?ge:void 0,className:Ie,style:G,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"],...le},Y.createElement(n.Months,{className:l[xe.Months],style:N==null?void 0:N[xe.Months]},!t.hideNavigation&&!f&&Y.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[xe.Nav],style:N==null?void 0:N[xe.Nav],"aria-label":ae(),onPreviousClick:Qe,onNextClick:xt,previousMonth:C,nextMonth:_}),I.map((ce,Me)=>Y.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:l[xe.Month],style:N==null?void 0:N[xe.Month],key:Me,displayIndex:Me,calendarMonth:ce},f==="around"&&!t.hideNavigation&&Me===0&&Y.createElement(n.PreviousMonthButton,{type:"button",className:l[xe.PreviousMonthButton],tabIndex:C?void 0:-1,"aria-disabled":C?void 0:!0,"aria-label":fe(C),onClick:Qe,"data-animated-button":t.animate?"true":void 0},Y.createElement(n.Chevron,{disabled:C?void 0:!0,className:l[xe.Chevron],orientation:t.dir==="rtl"?"right":"left"})),Y.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:l[xe.MonthCaption],style:N==null?void 0:N[xe.MonthCaption],calendarMonth:ce,displayIndex:Me},c!=null&&c.startsWith("dropdown")?Y.createElement(n.DropdownNav,{className:l[xe.Dropdowns],style:N==null?void 0:N[xe.Dropdowns]},(()=>{const Ne=c==="dropdown"||c==="dropdown-months"?Y.createElement(n.MonthsDropdown,{key:"month",className:l[xe.MonthsDropdown],"aria-label":Z(),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:de(ce.date),options:H_(ce.date,D,P,r,i),style:N==null?void 0:N[xe.Dropdown],value:i.getMonth(ce.date)}):Y.createElement("span",{key:"month"},M(ce.date,i)),Re=c==="dropdown"||c==="dropdown-years"?Y.createElement(n.YearsDropdown,{key:"year",className:l[xe.YearsDropdown],"aria-label":lt(i.options),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:be(ce.date),options:q_(D,P,r,i,!!t.reverseYears),style:N==null?void 0:N[xe.Dropdown],value:i.getYear(ce.date)}):Y.createElement("span",{key:"year"},O(ce.date,i));return i.getMonthYearOrder()==="year-first"?[Re,Ne]:[Ne,Re]})(),Y.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"}},k(ce.date,i.options,i))):Y.createElement(n.CaptionLabel,{className:l[xe.CaptionLabel],role:"status","aria-live":"polite"},k(ce.date,i.options,i))),f==="around"&&!t.hideNavigation&&Me===u-1&&Y.createElement(n.NextMonthButton,{type:"button",className:l[xe.NextMonthButton],tabIndex:_?void 0:-1,"aria-disabled":_?void 0:!0,"aria-label":pe(_),onClick:xt,"data-animated-button":t.animate?"true":void 0},Y.createElement(n.Chevron,{disabled:_?void 0:!0,className:l[xe.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Me===u-1&&f==="after"&&!t.hideNavigation&&Y.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[xe.Nav],style:N==null?void 0:N[xe.Nav],"aria-label":ae(),onPreviousClick:Qe,onNextClick:xt,previousMonth:C,nextMonth:_}),Y.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":Q(ce.date,i.options,i)||void 0,className:l[xe.MonthGrid],style:N==null?void 0:N[xe.MonthGrid]},!t.hideWeekdays&&Y.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:l[xe.Weekdays],style:N==null?void 0:N[xe.Weekdays]},j&&Y.createElement(n.WeekNumberHeader,{"aria-label":Pe(i.options),className:l[xe.WeekNumberHeader],style:N==null?void 0:N[xe.WeekNumberHeader],scope:"col"},$()),Pt.map(Ne=>Y.createElement(n.Weekday,{"aria-label":Se(Ne,i.options,i),className:l[xe.Weekday],key:String(Ne),style:N==null?void 0:N[xe.Weekday],scope:"col"},A(Ne,i.options,i)))),Y.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:l[xe.Weeks],style:N==null?void 0:N[xe.Weeks]},ce.weeks.map(Ne=>Y.createElement(n.Week,{className:l[xe.Week],key:Ne.weekNumber,style:N==null?void 0:N[xe.Week],week:Ne},j&&Y.createElement(n.WeekNumber,{week:Ne,style:N==null?void 0:N[xe.WeekNumber],"aria-label":Xe(Ne.weekNumber,{locale:o}),className:l[xe.WeekNumber],scope:"row",role:"rowheader"},z(Ne.weekNumber,i)),Ne.days.map(Re=>{const{date:wt}=Re,ie=B(Re);if(ie[et.focused]=!ie.hidden&&!!(J!=null&&J.isEqualTo(Re)),ie[Mn.selected]=(T==null?void 0:T(wt))||ie.selected,Cm(H)){const{from:Ln,to:Je}=H;ie[Mn.range_start]=!!(Ln&&Je&&i.isSameDay(wt,Ln)),ie[Mn.range_end]=!!(Ln&&Je&&i.isSameDay(wt,Je)),ie[Mn.range_middle]=xr(H,wt,!0,i)}const Ze=Y_(ie,N,t.modifiersStyles),dt=O_(ie,l,t.modifiersClassNames),jt=!Ae&&!ie.hidden?W(wt,ie,i.options,i):void 0;return Y.createElement(n.Day,{key:`${i.format(wt,"yyyy-MM-dd")}_${i.format(Re.displayMonth,"yyyy-MM")}`,day:Re,modifiers:ie,className:dt.join(" "),style:Ze,role:"gridcell","aria-selected":ie.selected||void 0,"aria-label":jt,"data-day":i.format(wt,"yyyy-MM-dd"),"data-month":Re.outside?i.format(wt,"yyyy-MM"):void 0,"data-selected":ie.selected||void 0,"data-disabled":ie.disabled||void 0,"data-hidden":ie.hidden||void 0,"data-outside":Re.outside||void 0,"data-focused":ie.focused||void 0,"data-today":ie.today||void 0},!ie.hidden&&Ae?Y.createElement(n.DayButton,{className:l[xe.DayButton],style:N==null?void 0:N[xe.DayButton],type:"button",day:Re,modifiers:ie,disabled:ie.disabled||void 0,tabIndex:ee(Re)?0:-1,"aria-label":me(wt,ie,i.options,i),onClick:zt(Re,ie),onBlur:oe(Re,ie),onFocus:te(Re,ie),onKeyDown:V(Re,ie),onMouseEnter:se(Re,ie),onMouseLeave:he(Re,ie)},S(wt,i.options,i)):!ie.hidden&&S(Re.date,i.options,i))})))))))),t.footer&&Y.createElement(n.Footer,{className:l[xe.Footer],style:N==null?void 0:N[xe.Footer],role:"status","aria-live":"polite"},t.footer)))}function DP({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:s="ghost",formatters:i,components:o,...l}){const c=Em();return a.jsx(PP,{showOutsideDays:n,className:we("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:r,formatters:{formatMonthDropdown:d=>d.toLocaleString("default",{month:"short"}),...i},classNames:{root:we("w-fit",c.root),months:we("relative flex flex-col gap-4 md:flex-row",c.months),month:we("flex w-full flex-col gap-4",c.month),nav:we("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:we(Yf({variant:s}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:we(Yf({variant:s}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:we("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:we("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:we("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:we("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:we("select-none font-medium",r==="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:we("flex",c.weekdays),weekday:we("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:we("mt-2 flex w-full",c.week),week_number_header:we("w-[--cell-size] select-none",c.week_number_header),week_number:we("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:we("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:we("bg-accent rounded-l-md",c.range_start),range_middle:we("rounded-none",c.range_middle),range_end:we("bg-accent rounded-r-md",c.range_end),today:we("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:we("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:we("text-muted-foreground opacity-50",c.disabled),hidden:we("invisible",c.hidden),...t},components:{Root:({className:d,rootRef:f,...u})=>a.jsx("div",{"data-slot":"calendar",ref:f,className:we(d),...u}),Chevron:({className:d,orientation:f,...u})=>f==="left"?a.jsx(Gv,{className:we("size-4",d),...u}):f==="right"?a.jsx(hm,{className:we("size-4",d),...u}):a.jsx(Io,{className:we("size-4",d),...u}),DayButton:TP,WeekNumber:({children:d,...f})=>a.jsx("td",{...f,children:a.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:d})}),...o},...l})}function TP({className:e,day:t,modifiers:n,...r}){const s=Em(),i=p.useRef(null);return p.useEffect(()=>{var o;n.focused&&((o=i.current)==null||o.focus())},[n.focused]),a.jsx(U,{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:we("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",s.day,e),...r})}const OP=["top","right","bottom","left"],ds=Math.min,tn=Math.max,Ec=Math.round,Nl=Math.floor,Jn=e=>({x:e,y:e}),AP={left:"right",right:"left",bottom:"top",top:"bottom"},RP={start:"end",end:"start"};function qf(e,t,n){return tn(e,ds(t,n))}function Sr(e,t){return typeof e=="function"?e(t):e}function Cr(e){return e.split("-")[0]}function li(e){return e.split("-")[1]}function Mm(e){return e==="x"?"y":"x"}function _m(e){return e==="y"?"height":"width"}const IP=new Set(["top","bottom"]);function Kn(e){return IP.has(Cr(e))?"y":"x"}function Pm(e){return Mm(Kn(e))}function zP(e,t,n){n===void 0&&(n=!1);const r=li(e),s=Pm(e),i=_m(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Mc(o)),[o,Mc(o)]}function $P(e){const t=Mc(e);return[Gf(e),t,Gf(t)]}function Gf(e){return e.replace(/start|end/g,t=>RP[t])}const dg=["left","right"],ug=["right","left"],LP=["top","bottom"],FP=["bottom","top"];function BP(e,t,n){switch(e){case"top":case"bottom":return n?t?ug:dg:t?dg:ug;case"left":case"right":return t?LP:FP;default:return[]}}function WP(e,t,n,r){const s=li(e);let i=BP(Cr(e),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),t&&(i=i.concat(i.map(Gf)))),i}function Mc(e){return e.replace(/left|right|bottom|top/g,t=>AP[t])}function UP(e){return{top:0,right:0,bottom:0,left:0,...e}}function xb(e){return typeof e!="number"?UP(e):{top:e,right:e,bottom:e,left:e}}function _c(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function fg(e,t,n){let{reference:r,floating:s}=e;const i=Kn(t),o=Pm(t),l=_m(o),c=Cr(t),d=i==="y",f=r.x+r.width/2-s.width/2,u=r.y+r.height/2-s.height/2,h=r[l]/2-s[l]/2;let m;switch(c){case"top":m={x:f,y:r.y-s.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:u};break;case"left":m={x:r.x-s.width,y:u};break;default:m={x:r.x,y:r.y}}switch(li(t)){case"start":m[o]-=h*(n&&d?-1:1);break;case"end":m[o]+=h*(n&&d?-1:1);break}return m}const VP=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:f,y:u}=fg(d,r,c),h=r,m={},w=0;for(let y=0;y<l.length;y++){const{name:b,fn:g}=l[y],{x:v,y:x,data:j,reset:N}=await g({x:f,y:u,initialPlacement:r,placement:h,strategy:s,middlewareData:m,rects:d,platform:o,elements:{reference:e,floating:t}});f=v??f,u=x??u,m={...m,[b]:{...m[b],...j}},N&&w<=50&&(w++,typeof N=="object"&&(N.placement&&(h=N.placement),N.rects&&(d=N.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):N.rects),{x:f,y:u}=fg(d,h,c)),y=-1)}return{x:f,y:u,placement:h,strategy:s,middlewareData:m}};async function xo(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:h=!1,padding:m=0}=Sr(t,e),w=xb(m),b=l[h?u==="floating"?"reference":"floating":u],g=_c(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:c})),v=u==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},N=_c(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:x,strategy:c}):v);return{top:(g.top-N.top+w.top)/j.y,bottom:(N.bottom-g.bottom+w.bottom)/j.y,left:(g.left-N.left+w.left)/j.x,right:(N.right-g.right+w.right)/j.x}}const HP=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:d,padding:f=0}=Sr(e,t)||{};if(d==null)return{};const u=xb(f),h={x:n,y:r},m=Pm(s),w=_m(m),y=await o.getDimensions(d),b=m==="y",g=b?"top":"left",v=b?"bottom":"right",x=b?"clientHeight":"clientWidth",j=i.reference[w]+i.reference[m]-h[m]-i.floating[w],N=h[m]-i.reference[m],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let S=k?k[x]:0;(!S||!await(o.isElement==null?void 0:o.isElement(k)))&&(S=l.floating[x]||i.floating[w]);const M=j/2-N/2,z=S/2-y[w]/2-1,$=ds(u[g],z),A=ds(u[v],z),O=$,L=S-y[w]-A,E=S/2-y[w]/2+M,I=qf(O,E,L),D=!c.arrow&&li(s)!=null&&E!==I&&i.reference[w]/2-(E<O?$:A)-y[w]/2<0,P=D?E<O?E-O:E-L:0;return{[m]:h[m]+P,data:{[m]:I,centerOffset:E-I-P,...D&&{alignmentOffset:P}},reset:D}}}),YP=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:y=!0,...b}=Sr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=Cr(s),v=Kn(l),x=Cr(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=h||(x||!y?[Mc(l)]:$P(l)),k=w!=="none";!h&&k&&N.push(...WP(l,y,w,j));const S=[l,...N],M=await xo(t,b),z=[];let $=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&z.push(M[g]),u){const E=zP(s,o,j);z.push(M[E[0]],M[E[1]])}if($=[...$,{placement:s,overflows:z}],!z.every(E=>E<=0)){var A,O;const E=(((A=i.flip)==null?void 0:A.index)||0)+1,I=S[E];if(I&&(!(u==="alignment"?v!==Kn(I):!1)||$.every(C=>Kn(C.placement)===v?C.overflows[0]>0:!0)))return{data:{index:E,overflows:$},reset:{placement:I}};let D=(O=$.filter(P=>P.overflows[0]<=0).sort((P,C)=>P.overflows[1]-C.overflows[1])[0])==null?void 0:O.placement;if(!D)switch(m){case"bestFit":{var L;const P=(L=$.filter(C=>{if(k){const _=Kn(C.placement);return _===v||_==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(_=>_>0).reduce((_,R)=>_+R,0)]).sort((C,_)=>C[1]-_[1])[0])==null?void 0:L[0];P&&(D=P);break}case"initialPlacement":D=l;break}if(s!==D)return{reset:{placement:D}}}return{}}}};function hg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function mg(e){return OP.some(t=>e[t]>=0)}const XP=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Sr(e,t);switch(r){case"referenceHidden":{const i=await xo(t,{...s,elementContext:"reference"}),o=hg(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:mg(o)}}}case"escaped":{const i=await xo(t,{...s,altBoundary:!0}),o=hg(i,n.floating);return{data:{escapedOffsets:o,escaped:mg(o)}}}default:return{}}}}},gb=new Set(["left","top"]);async function qP(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=Cr(n),l=li(n),c=Kn(n)==="y",d=gb.has(o)?-1:1,f=i&&c?-1:1,u=Sr(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:w}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof w=="number"&&(m=l==="end"?w*-1:w),c?{x:m*f,y:h*d}:{x:h*d,y:m*f}}const GP=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:o,middlewareData:l}=t,c=await qP(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:o}}}}},KP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:b=>{let{x:g,y:v}=b;return{x:g,y:v}}},...c}=Sr(e,t),d={x:n,y:r},f=await xo(t,c),u=Kn(Cr(s)),h=Mm(u);let m=d[h],w=d[u];if(i){const b=h==="y"?"top":"left",g=h==="y"?"bottom":"right",v=m+f[b],x=m-f[g];m=qf(v,m,x)}if(o){const b=u==="y"?"top":"left",g=u==="y"?"bottom":"right",v=w+f[b],x=w-f[g];w=qf(v,w,x)}const y=l.fn({...t,[h]:m,[u]:w});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:i,[u]:o}}}}}},QP=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Sr(e,t),f={x:n,y:r},u=Kn(s),h=Mm(u);let m=f[h],w=f[u];const y=Sr(l,t),b=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const x=h==="y"?"height":"width",j=i.reference[h]-i.floating[x]+b.mainAxis,N=i.reference[h]+i.reference[x]-b.mainAxis;m<j?m=j:m>N&&(m=N)}if(d){var g,v;const x=h==="y"?"width":"height",j=gb.has(Cr(s)),N=i.reference[u]-i.floating[x]+(j&&((g=o.offset)==null?void 0:g[u])||0)+(j?0:b.crossAxis),k=i.reference[u]+i.reference[x]+(j?0:((v=o.offset)==null?void 0:v[u])||0)-(j?b.crossAxis:0);w<N?w=N:w>k&&(w=k)}return{[h]:m,[u]:w}}}},ZP=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...d}=Sr(e,t),f=await xo(t,d),u=Cr(s),h=li(s),m=Kn(s)==="y",{width:w,height:y}=i.floating;let b,g;u==="top"||u==="bottom"?(b=u,g=h===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(g=u,b=h==="end"?"top":"bottom");const v=y-f.top-f.bottom,x=w-f.left-f.right,j=ds(y-f[b],v),N=ds(w-f[g],x),k=!t.middlewareData.shift;let S=j,M=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=v),k&&!h){const $=tn(f.left,0),A=tn(f.right,0),O=tn(f.top,0),L=tn(f.bottom,0);m?M=w-2*($!==0||A!==0?$+A:tn(f.left,f.right)):S=y-2*(O!==0||L!==0?O+L:tn(f.top,f.bottom))}await c({...t,availableWidth:M,availableHeight:S});const z=await o.getDimensions(l.floating);return w!==z.width||y!==z.height?{reset:{rects:!0}}:{}}}};function hd(){return typeof window<"u"}function ci(e){return yb(e)?(e.nodeName||"").toLowerCase():"#document"}function an(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function sr(e){var t;return(t=(yb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yb(e){return hd()?e instanceof Node||e instanceof an(e).Node:!1}function Rn(e){return hd()?e instanceof Element||e instanceof an(e).Element:!1}function tr(e){return hd()?e instanceof HTMLElement||e instanceof an(e).HTMLElement:!1}function pg(e){return!hd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof an(e).ShadowRoot}const JP=new Set(["inline","contents"]);function Uo(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=In(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!JP.has(s)}const eD=new Set(["table","td","th"]);function tD(e){return eD.has(ci(e))}const nD=[":popover-open",":modal"];function md(e){return nD.some(t=>{try{return e.matches(t)}catch{return!1}})}const rD=["transform","translate","scale","rotate","perspective"],sD=["transform","translate","scale","rotate","perspective","filter"],aD=["paint","layout","strict","content"];function Dm(e){const t=Tm(),n=Rn(e)?In(e):e;return rD.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||sD.some(r=>(n.willChange||"").includes(r))||aD.some(r=>(n.contain||"").includes(r))}function iD(e){let t=us(e);for(;tr(t)&&!Ha(t);){if(Dm(t))return t;if(md(t))return null;t=us(t)}return null}function Tm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const oD=new Set(["html","body","#document"]);function Ha(e){return oD.has(ci(e))}function In(e){return an(e).getComputedStyle(e)}function pd(e){return Rn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function us(e){if(ci(e)==="html")return e;const t=e.assignedSlot||e.parentNode||pg(e)&&e.host||sr(e);return pg(t)?t.host:t}function vb(e){const t=us(e);return Ha(t)?e.ownerDocument?e.ownerDocument.body:e.body:tr(t)&&Uo(t)?t:vb(t)}function go(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=vb(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),o=an(s);if(i){const l=Kf(o);return t.concat(o,o.visualViewport||[],Uo(s)?s:[],l&&n?go(l):[])}return t.concat(s,go(s,[],n))}function Kf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wb(e){const t=In(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=tr(e),i=s?e.offsetWidth:n,o=s?e.offsetHeight:r,l=Ec(n)!==i||Ec(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function Om(e){return Rn(e)?e:e.contextElement}function Ta(e){const t=Om(e);if(!tr(t))return Jn(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=wb(t);let o=(i?Ec(n.width):n.width)/r,l=(i?Ec(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const lD=Jn(0);function bb(e){const t=an(e);return!Tm()||!t.visualViewport?lD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==an(e)?!1:t}function Vs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=Om(e);let o=Jn(1);t&&(r?Rn(r)&&(o=Ta(r)):o=Ta(e));const l=cD(i,n,r)?bb(i):Jn(0);let c=(s.left+l.x)/o.x,d=(s.top+l.y)/o.y,f=s.width/o.x,u=s.height/o.y;if(i){const h=an(i),m=r&&Rn(r)?an(r):r;let w=h,y=Kf(w);for(;y&&r&&m!==w;){const b=Ta(y),g=y.getBoundingClientRect(),v=In(y),x=g.left+(y.clientLeft+parseFloat(v.paddingLeft))*b.x,j=g.top+(y.clientTop+parseFloat(v.paddingTop))*b.y;c*=b.x,d*=b.y,f*=b.x,u*=b.y,c+=x,d+=j,w=an(y),y=Kf(w)}}return _c({width:f,height:u,x:c,y:d})}function xd(e,t){const n=pd(e).scrollLeft;return t?t.left+n:Vs(sr(e)).left+n}function Nb(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-xd(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function dD(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",o=sr(r),l=t?md(t.floating):!1;if(r===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},d=Jn(1);const f=Jn(0),u=tr(r);if((u||!u&&!i)&&((ci(r)!=="body"||Uo(o))&&(c=pd(r)),tr(r))){const m=Vs(r);d=Ta(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const h=o&&!u&&!i?Nb(o,c):Jn(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+f.x+h.x,y:n.y*d.y-c.scrollTop*d.y+f.y+h.y}}function uD(e){return Array.from(e.getClientRects())}function fD(e){const t=sr(e),n=pd(e),r=e.ownerDocument.body,s=tn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=tn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+xd(e);const l=-n.scrollTop;return In(r).direction==="rtl"&&(o+=tn(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:l}}const xg=25;function hD(e,t){const n=an(e),r=sr(e),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,l=0,c=0;if(s){i=s.width,o=s.height;const f=Tm();(!f||f&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}const d=xd(r);if(d<=0){const f=r.ownerDocument,u=f.body,h=getComputedStyle(u),m=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(r.clientWidth-u.clientWidth-m);w<=xg&&(i-=w)}else d<=xg&&(i+=d);return{width:i,height:o,x:l,y:c}}const mD=new Set(["absolute","fixed"]);function pD(e,t){const n=Vs(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=tr(e)?Ta(e):Jn(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=s*i.x,d=r*i.y;return{width:o,height:l,x:c,y:d}}function gg(e,t,n){let r;if(t==="viewport")r=hD(e,n);else if(t==="document")r=fD(sr(e));else if(Rn(t))r=pD(t,n);else{const s=bb(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return _c(r)}function jb(e,t){const n=us(e);return n===t||!Rn(n)||Ha(n)?!1:In(n).position==="fixed"||jb(n,t)}function xD(e,t){const n=t.get(e);if(n)return n;let r=go(e,[],!1).filter(l=>Rn(l)&&ci(l)!=="body"),s=null;const i=In(e).position==="fixed";let o=i?us(e):e;for(;Rn(o)&&!Ha(o);){const l=In(o),c=Dm(o);!c&&l.position==="fixed"&&(s=null),(i?!c&&!s:!c&&l.position==="static"&&!!s&&mD.has(s.position)||Uo(o)&&!c&&jb(e,o))?r=r.filter(f=>f!==o):s=l,o=us(o)}return t.set(e,r),r}function gD(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?md(t)?[]:xD(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((d,f)=>{const u=gg(t,f,s);return d.top=tn(u.top,d.top),d.right=ds(u.right,d.right),d.bottom=ds(u.bottom,d.bottom),d.left=tn(u.left,d.left),d},gg(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function yD(e){const{width:t,height:n}=wb(e);return{width:t,height:n}}function vD(e,t,n){const r=tr(t),s=sr(t),i=n==="fixed",o=Vs(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Jn(0);function d(){c.x=xd(s)}if(r||!r&&!i)if((ci(t)!=="body"||Uo(s))&&(l=pd(t)),r){const m=Vs(t,!0,i,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else s&&d();i&&!r&&s&&d();const f=s&&!r&&!i?Nb(s,l):Jn(0),u=o.left+l.scrollLeft-c.x-f.x,h=o.top+l.scrollTop-c.y-f.y;return{x:u,y:h,width:o.width,height:o.height}}function Cu(e){return In(e).position==="static"}function yg(e,t){if(!tr(e)||In(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return sr(e)===n&&(n=n.ownerDocument.body),n}function kb(e,t){const n=an(e);if(md(e))return n;if(!tr(e)){let s=us(e);for(;s&&!Ha(s);){if(Rn(s)&&!Cu(s))return s;s=us(s)}return n}let r=yg(e,t);for(;r&&tD(r)&&Cu(r);)r=yg(r,t);return r&&Ha(r)&&Cu(r)&&!Dm(r)?n:r||iD(e)||n}const wD=async function(e){const t=this.getOffsetParent||kb,n=this.getDimensions,r=await n(e.floating);return{reference:vD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function bD(e){return In(e).direction==="rtl"}const ND={convertOffsetParentRelativeRectToViewportRelativeRect:dD,getDocumentElement:sr,getClippingRect:gD,getOffsetParent:kb,getElementRects:wD,getClientRects:uD,getDimensions:yD,getScale:Ta,isElement:Rn,isRTL:bD};function Sb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function jD(e,t){let n=null,r;const s=sr(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:f,top:u,width:h,height:m}=d;if(l||t(),!h||!m)return;const w=Nl(u),y=Nl(s.clientWidth-(f+h)),b=Nl(s.clientHeight-(u+m)),g=Nl(f),x={rootMargin:-w+"px "+-y+"px "+-b+"px "+-g+"px",threshold:tn(0,ds(1,c))||1};let j=!0;function N(k){const S=k[0].intersectionRatio;if(S!==c){if(!j)return o();S?o(!1,S):r=setTimeout(()=>{o(!1,1e-7)},1e3)}S===1&&!Sb(d,e.getBoundingClientRect())&&o(),j=!1}try{n=new IntersectionObserver(N,{...x,root:s.ownerDocument})}catch{n=new IntersectionObserver(N,x)}n.observe(e)}return o(!0),i}function kD(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Om(e),f=s||i?[...d?go(d):[],...go(t)]:[];f.forEach(g=>{s&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const u=d&&l?jD(d,n):null;let h=-1,m=null;o&&(m=new ResizeObserver(g=>{let[v]=g;v&&v.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),d&&!c&&m.observe(d),m.observe(t));let w,y=c?Vs(e):null;c&&b();function b(){const g=Vs(e);y&&!Sb(y,g)&&n(),y=g,w=requestAnimationFrame(b)}return n(),()=>{var g;f.forEach(v=>{s&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),u==null||u(),(g=m)==null||g.disconnect(),m=null,c&&cancelAnimationFrame(w)}}const SD=GP,CD=KP,ED=YP,MD=ZP,_D=XP,vg=HP,PD=QP,DD=(e,t,n)=>{const r=new Map,s={platform:ND,...n},i={...s.platform,_c:r};return VP(e,t,{...s,platform:i})};var TD=typeof document<"u",OD=function(){},Xl=TD?p.useLayoutEffect:OD;function Pc(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,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Pc(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!Pc(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Cb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wg(e,t){const n=Cb(e);return Math.round(t*n)/n}function Eu(e){const t=p.useRef(e);return Xl(()=>{t.current=e}),t}function AD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[f,u]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(r);Pc(h,r)||m(r);const[w,y]=p.useState(null),[b,g]=p.useState(null),v=p.useCallback(C=>{C!==k.current&&(k.current=C,y(C))},[]),x=p.useCallback(C=>{C!==S.current&&(S.current=C,g(C))},[]),j=i||w,N=o||b,k=p.useRef(null),S=p.useRef(null),M=p.useRef(f),z=c!=null,$=Eu(c),A=Eu(s),O=Eu(d),L=p.useCallback(()=>{if(!k.current||!S.current)return;const C={placement:t,strategy:n,middleware:h};A.current&&(C.platform=A.current),DD(k.current,S.current,C).then(_=>{const R={..._,isPositioned:O.current!==!1};E.current&&!Pc(M.current,R)&&(M.current=R,sd.flushSync(()=>{u(R)}))})},[h,t,n,A,O]);Xl(()=>{d===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,u(C=>({...C,isPositioned:!1})))},[d]);const E=p.useRef(!1);Xl(()=>(E.current=!0,()=>{E.current=!1}),[]),Xl(()=>{if(j&&(k.current=j),N&&(S.current=N),j&&N){if($.current)return $.current(j,N,L);L()}},[j,N,L,$,z]);const I=p.useMemo(()=>({reference:k,floating:S,setReference:v,setFloating:x}),[v,x]),D=p.useMemo(()=>({reference:j,floating:N}),[j,N]),P=p.useMemo(()=>{const C={position:n,left:0,top:0};if(!D.floating)return C;const _=wg(D.floating,f.x),R=wg(D.floating,f.y);return l?{...C,transform:"translate("+_+"px, "+R+"px)",...Cb(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:R}},[n,l,D.floating,f.x,f.y]);return p.useMemo(()=>({...f,update:L,refs:I,elements:D,floatingStyles:P}),[f,L,I,D,P])}const RD=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?vg({element:r.current,padding:s}).fn(n):{}:r?vg({element:r,padding:s}).fn(n):{}}}},ID=(e,t)=>({...SD(e),options:[e,t]}),zD=(e,t)=>({...CD(e),options:[e,t]}),$D=(e,t)=>({...PD(e),options:[e,t]}),LD=(e,t)=>({...ED(e),options:[e,t]}),FD=(e,t)=>({...MD(e),options:[e,t]}),BD=(e,t)=>({..._D(e),options:[e,t]}),WD=(e,t)=>({...RD(e),options:[e,t]});var UD="Arrow",Eb=p.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return a.jsx(Ge.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Eb.displayName=UD;var VD=Eb;function HD(e){const[t,n]=p.useState(void 0);return ls(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,l=d.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Am="Popper",[Mb,gd]=id(Am),[YD,_b]=Mb(Am),Pb=e=>{const{__scopePopper:t,children:n}=e,[r,s]=p.useState(null);return a.jsx(YD,{scope:t,anchor:r,onAnchorChange:s,children:n})};Pb.displayName=Am;var Db="PopperAnchor",Tb=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=_b(Db,n),o=p.useRef(null),l=fn(t,o),c=p.useRef(null);return p.useEffect(()=>{const d=c.current;c.current=(r==null?void 0:r.current)||o.current,d!==c.current&&i.onAnchorChange(c.current)}),r?null:a.jsx(Ge.div,{...s,ref:l})});Tb.displayName=Db;var Rm="PopperContent",[XD,qD]=Mb(Rm),Ob=p.forwardRef((e,t)=>{var ee,K,ne,me,W,Q;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:u="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:w,...y}=e,b=_b(Rm,n),[g,v]=p.useState(null),x=fn(t,Z=>v(Z)),[j,N]=p.useState(null),k=HD(j),S=(k==null?void 0:k.width)??0,M=(k==null?void 0:k.height)??0,z=r+(i!=="center"?"-"+i:""),$=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(d)?d:[d],O=A.length>0,L={padding:$,boundary:A.filter(KD),altBoundary:O},{refs:E,floatingStyles:I,placement:D,isPositioned:P,middlewareData:C}=AD({strategy:"fixed",placement:z,whileElementsMounted:(...Z)=>kD(...Z,{animationFrame:m==="always"}),elements:{reference:b.anchor},middleware:[ID({mainAxis:s+M,alignmentAxis:o}),c&&zD({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?$D():void 0,...L}),c&&LD({...L}),FD({...L,apply:({elements:Z,rects:ae,availableWidth:fe,availableHeight:pe})=>{const{width:Se,height:Xe}=ae.reference,Pe=Z.floating.style;Pe.setProperty("--radix-popper-available-width",`${fe}px`),Pe.setProperty("--radix-popper-available-height",`${pe}px`),Pe.setProperty("--radix-popper-anchor-width",`${Se}px`),Pe.setProperty("--radix-popper-anchor-height",`${Xe}px`)}}),j&&WD({element:j,padding:l}),QD({arrowWidth:S,arrowHeight:M}),h&&BD({strategy:"referenceHidden",...L})]}),[_,R]=Ib(D),B=Wa(w);ls(()=>{P&&(B==null||B())},[P,B]);const T=(ee=C.arrow)==null?void 0:ee.x,F=(K=C.arrow)==null?void 0:K.y,H=((ne=C.arrow)==null?void 0:ne.centerOffset)!==0,[X,J]=p.useState();return ls(()=>{g&&J(window.getComputedStyle(g).zIndex)},[g]),a.jsx("div",{ref:E.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:P?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(me=C.transformOrigin)==null?void 0:me.x,(W=C.transformOrigin)==null?void 0:W.y].join(" "),...((Q=C.hide)==null?void 0:Q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(XD,{scope:n,placedSide:_,onArrowChange:N,arrowX:T,arrowY:F,shouldHideArrow:H,children:a.jsx(Ge.div,{"data-side":_,"data-align":R,...y,ref:x,style:{...y.style,animation:P?void 0:"none"}})})})});Ob.displayName=Rm;var Ab="PopperArrow",GD={top:"bottom",right:"left",bottom:"top",left:"right"},Rb=p.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=qD(Ab,r),o=GD[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(VD,{...s,ref:n,style:{...s.style,display:"block"}})})});Rb.displayName=Ab;function KD(e){return e!==null}var QD=e=>({name:"transformOrigin",options:e,fn(t){var b,g,v;const{placement:n,rects:r,middlewareData:s}=t,o=((b=s.arrow)==null?void 0:b.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,f]=Ib(n),u={start:"0%",center:"50%",end:"100%"}[f],h=(((g=s.arrow)==null?void 0:g.x)??0)+l/2,m=(((v=s.arrow)==null?void 0:v.y)??0)+c/2;let w="",y="";return d==="bottom"?(w=o?u:`${h}px`,y=`${-c}px`):d==="top"?(w=o?u:`${h}px`,y=`${r.floating.height+c}px`):d==="right"?(w=`${-c}px`,y=o?u:`${m}px`):d==="left"&&(w=`${r.floating.width+c}px`,y=o?u:`${m}px`),{data:{x:w,y}}}});function Ib(e){const[t,n="center"]=e.split("-");return[t,n]}var zb=Pb,Im=Tb,$b=Ob,Lb=Rb,yd="Popover",[Fb]=id(yd,[gd]),Vo=gd(),[ZD,xs]=Fb(yd),Bb=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=e,l=Vo(t),c=p.useRef(null),[d,f]=p.useState(!1),[u,h]=xm({prop:r,defaultProp:s??!1,onChange:i,caller:yd});return a.jsx(zb,{...l,children:a.jsx(ZD,{scope:t,contentId:On(),triggerRef:c,open:u,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:d,onCustomAnchorAdd:p.useCallback(()=>f(!0),[]),onCustomAnchorRemove:p.useCallback(()=>f(!1),[]),modal:o,children:n})})};Bb.displayName=yd;var Wb="PopoverAnchor",JD=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=xs(Wb,n),i=Vo(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=s;return p.useEffect(()=>(o(),()=>l()),[o,l]),a.jsx(Im,{...i,...r,ref:t})});JD.displayName=Wb;var Ub="PopoverTrigger",Vb=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=xs(Ub,n),i=Vo(n),o=fn(t,s.triggerRef),l=a.jsx(Ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Gb(s.open),...r,ref:o,onClick:yt(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:a.jsx(Im,{asChild:!0,...i,children:l})});Vb.displayName=Ub;var zm="PopoverPortal",[eT,tT]=Fb(zm,{forceMount:void 0}),Hb=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=xs(zm,t);return a.jsx(eT,{scope:t,forceMount:n,children:a.jsx(Zs,{present:n||i.open,children:a.jsx(ym,{asChild:!0,container:s,children:r})})})};Hb.displayName=zm;var Ya="PopoverContent",Yb=p.forwardRef((e,t)=>{const n=tT(Ya,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,i=xs(Ya,e.__scopePopover);return a.jsx(Zs,{present:r||i.open,children:i.modal?a.jsx(rT,{...s,ref:t}):a.jsx(sT,{...s,ref:t})})});Yb.displayName=Ya;var nT=od("PopoverContent.RemoveScroll"),rT=p.forwardRef((e,t)=>{const n=xs(Ya,e.__scopePopover),r=p.useRef(null),s=fn(t,r),i=p.useRef(!1);return p.useEffect(()=>{const o=r.current;if(o)return fw(o)},[]),a.jsx(vm,{as:nT,allowPinchZoom:!0,children:a.jsx(Xb,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yt(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:yt(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:yt(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),sT=p.forwardRef((e,t)=>{const n=xs(Ya,e.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return a.jsx(Xb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),Xb=p.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,...u}=e,h=xs(Ya,n),m=Vo(n);return rw(),a.jsx(gm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(ld,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:f,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:a.jsx($b,{"data-state":Gb(h.open),role:"dialog",id:h.contentId,...m,...u,ref:t,style:{...u.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)"}})})})}),qb="PopoverClose",aT=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=xs(qb,n);return a.jsx(Ge.button,{type:"button",...r,ref:t,onClick:yt(e.onClick,()=>s.onOpenChange(!1))})});aT.displayName=qb;var iT="PopoverArrow",oT=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Vo(n);return a.jsx(Lb,{...s,...r,ref:t})});oT.displayName=iT;function Gb(e){return e?"open":"closed"}var lT=Bb,cT=Vb,dT=Hb,Kb=Yb;const uT=lT,fT=cT,Qb=p.forwardRef(({className:e,align:t="start",sideOffset:n=4,...r},s)=>a.jsx(dT,{children:a.jsx(Kb,{ref:s,align:t,sideOffset:n,className:we("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),...r})}));Qb.displayName=Kb.displayName;function hT({value:e,onChange:t,className:n}){const[r,s]=p.useState(!1),[i,o]=p.useState(e);p.useEffect(()=>{o(e)},[e]);const l=c=>{o(c),t==null||t(c),c!=null&&c.from&&(c!=null&&c.to)&&s(!1)};return a.jsx("div",{className:n,children:a.jsxs(uT,{open:r,onOpenChange:s,children:[a.jsx(fT,{asChild:!0,children:a.jsxs(U,{variant:"outline",className:"w-48 justify-between font-normal bg-black border-white/20 text-white hover:bg-white/10",children:[i!=null&&i.from?i.to?a.jsxs(a.Fragment,{children:[i.from.toLocaleDateString()," - ",i.to.toLocaleDateString()]}):i.from.toLocaleDateString():"Pick a date range",a.jsx(Io,{className:"h-4 w-4"})]})}),a.jsx(Qb,{className:"w-auto overflow-hidden p-0",align:"start",children:a.jsx(DP,{mode:"range",defaultMonth:i==null?void 0:i.from,selected:i,onSelect:l,numberOfMonths:2,disabled:c=>c>new Date})})]})})}function Zb(){const e=Qs(),{refetchCounts:t}=pm(),[n,r]=p.useState([]),[s,i]=p.useState(!0),[o,l]=p.useState(""),[c,d]=p.useState([]),[f,u]=p.useState(1),[h]=p.useState(20),[m,w]=p.useState(!1),[y,b]=p.useState(!1),[g,v]=p.useState(!1),[x,j]=p.useState(!1),[N,k]=p.useState(!1),[S,M]=p.useState(!1),[z,$]=p.useState(!1),[A,O]=p.useState(null),[L,E]=p.useState(null),[I,D]=p.useState(""),[P,C]=p.useState(),[_,R]=p.useState(!1),[B,T]=p.useState([]),[F,H]=p.useState(!1),X=p.useCallback(async()=>{try{const se=await(await fetch("/api/users?limit=10000")).json();r(se.users||[])}catch{}finally{i(!1)}},[]),J=p.useCallback(async()=>{try{const se=await(await fetch("/api/admin/status")).json();R(se.enabled)}catch{R(!1)}},[]);p.useEffect(()=>{X(),J();const V=()=>{L&&E(null)};return document.addEventListener("click",V),()=>document.removeEventListener("click",V)},[L,J,X]);const ee=async V=>{T([]),H(!0),T([{id:"start",type:"info",message:`Starting user seeding process for ${V} users...`,timestamp:new Date}]);try{const he=await(await fetch("/api/seed/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:V})})).json();if(he.success){const de=he.results.map((Ie,G)=>Ie.success?{id:`user-${G}`,type:"progress",message:`Creating user: ${Ie.user.name} (${Ie.user.email})`,timestamp:new Date,status:"completed"}:{id:`user-${G}`,type:"error",message:`Failed to create user ${G+1}: ${Ie.error}`,timestamp:new Date});T(Ie=>[...Ie,...de]);const be=he.results.filter(Ie=>Ie.success).length;T(Ie=>[...Ie,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${be}/${V} users successfully`,timestamp:new Date}]),await X(),await t()}else T(de=>[...de,{id:"error",type:"error",message:`❌ Seeding failed: ${he.error||"Unknown error"}`,timestamp:new Date}])}catch(se){T(he=>[...he,{id:"error",type:"error",message:`❌ Network error: ${se}`,timestamp:new Date}])}finally{H(!1)}},K=V=>{O(V),j(!0)},ne=V=>{O(V),b(!0)},me=V=>{O(V),v(!0)},W=async()=>{var be,Ie,G;const V=(be=document.getElementById("create-name"))==null?void 0:be.value,se=(Ie=document.getElementById("create-email"))==null?void 0:Ie.value,he=(G=document.getElementById("create-password"))==null?void 0:G.value;if(!V||!se||!he){q.error("Please fill in all fields");return}const de=q.loading("Creating user...");try{const ge=await(await fetch("/api/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:V,email:se,password:he})})).json();ge.success?(await X(),w(!1),document.getElementById("create-name").value="",document.getElementById("create-email").value="",document.getElementById("create-password").value="",q.success("User created successfully!",{id:de})):q.error(`Error creating user: ${ge.error||"Unknown error"}`,{id:de})}catch{q.error("Error creating user",{id:de})}},Q=async()=>{var de,be;if(!A){q.error("No user selected");return}const V=(de=document.getElementById("edit-name"))==null?void 0:de.value,se=(be=document.getElementById("edit-email"))==null?void 0:be.value;if(!V||!se){q.error("Please fill in all fields");return}const he=q.loading("Updating user...");try{const G=await(await fetch(`/api/users/${A.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:V,email:se})})).json();G.success?(await X(),b(!1),O(null),q.success("User updated successfully!",{id:he})):q.error(`Error updating user: ${G.error||"Unknown error"}`,{id:he})}catch{q.error("Error updating user",{id:he})}},Z=async()=>{if(!A){q.error("No user selected");return}const V=q.loading("Deleting user...");try{const he=await(await fetch(`/api/users/${A.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();he.success?(await X(),await t(),v(!1),O(null),q.success("User deleted successfully!",{id:V})):q.error(`Error deleting user: ${he.error||"Unknown error"}`,{id:V})}catch{q.error("Error deleting user",{id:V})}},ae=async()=>{if(!A)return;if(!_){q.error("Admin plugin is not enabled");return}const V=q.loading("Banning user...");try{const se=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:A.id,banReason:I||"No reason provided",banExpiresIn:P})}),he=await se.json();se.ok?(q.success("User banned successfully!",{id:V}),M(!1),D(""),C(void 0),O(null),E(null),X()):q.error(`Error banning user: ${he.error||he.message||"Unknown error"}`,{id:V})}catch{q.error("Error banning user",{id:V})}},fe=async()=>{if(!A)return;if(!_){q.error("Admin plugin is not enabled");return}const V=q.loading("Unbanning user...");try{const se=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:A.id})}),he=await se.json();se.ok?(q.success("User unbanned successfully!",{id:V}),$(!1),O(null),E(null),X()):q.error(`Error unbanning user: ${he.error||he.message||"Unknown error"}`,{id:V})}catch{q.error("Error unbanning user",{id:V})}},pe=()=>{if(n.length===0){q.error("No users to export");return}const V=["ID","Name","Email","Email Verified","Created At","Updated At"],se=n.map(G=>[G.id,G.name||"",G.email||"",!!G.emailVerified,new Date(G.createdAt).toLocaleString(),new Date(G.updatedAt).toLocaleString()]),he=[V.join(","),...se.map(G=>G.map(le=>`"${le}"`).join(","))].join(`
|
|
383
|
+
`),de=new Blob([he],{type:"text/csv;charset=utf-8;"}),be=document.createElement("a"),Ie=URL.createObjectURL(de);be.setAttribute("href",Ie),be.setAttribute("download",`users-export-${new Date().toISOString().split("T")[0]}.csv`),be.style.visibility="hidden",document.body.appendChild(be),be.click(),document.body.removeChild(be),q.success(`Exported ${n.length} users to CSV`)},Se=V=>{c.some(he=>he.type===V)||(d(he=>[...he,{type:V}]),u(1))},Xe=V=>{d(se=>se.filter(he=>he.type!==V)),u(1)},Pe=(V,se)=>{d(he=>he.map(de=>de.type===V?{...de,value:se}:de))},lt=(V,se)=>{d(he=>he.map(de=>de.type===V?{...de,dateRange:se}:de))},Pt=n.filter(V=>{const se=V.name.toLowerCase().includes(o.toLowerCase())||V.email.toLowerCase().includes(o.toLowerCase());if(c.length===0)return se;const he=c.every(de=>{var be,Ie,G,le,ge;switch(de.type){case"emailVerified":return de.value===void 0?!0:V.emailVerified===(de.value==="true");case"banned":return de.value===void 0?!0:V.banned===(de.value==="true");case"active":return V.banned!==!0;case"createdAt":{if(!((be=de.dateRange)!=null&&be.from)&&!((Ie=de.dateRange)!=null&&Ie.to))return!0;const Ue=new Date(V.createdAt);return!((G=de.dateRange)!=null&&G.from&&de.dateRange.from>Ue||(le=de.dateRange)!=null&&le.to&&de.dateRange.to<Ue)}case"role":return de.value?(ge=V.role)==null?void 0:ge.toLowerCase().includes(de.value.toLowerCase()):!0;default:return!0}});return se&&he}),Ae=n.filter(V=>V.banned).length,Qe=Math.ceil(Pt.length/h),xt=(f-1)*h,zt=xt+h,te=Pt.slice(xt,zt),oe=V=>{u(V)};return s?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(Rt,{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 text-white font-light",children:["Users (",n.length,")"]}),a.jsx("p",{className:"text-gray-400 mt-1",children:"Manage your application users"}),a.jsx("div",{className:"flex items-center space-x-4 mt-2",children:Ae>0&&a.jsxs("span",{className:"text-sm text-red-400 flex items-center space-x-1",children:[a.jsx(Hr,{className:"w-3 h-3"}),a.jsxs("span",{children:[Ae," Banned"]})]})})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(U,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:pe,children:[a.jsx(Kv,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),a.jsxs(U,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>k(!0),children:[a.jsx(Be,{className:"w-4 h-4 mr-2"}),"Seed"]}),a.jsxs(U,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>w(!0),children:[a.jsx(ts,{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(os,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Ce,{placeholder:"Search users...",value:o,onChange:V=>l(V.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(ns,{value:"",onValueChange:Se,children:[a.jsx(rs,{className:"w-[180px]",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(pr,{className:"w-4 h-4"}),a.jsx("span",{children:"Add Filter"})]})}),a.jsxs(ss,{children:[!c.some(V=>V.type==="emailVerified")&&a.jsx(Et,{value:"emailVerified",children:"Email Verified"}),!c.some(V=>V.type==="banned")&&a.jsx(Et,{value:"banned",children:"Banned Status"}),!c.some(V=>V.type==="createdAt")&&a.jsx(Et,{value:"createdAt",children:"Created Date"}),!c.some(V=>V.type==="role")&&a.jsx(Et,{value:"role",children:"Role"})]})]})})]}),c.length>0&&a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-gray-400",children:"Active filters:"}),a.jsx("button",{onClick:()=>d([]),className:"text-xs text-gray-400 hover:text-white underline",children:"Clear all"})]}),a.jsx("div",{className:"flex flex-wrap gap-3",children:c.map(V=>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(mm,{className:"w-3 h-3 text-white"}),V.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(ns,{value:V.value||"",onValueChange:se=>Pe("emailVerified",se),children:[a.jsx(rs,{className:"h-7 w-24 text-xs",children:a.jsx("span",{children:V.value==="true"?"True":V.value==="false"?"False":"Select"})}),a.jsxs(ss,{children:[a.jsx(Et,{value:"true",children:"True"}),a.jsx(Et,{value:"false",children:"False"})]})]})]}),V.type==="banned"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Banned:"}),a.jsxs(ns,{value:V.value||"",onValueChange:se=>Pe("banned",se),children:[a.jsx(rs,{className:"h-7 w-24 text-xs",children:a.jsx("span",{children:V.value==="true"?"Yes":V.value==="false"?"No":"Select"})}),a.jsxs(ss,{children:[a.jsx(Et,{value:"true",children:"Yes"}),a.jsx(Et,{value:"false",children:"No"})]})]})]}),V.type==="createdAt"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Created:"}),a.jsx(hT,{value:V.dateRange,onChange:se=>lt("createdAt",se)})]}),V.type==="role"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Role:"}),a.jsx(Ce,{type:"text",value:V.value||"",onChange:se=>Pe("role",se.target.value),className:"h-7 w-32 text-xs bg-black border-white/20 text-white",placeholder:"Enter role..."})]}),a.jsx("button",{onClick:()=>Xe(V.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:a.jsx(Fe,{className:"w-3 h-3 text-white"})})]},V.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:"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:te.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(Oe,{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:o||c.length>0?"Try adjusting your search or filter criteria":"Get started by creating your first user or seeding some data"})]}),!o&&c.length===0&&a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(U,{onClick:()=>w(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[a.jsx(ts,{className:"w-4 h-4 mr-2"}),"Create User"]}),a.jsxs(U,{onClick:()=>k(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(Be,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):te.map(V=>a.jsxs("tr",{className:`border-b border-dashed hover:bg-white/5 cursor-pointer ${V.banned?"border-red-500/30 bg-red-500/5":"border-white/5"}`,onClick:()=>e(`/users/${V.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:V.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${V.id}`,alt:V.name,className:`w-10 h-10 rounded-none border border-dashed ${V.banned?"border-red-400/50 opacity-60":"border-white/20"}`}),V.banned&&a.jsx("div",{className:"absolute -top-1 -right-1 bg-red-500 rounded-full p-0.5",children:a.jsx(Hr,{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:V.name}),V.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:V.email})]})]})}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[V.emailVerified?a.jsx(DC,{className:"w-4 h-4 text-green-400"}):a.jsx(pn,{className:"w-4 h-4 text-yellow-400"}),a.jsx("span",{className:"text-sm text-gray-400",children:V.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(V.createdAt).toLocaleDateString(),a.jsx("p",{className:"text-xs",children:new Date(V.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(U,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:se=>{se.stopPropagation(),E(L===V.id?null:V.id)},children:a.jsx(LC,{className:"w-4 h-4"})}),L===V.id&&a.jsxs("div",{className:"absolute right-0 top-full mt-1 w-48 bg-black border border-white/20 rounded-none shadow-lg z-50",onClick:se=>se.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:se=>{se.stopPropagation(),E(null),K(V)},children:[a.jsx(zo,{className:"w-4 h-4"}),a.jsx("span",{children:"View Details"})]}),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:se=>{se.stopPropagation(),E(null),ne(V)},children:[a.jsx(Fs,{className:"w-4 h-4"}),a.jsx("span",{children:"Edit User"})]}),_&&(V.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:se=>{se.stopPropagation(),O(V),$(!0),E(null)},children:[a.jsx(Hr,{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:se=>{se.stopPropagation(),O(V),M(!0),E(null)},children:[a.jsx(Hr,{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:se=>{se.stopPropagation(),E(null),me(V)},children:[a.jsx(Ds,{className:"w-4 h-4"}),a.jsx("span",{children:"Delete User"})]})]})]})})]},V.id))})]})}),a.jsx(Bw,{currentPage:f,totalPages:Qe,onPageChange:oe,totalItems:Pt.length,startIndex:xt,endIndex:zt})]}),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(U,{variant:"ghost",size:"sm",onClick:()=>k(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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(Oe,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Seed Users"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(De,{htmlFor:"user-count",className:"text-sm text-gray-400 font-light",children:"Number of users"}),a.jsx(Ce,{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(U,{onClick:()=>{var se;const V=parseInt(((se=document.getElementById("user-count"))==null?void 0:se.value)||"5",10);ee(V)},disabled:F,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:F?a.jsxs(a.Fragment,{children:[a.jsx(Rt,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Be,{className:"w-3 h-3 mr-2"}),"Seed Users"]})})]})]}),B.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(Ua,{title:"User Seeding Terminal",lines:B,isRunning:F,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(U,{variant:"outline",onClick:()=>k(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),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:"Create User"}),a.jsx(U,{variant:"ghost",size:"sm",onClick:()=>w(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(De,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Ce,{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(De,{htmlFor:"create-email",className:"text-sm text-gray-400 font-light",children:"Email"}),a.jsx(Ce,{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(De,{htmlFor:"create-password",className:"text-sm text-gray-400 font-light",children:"Password"}),a.jsx(Ce,{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(U,{variant:"outline",onClick:()=>w(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:W,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),y&&A&&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(U,{variant:"ghost",size:"sm",onClick:()=>b(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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:A.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${A.id}`,alt:A.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:A.name}),a.jsx("div",{className:"text-sm text-gray-400",children:A.email})]})]}),a.jsxs("div",{children:[a.jsx(De,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Ce,{id:"edit-name",defaultValue:A.name,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(De,{htmlFor:"edit-email",className:"text-sm text-gray-400 font-light",children:"Email"}),a.jsx(Ce,{id:"edit-email",type:"email",defaultValue:A.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(U,{variant:"outline",onClick:()=>b(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:Q,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),g&&A&&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(U,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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:A.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${A.id}`,alt:A.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:A.name}),a.jsx("div",{className:"text-sm text-gray-400",children:A.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(U,{variant:"outline",onClick:()=>v(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:Z,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),x&&A&&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(U,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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:A.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${A.id}`,alt:A.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:A.name}),a.jsx("div",{className:"text-sm text-gray-400",children:A.email})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"ID:"}),a.jsx("span",{className:"text-white text-sm",children:A.id})]}),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:A.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(A.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(A.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(U,{onClick:()=>j(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})}),S&&A&&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-red-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:"Ban User"}),a.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",a.jsx("strong",{children:A.name})," from accessing the system."]}),a.jsxs("div",{className:"space-y-4 mb-6",children:[a.jsxs("div",{children:[a.jsx(De,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),a.jsx(Ce,{id:"banReason",value:I,onChange:V=>D(V.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(De,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),a.jsx(Ce,{id:"banExpires",type:"number",value:P||"",onChange:V=>C(V.target.value?Number(V.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(U,{variant:"outline",onClick:()=>{M(!1),D(""),C(void 0),O(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:ae,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),z&&A&&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:A.name}),"? This will restore their access to the system."]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(U,{variant:"outline",onClick:()=>{$(!1),O(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:fe,className:"bg-green-600 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})})]})}function mT(){const[e,t]=p.useState("overview"),n=()=>a.jsxs("div",{className:"space-y-8 animate-fade-in px-6 py-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl text-white font-normal",children:"Better Auth Studio"}),a.jsx("p",{className:"text-gray-400 mt-1 font-light",children:"Manage your authentication system"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[a.jsx(St,{className:"border border-dashed border-white/20 bg-black/30 rounded-none hover:bg-black/50 transition-colors",children:a.jsxs(Ct,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-3 bg-white/10 rounded-none",children:a.jsx(Oe,{className:"w-6 h-6 text-white"})}),a.jsx(je,{className:"bg-white/10 text-white border border-dashed border-white/20 rounded-none",children:"Active"})]}),a.jsx("h3",{className:"text-lg text-white font-light mb-2",children:"User Management"}),a.jsx("p",{className:"text-gray-400 font-light mb-4",children:"Manage user accounts, profiles, and permissions"}),a.jsxs(U,{onClick:()=>t("users"),className:"w-full bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:["Manage Users",a.jsx(ia,{className:"w-4 h-4 ml-2"})]})]})}),a.jsx(St,{className:"border border-dashed border-white/20 bg-black/30 rounded-none hover:bg-black/50 transition-colors",children:a.jsxs(Ct,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-3 bg-white/10 rounded-none",children:a.jsx(it,{className:"w-6 h-6 text-white"})}),a.jsx(je,{className:"bg-white/10 text-white border border-dashed border-white/20 rounded-none",children:"Active"})]}),a.jsx("h3",{className:"text-lg text-white font-light mb-2",children:"Organizations"}),a.jsx("p",{className:"text-gray-400 font-light mb-4",children:"Manage organizations, teams, and memberships"}),a.jsxs(U,{onClick:()=>t("organizations"),className:"w-full bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:["Manage Organizations",a.jsx(ia,{className:"w-4 h-4 ml-2"})]})]})}),a.jsx(St,{className:"border border-dashed border-white/20 bg-black/30 rounded-none hover:bg-black/50 transition-colors",children:a.jsxs(Ct,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-3 bg-white/10 rounded-none",children:a.jsx(Ps,{className:"w-6 h-6 text-white"})}),a.jsx(je,{className:"bg-white/10 text-white border border-dashed border-white/20 rounded-none",children:"Configured"})]}),a.jsx("h3",{className:"text-lg text-white font-light mb-2",children:"Configuration"}),a.jsx("p",{className:"text-gray-400 font-light mb-4",children:"View and manage auth configuration"}),a.jsxs(U,{variant:"outline",className:"w-full border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:["View Config",a.jsx(ia,{className:"w-4 h-4 ml-2"})]})]})}),a.jsx(St,{className:"border border-dashed border-white/20 bg-black/30 rounded-none hover:bg-black/50 transition-colors",children:a.jsxs(Ct,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-3 bg-white/10 rounded-none",children:a.jsx(Lf,{className:"w-6 h-6 text-white"})}),a.jsx(je,{className:"bg-white/10 text-white border border-dashed border-white/20 rounded-none",children:"Coming Soon"})]}),a.jsx("h3",{className:"text-lg text-white font-light mb-2",children:"Analytics"}),a.jsx("p",{className:"text-gray-400 font-light mb-4",children:"View authentication analytics and insights"}),a.jsxs(U,{variant:"outline",disabled:!0,className:"w-full border border-dashed border-white/20 text-gray-400 rounded-none",children:["View Analytics",a.jsx(ia,{className:"w-4 h-4 ml-2"})]})]})}),a.jsx(St,{className:"border border-dashed border-white/20 bg-black/30 rounded-none hover:bg-black/50 transition-colors",children:a.jsxs(Ct,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-3 bg-white/10 rounded-none",children:a.jsx(Vl,{className:"w-6 h-6 text-white"})}),a.jsx(je,{className:"bg-white/10 text-white border border-dashed border-white/20 rounded-none",children:"Available"})]}),a.jsx("h3",{className:"text-lg text-white font-light mb-2",children:"Quick Actions"}),a.jsx("p",{className:"text-gray-400 font-light mb-4",children:"Common tasks and shortcuts"}),a.jsxs(U,{variant:"outline",className:"w-full border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:["View Actions",a.jsx(ia,{className:"w-4 h-4 ml-2"})]})]})})]})]});return a.jsx("div",{className:"min-h-screen bg-black text-white",children:e==="overview"?n():e==="users"?a.jsx(Zb,{}):e==="organizations"?a.jsx(Ww,{}):n()})}function pt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=pt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var pT={value:()=>{}};function vd(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ql(n)}function ql(e){this._=e}function xT(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ql.prototype=vd.prototype={constructor:ql,on:function(e,t){var n=this._,r=xT(e+"",n),s,i=-1,o=r.length;if(arguments.length<2){for(;++i<o;)if((s=(e=r[i]).type)&&(s=gT(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<o;)if(s=(e=r[i]).type)n[s]=bg(n[s],e.name,t);else if(t==null)for(s in n)n[s]=bg(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ql(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,i;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,i=r.length;s<i;++s)r[s].value.apply(t,n)}};function gT(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function bg(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=pT,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Qf="http://www.w3.org/1999/xhtml";const Ng={svg:"http://www.w3.org/2000/svg",xhtml:Qf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function wd(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Ng.hasOwnProperty(t)?{space:Ng[t],local:e}:e}function yT(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Qf&&t.documentElement.namespaceURI===Qf?t.createElement(e):t.createElementNS(n,e)}}function vT(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Jb(e){var t=wd(e);return(t.local?vT:yT)(t)}function wT(){}function $m(e){return e==null?wT:function(){return this.querySelector(e)}}function bT(e){typeof e!="function"&&(e=$m(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var i=t[s],o=i.length,l=r[s]=new Array(o),c,d,f=0;f<o;++f)(c=i[f])&&(d=e.call(c,c.__data__,f,i))&&("__data__"in c&&(d.__data__=c.__data__),l[f]=d);return new cn(r,this._parents)}function NT(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function jT(){return[]}function e1(e){return e==null?jT:function(){return this.querySelectorAll(e)}}function kT(e){return function(){return NT(e.apply(this,arguments))}}function ST(e){typeof e=="function"?e=kT(e):e=e1(e);for(var t=this._groups,n=t.length,r=[],s=[],i=0;i<n;++i)for(var o=t[i],l=o.length,c,d=0;d<l;++d)(c=o[d])&&(r.push(e.call(c,c.__data__,d,o)),s.push(c));return new cn(r,s)}function t1(e){return function(){return this.matches(e)}}function n1(e){return function(t){return t.matches(e)}}var CT=Array.prototype.find;function ET(e){return function(){return CT.call(this.children,e)}}function MT(){return this.firstElementChild}function _T(e){return this.select(e==null?MT:ET(typeof e=="function"?e:n1(e)))}var PT=Array.prototype.filter;function DT(){return Array.from(this.children)}function TT(e){return function(){return PT.call(this.children,e)}}function OT(e){return this.selectAll(e==null?DT:TT(typeof e=="function"?e:n1(e)))}function AT(e){typeof e!="function"&&(e=t1(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var i=t[s],o=i.length,l=r[s]=[],c,d=0;d<o;++d)(c=i[d])&&e.call(c,c.__data__,d,i)&&l.push(c);return new cn(r,this._parents)}function r1(e){return new Array(e.length)}function RT(){return new cn(this._enter||this._groups.map(r1),this._parents)}function Dc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Dc.prototype={constructor:Dc,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 IT(e){return function(){return e}}function zT(e,t,n,r,s,i){for(var o=0,l,c=t.length,d=i.length;o<d;++o)(l=t[o])?(l.__data__=i[o],r[o]=l):n[o]=new Dc(e,i[o]);for(;o<c;++o)(l=t[o])&&(s[o]=l)}function $T(e,t,n,r,s,i,o){var l,c,d=new Map,f=t.length,u=i.length,h=new Array(f),m;for(l=0;l<f;++l)(c=t[l])&&(h[l]=m=o.call(c,c.__data__,l,t)+"",d.has(m)?s[l]=c:d.set(m,c));for(l=0;l<u;++l)m=o.call(e,i[l],l,i)+"",(c=d.get(m))?(r[l]=c,c.__data__=i[l],d.delete(m)):n[l]=new Dc(e,i[l]);for(l=0;l<f;++l)(c=t[l])&&d.get(h[l])===c&&(s[l]=c)}function LT(e){return e.__data__}function FT(e,t){if(!arguments.length)return Array.from(this,LT);var n=t?$T:zT,r=this._parents,s=this._groups;typeof e!="function"&&(e=IT(e));for(var i=s.length,o=new Array(i),l=new Array(i),c=new Array(i),d=0;d<i;++d){var f=r[d],u=s[d],h=u.length,m=BT(e.call(f,f&&f.__data__,d,r)),w=m.length,y=l[d]=new Array(w),b=o[d]=new Array(w),g=c[d]=new Array(h);n(f,u,y,b,g,m,t);for(var v=0,x=0,j,N;v<w;++v)if(j=y[v]){for(v>=x&&(x=v+1);!(N=b[x])&&++x<w;);j._next=N||null}}return o=new cn(o,r),o._enter=l,o._exit=c,o}function BT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function WT(){return new cn(this._exit||this._groups.map(r1),this._parents)}function UT(e,t,n){var r=this.enter(),s=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?i.remove():n(i),r&&s?r.merge(s).order():s}function VT(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,i=r.length,o=Math.min(s,i),l=new Array(s),c=0;c<o;++c)for(var d=n[c],f=r[c],u=d.length,h=l[c]=new Array(u),m,w=0;w<u;++w)(m=d[w]||f[w])&&(h[w]=m);for(;c<s;++c)l[c]=n[c];return new cn(l,this._parents)}function HT(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,i=r[s],o;--s>=0;)(o=r[s])&&(i&&o.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(o,i),i=o);return this}function YT(e){e||(e=XT);function t(u,h){return u&&h?e(u.__data__,h.__data__):!u-!h}for(var n=this._groups,r=n.length,s=new Array(r),i=0;i<r;++i){for(var o=n[i],l=o.length,c=s[i]=new Array(l),d,f=0;f<l;++f)(d=o[f])&&(c[f]=d);c.sort(t)}return new cn(s,this._parents).order()}function XT(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function qT(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function GT(){return Array.from(this)}function KT(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,i=r.length;s<i;++s){var o=r[s];if(o)return o}return null}function QT(){let e=0;for(const t of this)++e;return e}function ZT(){return!this.node()}function JT(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],i=0,o=s.length,l;i<o;++i)(l=s[i])&&e.call(l,l.__data__,i,s);return this}function e5(e){return function(){this.removeAttribute(e)}}function t5(e){return function(){this.removeAttributeNS(e.space,e.local)}}function n5(e,t){return function(){this.setAttribute(e,t)}}function r5(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function s5(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function a5(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 i5(e,t){var n=wd(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?t5:e5:typeof t=="function"?n.local?a5:s5:n.local?r5:n5)(n,t))}function s1(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function o5(e){return function(){this.style.removeProperty(e)}}function l5(e,t,n){return function(){this.style.setProperty(e,t,n)}}function c5(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function d5(e,t,n){return arguments.length>1?this.each((t==null?o5:typeof t=="function"?c5:l5)(e,t,n??"")):Xa(this.node(),e)}function Xa(e,t){return e.style.getPropertyValue(t)||s1(e).getComputedStyle(e,null).getPropertyValue(t)}function u5(e){return function(){delete this[e]}}function f5(e,t){return function(){this[e]=t}}function h5(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function m5(e,t){return arguments.length>1?this.each((t==null?u5:typeof t=="function"?h5:f5)(e,t)):this.node()[e]}function a1(e){return e.trim().split(/^|\s+/)}function Lm(e){return e.classList||new i1(e)}function i1(e){this._node=e,this._names=a1(e.getAttribute("class")||"")}i1.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 o1(e,t){for(var n=Lm(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function l1(e,t){for(var n=Lm(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function p5(e){return function(){o1(this,e)}}function x5(e){return function(){l1(this,e)}}function g5(e,t){return function(){(t.apply(this,arguments)?o1:l1)(this,e)}}function y5(e,t){var n=a1(e+"");if(arguments.length<2){for(var r=Lm(this.node()),s=-1,i=n.length;++s<i;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?g5:t?p5:x5)(n,t))}function v5(){this.textContent=""}function w5(e){return function(){this.textContent=e}}function b5(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function N5(e){return arguments.length?this.each(e==null?v5:(typeof e=="function"?b5:w5)(e)):this.node().textContent}function j5(){this.innerHTML=""}function k5(e){return function(){this.innerHTML=e}}function S5(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function C5(e){return arguments.length?this.each(e==null?j5:(typeof e=="function"?S5:k5)(e)):this.node().innerHTML}function E5(){this.nextSibling&&this.parentNode.appendChild(this)}function M5(){return this.each(E5)}function _5(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function P5(){return this.each(_5)}function D5(e){var t=typeof e=="function"?e:Jb(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function T5(){return null}function O5(e,t){var n=typeof e=="function"?e:Jb(e),r=t==null?T5:typeof t=="function"?t:$m(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function A5(){var e=this.parentNode;e&&e.removeChild(this)}function R5(){return this.each(A5)}function I5(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function z5(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function $5(e){return this.select(e?z5:I5)}function L5(e){return arguments.length?this.property("__data__",e):this.node().__data__}function F5(e){return function(t){e.call(this,t,this.__data__)}}function B5(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function W5(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,i;n<s;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function U5(e,t,n){return function(){var r=this.__on,s,i=F5(t);if(r){for(var o=0,l=r.length;o<l;++o)if((s=r[o]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=i,s.options=n),s.value=t;return}}this.addEventListener(e.type,i,n),s={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(s):this.__on=[s]}}function V5(e,t,n){var r=B5(e+""),s,i=r.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,d=l.length,f;c<d;++c)for(s=0,f=l[c];s<i;++s)if((o=r[s]).type===f.type&&o.name===f.name)return f.value}return}for(l=t?U5:W5,s=0;s<i;++s)this.each(l(r[s],t,n));return this}function c1(e,t,n){var r=s1(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function H5(e,t){return function(){return c1(this,e,t)}}function Y5(e,t){return function(){return c1(this,e,t.apply(this,arguments))}}function X5(e,t){return this.each((typeof t=="function"?Y5:H5)(e,t))}function*q5(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,i=r.length,o;s<i;++s)(o=r[s])&&(yield o)}var d1=[null];function cn(e,t){this._groups=e,this._parents=t}function Ho(){return new cn([[document.documentElement]],d1)}function G5(){return this}cn.prototype=Ho.prototype={constructor:cn,select:bT,selectAll:ST,selectChild:_T,selectChildren:OT,filter:AT,data:FT,enter:RT,exit:WT,join:UT,merge:VT,selection:G5,order:HT,sort:YT,call:qT,nodes:GT,node:KT,size:QT,empty:ZT,each:JT,attr:i5,style:d5,property:m5,classed:y5,text:N5,html:C5,raise:M5,lower:P5,append:D5,insert:O5,remove:R5,clone:$5,datum:L5,on:V5,dispatch:X5,[Symbol.iterator]:q5};function nn(e){return typeof e=="string"?new cn([[document.querySelector(e)]],[document.documentElement]):new cn([[e]],d1)}function K5(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Sn(e,t){if(e=K5(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const Q5={passive:!1},yo={capture:!0,passive:!1};function Mu(e){e.stopImmediatePropagation()}function Oa(e){e.preventDefault(),e.stopImmediatePropagation()}function u1(e){var t=e.document.documentElement,n=nn(e).on("dragstart.drag",Oa,yo);"onselectstart"in t?n.on("selectstart.drag",Oa,yo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function f1(e,t){var n=e.document.documentElement,r=nn(e).on("dragstart.drag",null);t&&(r.on("click.drag",Oa,yo),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const jl=e=>()=>e;function Zf(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:i,x:o,y:l,dx:c,dy:d,dispatch:f}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,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:d,enumerable:!0,configurable:!0},_:{value:f}})}Zf.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Z5(e){return!e.ctrlKey&&!e.button}function J5(){return this.parentNode}function eO(e,t){return t??{x:e.x,y:e.y}}function tO(){return navigator.maxTouchPoints||"ontouchstart"in this}function h1(){var e=Z5,t=J5,n=eO,r=tO,s={},i=vd("start","drag","end"),o=0,l,c,d,f,u=0;function h(j){j.on("mousedown.drag",m).filter(r).on("touchstart.drag",b).on("touchmove.drag",g,Q5).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(j,N){if(!(f||!e.call(this,j,N))){var k=x(this,t.call(this,j,N),j,N,"mouse");k&&(nn(j.view).on("mousemove.drag",w,yo).on("mouseup.drag",y,yo),u1(j.view),Mu(j),d=!1,l=j.clientX,c=j.clientY,k("start",j))}}function w(j){if(Oa(j),!d){var N=j.clientX-l,k=j.clientY-c;d=N*N+k*k>u}s.mouse("drag",j)}function y(j){nn(j.view).on("mousemove.drag mouseup.drag",null),f1(j.view,d),Oa(j),s.mouse("end",j)}function b(j,N){if(e.call(this,j,N)){var k=j.changedTouches,S=t.call(this,j,N),M=k.length,z,$;for(z=0;z<M;++z)($=x(this,S,j,N,k[z].identifier,k[z]))&&(Mu(j),$("start",j,k[z]))}}function g(j){var N=j.changedTouches,k=N.length,S,M;for(S=0;S<k;++S)(M=s[N[S].identifier])&&(Oa(j),M("drag",j,N[S]))}function v(j){var N=j.changedTouches,k=N.length,S,M;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),S=0;S<k;++S)(M=s[N[S].identifier])&&(Mu(j),M("end",j,N[S]))}function x(j,N,k,S,M,z){var $=i.copy(),A=Sn(z||k,N),O,L,E;if((E=n.call(j,new Zf("beforestart",{sourceEvent:k,target:h,identifier:M,active:o,x:A[0],y:A[1],dx:0,dy:0,dispatch:$}),S))!=null)return O=E.x-A[0]||0,L=E.y-A[1]||0,function I(D,P,C){var _=A,R;switch(D){case"start":s[M]=I,R=o++;break;case"end":delete s[M],--o;case"drag":A=Sn(C||P,N),R=o;break}$.call(D,j,new Zf(D,{sourceEvent:P,subject:E,target:h,identifier:M,active:R,x:A[0]+O,y:A[1]+L,dx:A[0]-_[0],dy:A[1]-_[1],dispatch:$}),S)}}return h.filter=function(j){return arguments.length?(e=typeof j=="function"?j:jl(!!j),h):e},h.container=function(j){return arguments.length?(t=typeof j=="function"?j:jl(j),h):t},h.subject=function(j){return arguments.length?(n=typeof j=="function"?j:jl(j),h):n},h.touchable=function(j){return arguments.length?(r=typeof j=="function"?j:jl(!!j),h):r},h.on=function(){var j=i.on.apply(i,arguments);return j===i?h:j},h.clickDistance=function(j){return arguments.length?(u=(j=+j)*j,h):Math.sqrt(u)},h}function Fm(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function m1(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Yo(){}var vo=.7,Tc=1/vo,Aa="\\s*([+-]?\\d+)\\s*",wo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",er="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",nO=/^#([0-9a-f]{3,8})$/,rO=new RegExp(`^rgb\\(${Aa},${Aa},${Aa}\\)$`),sO=new RegExp(`^rgb\\(${er},${er},${er}\\)$`),aO=new RegExp(`^rgba\\(${Aa},${Aa},${Aa},${wo}\\)$`),iO=new RegExp(`^rgba\\(${er},${er},${er},${wo}\\)$`),oO=new RegExp(`^hsl\\(${wo},${er},${er}\\)$`),lO=new RegExp(`^hsla\\(${wo},${er},${er},${wo}\\)$`),jg={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};Fm(Yo,Hs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:kg,formatHex:kg,formatHex8:cO,formatHsl:dO,formatRgb:Sg,toString:Sg});function kg(){return this.rgb().formatHex()}function cO(){return this.rgb().formatHex8()}function dO(){return p1(this).formatHsl()}function Sg(){return this.rgb().formatRgb()}function Hs(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=nO.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Cg(t):n===3?new Yt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?kl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?kl(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=rO.exec(e))?new Yt(t[1],t[2],t[3],1):(t=sO.exec(e))?new Yt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=aO.exec(e))?kl(t[1],t[2],t[3],t[4]):(t=iO.exec(e))?kl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=oO.exec(e))?_g(t[1],t[2]/100,t[3]/100,1):(t=lO.exec(e))?_g(t[1],t[2]/100,t[3]/100,t[4]):jg.hasOwnProperty(e)?Cg(jg[e]):e==="transparent"?new Yt(NaN,NaN,NaN,0):null}function Cg(e){return new Yt(e>>16&255,e>>8&255,e&255,1)}function kl(e,t,n,r){return r<=0&&(e=t=n=NaN),new Yt(e,t,n,r)}function uO(e){return e instanceof Yo||(e=Hs(e)),e?(e=e.rgb(),new Yt(e.r,e.g,e.b,e.opacity)):new Yt}function Jf(e,t,n,r){return arguments.length===1?uO(e):new Yt(e,t,n,r??1)}function Yt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Fm(Yt,Jf,m1(Yo,{brighter(e){return e=e==null?Tc:Math.pow(Tc,e),new Yt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?vo:Math.pow(vo,e),new Yt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Yt(Ts(this.r),Ts(this.g),Ts(this.b),Oc(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:Eg,formatHex:Eg,formatHex8:fO,formatRgb:Mg,toString:Mg}));function Eg(){return`#${Es(this.r)}${Es(this.g)}${Es(this.b)}`}function fO(){return`#${Es(this.r)}${Es(this.g)}${Es(this.b)}${Es((isNaN(this.opacity)?1:this.opacity)*255)}`}function Mg(){const e=Oc(this.opacity);return`${e===1?"rgb(":"rgba("}${Ts(this.r)}, ${Ts(this.g)}, ${Ts(this.b)}${e===1?")":`, ${e})`}`}function Oc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ts(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Es(e){return e=Ts(e),(e<16?"0":"")+e.toString(16)}function _g(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new En(e,t,n,r)}function p1(e){if(e instanceof En)return new En(e.h,e.s,e.l,e.opacity);if(e instanceof Yo||(e=Hs(e)),!e)return new En;if(e instanceof En)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,l=i-s,c=(i+s)/2;return l?(t===i?o=(n-r)/l+(n<r)*6:n===i?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?i+s:2-i-s,o*=60):l=c>0&&c<1?0:o,new En(o,l,c,e.opacity)}function hO(e,t,n,r){return arguments.length===1?p1(e):new En(e,t,n,r??1)}function En(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Fm(En,hO,m1(Yo,{brighter(e){return e=e==null?Tc:Math.pow(Tc,e),new En(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?vo:Math.pow(vo,e),new En(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new Yt(_u(e>=240?e-240:e+120,s,r),_u(e,s,r),_u(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new En(Pg(this.h),Sl(this.s),Sl(this.l),Oc(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=Oc(this.opacity);return`${e===1?"hsl(":"hsla("}${Pg(this.h)}, ${Sl(this.s)*100}%, ${Sl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Pg(e){return e=(e||0)%360,e<0?e+360:e}function Sl(e){return Math.max(0,Math.min(1,e||0))}function _u(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 Bm=e=>()=>e;function mO(e,t){return function(n){return e+n*t}}function pO(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function xO(e){return(e=+e)==1?x1:function(t,n){return n-t?pO(t,n,e):Bm(isNaN(t)?n:t)}}function x1(e,t){var n=t-e;return n?mO(e,n):Bm(isNaN(e)?t:e)}const Ac=function e(t){var n=xO(t);function r(s,i){var o=n((s=Jf(s)).r,(i=Jf(i)).r),l=n(s.g,i.g),c=n(s.b,i.b),d=x1(s.opacity,i.opacity);return function(f){return s.r=o(f),s.g=l(f),s.b=c(f),s.opacity=d(f),s+""}}return r.gamma=e,r}(1);function gO(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(i){for(s=0;s<n;++s)r[s]=e[s]*(1-i)+t[s]*i;return r}}function yO(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function vO(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),i=new Array(n),o;for(o=0;o<r;++o)s[o]=Vi(e[o],t[o]);for(;o<n;++o)i[o]=t[o];return function(l){for(o=0;o<r;++o)i[o]=s[o](l);return i}}function wO(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Yn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function bO(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=Vi(e[s],t[s]):r[s]=t[s];return function(i){for(s in n)r[s]=n[s](i);return r}}var eh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Pu=new RegExp(eh.source,"g");function NO(e){return function(){return e}}function jO(e){return function(t){return e(t)+""}}function g1(e,t){var n=eh.lastIndex=Pu.lastIndex=0,r,s,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=eh.exec(e))&&(s=Pu.exec(t));)(i=s.index)>n&&(i=t.slice(n,i),l[o]?l[o]+=i:l[++o]=i),(r=r[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:Yn(r,s)})),n=Pu.lastIndex;return n<t.length&&(i=t.slice(n),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?jO(c[0].x):NO(t):(t=c.length,function(d){for(var f=0,u;f<t;++f)l[(u=c[f]).i]=u.x(d);return l.join("")})}function Vi(e,t){var n=typeof t,r;return t==null||n==="boolean"?Bm(t):(n==="number"?Yn:n==="string"?(r=Hs(t))?(t=r,Ac):g1:t instanceof Hs?Ac:t instanceof Date?wO:yO(t)?gO:Array.isArray(t)?vO:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?bO:Yn)(e,t)}var Dg=180/Math.PI,th={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function y1(e,t,n,r,s,i){var o,l,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,c/=l),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:s,translateY:i,rotate:Math.atan2(t,e)*Dg,skewX:Math.atan(c)*Dg,scaleX:o,scaleY:l}}var Cl;function kO(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?th:y1(t.a,t.b,t.c,t.d,t.e,t.f)}function SO(e){return e==null||(Cl||(Cl=document.createElementNS("http://www.w3.org/2000/svg","g")),Cl.setAttribute("transform",e),!(e=Cl.transform.baseVal.consolidate()))?th:(e=e.matrix,y1(e.a,e.b,e.c,e.d,e.e,e.f))}function v1(e,t,n,r){function s(d){return d.length?d.pop()+" ":""}function i(d,f,u,h,m,w){if(d!==u||f!==h){var y=m.push("translate(",null,t,null,n);w.push({i:y-4,x:Yn(d,u)},{i:y-2,x:Yn(f,h)})}else(u||h)&&m.push("translate("+u+t+h+n)}function o(d,f,u,h){d!==f?(d-f>180?f+=360:f-d>180&&(d+=360),h.push({i:u.push(s(u)+"rotate(",null,r)-2,x:Yn(d,f)})):f&&u.push(s(u)+"rotate("+f+r)}function l(d,f,u,h){d!==f?h.push({i:u.push(s(u)+"skewX(",null,r)-2,x:Yn(d,f)}):f&&u.push(s(u)+"skewX("+f+r)}function c(d,f,u,h,m,w){if(d!==u||f!==h){var y=m.push(s(m)+"scale(",null,",",null,")");w.push({i:y-4,x:Yn(d,u)},{i:y-2,x:Yn(f,h)})}else(u!==1||h!==1)&&m.push(s(m)+"scale("+u+","+h+")")}return function(d,f){var u=[],h=[];return d=e(d),f=e(f),i(d.translateX,d.translateY,f.translateX,f.translateY,u,h),o(d.rotate,f.rotate,u,h),l(d.skewX,f.skewX,u,h),c(d.scaleX,d.scaleY,f.scaleX,f.scaleY,u,h),d=f=null,function(m){for(var w=-1,y=h.length,b;++w<y;)u[(b=h[w]).i]=b.x(m);return u.join("")}}}var CO=v1(kO,"px, ","px)","deg)"),EO=v1(SO,", ",")",")"),MO=1e-12;function Tg(e){return((e=Math.exp(e))+1/e)/2}function _O(e){return((e=Math.exp(e))-1/e)/2}function PO(e){return((e=Math.exp(2*e))-1)/(e+1)}const Gl=function e(t,n,r){function s(i,o){var l=i[0],c=i[1],d=i[2],f=o[0],u=o[1],h=o[2],m=f-l,w=u-c,y=m*m+w*w,b,g;if(y<MO)g=Math.log(h/d)/t,b=function(S){return[l+S*m,c+S*w,d*Math.exp(t*S*g)]};else{var v=Math.sqrt(y),x=(h*h-d*d+r*y)/(2*d*n*v),j=(h*h-d*d-r*y)/(2*h*n*v),N=Math.log(Math.sqrt(x*x+1)-x),k=Math.log(Math.sqrt(j*j+1)-j);g=(k-N)/t,b=function(S){var M=S*g,z=Tg(N),$=d/(n*v)*(z*PO(t*M+N)-_O(N));return[l+$*m,c+$*w,d*z/Tg(t*M+N)]}}return b.duration=g*1e3*t/Math.SQRT2,b}return s.rho=function(i){var o=Math.max(.001,+i),l=o*o,c=l*l;return e(o,l,c)},s}(Math.SQRT2,2,4);var qa=0,Ti=0,Si=0,w1=1e3,Rc,Oi,Ic=0,Ys=0,bd=0,bo=typeof performance=="object"&&performance.now?performance:Date,b1=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Wm(){return Ys||(b1(DO),Ys=bo.now()+bd)}function DO(){Ys=0}function zc(){this._call=this._time=this._next=null}zc.prototype=N1.prototype={constructor:zc,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Wm():+n)+(t==null?0:+t),!this._next&&Oi!==this&&(Oi?Oi._next=this:Rc=this,Oi=this),this._call=e,this._time=n,nh()},stop:function(){this._call&&(this._call=null,this._time=1/0,nh())}};function N1(e,t,n){var r=new zc;return r.restart(e,t,n),r}function TO(){Wm(),++qa;for(var e=Rc,t;e;)(t=Ys-e._time)>=0&&e._call.call(void 0,t),e=e._next;--qa}function Og(){Ys=(Ic=bo.now())+bd,qa=Ti=0;try{TO()}finally{qa=0,AO(),Ys=0}}function OO(){var e=bo.now(),t=e-Ic;t>w1&&(bd-=t,Ic=e)}function AO(){for(var e,t=Rc,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Rc=n);Oi=e,nh(r)}function nh(e){if(!qa){Ti&&(Ti=clearTimeout(Ti));var t=e-Ys;t>24?(e<1/0&&(Ti=setTimeout(Og,e-bo.now()-bd)),Si&&(Si=clearInterval(Si))):(Si||(Ic=bo.now(),Si=setInterval(OO,w1)),qa=1,b1(Og))}}function Ag(e,t,n){var r=new zc;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var RO=vd("start","end","cancel","interrupt"),IO=[],j1=0,Rg=1,rh=2,Kl=3,Ig=4,sh=5,Ql=6;function Nd(e,t,n,r,s,i){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;zO(e,n,{name:t,index:r,group:s,on:RO,tween:IO,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:j1})}function Um(e,t){var n=$n(e,t);if(n.state>j1)throw new Error("too late; already scheduled");return n}function ar(e,t){var n=$n(e,t);if(n.state>Kl)throw new Error("too late; already running");return n}function $n(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function zO(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=N1(i,0,n.time);function i(d){n.state=Rg,n.timer.restart(o,n.delay,n.time),n.delay<=d&&o(d-n.delay)}function o(d){var f,u,h,m;if(n.state!==Rg)return c();for(f in r)if(m=r[f],m.name===n.name){if(m.state===Kl)return Ag(o);m.state===Ig?(m.state=Ql,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[f]):+f<t&&(m.state=Ql,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete r[f])}if(Ag(function(){n.state===Kl&&(n.state=Ig,n.timer.restart(l,n.delay,n.time),l(d))}),n.state=rh,n.on.call("start",e,e.__data__,n.index,n.group),n.state===rh){for(n.state=Kl,s=new Array(h=n.tween.length),f=0,u=-1;f<h;++f)(m=n.tween[f].value.call(e,e.__data__,n.index,n.group))&&(s[++u]=m);s.length=u+1}}function l(d){for(var f=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(c),n.state=sh,1),u=-1,h=s.length;++u<h;)s[u].call(e,f);n.state===sh&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Ql,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function Zl(e,t){var n=e.__transition,r,s,i=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){i=!1;continue}s=r.state>rh&&r.state<sh,r.state=Ql,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}i&&delete e.__transition}}function $O(e){return this.each(function(){Zl(this,e)})}function LO(e,t){var n,r;return function(){var s=ar(this,e),i=s.tween;if(i!==n){r=n=i;for(var o=0,l=r.length;o<l;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}s.tween=r}}function FO(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var i=ar(this,e),o=i.tween;if(o!==r){s=(r=o).slice();for(var l={name:t,value:n},c=0,d=s.length;c<d;++c)if(s[c].name===t){s[c]=l;break}c===d&&s.push(l)}i.tween=s}}function BO(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=$n(this.node(),n).tween,s=0,i=r.length,o;s<i;++s)if((o=r[s]).name===e)return o.value;return null}return this.each((t==null?LO:FO)(n,e,t))}function Vm(e,t,n){var r=e._id;return e.each(function(){var s=ar(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return $n(s,r).value[t]}}function k1(e,t){var n;return(typeof t=="number"?Yn:t instanceof Hs?Ac:(n=Hs(t))?(t=n,Ac):g1)(e,t)}function WO(e){return function(){this.removeAttribute(e)}}function UO(e){return function(){this.removeAttributeNS(e.space,e.local)}}function VO(e,t,n){var r,s=n+"",i;return function(){var o=this.getAttribute(e);return o===s?null:o===r?i:i=t(r=o,n)}}function HO(e,t,n){var r,s=n+"",i;return function(){var o=this.getAttributeNS(e.space,e.local);return o===s?null:o===r?i:i=t(r=o,n)}}function YO(e,t,n){var r,s,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===r&&c===s?i:(s=c,i=t(r=o,l)))}}function XO(e,t,n){var r,s,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===r&&c===s?i:(s=c,i=t(r=o,l)))}}function qO(e,t){var n=wd(e),r=n==="transform"?EO:k1;return this.attrTween(e,typeof t=="function"?(n.local?XO:YO)(n,r,Vm(this,"attr."+e,t)):t==null?(n.local?UO:WO)(n):(n.local?HO:VO)(n,r,t))}function GO(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function KO(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function QO(e,t){var n,r;function s(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&KO(e,i)),n}return s._value=t,s}function ZO(e,t){var n,r;function s(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&GO(e,i)),n}return s._value=t,s}function JO(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=wd(e);return this.tween(n,(r.local?QO:ZO)(r,t))}function eA(e,t){return function(){Um(this,e).delay=+t.apply(this,arguments)}}function tA(e,t){return t=+t,function(){Um(this,e).delay=t}}function nA(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?eA:tA)(t,e)):$n(this.node(),t).delay}function rA(e,t){return function(){ar(this,e).duration=+t.apply(this,arguments)}}function sA(e,t){return t=+t,function(){ar(this,e).duration=t}}function aA(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?rA:sA)(t,e)):$n(this.node(),t).duration}function iA(e,t){if(typeof t!="function")throw new Error;return function(){ar(this,e).ease=t}}function oA(e){var t=this._id;return arguments.length?this.each(iA(t,e)):$n(this.node(),t).ease}function lA(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ar(this,e).ease=n}}function cA(e){if(typeof e!="function")throw new Error;return this.each(lA(this._id,e))}function dA(e){typeof e!="function"&&(e=t1(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var i=t[s],o=i.length,l=r[s]=[],c,d=0;d<o;++d)(c=i[d])&&e.call(c,c.__data__,d,i)&&l.push(c);return new Er(r,this._parents,this._name,this._id)}function uA(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,i=Math.min(r,s),o=new Array(r),l=0;l<i;++l)for(var c=t[l],d=n[l],f=c.length,u=o[l]=new Array(f),h,m=0;m<f;++m)(h=c[m]||d[m])&&(u[m]=h);for(;l<r;++l)o[l]=t[l];return new Er(o,this._parents,this._name,this._id)}function fA(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 hA(e,t,n){var r,s,i=fA(t)?Um:ar;return function(){var o=i(this,e),l=o.on;l!==r&&(s=(r=l).copy()).on(t,n),o.on=s}}function mA(e,t){var n=this._id;return arguments.length<2?$n(this.node(),n).on.on(e):this.each(hA(n,e,t))}function pA(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function xA(){return this.on("end.remove",pA(this._id))}function gA(e){var t=this._name,n=this._id;typeof e!="function"&&(e=$m(e));for(var r=this._groups,s=r.length,i=new Array(s),o=0;o<s;++o)for(var l=r[o],c=l.length,d=i[o]=new Array(c),f,u,h=0;h<c;++h)(f=l[h])&&(u=e.call(f,f.__data__,h,l))&&("__data__"in f&&(u.__data__=f.__data__),d[h]=u,Nd(d[h],t,n,h,d,$n(f,n)));return new Er(i,this._parents,t,n)}function yA(e){var t=this._name,n=this._id;typeof e!="function"&&(e=e1(e));for(var r=this._groups,s=r.length,i=[],o=[],l=0;l<s;++l)for(var c=r[l],d=c.length,f,u=0;u<d;++u)if(f=c[u]){for(var h=e.call(f,f.__data__,u,c),m,w=$n(f,n),y=0,b=h.length;y<b;++y)(m=h[y])&&Nd(m,t,n,y,h,w);i.push(h),o.push(f)}return new Er(i,o,t,n)}var vA=Ho.prototype.constructor;function wA(){return new vA(this._groups,this._parents)}function bA(e,t){var n,r,s;return function(){var i=Xa(this,e),o=(this.style.removeProperty(e),Xa(this,e));return i===o?null:i===n&&o===r?s:s=t(n=i,r=o)}}function S1(e){return function(){this.style.removeProperty(e)}}function NA(e,t,n){var r,s=n+"",i;return function(){var o=Xa(this,e);return o===s?null:o===r?i:i=t(r=o,n)}}function jA(e,t,n){var r,s,i;return function(){var o=Xa(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),Xa(this,e))),o===c?null:o===r&&c===s?i:(s=c,i=t(r=o,l))}}function kA(e,t){var n,r,s,i="style."+t,o="end."+i,l;return function(){var c=ar(this,e),d=c.on,f=c.value[i]==null?l||(l=S1(t)):void 0;(d!==n||s!==f)&&(r=(n=d).copy()).on(o,s=f),c.on=r}}function SA(e,t,n){var r=(e+="")=="transform"?CO:k1;return t==null?this.styleTween(e,bA(e,r)).on("end.style."+e,S1(e)):typeof t=="function"?this.styleTween(e,jA(e,r,Vm(this,"style."+e,t))).each(kA(this._id,e)):this.styleTween(e,NA(e,r,t),n).on("end.style."+e,null)}function CA(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function EA(e,t,n){var r,s;function i(){var o=t.apply(this,arguments);return o!==s&&(r=(s=o)&&CA(e,o,n)),r}return i._value=t,i}function MA(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,EA(e,t,n??""))}function _A(e){return function(){this.textContent=e}}function PA(e){return function(){var t=e(this);this.textContent=t??""}}function DA(e){return this.tween("text",typeof e=="function"?PA(Vm(this,"text",e)):_A(e==null?"":e+""))}function TA(e){return function(t){this.textContent=e.call(this,t)}}function OA(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&TA(s)),t}return r._value=e,r}function AA(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,OA(e))}function RA(){for(var e=this._name,t=this._id,n=C1(),r=this._groups,s=r.length,i=0;i<s;++i)for(var o=r[i],l=o.length,c,d=0;d<l;++d)if(c=o[d]){var f=$n(c,t);Nd(c,e,n,d,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new Er(r,this._parents,e,n)}function IA(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(i,o){var l={value:o},c={value:function(){--s===0&&i()}};n.each(function(){var d=ar(this,r),f=d.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),d.on=t}),s===0&&i()})}var zA=0;function Er(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function C1(){return++zA}var cr=Ho.prototype;Er.prototype={constructor:Er,select:gA,selectAll:yA,selectChild:cr.selectChild,selectChildren:cr.selectChildren,filter:dA,merge:uA,selection:wA,transition:RA,call:cr.call,nodes:cr.nodes,node:cr.node,size:cr.size,empty:cr.empty,each:cr.each,on:mA,attr:qO,attrTween:JO,style:SA,styleTween:MA,text:DA,textTween:AA,remove:xA,tween:BO,delay:nA,duration:aA,ease:oA,easeVarying:cA,end:IA,[Symbol.iterator]:cr[Symbol.iterator]};function $A(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var LA={time:null,delay:0,duration:250,ease:$A};function FA(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 BA(e){var t,n;e instanceof Er?(t=e._id,e=e._name):(t=C1(),(n=LA).time=Wm(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,i=0;i<s;++i)for(var o=r[i],l=o.length,c,d=0;d<l;++d)(c=o[d])&&Nd(c,e,t,d,o,n||FA(c,t));return new Er(r,this._parents,e,t)}Ho.prototype.interrupt=$O;Ho.prototype.transition=BA;const El=e=>()=>e;function WA(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function yr(e,t,n){this.k=e,this.x=t,this.y=n}yr.prototype={constructor:yr,scale:function(e){return e===1?this:new yr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new yr(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 jd=new yr(1,0,0);E1.prototype=yr.prototype;function E1(e){for(;!e.__zoom;)if(!(e=e.parentNode))return jd;return e.__zoom}function Du(e){e.stopImmediatePropagation()}function Ci(e){e.preventDefault(),e.stopImmediatePropagation()}function UA(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function VA(){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 zg(){return this.__zoom||jd}function HA(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function YA(){return navigator.maxTouchPoints||"ontouchstart"in this}function XA(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=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(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o))}function M1(){var e=UA,t=VA,n=XA,r=HA,s=YA,i=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Gl,d=vd("start","zoom","end"),f,u,h,m=500,w=150,y=0,b=10;function g(E){E.property("__zoom",zg).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",$).filter(s).on("touchstart.zoom",A).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(E,I,D,P){var C=E.selection?E.selection():E;C.property("__zoom",zg),E!==C?N(E,I,D,P):C.interrupt().each(function(){k(this,arguments).event(P).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},g.scaleBy=function(E,I,D,P){g.scaleTo(E,function(){var C=this.__zoom.k,_=typeof I=="function"?I.apply(this,arguments):I;return C*_},D,P)},g.scaleTo=function(E,I,D,P){g.transform(E,function(){var C=t.apply(this,arguments),_=this.__zoom,R=D==null?j(C):typeof D=="function"?D.apply(this,arguments):D,B=_.invert(R),T=typeof I=="function"?I.apply(this,arguments):I;return n(x(v(_,T),R,B),C,o)},D,P)},g.translateBy=function(E,I,D,P){g.transform(E,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),o)},null,P)},g.translateTo=function(E,I,D,P,C){g.transform(E,function(){var _=t.apply(this,arguments),R=this.__zoom,B=P==null?j(_):typeof P=="function"?P.apply(this,arguments):P;return n(jd.translate(B[0],B[1]).scale(R.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof D=="function"?-D.apply(this,arguments):-D),_,o)},P,C)};function v(E,I){return I=Math.max(i[0],Math.min(i[1],I)),I===E.k?E:new yr(I,E.x,E.y)}function x(E,I,D){var P=I[0]-D[0]*E.k,C=I[1]-D[1]*E.k;return P===E.x&&C===E.y?E:new yr(E.k,P,C)}function j(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function N(E,I,D,P){E.on("start.zoom",function(){k(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(P).end()}).tween("zoom",function(){var C=this,_=arguments,R=k(C,_).event(P),B=t.apply(C,_),T=D==null?j(B):typeof D=="function"?D.apply(C,_):D,F=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),H=C.__zoom,X=typeof I=="function"?I.apply(C,_):I,J=c(H.invert(T).concat(F/H.k),X.invert(T).concat(F/X.k));return function(ee){if(ee===1)ee=X;else{var K=J(ee),ne=F/K[2];ee=new yr(ne,T[0]-K[0]*ne,T[1]-K[1]*ne)}R.zoom(null,ee)}})}function k(E,I,D){return!D&&E.__zooming||new S(E,I)}function S(E,I){this.that=E,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,I),this.taps=0}S.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,I){return this.mouse&&E!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var I=nn(this.that).datum();d.call(E,this.that,new WA(E,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:d}),I)}};function M(E,...I){if(!e.apply(this,arguments))return;var D=k(this,I).event(E),P=this.__zoom,C=Math.max(i[0],Math.min(i[1],P.k*Math.pow(2,r.apply(this,arguments)))),_=Sn(E);if(D.wheel)(D.mouse[0][0]!==_[0]||D.mouse[0][1]!==_[1])&&(D.mouse[1]=P.invert(D.mouse[0]=_)),clearTimeout(D.wheel);else{if(P.k===C)return;D.mouse=[_,P.invert(_)],Zl(this),D.start()}Ci(E),D.wheel=setTimeout(R,w),D.zoom("mouse",n(x(v(P,C),D.mouse[0],D.mouse[1]),D.extent,o));function R(){D.wheel=null,D.end()}}function z(E,...I){if(h||!e.apply(this,arguments))return;var D=E.currentTarget,P=k(this,I,!0).event(E),C=nn(E.view).on("mousemove.zoom",T,!0).on("mouseup.zoom",F,!0),_=Sn(E,D),R=E.clientX,B=E.clientY;u1(E.view),Du(E),P.mouse=[_,this.__zoom.invert(_)],Zl(this),P.start();function T(H){if(Ci(H),!P.moved){var X=H.clientX-R,J=H.clientY-B;P.moved=X*X+J*J>y}P.event(H).zoom("mouse",n(x(P.that.__zoom,P.mouse[0]=Sn(H,D),P.mouse[1]),P.extent,o))}function F(H){C.on("mousemove.zoom mouseup.zoom",null),f1(H.view,P.moved),Ci(H),P.event(H).end()}}function $(E,...I){if(e.apply(this,arguments)){var D=this.__zoom,P=Sn(E.changedTouches?E.changedTouches[0]:E,this),C=D.invert(P),_=D.k*(E.shiftKey?.5:2),R=n(x(v(D,_),P,C),t.apply(this,I),o);Ci(E),l>0?nn(this).transition().duration(l).call(N,R,P,E):nn(this).call(g.transform,R,P,E)}}function A(E,...I){if(e.apply(this,arguments)){var D=E.touches,P=D.length,C=k(this,I,E.changedTouches.length===P).event(E),_,R,B,T;for(Du(E),R=0;R<P;++R)B=D[R],T=Sn(B,this),T=[T,this.__zoom.invert(T),B.identifier],C.touch0?!C.touch1&&C.touch0[2]!==T[2]&&(C.touch1=T,C.taps=0):(C.touch0=T,_=!0,C.taps=1+!!f);f&&(f=clearTimeout(f)),_&&(C.taps<2&&(u=T[0],f=setTimeout(function(){f=null},m)),Zl(this),C.start())}}function O(E,...I){if(this.__zooming){var D=k(this,I).event(E),P=E.changedTouches,C=P.length,_,R,B,T;for(Ci(E),_=0;_<C;++_)R=P[_],B=Sn(R,this),D.touch0&&D.touch0[2]===R.identifier?D.touch0[0]=B:D.touch1&&D.touch1[2]===R.identifier&&(D.touch1[0]=B);if(R=D.that.__zoom,D.touch1){var F=D.touch0[0],H=D.touch0[1],X=D.touch1[0],J=D.touch1[1],ee=(ee=X[0]-F[0])*ee+(ee=X[1]-F[1])*ee,K=(K=J[0]-H[0])*K+(K=J[1]-H[1])*K;R=v(R,Math.sqrt(ee/K)),B=[(F[0]+X[0])/2,(F[1]+X[1])/2],T=[(H[0]+J[0])/2,(H[1]+J[1])/2]}else if(D.touch0)B=D.touch0[0],T=D.touch0[1];else return;D.zoom("touch",n(x(R,B,T),D.extent,o))}}function L(E,...I){if(this.__zooming){var D=k(this,I).event(E),P=E.changedTouches,C=P.length,_,R;for(Du(E),h&&clearTimeout(h),h=setTimeout(function(){h=null},m),_=0;_<C;++_)R=P[_],D.touch0&&D.touch0[2]===R.identifier?delete D.touch0:D.touch1&&D.touch1[2]===R.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(R=Sn(R,this),Math.hypot(u[0]-R[0],u[1]-R[1])<b)){var B=nn(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return g.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:El(+E),g):r},g.filter=function(E){return arguments.length?(e=typeof E=="function"?E:El(!!E),g):e},g.touchable=function(E){return arguments.length?(s=typeof E=="function"?E:El(!!E),g):s},g.extent=function(E){return arguments.length?(t=typeof E=="function"?E:El([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),g):t},g.scaleExtent=function(E){return arguments.length?(i[0]=+E[0],i[1]=+E[1],g):[i[0],i[1]]},g.translateExtent=function(E){return arguments.length?(o[0][0]=+E[0][0],o[1][0]=+E[1][0],o[0][1]=+E[0][1],o[1][1]=+E[1][1],g):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},g.constrain=function(E){return arguments.length?(n=E,g):n},g.duration=function(E){return arguments.length?(l=+E,g):l},g.interpolate=function(E){return arguments.length?(c=E,g):c},g.on=function(){var E=d.on.apply(d,arguments);return E===d?g:E},g.clickDistance=function(E){return arguments.length?(y=(E=+E)*E,g):Math.sqrt(y)},g.tapDistance=function(E){return arguments.length?(b=+E,g):b},g}const nr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},No=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],_1=["Enter"," ","Escape"],P1={"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 Ga;(function(e){e.Strict="strict",e.Loose="loose"})(Ga||(Ga={}));var Os;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Os||(Os={}));var jo;(function(e){e.Partial="partial",e.Full="full"})(jo||(jo={}));const D1={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Br;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Br||(Br={}));var $c;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})($c||($c={}));var ye;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ye||(ye={}));const $g={[ye.Left]:ye.Right,[ye.Right]:ye.Left,[ye.Top]:ye.Bottom,[ye.Bottom]:ye.Top};function T1(e){return e===null?null:e?"valid":"invalid"}const O1=e=>"id"in e&&"source"in e&&"target"in e,qA=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Hm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Xo=(e,t=[0,0])=>{const{width:n,height:r}=_r(e),s=e.origin??t,i=n*s[0],o=r*s[1];return{x:e.position.x-i,y:e.position.y-o}},GA=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const i=typeof s=="string";let o=!t.nodeLookup&&!i?s:void 0;t.nodeLookup&&(o=i?t.nodeLookup.get(s):Hm(s)?s:t.nodeLookup.get(s.id));const l=o?Lc(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return kd(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Sd(n)},qo=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const s=Lc(r);n=kd(n,s)}}),Sd(n)},Ym=(e,t,[n,r,s]=[0,0,1],i=!1,o=!1)=>{const l={...Ko(t,[n,r,s]),width:t.width/s,height:t.height/s},c=[];for(const d of e.values()){const{measured:f,selectable:u=!0,hidden:h=!1}=d;if(o&&!u||h)continue;const m=f.width??d.width??d.initialWidth??null,w=f.height??d.height??d.initialHeight??null,y=ko(l,Qa(d)),b=(m??0)*(w??0),g=i&&y>0;(!d.internals.handleBounds||g||y>=b||d.dragging)&&c.push(d)}return c},KA=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function QA(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function ZA({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:i},o){if(e.size===0)return Promise.resolve(!0);const l=QA(e,o),c=qo(l),d=Xm(c,t,n,(o==null?void 0:o.minZoom)??s,(o==null?void 0:o.maxZoom)??i,(o==null?void 0:o.padding)??.1);return await r.setViewport(d,{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 A1({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:d}=l?l.internals.positionAbsolute:{x:0,y:0},f=o.origin??r;let u=o.extent||s;if(o.extent==="parent"&&!o.expandParent)if(!l)i==null||i("005",nr.error005());else{const m=l.measured.width,w=l.measured.height;m&&w&&(u=[[c,d],[c+m,d+w]])}else l&&Za(o.extent)&&(u=[[o.extent[0][0]+c,o.extent[0][1]+d],[o.extent[1][0]+c,o.extent[1][1]+d]]);const h=Za(u)?Xs(t,u,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(i==null||i("015",nr.error015())),{position:{x:h.x-c+(o.measured.width??0)*f[0],y:h.y-d+(o.measured.height??0)*f[1]},positionAbsolute:h}}async function JA({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const i=new Set(e.map(h=>h.id)),o=[];for(const h of n){if(h.deletable===!1)continue;const m=i.has(h.id),w=!m&&h.parentId&&o.find(y=>y.id===h.parentId);(m||w)&&o.push(h)}const l=new Set(t.map(h=>h.id)),c=r.filter(h=>h.deletable!==!1),f=KA(o,c);for(const h of c)l.has(h.id)&&!f.find(w=>w.id===h.id)&&f.push(h);if(!s)return{edges:f,nodes:o};const u=await s({nodes:o,edges:f});return typeof u=="boolean"?u?{edges:f,nodes:o}:{edges:[],nodes:[]}:u}const Ka=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Xs=(e={x:0,y:0},t,n)=>({x:Ka(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ka(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function R1(e,t,n){const{width:r,height:s}=_r(n),{x:i,y:o}=n.internals.positionAbsolute;return Xs(e,[[i,o],[i+r,o+s]],t)}const Lg=(e,t,n)=>e<t?Ka(Math.abs(e-t),1,t)/t:e>n?-Ka(Math.abs(e-n),1,t)/t:0,I1=(e,t,n=15,r=40)=>{const s=Lg(e.x,r,t.width-r)*n,i=Lg(e.y,r,t.height-r)*n;return[s,i]},kd=(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)}),ah=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Sd=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Qa=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=Hm(e)?e.internals.positionAbsolute:Xo(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Lc=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=Hm(e)?e.internals.positionAbsolute:Xo(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},z1=(e,t)=>Sd(kd(ah(e),ah(t))),ko=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Fg=e=>_n(e.width)&&_n(e.height)&&_n(e.x)&&_n(e.y),_n=e=>!isNaN(e)&&isFinite(e),eR=(e,t)=>{},Go=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Ko=({x:e,y:t},[n,r,s],i=!1,o=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return i?Go(l,o):l},Fc=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function aa(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 tR(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=aa(e,n),s=aa(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=aa(e.top??e.y??0,n),s=aa(e.bottom??e.y??0,n),i=aa(e.left??e.x??0,t),o=aa(e.right??e.x??0,t);return{top:r,right:o,bottom:s,left:i,x:i+o,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function nR(e,t,n,r,s,i){const{x:o,y:l}=Fc(e,[t,n,r]),{x:c,y:d}=Fc({x:e.x+e.width,y:e.y+e.height},[t,n,r]),f=s-c,u=i-d;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(f),bottom:Math.floor(u)}}const Xm=(e,t,n,r,s,i)=>{const o=tR(i,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,d=Math.min(l,c),f=Ka(d,r,s),u=e.x+e.width/2,h=e.y+e.height/2,m=t/2-u*f,w=n/2-h*f,y=nR(e,m,w,f,t,n),b={left:Math.min(y.left-o.left,0),top:Math.min(y.top-o.top,0),right:Math.min(y.right-o.right,0),bottom:Math.min(y.bottom-o.bottom,0)};return{x:m-b.left+b.right,y:w-b.top+b.bottom,zoom:f}},So=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Za(e){return e!=null&&e!=="parent"}function _r(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 $1(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 L1(e,t={width:0,height:0},n,r,s){const i={...e},o=r.get(n);if(o){const l=o.origin||s;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 Bg(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function rR(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function sR(e){return{...P1,...e||{}}}function Hi(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:i,y:o}=Pn(e),l=Ko({x:i-((s==null?void 0:s.left)??0),y:o-((s==null?void 0:s.top)??0)},r),{x:c,y:d}=n?Go(l,t):l;return{xSnapped:c,ySnapped:d,...l}}const qm=e=>({width:e.offsetWidth,height:e.offsetHeight}),F1=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},aR=["INPUT","SELECT","TEXTAREA"];function B1(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:aR.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const W1=e=>"clientX"in e,Pn=(e,t)=>{var i,o;const n=W1(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},Wg=(e,t,n,r,s)=>{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:s,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...qm(o)}})};function U1({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:o,targetControlY:l}){const c=e*.125+s*.375+o*.375+n*.125,d=t*.125+i*.375+l*.375+r*.125,f=Math.abs(c-e),u=Math.abs(d-t);return[c,d,f,u]}function Ml(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Ug({pos:e,x1:t,y1:n,x2:r,y2:s,c:i}){switch(e){case ye.Left:return[t-Ml(t-r,i),n];case ye.Right:return[t+Ml(r-t,i),n];case ye.Top:return[t,n-Ml(n-s,i)];case ye.Bottom:return[t,n+Ml(s-n,i)]}}function V1({sourceX:e,sourceY:t,sourcePosition:n=ye.Bottom,targetX:r,targetY:s,targetPosition:i=ye.Top,curvature:o=.25}){const[l,c]=Ug({pos:n,x1:e,y1:t,x2:r,y2:s,c:o}),[d,f]=Ug({pos:i,x1:r,y1:s,x2:e,y2:t,c:o}),[u,h,m,w]=U1({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:f});return[`M${e},${t} C${l},${c} ${d},${f} ${r},${s}`,u,h,m,w]}function H1({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,i=n<e?n+s:n-s,o=Math.abs(r-t)/2,l=r<t?r+o:r-o;return[i,l,s,o]}function iR({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r,elevateOnSelect:s=!1}){if(r!==void 0)return r;const i=s&&n?1e3:0,o=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return i+o}function oR({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const i=kd(Lc(e),Lc(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const o={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:r/s[2]};return ko(o,Sd(i))>0}const lR=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,cR=(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)),Y1=(e,t)=>{if(!e.source||!e.target)return t;let n;return O1(e)?n={...e}:n={...e,id:lR(e)},cR(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function X1({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,i,o,l]=H1({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,i,o,l]}const Vg={[ye.Left]:{x:-1,y:0},[ye.Right]:{x:1,y:0},[ye.Top]:{x:0,y:-1},[ye.Bottom]:{x:0,y:1}},dR=({source:e,sourcePosition:t=ye.Bottom,target:n})=>t===ye.Left||t===ye.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},Hg=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function uR({source:e,sourcePosition:t=ye.Bottom,target:n,targetPosition:r=ye.Top,center:s,offset:i,stepPosition:o}){const l=Vg[t],c=Vg[r],d={x:e.x+l.x*i,y:e.y+l.y*i},f={x:n.x+c.x*i,y:n.y+c.y*i},u=dR({source:d,sourcePosition:t,target:f}),h=u.x!==0?"x":"y",m=u[h];let w=[],y,b;const g={x:0,y:0},v={x:0,y:0},[,,x,j]=H1({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(y=s.x??d.x+(f.x-d.x)*o,b=s.y??(d.y+f.y)/2):(y=s.x??(d.x+f.x)/2,b=s.y??d.y+(f.y-d.y)*o);const k=[{x:y,y:d.y},{x:y,y:f.y}],S=[{x:d.x,y:b},{x:f.x,y:b}];l[h]===m?w=h==="x"?k:S:w=h==="x"?S:k}else{const k=[{x:d.x,y:f.y}],S=[{x:f.x,y:d.y}];if(h==="x"?w=l.x===m?S:k:w=l.y===m?k:S,t===r){const O=Math.abs(e[h]-n[h]);if(O<=i){const L=Math.min(i-1,i-O);l[h]===m?g[h]=(d[h]>e[h]?-1:1)*L:v[h]=(f[h]>n[h]?-1:1)*L}}if(t!==r){const O=h==="x"?"y":"x",L=l[h]===c[O],E=d[O]>f[O],I=d[O]<f[O];(l[h]===1&&(!L&&E||L&&I)||l[h]!==1&&(!L&&I||L&&E))&&(w=h==="x"?k:S)}const M={x:d.x+g.x,y:d.y+g.y},z={x:f.x+v.x,y:f.y+v.y},$=Math.max(Math.abs(M.x-w[0].x),Math.abs(z.x-w[0].x)),A=Math.max(Math.abs(M.y-w[0].y),Math.abs(z.y-w[0].y));$>=A?(y=(M.x+z.x)/2,b=w[0].y):(y=w[0].x,b=(M.y+z.y)/2)}return[[e,{x:d.x+g.x,y:d.y+g.y},...w,{x:f.x+v.x,y:f.y+v.y},n],y,b,x,j]}function fR(e,t,n,r){const s=Math.min(Hg(e,t)/2,Hg(t,n)/2,r),{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 d=e.x<n.x?-1:1,f=e.y<n.y?1:-1;return`L ${i+s*d},${o}Q ${i},${o} ${i},${o+s*f}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${o+s*c}Q ${i},${o} ${i+s*l},${o}`}function ih({sourceX:e,sourceY:t,sourcePosition:n=ye.Bottom,targetX:r,targetY:s,targetPosition:i=ye.Top,borderRadius:o=5,centerX:l,centerY:c,offset:d=20,stepPosition:f=.5}){const[u,h,m,w,y]=uR({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:i,center:{x:l,y:c},offset:d,stepPosition:f});return[u.reduce((g,v,x)=>{let j="";return x>0&&x<u.length-1?j=fR(u[x-1],v,u[x+1],o):j=`${x===0?"M":"L"}${v.x} ${v.y}`,g+=j,g},""),h,m,w,y]}function Yg(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function hR(e){var u;const{sourceNode:t,targetNode:n}=e;if(!Yg(t)||!Yg(n))return null;const r=t.internals.handleBounds||Xg(t.handles),s=n.internals.handleBounds||Xg(n.handles),i=qg((r==null?void 0:r.source)??[],e.sourceHandle),o=qg(e.connectionMode===Ga.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!i||!o)return(u=e.onError)==null||u.call(e,"008",nr.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||ye.Bottom,c=(o==null?void 0:o.position)||ye.Top,d=Co(t,i,l),f=Co(n,o,c);return{sourceX:d.x,sourceY:d.y,targetX:f.x,targetY:f.y,sourcePosition:l,targetPosition:c}}function Xg(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Co(e,t,n=ye.Left,r=!1){const s=((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??_r(e);if(r)return{x:s+o/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case ye.Top:return{x:s+o/2,y:i};case ye.Right:return{x:s+o,y:i+l/2};case ye.Bottom:return{x:s+o/2,y:i+l};case ye.Left:return{x:s,y:i+l/2}}}function qg(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function oh(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function mR(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((o,l)=>([l.markerStart||r,l.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const d=oh(c,t);i.has(d)||(o.push({id:d,color:c.color||n,...c}),i.add(d))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const Gm={nodeOrigin:[0,0],nodeExtent:No,elevateNodesOnSelect:!0,defaults:{}},pR={...Gm,checkEquality:!0};function Km(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function xR(e,t,n){const r=Km(Gm,n);for(const s of e.values())if(s.parentId)Qm(s,e,t,r);else{const i=Xo(s,r.nodeOrigin),o=Za(s.extent)?s.extent:r.nodeExtent,l=Xs(i,o,_r(s));s.internals.positionAbsolute=l}}function gR(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const s of e.handles){const i={width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(i):s.type==="target"&&r.push(i)}return{source:n,target:r}}function lh(e,t,n,r){var c,d;const s=Km(pR,r);let i=e.length>0;const o=new Map(t),l=s!=null&&s.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const f of e){let u=o.get(f.id);if(s.checkEquality&&f===(u==null?void 0:u.internals.userNode))t.set(f.id,u);else{const h=Xo(f,s.nodeOrigin),m=Za(f.extent)?f.extent:s.nodeExtent,w=Xs(h,m,_r(f));u={...s.defaults,...f,measured:{width:(c=f.measured)==null?void 0:c.width,height:(d=f.measured)==null?void 0:d.height},internals:{positionAbsolute:w,handleBounds:gR(f,u),z:q1(f,l),userNode:f}},t.set(f.id,u)}(u.measured===void 0||u.measured.width===void 0||u.measured.height===void 0)&&!u.hidden&&(i=!1),f.parentId&&Qm(u,t,n,r)}return i}function yR(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 Qm(e,t,n,r){const{elevateNodesOnSelect:s,nodeOrigin:i,nodeExtent:o}=Km(Gm,r),l=e.parentId,c=t.get(l);if(!c){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}yR(e,n);const d=s?1e3:0,{x:f,y:u,z:h}=vR(e,c,i,o,d),{positionAbsolute:m}=e.internals,w=f!==m.x||u!==m.y;(w||h!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:f,y:u}:m,z:h}})}function q1(e,t){return(_n(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function vR(e,t,n,r,s){const{x:i,y:o}=t.internals.positionAbsolute,l=_r(e),c=Xo(e,n),d=Za(e.extent)?Xs(c,e.extent,l):c;let f=Xs({x:i+d.x,y:o+d.y},r,l);e.extent==="parent"&&(f=R1(f,l,t));const u=q1(e,s),h=t.internals.z??0;return{x:f.x,y:f.y,z:h>=u?h+1:u}}function Zm(e,t,n,r=[0,0]){var o;const s=[],i=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const d=((o=i.get(l.parentId))==null?void 0:o.expandedRect)??Qa(c),f=z1(d,l.rect);i.set(l.parentId,{expandedRect:f,parent:c})}return i.size>0&&i.forEach(({expandedRect:l,parent:c},d)=>{var x;const f=c.internals.positionAbsolute,u=_r(c),h=c.origin??r,m=l.x<f.x?Math.round(Math.abs(f.x-l.x)):0,w=l.y<f.y?Math.round(Math.abs(f.y-l.y)):0,y=Math.max(u.width,Math.round(l.width)),b=Math.max(u.height,Math.round(l.height)),g=(y-u.width)*h[0],v=(b-u.height)*h[1];(m>0||w>0||g||v)&&(s.push({id:d,type:"position",position:{x:c.position.x-m+g,y:c.position.y-w+v}}),(x=n.get(d))==null||x.forEach(j=>{e.some(N=>N.id===j.id)||s.push({id:j.id,type:"position",position:{x:j.position.x+m,y:j.position.y+w}})})),(u.width<l.width||u.height<l.height||m||w)&&s.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:y+(m?h[0]*m-g:0),height:b+(w?h[1]*w-v:0)}})}),s}function wR(e,t,n,r,s,i){const o=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!o)return{changes:[],updatedInternals:l};const c=[],d=window.getComputedStyle(o),{m22:f}=new window.DOMMatrixReadOnly(d.transform),u=[];for(const h of e.values()){const m=t.get(h.id);if(!m)continue;if(m.hidden){t.set(m.id,{...m,internals:{...m.internals,handleBounds:void 0}}),l=!0;continue}const w=qm(h.nodeElement),y=m.measured.width!==w.width||m.measured.height!==w.height;if(!!(w.width&&w.height&&(y||!m.internals.handleBounds||h.force))){const g=h.nodeElement.getBoundingClientRect(),v=Za(m.extent)?m.extent:i;let{positionAbsolute:x}=m.internals;m.parentId&&m.extent==="parent"?x=R1(x,w,t.get(m.parentId)):v&&(x=Xs(x,v,w));const j={...m,measured:w,internals:{...m.internals,positionAbsolute:x,handleBounds:{source:Wg("source",h.nodeElement,g,f,m.id),target:Wg("target",h.nodeElement,g,f,m.id)}}};t.set(m.id,j),m.parentId&&Qm(j,t,n,{nodeOrigin:s}),l=!0,y&&(c.push({id:m.id,type:"dimensions",dimensions:w}),m.expandParent&&m.parentId&&u.push({id:m.id,parentId:m.parentId,rect:Qa(j,s)}))}}if(u.length>0){const h=Zm(u,t,n,s);c.push(...h)}return{changes:c,updatedInternals:l}}async function bR({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,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],[s,i]],r),l=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(l)}function Gg(e,t,n,r,s,i){let o=s;const l=r.get(o)||new Map;r.set(o,l.set(n,t)),o=`${s}-${e}`;const c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),i){o=`${s}-${e}-${i}`;const d=r.get(o)||new Map;r.set(o,d.set(n,t))}}function G1(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:i,sourceHandle:o=null,targetHandle:l=null}=r,c={edgeId:r.id,source:s,target:i,sourceHandle:o,targetHandle:l},d=`${s}-${o}--${i}-${l}`,f=`${i}-${l}--${s}-${o}`;Gg("source",c,f,e,s,o),Gg("target",c,d,e,i,l),t.set(r.id,r)}}function K1(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:K1(n,t):!1}function Kg(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function NR(e,t,n,r){const s=new Map;for(const[i,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!K1(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(i);l&&s.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 s}function Tu({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,c;const s=[];for(const[d,f]of t){const u=(o=n.get(d))==null?void 0:o.internals.userNode;u&&s.push({...u,position:f.position,dragging:r})}if(!e)return[s[0],s];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:r}:s[0],s]}function jR({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:n-s.distance.x,y:r-s.distance.y},o=Go(i,t);return{x:o.x-i.x,y:o.y-i.y}}function kR({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let i={x:null,y:null},o=0,l=new Map,c=!1,d={x:0,y:0},f=null,u=!1,h=null,m=!1,w=!1,y=null;function b({noDragClassName:v,handleSelector:x,domNode:j,isSelectable:N,nodeId:k,nodeClickDistance:S=0}){h=nn(j);function M({x:O,y:L}){const{nodeLookup:E,nodeExtent:I,snapGrid:D,snapToGrid:P,nodeOrigin:C,onNodeDrag:_,onSelectionDrag:R,onError:B,updateNodePositions:T}=t();i={x:O,y:L};let F=!1;const H=l.size>1,X=H&&I?ah(qo(l)):null,J=H&&P?jR({dragItems:l,snapGrid:D,x:O,y:L}):null;for(const[ee,K]of l){if(!E.has(ee))continue;let ne={x:O-K.distance.x,y:L-K.distance.y};P&&(ne=J?{x:Math.round(ne.x+J.x),y:Math.round(ne.y+J.y)}:Go(ne,D));let me=null;if(H&&I&&!K.extent&&X){const{positionAbsolute:Z}=K.internals,ae=Z.x-X.x+I[0][0],fe=Z.x+K.measured.width-X.x2+I[1][0],pe=Z.y-X.y+I[0][1],Se=Z.y+K.measured.height-X.y2+I[1][1];me=[[ae,pe],[fe,Se]]}const{position:W,positionAbsolute:Q}=A1({nodeId:ee,nextPosition:ne,nodeLookup:E,nodeExtent:me||I,nodeOrigin:C,onError:B});F=F||K.position.x!==W.x||K.position.y!==W.y,K.position=W,K.internals.positionAbsolute=Q}if(w=w||F,!!F&&(T(l,!0),y&&(r||_||!k&&R))){const[ee,K]=Tu({nodeId:k,dragItems:l,nodeLookup:E});r==null||r(y,l,ee,K),_==null||_(y,ee,K),k||R==null||R(y,K)}}async function z(){if(!f)return;const{transform:O,panBy:L,autoPanSpeed:E,autoPanOnNodeDrag:I}=t();if(!I){c=!1,cancelAnimationFrame(o);return}const[D,P]=I1(d,f,E);(D!==0||P!==0)&&(i.x=(i.x??0)-D/O[2],i.y=(i.y??0)-P/O[2],await L({x:D,y:P})&&M(i)),o=requestAnimationFrame(z)}function $(O){var H;const{nodeLookup:L,multiSelectionActive:E,nodesDraggable:I,transform:D,snapGrid:P,snapToGrid:C,selectNodesOnDrag:_,onNodeDragStart:R,onSelectionDragStart:B,unselectNodesAndEdges:T}=t();u=!0,(!_||!N)&&!E&&k&&((H=L.get(k))!=null&&H.selected||T()),N&&_&&k&&(e==null||e(k));const F=Hi(O.sourceEvent,{transform:D,snapGrid:P,snapToGrid:C,containerBounds:f});if(i=F,l=NR(L,I,F,k),l.size>0&&(n||R||!k&&B)){const[X,J]=Tu({nodeId:k,dragItems:l,nodeLookup:L});n==null||n(O.sourceEvent,l,X,J),R==null||R(O.sourceEvent,X,J),k||B==null||B(O.sourceEvent,J)}}const A=h1().clickDistance(S).on("start",O=>{const{domNode:L,nodeDragThreshold:E,transform:I,snapGrid:D,snapToGrid:P}=t();f=(L==null?void 0:L.getBoundingClientRect())||null,m=!1,w=!1,y=O.sourceEvent,E===0&&$(O),i=Hi(O.sourceEvent,{transform:I,snapGrid:D,snapToGrid:P,containerBounds:f}),d=Pn(O.sourceEvent,f)}).on("drag",O=>{const{autoPanOnNodeDrag:L,transform:E,snapGrid:I,snapToGrid:D,nodeDragThreshold:P,nodeLookup:C}=t(),_=Hi(O.sourceEvent,{transform:E,snapGrid:I,snapToGrid:D,containerBounds:f});if(y=O.sourceEvent,(O.sourceEvent.type==="touchmove"&&O.sourceEvent.touches.length>1||k&&!C.has(k))&&(m=!0),!m){if(!c&&L&&u&&(c=!0,z()),!u){const R=Pn(O.sourceEvent,f),B=R.x-d.x,T=R.y-d.y;Math.sqrt(B*B+T*T)>P&&$(O)}(i.x!==_.xSnapped||i.y!==_.ySnapped)&&l&&u&&(d=Pn(O.sourceEvent,f),M(_))}}).on("end",O=>{if(!(!u||m)&&(c=!1,u=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:L,updateNodePositions:E,onNodeDragStop:I,onSelectionDragStop:D}=t();if(w&&(E(l,!1),w=!1),s||I||!k&&D){const[P,C]=Tu({nodeId:k,dragItems:l,nodeLookup:L,dragging:!1});s==null||s(O.sourceEvent,l,P,C),I==null||I(O.sourceEvent,P,C),k||D==null||D(O.sourceEvent,C)}}}).filter(O=>{const L=O.target;return!O.button&&(!v||!Kg(L,`.${v}`,j))&&(!x||Kg(L,x,j))});h.call(A)}function g(){h==null||h.on(".drag",null)}return{update:b,destroy:g}}function SR(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())ko(s,Qa(i))>0&&r.push(i);return r}const CR=250;function ER(e,t,n,r){var l,c;let s=[],i=1/0;const o=SR(e,n,t+CR);for(const d of o){const f=[...((l=d.internals.handleBounds)==null?void 0:l.source)??[],...((c=d.internals.handleBounds)==null?void 0:c.target)??[]];for(const u of f){if(r.nodeId===u.nodeId&&r.type===u.type&&r.id===u.id)continue;const{x:h,y:m}=Co(d,u,u.position,!0),w=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(m-e.y,2));w>t||(w<i?(s=[{...u,x:h,y:m}],i=w):w===i&&s.push({...u,x:h,y:m}))}}if(!s.length)return null;if(s.length>1){const d=r.type==="source"?"target":"source";return s.find(f=>f.type===d)??s[0]}return s[0]}function Q1(e,t,n,r,s,i=!1){var d,f,u;const o=r.get(e);if(!o)return null;const l=s==="strict"?(d=o.internals.handleBounds)==null?void 0:d[t]:[...((f=o.internals.handleBounds)==null?void 0:f.source)??[],...((u=o.internals.handleBounds)==null?void 0:u.target)??[]],c=(n?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&i?{...c,...Co(o,c,c.position,!0)}:c}function Z1(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function MR(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const J1=()=>!0;function _R(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:o,domNode:l,nodeLookup:c,lib:d,autoPanOnConnect:f,flowId:u,panBy:h,cancelConnection:m,onConnectStart:w,onConnect:y,onConnectEnd:b,isValidConnection:g=J1,onReconnectEnd:v,updateConnection:x,getTransform:j,getFromHandle:N,autoPanSpeed:k,dragThreshold:S=1,handleDomNode:M}){const z=F1(e.target);let $=0,A;const{x:O,y:L}=Pn(e),E=Z1(i,M),I=l==null?void 0:l.getBoundingClientRect();let D=!1;if(!I||!E)return;const P=Q1(s,E,r,c,t);if(!P)return;let C=Pn(e,I),_=!1,R=null,B=!1,T=null;function F(){if(!f||!I)return;const[W,Q]=I1(C,I,k);h({x:W,y:Q}),$=requestAnimationFrame(F)}const H={...P,nodeId:s,type:E,position:P.position},X=c.get(s);let ee={inProgress:!0,isValid:null,from:Co(X,H,ye.Left,!0),fromHandle:H,fromPosition:H.position,fromNode:X,to:C,toHandle:null,toPosition:$g[H.position],toNode:null};function K(){D=!0,x(ee),w==null||w(e,{nodeId:s,handleId:r,handleType:E})}S===0&&K();function ne(W){if(!D){const{x:fe,y:pe}=Pn(W),Se=fe-O,Xe=pe-L;if(!(Se*Se+Xe*Xe>S*S))return;K()}if(!N()||!H){me(W);return}const Q=j();C=Pn(W,I),A=ER(Ko(C,Q,!1,[1,1]),n,c,H),_||(F(),_=!0);const Z=eN(W,{handle:A,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:o?"target":"source",isValidConnection:g,doc:z,lib:d,flowId:u,nodeLookup:c});T=Z.handleDomNode,R=Z.connection,B=MR(!!A,Z.isValid);const ae={...ee,isValid:B,to:Z.toHandle&&B?Fc({x:Z.toHandle.x,y:Z.toHandle.y},Q):C,toHandle:Z.toHandle,toPosition:B&&Z.toHandle?Z.toHandle.position:$g[H.position],toNode:Z.toHandle?c.get(Z.toHandle.nodeId):null};B&&A&&ee.toHandle&&ae.toHandle&&ee.toHandle.type===ae.toHandle.type&&ee.toHandle.nodeId===ae.toHandle.nodeId&&ee.toHandle.id===ae.toHandle.id&&ee.to.x===ae.to.x&&ee.to.y===ae.to.y||(x(ae),ee=ae)}function me(W){if(!("touches"in W&&W.touches.length>0)){if(D){(A||T)&&R&&B&&(y==null||y(R));const{inProgress:Q,...Z}=ee,ae={...Z,toPosition:ee.toHandle?ee.toPosition:null};b==null||b(W,ae),i&&(v==null||v(W,ae))}m(),cancelAnimationFrame($),_=!1,B=!1,R=null,T=null,z.removeEventListener("mousemove",ne),z.removeEventListener("mouseup",me),z.removeEventListener("touchmove",ne),z.removeEventListener("touchend",me)}}z.addEventListener("mousemove",ne),z.addEventListener("mouseup",me),z.addEventListener("touchmove",ne),z.addEventListener("touchend",me)}function eN(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:i,doc:o,lib:l,flowId:c,isValidConnection:d=J1,nodeLookup:f}){const u=i==="target",h=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:m,y:w}=Pn(e),y=o.elementFromPoint(m,w),b=y!=null&&y.classList.contains(`${l}-flow__handle`)?y:h,g={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const v=Z1(void 0,b),x=b.getAttribute("data-nodeid"),j=b.getAttribute("data-handleid"),N=b.classList.contains("connectable"),k=b.classList.contains("connectableend");if(!x||!v)return g;const S={source:u?x:r,sourceHandle:u?j:s,target:u?r:x,targetHandle:u?s:j};g.connection=S;const z=N&&k&&(n===Ga.Strict?u&&v==="source"||!u&&v==="target":x!==r||j!==s);g.isValid=z&&d(S),g.toHandle=Q1(x,v,j,f,n,!0)}return g}const ch={onPointerDown:_R,isValid:eN};function PR({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=nn(e);function i({translateExtent:l,width:c,height:d,zoomStep:f=1,pannable:u=!0,zoomable:h=!0,inversePan:m=!1}){const w=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const j=n(),N=x.sourceEvent.ctrlKey&&So()?10:1,k=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*f,S=j[2]*Math.pow(2,k*N);t.scaleTo(S)};let y=[0,0];const b=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(y=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},g=x=>{const j=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const N=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],k=[N[0]-y[0],N[1]-y[1]];y=N;const S=r()*Math.max(j[2],Math.log(j[2]))*(m?-1:1),M={x:j[0]-k[0]*S,y:j[1]-k[1]*S},z=[[0,0],[c,d]];t.setViewportConstrained({x:M.x,y:M.y,zoom:j[2]},z,l)},v=M1().on("start",b).on("zoom",u?g:null).on("zoom.wheel",h?w:null);s.call(v,{})}function o(){s.on("zoom",null)}return{update:i,destroy:o,pointer:Sn}}const DR=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Cd=e=>({x:e.x,y:e.y,zoom:e.k}),Ou=({x:e,y:t,zoom:n})=>jd.translate(e,t).scale(n),ba=(e,t)=>e.target.closest(`.${t}`),tN=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),TR=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Au=(e,t=0,n=TR,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},nN=e=>{const t=e.ctrlKey&&So()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function OR({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:d}){return f=>{if(ba(f,t))return!1;f.preventDefault(),f.stopImmediatePropagation();const u=n.property("__zoom").k||1;if(f.ctrlKey&&o){const b=Sn(f),g=nN(f),v=u*Math.pow(2,g);r.scaleTo(n,v,b,f);return}const h=f.deltaMode===1?20:1;let m=s===Os.Vertical?0:f.deltaX*h,w=s===Os.Horizontal?0:f.deltaY*h;!So()&&f.shiftKey&&s!==Os.Vertical&&(m=f.deltaY*h,w=0),r.translateBy(n,-(m/u)*i,-(w/u)*i,{internal:!0});const y=Cd(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(f,y)),e.isPanScrolling&&(c==null||c(f,y),e.panScrollTimeout=setTimeout(()=>{d==null||d(f,y),e.isPanScrolling=!1},150))}}function AR({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const i=r.type==="wheel",o=!t&&i&&!r.ctrlKey,l=ba(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,s)}}function RR({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,o,l;if((i=r.sourceEvent)!=null&&i.internal)return;const s=Cd(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function IR({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return i=>{var o,l;e.usedRightMouseButton=!!(n&&tN(t,e.mouseButton??0)),(o=i.sourceEvent)!=null&&o.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((l=i.sourceEvent)!=null&&l.internal)&&(s==null||s(i.sourceEvent,Cd(i.transform)))}}function zR({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&tN(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&i(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),s&&DR(e.prevViewport,o.transform))){const c=Cd(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(o.sourceEvent,c)},n?150:0)}}}function $R({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:d,connectionInProgress:f}){return u=>{var b;const h=e||t,m=n&&u.ctrlKey,w=u.type==="wheel";if(u.button===1&&u.type==="mousedown"&&(ba(u,`${d}-flow__node`)||ba(u,`${d}-flow__edge`)))return!0;if(!r&&!h&&!s&&!i&&!n||o||f&&!w||ba(u,l)&&w||ba(u,c)&&(!w||s&&w&&!e)||!n&&u.ctrlKey&&w)return!1;if(!n&&u.type==="touchstart"&&((b=u.touches)==null?void 0:b.length)>1)return u.preventDefault(),!1;if(!h&&!s&&!m&&w||!r&&(u.type==="mousedown"||u.type==="touchstart")||Array.isArray(r)&&!r.includes(u.button)&&u.type==="mousedown")return!1;const y=Array.isArray(r)&&r.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||w)&&y}}function LR({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:s,viewport:i,onPanZoom:o,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:d}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),h=M1().clickDistance(!_n(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(s),m=nn(e).call(h);x({x:i.x,y:i.y,zoom:Ka(i.zoom,t,n)},[[0,0],[u.width,u.height]],s);const w=m.on("wheel.zoom"),y=m.on("dblclick.zoom");h.wheelDelta(nN);function b(O,L){return m?new Promise(E=>{h==null||h.interpolate((L==null?void 0:L.interpolate)==="linear"?Vi:Gl).transform(Au(m,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>E(!0)),O)}):Promise.resolve(!1)}function g({noWheelClassName:O,noPanClassName:L,onPaneContextMenu:E,userSelectionActive:I,panOnScroll:D,panOnDrag:P,panOnScrollMode:C,panOnScrollSpeed:_,preventScrolling:R,zoomOnPinch:B,zoomOnScroll:T,zoomOnDoubleClick:F,zoomActivationKeyPressed:H,lib:X,onTransformChange:J,connectionInProgress:ee}){I&&!f.isZoomingOrPanning&&v();const ne=D&&!H&&!I?OR({zoomPanValues:f,noWheelClassName:O,d3Selection:m,d3Zoom:h,panOnScrollMode:C,panOnScrollSpeed:_,zoomOnPinch:B,onPanZoomStart:l,onPanZoom:o,onPanZoomEnd:c}):AR({noWheelClassName:O,preventScrolling:R,d3ZoomHandler:w});if(m.on("wheel.zoom",ne,{passive:!1}),!I){const W=RR({zoomPanValues:f,onDraggingChange:d,onPanZoomStart:l});h.on("start",W);const Q=IR({zoomPanValues:f,panOnDrag:P,onPaneContextMenu:!!E,onPanZoom:o,onTransformChange:J});h.on("zoom",Q);const Z=zR({zoomPanValues:f,panOnDrag:P,panOnScroll:D,onPaneContextMenu:E,onPanZoomEnd:c,onDraggingChange:d});h.on("end",Z)}const me=$R({zoomActivationKeyPressed:H,panOnDrag:P,zoomOnScroll:T,panOnScroll:D,zoomOnDoubleClick:F,zoomOnPinch:B,userSelectionActive:I,noPanClassName:L,noWheelClassName:O,lib:X,connectionInProgress:ee});h.filter(me),F?m.on("dblclick.zoom",y):m.on("dblclick.zoom",null)}function v(){h.on("zoom",null)}async function x(O,L,E){const I=Ou(O),D=h==null?void 0:h.constrain()(I,L,E);return D&&await b(D),new Promise(P=>P(D))}async function j(O,L){const E=Ou(O);return await b(E,L),new Promise(I=>I(E))}function N(O){if(m){const L=Ou(O),E=m.property("__zoom");(E.k!==O.zoom||E.x!==O.x||E.y!==O.y)&&(h==null||h.transform(m,L,null,{sync:!0}))}}function k(){const O=m?E1(m.node()):{x:0,y:0,k:1};return{x:O.x,y:O.y,zoom:O.k}}function S(O,L){return m?new Promise(E=>{h==null||h.interpolate((L==null?void 0:L.interpolate)==="linear"?Vi:Gl).scaleTo(Au(m,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>E(!0)),O)}):Promise.resolve(!1)}function M(O,L){return m?new Promise(E=>{h==null||h.interpolate((L==null?void 0:L.interpolate)==="linear"?Vi:Gl).scaleBy(Au(m,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>E(!0)),O)}):Promise.resolve(!1)}function z(O){h==null||h.scaleExtent(O)}function $(O){h==null||h.translateExtent(O)}function A(O){const L=!_n(O)||O<0?0:O;h==null||h.clickDistance(L)}return{update:g,destroy:v,setViewport:j,setViewportConstrained:x,getViewport:k,scaleTo:S,scaleBy:M,setScaleExtent:z,setTranslateExtent:$,syncViewport:N,setClickDistance:A}}var Ja;(function(e){e.Line="line",e.Handle="handle"})(Ja||(Ja={}));function FR({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:i}){const o=e-t,l=n-r,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&s&&(c[0]=c[0]*-1),l&&i&&(c[1]=c[1]*-1),c}function BR(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function Ar(e,t){return Math.max(0,t-e)}function Rr(e,t){return Math.max(0,e-t)}function _l(e,t,n){return Math.max(0,t-e,e-n)}function Qg(e,t){return e?!t:t}function WR(e,t,n,r,s,i,o,l){let{affectsX:c,affectsY:d}=t;const{isHorizontal:f,isVertical:u}=t,h=f&&u,{xSnapped:m,ySnapped:w}=n,{minWidth:y,maxWidth:b,minHeight:g,maxHeight:v}=r,{x,y:j,width:N,height:k,aspectRatio:S}=e;let M=Math.floor(f?m-e.pointerX:0),z=Math.floor(u?w-e.pointerY:0);const $=N+(c?-M:M),A=k+(d?-z:z),O=-i[0]*N,L=-i[1]*k;let E=_l($,y,b),I=_l(A,g,v);if(o){let C=0,_=0;c&&M<0?C=Ar(x+M+O,o[0][0]):!c&&M>0&&(C=Rr(x+$+O,o[1][0])),d&&z<0?_=Ar(j+z+L,o[0][1]):!d&&z>0&&(_=Rr(j+A+L,o[1][1])),E=Math.max(E,C),I=Math.max(I,_)}if(l){let C=0,_=0;c&&M>0?C=Rr(x+M,l[0][0]):!c&&M<0&&(C=Ar(x+$,l[1][0])),d&&z>0?_=Rr(j+z,l[0][1]):!d&&z<0&&(_=Ar(j+A,l[1][1])),E=Math.max(E,C),I=Math.max(I,_)}if(s){if(f){const C=_l($/S,g,v)*S;if(E=Math.max(E,C),o){let _=0;!c&&!d||c&&!d&&h?_=Rr(j+L+$/S,o[1][1])*S:_=Ar(j+L+(c?M:-M)/S,o[0][1])*S,E=Math.max(E,_)}if(l){let _=0;!c&&!d||c&&!d&&h?_=Ar(j+$/S,l[1][1])*S:_=Rr(j+(c?M:-M)/S,l[0][1])*S,E=Math.max(E,_)}}if(u){const C=_l(A*S,y,b)/S;if(I=Math.max(I,C),o){let _=0;!c&&!d||d&&!c&&h?_=Rr(x+A*S+O,o[1][0])/S:_=Ar(x+(d?z:-z)*S+O,o[0][0])/S,I=Math.max(I,_)}if(l){let _=0;!c&&!d||d&&!c&&h?_=Ar(x+A*S,l[1][0])/S:_=Rr(x+(d?z:-z)*S,l[0][0])/S,I=Math.max(I,_)}}}z=z+(z<0?I:-I),M=M+(M<0?E:-E),s&&(h?$>A*S?z=(Qg(c,d)?-M:M)/S:M=(Qg(c,d)?-z:z)*S:f?(z=M/S,d=c):(M=z*S,c=d));const D=c?x+M:x,P=d?j+z:j;return{width:N+(c?-M:M),height:k+(d?-z:z),x:i[0]*M*(c?-1:1)+D,y:i[1]*z*(d?-1:1)+P}}const rN={width:0,height:0,x:0,y:0},UR={...rN,pointerX:0,pointerY:0,aspectRatio:1};function VR(e){return[[0,0],[e.measured.width,e.measured.height]]}function HR(e,t,n){const r=t.position.x+e.position.x,s=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[[r-l,s-c],[r+i-l,s+o-c]]}function YR({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const i=nn(e);function o({controlPosition:c,boundaries:d,keepAspectRatio:f,resizeDirection:u,onResizeStart:h,onResize:m,onResizeEnd:w,shouldResize:y}){let b={...rN},g={...UR};const v=BR(c);let x,j=null,N=[],k,S,M,z=!1;const $=h1().on("start",A=>{const{nodeLookup:O,transform:L,snapGrid:E,snapToGrid:I,nodeOrigin:D,paneDomNode:P}=n();if(x=O.get(t),!x)return;j=(P==null?void 0:P.getBoundingClientRect())??null;const{xSnapped:C,ySnapped:_}=Hi(A.sourceEvent,{transform:L,snapGrid:E,snapToGrid:I,containerBounds:j});b={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},g={...b,pointerX:C,pointerY:_,aspectRatio:b.width/b.height},k=void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(k=O.get(x.parentId),S=k&&x.extent==="parent"?VR(k):void 0),N=[],M=void 0;for(const[R,B]of O)if(B.parentId===t&&(N.push({id:R,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const T=HR(B,x,B.origin??D);M?M=[[Math.min(T[0][0],M[0][0]),Math.min(T[0][1],M[0][1])],[Math.max(T[1][0],M[1][0]),Math.max(T[1][1],M[1][1])]]:M=T}h==null||h(A,{...b})}).on("drag",A=>{const{transform:O,snapGrid:L,snapToGrid:E,nodeOrigin:I}=n(),D=Hi(A.sourceEvent,{transform:O,snapGrid:L,snapToGrid:E,containerBounds:j}),P=[];if(!x)return;const{x:C,y:_,width:R,height:B}=b,T={},F=x.origin??I,{width:H,height:X,x:J,y:ee}=WR(g,v,D,d,f,F,S,M),K=H!==R,ne=X!==B,me=J!==C&&K,W=ee!==_&≠if(!me&&!W&&!K&&!ne)return;if((me||W||F[0]===1||F[1]===1)&&(T.x=me?J:b.x,T.y=W?ee:b.y,b.x=T.x,b.y=T.y,N.length>0)){const fe=J-C,pe=ee-_;for(const Se of N)Se.position={x:Se.position.x-fe+F[0]*(H-R),y:Se.position.y-pe+F[1]*(X-B)},P.push(Se)}if((K||ne)&&(T.width=K&&(!u||u==="horizontal")?H:b.width,T.height=ne&&(!u||u==="vertical")?X:b.height,b.width=T.width,b.height=T.height),k&&x.expandParent){const fe=F[0]*(T.width??0);T.x&&T.x<fe&&(b.x=fe,g.x=g.x-(T.x-fe));const pe=F[1]*(T.height??0);T.y&&T.y<pe&&(b.y=pe,g.y=g.y-(T.y-pe))}const Q=FR({width:b.width,prevWidth:R,height:b.height,prevHeight:B,affectsX:v.affectsX,affectsY:v.affectsY}),Z={...b,direction:Q};(y==null?void 0:y(A,Z))!==!1&&(z=!0,m==null||m(A,Z),r(T,P))}).on("end",A=>{z&&(w==null||w(A,{...b}),s==null||s({...b}),z=!1)});i.call($)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}var sN={exports:{}},aN={},iN={exports:{}},oN={};/**
|
|
384
|
+
* @license React
|
|
385
|
+
* use-sync-external-store-shim.production.js
|
|
386
|
+
*
|
|
387
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
388
|
+
*
|
|
389
|
+
* This source code is licensed under the MIT license found in the
|
|
390
|
+
* LICENSE file in the root directory of this source tree.
|
|
391
|
+
*/var ei=p;function XR(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qR=typeof Object.is=="function"?Object.is:XR,GR=ei.useState,KR=ei.useEffect,QR=ei.useLayoutEffect,ZR=ei.useDebugValue;function JR(e,t){var n=t(),r=GR({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return QR(function(){s.value=n,s.getSnapshot=t,Ru(s)&&i({inst:s})},[e,n,t]),KR(function(){return Ru(s)&&i({inst:s}),e(function(){Ru(s)&&i({inst:s})})},[e]),ZR(n),n}function Ru(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!qR(e,n)}catch{return!0}}function eI(e,t){return t()}var tI=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?eI:JR;oN.useSyncExternalStore=ei.useSyncExternalStore!==void 0?ei.useSyncExternalStore:tI;iN.exports=oN;var nI=iN.exports;/**
|
|
392
|
+
* @license React
|
|
393
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
394
|
+
*
|
|
395
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
396
|
+
*
|
|
397
|
+
* This source code is licensed under the MIT license found in the
|
|
398
|
+
* LICENSE file in the root directory of this source tree.
|
|
399
|
+
*/var Ed=p,rI=nI;function sI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var aI=typeof Object.is=="function"?Object.is:sI,iI=rI.useSyncExternalStore,oI=Ed.useRef,lI=Ed.useEffect,cI=Ed.useMemo,dI=Ed.useDebugValue;aN.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=oI(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=cI(function(){function c(m){if(!d){if(d=!0,f=m,m=r(m),s!==void 0&&o.hasValue){var w=o.value;if(s(w,m))return u=w}return u=m}if(w=u,aI(f,m))return w;var y=r(m);return s!==void 0&&s(w,y)?(f=m,w):(f=m,u=y)}var d=!1,f,u,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,s]);var l=iI(e,i[0],i[1]);return lI(function(){o.hasValue=!0,o.value=l},[l]),dI(l),l};sN.exports=aN;var uI=sN.exports;const fI=mh(uI),hI={},Zg=e=>{let t;const n=new Set,r=(f,u)=>{const h=typeof f=="function"?f(t):f;if(!Object.is(h,t)){const m=t;t=u??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(w=>w(t,m))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>d,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(hI?"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()}},d=t=e(r,s,c);return c},mI=e=>e?Zg(e):Zg,{useDebugValue:pI}=Y,{useSyncExternalStoreWithSelector:xI}=fI,gI=e=>e;function lN(e,t=gI,n){const r=xI(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return pI(r),r}const Jg=(e,t)=>{const n=mI(e),r=(s,i=t)=>lN(n,s,i);return Object.assign(r,n),r},yI=(e,t)=>e?Jg(e,t):Jg;function st(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Md=p.createContext(null),vI=Md.Provider,cN=nr.error001();function _e(e,t){const n=p.useContext(Md);if(n===null)throw new Error(cN);return lN(n,e,t)}function Ke(){const e=p.useContext(Md);if(e===null)throw new Error(cN);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const e0={display:"none"},wI={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},dN="react-flow__node-desc",uN="react-flow__edge-desc",bI="react-flow__aria-live",NI=e=>e.ariaLiveMessage,jI=e=>e.ariaLabelConfig;function kI({rfId:e}){const t=_e(NI);return a.jsx("div",{id:`${bI}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:wI,children:t})}function SI({rfId:e,disableKeyboardA11y:t}){const n=_e(jI);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${dN}-${e}`,style:e0,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${uN}-${e}`,style:e0,children:n["edge.a11yDescription.default"]}),!t&&a.jsx(kI,{rfId:e})]})}const _d=p.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},i)=>{const o=`${e}`.split("-");return a.jsx("div",{className:pt(["react-flow__panel",n,...o]),style:r,ref:i,...s,children:t})});_d.displayName="Panel";function CI({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:a.jsx(_d,{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 EI=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Pl=e=>e.id;function MI(e,t){return st(e.selectedNodes.map(Pl),t.selectedNodes.map(Pl))&&st(e.selectedEdges.map(Pl),t.selectedEdges.map(Pl))}function _I({onSelectionChange:e}){const t=Ke(),{selectedNodes:n,selectedEdges:r}=_e(EI,MI);return p.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[n,r,e]),null}const PI=e=>!!e.onSelectionChangeHandlers;function DI({onSelectionChange:e}){const t=_e(PI);return e||t?a.jsx(_I,{onSelectionChange:e}):null}const fN=[0,0],TI={x:0,y:0,zoom:1},OI=["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","paneClickDistance","ariaLabelConfig"],t0=[...OI,"rfId"],AI=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,setPaneClickDistance:e.setPaneClickDistance}),n0={translateExtent:No,nodeOrigin:fN,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function RI(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c,setPaneClickDistance:d}=_e(AI,st),f=Ke();p.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=n0,l()}),[]);const u=p.useRef(n0);return p.useEffect(()=>{for(const h of t0){const m=e[h],w=u.current[h];m!==w&&(typeof e[h]>"u"||(h==="nodes"?t(m):h==="edges"?n(m):h==="minZoom"?r(m):h==="maxZoom"?s(m):h==="translateExtent"?i(m):h==="nodeExtent"?o(m):h==="paneClickDistance"?d(m):h==="ariaLabelConfig"?f.setState({ariaLabelConfig:sR(m)}):h==="fitView"?f.setState({fitViewQueued:m}):h==="fitViewOptions"?f.setState({fitViewOptions:m}):f.setState({[h]:m})))}u.current=e},t0.map(h=>e[h])),null}function r0(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function II(e){var r;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const s=r0(),i=()=>n(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),t!==null?t:(r=r0())!=null&&r.matches?"dark":"light"}const s0=typeof document<"u"?document:null;function Eo(e=null,t={target:s0,actInsideInputWithModifier:!0}){const[n,r]=p.useState(!1),s=p.useRef(!1),i=p.useRef(new Set([])),[o,l]=p.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(u=>typeof u=="string").map(u=>u.replace("+",`
|
|
400
|
+
`).replace(`
|
|
401
|
+
|
|
402
|
+
`,`
|
|
403
|
+
+`).split(`
|
|
404
|
+
`)),f=d.reduce((u,h)=>u.concat(...h),[]);return[d,f]}return[[],[]]},[e]);return p.useEffect(()=>{const c=(t==null?void 0:t.target)??s0,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const f=m=>{var b,g;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!d)&&B1(m))return!1;const y=i0(m.code,l);if(i.current.add(m[y]),a0(o,i.current,!1)){const v=((g=(b=m.composedPath)==null?void 0:b.call(m))==null?void 0:g[0])||m.target,x=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";t.preventDefault!==!1&&(s.current||!x)&&m.preventDefault(),r(!0)}},u=m=>{const w=i0(m.code,l);a0(o,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[w]),m.key==="Meta"&&i.current.clear(),s.current=!1},h=()=>{i.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",f),c==null||c.addEventListener("keyup",u),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",f),c==null||c.removeEventListener("keyup",u),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}function a0(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function i0(e,t){return t.includes(e)?"code":"key"}const zI=()=>{const e=Ke();return p.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,i],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:i,maxZoom:o,panZoom:l}=e.getState(),c=Xm(t,r,s,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:r,snapGrid:s,snapToGrid:i,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),d={x:t.x-l,y:t.y-c},f=n.snapGrid??s,u=n.snapToGrid??i;return Ko(d,r,u,f)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:i}=r.getBoundingClientRect(),o=Fc(t,n);return{x:o.x+s,y:o.y+i}}}),[])};function hN(e,t){const n=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const o=r.get(i.id);o?o.push(i):r.set(i.id,[i])}for(const i of t){const o=r.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)$I(c,l);n.push(l)}return s.length&&s.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function $I(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 mN(e,t){return hN(e,t)}function pN(e,t){return hN(e,t)}function bs(e,t){return{id:e,type:"select",selected:t}}function Na(e,t=new Set,n=!1){const r=[];for(const[s,i]of e){const o=t.has(s);!(i.selected===void 0&&!o)&&i.selected!==o&&(n&&(i.selected=o),r.push(bs(i.id,o)))}return r}function o0({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,o]of e.entries()){const l=t.get(o.id),c=((s=l==null?void 0:l.internals)==null?void 0:s.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)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function l0(e){return{id:e.id,type:"remove"}}const c0=e=>qA(e),LI=e=>O1(e);function xN(e){return p.forwardRef(e)}const FI=typeof window<"u"?p.useLayoutEffect:p.useEffect;function d0(e){const[t,n]=p.useState(BigInt(0)),[r]=p.useState(()=>BI(()=>n(s=>s+BigInt(1))));return FI(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function BI(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const gN=p.createContext(null);function WI({children:e}){const t=Ke(),n=p.useCallback(l=>{const{nodes:c=[],setNodes:d,hasDefaultNodes:f,onNodesChange:u,nodeLookup:h,fitViewQueued:m}=t.getState();let w=c;for(const b of l)w=typeof b=="function"?b(w):b;const y=o0({items:w,lookup:h});f&&d(w),y.length>0?u==null||u(y):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:g,setNodes:v}=t.getState();b&&v(g)})},[]),r=d0(n),s=p.useCallback(l=>{const{edges:c=[],setEdges:d,hasDefaultEdges:f,onEdgesChange:u,edgeLookup:h}=t.getState();let m=c;for(const w of l)m=typeof w=="function"?w(m):w;f?d(m):u&&u(o0({items:m,lookup:h}))},[]),i=d0(s),o=p.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return a.jsx(gN.Provider,{value:o,children:e})}function UI(){const e=p.useContext(gN);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const VI=e=>!!e.panZoom;function Jm(){const e=zI(),t=Ke(),n=UI(),r=_e(VI),s=p.useMemo(()=>{const i=u=>t.getState().nodeLookup.get(u),o=u=>{n.nodeQueue.push(u)},l=u=>{n.edgeQueue.push(u)},c=u=>{var g,v;const{nodeLookup:h,nodeOrigin:m}=t.getState(),w=c0(u)?u:h.get(u.id),y=w.parentId?L1(w.position,w.measured,w.parentId,h,m):w.position,b={...w,position:y,width:((g=w.measured)==null?void 0:g.width)??w.width,height:((v=w.measured)==null?void 0:v.height)??w.height};return Qa(b)},d=(u,h,m={replace:!1})=>{o(w=>w.map(y=>{if(y.id===u){const b=typeof h=="function"?h(y):h;return m.replace&&c0(b)?b:{...y,...b}}return y}))},f=(u,h,m={replace:!1})=>{l(w=>w.map(y=>{if(y.id===u){const b=typeof h=="function"?h(y):h;return m.replace&&LI(b)?b:{...y,...b}}return y}))};return{getNodes:()=>t.getState().nodes.map(u=>({...u})),getNode:u=>{var h;return(h=i(u))==null?void 0:h.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:u=[]}=t.getState();return u.map(h=>({...h}))},getEdge:u=>t.getState().edgeLookup.get(u),setNodes:o,setEdges:l,addNodes:u=>{const h=Array.isArray(u)?u:[u];n.nodeQueue.push(m=>[...m,...h])},addEdges:u=>{const h=Array.isArray(u)?u:[u];n.edgeQueue.push(m=>[...m,...h])},toObject:()=>{const{nodes:u=[],edges:h=[],transform:m}=t.getState(),[w,y,b]=m;return{nodes:u.map(g=>({...g})),edges:h.map(g=>({...g})),viewport:{x:w,y,zoom:b}}},deleteElements:async({nodes:u=[],edges:h=[]})=>{const{nodes:m,edges:w,onNodesDelete:y,onEdgesDelete:b,triggerNodeChanges:g,triggerEdgeChanges:v,onDelete:x,onBeforeDelete:j}=t.getState(),{nodes:N,edges:k}=await JA({nodesToRemove:u,edgesToRemove:h,nodes:m,edges:w,onBeforeDelete:j}),S=k.length>0,M=N.length>0;if(S){const z=k.map(l0);b==null||b(k),v(z)}if(M){const z=N.map(l0);y==null||y(N),g(z)}return(M||S)&&(x==null||x({nodes:N,edges:k})),{deletedNodes:N,deletedEdges:k}},getIntersectingNodes:(u,h=!0,m)=>{const w=Fg(u),y=w?u:c(u),b=m!==void 0;return y?(m||t.getState().nodes).filter(g=>{const v=t.getState().nodeLookup.get(g.id);if(v&&!w&&(g.id===u.id||!v.internals.positionAbsolute))return!1;const x=Qa(b?g:v),j=ko(x,y);return h&&j>0||j>=x.width*x.height||j>=y.width*y.height}):[]},isNodeIntersecting:(u,h,m=!0)=>{const y=Fg(u)?u:c(u);if(!y)return!1;const b=ko(y,h);return m&&b>0||b>=h.width*h.height||b>=y.width*y.height},updateNode:d,updateNodeData:(u,h,m={replace:!1})=>{d(u,w=>{const y=typeof h=="function"?h(w):h;return m.replace?{...w,data:y}:{...w,data:{...w.data,...y}}},m)},updateEdge:f,updateEdgeData:(u,h,m={replace:!1})=>{f(u,w=>{const y=typeof h=="function"?h(w):h;return m.replace?{...w,data:y}:{...w,data:{...w.data,...y}}},m)},getNodesBounds:u=>{const{nodeLookup:h,nodeOrigin:m}=t.getState();return GA(u,{nodeLookup:h,nodeOrigin:m})},getHandleConnections:({type:u,id:h,nodeId:m})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${m}-${u}${h?`-${h}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:u,handleId:h,nodeId:m})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${m}${u?h?`-${u}-${h}`:`-${u}`:""}`))==null?void 0:w.values())??[])},fitView:async u=>{const h=t.getState().fitViewResolver??rR();return t.setState({fitViewQueued:!0,fitViewOptions:u,fitViewResolver:h}),n.nodeQueue.push(m=>[...m]),h.promise}}},[]);return p.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const u0=e=>e.selected,HI=typeof window<"u"?window:void 0;function YI({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Ke(),{deleteElements:r}=Jm(),s=Eo(e,{actInsideInputWithModifier:!1}),i=Eo(t,{target:HI});p.useEffect(()=>{if(s){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(u0),edges:o.filter(u0)}),n.setState({nodesSelectionActive:!1})}},[s]),p.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function XI(e){const t=Ke();p.useEffect(()=>{const n=()=>{var s,i,o,l;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=qm(e.current);(r.height===0||r.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",nr.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Pd={position:"absolute",width:"100%",height:"100%",top:0,left:0},qI=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function GI({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=Os.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:d,minZoom:f,maxZoom:u,zoomActivationKeyCode:h,preventScrolling:m=!0,children:w,noWheelClassName:y,noPanClassName:b,onViewportChange:g,isControlledViewport:v,paneClickDistance:x}){const j=Ke(),N=p.useRef(null),{userSelectionActive:k,lib:S,connectionInProgress:M}=_e(qI,st),z=Eo(h),$=p.useRef();XI(N);const A=p.useCallback(O=>{g==null||g({x:O[0],y:O[1],zoom:O[2]}),v||j.setState({transform:O})},[g,v]);return p.useEffect(()=>{if(N.current){$.current=LR({domNode:N.current,minZoom:f,maxZoom:u,translateExtent:d,viewport:c,paneClickDistance:x,onDraggingChange:I=>j.setState({paneDragging:I}),onPanZoomStart:(I,D)=>{const{onViewportChangeStart:P,onMoveStart:C}=j.getState();C==null||C(I,D),P==null||P(D)},onPanZoom:(I,D)=>{const{onViewportChange:P,onMove:C}=j.getState();C==null||C(I,D),P==null||P(D)},onPanZoomEnd:(I,D)=>{const{onViewportChangeEnd:P,onMoveEnd:C}=j.getState();C==null||C(I,D),P==null||P(D)}});const{x:O,y:L,zoom:E}=$.current.getViewport();return j.setState({panZoom:$.current,transform:[O,L,E],domNode:N.current.closest(".react-flow")}),()=>{var I;(I=$.current)==null||I.destroy()}}},[]),p.useEffect(()=>{var O;(O=$.current)==null||O.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:z,preventScrolling:m,noPanClassName:b,userSelectionActive:k,noWheelClassName:y,lib:S,onTransformChange:A,connectionInProgress:M})},[e,t,n,r,s,i,o,l,z,m,b,k,y,S,A,M]),a.jsx("div",{className:"react-flow__renderer",ref:N,style:Pd,children:w})}const KI=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function QI(){const{userSelectionActive:e,userSelectionRect:t}=_e(KI,st);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 Iu=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},ZI=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function JI({isSelecting:e,selectionKeyPressed:t,selectionMode:n=jo.Full,panOnDrag:r,selectionOnDrag:s,onSelectionStart:i,onSelectionEnd:o,onPaneClick:l,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:u,onPaneMouseLeave:h,children:m}){const w=Ke(),{userSelectionActive:y,elementsSelectable:b,dragging:g,connectionInProgress:v}=_e(ZI,st),x=b&&(e||y),j=p.useRef(null),N=p.useRef(),k=p.useRef(new Set),S=p.useRef(new Set),M=p.useRef(!1),z=p.useRef(!1),$=P=>{if(M.current||v){M.current=!1;return}l==null||l(P),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},A=P=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){P.preventDefault();return}c==null||c(P)},O=d?P=>d(P):void 0,L=P=>{var T,F;const{resetSelectedElements:C,domNode:_}=w.getState();if(N.current=_==null?void 0:_.getBoundingClientRect(),!b||!e||P.button!==0||P.target!==j.current||!N.current)return;(F=(T=P.target)==null?void 0:T.setPointerCapture)==null||F.call(T,P.pointerId),z.current=!0,M.current=!1;const{x:R,y:B}=Pn(P.nativeEvent,N.current);C(),w.setState({userSelectionRect:{width:0,height:0,startX:R,startY:B,x:R,y:B}}),i==null||i(P)},E=P=>{const{userSelectionRect:C,transform:_,nodeLookup:R,edgeLookup:B,connectionLookup:T,triggerNodeChanges:F,triggerEdgeChanges:H,defaultEdgeOptions:X}=w.getState();if(!N.current||!C)return;M.current=!0;const{x:J,y:ee}=Pn(P.nativeEvent,N.current),{startX:K,startY:ne}=C,me={startX:K,startY:ne,x:J<K?J:K,y:ee<ne?ee:ne,width:Math.abs(J-K),height:Math.abs(ee-ne)},W=k.current,Q=S.current;k.current=new Set(Ym(R,me,_,n===jo.Partial,!0).map(ae=>ae.id)),S.current=new Set;const Z=(X==null?void 0:X.selectable)??!0;for(const ae of k.current){const fe=T.get(ae);if(fe)for(const{edgeId:pe}of fe.values()){const Se=B.get(pe);Se&&(Se.selectable??Z)&&S.current.add(pe)}}if(!Bg(W,k.current)){const ae=Na(R,k.current,!0);F(ae)}if(!Bg(Q,S.current)){const ae=Na(B,S.current);H(ae)}w.setState({userSelectionRect:me,userSelectionActive:!0,nodesSelectionActive:!1})},I=P=>{var _,R;if(P.button!==0||!z.current)return;(R=(_=P.target)==null?void 0:_.releasePointerCapture)==null||R.call(_,P.pointerId);const{userSelectionRect:C}=w.getState();!y&&C&&P.target===j.current&&($==null||$(P)),w.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:k.current.size>0}),o==null||o(P),(t||s)&&(M.current=!1),z.current=!1},D=r===!0||Array.isArray(r)&&r.includes(0);return a.jsxs("div",{className:pt(["react-flow__pane",{draggable:D,dragging:g,selection:e}]),onClick:x?void 0:Iu($,j),onContextMenu:Iu(A,j),onWheel:Iu(O,j),onPointerEnter:x?void 0:f,onPointerDown:x?L:u,onPointerMove:x?E:u,onPointerUp:x?I:void 0,onPointerLeave:h,ref:j,style:Pd,children:[m,a.jsx(QI,{})]})}function dh({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),d=l.get(e);if(!d){c==null||c("012",nr.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&o)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var f;return(f=r==null?void 0:r.current)==null?void 0:f.blur()})):s([e])}function yN({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:o}){const l=Ke(),[c,d]=p.useState(!1),f=p.useRef();return p.useEffect(()=>{f.current=kR({getStoreItems:()=>l.getState(),onNodeMouseDown:u=>{dh({id:u,store:l,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),p.useEffect(()=>{var u,h;if(t)(u=f.current)==null||u.destroy();else if(e.current)return(h=f.current)==null||h.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:o}),()=>{var m;(m=f.current)==null||m.destroy()}},[n,r,t,i,e,s]),c}const ez=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function vN(){const e=Ke();return p.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:d,nodeOrigin:f}=e.getState(),u=new Map,h=ez(o),m=s?i[0]:5,w=s?i[1]:5,y=n.direction.x*m*n.factor,b=n.direction.y*w*n.factor;for(const[,g]of d){if(!h(g))continue;let v={x:g.internals.positionAbsolute.x+y,y:g.internals.positionAbsolute.y+b};s&&(v=Go(v,i));const{position:x,positionAbsolute:j}=A1({nodeId:g.id,nextPosition:v,nodeLookup:d,nodeExtent:r,nodeOrigin:f,onError:l});g.position=x,g.internals.positionAbsolute=j,u.set(g.id,g)}c(u)},[])}const ep=p.createContext(null),tz=ep.Provider;ep.Consumer;const wN=()=>p.useContext(ep),nz=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),rz=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:o}=r,{fromHandle:l,toHandle:c,isValid:d}=o,f=(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:f,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:i===Ga.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:!!s,valid:f&&d}};function sz({type:e="source",position:t=ye.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:o,onConnect:l,children:c,className:d,onMouseDown:f,onTouchStart:u,...h},m){var I,D;const w=o||null,y=e==="target",b=Ke(),g=wN(),{connectOnClick:v,noPanClassName:x,rfId:j}=_e(nz,st),{connectingFrom:N,connectingTo:k,clickConnecting:S,isPossibleEndHandle:M,connectionInProcess:z,clickConnectionInProcess:$,valid:A}=_e(rz(g,w,e),st);g||(D=(I=b.getState()).onError)==null||D.call(I,"010",nr.error010());const O=P=>{const{defaultEdgeOptions:C,onConnect:_,hasDefaultEdges:R}=b.getState(),B={...C,...P};if(R){const{edges:T,setEdges:F}=b.getState();F(Y1(B,T))}_==null||_(B),l==null||l(B)},L=P=>{if(!g)return;const C=W1(P.nativeEvent);if(s&&(C&&P.button===0||!C)){const _=b.getState();ch.onPointerDown(P.nativeEvent,{handleDomNode:P.currentTarget,autoPanOnConnect:_.autoPanOnConnect,connectionMode:_.connectionMode,connectionRadius:_.connectionRadius,domNode:_.domNode,nodeLookup:_.nodeLookup,lib:_.lib,isTarget:y,handleId:w,nodeId:g,flowId:_.rfId,panBy:_.panBy,cancelConnection:_.cancelConnection,onConnectStart:_.onConnectStart,onConnectEnd:_.onConnectEnd,updateConnection:_.updateConnection,onConnect:O,isValidConnection:n||_.isValidConnection,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:_.autoPanSpeed,dragThreshold:_.connectionDragThreshold})}C?f==null||f(P):u==null||u(P)},E=P=>{const{onClickConnectStart:C,onClickConnectEnd:_,connectionClickStartHandle:R,connectionMode:B,isValidConnection:T,lib:F,rfId:H,nodeLookup:X,connection:J}=b.getState();if(!g||!R&&!s)return;if(!R){C==null||C(P.nativeEvent,{nodeId:g,handleId:w,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:g,type:e,id:w}});return}const ee=F1(P.target),K=n||T,{connection:ne,isValid:me}=ch.isValid(P.nativeEvent,{handle:{nodeId:g,id:w,type:e},connectionMode:B,fromNodeId:R.nodeId,fromHandleId:R.id||null,fromType:R.type,isValidConnection:K,flowId:H,doc:ee,lib:F,nodeLookup:X});me&&ne&&O(ne);const W=structuredClone(J);delete W.inProgress,W.toPosition=W.toHandle?W.toHandle.position:null,_==null||_(P,W),b.setState({connectionClickStartHandle:null})};return a.jsx("div",{"data-handleid":w,"data-nodeid":g,"data-handlepos":t,"data-id":`${j}-${g}-${w}-${e}`,className:pt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,d,{source:!y,target:y,connectable:r,connectablestart:s,connectableend:i,clickconnecting:S,connectingfrom:N,connectingto:k,valid:A,connectionindicator:r&&(!z||M)&&(z||$?i:s)}]),onMouseDown:L,onTouchStart:L,onClick:v?E:void 0,ref:m,...h,children:c})}const As=p.memo(xN(sz));function az({data:e,isConnectable:t,sourcePosition:n=ye.Bottom}){return a.jsxs(a.Fragment,{children:[e==null?void 0:e.label,a.jsx(As,{type:"source",position:n,isConnectable:t})]})}function iz({data:e,isConnectable:t,targetPosition:n=ye.Top,sourcePosition:r=ye.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx(As,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,a.jsx(As,{type:"source",position:r,isConnectable:t})]})}function oz(){return null}function lz({data:e,isConnectable:t,targetPosition:n=ye.Top}){return a.jsxs(a.Fragment,{children:[a.jsx(As,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Bc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},f0={input:az,default:iz,output:lz,group:oz};function cz(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const dz=e=>{const{width:t,height:n,x:r,y:s}=qo(e.nodeLookup,{filter:i=>!!i.selected});return{width:_n(t)?t:null,height:_n(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function uz({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Ke(),{width:s,height:i,transformString:o,userSelectionActive:l}=_e(dz,st),c=vN(),d=p.useRef(null);if(p.useEffect(()=>{var h;n||(h=d.current)==null||h.focus({preventScroll:!0})},[n]),yN({nodeRef:d}),l||!s||!i)return null;const f=e?h=>{const m=r.getState().nodes.filter(w=>w.selected);e(h,m)}:void 0,u=h=>{Object.prototype.hasOwnProperty.call(Bc,h.key)&&(h.preventDefault(),c({direction:Bc[h.key],factor:h.shiftKey?4:1}))};return a.jsx("div",{className:pt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:a.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:u,style:{width:s,height:i}})})}const h0=typeof window<"u"?window:void 0,fz=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function bN({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:d,selectionOnDrag:f,selectionMode:u,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:w,panActivationKeyCode:y,zoomActivationKeyCode:b,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:x,panOnScroll:j,panOnScrollSpeed:N,panOnScrollMode:k,zoomOnDoubleClick:S,panOnDrag:M,defaultViewport:z,translateExtent:$,minZoom:A,maxZoom:O,preventScrolling:L,onSelectionContextMenu:E,noWheelClassName:I,noPanClassName:D,disableKeyboardA11y:P,onViewportChange:C,isControlledViewport:_}){const{nodesSelectionActive:R,userSelectionActive:B}=_e(fz),T=Eo(d,{target:h0}),F=Eo(y,{target:h0}),H=F||M,X=F||j,J=f&&H!==!0,ee=T||B||J;return YI({deleteKeyCode:c,multiSelectionKeyCode:w}),a.jsx(GI,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:x,panOnScroll:X,panOnScrollSpeed:N,panOnScrollMode:k,zoomOnDoubleClick:S,panOnDrag:!T&&H,defaultViewport:z,translateExtent:$,minZoom:A,maxZoom:O,zoomActivationKeyCode:b,preventScrolling:L,noWheelClassName:I,noPanClassName:D,onViewportChange:C,isControlledViewport:_,paneClickDistance:l,children:a.jsxs(JI,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:o,panOnDrag:H,isSelecting:!!ee,selectionMode:u,selectionKeyPressed:T,selectionOnDrag:J,children:[e,R&&a.jsx(uz,{onSelectionContextMenu:E,noPanClassName:D,disableKeyboardA11y:P})]})})}bN.displayName="FlowRenderer";const hz=p.memo(bN),mz=e=>t=>e?Ym(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 pz(e){return _e(p.useCallback(mz(e),[e]),st)}const xz=e=>e.updateNodeInternals;function gz(){const e=_e(xz),[t]=p.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return p.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function yz({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=Ke(),i=p.useRef(null),o=p.useRef(null),l=p.useRef(e.sourcePosition),c=p.useRef(e.targetPosition),d=p.useRef(t),f=n&&!!e.internals.handleBounds;return p.useEffect(()=>{i.current&&!e.hidden&&(!f||o.current!==i.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(i.current),o.current=i.current)},[f,e.hidden]),p.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),p.useEffect(()=>{if(i.current){const u=d.current!==t,h=l.current!==e.sourcePosition,m=c.current!==e.targetPosition;(u||h||m)&&(d.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function vz({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:d,nodesFocusable:f,resizeObserver:u,noDragClassName:h,noPanClassName:m,disableKeyboardA11y:w,rfId:y,nodeTypes:b,nodeClickDistance:g,onError:v}){const{node:x,internals:j,isParent:N}=_e(K=>{const ne=K.nodeLookup.get(e),me=K.parentLookup.has(e);return{node:ne,internals:ne.internals,isParent:me}},st);let k=x.type||"default",S=(b==null?void 0:b[k])||f0[k];S===void 0&&(v==null||v("003",nr.error003(k)),k="default",S=(b==null?void 0:b.default)||f0.default);const M=!!(x.draggable||l&&typeof x.draggable>"u"),z=!!(x.selectable||c&&typeof x.selectable>"u"),$=!!(x.connectable||d&&typeof x.connectable>"u"),A=!!(x.focusable||f&&typeof x.focusable>"u"),O=Ke(),L=$1(x),E=yz({node:x,nodeType:k,hasDimensions:L,resizeObserver:u}),I=yN({nodeRef:E,disabled:x.hidden||!M,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:z,nodeClickDistance:g}),D=vN();if(x.hidden)return null;const P=_r(x),C=cz(x),_=z||M||t||n||r||s,R=n?K=>n(K,{...j.userNode}):void 0,B=r?K=>r(K,{...j.userNode}):void 0,T=s?K=>s(K,{...j.userNode}):void 0,F=i?K=>i(K,{...j.userNode}):void 0,H=o?K=>o(K,{...j.userNode}):void 0,X=K=>{const{selectNodesOnDrag:ne,nodeDragThreshold:me}=O.getState();z&&(!ne||!M||me>0)&&dh({id:e,store:O,nodeRef:E}),t&&t(K,{...j.userNode})},J=K=>{if(!(B1(K.nativeEvent)||w)){if(_1.includes(K.key)&&z){const ne=K.key==="Escape";dh({id:e,store:O,unselect:ne,nodeRef:E})}else if(M&&x.selected&&Object.prototype.hasOwnProperty.call(Bc,K.key)){K.preventDefault();const{ariaLabelConfig:ne}=O.getState();O.setState({ariaLiveMessage:ne["node.a11yDescription.ariaLiveMessage"]({direction:K.key.replace("Arrow","").toLowerCase(),x:~~j.positionAbsolute.x,y:~~j.positionAbsolute.y})}),D({direction:Bc[K.key],factor:K.shiftKey?4:1})}}},ee=()=>{var ae;if(w||!((ae=E.current)!=null&&ae.matches(":focus-visible")))return;const{transform:K,width:ne,height:me,autoPanOnNodeFocus:W,setCenter:Q}=O.getState();if(!W)return;Ym(new Map([[e,x]]),{x:0,y:0,width:ne,height:me},K,!0).length>0||Q(x.position.x+P.width/2,x.position.y+P.height/2,{zoom:K[2]})};return a.jsx("div",{className:pt(["react-flow__node",`react-flow__node-${k}`,{[m]:M},x.className,{selected:x.selected,selectable:z,parent:N,draggable:M,dragging:I}]),ref:E,style:{zIndex:j.z,transform:`translate(${j.positionAbsolute.x}px,${j.positionAbsolute.y}px)`,pointerEvents:_?"all":"none",visibility:L?"visible":"hidden",...x.style,...C},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:R,onMouseMove:B,onMouseLeave:T,onContextMenu:F,onClick:X,onDoubleClick:H,onKeyDown:A?J:void 0,tabIndex:A?0:void 0,onFocus:A?ee:void 0,role:x.ariaRole??(A?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${dN}-${y}`,"aria-label":x.ariaLabel,...x.domAttributes,children:a.jsx(tz,{value:e,children:a.jsx(S,{id:e,data:x.data,type:k,positionAbsoluteX:j.positionAbsolute.x,positionAbsoluteY:j.positionAbsolute.y,selected:x.selected??!1,selectable:z,draggable:M,deletable:x.deletable??!0,isConnectable:$,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:I,dragHandle:x.dragHandle,zIndex:j.z,parentId:x.parentId,...P})})})}const wz=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function NN(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:i}=_e(wz,st),o=pz(e.onlyRenderVisibleElements),l=gz();return a.jsx("div",{className:"react-flow__nodes",style:Pd,children:o.map(c=>a.jsx(vz,{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:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}NN.displayName="NodeRenderer";const bz=p.memo(NN);function Nz(e){return _e(p.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const i=n.nodeLookup.get(s.source),o=n.nodeLookup.get(s.target);i&&o&&oR({sourceNode:i,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),st)}const jz=({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"})},kz=({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"})},m0={[$c.Arrow]:jz,[$c.ArrowClosed]:kz};function Sz(e){const t=Ke();return p.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(m0,e)?m0[e]:((i=(s=t.getState()).onError)==null||i.call(s,"009",nr.error009(e)),null)},[e])}const Cz=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=Sz(t);return c?a.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:a.jsx(c,{color:n,strokeWidth:o})}):null},jN=({defaultColor:e,rfId:t})=>{const n=_e(i=>i.edges),r=_e(i=>i.defaultEdgeOptions),s=p.useMemo(()=>mR(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?a.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:a.jsx("defs",{children:s.map(i=>a.jsx(Cz,{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};jN.displayName="MarkerDefinitions";var Ez=p.memo(jN);function kN({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:d,...f}){const[u,h]=p.useState({x:1,y:0,width:0,height:0}),m=pt(["react-flow__edge-textwrapper",d]),w=p.useRef(null);return p.useEffect(()=>{if(w.current){const y=w.current.getBBox();h({x:y.x,y:y.y,width:y.width,height:y.height})}},[n]),n?a.jsxs("g",{transform:`translate(${e-u.width/2} ${t-u.height/2})`,className:m,visibility:u.width?"visible":"hidden",...f,children:[s&&a.jsx("rect",{width:u.width+2*o[0],x:-o[0],y:-o[1],height:u.height+2*o[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),a.jsx("text",{className:"react-flow__edge-text",y:u.height/2,dy:"0.3em",ref:w,style:r,children:n}),c]}):null}kN.displayName="EdgeText";const Mz=p.memo(kN);function Dd({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:d=20,...f}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...f,d:e,fill:"none",className:pt(["react-flow__edge-path",f.className])}),d?a.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&_n(t)&&_n(n)?a.jsx(Mz,{x:t,y:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function p0({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===ye.Left||e===ye.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function SN({sourceX:e,sourceY:t,sourcePosition:n=ye.Bottom,targetX:r,targetY:s,targetPosition:i=ye.Top}){const[o,l]=p0({pos:n,x1:e,y1:t,x2:r,y2:s}),[c,d]=p0({pos:i,x1:r,y1:s,x2:e,y2:t}),[f,u,h,m]=U1({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${e},${t} C${o},${l} ${c},${d} ${r},${s}`,f,u,h,m]}function CN(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:o,targetPosition:l,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:m,style:w,markerEnd:y,markerStart:b,interactionWidth:g})=>{const[v,x,j]=SN({sourceX:n,sourceY:r,sourcePosition:o,targetX:s,targetY:i,targetPosition:l}),N=e.isInternal?void 0:t;return a.jsx(Dd,{id:N,path:v,labelX:x,labelY:j,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:m,style:w,markerEnd:y,markerStart:b,interactionWidth:g})})}const _z=CN({isInternal:!1}),EN=CN({isInternal:!0});_z.displayName="SimpleBezierEdge";EN.displayName="SimpleBezierEdgeInternal";function MN(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:u,style:h,sourcePosition:m=ye.Bottom,targetPosition:w=ye.Top,markerEnd:y,markerStart:b,pathOptions:g,interactionWidth:v})=>{const[x,j,N]=ih({sourceX:n,sourceY:r,sourcePosition:m,targetX:s,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}),k=e.isInternal?void 0:t;return a.jsx(Dd,{id:k,path:x,labelX:j,labelY:N,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:u,style:h,markerEnd:y,markerStart:b,interactionWidth:v})})}const _N=MN({isInternal:!1}),PN=MN({isInternal:!0});_N.displayName="SmoothStepEdge";PN.displayName="SmoothStepEdgeInternal";function DN(e){return p.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return a.jsx(_N,{...n,id:r,pathOptions:p.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const Pz=DN({isInternal:!1}),TN=DN({isInternal:!0});Pz.displayName="StepEdge";TN.displayName="StepEdgeInternal";function ON(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:u,style:h,markerEnd:m,markerStart:w,interactionWidth:y})=>{const[b,g,v]=X1({sourceX:n,sourceY:r,targetX:s,targetY:i}),x=e.isInternal?void 0:t;return a.jsx(Dd,{id:x,path:b,labelX:g,labelY:v,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:u,style:h,markerEnd:m,markerStart:w,interactionWidth:y})})}const Dz=ON({isInternal:!1}),AN=ON({isInternal:!0});Dz.displayName="StraightEdge";AN.displayName="StraightEdgeInternal";function RN(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:o=ye.Bottom,targetPosition:l=ye.Top,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:m,style:w,markerEnd:y,markerStart:b,pathOptions:g,interactionWidth:v})=>{const[x,j,N]=V1({sourceX:n,sourceY:r,sourcePosition:o,targetX:s,targetY:i,targetPosition:l,curvature:g==null?void 0:g.curvature}),k=e.isInternal?void 0:t;return a.jsx(Dd,{id:k,path:x,labelX:j,labelY:N,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:m,style:w,markerEnd:y,markerStart:b,interactionWidth:v})})}const Tz=RN({isInternal:!1}),IN=RN({isInternal:!0});Tz.displayName="BezierEdge";IN.displayName="BezierEdgeInternal";const x0={default:IN,straight:AN,step:TN,smoothstep:PN,simplebezier:EN},g0={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Oz=(e,t,n)=>n===ye.Left?e-t:n===ye.Right?e+t:e,Az=(e,t,n)=>n===ye.Top?e-t:n===ye.Bottom?e+t:e,y0="react-flow__edgeupdater";function v0({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:o,type:l}){return a.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:o,className:pt([y0,`${y0}-${l}`]),cx:Oz(t,r,e),cy:Az(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Rz({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:i,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:u,setReconnecting:h,setUpdateHover:m}){const w=Ke(),y=(j,N)=>{if(j.button!==0)return;const{autoPanOnConnect:k,domNode:S,isValidConnection:M,connectionMode:z,connectionRadius:$,lib:A,onConnectStart:O,onConnectEnd:L,cancelConnection:E,nodeLookup:I,rfId:D,panBy:P,updateConnection:C}=w.getState(),_=N.type==="target",R=(F,H)=>{h(!1),u==null||u(F,n,N.type,H)},B=F=>d==null?void 0:d(n,F),T=(F,H)=>{h(!0),f==null||f(j,n,N.type),O==null||O(F,H)};ch.onPointerDown(j.nativeEvent,{autoPanOnConnect:k,connectionMode:z,connectionRadius:$,domNode:S,handleId:N.id,nodeId:N.nodeId,nodeLookup:I,isTarget:_,edgeUpdaterType:N.type,lib:A,flowId:D,cancelConnection:E,panBy:P,isValidConnection:M,onConnect:B,onConnectStart:T,onConnectEnd:L,onReconnectEnd:R,updateConnection:C,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:j.currentTarget})},b=j=>y(j,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=j=>y(j,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>m(!0),x=()=>m(!1);return a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(v0,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:b,onMouseEnter:v,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&a.jsx(v0,{position:c,centerX:i,centerY:o,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:x,type:"target"})]})}function Iz({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,reconnectRadius:f,onReconnect:u,onReconnectStart:h,onReconnectEnd:m,rfId:w,edgeTypes:y,noPanClassName:b,onError:g,disableKeyboardA11y:v}){let x=_e(Q=>Q.edgeLookup.get(e));const j=_e(Q=>Q.defaultEdgeOptions);x=j?{...j,...x}:x;let N=x.type||"default",k=(y==null?void 0:y[N])||x0[N];k===void 0&&(g==null||g("011",nr.error011(N)),N="default",k=(y==null?void 0:y.default)||x0.default);const S=!!(x.focusable||t&&typeof x.focusable>"u"),M=typeof u<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),z=!!(x.selectable||r&&typeof x.selectable>"u"),$=p.useRef(null),[A,O]=p.useState(!1),[L,E]=p.useState(!1),I=Ke(),{zIndex:D,sourceX:P,sourceY:C,targetX:_,targetY:R,sourcePosition:B,targetPosition:T}=_e(p.useCallback(Q=>{const Z=Q.nodeLookup.get(x.source),ae=Q.nodeLookup.get(x.target);if(!Z||!ae)return{zIndex:x.zIndex,...g0};const fe=hR({id:e,sourceNode:Z,targetNode:ae,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:Q.connectionMode,onError:g});return{zIndex:iR({selected:x.selected,zIndex:x.zIndex,sourceNode:Z,targetNode:ae,elevateOnSelect:Q.elevateEdgesOnSelect}),...fe||g0}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),st),F=p.useMemo(()=>x.markerStart?`url('#${oh(x.markerStart,w)}')`:void 0,[x.markerStart,w]),H=p.useMemo(()=>x.markerEnd?`url('#${oh(x.markerEnd,w)}')`:void 0,[x.markerEnd,w]);if(x.hidden||P===null||C===null||_===null||R===null)return null;const X=Q=>{var pe;const{addSelectedEdges:Z,unselectNodesAndEdges:ae,multiSelectionActive:fe}=I.getState();z&&(I.setState({nodesSelectionActive:!1}),x.selected&&fe?(ae({nodes:[],edges:[x]}),(pe=$.current)==null||pe.blur()):Z([e])),s&&s(Q,x)},J=i?Q=>{i(Q,{...x})}:void 0,ee=o?Q=>{o(Q,{...x})}:void 0,K=l?Q=>{l(Q,{...x})}:void 0,ne=c?Q=>{c(Q,{...x})}:void 0,me=d?Q=>{d(Q,{...x})}:void 0,W=Q=>{var Z;if(!v&&_1.includes(Q.key)&&z){const{unselectNodesAndEdges:ae,addSelectedEdges:fe}=I.getState();Q.key==="Escape"?((Z=$.current)==null||Z.blur(),ae({edges:[x]})):fe([e])}};return a.jsx("svg",{style:{zIndex:D},children:a.jsxs("g",{className:pt(["react-flow__edge",`react-flow__edge-${N}`,x.className,b,{selected:x.selected,animated:x.animated,inactive:!z&&!s,updating:A,selectable:z}]),onClick:X,onDoubleClick:J,onContextMenu:ee,onMouseEnter:K,onMouseMove:ne,onMouseLeave:me,onKeyDown:S?W:void 0,tabIndex:S?0:void 0,role:x.ariaRole??(S?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":S?`${uN}-${w}`:void 0,ref:$,...x.domAttributes,children:[!L&&a.jsx(k,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:z,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:P,sourceY:C,targetX:_,targetY:R,sourcePosition:B,targetPosition:T,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:F,markerEnd:H,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),M&&a.jsx(Rz,{edge:x,isReconnectable:M,reconnectRadius:f,onReconnect:u,onReconnectStart:h,onReconnectEnd:m,sourceX:P,sourceY:C,targetX:_,targetY:R,sourcePosition:B,targetPosition:T,setUpdateHover:O,setReconnecting:E})]})})}const zz=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function zN({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:f,reconnectRadius:u,onEdgeDoubleClick:h,onReconnectStart:m,onReconnectEnd:w,disableKeyboardA11y:y}){const{edgesFocusable:b,edgesReconnectable:g,elementsSelectable:v,onError:x}=_e(zz,st),j=Nz(t);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(Ez,{defaultColor:e,rfId:n}),j.map(N=>a.jsx(Iz,{id:N,edgesFocusable:b,edgesReconnectable:g,elementsSelectable:v,noPanClassName:s,onReconnect:i,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onClick:f,reconnectRadius:u,onDoubleClick:h,onReconnectStart:m,onReconnectEnd:w,rfId:n,onError:x,edgeTypes:r,disableKeyboardA11y:y},N))]})}zN.displayName="EdgeRenderer";const $z=p.memo(zN),Lz=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Fz({children:e}){const t=_e(Lz);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Bz(e){const t=Jm(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Wz=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Uz(e){const t=_e(Wz),n=Ke();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Vz(e){return e.connection.inProgress?{...e.connection,to:Ko(e.connection.to,e.transform)}:{...e.connection}}function Hz(e){return Vz}function Yz(e){const t=Hz();return _e(t,st)}const Xz=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function qz({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:i,height:o,isValid:l,inProgress:c}=_e(Xz,st);return!(i&&s&&c)?null:a.jsx("svg",{style:e,width:i,height:o,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:pt(["react-flow__connection",T1(l)]),children:a.jsx($N,{style:t,type:n,CustomComponent:r,isValid:l})})})}const $N=({style:e,type:t=Br.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:i,fromNode:o,fromHandle:l,fromPosition:c,to:d,toNode:f,toHandle:u,toPosition:h}=Yz();if(!s)return;if(n)return a.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:i.x,fromY:i.y,toX:d.x,toY:d.y,fromPosition:c,toPosition:h,connectionStatus:T1(r),toNode:f,toHandle:u});let m="";const w={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:d.x,targetY:d.y,targetPosition:h};switch(t){case Br.Bezier:[m]=V1(w);break;case Br.SimpleBezier:[m]=SN(w);break;case Br.Step:[m]=ih({...w,borderRadius:0});break;case Br.SmoothStep:[m]=ih(w);break;default:[m]=X1(w)}return a.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};$N.displayName="ConnectionLine";const Gz={};function w0(e=Gz){p.useRef(e),Ke(),p.useEffect(()=>{},[e])}function Kz(){Ke(),p.useRef(!1),p.useEffect(()=>{},[])}function LN({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:f,onSelectionContextMenu:u,onSelectionStart:h,onSelectionEnd:m,connectionLineType:w,connectionLineStyle:y,connectionLineComponent:b,connectionLineContainerStyle:g,selectionKeyCode:v,selectionOnDrag:x,selectionMode:j,multiSelectionKeyCode:N,panActivationKeyCode:k,zoomActivationKeyCode:S,deleteKeyCode:M,onlyRenderVisibleElements:z,elementsSelectable:$,defaultViewport:A,translateExtent:O,minZoom:L,maxZoom:E,preventScrolling:I,defaultMarkerColor:D,zoomOnScroll:P,zoomOnPinch:C,panOnScroll:_,panOnScrollSpeed:R,panOnScrollMode:B,zoomOnDoubleClick:T,panOnDrag:F,onPaneClick:H,onPaneMouseEnter:X,onPaneMouseMove:J,onPaneMouseLeave:ee,onPaneScroll:K,onPaneContextMenu:ne,paneClickDistance:me,nodeClickDistance:W,onEdgeContextMenu:Q,onEdgeMouseEnter:Z,onEdgeMouseMove:ae,onEdgeMouseLeave:fe,reconnectRadius:pe,onReconnect:Se,onReconnectStart:Xe,onReconnectEnd:Pe,noDragClassName:lt,noWheelClassName:Pt,noPanClassName:Ae,disableKeyboardA11y:Qe,nodeExtent:xt,rfId:zt,viewport:te,onViewportChange:oe}){return w0(e),w0(t),Kz(),Bz(n),Uz(te),a.jsx(hz,{onPaneClick:H,onPaneMouseEnter:X,onPaneMouseMove:J,onPaneMouseLeave:ee,onPaneContextMenu:ne,onPaneScroll:K,paneClickDistance:me,deleteKeyCode:M,selectionKeyCode:v,selectionOnDrag:x,selectionMode:j,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:N,panActivationKeyCode:k,zoomActivationKeyCode:S,elementsSelectable:$,zoomOnScroll:P,zoomOnPinch:C,zoomOnDoubleClick:T,panOnScroll:_,panOnScrollSpeed:R,panOnScrollMode:B,panOnDrag:F,defaultViewport:A,translateExtent:O,minZoom:L,maxZoom:E,onSelectionContextMenu:u,preventScrolling:I,noDragClassName:lt,noWheelClassName:Pt,noPanClassName:Ae,disableKeyboardA11y:Qe,onViewportChange:oe,isControlledViewport:!!te,children:a.jsxs(Fz,{children:[a.jsx($z,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:o,onReconnect:Se,onReconnectStart:Xe,onReconnectEnd:Pe,onlyRenderVisibleElements:z,onEdgeContextMenu:Q,onEdgeMouseEnter:Z,onEdgeMouseMove:ae,onEdgeMouseLeave:fe,reconnectRadius:pe,defaultMarkerColor:D,noPanClassName:Ae,disableKeyboardA11y:Qe,rfId:zt}),a.jsx(qz,{style:y,type:w,component:b,containerStyle:g}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(bz,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:f,nodeClickDistance:W,onlyRenderVisibleElements:z,noPanClassName:Ae,noDragClassName:lt,disableKeyboardA11y:Qe,nodeExtent:xt,rfId:zt}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}LN.displayName="GraphView";const Qz=p.memo(LN),b0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:d=2,nodeOrigin:f,nodeExtent:u}={})=>{const h=new Map,m=new Map,w=new Map,y=new Map,b=r??t??[],g=n??e??[],v=f??[0,0],x=u??No;G1(w,y,b);const j=lh(g,h,m,{nodeOrigin:v,nodeExtent:x,elevateNodesOnSelect:!1});let N=[0,0,1];if(o&&s&&i){const k=qo(h,{filter:$=>!!(($.width||$.initialWidth)&&($.height||$.initialHeight))}),{x:S,y:M,zoom:z}=Xm(k,s,i,c,d,(l==null?void 0:l.padding)??.1);N=[S,M,z]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:g,nodesInitialized:j,nodeLookup:h,parentLookup:m,edges:b,edgeLookup:y,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:d,translateExtent:No,nodeExtent:x,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ga.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:v,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:{...D1},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:eR,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:P1}},Zz=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:f,nodeExtent:u})=>yI((h,m)=>{async function w(){const{nodeLookup:y,panZoom:b,fitViewOptions:g,fitViewResolver:v,width:x,height:j,minZoom:N,maxZoom:k}=m();b&&(await ZA({nodes:y,width:x,height:j,panZoom:b,minZoom:N,maxZoom:k},g),v==null||v.resolve(!0),h({fitViewResolver:null}))}return{...b0({nodes:e,edges:t,width:s,height:i,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:f,nodeExtent:u,defaultNodes:n,defaultEdges:r}),setNodes:y=>{const{nodeLookup:b,parentLookup:g,nodeOrigin:v,elevateNodesOnSelect:x,fitViewQueued:j}=m(),N=lh(y,b,g,{nodeOrigin:v,nodeExtent:u,elevateNodesOnSelect:x,checkEquality:!0});j&&N?(w(),h({nodes:y,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0})):h({nodes:y,nodesInitialized:N})},setEdges:y=>{const{connectionLookup:b,edgeLookup:g}=m();G1(b,g,y),h({edges:y})},setDefaultNodesAndEdges:(y,b)=>{if(y){const{setNodes:g}=m();g(y),h({hasDefaultNodes:!0})}if(b){const{setEdges:g}=m();g(b),h({hasDefaultEdges:!0})}},updateNodeInternals:y=>{const{triggerNodeChanges:b,nodeLookup:g,parentLookup:v,domNode:x,nodeOrigin:j,nodeExtent:N,debug:k,fitViewQueued:S}=m(),{changes:M,updatedInternals:z}=wR(y,g,v,x,j,N);z&&(xR(g,v,{nodeOrigin:j,nodeExtent:N}),S?(w(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),(M==null?void 0:M.length)>0&&(k&&console.log("React Flow: trigger node changes",M),b==null||b(M)))},updateNodePositions:(y,b=!1)=>{const g=[],v=[],{nodeLookup:x,triggerNodeChanges:j}=m();for(const[N,k]of y){const S=x.get(N),M=!!(S!=null&&S.expandParent&&(S!=null&&S.parentId)&&(k!=null&&k.position)),z={id:N,type:"position",position:M?{x:Math.max(0,k.position.x),y:Math.max(0,k.position.y)}:k.position,dragging:b};M&&S.parentId&&g.push({id:N,parentId:S.parentId,rect:{...k.internals.positionAbsolute,width:k.measured.width??0,height:k.measured.height??0}}),v.push(z)}if(g.length>0){const{parentLookup:N,nodeOrigin:k}=m(),S=Zm(g,x,N,k);v.push(...S)}j(v)},triggerNodeChanges:y=>{const{onNodesChange:b,setNodes:g,nodes:v,hasDefaultNodes:x,debug:j}=m();if(y!=null&&y.length){if(x){const N=mN(y,v);g(N)}j&&console.log("React Flow: trigger node changes",y),b==null||b(y)}},triggerEdgeChanges:y=>{const{onEdgesChange:b,setEdges:g,edges:v,hasDefaultEdges:x,debug:j}=m();if(y!=null&&y.length){if(x){const N=pN(y,v);g(N)}j&&console.log("React Flow: trigger edge changes",y),b==null||b(y)}},addSelectedNodes:y=>{const{multiSelectionActive:b,edgeLookup:g,nodeLookup:v,triggerNodeChanges:x,triggerEdgeChanges:j}=m();if(b){const N=y.map(k=>bs(k,!0));x(N);return}x(Na(v,new Set([...y]),!0)),j(Na(g))},addSelectedEdges:y=>{const{multiSelectionActive:b,edgeLookup:g,nodeLookup:v,triggerNodeChanges:x,triggerEdgeChanges:j}=m();if(b){const N=y.map(k=>bs(k,!0));j(N);return}j(Na(g,new Set([...y]))),x(Na(v,new Set,!0))},unselectNodesAndEdges:({nodes:y,edges:b}={})=>{const{edges:g,nodes:v,nodeLookup:x,triggerNodeChanges:j,triggerEdgeChanges:N}=m(),k=y||v,S=b||g,M=k.map($=>{const A=x.get($.id);return A&&(A.selected=!1),bs($.id,!1)}),z=S.map($=>bs($.id,!1));j(M),N(z)},setMinZoom:y=>{const{panZoom:b,maxZoom:g}=m();b==null||b.setScaleExtent([y,g]),h({minZoom:y})},setMaxZoom:y=>{const{panZoom:b,minZoom:g}=m();b==null||b.setScaleExtent([g,y]),h({maxZoom:y})},setTranslateExtent:y=>{var b;(b=m().panZoom)==null||b.setTranslateExtent(y),h({translateExtent:y})},setPaneClickDistance:y=>{var b;(b=m().panZoom)==null||b.setClickDistance(y)},resetSelectedElements:()=>{const{edges:y,nodes:b,triggerNodeChanges:g,triggerEdgeChanges:v,elementsSelectable:x}=m();if(!x)return;const j=b.reduce((k,S)=>S.selected?[...k,bs(S.id,!1)]:k,[]),N=y.reduce((k,S)=>S.selected?[...k,bs(S.id,!1)]:k,[]);g(j),v(N)},setNodeExtent:y=>{const{nodes:b,nodeLookup:g,parentLookup:v,nodeOrigin:x,elevateNodesOnSelect:j,nodeExtent:N}=m();y[0][0]===N[0][0]&&y[0][1]===N[0][1]&&y[1][0]===N[1][0]&&y[1][1]===N[1][1]||(lh(b,g,v,{nodeOrigin:x,nodeExtent:y,elevateNodesOnSelect:j,checkEquality:!1}),h({nodeExtent:y}))},panBy:y=>{const{transform:b,width:g,height:v,panZoom:x,translateExtent:j}=m();return bR({delta:y,panZoom:x,transform:b,translateExtent:j,width:g,height:v})},setCenter:async(y,b,g)=>{const{width:v,height:x,maxZoom:j,panZoom:N}=m();if(!N)return Promise.resolve(!1);const k=typeof(g==null?void 0:g.zoom)<"u"?g.zoom:j;return await N.setViewport({x:v/2-y*k,y:x/2-b*k,zoom:k},{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:()=>{h({connection:{...D1}})},updateConnection:y=>{h({connection:y})},reset:()=>h({...b0()})}},Object.is);function Jz({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:d,nodeOrigin:f,nodeExtent:u,children:h}){const[m]=p.useState(()=>Zz({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:d,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:f,nodeExtent:u}));return a.jsx(vI,{value:m,children:a.jsx(WI,{children:h})})}function e6({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:i,height:o,fitView:l,fitViewOptions:c,minZoom:d,maxZoom:f,nodeOrigin:u,nodeExtent:h}){return p.useContext(Md)?a.jsx(a.Fragment,{children:e}):a.jsx(Jz,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:d,initialMaxZoom:f,nodeOrigin:u,nodeExtent:h,children:e})}const t6={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function n6({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:d,onMove:f,onMoveStart:u,onMoveEnd:h,onConnect:m,onConnectStart:w,onConnectEnd:y,onClickConnectStart:b,onClickConnectEnd:g,onNodeMouseEnter:v,onNodeMouseMove:x,onNodeMouseLeave:j,onNodeContextMenu:N,onNodeDoubleClick:k,onNodeDragStart:S,onNodeDrag:M,onNodeDragStop:z,onNodesDelete:$,onEdgesDelete:A,onDelete:O,onSelectionChange:L,onSelectionDragStart:E,onSelectionDrag:I,onSelectionDragStop:D,onSelectionContextMenu:P,onSelectionStart:C,onSelectionEnd:_,onBeforeDelete:R,connectionMode:B,connectionLineType:T=Br.Bezier,connectionLineStyle:F,connectionLineComponent:H,connectionLineContainerStyle:X,deleteKeyCode:J="Backspace",selectionKeyCode:ee="Shift",selectionOnDrag:K=!1,selectionMode:ne=jo.Full,panActivationKeyCode:me="Space",multiSelectionKeyCode:W=So()?"Meta":"Control",zoomActivationKeyCode:Q=So()?"Meta":"Control",snapToGrid:Z,snapGrid:ae,onlyRenderVisibleElements:fe=!1,selectNodesOnDrag:pe,nodesDraggable:Se,autoPanOnNodeFocus:Xe,nodesConnectable:Pe,nodesFocusable:lt,nodeOrigin:Pt=fN,edgesFocusable:Ae,edgesReconnectable:Qe,elementsSelectable:xt=!0,defaultViewport:zt=TI,minZoom:te=.5,maxZoom:oe=2,translateExtent:V=No,preventScrolling:se=!0,nodeExtent:he,defaultMarkerColor:de="#b1b1b7",zoomOnScroll:be=!0,zoomOnPinch:Ie=!0,panOnScroll:G=!1,panOnScrollSpeed:le=.5,panOnScrollMode:ge=Os.Free,zoomOnDoubleClick:Ue=!0,panOnDrag:ct=!0,onPaneClick:ce,onPaneMouseEnter:Me,onPaneMouseMove:Ne,onPaneMouseLeave:Re,onPaneScroll:wt,onPaneContextMenu:ie,paneClickDistance:Ze=0,nodeClickDistance:dt=0,children:jt,onReconnect:Ln,onReconnectStart:Je,onReconnectEnd:Wt,onEdgeContextMenu:Js,onEdgeDoubleClick:Kt,onEdgeMouseEnter:Qt,onEdgeMouseMove:Qo,onEdgeMouseLeave:ir,reconnectRadius:np=10,onNodesChange:ZN,onEdgesChange:JN,noDragClassName:ej="nodrag",noWheelClassName:tj="nowheel",noPanClassName:rp="nopan",fitView:sp,fitViewOptions:ap,connectOnClick:nj,attributionPosition:rj,proOptions:sj,defaultEdgeOptions:aj,elevateNodesOnSelect:ij,elevateEdgesOnSelect:oj,disableKeyboardA11y:ip=!1,autoPanOnConnect:lj,autoPanOnNodeDrag:cj,autoPanSpeed:dj,connectionRadius:uj,isValidConnection:fj,onError:hj,style:mj,id:op,nodeDragThreshold:pj,connectionDragThreshold:xj,viewport:gj,onViewportChange:yj,width:vj,height:wj,colorMode:bj="light",debug:Nj,onScroll:Zo,ariaLabelConfig:jj,...kj},Sj){const Rd=op||"1",Cj=II(bj),Ej=p.useCallback(lp=>{lp.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Zo==null||Zo(lp)},[Zo]);return a.jsx("div",{"data-testid":"rf__wrapper",...kj,onScroll:Ej,style:{...mj,...t6},ref:Sj,className:pt(["react-flow",s,Cj]),id:op,role:"application",children:a.jsxs(e6,{nodes:e,edges:t,width:vj,height:wj,fitView:sp,fitViewOptions:ap,minZoom:te,maxZoom:oe,nodeOrigin:Pt,nodeExtent:he,children:[a.jsx(Qz,{onInit:d,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:x,onNodeMouseLeave:j,onNodeContextMenu:N,onNodeDoubleClick:k,nodeTypes:i,edgeTypes:o,connectionLineType:T,connectionLineStyle:F,connectionLineComponent:H,connectionLineContainerStyle:X,selectionKeyCode:ee,selectionOnDrag:K,selectionMode:ne,deleteKeyCode:J,multiSelectionKeyCode:W,panActivationKeyCode:me,zoomActivationKeyCode:Q,onlyRenderVisibleElements:fe,defaultViewport:zt,translateExtent:V,minZoom:te,maxZoom:oe,preventScrolling:se,zoomOnScroll:be,zoomOnPinch:Ie,zoomOnDoubleClick:Ue,panOnScroll:G,panOnScrollSpeed:le,panOnScrollMode:ge,panOnDrag:ct,onPaneClick:ce,onPaneMouseEnter:Me,onPaneMouseMove:Ne,onPaneMouseLeave:Re,onPaneScroll:wt,onPaneContextMenu:ie,paneClickDistance:Ze,nodeClickDistance:dt,onSelectionContextMenu:P,onSelectionStart:C,onSelectionEnd:_,onReconnect:Ln,onReconnectStart:Je,onReconnectEnd:Wt,onEdgeContextMenu:Js,onEdgeDoubleClick:Kt,onEdgeMouseEnter:Qt,onEdgeMouseMove:Qo,onEdgeMouseLeave:ir,reconnectRadius:np,defaultMarkerColor:de,noDragClassName:ej,noWheelClassName:tj,noPanClassName:rp,rfId:Rd,disableKeyboardA11y:ip,nodeExtent:he,viewport:gj,onViewportChange:yj}),a.jsx(RI,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:m,onConnectStart:w,onConnectEnd:y,onClickConnectStart:b,onClickConnectEnd:g,nodesDraggable:Se,autoPanOnNodeFocus:Xe,nodesConnectable:Pe,nodesFocusable:lt,edgesFocusable:Ae,edgesReconnectable:Qe,elementsSelectable:xt,elevateNodesOnSelect:ij,elevateEdgesOnSelect:oj,minZoom:te,maxZoom:oe,nodeExtent:he,onNodesChange:ZN,onEdgesChange:JN,snapToGrid:Z,snapGrid:ae,connectionMode:B,translateExtent:V,connectOnClick:nj,defaultEdgeOptions:aj,fitView:sp,fitViewOptions:ap,onNodesDelete:$,onEdgesDelete:A,onDelete:O,onNodeDragStart:S,onNodeDrag:M,onNodeDragStop:z,onSelectionDrag:I,onSelectionDragStart:E,onSelectionDragStop:D,onMove:f,onMoveStart:u,onMoveEnd:h,noPanClassName:rp,nodeOrigin:Pt,rfId:Rd,autoPanOnConnect:lj,autoPanOnNodeDrag:cj,autoPanSpeed:dj,onError:hj,connectionRadius:uj,isValidConnection:fj,selectNodesOnDrag:pe,nodeDragThreshold:pj,connectionDragThreshold:xj,onBeforeDelete:R,paneClickDistance:Ze,debug:Nj,ariaLabelConfig:jj}),a.jsx(DI,{onSelectionChange:L}),jt,a.jsx(CI,{proOptions:sj,position:rj}),a.jsx(SI,{rfId:Rd,disableKeyboardA11y:ip})]})})}var r6=xN(n6);function s6(e){const[t,n]=p.useState(e),r=p.useCallback(s=>n(i=>mN(s,i)),[]);return[t,n,r]}function a6(e){const[t,n]=p.useState(e),r=p.useCallback(s=>n(i=>pN(s,i)),[]);return[t,n,r]}function i6({dimensions:e,lineWidth:t,variant:n,className:r}){return a.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:pt(["react-flow__background-pattern",n,r])})}function o6({radius:e,className:t}){return a.jsx("circle",{cx:e,cy:e,r:e,className:pt(["react-flow__background-pattern","dots",t])})}var wr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(wr||(wr={}));const l6={[wr.Dots]:1,[wr.Lines]:1,[wr.Cross]:6},c6=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function FN({id:e,variant:t=wr.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=0,color:o,bgColor:l,style:c,className:d,patternClassName:f}){const u=p.useRef(null),{transform:h,patternId:m}=_e(c6,st),w=r||l6[t],y=t===wr.Dots,b=t===wr.Cross,g=Array.isArray(n)?n:[n,n],v=[g[0]*h[2]||1,g[1]*h[2]||1],x=w*h[2],j=Array.isArray(i)?i:[i,i],N=b?[x,x]:v,k=[j[0]*h[2]||1+N[0]/2,j[1]*h[2]||1+N[1]/2],S=`${m}${e||""}`;return a.jsxs("svg",{className:pt(["react-flow__background",d]),style:{...c,...Pd,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:u,"data-testid":"rf__background",children:[a.jsx("pattern",{id:S,x:h[0]%v[0],y:h[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:y?a.jsx(o6,{radius:x/2,className:f}):a.jsx(i6,{dimensions:N,lineWidth:s,variant:t,className:f})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${S})`})]})}FN.displayName="Background";const d6=p.memo(FN);function u6(){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 f6(){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 h6(){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 m6(){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 p6(){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 Dl({children:e,className:t,...n}){return a.jsx("button",{type:"button",className:pt(["react-flow__controls-button",t]),...n,children:e})}const x6=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function BN({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:d,children:f,position:u="bottom-left",orientation:h="vertical","aria-label":m}){const w=Ke(),{isInteractive:y,minZoomReached:b,maxZoomReached:g,ariaLabelConfig:v}=_e(x6,st),{zoomIn:x,zoomOut:j,fitView:N}=Jm(),k=()=>{x(),i==null||i()},S=()=>{j(),o==null||o()},M=()=>{N(s),l==null||l()},z=()=>{w.setState({nodesDraggable:!y,nodesConnectable:!y,elementsSelectable:!y}),c==null||c(!y)},$=h==="horizontal"?"horizontal":"vertical";return a.jsxs(_d,{className:pt(["react-flow__controls",$,d]),position:u,style:e,"data-testid":"rf__controls","aria-label":m??v["controls.ariaLabel"],children:[t&&a.jsxs(a.Fragment,{children:[a.jsx(Dl,{onClick:k,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:g,children:a.jsx(u6,{})}),a.jsx(Dl,{onClick:S,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:b,children:a.jsx(f6,{})})]}),n&&a.jsx(Dl,{className:"react-flow__controls-fitview",onClick:M,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:a.jsx(h6,{})}),r&&a.jsx(Dl,{className:"react-flow__controls-interactive",onClick:z,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:y?a.jsx(p6,{}):a.jsx(m6,{})}),f]})}BN.displayName="Controls";const g6=p.memo(BN);function y6({id:e,x:t,y:n,width:r,height:s,style:i,color:o,strokeColor:l,strokeWidth:c,className:d,borderRadius:f,shapeRendering:u,selected:h,onClick:m}){const{background:w,backgroundColor:y}=i||{},b=o||w||y;return a.jsx("rect",{className:pt(["react-flow__minimap-node",{selected:h},d]),x:t,y:n,rx:f,ry:f,width:r,height:s,style:{fill:b,stroke:l,strokeWidth:c},shapeRendering:u,onClick:m?g=>m(g,e):void 0})}const v6=p.memo(y6),w6=e=>e.nodes.map(t=>t.id),zu=e=>e instanceof Function?e:()=>e;function b6({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=v6,onClick:o}){const l=_e(w6,st),c=zu(t),d=zu(e),f=zu(n),u=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(h=>a.jsx(j6,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:f,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:o,shapeRendering:u},h))})}function N6({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:d,x:f,y:u,width:h,height:m}=_e(w=>{const{internals:y}=w.nodeLookup.get(e),b=y.userNode,{x:g,y:v}=y.positionAbsolute,{width:x,height:j}=_r(b);return{node:b,x:g,y:v,width:x,height:j}},st);return!d||d.hidden||!$1(d)?null:a.jsx(l,{x:f,y:u,width:h,height:m,style:d.style,selected:!!d.selected,className:r(d),color:t(d),borderRadius:s,strokeColor:n(d),strokeWidth:i,shapeRendering:o,onClick:c,id:d.id})}const j6=p.memo(N6);var k6=p.memo(b6);const S6=200,C6=150,E6=e=>!e.hidden,M6=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?z1(qo(e.nodeLookup,{filter:E6}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},_6="react-flow__minimap-desc";function WN({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:d,maskStrokeColor:f,maskStrokeWidth:u,position:h="bottom-right",onClick:m,onNodeClick:w,pannable:y=!1,zoomable:b=!1,ariaLabel:g,inversePan:v,zoomStep:x=1,offsetScale:j=5}){const N=Ke(),k=p.useRef(null),{boundingRect:S,viewBB:M,rfId:z,panZoom:$,translateExtent:A,flowWidth:O,flowHeight:L,ariaLabelConfig:E}=_e(M6,st),I=(e==null?void 0:e.width)??S6,D=(e==null?void 0:e.height)??C6,P=S.width/I,C=S.height/D,_=Math.max(P,C),R=_*I,B=_*D,T=j*_,F=S.x-(R-S.width)/2-T,H=S.y-(B-S.height)/2-T,X=R+T*2,J=B+T*2,ee=`${_6}-${z}`,K=p.useRef(0),ne=p.useRef();K.current=_,p.useEffect(()=>{if(k.current&&$)return ne.current=PR({domNode:k.current,panZoom:$,getTransform:()=>N.getState().transform,getViewScale:()=>K.current}),()=>{var Z;(Z=ne.current)==null||Z.destroy()}},[$]),p.useEffect(()=>{var Z;(Z=ne.current)==null||Z.update({translateExtent:A,width:O,height:L,inversePan:v,pannable:y,zoomStep:x,zoomable:b})},[y,b,v,x,A,O,L]);const me=m?Z=>{var pe;const[ae,fe]=((pe=ne.current)==null?void 0:pe.pointer(Z))||[0,0];m(Z,{x:ae,y:fe})}:void 0,W=w?p.useCallback((Z,ae)=>{const fe=N.getState().nodeLookup.get(ae).internals.userNode;w(Z,fe)},[]):void 0,Q=g??E["minimap.ariaLabel"];return a.jsx(_d,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-width-props":typeof u=="number"?u*_:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:pt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:I,height:D,viewBox:`${F} ${H} ${X} ${J}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ee,ref:k,onClick:me,children:[Q&&a.jsx("title",{id:ee,children:Q}),a.jsx(k6,{onClick:W,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:o,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${F-T},${H-T}h${X+T*2}v${J+T*2}h${-X-T*2}z
|
|
405
|
+
M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}WN.displayName="MiniMap";const P6=p.memo(WN),D6=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,T6={[Ja.Line]:"right",[Ja.Handle]:"bottom-right"};function O6({nodeId:e,position:t,variant:n=Ja.Handle,className:r,style:s=void 0,children:i,color:o,minWidth:l=10,minHeight:c=10,maxWidth:d=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:u=!1,resizeDirection:h,autoScale:m=!0,shouldResize:w,onResizeStart:y,onResize:b,onResizeEnd:g}){const v=wN(),x=typeof e=="string"?e:v,j=Ke(),N=p.useRef(null),k=n===Ja.Handle,S=_e(p.useCallback(D6(k&&m),[k,m]),st),M=p.useRef(null),z=t??T6[n];p.useEffect(()=>{if(!(!N.current||!x))return M.current||(M.current=YR({domNode:N.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:A,transform:O,snapGrid:L,snapToGrid:E,nodeOrigin:I,domNode:D}=j.getState();return{nodeLookup:A,transform:O,snapGrid:L,snapToGrid:E,nodeOrigin:I,paneDomNode:D}},onChange:(A,O)=>{const{triggerNodeChanges:L,nodeLookup:E,parentLookup:I,nodeOrigin:D}=j.getState(),P=[],C={x:A.x,y:A.y},_=E.get(x);if(_&&_.expandParent&&_.parentId){const R=_.origin??D,B=A.width??_.measured.width??0,T=A.height??_.measured.height??0,F={id:_.id,parentId:_.parentId,rect:{width:B,height:T,...L1({x:A.x??_.position.x,y:A.y??_.position.y},{width:B,height:T},_.parentId,E,R)}},H=Zm([F],E,I,D);P.push(...H),C.x=A.x?Math.max(R[0]*B,A.x):void 0,C.y=A.y?Math.max(R[1]*T,A.y):void 0}if(C.x!==void 0&&C.y!==void 0){const R={id:x,type:"position",position:{...C}};P.push(R)}if(A.width!==void 0&&A.height!==void 0){const B={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:A.width,height:A.height}};P.push(B)}for(const R of O){const B={...R,type:"position"};P.push(B)}L(P)},onEnd:({width:A,height:O})=>{const L={id:x,type:"dimensions",resizing:!1,dimensions:{width:A,height:O}};j.getState().triggerNodeChanges([L])}})),M.current.update({controlPosition:z,boundaries:{minWidth:l,minHeight:c,maxWidth:d,maxHeight:f},keepAspectRatio:u,resizeDirection:h,onResizeStart:y,onResize:b,onResizeEnd:g,shouldResize:w}),()=>{var A;(A=M.current)==null||A.destroy()}},[z,l,c,d,f,u,y,b,g,w]);const $=z.split("-");return a.jsx("div",{className:pt(["react-flow__resize-control","nodrag",...$,n,r]),ref:N,style:{...s,scale:S,...o&&{[k?"backgroundColor":"borderColor"]:o}},children:i})}p.memo(O6);var A6=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"}),R6="VisuallyHidden",UN=p.forwardRef((e,t)=>a.jsx(Ge.span,{...e,ref:t,style:{...A6,...e.style}}));UN.displayName=R6;var I6=UN,[Td]=id("Tooltip",[gd]),Od=gd(),VN="TooltipProvider",z6=700,uh="tooltip.open",[$6,tp]=Td(VN),HN=e=>{const{__scopeTooltip:t,delayDuration:n=z6,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,o=p.useRef(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),a.jsx($6,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})};HN.displayName=VN;var Mo="Tooltip",[L6,Ad]=Td(Mo),YN=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=tp(Mo,e.__scopeTooltip),d=Od(t),[f,u]=p.useState(null),h=On(),m=p.useRef(0),w=o??c.disableHoverableContent,y=l??c.delayDuration,b=p.useRef(!1),[g,v]=xm({prop:r,defaultProp:s??!1,onChange:S=>{S?(c.onOpen(),document.dispatchEvent(new CustomEvent(uh))):c.onClose(),i==null||i(S)},caller:Mo}),x=p.useMemo(()=>g?b.current?"delayed-open":"instant-open":"closed",[g]),j=p.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b.current=!1,v(!0)},[v]),N=p.useCallback(()=>{window.clearTimeout(m.current),m.current=0,v(!1)},[v]),k=p.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{b.current=!0,v(!0),m.current=0},y)},[y,v]);return p.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),a.jsx(zb,{...d,children:a.jsx(L6,{scope:t,contentId:h,open:g,stateAttribute:x,trigger:f,onTriggerChange:u,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?k():j()},[c.isOpenDelayedRef,k,j]),onTriggerLeave:p.useCallback(()=>{w?N():(window.clearTimeout(m.current),m.current=0)},[N,w]),onOpen:j,onClose:N,disableHoverableContent:w,children:n})})};YN.displayName=Mo;var fh="TooltipTrigger",XN=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Ad(fh,n),i=tp(fh,n),o=Od(n),l=p.useRef(null),c=fn(t,l,s.onTriggerChange),d=p.useRef(!1),f=p.useRef(!1),u=p.useCallback(()=>d.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),a.jsx(Im,{asChild:!0,...o,children:a.jsx(Ge.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:yt(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:yt(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:yt(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:yt(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:yt(e.onBlur,s.onClose),onClick:yt(e.onClick,s.onClose)})})});XN.displayName=fh;var F6="TooltipPortal",[y$,B6]=Td(F6,{forceMount:void 0}),ti="TooltipContent",qN=p.forwardRef((e,t)=>{const n=B6(ti,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,o=Ad(ti,e.__scopeTooltip);return a.jsx(Zs,{present:r||o.open,children:o.disableHoverableContent?a.jsx(GN,{side:s,...i,ref:t}):a.jsx(W6,{side:s,...i,ref:t})})}),W6=p.forwardRef((e,t)=>{const n=Ad(ti,e.__scopeTooltip),r=tp(ti,e.__scopeTooltip),s=p.useRef(null),i=fn(t,s),[o,l]=p.useState(null),{trigger:c,onClose:d}=n,f=s.current,{onPointerInTransitChange:u}=r,h=p.useCallback(()=>{l(null),u(!1)},[u]),m=p.useCallback((w,y)=>{const b=w.currentTarget,g={x:w.clientX,y:w.clientY},v=X6(g,b.getBoundingClientRect()),x=q6(g,v),j=G6(y.getBoundingClientRect()),N=Q6([...x,...j]);l(N),u(!0)},[u]);return p.useEffect(()=>()=>h(),[h]),p.useEffect(()=>{if(c&&f){const w=b=>m(b,f),y=b=>m(b,c);return c.addEventListener("pointerleave",w),f.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",w),f.removeEventListener("pointerleave",y)}}},[c,f,m,h]),p.useEffect(()=>{if(o){const w=y=>{const b=y.target,g={x:y.clientX,y:y.clientY},v=(c==null?void 0:c.contains(b))||(f==null?void 0:f.contains(b)),x=!K6(g,o);v?h():x&&(h(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[c,f,o,d,h]),a.jsx(GN,{...e,ref:i})}),[U6,V6]=Td(Mo,{isInside:!1}),H6=iE("TooltipContent"),GN=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=Ad(ti,n),d=Od(n),{onClose:f}=c;return p.useEffect(()=>(document.addEventListener(uh,f),()=>document.removeEventListener(uh,f)),[f]),p.useEffect(()=>{if(c.trigger){const u=h=>{const m=h.target;m!=null&&m.contains(c.trigger)&&f()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[c.trigger,f]),a.jsx(ld,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:u=>u.preventDefault(),onDismiss:f,children:a.jsxs($b,{"data-state":c.stateAttribute,...d,...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(H6,{children:r}),a.jsx(U6,{scope:n,isInside:!0,children:a.jsx(I6,{id:c.contentId,role:"tooltip",children:s||r})})]})})});qN.displayName=ti;var KN="TooltipArrow",Y6=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Od(n);return V6(KN,n).isInside?null:a.jsx(Lb,{...s,...r,ref:t})});Y6.displayName=KN;function X6(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function q6(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function G6(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function K6(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],d=l.x,f=l.y,u=c.x,h=c.y;f>r!=h>r&&n<(u-d)*(r-f)/(h-f)+d&&(s=!s)}return s}function Q6(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Z6(t)}function Z6(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}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 J6=HN,e$=YN,t$=XN,QN=qN;const $u=J6,Lu=e$,Fu=t$,Jl=p.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(QN,{ref:r,sideOffset:t,className:we("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}));Jl.displayName=QN.displayName;const n$=320,r$=32,s$=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",hh=({data:e,targetPosition:t,sourcePosition:n})=>{const r=e,[s,i]=p.useState(!1),[o,l]=p.useState(!1),c="!h-2 !w-2 !min-w-0 !min-h-0 !cursor-grab !border-0 opacity-0 hover:opacity-100 transition-opacity",d=s$(r.plugin||"core");return r.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:`${r.name}-foreign-key`,children:[a.jsx(Be,{size:12,className:"text-gray-400"}),a.jsx("span",{className:"font-medium",children:r.displayName||r.name}),t&&a.jsx(As,{type:"target",id:r.name,position:t,className:we(c)})]})}):a.jsx("div",{className:"relative",children:a.jsxs("div",{className:we("border border-gray-700 overflow-hidden shadow-xl bg-gray-900 rounded-lg","hover:border-gray-600 transition-colors duration-200"),style:{width:n$},id:`${r.name}-schema-node`,children:[a.jsxs("div",{className:we("px-4 py-3 bg-black border-b border-gray-700 flex items-center justify-between","cursor-pointer select-none"),onClick:()=>i(!s),children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Be,{size:16,className:"text-white"}),a.jsx("span",{className:"text-white font-semibold text-sm",children:r.displayName||r.name})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:f=>{f.stopPropagation(),l(!o)},className:"p-1 hover:bg-gray-800 rounded transition-colors",children:o?a.jsx(OC,{size:12,className:"text-gray-400"}):a.jsx(zo,{size:12,className:"text-gray-400"})}),s?a.jsx(hm,{size:14,className:"text-gray-400"}):a.jsx(Io,{size:14,className:"text-gray-400"})]})]}),!s&&a.jsx("div",{className:"max-h-96 bg-black overflow-y-auto",children:r.columns.map(f=>a.jsxs("div",{className:we("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:r$},children:[a.jsxs("div",{className:"flex items-center gap-1 mr-3 min-w-[40px]",children:[f.isPrimary&&a.jsx($u,{delayDuration:100,children:a.jsxs(Lu,{children:[a.jsx(Fu,{asChild:!0,children:a.jsx(Ff,{size:10,className:"text-yellow-400 flex-shrink-0"})}),a.jsx(Jl,{className:"bg-black border-gray-600 text-white text-xs",children:"Primary Key"})]})}),f.isUnique&&!f.isPrimary&&a.jsx($u,{delayDuration:100,children:a.jsxs(Lu,{children:[a.jsx(Fu,{asChild:!0,children:a.jsx(AC,{size:10,className:"text-green-400 flex-shrink-0"})}),a.jsx(Jl,{className:"bg-black border-gray-600 text-white text-xs",children:"Unique"})]})}),f.isIdentity&&a.jsx($u,{delayDuration:100,children:a.jsxs(Lu,{children:[a.jsx(Fu,{asChild:!0,children:a.jsx(RC,{size:10,className:"text-blue-400 flex-shrink-0"})}),a.jsx(Jl,{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:[!f.isNullable&&a.jsx("span",{className:"text-red-400 text-xs",children:"*"}),a.jsx("span",{className:"text-white font-medium truncate",children:f.name}),a.jsx("span",{className:"text-gray-400 font-mono text-xs",children:f.format})]}),o&&f.description&&a.jsx("div",{className:"text-gray-500 text-xs mt-1 truncate",children:f.description})]}),a.jsx("div",{className:"ml-2",children:a.jsx("span",{className:we("px-2 py-1 rounded text-xs font-medium",d),children:f.plugin})}),a.jsx(As,{type:"target",id:f.id,position:t||"left",className:we(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(As,{type:"source",id:f.id,position:n||"right",className:we(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)"}})]},f.id))}),r.relationships&&r.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:[r.relationships.length," relationship",r.relationships.length!==1?"s":""]})})]})})},a$={databaseSchemaNode:hh},N0=[{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 i$(){const[e,t]=p.useState(null),[n,r]=p.useState(!0),[s,i]=p.useState(null),[o,l]=p.useState([]),[c,d]=p.useState([]),[f,u,h]=s6([]),[m,w,y]=a6([]),b=p.useCallback(N=>{const k=N0.find(S=>S.name===N);return(k==null?void 0:k.color)||"bg-gray-500"},[]),g=p.useCallback((N,k,S)=>{if(N==="user"||N==="session"||N==="account"||N==="verification")return"core";for(const M of S)if(N===M||N.includes(M))return M;return"core"},[]),v=p.useCallback(async()=>{try{const k=await(await fetch("/api/plugins")).json();if(k.plugins&&Array.isArray(k.plugins)){const S=k.plugins.map(M=>({name:M.id,displayName:M.name||M.id,description:M.description||`${M.id} plugin for Better Auth`,color:b(M.id)}));d(S),l(S.map(M=>M.name))}}catch{d(N0),l(["organization"])}},[b]),x=p.useCallback(async N=>{try{r(!0);const k=N.length>0?`?plugins=${N.join(",")}`:"",M=await(await fetch(`/api/database/schema${k}`)).json();M.success?t(M.schema):i(M.error||"Failed to fetch schema")}catch{i("Failed to fetch database schema")}finally{r(!1)}},[]);p.useEffect(()=>{v()},[v]),p.useEffect(()=>{o.length>0&&x(o)},[o,x]),p.useEffect(()=>{if(!e)return;const N=[],k=[];e.tables.forEach((S,M)=>{const z=S.fields.map($=>({id:`${S.name}-${$.name}`,isPrimary:$.primaryKey||!1,isNullable:!$.required,isUnique:$.unique||!1,isIdentity:!1,name:$.name,format:$.type,plugin:g(S.name,$.name,o)}));N.push({id:S.name,type:"databaseSchemaNode",position:{x:M%3*380,y:Math.floor(M/3)*320},data:{name:S.name,displayName:S.displayName,isForeign:!1,plugin:g(S.name,"",o),columns:z.map($=>{var A;return{...$,description:((A=S.fields.find(O=>O.name===$.name))==null?void 0:A.description)||""}}),relationships:S.relationships}})}),e.tables.forEach(S=>{S.relationships.forEach(M=>{if(M.type==="many-to-one")return;const z=S.name,$=M.target,A=N.find(L=>L.id===z),O=N.find(L=>L.id===$);if(A&&O){const L=M.type==="one-to-one"?"1:1":"1:N";k.push({id:`${z}-${$}-${M.field}`,source:z,target:$,type:"smoothstep",animated:!1,style:{stroke:"#6b7280",strokeWidth:2,strokeDasharray:"0"},label:L,labelStyle:{fontSize:"11px",fill:"#9ca3af",fontWeight:"500"},labelBgStyle:{fill:"rgba(0, 0, 0, 0.9)",fillOpacity:1,rx:4,ry:4},markerEnd:{type:"arrowclosed",color:"#6b7280",width:12,height:12}})}})}),u(N),w(k)},[e,o,u,w,g]);const j=p.useCallback(N=>w(k=>Y1(N,k)),[w]);return n?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..."})]}):s?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:s})]})}):a.jsxs("div",{className:"p-6 h-screen flex flex-col bg-black",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(Be,{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(St,{className:"rounded-none bg-black h-fit shadow-sm",children:[a.jsx(hn,{children:a.jsxs(mn,{className:"font-light text-xl text-white flex items-center space-x-2",children:[a.jsx(Ps,{className:"w-5 h-5"}),a.jsx("span",{children:"Plugins"})]})}),a.jsx(Ct,{className:"space-y-3",children:c.length>0?c.map(N=>a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:`w-3 h-3 rounded-full ${N.color}`}),a.jsx("label",{htmlFor:N.name,className:"text-sm font-medium text-white cursor-pointer",children:N.displayName.slice(0,1).toUpperCase()+N.displayName.slice(1).replace("-"," ")})]},N.name)):a.jsx("div",{className:"text-sm text-white/70",children:"No plugins detected in configuration"})})]}),e&&a.jsxs(St,{className:"rounded-none bg-black mt-4 shadow-sm",children:[a.jsx(hn,{children:a.jsx(mn,{className:"text-white text-sm",children:"Schema Info"})}),a.jsxs(Ct,{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((N,k)=>N+k.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(r6,{nodes:f,edges:m,onNodesChange:h,onEdgesChange:y,onConnect:j,nodeTypes:a$,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(g6,{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(P6,{className:"bg-gray-900 border-gray-700",nodeColor:N=>{var k;return(k=N.data)!=null&&k.isForeign?"#374151":"#1f2937"},maskColor:"rgba(0, 0, 0, 0.9)"}),a.jsx(d6,{variant:wr.Dots,gap:20,size:1,color:"#374151"})]})})})]})]})}const o$={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"}]},l$={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 c$(){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(hh,{data:o$,targetPosition:"left",sourcePosition:"right"})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl text-white mb-4",children:"Organization Plugin Table"}),a.jsx(hh,{data:l$,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"]})]})]})]})})}function d$(){const{orgId:e}=fm(),t=Qs(),[n,r]=p.useState(null),[s,i]=p.useState([]),[o,l]=p.useState([]),[c,d]=p.useState([]),[f,u]=p.useState(!0),[h,m]=p.useState("details"),[w,y]=p.useState(!1),[b,g]=p.useState(!1),[v,x]=p.useState(!1),[j,N]=p.useState(!1),[k,S]=p.useState(!1),[M,z]=p.useState(!1),[$,A]=p.useState(!1),[O,L]=p.useState(!1),[E,I]=p.useState(null),[D,P]=p.useState(""),[C,_]=p.useState(""),[R,B]=p.useState([]),[T,F]=p.useState({name:""}),[H,X]=p.useState(!1),[J,ee]=p.useState([]),[K,ne]=p.useState(!1),[me,W]=p.useState([]),[Q,Z]=p.useState(!1);p.useEffect(()=>{e&&(fe(),Se(),pe(),Pe(),lt(),Xe())},[e]),p.useEffect(()=>{w&&e&&Xe()},[]),p.useEffect(()=>{h==="members"&&e&<()},[h,e]),p.useEffect(()=>{h==="invitations"&&e&&Pe()},[h,e]);const ae=G=>{F({name:G})},fe=async()=>{try{const le=await(await fetch(`/api/organizations/${e}`)).json();le.success&&le.organization||le.organization?r(le.organization):q.error("Organization not found")}catch(G){console.error("Failed to fetch organization:",G),q.error("Failed to load organization")}finally{u(!1)}},pe=async()=>{try{const le=await(await fetch("/api/plugins/teams/status")).json();y(le.enabled)}catch(G){console.error("Failed to check teams status:",G),y(!1)}},Se=async()=>{try{const le=await(await fetch("/api/plugins/organization/status")).json();g(le.enabled)}catch(G){console.error("Failed to check organization status:",G),g(!1)}},Xe=async()=>{try{const le=await(await fetch(`/api/organizations/${e}/teams`)).json();le.success&&i(le.teams||[])}catch(G){console.error("Failed to fetch teams:",G),q.error("Failed to load teams")}},Pe=async()=>{try{const le=await(await fetch(`/api/organizations/${e}/invitations`)).json();le.success&&l(le.invitations||[])}catch(G){console.error("Failed to fetch invitations:",G),q.error("Failed to load invitations")}},lt=async()=>{try{const le=await(await fetch(`/api/organizations/${e}/members`)).json();le.success&&d(le.members||[])}catch(G){console.error("Failed to fetch members:",G),q.error("Failed to load members")}},Pt=async G=>{ee([]),ne(!0),ee([{id:"start",type:"info",message:`Starting member seeding process for ${G} members...`,timestamp:new Date}]);try{const ge=await(await fetch(`/api/organizations/${e}/seed-members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:G})})).json();if(ge.success){const Ue=ge.results.map((ce,Me)=>ce.success?{id:`member-${Me}`,type:"progress",message:`Adding member: ${ce.member.user.name} (${ce.member.user.email})`,timestamp:new Date,status:"completed"}:{id:`member-${Me}`,type:"error",message:`Failed to add member ${Me+1}: ${ce.error}`,timestamp:new Date});ee(ce=>[...ce,...Ue]);const ct=ge.results.filter(ce=>ce.success).length;ee(ce=>[...ce,{id:"complete",type:"success",message:`✅ Seeding completed! Added ${ct}/${G} members successfully`,timestamp:new Date}]),await lt(),q.success(`Successfully added ${ct} members!`)}else ee(Ue=>[...Ue,{id:"error",type:"error",message:`❌ Seeding failed: ${ge.error||"Unknown error"}`,timestamp:new Date}]),q.error(ge.error||"Failed to seed members")}catch(le){ee(ge=>[...ge,{id:"error",type:"error",message:`❌ Network error: ${le}`,timestamp:new Date}]),q.error("Failed to seed members")}finally{ne(!1)}},Ae=async G=>{W([]),Z(!0),W([{id:"start",type:"info",message:`Starting team seeding process for ${G} teams...`,timestamp:new Date}]);try{const ge=await(await fetch(`/api/organizations/${e}/seed-teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:G})})).json();if(ge.success){const Ue=ge.results.map((ce,Me)=>ce.success?{id:`team-${Me}`,type:"progress",message:`Creating team: ${ce.team.name}`,timestamp:new Date,status:"completed"}:{id:`team-${Me}`,type:"error",message:`Failed to create team ${Me+1}: ${ce.error}`,timestamp:new Date});W(ce=>[...ce,...Ue]);const ct=ge.results.filter(ce=>ce.success).length;W(ce=>[...ce,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${ct}/${G} teams successfully`,timestamp:new Date}]),await Xe(),q.success(`Successfully created ${ct} teams!`)}else W(Ue=>[...Ue,{id:"error",type:"error",message:`❌ Seeding failed: ${ge.error||"Unknown error"}`,timestamp:new Date}]),q.error(ge.error||"Failed to seed teams")}catch(le){W(ge=>[...ge,{id:"error",type:"error",message:`❌ Network error: ${le}`,timestamp:new Date}]),q.error("Failed to seed teams")}finally{Z(!1)}},Qe=async()=>{try{const le=await(await fetch("/api/users/all")).json();le.success&&B(le.users||[])}catch(G){console.error("Failed to fetch users:",G)}},xt=()=>{Qe(),x(!0)},zt=async()=>{if(!D){q.error("Please enter an email address");return}if(!C){q.error("Please select an inviter");return}X(!0);const G=q.loading("Sending invitation...");try{const ge=await(await fetch(`/api/organizations/${e}/invitations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:D,role:"member",inviterId:C})})).json();ge.success?(await Pe(),x(!1),P(""),_(""),q.success("Invitation sent successfully!",{id:G})):q.error(`Error sending invitation: ${ge.error||"Unknown error"}`,{id:G})}catch(le){console.error("Error sending invitation:",le),q.error("Error sending invitation",{id:G})}finally{X(!1)}},te=async G=>{const le=q.loading("Cancelling invitation...");try{const Ue=await(await fetch(`/api/invitations/${G}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();Ue.success?(await Pe(),q.success("Invitation cancelled successfully!",{id:le})):q.error(`Error cancelling invitation: ${Ue.error||"Unknown error"}`,{id:le})}catch(ge){console.error("Error cancelling invitation:",ge),q.error("Error cancelling invitation",{id:le})}},oe=async(G,le)=>{const ge=q.loading("Resending invitation...");try{const ct=await(await fetch(`/api/invitations/${G}/resend`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();ct.success?(await Pe(),q.success(`Invitation resent to ${le}!`,{id:ge})):q.error(`Error resending invitation: ${ct.error||"Unknown error"}`,{id:ge})}catch(Ue){console.error("Error resending invitation:",Ue),q.error("Error resending invitation",{id:ge})}},V=async(G,le)=>{const ge=q.loading(`Removing ${le}...`);try{const ct=await(await fetch(`/api/members/${G}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();ct.success?(await lt(),q.success(`${le} removed from organization!`,{id:ge})):q.error(`Error removing member: ${ct.error||"Unknown error"}`,{id:ge})}catch(Ue){console.error("Error removing member:",Ue),q.error("Error removing member",{id:ge})}},se=async()=>{if(!T.name){q.error("Please enter a team name");return}const G=q.loading("Creating team...");try{const ge=await(await fetch(`/api/organizations/${e}/teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:T.name,organizationId:e})})).json();ge.success?(await Xe(),z(!1),F({name:""}),q.success("Team created successfully!",{id:G})):q.error(`Error creating team: ${ge.error||"Unknown error"}`,{id:G})}catch(le){console.error("Error creating team:",le),q.error("Error creating team",{id:G})}},he=async()=>{if(!E||!T.name){q.error("Please enter a team name");return}const G=q.loading("Updating team...");try{const ge=await(await fetch(`/api/teams/${E.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:T.name})})).json();ge.success?(await Xe(),A(!1),I(null),F({name:""}),q.success("Team updated successfully!",{id:G})):q.error(`Error updating team: ${ge.error||"Unknown error"}`,{id:G})}catch(le){console.error("Error updating team:",le),q.error("Error updating team",{id:G})}},de=async()=>{if(!E){q.error("No team selected");return}const G=q.loading("Deleting team...");try{const ge=await(await fetch(`/api/teams/${E.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();ge.success?(await Xe(),L(!1),I(null),q.success("Team deleted successfully!",{id:G})):q.error(`Error deleting team: ${ge.error||"Unknown error"}`,{id:G})}catch(le){console.error("Error deleting team:",le),q.error("Error deleting team",{id:G})}},be=G=>{I(G),F({name:G.name}),A(!0)},Ie=G=>{I(G),L(!0)};return f?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(Rt,{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(_a,{to:"/organizations",children:a.jsxs(U,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(fo,{className:"w-4 h-4 mr-2"}),"Back to Organizations"]})})}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(U,{onClick:()=>N(!0),className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[a.jsx(Oe,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),a.jsxs(U,{onClick:xt,className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[a.jsx(pn,{className:"w-4 h-4 mr-2"}),"Invite User"]}),a.jsxs(U,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Fs,{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(it,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl text-white font-light",children:n.name}),a.jsx("p",{className:"text-gray-400",children:n.slug})]})]}),a.jsx("div",{className:"border-b border-white/10",children:a.jsxs("nav",{className:"flex space-x-8",children:[a.jsxs("button",{onClick:()=>m("details"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${h==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(it,{className:"w-4 h-4"}),a.jsx("span",{children:"Details"}),a.jsx(je,{variant:"secondary",className:"text-xs bg-white/10 border border-white/20 rounded-sm",children:c.length+o.length+s.length})]}),a.jsxs("button",{onClick:()=>m("members"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${h==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(Oe,{className:"w-4 h-4"}),a.jsx("span",{children:"Members"}),c.length>0&&a.jsx(je,{variant:"secondary",className:"text-xs bg-white/10 border border-white/20 rounded-sm",children:c.length})]}),a.jsxs("button",{onClick:()=>m("invitations"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${h==="invitations"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(pn,{className:"w-4 h-4"}),a.jsx("span",{children:"Invitations"}),o.length>0&&a.jsx(je,{variant:"secondary",className:"text-xs bg-white/10 border border-white/20 rounded-sm",children:o.length})]}),a.jsxs("button",{onClick:()=>m("teams"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${h==="teams"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(Oe,{className:"w-4 h-4"}),a.jsx("span",{children:"Teams"}),s.length>0&&a.jsx(je,{variant:"secondary",className:"text-xs bg-white/10 border border-white/20 rounded-sm",children:s.length})]})]})}),h==="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-light",children:"Name"}),a.jsx("p",{className:"text-white mt-1",children:n.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-light",children:"Slug"}),a.jsx("p",{className:"text-white mt-1",children:n.slug})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-light",children:"Created"}),a.jsx("p",{className:"text-white 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(Oe,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-light",children:c.length}),a.jsx("p",{className:"text-sm text-gray-400",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(Oe,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-light",children:s.length}),a.jsx("p",{className:"text-sm text-gray-400",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(pn,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-light",children:o.length}),a.jsx("p",{className:"text-sm text-gray-400",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(Sc,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white 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",children:"Days Active"})]})]})})]})]}),h==="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 text-white font-light",children:["Teams (",s.length,")"]}),a.jsx("p",{className:"text-gray-400 mt-1",children:"Manage teams within this organization"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(U,{onClick:()=>S(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(Be,{className:"w-4 h-4 mr-2"}),"Seed Teams"]}),a.jsxs(U,{onClick:()=>z(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(ts,{className:"w-4 h-4 mr-2"}),"Create Team"]})]})]}),w?s.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:s.map(G=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>t(`/organizations/${e}/teams/${G.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(Oe,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:G.name}),a.jsxs("div",{className:"text-sm text-gray-400",children:["Team ID: ",G.id]})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:G.memberCount||0}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(G.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(U,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:le=>{le.stopPropagation(),be(G)},children:[a.jsx(Fs,{className:"w-4 h-4 mr-1"}),"Edit"]}),a.jsxs(U,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:le=>{le.stopPropagation(),Ie(G)},children:[a.jsx(Ds,{className:"w-4 h-4 mr-1"}),"Delete"]})]})})]},G.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(Oe,{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(U,{onClick:()=>z(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(ts,{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(Oe,{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(U,{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"})]})]})]})})]}),h==="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 text-white font-light",children:["Members (",c.length,")"]}),a.jsx("p",{className:"text-gray-400 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(G=>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:G.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${G.user.id}`,alt:G.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:G.user.name}),a.jsxs("div",{className:"text-sm text-gray-400",children:["ID: ",G.user.id]})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:G.user.email}),a.jsx("td",{className:"py-4 px-4",children:a.jsx(je,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed rounded-none border-blue-500/30 text-blue-400/70 capitalize",children:G.role})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(G.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(U,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>V(G.id,G.user.name),children:[a.jsx(Ds,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},G.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(Oe,{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(U,{onClick:()=>N(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(Oe,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),a.jsxs(U,{onClick:xt,className:"bg-white text-white hover:bg-white/90 bg-transparent border border-white/20 rounded-none",children:[a.jsx(pn,{className:"w-4 h-4 mr-2"}),"Invite User"]})]})]})})]}),h==="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 text-white font-light",children:["Invitations (",o.length,")"]}),a.jsx("p",{className:"text-gray-400 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(G=>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(pn,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:G.email}),a.jsxs("div",{className:"text-sm text-gray-400",children:["Expires on"," ",new Date(G.expiresAt).toLocaleDateString("en-US",{month:"short",year:"numeric",day:"numeric"})]})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white capitalize",children:G.role}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs(je,{variant:"secondary",className:`text-xs font-normal rounded-none border-dashed flex items-center gap-1 w-fit ${G.status==="pending"?"bg-yellow-900/10 border border-yellow-500/30 text-yellow-400/70":G.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:[G.status==="pending"&&a.jsx(mr,{className:"w-3 h-3"}),G.status==="accepted"&&a.jsx(ut,{className:"w-3 h-3"}),G.status==="expired"&&a.jsx(Fe,{className:"w-3 h-3"}),G.status]})}),a.jsxs("td",{className:"py-4 px-4 text-sm text-gray-400",children:[new Date(G.expiresAt).toLocaleDateString(),a.jsx("br",{}),a.jsx("span",{className:"text-xs text-gray-400",children:new Date(G.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(U,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>oe(G.id,G.email),children:[a.jsx(Px,{className:"w-4 h-4 mr-1"}),"Resend"]}),a.jsxs(U,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>te(G.id),children:[a.jsx(Ds,{className:"w-4 h-4 mr-1"}),"Cancel"]})]})})]},G.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(pn,{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(U,{onClick:xt,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(pn,{className:"w-4 h-4 mr-2"}),"Send First Invitation"]})]})})]}),v&&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(U,{variant:"ghost",size:"sm",onClick:()=>{x(!1),P(""),_("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(De,{htmlFor:"invite-email",className:"text-sm text-gray-400 font-light",children:"Email Address"}),a.jsx(Ce,{id:"invite-email",type:"email",value:D,onChange:G=>P(G.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(De,{htmlFor:"inviter-select",className:"text-sm text-gray-400 font-light",children:"Inviter"}),a.jsxs(ns,{value:C,onValueChange:_,children:[a.jsx(rs,{children:a.jsx(ho,{placeholder:"Select an inviter..."})}),a.jsx(ss,{children:R.map(G=>a.jsx(Et,{value:G.id,children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("img",{src:G.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${G.id}`,alt:G.name,className:"w-6 h-6 rounded-none border border-dashed border-white/20"}),a.jsxs("span",{children:[G.name," (",G.email,")"]})]})},G.id))})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(U,{variant:"outline",onClick:()=>{x(!1),P(""),_("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsxs(U,{onClick:zt,disabled:H,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[H?a.jsx(Rt,{className:"w-3 h-3 mr-2 animate-spin"}):a.jsx(Px,{className:"w-4 h-4 mr-2"}),H?"Sending...":"Send Invitation"]})]})]})}),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:"Create Team"}),a.jsx(U,{variant:"ghost",size:"sm",onClick:()=>{z(!1),F({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{className:"w-4 h-4"})})]}),a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{children:[a.jsx(De,{htmlFor:"team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Ce,{id:"team-name",value:T.name,onChange:G=>ae(G.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(U,{variant:"outline",onClick:()=>{z(!1),F({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:se,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create Team"})]})]})}),$&&E&&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(U,{variant:"ghost",size:"sm",onClick:()=>{A(!1),F({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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(Oe,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:E.name}),a.jsxs("div",{className:"text-sm text-gray-400",children:["Team ID: ",E.id]})]})]}),a.jsxs("div",{children:[a.jsx(De,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Ce,{id:"edit-team-name",value:T.name,onChange:G=>ae(G.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(U,{variant:"outline",onClick:()=>{A(!1),F({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:he,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})}),O&&E&&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(U,{variant:"ghost",size:"sm",onClick:()=>L(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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(Oe,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:E.name}),a.jsxs("div",{className:"text-sm text-gray-400",children:["Team ID: ",E.id]})]})]}),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(U,{variant:"outline",onClick:()=>L(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:de,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete Team"})]})]})}),j&&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(U,{variant:"ghost",size:"sm",onClick:()=>N(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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(Oe,{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(De,{htmlFor:"member-count",className:"text-sm text-gray-400 font-light",children:"Number of members to add"}),a.jsx(Ce,{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(U,{onClick:()=>{var le;const G=parseInt(((le=document.getElementById("member-count"))==null?void 0:le.value)||"5");Pt(G)},disabled:K,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:K?a.jsxs(a.Fragment,{children:[a.jsx(Rt,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Oe,{className:"w-3 h-3 mr-2"}),"Seed Members"]})})]})]}),J.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(Ua,{title:"Member Seeding Terminal",lines:J,isRunning:K,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(U,{variant:"outline",onClick:()=>N(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),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-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(U,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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(it,{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(De,{htmlFor:"team-count",className:"text-sm text-gray-400 font-light",children:"Number of teams to create"}),a.jsx(Ce,{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(U,{onClick:()=>{var le;const G=parseInt(((le=document.getElementById("team-count"))==null?void 0:le.value)||"3");Ae(G)},disabled:Q,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:Q?a.jsxs(a.Fragment,{children:[a.jsx(Rt,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(it,{className:"w-3 h-3 mr-2"}),"Seed Teams"]})})]})]}),me.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(Ua,{title:"Team Seeding Terminal",lines:me,isRunning:Q,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(U,{variant:"outline",onClick:()=>S(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx(_a,{to:"/organizations",children:a.jsxs(U,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(fo,{className:"w-4 h-4 mr-2"}),"Back to Organizations"]})})}),a.jsx("br",{}),a.jsxs("div",{className:"text-center py-12",children:[a.jsx(it,{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 u$(){const[e,t]=p.useState([]),[n,r]=p.useState(!0),[s,i]=p.useState(""),[o,l]=p.useState("all"),[c,d]=p.useState(!1),[f,u]=p.useState(!1),[h,m]=p.useState(!1),[w,y]=p.useState(!1),[b,g]=p.useState(!1),[v,x]=p.useState(null),[j,N]=p.useState([]),[k,S]=p.useState(!1),M=p.useCallback(async()=>{try{const _=await(await fetch("/api/sessions")).json();t(_.sessions||[])}catch{}finally{r(!1)}},[]);p.useEffect(()=>{M()},[M]);const z=async C=>{N([]),S(!0),N([{id:"start",type:"info",message:`Starting session seeding process for ${C} sessions...`,timestamp:new Date}]);try{const R=await(await fetch("/api/seed/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:C})})).json();if(R.success){const B=R.results.map((F,H)=>F.success?{id:`session-${H}`,type:"progress",message:`Creating session: ${F.session.id}`,timestamp:new Date,status:"completed"}:{id:`session-${H}`,type:"error",message:`Failed to create session ${H+1}: ${F.error}`,timestamp:new Date});N(F=>[...F,...B]);const T=R.results.filter(F=>F.success).length;N(F=>[...F,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${T}/${C} sessions successfully`,timestamp:new Date}]),await M()}else N(B=>[...B,{id:"error",type:"error",message:`❌ Seeding failed: ${R.error||"Unknown error"}`,timestamp:new Date}])}catch(_){N(R=>[...R,{id:"error",type:"error",message:`❌ Network error: ${_}`,timestamp:new Date}])}finally{S(!1)}},$=async C=>{N([]),S(!0),N([{id:"start",type:"info",message:`Starting account seeding process for ${C} accounts...`,timestamp:new Date}]);try{const R=await(await fetch("/api/seed/accounts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:C})})).json();if(R.success){const B=R.results.map((F,H)=>F.success?{id:`account-${H}`,type:"progress",message:`Creating account: ${F.account.provider}`,timestamp:new Date,status:"completed"}:{id:`account-${H}`,type:"error",message:`Failed to create account ${H+1}: ${F.error}`,timestamp:new Date});N(F=>[...F,...B]);const T=R.results.filter(F=>F.success).length;N(F=>[...F,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${T}/${C} accounts successfully`,timestamp:new Date}]),await M()}else N(B=>[...B,{id:"error",type:"error",message:`❌ Seeding failed: ${R.error||"Unknown error"}`,timestamp:new Date}])}catch(_){N(R=>[...R,{id:"error",type:"error",message:`❌ Network error: ${_}`,timestamp:new Date}])}finally{S(!1)}},A=C=>{x(C),y(!0)},O=C=>{x(C),u(!0)},L=C=>{x(C),m(!0)},E=async C=>{d(!1)},I=async C=>{u(!1)},D=async()=>{m(!1)},P=e.filter(C=>{const _=C.id.toLowerCase().includes(s.toLowerCase())||C.userId.toLowerCase().includes(s.toLowerCase()),R=o==="all"||o==="active"&&new Date(C.expiresAt)>new Date||o==="expired"&&new Date(C.expiresAt)<=new Date;return _&&R});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(Rt,{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 text-white font-light",children:["Sessions (",e.length,")"]}),a.jsx("p",{className:"text-gray-400 mt-1",children:"Manage user sessions and accounts"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(U,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>g(!0),children:[a.jsx(Be,{className:"w-4 h-4 mr-2"}),"Seed"]}),a.jsxs(U,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>d(!0),children:[a.jsx(pr,{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(os,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Ce,{placeholder:"Search sessions...",value:s,onChange:C=>i(C.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(mm,{className:"w-4 h-4 text-gray-400"}),a.jsxs(ns,{value:o,onValueChange:l,children:[a.jsx(rs,{children:a.jsx(ho,{})}),a.jsxs(ss,{children:[a.jsx(Et,{value:"all",children:"All"}),a.jsx(Et,{value:"active",children:"Active"}),a.jsx(Et,{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:P.map(C=>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(Be,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",C.id.slice(0,8),"..."]}),a.jsxs("div",{className:"text-sm text-gray-400",children:["ID: ",C.id]})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:C.userId}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[new Date(C.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(C.expiresAt)>new Date?"Active":"Expired"})]})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(C.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(U,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>A(C),children:a.jsx(zo,{className:"w-4 h-4"})}),a.jsx(U,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>O(C),children:a.jsx(Fs,{className:"w-4 h-4"})}),a.jsx(U,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:()=>L(C),children:a.jsx(Ds,{className:"w-4 h-4"})})]})})]},C.id))})]})})}),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-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(U,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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(Be,{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(De,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),a.jsx(Ce,{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(U,{onClick:()=>{var _;const C=parseInt(((_=document.getElementById("session-count"))==null?void 0:_.value)||"5",10);z(C)},disabled:k,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:k?a.jsxs(a.Fragment,{children:[a.jsx(Rt,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Be,{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(Ui,{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(De,{htmlFor:"account-count",className:"text-sm text-gray-400 font-light",children:"Number of accounts"}),a.jsx(Ce,{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(U,{onClick:()=>{var _;const C=parseInt(((_=document.getElementById("account-count"))==null?void 0:_.value)||"5",10);$(C)},disabled:k,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:k?a.jsxs(a.Fragment,{children:[a.jsx(Rt,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Ui,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]})]}),j.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(Ua,{title:"Session Seeding Terminal",lines:j,isRunning:k,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(U,{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(U,{variant:"ghost",size:"sm",onClick:()=>d(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(De,{htmlFor:"create-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),a.jsx(Ce,{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(De,{htmlFor:"create-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),a.jsx(Ce,{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(U,{variant:"outline",onClick:()=>d(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:()=>E(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),f&&v&&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(U,{variant:"ghost",size:"sm",onClick:()=>u(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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(Be,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",v.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:v.userId})]})]}),a.jsxs("div",{children:[a.jsx(De,{htmlFor:"edit-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),a.jsx(Ce,{id:"edit-user-id",defaultValue:v.userId,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(De,{htmlFor:"edit-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),a.jsx(Ce,{id:"edit-expires",type:"datetime-local",defaultValue:new Date(v.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(U,{variant:"outline",onClick:()=>u(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:()=>I(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),h&&v&&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(U,{variant:"ghost",size:"sm",onClick:()=>m(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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(Be,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",v.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:v.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(U,{variant:"outline",onClick:()=>m(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:D,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),w&&v&&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(U,{variant:"ghost",size:"sm",onClick:()=>y(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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(Be,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",v.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:v.userId})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"ID:"}),a.jsx("span",{className:"text-white text-sm",children:v.id})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"User ID:"}),a.jsx("span",{className:"text-white text-sm",children:v.userId})]}),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(v.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(v.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(v.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(v.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(U,{onClick:()=>y(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function f$(e){const t=p.useRef(null),n=p.useRef(null),r=p.useRef(0),s=5;p.useEffect(()=>{const i=()=>{try{const l=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`;t.current=new WebSocket(l),t.current.onopen=()=>{r.current=0,n.current&&(clearTimeout(n.current),n.current=null)},t.current.onmessage=c=>{try{const d=JSON.parse(c.data);e(d)}catch{}},t.current.onclose=c=>{if(!(c.code===1006||c.code===1001)&&r.current<s){r.current++;const d=Math.min(1e3*2**r.current,1e4);n.current=setTimeout(()=>{i()},d)}},t.current.onerror=c=>{}}catch{}};return i(),()=>{t.current&&t.current.close(),n.current&&clearTimeout(n.current)}},[e])}function h$(){var v,x,j,N,k,S,M,z,$,A,O,L,E,I,D,P,C,_,R,B,T,F,H,X,J,ee,K,ne,me;const[e,t]=p.useState(null),[n,r]=p.useState(null),[s,i]=p.useState(null),[o,l]=p.useState(null),[c,d]=p.useState(!0),[f,u]=p.useState(null);f$(W=>{W.type==="config_changed"?setTimeout(()=>{h(),m(),w(),y()},500):W.type});const h=p.useCallback(async()=>{var W;try{const Z=await(await fetch("/api/config")).json();(W=Z.studio)!=null&&W.version&&u(`v${Z.studio.version}`),t(Z)}catch{}finally{d(!1)}},[]),m=p.useCallback(async()=>{try{const Q=await(await fetch("/api/health")).json();r(Q.system||{studioVersion:f||"v1.0.0",nodeVersion:process.version,platform:navigator.platform,uptime:"2h 15m"})}catch{r({studioVersion:f||"v1.0.0",nodeVersion:"v18.0.0",platform:"macOS",uptime:"2h 15m"})}},[f]),w=p.useCallback(async()=>{try{const Q=await(await fetch("/api/plugins")).json();i(Q)}catch{i({plugins:[],configPath:null,totalPlugins:0,error:"Failed to fetch plugins"})}},[]),y=p.useCallback(async()=>{try{const Q=await(await fetch("/api/db")).json();l(Q)}catch{l({success:!1,name:"unknown",version:"unknown",dialect:"unknown",adapter:"unknown",displayName:"Unknown",autoDetected:!1,message:"Failed to fetch database info"})}},[]),b=W=>{switch(W==null?void 0:W.toLowerCase()){case"postgresql":case"postgres":return a.jsxs(je,{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(ut,{className:"w-3 h-3"}),"Connected"]});case"mysql":return a.jsxs(je,{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(ut,{className:"w-3 h-3"}),"Connected"]});case"sqlite":return a.jsxs(je,{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(yi,{className:"w-3 h-3"}),"Local"]});default:return a.jsxs(je,{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(Wn,{className:"w-3 h-3"}),"Unknown"]})}};p.useEffect(()=>{h(),m(),w(),y()},[h,y,w,m]);const g=W=>{switch(W.toLowerCase()){case"google":return a.jsx(vs,{className:"w-5 h-5 text-white"});case"github":return a.jsx(or,{className:"w-5 h-5 text-white"});case"discord":return a.jsx(vs,{className:"w-5 h-5 text-white"});case"twitter":return a.jsx(vs,{className:"w-5 h-5 text-white"});default:return a.jsx(vs,{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",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(St,{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(hn,{children:[a.jsxs(mn,{className:"text-white flex items-center space-x-2",children:[a.jsx(Ps,{className:"w-5 h-5 text-white"}),a.jsx("span",{children:"Application"})]}),a.jsx(Un,{children:"Basic application configuration"})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Ct,{className:"space-y-0 px-0 pb-0 border-b-none",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(vs,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"App Name"}),a.jsx("p",{className:"text-xs 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-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ff,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Base URL"}),a.jsx("p",{className:"text-xs 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-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(cu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Base Path"}),a.jsx("p",{className:"text-xs 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-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(or,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Secret"}),a.jsx("p",{className:"text-xs 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(St,{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(hn,{children:[a.jsxs(mn,{className:"text-white flex items-center space-x-2",children:[a.jsx(Be,{className:"w-5 h-5 text-white"}),a.jsx("span",{children:"Database"})]}),a.jsx(Un,{children:"Database connection and configuration"})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Ct,{className:"space-y-0 px-0 pb-0 border-b-none",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Be,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(o==null?void 0:o.displayName)||((v=e==null?void 0:e.database)==null?void 0:v.type)&&((x=e==null?void 0:e.database)==null?void 0:x.type.charAt(0).toUpperCase())+((j=e==null?void 0:e.database)==null?void 0:j.type.slice(1))||"Unknown"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Database Type"})]})]}),((o==null?void 0:o.name)||((N=e==null?void 0:e.database)==null?void 0:N.type))&&b((o==null?void 0:o.name)||((k=e==null?void 0:e.database)==null?void 0:k.type)||"")]}),((o==null?void 0:o.dialect)||((S=e==null?void 0:e.database)==null?void 0:S.dialect))&&(o==null?void 0:o.dialect)!=="unknown"&&a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Be,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Dialect"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Database dialect"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:(o==null?void 0:o.dialect)||((M=e==null?void 0:e.database)==null?void 0:M.dialect)})})]}),((z=e==null?void 0:e.database)==null?void 0:z.url)&&a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ff,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Connection URL"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Database connection string"})]})]}),a.jsxs(je,{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(ut,{className:"w-3 h-3"}),"Configured"]})]}),(($=e==null?void 0:e.database)==null?void 0:$.casing)&&a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ps,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Casing"}),a.jsx("p",{className:"text-xs 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-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(_x,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Debug Logs"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Database debug logging"})]})]}),a.jsx(je,{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(Wn,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(ut,{className:"w-3 h-3"}),"Disabled"]})})]}),!(o!=null&&o.success)&&!(e!=null&&e.database)&&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(Wn,{className:"w-5 h-5 text-yellow-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"No Database Detected"}),a.jsx("p",{className:"text-xs text-gray-400",children:(o==null?void 0:o.message)||"No supported database packages found"})]})]}),a.jsx(je,{variant:"secondary",className:"text-xs bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"Unknown"})]})]})]}),a.jsxs(St,{className:"border-white/15 bg-black rounded-none",children:[a.jsxs(hn,{className:"border-b border-white/15",children:[a.jsxs(mn,{className:"text-white flex items-center space-x-2",children:[a.jsx(or,{className:"w-5 h-5 text-white"}),a.jsx("span",{children:"Providers"})]}),a.jsx(Un,{children:"Configured authentication providers"})]}),a.jsx(Ct,{className:"p-0",children:e!=null&&e.socialProviders&&e.socialProviders.length>0?e.socialProviders.map((W,Q)=>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:[g(W.type),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white capitalize",children:W.type}),a.jsx("p",{className:"text-xs text-gray-400",children:W.clientId?"Configured":"Not configured"})]})]}),a.jsx(je,{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.clientId?a.jsxs(a.Fragment,{children:[a.jsx(ut,{className:"w-3 h-3"}),"Active"]}):a.jsxs(a.Fragment,{children:[a.jsx(Wn,{className:"w-3 h-3"}),"Setup Required"]})})]},Q)):a.jsxs("div",{className:"text-center py-8",children:[a.jsx(or,{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(St,{className:"border-white/15 bg-black rounded-none",children:[a.jsxs(hn,{className:"border-b border-white/15",children:[a.jsxs(mn,{className:"text-white flex items-center space-x-2",children:[a.jsx(pn,{className:"w-5 h-5 text-white"}),a.jsx("span",{children:"Email & Password"})]}),a.jsx(Un,{children:"Email authentication settings"})]}),a.jsxs(Ct,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(pn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Email Authentication"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Allow users to sign up with email"})]})]}),a.jsx(je,{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=e==null?void 0:e.emailAndPassword)!=null&&A.enabled?a.jsxs(a.Fragment,{children:[a.jsx(ut,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ns,{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-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Oe,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Sign Up"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Allow new user registration"})]})]}),a.jsx(je,{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.emailAndPassword)!=null&&L.disableSignUp?a.jsxs(a.Fragment,{children:[a.jsx(Ns,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(ut,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(or,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Email Verification"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Require email verification"})]})]}),a.jsx(je,{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=e==null?void 0:e.emailAndPassword)!=null&&E.requireEmailVerification?a.jsxs(a.Fragment,{children:[a.jsx(ut,{className:"w-3 h-3"}),"Required"]}):a.jsxs(a.Fragment,{children:[a.jsx(Wn,{className:"w-3 h-3"}),"Optional"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(cu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Password Length"}),a.jsx("p",{className:"text-xs 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:[((I=e==null?void 0:e.emailAndPassword)==null?void 0:I.minPasswordLength)||8," -"," ",((D=e==null?void 0:e.emailAndPassword)==null?void 0:D.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(Vl,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Auto Sign In"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Auto sign in after registration"})]})]}),a.jsx(je,{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:(P=e==null?void 0:e.emailAndPassword)!=null&&P.autoSignIn?a.jsxs(a.Fragment,{children:[a.jsx(ut,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Wn,{className:"w-3 h-3"}),"Disabled"]})})]})]})]})]}),a.jsxs(St,{className:"border-white/15 bg-black rounded-none",children:[a.jsxs(hn,{className:"border-b border-white/15",children:[a.jsxs(mn,{className:"text-white flex items-center space-x-2",children:[a.jsx(mr,{className:"w-5 h-5 text-white"}),a.jsx("span",{children:"Session"})]}),a.jsx(Un,{children:"Session management settings"})]}),a.jsxs(Ct,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(mr,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Session Duration"}),a.jsx("p",{className:"text-xs 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:(C=e==null?void 0:e.session)!=null&&C.expiresIn?`${Math.floor(e.session.expiresIn/(60*60*24))} days`:"7 days"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Default"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(_x,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Update Age"}),a.jsx("p",{className:"text-xs 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:(_=e==null?void 0:e.session)!=null&&_.updateAge?`${Math.floor(e.session.updateAge/(60*60))} hours`:"24 hours"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Vl,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Session Refresh"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Auto refresh sessions"})]})]}),a.jsx(je,{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.session)!=null&&R.disableSessionRefresh?a.jsxs(a.Fragment,{children:[a.jsx(Ns,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(ut,{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(Be,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Store in Database"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Store sessions in database"})]})]}),a.jsx(je,{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:(B=e==null?void 0:e.session)!=null&&B.storeSessionInDatabase?a.jsxs(a.Fragment,{children:[a.jsx(ut,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(yi,{className:"w-3 h-3"}),"Secondary Storage"]})})]})]})]}),a.jsxs(St,{className:"border-white/15 bg-black rounded-none",children:[a.jsxs(hn,{className:"border-b border-white/15",children:[a.jsxs(mn,{className:"text-white flex items-center space-x-2",children:[a.jsx(or,{className:"w-5 h-5 text-white"}),a.jsx("span",{children:"Rate Limiting"})]}),a.jsx(Un,{children:"API rate limiting configuration"})]}),a.jsxs(Ct,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(or,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Rate Limiting"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Enable rate limiting"})]})]}),a.jsx(je,{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:(T=e==null?void 0:e.rateLimit)!=null&&T.enabled?a.jsxs(a.Fragment,{children:[a.jsx(ut,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Wn,{className:"w-3 h-3"}),"Disabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(mr,{className:"w-5 h-5 text-red-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Rate Limit Window"}),a.jsx("p",{className:"text-xs 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:(F=e==null?void 0:e.rateLimit)!=null&&F.window?`${e.rateLimit.window} seconds`:"10 seconds"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Window"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(or,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Max Requests"}),a.jsx("p",{className:"text-xs 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:((H=e==null?void 0:e.rateLimit)==null?void 0:H.max)||100}),a.jsx("p",{className:"text-xs 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(Be,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Storage"}),a.jsx("p",{className:"text-xs 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(St,{className:"border-white/15 bg-black rounded-none",children:[a.jsxs(hn,{className:"border-b border-white/15",children:[a.jsxs(mn,{className:"text-white flex items-center space-x-2",children:[a.jsx(Ps,{className:"w-5 h-5 text-white"}),a.jsx("span",{children:"Advanced"})]}),a.jsx(Un,{children:"Advanced configuration options"})]}),a.jsxs(Ct,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(cu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Secure Cookies"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Use secure cookies"})]})]}),a.jsx(je,{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&&J.useSecureCookies?a.jsxs(a.Fragment,{children:[a.jsx(ut,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Wn,{className:"w-3 h-3"}),"Disabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(or,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"CSRF Check"}),a.jsx("p",{className:"text-xs text-gray-400",children:"CSRF protection"})]})]}),a.jsx(je,{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:(ee=e==null?void 0:e.advanced)!=null&&ee.disableCSRFCheck?a.jsxs(a.Fragment,{children:[a.jsx(Ns,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(ut,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(zo,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"IP Tracking"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Track IP addresses"})]})]}),a.jsx(je,{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=(K=e==null?void 0:e.advanced)==null?void 0:K.ipAddress)!=null&&ne.disableIpTracking?a.jsxs(a.Fragment,{children:[a.jsx(Ns,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(ut,{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(PC,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Telemetry"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Usage analytics"})]})]}),a.jsx(je,{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:(me=e==null?void 0:e.telemetry)!=null&&me.enabled?a.jsxs(a.Fragment,{children:[a.jsx(Wn,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(ut,{className:"w-3 h-3"}),"Disabled"]})})]})]})]}),a.jsxs(St,{className:"border-white/15 bg-black rounded-none",children:[a.jsxs(hn,{className:"border-b border-white/15",children:[a.jsxs(mn,{className:"text-white flex items-center space-x-2",children:[a.jsx(yi,{className:"w-5 h-5 text-white"}),a.jsx("span",{children:"System Info"})]}),a.jsx(Un,{children:"Better Auth Studio system information"})]}),a.jsxs(Ct,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Vl,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Studio Version"}),a.jsx("p",{className:"text-xs 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:f||"v1.0.0"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Latest"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(yi,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Node.js Version"}),a.jsx("p",{className:"text-xs 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-xs text-gray-400",children:"Current"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(vs,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Platform"}),a.jsx("p",{className:"text-xs 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-xs 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(mr,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Uptime"}),a.jsx("p",{className:"text-xs 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-xs text-gray-400",children:"Running"})]})]})]})]}),a.jsxs(St,{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(hn,{children:[a.jsxs(mn,{className:"text-white flex items-center space-x-2",children:[a.jsx(Mx,{className:"w-5 h-5 text-white"}),a.jsx("span",{children:"Plugins"})]}),a.jsx(Un,{children:"Better Auth plugins enabled in your configuration"})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsx(Ct,{className:"space-y-0 px-0 pb-0 border-b-none",children:s!=null&&s.plugins&&s.plugins.length>0?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(yi,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"Total Plugins"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Currently enabled plugins"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:s.totalPlugins}),a.jsx("p",{className:"text-xs text-gray-400",children:"Active"})]})]}),s.plugins.map((W,Q)=>a.jsxs("div",{className:`flex items-center justify-between p-4 px-5 ${Q<s.plugins.length-1?"border-b border-white/15":""}`,children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Mx,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:W.name.slice(0,1).toUpperCase()+W.name.slice(1).replace("-"," ")}),a.jsx("p",{className:"text-xs text-gray-400",children:W.description})]})]}),a.jsx("div",{className:"text-right flex items-center space-x-2",children:a.jsxs(je,{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(ut,{className:"w-3 h-3"}),"Enabled"]})})]},W.id)),s.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:s.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(Wn,{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:(s==null?void 0:s.error)||"No plugins are currently configured in your Better Auth setup"})]})]}),a.jsx(je,{variant:"secondary",className:"text-xs bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"None"})]})})]})]})]})}function j0(){var I,D;const{orgId:e,teamId:t}=fm(),[n,r]=p.useState(null),[s,i]=p.useState([]),[o,l]=p.useState(!0),[c,d]=p.useState("details"),[f,u]=p.useState(!1),[h,m]=p.useState(!1),[w,y]=p.useState(""),[b,g]=p.useState([]),[v,x]=p.useState([]),[j,N]=p.useState({name:""}),k=async()=>{try{const C=await(await fetch(`/api/teams/${t}`)).json();C.success&&C.team?(r(C.team),N({name:C.team.name})):C.team?(r(C.team),N({name:C.team.name})):q.error("Team not found")}catch{q.error("Failed to load team")}finally{l(!1)}},S=async()=>{try{const C=await(await fetch(`/api/teams/${t}/members`)).json();C.success&&i(C.members||[])}catch{q.error("Failed to load team members")}},M=async()=>{try{const C=await(await fetch("/api/users?limit=10000")).json(),_=s.map(B=>B.userId),R=(C.users||[]).filter(B=>!_.includes(B.id));g(R)}catch{q.error("Failed to load users")}};p.useEffect(()=>{t&&(k(),S())},[t,k,S]);const z=async()=>{if(!j.name){q.error("Please enter a team name");return}const P=q.loading("Updating team...");try{const _=await(await fetch(`/api/teams/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:j.name})})).json();_.success?(await k(),m(!1),q.success("Team updated successfully!",{id:P})):q.error(`Error updating team: ${_.error||"Unknown error"}`,{id:P})}catch{q.error("Error updating team",{id:P})}},$=async()=>{if(v.length===0){q.error("Please select at least one user");return}const P=q.loading(`Adding ${v.length} members...`);try{const _=await(await fetch(`/api/teams/${t}/members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userIds:v})})).json();_.success?(await S(),u(!1),x([]),y(""),q.success(`Successfully added ${v.length} members!`,{id:P})):q.error(`Error adding members: ${_.error||"Unknown error"}`,{id:P})}catch{q.error("Error adding members",{id:P})}},A=async(P,C)=>{const _=q.loading(`Removing ${C}...`);try{const B=await(await fetch(`/api/team-members/${P}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();B.success?(await S(),q.success(`${C} removed from team!`,{id:_})):q.error(`Error removing member: ${B.error||"Unknown error"}`,{id:_})}catch{q.error("Error removing team member",{id:_})}},O=()=>{M(),u(!0)},L=P=>{x(C=>C.includes(P)?C.filter(_=>_!==P):[...C,P])},E=b.filter(P=>P.name.toLowerCase().includes(w.toLowerCase())||P.email.toLowerCase().includes(w.toLowerCase()));return o?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(Rt,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading team 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(_a,{to:`/organizations/${n.organizationId}`,children:a.jsxs(U,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(fo,{className:"w-4 h-4 mr-2"}),"Back to Organization"]})})}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(U,{onClick:O,className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(ts,{className:"w-4 h-4 mr-2"}),"Add Members"]}),a.jsxs(U,{onClick:()=>m(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Fs,{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(Oe,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl text-white font-light",children:n.name}),a.jsx("div",{className:"flex items-center space-x-2",children:n.organization&&a.jsxs(_a,{to:`/organizations/${n.organizationId}`,className:"text-gray-400 hover:text-white text-sm",children:[a.jsx(it,{className:"w-4 h-4 inline mr-1"}),n.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:()=>d("details"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${c==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(Oe,{className:"w-4 h-4"}),a.jsx("span",{children:"Details"})]}),a.jsxs("button",{onClick:()=>d("members"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${c==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(Oe,{className:"w-4 h-4"}),a.jsx("span",{children:"Members"}),s.length>0&&a.jsx(je,{variant:"secondary",className:"text-xs bg-white/10 border border-white/20 rounded-sm",children:s.length})]})]})}),c==="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-light",children:"Name"}),a.jsx("p",{className:"text-white mt-1",children:n.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-light",children:"Organization"}),a.jsx("p",{className:"text-white mt-1",children:((I=n.organization)==null?void 0:I.name)||"Unknown"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-light",children:"Created"}),a.jsx("p",{className:"text-white mt-1",children:new Date(n.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-light",children:"Last Updated"}),a.jsx("p",{className:"text-white mt-1",children:new Date(n.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(Oe,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-light",children:s.length}),a.jsx("p",{className:"text-sm text-gray-400",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(Sc,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-light",children:Math.ceil((Date.now()-new Date(n.createdAt).getTime())/(1e3*60*60*24))}),a.jsx("p",{className:"text-sm text-gray-400",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(it,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-light",children:"1"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Organization"})]})]})})]})]}),c==="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 text-white font-light",children:["Team Members (",s.length,")"]}),a.jsx("p",{className:"text-gray-400 mt-1",children:"Manage members of this team"})]})}),s.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:s.map(P=>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:P.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${P.user.id}`,alt:P.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:P.user.name}),a.jsxs("div",{className:"text-sm text-gray-400",children:["ID: ",P.user.id]})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:P.user.email}),a.jsx("td",{className:"py-4 px-4",children:a.jsx(je,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed border-blue-500/30 text-blue-400/70 rounded-none capitalize",children:P.role})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(P.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(U,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>A(P.id,P.user.name),children:[a.jsx(Ds,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},P.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(Oe,{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(U,{onClick:O,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(ts,{className:"w-4 h-4 mr-2"}),"Add First Members"]})]})})]}),f&&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(U,{variant:"ghost",size:"sm",onClick:()=>{u(!1),x([]),y("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(os,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Ce,{placeholder:"Search users by name or email...",value:w,onChange:P=>y(P.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),v.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:[v.length," user",v.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:E.length>0?a.jsx("div",{className:"divide-y divide-white/5",children:E.map(P=>a.jsxs("div",{className:`flex items-center space-x-3 p-4 cursor-pointer hover:bg-white/5 ${v.includes(P.id)?"bg-blue-900/20":""}`,onClick:()=>L(P.id),children:[a.jsx("input",{type:"checkbox",checked:v.includes(P.id),onChange:()=>L(P.id),className:"rounded border-gray-300"}),a.jsx("img",{src:P.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${P.id}`,alt:P.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:P.name}),a.jsx("div",{className:"text-sm text-gray-400",children:P.email})]})]},P.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(U,{variant:"outline",onClick:()=>{u(!1),x([]),y("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsxs(U,{onClick:$,disabled:v.length===0,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[a.jsx(ts,{className:"w-4 h-4 mr-2"}),"Add ",v.length," Member",v.length!==1?"s":""]})]})]})}),h&&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(U,{variant:"ghost",size:"sm",onClick:()=>m(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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(Oe,{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:(D=n.organization)==null?void 0:D.name})]})]}),a.jsxs("div",{children:[a.jsx(De,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Ce,{id:"edit-team-name",value:j.name,onChange:P=>N({name:P.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(U,{variant:"outline",onClick:()=>m(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:z,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(_a,{to:`/organizations/${e}`,children:a.jsxs(U,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(fo,{className:"w-4 h-4 mr-2"}),"Back to Organization"]})})}),a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Oe,{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 m$(){const e=Qs(),[t,n]=p.useState([]),[r,s]=p.useState(!0),[i,o]=p.useState(null),[l,c]=p.useState(""),[d,f]=p.useState("all"),[u,h]=p.useState(1),[m]=p.useState(20);p.useEffect(()=>{w()},[]);const w=async()=>{try{const k=await(await fetch("/api/plugins")).json(),S=(k==null?void 0:k.plugins).find(M=>M.id==="teams");o({enabled:!!S,availablePlugins:(k==null?void 0:k.plugins).map(M=>M.id),configPath:k.configPath,teamsPlugin:(k==null?void 0:k.plugins).find(M=>M.id==="teams")}),S?await y():s(!1)}catch(N){console.error("Failed to check teams plugin status:",N),o({enabled:!1,error:"Failed to check plugin status"}),s(!1)}},y=async()=>{try{const k=await(await fetch("/api/teams")).json();k.success&&n(k.teams||[])}catch(N){console.error("Failed to fetch teams:",N),q.error("Failed to load teams")}finally{s(!1)}},b=t.filter(N=>{var S;const k=N.name.toLowerCase().includes(l.toLowerCase())||((S=N.organization)==null?void 0:S.name.toLowerCase().includes(l.toLowerCase()));if(d==="all")return k;if(d==="recent"){const M=new Date;return M.setDate(M.getDate()-7),k&&new Date(N.createdAt)>M}return k}),g=u*m,v=g-m,x=b.slice(v,g),j=Math.ceil(b.length/m);return r?a.jsx("div",{className:"flex items-center justify-center min-h-screen",children:a.jsx(Rt,{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.jsx("h1",{className:"text-2xl font-light tracking-tight text-white",children:"Teams"}),a.jsxs("p",{className:"text-gray-400 mt-1",children:[b.length," team",b.length!==1?"s":""," found"]})]}),a.jsx("div",{className:"flex items-center space-x-3",children:a.jsxs(U,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[a.jsx(pr,{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(os,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Ce,{type:"text",placeholder:"Search teams...",value:l,onChange:N=>c(N.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(U,{variant:d==="all"?"default":"outline",size:"sm",onClick:()=>f("all"),className:d==="all"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"All"}),a.jsx(U,{variant:d==="recent"?"default":"outline",size:"sm",onClick:()=>f("recent"),className:d==="recent"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"Recent"})]})]}),x.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Oe,{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(U,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[a.jsx(pr,{className:"w-4 h-4 mr-2"}),"Create Team"]})]}):a.jsx("div",{className:"grid gap-4",children:x.map(N=>{var k;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/${N.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(Oe,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium",children:N.name}),a.jsxs("p",{className:"text-gray-400 text-sm",children:[(k=N.organization)==null?void 0:k.name," • ",N.memberCount||0," members"]})]})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx(je,{variant:"secondary",className:"text-xs bg-green-900/50 border border-dashed rounded-none border-green-500/30 text-green-400",children:"Active"})})]})},N.id)})}),j>1&&a.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[a.jsx(U,{variant:"outline",size:"sm",onClick:()=>h(Math.max(1,u-1)),disabled:u===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 ",u," of ",j]}),a.jsx(U,{variant:"outline",size:"sm",onClick:()=>h(Math.min(j,u+1)),disabled:u===j,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(it,{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(U,{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"})]})]})]})})]})}function p$(){const{userId:e}=fm(),t=Qs(),[n,r]=p.useState(null),[s,i]=p.useState([]),[o,l]=p.useState([]),[c,d]=p.useState([]),[f,u]=p.useState(!0),[h,m]=p.useState("details"),[w,y]=p.useState(!1),[b,g]=p.useState(!1),[v,x]=p.useState(!1),[j,N]=p.useState(!1),[k,S]=p.useState(""),[M,z]=p.useState(),[$,A]=p.useState(!1),[O,L]=p.useState([]),[E,I]=p.useState(!1),[D,P]=p.useState({}),C=p.useCallback(async()=>{try{const Q=await(await fetch("/api/admin/status")).json();A(Q.enabled)}catch{A(!1)}},[]),_=async W=>{try{const Q=await fetch("/api/geo/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ipAddress:W})});if(Q.ok){const Z=await Q.json();if(Z.success&&Z.location)return Z.location}return null}catch{return null}},R=async W=>{const Q=W.map(async fe=>{if(!D[fe.id]){const pe=await _(fe.ipAddress);if(pe)return{sessionId:fe.id,location:pe}}return null}),Z=await Promise.all(Q),ae={};Z.forEach(fe=>{fe&&(ae[fe.sessionId]=fe.location)}),Object.keys(ae).length>0&&P(fe=>({...fe,...ae}))},B=W=>{if(!W)return"🌍";const Q=W.toUpperCase().split("").map(Z=>127397+Z.charCodeAt(0));return String.fromCodePoint(...Q)},T=p.useCallback(async()=>{try{const W=await fetch(`/api/users/${e}`);if(W.ok){const Q=await W.json();r(Q.user)}else q.error("Failed to fetch user details"),t("/users")}catch{q.error("Failed to fetch user details"),t("/users")}finally{u(!1)}},[e,t]),F=p.useCallback(async()=>{try{const[W,Q,Z]=await Promise.all([fetch(`/api/users/${e}/organizations`),fetch(`/api/users/${e}/teams`),fetch(`/api/users/${e}/sessions`)]);if(W.ok){const ae=await W.json();i(ae.memberships||[])}if(Q.ok){const ae=await Q.json();l(ae.memberships||[])}if(Z.ok){const fe=(await Z.json()).sessions||[];d(fe),R(fe)}}catch{}},[e]),H=async()=>{var ae,fe;if(!n)return;const W=(ae=document.getElementById("edit-name"))==null?void 0:ae.value,Q=(fe=document.getElementById("edit-email"))==null?void 0:fe.value;if(!W||!Q){q.error("Please fill in all fields");return}const Z=q.loading("Updating user...");try{const Se=await(await fetch(`/api/users/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:W,email:Q})})).json();Se.success?(r({...n,name:W,email:Q}),y(!1),q.success("User updated successfully!",{id:Z})):q.error(`Error updating user: ${Se.error||"Unknown error"}`,{id:Z})}catch{q.error("Error updating user",{id:Z})}},X=async()=>{if(!n)return;if(!$){q.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use ban functionality.");return}const W=q.loading("Banning user...");try{const Q=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,banReason:k||"No reason provided",banExpiresIn:M})}),Z=await Q.json();Q.ok?(q.success("User banned successfully!",{id:W}),g(!1),S(""),z(void 0),T()):Q.status===403?q.error("You do not have permission to ban users. Admin role required.",{id:W}):Z.adminPluginEnabled&&Z.instructions?q.error(`${Z.error}`,{id:W,duration:6e3,description:`Use: ${Z.instructions.example}`}):q.error(`Error banning user: ${Z.error||Z.message||"Unknown error"}`,{id:W})}catch{q.error("Error banning user",{id:W})}},J=async()=>{if(!n)return;if(!$){q.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use unban functionality.");return}const W=q.loading("Unbanning user...");try{const Q=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})}),Z=await Q.json();Q.ok?(q.success("User unbanned successfully!",{id:W}),x(!1),T()):Q.status===403?q.error("You do not have permission to unban users. Admin role required.",{id:W}):Z.adminPluginEnabled&&Z.instructions?q.error(`${Z.error}`,{id:W,duration:6e3,description:`Use: ${Z.instructions.example}`}):q.error(`Error unbanning user: ${Z.error||Z.message||"Unknown error"}`,{id:W})}catch{q.error("Error unbanning user",{id:W})}},ee=async W=>{const Q=q.loading("Removing user from organization...");try{const ae=await(await fetch(`/api/organizations/members/${W}`,{method:"DELETE"})).json();ae.success?(i(fe=>fe.filter(pe=>pe.id!==W)),q.success("User removed from organization!",{id:Q})):q.error(`Error removing user: ${ae.error||"Unknown error"}`,{id:Q})}catch{q.error("Error removing user from organization",{id:Q})}},K=async W=>{const Q=q.loading("Removing user from team...");try{const ae=await(await fetch(`/api/teams/members/${W}`,{method:"DELETE"})).json();ae.success?(l(fe=>fe.filter(pe=>pe.id!==W)),q.success("User removed from team!",{id:Q})):q.error(`Error removing user: ${ae.error||"Unknown error"}`,{id:Q})}catch{q.error("Error removing user from team",{id:Q})}},ne=async W=>{const Q=q.loading("Deleting session...");try{const ae=await(await fetch(`/api/sessions/${W}`,{method:"DELETE"})).json();ae.success?(d(fe=>fe.filter(pe=>pe.id!==W)),q.success("Session deleted successfully!",{id:Q})):q.error(`Error deleting session: ${ae.error||"Unknown error"}`,{id:Q})}catch{q.error("Error deleting session",{id:Q})}};p.useEffect(()=>{e&&(T(),F(),C())},[e,C,T,F]);const me=async(W=3)=>{if(e){L([]),I(!0),L([{id:"start",type:"info",message:`Starting session seeding process for ${W} sessions...`,timestamp:new Date}]);try{const Z=await(await fetch(`/api/users/${e}/seed-sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:W})})).json();if(Z.success){const ae=Z.results.map((pe,Se)=>pe.success?{id:`session-${Se}`,type:"progress",message:`Creating session ${Se+1}: ${pe.session.token.substring(0,20)}... from ${pe.session.ipAddress}`,timestamp:new Date,status:"completed"}:{id:`session-${Se}`,type:"error",message:`Failed to create session ${Se+1}: ${pe.error}`,timestamp:new Date});L(pe=>[...pe,...ae]);const fe=Z.results.filter(pe=>pe.success).length;L(pe=>[...pe,{id:"complete",type:"success",message:`✅ Session seeding completed! Created ${fe}/${W} sessions successfully`,timestamp:new Date}]),F()}else L(ae=>[...ae,{id:"error",type:"error",message:`❌ Session seeding failed: ${Z.error||"Unknown error"}`,timestamp:new Date}])}catch(Q){L(Z=>[...Z,{id:"error",type:"error",message:`❌ Network error: ${Q}`,timestamp:new Date}])}finally{I(!1)}}};return f?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:"min-h-screen bg-black w-full",children:[a.jsxs("div",{className:"w-full px-6 py-8",children:[n.banned&&a.jsx("div",{className:"mb-6 border-l-4 border-red-500 bg-red-500/10 p-4",children:a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Hr,{className:"w-5 h-5 text-red-400 mt-0.5"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-red-400 font-semibold text-sm uppercase tracking-wide",children:"User Account Banned"}),a.jsx("p",{className:"text-red-300 text-sm mt-1",children:"This user has been banned from accessing the system."}),n.banReason&&a.jsxs("div",{className:"mt-2 text-sm",children:[a.jsx("span",{className:"text-gray-400",children:"Reason: "}),a.jsx("span",{className:"text-red-300",children:n.banReason})]}),n.banExpires&&a.jsxs("div",{className:"mt-1 text-sm",children:[a.jsx("span",{className:"text-gray-400",children:"Ban expires: "}),a.jsx("span",{className:"text-yellow-400",children:new Date(n.banExpires).toLocaleString()})]})]})]})}),a.jsxs("div",{className:"mb-8",children:[a.jsxs(U,{variant:"outline",onClick:()=>t("/users"),className:"mb-4 border-none text-white",children:[a.jsx(fo,{className:"w-4 h-4 mr-2"}),"Back to Users"]}),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(Ui,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-white",children:n.name}),a.jsx("p",{className:"text-gray-400",children:n.email}),a.jsx("div",{className:"flex items-center space-x-2 mt-2",children:a.jsx(je,{variant:n.emailVerified?"default":"destructive",className:"rounded-none",children:n.emailVerified?"Verified":"Unverified"})})]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs(U,{variant:"outline",onClick:()=>y(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(Fs,{className:"w-4 h-4 mr-2"}),"Edit User"]}),n.banned?a.jsxs(U,{variant:"outline",onClick:()=>x(!0),className:"border border-dashed border-green-400/50 text-green-400 hover:bg-green-400/10 rounded-none",disabled:!$,children:[a.jsx(Hr,{className:"w-4 h-4 mr-2"}),"Unban User"]}):a.jsxs(U,{variant:"outline",onClick:()=>g(!0),className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",disabled:!$,children:[a.jsx(Hr,{className:"w-4 h-4 mr-2"}),"Ban User"]})]})]})]}),a.jsxs("div",{className:"border border-dashed border-white/10 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:Ui},{id:"organizations",name:"Organizations",icon:it,count:s.length},{id:"teams",name:"Teams",icon:Oe,count:o.length},{id:"sessions",name:"Sessions",icon:mr,count:c.length}].map(W=>a.jsxs("button",{onClick:()=>m(W.id),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${h===W.id?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[a.jsx(W.icon,{className:"w-4 h-4"}),a.jsx("span",{children:W.name}),W.count!==void 0&&a.jsx(je,{variant:"outline",className:"rounded-none text-xs",children:W.count})]},W.id))})}),a.jsxs("div",{className:"p-6",children:[h==="details"&&a.jsx("div",{className:"space-y-6",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Name"}),a.jsx("div",{className:"text-white",children:n.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Email"}),a.jsxs("div",{className:"text-white flex items-center space-x-2",children:[a.jsx(pn,{className:"w-4 h-4"}),a.jsx("span",{children:n.email})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Email Status"}),a.jsx(je,{variant:n.emailVerified?"default":"destructive",className:"rounded-none",children:n.emailVerified?"Verified":"Unverified"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Account Status"}),a.jsx(je,{variant:n.banned?"destructive":"default",className:"rounded-none",children:n.banned?"Banned":"Active"}),n.banned&&n.banReason&&a.jsxs("div",{className:"mt-2 text-sm text-red-400",children:["Reason: ",n.banReason]}),n.banned&&n.banExpires&&a.jsxs("div",{className:"mt-1 text-sm text-yellow-400",children:["Expires: ",new Date(n.banExpires).toLocaleDateString()]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Created"}),a.jsxs("div",{className:"text-white flex items-center space-x-2",children:[a.jsx(Sc,{className:"w-4 h-4"}),a.jsx("span",{children:new Date(n.createdAt).toLocaleDateString()})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Last Updated"}),a.jsxs("div",{className:"text-white flex items-center space-x-2",children:[a.jsx(Sc,{className:"w-4 h-4"}),a.jsx("span",{children:new Date(n.updatedAt).toLocaleDateString()})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"User ID"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.id})]})]})]})}),h==="organizations"&&a.jsx("div",{className:"space-y-4",children:s.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(it,{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:s.map(W=>a.jsx("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-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-12 h-12 bg-gray-800 border border-dashed border-white/20 flex items-center justify-center",children:W.organization.image?a.jsx("img",{src:W.organization.image,alt:W.organization.name,className:"w-12 h-12 object-cover"}):a.jsx(it,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium",children:W.organization.name}),a.jsxs("p",{className:"text-gray-400 text-sm",children:["@",W.organization.slug]}),a.jsxs("div",{className:"flex items-center space-x-2 mt-1",children:[a.jsx(je,{variant:"outline",className:"rounded-none text-xs",children:W.role}),a.jsxs("span",{className:"text-gray-400 text-xs",children:["Joined ",new Date(W.joinedAt).toLocaleDateString()]})]})]})]}),a.jsxs(U,{variant:"outline",size:"sm",onClick:()=>ee(W.id),className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(Dx,{className:"w-4 h-4 mr-1"}),"Remove"]})]})},W.id))})}),h==="teams"&&a.jsx("div",{className:"space-y-4",children:o.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Oe,{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(W=>a.jsx("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-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center",children:a.jsx(Oe,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium",children:W.team.name}),a.jsxs("p",{className:"text-gray-400 text-sm",children:["in ",W.team.organizationName]}),a.jsxs("div",{className:"flex items-center space-x-2 mt-1",children:[a.jsx(je,{variant:"outline",className:"rounded-none text-xs",children:W.role}),a.jsxs("span",{className:"text-gray-400 text-xs",children:["Joined ",new Date(W.joinedAt).toLocaleDateString()]})]})]})]}),a.jsxs(U,{variant:"outline",size:"sm",onClick:()=>K(W.id),className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(Dx,{className:"w-4 h-4 mr-1"}),"Remove"]})]})},W.id))})}),h==="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(U,{variant:"outline",onClick:()=>{L([]),I(!1),N(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(Be,{className:"w-4 h-4 mr-2"}),"Seed Sessions"]})]}),c.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(mr,{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(W=>{var Q,Z,ae,fe;return a.jsx("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 -mt-2 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(zC,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"flex items-center space-x-3 mb-2",children:a.jsxs("h3",{className:"text-white font-medium",children:["Session ",W.id.substring(0,8),"..."]})}),a.jsxs("div",{className:"flex items-center space-x-4 mb-1",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(vs,{className:"w-4 h-4 text-white"}),a.jsx("span",{className:"text-white text-sm",children:W.ipAddress})]}),a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx("span",{className:"text-gray-400 text-xs",children:"📍"}),a.jsxs("span",{className:"text-gray-300 text-sm",children:[((Q=D[W.id])==null?void 0:Q.city)||"...",","," ",((Z=D[W.id])==null?void 0:Z.country)||"..."]}),((ae=D[W.id])==null?void 0:ae.countryCode)&&a.jsx("span",{className:"text-sm ml-1",children:B((fe=D[W.id])==null?void 0:fe.countryCode)})]})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(mr,{className:"w-4 h-4 text-white"}),a.jsx("span",{className:"text-gray-400 text-sm",children:"Expires:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(W.expiresAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hour12:!0})})]}),a.jsxs(U,{variant:"outline",size:"sm",onClick:()=>ne(W.id),className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(Hr,{className:"w-4 h-4 mr-1"}),"Revoke"]})]})]})]})})},W.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(U,{variant:"ghost",size:"sm",onClick:()=>y(!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(Ui,{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(U,{variant:"outline",onClick:()=>y(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:H,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),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-dashed border-red-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:"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(De,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),a.jsx(Ce,{id:"banReason",value:k,onChange:W=>S(W.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(De,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),a.jsx(Ce,{id:"banExpires",type:"number",value:M||"",onChange:W=>z(W.target.value?Number(W.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(U,{variant:"outline",onClick:()=>{g(!1),S(""),z(void 0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:X,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),v&&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:n.name}),"? This will restore their access to the system."]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(U,{variant:"outline",onClick:()=>x(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:J,className:"bg-green-600 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),j&&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 Sessions"}),a.jsx(U,{variant:"ghost",size:"sm",onClick:()=>N(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Fe,{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(mr,{className:"w-5 h-5 text-white"}),a.jsxs("h4",{className:"text-white font-light",children:["Create Sessions for ",n==null?void 0:n.name]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx(De,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),a.jsx(Ce,{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("p",{className:"text-xs text-gray-400",children:"Each session will have a unique token, IP address, and 7-day expiration."})]})]}),O.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(Ua,{title:"Session Seeding Terminal",lines:O,isRunning:E,className:"w-full",defaultCollapsed:!1})})]}),a.jsxs("div",{className:"flex justify-end space-x-2 mt-6 pt-6 border-t border-dashed border-white/10",children:[a.jsx(U,{variant:"outline",onClick:()=>N(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(U,{onClick:()=>{var Q;const W=parseInt(((Q=document.getElementById("session-count"))==null?void 0:Q.value)||"3",10);me(W)},disabled:E,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:E?a.jsxs(a.Fragment,{children:[a.jsx(Rt,{className:"w-4 h-4 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Be,{className:"w-4 h-4 mr-2"}),"Seed Sessions"]})})]})]})})]}):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 x$(){return a.jsx(BC,{children:a.jsxs(QS,{children:[a.jsx(M3,{children:a.jsxs(VS,{children:[a.jsx(Zt,{path:"/",element:a.jsx(mT,{})}),a.jsx(Zt,{path:"/users",element:a.jsx(Zb,{})}),a.jsx(Zt,{path:"/users/:userId",element:a.jsx(p$,{})}),a.jsx(Zt,{path:"/organizations",element:a.jsx(Ww,{})}),a.jsx(Zt,{path:"/organizations/:orgId",element:a.jsx(d$,{})}),a.jsx(Zt,{path:"/teams",element:a.jsx(m$,{})}),a.jsx(Zt,{path:"/teams/:teamId",element:a.jsx(j0,{})}),a.jsx(Zt,{path:"/organizations/:orgId/teams/:teamId",element:a.jsx(j0,{})}),a.jsx(Zt,{path:"/sessions",element:a.jsx(u$,{})}),a.jsx(Zt,{path:"/database",element:a.jsx(i$,{})}),a.jsx(Zt,{path:"/database/demo",element:a.jsx(c$,{})}),a.jsx(Zt,{path:"/settings",element:a.jsx(h$,{})})]})}),a.jsx(EC,{theme:"dark",position:"top-right",richColors:!0,closeButton:!0})]})})}Bu.createRoot(document.getElementById("root")).render(a.jsx(Y.StrictMode,{children:a.jsx(x$,{})}));
|