better-auth-studio 1.0.26 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth-adapter.d.ts +1 -0
- package/dist/auth-adapter.d.ts.map +1 -1
- package/dist/auth-adapter.js.map +1 -1
- package/dist/cli.js +18 -3
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +3 -0
- 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 +284 -2
- package/dist/data.js.map +1 -1
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +674 -52
- package/dist/routes.js.map +1 -1
- package/dist/studio.d.ts.map +1 -1
- package/dist/studio.js +9 -0
- package/dist/studio.js.map +1 -1
- package/package.json +4 -3
- package/public/assets/main-CvE7bhI5.css +1 -0
- package/public/assets/main-Dzvwip90.js +674 -0
- package/public/index.html +2 -2
- package/public/assets/main-C14wu34m.css +0 -1
- package/public/assets/main-yHRaRyCA.js +0 -410
|
@@ -1,410 +0,0 @@
|
|
|
1
|
-
function Bj(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 o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{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 o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function xh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C0={exports:{}},Uc={},E0={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 Pi=Symbol.for("react.element"),Wj=Symbol.for("react.portal"),Uj=Symbol.for("react.fragment"),Vj=Symbol.for("react.strict_mode"),Hj=Symbol.for("react.profiler"),Yj=Symbol.for("react.provider"),Xj=Symbol.for("react.context"),qj=Symbol.for("react.forward_ref"),Gj=Symbol.for("react.suspense"),Kj=Symbol.for("react.memo"),Qj=Symbol.for("react.lazy"),up=Symbol.iterator;function Zj(e){return e===null||typeof e!="object"?null:(e=up&&e[up]||e["@@iterator"],typeof e=="function"?e:null)}var M0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_0=Object.assign,P0={};function ro(e,t,n){this.props=e,this.context=t,this.refs=P0,this.updater=n||M0}ro.prototype.isReactComponent={};ro.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")};ro.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function D0(){}D0.prototype=ro.prototype;function gh(e,t,n){this.props=e,this.context=t,this.refs=P0,this.updater=n||M0}var yh=gh.prototype=new D0;yh.constructor=gh;_0(yh,ro.prototype);yh.isPureReactComponent=!0;var fp=Array.isArray,T0=Object.prototype.hasOwnProperty,vh={current:null},O0={key:!0,ref:!0,__self:!0,__source:!0};function A0(e,t,n){var r,s={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)T0.call(t,r)&&!O0.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:Pi,type:e,key:o,ref:i,props:s,_owner:vh.current}}function Jj(e,t){return{$$typeof:Pi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function wh(e){return typeof e=="object"&&e!==null&&e.$$typeof===Pi}function ek(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var hp=/\/+/g;function Ld(e,t){return typeof e=="object"&&e!==null&&e.key!=null?ek(""+e.key):t.toString(36)}function Ol(e,t,n,r,s){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(o){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Pi:case Wj:i=!0}}if(i)return i=e,s=s(i),e=r===""?"."+Ld(i,0):r,fp(s)?(n="",e!=null&&(n=e.replace(hp,"$&/")+"/"),Ol(s,t,n,"",function(d){return d})):s!=null&&(wh(s)&&(s=Jj(s,n+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(hp,"$&/")+"/")+e)),t.push(s)),1;if(i=0,r=r===""?".":r+":",fp(e))for(var l=0;l<e.length;l++){o=e[l];var c=r+Ld(o,l);i+=Ol(o,t,n,c,s)}else if(c=Zj(e),typeof c=="function")for(e=c.call(e),l=0;!(o=e.next()).done;)o=o.value,c=r+Ld(o,l++),i+=Ol(o,t,n,c,s);else if(o==="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 i}function el(e,t,n){if(e==null)return e;var r=[],s=0;return Ol(e,r,"","",function(o){return t.call(n,o,s++)}),r}function tk(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},Al={transition:null},nk={ReactCurrentDispatcher:Ft,ReactCurrentBatchConfig:Al,ReactCurrentOwner:vh};function R0(){throw Error("act(...) is not supported in production builds of React.")}Ee.Children={map:el,forEach:function(e,t,n){el(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return el(e,function(){t++}),t},toArray:function(e){return el(e,function(t){return t})||[]},only:function(e){if(!wh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ee.Component=ro;Ee.Fragment=Uj;Ee.Profiler=Hj;Ee.PureComponent=gh;Ee.StrictMode=Vj;Ee.Suspense=Gj;Ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=nk;Ee.act=R0;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=_0({},e.props),s=e.key,o=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,i=vh.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)T0.call(t,c)&&!O0.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:Pi,type:e.type,key:s,ref:o,props:r,_owner:i}};Ee.createContext=function(e){return e={$$typeof:Xj,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Yj,_context:e},e.Consumer=e};Ee.createElement=A0;Ee.createFactory=function(e){var t=A0.bind(null,e);return t.type=e,t};Ee.createRef=function(){return{current:null}};Ee.forwardRef=function(e){return{$$typeof:qj,render:e}};Ee.isValidElement=wh;Ee.lazy=function(e){return{$$typeof:Qj,_payload:{_status:-1,_result:e},_init:tk}};Ee.memo=function(e,t){return{$$typeof:Kj,type:e,compare:t===void 0?null:t}};Ee.startTransition=function(e){var t=Al.transition;Al.transition={};try{e()}finally{Al.transition=t}};Ee.unstable_act=R0;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";E0.exports=Ee;var p=E0.exports;const Y=xh(p),bh=Bj({__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 rk=p,sk=Symbol.for("react.element"),ak=Symbol.for("react.fragment"),ok=Object.prototype.hasOwnProperty,ik=rk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,lk={key:!0,ref:!0,__self:!0,__source:!0};function I0(e,t,n){var r,s={},o=null,i=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)ok.call(t,r)&&!lk.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:sk,type:e,key:o,ref:i,props:s,_owner:ik.current}}Uc.Fragment=ak;Uc.jsx=I0;Uc.jsxs=I0;C0.exports=Uc;var a=C0.exports,Vu={},z0={exports:{}},dn={},$0={exports:{}},L0={};/**
|
|
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 I=C.length;C.push(_);e:for(;0<I;){var B=I-1>>>1,T=C[B];if(0<s(T,_))C[B]=_,C[I]=T,I=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],I=C.pop();if(I!==_){C[0]=I;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,I))J<T&&0>s(ee,X)?(C[B]=ee,C[J]=I,B=J):(C[B]=X,C[H]=I,B=H);else if(J<T&&0>s(ee,I))C[B]=ee,C[J]=I,B=J;else break e}}return _}function s(C,_){var I=C.sortIndex-_.sortIndex;return I!==0?I:C.id-_.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],d=[],f=1,u=null,h=3,m=!1,w=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(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 N(C){if(v=!1,g(C),!w)if(n(c)!==null)w=!0,D(j);else{var _=n(d);_!==null&&P(N,_.startTime-C)}}function j(C,_){w=!1,v&&(v=!1,x(M),M=-1),m=!0;var I=h;try{for(g(_),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),g(_)}else r(c);u=n(c)}if(u!==null)var F=!0;else{var H=n(d);H!==null&&P(N,H.startTime-_),F=!1}return F}finally{u=null,h=I,m=!1}}var k=!1,S=null,M=-1,R=5,z=-1;function A(){return!(e.unstable_now()-z<R)}function O(){if(S!==null){var C=e.unstable_now();z=C;var _=!0;try{_=S(!0,C)}finally{_?L():(k=!1,S=null)}}else k=!1}var L;if(typeof y=="function")L=function(){y(O)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,$=E.port2;E.port1.onmessage=O,L=function(){$.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(j))},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"):R=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 I=h;h=_;try{return C()}finally{h=I}},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 I=h;h=C;try{return _()}finally{h=I}},e.unstable_scheduleCallback=function(C,_,I){var B=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?B+I:B):I=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=I+T,C={id:f++,callback:_,priorityLevel:C,startTime:I,expirationTime:T,sortIndex:-1},I>B?(C.sortIndex=I,t(d,C),n(c)===null&&C===n(d)&&(v?(x(M),M=-1):v=!0,P(N,I-B))):(C.sortIndex=T,t(c,C),w||m||(w=!0,D(j))),C},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(C){var _=h;return function(){var I=h;h=_;try{return C.apply(this,arguments)}finally{h=I}}}})(L0);$0.exports=L0;var ck=$0.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 dk=p,on=ck;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 F0=new Set,qo={};function Ks(e,t){Ia(e,t),Ia(e+"Capture",t)}function Ia(e,t){for(qo[e]=t,e=0;e<t.length;e++)F0.add(t[e])}var br=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hu=Object.prototype.hasOwnProperty,uk=/^[: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]*$/,mp={},pp={};function fk(e){return Hu.call(pp,e)?!0:Hu.call(mp,e)?!1:uk.test(e)?pp[e]=!0:(mp[e]=!0,!1)}function hk(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 mk(e,t,n,r){if(t===null||typeof t>"u"||hk(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,o,i){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=o,this.removeEmptyString=i}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 Nh=/[\-:]([a-z])/g;function jh(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(Nh,jh);_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(Nh,jh);_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(Nh,jh);_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 kh(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")&&(mk(t,n,s,r)&&(n=null),r||s===null?fk(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=dk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,tl=Symbol.for("react.element"),da=Symbol.for("react.portal"),ua=Symbol.for("react.fragment"),Sh=Symbol.for("react.strict_mode"),Yu=Symbol.for("react.profiler"),B0=Symbol.for("react.provider"),W0=Symbol.for("react.context"),Ch=Symbol.for("react.forward_ref"),Xu=Symbol.for("react.suspense"),qu=Symbol.for("react.suspense_list"),Eh=Symbol.for("react.memo"),zr=Symbol.for("react.lazy"),U0=Symbol.for("react.offscreen"),xp=Symbol.iterator;function fo(e){return e===null||typeof e!="object"?null:(e=xp&&e[xp]||e["@@iterator"],typeof e=="function"?e:null)}var rt=Object.assign,Fd;function _o(e){if(Fd===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Fd=t&&t[1]||""}return`
|
|
34
|
-
`+Fd+e}var Bd=!1;function Wd(e,t){if(!e||Bd)return"";Bd=!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
|
-
`),o=r.stack.split(`
|
|
36
|
-
`),i=s.length-1,l=o.length-1;1<=i&&0<=l&&s[i]!==o[l];)l--;for(;1<=i&&0<=l;i--,l--)if(s[i]!==o[l]){if(i!==1||l!==1)do if(i--,l--,0>l||s[i]!==o[l]){var c=`
|
|
37
|
-
`+s[i].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=i&&0<=l);break}}}finally{Bd=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?_o(e):""}function pk(e){switch(e.tag){case 5:return _o(e.type);case 16:return _o("Lazy");case 13:return _o("Suspense");case 19:return _o("SuspenseList");case 0:case 2:case 15:return e=Wd(e.type,!1),e;case 11:return e=Wd(e.type.render,!1),e;case 1:return e=Wd(e.type,!0),e;default:return""}}function Gu(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 ua:return"Fragment";case da:return"Portal";case Yu:return"Profiler";case Sh:return"StrictMode";case Xu:return"Suspense";case qu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case W0:return(e.displayName||"Context")+".Consumer";case B0:return(e._context.displayName||"Context")+".Provider";case Ch:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Eh:return t=e.displayName||null,t!==null?t:Gu(e.type)||"Memo";case zr:t=e._payload,e=e._init;try{return Gu(e(t))}catch{}}return null}function xk(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 Gu(t);case 8:return t===Sh?"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 os(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function V0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function gk(e){var t=V0(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,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function nl(e){e._valueTracker||(e._valueTracker=gk(e))}function H0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=V0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function tc(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 Ku(e,t){var n=t.checked;return rt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function gp(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=os(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 Y0(e,t){t=t.checked,t!=null&&kh(e,"checked",t,!1)}function Qu(e,t){Y0(e,t);var n=os(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")?Zu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Zu(e,t.type,os(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function yp(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 Zu(e,t,n){(t!=="number"||tc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Po=Array.isArray;function ka(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=""+os(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 Ju(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(re(91));return rt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function vp(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(Po(n)){if(1<n.length)throw Error(re(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:os(n)}}function X0(e,t){var n=os(t.value),r=os(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 wp(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function q0(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 ef(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?q0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var rl,G0=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(rl=rl||document.createElement("div"),rl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=rl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Go(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Io={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},yk=["Webkit","ms","Moz","O"];Object.keys(Io).forEach(function(e){yk.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Io[t]=Io[e]})});function K0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Io.hasOwnProperty(e)&&Io[e]?(""+t).trim():t+"px"}function Q0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=K0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var vk=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 tf(e,t){if(t){if(vk[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 nf(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 rf=null;function Mh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var sf=null,Sa=null,Ca=null;function bp(e){if(e=Oi(e)){if(typeof sf!="function")throw Error(re(280));var t=e.stateNode;t&&(t=qc(t),sf(e.stateNode,e.type,t))}}function Z0(e){Sa?Ca?Ca.push(e):Ca=[e]:Sa=e}function J0(){if(Sa){var e=Sa,t=Ca;if(Ca=Sa=null,bp(e),t)for(e=0;e<t.length;e++)bp(t[e])}}function ey(e,t){return e(t)}function ty(){}var Ud=!1;function ny(e,t,n){if(Ud)return e(t,n);Ud=!0;try{return ey(e,t,n)}finally{Ud=!1,(Sa!==null||Ca!==null)&&(ty(),J0())}}function Ko(e,t){var n=e.stateNode;if(n===null)return null;var r=qc(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 af=!1;if(br)try{var ho={};Object.defineProperty(ho,"passive",{get:function(){af=!0}}),window.addEventListener("test",ho,ho),window.removeEventListener("test",ho,ho)}catch{af=!1}function wk(e,t,n,r,s,o,i,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(f){this.onError(f)}}var zo=!1,nc=null,rc=!1,of=null,bk={onError:function(e){zo=!0,nc=e}};function Nk(e,t,n,r,s,o,i,l,c){zo=!1,nc=null,wk.apply(bk,arguments)}function jk(e,t,n,r,s,o,i,l,c){if(Nk.apply(this,arguments),zo){if(zo){var d=nc;zo=!1,nc=null}else throw Error(re(198));rc||(rc=!0,of=d)}}function Qs(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 ry(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 Np(e){if(Qs(e)!==e)throw Error(re(188))}function kk(e){var t=e.alternate;if(!t){if(t=Qs(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 o=s.alternate;if(o===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===n)return Np(s),e;if(o===r)return Np(s),t;o=o.sibling}throw Error(re(188))}if(n.return!==r.return)n=s,r=o;else{for(var i=!1,l=s.child;l;){if(l===n){i=!0,n=s,r=o;break}if(l===r){i=!0,r=s,n=o;break}l=l.sibling}if(!i){for(l=o.child;l;){if(l===n){i=!0,n=o,r=s;break}if(l===r){i=!0,r=o,n=s;break}l=l.sibling}if(!i)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 sy(e){return e=kk(e),e!==null?ay(e):null}function ay(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ay(e);if(t!==null)return t;e=e.sibling}return null}var oy=on.unstable_scheduleCallback,jp=on.unstable_cancelCallback,Sk=on.unstable_shouldYield,Ck=on.unstable_requestPaint,it=on.unstable_now,Ek=on.unstable_getCurrentPriorityLevel,_h=on.unstable_ImmediatePriority,iy=on.unstable_UserBlockingPriority,sc=on.unstable_NormalPriority,Mk=on.unstable_LowPriority,ly=on.unstable_IdlePriority,Vc=null,Qn=null;function _k(e){if(Qn&&typeof Qn.onCommitFiberRoot=="function")try{Qn.onCommitFiberRoot(Vc,e,void 0,(e.current.flags&128)===128)}catch{}}var Dn=Math.clz32?Math.clz32:Tk,Pk=Math.log,Dk=Math.LN2;function Tk(e){return e>>>=0,e===0?32:31-(Pk(e)/Dk|0)|0}var sl=64,al=4194304;function Do(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 ac(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var l=i&~s;l!==0?r=Do(l):(o&=i,o!==0&&(r=Do(o)))}else i=n&~s,i!==0?r=Do(i):o!==0&&(r=Do(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&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 Ok(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 Ak(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-Dn(o),l=1<<i,c=s[i];c===-1?(!(l&n)||l&r)&&(s[i]=Ok(l,t)):c<=t&&(e.expiredLanes|=l),o&=~l}}function lf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function cy(){var e=sl;return sl<<=1,!(sl&4194240)&&(sl=64),e}function Vd(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Di(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 Rk(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),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function Ph(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 dy(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var uy,Dh,fy,hy,my,cf=!1,ol=[],Yr=null,Xr=null,qr=null,Qo=new Map,Zo=new Map,Lr=[],Ik="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 kp(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":Qo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zo.delete(t.pointerId)}}function mo(e,t,n,r,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[s]},t!==null&&(t=Oi(t),t!==null&&Dh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function zk(e,t,n,r,s){switch(t){case"focusin":return Yr=mo(Yr,e,t,n,r,s),!0;case"dragenter":return Xr=mo(Xr,e,t,n,r,s),!0;case"mouseover":return qr=mo(qr,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return Qo.set(o,mo(Qo.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,Zo.set(o,mo(Zo.get(o)||null,e,t,n,r,s)),!0}return!1}function py(e){var t=Ss(e.target);if(t!==null){var n=Qs(t);if(n!==null){if(t=n.tag,t===13){if(t=ry(n),t!==null){e.blockedOn=t,my(e.priority,function(){fy(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 Rl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=df(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);rf=r,n.target.dispatchEvent(r),rf=null}else return t=Oi(n),t!==null&&Dh(t),e.blockedOn=n,!1;t.shift()}return!0}function Sp(e,t,n){Rl(e)&&n.delete(t)}function $k(){cf=!1,Yr!==null&&Rl(Yr)&&(Yr=null),Xr!==null&&Rl(Xr)&&(Xr=null),qr!==null&&Rl(qr)&&(qr=null),Qo.forEach(Sp),Zo.forEach(Sp)}function po(e,t){e.blockedOn===t&&(e.blockedOn=null,cf||(cf=!0,on.unstable_scheduleCallback(on.unstable_NormalPriority,$k)))}function Jo(e){function t(s){return po(s,e)}if(0<ol.length){po(ol[0],e);for(var n=1;n<ol.length;n++){var r=ol[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Yr!==null&&po(Yr,e),Xr!==null&&po(Xr,e),qr!==null&&po(qr,e),Qo.forEach(t),Zo.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);)py(n),n.blockedOn===null&&Lr.shift()}var Ea=Mr.ReactCurrentBatchConfig,oc=!0;function Lk(e,t,n,r){var s=$e,o=Ea.transition;Ea.transition=null;try{$e=1,Th(e,t,n,r)}finally{$e=s,Ea.transition=o}}function Fk(e,t,n,r){var s=$e,o=Ea.transition;Ea.transition=null;try{$e=4,Th(e,t,n,r)}finally{$e=s,Ea.transition=o}}function Th(e,t,n,r){if(oc){var s=df(e,t,n,r);if(s===null)eu(e,t,r,ic,n),kp(e,r);else if(zk(s,e,t,n,r))r.stopPropagation();else if(kp(e,r),t&4&&-1<Ik.indexOf(e)){for(;s!==null;){var o=Oi(s);if(o!==null&&uy(o),o=df(e,t,n,r),o===null&&eu(e,t,r,ic,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else eu(e,t,r,null,n)}}var ic=null;function df(e,t,n,r){if(ic=null,e=Mh(r),e=Ss(e),e!==null)if(t=Qs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ry(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 xy(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(Ek()){case _h:return 1;case iy:return 4;case sc:case Mk:return 16;case ly:return 536870912;default:return 16}default:return 16}}var Wr=null,Oh=null,Il=null;function gy(){if(Il)return Il;var e,t=Oh,n=t.length,r,s="value"in Wr?Wr.value:Wr.textContent,o=s.length;for(e=0;e<n&&t[e]===s[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===s[o-r];r++);return Il=s.slice(e,1<r?1-r:void 0)}function zl(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 Cp(){return!1}function un(e){function t(n,r,s,o,i){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?il:Cp,this.isPropagationStopped=Cp,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 so={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ah=un(so),Ti=rt({},so,{view:0,detail:0}),Bk=un(Ti),Hd,Yd,xo,Hc=rt({},Ti,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rh,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!==xo&&(xo&&e.type==="mousemove"?(Hd=e.screenX-xo.screenX,Yd=e.screenY-xo.screenY):Yd=Hd=0,xo=e),Hd)},movementY:function(e){return"movementY"in e?e.movementY:Yd}}),Ep=un(Hc),Wk=rt({},Hc,{dataTransfer:0}),Uk=un(Wk),Vk=rt({},Ti,{relatedTarget:0}),Xd=un(Vk),Hk=rt({},so,{animationName:0,elapsedTime:0,pseudoElement:0}),Yk=un(Hk),Xk=rt({},so,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),qk=un(Xk),Gk=rt({},so,{data:0}),Mp=un(Gk),Kk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qk={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"},Zk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jk(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zk[e])?!!t[e]:!1}function Rh(){return Jk}var e2=rt({},Ti,{key:function(e){if(e.key){var t=Kk[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=zl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Qk[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rh,charCode:function(e){return e.type==="keypress"?zl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),t2=un(e2),n2=rt({},Hc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_p=un(n2),r2=rt({},Ti,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rh}),s2=un(r2),a2=rt({},so,{propertyName:0,elapsedTime:0,pseudoElement:0}),o2=un(a2),i2=rt({},Hc,{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}),l2=un(i2),c2=[9,13,27,32],Ih=br&&"CompositionEvent"in window,$o=null;br&&"documentMode"in document&&($o=document.documentMode);var d2=br&&"TextEvent"in window&&!$o,yy=br&&(!Ih||$o&&8<$o&&11>=$o),Pp=" ",Dp=!1;function vy(e,t){switch(e){case"keyup":return c2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wy(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fa=!1;function u2(e,t){switch(e){case"compositionend":return wy(t);case"keypress":return t.which!==32?null:(Dp=!0,Pp);case"textInput":return e=t.data,e===Pp&&Dp?null:e;default:return null}}function f2(e,t){if(fa)return e==="compositionend"||!Ih&&vy(e,t)?(e=gy(),Il=Oh=Wr=null,fa=!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 yy&&t.locale!=="ko"?null:t.data;default:return null}}var h2={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 Tp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!h2[e.type]:t==="textarea"}function by(e,t,n,r){Z0(r),t=lc(t,"onChange"),0<t.length&&(n=new Ah("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Lo=null,ei=null;function m2(e){Ty(e,0)}function Yc(e){var t=pa(e);if(H0(t))return e}function p2(e,t){if(e==="change")return t}var Ny=!1;if(br){var qd;if(br){var Gd="oninput"in document;if(!Gd){var Op=document.createElement("div");Op.setAttribute("oninput","return;"),Gd=typeof Op.oninput=="function"}qd=Gd}else qd=!1;Ny=qd&&(!document.documentMode||9<document.documentMode)}function Ap(){Lo&&(Lo.detachEvent("onpropertychange",jy),ei=Lo=null)}function jy(e){if(e.propertyName==="value"&&Yc(ei)){var t=[];by(t,ei,e,Mh(e)),ny(m2,t)}}function x2(e,t,n){e==="focusin"?(Ap(),Lo=t,ei=n,Lo.attachEvent("onpropertychange",jy)):e==="focusout"&&Ap()}function g2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Yc(ei)}function y2(e,t){if(e==="click")return Yc(t)}function v2(e,t){if(e==="input"||e==="change")return Yc(t)}function w2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var An=typeof Object.is=="function"?Object.is:w2;function ti(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(!Hu.call(t,s)||!An(e[s],t[s]))return!1}return!0}function Rp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ip(e,t){var n=Rp(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=Rp(n)}}function ky(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ky(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sy(){for(var e=window,t=tc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=tc(e.document)}return t}function zh(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 b2(e){var t=Sy(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ky(n.ownerDocument.documentElement,n)){if(r!==null&&zh(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,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=Ip(n,o);var i=Ip(n,r);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.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 N2=br&&"documentMode"in document&&11>=document.documentMode,ha=null,uf=null,Fo=null,ff=!1;function zp(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ff||ha==null||ha!==tc(r)||(r=ha,"selectionStart"in r&&zh(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}),Fo&&ti(Fo,r)||(Fo=r,r=lc(uf,"onSelect"),0<r.length&&(t=new Ah("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ha)))}function ll(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ma={animationend:ll("Animation","AnimationEnd"),animationiteration:ll("Animation","AnimationIteration"),animationstart:ll("Animation","AnimationStart"),transitionend:ll("Transition","TransitionEnd")},Kd={},Cy={};br&&(Cy=document.createElement("div").style,"AnimationEvent"in window||(delete ma.animationend.animation,delete ma.animationiteration.animation,delete ma.animationstart.animation),"TransitionEvent"in window||delete ma.transitionend.transition);function Xc(e){if(Kd[e])return Kd[e];if(!ma[e])return e;var t=ma[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Cy)return Kd[e]=t[n];return e}var Ey=Xc("animationend"),My=Xc("animationiteration"),_y=Xc("animationstart"),Py=Xc("transitionend"),Dy=new Map,$p="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 hs(e,t){Dy.set(e,t),Ks(t,[e])}for(var Qd=0;Qd<$p.length;Qd++){var Zd=$p[Qd],j2=Zd.toLowerCase(),k2=Zd[0].toUpperCase()+Zd.slice(1);hs(j2,"on"+k2)}hs(Ey,"onAnimationEnd");hs(My,"onAnimationIteration");hs(_y,"onAnimationStart");hs("dblclick","onDoubleClick");hs("focusin","onFocus");hs("focusout","onBlur");hs(Py,"onTransitionEnd");Ia("onMouseEnter",["mouseout","mouseover"]);Ia("onMouseLeave",["mouseout","mouseover"]);Ia("onPointerEnter",["pointerout","pointerover"]);Ia("onPointerLeave",["pointerout","pointerover"]);Ks("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ks("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ks("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ks("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ks("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ks("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var To="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(" "),S2=new Set("cancel close invalid load scroll toggle".split(" ").concat(To));function Lp(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,jk(r,t,void 0,e),e.currentTarget=null}function Ty(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 o=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==o&&s.isPropagationStopped())break e;Lp(s,l,d),o=c}else for(i=0;i<r.length;i++){if(l=r[i],c=l.instance,d=l.currentTarget,l=l.listener,c!==o&&s.isPropagationStopped())break e;Lp(s,l,d),o=c}}}if(rc)throw e=of,rc=!1,of=null,e}function He(e,t){var n=t[gf];n===void 0&&(n=t[gf]=new Set);var r=e+"__bubble";n.has(r)||(Oy(t,e,2,!1),n.add(r))}function Jd(e,t,n){var r=0;t&&(r|=4),Oy(n,e,r,t)}var cl="_reactListening"+Math.random().toString(36).slice(2);function ni(e){if(!e[cl]){e[cl]=!0,F0.forEach(function(n){n!=="selectionchange"&&(S2.has(n)||Jd(n,!1,e),Jd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[cl]||(t[cl]=!0,Jd("selectionchange",!1,t))}}function Oy(e,t,n,r){switch(xy(t)){case 1:var s=Lk;break;case 4:s=Fk;break;default:s=Th}n=s.bind(null,t,n,e),s=void 0,!af||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 eu(e,t,n,r,s){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(i===4)for(i=r.return;i!==null;){var c=i.tag;if((c===3||c===4)&&(c=i.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;i=i.return}for(;l!==null;){if(i=Ss(l),i===null)return;if(c=i.tag,c===5||c===6){r=o=i;continue e}l=l.parentNode}}r=r.return}ny(function(){var d=o,f=Mh(n),u=[];e:{var h=Dy.get(e);if(h!==void 0){var m=Ah,w=e;switch(e){case"keypress":if(zl(n)===0)break e;case"keydown":case"keyup":m=t2;break;case"focusin":w="focus",m=Xd;break;case"focusout":w="blur",m=Xd;break;case"beforeblur":case"afterblur":m=Xd;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=Ep;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Uk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=s2;break;case Ey:case My:case _y:m=Yk;break;case Py:m=o2;break;case"scroll":m=Bk;break;case"wheel":m=l2;break;case"copy":case"cut":case"paste":m=qk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=_p}var v=(t&4)!==0,b=!v&&e==="scroll",x=v?h!==null?h+"Capture":null:h;v=[];for(var y=d,g;y!==null;){g=y;var N=g.stateNode;if(g.tag===5&&N!==null&&(g=N,x!==null&&(N=Ko(y,x),N!=null&&v.push(ri(y,N,g)))),b)break;y=y.return}0<v.length&&(h=new m(h,w,null,n,f),u.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==rf&&(w=n.relatedTarget||n.fromElement)&&(Ss(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?Ss(w):null,w!==null&&(b=Qs(w),w!==b||w.tag!==5&&w.tag!==6)&&(w=null)):(m=null,w=d),m!==w)){if(v=Ep,N="onMouseLeave",x="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(v=_p,N="onPointerLeave",x="onPointerEnter",y="pointer"),b=m==null?h:pa(m),g=w==null?h:pa(w),h=new v(N,y+"leave",m,n,f),h.target=b,h.relatedTarget=g,N=null,Ss(f)===d&&(v=new v(x,y+"enter",w,n,f),v.target=g,v.relatedTarget=b,N=v),b=N,m&&w)t:{for(v=m,x=w,y=0,g=v;g;g=ta(g))y++;for(g=0,N=x;N;N=ta(N))g++;for(;0<y-g;)v=ta(v),y--;for(;0<g-y;)x=ta(x),g--;for(;y--;){if(v===x||x!==null&&v===x.alternate)break t;v=ta(v),x=ta(x)}v=null}else v=null;m!==null&&Fp(u,h,m,v,!1),w!==null&&b!==null&&Fp(u,b,w,v,!0)}}e:{if(h=d?pa(d):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var j=p2;else if(Tp(h))if(Ny)j=v2;else{j=g2;var k=x2}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=y2);if(j&&(j=j(e,d))){by(u,j,n,f);break e}k&&k(e,h,d),e==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&Zu(h,"number",h.value)}switch(k=d?pa(d):window,e){case"focusin":(Tp(k)||k.contentEditable==="true")&&(ha=k,uf=d,Fo=null);break;case"focusout":Fo=uf=ha=null;break;case"mousedown":ff=!0;break;case"contextmenu":case"mouseup":case"dragend":ff=!1,zp(u,n,f);break;case"selectionchange":if(N2)break;case"keydown":case"keyup":zp(u,n,f)}var S;if(Ih)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 fa?vy(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(yy&&n.locale!=="ko"&&(fa||M!=="onCompositionStart"?M==="onCompositionEnd"&&fa&&(S=gy()):(Wr=f,Oh="value"in Wr?Wr.value:Wr.textContent,fa=!0)),k=lc(d,M),0<k.length&&(M=new Mp(M,e,null,n,f),u.push({event:M,listeners:k}),S?M.data=S:(S=wy(n),S!==null&&(M.data=S)))),(S=d2?u2(e,n):f2(e,n))&&(d=lc(d,"onBeforeInput"),0<d.length&&(f=new Mp("onBeforeInput","beforeinput",null,n,f),u.push({event:f,listeners:d}),f.data=S))}Ty(u,t)})}function ri(e,t,n){return{instance:e,listener:t,currentTarget:n}}function lc(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=Ko(e,n),o!=null&&r.unshift(ri(e,o,s)),o=Ko(e,t),o!=null&&r.push(ri(e,o,s))),e=e.return}return r}function ta(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Fp(e,t,n,r,s){for(var o=t._reactName,i=[];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=Ko(n,o),c!=null&&i.unshift(ri(n,c,l))):s||(c=Ko(n,o),c!=null&&i.push(ri(n,c,l)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var C2=/\r\n?/g,E2=/\u0000|\uFFFD/g;function Bp(e){return(typeof e=="string"?e:""+e).replace(C2,`
|
|
38
|
-
`).replace(E2,"")}function dl(e,t,n){if(t=Bp(t),Bp(e)!==t&&n)throw Error(re(425))}function cc(){}var hf=null,mf=null;function pf(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 xf=typeof setTimeout=="function"?setTimeout:void 0,M2=typeof clearTimeout=="function"?clearTimeout:void 0,Wp=typeof Promise=="function"?Promise:void 0,_2=typeof queueMicrotask=="function"?queueMicrotask:typeof Wp<"u"?function(e){return Wp.resolve(null).then(e).catch(P2)}:xf;function P2(e){setTimeout(function(){throw e})}function tu(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),Jo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Jo(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 Up(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 ao=Math.random().toString(36).slice(2),Xn="__reactFiber$"+ao,si="__reactProps$"+ao,Nr="__reactContainer$"+ao,gf="__reactEvents$"+ao,D2="__reactListeners$"+ao,T2="__reactHandles$"+ao;function Ss(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=Up(e);e!==null;){if(n=e[Xn])return n;e=Up(e)}return t}e=n,n=e.parentNode}return null}function Oi(e){return e=e[Xn]||e[Nr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function pa(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(re(33))}function qc(e){return e[si]||null}var yf=[],xa=-1;function ms(e){return{current:e}}function Ye(e){0>xa||(e.current=yf[xa],yf[xa]=null,xa--)}function We(e,t){xa++,yf[xa]=e.current,e.current=t}var is={},It=ms(is),qt=ms(!1),zs=is;function za(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={},o;for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Gt(e){return e=e.childContextTypes,e!=null}function dc(){Ye(qt),Ye(It)}function Vp(e,t,n){if(It.current!==is)throw Error(re(168));We(It,t),We(qt,n)}function Ay(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,xk(e)||"Unknown",s));return rt({},n,r)}function uc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||is,zs=It.current,We(It,e),We(qt,qt.current),!0}function Hp(e,t,n){var r=e.stateNode;if(!r)throw Error(re(169));n?(e=Ay(e,t,zs),r.__reactInternalMemoizedMergedChildContext=e,Ye(qt),Ye(It),We(It,e)):Ye(qt),We(qt,n)}var ur=null,Gc=!1,nu=!1;function Ry(e){ur===null?ur=[e]:ur.push(e)}function O2(e){Gc=!0,Ry(e)}function ps(){if(!nu&&ur!==null){nu=!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,Gc=!1}catch(s){throw ur!==null&&(ur=ur.slice(e+1)),oy(_h,ps),s}finally{$e=t,nu=!1}}return null}var ga=[],ya=0,fc=null,hc=0,xn=[],gn=0,$s=null,fr=1,hr="";function vs(e,t){ga[ya++]=hc,ga[ya++]=fc,fc=e,hc=t}function Iy(e,t,n){xn[gn++]=fr,xn[gn++]=hr,xn[gn++]=$s,$s=e;var r=fr;e=hr;var s=32-Dn(r)-1;r&=~(1<<s),n+=1;var o=32-Dn(t)+s;if(30<o){var i=s-s%5;o=(r&(1<<i)-1).toString(32),r>>=i,s-=i,fr=1<<32-Dn(t)+s|n<<s|r,hr=o+e}else fr=1<<o|n<<s|r,hr=e}function $h(e){e.return!==null&&(vs(e,1),Iy(e,1,0))}function Lh(e){for(;e===fc;)fc=ga[--ya],ga[ya]=null,hc=ga[--ya],ga[ya]=null;for(;e===$s;)$s=xn[--gn],xn[gn]=null,hr=xn[--gn],xn[gn]=null,fr=xn[--gn],xn[gn]=null}var sn=null,rn=null,Ge=!1,Cn=null;function zy(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 Yp(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=$s!==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 vf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function wf(e){if(Ge){var t=rn;if(t){var n=t;if(!Yp(e,t)){if(vf(e))throw Error(re(418));t=Gr(n.nextSibling);var r=sn;t&&Yp(e,t)?zy(r,n):(e.flags=e.flags&-4097|2,Ge=!1,sn=e)}}else{if(vf(e))throw Error(re(418));e.flags=e.flags&-4097|2,Ge=!1,sn=e}}}function Xp(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;sn=e}function ul(e){if(e!==sn)return!1;if(!Ge)return Xp(e),Ge=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!pf(e.type,e.memoizedProps)),t&&(t=rn)){if(vf(e))throw $y(),Error(re(418));for(;t;)zy(e,t),t=Gr(t.nextSibling)}if(Xp(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 $y(){for(var e=rn;e;)e=Gr(e.nextSibling)}function $a(){rn=sn=null,Ge=!1}function Fh(e){Cn===null?Cn=[e]:Cn.push(e)}var A2=Mr.ReactCurrentBatchConfig;function go(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,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(i){var l=s.refs;i===null?delete l[o]:l[o]=i},t._stringRef=o,t)}if(typeof e!="string")throw Error(re(284));if(!n._owner)throw Error(re(290,e))}return e}function fl(e,t){throw e=Object.prototype.toString.call(t),Error(re(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function qp(e){var t=e._init;return t(e._payload)}function Ly(e){function t(x,y){if(e){var g=x.deletions;g===null?(x.deletions=[y],x.flags|=16):g.push(y)}}function n(x,y){if(!e)return null;for(;y!==null;)t(x,y),y=y.sibling;return null}function r(x,y){for(x=new Map;y!==null;)y.key!==null?x.set(y.key,y):x.set(y.index,y),y=y.sibling;return x}function s(x,y){return x=Jr(x,y),x.index=0,x.sibling=null,x}function o(x,y,g){return x.index=g,e?(g=x.alternate,g!==null?(g=g.index,g<y?(x.flags|=2,y):g):(x.flags|=2,y)):(x.flags|=1048576,y)}function i(x){return e&&x.alternate===null&&(x.flags|=2),x}function l(x,y,g,N){return y===null||y.tag!==6?(y=cu(g,x.mode,N),y.return=x,y):(y=s(y,g),y.return=x,y)}function c(x,y,g,N){var j=g.type;return j===ua?f(x,y,g.props.children,N,g.key):y!==null&&(y.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===zr&&qp(j)===y.type)?(N=s(y,g.props),N.ref=go(x,y,g),N.return=x,N):(N=Vl(g.type,g.key,g.props,null,x.mode,N),N.ref=go(x,y,g),N.return=x,N)}function d(x,y,g,N){return y===null||y.tag!==4||y.stateNode.containerInfo!==g.containerInfo||y.stateNode.implementation!==g.implementation?(y=du(g,x.mode,N),y.return=x,y):(y=s(y,g.children||[]),y.return=x,y)}function f(x,y,g,N,j){return y===null||y.tag!==7?(y=Ds(g,x.mode,N,j),y.return=x,y):(y=s(y,g),y.return=x,y)}function u(x,y,g){if(typeof y=="string"&&y!==""||typeof y=="number")return y=cu(""+y,x.mode,g),y.return=x,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case tl:return g=Vl(y.type,y.key,y.props,null,x.mode,g),g.ref=go(x,null,y),g.return=x,g;case da:return y=du(y,x.mode,g),y.return=x,y;case zr:var N=y._init;return u(x,N(y._payload),g)}if(Po(y)||fo(y))return y=Ds(y,x.mode,g,null),y.return=x,y;fl(x,y)}return null}function h(x,y,g,N){var j=y!==null?y.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return j!==null?null:l(x,y,""+g,N);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case tl:return g.key===j?c(x,y,g,N):null;case da:return g.key===j?d(x,y,g,N):null;case zr:return j=g._init,h(x,y,j(g._payload),N)}if(Po(g)||fo(g))return j!==null?null:f(x,y,g,N,null);fl(x,g)}return null}function m(x,y,g,N,j){if(typeof N=="string"&&N!==""||typeof N=="number")return x=x.get(g)||null,l(y,x,""+N,j);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case tl:return x=x.get(N.key===null?g:N.key)||null,c(y,x,N,j);case da:return x=x.get(N.key===null?g:N.key)||null,d(y,x,N,j);case zr:var k=N._init;return m(x,y,g,k(N._payload),j)}if(Po(N)||fo(N))return x=x.get(g)||null,f(y,x,N,j,null);fl(y,N)}return null}function w(x,y,g,N){for(var j=null,k=null,S=y,M=y=0,R=null;S!==null&&M<g.length;M++){S.index>M?(R=S,S=null):R=S.sibling;var z=h(x,S,g[M],N);if(z===null){S===null&&(S=R);break}e&&S&&z.alternate===null&&t(x,S),y=o(z,y,M),k===null?j=z:k.sibling=z,k=z,S=R}if(M===g.length)return n(x,S),Ge&&vs(x,M),j;if(S===null){for(;M<g.length;M++)S=u(x,g[M],N),S!==null&&(y=o(S,y,M),k===null?j=S:k.sibling=S,k=S);return Ge&&vs(x,M),j}for(S=r(x,S);M<g.length;M++)R=m(S,x,M,g[M],N),R!==null&&(e&&R.alternate!==null&&S.delete(R.key===null?M:R.key),y=o(R,y,M),k===null?j=R:k.sibling=R,k=R);return e&&S.forEach(function(A){return t(x,A)}),Ge&&vs(x,M),j}function v(x,y,g,N){var j=fo(g);if(typeof j!="function")throw Error(re(150));if(g=j.call(g),g==null)throw Error(re(151));for(var k=j=null,S=y,M=y=0,R=null,z=g.next();S!==null&&!z.done;M++,z=g.next()){S.index>M?(R=S,S=null):R=S.sibling;var A=h(x,S,z.value,N);if(A===null){S===null&&(S=R);break}e&&S&&A.alternate===null&&t(x,S),y=o(A,y,M),k===null?j=A:k.sibling=A,k=A,S=R}if(z.done)return n(x,S),Ge&&vs(x,M),j;if(S===null){for(;!z.done;M++,z=g.next())z=u(x,z.value,N),z!==null&&(y=o(z,y,M),k===null?j=z:k.sibling=z,k=z);return Ge&&vs(x,M),j}for(S=r(x,S);!z.done;M++,z=g.next())z=m(S,x,M,z.value,N),z!==null&&(e&&z.alternate!==null&&S.delete(z.key===null?M:z.key),y=o(z,y,M),k===null?j=z:k.sibling=z,k=z);return e&&S.forEach(function(O){return t(x,O)}),Ge&&vs(x,M),j}function b(x,y,g,N){if(typeof g=="object"&&g!==null&&g.type===ua&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case tl:e:{for(var j=g.key,k=y;k!==null;){if(k.key===j){if(j=g.type,j===ua){if(k.tag===7){n(x,k.sibling),y=s(k,g.props.children),y.return=x,x=y;break e}}else if(k.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===zr&&qp(j)===k.type){n(x,k.sibling),y=s(k,g.props),y.ref=go(x,k,g),y.return=x,x=y;break e}n(x,k);break}else t(x,k);k=k.sibling}g.type===ua?(y=Ds(g.props.children,x.mode,N,g.key),y.return=x,x=y):(N=Vl(g.type,g.key,g.props,null,x.mode,N),N.ref=go(x,y,g),N.return=x,x=N)}return i(x);case da:e:{for(k=g.key;y!==null;){if(y.key===k)if(y.tag===4&&y.stateNode.containerInfo===g.containerInfo&&y.stateNode.implementation===g.implementation){n(x,y.sibling),y=s(y,g.children||[]),y.return=x,x=y;break e}else{n(x,y);break}else t(x,y);y=y.sibling}y=du(g,x.mode,N),y.return=x,x=y}return i(x);case zr:return k=g._init,b(x,y,k(g._payload),N)}if(Po(g))return w(x,y,g,N);if(fo(g))return v(x,y,g,N);fl(x,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,y!==null&&y.tag===6?(n(x,y.sibling),y=s(y,g),y.return=x,x=y):(n(x,y),y=cu(g,x.mode,N),y.return=x,x=y),i(x)):n(x,y)}return b}var La=Ly(!0),Fy=Ly(!1),mc=ms(null),pc=null,va=null,Bh=null;function Wh(){Bh=va=pc=null}function Uh(e){var t=mc.current;Ye(mc),e._currentValue=t}function bf(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 Ma(e,t){pc=e,Bh=va=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Yt=!0),e.firstContext=null)}function wn(e){var t=e._currentValue;if(Bh!==e)if(e={context:e,memoizedValue:t,next:null},va===null){if(pc===null)throw Error(re(308));va=e,pc.dependencies={lanes:0,firstContext:e}}else va=va.next=e;return t}var Cs=null;function Vh(e){Cs===null?Cs=[e]:Cs.push(e)}function By(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Vh(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 Hh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wy(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,Vh(r)):(t.next=s.next,s.next=t),r.interleaved=t,jr(e,n)}function $l(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,Ph(e,n)}}function Gp(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?s=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,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 xc(e,t,n,r){var s=e.updateQueue;$r=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,d=c.next;c.next=null,i===null?o=d:i.next=d,i=c;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==i&&(l===null?f.firstBaseUpdate=d:l.next=d,f.lastBaseUpdate=c))}if(o!==null){var u=s.baseState;i=0,f=d=c=null,l=o;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,v=l;switch(h=t,m=n,v.tag){case 1:if(w=v.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=v.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,i|=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 i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);Fs|=i,e.lanes=i,e.memoizedState=u}}function Kp(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 Ai={},Zn=ms(Ai),ai=ms(Ai),oi=ms(Ai);function Es(e){if(e===Ai)throw Error(re(174));return e}function Yh(e,t){switch(We(oi,t),We(ai,e),We(Zn,Ai),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ef(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ef(t,e)}Ye(Zn),We(Zn,t)}function Fa(){Ye(Zn),Ye(ai),Ye(oi)}function Uy(e){Es(oi.current);var t=Es(Zn.current),n=ef(t,e.type);t!==n&&(We(ai,e),We(Zn,n))}function Xh(e){ai.current===e&&(Ye(Zn),Ye(ai))}var tt=ms(0);function gc(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 ru=[];function qh(){for(var e=0;e<ru.length;e++)ru[e]._workInProgressVersionPrimary=null;ru.length=0}var Ll=Mr.ReactCurrentDispatcher,su=Mr.ReactCurrentBatchConfig,Ls=0,nt=null,yt=null,bt=null,yc=!1,Bo=!1,ii=0,R2=0;function Dt(){throw Error(re(321))}function Gh(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 Kh(e,t,n,r,s,o){if(Ls=o,nt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ll.current=e===null||e.memoizedState===null?L2:F2,e=n(r,s),Bo){o=0;do{if(Bo=!1,ii=0,25<=o)throw Error(re(301));o+=1,bt=yt=null,t.updateQueue=null,Ll.current=B2,e=n(r,s)}while(Bo)}if(Ll.current=vc,t=yt!==null&&yt.next!==null,Ls=0,bt=yt=nt=null,yc=!1,t)throw Error(re(300));return e}function Qh(){var e=ii!==0;return ii=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(yt===null){var e=nt.alternate;e=e!==null?e.memoizedState:null}else e=yt.next;var t=bt===null?nt.memoizedState:bt.next;if(t!==null)bt=t,yt=e;else{if(e===null)throw Error(re(310));yt=e,e={memoizedState:yt.memoizedState,baseState:yt.baseState,baseQueue:yt.baseQueue,queue:yt.queue,next:null},bt===null?nt.memoizedState=bt=e:bt=bt.next=e}return bt}function li(e,t){return typeof t=="function"?t(e):t}function au(e){var t=bn(),n=t.queue;if(n===null)throw Error(re(311));n.lastRenderedReducer=e;var r=yt,s=r.baseQueue,o=n.pending;if(o!==null){if(s!==null){var i=s.next;s.next=o.next,o.next=i}r.baseQueue=s=o,n.pending=null}if(s!==null){o=s.next,r=r.baseState;var l=i=null,c=null,d=o;do{var f=d.lane;if((Ls&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,i=r):c=c.next=u,nt.lanes|=f,Fs|=f}d=d.next}while(d!==null&&d!==o);c===null?i=r:c.next=l,An(r,t.memoizedState)||(Yt=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do o=s.lane,nt.lanes|=o,Fs|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ou(e){var t=bn(),n=t.queue;if(n===null)throw Error(re(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,o=t.memoizedState;if(s!==null){n.pending=null;var i=s=s.next;do o=e(o,i.action),i=i.next;while(i!==s);An(o,t.memoizedState)||(Yt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Vy(){}function Hy(e,t){var n=nt,r=bn(),s=t(),o=!An(r.memoizedState,s);if(o&&(r.memoizedState=s,Yt=!0),r=r.queue,Zh(qy.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||bt!==null&&bt.memoizedState.tag&1){if(n.flags|=2048,ci(9,Xy.bind(null,n,r,s,t),void 0,null),Nt===null)throw Error(re(349));Ls&30||Yy(n,t,s)}return s}function Yy(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 Xy(e,t,n,r){t.value=n,t.getSnapshot=r,Gy(t)&&Ky(e)}function qy(e,t,n){return n(function(){Gy(t)&&Ky(e)})}function Gy(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!An(e,n)}catch{return!0}}function Ky(e){var t=jr(e,1);t!==null&&Tn(t,e,1,-1)}function Qp(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:li,lastRenderedState:e},t.queue=e,e=e.dispatch=$2.bind(null,nt,e),[t.memoizedState,e]}function ci(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 Qy(){return bn().memoizedState}function Fl(e,t,n,r){var s=Vn();nt.flags|=e,s.memoizedState=ci(1|t,n,void 0,r===void 0?null:r)}function Kc(e,t,n,r){var s=bn();r=r===void 0?null:r;var o=void 0;if(yt!==null){var i=yt.memoizedState;if(o=i.destroy,r!==null&&Gh(r,i.deps)){s.memoizedState=ci(t,n,o,r);return}}nt.flags|=e,s.memoizedState=ci(1|t,n,o,r)}function Zp(e,t){return Fl(8390656,8,e,t)}function Zh(e,t){return Kc(2048,8,e,t)}function Zy(e,t){return Kc(4,2,e,t)}function Jy(e,t){return Kc(4,4,e,t)}function ev(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 tv(e,t,n){return n=n!=null?n.concat([e]):null,Kc(4,4,ev.bind(null,t,e),n)}function Jh(){}function nv(e,t){var n=bn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Gh(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function rv(e,t){var n=bn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Gh(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function sv(e,t,n){return Ls&21?(An(n,t)||(n=cy(),nt.lanes|=n,Fs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Yt=!0),e.memoizedState=n)}function I2(e,t){var n=$e;$e=n!==0&&4>n?n:4,e(!0);var r=su.transition;su.transition={};try{e(!1),t()}finally{$e=n,su.transition=r}}function av(){return bn().memoizedState}function z2(e,t,n){var r=Zr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ov(e))iv(t,n);else if(n=By(e,t,n,r),n!==null){var s=Lt();Tn(n,e,r,s),lv(n,t,r)}}function $2(e,t,n){var r=Zr(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ov(e))iv(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,l=o(i,n);if(s.hasEagerState=!0,s.eagerState=l,An(l,i)){var c=t.interleaved;c===null?(s.next=s,Vh(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=By(e,t,s,r),n!==null&&(s=Lt(),Tn(n,e,r,s),lv(n,t,r))}}function ov(e){var t=e.alternate;return e===nt||t!==null&&t===nt}function iv(e,t){Bo=yc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lv(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ph(e,n)}}var vc={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},L2={readContext:wn,useCallback:function(e,t){return Vn().memoizedState=[e,t===void 0?null:t],e},useContext:wn,useEffect:Zp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Fl(4194308,4,ev.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Fl(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=z2.bind(null,nt,e),[r.memoizedState,e]},useRef:function(e){var t=Vn();return e={current:e},t.memoizedState=e},useState:Qp,useDebugValue:Jh,useDeferredValue:function(e){return Vn().memoizedState=e},useTransition:function(){var e=Qp(!1),t=e[0];return e=I2.bind(null,e[1]),Vn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=nt,s=Vn();if(Ge){if(n===void 0)throw Error(re(407));n=n()}else{if(n=t(),Nt===null)throw Error(re(349));Ls&30||Yy(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,Zp(qy.bind(null,r,o,e),[e]),r.flags|=2048,ci(9,Xy.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Vn(),t=Nt.identifierPrefix;if(Ge){var n=hr,r=fr;n=(r&~(1<<32-Dn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ii++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=R2++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},F2={readContext:wn,useCallback:nv,useContext:wn,useEffect:Zh,useImperativeHandle:tv,useInsertionEffect:Zy,useLayoutEffect:Jy,useMemo:rv,useReducer:au,useRef:Qy,useState:function(){return au(li)},useDebugValue:Jh,useDeferredValue:function(e){var t=bn();return sv(t,yt.memoizedState,e)},useTransition:function(){var e=au(li)[0],t=bn().memoizedState;return[e,t]},useMutableSource:Vy,useSyncExternalStore:Hy,useId:av,unstable_isNewReconciler:!1},B2={readContext:wn,useCallback:nv,useContext:wn,useEffect:Zh,useImperativeHandle:tv,useInsertionEffect:Zy,useLayoutEffect:Jy,useMemo:rv,useReducer:ou,useRef:Qy,useState:function(){return ou(li)},useDebugValue:Jh,useDeferredValue:function(e){var t=bn();return yt===null?t.memoizedState=e:sv(t,yt.memoizedState,e)},useTransition:function(){var e=ou(li)[0],t=bn().memoizedState;return[e,t]},useMutableSource:Vy,useSyncExternalStore:Hy,useId:av,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 Nf(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 Qc={isMounted:function(e){return(e=e._reactInternals)?Qs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Lt(),s=Zr(e),o=vr(r,s);o.payload=t,n!=null&&(o.callback=n),t=Kr(e,o,s),t!==null&&(Tn(t,e,s,r),$l(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Lt(),s=Zr(e),o=vr(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Kr(e,o,s),t!==null&&(Tn(t,e,s,r),$l(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),$l(t,e,r))}};function Jp(e,t,n,r,s,o,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,i):t.prototype&&t.prototype.isPureReactComponent?!ti(n,r)||!ti(s,o):!0}function cv(e,t,n){var r=!1,s=is,o=t.contextType;return typeof o=="object"&&o!==null?o=wn(o):(s=Gt(t)?zs:It.current,r=t.contextTypes,o=(r=r!=null)?za(e,s):is),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Qc,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function ex(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&&Qc.enqueueReplaceState(t,t.state,null)}function jf(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Hh(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=wn(o):(o=Gt(t)?zs:It.current,s.context=za(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Nf(e,t,o,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&&Qc.enqueueReplaceState(s,s.state,null),xc(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Ba(e,t){try{var n="",r=t;do n+=pk(r),r=r.return;while(r);var s=n}catch(o){s=`
|
|
39
|
-
Error generating stack: `+o.message+`
|
|
40
|
-
`+o.stack}return{value:e,source:t,stack:s,digest:null}}function iu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function kf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var W2=typeof WeakMap=="function"?WeakMap:Map;function dv(e,t,n){n=vr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){bc||(bc=!0,Af=r),kf(e,t)},n}function uv(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(){kf(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){kf(e,t),typeof r!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function tx(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new W2;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=nS.bind(null,e,t,n),t.then(e,e))}function nx(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 rx(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 U2=Mr.ReactCurrentOwner,Yt=!1;function $t(e,t,n,r){t.child=e===null?Fy(t,null,n,r):La(t,e.child,n,r)}function sx(e,t,n,r,s){n=n.render;var o=t.ref;return Ma(t,s),r=Kh(e,t,n,r,o,s),n=Qh(),e!==null&&!Yt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,kr(e,t,s)):(Ge&&n&&$h(t),t.flags|=1,$t(e,t,r,s),t.child)}function ax(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!im(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,fv(e,t,o,r,s)):(e=Vl(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var i=o.memoizedProps;if(n=n.compare,n=n!==null?n:ti,n(i,r)&&e.ref===t.ref)return kr(e,t,s)}return t.flags|=1,e=Jr(o,r),e.ref=t.ref,e.return=t,t.child=e}function fv(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if(ti(o,r)&&e.ref===t.ref)if(Yt=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(Yt=!0);else return t.lanes=e.lanes,kr(e,t,s)}return Sf(e,t,n,r,s)}function hv(e,t,n){var r=t.pendingProps,s=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},We(ba,Jt),Jt|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,We(ba,Jt),Jt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,We(ba,Jt),Jt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,We(ba,Jt),Jt|=r;return $t(e,t,s,n),t.child}function mv(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Sf(e,t,n,r,s){var o=Gt(n)?zs:It.current;return o=za(t,o),Ma(t,s),n=Kh(e,t,n,r,o,s),r=Qh(),e!==null&&!Yt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,kr(e,t,s)):(Ge&&r&&$h(t),t.flags|=1,$t(e,t,n,s),t.child)}function ox(e,t,n,r,s){if(Gt(n)){var o=!0;uc(t)}else o=!1;if(Ma(t,s),t.stateNode===null)Bl(e,t),cv(t,n,r),jf(t,n,r,s),r=!0;else if(e===null){var i=t.stateNode,l=t.memoizedProps;i.props=l;var c=i.context,d=n.contextType;typeof d=="object"&&d!==null?d=wn(d):(d=Gt(n)?zs:It.current,d=za(t,d));var f=n.getDerivedStateFromProps,u=typeof f=="function"||typeof i.getSnapshotBeforeUpdate=="function";u||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==r||c!==d)&&ex(t,i,r,d),$r=!1;var h=t.memoizedState;i.state=h,xc(t,r,i,s),c=t.memoizedState,l!==r||h!==c||qt.current||$r?(typeof f=="function"&&(Nf(t,n,f,r),c=t.memoizedState),(l=$r||Jp(t,n,l,r,h,c,d))?(u||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),i.props=r,i.state=c,i.context=d,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Wy(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:jn(t.type,l),i.props=d,u=t.pendingProps,h=i.context,c=n.contextType,typeof c=="object"&&c!==null?c=wn(c):(c=Gt(n)?zs:It.current,c=za(t,c));var m=n.getDerivedStateFromProps;(f=typeof m=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==u||h!==c)&&ex(t,i,r,c),$r=!1,h=t.memoizedState,i.state=h,xc(t,r,i,s);var w=t.memoizedState;l!==u||h!==w||qt.current||$r?(typeof m=="function"&&(Nf(t,n,m,r),w=t.memoizedState),(d=$r||Jp(t,n,d,r,h,w,c)||!1)?(f||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,w,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,w,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=w),i.props=r,i.state=w,i.context=c,r=d):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Cf(e,t,n,r,o,s)}function Cf(e,t,n,r,s,o){mv(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return s&&Hp(t,n,!1),kr(e,t,o);r=t.stateNode,U2.current=t;var l=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=La(t,e.child,null,o),t.child=La(t,null,l,o)):$t(e,t,l,o),t.memoizedState=r.state,s&&Hp(t,n,!0),t.child}function pv(e){var t=e.stateNode;t.pendingContext?Vp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Vp(e,t.context,!1),Yh(e,t.containerInfo)}function ix(e,t,n,r,s){return $a(),Fh(s),t.flags|=256,$t(e,t,n,r),t.child}var Ef={dehydrated:null,treeContext:null,retryLane:0};function Mf(e){return{baseLanes:e,cachePool:null,transitions:null}}function xv(e,t,n){var r=t.pendingProps,s=tt.current,o=!1,i=(t.flags&128)!==0,l;if((l=i)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),We(tt,s&1),e===null)return wf(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):(i=r.children,e=r.fallback,o?(r=t.mode,o=t.child,i={mode:"hidden",children:i},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=ed(i,r,0,null),e=Ds(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Mf(n),t.memoizedState=Ef,e):em(t,i));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return V2(e,t,i,r,l,s,n);if(o){o=r.fallback,i=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:r.children};return!(i&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?o=Jr(l,o):(o=Ds(o,i,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,i=e.child.memoizedState,i=i===null?Mf(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=Ef,r}return o=e.child,e=o.sibling,r=Jr(o,{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 em(e,t){return t=ed({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function hl(e,t,n,r){return r!==null&&Fh(r),La(t,e.child,null,n),e=em(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function V2(e,t,n,r,s,o,i){if(n)return t.flags&256?(t.flags&=-257,r=iu(Error(re(422))),hl(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=ed({mode:"visible",children:r.children},s,0,null),o=Ds(o,s,i,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&La(t,e.child,null,i),t.child.memoizedState=Mf(i),t.memoizedState=Ef,o);if(!(t.mode&1))return hl(e,t,i,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(re(419)),r=iu(o,r,void 0),hl(e,t,i,r)}if(l=(i&e.childLanes)!==0,Yt||l){if(r=Nt,r!==null){switch(i&-i){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|i)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,jr(e,s),Tn(r,e,s,-1))}return om(),r=iu(Error(re(421))),hl(e,t,i,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=rS.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,rn=Gr(s.nextSibling),sn=t,Ge=!0,Cn=null,e!==null&&(xn[gn++]=fr,xn[gn++]=hr,xn[gn++]=$s,fr=e.id,hr=e.overflow,$s=t),t=em(t,r.children),t.flags|=4096,t)}function lx(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),bf(e.return,t,n)}function lu(e,t,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=s)}function gv(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=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&&lx(e,n,t);else if(e.tag===19)lx(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&&gc(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),lu(t,!1,s,n,o);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&gc(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}lu(t,!0,n,null,o);break;case"together":lu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Bl(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),Fs|=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 H2(e,t,n){switch(t.tag){case 3:pv(t),$a();break;case 5:Uy(t);break;case 1:Gt(t.type)&&uc(t);break;case 4:Yh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;We(mc,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?xv(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 gv(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,hv(e,t,n)}return kr(e,t,n)}var yv,_f,vv,wv;yv=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}};_f=function(){};vv=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Es(Zn.current);var o=null;switch(n){case"input":s=Ku(e,s),r=Ku(e,r),o=[];break;case"select":s=rt({},s,{value:void 0}),r=rt({},r,{value:void 0}),o=[];break;case"textarea":s=Ju(e,s),r=Ju(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=cc)}tf(n,r);var i;n=null;for(d in s)if(!r.hasOwnProperty(d)&&s.hasOwnProperty(d)&&s[d]!=null)if(d==="style"){var l=s[d];for(i in l)l.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(qo.hasOwnProperty(d)?o||(o=[]):(o=o||[]).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(i in l)!l.hasOwnProperty(i)||c&&c.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in c)c.hasOwnProperty(i)&&l[i]!==c[i]&&(n||(n={}),n[i]=c[i])}else n||(o||(o=[]),o.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(o=o||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(o=o||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(qo.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&He("scroll",e),o||l===c||(o=[])):(o=o||[]).push(d,c))}n&&(o=o||[]).push("style",n);var d=o;(t.updateQueue=d)&&(t.flags|=4)}};wv=function(e,t,n,r){n!==r&&(t.flags|=4)};function yo(e,t){if(!Ge)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 Y2(e,t,n){var r=t.pendingProps;switch(Lh(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 Gt(t.type)&&dc(),Tt(t),null;case 3:return r=t.stateNode,Fa(),Ye(qt),Ye(It),qh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ul(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Cn!==null&&(zf(Cn),Cn=null))),_f(e,t),Tt(t),null;case 5:Xh(t);var s=Es(oi.current);if(n=t.type,e!==null&&t.stateNode!=null)vv(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=Es(Zn.current),ul(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Xn]=t,r[si]=o,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<To.length;s++)He(To[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":gp(r,o),He("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},He("invalid",r);break;case"textarea":vp(r,o),He("invalid",r)}tf(n,o),s=null;for(var i in o)if(o.hasOwnProperty(i)){var l=o[i];i==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&dl(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&dl(r.textContent,l,e),s=["children",""+l]):qo.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&He("scroll",r)}switch(n){case"input":nl(r),yp(r,o,!0);break;case"textarea":nl(r),wp(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=cc)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=q0(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Xn]=t,e[si]=r,yv(e,t,!1,!1),t.stateNode=e;e:{switch(i=nf(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<To.length;s++)He(To[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":gp(e,r),s=Ku(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":vp(e,r),s=Ju(e,r),He("invalid",e);break;default:s=r}tf(n,s),l=s;for(o in l)if(l.hasOwnProperty(o)){var c=l[o];o==="style"?Q0(e,c):o==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&G0(e,c)):o==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Go(e,c):typeof c=="number"&&Go(e,""+c):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(qo.hasOwnProperty(o)?c!=null&&o==="onScroll"&&He("scroll",e):c!=null&&kh(e,o,c,i))}switch(n){case"input":nl(e),yp(e,r,!1);break;case"textarea":nl(e),wp(e);break;case"option":r.value!=null&&e.setAttribute("value",""+os(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?ka(e,!!r.multiple,o,!1):r.defaultValue!=null&&ka(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=cc)}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)wv(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(re(166));if(n=Es(oi.current),Es(Zn.current),ul(t)){if(r=t.stateNode,n=t.memoizedProps,r[Xn]=t,(o=r.nodeValue!==n)&&(e=sn,e!==null))switch(e.tag){case 3:dl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&dl(r.nodeValue,n,(e.mode&1)!==0)}o&&(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(Ge&&rn!==null&&t.mode&1&&!(t.flags&128))$y(),$a(),t.flags|=98560,o=!1;else if(o=ul(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(re(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(re(317));o[Xn]=t}else $a(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Tt(t),o=!1}else Cn!==null&&(zf(Cn),Cn=null),o=!0;if(!o)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):om())),t.updateQueue!==null&&(t.flags|=4),Tt(t),null);case 4:return Fa(),_f(e,t),e===null&&ni(t.stateNode.containerInfo),Tt(t),null;case 10:return Uh(t.type._context),Tt(t),null;case 17:return Gt(t.type)&&dc(),Tt(t),null;case 19:if(Ye(tt),o=t.memoizedState,o===null)return Tt(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)yo(o,!1);else{if(vt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=gc(e),i!==null){for(t.flags|=128,yo(o,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.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}o.tail!==null&&it()>Wa&&(t.flags|=128,r=!0,yo(o,!1),t.lanes=4194304)}else{if(!r)if(e=gc(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),yo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!Ge)return Tt(t),null}else 2*it()-o.renderingStartTime>Wa&&n!==1073741824&&(t.flags|=128,r=!0,yo(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=it(),t.sibling=null,n=tt.current,We(tt,r?n&1|2:n&1),t):(Tt(t),null);case 22:case 23:return am(),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 X2(e,t){switch(Lh(t),t.tag){case 1:return Gt(t.type)&&dc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fa(),Ye(qt),Ye(It),qh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Xh(t),null;case 13:if(Ye(tt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(re(340));$a()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ye(tt),null;case 4:return Fa(),null;case 10:return Uh(t.type._context),null;case 22:case 23:return am(),null;case 24:return null;default:return null}}var ml=!1,At=!1,q2=typeof WeakSet=="function"?WeakSet:Set,ue=null;function wa(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 Pf(e,t,n){try{n()}catch(r){at(e,t,r)}}var cx=!1;function G2(e,t){if(hf=oc,e=Sy(),zh(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,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=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=i+s),u!==o||r!==0&&u.nodeType!==3||(c=i+r),u.nodeType===3&&(i+=u.nodeValue.length),(m=u.firstChild)!==null;)h=u,u=m;for(;;){if(u===e)break t;if(h===n&&++d===s&&(l=i),h===o&&++f===r&&(c=i),(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(mf={focusedElem:e,selectionRange:n},oc=!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 v=w.memoizedProps,b=w.memoizedState,x=t.stateNode,y=x.getSnapshotBeforeUpdate(t.elementType===t.type?v:jn(t.type,v),b);x.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(re(163))}}catch(N){at(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,ue=e;break}ue=t.return}return w=cx,cx=!1,w}function Wo(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 o=s.destroy;s.destroy=void 0,o!==void 0&&Pf(t,n,o)}s=s.next}while(s!==r)}}function Zc(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 Df(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 bv(e){var t=e.alternate;t!==null&&(e.alternate=null,bv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xn],delete t[si],delete t[gf],delete t[D2],delete t[T2])),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 Nv(e){return e.tag===5||e.tag===3||e.tag===4}function dx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nv(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 Tf(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=cc));else if(r!==4&&(e=e.child,e!==null))for(Tf(e,t,n),e=e.sibling;e!==null;)Tf(e,t,n),e=e.sibling}function Of(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(Of(e,t,n),e=e.sibling;e!==null;)Of(e,t,n),e=e.sibling}var kt=null,kn=!1;function Pr(e,t,n){for(n=n.child;n!==null;)jv(e,t,n),n=n.sibling}function jv(e,t,n){if(Qn&&typeof Qn.onCommitFiberUnmount=="function")try{Qn.onCommitFiberUnmount(Vc,n)}catch{}switch(n.tag){case 5:At||wa(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?tu(e.parentNode,n):e.nodeType===1&&tu(e,n),Jo(e)):tu(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 o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Pf(n,t,i),s=s.next}while(s!==r)}Pr(e,t,n);break;case 1:if(!At&&(wa(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 ux(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new q2),t.forEach(function(r){var s=sS.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 o=e,i=t,l=i;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));jv(o,i,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;)kv(t,e),t=t.sibling}function kv(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{Wo(3,e,e.return),Zc(3,e)}catch(v){at(e,e.return,v)}try{Wo(5,e,e.return)}catch(v){at(e,e.return,v)}}break;case 1:Nn(t,e),Fn(e),r&512&&n!==null&&wa(n,n.return);break;case 5:if(Nn(t,e),Fn(e),r&512&&n!==null&&wa(n,n.return),e.flags&32){var s=e.stateNode;try{Go(s,"")}catch(v){at(e,e.return,v)}}if(r&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,i=n!==null?n.memoizedProps:o,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&Y0(s,o),nf(l,i);var d=nf(l,o);for(i=0;i<c.length;i+=2){var f=c[i],u=c[i+1];f==="style"?Q0(s,u):f==="dangerouslySetInnerHTML"?G0(s,u):f==="children"?Go(s,u):kh(s,f,u,d)}switch(l){case"input":Qu(s,o);break;case"textarea":X0(s,o);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m!=null?ka(s,!!o.multiple,m,!1):h!==!!o.multiple&&(o.defaultValue!=null?ka(s,!!o.multiple,o.defaultValue,!0):ka(s,!!o.multiple,o.multiple?[]:"",!1))}s[si]=o}catch(v){at(e,e.return,v)}}break;case 6:if(Nn(t,e),Fn(e),r&4){if(e.stateNode===null)throw Error(re(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(v){at(e,e.return,v)}}break;case 3:if(Nn(t,e),Fn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Jo(t.containerInfo)}catch(v){at(e,e.return,v)}break;case 4:Nn(t,e),Fn(e);break;case 13:Nn(t,e),Fn(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(rm=it())),r&4&&ux(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:Wo(4,h,h.return);break;case 1:wa(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(v){at(r,n,v)}}break;case 5:wa(h,h.return);break;case 22:if(h.memoizedState!==null){hx(u);continue}}m!==null?(m.return=h,ue=m):hx(u)}f=f.sibling}e:for(f=null,u=e;;){if(u.tag===5){if(f===null){f=u;try{s=u.stateNode,d?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=u.stateNode,c=u.memoizedProps.style,i=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=K0("display",i))}catch(v){at(e,e.return,v)}}}else if(u.tag===6){if(f===null)try{u.stateNode.nodeValue=d?"":u.memoizedProps}catch(v){at(e,e.return,v)}}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&&ux(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(Nv(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&&(Go(s,""),r.flags&=-33);var o=dx(e);Of(e,o,s);break;case 3:case 4:var i=r.stateNode.containerInfo,l=dx(e);Tf(e,l,i);break;default:throw Error(re(161))}}catch(c){at(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function K2(e,t,n){ue=e,Sv(e)}function Sv(e,t,n){for(var r=(e.mode&1)!==0;ue!==null;){var s=ue,o=s.child;if(s.tag===22&&r){var i=s.memoizedState!==null||ml;if(!i){var l=s.alternate,c=l!==null&&l.memoizedState!==null||At;l=ml;var d=At;if(ml=i,(At=c)&&!d)for(ue=s;ue!==null;)i=ue,c=i.child,i.tag===22&&i.memoizedState!==null?mx(s):c!==null?(c.return=i,ue=c):mx(s);for(;o!==null;)ue=o,Sv(o),o=o.sibling;ue=s,ml=l,At=d}fx(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,ue=o):fx(e)}}function fx(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||Zc(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 o=t.updateQueue;o!==null&&Kp(t,o,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Kp(t,i,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&&Jo(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(re(163))}At||t.flags&512&&Df(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 hx(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 mx(e){for(;ue!==null;){var t=ue;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Zc(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 o=t.return;try{Df(t)}catch(c){at(t,o,c)}break;case 5:var i=t.return;try{Df(t)}catch(c){at(t,i,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 Q2=Math.ceil,wc=Mr.ReactCurrentDispatcher,tm=Mr.ReactCurrentOwner,vn=Mr.ReactCurrentBatchConfig,Te=0,Nt=null,ht=null,Mt=0,Jt=0,ba=ms(0),vt=0,di=null,Fs=0,Jc=0,nm=0,Uo=null,Ht=null,rm=0,Wa=1/0,dr=null,bc=!1,Af=null,Qr=null,pl=!1,Ur=null,Nc=0,Vo=0,Rf=null,Wl=-1,Ul=0;function Lt(){return Te&6?it():Wl!==-1?Wl:Wl=it()}function Zr(e){return e.mode&1?Te&2&&Mt!==0?Mt&-Mt:A2.transition!==null?(Ul===0&&(Ul=cy()),Ul):(e=$e,e!==0||(e=window.event,e=e===void 0?16:xy(e.type)),e):1}function Tn(e,t,n,r){if(50<Vo)throw Vo=0,Rf=null,Error(re(185));Di(e,n,r),(!(Te&2)||e!==Nt)&&(e===Nt&&(!(Te&2)&&(Jc|=n),vt===4&&Fr(e,Mt)),Kt(e,r),n===1&&Te===0&&!(t.mode&1)&&(Wa=it()+500,Gc&&ps()))}function Kt(e,t){var n=e.callbackNode;Ak(e,t);var r=ac(e,e===Nt?Mt:0);if(r===0)n!==null&&jp(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&jp(n),t===1)e.tag===0?O2(px.bind(null,e)):Ry(px.bind(null,e)),_2(function(){!(Te&6)&&ps()}),n=null;else{switch(dy(r)){case 1:n=_h;break;case 4:n=iy;break;case 16:n=sc;break;case 536870912:n=ly;break;default:n=sc}n=Ov(n,Cv.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Cv(e,t){if(Wl=-1,Ul=0,Te&6)throw Error(re(327));var n=e.callbackNode;if(_a()&&e.callbackNode!==n)return null;var r=ac(e,e===Nt?Mt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=jc(e,r);else{t=r;var s=Te;Te|=2;var o=Mv();(Nt!==e||Mt!==t)&&(dr=null,Wa=it()+500,Ps(e,t));do try{eS();break}catch(l){Ev(e,l)}while(!0);Wh(),wc.current=o,Te=s,ht!==null?t=0:(Nt=null,Mt=0,t=vt)}if(t!==0){if(t===2&&(s=lf(e),s!==0&&(r=s,t=If(e,s))),t===1)throw n=di,Ps(e,0),Fr(e,r),Kt(e,it()),n;if(t===6)Fr(e,r);else{if(s=e.current.alternate,!(r&30)&&!Z2(s)&&(t=jc(e,r),t===2&&(o=lf(e),o!==0&&(r=o,t=If(e,o))),t===1))throw n=di,Ps(e,0),Fr(e,r),Kt(e,it()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(re(345));case 2:ws(e,Ht,dr);break;case 3:if(Fr(e,r),(r&130023424)===r&&(t=rm+500-it(),10<t)){if(ac(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Lt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=xf(ws.bind(null,e,Ht,dr),t);break}ws(e,Ht,dr);break;case 4:if(Fr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var i=31-Dn(r);o=1<<i,i=t[i],i>s&&(s=i),r&=~o}if(r=s,r=it()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Q2(r/1960))-r,10<r){e.timeoutHandle=xf(ws.bind(null,e,Ht,dr),r);break}ws(e,Ht,dr);break;case 5:ws(e,Ht,dr);break;default:throw Error(re(329))}}}return Kt(e,it()),e.callbackNode===n?Cv.bind(null,e):null}function If(e,t){var n=Uo;return e.current.memoizedState.isDehydrated&&(Ps(e,t).flags|=256),e=jc(e,t),e!==2&&(t=Ht,Ht=n,t!==null&&zf(t)),e}function zf(e){Ht===null?Ht=e:Ht.push.apply(Ht,e)}function Z2(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],o=s.getSnapshot;s=s.value;try{if(!An(o(),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&=~nm,t&=~Jc,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 px(e){if(Te&6)throw Error(re(327));_a();var t=ac(e,0);if(!(t&1))return Kt(e,it()),null;var n=jc(e,t);if(e.tag!==0&&n===2){var r=lf(e);r!==0&&(t=r,n=If(e,r))}if(n===1)throw n=di,Ps(e,0),Fr(e,t),Kt(e,it()),n;if(n===6)throw Error(re(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ws(e,Ht,dr),Kt(e,it()),null}function sm(e,t){var n=Te;Te|=1;try{return e(t)}finally{Te=n,Te===0&&(Wa=it()+500,Gc&&ps())}}function Bs(e){Ur!==null&&Ur.tag===0&&!(Te&6)&&_a();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)&&ps()}}function am(){Jt=ba.current,Ye(ba)}function Ps(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,M2(n)),ht!==null)for(n=ht.return;n!==null;){var r=n;switch(Lh(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&dc();break;case 3:Fa(),Ye(qt),Ye(It),qh();break;case 5:Xh(r);break;case 4:Fa();break;case 13:Ye(tt);break;case 19:Ye(tt);break;case 10:Uh(r.type._context);break;case 22:case 23:am()}n=n.return}if(Nt=e,ht=e=Jr(e.current,null),Mt=Jt=t,vt=0,di=null,nm=Jc=Fs=0,Ht=Uo=null,Cs!==null){for(t=0;t<Cs.length;t++)if(n=Cs[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,o=n.pending;if(o!==null){var i=o.next;o.next=s,r.next=i}n.pending=r}Cs=null}return e}function Ev(e,t){do{var n=ht;try{if(Wh(),Ll.current=vc,yc){for(var r=nt.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}yc=!1}if(Ls=0,bt=yt=nt=null,Bo=!1,ii=0,tm.current=null,n===null||n.return===null){vt=1,di=t,ht=null;break}e:{var o=e,i=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=nx(i);if(m!==null){m.flags&=-257,rx(m,i,l,o,t),m.mode&1&&tx(o,d,t),t=m,c=d;var w=t.updateQueue;if(w===null){var v=new Set;v.add(c),t.updateQueue=v}else w.add(c);break e}else{if(!(t&1)){tx(o,d,t),om();break e}c=Error(re(426))}}else if(Ge&&l.mode&1){var b=nx(i);if(b!==null){!(b.flags&65536)&&(b.flags|=256),rx(b,i,l,o,t),Fh(Ba(c,l));break e}}o=c=Ba(c,l),vt!==4&&(vt=2),Uo===null?Uo=[o]:Uo.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var x=dv(o,c,t);Gp(o,x);break e;case 1:l=c;var y=o.type,g=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Qr===null||!Qr.has(g)))){o.flags|=65536,t&=-t,o.lanes|=t;var N=uv(o,l,t);Gp(o,N);break e}}o=o.return}while(o!==null)}Pv(n)}catch(j){t=j,ht===n&&n!==null&&(ht=n=n.return);continue}break}while(!0)}function Mv(){var e=wc.current;return wc.current=vc,e===null?vc:e}function om(){(vt===0||vt===3||vt===2)&&(vt=4),Nt===null||!(Fs&268435455)&&!(Jc&268435455)||Fr(Nt,Mt)}function jc(e,t){var n=Te;Te|=2;var r=Mv();(Nt!==e||Mt!==t)&&(dr=null,Ps(e,t));do try{J2();break}catch(s){Ev(e,s)}while(!0);if(Wh(),Te=n,wc.current=r,ht!==null)throw Error(re(261));return Nt=null,Mt=0,vt}function J2(){for(;ht!==null;)_v(ht)}function eS(){for(;ht!==null&&!Sk();)_v(ht)}function _v(e){var t=Tv(e.alternate,e,Jt);e.memoizedProps=e.pendingProps,t===null?Pv(e):ht=t,tm.current=null}function Pv(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=X2(n,t),n!==null){n.flags&=32767,ht=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{vt=6,ht=null;return}}else if(n=Y2(n,t,Jt),n!==null){ht=n;return}if(t=t.sibling,t!==null){ht=t;return}ht=t=e}while(t!==null);vt===0&&(vt=5)}function ws(e,t,n){var r=$e,s=vn.transition;try{vn.transition=null,$e=1,tS(e,t,n,r)}finally{vn.transition=s,$e=r}return null}function tS(e,t,n,r){do _a();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 o=n.lanes|n.childLanes;if(Rk(e,o),e===Nt&&(ht=Nt=null,Mt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||pl||(pl=!0,Ov(sc,function(){return _a(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=vn.transition,vn.transition=null;var i=$e;$e=1;var l=Te;Te|=4,tm.current=null,G2(e,n),kv(n,e),b2(mf),oc=!!hf,mf=hf=null,e.current=n,K2(n),Ck(),Te=l,$e=i,vn.transition=o}else e.current=n;if(pl&&(pl=!1,Ur=e,Nc=s),o=e.pendingLanes,o===0&&(Qr=null),_k(n.stateNode),Kt(e,it()),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(bc)throw bc=!1,e=Af,Af=null,e;return Nc&1&&e.tag!==0&&_a(),o=e.pendingLanes,o&1?e===Rf?Vo++:(Vo=0,Rf=e):Vo=0,ps(),null}function _a(){if(Ur!==null){var e=dy(Nc),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,Nc=0,Te&6)throw Error(re(331));var s=Te;for(Te|=4,ue=e.current;ue!==null;){var o=ue,i=o.child;if(ue.flags&16){var l=o.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:Wo(8,f,o)}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(bv(f),f===d){ue=null;break}if(h!==null){h.return=m,ue=h;break}ue=m}}}var w=o.alternate;if(w!==null){var v=w.child;if(v!==null){w.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==null)}}ue=o}}if(o.subtreeFlags&2064&&i!==null)i.return=o,ue=i;else e:for(;ue!==null;){if(o=ue,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Wo(9,o,o.return)}var x=o.sibling;if(x!==null){x.return=o.return,ue=x;break e}ue=o.return}}var y=e.current;for(ue=y;ue!==null;){i=ue;var g=i.child;if(i.subtreeFlags&2064&&g!==null)g.return=i,ue=g;else e:for(i=y;ue!==null;){if(l=ue,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Zc(9,l)}}catch(j){at(l,l.return,j)}if(l===i){ue=null;break e}var N=l.sibling;if(N!==null){N.return=l.return,ue=N;break e}ue=l.return}}if(Te=s,ps(),Qn&&typeof Qn.onPostCommitFiberRoot=="function")try{Qn.onPostCommitFiberRoot(Vc,e)}catch{}r=!0}return r}finally{$e=n,vn.transition=t}}return!1}function xx(e,t,n){t=Ba(n,t),t=dv(e,t,1),e=Kr(e,t,1),t=Lt(),e!==null&&(Di(e,1,t),Kt(e,t))}function at(e,t,n){if(e.tag===3)xx(e,e,n);else for(;t!==null;){if(t.tag===3){xx(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=Ba(n,e),e=uv(t,e,1),t=Kr(t,e,1),e=Lt(),t!==null&&(Di(t,1,e),Kt(t,e));break}}t=t.return}}function nS(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>it()-rm?Ps(e,0):nm|=n),Kt(e,t)}function Dv(e,t){t===0&&(e.mode&1?(t=al,al<<=1,!(al&130023424)&&(al=4194304)):t=1);var n=Lt();e=jr(e,t),e!==null&&(Di(e,t,n),Kt(e,n))}function rS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Dv(e,n)}function sS(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),Dv(e,n)}var Tv;Tv=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||qt.current)Yt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Yt=!1,H2(e,t,n);Yt=!!(e.flags&131072)}else Yt=!1,Ge&&t.flags&1048576&&Iy(t,hc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Bl(e,t),e=t.pendingProps;var s=za(t,It.current);Ma(t,n),s=Kh(null,t,r,e,s,n);var o=Qh();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,Gt(r)?(o=!0,uc(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Hh(t),s.updater=Qc,t.stateNode=s,s._reactInternals=t,jf(t,r,e,n),t=Cf(null,t,r,!0,o,n)):(t.tag=0,Ge&&o&&$h(t),$t(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Bl(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=oS(r),e=jn(r,e),s){case 0:t=Sf(null,t,r,e,n);break e;case 1:t=ox(null,t,r,e,n);break e;case 11:t=sx(null,t,r,e,n);break e;case 14:t=ax(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),Sf(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:jn(r,s),ox(e,t,r,s,n);case 3:e:{if(pv(t),e===null)throw Error(re(387));r=t.pendingProps,o=t.memoizedState,s=o.element,Wy(e,t),xc(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=Ba(Error(re(423)),t),t=ix(e,t,r,n,s);break e}else if(r!==s){s=Ba(Error(re(424)),t),t=ix(e,t,r,n,s);break e}else for(rn=Gr(t.stateNode.containerInfo.firstChild),sn=t,Ge=!0,Cn=null,n=Fy(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($a(),r===s){t=kr(e,t,n);break e}$t(e,t,r,n)}t=t.child}return t;case 5:return Uy(t),e===null&&wf(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,pf(r,s)?i=null:o!==null&&pf(r,o)&&(t.flags|=32),mv(e,t),$t(e,t,i,n),t.child;case 6:return e===null&&wf(t),null;case 13:return xv(e,t,n);case 4:return Yh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=La(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),sx(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,o=t.memoizedProps,i=s.value,We(mc,r._currentValue),r._currentValue=i,o!==null)if(An(o.value,i)){if(o.children===s.children&&!qt.current){t=kr(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){i=o.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(o.tag===1){c=vr(-1,n&-n),c.tag=2;var d=o.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}}o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),bf(o.return,n,t),l.lanes|=n;break}c=c.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(re(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),bf(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}$t(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Ma(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),ax(e,t,r,s,n);case 15:return fv(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:jn(r,s),Bl(e,t),t.tag=1,Gt(r)?(e=!0,uc(t)):e=!1,Ma(t,n),cv(t,r,s),jf(t,r,s,n),Cf(null,t,r,!0,e,n);case 19:return gv(e,t,n);case 22:return hv(e,t,n)}throw Error(re(156,t.tag))};function Ov(e,t){return oy(e,t)}function aS(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 aS(e,t,n,r)}function im(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oS(e){if(typeof e=="function")return im(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ch)return 11;if(e===Eh)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 Vl(e,t,n,r,s,o){var i=2;if(r=e,typeof e=="function")im(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case ua:return Ds(n.children,s,o,t);case Sh:i=8,s|=8;break;case Yu:return e=yn(12,n,t,s|2),e.elementType=Yu,e.lanes=o,e;case Xu:return e=yn(13,n,t,s),e.elementType=Xu,e.lanes=o,e;case qu:return e=yn(19,n,t,s),e.elementType=qu,e.lanes=o,e;case U0:return ed(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case B0:i=10;break e;case W0:i=9;break e;case Ch:i=11;break e;case Eh:i=14;break e;case zr:i=16,r=null;break e}throw Error(re(130,e==null?e:typeof e,""))}return t=yn(i,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function Ds(e,t,n,r){return e=yn(7,e,r,t),e.lanes=n,e}function ed(e,t,n,r){return e=yn(22,e,r,t),e.elementType=U0,e.lanes=n,e.stateNode={isHidden:!1},e}function cu(e,t,n){return e=yn(6,e,null,t),e.lanes=n,e}function du(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 iS(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=Vd(0),this.expirationTimes=Vd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vd(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function lm(e,t,n,r,s,o,i,l,c){return e=new iS(e,t,n,l,c),t===1?(t=1,o===!0&&(t|=8)):t=0,o=yn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hh(o),e}function lS(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:da,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Av(e){if(!e)return is;e=e._reactInternals;e:{if(Qs(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(Gt(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(Gt(n))return Ay(e,n,t)}return t}function Rv(e,t,n,r,s,o,i,l,c){return e=lm(n,r,!0,e,s,o,i,l,c),e.context=Av(null),n=e.current,r=Lt(),s=Zr(n),o=vr(r,s),o.callback=t??null,Kr(n,o,s),e.current.lanes=s,Di(e,s,r),Kt(e,r),e}function td(e,t,n,r){var s=t.current,o=Lt(),i=Zr(s);return n=Av(n),t.context===null?t.context=n:t.pendingContext=n,t=vr(o,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Kr(s,t,i),e!==null&&(Tn(e,s,i,o),$l(e,s,i)),i}function kc(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 gx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function cm(e,t){gx(e,t),(e=e.alternate)&&gx(e,t)}function cS(){return null}var Iv=typeof reportError=="function"?reportError:function(e){console.error(e)};function dm(e){this._internalRoot=e}nd.prototype.render=dm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(re(409));td(e,t,null,null)};nd.prototype.unmount=dm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bs(function(){td(null,e,null,null)}),t[Nr]=null}};function nd(e){this._internalRoot=e}nd.prototype.unstable_scheduleHydration=function(e){if(e){var t=hy();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&&py(e)}};function um(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function rd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function yx(){}function dS(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var d=kc(i);o.call(d)}}var i=Rv(t,r,e,0,null,!1,!1,"",yx);return e._reactRootContainer=i,e[Nr]=i.current,ni(e.nodeType===8?e.parentNode:e),Bs(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var d=kc(c);l.call(d)}}var c=lm(e,0,!1,null,null,!1,!1,"",yx);return e._reactRootContainer=c,e[Nr]=c.current,ni(e.nodeType===8?e.parentNode:e),Bs(function(){td(t,c,n,r)}),c}function sd(e,t,n,r,s){var o=n._reactRootContainer;if(o){var i=o;if(typeof s=="function"){var l=s;s=function(){var c=kc(i);l.call(c)}}td(t,i,e,s)}else i=dS(n,t,e,s,r);return kc(i)}uy=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Do(t.pendingLanes);n!==0&&(Ph(t,n|1),Kt(t,it()),!(Te&6)&&(Wa=it()+500,ps()))}break;case 13:Bs(function(){var r=jr(e,1);if(r!==null){var s=Lt();Tn(r,e,1,s)}}),cm(e,1)}};Dh=function(e){if(e.tag===13){var t=jr(e,134217728);if(t!==null){var n=Lt();Tn(t,e,134217728,n)}cm(e,134217728)}};fy=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)}cm(e,t)}};hy=function(){return $e};my=function(e,t){var n=$e;try{return $e=e,t()}finally{$e=n}};sf=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=qc(r);if(!s)throw Error(re(90));H0(r),Qu(r,s)}}}break;case"textarea":X0(e,n);break;case"select":t=n.value,t!=null&&ka(e,!!n.multiple,t,!1)}};ey=sm;ty=Bs;var uS={usingClientEntryPoint:!1,Events:[Oi,pa,qc,Z0,J0,sm]},vo={findFiberByHostInstance:Ss,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},fS={bundleType:vo.bundleType,version:vo.version,rendererPackageName:vo.rendererPackageName,rendererConfig:vo.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=sy(e),e===null?null:e.stateNode},findFiberByHostInstance:vo.findFiberByHostInstance||cS,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 xl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xl.isDisabled&&xl.supportsFiber)try{Vc=xl.inject(fS),Qn=xl}catch{}}dn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=uS;dn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!um(t))throw Error(re(200));return lS(e,t,null,n)};dn.createRoot=function(e,t){if(!um(e))throw Error(re(299));var n=!1,r="",s=Iv;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=lm(e,1,!1,null,null,n,!1,r,s),e[Nr]=t.current,ni(e.nodeType===8?e.parentNode:e),new dm(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=sy(t),e=e===null?null:e.stateNode,e};dn.flushSync=function(e){return Bs(e)};dn.hydrate=function(e,t,n){if(!rd(t))throw Error(re(200));return sd(null,e,t,!0,n)};dn.hydrateRoot=function(e,t,n){if(!um(e))throw Error(re(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",i=Iv;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=Rv(t,null,e,1,n??null,s,!1,o,i),e[Nr]=t.current,ni(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 nd(t)};dn.render=function(e,t,n){if(!rd(t))throw Error(re(200));return sd(null,e,t,!1,n)};dn.unmountComponentAtNode=function(e){if(!rd(e))throw Error(re(40));return e._reactRootContainer?(Bs(function(){sd(null,null,e,!1,function(){e._reactRootContainer=null,e[Nr]=null})}),!0):!1};dn.unstable_batchedUpdates=sm;dn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!rd(n))throw Error(re(200));if(e==null||e._reactInternals===void 0)throw Error(re(38));return sd(e,t,n,!1,r)};dn.version="18.3.1-next-f1338f8080-20240426";function zv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(zv)}catch(e){console.error(e)}}zv(),z0.exports=dn;var ad=z0.exports;const $v=xh(ad);var vx=ad;Vu.createRoot=vx.createRoot,Vu.hydrateRoot=vx.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 ui(){return ui=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},ui.apply(this,arguments)}var Vr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Vr||(Vr={}));const wx="popstate";function hS(e){e===void 0&&(e={});function t(r,s){let{pathname:o,search:i,hash:l}=r.location;return $f("",{pathname:o,search:i,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Sc(s)}return pS(t,n,null,e)}function mt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Lv(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function mS(){return Math.random().toString(36).substr(2,8)}function bx(e,t){return{usr:e.state,key:e.key,idx:t}}function $f(e,t,n,r){return n===void 0&&(n=null),ui({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?oo(t):t,{state:n,key:t&&t.key||r||mS()})}function Sc(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 oo(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 pS(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:o=!1}=r,i=s.history,l=Vr.Pop,c=null,d=f();d==null&&(d=0,i.replaceState(ui({},i.state,{idx:d}),""));function f(){return(i.state||{idx:null}).idx}function u(){l=Vr.Pop;let b=f(),x=b==null?null:b-d;d=b,c&&c({action:l,location:v.location,delta:x})}function h(b,x){l=Vr.Push;let y=$f(v.location,b,x);d=f()+1;let g=bx(y,d),N=v.createHref(y);try{i.pushState(g,"",N)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;s.location.assign(N)}o&&c&&c({action:l,location:v.location,delta:1})}function m(b,x){l=Vr.Replace;let y=$f(v.location,b,x);d=f();let g=bx(y,d),N=v.createHref(y);i.replaceState(g,"",N),o&&c&&c({action:l,location:v.location,delta:0})}function w(b){let x=s.location.origin!=="null"?s.location.origin:s.location.href,y=typeof b=="string"?b:Sc(b);return y=y.replace(/ $/,"%20"),mt(x,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,x)}let v={get action(){return l},get location(){return e(s,i)},listen(b){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(wx,u),c=b,()=>{s.removeEventListener(wx,u),c=null}},createHref(b){return t(s,b)},createURL:w,encodeLocation(b){let x=w(b);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:h,replace:m,go(b){return i.go(b)}};return v}var Nx;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Nx||(Nx={}));function xS(e,t,n){return n===void 0&&(n="/"),gS(e,t,n)}function gS(e,t,n,r){let s=typeof t=="string"?oo(t):t,o=fm(s.pathname||"/",n);if(o==null)return null;let i=Fv(e);yS(i);let l=null;for(let c=0;l==null&&c<i.length;++c){let d=PS(o);l=ES(i[c],d)}return l}function Fv(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(o,i,l)=>{let c={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};c.relativePath.startsWith("/")&&(mt(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);o.children&&o.children.length>0&&(mt(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Fv(o.children,t,f,d)),!(o.path==null&&!o.index)&&t.push({path:d,score:SS(d,o.index),routesMeta:f})};return e.forEach((o,i)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))s(o,i);else for(let c of Bv(o.path))s(o,i,c)}),t}function Bv(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let i=Bv(r.join("/")),l=[];return l.push(...i.map(c=>c===""?o:[o,c].join("/"))),s&&l.push(...i),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function yS(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:CS(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const vS=/^:[\w-]+$/,wS=3,bS=2,NS=1,jS=10,kS=-2,jx=e=>e==="*";function SS(e,t){let n=e.split("/"),r=n.length;return n.some(jx)&&(r+=kS),t&&(r+=bS),n.filter(s=>!jx(s)).reduce((s,o)=>s+(vS.test(o)?wS:o===""?NS:jS),r)}function CS(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 ES(e,t,n){let{routesMeta:r}=e,s={},o="/",i=[];for(let l=0;l<r.length;++l){let c=r[l],d=l===r.length-1,f=o==="/"?t:t.slice(o.length)||"/",u=MS({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},f),h=c.route;if(!u)return null;Object.assign(s,u.params),i.push({params:s,pathname:es([o,u.pathname]),pathnameBase:AS(es([o,u.pathnameBase])),route:h}),u.pathnameBase!=="/"&&(o=es([o,u.pathnameBase]))}return i}function MS(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=_S(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],i=o.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((d,f,u)=>{let{paramName:h,isOptional:m}=f;if(h==="*"){let v=l[u]||"";i=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}const w=l[u];return m&&!w?d[h]=void 0:d[h]=(w||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:i,pattern:e}}function _S(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Lv(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,(i,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 PS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Lv(!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 fm(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 DS(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?oo(e):e;return{pathname:n?n.startsWith("/")?n:TS(n,t):t,search:RS(r),hash:IS(s)}}function TS(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 uu(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 OS(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Wv(e,t){let n=OS(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Uv(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=oo(e):(s=ui({},e),mt(!s.pathname||!s.pathname.includes("?"),uu("?","pathname","search",s)),mt(!s.pathname||!s.pathname.includes("#"),uu("#","pathname","hash",s)),mt(!s.search||!s.search.includes("#"),uu("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,l;if(i==null)l=n;else{let u=t.length-1;if(!r&&i.startsWith("..")){let h=i.split("/");for(;h[0]==="..";)h.shift(),u-=1;s.pathname=h.join("/")}l=u>=0?t[u]:"/"}let c=DS(s,l),d=i&&i!=="/"&&i.endsWith("/"),f=(o||i===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||f)&&(c.pathname+="/"),c}const es=e=>e.join("/").replace(/\/\/+/g,"/"),AS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),RS=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,IS=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function zS(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Vv=["post","put","patch","delete"];new Set(Vv);const $S=["get",...Vv];new Set($S);/**
|
|
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 fi(){return fi=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},fi.apply(this,arguments)}const hm=p.createContext(null),LS=p.createContext(null),Zs=p.createContext(null),od=p.createContext(null),xs=p.createContext({outlet:null,matches:[],isDataRoute:!1}),Hv=p.createContext(null);function FS(e,t){let{relative:n}=t===void 0?{}:t;Ri()||mt(!1);let{basename:r,navigator:s}=p.useContext(Zs),{hash:o,pathname:i,search:l}=Xv(e,{relative:n}),c=i;return r!=="/"&&(c=i==="/"?r:es([r,i])),s.createHref({pathname:c,search:l,hash:o})}function Ri(){return p.useContext(od)!=null}function Ii(){return Ri()||mt(!1),p.useContext(od).location}function Yv(e){p.useContext(Zs).static||p.useLayoutEffect(e)}function Js(){let{isDataRoute:e}=p.useContext(xs);return e?JS():BS()}function BS(){Ri()||mt(!1);let e=p.useContext(hm),{basename:t,future:n,navigator:r}=p.useContext(Zs),{matches:s}=p.useContext(xs),{pathname:o}=Ii(),i=JSON.stringify(Wv(s,n.v7_relativeSplatPath)),l=p.useRef(!1);return Yv(()=>{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=Uv(d,JSON.parse(i),o,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,i,o,e])}function mm(){let{matches:e}=p.useContext(xs),t=e[e.length-1];return t?t.params:{}}function Xv(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=p.useContext(Zs),{matches:s}=p.useContext(xs),{pathname:o}=Ii(),i=JSON.stringify(Wv(s,r.v7_relativeSplatPath));return p.useMemo(()=>Uv(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function WS(e,t){return US(e,t)}function US(e,t,n,r){Ri()||mt(!1);let{navigator:s}=p.useContext(Zs),{matches:o}=p.useContext(xs),i=o[o.length-1],l=i?i.params:{};i&&i.pathname;let c=i?i.pathnameBase:"/";i&&i.route;let d=Ii(),f;if(t){var u;let b=typeof t=="string"?oo(t):t;c==="/"||(u=b.pathname)!=null&&u.startsWith(c)||mt(!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=xS(e,{pathname:m}),v=qS(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])})),o,n,r);return t&&v?p.createElement(od.Provider,{value:{location:fi({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Vr.Pop}},v):v}function VS(){let e=ZS(),t=zS(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 HS=p.createElement(VS,null);class YS 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(xs.Provider,{value:this.props.routeContext},p.createElement(Hv.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function XS(e){let{routeContext:t,match:n,children:r}=e,s=p.useContext(hm);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(xs.Provider,{value:t},r)}function qS(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,l=(s=n)==null?void 0:s.errors;if(l!=null){let f=i.findIndex(u=>u.route.id&&(l==null?void 0:l[u.route.id])!==void 0);f>=0||mt(!1),i=i.slice(0,Math.min(i.length,f+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f<i.length;f++){let u=i[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?i=i.slice(0,d+1):i=[i[0]];break}}}return i.reduceRight((f,u,h)=>{let m,w=!1,v=null,b=null;n&&(m=l&&u.route.id?l[u.route.id]:void 0,v=u.route.errorElement||HS,c&&(d<0&&h===0?(eC("route-fallback"),w=!0,b=null):d===h&&(w=!0,b=u.route.hydrateFallbackElement||null)));let x=t.concat(i.slice(0,h+1)),y=()=>{let g;return m?g=v:w?g=b:u.route.Component?g=p.createElement(u.route.Component,null):u.route.element?g=u.route.element:g=f,p.createElement(XS,{match:u,routeContext:{outlet:f,matches:x,isDataRoute:n!=null},children:g})};return n&&(u.route.ErrorBoundary||u.route.errorElement||h===0)?p.createElement(YS,{location:n.location,revalidation:n.revalidation,component:v,error:m,children:y(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):y()},null)}var qv=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(qv||{}),Gv=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}(Gv||{});function GS(e){let t=p.useContext(hm);return t||mt(!1),t}function KS(e){let t=p.useContext(LS);return t||mt(!1),t}function QS(e){let t=p.useContext(xs);return t||mt(!1),t}function Kv(e){let t=QS(),n=t.matches[t.matches.length-1];return n.route.id||mt(!1),n.route.id}function ZS(){var e;let t=p.useContext(Hv),n=KS(),r=Kv();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function JS(){let{router:e}=GS(qv.UseNavigateStable),t=Kv(Gv.UseNavigateStable),n=p.useRef(!1);return Yv(()=>{n.current=!0}),p.useCallback(function(s,o){o===void 0&&(o={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,fi({fromRouteId:t},o)))},[e,t])}const kx={};function eC(e,t,n){kx[e]||(kx[e]=!0)}function tC(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function fn(e){mt(!1)}function nC(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Vr.Pop,navigator:o,static:i=!1,future:l}=e;Ri()&&mt(!1);let c=t.replace(/^\/*/,"/"),d=p.useMemo(()=>({basename:c,navigator:o,static:i,future:fi({v7_relativeSplatPath:!1},l)}),[c,l,o,i]);typeof r=="string"&&(r=oo(r));let{pathname:f="/",search:u="",hash:h="",state:m=null,key:w="default"}=r,v=p.useMemo(()=>{let b=fm(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 v==null?null:p.createElement(Zs.Provider,{value:d},p.createElement(od.Provider,{children:n,value:v}))}function rC(e){let{children:t,location:n}=e;return WS(Lf(t),n)}new Promise(()=>{});function Lf(e,t){t===void 0&&(t=[]);let n=[];return p.Children.forEach(e,(r,s)=>{if(!p.isValidElement(r))return;let o=[...t,s];if(r.type===p.Fragment){n.push.apply(n,Lf(r.props.children,o));return}r.type!==fn&&mt(!1),!r.props.index||!r.props.children||mt(!1);let i={id:r.props.id||o.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&&(i.children=Lf(r.props.children,o)),n.push(i)}),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 Ff(){return Ff=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},Ff.apply(this,arguments)}function sC(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,o;for(o=0;o<r.length;o++)s=r[o],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function aC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function oC(e,t){return e.button===0&&(!t||t==="_self")&&!aC(e)}const iC=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],lC="6";try{window.__reactRouterVersion=lC}catch{}const cC="startTransition",Sx=bh[cC];function dC(e){let{basename:t,children:n,future:r,window:s}=e,o=p.useRef();o.current==null&&(o.current=hS({window:s,v5Compat:!0}));let i=o.current,[l,c]=p.useState({action:i.action,location:i.location}),{v7_startTransition:d}=r||{},f=p.useCallback(u=>{d&&Sx?Sx(()=>c(u)):c(u)},[c,d]);return p.useLayoutEffect(()=>i.listen(f),[i,f]),p.useEffect(()=>tC(r),[r]),p.createElement(nC,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:i,future:r})}const uC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",fC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pa=p.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:o,replace:i,state:l,target:c,to:d,preventScrollReset:f,viewTransition:u}=t,h=sC(t,iC),{basename:m}=p.useContext(Zs),w,v=!1;if(typeof d=="string"&&fC.test(d)&&(w=d,uC))try{let g=new URL(window.location.href),N=d.startsWith("//")?new URL(g.protocol+d):new URL(d),j=fm(N.pathname,m);N.origin===g.origin&&j!=null?d=j+N.search+N.hash:v=!0}catch{}let b=FS(d,{relative:s}),x=hC(d,{replace:i,state:l,target:c,preventScrollReset:f,relative:s,viewTransition:u});function y(g){r&&r(g),g.defaultPrevented||x(g)}return p.createElement("a",Ff({},h,{href:w||b,onClick:v||o?r:y,ref:n,target:c}))});var Cx;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Cx||(Cx={}));var Ex;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ex||(Ex={}));function hC(e,t){let{target:n,replace:r,state:s,preventScrollReset:o,relative:i,viewTransition:l}=t===void 0?{}:t,c=Js(),d=Ii(),f=Xv(e,{relative:i});return p.useCallback(u=>{if(oC(u,n)){u.preventDefault();let h=r!==void 0?r:Sc(d)===Sc(f);c(e,{replace:h,state:s,preventScrollReset:o,relative:i,viewTransition:l})}},[d,c,f,r,s,n,e,o,i,l])}function mC(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 pC=e=>{switch(e){case"success":return yC;case"info":return wC;case"warning":return vC;case"error":return bC;default:return null}},xC=Array(12).fill(0),gC=({visible:e,className:t})=>Y.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Y.createElement("div",{className:"sonner-spinner"},xC.map((n,r)=>Y.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),yC=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"})),vC=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"})),wC=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"})),bC=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"})),NC=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"})),jC=()=>{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 Bf=1;class kC{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,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Bf++,i=this.toasts.find(c=>c.id===o),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(c=>c.id===o?(this.publish({...c,...t,id:o,title:r}),{...c,...t,id:o,dismissible:l,title:r}):c):this.addToast({title:r,...s,dismissible:l,id:o}),o},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 o=r!==void 0,i;const l=s.then(async d=>{if(i=["resolve",d],Y.isValidElement(d))o=!1,this.create({id:r,type:"default",message:d});else if(CC(d)&&!d.ok){o=!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){o=!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){o=!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(i=["reject",d],n.error!==void 0){o=!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(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,f)=>l.then(()=>i[0]==="reject"?f(i[1]):d(i[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)||Bf++;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 Vt=new kC,SC=(e,t)=>{const n=(t==null?void 0:t.id)||Bf++;return Vt.addToast({title:e,...t,id:n}),n},CC=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",EC=SC,MC=()=>Vt.toasts,_C=()=>Vt.getActiveToasts(),q=Object.assign(EC,{success:Vt.success,info:Vt.info,warning:Vt.warning,error:Vt.error,custom:Vt.custom,message:Vt.message,promise:Vt.promise,dismiss:Vt.dismiss,loading:Vt.loading},{getHistory:MC,getToasts:_C});mC("[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 gl(e){return e.label!==void 0}const PC=3,DC="24px",TC="16px",Mx=4e3,OC=356,AC=14,RC=45,IC=200;function Bn(...e){return e.filter(Boolean).join(" ")}function zC(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const $C=e=>{var t,n,r,s,o,i,l,c,d;const{invert:f,toast:u,unstyled:h,interacting:m,setHeights:w,visibleToasts:v,heights:b,index:x,toasts:y,expanded:g,removeToast:N,defaultRichColors:j,closeButton:k,style:S,cancelButtonStyle:M,actionButtonStyle:R,className:z="",descriptionClassName:A="",duration:O,position:L,gap:E,expandByDefault:$,classNames:D,icons:P,closeButtonAriaLabel:C="Close toast"}=e,[_,I]=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||Mx),Xe=Y.useRef(null),Pe=Y.useRef(null),ct=x===0,Pt=x+1<=v,Ae=u.type,Qe=u.dismissible!==!1,gt=u.className||"",zt=u.descriptionClassName||"",te=Y.useMemo(()=>b.findIndex(oe=>oe.toastId===u.id)||0,[b,u.id]),ie=Y.useMemo(()=>{var oe;return(oe=u.closeButton)!=null?oe:k},[u.closeButton,k]),V=Y.useMemo(()=>u.duration||O||Mx,[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((oe,Ze,ut)=>ut>=te?oe:oe+Ze.height,0),[b,te]),ge=jC(),Ue=u.invert||f,dt=Ae==="loading";he.current=Y.useMemo(()=>te*E+le,[te,le]),Y.useEffect(()=>{Se.current=V},[V]),Y.useEffect(()=>{H(!0)},[]),Y.useEffect(()=>{const oe=Pe.current;if(oe){const Ze=oe.getBoundingClientRect().height;return pe(Ze),w(ut=>[{toastId:u.id,height:Ze,position:u.position},...ut]),()=>w(ut=>ut.filter(jt=>jt.toastId!==u.id))}},[w,u.id]),Y.useLayoutEffect(()=>{if(!F)return;const oe=Pe.current,Ze=oe.style.height;oe.style.height="auto";const ut=oe.getBoundingClientRect().height;oe.style.height=Ze,pe(ut),w(jt=>jt.find(Je=>Je.toastId===u.id)?jt.map(Je=>Je.toastId===u.id?{...Je,height:ut}:Je):[{toastId:u.id,height:ut,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(oe=>oe.filter(Ze=>Ze.toastId!==u.id)),setTimeout(()=>{N(u)},IC)},[u,N,w,he]);Y.useEffect(()=>{if(u.promise&&Ae==="loading"||u.duration===1/0||u.type==="loading")return;let oe;return g||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(),oe=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),ce()},Se.current))})(),()=>clearTimeout(oe)},[g,m,u,Ae,ge,ce]),Y.useEffect(()=>{u.delete&&(ce(),u.onDismiss==null||u.onDismiss.call(u,u))},[ce,u.delete]);function Me(){var oe;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(gC,{className:Bn(D==null?void 0:D.loader,u==null||(oe=u.classNames)==null?void 0:oe.loader),visible:Ae==="loading"})}const Ne=u.icon||(P==null?void 0:P[Ae])||pC(Ae);var Re,wt;return Y.createElement("li",{tabIndex:0,ref:Pe,className:Bn(z,gt,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:j,"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":x,"data-front":ct,"data-swiping":ee,"data-dismissible":Qe,"data-type":Ae,"data-invert":Ue,"data-swipe-out":ne,"data-swipe-direction":B,"data-expanded":!!(g||$&&F),"data-testid":u.testId,style:{"--index":x,"--toasts-before":x,"--z-index":y.length-x,"--offset":`${X?Z:he.current}px`,"--initial-height":$?"auto":`${fe}px`,...S,...u.style},onDragEnd:()=>{K(!1),I(null),be.current=null},onPointerDown:oe=>{oe.button!==2&&(dt||!Qe||(Xe.current=new Date,ae(he.current),oe.target.setPointerCapture(oe.pointerId),oe.target.tagName!=="BUTTON"&&(K(!0),be.current={x:oe.clientX,y:oe.clientY})))},onPointerUp:()=>{var oe,Ze,ut;if(ne||!Qe)return;be.current=null;const jt=Number(((oe=Pe.current)==null?void 0:oe.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()-((ut=Xe.current)==null?void 0:ut.getTime()),Ut=_==="x"?jt:Ln,ea=Math.abs(Ut)/Je;if(Math.abs(Ut)>=RC||ea>.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 Qt,Zt;(Qt=Pe.current)==null||Qt.style.setProperty("--swipe-amount-x","0px"),(Zt=Pe.current)==null||Zt.style.setProperty("--swipe-amount-y","0px")}Q(!1),K(!1),I(null)},onPointerMove:oe=>{var Ze,ut,jt;if(!be.current||!Qe||((Ze=window.getSelection())==null?void 0:Ze.toString().length)>0)return;const Je=oe.clientY-be.current.y,Ut=oe.clientX-be.current.x;var ea;const Qt=(ea=e.swipeDirections)!=null?ea:zC(L);!_&&(Math.abs(Ut)>1||Math.abs(Je)>1)&&I(Math.abs(Ut)>Math.abs(Je)?"x":"y");let Zt={x:0,y:0};const Zi=or=>1/(1.5+Math.abs(or)/20);if(_==="y"){if(Qt.includes("top")||Qt.includes("bottom"))if(Qt.includes("top")&&Je<0||Qt.includes("bottom")&&Je>0)Zt.y=Je;else{const or=Je*Zi(Je);Zt.y=Math.abs(or)<Math.abs(Je)?or:Je}}else if(_==="x"&&(Qt.includes("left")||Qt.includes("right")))if(Qt.includes("left")&&Ut<0||Qt.includes("right")&&Ut>0)Zt.x=Ut;else{const or=Ut*Zi(Ut);Zt.x=Math.abs(or)<Math.abs(Ut)?or:Ut}(Math.abs(Zt.x)>0||Math.abs(Zt.y)>0)&&Q(!0),(ut=Pe.current)==null||ut.style.setProperty("--swipe-amount-x",`${Zt.x}px`),(jt=Pe.current)==null||jt.style.setProperty("--swipe-amount-y",`${Zt.y}px`)}},ie&&!u.jsx&&Ae!=="loading"?Y.createElement("button",{"aria-label":C,"data-disabled":dt,"data-close-button":!0,onClick:dt||!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:NC):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||(o=u.classNames)==null?void 0:o.content)},Y.createElement("div",{"data-title":"",className:Bn(D==null?void 0:D.title,u==null||(i=u.classNames)==null?void 0:i.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&&gl(u.cancel)?Y.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||M,onClick:oe=>{gl(u.cancel)&&Qe&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,oe),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&&gl(u.action)?Y.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||R,onClick:oe=>{gl(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,oe),!oe.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 _x(){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 LC(e,t){const n={};return[e,t].forEach((r,s)=>{const o=s===1,i=o?"--mobile-offset":"--offset",l=o?TC:DC;function c(d){["top","right","bottom","left"].forEach(f=>{n[`${i}-${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[`${i}-${d}`]=l:n[`${i}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}const FC=Y.forwardRef(function(t,n){const{id:r,invert:s,position:o="bottom-right",hotkey:i=["altKey","KeyT"],expand:l,closeButton:c,className:d,offset:f,mobileOffset:u,theme:h="light",richColors:m,duration:w,style:v,visibleToasts:b=PC,toastOptions:x,dir:y=_x(),gap:g=AC,icons:N,containerAriaLabel:j="Notifications"}=t,[k,S]=Y.useState([]),M=Y.useMemo(()=>r?k.filter(F=>F.toasterId===r):k.filter(F=>!F.toasterId),[k,r]),R=Y.useMemo(()=>Array.from(new Set([o].concat(M.filter(F=>F.position).map(F=>F.position)))),[M,o]),[z,A]=Y.useState([]),[O,L]=Y.useState(!1),[E,$]=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),_=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),I=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||Vt.dismiss(F.id),H.filter(({id:J})=>J!==F.id)})},[]);return Y.useEffect(()=>Vt.subscribe(F=>{if(F.dismiss){requestAnimationFrame(()=>{S(H=>H.map(X=>X.id===F.id?{...X,delete:!0}:X))});return}setTimeout(()=>{$v.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(i.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)},[i]),Y.useEffect(()=>{if(C.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,B.current=!1)}},[C.current]),Y.createElement("section",{ref:n,"aria-label":`${j} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((F,H)=>{var X;const[J,ee]=F.split("-");return M.length?Y.createElement("ol",{key:F,dir:y==="auto"?_x():y,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=z[0])==null?void 0:X.height)||0}px`,"--width":`${OC}px`,"--gap":`${g}px`,...v,...LC(f,u)},onBlur:K=>{B.current&&!K.currentTarget.contains(K.relatedTarget)&&(B.current=!1,I.current&&(I.current.focus({preventScroll:!0}),I.current=null))},onFocus:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||B.current||(B.current=!0,I.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"||$(!0)},onPointerUp:()=>$(!1)},M.filter(K=>!K.position&&H===0||K.position===F).map((K,ne)=>{var me,W;return Y.createElement($C,{key:K.id,icons:N,index:ne,toast:K,defaultRichColors:m,duration:(me=x==null?void 0:x.duration)!=null?me:w,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:s,visibleToasts:b,closeButton:(W=x==null?void 0:x.closeButton)!=null?W:c,interacting:E,position:F,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,closeButtonAriaLabel:x==null?void 0:x.closeButtonAriaLabel,removeToast:T,toasts:M.filter(Q=>Q.position==K.position),heights:z.filter(Q=>Q.position==K.position),setHeights:A,expandByDefault:l,gap:g,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 BC={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 WC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),we=(e,t)=>{const n=p.forwardRef(({color:r="currentColor",size:s=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:l="",children:c,...d},f)=>p.createElement("svg",{ref:f,...BC,width:s,height:s,stroke:r,strokeWidth:i?Number(o)*24/Number(s):o,className:["lucide",`lucide-${WC(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=we("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 hi=we("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=we("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=we("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 Wf=we("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 UC=we("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 ot=we("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 Cc=we("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 ft=we("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 Qv=we("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 id=we("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 Zv=we("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 Jv=we("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 VC=we("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=we("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 qe=we("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 ew=we("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 HC=we("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 zi=we("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 pm=we("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 YC=we("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 bs=we("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 XC=we("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 wo=we("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 Uf=we("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 qC=we("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=we("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 fu=we("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=we("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 GC=we("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 KC=we("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 QC=we("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 Ws=we("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=we("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 Px=we("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 Dx=we("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 ls=we("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 Tx=we("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 Ts=we("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 ir=we("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 ZC=we("Table2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]);/**
|
|
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 JC=we("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
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 Os=we("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"}]]);/**
|
|
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 Ox=we("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"}]]);/**
|
|
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 ts=we("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"}]]);/**
|
|
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 Ho=we("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"}]]);/**
|
|
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 Oe=we("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"}]]);/**
|
|
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 ks=we("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"}]]);/**
|
|
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 Fe=we("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
323
|
-
* @license lucide-react v0.294.0 - ISC
|
|
324
|
-
*
|
|
325
|
-
* This source code is licensed under the ISC license.
|
|
326
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
-
*/const Hl=we("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),tw=p.createContext(void 0);function eE({children:e}){const[t,n]=p.useState({users:0,organizations:0,sessions:0,teams:0}),[r,s]=p.useState(!0),o=async()=>{try{const c=await(await fetch("/api/counts")).json();n(c)}catch{}finally{s(!1)}},i=async()=>{s(!0),await o()};return p.useEffect(()=>{o()},[o]),a.jsx(tw.Provider,{value:{counts:t,loading:r,refetchCounts:i},children:e})}function xm(){const e=p.useContext(tw);if(e===void 0)throw new Error("useCounts must be used within a CountsProvider");return e}var Ax=1,tE=.9,nE=.8,rE=.17,hu=.1,mu=.999,sE=.9999,aE=.99,oE=/[\\\/_+.#"@\[\(\{&]/,iE=/[\\\/_+.#"@\[\(\{&]/g,lE=/[\s-]/,nw=/[\s-]/g;function Vf(e,t,n,r,s,o,i){if(o===t.length)return s===e.length?Ax:aE;var l=`${s},${o}`;if(i[l]!==void 0)return i[l];for(var c=r.charAt(o),d=n.indexOf(c,s),f=0,u,h,m,w;d>=0;)u=Vf(e,t,n,r,d+1,o+1,i),u>f&&(d===s?u*=Ax:oE.test(e.charAt(d-1))?(u*=nE,m=e.slice(s,d-1).match(iE),m&&s>0&&(u*=Math.pow(mu,m.length))):lE.test(e.charAt(d-1))?(u*=tE,w=e.slice(s,d-1).match(nw),w&&s>0&&(u*=Math.pow(mu,w.length))):(u*=rE,s>0&&(u*=Math.pow(mu,d-s))),e.charAt(d)!==t.charAt(o)&&(u*=sE)),(u<hu&&n.charAt(d-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(d-1)!==r.charAt(o))&&(h=Vf(e,t,n,r,d+1,o+2,i),h*hu>u&&(u=h*hu)),u>f&&(f=u),d=n.indexOf(c,d+1);return i[l]=f,f}function Rx(e){return e.toLowerCase().replace(nw," ")}function cE(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Vf(e,t,Rx(e),Rx(t),0,0,{})}function lt(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 Ix(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Us(...e){return t=>{let n=!1;const r=e.map(s=>{const o=Ix(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Ix(e[s],null)}}}}function Wt(...e){return p.useCallback(Us(...e),e)}function dE(e,t){const n=p.createContext(t),r=o=>{const{children:i,...l}=o,c=p.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function s(o){const i=p.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function $i(e,t=[]){let n=[];function r(o,i){const l=p.createContext(i),c=n.length;n=[...n,i];const d=u=>{var x;const{scope:h,children:m,...w}=u,v=((x=h==null?void 0:h[e])==null?void 0:x[c])||l,b=p.useMemo(()=>w,Object.values(w));return a.jsx(v.Provider,{value:b,children:m})};d.displayName=o+"Provider";function f(u,h){var v;const m=((v=h==null?void 0:h[e])==null?void 0:v[c])||l,w=p.useContext(m);if(w)return w;if(i!==void 0)return i;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[d,f]}const s=()=>{const o=n.map(i=>p.createContext(i));return function(l){const c=(l==null?void 0:l[e])||o;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,uE(s,...t)]}function uE(...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(o){const i=r.reduce((l,{useScope:c,scopeName:d})=>{const u=c(o)[`__scope${d}`];return{...l,...u}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var cs=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},fE=bh[" useId ".trim().toString()]||(()=>{}),hE=0;function On(e){const[t,n]=p.useState(fE());return cs(()=>{n(r=>r??String(hE++))},[e]),t?`radix-${t}`:""}var mE=bh[" useInsertionEffect ".trim().toString()]||cs;function ld({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,i]=pE({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=xE(f)?f(e):f;h!==e&&((u=i.current)==null||u.call(i,h))}else o(f)},[l,e,o,i]);return[c,d]}function pE({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),s=p.useRef(n),o=p.useRef(t);return mE(()=>{o.current=t},[t]),p.useEffect(()=>{var i;s.current!==n&&((i=o.current)==null||i.call(o,n),s.current=n)},[n,s]),[n,r,o]}function xE(e){return typeof e=="function"}function cd(e){const t=yE(e),n=p.forwardRef((r,s)=>{const{children:o,...i}=r,l=p.Children.toArray(o),c=l.find(wE);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,{...i,ref:s,children:p.isValidElement(d)?p.cloneElement(d,void 0,f):null})}return a.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}var gE=cd("Slot");function yE(e){const t=p.forwardRef((n,r)=>{const{children:s,...o}=n;if(p.isValidElement(s)){const i=NE(s),l=bE(o,s.props);return s.type!==p.Fragment&&(l.ref=r?Us(r,i):i),p.cloneElement(s,l)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rw=Symbol("radix.slottable");function vE(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=rw,t}function wE(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rw}function bE(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...l)=>{const c=o(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function NE(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 jE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Be=jE.reduce((e,t)=>{const n=cd(`Primitive.${t}`),r=p.forwardRef((s,o)=>{const{asChild:i,...l}=s,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function kE(e,t){e&&ad.flushSync(()=>e.dispatchEvent(t))}function Ua(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 SE(e,t=globalThis==null?void 0:globalThis.document){const n=Ua(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 CE="DismissableLayer",Hf="dismissableLayer.update",EE="dismissableLayer.pointerDownOutside",ME="dismissableLayer.focusOutside",zx,sw=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dd=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:l,...c}=e,d=p.useContext(sw),[f,u]=p.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=p.useState({}),w=Wt(t,S=>u(S)),v=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=v.indexOf(b),y=f?v.indexOf(f):-1,g=d.layersWithOutsidePointerEventsDisabled.size>0,N=y>=x,j=DE(S=>{const M=S.target,R=[...d.branches].some(z=>z.contains(M));!N||R||(s==null||s(S),i==null||i(S),S.defaultPrevented||l==null||l())},h),k=TE(S=>{const M=S.target;[...d.branches].some(z=>z.contains(M))||(o==null||o(S),i==null||i(S),S.defaultPrevented||l==null||l())},h);return SE(S=>{y===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&&(zx=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),$x(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=zx)}},[f,h,n,d]),p.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),$x())},[f,d]),p.useEffect(()=>{const S=()=>m({});return document.addEventListener(Hf,S),()=>document.removeEventListener(Hf,S)},[]),a.jsx(Be.div,{...c,ref:w,style:{pointerEvents:g?N?"auto":"none":void 0,...e.style},onFocusCapture:lt(e.onFocusCapture,k.onFocusCapture),onBlurCapture:lt(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:lt(e.onPointerDownCapture,j.onPointerDownCapture)})});dd.displayName=CE;var _E="DismissableLayerBranch",PE=p.forwardRef((e,t)=>{const n=p.useContext(sw),r=p.useRef(null),s=Wt(t,r);return p.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),a.jsx(Be.div,{...e,ref:s})});PE.displayName=_E;function DE(e,t=globalThis==null?void 0:globalThis.document){const n=Ua(e),r=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let c=function(){aw(EE,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},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function TE(e,t=globalThis==null?void 0:globalThis.document){const n=Ua(e),r=p.useRef(!1);return p.useEffect(()=>{const s=o=>{o.target&&!r.current&&aw(ME,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function $x(){const e=new CustomEvent(Hf);document.dispatchEvent(e)}function aw(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?kE(s,o):s.dispatchEvent(o)}var pu="focusScope.autoFocusOnMount",xu="focusScope.autoFocusOnUnmount",Lx={bubbles:!1,cancelable:!0},OE="FocusScope",gm=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[l,c]=p.useState(null),d=Ua(s),f=Ua(o),u=p.useRef(null),h=Wt(t,v=>c(v)),m=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(g){if(m.paused||!l)return;const N=g.target;l.contains(N)?u.current=N:Ir(u.current,{select:!0})},b=function(g){if(m.paused||!l)return;const N=g.relatedTarget;N!==null&&(l.contains(N)||Ir(u.current,{select:!0}))},x=function(g){if(document.activeElement===document.body)for(const j of g)j.removedNodes.length>0&&Ir(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const y=new MutationObserver(x);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),y.disconnect()}}},[r,l,m.paused]),p.useEffect(()=>{if(l){Bx.add(m);const v=document.activeElement;if(!l.contains(v)){const x=new CustomEvent(pu,Lx);l.addEventListener(pu,d),l.dispatchEvent(x),x.defaultPrevented||(AE(LE(ow(l)),{select:!0}),document.activeElement===v&&Ir(l))}return()=>{l.removeEventListener(pu,d),setTimeout(()=>{const x=new CustomEvent(xu,Lx);l.addEventListener(xu,f),l.dispatchEvent(x),x.defaultPrevented||Ir(v??document.body,{select:!0}),l.removeEventListener(xu,f),Bx.remove(m)},0)}}},[l,d,f,m]);const w=p.useCallback(v=>{if(!n&&!r||m.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,x=document.activeElement;if(b&&x){const y=v.currentTarget,[g,N]=RE(y);g&&N?!v.shiftKey&&x===N?(v.preventDefault(),n&&Ir(g,{select:!0})):v.shiftKey&&x===g&&(v.preventDefault(),n&&Ir(N,{select:!0})):x===y&&v.preventDefault()}},[n,r,m.paused]);return a.jsx(Be.div,{tabIndex:-1,...i,ref:h,onKeyDown:w})});gm.displayName=OE;function AE(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ir(r,{select:t}),document.activeElement!==n)return}function RE(e){const t=ow(e),n=Fx(t,e),r=Fx(t.reverse(),e);return[n,r]}function ow(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 Fx(e,t){for(const n of e)if(!IE(n,{upTo:t}))return n}function IE(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 zE(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&&zE(e)&&t&&e.select()}}var Bx=$E();function $E(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Wx(e,t),e.unshift(t)},remove(t){var n;e=Wx(e,t),(n=e[0])==null||n.resume()}}}function Wx(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function LE(e){return e.filter(t=>t.tagName!=="A")}var FE="Portal",ym=p.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,o]=p.useState(!1);cs(()=>o(!0),[]);const i=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return i?$v.createPortal(a.jsx(Be.div,{...r,ref:t}),i):null});ym.displayName=FE;function BE(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var gs=e=>{const{present:t,children:n}=e,r=WE(t),s=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),o=Wt(r.ref,UE(s));return typeof n=="function"||r.isPresent?p.cloneElement(s,{ref:o}):null};gs.displayName="Presence";function WE(e){const[t,n]=p.useState(),r=p.useRef(null),s=p.useRef(e),o=p.useRef("none"),i=e?"mounted":"unmounted",[l,c]=BE(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const d=yl(r.current);o.current=l==="mounted"?d:"none"},[l]),cs(()=>{const d=r.current,f=s.current;if(f!==e){const h=o.current,m=yl(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]),cs(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,u=m=>{const v=yl(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&v&&(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&&(o.current=yl(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 yl(e){return(e==null?void 0:e.animationName)||"none"}function UE(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 gu=0;function iw(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ux()),document.body.insertAdjacentElement("beforeend",e[1]??Ux()),gu++,()=>{gu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),gu--}},[])}function Ux(){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 o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},qn.apply(this,arguments)};function lw(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 VE(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Yl="right-scroll-bar-position",Xl="width-before-scroll-bar",HE="with-scroll-bars-hidden",YE="--removed-body-scroll-bar-size";function yu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function XE(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 qE=typeof window<"u"?p.useLayoutEffect:p.useEffect,Vx=new WeakMap;function GE(e,t){var n=XE(null,function(r){return e.forEach(function(s){return yu(s,r)})});return qE(function(){var r=Vx.get(n);if(r){var s=new Set(r),o=new Set(e),i=n.current;s.forEach(function(l){o.has(l)||yu(l,null)}),o.forEach(function(l){s.has(l)||yu(l,i)})}Vx.set(n,e)},[e]),n}function KE(e){return e}function QE(e,t){t===void 0&&(t=KE);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(o){var i=t(o,r);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(o){for(r=!0;n.length;){var i=n;n=[],i.forEach(o)}n={push:function(l){return o(l)},filter:function(){return n}}},assignMedium:function(o){r=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(o),i=n}var c=function(){var f=i;i=[],f.forEach(o)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){i.push(f),d()},filter:function(f){return i=i.filter(f),n}}}};return s}function ZE(e){e===void 0&&(e={});var t=QE(null);return t.options=qn({async:!0,ssr:!1},e),t}var cw=function(e){var t=e.sideCar,n=lw(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))};cw.isSideCarExport=!0;function JE(e,t){return e.useMedium(t),cw}var dw=ZE(),vu=function(){},ud=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:vu,onWheelCapture:vu,onTouchMoveCapture:vu}),s=r[0],o=r[1],i=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,v=e.inert,b=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,g=e.gapMode,N=lw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=h,k=GE([n,t]),S=qn(qn({},N),s);return p.createElement(p.Fragment,null,f&&p.createElement(j,{sideCar:dw,removeScrollBar:d,shards:u,noRelative:m,noIsolation:w,inert:v,setCallbacks:o,allowPinchZoom:!!b,lockRef:n,gapMode:g}),i?p.cloneElement(p.Children.only(l),qn(qn({},S),{ref:k})):p.createElement(y,qn({},S,{className:c,ref:k}),l))});ud.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ud.classNames={fullWidth:Xl,zeroRight:Yl};var e4=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function t4(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=e4();return t&&e.setAttribute("nonce",t),e}function n4(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function r4(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var s4=function(){var e=0,t=null;return{add:function(n){e==0&&(t=t4())&&(n4(t,n),r4(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},a4=function(){var e=s4();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},uw=function(){var e=a4(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},o4={left:0,top:0,right:0,gap:0},wu=function(e){return parseInt(e||"",10)||0},i4=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[wu(n),wu(r),wu(s)]},l4=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return o4;var t=i4(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])}},c4=uw(),Da="data-scroll-locked",d4=function(e,t,n,r){var s=e.left,o=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
328
|
-
.`.concat(HE,` {
|
|
329
|
-
overflow: hidden `).concat(r,`;
|
|
330
|
-
padding-right: `).concat(l,"px ").concat(r,`;
|
|
331
|
-
}
|
|
332
|
-
body[`).concat(Da,`] {
|
|
333
|
-
overflow: hidden `).concat(r,`;
|
|
334
|
-
overscroll-behavior: contain;
|
|
335
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
336
|
-
padding-left: `.concat(s,`px;
|
|
337
|
-
padding-top: `).concat(o,`px;
|
|
338
|
-
padding-right: `).concat(i,`px;
|
|
339
|
-
margin-left:0;
|
|
340
|
-
margin-top:0;
|
|
341
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
342
|
-
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
.`).concat(Yl,` {
|
|
346
|
-
right: `).concat(l,"px ").concat(r,`;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
.`).concat(Xl,` {
|
|
350
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.`).concat(Yl," .").concat(Yl,` {
|
|
354
|
-
right: 0 `).concat(r,`;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
.`).concat(Xl," .").concat(Xl,` {
|
|
358
|
-
margin-right: 0 `).concat(r,`;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
body[`).concat(Da,`] {
|
|
362
|
-
`).concat(YE,": ").concat(l,`px;
|
|
363
|
-
}
|
|
364
|
-
`)},Hx=function(){var e=parseInt(document.body.getAttribute(Da)||"0",10);return isFinite(e)?e:0},u4=function(){p.useEffect(function(){return document.body.setAttribute(Da,(Hx()+1).toString()),function(){var e=Hx()-1;e<=0?document.body.removeAttribute(Da):document.body.setAttribute(Da,e.toString())}},[])},f4=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;u4();var o=p.useMemo(function(){return l4(s)},[s]);return p.createElement(c4,{styles:d4(o,!t,s,n?"":"!important")})},Yf=!1;if(typeof window<"u")try{var vl=Object.defineProperty({},"passive",{get:function(){return Yf=!0,!0}});window.addEventListener("test",vl,vl),window.removeEventListener("test",vl,vl)}catch{Yf=!1}var na=Yf?{passive:!1}:!1,h4=function(e){return e.tagName==="TEXTAREA"},fw=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!h4(e)&&n[t]==="visible")},m4=function(e){return fw(e,"overflowY")},p4=function(e){return fw(e,"overflowX")},Yx=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=hw(e,r);if(s){var o=mw(e,r),i=o[1],l=o[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},x4=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},g4=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},hw=function(e,t){return e==="v"?m4(t):p4(t)},mw=function(e,t){return e==="v"?x4(t):g4(t)},y4=function(e,t){return e==="h"&&t==="rtl"?-1:1},v4=function(e,t,n,r,s){var o=y4(e,window.getComputedStyle(t).direction),i=o*r,l=n.target,c=t.contains(l),d=!1,f=i>0,u=0,h=0;do{if(!l)break;var m=mw(e,l),w=m[0],v=m[1],b=m[2],x=v-b-o*w;(w||x)&&hw(e,l)&&(u+=x,h+=w);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}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},wl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Xx=function(e){return[e.deltaX,e.deltaY]},qx=function(e){return e&&"current"in e?e.current:e},w4=function(e,t){return e[0]===t[0]&&e[1]===t[1]},b4=function(e){return`
|
|
365
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
366
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
367
|
-
`)},N4=0,ra=[];function j4(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),s=p.useState(N4++)[0],o=p.useState(uw)[0],i=p.useRef(e);p.useEffect(function(){i.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var v=VE([e.lockRef.current],(e.shards||[]).map(qx),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(v,b){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!i.current.allowPinchZoom;var x=wl(v),y=n.current,g="deltaX"in v?v.deltaX:y[0]-x[0],N="deltaY"in v?v.deltaY:y[1]-x[1],j,k=v.target,S=Math.abs(g)>Math.abs(N)?"h":"v";if("touches"in v&&S==="h"&&k.type==="range")return!1;var M=Yx(S,k);if(!M)return!0;if(M?j=S:(j=S==="v"?"h":"v",M=Yx(S,k)),!M)return!1;if(!r.current&&"changedTouches"in v&&(g||N)&&(r.current=j),!j)return!0;var R=r.current||j;return v4(R,b,v,R==="h"?g:N)},[]),c=p.useCallback(function(v){var b=v;if(!(!ra.length||ra[ra.length-1]!==o)){var x="deltaY"in b?Xx(b):wl(b),y=t.current.filter(function(j){return j.name===b.type&&(j.target===b.target||b.target===j.shadowParent)&&w4(j.delta,x)})[0];if(y&&y.should){b.cancelable&&b.preventDefault();return}if(!y){var g=(i.current.shards||[]).map(qx).filter(Boolean).filter(function(j){return j.contains(b.target)}),N=g.length>0?l(b,g[0]):!i.current.noIsolation;N&&b.cancelable&&b.preventDefault()}}},[]),d=p.useCallback(function(v,b,x,y){var g={name:v,delta:b,target:x,should:y,shadowParent:k4(x)};t.current.push(g),setTimeout(function(){t.current=t.current.filter(function(N){return N!==g})},1)},[]),f=p.useCallback(function(v){n.current=wl(v),r.current=void 0},[]),u=p.useCallback(function(v){d(v.type,Xx(v),v.target,l(v,e.lockRef.current))},[]),h=p.useCallback(function(v){d(v.type,wl(v),v.target,l(v,e.lockRef.current))},[]);p.useEffect(function(){return ra.push(o),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:h}),document.addEventListener("wheel",c,na),document.addEventListener("touchmove",c,na),document.addEventListener("touchstart",f,na),function(){ra=ra.filter(function(v){return v!==o}),document.removeEventListener("wheel",c,na),document.removeEventListener("touchmove",c,na),document.removeEventListener("touchstart",f,na)}},[]);var m=e.removeScrollBar,w=e.inert;return p.createElement(p.Fragment,null,w?p.createElement(o,{styles:b4(s)}):null,m?p.createElement(f4,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function k4(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const S4=JE(dw,j4);var vm=p.forwardRef(function(e,t){return p.createElement(ud,qn({},e,{ref:t,sideCar:S4}))});vm.classNames=ud.classNames;var C4=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},sa=new WeakMap,bl=new WeakMap,Nl={},bu=0,pw=function(e){return e&&(e.host||pw(e.parentNode))},E4=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=pw(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})},M4=function(e,t,n,r){var s=E4(t,Array.isArray(e)?e:[e]);Nl[n]||(Nl[n]=new WeakMap);var o=Nl[n],i=[],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",v=(sa.get(h)||0)+1,b=(o.get(h)||0)+1;sa.set(h,v),o.set(h,b),i.push(h),v===1&&w&&bl.set(h,!0),b===1&&h.setAttribute(n,"true"),w||h.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return f(t),l.clear(),bu++,function(){i.forEach(function(u){var h=sa.get(u)-1,m=o.get(u)-1;sa.set(u,h),o.set(u,m),h||(bl.has(u)||u.removeAttribute(r),bl.delete(u)),m||u.removeAttribute(n)}),bu--,bu||(sa=new WeakMap,sa=new WeakMap,bl=new WeakMap,Nl={})}},xw=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=C4(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),M4(r,s,n,"aria-hidden")):function(){return null}},fd="Dialog",[gw]=$i(fd),[_4,zn]=gw(fd),yw=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,l=p.useRef(null),c=p.useRef(null),[d,f]=ld({prop:r,defaultProp:s??!1,onChange:o,caller:fd});return a.jsx(_4,{scope:t,triggerRef:l,contentRef:c,contentId:On(),titleId:On(),descriptionId:On(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(u=>!u),[f]),modal:i,children:n})};yw.displayName=fd;var vw="DialogTrigger",P4=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=zn(vw,n),o=Wt(t,s.triggerRef);return a.jsx(Be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Nm(s.open),...r,ref:o,onClick:lt(e.onClick,s.onOpenToggle)})});P4.displayName=vw;var wm="DialogPortal",[D4,ww]=gw(wm,{forceMount:void 0}),bw=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=zn(wm,t);return a.jsx(D4,{scope:t,forceMount:n,children:p.Children.map(r,i=>a.jsx(gs,{present:n||o.open,children:a.jsx(ym,{asChild:!0,container:s,children:i})}))})};bw.displayName=wm;var Ec="DialogOverlay",Nw=p.forwardRef((e,t)=>{const n=ww(Ec,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=zn(Ec,e.__scopeDialog);return o.modal?a.jsx(gs,{present:r||o.open,children:a.jsx(O4,{...s,ref:t})}):null});Nw.displayName=Ec;var T4=cd("DialogOverlay.RemoveScroll"),O4=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=zn(Ec,n);return a.jsx(vm,{as:T4,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(Be.div,{"data-state":Nm(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Vs="DialogContent",jw=p.forwardRef((e,t)=>{const n=ww(Vs,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=zn(Vs,e.__scopeDialog);return a.jsx(gs,{present:r||o.open,children:o.modal?a.jsx(A4,{...s,ref:t}):a.jsx(R4,{...s,ref:t})})});jw.displayName=Vs;var A4=p.forwardRef((e,t)=>{const n=zn(Vs,e.__scopeDialog),r=p.useRef(null),s=Wt(t,n.contentRef,r);return p.useEffect(()=>{const o=r.current;if(o)return xw(o)},[]),a.jsx(kw,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:lt(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:lt(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&o.preventDefault()}),onFocusOutside:lt(e.onFocusOutside,o=>o.preventDefault())})}),R4=p.forwardRef((e,t)=>{const n=zn(Vs,e.__scopeDialog),r=p.useRef(!1),s=p.useRef(!1);return a.jsx(kw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),kw=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,l=zn(Vs,n),c=p.useRef(null),d=Wt(t,c);return iw(),a.jsxs(a.Fragment,{children:[a.jsx(gm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(dd,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Nm(l.open),...i,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(L4,{titleId:l.titleId}),a.jsx(B4,{contentRef:c,descriptionId:l.descriptionId})]})]})}),bm="DialogTitle",I4=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=zn(bm,n);return a.jsx(Be.h2,{id:s.titleId,...r,ref:t})});I4.displayName=bm;var Sw="DialogDescription",z4=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=zn(Sw,n);return a.jsx(Be.p,{id:s.descriptionId,...r,ref:t})});z4.displayName=Sw;var Cw="DialogClose",$4=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=zn(Cw,n);return a.jsx(Be.button,{type:"button",...r,ref:t,onClick:lt(e.onClick,()=>s.onOpenChange(!1))})});$4.displayName=Cw;function Nm(e){return e?"open":"closed"}var Ew="DialogTitleWarning",[P$,Mw]=dE(Ew,{contentName:Vs,titleName:bm,docsSlug:"dialog"}),L4=({titleId:e})=>{const t=Mw(Ew),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
368
|
-
|
|
369
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
370
|
-
|
|
371
|
-
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},F4="DialogDescriptionWarning",B4=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Mw(F4).contentName}}.`;return p.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},W4=yw,U4=bw,V4=Nw,H4=jw,bo='[cmdk-group=""]',Nu='[cmdk-group-items=""]',Y4='[cmdk-group-heading=""]',_w='[cmdk-item=""]',Gx=`${_w}:not([aria-disabled="true"])`,Xf="cmdk-item-select",la="data-value",X4=(e,t,n)=>cE(e,t,n),Pw=p.createContext(void 0),Li=()=>p.useContext(Pw),Dw=p.createContext(void 0),jm=()=>p.useContext(Dw),Tw=p.createContext(void 0),Ow=p.forwardRef((e,t)=>{let n=ca(()=>{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=ca(()=>new Set),s=ca(()=>new Map),o=ca(()=>new Map),i=ca(()=>new Set),l=Aw(e),{label:c,children:d,value:f,onValueChange:u,filter:h,shouldFilter:m,loop:w,disablePointerSelection:v=!1,vimBindings:b=!0,...x}=e,y=On(),g=On(),N=On(),j=p.useRef(null),k=sM();Hs(()=>{if(f!==void 0){let T=f.trim();n.current.value=T,S.emit()}},[f]),Hs(()=>{k(6,L)},[]);let S=p.useMemo(()=>({subscribe:T=>(i.current.add(T),()=>i.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(),z(),k(1,A);else if(T==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ne=document.getElementById(N);ne?ne.focus():(X=document.getElementById(y))==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:()=>{i.current.forEach(T=>T())}}),[]),M=p.useMemo(()=>({value:(T,F,H)=>{var X;F!==((X=o.current.get(T))==null?void 0:X.value)&&(o.current.set(T,{value:F,keywords:H}),n.current.filtered.items.set(T,R(F,H)),k(2,()=>{z(),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(),z(),n.current.value||A(),S.emit()}),()=>{o.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),()=>{o.current.delete(T),s.current.delete(T)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:N,labelId:g,listInnerRef:j}),[]);function R(T,F){var H,X;let J=(X=(H=l.current)==null?void 0:H.filter)!=null?X:X4;return T?J(T,n.current.search,F):0}function z(){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=j.current;$().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(Nu);J?J.appendChild(X.parentElement===J?X:X.closest(`${Nu} > *`)):H.appendChild(X.parentElement===H?X:X.closest(`${Nu} > *`))}),F.sort((X,J)=>J[1]-X[1]).forEach(X=>{var J;let ee=(J=j.current)==null?void 0:J.querySelector(`${bo}[${la}="${encodeURIComponent(X[0])}"]`);ee==null||ee.parentElement.appendChild(ee)})}function A(){let T=$().find(H=>H.getAttribute("aria-disabled")!=="true"),F=T==null?void 0:T.getAttribute(la);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=o.current.get(ee))==null?void 0:T.value)!=null?F:"",ne=(X=(H=o.current.get(ee))==null?void 0:H.keywords)!=null?X:[],me=R(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(bo))==null?void 0:F.querySelector(Y4))==null||H.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function E(){var T;return(T=j.current)==null?void 0:T.querySelector(`${_w}[aria-selected="true"]`)}function $(){var T;return Array.from(((T=j.current)==null?void 0:T.querySelectorAll(Gx))||[])}function D(T){let F=$()[T];F&&S.setState("value",F.getAttribute(la))}function P(T){var F;let H=E(),X=$(),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(la))}function C(T){let F=E(),H=F==null?void 0:F.closest(bo),X;for(;H&&!X;)H=T>0?nM(H,bo):rM(H,bo),X=H==null?void 0:H.querySelector(Gx);X?S.setState("value",X.getAttribute(la)):P(T)}let _=()=>D($().length-1),I=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(Be.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:T=>{var F;(F=x.onKeyDown)==null||F.call(x,T);let H=T.nativeEvent.isComposing||T.keyCode===229;if(!(T.defaultPrevented||H))switch(T.key){case"n":case"j":{b&&T.ctrlKey&&I(T);break}case"ArrowDown":{I(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(Xf);X.dispatchEvent(J)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:oM},c),hd(e,T=>p.createElement(Dw.Provider,{value:S},p.createElement(Pw.Provider,{value:M},T))))}),q4=p.forwardRef((e,t)=>{var n,r;let s=On(),o=p.useRef(null),i=p.useContext(Tw),l=Li(),c=Aw(e),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;Hs(()=>{if(!d)return l.item(s,i==null?void 0:i.id)},[d]);let f=Rw(s,o,[e.value,e.children,o],e.keywords),u=jm(),h=ds(k=>k.value&&k.value===f.current),m=ds(k=>d||l.filter()===!1?!0:k.search?k.filtered.items.get(s)>0:!0);p.useEffect(()=>{let k=o.current;if(!(!k||e.disabled))return k.addEventListener(Xf,w),()=>k.removeEventListener(Xf,w)},[m,e.onSelect,e.disabled]);function w(){var k,S;v(),(S=(k=c.current).onSelect)==null||S.call(k,f.current)}function v(){u.setState("value",f.current,!0)}if(!m)return null;let{disabled:b,value:x,onSelect:y,forceMount:g,keywords:N,...j}=e;return p.createElement(Be.div,{ref:Us(o,t),...j,id:s,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!h,"data-disabled":!!b,"data-selected":!!h,onPointerMove:b||l.getDisablePointerSelection()?void 0:v,onClick:b?void 0:w},e.children)}),G4=p.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...o}=e,i=On(),l=p.useRef(null),c=p.useRef(null),d=On(),f=Li(),u=ds(m=>s||f.filter()===!1?!0:m.search?m.filtered.groups.has(i):!0);Hs(()=>f.group(i),[]),Rw(i,l,[e.value,e.heading,c]);let h=p.useMemo(()=>({id:i,forceMount:s}),[s]);return p.createElement(Be.div,{ref:Us(l,t),...o,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&p.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),hd(e,m=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},p.createElement(Tw.Provider,{value:h},m))))}),K4=p.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=p.useRef(null),o=ds(i=>!i.search);return!n&&!o?null:p.createElement(Be.div,{ref:Us(s,t),...r,"cmdk-separator":"",role:"separator"})}),Q4=p.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,o=jm(),i=ds(d=>d.search),l=ds(d=>d.selectedItemId),c=Li();return p.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),p.createElement(Be.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:i,onChange:d=>{s||o.setState("search",d.target.value),n==null||n(d.target.value)}})}),Z4=p.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,o=p.useRef(null),i=p.useRef(null),l=ds(d=>d.selectedItemId),c=Li();return p.useEffect(()=>{if(i.current&&o.current){let d=i.current,f=o.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(Be.div,{ref:Us(o,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},hd(e,d=>p.createElement("div",{ref:Us(i,c.listInnerRef),"cmdk-list-sizer":""},d)))}),J4=p.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:o,container:i,...l}=e;return p.createElement(W4,{open:n,onOpenChange:r},p.createElement(U4,{container:i},p.createElement(V4,{"cmdk-overlay":"",className:s}),p.createElement(H4,{"aria-label":e.label,"cmdk-dialog":"",className:o},p.createElement(Ow,{ref:t,...l}))))}),eM=p.forwardRef((e,t)=>ds(n=>n.filtered.count===0)?p.createElement(Be.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),tM=p.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...o}=e;return p.createElement(Be.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},hd(e,i=>p.createElement("div",{"aria-hidden":!0},i)))}),No=Object.assign(Ow,{List:Z4,Item:q4,Input:Q4,Group:G4,Separator:K4,Dialog:J4,Empty:eM,Loading:tM});function nM(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function rM(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Aw(e){let t=p.useRef(e);return Hs(()=>{t.current=e}),t}var Hs=typeof window>"u"?p.useEffect:p.useLayoutEffect;function ca(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function ds(e){let t=jm(),n=()=>e(t.snapshot());return p.useSyncExternalStore(t.subscribe,n,n)}function Rw(e,t,n,r=[]){let s=p.useRef(),o=Li();return Hs(()=>{var i;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());o.value(e,l,c),(i=t.current)==null||i.setAttribute(la,l),s.current=l}),s}var sM=()=>{let[e,t]=p.useState(),n=ca(()=>new Map);return Hs(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function aM(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function hd({asChild:e,children:t},n){return e&&p.isValidElement(t)?p.cloneElement(aM(t),{ref:t.ref},n(t.props.children)):n(t)}var oM={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function iM({isOpen:e,onClose:t}){const n=Js(),[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:ot,action:()=>n("/organizations"),category:"Navigation",keywords:["org","company","team"]},{id:"sessions",title:"Sessions",description:"View active user sessions",icon:Wf,action:()=>n("/sessions"),category:"Navigation",keywords:["session","login","active"]},{id:"settings",title:"Settings",description:"Configure Better Auth Studio",icon:Ts,action:()=>n("/settings"),category:"Navigation",keywords:["config","setup","preferences"]},{id:"dashboard",title:"Dashboard",description:"View overview and statistics",icon:Wf,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(No,{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(ls,{className:"w-4 h-4 text-gray-400 mr-3"}),a.jsx(No.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(No.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(ls,{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(No.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(No.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 Iw(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=Iw(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function zw(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Iw(e))&&(r&&(r+=" "),r+=t);return r}const Kx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Qx=zw,$w=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Qx(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(d=>{const f=n==null?void 0:n[d],u=o==null?void 0:o[d];if(f===null)return null;const h=Kx(f)||Kx(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[v,b]=w;return Array.isArray(b)?b.includes({...o,...l}[v]):{...o,...l}[v]===b})?[...d,u,h]:d},[]);return Qx(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},km="-",lM=e=>{const t=dM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const l=i.split(km);return l[0]===""&&l.length!==1&&l.shift(),Lw(l,t)||cM(i)},getConflictingClassGroupIds:(i,l)=>{const c=n[i]||[];return l&&r[i]?[...c,...r[i]]:c}}},Lw=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Lw(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(km);return(i=t.validators.find(({validator:l})=>l(o)))==null?void 0:i.classGroupId},Zx=/^\[(.+)\]$/,cM=e=>{if(Zx.test(e)){const t=Zx.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},dM=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return fM(Object.entries(e.classGroups),n).forEach(([o,i])=>{qf(i,r,o,t)}),r},qf=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Jx(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(uM(s)){qf(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,i])=>{qf(i,Jx(t,o),n,r)})})},Jx=(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},uM=e=>e.isThemeGetter,fM=(e,t)=>t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,l])=>[t+i,l])):o);return[n,s]}):e,hM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let i=n.get(o);if(i!==void 0)return i;if((i=r.get(o))!==void 0)return s(o,i),i},set(o,i){n.has(o)?n.set(o,i):s(o,i)}}},Fw="!",mM=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length,i=l=>{const c=[];let d=0,f=0,u;for(let b=0;b<l.length;b++){let x=l[b];if(d===0){if(x===s&&(r||l.slice(b,b+o)===t)){c.push(l.slice(f,b)),f=b+o;continue}if(x==="/"){u=b;continue}}x==="["?d++:x==="]"&&d--}const h=c.length===0?l:l.substring(f),m=h.startsWith(Fw),w=m?h.substring(1):h,v=u&&u>f?u-f:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:w,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:i}):i},pM=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},xM=e=>({cache:hM(e.cacheSize),parseClassName:mM(e),...lM(e)}),gM=/\s+/,yM=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=[],i=e.trim().split(gM);let l="";for(let c=i.length-1;c>=0;c-=1){const d=i[c],{modifiers:f,hasImportantModifier:u,baseClassName:h,maybePostfixModifierPosition:m}=n(d);let w=!!m,v=r(w?h.substring(0,m):h);if(!v){if(!w){l=d+(l.length>0?" "+l:l);continue}if(v=r(h),!v){l=d+(l.length>0?" "+l:l);continue}w=!1}const b=pM(f).join(":"),x=u?b+Fw:b,y=x+v;if(o.includes(y))continue;o.push(y);const g=s(v,w);for(let N=0;N<g.length;++N){const j=g[N];o.push(x+j)}l=d+(l.length>0?" "+l:l)}return l};function vM(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Bw(t))&&(r&&(r+=" "),r+=n);return r}const Bw=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Bw(e[r]))&&(n&&(n+=" "),n+=t);return n};function wM(e,...t){let n,r,s,o=i;function i(c){const d=t.reduce((f,u)=>u(f),e());return n=xM(d),r=n.cache.get,s=n.cache.set,o=l,l(c)}function l(c){const d=r(c);if(d)return d;const f=yM(c,n);return s(c,f),f}return function(){return o(vM.apply(null,arguments))}}const Ve=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ww=/^\[(?:([a-z-]+):)?(.+)\]$/i,bM=/^\d+\/\d+$/,NM=new Set(["px","full","screen"]),jM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kM=/\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$/,SM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,CM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,EM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,lr=e=>Ta(e)||NM.has(e)||bM.test(e),Dr=e=>io(e,"length",RM),Ta=e=>!!e&&!Number.isNaN(Number(e)),ju=e=>io(e,"number",Ta),jo=e=>!!e&&Number.isInteger(Number(e)),MM=e=>e.endsWith("%")&&Ta(e.slice(0,-1)),ke=e=>Ww.test(e),Tr=e=>jM.test(e),_M=new Set(["length","size","percentage"]),PM=e=>io(e,_M,Uw),DM=e=>io(e,"position",Uw),TM=new Set(["image","url"]),OM=e=>io(e,TM,zM),AM=e=>io(e,"",IM),ko=()=>!0,io=(e,t,n)=>{const r=Ww.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},RM=e=>kM.test(e)&&!SM.test(e),Uw=()=>!1,IM=e=>CM.test(e),zM=e=>EM.test(e),$M=()=>{const e=Ve("colors"),t=Ve("spacing"),n=Ve("blur"),r=Ve("brightness"),s=Ve("borderColor"),o=Ve("borderRadius"),i=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"),v=Ve("inset"),b=Ve("margin"),x=Ve("opacity"),y=Ve("padding"),g=Ve("saturate"),N=Ve("scale"),j=Ve("sepia"),k=Ve("skew"),S=Ve("space"),M=Ve("translate"),R=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",ke,t],O=()=>[ke,t],L=()=>["",lr,Dr],E=()=>["auto",Ta,ke],$=()=>["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],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Ta,ke];return{cacheSize:500,separator:":",theme:{colors:[ko],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:[MM,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":I()}],"break-before":[{"break-before":I()}],"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:[...$(),ke]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",jo,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",jo,ke]}],"grid-cols":[{"grid-cols":[ko]}],"col-start-end":[{col:["auto",{span:["full",jo,ke]},ke]}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":[ko]}],"row-start-end":[{row:["auto",{span:[jo,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:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],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",ju]}],"font-family":[{font:[ko]}],"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",Ta,ju]}],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":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"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":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),DM]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",PM]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},OM]}],"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:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"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":[x]}],"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":[x]}],"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":[x]}],"ring-offset-w":[{"ring-offset":[lr,Dr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Tr,AM]}],"shadow-color":[{shadow:[ko]}],opacity:[{opacity:[x]}],"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:[g]}],sepia:[{sepia:[j]}],"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":[x]}],"backdrop-saturate":[{"backdrop-saturate":[g]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["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:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[jo,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,ju]}],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"]}}},LM=wM($M);function ve(...e){return LM(zw(e))}const FM=$w("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:ve(FM({variant:t}),e),...n})}const Gf=$w("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},o)=>{const i=r?gE:"button";return a.jsx(i,{className:ve(Gf({variant:t,size:n,className:e})),ref:o,...s})});U.displayName="Button";function BM({children:e}){const t=Ii(),{counts:n,loading:r}=xm(),[s,o]=p.useState(!1),[i,l]=p.useState("v1.0.0");p.useEffect(()=>{const f=u=>{(u.metaKey||u.ctrlKey)&&u.key==="k"&&(u.preventDefault(),o(!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:qC},{name:"Users",href:"/users",icon:Oe,badge:r?"...":c(n.users)},{name:"Organizations",href:"/organizations",icon:ot,badge:r?"...":c(n.organizations)},{name:"Database",href:"/database",icon:qe},{name:"Settings",href:"/settings",icon:Ts}];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:i})]})]})}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(ls,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx("input",{type:"text",placeholder:"Search...",onClick:()=>o(!0),className:"pl-10 pr-4 py-2 bg-black border rounded-none border-gray-600 text-white border-dashed 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(Pa,{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(iM,{isOpen:s,onClose:()=>o(!1)})]})}const St=p.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:ve("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:ve("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:ve("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:ve("text-sm text-gray-300",e),...t}));Un.displayName="CardDescription";const Ct=p.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:ve("p-6 pt-0",e),...t}));Ct.displayName="CardContent";const WM=p.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:ve("flex items-center p-6 pt-0",e),...t}));WM.displayName="CardFooter";function Va({title:e="Seeding Terminal",lines:t,isRunning:n=!1,className:r="",defaultCollapsed:s=!1}){const[o,i]=p.useState(s),l=f=>{switch(f.type){case"success":return a.jsx(ft,{className:"w-3 h-3 text-green-400"});case"error":return a.jsx(ks,{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(ft,{className:"w-3 h-3 text-green-400"}):f.status==="failed"?a.jsx(ks,{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(JC,{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:()=>i(!o),className:"text-gray-400 hover:text-white transition-colors",children:o?a.jsx(id,{className:"w-3 h-3"}):a.jsx(VC,{className:"w-3 h-3"})})]})]}),!o&&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:"█"})})]})]}),!o&&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 Vw=document.createElement("style");Vw.textContent=`
|
|
372
|
-
@keyframes fadeIn {
|
|
373
|
-
from {
|
|
374
|
-
opacity: 0;
|
|
375
|
-
transform: translateX(-10px);
|
|
376
|
-
}
|
|
377
|
-
to {
|
|
378
|
-
opacity: 1;
|
|
379
|
-
transform: translateX(0);
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
.animate-fadeIn {
|
|
384
|
-
animation: fadeIn 0.3s ease-out forwards;
|
|
385
|
-
}
|
|
386
|
-
`;document.head.appendChild(Vw);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 Hw({currentPage:e,totalPages:t,onPageChange:n,totalItems:r,startIndex:s,endIndex:o}){const i=()=>{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=i();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(o,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(Zv,{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(KC,{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(Jv,{className:"w-4 h-4"})]})]})]})}const Fi=p.createContext({isOpen:!1,setIsOpen:()=>{}}),ns=p.forwardRef(({className:e,value:t,onValueChange:n,children:r,...s},o)=>{const[i,l]=p.useState(!1);return a.jsx(Fi.Provider,{value:{value:t,onValueChange:n,isOpen:i,setIsOpen:l},children:a.jsx("div",{ref:o,className:`relative ${e}`,...s,children:r})})});ns.displayName="Select";const rs=p.forwardRef(({className:e,children:t,...n},r)=>{const{isOpen:s,setIsOpen:o}=p.useContext(Fi);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:()=>o(!s),...n,children:[t,a.jsx(id,{className:`h-4 w-4 text-gray-400 transition-transform ${s?"rotate-180":""}`})]})});rs.displayName="SelectTrigger";const mi=p.forwardRef(({className:e,placeholder:t,...n},r)=>{const{value:s}=p.useContext(Fi);return a.jsx("span",{ref:r,className:`text-sm text-white ${e}`,...n,children:s||t})});mi.displayName="SelectValue";const ss=p.forwardRef(({className:e,children:t,...n},r)=>{const{isOpen:s}=p.useContext(Fi);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:o,setIsOpen:i}=p.useContext(Fi);return a.jsx("div",{ref:s,className:`px-3 py-2 text-sm text-white hover:bg-white/10 cursor-pointer ${e}`,onClick:()=>{o==null||o(n),i(!1)},...r,children:t})});Et.displayName="SelectItem";function Yw(){const e=Js(),{refetchCounts:t}=xm(),[n,r]=p.useState([]),[s,o]=p.useState(!0),[i,l]=p.useState(null),[c,d]=p.useState(""),[f,u]=p.useState("all"),[h,m]=p.useState(1),[w]=p.useState(20),[v,b]=p.useState(!1),[x,y]=p.useState(!1),[g,N]=p.useState(!1),[j,k]=p.useState(!1),[S,M]=p.useState(!1),[R,z]=p.useState(!1),[A,O]=p.useState(null),[L,E]=p.useState([]),[$,D]=p.useState(!1),[P,C]=p.useState({name:"",slug:""}),[_,I]=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 ie=F(te);C({name:te,slug:ie})},X=te=>{C(ie=>({...ie,slug:F(te)}))},J=te=>{const ie=F(te);T({name:te,slug:ie})},ee=te=>{T(ie=>({...ie,slug:F(te)}))},K=async()=>{try{const ie=await(await fetch("/api/plugins")).json(),V=(ie==null?void 0:ie.plugins).find(se=>se.id==="organization");l({enabled:!!V,availablePlugins:(ie==null?void 0:ie.plugins).map(se=>se.id),configPath:ie.configPath,organizationPlugin:(ie==null?void 0:ie.plugins).find(se=>se.id==="organization")}),V?await ne():o(!1)}catch(te){console.error("Failed to check plugin status:",te),l({enabled:!1,error:"Failed to check plugin status"}),o(!1)}},ne=async()=>{try{const ie=await(await fetch("/api/organizations?limit=10000")).json();r(ie.organizations||[])}catch(te){console.error("Failed to fetch organizations:",te),q.error("Failed to fetch organizations")}finally{o(!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(ie){E(V=>[...V,{id:"error",type:"error",message:`❌ Network error: ${ie}`,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(ie){E(V=>[...V,{id:"error",type:"error",message:`❌ Network error: ${ie}`,timestamp:new Date}])}finally{D(!1)}},Q=te=>{O(te),M(!0)},Z=te=>{O(te),T({name:te.name,slug:te.slug}),N(!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(ie){console.error("Error creating organization:",ie),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?(y(!1),I({name:"",organizationId:""}),q.success("Team created successfully!",{id:te})):q.error(`Error creating team: ${V.error||"Unknown error"}`,{id:te})}catch(ie){console.error("Error creating team:",ie),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(),N(!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(ie){console.error("Error updating organization:",ie),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(ie){console.error("Error deleting organization:",ie),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"],ie=n.map(be=>[be.id,be.name||"",be.slug||"",new Date(be.createdAt).toLocaleString(),new Date(be.updatedAt).toLocaleString()]),V=[te.join(","),...ie.map(be=>be.map(Ie=>`"${Ie}"`).join(","))].join(`
|
|
387
|
-
`),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`)},ct=n.filter(te=>{var se;const ie=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 ie&&V}),Pt=Math.ceil(ct.length/w),Ae=(h-1)*w,Qe=Ae+w,gt=ct.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..."})]})}):i&&!i.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(ot,{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.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.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"})]})]})]})})]}):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(ew,{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:()=>z(!0),children:[a.jsx(qe,{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:()=>y(!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(ls,{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(pm,{className:"w-4 h-4 text-gray-400"}),a.jsxs(ns,{value:f,onValueChange:u,children:[a.jsx(rs,{children:a.jsx(mi,{})}),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:ct.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(ot,{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:()=>z(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(qe,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):gt.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(ot,{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:ie=>{ie.stopPropagation(),Q(te)},children:a.jsx(zi,{className:"w-4 h-4"})}),a.jsx(U,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:ie=>{ie.stopPropagation(),Z(te)},children:a.jsx(Ws,{className:"w-4 h-4"})}),a.jsx(U,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:ie=>{ie.stopPropagation(),ae(te)},children:a.jsx(Os,{className:"w-4 h-4"})})]})})]},te.id))})]})}),a.jsx(Hw,{currentPage:h,totalPages:Pt,onPageChange:zt,totalItems:ct.length,startIndex:Ae,endIndex:Qe})]}),R&&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:()=>z(!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(ot,{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 ie;const te=parseInt(((ie=document.getElementById("organization-count"))==null?void 0:ie.value)||"5");me(te)},disabled:$,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:$?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(qe,{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 ie;const te=parseInt(((ie=document.getElementById("team-count"))==null?void 0:ie.value)||"5");W(te)},disabled:$,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:$?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(qe,{className:"w-3 h-3 mr-2"}),"Seed Teams"]})})]})]}),L.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(Va,{title:"Organization Seeding Terminal",lines:L,isRunning:$,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:()=>z(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),x&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create Team"}),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",{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=>I(ie=>({...ie,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=>I(ie=>({...ie,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(mi,{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:()=>{y(!1),I({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"})]})]})}),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:"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"})]})]})}),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:"Edit Organization"}),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-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(ot,{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:()=>{N(!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"})]})]})}),j&&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(ot,{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(ot,{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 UM(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 ku={},Oo={};function Ms(e,t){try{const r=(ku[e]||(ku[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in Oo?Oo[r]:eg(r,r.split(":"))}catch{if(e in Oo)return Oo[e];const n=e==null?void 0:e.match(VM);return n?eg(e,n.slice(1)):NaN}}const VM=/([+-]\d\d):?(\d\d)?/;function eg(e,t){const n=+(t[0]||0),r=+(t[1]||0),s=+(t[2]||0)/60;return Oo[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(Ms(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)),Xw(this),Kf(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=-Ms(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Kf(this),+this}[Symbol.for("constructDateFrom")](t){return new Gn(+new Date(t),this.timeZone)}}const tg=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!tg.test(e))return;const t=e.replace(tg,"$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),HM(this),+this},Gn.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Kf(this),+this}))});function Kf(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Ms(e.timeZone,e)*60))}function HM(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()),Xw(e)}function Xw(e){const t=Ms(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(),o=-new Date(+r).getTimezoneOffset(),i=s-o,l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();i&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+i);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(-(Ms(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=Ms(e.timeZone,e),m=h>0?Math.floor(h):Math.ceil(h),v=-new Date(+e).getTimezoneOffset()-m,b=m!==n,x=v-c;if(b&&x){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+x);const y=Ms(e.timeZone,e),g=y>0?Math.floor(y):Math.ceil(y),N=m-g;N&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+N),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+N))}}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} (${UM(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 qw=6048e5,YM=864e5,ng=Symbol.for("constructDateFrom");function pt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&ng in e?e[ng](t):e instanceof Date?new e.constructor(t):new Date(t)}function Le(e,t){return pt(t||e,e)}function Gw(e,t,n){const r=Le(e,n==null?void 0:n.in);return isNaN(t)?pt(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Kw(e,t,n){const r=Le(e,n==null?void 0:n.in);if(isNaN(t))return pt(e,NaN);if(!t)return r;const s=r.getDate(),o=pt(e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const i=o.getDate();return s>=i?o:(r.setFullYear(o.getFullYear(),o.getMonth(),s),r)}let XM={};function Bi(){return XM}function Ha(e,t){var l,c,d,f;const n=Bi(),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),o=s.getDay(),i=(o<r?7:0)+o-r;return s.setDate(s.getDate()-i),s.setHours(0,0,0,0),s}function pi(e,t){return Ha(e,{...t,weekStartsOn:1})}function Qw(e,t){const n=Le(e,t==null?void 0:t.in),r=n.getFullYear(),s=pt(n,0);s.setFullYear(r+1,0,4),s.setHours(0,0,0,0);const o=pi(s),i=pt(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const l=pi(i);return n.getTime()>=o.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function rg(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 lo(e,...t){const n=pt.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function xi(e,t){const n=Le(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Zw(e,t,n){const[r,s]=lo(n==null?void 0:n.in,e,t),o=xi(r),i=xi(s),l=+o-rg(o),c=+i-rg(i);return Math.round((l-c)/YM)}function qM(e,t){const n=Qw(e,t),r=pt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),pi(r)}function GM(e,t,n){return Gw(e,t*7,n)}function KM(e,t,n){return Kw(e,t*12,n)}function QM(e,t){let n,r=t==null?void 0:t.in;return e.forEach(s=>{!r&&typeof s=="object"&&(r=pt.bind(null,s));const o=Le(s,r);(!n||n<o||isNaN(+o))&&(n=o)}),pt(r,n||NaN)}function ZM(e,t){let n,r=t==null?void 0:t.in;return e.forEach(s=>{!r&&typeof s=="object"&&(r=pt.bind(null,s));const o=Le(s,r);(!n||n>o||isNaN(+o))&&(n=o)}),pt(r,n||NaN)}function JM(e,t,n){const[r,s]=lo(n==null?void 0:n.in,e,t);return+xi(r)==+xi(s)}function Jw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function e3(e){return!(!Jw(e)&&typeof e!="number"||isNaN(+Le(e)))}function t3(e,t,n){const[r,s]=lo(n==null?void 0:n.in,e,t),o=r.getFullYear()-s.getFullYear(),i=r.getMonth()-s.getMonth();return o*12+i}function n3(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 eb(e,t){const[n,r]=lo(e,t.start,t.end);return{start:n,end:r}}function r3(e,t){const{start:n,end:r}=eb(t==null?void 0:t.in,e);let s=+n>+r;const o=s?+n:+r,i=s?r:n;i.setHours(0,0,0,0),i.setDate(1);let l=1;const c=[];for(;+i<=o;)c.push(pt(n,i)),i.setMonth(i.getMonth()+l);return s?c.reverse():c}function s3(e,t){const n=Le(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function a3(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 tb(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 o3(e,t){const{start:n,end:r}=eb(t==null?void 0:t.in,e);let s=+n>+r;const o=s?+n:+r,i=s?r:n;i.setHours(0,0,0,0),i.setMonth(0,1);let l=1;const c=[];for(;+i<=o;)c.push(pt(n,i)),i.setFullYear(i.getFullYear()+l);return s?c.reverse():c}function nb(e,t){var l,c,d,f;const n=Bi(),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),o=s.getDay(),i=(o<r?-7:0)+6-(o-r);return s.setDate(s.getDate()+i),s.setHours(23,59,59,999),s}function i3(e,t){return nb(e,{...t,weekStartsOn:1})}const l3={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"}},c3=(e,t,n)=>{let r;const s=l3[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 Su(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const d3={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},u3={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},f3={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},h3={date:Su({formats:d3,defaultWidth:"full"}),time:Su({formats:u3,defaultWidth:"full"}),dateTime:Su({formats:f3,defaultWidth:"full"})},m3={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},p3=(e,t,n,r)=>m3[e];function So(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):i;s=e.formattingValues[l]||e.formattingValues[i]}else{const i=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[l]||e.values[i]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const x3={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},g3={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},y3={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"]},v3={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"]},w3={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"}},b3={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"}},N3=(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"},j3={ordinalNumber:N3,era:So({values:x3,defaultWidth:"wide"}),quarter:So({values:g3,defaultWidth:"wide",argumentCallback:e=>e-1}),month:So({values:y3,defaultWidth:"wide"}),day:So({values:v3,defaultWidth:"wide"}),dayPeriod:So({values:w3,defaultWidth:"wide",formattingValues:b3,defaultFormattingWidth:"wide"})};function Co(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const i=o[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?S3(l,u=>u.test(i)):k3(l,u=>u.test(i));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const f=t.slice(i.length);return{value:d,rest:f}}}function k3(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function S3(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function C3(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],o=t.match(e.parsePattern);if(!o)return null;let i=e.valueCallback?e.valueCallback(o[0]):o[0];i=n.valueCallback?n.valueCallback(i):i;const l=t.slice(s.length);return{value:i,rest:l}}}const E3=/^(\d+)(th|st|nd|rd)?/i,M3=/\d+/i,_3={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},P3={any:[/^b/i,/^(a|c)/i]},D3={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},T3={any:[/1/i,/2/i,/3/i,/4/i]},O3={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},A3={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]},R3={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},I3={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]},z3={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},$3={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}},L3={ordinalNumber:C3({matchPattern:E3,parsePattern:M3,valueCallback:e=>parseInt(e,10)}),era:Co({matchPatterns:_3,defaultMatchWidth:"wide",parsePatterns:P3,defaultParseWidth:"any"}),quarter:Co({matchPatterns:D3,defaultMatchWidth:"wide",parsePatterns:T3,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Co({matchPatterns:O3,defaultMatchWidth:"wide",parsePatterns:A3,defaultParseWidth:"any"}),day:Co({matchPatterns:R3,defaultMatchWidth:"wide",parsePatterns:I3,defaultParseWidth:"any"}),dayPeriod:Co({matchPatterns:z3,defaultMatchWidth:"any",parsePatterns:$3,defaultParseWidth:"any"})},Sm={code:"en-US",formatDistance:c3,formatLong:h3,formatRelative:p3,localize:j3,match:L3,options:{weekStartsOn:0,firstWeekContainsDate:1}};function F3(e,t){const n=Le(e,t==null?void 0:t.in);return Zw(n,tb(n))+1}function rb(e,t){const n=Le(e,t==null?void 0:t.in),r=+pi(n)-+qM(n);return Math.round(r/qw)+1}function sb(e,t){var f,u,h,m;const n=Le(e,t==null?void 0:t.in),r=n.getFullYear(),s=Bi(),o=(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,i=pt((t==null?void 0:t.in)||e,0);i.setFullYear(r+1,0,o),i.setHours(0,0,0,0);const l=Ha(i,t),c=pt((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,o),c.setHours(0,0,0,0);const d=Ha(c,t);return+n>=+l?r+1:+n>=+d?r:r-1}function B3(e,t){var l,c,d,f;const n=Bi(),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=sb(e,t),o=pt((t==null?void 0:t.in)||e,0);return o.setFullYear(s,0,r),o.setHours(0,0,0,0),Ha(o,t)}function ab(e,t){const n=Le(e,t==null?void 0:t.in),r=+Ha(n,t)-+B3(n,t);return Math.round(r/qw)+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)}},aa={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sg={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=sb(e,r),o=s>0?s:1-s;if(t==="YY"){const i=o%100;return ze(i,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):ze(o,t.length)},R:function(e,t){const n=Qw(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=ab(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):ze(s,t.length)},I:function(e,t,n){const r=rb(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=F3(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(),o=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return ze(o,2);case"eo":return n.ordinalNumber(o,{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(),o=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return ze(o,t.length);case"co":return n.ordinalNumber(o,{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=aa.noon:r===0?s=aa.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=aa.evening:r>=12?s=aa.afternoon:r>=4?s=aa.morning:s=aa.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 og(r);case"XXXX":case"XX":return Ns(r);case"XXXXX":case"XXX":default:return Ns(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return og(r);case"xxxx":case"xx":return Ns(r);case"xxxxx":case"xxx":default:return Ns(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ag(r,":");case"OOOO":default:return"GMT"+Ns(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ag(r,":");case"zzzz":default:return"GMT"+Ns(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 ag(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),o=r%60;return o===0?n+String(s):n+String(s)+t+ze(o,2)}function og(e,t){return e%60===0?(e>0?"-":"+")+ze(Math.abs(e)/60,2):Ns(e,t)}function Ns(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=ze(Math.trunc(r/60),2),o=ze(r%60,2);return n+s+t+o}const ig=(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"})}},ob=(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"})}},W3=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return ig(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",ig(r,t)).replace("{{time}}",ob(s,t))},U3={p:ob,P:W3},V3=/^D+$/,H3=/^Y+$/,Y3=["D","DD","YY","YYYY"];function X3(e){return V3.test(e)}function q3(e){return H3.test(e)}function G3(e,t,n){const r=K3(e,t,n);if(console.warn(r),Y3.includes(e))throw new RangeError(r)}function K3(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 Q3=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Z3=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J3=/^'([^]*?)'?$/,e_=/''/g,t_=/[a-zA-Z]/;function n_(e,t,n){var f,u,h,m,w,v,b,x;const r=Bi(),s=(n==null?void 0:n.locale)??r.locale??Sm,o=(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,i=(n==null?void 0:n.weekStartsOn)??((v=(w=n==null?void 0:n.locale)==null?void 0:w.options)==null?void 0:v.weekStartsOn)??r.weekStartsOn??((x=(b=r.locale)==null?void 0:b.options)==null?void 0:x.weekStartsOn)??0,l=Le(e,n==null?void 0:n.in);if(!e3(l))throw new RangeError("Invalid time value");let c=t.match(Z3).map(y=>{const g=y[0];if(g==="p"||g==="P"){const N=U3[g];return N(y,s.formatLong)}return y}).join("").match(Q3).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const g=y[0];if(g==="'")return{isToken:!1,value:r_(y)};if(sg[g])return{isToken:!0,value:y};if(g.match(t_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:y}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const d={firstWeekContainsDate:o,weekStartsOn:i,locale:s};return c.map(y=>{if(!y.isToken)return y.value;const g=y.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&q3(g)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&X3(g))&&G3(g,t,String(e));const N=sg[g[0]];return N(l,g,s.localize,d)}).join("")}function r_(e){const t=e.match(J3);return t?t[1].replace(e_,"'"):e}function s_(e,t){const n=Le(e,t==null?void 0:t.in),r=n.getFullYear(),s=n.getMonth(),o=pt(n,0);return o.setFullYear(r,s+1,0),o.setHours(0,0,0,0),o.getDate()}function a_(e,t){return Le(e,t==null?void 0:t.in).getMonth()}function o_(e,t){return Le(e,t==null?void 0:t.in).getFullYear()}function i_(e,t){return+Le(e)>+Le(t)}function l_(e,t){return+Le(e)<+Le(t)}function c_(e,t,n){const[r,s]=lo(n==null?void 0:n.in,e,t);return r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()}function d_(e,t,n){const[r,s]=lo(n==null?void 0:n.in,e,t);return r.getFullYear()===s.getFullYear()}function u_(e,t,n){const r=Le(e,n==null?void 0:n.in),s=r.getFullYear(),o=r.getDate(),i=pt(e,0);i.setFullYear(s,t,15),i.setHours(0,0,0,0);const l=s_(i);return r.setMonth(t,Math.min(o,l)),r}function f_(e,t,n){const r=Le(e,n==null?void 0:n.in);return isNaN(+r)?pt(e,NaN):(r.setFullYear(t),r)}const lg=5,h_=4;function m_(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,s=t.addDays(e,-r+1),o=t.addDays(s,lg*7-1);return t.getMonth(e)===t.getMonth(o)?lg:h_}function ib(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 p_(e,t){const n=ib(e,t),r=m_(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,o)=>{var i;return(i=this.overrides)!=null&&i.newDate?this.overrides.newDate(r,s,o):this.options.timeZone?new Ot(r,s,o,this.options.timeZone):new Date(r,s,o)},this.addDays=(r,s)=>{var o;return(o=this.overrides)!=null&&o.addDays?this.overrides.addDays(r,s):Gw(r,s)},this.addMonths=(r,s)=>{var o;return(o=this.overrides)!=null&&o.addMonths?this.overrides.addMonths(r,s):Kw(r,s)},this.addWeeks=(r,s)=>{var o;return(o=this.overrides)!=null&&o.addWeeks?this.overrides.addWeeks(r,s):GM(r,s)},this.addYears=(r,s)=>{var o;return(o=this.overrides)!=null&&o.addYears?this.overrides.addYears(r,s):KM(r,s)},this.differenceInCalendarDays=(r,s)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,s):Zw(r,s)},this.differenceInCalendarMonths=(r,s)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,s):t3(r,s)},this.eachMonthOfInterval=r=>{var s;return(s=this.overrides)!=null&&s.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):r3(r)},this.eachYearOfInterval=r=>{var l;const s=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(r):o3(r),o=new Set(s.map(c=>this.getYear(c)));if(o.size===s.length)return s;const i=[];return o.forEach(c=>{i.push(new Date(c,0,1))}),i},this.endOfBroadcastWeek=r=>{var s;return(s=this.overrides)!=null&&s.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):p_(r,this)},this.endOfISOWeek=r=>{var s;return(s=this.overrides)!=null&&s.endOfISOWeek?this.overrides.endOfISOWeek(r):i3(r)},this.endOfMonth=r=>{var s;return(s=this.overrides)!=null&&s.endOfMonth?this.overrides.endOfMonth(r):n3(r)},this.endOfWeek=(r,s)=>{var o;return(o=this.overrides)!=null&&o.endOfWeek?this.overrides.endOfWeek(r,s):nb(r,this.options)},this.endOfYear=r=>{var s;return(s=this.overrides)!=null&&s.endOfYear?this.overrides.endOfYear(r):a3(r)},this.format=(r,s,o)=>{var l;const i=(l=this.overrides)!=null&&l.format?this.overrides.format(r,s,this.options):n_(r,s,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(i):i},this.getISOWeek=r=>{var s;return(s=this.overrides)!=null&&s.getISOWeek?this.overrides.getISOWeek(r):rb(r)},this.getMonth=(r,s)=>{var o;return(o=this.overrides)!=null&&o.getMonth?this.overrides.getMonth(r,this.options):a_(r,this.options)},this.getYear=(r,s)=>{var o;return(o=this.overrides)!=null&&o.getYear?this.overrides.getYear(r,this.options):o_(r,this.options)},this.getWeek=(r,s)=>{var o;return(o=this.overrides)!=null&&o.getWeek?this.overrides.getWeek(r,this.options):ab(r,this.options)},this.isAfter=(r,s)=>{var o;return(o=this.overrides)!=null&&o.isAfter?this.overrides.isAfter(r,s):i_(r,s)},this.isBefore=(r,s)=>{var o;return(o=this.overrides)!=null&&o.isBefore?this.overrides.isBefore(r,s):l_(r,s)},this.isDate=r=>{var s;return(s=this.overrides)!=null&&s.isDate?this.overrides.isDate(r):Jw(r)},this.isSameDay=(r,s)=>{var o;return(o=this.overrides)!=null&&o.isSameDay?this.overrides.isSameDay(r,s):JM(r,s)},this.isSameMonth=(r,s)=>{var o;return(o=this.overrides)!=null&&o.isSameMonth?this.overrides.isSameMonth(r,s):c_(r,s)},this.isSameYear=(r,s)=>{var o;return(o=this.overrides)!=null&&o.isSameYear?this.overrides.isSameYear(r,s):d_(r,s)},this.max=r=>{var s;return(s=this.overrides)!=null&&s.max?this.overrides.max(r):QM(r)},this.min=r=>{var s;return(s=this.overrides)!=null&&s.min?this.overrides.min(r):ZM(r)},this.setMonth=(r,s)=>{var o;return(o=this.overrides)!=null&&o.setMonth?this.overrides.setMonth(r,s):u_(r,s)},this.setYear=(r,s)=>{var o;return(o=this.overrides)!=null&&o.setYear?this.overrides.setYear(r,s):f_(r,s)},this.startOfBroadcastWeek=(r,s)=>{var o;return(o=this.overrides)!=null&&o.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):ib(r,this)},this.startOfDay=r=>{var s;return(s=this.overrides)!=null&&s.startOfDay?this.overrides.startOfDay(r):xi(r)},this.startOfISOWeek=r=>{var s;return(s=this.overrides)!=null&&s.startOfISOWeek?this.overrides.startOfISOWeek(r):pi(r)},this.startOfMonth=r=>{var s;return(s=this.overrides)!=null&&s.startOfMonth?this.overrides.startOfMonth(r):s3(r)},this.startOfWeek=(r,s)=>{var o;return(o=this.overrides)!=null&&o.startOfWeek?this.overrides.startOfWeek(r,this.options):Ha(r,this.options)},this.startOfYear=r=>{var s;return(s=this.overrides)!=null&&s.startOfYear?this.overrides.startOfYear(r):tb(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,o=n==null?void 0:n.code;if(o&&ln.yearFirstLocales.has(o))try{return new Intl.DateTimeFormat(o,{month:"long",year:"numeric",timeZone:r,numberingSystem:s}).format(t)}catch{}const i=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,i)}}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 lb{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 x_{constructor(t,n){this.date=t,this.weeks=n}}class g_{constructor(t,n){this.days=n,this.weekNumber=t}}function y_(e){return Y.createElement("button",{...e})}function v_(e){return Y.createElement("span",{...e})}function w_(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 b_(e){const{day:t,modifiers:n,...r}=e;return Y.createElement("td",{...r})}function N_(e){const{day:t,modifiers:n,...r}=e,s=Y.useRef(null);return Y.useEffect(()=>{var o;n.focused&&((o=s.current)==null||o.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 j_(e){const{options:t,className:n,components:r,classNames:s,...o}=e,i=[s[xe.Dropdown],n].join(" "),l=t==null?void 0:t.find(({value:c})=>c===o.value);return Y.createElement("span",{"data-disabled":o.disabled,className:s[xe.DropdownRoot]},Y.createElement(r.Select,{className:i,...o},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 k_(e){return Y.createElement("div",{...e})}function S_(e){return Y.createElement("div",{...e})}function C_(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Y.createElement("div",{...r},e.children)}function E_(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Y.createElement("div",{...r})}function M_(e){return Y.createElement("table",{...e})}function __(e){return Y.createElement("div",{...e})}const cb=p.createContext(void 0);function Wi(){const e=p.useContext(cb);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function P_(e){const{components:t}=Wi();return Y.createElement(t.Dropdown,{...e})}function D_(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:s,...o}=e,{components:i,classNames:l,labels:{labelPrevious:c,labelNext:d}}=Wi(),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",{...o},Y.createElement(i.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(i.Chevron,{disabled:r?void 0:!0,className:l[xe.Chevron],orientation:"left"})),Y.createElement(i.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(i.Chevron,{disabled:s?void 0:!0,orientation:"right",className:l[xe.Chevron]})))}function T_(e){const{components:t}=Wi();return Y.createElement(t.Button,{...e})}function O_(e){return Y.createElement("option",{...e})}function A_(e){const{components:t}=Wi();return Y.createElement(t.Button,{...e})}function R_(e){const{rootRef:t,...n}=e;return Y.createElement("div",{...n,ref:t})}function I_(e){return Y.createElement("select",{...e})}function z_(e){const{week:t,...n}=e;return Y.createElement("tr",{...n})}function $_(e){return Y.createElement("th",{...e})}function L_(e){return Y.createElement("thead",{"aria-hidden":!0},Y.createElement("tr",{...e}))}function F_(e){const{week:t,...n}=e;return Y.createElement("th",{...n})}function B_(e){return Y.createElement("th",{...e})}function W_(e){return Y.createElement("tbody",{...e})}function U_(e){const{components:t}=Wi();return Y.createElement(t.Dropdown,{...e})}const V_=Object.freeze(Object.defineProperty({__proto__:null,Button:y_,CaptionLabel:v_,Chevron:w_,Day:b_,DayButton:N_,Dropdown:j_,DropdownNav:k_,Footer:S_,Month:C_,MonthCaption:E_,MonthGrid:M_,Months:__,MonthsDropdown:P_,Nav:D_,NextMonthButton:T_,Option:O_,PreviousMonthButton:A_,Root:R_,Select:I_,Week:z_,WeekNumber:F_,WeekNumberHeader:B_,Weekday:$_,Weekdays:L_,Weeks:W_,YearsDropdown:U_},Symbol.toStringTag,{value:"Module"}));function xr(e,t,n=!1,r=rr){let{from:s,to:o}=e;const{differenceInCalendarDays:i,isSameDay:l}=r;return s&&o?(i(o,s)<0&&([s,o]=[o,s]),i(t,s)>=(n?1:0)&&i(o,t)>=(n?1:0)):!n&&o?l(o,t):!n&&s?l(s,t):!1}function db(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Cm(e){return!!(e&&typeof e=="object"&&"from"in e)}function ub(e){return!!(e&&typeof e=="object"&&"after"in e)}function fb(e){return!!(e&&typeof e=="object"&&"before"in e)}function hb(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function mb(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:o,isAfter:i}=n;return r.some(l=>{if(typeof l=="boolean")return l;if(n.isDate(l))return s(e,l);if(mb(l,n))return l.includes(e);if(Cm(l))return xr(l,e,!1,n);if(hb(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(db(l)){const c=o(l.before,e),d=o(l.after,e),f=c>0,u=d<0;return i(l.before,l.after)?u&&f:f||u}return ub(l)?o(e,l.after)>0:fb(l)?o(l.before,e)>0:typeof l=="function"?l(e):!1})}function H_(e,t,n,r,s){const{disabled:o,hidden:i,modifiers:l,showOutsideDays:c,broadcastCalendar:d,today:f}=t,{isSameDay:u,isSameMonth:h,startOfMonth:m,isBefore:w,endOfMonth:v,isAfter:b}=s,x=n&&m(n),y=r&&v(r),g={[et.focused]:[],[et.outside]:[],[et.disabled]:[],[et.hidden]:[],[et.today]:[]},N={};for(const j of e){const{date:k,displayMonth:S}=j,M=!!(S&&!h(k,S)),R=!!(x&&w(k,x)),z=!!(y&&b(k,y)),A=!!(o&&gr(k,o,s)),O=!!(i&&gr(k,i,s))||R||z||!d&&!c&&M||d&&c===!1&&M,L=u(k,f??s.today());M&&g.outside.push(j),A&&g.disabled.push(j),O&&g.hidden.push(j),L&&g.today.push(j),l&&Object.keys(l).forEach(E=>{const $=l==null?void 0:l[E];$&&gr(k,$,s)&&(N[E]?N[E].push(j):N[E]=[j])})}return j=>{const k={[et.focused]:!1,[et.disabled]:!1,[et.hidden]:!1,[et.outside]:!1,[et.today]:!1},S={};for(const M in g){const R=g[M];k[M]=R.some(z=>z===j)}for(const M in N)S[M]=N[M].some(R=>R===j);return{...k,...S}}}function Y_(e,t,n={}){return Object.entries(e).filter(([,s])=>s===!0).reduce((s,[o])=>(n[o]?s.push(n[o]):t[et[o]]?s.push(t[et[o]]):t[Mn[o]]&&s.push(t[Mn[o]]),s),[t[xe.Day]])}function X_(e){return{...V_,...e}}function q_(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 pb(e,t,n){return(n??new ln(t)).formatMonthYear(e)}const G_=pb;function K_(e,t,n){return(n??new ln(t)).format(e,"d")}function Q_(e,t=rr){return t.format(e,"LLLL")}function Z_(e,t,n){return(n??new ln(t)).format(e,"cccccc")}function J_(e,t=rr){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function eP(){return""}function xb(e,t=rr){return t.format(e,"yyyy")}const tP=xb,nP=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:pb,formatDay:K_,formatMonthCaption:G_,formatMonthDropdown:Q_,formatWeekNumber:J_,formatWeekNumberHeader:eP,formatWeekdayName:Z_,formatYearCaption:tP,formatYearDropdown:xb},Symbol.toStringTag,{value:"Module"}));function rP(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...nP,...e}}function sP(e,t,n,r,s){const{startOfMonth:o,startOfYear:i,endOfYear:l,eachMonthOfInterval:c,getMonth:d}=s;return c({start:i(e),end:l(e)}).map(h=>{const m=r.formatMonthDropdown(h,s),w=d(h),v=t&&h<o(t)||n&&h>o(n)||!1;return{value:w,label:m,disabled:v}})}function aP(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 oP(e,t,n){const r=e.today(),s=t?e.startOfISOWeek(r):e.startOfWeek(r),o=[];for(let i=0;i<7;i++){const l=e.addDays(s,i);o.push(l)}return o}function iP(e,t,n,r,s=!1){if(!e||!t)return;const{startOfYear:o,endOfYear:i,eachYearOfInterval:l,getYear:c}=r,d=o(e),f=i(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 gb(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 lP=gb;function yb(e,t,n){return(n??new ln(t)).formatMonthYear(e)}const cP=yb;function dP(e,t,n,r){let s=(r??new ln(n)).format(e,"PPPP");return t!=null&&t.today&&(s=`Today, ${s}`),s}function uP(e){return"Choose the Month"}function fP(){return""}function hP(e){return"Go to the Next Month"}function mP(e){return"Go to the Previous Month"}function pP(e,t,n){return(n??new ln(t)).format(e,"cccc")}function xP(e,t){return`Week ${e}`}function gP(e){return"Week Number"}function yP(e){return"Choose the Year"}const vP=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:cP,labelDay:lP,labelDayButton:gb,labelGrid:yb,labelGridcell:dP,labelMonthDropdown:uP,labelNav:fP,labelNext:hP,labelPrevious:mP,labelWeekNumber:xP,labelWeekNumberHeader:gP,labelWeekday:pP,labelYearDropdown:yP},Symbol.toStringTag,{value:"Module"})),Ui=e=>e instanceof HTMLElement?e:null,Cu=e=>[...e.querySelectorAll("[data-animated-month]")??[]],wP=e=>Ui(e.querySelector("[data-animated-month]")),Eu=e=>Ui(e.querySelector("[data-animated-caption]")),Mu=e=>Ui(e.querySelector("[data-animated-weeks]")),bP=e=>Ui(e.querySelector("[data-animated-nav]")),NP=e=>Ui(e.querySelector("[data-animated-weekdays]"));function jP(e,t,{classNames:n,months:r,focused:s,dateLib:o}){const i=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=o.isSameMonth(r[0].date,d[0].date),u=o.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=i.current,v=e.current.cloneNode(!0);if(v instanceof HTMLElement?(Cu(v).forEach(g=>{if(!(g instanceof HTMLElement))return;const N=wP(g);N&&g.contains(N)&&g.removeChild(N);const j=Eu(g);j&&j.classList.remove(h);const k=Mu(g);k&&k.classList.remove(m)}),i.current=v):i.current=null,c.current||f||s)return;const b=w instanceof HTMLElement?Cu(w):[],x=Cu(e.current);if(x!=null&&x.every(y=>y instanceof HTMLElement)&&b&&b.every(y=>y instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const y=bP(e.current);y&&(y.style.zIndex="1"),x.forEach((g,N)=>{const j=b[N];if(!j)return;g.style.position="relative",g.style.overflow="hidden";const k=Eu(g);k&&k.classList.add(h);const S=Mu(g);S&&S.classList.add(m);const M=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),y&&(y.style.zIndex=""),k&&k.classList.remove(h),S&&S.classList.remove(m),g.style.position="",g.style.overflow="",g.contains(j)&&g.removeChild(j)};j.style.pointerEvents="none",j.style.position="absolute",j.style.overflow="hidden",j.setAttribute("aria-hidden","true");const R=NP(j);R&&(R.style.opacity="0");const z=Eu(j);z&&(z.classList.add(u?n[en.caption_before_exit]:n[en.caption_after_exit]),z.addEventListener("animationend",M));const A=Mu(j);A&&A.classList.add(u?n[en.weeks_before_exit]:n[en.weeks_after_exit]),g.insertBefore(j,g.firstChild)})}})}function kP(e,t,n,r){const s=e[0],o=e[e.length-1],{ISOWeek:i,fixedWeeks:l,broadcastCalendar:c}=n??{},{addDays:d,differenceInCalendarDays:f,differenceInCalendarMonths:u,endOfBroadcastWeek:h,endOfISOWeek:m,endOfMonth:w,endOfWeek:v,isAfter:b,startOfBroadcastWeek:x,startOfISOWeek:y,startOfWeek:g}=r,N=c?x(s,r):i?y(s):g(s),j=c?h(o):i?m(w(o)):v(w(o)),k=f(j,N),S=u(o,s)+1,M=[];for(let A=0;A<=k;A++){const O=d(N,A);if(t&&b(O,t))break;M.push(O)}const z=(c?35:42)*S;if(l&&M.length<z){const A=z-M.length;for(let O=0;O<A;O++){const L=d(M[M.length-1],1);M.push(L)}}return M}function SP(e){const t=[];return e.reduce((n,r)=>{const s=r.weeks.reduce((o,i)=>o.concat(i.days.slice()),t.slice());return n.concat(s.slice())},t.slice())}function CP(e,t,n,r){const{numberOfMonths:s=1}=n,o=[];for(let i=0;i<s;i++){const l=r.addMonths(e,i);if(t&&l>t)break;o.push(l)}return o}function cg(e,t,n,r){const{month:s,defaultMonth:o,today:i=r.today(),numberOfMonths:l=1}=e;let c=s||o||i;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 EP(e,t,n,r){const{addDays:s,endOfBroadcastWeek:o,endOfISOWeek:i,endOfMonth:l,endOfWeek:c,getISOWeek:d,getWeek:f,startOfBroadcastWeek:u,startOfISOWeek:h,startOfWeek:m}=r,w=e.reduce((v,b)=>{const x=n.broadcastCalendar?u(b,r):n.ISOWeek?h(b):m(b),y=n.broadcastCalendar?o(b):n.ISOWeek?i(l(b)):c(l(b)),g=t.filter(S=>S>=x&&S<=y),N=n.broadcastCalendar?35:42;if(n.fixedWeeks&&g.length<N){const S=t.filter(M=>{const R=N-g.length;return M>y&&M<=s(y,R)});g.push(...S)}const j=g.reduce((S,M)=>{const R=n.ISOWeek?d(M):f(M),z=S.find(O=>O.weekNumber===R),A=new lb(M,b,r);return z?z.days.push(A):S.push(new g_(R,[A])),S},[]),k=new x_(b,j);return v.push(k),v},[]);return n.reverseMonths?w.reverse():w}function MP(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:s,startOfDay:o,startOfMonth:i,endOfMonth:l,addYears:c,endOfYear:d,newDate:f,today:u}=t,{fromYear:h,toYear:m,fromMonth:w,toMonth:v}=e;!n&&w&&(n=w),!n&&h&&(n=t.newDate(h,0,1)),!r&&v&&(r=v),!r&&m&&(r=f(m,11,31));const b=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=i(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&&o(n),r&&o(r)]}function _P(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:o=1}=n,{startOfMonth:i,addMonths:l,differenceInCalendarMonths:c}=r,d=s?o:1,f=i(e);if(!t)return l(f,d);if(!(c(t,e)<o))return l(f,d)}function PP(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:o}=n,{startOfMonth:i,addMonths:l,differenceInCalendarMonths:c}=r,d=s?o??1:1,f=i(e);if(!t)return l(f,-d);if(!(c(f,t)<=0))return l(f,-d)}function DP(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function md(e,t){const[n,r]=p.useState(e);return[t===void 0?n:t,r]}function TP(e,t){const[n,r]=MP(e,t),{startOfMonth:s,endOfMonth:o}=t,i=cg(e,n,r,t),[l,c]=md(i,e.month?i:void 0);p.useEffect(()=>{const k=cg(e,n,r,t);c(k)},[e.timeZone]);const d=CP(l,r,e,t),f=kP(d,e.endMonth?o(e.endMonth):void 0,e,t),u=EP(d,f,e,t),h=DP(u),m=SP(u),w=PP(l,n,e,t),v=_P(l,r,e,t),{disableNavigation:b,onMonthChange:x}=e,y=k=>h.some(S=>S.days.some(M=>M.isEqualTo(k))),g=k=>{if(b)return;let S=s(k);n&&S<s(n)&&(S=s(n)),r&&S>s(r)&&(S=s(r)),c(S),x==null||x(S)};return{months:u,weeks:h,days:m,navStart:n,navEnd:r,previousMonth:w,nextMonth:v,goToMonth:g,goToDay:k=>{y(k)||g(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 dg(e){return!e[et.disabled]&&!e[et.hidden]&&!e[et.outside]}function OP(e,t,n,r){let s,o=-1;for(const i of e){const l=t(i);dg(l)&&(l[et.focused]&&o<Hn.FocusedModifier?(s=i,o=Hn.FocusedModifier):r!=null&&r.isEqualTo(i)&&o<Hn.LastFocused?(s=i,o=Hn.LastFocused):n(i.date)&&o<Hn.Selected?(s=i,o=Hn.Selected):l[et.today]&&o<Hn.Today&&(s=i,o=Hn.Today))}return s||(s=e.find(i=>dg(t(i)))),s}function AP(e,t,n,r,s,o,i){const{ISOWeek:l,broadcastCalendar:c}=o,{addDays:d,addMonths:f,addWeeks:u,addYears:h,endOfBroadcastWeek:m,endOfISOWeek:w,endOfWeek:v,max:b,min:x,startOfBroadcastWeek:y,startOfISOWeek:g,startOfWeek:N}=i;let k={day:d,week:u,month:f,year:h,startOfWeek:S=>c?y(S,i):l?g(S):N(S),endOfWeek:S=>c?m(S):l?w(S):v(S)}[e](n,t==="after"?1:-1);return t==="before"&&r?k=b([r,k]):t==="after"&&s&&(k=x([s,k])),k}function vb(e,t,n,r,s,o,i,l=0){if(l>365)return;const c=AP(e,t,n.date,r,s,o,i),d=!!(o.disabled&&gr(c,o.disabled,i)),f=!!(o.hidden&&gr(c,o.hidden,i)),u=c,h=new lb(c,u,i);return!d&&!f?h:vb(e,t,h,r,s,o,i,l+1)}function RP(e,t,n,r,s){const{autoFocus:o}=e,[i,l]=p.useState(),c=OP(t.days,n,r||(()=>!1),i),[d,f]=p.useState(o?c:void 0);return{isFocusTarget:v=>!!(c!=null&&c.isEqualTo(v)),setFocused:f,focused:d,blur:()=>{l(d),f(void 0)},moveFocus:(v,b)=>{if(!d)return;const x=vb(v,b,d,t.navStart,t.navEnd,e,s);x&&(e.disableNavigation&&!t.days.some(g=>g.isEqualTo(x))||(t.goToDay(x),f(x)))}}}function IP(e,t){const{selected:n,required:r,onSelect:s}=e,[o,i]=md(n,s?n:void 0),l=s?n:o,{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,v)=>{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(x=>!c(x,m))}else(l==null?void 0:l.length)===u?b=[m]:b=[...b,m];return s||i(b),s==null||s(b,m,w,v),b},isSelected:d}}function zP(e,t,n=0,r=0,s=!1,o=rr){const{from:i,to:l}=t||{},{isSameDay:c,isAfter:d,isBefore:f}=o;let u;if(!i&&!l)u={from:e,to:n>0?void 0:e};else if(i&&!l)c(i,e)?n===0?u={from:i,to:e}:s?u={from:i,to:void 0}:u=void 0:f(e,i)?u={from:e,to:i}:u={from:i,to:e};else if(i&&l)if(c(i,e)&&c(l,e))s?u={from:i,to:l}:u=void 0;else if(c(i,e))u={from:i,to:n>0?void 0:e};else if(c(l,e))u={from:e,to:n>0?void 0:e};else if(f(e,i))u={from:e,to:l};else if(d(e,i))u={from:i,to:e};else if(d(e,l))u={from:i,to:e};else throw new Error("Invalid range");if(u!=null&&u.from&&(u!=null&&u.to)){const h=o.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 $P(e,t,n=rr){const r=Array.isArray(t)?t:[t];let s=e.from;const o=n.differenceInCalendarDays(e.to,e.from),i=Math.min(o,6);for(let l=0;l<=i;l++){if(r.includes(s.getDay()))return!0;s=n.addDays(s,1)}return!1}function ug(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 LP(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):mb(l,n)?l.some(c=>xr(e,c,!1,n)):Cm(l)?l.from&&l.to?ug(e,{from:l.from,to:l.to},n):!1:hb(l)?$P(e,l.dayOfWeek,n):db(l)?n.isAfter(l.before,l.after)?ug(e,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):gr(e.from,l,n)||gr(e.to,l,n):ub(l)||fb(l)?gr(e.from,l,n)||gr(e.to,l,n):!1))return!0;const i=r.filter(l=>typeof l=="function");if(i.length){let l=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let d=0;d<=c;d++){if(i.some(f=>f(l)))return!0;l=n.addDays(l,1)}}return!1}function FP(e,t){const{disabled:n,excludeDisabled:r,selected:s,required:o,onSelect:i}=e,[l,c]=md(s,i?s:void 0),d=i?s:l;return{selected:d,select:(h,m,w)=>{const{min:v,max:b}=e,x=h?zP(h,d,v,b,o,t):void 0;return r&&n&&(x!=null&&x.from)&&x.to&&LP({from:x.from,to:x.to},n,t)&&(x.from=h,x.to=void 0),i||c(x),i==null||i(x,h,m,w),x},isSelected:h=>d&&xr(d,h,!1,t)}}function BP(e,t){const{selected:n,required:r,onSelect:s}=e,[o,i]=md(n,s?n:void 0),l=s?n:o,{isSameDay:c}=t;return{selected:l,select:(u,h,m)=>{let w=u;return!r&&l&&l&&c(u,l)&&(w=void 0),s||i(w),s==null||s(w,u,h,m),w},isSelected:u=>l?c(l,u):!1}}function WP(e,t){const n=BP(e,t),r=IP(e,t),s=FP(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return s;default:return}}function UP(e){var dt;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=(dt=t.selected)==null?void 0:dt.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:o,locale:i,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:X_(t.components),formatters:rP(t.formatters),labels:{...vP,...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:v,onDayMouseEnter:b,onDayMouseLeave:x,onNextClick:y,onPrevClick:g,showWeekNumber:N,styles:j}=t,{formatCaption:k,formatDay:S,formatMonthDropdown:M,formatWeekNumber:R,formatWeekNumberHeader:z,formatWeekdayName:A,formatYearDropdown:O}=r,L=TP(t,o),{days:E,months:$,navStart:D,navEnd:P,previousMonth:C,nextMonth:_,goToMonth:I}=L,B=H_(E,t,D,P,o),{isSelected:T,select:F,selected:H}=WP(t,o)??{},{blur:X,focused:J,isFocusTarget:ee,moveFocus:K,setFocused:ne}=RP(t,L,B,T??(()=>!1),o),{labelDayButton:me,labelGridcell:W,labelGrid:Q,labelMonthDropdown:Z,labelNav:ae,labelPrevious:fe,labelNext:pe,labelWeekday:Se,labelWeekNumber:Xe,labelWeekNumberHeader:Pe,labelYearDropdown:ct}=s,Pt=p.useMemo(()=>oP(o,t.ISOWeek),[o,t.ISOWeek]),Ae=d!==void 0||m!==void 0,Qe=p.useCallback(()=>{C&&(I(C),g==null||g(C))},[C,I,g]),gt=p.useCallback(()=>{_&&(I(_),y==null||y(_))},[I,_,y]),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]),ie=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,oe]=Re[Ne.key];K(wt,oe)}v==null||v(ce.date,Me,Ne)},[K,v,t.dir]),se=p.useCallback((ce,Me)=>Ne=>{b==null||b(ce.date,Me,Ne)},[b]),he=p.useCallback((ce,Me)=>Ne=>{x==null||x(ce.date,Me,Ne)},[x]),de=p.useCallback(ce=>Me=>{const Ne=Number(Me.target.value),Re=o.setMonth(o.startOfMonth(ce),Ne);I(Re)},[o,I]),be=p.useCallback(ce=>Me=>{const Ne=Number(Me.target.value),Re=o.setYear(o.startOfMonth(ce),Ne);I(Re)},[o,I]),{className:Ie,style:G}=p.useMemo(()=>({className:[l[xe.Root],t.className].filter(Boolean).join(" "),style:{...j==null?void 0:j[xe.Root],...t.style}}),[l,t.className,t.style,j]),le=q_(t),ge=p.useRef(null);jP(ge,!!t.animate,{classNames:l,months:$,focused:J,dateLib:o});const Ue={dayPickerProps:t,selected:H,select:F,isSelected:T,months:$,nextMonth:_,previousMonth:C,goToMonth:I,getModifiers:B,components:n,classNames:l,styles:j,labels:s,formatters:r};return Y.createElement(cb.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:j==null?void 0:j[xe.Months]},!t.hideNavigation&&!f&&Y.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[xe.Nav],style:j==null?void 0:j[xe.Nav],"aria-label":ae(),onPreviousClick:Qe,onNextClick:gt,previousMonth:C,nextMonth:_}),$.map((ce,Me)=>Y.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:l[xe.Month],style:j==null?void 0:j[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:j==null?void 0:j[xe.MonthCaption],calendarMonth:ce,displayIndex:Me},c!=null&&c.startsWith("dropdown")?Y.createElement(n.DropdownNav,{className:l[xe.Dropdowns],style:j==null?void 0:j[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:sP(ce.date,D,P,r,o),style:j==null?void 0:j[xe.Dropdown],value:o.getMonth(ce.date)}):Y.createElement("span",{key:"month"},M(ce.date,o)),Re=c==="dropdown"||c==="dropdown-years"?Y.createElement(n.YearsDropdown,{key:"year",className:l[xe.YearsDropdown],"aria-label":ct(o.options),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:be(ce.date),options:iP(D,P,r,o,!!t.reverseYears),style:j==null?void 0:j[xe.Dropdown],value:o.getYear(ce.date)}):Y.createElement("span",{key:"year"},O(ce.date,o));return o.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,o.options,o))):Y.createElement(n.CaptionLabel,{className:l[xe.CaptionLabel],role:"status","aria-live":"polite"},k(ce.date,o.options,o))),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:gt,"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:j==null?void 0:j[xe.Nav],"aria-label":ae(),onPreviousClick:Qe,onNextClick:gt,previousMonth:C,nextMonth:_}),Y.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":Q(ce.date,o.options,o)||void 0,className:l[xe.MonthGrid],style:j==null?void 0:j[xe.MonthGrid]},!t.hideWeekdays&&Y.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:l[xe.Weekdays],style:j==null?void 0:j[xe.Weekdays]},N&&Y.createElement(n.WeekNumberHeader,{"aria-label":Pe(o.options),className:l[xe.WeekNumberHeader],style:j==null?void 0:j[xe.WeekNumberHeader],scope:"col"},z()),Pt.map(Ne=>Y.createElement(n.Weekday,{"aria-label":Se(Ne,o.options,o),className:l[xe.Weekday],key:String(Ne),style:j==null?void 0:j[xe.Weekday],scope:"col"},A(Ne,o.options,o)))),Y.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:l[xe.Weeks],style:j==null?void 0:j[xe.Weeks]},ce.weeks.map(Ne=>Y.createElement(n.Week,{className:l[xe.Week],key:Ne.weekNumber,style:j==null?void 0:j[xe.Week],week:Ne},N&&Y.createElement(n.WeekNumber,{week:Ne,style:j==null?void 0:j[xe.WeekNumber],"aria-label":Xe(Ne.weekNumber,{locale:i}),className:l[xe.WeekNumber],scope:"row",role:"rowheader"},R(Ne.weekNumber,o)),Ne.days.map(Re=>{const{date:wt}=Re,oe=B(Re);if(oe[et.focused]=!oe.hidden&&!!(J!=null&&J.isEqualTo(Re)),oe[Mn.selected]=(T==null?void 0:T(wt))||oe.selected,Cm(H)){const{from:Ln,to:Je}=H;oe[Mn.range_start]=!!(Ln&&Je&&o.isSameDay(wt,Ln)),oe[Mn.range_end]=!!(Ln&&Je&&o.isSameDay(wt,Je)),oe[Mn.range_middle]=xr(H,wt,!0,o)}const Ze=aP(oe,j,t.modifiersStyles),ut=Y_(oe,l,t.modifiersClassNames),jt=!Ae&&!oe.hidden?W(wt,oe,o.options,o):void 0;return Y.createElement(n.Day,{key:`${o.format(wt,"yyyy-MM-dd")}_${o.format(Re.displayMonth,"yyyy-MM")}`,day:Re,modifiers:oe,className:ut.join(" "),style:Ze,role:"gridcell","aria-selected":oe.selected||void 0,"aria-label":jt,"data-day":o.format(wt,"yyyy-MM-dd"),"data-month":Re.outside?o.format(wt,"yyyy-MM"):void 0,"data-selected":oe.selected||void 0,"data-disabled":oe.disabled||void 0,"data-hidden":oe.hidden||void 0,"data-outside":Re.outside||void 0,"data-focused":oe.focused||void 0,"data-today":oe.today||void 0},!oe.hidden&&Ae?Y.createElement(n.DayButton,{className:l[xe.DayButton],style:j==null?void 0:j[xe.DayButton],type:"button",day:Re,modifiers:oe,disabled:oe.disabled||void 0,tabIndex:ee(Re)?0:-1,"aria-label":me(wt,oe,o.options,o),onClick:zt(Re,oe),onBlur:ie(Re,oe),onFocus:te(Re,oe),onKeyDown:V(Re,oe),onMouseEnter:se(Re,oe),onMouseLeave:he(Re,oe)},S(wt,o.options,o)):!oe.hidden&&S(Re.date,o.options,o))})))))))),t.footer&&Y.createElement(n.Footer,{className:l[xe.Footer],style:j==null?void 0:j[xe.Footer],role:"status","aria-live":"polite"},t.footer)))}function VP({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:s="ghost",formatters:o,components:i,...l}){const c=Em();return a.jsx(UP,{showOutsideDays:n,className:ve("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"}),...o},classNames:{root:ve("w-fit",c.root),months:ve("relative flex flex-col gap-4 md:flex-row",c.months),month:ve("flex w-full flex-col gap-4",c.month),nav:ve("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:ve(Gf({variant:s}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:ve(Gf({variant:s}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:ve("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:ve("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:ve("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:ve("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:ve("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:ve("flex",c.weekdays),weekday:ve("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:ve("mt-2 flex w-full",c.week),week_number_header:ve("w-[--cell-size] select-none",c.week_number_header),week_number:ve("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:ve("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:ve("bg-accent rounded-l-md",c.range_start),range_middle:ve("rounded-none",c.range_middle),range_end:ve("bg-accent rounded-r-md",c.range_end),today:ve("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:ve("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:ve("text-muted-foreground opacity-50",c.disabled),hidden:ve("invisible",c.hidden),...t},components:{Root:({className:d,rootRef:f,...u})=>a.jsx("div",{"data-slot":"calendar",ref:f,className:ve(d),...u}),Chevron:({className:d,orientation:f,...u})=>f==="left"?a.jsx(Zv,{className:ve("size-4",d),...u}):f==="right"?a.jsx(Jv,{className:ve("size-4",d),...u}):a.jsx(id,{className:ve("size-4",d),...u}),DayButton:HP,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})}),...i},...l})}function HP({className:e,day:t,modifiers:n,...r}){const s=Em(),o=p.useRef(null);return p.useEffect(()=>{var i;n.focused&&((i=o.current)==null||i.focus())},[n.focused]),a.jsx(U,{ref:o,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:ve("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 YP=["top","right","bottom","left"],us=Math.min,tn=Math.max,Mc=Math.round,jl=Math.floor,Jn=e=>({x:e,y:e}),XP={left:"right",right:"left",bottom:"top",top:"bottom"},qP={start:"end",end:"start"};function Qf(e,t,n){return tn(e,us(t,n))}function Sr(e,t){return typeof e=="function"?e(t):e}function Cr(e){return e.split("-")[0]}function co(e){return e.split("-")[1]}function Mm(e){return e==="x"?"y":"x"}function _m(e){return e==="y"?"height":"width"}const GP=new Set(["top","bottom"]);function Kn(e){return GP.has(Cr(e))?"y":"x"}function Pm(e){return Mm(Kn(e))}function KP(e,t,n){n===void 0&&(n=!1);const r=co(e),s=Pm(e),o=_m(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=_c(i)),[i,_c(i)]}function QP(e){const t=_c(e);return[Zf(e),t,Zf(t)]}function Zf(e){return e.replace(/start|end/g,t=>qP[t])}const fg=["left","right"],hg=["right","left"],ZP=["top","bottom"],JP=["bottom","top"];function e5(e,t,n){switch(e){case"top":case"bottom":return n?t?hg:fg:t?fg:hg;case"left":case"right":return t?ZP:JP;default:return[]}}function t5(e,t,n,r){const s=co(e);let o=e5(Cr(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(Zf)))),o}function _c(e){return e.replace(/left|right|bottom|top/g,t=>XP[t])}function n5(e){return{top:0,right:0,bottom:0,left:0,...e}}function wb(e){return typeof e!="number"?n5(e):{top:e,right:e,bottom:e,left:e}}function Pc(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 mg(e,t,n){let{reference:r,floating:s}=e;const o=Kn(t),i=Pm(t),l=_m(i),c=Cr(t),d=o==="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(co(t)){case"start":m[i]-=h*(n&&d?-1:1);break;case"end":m[i]+=h*(n&&d?-1:1);break}return m}const r5=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,l=o.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:f,y:u}=mg(d,r,c),h=r,m={},w=0;for(let v=0;v<l.length;v++){const{name:b,fn:x}=l[v],{x:y,y:g,data:N,reset:j}=await x({x:f,y:u,initialPlacement:r,placement:h,strategy:s,middlewareData:m,rects:d,platform:i,elements:{reference:e,floating:t}});f=y??f,u=g??u,m={...m,[b]:{...m[b],...N}},j&&w<=50&&(w++,typeof j=="object"&&(j.placement&&(h=j.placement),j.rects&&(d=j.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):j.rects),{x:f,y:u}=mg(d,h,c)),v=-1)}return{x:f,y:u,placement:h,strategy:s,middlewareData:m}};async function gi(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:i,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:h=!1,padding:m=0}=Sr(t,e),w=wb(m),b=l[h?u==="floating"?"reference":"floating":u],x=Pc(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:c})),y=u==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,g=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),N=await(o.isElement==null?void 0:o.isElement(g))?await(o.getScale==null?void 0:o.getScale(g))||{x:1,y:1}:{x:1,y:1},j=Pc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:g,strategy:c}):y);return{top:(x.top-j.top+w.top)/N.y,bottom:(j.bottom-x.bottom+w.bottom)/N.y,left:(x.left-j.left+w.left)/N.x,right:(j.right-x.right+w.right)/N.x}}const s5=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:i,elements:l,middlewareData:c}=t,{element:d,padding:f=0}=Sr(e,t)||{};if(d==null)return{};const u=wb(f),h={x:n,y:r},m=Pm(s),w=_m(m),v=await i.getDimensions(d),b=m==="y",x=b?"top":"left",y=b?"bottom":"right",g=b?"clientHeight":"clientWidth",N=o.reference[w]+o.reference[m]-h[m]-o.floating[w],j=h[m]-o.reference[m],k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let S=k?k[g]:0;(!S||!await(i.isElement==null?void 0:i.isElement(k)))&&(S=l.floating[g]||o.floating[w]);const M=N/2-j/2,R=S/2-v[w]/2-1,z=us(u[x],R),A=us(u[y],R),O=z,L=S-v[w]-A,E=S/2-v[w]/2+M,$=Qf(O,E,L),D=!c.arrow&&co(s)!=null&&E!==$&&o.reference[w]/2-(E<O?z:A)-v[w]/2<0,P=D?E<O?E-O:E-L:0;return{[m]:h[m]+P,data:{[m]:$,centerOffset:E-$-P,...D&&{alignmentOffset:P}},reset:D}}}),a5=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:i,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:v=!0,...b}=Sr(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const x=Cr(s),y=Kn(l),g=Cr(l)===l,N=await(c.isRTL==null?void 0:c.isRTL(d.floating)),j=h||(g||!v?[_c(l)]:QP(l)),k=w!=="none";!h&&k&&j.push(...t5(l,v,w,N));const S=[l,...j],M=await gi(t,b),R=[];let z=((r=o.flip)==null?void 0:r.overflows)||[];if(f&&R.push(M[x]),u){const E=KP(s,i,N);R.push(M[E[0]],M[E[1]])}if(z=[...z,{placement:s,overflows:R}],!R.every(E=>E<=0)){var A,O;const E=(((A=o.flip)==null?void 0:A.index)||0)+1,$=S[E];if($&&(!(u==="alignment"?y!==Kn($):!1)||z.every(C=>Kn(C.placement)===y?C.overflows[0]>0:!0)))return{data:{index:E,overflows:z},reset:{placement:$}};let D=(O=z.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=z.filter(C=>{if(k){const _=Kn(C.placement);return _===y||_==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(_=>_>0).reduce((_,I)=>_+I,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 pg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function xg(e){return YP.some(t=>e[t]>=0)}const o5=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 o=await gi(t,{...s,elementContext:"reference"}),i=pg(o,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:xg(i)}}}case"escaped":{const o=await gi(t,{...s,altBoundary:!0}),i=pg(o,n.floating);return{data:{escapedOffsets:i,escaped:xg(i)}}}default:return{}}}}},bb=new Set(["left","top"]);async function i5(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=Cr(n),l=co(n),c=Kn(n)==="y",d=bb.has(i)?-1:1,f=o&&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 l5=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:i,middlewareData:l}=t,c=await i5(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:i}}}}},c5=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:l={fn:b=>{let{x,y}=b;return{x,y}}},...c}=Sr(e,t),d={x:n,y:r},f=await gi(t,c),u=Kn(Cr(s)),h=Mm(u);let m=d[h],w=d[u];if(o){const b=h==="y"?"top":"left",x=h==="y"?"bottom":"right",y=m+f[b],g=m-f[x];m=Qf(y,m,g)}if(i){const b=u==="y"?"top":"left",x=u==="y"?"bottom":"right",y=w+f[b],g=w-f[x];w=Qf(y,w,g)}const v=l.fn({...t,[h]:m,[u]:w});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:o,[u]:i}}}}}},d5=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:i}=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 v=Sr(l,t),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const g=h==="y"?"height":"width",N=o.reference[h]-o.floating[g]+b.mainAxis,j=o.reference[h]+o.reference[g]-b.mainAxis;m<N?m=N:m>j&&(m=j)}if(d){var x,y;const g=h==="y"?"width":"height",N=bb.has(Cr(s)),j=o.reference[u]-o.floating[g]+(N&&((x=i.offset)==null?void 0:x[u])||0)+(N?0:b.crossAxis),k=o.reference[u]+o.reference[g]+(N?0:((y=i.offset)==null?void 0:y[u])||0)-(N?b.crossAxis:0);w<j?w=j:w>k&&(w=k)}return{[h]:m,[u]:w}}}},u5=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:i,elements:l}=t,{apply:c=()=>{},...d}=Sr(e,t),f=await gi(t,d),u=Cr(s),h=co(s),m=Kn(s)==="y",{width:w,height:v}=o.floating;let b,x;u==="top"||u==="bottom"?(b=u,x=h===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(x=u,b=h==="end"?"top":"bottom");const y=v-f.top-f.bottom,g=w-f.left-f.right,N=us(v-f[b],y),j=us(w-f[x],g),k=!t.middlewareData.shift;let S=N,M=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=g),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=y),k&&!h){const z=tn(f.left,0),A=tn(f.right,0),O=tn(f.top,0),L=tn(f.bottom,0);m?M=w-2*(z!==0||A!==0?z+A:tn(f.left,f.right)):S=v-2*(O!==0||L!==0?O+L:tn(f.top,f.bottom))}await c({...t,availableWidth:M,availableHeight:S});const R=await i.getDimensions(l.floating);return w!==R.width||v!==R.height?{reset:{rects:!0}}:{}}}};function pd(){return typeof window<"u"}function uo(e){return Nb(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=(Nb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Nb(e){return pd()?e instanceof Node||e instanceof an(e).Node:!1}function Rn(e){return pd()?e instanceof Element||e instanceof an(e).Element:!1}function tr(e){return pd()?e instanceof HTMLElement||e instanceof an(e).HTMLElement:!1}function gg(e){return!pd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof an(e).ShadowRoot}const f5=new Set(["inline","contents"]);function Vi(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=In(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!f5.has(s)}const h5=new Set(["table","td","th"]);function m5(e){return h5.has(uo(e))}const p5=[":popover-open",":modal"];function xd(e){return p5.some(t=>{try{return e.matches(t)}catch{return!1}})}const x5=["transform","translate","scale","rotate","perspective"],g5=["transform","translate","scale","rotate","perspective","filter"],y5=["paint","layout","strict","content"];function Dm(e){const t=Tm(),n=Rn(e)?In(e):e;return x5.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)||g5.some(r=>(n.willChange||"").includes(r))||y5.some(r=>(n.contain||"").includes(r))}function v5(e){let t=fs(e);for(;tr(t)&&!Ya(t);){if(Dm(t))return t;if(xd(t))return null;t=fs(t)}return null}function Tm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const w5=new Set(["html","body","#document"]);function Ya(e){return w5.has(uo(e))}function In(e){return an(e).getComputedStyle(e)}function gd(e){return Rn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fs(e){if(uo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gg(e)&&e.host||sr(e);return gg(t)?t.host:t}function jb(e){const t=fs(e);return Ya(t)?e.ownerDocument?e.ownerDocument.body:e.body:tr(t)&&Vi(t)?t:jb(t)}function yi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=jb(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=an(s);if(o){const l=Jf(i);return t.concat(i,i.visualViewport||[],Vi(s)?s:[],l&&n?yi(l):[])}return t.concat(s,yi(s,[],n))}function Jf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function kb(e){const t=In(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=tr(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,l=Mc(n)!==o||Mc(r)!==i;return l&&(n=o,r=i),{width:n,height:r,$:l}}function Om(e){return Rn(e)?e:e.contextElement}function Oa(e){const t=Om(e);if(!tr(t))return Jn(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=kb(t);let i=(o?Mc(n.width):n.width)/r,l=(o?Mc(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const b5=Jn(0);function Sb(e){const t=an(e);return!Tm()||!t.visualViewport?b5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function N5(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==an(e)?!1:t}function Ys(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Om(e);let i=Jn(1);t&&(r?Rn(r)&&(i=Oa(r)):i=Oa(e));const l=N5(o,n,r)?Sb(o):Jn(0);let c=(s.left+l.x)/i.x,d=(s.top+l.y)/i.y,f=s.width/i.x,u=s.height/i.y;if(o){const h=an(o),m=r&&Rn(r)?an(r):r;let w=h,v=Jf(w);for(;v&&r&&m!==w;){const b=Oa(v),x=v.getBoundingClientRect(),y=In(v),g=x.left+(v.clientLeft+parseFloat(y.paddingLeft))*b.x,N=x.top+(v.clientTop+parseFloat(y.paddingTop))*b.y;c*=b.x,d*=b.y,f*=b.x,u*=b.y,c+=g,d+=N,w=an(v),v=Jf(w)}}return Pc({width:f,height:u,x:c,y:d})}function yd(e,t){const n=gd(e).scrollLeft;return t?t.left+n:Ys(sr(e)).left+n}function Cb(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-yd(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function j5(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=sr(r),l=t?xd(t.floating):!1;if(r===i||l&&o)return n;let c={scrollLeft:0,scrollTop:0},d=Jn(1);const f=Jn(0),u=tr(r);if((u||!u&&!o)&&((uo(r)!=="body"||Vi(i))&&(c=gd(r)),tr(r))){const m=Ys(r);d=Oa(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const h=i&&!u&&!o?Cb(i,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 k5(e){return Array.from(e.getClientRects())}function S5(e){const t=sr(e),n=gd(e),r=e.ownerDocument.body,s=tn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=tn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+yd(e);const l=-n.scrollTop;return In(r).direction==="rtl"&&(i+=tn(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:i,y:l}}const yg=25;function C5(e,t){const n=an(e),r=sr(e),s=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,l=0,c=0;if(s){o=s.width,i=s.height;const f=Tm();(!f||f&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}const d=yd(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<=yg&&(o-=w)}else d<=yg&&(o+=d);return{width:o,height:i,x:l,y:c}}const E5=new Set(["absolute","fixed"]);function M5(e,t){const n=Ys(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=tr(e)?Oa(e):Jn(1),i=e.clientWidth*o.x,l=e.clientHeight*o.y,c=s*o.x,d=r*o.y;return{width:i,height:l,x:c,y:d}}function vg(e,t,n){let r;if(t==="viewport")r=C5(e,n);else if(t==="document")r=S5(sr(e));else if(Rn(t))r=M5(t,n);else{const s=Sb(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Pc(r)}function Eb(e,t){const n=fs(e);return n===t||!Rn(n)||Ya(n)?!1:In(n).position==="fixed"||Eb(n,t)}function _5(e,t){const n=t.get(e);if(n)return n;let r=yi(e,[],!1).filter(l=>Rn(l)&&uo(l)!=="body"),s=null;const o=In(e).position==="fixed";let i=o?fs(e):e;for(;Rn(i)&&!Ya(i);){const l=In(i),c=Dm(i);!c&&l.position==="fixed"&&(s=null),(o?!c&&!s:!c&&l.position==="static"&&!!s&&E5.has(s.position)||Vi(i)&&!c&&Eb(e,i))?r=r.filter(f=>f!==i):s=l,i=fs(i)}return t.set(e,r),r}function P5(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?xd(t)?[]:_5(t,this._c):[].concat(n),r],l=i[0],c=i.reduce((d,f)=>{const u=vg(t,f,s);return d.top=tn(u.top,d.top),d.right=us(u.right,d.right),d.bottom=us(u.bottom,d.bottom),d.left=tn(u.left,d.left),d},vg(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function D5(e){const{width:t,height:n}=kb(e);return{width:t,height:n}}function T5(e,t,n){const r=tr(t),s=sr(t),o=n==="fixed",i=Ys(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const c=Jn(0);function d(){c.x=yd(s)}if(r||!r&&!o)if((uo(t)!=="body"||Vi(s))&&(l=gd(t)),r){const m=Ys(t,!0,o,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else s&&d();o&&!r&&s&&d();const f=s&&!r&&!o?Cb(s,l):Jn(0),u=i.left+l.scrollLeft-c.x-f.x,h=i.top+l.scrollTop-c.y-f.y;return{x:u,y:h,width:i.width,height:i.height}}function _u(e){return In(e).position==="static"}function wg(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 Mb(e,t){const n=an(e);if(xd(e))return n;if(!tr(e)){let s=fs(e);for(;s&&!Ya(s);){if(Rn(s)&&!_u(s))return s;s=fs(s)}return n}let r=wg(e,t);for(;r&&m5(r)&&_u(r);)r=wg(r,t);return r&&Ya(r)&&_u(r)&&!Dm(r)?n:r||v5(e)||n}const O5=async function(e){const t=this.getOffsetParent||Mb,n=this.getDimensions,r=await n(e.floating);return{reference:T5(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function A5(e){return In(e).direction==="rtl"}const R5={convertOffsetParentRelativeRectToViewportRelativeRect:j5,getDocumentElement:sr,getClippingRect:P5,getOffsetParent:Mb,getElementRects:O5,getClientRects:k5,getDimensions:D5,getScale:Oa,isElement:Rn,isRTL:A5};function _b(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function I5(e,t){let n=null,r;const s=sr(e);function o(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),o();const d=e.getBoundingClientRect(),{left:f,top:u,width:h,height:m}=d;if(l||t(),!h||!m)return;const w=jl(u),v=jl(s.clientWidth-(f+h)),b=jl(s.clientHeight-(u+m)),x=jl(f),g={rootMargin:-w+"px "+-v+"px "+-b+"px "+-x+"px",threshold:tn(0,us(1,c))||1};let N=!0;function j(k){const S=k[0].intersectionRatio;if(S!==c){if(!N)return i();S?i(!1,S):r=setTimeout(()=>{i(!1,1e-7)},1e3)}S===1&&!_b(d,e.getBoundingClientRect())&&i(),N=!1}try{n=new IntersectionObserver(j,{...g,root:s.ownerDocument})}catch{n=new IntersectionObserver(j,g)}n.observe(e)}return i(!0),o}function z5(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Om(e),f=s||o?[...d?yi(d):[],...yi(t)]:[];f.forEach(x=>{s&&x.addEventListener("scroll",n,{passive:!0}),o&&x.addEventListener("resize",n)});const u=d&&l?I5(d,n):null;let h=-1,m=null;i&&(m=new ResizeObserver(x=>{let[y]=x;y&&y.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var g;(g=m)==null||g.observe(t)})),n()}),d&&!c&&m.observe(d),m.observe(t));let w,v=c?Ys(e):null;c&&b();function b(){const x=Ys(e);v&&!_b(v,x)&&n(),v=x,w=requestAnimationFrame(b)}return n(),()=>{var x;f.forEach(y=>{s&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),u==null||u(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(w)}}const $5=l5,L5=c5,F5=a5,B5=u5,W5=o5,bg=s5,U5=d5,V5=(e,t,n)=>{const r=new Map,s={platform:R5,...n},o={...s.platform,_c:r};return r5(e,t,{...s,platform:o})};var H5=typeof document<"u",Y5=function(){},ql=H5?p.useLayoutEffect:Y5;function Dc(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(!Dc(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 o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!Dc(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Pb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ng(e,t){const n=Pb(e);return Math.round(t*n)/n}function Pu(e){const t=p.useRef(e);return ql(()=>{t.current=e}),t}function X5(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:i}={},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);Dc(h,r)||m(r);const[w,v]=p.useState(null),[b,x]=p.useState(null),y=p.useCallback(C=>{C!==k.current&&(k.current=C,v(C))},[]),g=p.useCallback(C=>{C!==S.current&&(S.current=C,x(C))},[]),N=o||w,j=i||b,k=p.useRef(null),S=p.useRef(null),M=p.useRef(f),R=c!=null,z=Pu(c),A=Pu(s),O=Pu(d),L=p.useCallback(()=>{if(!k.current||!S.current)return;const C={placement:t,strategy:n,middleware:h};A.current&&(C.platform=A.current),V5(k.current,S.current,C).then(_=>{const I={..._,isPositioned:O.current!==!1};E.current&&!Dc(M.current,I)&&(M.current=I,ad.flushSync(()=>{u(I)}))})},[h,t,n,A,O]);ql(()=>{d===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,u(C=>({...C,isPositioned:!1})))},[d]);const E=p.useRef(!1);ql(()=>(E.current=!0,()=>{E.current=!1}),[]),ql(()=>{if(N&&(k.current=N),j&&(S.current=j),N&&j){if(z.current)return z.current(N,j,L);L()}},[N,j,L,z,R]);const $=p.useMemo(()=>({reference:k,floating:S,setReference:y,setFloating:g}),[y,g]),D=p.useMemo(()=>({reference:N,floating:j}),[N,j]),P=p.useMemo(()=>{const C={position:n,left:0,top:0};if(!D.floating)return C;const _=Ng(D.floating,f.x),I=Ng(D.floating,f.y);return l?{...C,transform:"translate("+_+"px, "+I+"px)",...Pb(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:I}},[n,l,D.floating,f.x,f.y]);return p.useMemo(()=>({...f,update:L,refs:$,elements:D,floatingStyles:P}),[f,L,$,D,P])}const q5=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?bg({element:r.current,padding:s}).fn(n):{}:r?bg({element:r,padding:s}).fn(n):{}}}},G5=(e,t)=>({...$5(e),options:[e,t]}),K5=(e,t)=>({...L5(e),options:[e,t]}),Q5=(e,t)=>({...U5(e),options:[e,t]}),Z5=(e,t)=>({...F5(e),options:[e,t]}),J5=(e,t)=>({...B5(e),options:[e,t]}),eD=(e,t)=>({...W5(e),options:[e,t]}),tD=(e,t)=>({...q5(e),options:[e,t]});var nD="Arrow",Db=p.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return a.jsx(Be.svg,{...o,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"})})});Db.displayName=nD;var rD=Db;function Tb(e){const[t,n]=p.useState(void 0);return cs(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let i,l;if("borderBoxSize"in o){const c=o.borderBoxSize,d=Array.isArray(c)?c[0]:c;i=d.inlineSize,l=d.blockSize}else i=e.offsetWidth,l=e.offsetHeight;n({width:i,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Am="Popper",[Ob,vd]=$i(Am),[sD,Ab]=Ob(Am),Rb=e=>{const{__scopePopper:t,children:n}=e,[r,s]=p.useState(null);return a.jsx(sD,{scope:t,anchor:r,onAnchorChange:s,children:n})};Rb.displayName=Am;var Ib="PopperAnchor",zb=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=Ab(Ib,n),i=p.useRef(null),l=Wt(t,i),c=p.useRef(null);return p.useEffect(()=>{const d=c.current;c.current=(r==null?void 0:r.current)||i.current,d!==c.current&&o.onAnchorChange(c.current)}),r?null:a.jsx(Be.div,{...s,ref:l})});zb.displayName=Ib;var Rm="PopperContent",[aD,oD]=Ob(Rm),$b=p.forwardRef((e,t)=>{var ee,K,ne,me,W,Q;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:u="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:w,...v}=e,b=Ab(Rm,n),[x,y]=p.useState(null),g=Wt(t,Z=>y(Z)),[N,j]=p.useState(null),k=Tb(N),S=(k==null?void 0:k.width)??0,M=(k==null?void 0:k.height)??0,R=r+(o!=="center"?"-"+o:""),z=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:z,boundary:A.filter(lD),altBoundary:O},{refs:E,floatingStyles:$,placement:D,isPositioned:P,middlewareData:C}=X5({strategy:"fixed",placement:R,whileElementsMounted:(...Z)=>z5(...Z,{animationFrame:m==="always"}),elements:{reference:b.anchor},middleware:[G5({mainAxis:s+M,alignmentAxis:i}),c&&K5({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Q5():void 0,...L}),c&&Z5({...L}),J5({...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`)}}),N&&tD({element:N,padding:l}),cD({arrowWidth:S,arrowHeight:M}),h&&eD({strategy:"referenceHidden",...L})]}),[_,I]=Bb(D),B=Ua(w);cs(()=>{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 cs(()=>{x&&J(window.getComputedStyle(x).zIndex)},[x]),a.jsx("div",{ref:E.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:P?$.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(aD,{scope:n,placedSide:_,onArrowChange:j,arrowX:T,arrowY:F,shouldHideArrow:H,children:a.jsx(Be.div,{"data-side":_,"data-align":I,...v,ref:g,style:{...v.style,animation:P?void 0:"none"}})})})});$b.displayName=Rm;var Lb="PopperArrow",iD={top:"bottom",right:"left",bottom:"top",left:"right"},Fb=p.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=oD(Lb,r),i=iD[o.placedSide];return a.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:a.jsx(rD,{...s,ref:n,style:{...s.style,display:"block"}})})});Fb.displayName=Lb;function lD(e){return e!==null}var cD=e=>({name:"transformOrigin",options:e,fn(t){var b,x,y;const{placement:n,rects:r,middlewareData:s}=t,i=((b=s.arrow)==null?void 0:b.centerOffset)!==0,l=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,f]=Bb(n),u={start:"0%",center:"50%",end:"100%"}[f],h=(((x=s.arrow)==null?void 0:x.x)??0)+l/2,m=(((y=s.arrow)==null?void 0:y.y)??0)+c/2;let w="",v="";return d==="bottom"?(w=i?u:`${h}px`,v=`${-c}px`):d==="top"?(w=i?u:`${h}px`,v=`${r.floating.height+c}px`):d==="right"?(w=`${-c}px`,v=i?u:`${m}px`):d==="left"&&(w=`${r.floating.width+c}px`,v=i?u:`${m}px`),{data:{x:w,y:v}}}});function Bb(e){const[t,n="center"]=e.split("-");return[t,n]}var Wb=Rb,Im=zb,Ub=$b,Vb=Fb,wd="Popover",[Hb]=$i(wd,[vd]),Hi=vd(),[dD,ys]=Hb(wd),Yb=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!1}=e,l=Hi(t),c=p.useRef(null),[d,f]=p.useState(!1),[u,h]=ld({prop:r,defaultProp:s??!1,onChange:o,caller:wd});return a.jsx(Wb,{...l,children:a.jsx(dD,{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:i,children:n})})};Yb.displayName=wd;var Xb="PopoverAnchor",uD=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ys(Xb,n),o=Hi(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=s;return p.useEffect(()=>(i(),()=>l()),[i,l]),a.jsx(Im,{...o,...r,ref:t})});uD.displayName=Xb;var qb="PopoverTrigger",Gb=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ys(qb,n),o=Hi(n),i=Wt(t,s.triggerRef),l=a.jsx(Be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":e1(s.open),...r,ref:i,onClick:lt(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:a.jsx(Im,{asChild:!0,...o,children:l})});Gb.displayName=qb;var zm="PopoverPortal",[fD,hD]=Hb(zm,{forceMount:void 0}),Kb=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,o=ys(zm,t);return a.jsx(fD,{scope:t,forceMount:n,children:a.jsx(gs,{present:n||o.open,children:a.jsx(ym,{asChild:!0,container:s,children:r})})})};Kb.displayName=zm;var Xa="PopoverContent",Qb=p.forwardRef((e,t)=>{const n=hD(Xa,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,o=ys(Xa,e.__scopePopover);return a.jsx(gs,{present:r||o.open,children:o.modal?a.jsx(pD,{...s,ref:t}):a.jsx(xD,{...s,ref:t})})});Qb.displayName=Xa;var mD=cd("PopoverContent.RemoveScroll"),pD=p.forwardRef((e,t)=>{const n=ys(Xa,e.__scopePopover),r=p.useRef(null),s=Wt(t,r),o=p.useRef(!1);return p.useEffect(()=>{const i=r.current;if(i)return xw(i)},[]),a.jsx(vm,{as:mD,allowPinchZoom:!0,children:a.jsx(Zb,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:lt(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),o.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:lt(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:lt(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),xD=p.forwardRef((e,t)=>{const n=ys(Xa,e.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return a.jsx(Zb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),Zb=p.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,...u}=e,h=ys(Xa,n),m=Hi(n);return iw(),a.jsx(gm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(dd,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:f,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:a.jsx(Ub,{"data-state":e1(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)"}})})})}),Jb="PopoverClose",gD=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ys(Jb,n);return a.jsx(Be.button,{type:"button",...r,ref:t,onClick:lt(e.onClick,()=>s.onOpenChange(!1))})});gD.displayName=Jb;var yD="PopoverArrow",vD=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Hi(n);return a.jsx(Vb,{...s,...r,ref:t})});vD.displayName=yD;function e1(e){return e?"open":"closed"}var wD=Yb,bD=Gb,ND=Kb,t1=Qb;const jD=wD,kD=bD,n1=p.forwardRef(({className:e,align:t="start",sideOffset:n=4,...r},s)=>a.jsx(ND,{children:a.jsx(t1,{ref:s,align:t,sideOffset:n,className:ve("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})}));n1.displayName=t1.displayName;function SD({value:e,onChange:t,className:n}){const[r,s]=p.useState(!1),[o,i]=p.useState(e);p.useEffect(()=>{i(e)},[e]);const l=c=>{i(c),t==null||t(c),c!=null&&c.from&&(c!=null&&c.to)&&s(!1)};return a.jsx("div",{className:n,children:a.jsxs(jD,{open:r,onOpenChange:s,children:[a.jsx(kD,{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:[o!=null&&o.from?o.to?a.jsxs(a.Fragment,{children:[o.from.toLocaleDateString()," - ",o.to.toLocaleDateString()]}):o.from.toLocaleDateString():"Pick a date range",a.jsx(id,{className:"h-4 w-4"})]})}),a.jsx(n1,{className:"w-auto overflow-hidden p-0",align:"start",children:a.jsx(VP,{mode:"range",defaultMonth:o==null?void 0:o.from,selected:o,onSelect:l,numberOfMonths:2,disabled:c=>c>new Date})})]})})}function r1(){const e=Js(),{refetchCounts:t}=xm(),[n,r]=p.useState([]),[s,o]=p.useState(!0),[i,l]=p.useState(""),[c,d]=p.useState([]),[f,u]=p.useState(1),[h]=p.useState(20),[m,w]=p.useState(!1),[v,b]=p.useState(!1),[x,y]=p.useState(!1),[g,N]=p.useState(!1),[j,k]=p.useState(!1),[S,M]=p.useState(!1),[R,z]=p.useState(!1),[A,O]=p.useState(null),[L,E]=p.useState(null),[$,D]=p.useState(""),[P,C]=p.useState(),[_,I]=p.useState(!1),[B,T]=p.useState([]),[F,H]=p.useState(!1),X=async()=>{try{const se=await(await fetch("/api/users?limit=10000")).json();r(se.users||[])}catch{}finally{o(!1)}},J=async()=>{try{const se=await(await fetch("/api/admin/status")).json();I(se.enabled)}catch{I(!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),N(!0)},ne=V=>{O(V),b(!0)},me=V=>{O(V),y(!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(),y(!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:$||"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}),z(!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(`
|
|
388
|
-
`),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))},ct=(V,se)=>{d(he=>he.map(de=>de.type===V?{...de,dateRange:se}:de))},Pt=n.filter(V=>{const se=V.name.toLowerCase().includes(i.toLowerCase())||V.email.toLowerCase().includes(i.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),gt=(f-1)*h,zt=gt+h,te=Pt.slice(gt,zt),ie=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(ew,{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(qe,{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(ls,{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:i,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(pm,{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(SD,{value:V.dateRange,onChange:se=>ct("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:i||c.length>0?"Try adjusting your search or filter criteria":"Get started by creating your first user or seeding some data"})]}),!i&&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(qe,{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(Qv,{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(QC,{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(zi,{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(Ws,{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),z(!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(Os,{className:"w-4 h-4"}),a.jsx("span",{children:"Delete User"})]})]})]})})]},V.id))})]})}),a.jsx(Hw,{currentPage:f,totalPages:Qe,onPageChange:ie,totalItems:Pt.length,startIndex:gt,endIndex:zt})]}),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 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(qe,{className:"w-3 h-3 mr-2"}),"Seed Users"]})})]})]}),B.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(Va,{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"})]})]})}),v&&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"})]})]})}),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:"Delete User"}),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("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:()=>y(!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"})]})]})}),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:"User Details"}),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-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:()=>N(!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:$,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"})]})]})}),R&&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:()=>{z(!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 CD(){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(ot,{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(Ts,{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(Wf,{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(Hl,{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(r1,{}):e==="organizations"?a.jsx(Yw,{}):n()})}function xt(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=xt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var ED={value:()=>{}};function bd(){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 Gl(n)}function Gl(e){this._=e}function MD(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}})}Gl.prototype=bd.prototype={constructor:Gl,on:function(e,t){var n=this._,r=MD(e+"",n),s,o=-1,i=r.length;if(arguments.length<2){for(;++o<i;)if((s=(e=r[o]).type)&&(s=_D(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<i;)if(s=(e=r[o]).type)n[s]=jg(n[s],e.name,t);else if(t==null)for(s in n)n[s]=jg(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 Gl(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,o;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,s=o.length;r<s;++r)o[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,o=r.length;s<o;++s)r[s].value.apply(t,n)}};function _D(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function jg(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=ED,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var eh="http://www.w3.org/1999/xhtml";const kg={svg:"http://www.w3.org/2000/svg",xhtml:eh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Nd(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),kg.hasOwnProperty(t)?{space:kg[t],local:e}:e}function PD(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===eh&&t.documentElement.namespaceURI===eh?t.createElement(e):t.createElementNS(n,e)}}function DD(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function s1(e){var t=Nd(e);return(t.local?DD:PD)(t)}function TD(){}function $m(e){return e==null?TD:function(){return this.querySelector(e)}}function OD(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 o=t[s],i=o.length,l=r[s]=new Array(i),c,d,f=0;f<i;++f)(c=o[f])&&(d=e.call(c,c.__data__,f,o))&&("__data__"in c&&(d.__data__=c.__data__),l[f]=d);return new cn(r,this._parents)}function AD(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function RD(){return[]}function a1(e){return e==null?RD:function(){return this.querySelectorAll(e)}}function ID(e){return function(){return AD(e.apply(this,arguments))}}function zD(e){typeof e=="function"?e=ID(e):e=a1(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var i=t[o],l=i.length,c,d=0;d<l;++d)(c=i[d])&&(r.push(e.call(c,c.__data__,d,i)),s.push(c));return new cn(r,s)}function o1(e){return function(){return this.matches(e)}}function i1(e){return function(t){return t.matches(e)}}var $D=Array.prototype.find;function LD(e){return function(){return $D.call(this.children,e)}}function FD(){return this.firstElementChild}function BD(e){return this.select(e==null?FD:LD(typeof e=="function"?e:i1(e)))}var WD=Array.prototype.filter;function UD(){return Array.from(this.children)}function VD(e){return function(){return WD.call(this.children,e)}}function HD(e){return this.selectAll(e==null?UD:VD(typeof e=="function"?e:i1(e)))}function YD(e){typeof e!="function"&&(e=o1(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=[],c,d=0;d<i;++d)(c=o[d])&&e.call(c,c.__data__,d,o)&&l.push(c);return new cn(r,this._parents)}function l1(e){return new Array(e.length)}function XD(){return new cn(this._enter||this._groups.map(l1),this._parents)}function Tc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Tc.prototype={constructor:Tc,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 qD(e){return function(){return e}}function GD(e,t,n,r,s,o){for(var i=0,l,c=t.length,d=o.length;i<d;++i)(l=t[i])?(l.__data__=o[i],r[i]=l):n[i]=new Tc(e,o[i]);for(;i<c;++i)(l=t[i])&&(s[i]=l)}function KD(e,t,n,r,s,o,i){var l,c,d=new Map,f=t.length,u=o.length,h=new Array(f),m;for(l=0;l<f;++l)(c=t[l])&&(h[l]=m=i.call(c,c.__data__,l,t)+"",d.has(m)?s[l]=c:d.set(m,c));for(l=0;l<u;++l)m=i.call(e,o[l],l,o)+"",(c=d.get(m))?(r[l]=c,c.__data__=o[l],d.delete(m)):n[l]=new Tc(e,o[l]);for(l=0;l<f;++l)(c=t[l])&&d.get(h[l])===c&&(s[l]=c)}function QD(e){return e.__data__}function ZD(e,t){if(!arguments.length)return Array.from(this,QD);var n=t?KD:GD,r=this._parents,s=this._groups;typeof e!="function"&&(e=qD(e));for(var o=s.length,i=new Array(o),l=new Array(o),c=new Array(o),d=0;d<o;++d){var f=r[d],u=s[d],h=u.length,m=JD(e.call(f,f&&f.__data__,d,r)),w=m.length,v=l[d]=new Array(w),b=i[d]=new Array(w),x=c[d]=new Array(h);n(f,u,v,b,x,m,t);for(var y=0,g=0,N,j;y<w;++y)if(N=v[y]){for(y>=g&&(g=y+1);!(j=b[g])&&++g<w;);N._next=j||null}}return i=new cn(i,r),i._enter=l,i._exit=c,i}function JD(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function eT(){return new cn(this._exit||this._groups.map(l1),this._parents)}function tT(e,t,n){var r=this.enter(),s=this,o=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?o.remove():n(o),r&&s?r.merge(s).order():s}function nT(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,o=r.length,i=Math.min(s,o),l=new Array(s),c=0;c<i;++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 rT(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,o=r[s],i;--s>=0;)(i=r[s])&&(o&&i.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(i,o),o=i);return this}function sT(e){e||(e=aT);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),o=0;o<r;++o){for(var i=n[o],l=i.length,c=s[o]=new Array(l),d,f=0;f<l;++f)(d=i[f])&&(c[f]=d);c.sort(t)}return new cn(s,this._parents).order()}function aT(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function oT(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function iT(){return Array.from(this)}function lT(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length;s<o;++s){var i=r[s];if(i)return i}return null}function cT(){let e=0;for(const t of this)++e;return e}function dT(){return!this.node()}function uT(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],o=0,i=s.length,l;o<i;++o)(l=s[o])&&e.call(l,l.__data__,o,s);return this}function fT(e){return function(){this.removeAttribute(e)}}function hT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function mT(e,t){return function(){this.setAttribute(e,t)}}function pT(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function xT(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function gT(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function yT(e,t){var n=Nd(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?hT:fT:typeof t=="function"?n.local?gT:xT:n.local?pT:mT)(n,t))}function c1(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function vT(e){return function(){this.style.removeProperty(e)}}function wT(e,t,n){return function(){this.style.setProperty(e,t,n)}}function bT(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function NT(e,t,n){return arguments.length>1?this.each((t==null?vT:typeof t=="function"?bT:wT)(e,t,n??"")):qa(this.node(),e)}function qa(e,t){return e.style.getPropertyValue(t)||c1(e).getComputedStyle(e,null).getPropertyValue(t)}function jT(e){return function(){delete this[e]}}function kT(e,t){return function(){this[e]=t}}function ST(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function CT(e,t){return arguments.length>1?this.each((t==null?jT:typeof t=="function"?ST:kT)(e,t)):this.node()[e]}function d1(e){return e.trim().split(/^|\s+/)}function Lm(e){return e.classList||new u1(e)}function u1(e){this._node=e,this._names=d1(e.getAttribute("class")||"")}u1.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 f1(e,t){for(var n=Lm(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function h1(e,t){for(var n=Lm(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function ET(e){return function(){f1(this,e)}}function MT(e){return function(){h1(this,e)}}function _T(e,t){return function(){(t.apply(this,arguments)?f1:h1)(this,e)}}function PT(e,t){var n=d1(e+"");if(arguments.length<2){for(var r=Lm(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?_T:t?ET:MT)(n,t))}function DT(){this.textContent=""}function TT(e){return function(){this.textContent=e}}function OT(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function AT(e){return arguments.length?this.each(e==null?DT:(typeof e=="function"?OT:TT)(e)):this.node().textContent}function RT(){this.innerHTML=""}function IT(e){return function(){this.innerHTML=e}}function zT(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function $T(e){return arguments.length?this.each(e==null?RT:(typeof e=="function"?zT:IT)(e)):this.node().innerHTML}function LT(){this.nextSibling&&this.parentNode.appendChild(this)}function FT(){return this.each(LT)}function BT(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function WT(){return this.each(BT)}function UT(e){var t=typeof e=="function"?e:s1(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function VT(){return null}function HT(e,t){var n=typeof e=="function"?e:s1(e),r=t==null?VT:typeof t=="function"?t:$m(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function YT(){var e=this.parentNode;e&&e.removeChild(this)}function XT(){return this.each(YT)}function qT(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function GT(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function KT(e){return this.select(e?GT:qT)}function QT(e){return arguments.length?this.property("__data__",e):this.node().__data__}function ZT(e){return function(t){e.call(this,t,this.__data__)}}function JT(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 eO(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,o;n<s;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function tO(e,t,n){return function(){var r=this.__on,s,o=ZT(t);if(r){for(var i=0,l=r.length;i<l;++i)if((s=r[i]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=n),s.value=t;return}}this.addEventListener(e.type,o,n),s={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(s):this.__on=[s]}}function nO(e,t,n){var r=JT(e+""),s,o=r.length,i;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<o;++s)if((i=r[s]).type===f.type&&i.name===f.name)return f.value}return}for(l=t?tO:eO,s=0;s<o;++s)this.each(l(r[s],t,n));return this}function m1(e,t,n){var r=c1(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 rO(e,t){return function(){return m1(this,e,t)}}function sO(e,t){return function(){return m1(this,e,t.apply(this,arguments))}}function aO(e,t){return this.each((typeof t=="function"?sO:rO)(e,t))}function*oO(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length,i;s<o;++s)(i=r[s])&&(yield i)}var p1=[null];function cn(e,t){this._groups=e,this._parents=t}function Yi(){return new cn([[document.documentElement]],p1)}function iO(){return this}cn.prototype=Yi.prototype={constructor:cn,select:OD,selectAll:zD,selectChild:BD,selectChildren:HD,filter:YD,data:ZD,enter:XD,exit:eT,join:tT,merge:nT,selection:iO,order:rT,sort:sT,call:oT,nodes:iT,node:lT,size:cT,empty:dT,each:uT,attr:yT,style:NT,property:CT,classed:PT,text:AT,html:$T,raise:FT,lower:WT,append:UT,insert:HT,remove:XT,clone:KT,datum:QT,on:nO,dispatch:aO,[Symbol.iterator]:oO};function nn(e){return typeof e=="string"?new cn([[document.querySelector(e)]],[document.documentElement]):new cn([[e]],p1)}function lO(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Sn(e,t){if(e=lO(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 cO={passive:!1},vi={capture:!0,passive:!1};function Du(e){e.stopImmediatePropagation()}function Aa(e){e.preventDefault(),e.stopImmediatePropagation()}function x1(e){var t=e.document.documentElement,n=nn(e).on("dragstart.drag",Aa,vi);"onselectstart"in t?n.on("selectstart.drag",Aa,vi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function g1(e,t){var n=e.document.documentElement,r=nn(e).on("dragstart.drag",null);t&&(r.on("click.drag",Aa,vi),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 kl=e=>()=>e;function th(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:i,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:o,enumerable:!0,configurable:!0},x:{value:i,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}})}th.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function dO(e){return!e.ctrlKey&&!e.button}function uO(){return this.parentNode}function fO(e,t){return t??{x:e.x,y:e.y}}function hO(){return navigator.maxTouchPoints||"ontouchstart"in this}function y1(){var e=dO,t=uO,n=fO,r=hO,s={},o=bd("start","drag","end"),i=0,l,c,d,f,u=0;function h(N){N.on("mousedown.drag",m).filter(r).on("touchstart.drag",b).on("touchmove.drag",x,cO).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(N,j){if(!(f||!e.call(this,N,j))){var k=g(this,t.call(this,N,j),N,j,"mouse");k&&(nn(N.view).on("mousemove.drag",w,vi).on("mouseup.drag",v,vi),x1(N.view),Du(N),d=!1,l=N.clientX,c=N.clientY,k("start",N))}}function w(N){if(Aa(N),!d){var j=N.clientX-l,k=N.clientY-c;d=j*j+k*k>u}s.mouse("drag",N)}function v(N){nn(N.view).on("mousemove.drag mouseup.drag",null),g1(N.view,d),Aa(N),s.mouse("end",N)}function b(N,j){if(e.call(this,N,j)){var k=N.changedTouches,S=t.call(this,N,j),M=k.length,R,z;for(R=0;R<M;++R)(z=g(this,S,N,j,k[R].identifier,k[R]))&&(Du(N),z("start",N,k[R]))}}function x(N){var j=N.changedTouches,k=j.length,S,M;for(S=0;S<k;++S)(M=s[j[S].identifier])&&(Aa(N),M("drag",N,j[S]))}function y(N){var j=N.changedTouches,k=j.length,S,M;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),S=0;S<k;++S)(M=s[j[S].identifier])&&(Du(N),M("end",N,j[S]))}function g(N,j,k,S,M,R){var z=o.copy(),A=Sn(R||k,j),O,L,E;if((E=n.call(N,new th("beforestart",{sourceEvent:k,target:h,identifier:M,active:i,x:A[0],y:A[1],dx:0,dy:0,dispatch:z}),S))!=null)return O=E.x-A[0]||0,L=E.y-A[1]||0,function $(D,P,C){var _=A,I;switch(D){case"start":s[M]=$,I=i++;break;case"end":delete s[M],--i;case"drag":A=Sn(C||P,j),I=i;break}z.call(D,N,new th(D,{sourceEvent:P,subject:E,target:h,identifier:M,active:I,x:A[0]+O,y:A[1]+L,dx:A[0]-_[0],dy:A[1]-_[1],dispatch:z}),S)}}return h.filter=function(N){return arguments.length?(e=typeof N=="function"?N:kl(!!N),h):e},h.container=function(N){return arguments.length?(t=typeof N=="function"?N:kl(N),h):t},h.subject=function(N){return arguments.length?(n=typeof N=="function"?N:kl(N),h):n},h.touchable=function(N){return arguments.length?(r=typeof N=="function"?N:kl(!!N),h):r},h.on=function(){var N=o.on.apply(o,arguments);return N===o?h:N},h.clickDistance=function(N){return arguments.length?(u=(N=+N)*N,h):Math.sqrt(u)},h}function Fm(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function v1(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Xi(){}var wi=.7,Oc=1/wi,Ra="\\s*([+-]?\\d+)\\s*",bi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",er="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mO=/^#([0-9a-f]{3,8})$/,pO=new RegExp(`^rgb\\(${Ra},${Ra},${Ra}\\)$`),xO=new RegExp(`^rgb\\(${er},${er},${er}\\)$`),gO=new RegExp(`^rgba\\(${Ra},${Ra},${Ra},${bi}\\)$`),yO=new RegExp(`^rgba\\(${er},${er},${er},${bi}\\)$`),vO=new RegExp(`^hsl\\(${bi},${er},${er}\\)$`),wO=new RegExp(`^hsla\\(${bi},${er},${er},${bi}\\)$`),Sg={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(Xi,Xs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Cg,formatHex:Cg,formatHex8:bO,formatHsl:NO,formatRgb:Eg,toString:Eg});function Cg(){return this.rgb().formatHex()}function bO(){return this.rgb().formatHex8()}function NO(){return w1(this).formatHsl()}function Eg(){return this.rgb().formatRgb()}function Xs(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=mO.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Mg(t):n===3?new Xt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Sl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Sl(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=pO.exec(e))?new Xt(t[1],t[2],t[3],1):(t=xO.exec(e))?new Xt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gO.exec(e))?Sl(t[1],t[2],t[3],t[4]):(t=yO.exec(e))?Sl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=vO.exec(e))?Dg(t[1],t[2]/100,t[3]/100,1):(t=wO.exec(e))?Dg(t[1],t[2]/100,t[3]/100,t[4]):Sg.hasOwnProperty(e)?Mg(Sg[e]):e==="transparent"?new Xt(NaN,NaN,NaN,0):null}function Mg(e){return new Xt(e>>16&255,e>>8&255,e&255,1)}function Sl(e,t,n,r){return r<=0&&(e=t=n=NaN),new Xt(e,t,n,r)}function jO(e){return e instanceof Xi||(e=Xs(e)),e?(e=e.rgb(),new Xt(e.r,e.g,e.b,e.opacity)):new Xt}function nh(e,t,n,r){return arguments.length===1?jO(e):new Xt(e,t,n,r??1)}function Xt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Fm(Xt,nh,v1(Xi,{brighter(e){return e=e==null?Oc:Math.pow(Oc,e),new Xt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?wi:Math.pow(wi,e),new Xt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Xt(As(this.r),As(this.g),As(this.b),Ac(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:_g,formatHex:_g,formatHex8:kO,formatRgb:Pg,toString:Pg}));function _g(){return`#${_s(this.r)}${_s(this.g)}${_s(this.b)}`}function kO(){return`#${_s(this.r)}${_s(this.g)}${_s(this.b)}${_s((isNaN(this.opacity)?1:this.opacity)*255)}`}function Pg(){const e=Ac(this.opacity);return`${e===1?"rgb(":"rgba("}${As(this.r)}, ${As(this.g)}, ${As(this.b)}${e===1?")":`, ${e})`}`}function Ac(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function As(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function _s(e){return e=As(e),(e<16?"0":"")+e.toString(16)}function Dg(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 w1(e){if(e instanceof En)return new En(e.h,e.s,e.l,e.opacity);if(e instanceof Xi||(e=Xs(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),o=Math.max(t,n,r),i=NaN,l=o-s,c=(o+s)/2;return l?(t===o?i=(n-r)/l+(n<r)*6:n===o?i=(r-t)/l+2:i=(t-n)/l+4,l/=c<.5?o+s:2-o-s,i*=60):l=c>0&&c<1?0:i,new En(i,l,c,e.opacity)}function SO(e,t,n,r){return arguments.length===1?w1(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,SO,v1(Xi,{brighter(e){return e=e==null?Oc:Math.pow(Oc,e),new En(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wi:Math.pow(wi,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 Xt(Tu(e>=240?e-240:e+120,s,r),Tu(e,s,r),Tu(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new En(Tg(this.h),Cl(this.s),Cl(this.l),Ac(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=Ac(this.opacity);return`${e===1?"hsl(":"hsla("}${Tg(this.h)}, ${Cl(this.s)*100}%, ${Cl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Tg(e){return e=(e||0)%360,e<0?e+360:e}function Cl(e){return Math.max(0,Math.min(1,e||0))}function Tu(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 CO(e,t){return function(n){return e+n*t}}function EO(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 MO(e){return(e=+e)==1?b1:function(t,n){return n-t?EO(t,n,e):Bm(isNaN(t)?n:t)}}function b1(e,t){var n=t-e;return n?CO(e,n):Bm(isNaN(e)?t:e)}const Rc=function e(t){var n=MO(t);function r(s,o){var i=n((s=nh(s)).r,(o=nh(o)).r),l=n(s.g,o.g),c=n(s.b,o.b),d=b1(s.opacity,o.opacity);return function(f){return s.r=i(f),s.g=l(f),s.b=c(f),s.opacity=d(f),s+""}}return r.gamma=e,r}(1);function _O(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(o){for(s=0;s<n;++s)r[s]=e[s]*(1-o)+t[s]*o;return r}}function PO(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function DO(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),o=new Array(n),i;for(i=0;i<r;++i)s[i]=Yo(e[i],t[i]);for(;i<n;++i)o[i]=t[i];return function(l){for(i=0;i<r;++i)o[i]=s[i](l);return o}}function TO(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 OO(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]=Yo(e[s],t[s]):r[s]=t[s];return function(o){for(s in n)r[s]=n[s](o);return r}}var rh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ou=new RegExp(rh.source,"g");function AO(e){return function(){return e}}function RO(e){return function(t){return e(t)+""}}function N1(e,t){var n=rh.lastIndex=Ou.lastIndex=0,r,s,o,i=-1,l=[],c=[];for(e=e+"",t=t+"";(r=rh.exec(e))&&(s=Ou.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),l[i]?l[i]+=o:l[++i]=o),(r=r[0])===(s=s[0])?l[i]?l[i]+=s:l[++i]=s:(l[++i]=null,c.push({i,x:Yn(r,s)})),n=Ou.lastIndex;return n<t.length&&(o=t.slice(n),l[i]?l[i]+=o:l[++i]=o),l.length<2?c[0]?RO(c[0].x):AO(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 Yo(e,t){var n=typeof t,r;return t==null||n==="boolean"?Bm(t):(n==="number"?Yn:n==="string"?(r=Xs(t))?(t=r,Rc):N1:t instanceof Xs?Rc:t instanceof Date?TO:PO(t)?_O:Array.isArray(t)?DO:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?OO:Yn)(e,t)}var Og=180/Math.PI,sh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function j1(e,t,n,r,s,o){var i,l,c;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(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,i=-i),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*Og,skewX:Math.atan(c)*Og,scaleX:i,scaleY:l}}var El;function IO(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?sh:j1(t.a,t.b,t.c,t.d,t.e,t.f)}function zO(e){return e==null||(El||(El=document.createElementNS("http://www.w3.org/2000/svg","g")),El.setAttribute("transform",e),!(e=El.transform.baseVal.consolidate()))?sh:(e=e.matrix,j1(e.a,e.b,e.c,e.d,e.e,e.f))}function k1(e,t,n,r){function s(d){return d.length?d.pop()+" ":""}function o(d,f,u,h,m,w){if(d!==u||f!==h){var v=m.push("translate(",null,t,null,n);w.push({i:v-4,x:Yn(d,u)},{i:v-2,x:Yn(f,h)})}else(u||h)&&m.push("translate("+u+t+h+n)}function i(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 v=m.push(s(m)+"scale(",null,",",null,")");w.push({i:v-4,x:Yn(d,u)},{i:v-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),o(d.translateX,d.translateY,f.translateX,f.translateY,u,h),i(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,v=h.length,b;++w<v;)u[(b=h[w]).i]=b.x(m);return u.join("")}}}var $O=k1(IO,"px, ","px)","deg)"),LO=k1(zO,", ",")",")"),FO=1e-12;function Ag(e){return((e=Math.exp(e))+1/e)/2}function BO(e){return((e=Math.exp(e))-1/e)/2}function WO(e){return((e=Math.exp(2*e))-1)/(e+1)}const Kl=function e(t,n,r){function s(o,i){var l=o[0],c=o[1],d=o[2],f=i[0],u=i[1],h=i[2],m=f-l,w=u-c,v=m*m+w*w,b,x;if(v<FO)x=Math.log(h/d)/t,b=function(S){return[l+S*m,c+S*w,d*Math.exp(t*S*x)]};else{var y=Math.sqrt(v),g=(h*h-d*d+r*v)/(2*d*n*y),N=(h*h-d*d-r*v)/(2*h*n*y),j=Math.log(Math.sqrt(g*g+1)-g),k=Math.log(Math.sqrt(N*N+1)-N);x=(k-j)/t,b=function(S){var M=S*x,R=Ag(j),z=d/(n*y)*(R*WO(t*M+j)-BO(j));return[l+z*m,c+z*w,d*R/Ag(t*M+j)]}}return b.duration=x*1e3*t/Math.SQRT2,b}return s.rho=function(o){var i=Math.max(.001,+o),l=i*i,c=l*l;return e(i,l,c)},s}(Math.SQRT2,2,4);var Ga=0,Ao=0,Eo=0,S1=1e3,Ic,Ro,zc=0,qs=0,jd=0,Ni=typeof performance=="object"&&performance.now?performance:Date,C1=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Wm(){return qs||(C1(UO),qs=Ni.now()+jd)}function UO(){qs=0}function $c(){this._call=this._time=this._next=null}$c.prototype=E1.prototype={constructor:$c,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&&Ro!==this&&(Ro?Ro._next=this:Ic=this,Ro=this),this._call=e,this._time=n,ah()},stop:function(){this._call&&(this._call=null,this._time=1/0,ah())}};function E1(e,t,n){var r=new $c;return r.restart(e,t,n),r}function VO(){Wm(),++Ga;for(var e=Ic,t;e;)(t=qs-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ga}function Rg(){qs=(zc=Ni.now())+jd,Ga=Ao=0;try{VO()}finally{Ga=0,YO(),qs=0}}function HO(){var e=Ni.now(),t=e-zc;t>S1&&(jd-=t,zc=e)}function YO(){for(var e,t=Ic,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:Ic=n);Ro=e,ah(r)}function ah(e){if(!Ga){Ao&&(Ao=clearTimeout(Ao));var t=e-qs;t>24?(e<1/0&&(Ao=setTimeout(Rg,e-Ni.now()-jd)),Eo&&(Eo=clearInterval(Eo))):(Eo||(zc=Ni.now(),Eo=setInterval(HO,S1)),Ga=1,C1(Rg))}}function Ig(e,t,n){var r=new $c;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var XO=bd("start","end","cancel","interrupt"),qO=[],M1=0,zg=1,oh=2,Ql=3,$g=4,ih=5,Zl=6;function kd(e,t,n,r,s,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;GO(e,n,{name:t,index:r,group:s,on:XO,tween:qO,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:M1})}function Um(e,t){var n=$n(e,t);if(n.state>M1)throw new Error("too late; already scheduled");return n}function ar(e,t){var n=$n(e,t);if(n.state>Ql)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 GO(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=E1(o,0,n.time);function o(d){n.state=zg,n.timer.restart(i,n.delay,n.time),n.delay<=d&&i(d-n.delay)}function i(d){var f,u,h,m;if(n.state!==zg)return c();for(f in r)if(m=r[f],m.name===n.name){if(m.state===Ql)return Ig(i);m.state===$g?(m.state=Zl,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[f]):+f<t&&(m.state=Zl,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete r[f])}if(Ig(function(){n.state===Ql&&(n.state=$g,n.timer.restart(l,n.delay,n.time),l(d))}),n.state=oh,n.on.call("start",e,e.__data__,n.index,n.group),n.state===oh){for(n.state=Ql,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=ih,1),u=-1,h=s.length;++u<h;)s[u].call(e,f);n.state===ih&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Zl,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function Jl(e,t){var n=e.__transition,r,s,o=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((r=n[i]).name!==t){o=!1;continue}s=r.state>oh&&r.state<ih,r.state=Zl,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}o&&delete e.__transition}}function KO(e){return this.each(function(){Jl(this,e)})}function QO(e,t){var n,r;return function(){var s=ar(this,e),o=s.tween;if(o!==n){r=n=o;for(var i=0,l=r.length;i<l;++i)if(r[i].name===t){r=r.slice(),r.splice(i,1);break}}s.tween=r}}function ZO(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=ar(this,e),i=o.tween;if(i!==r){s=(r=i).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)}o.tween=s}}function JO(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=$n(this.node(),n).tween,s=0,o=r.length,i;s<o;++s)if((i=r[s]).name===e)return i.value;return null}return this.each((t==null?QO:ZO)(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 _1(e,t){var n;return(typeof t=="number"?Yn:t instanceof Xs?Rc:(n=Xs(t))?(t=n,Rc):N1)(e,t)}function eA(e){return function(){this.removeAttribute(e)}}function tA(e){return function(){this.removeAttributeNS(e.space,e.local)}}function nA(e,t,n){var r,s=n+"",o;return function(){var i=this.getAttribute(e);return i===s?null:i===r?o:o=t(r=i,n)}}function rA(e,t,n){var r,s=n+"",o;return function(){var i=this.getAttributeNS(e.space,e.local);return i===s?null:i===r?o:o=t(r=i,n)}}function sA(e,t,n){var r,s,o;return function(){var i,l=n(this),c;return l==null?void this.removeAttribute(e):(i=this.getAttribute(e),c=l+"",i===c?null:i===r&&c===s?o:(s=c,o=t(r=i,l)))}}function aA(e,t,n){var r,s,o;return function(){var i,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),c=l+"",i===c?null:i===r&&c===s?o:(s=c,o=t(r=i,l)))}}function oA(e,t){var n=Nd(e),r=n==="transform"?LO:_1;return this.attrTween(e,typeof t=="function"?(n.local?aA:sA)(n,r,Vm(this,"attr."+e,t)):t==null?(n.local?tA:eA)(n):(n.local?rA:nA)(n,r,t))}function iA(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function lA(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function cA(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&lA(e,o)),n}return s._value=t,s}function dA(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&iA(e,o)),n}return s._value=t,s}function uA(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=Nd(e);return this.tween(n,(r.local?cA:dA)(r,t))}function fA(e,t){return function(){Um(this,e).delay=+t.apply(this,arguments)}}function hA(e,t){return t=+t,function(){Um(this,e).delay=t}}function mA(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?fA:hA)(t,e)):$n(this.node(),t).delay}function pA(e,t){return function(){ar(this,e).duration=+t.apply(this,arguments)}}function xA(e,t){return t=+t,function(){ar(this,e).duration=t}}function gA(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?pA:xA)(t,e)):$n(this.node(),t).duration}function yA(e,t){if(typeof t!="function")throw new Error;return function(){ar(this,e).ease=t}}function vA(e){var t=this._id;return arguments.length?this.each(yA(t,e)):$n(this.node(),t).ease}function wA(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ar(this,e).ease=n}}function bA(e){if(typeof e!="function")throw new Error;return this.each(wA(this._id,e))}function NA(e){typeof e!="function"&&(e=o1(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=[],c,d=0;d<i;++d)(c=o[d])&&e.call(c,c.__data__,d,o)&&l.push(c);return new Er(r,this._parents,this._name,this._id)}function jA(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,o=Math.min(r,s),i=new Array(r),l=0;l<o;++l)for(var c=t[l],d=n[l],f=c.length,u=i[l]=new Array(f),h,m=0;m<f;++m)(h=c[m]||d[m])&&(u[m]=h);for(;l<r;++l)i[l]=t[l];return new Er(i,this._parents,this._name,this._id)}function kA(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 SA(e,t,n){var r,s,o=kA(t)?Um:ar;return function(){var i=o(this,e),l=i.on;l!==r&&(s=(r=l).copy()).on(t,n),i.on=s}}function CA(e,t){var n=this._id;return arguments.length<2?$n(this.node(),n).on.on(e):this.each(SA(n,e,t))}function EA(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function MA(){return this.on("end.remove",EA(this._id))}function _A(e){var t=this._name,n=this._id;typeof e!="function"&&(e=$m(e));for(var r=this._groups,s=r.length,o=new Array(s),i=0;i<s;++i)for(var l=r[i],c=l.length,d=o[i]=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,kd(d[h],t,n,h,d,$n(f,n)));return new Er(o,this._parents,t,n)}function PA(e){var t=this._name,n=this._id;typeof e!="function"&&(e=a1(e));for(var r=this._groups,s=r.length,o=[],i=[],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),v=0,b=h.length;v<b;++v)(m=h[v])&&kd(m,t,n,v,h,w);o.push(h),i.push(f)}return new Er(o,i,t,n)}var DA=Yi.prototype.constructor;function TA(){return new DA(this._groups,this._parents)}function OA(e,t){var n,r,s;return function(){var o=qa(this,e),i=(this.style.removeProperty(e),qa(this,e));return o===i?null:o===n&&i===r?s:s=t(n=o,r=i)}}function P1(e){return function(){this.style.removeProperty(e)}}function AA(e,t,n){var r,s=n+"",o;return function(){var i=qa(this,e);return i===s?null:i===r?o:o=t(r=i,n)}}function RA(e,t,n){var r,s,o;return function(){var i=qa(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),qa(this,e))),i===c?null:i===r&&c===s?o:(s=c,o=t(r=i,l))}}function IA(e,t){var n,r,s,o="style."+t,i="end."+o,l;return function(){var c=ar(this,e),d=c.on,f=c.value[o]==null?l||(l=P1(t)):void 0;(d!==n||s!==f)&&(r=(n=d).copy()).on(i,s=f),c.on=r}}function zA(e,t,n){var r=(e+="")=="transform"?$O:_1;return t==null?this.styleTween(e,OA(e,r)).on("end.style."+e,P1(e)):typeof t=="function"?this.styleTween(e,RA(e,r,Vm(this,"style."+e,t))).each(IA(this._id,e)):this.styleTween(e,AA(e,r,t),n).on("end.style."+e,null)}function $A(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function LA(e,t,n){var r,s;function o(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&$A(e,i,n)),r}return o._value=t,o}function FA(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,LA(e,t,n??""))}function BA(e){return function(){this.textContent=e}}function WA(e){return function(){var t=e(this);this.textContent=t??""}}function UA(e){return this.tween("text",typeof e=="function"?WA(Vm(this,"text",e)):BA(e==null?"":e+""))}function VA(e){return function(t){this.textContent=e.call(this,t)}}function HA(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&VA(s)),t}return r._value=e,r}function YA(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,HA(e))}function XA(){for(var e=this._name,t=this._id,n=D1(),r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],l=i.length,c,d=0;d<l;++d)if(c=i[d]){var f=$n(c,t);kd(c,e,n,d,i,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new Er(r,this._parents,e,n)}function qA(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,i){var l={value:i},c={value:function(){--s===0&&o()}};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&&o()})}var GA=0;function Er(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function D1(){return++GA}var cr=Yi.prototype;Er.prototype={constructor:Er,select:_A,selectAll:PA,selectChild:cr.selectChild,selectChildren:cr.selectChildren,filter:NA,merge:jA,selection:TA,transition:XA,call:cr.call,nodes:cr.nodes,node:cr.node,size:cr.size,empty:cr.empty,each:cr.each,on:CA,attr:oA,attrTween:uA,style:zA,styleTween:FA,text:UA,textTween:YA,remove:MA,tween:JO,delay:mA,duration:gA,ease:vA,easeVarying:bA,end:qA,[Symbol.iterator]:cr[Symbol.iterator]};function KA(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var QA={time:null,delay:0,duration:250,ease:KA};function ZA(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 JA(e){var t,n;e instanceof Er?(t=e._id,e=e._name):(t=D1(),(n=QA).time=Wm(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],l=i.length,c,d=0;d<l;++d)(c=i[d])&&kd(c,e,t,d,i,n||ZA(c,t));return new Er(r,this._parents,e,t)}Yi.prototype.interrupt=KO;Yi.prototype.transition=JA;const Ml=e=>()=>e;function eR(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 Sd=new yr(1,0,0);T1.prototype=yr.prototype;function T1(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Sd;return e.__zoom}function Au(e){e.stopImmediatePropagation()}function Mo(e){e.preventDefault(),e.stopImmediatePropagation()}function tR(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function nR(){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 Lg(){return this.__zoom||Sd}function rR(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function sR(){return navigator.maxTouchPoints||"ontouchstart"in this}function aR(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i))}function O1(){var e=tR,t=nR,n=aR,r=rR,s=sR,o=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Kl,d=bd("start","zoom","end"),f,u,h,m=500,w=150,v=0,b=10;function x(E){E.property("__zoom",Lg).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",z).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)")}x.transform=function(E,$,D,P){var C=E.selection?E.selection():E;C.property("__zoom",Lg),E!==C?j(E,$,D,P):C.interrupt().each(function(){k(this,arguments).event(P).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},x.scaleBy=function(E,$,D,P){x.scaleTo(E,function(){var C=this.__zoom.k,_=typeof $=="function"?$.apply(this,arguments):$;return C*_},D,P)},x.scaleTo=function(E,$,D,P){x.transform(E,function(){var C=t.apply(this,arguments),_=this.__zoom,I=D==null?N(C):typeof D=="function"?D.apply(this,arguments):D,B=_.invert(I),T=typeof $=="function"?$.apply(this,arguments):$;return n(g(y(_,T),I,B),C,i)},D,P)},x.translateBy=function(E,$,D,P){x.transform(E,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),i)},null,P)},x.translateTo=function(E,$,D,P,C){x.transform(E,function(){var _=t.apply(this,arguments),I=this.__zoom,B=P==null?N(_):typeof P=="function"?P.apply(this,arguments):P;return n(Sd.translate(B[0],B[1]).scale(I.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof D=="function"?-D.apply(this,arguments):-D),_,i)},P,C)};function y(E,$){return $=Math.max(o[0],Math.min(o[1],$)),$===E.k?E:new yr($,E.x,E.y)}function g(E,$,D){var P=$[0]-D[0]*E.k,C=$[1]-D[1]*E.k;return P===E.x&&C===E.y?E:new yr(E.k,P,C)}function N(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function j(E,$,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,I=k(C,_).event(P),B=t.apply(C,_),T=D==null?N(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 $=="function"?$.apply(C,_):$,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)}I.zoom(null,ee)}})}function k(E,$,D){return!D&&E.__zooming||new S(E,$)}function S(E,$){this.that=E,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,$),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,$){return this.mouse&&E!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var $=nn(this.that).datum();d.call(E,this.that,new eR(E,{sourceEvent:this.sourceEvent,target:x,transform:this.that.__zoom,dispatch:d}),$)}};function M(E,...$){if(!e.apply(this,arguments))return;var D=k(this,$).event(E),P=this.__zoom,C=Math.max(o[0],Math.min(o[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(_)],Jl(this),D.start()}Mo(E),D.wheel=setTimeout(I,w),D.zoom("mouse",n(g(y(P,C),D.mouse[0],D.mouse[1]),D.extent,i));function I(){D.wheel=null,D.end()}}function R(E,...$){if(h||!e.apply(this,arguments))return;var D=E.currentTarget,P=k(this,$,!0).event(E),C=nn(E.view).on("mousemove.zoom",T,!0).on("mouseup.zoom",F,!0),_=Sn(E,D),I=E.clientX,B=E.clientY;x1(E.view),Au(E),P.mouse=[_,this.__zoom.invert(_)],Jl(this),P.start();function T(H){if(Mo(H),!P.moved){var X=H.clientX-I,J=H.clientY-B;P.moved=X*X+J*J>v}P.event(H).zoom("mouse",n(g(P.that.__zoom,P.mouse[0]=Sn(H,D),P.mouse[1]),P.extent,i))}function F(H){C.on("mousemove.zoom mouseup.zoom",null),g1(H.view,P.moved),Mo(H),P.event(H).end()}}function z(E,...$){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),I=n(g(y(D,_),P,C),t.apply(this,$),i);Mo(E),l>0?nn(this).transition().duration(l).call(j,I,P,E):nn(this).call(x.transform,I,P,E)}}function A(E,...$){if(e.apply(this,arguments)){var D=E.touches,P=D.length,C=k(this,$,E.changedTouches.length===P).event(E),_,I,B,T;for(Au(E),I=0;I<P;++I)B=D[I],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)),Jl(this),C.start())}}function O(E,...$){if(this.__zooming){var D=k(this,$).event(E),P=E.changedTouches,C=P.length,_,I,B,T;for(Mo(E),_=0;_<C;++_)I=P[_],B=Sn(I,this),D.touch0&&D.touch0[2]===I.identifier?D.touch0[0]=B:D.touch1&&D.touch1[2]===I.identifier&&(D.touch1[0]=B);if(I=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;I=y(I,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(g(I,B,T),D.extent,i))}}function L(E,...$){if(this.__zooming){var D=k(this,$).event(E),P=E.changedTouches,C=P.length,_,I;for(Au(E),h&&clearTimeout(h),h=setTimeout(function(){h=null},m),_=0;_<C;++_)I=P[_],D.touch0&&D.touch0[2]===I.identifier?delete D.touch0:D.touch1&&D.touch1[2]===I.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&&(I=Sn(I,this),Math.hypot(u[0]-I[0],u[1]-I[1])<b)){var B=nn(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return x.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:Ml(+E),x):r},x.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Ml(!!E),x):e},x.touchable=function(E){return arguments.length?(s=typeof E=="function"?E:Ml(!!E),x):s},x.extent=function(E){return arguments.length?(t=typeof E=="function"?E:Ml([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),x):t},x.scaleExtent=function(E){return arguments.length?(o[0]=+E[0],o[1]=+E[1],x):[o[0],o[1]]},x.translateExtent=function(E){return arguments.length?(i[0][0]=+E[0][0],i[1][0]=+E[1][0],i[0][1]=+E[0][1],i[1][1]=+E[1][1],x):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},x.constrain=function(E){return arguments.length?(n=E,x):n},x.duration=function(E){return arguments.length?(l=+E,x):l},x.interpolate=function(E){return arguments.length?(c=E,x):c},x.on=function(){var E=d.on.apply(d,arguments);return E===d?x:E},x.clickDistance=function(E){return arguments.length?(v=(E=+E)*E,x):Math.sqrt(v)},x.tapDistance=function(E){return arguments.length?(b=+E,x):b},x}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."},ji=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],A1=["Enter"," ","Escape"],R1={"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 Ka;(function(e){e.Strict="strict",e.Loose="loose"})(Ka||(Ka={}));var Rs;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Rs||(Rs={}));var ki;(function(e){e.Partial="partial",e.Full="full"})(ki||(ki={}));const I1={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 Lc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Lc||(Lc={}));var ye;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ye||(ye={}));const Fg={[ye.Left]:ye.Right,[ye.Right]:ye.Left,[ye.Top]:ye.Bottom,[ye.Bottom]:ye.Top};function z1(e){return e===null?null:e?"valid":"invalid"}const $1=e=>"id"in e&&"source"in e&&"target"in e,oR=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),qi=(e,t=[0,0])=>{const{width:n,height:r}=_r(e),s=e.origin??t,o=n*s[0],i=r*s[1];return{x:e.position.x-o,y:e.position.y-i}},iR=(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 o=typeof s=="string";let i=!t.nodeLookup&&!o?s:void 0;t.nodeLookup&&(i=o?t.nodeLookup.get(s):Hm(s)?s:t.nodeLookup.get(s.id));const l=i?Fc(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Cd(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ed(n)},Gi=(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=Fc(r);n=Cd(n,s)}}),Ed(n)},Ym=(e,t,[n,r,s]=[0,0,1],o=!1,i=!1)=>{const l={...Qi(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(i&&!u||h)continue;const m=f.width??d.width??d.initialWidth??null,w=f.height??d.height??d.initialHeight??null,v=Si(l,Za(d)),b=(m??0)*(w??0),x=o&&v>0;(!d.internals.handleBounds||x||v>=b||d.dragging)&&c.push(d)}return c},lR=(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 cR(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 dR({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},i){if(e.size===0)return Promise.resolve(!0);const l=cR(e,i),c=Gi(l),d=Xm(c,t,n,(i==null?void 0:i.minZoom)??s,(i==null?void 0:i.maxZoom)??o,(i==null?void 0:i.padding)??.1);return await r.setViewport(d,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)}function L1({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:o}){const i=n.get(e),l=i.parentId?n.get(i.parentId):void 0,{x:c,y:d}=l?l.internals.positionAbsolute:{x:0,y:0},f=i.origin??r;let u=i.extent||s;if(i.extent==="parent"&&!i.expandParent)if(!l)o==null||o("005",nr.error005());else{const m=l.measured.width,w=l.measured.height;m&&w&&(u=[[c,d],[c+m,d+w]])}else l&&Ja(i.extent)&&(u=[[i.extent[0][0]+c,i.extent[0][1]+d],[i.extent[1][0]+c,i.extent[1][1]+d]]);const h=Ja(u)?Gs(t,u,i.measured):t;return(i.measured.width===void 0||i.measured.height===void 0)&&(o==null||o("015",nr.error015())),{position:{x:h.x-c+(i.measured.width??0)*f[0],y:h.y-d+(i.measured.height??0)*f[1]},positionAbsolute:h}}async function uR({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const o=new Set(e.map(h=>h.id)),i=[];for(const h of n){if(h.deletable===!1)continue;const m=o.has(h.id),w=!m&&h.parentId&&i.find(v=>v.id===h.parentId);(m||w)&&i.push(h)}const l=new Set(t.map(h=>h.id)),c=r.filter(h=>h.deletable!==!1),f=lR(i,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:i};const u=await s({nodes:i,edges:f});return typeof u=="boolean"?u?{edges:f,nodes:i}:{edges:[],nodes:[]}:u}const Qa=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Gs=(e={x:0,y:0},t,n)=>({x:Qa(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Qa(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function F1(e,t,n){const{width:r,height:s}=_r(n),{x:o,y:i}=n.internals.positionAbsolute;return Gs(e,[[o,i],[o+r,i+s]],t)}const Bg=(e,t,n)=>e<t?Qa(Math.abs(e-t),1,t)/t:e>n?-Qa(Math.abs(e-n),1,t)/t:0,B1=(e,t,n=15,r=40)=>{const s=Bg(e.x,r,t.width-r)*n,o=Bg(e.y,r,t.height-r)*n;return[s,o]},Cd=(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)}),lh=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Ed=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Za=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=Hm(e)?e.internals.positionAbsolute:qi(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Fc=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=Hm(e)?e.internals.positionAbsolute:qi(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},W1=(e,t)=>Ed(Cd(lh(e),lh(t))),Si=(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)},Wg=e=>_n(e.width)&&_n(e.height)&&_n(e.x)&&_n(e.y),_n=e=>!isNaN(e)&&isFinite(e),fR=(e,t)=>{},Ki=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Qi=({x:e,y:t},[n,r,s],o=!1,i=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return o?Ki(l,i):l},Bc=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function oa(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 hR(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=oa(e,n),s=oa(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=oa(e.top??e.y??0,n),s=oa(e.bottom??e.y??0,n),o=oa(e.left??e.x??0,t),i=oa(e.right??e.x??0,t);return{top:r,right:i,bottom:s,left:o,x:o+i,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function mR(e,t,n,r,s,o){const{x:i,y:l}=Bc(e,[t,n,r]),{x:c,y:d}=Bc({x:e.x+e.width,y:e.y+e.height},[t,n,r]),f=s-c,u=o-d;return{left:Math.floor(i),top:Math.floor(l),right:Math.floor(f),bottom:Math.floor(u)}}const Xm=(e,t,n,r,s,o)=>{const i=hR(o,t,n),l=(t-i.x)/e.width,c=(n-i.y)/e.height,d=Math.min(l,c),f=Qa(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,v=mR(e,m,w,f,t,n),b={left:Math.min(v.left-i.left,0),top:Math.min(v.top-i.top,0),right:Math.min(v.right-i.right,0),bottom:Math.min(v.bottom-i.bottom,0)};return{x:m-b.left+b.right,y:w-b.top+b.bottom,zoom:f}},Ci=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ja(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 U1(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 V1(e,t={width:0,height:0},n,r,s){const o={...e},i=r.get(n);if(i){const l=i.origin||s;o.x+=i.internals.positionAbsolute.x-(t.width??0)*l[0],o.y+=i.internals.positionAbsolute.y-(t.height??0)*l[1]}return o}function Ug(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function pR(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function xR(e){return{...R1,...e||{}}}function Xo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:i}=Pn(e),l=Qi({x:o-((s==null?void 0:s.left)??0),y:i-((s==null?void 0:s.top)??0)},r),{x:c,y:d}=n?Ki(l,t):l;return{xSnapped:c,ySnapped:d,...l}}const qm=e=>({width:e.offsetWidth,height:e.offsetHeight}),H1=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},gR=["INPUT","SELECT","TEXTAREA"];function Y1(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:gR.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const X1=e=>"clientX"in e,Pn=(e,t)=>{var o,i;const n=X1(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,s=n?e.clientY:(i=e.touches)==null?void 0:i[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},Vg=(e,t,n,r,s)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(i=>{const l=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:e,nodeId:s,position:i.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...qm(i)}})};function q1({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:i,targetControlY:l}){const c=e*.125+s*.375+i*.375+n*.125,d=t*.125+o*.375+l*.375+r*.125,f=Math.abs(c-e),u=Math.abs(d-t);return[c,d,f,u]}function _l(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Hg({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case ye.Left:return[t-_l(t-r,o),n];case ye.Right:return[t+_l(r-t,o),n];case ye.Top:return[t,n-_l(n-s,o)];case ye.Bottom:return[t,n+_l(s-n,o)]}}function G1({sourceX:e,sourceY:t,sourcePosition:n=ye.Bottom,targetX:r,targetY:s,targetPosition:o=ye.Top,curvature:i=.25}){const[l,c]=Hg({pos:n,x1:e,y1:t,x2:r,y2:s,c:i}),[d,f]=Hg({pos:o,x1:r,y1:s,x2:e,y2:t,c:i}),[u,h,m,w]=q1({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 K1({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,o=n<e?n+s:n-s,i=Math.abs(r-t)/2,l=r<t?r+i:r-i;return[o,l,s,i]}function yR({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r,elevateOnSelect:s=!1}){if(r!==void 0)return r;const o=s&&n?1e3:0,i=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return o+i}function vR({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=Cd(Fc(e),Fc(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const i={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:r/s[2]};return Si(i,Ed(o))>0}const wR=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,bR=(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)),Q1=(e,t)=>{if(!e.source||!e.target)return t;let n;return $1(e)?n={...e}:n={...e,id:wR(e)},bR(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function Z1({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,i,l]=K1({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,i,l]}const Yg={[ye.Left]:{x:-1,y:0},[ye.Right]:{x:1,y:0},[ye.Top]:{x:0,y:-1},[ye.Bottom]:{x:0,y:1}},NR=({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},Xg=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function jR({source:e,sourcePosition:t=ye.Bottom,target:n,targetPosition:r=ye.Top,center:s,offset:o,stepPosition:i}){const l=Yg[t],c=Yg[r],d={x:e.x+l.x*o,y:e.y+l.y*o},f={x:n.x+c.x*o,y:n.y+c.y*o},u=NR({source:d,sourcePosition:t,target:f}),h=u.x!==0?"x":"y",m=u[h];let w=[],v,b;const x={x:0,y:0},y={x:0,y:0},[,,g,N]=K1({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(v=s.x??d.x+(f.x-d.x)*i,b=s.y??(d.y+f.y)/2):(v=s.x??(d.x+f.x)/2,b=s.y??d.y+(f.y-d.y)*i);const k=[{x:v,y:d.y},{x:v,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<=o){const L=Math.min(o-1,o-O);l[h]===m?x[h]=(d[h]>e[h]?-1:1)*L:y[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],$=d[O]<f[O];(l[h]===1&&(!L&&E||L&&$)||l[h]!==1&&(!L&&$||L&&E))&&(w=h==="x"?k:S)}const M={x:d.x+x.x,y:d.y+x.y},R={x:f.x+y.x,y:f.y+y.y},z=Math.max(Math.abs(M.x-w[0].x),Math.abs(R.x-w[0].x)),A=Math.max(Math.abs(M.y-w[0].y),Math.abs(R.y-w[0].y));z>=A?(v=(M.x+R.x)/2,b=w[0].y):(v=w[0].x,b=(M.y+R.y)/2)}return[[e,{x:d.x+x.x,y:d.y+x.y},...w,{x:f.x+y.x,y:f.y+y.y},n],v,b,g,N]}function kR(e,t,n,r){const s=Math.min(Xg(e,t)/2,Xg(t,n)/2,r),{x:o,y:i}=t;if(e.x===o&&o===n.x||e.y===i&&i===n.y)return`L${o} ${i}`;if(e.y===i){const d=e.x<n.x?-1:1,f=e.y<n.y?1:-1;return`L ${o+s*d},${i}Q ${o},${i} ${o},${i+s*f}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${o},${i+s*c}Q ${o},${i} ${o+s*l},${i}`}function ch({sourceX:e,sourceY:t,sourcePosition:n=ye.Bottom,targetX:r,targetY:s,targetPosition:o=ye.Top,borderRadius:i=5,centerX:l,centerY:c,offset:d=20,stepPosition:f=.5}){const[u,h,m,w,v]=jR({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:l,y:c},offset:d,stepPosition:f});return[u.reduce((x,y,g)=>{let N="";return g>0&&g<u.length-1?N=kR(u[g-1],y,u[g+1],i):N=`${g===0?"M":"L"}${y.x} ${y.y}`,x+=N,x},""),h,m,w,v]}function qg(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function SR(e){var u;const{sourceNode:t,targetNode:n}=e;if(!qg(t)||!qg(n))return null;const r=t.internals.handleBounds||Gg(t.handles),s=n.internals.handleBounds||Gg(n.handles),o=Kg((r==null?void 0:r.source)??[],e.sourceHandle),i=Kg(e.connectionMode===Ka.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!o||!i)return(u=e.onError)==null||u.call(e,"008",nr.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(o==null?void 0:o.position)||ye.Bottom,c=(i==null?void 0:i.position)||ye.Top,d=Ei(t,o,l),f=Ei(n,i,c);return{sourceX:d.x,sourceY:d.y,targetX:f.x,targetY:f.y,sourcePosition:l,targetPosition:c}}function Gg(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 Ei(e,t,n=ye.Left,r=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:i,height:l}=t??_r(e);if(r)return{x:s+i/2,y:o+l/2};switch((t==null?void 0:t.position)??n){case ye.Top:return{x:s+i/2,y:o};case ye.Right:return{x:s+i,y:o+l/2};case ye.Bottom:return{x:s+i/2,y:o+l};case ye.Left:return{x:s,y:o+l/2}}}function Kg(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function dh(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function CR(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const o=new Set;return e.reduce((i,l)=>([l.markerStart||r,l.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const d=dh(c,t);o.has(d)||(i.push({id:d,color:c.color||n,...c}),o.add(d))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))}const Gm={nodeOrigin:[0,0],nodeExtent:ji,elevateNodesOnSelect:!0,defaults:{}},ER={...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 MR(e,t,n){const r=Km(Gm,n);for(const s of e.values())if(s.parentId)Qm(s,e,t,r);else{const o=qi(s,r.nodeOrigin),i=Ja(s.extent)?s.extent:r.nodeExtent,l=Gs(o,i,_r(s));s.internals.positionAbsolute=l}}function _R(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 o={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(o):s.type==="target"&&r.push(o)}return{source:n,target:r}}function uh(e,t,n,r){var c,d;const s=Km(ER,r);let o=e.length>0;const i=new Map(t),l=s!=null&&s.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const f of e){let u=i.get(f.id);if(s.checkEquality&&f===(u==null?void 0:u.internals.userNode))t.set(f.id,u);else{const h=qi(f,s.nodeOrigin),m=Ja(f.extent)?f.extent:s.nodeExtent,w=Gs(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:_R(f,u),z:J1(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&&(o=!1),f.parentId&&Qm(u,t,n,r)}return o}function PR(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:o,nodeExtent:i}=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}PR(e,n);const d=s?1e3:0,{x:f,y:u,z:h}=DR(e,c,o,i,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 J1(e,t){return(_n(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function DR(e,t,n,r,s){const{x:o,y:i}=t.internals.positionAbsolute,l=_r(e),c=qi(e,n),d=Ja(e.extent)?Gs(c,e.extent,l):c;let f=Gs({x:o+d.x,y:i+d.y},r,l);e.extent==="parent"&&(f=F1(f,l,t));const u=J1(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 i;const s=[],o=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const d=((i=o.get(l.parentId))==null?void 0:i.expandedRect)??Za(c),f=W1(d,l.rect);o.set(l.parentId,{expandedRect:f,parent:c})}return o.size>0&&o.forEach(({expandedRect:l,parent:c},d)=>{var g;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,v=Math.max(u.width,Math.round(l.width)),b=Math.max(u.height,Math.round(l.height)),x=(v-u.width)*h[0],y=(b-u.height)*h[1];(m>0||w>0||x||y)&&(s.push({id:d,type:"position",position:{x:c.position.x-m+x,y:c.position.y-w+y}}),(g=n.get(d))==null||g.forEach(N=>{e.some(j=>j.id===N.id)||s.push({id:N.id,type:"position",position:{x:N.position.x+m,y:N.position.y+w}})})),(u.width<l.width||u.height<l.height||m||w)&&s.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:v+(m?h[0]*m-x:0),height:b+(w?h[1]*w-y:0)}})}),s}function TR(e,t,n,r,s,o){const i=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!i)return{changes:[],updatedInternals:l};const c=[],d=window.getComputedStyle(i),{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),v=m.measured.width!==w.width||m.measured.height!==w.height;if(!!(w.width&&w.height&&(v||!m.internals.handleBounds||h.force))){const x=h.nodeElement.getBoundingClientRect(),y=Ja(m.extent)?m.extent:o;let{positionAbsolute:g}=m.internals;m.parentId&&m.extent==="parent"?g=F1(g,w,t.get(m.parentId)):y&&(g=Gs(g,y,w));const N={...m,measured:w,internals:{...m.internals,positionAbsolute:g,handleBounds:{source:Vg("source",h.nodeElement,x,f,m.id),target:Vg("target",h.nodeElement,x,f,m.id)}}};t.set(m.id,N),m.parentId&&Qm(N,t,n,{nodeOrigin:s}),l=!0,v&&(c.push({id:m.id,type:"dimensions",dimensions:w}),m.expandParent&&m.parentId&&u.push({id:m.id,parentId:m.parentId,rect:Za(N,s)}))}}if(u.length>0){const h=Zm(u,t,n,s);c.push(...h)}return{changes:c,updatedInternals:l}}async function OR({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const i=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,o]],r),l=!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2]);return Promise.resolve(l)}function Qg(e,t,n,r,s,o){let i=s;const l=r.get(i)||new Map;r.set(i,l.set(n,t)),i=`${s}-${e}`;const c=r.get(i)||new Map;if(r.set(i,c.set(n,t)),o){i=`${s}-${e}-${o}`;const d=r.get(i)||new Map;r.set(i,d.set(n,t))}}function eN(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:o,sourceHandle:i=null,targetHandle:l=null}=r,c={edgeId:r.id,source:s,target:o,sourceHandle:i,targetHandle:l},d=`${s}-${i}--${o}-${l}`,f=`${o}-${l}--${s}-${i}`;Qg("source",c,f,e,s,i),Qg("target",c,d,e,o,l),t.set(r.id,r)}}function tN(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:tN(n,t):!1}function Zg(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 AR(e,t,n,r){const s=new Map;for(const[o,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!tN(i,e))&&(i.draggable||t&&typeof i.draggable>"u")){const l=e.get(o);l&&s.set(o,{id:o,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 Ru({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var i,l,c;const s=[];for(const[d,f]of t){const u=(i=n.get(d))==null?void 0:i.internals.userNode;u&&s.push({...u,position:f.position,dragging:r})}if(!e)return[s[0],s];const o=(l=n.get(e))==null?void 0:l.internals.userNode;return[o?{...o,position:((c=t.get(e))==null?void 0:c.position)||o.position,dragging:r}:s[0],s]}function RR({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const o={x:n-s.distance.x,y:r-s.distance.y},i=Ki(o,t);return{x:i.x-o.x,y:i.y-o.y}}function IR({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let o={x:null,y:null},i=0,l=new Map,c=!1,d={x:0,y:0},f=null,u=!1,h=null,m=!1,w=!1,v=null;function b({noDragClassName:y,handleSelector:g,domNode:N,isSelectable:j,nodeId:k,nodeClickDistance:S=0}){h=nn(N);function M({x:O,y:L}){const{nodeLookup:E,nodeExtent:$,snapGrid:D,snapToGrid:P,nodeOrigin:C,onNodeDrag:_,onSelectionDrag:I,onError:B,updateNodePositions:T}=t();o={x:O,y:L};let F=!1;const H=l.size>1,X=H&&$?lh(Gi(l)):null,J=H&&P?RR({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)}:Ki(ne,D));let me=null;if(H&&$&&!K.extent&&X){const{positionAbsolute:Z}=K.internals,ae=Z.x-X.x+$[0][0],fe=Z.x+K.measured.width-X.x2+$[1][0],pe=Z.y-X.y+$[0][1],Se=Z.y+K.measured.height-X.y2+$[1][1];me=[[ae,pe],[fe,Se]]}const{position:W,positionAbsolute:Q}=L1({nodeId:ee,nextPosition:ne,nodeLookup:E,nodeExtent:me||$,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),v&&(r||_||!k&&I))){const[ee,K]=Ru({nodeId:k,dragItems:l,nodeLookup:E});r==null||r(v,l,ee,K),_==null||_(v,ee,K),k||I==null||I(v,K)}}async function R(){if(!f)return;const{transform:O,panBy:L,autoPanSpeed:E,autoPanOnNodeDrag:$}=t();if(!$){c=!1,cancelAnimationFrame(i);return}const[D,P]=B1(d,f,E);(D!==0||P!==0)&&(o.x=(o.x??0)-D/O[2],o.y=(o.y??0)-P/O[2],await L({x:D,y:P})&&M(o)),i=requestAnimationFrame(R)}function z(O){var H;const{nodeLookup:L,multiSelectionActive:E,nodesDraggable:$,transform:D,snapGrid:P,snapToGrid:C,selectNodesOnDrag:_,onNodeDragStart:I,onSelectionDragStart:B,unselectNodesAndEdges:T}=t();u=!0,(!_||!j)&&!E&&k&&((H=L.get(k))!=null&&H.selected||T()),j&&_&&k&&(e==null||e(k));const F=Xo(O.sourceEvent,{transform:D,snapGrid:P,snapToGrid:C,containerBounds:f});if(o=F,l=AR(L,$,F,k),l.size>0&&(n||I||!k&&B)){const[X,J]=Ru({nodeId:k,dragItems:l,nodeLookup:L});n==null||n(O.sourceEvent,l,X,J),I==null||I(O.sourceEvent,X,J),k||B==null||B(O.sourceEvent,J)}}const A=y1().clickDistance(S).on("start",O=>{const{domNode:L,nodeDragThreshold:E,transform:$,snapGrid:D,snapToGrid:P}=t();f=(L==null?void 0:L.getBoundingClientRect())||null,m=!1,w=!1,v=O.sourceEvent,E===0&&z(O),o=Xo(O.sourceEvent,{transform:$,snapGrid:D,snapToGrid:P,containerBounds:f}),d=Pn(O.sourceEvent,f)}).on("drag",O=>{const{autoPanOnNodeDrag:L,transform:E,snapGrid:$,snapToGrid:D,nodeDragThreshold:P,nodeLookup:C}=t(),_=Xo(O.sourceEvent,{transform:E,snapGrid:$,snapToGrid:D,containerBounds:f});if(v=O.sourceEvent,(O.sourceEvent.type==="touchmove"&&O.sourceEvent.touches.length>1||k&&!C.has(k))&&(m=!0),!m){if(!c&&L&&u&&(c=!0,R()),!u){const I=Pn(O.sourceEvent,f),B=I.x-d.x,T=I.y-d.y;Math.sqrt(B*B+T*T)>P&&z(O)}(o.x!==_.xSnapped||o.y!==_.ySnapped)&&l&&u&&(d=Pn(O.sourceEvent,f),M(_))}}).on("end",O=>{if(!(!u||m)&&(c=!1,u=!1,cancelAnimationFrame(i),l.size>0)){const{nodeLookup:L,updateNodePositions:E,onNodeDragStop:$,onSelectionDragStop:D}=t();if(w&&(E(l,!1),w=!1),s||$||!k&&D){const[P,C]=Ru({nodeId:k,dragItems:l,nodeLookup:L,dragging:!1});s==null||s(O.sourceEvent,l,P,C),$==null||$(O.sourceEvent,P,C),k||D==null||D(O.sourceEvent,C)}}}).filter(O=>{const L=O.target;return!O.button&&(!y||!Zg(L,`.${y}`,N))&&(!g||Zg(L,g,N))});h.call(A)}function x(){h==null||h.on(".drag",null)}return{update:b,destroy:x}}function zR(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())Si(s,Za(o))>0&&r.push(o);return r}const $R=250;function LR(e,t,n,r){var l,c;let s=[],o=1/0;const i=zR(e,n,t+$R);for(const d of i){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}=Ei(d,u,u.position,!0),w=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(m-e.y,2));w>t||(w<o?(s=[{...u,x:h,y:m}],o=w):w===o&&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 nN(e,t,n,r,s,o=!1){var d,f,u;const i=r.get(e);if(!i)return null;const l=s==="strict"?(d=i.internals.handleBounds)==null?void 0:d[t]:[...((f=i.internals.handleBounds)==null?void 0:f.source)??[],...((u=i.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&&o?{...c,...Ei(i,c,c.position,!0)}:c}function rN(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function FR(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const sN=()=>!0;function BR(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:i,domNode:l,nodeLookup:c,lib:d,autoPanOnConnect:f,flowId:u,panBy:h,cancelConnection:m,onConnectStart:w,onConnect:v,onConnectEnd:b,isValidConnection:x=sN,onReconnectEnd:y,updateConnection:g,getTransform:N,getFromHandle:j,autoPanSpeed:k,dragThreshold:S=1,handleDomNode:M}){const R=H1(e.target);let z=0,A;const{x:O,y:L}=Pn(e),E=rN(o,M),$=l==null?void 0:l.getBoundingClientRect();let D=!1;if(!$||!E)return;const P=nN(s,E,r,c,t);if(!P)return;let C=Pn(e,$),_=!1,I=null,B=!1,T=null;function F(){if(!f||!$)return;const[W,Q]=B1(C,$,k);h({x:W,y:Q}),z=requestAnimationFrame(F)}const H={...P,nodeId:s,type:E,position:P.position},X=c.get(s);let ee={inProgress:!0,isValid:null,from:Ei(X,H,ye.Left,!0),fromHandle:H,fromPosition:H.position,fromNode:X,to:C,toHandle:null,toPosition:Fg[H.position],toNode:null};function K(){D=!0,g(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(!j()||!H){me(W);return}const Q=N();C=Pn(W,$),A=LR(Qi(C,Q,!1,[1,1]),n,c,H),_||(F(),_=!0);const Z=aN(W,{handle:A,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:i?"target":"source",isValidConnection:x,doc:R,lib:d,flowId:u,nodeLookup:c});T=Z.handleDomNode,I=Z.connection,B=FR(!!A,Z.isValid);const ae={...ee,isValid:B,to:Z.toHandle&&B?Bc({x:Z.toHandle.x,y:Z.toHandle.y},Q):C,toHandle:Z.toHandle,toPosition:B&&Z.toHandle?Z.toHandle.position:Fg[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||(g(ae),ee=ae)}function me(W){if(!("touches"in W&&W.touches.length>0)){if(D){(A||T)&&I&&B&&(v==null||v(I));const{inProgress:Q,...Z}=ee,ae={...Z,toPosition:ee.toHandle?ee.toPosition:null};b==null||b(W,ae),o&&(y==null||y(W,ae))}m(),cancelAnimationFrame(z),_=!1,B=!1,I=null,T=null,R.removeEventListener("mousemove",ne),R.removeEventListener("mouseup",me),R.removeEventListener("touchmove",ne),R.removeEventListener("touchend",me)}}R.addEventListener("mousemove",ne),R.addEventListener("mouseup",me),R.addEventListener("touchmove",ne),R.addEventListener("touchend",me)}function aN(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:i,lib:l,flowId:c,isValidConnection:d=sN,nodeLookup:f}){const u=o==="target",h=t?i.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),v=i.elementFromPoint(m,w),b=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:h,x={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const y=rN(void 0,b),g=b.getAttribute("data-nodeid"),N=b.getAttribute("data-handleid"),j=b.classList.contains("connectable"),k=b.classList.contains("connectableend");if(!g||!y)return x;const S={source:u?g:r,sourceHandle:u?N:s,target:u?r:g,targetHandle:u?s:N};x.connection=S;const R=j&&k&&(n===Ka.Strict?u&&y==="source"||!u&&y==="target":g!==r||N!==s);x.isValid=R&&d(S),x.toHandle=nN(g,y,N,f,n,!0)}return x}const fh={onPointerDown:BR,isValid:aN};function WR({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=nn(e);function o({translateExtent:l,width:c,height:d,zoomStep:f=1,pannable:u=!0,zoomable:h=!0,inversePan:m=!1}){const w=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const N=n(),j=g.sourceEvent.ctrlKey&&Ci()?10:1,k=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*f,S=N[2]*Math.pow(2,k*j);t.scaleTo(S)};let v=[0,0];const b=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(v=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},x=g=>{const N=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const j=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],k=[j[0]-v[0],j[1]-v[1]];v=j;const S=r()*Math.max(N[2],Math.log(N[2]))*(m?-1:1),M={x:N[0]-k[0]*S,y:N[1]-k[1]*S},R=[[0,0],[c,d]];t.setViewportConstrained({x:M.x,y:M.y,zoom:N[2]},R,l)},y=O1().on("start",b).on("zoom",u?x:null).on("zoom.wheel",h?w:null);s.call(y,{})}function i(){s.on("zoom",null)}return{update:o,destroy:i,pointer:Sn}}const UR=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Md=e=>({x:e.x,y:e.y,zoom:e.k}),Iu=({x:e,y:t,zoom:n})=>Sd.translate(e,t).scale(n),Na=(e,t)=>e.target.closest(`.${t}`),oN=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),VR=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,zu=(e,t=0,n=VR,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},iN=e=>{const t=e.ctrlKey&&Ci()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function HR({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:d}){return f=>{if(Na(f,t))return!1;f.preventDefault(),f.stopImmediatePropagation();const u=n.property("__zoom").k||1;if(f.ctrlKey&&i){const b=Sn(f),x=iN(f),y=u*Math.pow(2,x);r.scaleTo(n,y,b,f);return}const h=f.deltaMode===1?20:1;let m=s===Rs.Vertical?0:f.deltaX*h,w=s===Rs.Horizontal?0:f.deltaY*h;!Ci()&&f.shiftKey&&s!==Rs.Vertical&&(m=f.deltaY*h,w=0),r.translateBy(n,-(m/u)*o,-(w/u)*o,{internal:!0});const v=Md(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(f,v)),e.isPanScrolling&&(c==null||c(f,v),e.panScrollTimeout=setTimeout(()=>{d==null||d(f,v),e.isPanScrolling=!1},150))}}function YR({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const o=r.type==="wheel",i=!t&&o&&!r.ctrlKey,l=Na(r,e);if(r.ctrlKey&&o&&l&&r.preventDefault(),i||l)return null;r.preventDefault(),n.call(this,r,s)}}function XR({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,i,l;if((o=r.sourceEvent)!=null&&o.internal)return;const s=Md(r.transform);e.mouseButton=((i=r.sourceEvent)==null?void 0:i.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 qR({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var i,l;e.usedRightMouseButton=!!(n&&oN(t,e.mouseButton??0)),(i=o.sourceEvent)!=null&&i.sync||r([o.transform.x,o.transform.y,o.transform.k]),s&&!((l=o.sourceEvent)!=null&&l.internal)&&(s==null||s(o.sourceEvent,Md(o.transform)))}}function GR({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:o}){return i=>{var l;if(!((l=i.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,o&&oN(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&o(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),s&&UR(e.prevViewport,i.transform))){const c=Md(i.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(i.sourceEvent,c)},n?150:0)}}}function KR({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:i,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"&&(Na(u,`${d}-flow__node`)||Na(u,`${d}-flow__edge`)))return!0;if(!r&&!h&&!s&&!o&&!n||i||f&&!w||Na(u,l)&&w||Na(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 v=Array.isArray(r)&&r.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||w)&&v}}function QR({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:s,viewport:o,onPanZoom:i,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=O1().clickDistance(!_n(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(s),m=nn(e).call(h);g({x:o.x,y:o.y,zoom:Qa(o.zoom,t,n)},[[0,0],[u.width,u.height]],s);const w=m.on("wheel.zoom"),v=m.on("dblclick.zoom");h.wheelDelta(iN);function b(O,L){return m?new Promise(E=>{h==null||h.interpolate((L==null?void 0:L.interpolate)==="linear"?Yo:Kl).transform(zu(m,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>E(!0)),O)}):Promise.resolve(!1)}function x({noWheelClassName:O,noPanClassName:L,onPaneContextMenu:E,userSelectionActive:$,panOnScroll:D,panOnDrag:P,panOnScrollMode:C,panOnScrollSpeed:_,preventScrolling:I,zoomOnPinch:B,zoomOnScroll:T,zoomOnDoubleClick:F,zoomActivationKeyPressed:H,lib:X,onTransformChange:J,connectionInProgress:ee}){$&&!f.isZoomingOrPanning&&y();const ne=D&&!H&&!$?HR({zoomPanValues:f,noWheelClassName:O,d3Selection:m,d3Zoom:h,panOnScrollMode:C,panOnScrollSpeed:_,zoomOnPinch:B,onPanZoomStart:l,onPanZoom:i,onPanZoomEnd:c}):YR({noWheelClassName:O,preventScrolling:I,d3ZoomHandler:w});if(m.on("wheel.zoom",ne,{passive:!1}),!$){const W=XR({zoomPanValues:f,onDraggingChange:d,onPanZoomStart:l});h.on("start",W);const Q=qR({zoomPanValues:f,panOnDrag:P,onPaneContextMenu:!!E,onPanZoom:i,onTransformChange:J});h.on("zoom",Q);const Z=GR({zoomPanValues:f,panOnDrag:P,panOnScroll:D,onPaneContextMenu:E,onPanZoomEnd:c,onDraggingChange:d});h.on("end",Z)}const me=KR({zoomActivationKeyPressed:H,panOnDrag:P,zoomOnScroll:T,panOnScroll:D,zoomOnDoubleClick:F,zoomOnPinch:B,userSelectionActive:$,noPanClassName:L,noWheelClassName:O,lib:X,connectionInProgress:ee});h.filter(me),F?m.on("dblclick.zoom",v):m.on("dblclick.zoom",null)}function y(){h.on("zoom",null)}async function g(O,L,E){const $=Iu(O),D=h==null?void 0:h.constrain()($,L,E);return D&&await b(D),new Promise(P=>P(D))}async function N(O,L){const E=Iu(O);return await b(E,L),new Promise($=>$(E))}function j(O){if(m){const L=Iu(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?T1(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"?Yo:Kl).scaleTo(zu(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"?Yo:Kl).scaleBy(zu(m,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>E(!0)),O)}):Promise.resolve(!1)}function R(O){h==null||h.scaleExtent(O)}function z(O){h==null||h.translateExtent(O)}function A(O){const L=!_n(O)||O<0?0:O;h==null||h.clickDistance(L)}return{update:x,destroy:y,setViewport:N,setViewportConstrained:g,getViewport:k,scaleTo:S,scaleBy:M,setScaleExtent:R,setTranslateExtent:z,syncViewport:j,setClickDistance:A}}var eo;(function(e){e.Line="line",e.Handle="handle"})(eo||(eo={}));function ZR({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:o}){const i=e-t,l=n-r,c=[i>0?1:i<0?-1:0,l>0?1:l<0?-1:0];return i&&s&&(c[0]=c[0]*-1),l&&o&&(c[1]=c[1]*-1),c}function JR(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 Pl(e,t,n){return Math.max(0,t-e,e-n)}function Jg(e,t){return e?!t:t}function eI(e,t,n,r,s,o,i,l){let{affectsX:c,affectsY:d}=t;const{isHorizontal:f,isVertical:u}=t,h=f&&u,{xSnapped:m,ySnapped:w}=n,{minWidth:v,maxWidth:b,minHeight:x,maxHeight:y}=r,{x:g,y:N,width:j,height:k,aspectRatio:S}=e;let M=Math.floor(f?m-e.pointerX:0),R=Math.floor(u?w-e.pointerY:0);const z=j+(c?-M:M),A=k+(d?-R:R),O=-o[0]*j,L=-o[1]*k;let E=Pl(z,v,b),$=Pl(A,x,y);if(i){let C=0,_=0;c&&M<0?C=Ar(g+M+O,i[0][0]):!c&&M>0&&(C=Rr(g+z+O,i[1][0])),d&&R<0?_=Ar(N+R+L,i[0][1]):!d&&R>0&&(_=Rr(N+A+L,i[1][1])),E=Math.max(E,C),$=Math.max($,_)}if(l){let C=0,_=0;c&&M>0?C=Rr(g+M,l[0][0]):!c&&M<0&&(C=Ar(g+z,l[1][0])),d&&R>0?_=Rr(N+R,l[0][1]):!d&&R<0&&(_=Ar(N+A,l[1][1])),E=Math.max(E,C),$=Math.max($,_)}if(s){if(f){const C=Pl(z/S,x,y)*S;if(E=Math.max(E,C),i){let _=0;!c&&!d||c&&!d&&h?_=Rr(N+L+z/S,i[1][1])*S:_=Ar(N+L+(c?M:-M)/S,i[0][1])*S,E=Math.max(E,_)}if(l){let _=0;!c&&!d||c&&!d&&h?_=Ar(N+z/S,l[1][1])*S:_=Rr(N+(c?M:-M)/S,l[0][1])*S,E=Math.max(E,_)}}if(u){const C=Pl(A*S,v,b)/S;if($=Math.max($,C),i){let _=0;!c&&!d||d&&!c&&h?_=Rr(g+A*S+O,i[1][0])/S:_=Ar(g+(d?R:-R)*S+O,i[0][0])/S,$=Math.max($,_)}if(l){let _=0;!c&&!d||d&&!c&&h?_=Ar(g+A*S,l[1][0])/S:_=Rr(g+(d?R:-R)*S,l[0][0])/S,$=Math.max($,_)}}}R=R+(R<0?$:-$),M=M+(M<0?E:-E),s&&(h?z>A*S?R=(Jg(c,d)?-M:M)/S:M=(Jg(c,d)?-R:R)*S:f?(R=M/S,d=c):(M=R*S,c=d));const D=c?g+M:g,P=d?N+R:N;return{width:j+(c?-M:M),height:k+(d?-R:R),x:o[0]*M*(c?-1:1)+D,y:o[1]*R*(d?-1:1)+P}}const lN={width:0,height:0,x:0,y:0},tI={...lN,pointerX:0,pointerY:0,aspectRatio:1};function nI(e){return[[0,0],[e.measured.width,e.measured.height]]}function rI(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,o=e.measured.width??0,i=e.measured.height??0,l=n[0]*o,c=n[1]*i;return[[r-l,s-c],[r+o-l,s+i-c]]}function sI({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=nn(e);function i({controlPosition:c,boundaries:d,keepAspectRatio:f,resizeDirection:u,onResizeStart:h,onResize:m,onResizeEnd:w,shouldResize:v}){let b={...lN},x={...tI};const y=JR(c);let g,N=null,j=[],k,S,M,R=!1;const z=y1().on("start",A=>{const{nodeLookup:O,transform:L,snapGrid:E,snapToGrid:$,nodeOrigin:D,paneDomNode:P}=n();if(g=O.get(t),!g)return;N=(P==null?void 0:P.getBoundingClientRect())??null;const{xSnapped:C,ySnapped:_}=Xo(A.sourceEvent,{transform:L,snapGrid:E,snapToGrid:$,containerBounds:N});b={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},x={...b,pointerX:C,pointerY:_,aspectRatio:b.width/b.height},k=void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(k=O.get(g.parentId),S=k&&g.extent==="parent"?nI(k):void 0),j=[],M=void 0;for(const[I,B]of O)if(B.parentId===t&&(j.push({id:I,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const T=rI(B,g,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:$}=n(),D=Xo(A.sourceEvent,{transform:O,snapGrid:L,snapToGrid:E,containerBounds:N}),P=[];if(!g)return;const{x:C,y:_,width:I,height:B}=b,T={},F=g.origin??$,{width:H,height:X,x:J,y:ee}=eI(x,y,D,d,f,F,S,M),K=H!==I,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,j.length>0)){const fe=J-C,pe=ee-_;for(const Se of j)Se.position={x:Se.position.x-fe+F[0]*(H-I),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&&g.expandParent){const fe=F[0]*(T.width??0);T.x&&T.x<fe&&(b.x=fe,x.x=x.x-(T.x-fe));const pe=F[1]*(T.height??0);T.y&&T.y<pe&&(b.y=pe,x.y=x.y-(T.y-pe))}const Q=ZR({width:b.width,prevWidth:I,height:b.height,prevHeight:B,affectsX:y.affectsX,affectsY:y.affectsY}),Z={...b,direction:Q};(v==null?void 0:v(A,Z))!==!1&&(R=!0,m==null||m(A,Z),r(T,P))}).on("end",A=>{R&&(w==null||w(A,{...b}),s==null||s({...b}),R=!1)});o.call(z)}function l(){o.on(".drag",null)}return{update:i,destroy:l}}var cN={exports:{}},dN={},uN={exports:{}},fN={};/**
|
|
389
|
-
* @license React
|
|
390
|
-
* use-sync-external-store-shim.production.js
|
|
391
|
-
*
|
|
392
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
393
|
-
*
|
|
394
|
-
* This source code is licensed under the MIT license found in the
|
|
395
|
-
* LICENSE file in the root directory of this source tree.
|
|
396
|
-
*/var to=p;function aI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var oI=typeof Object.is=="function"?Object.is:aI,iI=to.useState,lI=to.useEffect,cI=to.useLayoutEffect,dI=to.useDebugValue;function uI(e,t){var n=t(),r=iI({inst:{value:n,getSnapshot:t}}),s=r[0].inst,o=r[1];return cI(function(){s.value=n,s.getSnapshot=t,$u(s)&&o({inst:s})},[e,n,t]),lI(function(){return $u(s)&&o({inst:s}),e(function(){$u(s)&&o({inst:s})})},[e]),dI(n),n}function $u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!oI(e,n)}catch{return!0}}function fI(e,t){return t()}var hI=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?fI:uI;fN.useSyncExternalStore=to.useSyncExternalStore!==void 0?to.useSyncExternalStore:hI;uN.exports=fN;var mI=uN.exports;/**
|
|
397
|
-
* @license React
|
|
398
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
399
|
-
*
|
|
400
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
401
|
-
*
|
|
402
|
-
* This source code is licensed under the MIT license found in the
|
|
403
|
-
* LICENSE file in the root directory of this source tree.
|
|
404
|
-
*/var _d=p,pI=mI;function xI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gI=typeof Object.is=="function"?Object.is:xI,yI=pI.useSyncExternalStore,vI=_d.useRef,wI=_d.useEffect,bI=_d.useMemo,NI=_d.useDebugValue;dN.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var o=vI(null);if(o.current===null){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=bI(function(){function c(m){if(!d){if(d=!0,f=m,m=r(m),s!==void 0&&i.hasValue){var w=i.value;if(s(w,m))return u=w}return u=m}if(w=u,gI(f,m))return w;var v=r(m);return s!==void 0&&s(w,v)?(f=m,w):(f=m,u=v)}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=yI(e,o[0],o[1]);return wI(function(){i.hasValue=!0,i.value=l},[l]),NI(l),l};cN.exports=dN;var jI=cN.exports;const kI=xh(jI),SI={},e0=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:()=>{(SI?"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},CI=e=>e?e0(e):e0,{useDebugValue:EI}=Y,{useSyncExternalStoreWithSelector:MI}=kI,_I=e=>e;function hN(e,t=_I,n){const r=MI(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return EI(r),r}const t0=(e,t)=>{const n=CI(e),r=(s,o=t)=>hN(n,s,o);return Object.assign(r,n),r},PI=(e,t)=>e?t0(e,t):t0;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 Pd=p.createContext(null),DI=Pd.Provider,mN=nr.error001();function _e(e,t){const n=p.useContext(Pd);if(n===null)throw new Error(mN);return hN(n,e,t)}function Ke(){const e=p.useContext(Pd);if(e===null)throw new Error(mN);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const n0={display:"none"},TI={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},pN="react-flow__node-desc",xN="react-flow__edge-desc",OI="react-flow__aria-live",AI=e=>e.ariaLiveMessage,RI=e=>e.ariaLabelConfig;function II({rfId:e}){const t=_e(AI);return a.jsx("div",{id:`${OI}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:TI,children:t})}function zI({rfId:e,disableKeyboardA11y:t}){const n=_e(RI);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${pN}-${e}`,style:n0,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${xN}-${e}`,style:n0,children:n["edge.a11yDescription.default"]}),!t&&a.jsx(II,{rfId:e})]})}const Dd=p.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const i=`${e}`.split("-");return a.jsx("div",{className:xt(["react-flow__panel",n,...i]),style:r,ref:o,...s,children:t})});Dd.displayName="Panel";function $I({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:a.jsx(Dd,{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 LI=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}},Dl=e=>e.id;function FI(e,t){return st(e.selectedNodes.map(Dl),t.selectedNodes.map(Dl))&&st(e.selectedEdges.map(Dl),t.selectedEdges.map(Dl))}function BI({onSelectionChange:e}){const t=Ke(),{selectedNodes:n,selectedEdges:r}=_e(LI,FI);return p.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[n,r,e]),null}const WI=e=>!!e.onSelectionChangeHandlers;function UI({onSelectionChange:e}){const t=_e(WI);return e||t?a.jsx(BI,{onSelectionChange:e}):null}const gN=[0,0],VI={x:0,y:0,zoom:1},HI=["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"],r0=[...HI,"rfId"],YI=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}),s0={translateExtent:ji,nodeOrigin:gN,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function XI(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:c,setPaneClickDistance:d}=_e(YI,st),f=Ke();p.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=s0,l()}),[]);const u=p.useRef(s0);return p.useEffect(()=>{for(const h of r0){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"?o(m):h==="nodeExtent"?i(m):h==="paneClickDistance"?d(m):h==="ariaLabelConfig"?f.setState({ariaLabelConfig:xR(m)}):h==="fitView"?f.setState({fitViewQueued:m}):h==="fitViewOptions"?f.setState({fitViewOptions:m}):f.setState({[h]:m})))}u.current=e},r0.map(h=>e[h])),null}function a0(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function qI(e){var r;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const s=a0(),o=()=>n(s!=null&&s.matches?"dark":"light");return o(),s==null||s.addEventListener("change",o),()=>{s==null||s.removeEventListener("change",o)}},[e]),t!==null?t:(r=a0())!=null&&r.matches?"dark":"light"}const o0=typeof document<"u"?document:null;function Mi(e=null,t={target:o0,actInsideInputWithModifier:!0}){const[n,r]=p.useState(!1),s=p.useRef(!1),o=p.useRef(new Set([])),[i,l]=p.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(u=>typeof u=="string").map(u=>u.replace("+",`
|
|
405
|
-
`).replace(`
|
|
406
|
-
|
|
407
|
-
`,`
|
|
408
|
-
+`).split(`
|
|
409
|
-
`)),f=d.reduce((u,h)=>u.concat(...h),[]);return[d,f]}return[[],[]]},[e]);return p.useEffect(()=>{const c=(t==null?void 0:t.target)??o0,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const f=m=>{var b,x;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!d)&&Y1(m))return!1;const v=l0(m.code,l);if(o.current.add(m[v]),i0(i,o.current,!1)){const y=((x=(b=m.composedPath)==null?void 0:b.call(m))==null?void 0:x[0])||m.target,g=(y==null?void 0:y.nodeName)==="BUTTON"||(y==null?void 0:y.nodeName)==="A";t.preventDefault!==!1&&(s.current||!g)&&m.preventDefault(),r(!0)}},u=m=>{const w=l0(m.code,l);i0(i,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(m[w]),m.key==="Meta"&&o.current.clear(),s.current=!1},h=()=>{o.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 i0(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function l0(e,t){return t.includes(e)?"code":"key"}const GI=()=>{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,o],panZoom:i}=e.getState();return i?(await i.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??o},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:o,maxZoom:i,panZoom:l}=e.getState(),c=Xm(t,r,s,o,i,(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:o,domNode:i}=e.getState();if(!i)return t;const{x:l,y:c}=i.getBoundingClientRect(),d={x:t.x-l,y:t.y-c},f=n.snapGrid??s,u=n.snapToGrid??o;return Qi(d,r,u,f)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:o}=r.getBoundingClientRect(),i=Bc(t,n);return{x:i.x+s,y:i.y+o}}}),[])};function yN(e,t){const n=[],r=new Map,s=[];for(const o of e)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const i=r.get(o.id);i?i.push(o):r.set(o.id,[o])}for(const o of t){const i=r.get(o.id);if(!i){n.push(o);continue}if(i[0].type==="remove")continue;if(i[0].type==="replace"){n.push({...i[0].item});continue}const l={...o};for(const c of i)KI(c,l);n.push(l)}return s.length&&s.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function KI(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 vN(e,t){return yN(e,t)}function wN(e,t){return yN(e,t)}function js(e,t){return{id:e,type:"select",selected:t}}function ja(e,t=new Set,n=!1){const r=[];for(const[s,o]of e){const i=t.has(s);!(o.selected===void 0&&!i)&&o.selected!==i&&(n&&(o.selected=i),r.push(js(o.id,i)))}return r}function c0({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,i]of e.entries()){const l=t.get(i.id),c=((s=l==null?void 0:l.internals)==null?void 0:s.userNode)??l;c!==void 0&&c!==i&&n.push({id:i.id,item:i,type:"replace"}),c===void 0&&n.push({item:i,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function d0(e){return{id:e.id,type:"remove"}}const u0=e=>oR(e),QI=e=>$1(e);function bN(e){return p.forwardRef(e)}const ZI=typeof window<"u"?p.useLayoutEffect:p.useEffect;function f0(e){const[t,n]=p.useState(BigInt(0)),[r]=p.useState(()=>JI(()=>n(s=>s+BigInt(1))));return ZI(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function JI(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const NN=p.createContext(null);function ez({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 v=c0({items:w,lookup:h});f&&d(w),v.length>0?u==null||u(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:x,setNodes:y}=t.getState();b&&y(x)})},[]),r=f0(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(c0({items:m,lookup:h}))},[]),o=f0(s),i=p.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return a.jsx(NN.Provider,{value:i,children:e})}function tz(){const e=p.useContext(NN);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const nz=e=>!!e.panZoom;function Jm(){const e=GI(),t=Ke(),n=tz(),r=_e(nz),s=p.useMemo(()=>{const o=u=>t.getState().nodeLookup.get(u),i=u=>{n.nodeQueue.push(u)},l=u=>{n.edgeQueue.push(u)},c=u=>{var x,y;const{nodeLookup:h,nodeOrigin:m}=t.getState(),w=u0(u)?u:h.get(u.id),v=w.parentId?V1(w.position,w.measured,w.parentId,h,m):w.position,b={...w,position:v,width:((x=w.measured)==null?void 0:x.width)??w.width,height:((y=w.measured)==null?void 0:y.height)??w.height};return Za(b)},d=(u,h,m={replace:!1})=>{i(w=>w.map(v=>{if(v.id===u){const b=typeof h=="function"?h(v):h;return m.replace&&u0(b)?b:{...v,...b}}return v}))},f=(u,h,m={replace:!1})=>{l(w=>w.map(v=>{if(v.id===u){const b=typeof h=="function"?h(v):h;return m.replace&&QI(b)?b:{...v,...b}}return v}))};return{getNodes:()=>t.getState().nodes.map(u=>({...u})),getNode:u=>{var h;return(h=o(u))==null?void 0:h.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:u=[]}=t.getState();return u.map(h=>({...h}))},getEdge:u=>t.getState().edgeLookup.get(u),setNodes:i,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,v,b]=m;return{nodes:u.map(x=>({...x})),edges:h.map(x=>({...x})),viewport:{x:w,y:v,zoom:b}}},deleteElements:async({nodes:u=[],edges:h=[]})=>{const{nodes:m,edges:w,onNodesDelete:v,onEdgesDelete:b,triggerNodeChanges:x,triggerEdgeChanges:y,onDelete:g,onBeforeDelete:N}=t.getState(),{nodes:j,edges:k}=await uR({nodesToRemove:u,edgesToRemove:h,nodes:m,edges:w,onBeforeDelete:N}),S=k.length>0,M=j.length>0;if(S){const R=k.map(d0);b==null||b(k),y(R)}if(M){const R=j.map(d0);v==null||v(j),x(R)}return(M||S)&&(g==null||g({nodes:j,edges:k})),{deletedNodes:j,deletedEdges:k}},getIntersectingNodes:(u,h=!0,m)=>{const w=Wg(u),v=w?u:c(u),b=m!==void 0;return v?(m||t.getState().nodes).filter(x=>{const y=t.getState().nodeLookup.get(x.id);if(y&&!w&&(x.id===u.id||!y.internals.positionAbsolute))return!1;const g=Za(b?x:y),N=Si(g,v);return h&&N>0||N>=g.width*g.height||N>=v.width*v.height}):[]},isNodeIntersecting:(u,h,m=!0)=>{const v=Wg(u)?u:c(u);if(!v)return!1;const b=Si(v,h);return m&&b>0||b>=h.width*h.height||b>=v.width*v.height},updateNode:d,updateNodeData:(u,h,m={replace:!1})=>{d(u,w=>{const v=typeof h=="function"?h(w):h;return m.replace?{...w,data:v}:{...w,data:{...w.data,...v}}},m)},updateEdge:f,updateEdgeData:(u,h,m={replace:!1})=>{f(u,w=>{const v=typeof h=="function"?h(w):h;return m.replace?{...w,data:v}:{...w,data:{...w.data,...v}}},m)},getNodesBounds:u=>{const{nodeLookup:h,nodeOrigin:m}=t.getState();return iR(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??pR();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 h0=e=>e.selected,rz=typeof window<"u"?window:void 0;function sz({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Ke(),{deleteElements:r}=Jm(),s=Mi(e,{actInsideInputWithModifier:!1}),o=Mi(t,{target:rz});p.useEffect(()=>{if(s){const{edges:i,nodes:l}=n.getState();r({nodes:l.filter(h0),edges:i.filter(h0)}),n.setState({nodesSelectionActive:!1})}},[s]),p.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function az(e){const t=Ke();p.useEffect(()=>{const n=()=>{var s,o,i,l;if(!e.current||!(((o=(s=e.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const r=qm(e.current);(r.height===0||r.width===0)&&((l=(i=t.getState()).onError)==null||l.call(i,"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 Td={position:"absolute",width:"100%",height:"100%",top:0,left:0},oz=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function iz({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=Rs.Free,zoomOnDoubleClick:i=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:d,minZoom:f,maxZoom:u,zoomActivationKeyCode:h,preventScrolling:m=!0,children:w,noWheelClassName:v,noPanClassName:b,onViewportChange:x,isControlledViewport:y,paneClickDistance:g}){const N=Ke(),j=p.useRef(null),{userSelectionActive:k,lib:S,connectionInProgress:M}=_e(oz,st),R=Mi(h),z=p.useRef();az(j);const A=p.useCallback(O=>{x==null||x({x:O[0],y:O[1],zoom:O[2]}),y||N.setState({transform:O})},[x,y]);return p.useEffect(()=>{if(j.current){z.current=QR({domNode:j.current,minZoom:f,maxZoom:u,translateExtent:d,viewport:c,paneClickDistance:g,onDraggingChange:$=>N.setState({paneDragging:$}),onPanZoomStart:($,D)=>{const{onViewportChangeStart:P,onMoveStart:C}=N.getState();C==null||C($,D),P==null||P(D)},onPanZoom:($,D)=>{const{onViewportChange:P,onMove:C}=N.getState();C==null||C($,D),P==null||P(D)},onPanZoomEnd:($,D)=>{const{onViewportChangeEnd:P,onMoveEnd:C}=N.getState();C==null||C($,D),P==null||P(D)}});const{x:O,y:L,zoom:E}=z.current.getViewport();return N.setState({panZoom:z.current,transform:[O,L,E],domNode:j.current.closest(".react-flow")}),()=>{var $;($=z.current)==null||$.destroy()}}},[]),p.useEffect(()=>{var O;(O=z.current)==null||O.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:i,panOnDrag:l,zoomActivationKeyPressed:R,preventScrolling:m,noPanClassName:b,userSelectionActive:k,noWheelClassName:v,lib:S,onTransformChange:A,connectionInProgress:M})},[e,t,n,r,s,o,i,l,R,m,b,k,v,S,A,M]),a.jsx("div",{className:"react-flow__renderer",ref:j,style:Td,children:w})}const lz=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function cz(){const{userSelectionActive:e,userSelectionRect:t}=_e(lz,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 Lu=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},dz=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function uz({isSelecting:e,selectionKeyPressed:t,selectionMode:n=ki.Full,panOnDrag:r,selectionOnDrag:s,onSelectionStart:o,onSelectionEnd:i,onPaneClick:l,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:u,onPaneMouseLeave:h,children:m}){const w=Ke(),{userSelectionActive:v,elementsSelectable:b,dragging:x,connectionInProgress:y}=_e(dz,st),g=b&&(e||v),N=p.useRef(null),j=p.useRef(),k=p.useRef(new Set),S=p.useRef(new Set),M=p.useRef(!1),R=p.useRef(!1),z=P=>{if(M.current||y){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(j.current=_==null?void 0:_.getBoundingClientRect(),!b||!e||P.button!==0||P.target!==N.current||!j.current)return;(F=(T=P.target)==null?void 0:T.setPointerCapture)==null||F.call(T,P.pointerId),R.current=!0,M.current=!1;const{x:I,y:B}=Pn(P.nativeEvent,j.current);C(),w.setState({userSelectionRect:{width:0,height:0,startX:I,startY:B,x:I,y:B}}),o==null||o(P)},E=P=>{const{userSelectionRect:C,transform:_,nodeLookup:I,edgeLookup:B,connectionLookup:T,triggerNodeChanges:F,triggerEdgeChanges:H,defaultEdgeOptions:X}=w.getState();if(!j.current||!C)return;M.current=!0;const{x:J,y:ee}=Pn(P.nativeEvent,j.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(I,me,_,n===ki.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(!Ug(W,k.current)){const ae=ja(I,k.current,!0);F(ae)}if(!Ug(Q,S.current)){const ae=ja(B,S.current);H(ae)}w.setState({userSelectionRect:me,userSelectionActive:!0,nodesSelectionActive:!1})},$=P=>{var _,I;if(P.button!==0||!R.current)return;(I=(_=P.target)==null?void 0:_.releasePointerCapture)==null||I.call(_,P.pointerId);const{userSelectionRect:C}=w.getState();!v&&C&&P.target===N.current&&(z==null||z(P)),w.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:k.current.size>0}),i==null||i(P),(t||s)&&(M.current=!1),R.current=!1},D=r===!0||Array.isArray(r)&&r.includes(0);return a.jsxs("div",{className:xt(["react-flow__pane",{draggable:D,dragging:x,selection:e}]),onClick:g?void 0:Lu(z,N),onContextMenu:Lu(A,N),onWheel:Lu(O,N),onPointerEnter:g?void 0:f,onPointerDown:g?L:u,onPointerMove:g?E:u,onPointerUp:g?$:void 0,onPointerLeave:h,ref:N,style:Td,children:[m,a.jsx(cz,{})]})}function hh({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:i,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&&i)&&(o({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var f;return(f=r==null?void 0:r.current)==null?void 0:f.blur()})):s([e])}function jN({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:i}){const l=Ke(),[c,d]=p.useState(!1),f=p.useRef();return p.useEffect(()=>{f.current=IR({getStoreItems:()=>l.getState(),onNodeMouseDown:u=>{hh({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:o,nodeId:s,nodeClickDistance:i}),()=>{var m;(m=f.current)==null||m.destroy()}},[n,r,t,o,e,s]),c}const fz=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function kN(){const e=Ke();return p.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:i,onError:l,updateNodePositions:c,nodeLookup:d,nodeOrigin:f}=e.getState(),u=new Map,h=fz(i),m=s?o[0]:5,w=s?o[1]:5,v=n.direction.x*m*n.factor,b=n.direction.y*w*n.factor;for(const[,x]of d){if(!h(x))continue;let y={x:x.internals.positionAbsolute.x+v,y:x.internals.positionAbsolute.y+b};s&&(y=Ki(y,o));const{position:g,positionAbsolute:N}=L1({nodeId:x.id,nextPosition:y,nodeLookup:d,nodeExtent:r,nodeOrigin:f,onError:l});x.position=g,x.internals.positionAbsolute=N,u.set(x.id,x)}c(u)},[])}const ep=p.createContext(null),hz=ep.Provider;ep.Consumer;const SN=()=>p.useContext(ep),mz=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),pz=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:i}=r,{fromHandle:l,toHandle:c,isValid:d}=i,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:o===Ka.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 xz({type:e="source",position:t=ye.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:i,onConnect:l,children:c,className:d,onMouseDown:f,onTouchStart:u,...h},m){var $,D;const w=i||null,v=e==="target",b=Ke(),x=SN(),{connectOnClick:y,noPanClassName:g,rfId:N}=_e(mz,st),{connectingFrom:j,connectingTo:k,clickConnecting:S,isPossibleEndHandle:M,connectionInProcess:R,clickConnectionInProcess:z,valid:A}=_e(pz(x,w,e),st);x||(D=($=b.getState()).onError)==null||D.call($,"010",nr.error010());const O=P=>{const{defaultEdgeOptions:C,onConnect:_,hasDefaultEdges:I}=b.getState(),B={...C,...P};if(I){const{edges:T,setEdges:F}=b.getState();F(Q1(B,T))}_==null||_(B),l==null||l(B)},L=P=>{if(!x)return;const C=X1(P.nativeEvent);if(s&&(C&&P.button===0||!C)){const _=b.getState();fh.onPointerDown(P.nativeEvent,{handleDomNode:P.currentTarget,autoPanOnConnect:_.autoPanOnConnect,connectionMode:_.connectionMode,connectionRadius:_.connectionRadius,domNode:_.domNode,nodeLookup:_.nodeLookup,lib:_.lib,isTarget:v,handleId:w,nodeId:x,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:I,connectionMode:B,isValidConnection:T,lib:F,rfId:H,nodeLookup:X,connection:J}=b.getState();if(!x||!I&&!s)return;if(!I){C==null||C(P.nativeEvent,{nodeId:x,handleId:w,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:x,type:e,id:w}});return}const ee=H1(P.target),K=n||T,{connection:ne,isValid:me}=fh.isValid(P.nativeEvent,{handle:{nodeId:x,id:w,type:e},connectionMode:B,fromNodeId:I.nodeId,fromHandleId:I.id||null,fromType:I.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":x,"data-handlepos":t,"data-id":`${N}-${x}-${w}-${e}`,className:xt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,d,{source:!v,target:v,connectable:r,connectablestart:s,connectableend:o,clickconnecting:S,connectingfrom:j,connectingto:k,valid:A,connectionindicator:r&&(!R||M)&&(R||z?o:s)}]),onMouseDown:L,onTouchStart:L,onClick:y?E:void 0,ref:m,...h,children:c})}const Is=p.memo(bN(xz));function gz({data:e,isConnectable:t,sourcePosition:n=ye.Bottom}){return a.jsxs(a.Fragment,{children:[e==null?void 0:e.label,a.jsx(Is,{type:"source",position:n,isConnectable:t})]})}function yz({data:e,isConnectable:t,targetPosition:n=ye.Top,sourcePosition:r=ye.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx(Is,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,a.jsx(Is,{type:"source",position:r,isConnectable:t})]})}function vz(){return null}function wz({data:e,isConnectable:t,targetPosition:n=ye.Top}){return a.jsxs(a.Fragment,{children:[a.jsx(Is,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Wc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},m0={input:gz,default:yz,output:wz,group:vz};function bz(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 Nz=e=>{const{width:t,height:n,x:r,y:s}=Gi(e.nodeLookup,{filter:o=>!!o.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 jz({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Ke(),{width:s,height:o,transformString:i,userSelectionActive:l}=_e(Nz,st),c=kN(),d=p.useRef(null);if(p.useEffect(()=>{var h;n||(h=d.current)==null||h.focus({preventScroll:!0})},[n]),jN({nodeRef:d}),l||!s||!o)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(Wc,h.key)&&(h.preventDefault(),c({direction:Wc[h.key],factor:h.shiftKey?4:1}))};return a.jsx("div",{className:xt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},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:o}})})}const p0=typeof window<"u"?window:void 0,kz=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function CN({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:d,selectionOnDrag:f,selectionMode:u,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:w,panActivationKeyCode:v,zoomActivationKeyCode:b,elementsSelectable:x,zoomOnScroll:y,zoomOnPinch:g,panOnScroll:N,panOnScrollSpeed:j,panOnScrollMode:k,zoomOnDoubleClick:S,panOnDrag:M,defaultViewport:R,translateExtent:z,minZoom:A,maxZoom:O,preventScrolling:L,onSelectionContextMenu:E,noWheelClassName:$,noPanClassName:D,disableKeyboardA11y:P,onViewportChange:C,isControlledViewport:_}){const{nodesSelectionActive:I,userSelectionActive:B}=_e(kz),T=Mi(d,{target:p0}),F=Mi(v,{target:p0}),H=F||M,X=F||N,J=f&&H!==!0,ee=T||B||J;return sz({deleteKeyCode:c,multiSelectionKeyCode:w}),a.jsx(iz,{onPaneContextMenu:o,elementsSelectable:x,zoomOnScroll:y,zoomOnPinch:g,panOnScroll:X,panOnScrollSpeed:j,panOnScrollMode:k,zoomOnDoubleClick:S,panOnDrag:!T&&H,defaultViewport:R,translateExtent:z,minZoom:A,maxZoom:O,zoomActivationKeyCode:b,preventScrolling:L,noWheelClassName:$,noPanClassName:D,onViewportChange:C,isControlledViewport:_,paneClickDistance:l,children:a.jsxs(uz,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,panOnDrag:H,isSelecting:!!ee,selectionMode:u,selectionKeyPressed:T,selectionOnDrag:J,children:[e,I&&a.jsx(jz,{onSelectionContextMenu:E,noPanClassName:D,disableKeyboardA11y:P})]})})}CN.displayName="FlowRenderer";const Sz=p.memo(CN),Cz=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 Ez(e){return _e(p.useCallback(Cz(e),[e]),st)}const Mz=e=>e.updateNodeInternals;function _z(){const e=_e(Mz),[t]=p.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const o=s.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:s.target,force:!0})}),e(r)}));return p.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Pz({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=Ke(),o=p.useRef(null),i=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(()=>{o.current&&!e.hidden&&(!f||i.current!==o.current)&&(i.current&&(r==null||r.unobserve(i.current)),r==null||r.observe(o.current),i.current=o.current)},[f,e.hidden]),p.useEffect(()=>()=>{i.current&&(r==null||r.unobserve(i.current),i.current=null)},[]),p.useEffect(()=>{if(o.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:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function Dz({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:i,nodesDraggable:l,elementsSelectable:c,nodesConnectable:d,nodesFocusable:f,resizeObserver:u,noDragClassName:h,noPanClassName:m,disableKeyboardA11y:w,rfId:v,nodeTypes:b,nodeClickDistance:x,onError:y}){const{node:g,internals:N,isParent:j}=_e(K=>{const ne=K.nodeLookup.get(e),me=K.parentLookup.has(e);return{node:ne,internals:ne.internals,isParent:me}},st);let k=g.type||"default",S=(b==null?void 0:b[k])||m0[k];S===void 0&&(y==null||y("003",nr.error003(k)),k="default",S=(b==null?void 0:b.default)||m0.default);const M=!!(g.draggable||l&&typeof g.draggable>"u"),R=!!(g.selectable||c&&typeof g.selectable>"u"),z=!!(g.connectable||d&&typeof g.connectable>"u"),A=!!(g.focusable||f&&typeof g.focusable>"u"),O=Ke(),L=U1(g),E=Pz({node:g,nodeType:k,hasDimensions:L,resizeObserver:u}),$=jN({nodeRef:E,disabled:g.hidden||!M,noDragClassName:h,handleSelector:g.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:x}),D=kN();if(g.hidden)return null;const P=_r(g),C=bz(g),_=R||M||t||n||r||s,I=n?K=>n(K,{...N.userNode}):void 0,B=r?K=>r(K,{...N.userNode}):void 0,T=s?K=>s(K,{...N.userNode}):void 0,F=o?K=>o(K,{...N.userNode}):void 0,H=i?K=>i(K,{...N.userNode}):void 0,X=K=>{const{selectNodesOnDrag:ne,nodeDragThreshold:me}=O.getState();R&&(!ne||!M||me>0)&&hh({id:e,store:O,nodeRef:E}),t&&t(K,{...N.userNode})},J=K=>{if(!(Y1(K.nativeEvent)||w)){if(A1.includes(K.key)&&R){const ne=K.key==="Escape";hh({id:e,store:O,unselect:ne,nodeRef:E})}else if(M&&g.selected&&Object.prototype.hasOwnProperty.call(Wc,K.key)){K.preventDefault();const{ariaLabelConfig:ne}=O.getState();O.setState({ariaLiveMessage:ne["node.a11yDescription.ariaLiveMessage"]({direction:K.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),D({direction:Wc[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,g]]),{x:0,y:0,width:ne,height:me},K,!0).length>0||Q(g.position.x+P.width/2,g.position.y+P.height/2,{zoom:K[2]})};return a.jsx("div",{className:xt(["react-flow__node",`react-flow__node-${k}`,{[m]:M},g.className,{selected:g.selected,selectable:R,parent:j,draggable:M,dragging:$}]),ref:E,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:_?"all":"none",visibility:L?"visible":"hidden",...g.style,...C},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,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:g.ariaRole??(A?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${pN}-${v}`,"aria-label":g.ariaLabel,...g.domAttributes,children:a.jsx(hz,{value:e,children:a.jsx(S,{id:e,data:g.data,type:k,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:g.selected??!1,selectable:R,draggable:M,deletable:g.deletable??!0,isConnectable:z,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:$,dragHandle:g.dragHandle,zIndex:N.z,parentId:g.parentId,...P})})})}const Tz=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function EN(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:o}=_e(Tz,st),i=Ez(e.onlyRenderVisibleElements),l=_z();return a.jsx("div",{className:"react-flow__nodes",style:Td,children:i.map(c=>a.jsx(Dz,{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:o},c))})}EN.displayName="NodeRenderer";const Oz=p.memo(EN);function Az(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 o=n.nodeLookup.get(s.source),i=n.nodeLookup.get(s.target);o&&i&&vR({sourceNode:o,targetNode:i,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),st)}const Rz=({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"})},Iz=({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"})},x0={[Lc.Arrow]:Rz,[Lc.ArrowClosed]:Iz};function zz(e){const t=Ke();return p.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(x0,e)?x0[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",nr.error009(e)),null)},[e])}const $z=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:i,orient:l="auto-start-reverse"})=>{const c=zz(t);return c?a.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:l,refX:"0",refY:"0",children:a.jsx(c,{color:n,strokeWidth:i})}):null},MN=({defaultColor:e,rfId:t})=>{const n=_e(o=>o.edges),r=_e(o=>o.defaultEdgeOptions),s=p.useMemo(()=>CR(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(o=>a.jsx($z,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};MN.displayName="MarkerDefinitions";var Lz=p.memo(MN);function _N({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:i=[2,4],labelBgBorderRadius:l=2,children:c,className:d,...f}){const[u,h]=p.useState({x:1,y:0,width:0,height:0}),m=xt(["react-flow__edge-textwrapper",d]),w=p.useRef(null);return p.useEffect(()=>{if(w.current){const v=w.current.getBBox();h({x:v.x,y:v.y,width:v.width,height:v.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*i[0],x:-i[0],y:-i[1],height:u.height+2*i[1],className:"react-flow__edge-textbg",style:o,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}_N.displayName="EdgeText";const Fz=p.memo(_N);function Od({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:d=20,...f}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...f,d:e,fill:"none",className:xt(["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(Fz,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function g0({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 PN({sourceX:e,sourceY:t,sourcePosition:n=ye.Bottom,targetX:r,targetY:s,targetPosition:o=ye.Top}){const[i,l]=g0({pos:n,x1:e,y1:t,x2:r,y2:s}),[c,d]=g0({pos:o,x1:r,y1:s,x2:e,y2:t}),[f,u,h,m]=q1({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:i,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${e},${t} C${i},${l} ${c},${d} ${r},${s}`,f,u,h,m]}function DN(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i,targetPosition:l,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:m,style:w,markerEnd:v,markerStart:b,interactionWidth:x})=>{const[y,g,N]=PN({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l}),j=e.isInternal?void 0:t;return a.jsx(Od,{id:j,path:y,labelX:g,labelY:N,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:m,style:w,markerEnd:v,markerStart:b,interactionWidth:x})})}const Bz=DN({isInternal:!1}),TN=DN({isInternal:!0});Bz.displayName="SimpleBezierEdge";TN.displayName="SimpleBezierEdgeInternal";function ON(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:u,style:h,sourcePosition:m=ye.Bottom,targetPosition:w=ye.Top,markerEnd:v,markerStart:b,pathOptions:x,interactionWidth:y})=>{const[g,N,j]=ch({sourceX:n,sourceY:r,sourcePosition:m,targetX:s,targetY:o,targetPosition:w,borderRadius:x==null?void 0:x.borderRadius,offset:x==null?void 0:x.offset,stepPosition:x==null?void 0:x.stepPosition}),k=e.isInternal?void 0:t;return a.jsx(Od,{id:k,path:g,labelX:N,labelY:j,label:i,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:u,style:h,markerEnd:v,markerStart:b,interactionWidth:y})})}const AN=ON({isInternal:!1}),RN=ON({isInternal:!0});AN.displayName="SmoothStepEdge";RN.displayName="SmoothStepEdgeInternal";function IN(e){return p.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return a.jsx(AN,{...n,id:r,pathOptions:p.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const Wz=IN({isInternal:!1}),zN=IN({isInternal:!0});Wz.displayName="StepEdge";zN.displayName="StepEdgeInternal";function $N(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:u,style:h,markerEnd:m,markerStart:w,interactionWidth:v})=>{const[b,x,y]=Z1({sourceX:n,sourceY:r,targetX:s,targetY:o}),g=e.isInternal?void 0:t;return a.jsx(Od,{id:g,path:b,labelX:x,labelY:y,label:i,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:u,style:h,markerEnd:m,markerStart:w,interactionWidth:v})})}const Uz=$N({isInternal:!1}),LN=$N({isInternal:!0});Uz.displayName="StraightEdge";LN.displayName="StraightEdgeInternal";function FN(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i=ye.Bottom,targetPosition:l=ye.Top,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:m,style:w,markerEnd:v,markerStart:b,pathOptions:x,interactionWidth:y})=>{const[g,N,j]=G1({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l,curvature:x==null?void 0:x.curvature}),k=e.isInternal?void 0:t;return a.jsx(Od,{id:k,path:g,labelX:N,labelY:j,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:m,style:w,markerEnd:v,markerStart:b,interactionWidth:y})})}const Vz=FN({isInternal:!1}),BN=FN({isInternal:!0});Vz.displayName="BezierEdge";BN.displayName="BezierEdgeInternal";const y0={default:BN,straight:LN,step:zN,smoothstep:RN,simplebezier:TN},v0={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Hz=(e,t,n)=>n===ye.Left?e-t:n===ye.Right?e+t:e,Yz=(e,t,n)=>n===ye.Top?e-t:n===ye.Bottom?e+t:e,w0="react-flow__edgeupdater";function b0({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:i,type:l}){return a.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:i,className:xt([w0,`${w0}-${l}`]),cx:Hz(t,r,e),cy:Yz(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Xz({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:i,sourcePosition:l,targetPosition:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:u,setReconnecting:h,setUpdateHover:m}){const w=Ke(),v=(N,j)=>{if(N.button!==0)return;const{autoPanOnConnect:k,domNode:S,isValidConnection:M,connectionMode:R,connectionRadius:z,lib:A,onConnectStart:O,onConnectEnd:L,cancelConnection:E,nodeLookup:$,rfId:D,panBy:P,updateConnection:C}=w.getState(),_=j.type==="target",I=(F,H)=>{h(!1),u==null||u(F,n,j.type,H)},B=F=>d==null?void 0:d(n,F),T=(F,H)=>{h(!0),f==null||f(N,n,j.type),O==null||O(F,H)};fh.onPointerDown(N.nativeEvent,{autoPanOnConnect:k,connectionMode:R,connectionRadius:z,domNode:S,handleId:j.id,nodeId:j.nodeId,nodeLookup:$,isTarget:_,edgeUpdaterType:j.type,lib:A,flowId:D,cancelConnection:E,panBy:P,isValidConnection:M,onConnect:B,onConnectStart:T,onConnectEnd:L,onReconnectEnd:I,updateConnection:C,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},b=N=>v(N,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),x=N=>v(N,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),y=()=>m(!0),g=()=>m(!1);return a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(b0,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:b,onMouseEnter:y,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&a.jsx(b0,{position:c,centerX:o,centerY:i,radius:t,onMouseDown:x,onMouseEnter:y,onMouseOut:g,type:"target"})]})}function qz({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:i,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,reconnectRadius:f,onReconnect:u,onReconnectStart:h,onReconnectEnd:m,rfId:w,edgeTypes:v,noPanClassName:b,onError:x,disableKeyboardA11y:y}){let g=_e(Q=>Q.edgeLookup.get(e));const N=_e(Q=>Q.defaultEdgeOptions);g=N?{...N,...g}:g;let j=g.type||"default",k=(v==null?void 0:v[j])||y0[j];k===void 0&&(x==null||x("011",nr.error011(j)),j="default",k=(v==null?void 0:v.default)||y0.default);const S=!!(g.focusable||t&&typeof g.focusable>"u"),M=typeof u<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),R=!!(g.selectable||r&&typeof g.selectable>"u"),z=p.useRef(null),[A,O]=p.useState(!1),[L,E]=p.useState(!1),$=Ke(),{zIndex:D,sourceX:P,sourceY:C,targetX:_,targetY:I,sourcePosition:B,targetPosition:T}=_e(p.useCallback(Q=>{const Z=Q.nodeLookup.get(g.source),ae=Q.nodeLookup.get(g.target);if(!Z||!ae)return{zIndex:g.zIndex,...v0};const fe=SR({id:e,sourceNode:Z,targetNode:ae,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:Q.connectionMode,onError:x});return{zIndex:yR({selected:g.selected,zIndex:g.zIndex,sourceNode:Z,targetNode:ae,elevateOnSelect:Q.elevateEdgesOnSelect}),...fe||v0}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex]),st),F=p.useMemo(()=>g.markerStart?`url('#${dh(g.markerStart,w)}')`:void 0,[g.markerStart,w]),H=p.useMemo(()=>g.markerEnd?`url('#${dh(g.markerEnd,w)}')`:void 0,[g.markerEnd,w]);if(g.hidden||P===null||C===null||_===null||I===null)return null;const X=Q=>{var pe;const{addSelectedEdges:Z,unselectNodesAndEdges:ae,multiSelectionActive:fe}=$.getState();R&&($.setState({nodesSelectionActive:!1}),g.selected&&fe?(ae({nodes:[],edges:[g]}),(pe=z.current)==null||pe.blur()):Z([e])),s&&s(Q,g)},J=o?Q=>{o(Q,{...g})}:void 0,ee=i?Q=>{i(Q,{...g})}:void 0,K=l?Q=>{l(Q,{...g})}:void 0,ne=c?Q=>{c(Q,{...g})}:void 0,me=d?Q=>{d(Q,{...g})}:void 0,W=Q=>{var Z;if(!y&&A1.includes(Q.key)&&R){const{unselectNodesAndEdges:ae,addSelectedEdges:fe}=$.getState();Q.key==="Escape"?((Z=z.current)==null||Z.blur(),ae({edges:[g]})):fe([e])}};return a.jsx("svg",{style:{zIndex:D},children:a.jsxs("g",{className:xt(["react-flow__edge",`react-flow__edge-${j}`,g.className,b,{selected:g.selected,animated:g.animated,inactive:!R&&!s,updating:A,selectable:R}]),onClick:X,onDoubleClick:J,onContextMenu:ee,onMouseEnter:K,onMouseMove:ne,onMouseLeave:me,onKeyDown:S?W:void 0,tabIndex:S?0:void 0,role:g.ariaRole??(S?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":g.ariaLabel===null?void 0:g.ariaLabel||`Edge from ${g.source} to ${g.target}`,"aria-describedby":S?`${xN}-${w}`:void 0,ref:z,...g.domAttributes,children:[!L&&a.jsx(k,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:R,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:P,sourceY:C,targetX:_,targetY:I,sourcePosition:B,targetPosition:T,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:F,markerEnd:H,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),M&&a.jsx(Xz,{edge:g,isReconnectable:M,reconnectRadius:f,onReconnect:u,onReconnectStart:h,onReconnectEnd:m,sourceX:P,sourceY:C,targetX:_,targetY:I,sourcePosition:B,targetPosition:T,setUpdateHover:O,setReconnecting:E})]})})}const Gz=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function WN({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:f,reconnectRadius:u,onEdgeDoubleClick:h,onReconnectStart:m,onReconnectEnd:w,disableKeyboardA11y:v}){const{edgesFocusable:b,edgesReconnectable:x,elementsSelectable:y,onError:g}=_e(Gz,st),N=Az(t);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(Lz,{defaultColor:e,rfId:n}),N.map(j=>a.jsx(qz,{id:j,edgesFocusable:b,edgesReconnectable:x,elementsSelectable:y,noPanClassName:s,onReconnect:o,onContextMenu:i,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onClick:f,reconnectRadius:u,onDoubleClick:h,onReconnectStart:m,onReconnectEnd:w,rfId:n,onError:g,edgeTypes:r,disableKeyboardA11y:v},j))]})}WN.displayName="EdgeRenderer";const Kz=p.memo(WN),Qz=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Zz({children:e}){const t=_e(Qz);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Jz(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 e6=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function t6(e){const t=_e(e6),n=Ke();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function n6(e){return e.connection.inProgress?{...e.connection,to:Qi(e.connection.to,e.transform)}:{...e.connection}}function r6(e){return n6}function s6(e){const t=r6();return _e(t,st)}const a6=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function o6({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:i,isValid:l,inProgress:c}=_e(a6,st);return!(o&&s&&c)?null:a.jsx("svg",{style:e,width:o,height:i,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:xt(["react-flow__connection",z1(l)]),children:a.jsx(UN,{style:t,type:n,CustomComponent:r,isValid:l})})})}const UN=({style:e,type:t=Br.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:i,fromHandle:l,fromPosition:c,to:d,toNode:f,toHandle:u,toPosition:h}=s6();if(!s)return;if(n)return a.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:l,fromX:o.x,fromY:o.y,toX:d.x,toY:d.y,fromPosition:c,toPosition:h,connectionStatus:z1(r),toNode:f,toHandle:u});let m="";const w={sourceX:o.x,sourceY:o.y,sourcePosition:c,targetX:d.x,targetY:d.y,targetPosition:h};switch(t){case Br.Bezier:[m]=G1(w);break;case Br.SimpleBezier:[m]=PN(w);break;case Br.Step:[m]=ch({...w,borderRadius:0});break;case Br.SmoothStep:[m]=ch(w);break;default:[m]=Z1(w)}return a.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};UN.displayName="ConnectionLine";const i6={};function N0(e=i6){p.useRef(e),Ke(),p.useEffect(()=>{},[e])}function l6(){Ke(),p.useRef(!1),p.useEffect(()=>{},[])}function VN({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:f,onSelectionContextMenu:u,onSelectionStart:h,onSelectionEnd:m,connectionLineType:w,connectionLineStyle:v,connectionLineComponent:b,connectionLineContainerStyle:x,selectionKeyCode:y,selectionOnDrag:g,selectionMode:N,multiSelectionKeyCode:j,panActivationKeyCode:k,zoomActivationKeyCode:S,deleteKeyCode:M,onlyRenderVisibleElements:R,elementsSelectable:z,defaultViewport:A,translateExtent:O,minZoom:L,maxZoom:E,preventScrolling:$,defaultMarkerColor:D,zoomOnScroll:P,zoomOnPinch:C,panOnScroll:_,panOnScrollSpeed:I,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:ct,noWheelClassName:Pt,noPanClassName:Ae,disableKeyboardA11y:Qe,nodeExtent:gt,rfId:zt,viewport:te,onViewportChange:ie}){return N0(e),N0(t),l6(),Jz(n),t6(te),a.jsx(Sz,{onPaneClick:H,onPaneMouseEnter:X,onPaneMouseMove:J,onPaneMouseLeave:ee,onPaneContextMenu:ne,onPaneScroll:K,paneClickDistance:me,deleteKeyCode:M,selectionKeyCode:y,selectionOnDrag:g,selectionMode:N,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:j,panActivationKeyCode:k,zoomActivationKeyCode:S,elementsSelectable:z,zoomOnScroll:P,zoomOnPinch:C,zoomOnDoubleClick:T,panOnScroll:_,panOnScrollSpeed:I,panOnScrollMode:B,panOnDrag:F,defaultViewport:A,translateExtent:O,minZoom:L,maxZoom:E,onSelectionContextMenu:u,preventScrolling:$,noDragClassName:ct,noWheelClassName:Pt,noPanClassName:Ae,disableKeyboardA11y:Qe,onViewportChange:ie,isControlledViewport:!!te,children:a.jsxs(Zz,{children:[a.jsx(Kz,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:i,onReconnect:Se,onReconnectStart:Xe,onReconnectEnd:Pe,onlyRenderVisibleElements:R,onEdgeContextMenu:Q,onEdgeMouseEnter:Z,onEdgeMouseMove:ae,onEdgeMouseLeave:fe,reconnectRadius:pe,defaultMarkerColor:D,noPanClassName:Ae,disableKeyboardA11y:Qe,rfId:zt}),a.jsx(o6,{style:v,type:w,component:b,containerStyle:x}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(Oz,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:f,nodeClickDistance:W,onlyRenderVisibleElements:R,noPanClassName:Ae,noDragClassName:ct,disableKeyboardA11y:Qe,nodeExtent:gt,rfId:zt}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}VN.displayName="GraphView";const c6=p.memo(VN),j0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:c=.5,maxZoom:d=2,nodeOrigin:f,nodeExtent:u}={})=>{const h=new Map,m=new Map,w=new Map,v=new Map,b=r??t??[],x=n??e??[],y=f??[0,0],g=u??ji;eN(w,v,b);const N=uh(x,h,m,{nodeOrigin:y,nodeExtent:g,elevateNodesOnSelect:!1});let j=[0,0,1];if(i&&s&&o){const k=Gi(h,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:S,y:M,zoom:R}=Xm(k,s,o,c,d,(l==null?void 0:l.padding)??.1);j=[S,M,R]}return{rfId:"1",width:s??0,height:o??0,transform:j,nodes:x,nodesInitialized:N,nodeLookup:h,parentLookup:m,edges:b,edgeLookup:v,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:d,translateExtent:ji,nodeExtent:g,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ka.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,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:i??!1,fitViewOptions:l,fitViewResolver:null,connection:{...I1},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:fR,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:R1}},d6=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:f,nodeExtent:u})=>PI((h,m)=>{async function w(){const{nodeLookup:v,panZoom:b,fitViewOptions:x,fitViewResolver:y,width:g,height:N,minZoom:j,maxZoom:k}=m();b&&(await dR({nodes:v,width:g,height:N,panZoom:b,minZoom:j,maxZoom:k},x),y==null||y.resolve(!0),h({fitViewResolver:null}))}return{...j0({nodes:e,edges:t,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:f,nodeExtent:u,defaultNodes:n,defaultEdges:r}),setNodes:v=>{const{nodeLookup:b,parentLookup:x,nodeOrigin:y,elevateNodesOnSelect:g,fitViewQueued:N}=m(),j=uh(v,b,x,{nodeOrigin:y,nodeExtent:u,elevateNodesOnSelect:g,checkEquality:!0});N&&j?(w(),h({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0})):h({nodes:v,nodesInitialized:j})},setEdges:v=>{const{connectionLookup:b,edgeLookup:x}=m();eN(b,x,v),h({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:x}=m();x(v),h({hasDefaultNodes:!0})}if(b){const{setEdges:x}=m();x(b),h({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:x,parentLookup:y,domNode:g,nodeOrigin:N,nodeExtent:j,debug:k,fitViewQueued:S}=m(),{changes:M,updatedInternals:R}=TR(v,x,y,g,N,j);R&&(MR(x,y,{nodeOrigin:N,nodeExtent:j}),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:(v,b=!1)=>{const x=[],y=[],{nodeLookup:g,triggerNodeChanges:N}=m();for(const[j,k]of v){const S=g.get(j),M=!!(S!=null&&S.expandParent&&(S!=null&&S.parentId)&&(k!=null&&k.position)),R={id:j,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&&x.push({id:j,parentId:S.parentId,rect:{...k.internals.positionAbsolute,width:k.measured.width??0,height:k.measured.height??0}}),y.push(R)}if(x.length>0){const{parentLookup:j,nodeOrigin:k}=m(),S=Zm(x,g,j,k);y.push(...S)}N(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:x,nodes:y,hasDefaultNodes:g,debug:N}=m();if(v!=null&&v.length){if(g){const j=vN(v,y);x(j)}N&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:x,edges:y,hasDefaultEdges:g,debug:N}=m();if(v!=null&&v.length){if(g){const j=wN(v,y);x(j)}N&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:x,nodeLookup:y,triggerNodeChanges:g,triggerEdgeChanges:N}=m();if(b){const j=v.map(k=>js(k,!0));g(j);return}g(ja(y,new Set([...v]),!0)),N(ja(x))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:x,nodeLookup:y,triggerNodeChanges:g,triggerEdgeChanges:N}=m();if(b){const j=v.map(k=>js(k,!0));N(j);return}N(ja(x,new Set([...v]))),g(ja(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:x,nodes:y,nodeLookup:g,triggerNodeChanges:N,triggerEdgeChanges:j}=m(),k=v||y,S=b||x,M=k.map(z=>{const A=g.get(z.id);return A&&(A.selected=!1),js(z.id,!1)}),R=S.map(z=>js(z.id,!1));N(M),j(R)},setMinZoom:v=>{const{panZoom:b,maxZoom:x}=m();b==null||b.setScaleExtent([v,x]),h({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:x}=m();b==null||b.setScaleExtent([x,v]),h({maxZoom:v})},setTranslateExtent:v=>{var b;(b=m().panZoom)==null||b.setTranslateExtent(v),h({translateExtent:v})},setPaneClickDistance:v=>{var b;(b=m().panZoom)==null||b.setClickDistance(v)},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:x,triggerEdgeChanges:y,elementsSelectable:g}=m();if(!g)return;const N=b.reduce((k,S)=>S.selected?[...k,js(S.id,!1)]:k,[]),j=v.reduce((k,S)=>S.selected?[...k,js(S.id,!1)]:k,[]);x(N),y(j)},setNodeExtent:v=>{const{nodes:b,nodeLookup:x,parentLookup:y,nodeOrigin:g,elevateNodesOnSelect:N,nodeExtent:j}=m();v[0][0]===j[0][0]&&v[0][1]===j[0][1]&&v[1][0]===j[1][0]&&v[1][1]===j[1][1]||(uh(b,x,y,{nodeOrigin:g,nodeExtent:v,elevateNodesOnSelect:N,checkEquality:!1}),h({nodeExtent:v}))},panBy:v=>{const{transform:b,width:x,height:y,panZoom:g,translateExtent:N}=m();return OR({delta:v,panZoom:g,transform:b,translateExtent:N,width:x,height:y})},setCenter:async(v,b,x)=>{const{width:y,height:g,maxZoom:N,panZoom:j}=m();if(!j)return Promise.resolve(!1);const k=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:N;return await j.setViewport({x:y/2-v*k,y:g/2-b*k,zoom:k},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{h({connection:{...I1}})},updateConnection:v=>{h({connection:v})},reset:()=>h({...j0()})}},Object.is);function u6({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,initialMinZoom:i,initialMaxZoom:l,initialFitViewOptions:c,fitView:d,nodeOrigin:f,nodeExtent:u,children:h}){const[m]=p.useState(()=>d6({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:d,minZoom:i,maxZoom:l,fitViewOptions:c,nodeOrigin:f,nodeExtent:u}));return a.jsx(DI,{value:m,children:a.jsx(ez,{children:h})})}function f6({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:i,fitView:l,fitViewOptions:c,minZoom:d,maxZoom:f,nodeOrigin:u,nodeExtent:h}){return p.useContext(Pd)?a.jsx(a.Fragment,{children:e}):a.jsx(u6,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:i,fitView:l,initialFitViewOptions:c,initialMinZoom:d,initialMaxZoom:f,nodeOrigin:u,nodeExtent:h,children:e})}const h6={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function m6({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:i,onNodeClick:l,onEdgeClick:c,onInit:d,onMove:f,onMoveStart:u,onMoveEnd:h,onConnect:m,onConnectStart:w,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:x,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:k,onNodeDragStart:S,onNodeDrag:M,onNodeDragStop:R,onNodesDelete:z,onEdgesDelete:A,onDelete:O,onSelectionChange:L,onSelectionDragStart:E,onSelectionDrag:$,onSelectionDragStop:D,onSelectionContextMenu:P,onSelectionStart:C,onSelectionEnd:_,onBeforeDelete:I,connectionMode:B,connectionLineType:T=Br.Bezier,connectionLineStyle:F,connectionLineComponent:H,connectionLineContainerStyle:X,deleteKeyCode:J="Backspace",selectionKeyCode:ee="Shift",selectionOnDrag:K=!1,selectionMode:ne=ki.Full,panActivationKeyCode:me="Space",multiSelectionKeyCode:W=Ci()?"Meta":"Control",zoomActivationKeyCode:Q=Ci()?"Meta":"Control",snapToGrid:Z,snapGrid:ae,onlyRenderVisibleElements:fe=!1,selectNodesOnDrag:pe,nodesDraggable:Se,autoPanOnNodeFocus:Xe,nodesConnectable:Pe,nodesFocusable:ct,nodeOrigin:Pt=gN,edgesFocusable:Ae,edgesReconnectable:Qe,elementsSelectable:gt=!0,defaultViewport:zt=VI,minZoom:te=.5,maxZoom:ie=2,translateExtent:V=ji,preventScrolling:se=!0,nodeExtent:he,defaultMarkerColor:de="#b1b1b7",zoomOnScroll:be=!0,zoomOnPinch:Ie=!0,panOnScroll:G=!1,panOnScrollSpeed:le=.5,panOnScrollMode:ge=Rs.Free,zoomOnDoubleClick:Ue=!0,panOnDrag:dt=!0,onPaneClick:ce,onPaneMouseEnter:Me,onPaneMouseMove:Ne,onPaneMouseLeave:Re,onPaneScroll:wt,onPaneContextMenu:oe,paneClickDistance:Ze=0,nodeClickDistance:ut=0,children:jt,onReconnect:Ln,onReconnectStart:Je,onReconnectEnd:Ut,onEdgeContextMenu:ea,onEdgeDoubleClick:Qt,onEdgeMouseEnter:Zt,onEdgeMouseMove:Zi,onEdgeMouseLeave:or,reconnectRadius:sp=10,onNodesChange:uj,onEdgesChange:fj,noDragClassName:hj="nodrag",noWheelClassName:mj="nowheel",noPanClassName:ap="nopan",fitView:op,fitViewOptions:ip,connectOnClick:pj,attributionPosition:xj,proOptions:gj,defaultEdgeOptions:yj,elevateNodesOnSelect:vj,elevateEdgesOnSelect:wj,disableKeyboardA11y:lp=!1,autoPanOnConnect:bj,autoPanOnNodeDrag:Nj,autoPanSpeed:jj,connectionRadius:kj,isValidConnection:Sj,onError:Cj,style:Ej,id:cp,nodeDragThreshold:Mj,connectionDragThreshold:_j,viewport:Pj,onViewportChange:Dj,width:Tj,height:Oj,colorMode:Aj="light",debug:Rj,onScroll:Ji,ariaLabelConfig:Ij,...zj},$j){const $d=cp||"1",Lj=qI(Aj),Fj=p.useCallback(dp=>{dp.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ji==null||Ji(dp)},[Ji]);return a.jsx("div",{"data-testid":"rf__wrapper",...zj,onScroll:Fj,style:{...Ej,...h6},ref:$j,className:xt(["react-flow",s,Lj]),id:cp,role:"application",children:a.jsxs(f6,{nodes:e,edges:t,width:Tj,height:Oj,fitView:op,fitViewOptions:ip,minZoom:te,maxZoom:ie,nodeOrigin:Pt,nodeExtent:he,children:[a.jsx(c6,{onInit:d,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:k,nodeTypes:o,edgeTypes:i,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:ie,preventScrolling:se,zoomOnScroll:be,zoomOnPinch:Ie,zoomOnDoubleClick:Ue,panOnScroll:G,panOnScrollSpeed:le,panOnScrollMode:ge,panOnDrag:dt,onPaneClick:ce,onPaneMouseEnter:Me,onPaneMouseMove:Ne,onPaneMouseLeave:Re,onPaneScroll:wt,onPaneContextMenu:oe,paneClickDistance:Ze,nodeClickDistance:ut,onSelectionContextMenu:P,onSelectionStart:C,onSelectionEnd:_,onReconnect:Ln,onReconnectStart:Je,onReconnectEnd:Ut,onEdgeContextMenu:ea,onEdgeDoubleClick:Qt,onEdgeMouseEnter:Zt,onEdgeMouseMove:Zi,onEdgeMouseLeave:or,reconnectRadius:sp,defaultMarkerColor:de,noDragClassName:hj,noWheelClassName:mj,noPanClassName:ap,rfId:$d,disableKeyboardA11y:lp,nodeExtent:he,viewport:Pj,onViewportChange:Dj}),a.jsx(XI,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:m,onConnectStart:w,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:x,nodesDraggable:Se,autoPanOnNodeFocus:Xe,nodesConnectable:Pe,nodesFocusable:ct,edgesFocusable:Ae,edgesReconnectable:Qe,elementsSelectable:gt,elevateNodesOnSelect:vj,elevateEdgesOnSelect:wj,minZoom:te,maxZoom:ie,nodeExtent:he,onNodesChange:uj,onEdgesChange:fj,snapToGrid:Z,snapGrid:ae,connectionMode:B,translateExtent:V,connectOnClick:pj,defaultEdgeOptions:yj,fitView:op,fitViewOptions:ip,onNodesDelete:z,onEdgesDelete:A,onDelete:O,onNodeDragStart:S,onNodeDrag:M,onNodeDragStop:R,onSelectionDrag:$,onSelectionDragStart:E,onSelectionDragStop:D,onMove:f,onMoveStart:u,onMoveEnd:h,noPanClassName:ap,nodeOrigin:Pt,rfId:$d,autoPanOnConnect:bj,autoPanOnNodeDrag:Nj,autoPanSpeed:jj,onError:Cj,connectionRadius:kj,isValidConnection:Sj,selectNodesOnDrag:pe,nodeDragThreshold:Mj,connectionDragThreshold:_j,onBeforeDelete:I,paneClickDistance:Ze,debug:Rj,ariaLabelConfig:Ij}),a.jsx(UI,{onSelectionChange:L}),jt,a.jsx($I,{proOptions:gj,position:xj}),a.jsx(zI,{rfId:$d,disableKeyboardA11y:lp})]})})}var p6=bN(m6);function x6(e){const[t,n]=p.useState(e),r=p.useCallback(s=>n(o=>vN(s,o)),[]);return[t,n,r]}function g6(e){const[t,n]=p.useState(e),r=p.useCallback(s=>n(o=>wN(s,o)),[]);return[t,n,r]}function y6({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:xt(["react-flow__background-pattern",n,r])})}function v6({radius:e,className:t}){return a.jsx("circle",{cx:e,cy:e,r:e,className:xt(["react-flow__background-pattern","dots",t])})}var wr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(wr||(wr={}));const w6={[wr.Dots]:1,[wr.Lines]:1,[wr.Cross]:6},b6=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function HN({id:e,variant:t=wr.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:i,bgColor:l,style:c,className:d,patternClassName:f}){const u=p.useRef(null),{transform:h,patternId:m}=_e(b6,st),w=r||w6[t],v=t===wr.Dots,b=t===wr.Cross,x=Array.isArray(n)?n:[n,n],y=[x[0]*h[2]||1,x[1]*h[2]||1],g=w*h[2],N=Array.isArray(o)?o:[o,o],j=b?[g,g]:y,k=[N[0]*h[2]||1+j[0]/2,N[1]*h[2]||1+j[1]/2],S=`${m}${e||""}`;return a.jsxs("svg",{className:xt(["react-flow__background",d]),style:{...c,...Td,"--xy-background-color-props":l,"--xy-background-pattern-color-props":i},ref:u,"data-testid":"rf__background",children:[a.jsx("pattern",{id:S,x:h[0]%y[0],y:h[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:v?a.jsx(v6,{radius:g/2,className:f}):a.jsx(y6,{dimensions:j,lineWidth:s,variant:t,className:f})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${S})`})]})}HN.displayName="Background";const N6=p.memo(HN);function j6(){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 k6(){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 S6(){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 C6(){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 E6(){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 Tl({children:e,className:t,...n}){return a.jsx("button",{type:"button",className:xt(["react-flow__controls-button",t]),...n,children:e})}const M6=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function YN({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:i,onFitView:l,onInteractiveChange:c,className:d,children:f,position:u="bottom-left",orientation:h="vertical","aria-label":m}){const w=Ke(),{isInteractive:v,minZoomReached:b,maxZoomReached:x,ariaLabelConfig:y}=_e(M6,st),{zoomIn:g,zoomOut:N,fitView:j}=Jm(),k=()=>{g(),o==null||o()},S=()=>{N(),i==null||i()},M=()=>{j(s),l==null||l()},R=()=>{w.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),c==null||c(!v)},z=h==="horizontal"?"horizontal":"vertical";return a.jsxs(Dd,{className:xt(["react-flow__controls",z,d]),position:u,style:e,"data-testid":"rf__controls","aria-label":m??y["controls.ariaLabel"],children:[t&&a.jsxs(a.Fragment,{children:[a.jsx(Tl,{onClick:k,className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:x,children:a.jsx(j6,{})}),a.jsx(Tl,{onClick:S,className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:b,children:a.jsx(k6,{})})]}),n&&a.jsx(Tl,{className:"react-flow__controls-fitview",onClick:M,title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:a.jsx(S6,{})}),r&&a.jsx(Tl,{className:"react-flow__controls-interactive",onClick:R,title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:v?a.jsx(E6,{}):a.jsx(C6,{})}),f]})}YN.displayName="Controls";const _6=p.memo(YN);function P6({id:e,x:t,y:n,width:r,height:s,style:o,color:i,strokeColor:l,strokeWidth:c,className:d,borderRadius:f,shapeRendering:u,selected:h,onClick:m}){const{background:w,backgroundColor:v}=o||{},b=i||w||v;return a.jsx("rect",{className:xt(["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?x=>m(x,e):void 0})}const D6=p.memo(P6),T6=e=>e.nodes.map(t=>t.id),Fu=e=>e instanceof Function?e:()=>e;function O6({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=D6,onClick:i}){const l=_e(T6,st),c=Fu(t),d=Fu(e),f=Fu(n),u=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(h=>a.jsx(R6,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:f,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:i,shapeRendering:u},h))})}function A6({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:i,NodeComponent:l,onClick:c}){const{node:d,x:f,y:u,width:h,height:m}=_e(w=>{const{internals:v}=w.nodeLookup.get(e),b=v.userNode,{x,y}=v.positionAbsolute,{width:g,height:N}=_r(b);return{node:b,x,y,width:g,height:N}},st);return!d||d.hidden||!U1(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:o,shapeRendering:i,onClick:c,id:d.id})}const R6=p.memo(A6);var I6=p.memo(O6);const z6=200,$6=150,L6=e=>!e.hidden,F6=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?W1(Gi(e.nodeLookup,{filter:L6}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},B6="react-flow__minimap-desc";function XN({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:i,nodeComponent:l,bgColor:c,maskColor:d,maskStrokeColor:f,maskStrokeWidth:u,position:h="bottom-right",onClick:m,onNodeClick:w,pannable:v=!1,zoomable:b=!1,ariaLabel:x,inversePan:y,zoomStep:g=1,offsetScale:N=5}){const j=Ke(),k=p.useRef(null),{boundingRect:S,viewBB:M,rfId:R,panZoom:z,translateExtent:A,flowWidth:O,flowHeight:L,ariaLabelConfig:E}=_e(F6,st),$=(e==null?void 0:e.width)??z6,D=(e==null?void 0:e.height)??$6,P=S.width/$,C=S.height/D,_=Math.max(P,C),I=_*$,B=_*D,T=N*_,F=S.x-(I-S.width)/2-T,H=S.y-(B-S.height)/2-T,X=I+T*2,J=B+T*2,ee=`${B6}-${R}`,K=p.useRef(0),ne=p.useRef();K.current=_,p.useEffect(()=>{if(k.current&&z)return ne.current=WR({domNode:k.current,panZoom:z,getTransform:()=>j.getState().transform,getViewScale:()=>K.current}),()=>{var Z;(Z=ne.current)==null||Z.destroy()}},[z]),p.useEffect(()=>{var Z;(Z=ne.current)==null||Z.update({translateExtent:A,width:O,height:L,inversePan:y,pannable:v,zoomStep:g,zoomable:b})},[v,b,y,g,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=j.getState().nodeLookup.get(ae).internals.userNode;w(Z,fe)},[]):void 0,Q=x??E["minimap.ariaLabel"];return a.jsx(Dd,{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 i=="number"?i:void 0},className:xt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:$,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(I6,{onClick:W,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:i,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
|
|
410
|
-
M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}XN.displayName="MiniMap";const W6=p.memo(XN),U6=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,V6={[eo.Line]:"right",[eo.Handle]:"bottom-right"};function H6({nodeId:e,position:t,variant:n=eo.Handle,className:r,style:s=void 0,children:o,color:i,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:v,onResize:b,onResizeEnd:x}){const y=SN(),g=typeof e=="string"?e:y,N=Ke(),j=p.useRef(null),k=n===eo.Handle,S=_e(p.useCallback(U6(k&&m),[k,m]),st),M=p.useRef(null),R=t??V6[n];p.useEffect(()=>{if(!(!j.current||!g))return M.current||(M.current=sI({domNode:j.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:A,transform:O,snapGrid:L,snapToGrid:E,nodeOrigin:$,domNode:D}=N.getState();return{nodeLookup:A,transform:O,snapGrid:L,snapToGrid:E,nodeOrigin:$,paneDomNode:D}},onChange:(A,O)=>{const{triggerNodeChanges:L,nodeLookup:E,parentLookup:$,nodeOrigin:D}=N.getState(),P=[],C={x:A.x,y:A.y},_=E.get(g);if(_&&_.expandParent&&_.parentId){const I=_.origin??D,B=A.width??_.measured.width??0,T=A.height??_.measured.height??0,F={id:_.id,parentId:_.parentId,rect:{width:B,height:T,...V1({x:A.x??_.position.x,y:A.y??_.position.y},{width:B,height:T},_.parentId,E,I)}},H=Zm([F],E,$,D);P.push(...H),C.x=A.x?Math.max(I[0]*B,A.x):void 0,C.y=A.y?Math.max(I[1]*T,A.y):void 0}if(C.x!==void 0&&C.y!==void 0){const I={id:g,type:"position",position:{...C}};P.push(I)}if(A.width!==void 0&&A.height!==void 0){const B={id:g,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:A.width,height:A.height}};P.push(B)}for(const I of O){const B={...I,type:"position"};P.push(B)}L(P)},onEnd:({width:A,height:O})=>{const L={id:g,type:"dimensions",resizing:!1,dimensions:{width:A,height:O}};N.getState().triggerNodeChanges([L])}})),M.current.update({controlPosition:R,boundaries:{minWidth:l,minHeight:c,maxWidth:d,maxHeight:f},keepAspectRatio:u,resizeDirection:h,onResizeStart:v,onResize:b,onResizeEnd:x,shouldResize:w}),()=>{var A;(A=M.current)==null||A.destroy()}},[R,l,c,d,f,u,v,b,x,w]);const z=R.split("-");return a.jsx("div",{className:xt(["react-flow__resize-control","nodrag",...z,n,r]),ref:j,style:{...s,scale:S,...i&&{[k?"backgroundColor":"borderColor"]:i}},children:o})}p.memo(H6);var Y6=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"}),X6="VisuallyHidden",qN=p.forwardRef((e,t)=>a.jsx(Be.span,{...e,ref:t,style:{...Y6,...e.style}}));qN.displayName=X6;var q6=qN,[Ad]=$i("Tooltip",[vd]),Rd=vd(),GN="TooltipProvider",G6=700,mh="tooltip.open",[K6,tp]=Ad(GN),KN=e=>{const{__scopeTooltip:t,delayDuration:n=G6,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:o}=e,i=p.useRef(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),a.jsx(K6,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:o})};KN.displayName=GN;var _i="Tooltip",[Q6,Id]=Ad(_i),QN=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:o,disableHoverableContent:i,delayDuration:l}=e,c=tp(_i,e.__scopeTooltip),d=Rd(t),[f,u]=p.useState(null),h=On(),m=p.useRef(0),w=i??c.disableHoverableContent,v=l??c.delayDuration,b=p.useRef(!1),[x,y]=ld({prop:r,defaultProp:s??!1,onChange:S=>{S?(c.onOpen(),document.dispatchEvent(new CustomEvent(mh))):c.onClose(),o==null||o(S)},caller:_i}),g=p.useMemo(()=>x?b.current?"delayed-open":"instant-open":"closed",[x]),N=p.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b.current=!1,y(!0)},[y]),j=p.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),k=p.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{b.current=!0,y(!0),m.current=0},v)},[v,y]);return p.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),a.jsx(Wb,{...d,children:a.jsx(Q6,{scope:t,contentId:h,open:x,stateAttribute:g,trigger:f,onTriggerChange:u,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?k():N()},[c.isOpenDelayedRef,k,N]),onTriggerLeave:p.useCallback(()=>{w?j():(window.clearTimeout(m.current),m.current=0)},[j,w]),onOpen:N,onClose:j,disableHoverableContent:w,children:n})})};QN.displayName=_i;var ph="TooltipTrigger",ZN=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Id(ph,n),o=tp(ph,n),i=Rd(n),l=p.useRef(null),c=Wt(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,...i,children:a.jsx(Be.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:lt(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:lt(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:lt(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:lt(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:lt(e.onBlur,s.onClose),onClick:lt(e.onClick,s.onClose)})})});ZN.displayName=ph;var Z6="TooltipPortal",[D$,J6]=Ad(Z6,{forceMount:void 0}),no="TooltipContent",JN=p.forwardRef((e,t)=>{const n=J6(no,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...o}=e,i=Id(no,e.__scopeTooltip);return a.jsx(gs,{present:r||i.open,children:i.disableHoverableContent?a.jsx(ej,{side:s,...o,ref:t}):a.jsx(e$,{side:s,...o,ref:t})})}),e$=p.forwardRef((e,t)=>{const n=Id(no,e.__scopeTooltip),r=tp(no,e.__scopeTooltip),s=p.useRef(null),o=Wt(t,s),[i,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,v)=>{const b=w.currentTarget,x={x:w.clientX,y:w.clientY},y=a$(x,b.getBoundingClientRect()),g=o$(x,y),N=i$(v.getBoundingClientRect()),j=c$([...g,...N]);l(j),u(!0)},[u]);return p.useEffect(()=>()=>h(),[h]),p.useEffect(()=>{if(c&&f){const w=b=>m(b,f),v=b=>m(b,c);return c.addEventListener("pointerleave",w),f.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",w),f.removeEventListener("pointerleave",v)}}},[c,f,m,h]),p.useEffect(()=>{if(i){const w=v=>{const b=v.target,x={x:v.clientX,y:v.clientY},y=(c==null?void 0:c.contains(b))||(f==null?void 0:f.contains(b)),g=!l$(x,i);y?h():g&&(h(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[c,f,i,d,h]),a.jsx(ej,{...e,ref:o})}),[t$,n$]=Ad(_i,{isInside:!1}),r$=vE("TooltipContent"),ej=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...l}=e,c=Id(no,n),d=Rd(n),{onClose:f}=c;return p.useEffect(()=>(document.addEventListener(mh,f),()=>document.removeEventListener(mh,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(dd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:u=>u.preventDefault(),onDismiss:f,children:a.jsxs(Ub,{"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(r$,{children:r}),a.jsx(t$,{scope:n,isInside:!0,children:a.jsx(q6,{id:c.contentId,role:"tooltip",children:s||r})})]})})});JN.displayName=no;var tj="TooltipArrow",s$=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Rd(n);return n$(tj,n).isInside?null:a.jsx(Vb,{...s,...r,ref:t})});s$.displayName=tj;function a$(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,s,o)){case o:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function o$(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 i$(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 l$(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const l=t[o],c=t[i],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 c$(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),d$(t)}function d$(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 o=t[t.length-1],i=t[t.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.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 o=n[n.length-1],i=n[n.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.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 u$=KN,f$=QN,h$=ZN,nj=JN;const Bu=u$,Wu=f$,Uu=h$,ec=p.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(nj,{ref:r,sideOffset:t,className:ve("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}));ec.displayName=nj.displayName;const m$=420,p$=({data:e,targetPosition:t,sourcePosition:n})=>{const r=e,s="!h-1.5 !w-1.5 !min-w-0 !min-h-0 !cursor-grab !border-0 opacity-100",o="h-[22px]";return a.jsx(a.Fragment,{children:r.isForeign?a.jsxs("header",{className:"text-[0.55rem] px-2 py-1 border-[0.5px] border-gray-300 dark:border-gray-600 bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white flex gap-1 items-center",id:`${r.name}-foreign-key`,children:[a.jsx("span",{className:"text-gray-900 dark:text-white font-medium",children:r.name}),t&&a.jsx(Is,{type:"target",id:r.name,position:t,className:ve(s)})]}):a.jsxs("div",{className:ve("border border-gray-200 dark:border-gray-700 overflow-hidden shadow-lg bg-white dark:bg-gray-900 rounded-none"),style:{width:m$/2},id:`${r.name}-table-node`,children:[a.jsx("header",{className:ve("text-[0.55rem] pl-3 pr-2 bg-black text-white flex items-center justify-between border-b border-gray-300",o),children:a.jsxs("div",{className:"flex items-center gap-x-1",children:[a.jsx(ZC,{strokeWidth:1,size:12,className:"text-white"}),a.jsx("span",{className:"text-white font-medium",children:r.name})]})}),r.columns.map(i=>a.jsxs("div",{className:ve("text-[8px] leading-5 relative flex flex-row justify-items-start","bg-white dark:bg-gray-900","border-t","border-t-gray-200 dark:border-t-gray-700","hover:bg-gray-50 dark:hover:bg-gray-800 transition cursor-default",o),children:[a.jsxs("div",{className:ve("gap-[0.24rem] flex ml-2 align-middle items-center justify-start"),children:[i.isPrimary&&a.jsx(Bu,{delayDuration:10,children:a.jsxs(Wu,{children:[a.jsx(Uu,{asChild:!0,children:a.jsx(Uf,{size:8,strokeWidth:1,className:ve("flex-shrink-0","text-yellow-400 mr-2")})}),a.jsx(ec,{className:"pointer-events-none",sideOffset:0,children:"primary key"})]})}),i.isUnique&&a.jsx(Bu,{delayDuration:10,children:a.jsxs(Wu,{children:[a.jsx(Uu,{asChild:!0,children:a.jsx(YC,{size:8,strokeWidth:1,className:"flex-shrink-0 mr-2 text-green-400"})}),a.jsx(ec,{className:"pointer-events-none ",sideOffset:0,children:"unique"})]})}),i.isIdentity&&a.jsx(XC,{size:8,strokeWidth:1,className:"flex-shrink-0 text-blue-400"}),!i.isIdentity&&!i.isUnique&&!i.isPrimary&&a.jsx("div",{className:" size-4"})]}),a.jsxs("div",{className:"flex justify-between w-full",children:[a.jsxs("div",{className:"relative flex justify-center whitespace-nowrap",children:[i.isNullable?"":a.jsx(Bu,{delayDuration:10,children:a.jsxs(Wu,{children:[a.jsx(Uu,{asChild:!0,children:a.jsx("span",{className:"text-muted-foreground absolute left-[-6px] top-[1px]",children:"*"})}),a.jsx(ec,{className:"pointer-events-none scale-70",sideOffset:-5,children:"required"})]})})," ",a.jsx("div",{className:"max-w-[100px] w-fit text-ellipsis overflow-hidden text-gray-900 dark:text-white",children:i.name}),a.jsx("span",{className:"font-mono text-gray-500 dark:text-gray-400 text-[0.35rem] pl-1 mt-[1px]",children:i.format})]}),a.jsx("span",{className:"px-2 inline-flex justify-end text-gray-400 dark:text-gray-500 text-[0.4rem] mt-[1px]",children:i.plugin})]}),a.jsx(Is,{type:"target",id:i.id,position:t||"left",className:ve(s,"!left-[-6px] !top-1/2 !transform !-translate-y-1/2"),style:{background:"#000000",border:"1px solid #ffffff",left:"-6px",top:"50%",transform:"translateY(-50%)",boxShadow:"0 0 0 2px rgba(0, 0, 0, 0.1)"}}),a.jsx(Is,{type:"source",id:i.id,position:n||"right",className:ve(s,"!right-[-6px] !top-1/2 !transform !-translate-y-1/2"),style:{background:"#000000",border:"1px solid #ffffff",right:"-6px",top:"50%",transform:"translateY(-50%)",boxShadow:"0 0 0 2px rgba(0, 0, 0, 0.1)"}})]},i.id))]})})};function x$(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var zd="Checkbox",[g$]=$i(zd),[y$,np]=g$(zd);function v$(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:o,form:i,name:l,onCheckedChange:c,required:d,value:f="on",internal_do_not_use_render:u}=e,[h,m]=ld({prop:n,defaultProp:s??!1,onChange:c,caller:zd}),[w,v]=p.useState(null),[b,x]=p.useState(null),y=p.useRef(!1),g=w?!!i||!!w.closest("form"):!0,N={checked:h,disabled:o,setChecked:m,control:w,setControl:v,name:l,form:i,value:f,hasConsumerStoppedPropagationRef:y,required:d,defaultChecked:as(s)?!1:s,isFormControl:g,bubbleInput:b,setBubbleInput:x};return a.jsx(y$,{scope:t,...N,children:w$(u)?u(N):r})}var rj="CheckboxTrigger",sj=p.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:o,value:i,disabled:l,checked:c,required:d,setControl:f,setChecked:u,hasConsumerStoppedPropagationRef:h,isFormControl:m,bubbleInput:w}=np(rj,e),v=Wt(s,f),b=p.useRef(c);return p.useEffect(()=>{const x=o==null?void 0:o.form;if(x){const y=()=>u(b.current);return x.addEventListener("reset",y),()=>x.removeEventListener("reset",y)}},[o,u]),a.jsx(Be.button,{type:"button",role:"checkbox","aria-checked":as(c)?"mixed":c,"aria-required":d,"data-state":cj(c),"data-disabled":l?"":void 0,disabled:l,value:i,...r,ref:v,onKeyDown:lt(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:lt(n,x=>{u(y=>as(y)?!0:!y),w&&m&&(h.current=x.isPropagationStopped(),h.current||x.stopPropagation())})})});sj.displayName=rj;var rp=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:o,required:i,disabled:l,value:c,onCheckedChange:d,form:f,...u}=e;return a.jsx(v$,{__scopeCheckbox:n,checked:s,defaultChecked:o,disabled:l,required:i,onCheckedChange:d,name:r,form:f,value:c,internal_do_not_use_render:({isFormControl:h})=>a.jsxs(a.Fragment,{children:[a.jsx(sj,{...u,ref:t,__scopeCheckbox:n}),h&&a.jsx(lj,{__scopeCheckbox:n})]})})});rp.displayName=zd;var aj="CheckboxIndicator",oj=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,o=np(aj,n);return a.jsx(gs,{present:r||as(o.checked)||o.checked===!0,children:a.jsx(Be.span,{"data-state":cj(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});oj.displayName=aj;var ij="CheckboxBubbleInput",lj=p.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:i,required:l,disabled:c,name:d,value:f,form:u,bubbleInput:h,setBubbleInput:m}=np(ij,e),w=Wt(n,m),v=x$(o),b=Tb(r);p.useEffect(()=>{const y=h;if(!y)return;const g=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(g,"checked").set,k=!s.current;if(v!==o&&j){const S=new Event("click",{bubbles:k});y.indeterminate=as(o),j.call(y,as(o)?!1:o),y.dispatchEvent(S)}},[h,v,o,s]);const x=p.useRef(as(o)?!1:o);return a.jsx(Be.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.current,required:l,disabled:c,name:d,value:f,form:u,...t,tabIndex:-1,ref:w,style:{...t.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});lj.displayName=ij;function w$(e){return typeof e=="function"}function as(e){return e==="indeterminate"}function cj(e){return as(e)?"indeterminate":e?"checked":"unchecked"}const dj=p.forwardRef(({className:e,...t},n)=>a.jsx(rp,{ref:n,className:ve("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:a.jsx(oj,{className:ve("flex items-center justify-center text-current"),children:a.jsx(Qv,{className:"h-4 w-4"})})}));dj.displayName=rp.displayName;const b$={tableNode:p$},k0=[{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 N$(){const[e,t]=p.useState(null),[n,r]=p.useState(!0),[s,o]=p.useState(null),[i,l]=p.useState([]),[c,d]=p.useState([]),[f,u]=p.useState(!0),[h,m,w]=x6([]),[v,b,x]=g6([]),y=S=>{const M=k0.find(R=>R.name===S);return(M==null?void 0:M.color)||"bg-gray-500"},g=p.useCallback(async()=>{try{const M=await(await fetch("/api/plugins")).json();if(M.plugins&&Array.isArray(M.plugins)){const R=M.plugins.map(z=>({name:z.id,displayName:z.name||z.id,description:z.description||`${z.id} plugin for Better Auth`,color:y(z.id)}));d(R),l(R.map(z=>z.name))}}catch{d(k0),l(["organization"])}},[y]),N=p.useCallback(async S=>{try{r(!0);const M=S.length>0?`?plugins=${S.join(",")}`:"",z=await(await fetch(`/api/database/schema${M}`)).json();z.success?t(z.schema):o(z.error||"Failed to fetch schema")}catch{o("Failed to fetch database schema")}finally{r(!1)}},[]);p.useEffect(()=>{g()},[g]),p.useEffect(()=>{i.length>0&&N(i)},[i,N]),p.useEffect(()=>{if(!e)return;const S=[],M=[];e.tables.forEach((z,A)=>{const O=z.fields.map(L=>({id:`${z.name}-${L.name}`,isPrimary:L.primaryKey||!1,isNullable:!L.required,isUnique:L.unique||!1,isIdentity:!1,name:L.name,format:L.type,plugin:R(z.name,L.name,i)}));S.push({id:z.name,type:"tableNode",position:{x:A%4*350,y:Math.floor(A/4)*300},data:{name:z.name,isForeign:!1,columns:O}})});const R=(z,A,O)=>{if(z==="user"||z==="session"||z==="account"||z==="verification")return"core";for(const L of O)if(z===L||z.includes(L))return L;return"core"};e.tables.forEach(z=>{z.relationships.forEach(A=>{if(A.type==="many-to-one")return;const O=z.name,L=A.target,E=S.find(D=>D.id===O),$=S.find(D=>D.id===L);if(E&&$){const D=A.type==="one-to-one"?"1:1":"1:N";M.push({id:`${O}-${L}-${A.field}`,source:O,target:L,type:"smoothstep",animated:!1,style:{stroke:"#ffffff",strokeWidth:1.5,strokeDasharray:"0"},label:D,labelStyle:{fontSize:"11px",fill:"#6b7280",fontWeight:"500"},labelBgStyle:{fill:"rgba(255, 255, 255, 0.95)",fillOpacity:1,rx:4,ry:4},markerEnd:{type:"arrowclosed",color:"#ffffff",width:12,height:12}})}})}),m(S),b(M)},[e,i,m,b]);const j=p.useCallback(S=>b(M=>Q1(S,M)),[b]),k=(S,M)=>{l(M?R=>[...R,S]:R=>R.filter(z=>z!==S))};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.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(qe,{className:"w-8 h-8 text-white"}),a.jsx("h1",{className:"text-2xl font-normal text-white",children:"Schema Visualizer"})]}),a.jsx("div",{className:"flex items-center space-x-4",children:a.jsxs(U,{variant:"outline",size:"sm",onClick:()=>u(!f),className:"flex items-center space-x-2 rounded-none border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-black",children:[f?a.jsx(HC,{className:"w-4 h-4"}):a.jsx(zi,{className:"w-4 h-4"}),a.jsx("span",{children:"Plugin Labels"})]})})]}),a.jsx("p",{className:"text-gray-600 dark: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-white dark:bg-black border-gray-200 dark:border-gray-700 h-fit shadow-sm",children:[a.jsx(hn,{children:a.jsxs(mn,{className:"text-gray-900 dark:text-white flex items-center space-x-2",children:[a.jsx(Ts,{className:"w-5 h-5"}),a.jsx("span",{children:"Plugins"})]})}),a.jsx(Ct,{className:"space-y-3",children:c.length>0?c.map(S=>a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(dj,{id:S.name,checked:i.includes(S.name),onCheckedChange:M=>k(S.name,M)}),a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{htmlFor:S.name,className:"text-sm font-medium text-gray-900 dark:text-white cursor-pointer",children:S.displayName}),a.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:S.description})]}),a.jsx("div",{className:`w-3 h-3 rounded-full ${S.color}`})]},S.name)):a.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"No plugins detected in configuration"})})]}),e&&a.jsxs(St,{className:"rounded-none bg-white dark:bg-black border-gray-200 dark:border-gray-700 mt-4 shadow-sm",children:[a.jsx(hn,{children:a.jsx(mn,{className:"text-gray-900 dark: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-gray-600 dark:text-gray-400",children:"Tables:"}),a.jsx("span",{className:"text-gray-900 dark:text-white",children:e.tables.length})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Relationships:"}),a.jsx("span",{className:"text-gray-900 dark:text-white",children:e.tables.reduce((S,M)=>S+M.relationships.length,0)})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Available Plugins:"}),a.jsx("span",{className:"text-gray-900 dark:text-white",children:c.length})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Selected Plugins:"}),a.jsx("span",{className:"text-gray-900 dark:text-white",children:i.length})]})]})]})]}),a.jsx("div",{className:"col-span-3",children:a.jsx("div",{className:"h-full bg-black border border-white/20 rounded-none overflow-hidden shadow-sm",children:a.jsxs(p6,{nodes:h,edges:v,onNodesChange:w,onEdgesChange:x,onConnect:j,nodeTypes:b$,fitView:!0,fitViewOptions:{padding:.1,includeHiddenNodes:!1},className:"bg-black",connectionLineType:"smoothstep",defaultEdgeOptions:{style:{stroke:"#ffffff",strokeWidth:1.5},animated:!1,type:"smoothstep"},nodesDraggable:!0,nodesConnectable:!1,elementsSelectable:!0,children:[a.jsx(_6,{className:"bg-black border-white/20"}),a.jsx(W6,{className:"bg-black border-white/20",nodeColor:S=>{var M;return(M=S.data)!=null&&M.isForeign,"#ffffff"},maskColor:"rgba(0, 0, 0, 0.8)"}),a.jsx(N6,{variant:wr.Dots,gap:20,size:1,color:"#ffffff"})]})})})]})]})}function j$(){const{orgId:e}=mm(),t=Js(),[n,r]=p.useState(null),[s,o]=p.useState([]),[i,l]=p.useState([]),[c,d]=p.useState([]),[f,u]=p.useState(!0),[h,m]=p.useState("details"),[w,v]=p.useState(!1),[b,x]=p.useState(!1),[y,g]=p.useState(!1),[N,j]=p.useState(!1),[k,S]=p.useState(!1),[M,R]=p.useState(!1),[z,A]=p.useState(!1),[O,L]=p.useState(!1),[E,$]=p.useState(null),[D,P]=p.useState(""),[C,_]=p.useState(""),[I,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(),ct(),Xe())},[e]),p.useEffect(()=>{w&&e&&Xe()},[]),p.useEffect(()=>{h==="members"&&e&&ct()},[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();v(le.enabled)}catch(G){console.error("Failed to check teams status:",G),v(!1)}},Se=async()=>{try{const le=await(await fetch("/api/plugins/organization/status")).json();x(le.enabled)}catch(G){console.error("Failed to check organization status:",G),x(!1)}},Xe=async()=>{try{const le=await(await fetch(`/api/organizations/${e}/teams`)).json();le.success&&o(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")}},ct=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 dt=ge.results.filter(ce=>ce.success).length;ee(ce=>[...ce,{id:"complete",type:"success",message:`✅ Seeding completed! Added ${dt}/${G} members successfully`,timestamp:new Date}]),await ct(),q.success(`Successfully added ${dt} 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 dt=ge.results.filter(ce=>ce.success).length;W(ce=>[...ce,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${dt}/${G} teams successfully`,timestamp:new Date}]),await Xe(),q.success(`Successfully created ${dt} 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)}},gt=()=>{Qe(),g(!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(),g(!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})}},ie=async(G,le)=>{const ge=q.loading("Resending invitation...");try{const dt=await(await fetch(`/api/invitations/${G}/resend`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();dt.success?(await Pe(),q.success(`Invitation resent to ${le}!`,{id:ge})):q.error(`Error resending invitation: ${dt.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 dt=await(await fetch(`/api/members/${G}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();dt.success?(await ct(),q.success(`${le} removed from organization!`,{id:ge})):q.error(`Error removing member: ${dt.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(),R(!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),$(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),$(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=>{$(G),F({name:G.name}),A(!0)},Ie=G=>{$(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(Pa,{to:"/organizations",children:a.jsxs(U,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(hi,{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:()=>j(!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:gt,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(Ws,{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(ot,{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(ot,{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+i.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"}),i.length>0&&a.jsx(je,{variant:"secondary",className:"text-xs bg-white/10 border border-white/20 rounded-sm",children:i.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:i.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(Cc,{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(qe,{className:"w-4 h-4 mr-2"}),"Seed Teams"]}),a.jsxs(U,{onClick:()=>R(!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(Ws,{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(Os,{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:()=>R(!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(Os,{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:()=>j(!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:gt,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 (",i.length,")"]}),a.jsx("p",{className:"text-gray-400 mt-1",children:"Manage pending invitations to this organization"})]})}),i.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"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:i.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(ft,{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:()=>ie(G.id,G.email),children:[a.jsx(Tx,{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(Os,{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:gt,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"]})]})})]}),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:"Invite User"}),a.jsx(U,{variant:"ghost",size:"sm",onClick:()=>{g(!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(mi,{placeholder:"Select an inviter..."})}),a.jsx(ss,{children:I.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:()=>{g(!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(Tx,{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:()=>{R(!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:()=>{R(!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"})]})]})}),z&&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"})]})]})}),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 Members"}),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-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(Va,{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:()=>j(!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(ot,{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(ot,{className:"w-3 h-3 mr-2"}),"Seed Teams"]})})]})]}),me.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(Va,{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(Pa,{to:"/organizations",children:a.jsxs(U,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(hi,{className:"w-4 h-4 mr-2"}),"Back to Organizations"]})})}),a.jsx("br",{}),a.jsxs("div",{className:"text-center py-12",children:[a.jsx(ot,{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 k$(){const[e,t]=p.useState([]),[n,r]=p.useState(!0),[s,o]=p.useState(""),[i,l]=p.useState("all"),[c,d]=p.useState(!1),[f,u]=p.useState(!1),[h,m]=p.useState(!1),[w,v]=p.useState(!1),[b,x]=p.useState(!1),[y,g]=p.useState(null),[N,j]=p.useState([]),[k,S]=p.useState(!1),M=async()=>{try{const _=await(await fetch("/api/sessions")).json();t(_.sessions||[])}catch{}finally{r(!1)}};p.useEffect(()=>{M()},[M]);const R=async C=>{j([]),S(!0),j([{id:"start",type:"info",message:`Starting session seeding process for ${C} sessions...`,timestamp:new Date}]);try{const I=await(await fetch("/api/seed/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:C})})).json();if(I.success){const B=I.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});j(F=>[...F,...B]);const T=I.results.filter(F=>F.success).length;j(F=>[...F,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${T}/${C} sessions successfully`,timestamp:new Date}]),await M()}else j(B=>[...B,{id:"error",type:"error",message:`❌ Seeding failed: ${I.error||"Unknown error"}`,timestamp:new Date}])}catch(_){j(I=>[...I,{id:"error",type:"error",message:`❌ Network error: ${_}`,timestamp:new Date}])}finally{S(!1)}},z=async C=>{j([]),S(!0),j([{id:"start",type:"info",message:`Starting account seeding process for ${C} accounts...`,timestamp:new Date}]);try{const I=await(await fetch("/api/seed/accounts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:C})})).json();if(I.success){const B=I.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});j(F=>[...F,...B]);const T=I.results.filter(F=>F.success).length;j(F=>[...F,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${T}/${C} accounts successfully`,timestamp:new Date}]),await M()}else j(B=>[...B,{id:"error",type:"error",message:`❌ Seeding failed: ${I.error||"Unknown error"}`,timestamp:new Date}])}catch(_){j(I=>[...I,{id:"error",type:"error",message:`❌ Network error: ${_}`,timestamp:new Date}])}finally{S(!1)}},A=C=>{g(C),v(!0)},O=C=>{g(C),u(!0)},L=C=>{g(C),m(!0)},E=async C=>{d(!1)},$=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()),I=i==="all"||i==="active"&&new Date(C.expiresAt)>new Date||i==="expired"&&new Date(C.expiresAt)<=new Date;return _&&I});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:()=>x(!0),children:[a.jsx(qe,{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(ls,{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=>o(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(pm,{className:"w-4 h-4 text-gray-400"}),a.jsxs(ns,{value:i,onValueChange:l,children:[a.jsx(rs,{children:a.jsx(mi,{})}),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(qe,{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(zi,{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(Ws,{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(Os,{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:()=>x(!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(qe,{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);R(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(qe,{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(Ho,{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);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(Ho,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]})]}),N.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(Va,{title:"Session Seeding Terminal",lines:N,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:()=>x(!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&&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:"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(qe,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:y.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:y.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(y.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:()=>$(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),h&&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:"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(qe,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:y.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&&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:"Session Details"}),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("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(qe,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:y.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:y.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:y.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(y.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(y.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(y.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(y.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(U,{onClick:()=>v(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function S$(e){const t=p.useRef(null),n=p.useRef(null),r=p.useRef(0),s=5;p.useEffect(()=>{const o=()=>{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(()=>{o()},d)}},t.current.onerror=c=>{}}catch{}};return o(),()=>{t.current&&t.current.close(),n.current&&clearTimeout(n.current)}},[e])}function C$(){var y,g,N,j,k,S,M,R,z,A,O,L,E,$,D,P,C,_,I,B,T,F,H,X,J,ee,K,ne,me;const[e,t]=p.useState(null),[n,r]=p.useState(null),[s,o]=p.useState(null),[i,l]=p.useState(null),[c,d]=p.useState(!0),[f,u]=p.useState(null);S$(W=>{W.type==="config_changed"?setTimeout(()=>{h(),m(),w(),v()},500):W.type});const h=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=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"})}},w=async()=>{try{const Q=await(await fetch("/api/plugins")).json();o(Q)}catch{o({plugins:[],configPath:null,totalPlugins:0,error:"Failed to fetch plugins"})}},v=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(ft,{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(ft,{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(wo,{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(),v()},[h,v,w,m]);const x=W=>{switch(W.toLowerCase()){case"google":return a.jsx(bs,{className:"w-5 h-5 text-white"});case"github":return a.jsx(ir,{className:"w-5 h-5 text-white"});case"discord":return a.jsx(bs,{className:"w-5 h-5 text-white"});case"twitter":return a.jsx(bs,{className:"w-5 h-5 text-white"});default:return a.jsx(bs,{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(Ts,{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(bs,{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(Uf,{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(fu,{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(ir,{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(qe,{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(qe,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(i==null?void 0:i.displayName)||((y=e==null?void 0:e.database)==null?void 0:y.type)&&((g=e==null?void 0:e.database)==null?void 0:g.type.charAt(0).toUpperCase())+((N=e==null?void 0:e.database)==null?void 0:N.type.slice(1))||"Unknown"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Database Type"})]})]}),((i==null?void 0:i.name)||((j=e==null?void 0:e.database)==null?void 0:j.type))&&b((i==null?void 0:i.name)||((k=e==null?void 0:e.database)==null?void 0:k.type)||"")]}),((i==null?void 0:i.dialect)||((S=e==null?void 0:e.database)==null?void 0:S.dialect))&&(i==null?void 0:i.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(qe,{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:(i==null?void 0:i.dialect)||((M=e==null?void 0:e.database)==null?void 0:M.dialect)})})]}),((R=e==null?void 0:e.database)==null?void 0:R.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(Uf,{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(ft,{className:"w-3 h-3"}),"Configured"]})]}),((z=e==null?void 0:e.database)==null?void 0:z.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(Ts,{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(Dx,{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(ft,{className:"w-3 h-3"}),"Disabled"]})})]}),!(i!=null&&i.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:(i==null?void 0:i.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(ir,{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:[x(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(ft,{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(ir,{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(ft,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(ks,{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(ks,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(ft,{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(ir,{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(ft,{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(fu,{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:[(($=e==null?void 0:e.emailAndPassword)==null?void 0:$.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(Hl,{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(ft,{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(Dx,{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(Hl,{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:(I=e==null?void 0:e.session)!=null&&I.disableSessionRefresh?a.jsxs(a.Fragment,{children:[a.jsx(ks,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(ft,{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(qe,{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(ft,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(wo,{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(ir,{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(ir,{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(ft,{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(ir,{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(qe,{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(Ts,{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(fu,{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(ft,{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(ir,{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(ks,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(ft,{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(zi,{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(ks,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(ft,{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(UC,{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(ft,{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(wo,{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(Hl,{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(wo,{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(bs,{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(Px,{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(wo,{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(Px,{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(ft,{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 S0(){var $,D;const{orgId:e,teamId:t}=mm(),[n,r]=p.useState(null),[s,o]=p.useState([]),[i,l]=p.useState(!0),[c,d]=p.useState("details"),[f,u]=p.useState(!1),[h,m]=p.useState(!1),[w,v]=p.useState(""),[b,x]=p.useState([]),[y,g]=p.useState([]),[N,j]=p.useState({name:""}),k=async()=>{try{const C=await(await fetch(`/api/teams/${t}`)).json();C.success&&C.team?(r(C.team),j({name:C.team.name})):C.team?(r(C.team),j({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&&o(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),I=(C.users||[]).filter(B=>!_.includes(B.id));x(I)}catch{q.error("Failed to load users")}};p.useEffect(()=>{t&&(k(),S())},[t,k,S]);const R=async()=>{if(!N.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:N.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})}},z=async()=>{if(y.length===0){q.error("Please select at least one user");return}const P=q.loading(`Adding ${y.length} members...`);try{const _=await(await fetch(`/api/teams/${t}/members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userIds:y})})).json();_.success?(await S(),u(!1),g([]),v(""),q.success(`Successfully added ${y.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=>{g(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 i?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(Pa,{to:`/organizations/${n.organizationId}`,children:a.jsxs(U,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(hi,{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(Ws,{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(Pa,{to:`/organizations/${n.organizationId}`,className:"text-gray-400 hover:text-white text-sm",children:[a.jsx(ot,{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:(($=n.organization)==null?void 0:$.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(Cc,{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(ot,{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(Os,{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),g([]),v("")},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(ls,{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=>v(P.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),y.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:[y.length," user",y.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 ${y.includes(P.id)?"bg-blue-900/20":""}`,onClick:()=>L(P.id),children:[a.jsx("input",{type:"checkbox",checked:y.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),g([]),v("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsxs(U,{onClick:z,disabled:y.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 ",y.length," Member",y.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:N.name,onChange:P=>j({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:R,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(Pa,{to:`/organizations/${e}`,children:a.jsxs(U,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(hi,{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 E$(){const e=Js(),[t,n]=p.useState([]),[r,s]=p.useState(!0),[o,i]=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");i({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 v():s(!1)}catch(j){console.error("Failed to check teams plugin status:",j),i({enabled:!1,error:"Failed to check plugin status"}),s(!1)}},v=async()=>{try{const k=await(await fetch("/api/teams")).json();k.success&&n(k.teams||[])}catch(j){console.error("Failed to fetch teams:",j),q.error("Failed to load teams")}finally{s(!1)}},b=t.filter(j=>{var S;const k=j.name.toLowerCase().includes(l.toLowerCase())||((S=j.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(j.createdAt)>M}return k}),x=u*m,y=x-m,g=b.slice(y,x),N=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"})}):o!=null&&o.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(ls,{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:j=>c(j.target.value),className:"pl-10 bg-black border-dashed border-white/20 text-white placeholder-gray-400 focus:ring-2 focus:ring-white focus:border-transparent"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(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"})]})]}),g.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:g.map(j=>{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/${j.id}`),children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-10 h-10 bg-white/10 rounded-none flex items-center justify-center",children:a.jsx(Oe,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium",children:j.name}),a.jsxs("p",{className:"text-gray-400 text-sm",children:[(k=j.organization)==null?void 0:k.name," • ",j.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"})})]})},j.id)})}),N>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 ",N]}),a.jsx(U,{variant:"outline",size:"sm",onClick:()=>h(Math.min(N,u+1)),disabled:u===N,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(ot,{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==null?void 0: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==null?void 0: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"})]})]})]})})]})}function M$(){const{userId:e}=mm(),t=Js(),[n,r]=p.useState(null),[s,o]=p.useState([]),[i,l]=p.useState([]),[c,d]=p.useState([]),[f,u]=p.useState(!0),[h,m]=p.useState("details"),[w,v]=p.useState(!1),[b,x]=p.useState(!1),[y,g]=p.useState(!1),[N,j]=p.useState(!1),[k,S]=p.useState(""),[M,R]=p.useState(),[z,A]=p.useState(!1),[O,L]=p.useState([]),[E,$]=p.useState(!1),[D,P]=p.useState({}),C=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}},I=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=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)}},F=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();o(ae.memberships||[])}if(Q.ok){const ae=await Q.json();l(ae.memberships||[])}if(Z.ok){const fe=(await Z.json()).sessions||[];d(fe),I(fe)}}catch{}},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}),v(!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(!z){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}),x(!1),S(""),R(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(!z){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}),g(!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?(o(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([]),$(!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{$(!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(hi,{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(Ho,{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:()=>v(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(Ws,{className:"w-4 h-4 mr-2"}),"Edit User"]}),n.banned?a.jsxs(U,{variant:"outline",onClick:()=>g(!0),className:"border border-dashed border-green-400/50 text-green-400 hover:bg-green-400/10 rounded-none",disabled:!z,children:[a.jsx(Hr,{className:"w-4 h-4 mr-2"}),"Unban User"]}):a.jsxs(U,{variant:"outline",onClick:()=>x(!0),className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",disabled:!z,children:[a.jsx(Hr,{className:"w-4 h-4 mr-2"}),"Ban User"]}),!z&&a.jsx("p",{className:"text-xs text-yellow-400 mt-1",children:"Admin plugin required for ban/unban functionality. Please enable the admin plugin in your Better Auth configuration."})]})]})]}),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:Ho},{id:"organizations",name:"Organizations",icon:ot,count:s.length},{id:"teams",name:"Teams",icon:Oe,count:i.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(Cc,{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(Cc,{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(ot,{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(ot,{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(Ox,{className:"w-4 h-4 mr-1"}),"Remove"]})]})},W.id))})}),h==="teams"&&a.jsx("div",{className:"space-y-4",children:i.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:i.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(Ox,{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([]),$(!1),j(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(qe,{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(GC,{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(bs,{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:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:"×"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-black/80 border border-dashed border-white/20 flex items-center justify-center",children:n!=null&&n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):a.jsx(Ho,{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:()=>v(!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=>R(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:()=>{x(!1),S(""),R(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"})]})]})}),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 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:()=>g(!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"})]})]})}),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 Sessions"}),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-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(Va,{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:()=>j(!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(qe,{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 _$(){return a.jsx(eE,{children:a.jsxs(dC,{children:[a.jsx(BM,{children:a.jsxs(rC,{children:[a.jsx(fn,{path:"/",element:a.jsx(CD,{})}),a.jsx(fn,{path:"/users",element:a.jsx(r1,{})}),a.jsx(fn,{path:"/users/:userId",element:a.jsx(M$,{})}),a.jsx(fn,{path:"/organizations",element:a.jsx(Yw,{})}),a.jsx(fn,{path:"/organizations/:orgId",element:a.jsx(j$,{})}),a.jsx(fn,{path:"/teams",element:a.jsx(E$,{})}),a.jsx(fn,{path:"/teams/:teamId",element:a.jsx(S0,{})}),a.jsx(fn,{path:"/organizations/:orgId/teams/:teamId",element:a.jsx(S0,{})}),a.jsx(fn,{path:"/sessions",element:a.jsx(k$,{})}),a.jsx(fn,{path:"/database",element:a.jsx(N$,{})}),a.jsx(fn,{path:"/settings",element:a.jsx(C$,{})})]})}),a.jsx(FC,{theme:"dark",position:"top-right",richColors:!0,closeButton:!0})]})})}Vu.createRoot(document.getElementById("root")).render(a.jsx(Y.StrictMode,{children:a.jsx(_$,{})}));
|